aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1303658 - in /aries/trunk/versioning: org.apache.aries.versioning.plugin/ versioning-checker/src/main/java/org/apache/aries/versioning/utils/
Date Thu, 22 Mar 2012 05:36:18 GMT
Author: djencks
Date: Thu Mar 22 05:36:17 2012
New Revision: 1303658

URL: http://svn.apache.org/viewvc?rev=1303658&view=rev
Log:
ARIES-817 finish upgrading to asm 4.  Also slightly fix serialversionuid comparison NPE

Removed:
    aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/utils/EmptyClassVisitor.java
Modified:
    aries/trunk/versioning/org.apache.aries.versioning.plugin/pom.xml
    aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/utils/ClassDeclaration.java

Modified: aries/trunk/versioning/org.apache.aries.versioning.plugin/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/versioning/org.apache.aries.versioning.plugin/pom.xml?rev=1303658&r1=1303657&r2=1303658&view=diff
==============================================================================
--- aries/trunk/versioning/org.apache.aries.versioning.plugin/pom.xml (original)
+++ aries/trunk/versioning/org.apache.aries.versioning.plugin/pom.xml Thu Mar 22 05:36:17
2012
@@ -19,9 +19,9 @@
             <version>0.1.0-SNAPSHOT</version>
         </dependency>
         <dependency>
-            <groupId>asm</groupId>
+            <groupId>org.ow2.asm</groupId>
             <artifactId>asm-all</artifactId>
-            <version>3.3.1</version>
+            <version>4.0</version>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>

Modified: aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/utils/ClassDeclaration.java
URL: http://svn.apache.org/viewvc/aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/utils/ClassDeclaration.java?rev=1303658&r1=1303657&r2=1303658&view=diff
==============================================================================
--- aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/utils/ClassDeclaration.java
(original)
+++ aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/utils/ClassDeclaration.java
Thu Mar 22 05:36:17 2012
@@ -111,16 +111,16 @@ public class ClassDeclaration extends Ge
     }
 
 
-    public ClassDeclaration(int access, String name, String signature, String superName,
-                            String[] interfaces, URLClassLoader loader) {
-        super(access, name, signature);
-        this.superName = superName;
-        this.interfaces = interfaces;
-        this.fields = new HashMap<String, FieldDeclaration>();
-        this.methods = new HashMap<String, Set<MethodDeclaration>>();
-        this.jarsLoader = loader;
-        this.serialVisitor = null;
-    }
+//    public ClassDeclaration(int access, String name, String signature, String superName,
+//                            String[] interfaces, URLClassLoader loader) {
+//        super(access, name, signature);
+//        this.superName = superName;
+//        this.interfaces = interfaces;
+//        this.fields = new HashMap<String, FieldDeclaration>();
+//        this.methods = new HashMap<String, Set<MethodDeclaration>>();
+//        this.jarsLoader = loader;
+//        this.serialVisitor = null;
+//    }
 
     public ClassDeclaration(int access, String name, String signature, String superName,
                             String[] interfaces, URLClassLoader loader, SerialVersionClassVisitor
cv) {
@@ -138,8 +138,7 @@ public class ClassDeclaration extends Ge
         if ((superClass != null)) {
             // load the super class of the cd
             try {
-                ClassVisitor cw = new EmptyClassVisitor();
-                SerialVersionClassVisitor cv = new SerialVersionClassVisitor(cw);
+                SerialVersionClassVisitor cv = new SerialVersionClassVisitor(null);
                 SemanticVersioningClassVisitor svc = new SemanticVersioningClassVisitor(jarsLoader,
cv);
                 ClassReader cr = new ClassReader(jarsLoader.getResourceAsStream(superClass
+ SemanticVersioningUtils.classExt));
                 cr.accept(svc, 0);
@@ -160,8 +159,7 @@ public class ClassDeclaration extends Ge
     private void getMethodsRecursively(String superClass) {
         if ((superClass != null)) {
             // load the super class of the cd
-            ClassVisitor cw = new EmptyClassVisitor();
-            SerialVersionClassVisitor cv = new SerialVersionClassVisitor(cw);
+            SerialVersionClassVisitor cv = new SerialVersionClassVisitor(null);
 
             SemanticVersioningClassVisitor svc = new SemanticVersioningClassVisitor(jarsLoader,
cv);
             // use URLClassLoader to load the class
@@ -226,8 +224,7 @@ public class ClassDeclaration extends Ge
 
         if (className != null) {
             // load the super class of the cd
-            ClassVisitor cw = new EmptyClassVisitor();
-            SerialVersionClassVisitor cv = new SerialVersionClassVisitor(cw);
+            SerialVersionClassVisitor cv = new SerialVersionClassVisitor(null);
 
             SemanticVersioningClassVisitor svc = new SemanticVersioningClassVisitor(jarsLoader,
cv);
             try {
@@ -399,8 +396,8 @@ public class ClassDeclaration extends Ge
             // check to see whether the serializable id is the same
             //ignore if it is enum
             if ((!getAllSupers().contains(SemanticVersioningUtils.ENUM_CLASS) &&
(!old.getAllSupers().contains(SemanticVersioningUtils.ENUM_CLASS)))) {
-                long oldValue = getSerialVersionUID(old);
-                long curValue = getSerialVersionUID(this);
+                Long oldValue = getSerialVersionUID(old);
+                Long curValue = getSerialVersionUID(this);
                 if ((oldValue != curValue)) {
                     reasons.add("The serializable class is no longer back compatible as the
value of SerialVersionUID has changed from " + oldValue + " to " + curValue + ".");
                 }
@@ -409,19 +406,17 @@ public class ClassDeclaration extends Ge
 
     }
 
-    private long getSerialVersionUID(ClassDeclaration cd) {
+    private Long getSerialVersionUID(ClassDeclaration cd) {
         FieldDeclaration serialID = cd.getAllFields().get(SemanticVersioningUtils.SERIAL_VERSION_UTD);
         if (serialID != null) {
             if (serialID.isFinal() && serialID.isStatic() && Type.LONG_TYPE.equals(Type.getType(serialID.getDesc())))
{
                 if (serialID.getValue() != null) {
                     return (Long) (serialID.getValue());
-                } else {
-                    return 0;
                 }
             }
         }
         // get the generated value
-        return cd.getSerialVisitor().getComputeSerialVersionUID();
+        return cd.getSerialVisitor() == null? null: cd.getSerialVisitor().getComputeSerialVersionUID();
     }
 
     private boolean isFieldTypeSame(FieldDeclaration bef_fd, FieldDeclaration cur_fd) {



Mime
View raw message