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

Deprecated signatures of Java 8 fail to load on Java 9 #41

Closed
GoogleCodeExporter opened this issue Mar 14, 2015 · 4 comments
Closed

Deprecated signatures of Java 8 fail to load on Java 9 #41

GoogleCodeExporter opened this issue Mar 14, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

This was found after changing Lucene to Java 8: 
https://issues.apache.org/jira/browse/LUCENE-6070

What happens:

-check-forbidden-all:
[forbidden-apis] Reading bundled API signatures: jdk-unsafe-1.8
[forbidden-apis] Reading bundled API signatures: jdk-deprecated-1.8

BUILD FAILED
/mnt/ssd/jenkins/workspace/Lucene-Solr-trunk-Linux/build.xml:515: The following 
error occurred while executing this line:
/mnt/ssd/jenkins/workspace/Lucene-Solr-trunk-Linux/build.xml:86: The following 
error occurred while executing this line:
/mnt/ssd/jenkins/workspace/Lucene-Solr-trunk-Linux/lucene/build.xml:101: The 
following error occurred while executing this line:
/mnt/ssd/jenkins/workspace/Lucene-Solr-trunk-Linux/lucene/common-build.xml:2293:
 Parsing signatures failed: No method found with following signature: 
java.util.jar.Pack200$Packer#addPropertyChangeListener(java.beans.PropertyChange
Listener)

This is a really new thing:

The method 
{{java.util.jar.Pack200$Packer#addPropertyChangeListener(java.beans.PropertyChan
geListener)}} part of the JDK 8 deprecation list. But this method was actually 
removed in Java 9 completely (the first deprecation ever that was actually 
removed!). This method was deprecated in Java 8 for the first time, with the 
following text:

"Deprecated.  The dependency on PropertyChangeListener creates a significant 
impediment to future modularization of the Java platform. This method will be 
removed in a future release. Applications that need to monitor progress of the 
packer can poll the value of the PROGRESS property instead."

The solution in forbidden-apis is to automatically disable 
failOnUnresolvableSignatures for those "deprecated" signatures, because they 
are likely to disappear in later Java versions.

Unfortunately for ANT builds there is no workaround at the moment, so this 
should go in version 1.6.2. On the other hand, disabling the above in Maven 
does not help, too, because it only prevents signatures from failing if the 
class was not found.

This issue should fix the following:
- Make failOnUnresolvableSignatures behave correctly when method or field is 
nor found
- Add @ignoreUnresolvable to signatures file checking and add this setting to 
the deprecated lists. This setting overrides the global setting.

Original issue reported on code.google.com by uwe.h.schindler on 22 Nov 2014 at 10:47

@GoogleCodeExporter
Copy link
Author

Here is the patch for forbidden-apis 1.7.

I will review other changes in forbidden-apis 1.7 and maybe release that as new 
version. This change is quite large so it is nbot applicable for bugfix release.

Original comment by uwe.h.schindler on 23 Nov 2014 at 11:37

Attachments:

@GoogleCodeExporter
Copy link
Author

In addition, this change makes some messages look different and the file format 
changed.

I will add some test for the new signatures file option.

Original comment by uwe.h.schindler on 23 Nov 2014 at 11:40

@GoogleCodeExporter
Copy link
Author

Original comment by uwe.h.schindler on 23 Nov 2014 at 11:58

  • Changed state: Committed

@GoogleCodeExporter
Copy link
Author

Released with version 1.7

Original comment by uwe.h.schindler on 24 Nov 2014 at 12:49

  • Changed state: Fixed

uschindler added a commit that referenced this issue Mar 14, 2015
uschindler added a commit that referenced this issue Mar 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant