tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r740222 - in /tuscany/java/sca/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler: JavaCompiler.java osgi/BundleResolver.java
Date Tue, 03 Feb 2009 05:41:25 GMT
Author: rfeng
Date: Tue Feb  3 05:41:25 2009
New Revision: 740222

URL: http://svn.apache.org/viewvc?rev=740222&view=rev
Log:
Produce more information about the resolution errors

Modified:
    tuscany/java/sca/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/JavaCompiler.java
    tuscany/java/sca/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/osgi/BundleResolver.java

Modified: tuscany/java/sca/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/JavaCompiler.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/JavaCompiler.java?rev=740222&r1=740221&r2=740222&view=diff
==============================================================================
--- tuscany/java/sca/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/JavaCompiler.java
(original)
+++ tuscany/java/sca/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/JavaCompiler.java
Tue Feb  3 05:41:25 2009
@@ -189,7 +189,8 @@
                     stateController.assertResolved(b);
                     getLogger().info("OSGi bundle is resolved: " + b.getSymbolicName());
                 } catch (BundleException e) {
-                    getLogger().error(stateController.getAllErrors().toString());
+                    // getLogger().error(stateController.getAllErrors().toString());
+                    getLogger().error(e.getMessage());
                     // FIXME: For now, only a warning is reported
                     // throw new CompilerException(e.getMessage(), e);
                 }

Modified: tuscany/java/sca/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/osgi/BundleResolver.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/osgi/BundleResolver.java?rev=740222&r1=740221&r2=740222&view=diff
==============================================================================
--- tuscany/java/sca/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/osgi/BundleResolver.java
(original)
+++ tuscany/java/sca/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/osgi/BundleResolver.java
Tue Feb  3 05:41:25 2009
@@ -357,12 +357,21 @@
     public void assertResolved(BundleDescription desc) throws BundleException {
         if (!desc.isResolved()) {
             StringBuffer msg = new StringBuffer();
-            msg.append("Bundle ").append(desc.getSymbolicName()).append(" cannot be resolved\n");
-            msg.append("Resolution errors:\n");
-            ResolverError[] errors = getResolverErrors(desc);
-            for (int i = 0; i < errors.length; i++) {
-                ResolverError error = errors[i];
-                msg.append(error).append("\n");
+            msg.append("Bundle ").append(desc.getSymbolicName()).append(" cannot be resolved:
\n");
+            BundleDescription[] bundles = state.getBundles();
+            int index = 0;
+            for (BundleDescription b : bundles) {
+                if (b.isResolved()) {
+                    continue;
+                }
+                ResolverError[] errors = state.getResolverErrors(b);
+                if (errors.length > 0) {
+                    msg.append("[").append(index++).append("] ").append(b.getSymbolicName()).append("\n");
+                }
+                for (int i = 0; i < errors.length; i++) {
+                    ResolverError error = errors[i];
+                    msg.append(error).append("\n");
+                }
             }
 
             throw new BundleException(msg.toString());



Mime
View raw message