You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2018/11/27 12:52:09 UTC

[sling-org-apache-sling-feature-analyser] branch feature/SLING-8136 created (now f2f13d4)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to branch feature/SLING-8136
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-analyser.git.


      at f2f13d4  SLING-8136 - Analyser fails when javax.*, org.xml.sax.*, org.w3c.dom* or org.ietf.jgss imports are found

This branch includes the following new commits:

     new f2f13d4  SLING-8136 - Analyser fails when javax.*, org.xml.sax.*, org.w3c.dom* or org.ietf.jgss imports are found

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-org-apache-sling-feature-analyser] 01/01: SLING-8136 - Analyser fails when javax.*, org.xml.sax.*, org.w3c.dom* or org.ietf.jgss imports are found

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch feature/SLING-8136
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-analyser.git

commit f2f13d492b76958f3008d77d0ef2f444c4f3659e
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Nov 27 13:51:16 2018 +0100

    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.
---
 .../analyser/task/impl/CheckBundleExportsImports.java    | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

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 @@ public class CheckBundleExportsImports implements AnalyserTask {
             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 @@ public class CheckBundleExportsImports implements AnalyserTask {
         }
     }
 
+    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 @@ public class CheckBundleExportsImports implements AnalyserTask {
             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() ) {