SLING-8136 - Analyser fails when javax.*, org.xml.sax.*, org.w3c.dom* or org.ietf.jgss imports are found
Extend the current TODO regarding some packages that are not analysed and apply it
for missing exported packages as well.
diff --git a/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckBundleExportsImports.java b/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckBundleExportsImports.java
index e35347c..c1b4e27 100644
--- a/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckBundleExportsImports.java
+++ b/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckBundleExportsImports.java
@@ -85,9 +85,8 @@
if ( info.getImportedPackages() != null ) {
for(final PackageInfo i : info.getImportedPackages()) {
if ( i.getVersion() == null ) {
- // don't report for javax and org.w3c. packages (TODO)
- if ( !i.getName().startsWith("javax.")
- && !i.getName().startsWith("org.w3c.")) {
+ // don't report for packages we don't provide yet (TODO)
+ if ( !isIgnored(i)) {
getReport(reports, info).importWithoutVersion.add(i);
}
}
@@ -96,6 +95,13 @@
}
}
+ private boolean isIgnored(final PackageInfo i) {
+ return i.getName().startsWith("javax.")
+ || i.getName().startsWith("org.w3c.")
+ || i.getName().startsWith("org.xml.sax.")
+ || i.getName().equals("org.ietf.jgss");
+ }
+
@Override
public void execute(final AnalyserTaskContext ctx) throws IOException {
@@ -131,6 +137,10 @@
for(final BundleDescriptor info : entry.getValue()) {
if ( info.getImportedPackages() != null ) {
for(final PackageInfo pck : info.getImportedPackages() ) {
+ // don't report for packages we don't provide yet (TODO)
+ if ( isIgnored(pck) ) {
+ continue;
+ }
final List<BundleDescriptor> candidates = getCandidates(exportingBundles, pck);
if ( candidates.isEmpty() ) {
if ( pck.isOptional() ) {