Skip to content
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

Output in System.err 'Two methods with same method #35

Closed
harawata opened this issue Apr 11, 2017 · 6 comments · Fixed by #40
Closed

Output in System.err 'Two methods with same method #35

harawata opened this issue Apr 11, 2017 · 6 comments · Fixed by #40

Comments

@harawata
Copy link
Contributor

Here is a repro:

  @Test
  public void test() throws Exception {
    String expressiosn = "list.isEmpty()";
    Object expr = Ognl.parseExpression(expressiosn);
    OgnlContext ctx = new OgnlContext();
    List<String> list = Collections.singletonList("string");
    ctx.put("list", list);
    Object value = Ognl.getValue(expr, ctx);
    Assert.assertFalse((Boolean)value);
  }

The above test passes, but the following message is output in System.err.

Two methods with same method signature but not providing classes assignable? "public abstract boolean java.util.List.isEmpty()" and "public boolean java.util.AbstractCollection.isEmpty()" please report!

  • The line that outputs the message is here.
  • This seems to be a side effect of ca37319 .

This was reported on MyBatis tracker a while ago.

@PatrickGotthard
Copy link

Is there a chance that this could be fixed soon? At least every MyBatis user will get this error message when checking whether a collection is filled.

@lukaszlenart
Copy link
Collaborator

To be honest ... I have no idea how to fix that and I think the original authors also didn't take into account that the interfaces could have a real methods some day ...

@lukaszlenart
Copy link
Collaborator

The only idea I have is to remove this warning ... right now it's a valid case :)

@PatrickGotthard
Copy link

It is possible to check whether a method is a default method. Maybe it is possible to add this check to the code.

@lukaszlenart
Copy link
Collaborator

but not when using JDK7 as a source target.

@PatrickGotthard
Copy link

PatrickGotthard commented Sep 11, 2017

Hi Lukasz,

you're absolutely right. Maybe using a logging framework instead of System.err is also an option?

Regards,
Patrick

@harawata harawata changed the title Output in System.err 'Two methods with same method signature but not providing classes assignable?' Invalid error message 'Two methods with same method sigunature but not providing classes assignable?' in System.err Mar 9, 2018
@harawata harawata changed the title Invalid error message 'Two methods with same method sigunature but not providing classes assignable?' in System.err Output in System.err 'Two methods with same method Mar 9, 2018
harawata added a commit to harawata/ognl that referenced this issue Jan 8, 2022
The test passes, but there is a message in System.err: Two methods with same method signature but not providing classes assignable?
This was originally reported as orphan-oss#35 and temporarily resolved by orphan-oss#40 , but as you can see, this is not an error case in the first place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants