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

Method tryGetField

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

Source from the content-addressed store, hash-verified

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