Skip to content

Commit a5e9803

Browse files
committed
Fix to also check for boolean-"is" methods for Help
1 parent be85104 commit a5e9803

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/org/opensolaris/opengrok/configuration/ConfigurationHelp.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,17 @@ private static Project getSampleProject(String name) {
261261
private static Object getDefaultValue(Class<?> klass, Method setter,
262262
Configuration cinst) {
263263

264-
String gname = setter.getName();
265-
gname = gname.replaceFirst("^set", "get");
264+
String gname = setter.getName().replaceFirst("^set", "get");
266265
Method getter;
267266
try {
268267
getter = klass.getDeclaredMethod(gname);
269268
} catch (NoSuchMethodException|SecurityException ex) {
270-
return null;
269+
gname = setter.getName().replaceFirst("^set", "is");
270+
try {
271+
getter = klass.getDeclaredMethod(gname);
272+
} catch (NoSuchMethodException|SecurityException ex2) {
273+
return null;
274+
}
271275
}
272276

273277
try {

0 commit comments

Comments
 (0)