Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
Linux/maven
Description
The test below passes when run under java 1.7, but fails under java 1.6. I feel the behaviour should be consistent between the two. I will provide more details if there is any difficulty reproducing.
import static org.fest.assertions.Assertions.assertThat;
import java.beans.PropertyDescriptor;
import java.util.Arrays;
import org.apache.commons.beanutils.PropertyUtils;
import org.junit.Test;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
public class PropertyUtilsTest {
public static class Superclass<S> {
private S property;
public S getProperty()
}
public static class Subclass extends Superclass<String> {
@Override
public String getProperty()
}
@Test
public void usesSubclassAccessorMethod() throws Exception {
final PropertyDescriptor[] descriptors = PropertyUtils.getPropertyDescriptors(PropertyUtilsTest.Subclass.class);
final PropertyDescriptor descriptor = Iterables.find(Arrays.asList(descriptors), new Predicate<PropertyDescriptor>() {
@Override
public boolean apply(final PropertyDescriptor input)
});
assertThat(descriptor.getReadMethod()).isEqualTo(Subclass.class.getMethod("getProperty")).isNotEqualTo(Superclass.class.getMethod("getProperty"));
}
}