Menu

#566 Lucene code involving MethodHandle is returning odd warnings

v5.1
open-later
None
5
2018-10-04
2015-02-18
Dawid Weiss
No

This is odd. I'm upgrading from a much older version of ProGuard and ProGuard 5.2 is throwing these warnings. They are odd; seems like MethodHandles are not properly parsed/ recognized?

[proguard] Warning: org.apache.lucene.util.AttributeFactory$1: 
can't find referenced method 'org.apache.lucene.util.AttributeImpl invokeExact()' 
in library class java.lang.invoke.MethodHandle
[proguard] Warning: org.apache.lucene.util.AttributeFactory$DefaultAttributeFactory:
can't find referenced method 'org.apache.lucene.util.AttributeImpl invokeExact()' 
in library class java.lang.invoke.MethodHandle

Discussion

  • Dawid Weiss

    Dawid Weiss - 2015-02-18

    A temporary (?) workaround is to add:
    -dontwarn java.lang.invoke.MethodHandle

    to your config.

     
  • Eric Lafortune

    Eric Lafortune - 2015-03-08

    Thanks for your report. ProGuard currently indeed treats the polymorphic signature of MethodHandle#invoke/invokeExact like all normal signatures. This may produce warnings, but it should work otherwise. You should use the workaround. Since ProGuard tries to be agnostic of the platform (JSE, JME, Android,...), I'm a bit reluctant to hard-code such an exception.

     
  • Eric Lafortune

    Eric Lafortune - 2015-03-08
    • status: open --> open-later
    • assigned_to: Eric Lafortune
     
  • Dawid Weiss

    Dawid Weiss - 2015-03-08

    Hi Eric. This seems to be part of the JLS now (not just a caveat of the runtime library) so I think in the end it should be somehow respected/ recognized out of the box, otherwise you get those cryptic errors that will be very difficult for any non-JVM specialist to figure out. But I understand it's a very low priority.

     
  • Dawid Weiss

    Dawid Weiss - 2018-10-04
     

Log in to post a comment.