RuntimeException if -parameters compile option is enabled

60 views
Skip to first unread message

Chris Savory

unread,
Feb 20, 2016, 7:43:00 PM2/20/16
to equalsverifier
Getting the following error if -parameters compiler option is enabled.


Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.286 sec <<< FAILURE! - in com.edlogics.authentication.domain.RoleTests

testEqualsContract(com.edlogics.authentication.domain.RoleTests)  Time elapsed: 0.282 sec  <<< FAILURE!

java.lang.AssertionError: java.lang.RuntimeException: 

For more information, go to: http://www.jqno.nl/equalsverifier/errormessages

at nl.jqno.equalsverifier.internal.asm.MethodVisitor.visitParameter(Unknown Source)

at nl.jqno.equalsverifier.internal.asm.ClassReader.b(Unknown Source)

at nl.jqno.equalsverifier.internal.asm.ClassReader.accept(Unknown Source)

at nl.jqno.equalsverifier.internal.asm.ClassReader.accept(Unknown Source)

at nl.jqno.equalsverifier.internal.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:61)

at nl.jqno.equalsverifier.internal.cglib.proxy.Enhancer.emitMethods(Enhancer.java:911)

at nl.jqno.equalsverifier.internal.cglib.proxy.Enhancer.generateClass(Enhancer.java:498)

at nl.jqno.equalsverifier.internal.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)

at nl.jqno.equalsverifier.internal.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)

at nl.jqno.equalsverifier.internal.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)

at nl.jqno.equalsverifier.internal.cglib.proxy.Enhancer.createClass(Enhancer.java:317)

at nl.jqno.equalsverifier.util.Instantiator.createDynamicSubclass(Instantiator.java:103)

at nl.jqno.equalsverifier.util.Instantiator.of(Instantiator.java:49)

at nl.jqno.equalsverifier.util.ClassAccessor.buildObjectAccessor(ClassAccessor.java:316)

at nl.jqno.equalsverifier.util.ClassAccessor.getRedAccessor(ClassAccessor.java:260)

at nl.jqno.equalsverifier.util.ClassAccessor.getRedObject(ClassAccessor.java:251)

at nl.jqno.equalsverifier.AbstractDelegationChecker.checkAbstractDelegationInSuper(AbstractDelegationChecker.java:106)

at nl.jqno.equalsverifier.AbstractDelegationChecker.check(AbstractDelegationChecker.java:57)

at nl.jqno.equalsverifier.EqualsVerifier.verifyWithoutExamples(EqualsVerifier.java:428)

at nl.jqno.equalsverifier.EqualsVerifier.performVerification(EqualsVerifier.java:416)

at nl.jqno.equalsverifier.EqualsVerifier.verify(EqualsVerifier.java:386)

at com.edlogics.authentication.domain.RoleTests.testEqualsContract(RoleTests.java:48)

Jan Ouwens

unread,
Feb 21, 2016, 10:12:48 AM2/21/16
to equalsv...@googlegroups.com
Hi Chris,

Sorry for the late reply.

I haven’t been able to reproduce this. If you send me a small, self-contained project that reproduces this, that would be very helpful.

From what I’ve seen from the stack trace, the problem occurs in ASM. (EqualsVerifier incorporates ASM’s jar inside its own, so as not to conflict with any other versions of ASM that may or may not be on the class path.) I know that ASM doesn’t include debug information in its jars (they’re kind of unique with that, at least on Maven Central), so this may be causing the problem, but I can’t be sure as long as I can’t reproduce the problem.


Jan



--
You received this message because you are subscribed to the Google Groups "equalsverifier" group.
To unsubscribe from this group and stop receiving emails from it, send an email to equalsverifie...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christoph Sturm

unread,
Feb 24, 2016, 3:48:58 AM2/24/16
to equalsverifier
I had the same problem with version 1.7.7, but i can verify that it is fixed in master.

is it maybe possible to publish a new version?

Jan Ouwens

unread,
Feb 24, 2016, 3:59:43 AM2/24/16
to equalsv...@googlegroups.com, Christoph Sturm
Hi Christoph,

I’m very happy to hear it’s working on master.

I’m working on a release. Unfortunately, this is going to be a big one (a 2.0 version) with a lot of changes, including some breaking ones, so I need to be a bit more careful. Also, I have some documentation work still to do before I can release. In other words, it will still be a little while.

If you can help me reproduce the issue, I can also make a fix in the 1.7.x line. That is something I can release much sooner.


Jan

Jan Ouwens

unread,
Feb 24, 2016, 6:29:02 AM2/24/16
to Christoph Sturm, equalsv...@googlegroups.com
Hi Christoph,

Thanks for the reply. I can indeed reproduce the issue in the 1.7.x line now.

After some searching, I found the reason why it works on master but not on 1.7.x. In 1.7.x, EqualsVerifier used CGLib for code generation. In master, I’ve replaced it with ByteBuddy. Apparently, this also sidesteps your problem.

Unfortunately, this is not really something I want to backport, because it had a big impact on things.
Is this a big issue for you, or is it something that can still wait a while?

I don’t want to make any promises about a release of master (I’ve been burned by those kinds of promises before :) ), but I’m really in the dotting the i’s and crossing the t’s stage at this point.


Jan

On 24 February 2016 at 10:08:25, Christoph Sturm (m...@christophsturm.com) wrote:

hey jan!

this is a class that reproduces the problem:

public class ScreenFilter implements Filter<Integer> {
@Override
public boolean accept(Integer value) {
return false;
}
}

interface Filter<T> {
boolean accept(T value);
}


I tried in the 1x dev branch and in the 1.7.7 branch. both fail

Christoph Sturm

unread,
Feb 24, 2016, 7:20:30 AM2/24/16
to Jan Ouwens, equalsv...@googlegroups.com
I think it can be fixed by updating asm to 5.0.4 and cglib to 3.2.1

Jan Ouwens

unread,
Feb 24, 2016, 10:48:40 AM2/24/16
to equalsv...@googlegroups.com
Wow, I didn’t realize cglib had a new release! The reason I switched to ByteBuddy was that cglib had an incompatibility with Java 8 but for some reason never released a fix for that. Looks like they may have done so now.

I’ll see if I can get things to work with the new versions.

Jan Ouwens

unread,
Feb 24, 2016, 1:24:56 PM2/24/16
to equalsv...@googlegroups.com
So, I’ve tried it out, and I have good news and bad news :).

The bad news is: CGLib 3.2.1 doesn’t work. See also https://github.com/cglib/cglib/issues/64
The good news is: CGLib 3.2.0 does work. I can probably make a new release next Friday or so.

Thanks for your help in this one!


Jan

Jan Ouwens

unread,
Feb 26, 2016, 7:51:27 AM2/26/16
to equalsv...@googlegroups.com
Hi Christoph,

As you may already have noticed, I just released a version that should fix this.


Jan

Chris Savory

unread,
Mar 2, 2016, 11:00:02 AM3/2/16
to equalsverifier
Jan, thank you for the new release.  I was able to verify this fixed our problem. 

Jan Ouwens

unread,
Mar 2, 2016, 3:45:59 PM3/2/16
to equalsverifier
Hi Chris,

I'm happy to hear that!


Cheers,
Jan
Reply all
Reply to author
Forward
0 new messages