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
Running EqualsVerifier on a class with an InetAddress field.
Changing the code below to wrap a String vs. an InetAddress makes the test pass.
What is the code that triggers this problem?
import java.net.InetAddress;
import nl.jqno.equalsverifier.EqualsVerifier;
public class TempTest {
final InetAddress ia;
private TempTest(InetAddress ia) {
this.ia = ia;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((ia == null) ? 0 : ia.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
TempTest other = (TempTest) obj;
if (ia == null) {
if (other.ia != null) {
return false;
}
} else if (!ia.equals(other.ia)) {
return false;
}
return true;
}
public static void main(String[] args) {
EqualsVerifier.forClass(TempTest.class).usingGetClass().verify();
}
}
What error message or stack trace does EqualsVerifier give?
Exception in thread "main" java.lang.AssertionError: IllegalArgumentException: Cannot inject classes into the bootstrap
class loader
For more information, go to: http://www.jqno.nl/equalsverifier/errormessages
at nl.jqno.equalsverifier.EqualsVerifier.handleError(EqualsVerifier.java:355)
at nl.jqno.equalsverifier.EqualsVerifier.verify(EqualsVerifier.java:344)
at TempTest.main(TempTest.java:46)
Caused by: java.lang.IllegalArgumentException: Cannot inject classes into the bootstrap class loader
at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.<init>(ClassInjector.jav
a:127)
at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default$InjectionDispatcher.load(
ClassLoadingStrategy.java:184)
at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default.load(ClassLoadingStrategy
.java:120)
at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.TypeResolutionStrategy$Passive.initialize(TypeResolutionStrate
gy.java:79)
at nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:4352)
at nl.jqno.equalsverifier.internal.Instantiator.giveDynamicSubclass(Instantiator.java:98)
at nl.jqno.equalsverifier.internal.Instantiator.of(Instantiator.java:58)
at nl.jqno.equalsverifier.internal.ClassAccessor.buildObjectAccessor(ClassAccessor.java:334)
at nl.jqno.equalsverifier.internal.ClassAccessor.getRedAccessor(ClassAccessor.java:263)
at nl.jqno.equalsverifier.internal.ClassAccessor.getRedObject(ClassAccessor.java:251)
at nl.jqno.equalsverifier.internal.prefabvalues.factories.FallbackFactory.giveInstances(FallbackFactory.java:98)
at nl.jqno.equalsverifier.internal.prefabvalues.factories.FallbackFactory.createValues(FallbackFactory.java:53)
at nl.jqno.equalsverifier.internal.prefabvalues.PrefabValues.createTuple(PrefabValues.java:170)
at nl.jqno.equalsverifier.internal.prefabvalues.PrefabValues.realizeCacheFor(PrefabValues.java:153)
at nl.jqno.equalsverifier.internal.prefabvalues.factories.AbstractReflectiveGenericFactory.determineAndCacheActualTypeT
ag(AbstractReflectiveGenericFactory.java:61)
at nl.jqno.equalsverifier.internal.prefabvalues.factories.AbstractReflectiveGenericFactory.determineAndCacheActualTypeT
ag(AbstractReflectiveGenericFactory.java:52)
at nl.jqno.equalsverifier.internal.prefabvalues.factories.CollectionFactory.createValues(CollectionFactory.java:36)
at nl.jqno.equalsverifier.internal.prefabvalues.PrefabValues.createTuple(PrefabValues.java:166)
at nl.jqno.equalsverifier.internal.prefabvalues.PrefabValues.realizeCacheFor(PrefabValues.java:153)
at nl.jqno.equalsverifier.internal.prefabvalues.factories.FallbackFactory.traverseFields(FallbackFactory.java:91)
at nl.jqno.equalsverifier.internal.prefabvalues.factories.FallbackFactory.createValues(FallbackFactory.java:52)
at nl.jqno.equalsverifier.internal.prefabvalues.PrefabValues.createTuple(PrefabValues.java:170)
at nl.jqno.equalsverifier.internal.prefabvalues.PrefabValues.realizeCacheFor(PrefabValues.java:153)
at nl.jqno.equalsverifier.internal.prefabvalues.factories.FallbackFactory.traverseFields(FallbackFactory.java:91)
at nl.jqno.equalsverifier.internal.prefabvalues.factories.FallbackFactory.createValues(FallbackFactory.java:52)
at nl.jqno.equalsverifier.internal.prefabvalues.PrefabValues.createTuple(PrefabValues.java:170)
at nl.jqno.equalsverifier.internal.prefabvalues.PrefabValues.realizeCacheFor(PrefabValues.java:153)
at nl.jqno.equalsverifier.internal.prefabvalues.PrefabValues.giveTuple(PrefabValues.java:101)
at nl.jqno.equalsverifier.internal.prefabvalues.PrefabValues.giveRed(PrefabValues.java:78)
at nl.jqno.equalsverifier.AbstractDelegationChecker.check(AbstractDelegationChecker.java:51)
at nl.jqno.equalsverifier.EqualsVerifier.verifyWithoutExamples(EqualsVerifier.java:379)
at nl.jqno.equalsverifier.EqualsVerifier.performVerification(EqualsVerifier.java:365)
at nl.jqno.equalsverifier.EqualsVerifier.verify(EqualsVerifier.java:338)
... 1 more
What did you expect?
The test to pass.
Which version of EqualsVerifier are you using?
2.2.1
Please provide any additional information below.
None. Thanks yet again for EV, it's great.
The text was updated successfully, but these errors were encountered:
What steps will reproduce the problem?
Running EqualsVerifier on a class with an InetAddress field.
Changing the code below to wrap a String vs. an InetAddress makes the test pass.
What is the code that triggers this problem?
What error message or stack trace does EqualsVerifier give?
What did you expect?
The test to pass.
Which version of EqualsVerifier are you using?
2.2.1
Please provide any additional information below.
None. Thanks yet again for EV, it's great.
The text was updated successfully, but these errors were encountered: