Skip to content
This repository was archived by the owner on Nov 15, 2022. It is now read-only.

Commit aa18e79

Browse files
sumauppayaminikb
authored andcommitted
21709 :Added support for boolean get method names (#21835)
1 parent 758a7ff commit aa18e79

File tree

1 file changed

+6
-1
lines changed
  • nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/utils

1 file changed

+6
-1
lines changed

nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/utils/ResourceUtil.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,9 @@ public static MethodMetaData getMethodMetaData(ConfigModel configBeanModel) {
442442
// can't be found via the method above. For example: for
443443
// Ssl.getSSLInactivityTimeout(), we calculate getSslInactivityTimeout,
444444
// which doesn't match due to case.
445+
String booleanMethodName = getAttributeBooleanMethodName(attributeName);
445446
for (Method m : configBeanProxy.getMethods()) {
446-
if (m.getName().equalsIgnoreCase(methodName)) {
447+
if (m.getName().equalsIgnoreCase(methodName) || m.getName().equalsIgnoreCase(booleanMethodName)) {
447448
method = m;
448449
}
449450
}
@@ -804,6 +805,10 @@ public static String getAttributeMethodName(String attributeName) {
804805
return methodNameFromDtdName(attributeName, "get");
805806
}
806807

808+
public static String getAttributeBooleanMethodName(String attributeName) {
809+
return methodNameFromDtdName(attributeName, "is");
810+
}
811+
807812
private static String split(String lookback, String lookahead) {
808813
return "((?<=" + lookback + ")(?=" + lookahead + "))";
809814
}

0 commit comments

Comments
 (0)