You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following test code throws an IllegalArgumentException.
@Test
public void test() throws Exception {
assertPojoMethodsFor(TestClass.class).areWellImplemented();
}
@Data
class TestClass {
E e;
}
enum E {
A;
}
However, the code below succeeds.
@Test
public void test() throws Exception {
assertPojoMethodsFor(TestClass.class).areWellImplemented();
}
@Data
class TestClass {
E e;
}
enum E {
A,
B;
}
The error is the code below (pl.pojo.tester.internal.instantiator.EnumInstantiator)
public Object instantiate() {
Object[] enumConstants = this.clazz.getEnumConstants();
int length = enumConstants.length;
if(length != 0) {
int random = (new Random()).nextInt(length - 1);
return enumConstants[random];
} else {
return null;
}
}
Occurs when the length is 1.
The text was updated successfully, but these errors were encountered:
The following test code throws an IllegalArgumentException.
However, the code below succeeds.
The error is the code below (pl.pojo.tester.internal.instantiator.EnumInstantiator)
Occurs when the length is 1.
The text was updated successfully, but these errors were encountered: