Skip to content

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

Closed
@GoogleCodeExporter

Description

@GoogleCodeExporter
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions