apache / apache/lucene

Use Animal-Sniffer ANT task to enforce JDK compatibility [LUCENE-4725]

Open
#5,790 0 comments 0 reactions 1 assignee Claimed by @uschindler View on GitHub
affects-version:4.1 legacy-jira-priority:Major tool:build type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

While developing the fork of the forbidden-apis check, I recogized another very useful task to execute (in fact its similar to the forbidden-apis task, it just does the opposite - it only allows specific signatures).

The problem is in general: If the developer has a newer JDK version installed and builds Lucene/Solr against it, he can accidentally use method signatures or classes not available in the compile target java version (in our case 1.6). This is especially useful for Mac users, who are enforced to use the JDK version shipped with the operating system.

The Animal-Sniffer ANT plugin can handle this for us (http://mojo.codehaus.org/animal-sniffer/animal-sniffer-ant-tasks/), available via IVY. The corresponding signatures are also available via IVY: http://mojo.codehaus.org/signatures/java16/

Like the forbidden APIs scanner it scans the byte code and fails the build if any signature is used that is not shipped with the compiler target JDK.

---
Migrated from [LUCENE-4725](https://issues.apache.org/jira/browse/LUCENE-4725) by Uwe Schindler (@uschindler), updated Jan 28 2013
Linked issues:
- #5636

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.