Skip to content

Commit ced8f93

Browse files
committed
restore commented-out code removed from app.Preferences
The old init() signature comment and the block in getBoolean() were dropped as cleanup that does not belong in this change. Put them back as they are on main.
1 parent 0a00a60 commit ced8f93

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎app/src/processing/app/Preferences.java‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
*/
4242
public class Preferences {
4343

44+
// /** @return true if the sketchbook file did not exist */
45+
// static public boolean init() {
4446
static public void init() {
4547
// start by loading the defaults, in case something
4648
// important was deleted from the user prefs
@@ -181,6 +183,19 @@ static public void unset(String attribute) {
181183
static public boolean getBoolean(String attribute) {
182184
String value = get(attribute); //, null);
183185
return Boolean.parseBoolean(value);
186+
187+
/*
188+
supposedly not needed, because anything besides 'true'
189+
(ignoring case) will just be false.. so if malformed -> false
190+
if (value == null) return defaultValue;
191+
192+
try {
193+
return (new Boolean(value)).booleanValue();
194+
} catch (NumberFormatException e) {
195+
System.err.println("expecting an integer: " + attribute + " = " + value);
196+
}
197+
return defaultValue;
198+
*/
184199
}
185200

186201

0 commit comments

Comments
 (0)