MCPcopy Create free account
hub / github.com/antlr/codebuff / tryGetField

Method tryGetField

output/java/1.4.14/ObjectModelAdaptor.java:138–149  ·  view source on GitHub ↗
(Class<?> clazz, String fieldName)

Source from the content-addressed store, hash-verified

136 }
137
138 protected static Field tryGetField(Class<?> clazz, String fieldName) {
139 try {
140 Field field = clazz.getField(fieldName);
141 if ( field!=null ) {
142 field.setAccessible(true);
143 }
144 return field;
145 }
146 catch (NoSuchFieldException ex) { }
147 catch (SecurityException ex) { }
148 return null;
149 }
150
151 protected Object throwNoSuchProperty(Class<?> clazz, String propertyName, Exception cause) {
152 throw new STNoSuchPropertyException(cause, null, clazz.getName()+"."+propertyName);

Callers 1

findMemberMethod · 0.95

Calls 2

getFieldMethod · 0.45
setAccessibleMethod · 0.45

Tested by

no test coverage detected