MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / findGetter

Method findGetter

java/src/org/openqa/selenium/grid/jmx/MBean.java:137–156  ·  view source on GitHub ↗
(Method annotatedMethod)

Source from the content-addressed store, hash-verified

135 }
136
137 private @Nullable Method findGetter(Method annotatedMethod) {
138 ManagedAttribute ma = annotatedMethod.getAnnotation(ManagedAttribute.class);
139 try {
140 if (!"".equals(ma.getter())) {
141 return annotatedMethod.getDeclaringClass().getMethod(ma.getter());
142 } else {
143 String name = annotatedMethod.getName();
144 if (name.startsWith("get") || name.startsWith("is")) {
145 return annotatedMethod;
146 }
147 if (name.startsWith("set")) {
148 return annotatedMethod.getDeclaringClass().getMethod("g" + name.substring(1));
149 }
150 }
151 return null;
152 } catch (NoSuchMethodException e) {
153 LOG.severe("Error during execution: " + e.getMessage());
154 return null;
155 }
156 }
157
158 private @Nullable Method findSetter(Method annotatedMethod) {
159 ManagedAttribute ma = annotatedMethod.getAnnotation(ManagedAttribute.class);

Callers 1

getAttributeInfoMethod · 0.95

Calls 5

severeMethod · 0.80
getNameMethod · 0.65
equalsMethod · 0.45
getMethodMethod · 0.45
getMessageMethod · 0.45

Tested by

no test coverage detected