@Test(expected = NullPointerException.class) public void testGetGetMethodWithNullObject() { cache.getGetMethod(null, "name"); }
public Method getGetMethod(final Object object, final String fieldName) { if( object == null ) { throw new NullPointerException("object should not be null"); } else if( fieldName == null ) { throw new NullPointerException("fieldName should not be null"); } Method method = getCache.get(object.getClass().getName(), fieldName); if( method == null ) { method = ReflectionUtils.findGetter(object, fieldName); getCache.set(object.getClass().getName(), fieldName, method); } return method; }
MethodCache { public Method getGetMethod(final Object object, final String fieldName) { if( object == null ) { throw new NullPointerException("object should not be null"); } else if( fieldName == null ) { throw new NullPointerException("fieldName should not be null"); } Method method = getCache.get(object.getClass().getName(), fieldName); if( method == null ) { method = ReflectionUtils.findGetter(object, fieldName); getCache.set(object.getClass().getName(), fieldName, method); } return method; } }
MethodCache { public Method getGetMethod(final Object object, final String fieldName) { if( object == null ) { throw new NullPointerException("object should not be null"); } else if( fieldName == null ) { throw new NullPointerException("fieldName should not be null"); } Method method = getCache.get(object.getClass().getName(), fieldName); if( method == null ) { method = ReflectionUtils.findGetter(object, fieldName); getCache.set(object.getClass().getName(), fieldName, method); } return method; }  }
MethodCache { public Method getGetMethod(final Object object, final String fieldName) { if( object == null ) { throw new NullPointerException("object should not be null"); } else if( fieldName == null ) { throw new NullPointerException("fieldName should not be null"); } Method method = getCache.get(object.getClass().getName(), fieldName); if( method == null ) { method = ReflectionUtils.findGetter(object, fieldName); getCache.set(object.getClass().getName(), fieldName, method); } return method; }  Method getGetMethod(final Object object, final String fieldName); Method getSetMethod(final Object object, final String fieldName, final Class<?> argumentType); }
MethodCache { public Method getGetMethod(final Object object, final String fieldName) { if( object == null ) { throw new NullPointerException("object should not be null"); } else if( fieldName == null ) { throw new NullPointerException("fieldName should not be null"); } Method method = getCache.get(object.getClass().getName(), fieldName); if( method == null ) { method = ReflectionUtils.findGetter(object, fieldName); getCache.set(object.getClass().getName(), fieldName, method); } return method; }  Method getGetMethod(final Object object, final String fieldName); Method getSetMethod(final Object object, final String fieldName, final Class<?> argumentType);  }