-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Two vararg methods with same score" for resteasy ClientWebTarget.request() #125
Comments
Are you sure you call |
I've just double-checked all other OGNL statements that are configured and all of them call I built a unit test myself which appears to reproduce the issue against ognl:ognl:3.2.20 in central: https://gist.github.com/petergeneric/d898dd50477d690cdedf9672ae945dc7 For me, the first assert passes (OGNL calls the right method), but the second assert that there's no stderr output fails Hopefully it's not caused by me setting something up incorrectly - apologies in advance if that is the case! |
Thanks a lot for your example, I was able reproduce this problem locally and what is more interesting it only happens in nested expressions like |
I found the source of the problem, by introducing #69 something has been broken, using |
Which version of Java do you use? Upgrading Java to version 8 solves the problem, so maybe it's time to abound Java 1.7 in OGNL and start using Java 8 🤔 |
@harawata what do you think about this ^^? |
I'm using a range of versions (it's an app suport framework), 1.8 LTS, 11 LTS and 16 (16 to be dropped whe 17 LTS comes out), this particular app was running on 16 (as was the unit test) |
…is a sign that this bug may have been fixed. The bug causes OGNL to incorrectly identify a case of 2 varargs method that also has a no-args option as problematic in a particular condition (see the github issue for more detail). §Currently the only side-effect of this bug is to print an error message to application stderr in this case, e.g. ``` Two vararg methods with same score(0): "public javax.ws.rs.client.Invocation$Builder org.jboss.resteasy.client.jaxrs.internal.ClientWebTarget.request(javax.ws.rs.core.MediaType[])" and "public javax.ws.rs.client.Invocation$Builder org.jboss.resteasy.client.jaxrs.internal.ClientWebTarget.request(java.lang.String[])" please report! ```
…is a sign that this bug may have been fixed. The bug causes OGNL to incorrectly identify a case of 2 varargs method that also has a no-args option as problematic in a particular condition (see the github issue for more detail). §Currently the only side-effect of this bug is to print an error message to application stderr in this case, e.g. ``` Two vararg methods with same score(0): "public javax.ws.rs.client.Invocation$Builder org.jboss.resteasy.client.jaxrs.internal.ClientWebTarget.request(javax.ws.rs.core.MediaType[])" and "public javax.ws.rs.client.Invocation$Builder org.jboss.resteasy.client.jaxrs.internal.ClientWebTarget.request(java.lang.String[])" please report! ```
Hi @lukaszlenart @petergeneric ! I just took a quick look and the error does not depend on Java version, but it is not 100% reproducible. There are several logical issues.
[EDIT] |
Thanks a lot @harawata for your insights! I will try to improve the code base on your ideas. Yet I would like to know if switching to Java 8 would be a problem for you? |
Hi @lukaszlenart , |
@petergeneric I have pushed OGNL 3.2.21-SNAPSHOT into https://s01.oss.sonatype.org/content/repositories/snapshots/ - could you test it? |
@lukaszlenart looks good to me, thanks (Maven couldn't find 3.2.21-SNAPSHOT on s01.oss or oss., but I found and used 3.2.21-20210509.182701-1 on oss.sonatype which looks like the right artifact from the timestamp). I ran the test several times against JDK10 and JDK11 and didn't get any errors. |
@petergeneric great, thanks a lot for your help! |
In OGNL 3.2.20 I'm experiencing the following log message. I think this error may be spurious here since there's a no-args method as well as 2 varargs methods.
The OGNL statement being executed is:
Here's the method being called: https://github.com/resteasy/Resteasy/blob/main/resteasy-client/src/main/java/org/jboss/resteasy/client/jaxrs/internal/ClientWebTarget.java#L358
The text was updated successfully, but these errors were encountered: