geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r778973 - in /geronimo/xbean/trunk: ./ xbean-asm-shaded/ xbean-reflect-shaded/ xbean-reflect/ xbean-reflect/src/main/java/org/apache/xbean/recipe/
Date Wed, 27 May 2009 02:32:13 GMT
Author: dblevins
Date: Wed May 27 02:32:13 2009
New Revision: 778973

URL: http://svn.apache.org/viewvc?rev=778973&view=rev
Log:
Don't need the xbean-relfect-shaded module.  Can just have another ParameterNameLoader for
xbean-asm-shaded.

Added:
    geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java
  (contents, props changed)
      - copied, changed from r778958, geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/AsmParameterNameLoader.java
Removed:
    geronimo/xbean/trunk/xbean-reflect-shaded/
Modified:
    geronimo/xbean/trunk/pom.xml
    geronimo/xbean/trunk/xbean-asm-shaded/pom.xml
    geronimo/xbean/trunk/xbean-reflect/pom.xml
    geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java

Modified: geronimo/xbean/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/pom.xml?rev=778973&r1=778972&r2=778973&view=diff
==============================================================================
--- geronimo/xbean/trunk/pom.xml (original)
+++ geronimo/xbean/trunk/pom.xml Wed May 27 02:32:13 2009
@@ -412,7 +412,6 @@
         <module>maven-xbean-plugin</module>
         <module>xbean-asm-shaded</module>
         <module>xbean-finder-shaded</module>
-        <module>xbean-reflect-shaded</module>
     </modules>
     
     <repositories>

Modified: geronimo/xbean/trunk/xbean-asm-shaded/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-asm-shaded/pom.xml?rev=778973&r1=778972&r2=778973&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-asm-shaded/pom.xml (original)
+++ geronimo/xbean/trunk/xbean-asm-shaded/pom.xml Wed May 27 02:32:13 2009
@@ -54,6 +54,23 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <tasks>
+                <unzip src="${project.build.directory}/xbean-asm-shaded-${pom.version}.jar"
dest="${project.build.directory}/classes"/>
+              </tasks>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
   <dependencies>

Modified: geronimo/xbean/trunk/xbean-reflect/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-reflect/pom.xml?rev=778973&r1=778972&r2=778973&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-reflect/pom.xml (original)
+++ geronimo/xbean/trunk/xbean-reflect/pom.xml Wed May 27 02:32:13 2009
@@ -38,12 +38,21 @@
         <artifactId>asm</artifactId>
         <version>3.1</version>
         <scope>provided</scope>
+        <optional>true</optional>
       </dependency>
       <dependency>
         <groupId>asm</groupId>
         <artifactId>asm-commons</artifactId>
         <version>3.1</version>
         <scope>provided</scope>
+        <optional>true</optional>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-asm-shaded</artifactId>
+        <version>3.6-SNAPSHOT</version>
+        <scope>provided</scope>
+        <optional>true</optional>
       </dependency>
     <dependency>
       <groupId>log4j</groupId>

Modified: geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java?rev=778973&r1=778972&r2=778973&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java
(original)
+++ geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java
Wed May 27 02:32:13 2009
@@ -42,10 +42,14 @@
 public final class ReflectionUtil {
     private static ParameterNameLoader parameterNamesLoader;
     static {
-        try {
-            Class<? extends ParameterNameLoader> loaderClass = ReflectionUtil.class.getClassLoader().loadClass("org.apache.xbean.recipe.AsmParameterNameLoader").asSubclass(ParameterNameLoader.class);
-            parameterNamesLoader = loaderClass.newInstance();
-        } catch (Throwable ignored) {
+        String[] impls = {"org.apache.xbean.recipe.XbeanAsmParameterNameLoader", "org.apache.xbean.recipe.AsmParameterNameLoader"};
+        for (String impl : impls) {
+            try {
+                Class<? extends ParameterNameLoader> loaderClass = ReflectionUtil.class.getClassLoader().loadClass(impl).asSubclass(ParameterNameLoader.class);
+                parameterNamesLoader = loaderClass.newInstance();
+                break;
+            } catch (Throwable ignored) {
+            }
         }
     }
 

Copied: geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java
(from r778958, geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/AsmParameterNameLoader.java)
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java?p2=geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java&p1=geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/AsmParameterNameLoader.java&r1=778958&r2=778973&rev=778973&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/AsmParameterNameLoader.java
(original)
+++ geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java
Wed May 27 02:32:13 2009
@@ -30,11 +30,11 @@
 import java.util.WeakHashMap;
 import java.util.Arrays;
 
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.Label;
-import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.Type;
-import org.objectweb.asm.commons.EmptyVisitor;
+import org.apache.xbean.asm.ClassReader;
+import org.apache.xbean.asm.Label;
+import org.apache.xbean.asm.MethodVisitor;
+import org.apache.xbean.asm.Type;
+import org.apache.xbean.asm.commons.EmptyVisitor;
 
 /**
  * Implementation of ParameterNameLoader that uses ASM to read the parameter names from the
local variable table in the
@@ -42,7 +42,7 @@
  *
  * This wonderful piece of code was taken from org.springframework.core.LocalVariableTableParameterNameDiscover
  */
-public class AsmParameterNameLoader implements ParameterNameLoader {
+public class XbeanAsmParameterNameLoader implements ParameterNameLoader {
     /**
      * Weak map from Constructor to List&lt;String&gt;.
      */
@@ -108,9 +108,9 @@
         // Load the parameter names using ASM
         Map<Constructor,List<String>> constructorParameters = new HashMap<Constructor,List<String>>
();
         try {
-            ClassReader reader = AsmParameterNameLoader.createClassReader(clazz);
+            ClassReader reader = XbeanAsmParameterNameLoader.createClassReader(clazz);
 
-            AsmParameterNameLoader.AllParameterNamesDiscoveringVisitor visitor = new AsmParameterNameLoader.AllParameterNamesDiscoveringVisitor(clazz);
+            XbeanAsmParameterNameLoader.AllParameterNamesDiscoveringVisitor visitor = new
XbeanAsmParameterNameLoader.AllParameterNamesDiscoveringVisitor(clazz);
             reader.accept(visitor, 0);
 
             Map exceptions = visitor.getExceptions();
@@ -157,9 +157,9 @@
         // Load the parameter names using ASM
         Map<Method,List<String>>  methodParameters = new HashMap<Method,List<String>>();
         try {
-            ClassReader reader = AsmParameterNameLoader.createClassReader(clazz);
+            ClassReader reader = XbeanAsmParameterNameLoader.createClassReader(clazz);
 
-            AsmParameterNameLoader.AllParameterNamesDiscoveringVisitor visitor = new AsmParameterNameLoader.AllParameterNamesDiscoveringVisitor(clazz,
methodName);
+            XbeanAsmParameterNameLoader.AllParameterNamesDiscoveringVisitor visitor = new
XbeanAsmParameterNameLoader.AllParameterNamesDiscoveringVisitor(clazz, methodName);
             reader.accept(visitor, 0);
 
             Map exceptions = visitor.getExceptions();
@@ -302,4 +302,4 @@
             return null;
         }
     }
-}
+}
\ No newline at end of file

Propchange: geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java
------------------------------------------------------------------------------
    svn:mergeinfo = 



Mime
View raw message