[hg] main-silver: evaluate values from plugin configuration

  • From: Milos Kleint < >
  • To: ,
  • Subject: [hg] main-silver: evaluate values from plugin configuration
  • Date: Thu, 04 Apr 2013 17:58:47 -0700

changeset 2f47a1bd8630 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/2f47a1bd8630
description:
        evaluate values from plugin configuration

diffstat:

 
maven.apisupport/src/org/netbeans/modules/maven/apisupport/MavenWhiteListQueryImpl.java
 |  35 ++++++++-
 1 files changed, 29 insertions(+), 6 deletions(-)

diffs (78 lines):

diff --git 
a/maven.apisupport/src/org/netbeans/modules/maven/apisupport/MavenWhiteListQueryImpl.java
 
b/maven.apisupport/src/org/netbeans/modules/maven/apisupport/MavenWhiteListQueryImpl.java
--- 
a/maven.apisupport/src/org/netbeans/modules/maven/apisupport/MavenWhiteListQueryImpl.java
+++ 
b/maven.apisupport/src/org/netbeans/modules/maven/apisupport/MavenWhiteListQueryImpl.java
@@ -65,6 +65,7 @@
 import javax.swing.event.ChangeListener;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.project.MavenProject;
+import 
org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
 import 
org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator;
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
@@ -78,7 +79,6 @@
 import org.netbeans.modules.maven.api.PluginPropertyUtils;
 import 
org.netbeans.modules.maven.api.classpath.ProjectSourcesClassPathProvider;
 import org.netbeans.modules.parsing.api.indexing.IndexingManager;
-import org.netbeans.spi.java.classpath.ClassPathProvider;
 import org.netbeans.spi.project.AuxiliaryProperties;
 import org.netbeans.spi.project.ProjectServiceProvider;
 import org.netbeans.spi.whitelist.WhiteListQueryImplementation;
@@ -320,7 +320,6 @@
                     if (ex.matches(nbm.art) && 
ex.isImplementationDependency()) {
                         //we got impl dep, none of the packages are private.
                         nonPrivatePackages.addAll(allPackages);
-                        continue;
                     }
                 }
             }
@@ -427,7 +426,7 @@
             List<WhiteListQuery.RuleDescription> rds = new 
ArrayList<WhiteListQuery.RuleDescription>();
             if (element.getKind() == ElementKind.CLASS || element.getKind() 
== ElementKind.INTERFACE) {
                 String qn = element.getQualifiedName();
-                if (qn != null && qn.lastIndexOf('.') > 0) {
+                if (qn.lastIndexOf('.') > 0) {
                     String pack = qn.substring(0, qn.lastIndexOf("."));
                     synchronized (IMPL_LOCK) {
                         if (privatePackages.contains(pack)) {
@@ -603,14 +602,38 @@
                         Xpp3Dom explicitDom = ch.getChild("explicitValue"); 
//NOI18N
                         if (idDom != null && (typeDom != null || explicitDom 
!= null)) {
                             String id = idDom.getValue();
-                            String type = typeDom.getValue();
-                            String explicit = explicitDom.getValue();
+                            String type = typeDom != null ? 
typeDom.getValue() : null;
+                            String explicit = explicitDom != null ? 
explicitDom.getValue() : null;
                             if (id != null && (type != null || explicit != 
null)) {
+                                try {
+                                    Object evaluated = eval.evaluate(id);
+                                    if (evaluated != null) {
+                                        id = evaluated.toString();
+                                    }
+                                } catch (ExpressionEvaluationException ex) {
+                                }
+                                if (type != null) {
+                                    try {
+                                        Object evaluated = 
eval.evaluate(type);
+                                        if (evaluated != null) {
+                                            type = evaluated.toString();
+                                        }
+                                    } catch (ExpressionEvaluationException 
ex) {
+                                    }
+                                }
+                                if (explicit != null) {
+                                    try {
+                                        Object evaluated = 
eval.evaluate(explicit);
+                                        if (evaluated != null) {
+                                            explicit = evaluated.toString();
+                                        }
+                                    } catch (ExpressionEvaluationException 
ex) {
+                                    }
+                                }
                                 ExplicitDependency ed = new 
ExplicitDependency();
                                 ed.id = id;
                                 ed.type = type;
                                 ed.explicit = explicit;
-                                //TODO any value evaluation necessary?
                                 toRet.add(ed);
                             }
                         }

[hg] main-silver: evaluate values from plugin configuration

Milos Kleint 04/05/2013

Project Features

About this Project

APIsupport was started in November 2009, is owned by Antonin Nebuzelsky, and has 43 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close