MCPcopy Index your code
hub / github.com/antlr/codebuff / tryGetField

Method tryGetField

output/java8/1.4.13/ObjectModelAdaptor.java:137–150  ·  view source on GitHub ↗
(Class<?> clazz, String fieldName)

Source from the content-addressed store, hash-verified

135 }
136
137 protected static Field tryGetField(Class<?> clazz, String fieldName) {
138 try {
139 Field field = clazz.getField(fieldName);
140 if ( field!=null ) {
141 field.setAccessible(true);
142 }
143 return field;
144 }
145 catch (NoSuchFieldException ex) {
146 }
147 catch (SecurityException ex) {
148 }
149 return null;
150 }
151
152 protected Object throwNoSuchProperty(Class<?> clazz, String propertyName, Exception cause) {
153 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