(Class<?> clazz, String fieldName)
| 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); |
no test coverage detected