incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1052208 - in /incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/SpiFly/src/org/apache/aries/spifly: ClientWeavingHook.java Util.java
Date Thu, 23 Dec 2010 09:49:59 GMT
Author: davidb
Date: Thu Dec 23 09:49:59 2010
New Revision: 1052208

URL: http://svn.apache.org/viewvc?rev=1052208&view=rev
Log:
More fixes.

Modified:
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/SpiFly/src/org/apache/aries/spifly/ClientWeavingHook.java
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/SpiFly/src/org/apache/aries/spifly/Util.java

Modified: incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/SpiFly/src/org/apache/aries/spifly/ClientWeavingHook.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/SpiFly/src/org/apache/aries/spifly/ClientWeavingHook.java?rev=1052208&r1=1052207&r2=1052208&view=diff
==============================================================================
--- incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/SpiFly/src/org/apache/aries/spifly/ClientWeavingHook.java
(original)
+++ incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/SpiFly/src/org/apache/aries/spifly/ClientWeavingHook.java
Thu Dec 23 09:49:59 2010
@@ -95,11 +95,11 @@ public class ClientWeavingHook implement
         List<BundleDescriptor> allowedBundles = new ArrayList<BundleDescriptor>();
 
         for (PathElement element : HeaderParser.parseHeader(consumerHeader)) {
-            Set<ConsumerRestriction> restrictions = new HashSet<ConsumerRestriction>();
-            MethodRestriction methodRestriction = null;
             String name = element.getName().trim();
+
             String className;
             String methodName;
+            MethodRestriction methodRestriction;
             
             int hashIdx = name.indexOf('#');
             if (hashIdx > 0) {                
@@ -107,7 +107,6 @@ public class ClientWeavingHook implement
                 int braceIdx = name.substring(hashIdx).indexOf('(');
                 if (braceIdx > 0) {
                     methodName = name.substring(hashIdx + 1, hashIdx + braceIdx);
-                    // Map<Integer, Map<String, String>> args = new HashMap<Integer,
Map<String,String>>();
                     ArgRestrictions argRestrictions = new ArgRestrictions();
                     int closeIdx = name.substring(hashIdx).indexOf(')');
                     if (closeIdx > 0) {
@@ -117,7 +116,7 @@ public class ClientWeavingHook implement
                                 int argNumber = 0;
                                 for (String s : classes.split(",")) {
                                     int idx = s.indexOf('[');
-                                    int end = s.indexOf(idx, ']');
+                                    int end = s.indexOf(']', idx);
                                     if (idx > 0 && end > idx) {
                                         argRestrictions.addRestriction(argNumber, s.substring(0,
idx), s.substring(idx + 1, end));
                                     } else {
@@ -143,13 +142,15 @@ public class ClientWeavingHook implement
                     className = ServiceLoader.class.getName();
                     methodName = "load";
                     ArgRestrictions argRestrictions = new ArgRestrictions();
-                    argRestrictions.addRestriction(1, Class.class.getName());
+                    argRestrictions.addRestriction(0, Class.class.getName());
                     methodRestriction = new MethodRestriction(methodName, argRestrictions);
                 } else {
                     throw new IllegalArgumentException("Must at least specify class name
and method name: " + name);
                 }
             }  
             ConsumerRestriction restriction = new ConsumerRestriction(className, methodRestriction);
+
+            Set<ConsumerRestriction> restrictions = new HashSet<ConsumerRestriction>();
             restrictions.add(restriction);
                 
             String bsn = element.getAttribute("bundle");

Modified: incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/SpiFly/src/org/apache/aries/spifly/Util.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/SpiFly/src/org/apache/aries/spifly/Util.java?rev=1052208&r1=1052207&r2=1052208&view=diff
==============================================================================
--- incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/SpiFly/src/org/apache/aries/spifly/Util.java
(original)
+++ incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/SpiFly/src/org/apache/aries/spifly/Util.java
Thu Dec 23 09:49:59 2010
@@ -78,7 +78,7 @@ public class Util {
         activator.log(LogService.LOG_DEBUG, "Found bundles providing " + requestedClass +
": " + bundles);
                 
         Map<Pair<Integer, String>, String> args = new HashMap<Pair<Integer,String>,
String>();
-        args.put(new Pair<Integer, String>(1, Class.class.getName()), clsArg.getName());
+        args.put(new Pair<Integer, String>(0, Class.class.getName()), clsArg.getName());
         Collection<Bundle> allowedBundles = activator.findConsumerRestrictions(consumerBundle,
className, methodName, args);
 
         if (allowedBundles != null) {



Mime
View raw message