You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@river.apache.org by pe...@apache.org on 2014/03/26 09:50:57 UTC
svn commit: r1581750 - in /river/jtsk/skunk/qa_refactor/trunk: ./
dep-libs/asm/ src/com/sun/jini/tool/classdepend/ src/manifest/
Author: peter_firmstone
Date: Wed Mar 26 08:50:56 2014
New Revision: 1581750
URL: http://svn.apache.org/r1581750
Log:
Update ASM from 3.2 to 5.0.1, although the library has been updated, no support for dependency resolution of Java 8 Language features has been implemented.
Added:
river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-5.0.1.jar (with props)
river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-5.0.1.pom
river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-commons-5.0.1.jar (with props)
river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-commons-5.0.1.pom
river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-tree-5.0.1.jar (with props)
river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-tree-5.0.1.pom
river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm.LICENSE.txt
Removed:
river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/README
river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-3.2.jar
river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-commons-3.2.jar
river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-tree-3.2.jar
river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm.LICENSE
river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/tool/classdepend/AbstractVisitor.java
Modified:
river/jtsk/skunk/qa_refactor/trunk/LICENSE
river/jtsk/skunk/qa_refactor/trunk/common.xml
river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/tool/classdepend/AbstractDependencyVisitor.java
river/jtsk/skunk/qa_refactor/trunk/src/manifest/tools.mf
Modified: river/jtsk/skunk/qa_refactor/trunk/LICENSE
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/LICENSE?rev=1581750&r1=1581749&r2=1581750&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/LICENSE (original)
+++ river/jtsk/skunk/qa_refactor/trunk/LICENSE Wed Mar 26 08:50:56 2014
@@ -206,10 +206,10 @@ APACHE RIVER SUBCOMPONENTS:
Apache River includes some external software components. Your use of these
components is subject to the terms and conditions of the following licenses:
-ASM libraries (tools/asm-3.2.jar and tools/asm-commons-3.2.jar)
+ASM libraries (tools/asm-5.0.1.jar and tools/asm-commons-5.0.1.jar)
ASM: a very small and fast Java bytecode manipulation framework
- Copyright (c) 2000-2005 INRIA, France Telecom
+ Copyright (c) 2000-20011 INRIA, France Telecom
All rights reserved.
Redistribution and use in source and binary forms, with or without
Modified: river/jtsk/skunk/qa_refactor/trunk/common.xml
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/common.xml?rev=1581750&r1=1581749&r2=1581750&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/common.xml (original)
+++ river/jtsk/skunk/qa_refactor/trunk/common.xml Wed Mar 26 08:50:56 2014
@@ -126,8 +126,8 @@
</path>
<fileset id="asm.jars" dir="${root}/dep-libs/asm">
- <include name="asm-3.2.jar" />
- <include name="asm-commons-3.2.jar" />
+ <include name="asm-5.0.1.jar" />
+ <include name="asm-commons-5.0.1.jar" />
</fileset>
<fileset id="velocity.jars" dir="${root}/dep-libs/velocity">
Added: river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-5.0.1.jar
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-5.0.1.jar?rev=1581750&view=auto
==============================================================================
Binary file - no diff available.
Propchange: river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-5.0.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-5.0.1.pom
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-5.0.1.pom?rev=1581750&view=auto
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-5.0.1.pom (added)
+++ river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-5.0.1.pom Wed Mar 26 08:50:56 2014
@@ -0,0 +1,44 @@
+<!--
+ ! ASM: a very small and fast Java bytecode manipulation framework
+ ! Copyright (c) 2000-2011 INRIA, France Telecom
+ ! All rights reserved.
+ !
+ ! Redistribution and use in source and binary forms, with or without
+ ! modification, are permitted provided that the following conditions
+ ! are met:
+ ! 1. Redistributions of source code must retain the above copyright
+ ! notice, this list of conditions and the following disclaimer.
+ ! 2. Redistributions in binary form must reproduce the above copyright
+ ! notice, this list of conditions and the following disclaimer in the
+ ! documentation and/or other materials provided with the distribution.
+ ! 3. Neither the name of the copyright holders nor the names of its
+ ! contributors may be used to endorse or promote products derived from
+ ! this software without specific prior written permission.
+ !
+ ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ ! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ ! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ ! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ ! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ ! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ ! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ ! THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>asm-parent</artifactId>
+ <groupId>org.ow2.asm</groupId>
+ <version>5.0.1</version>
+ </parent>
+
+ <name>ASM Core</name>
+ <artifactId>asm</artifactId>
+ <packaging>jar</packaging>
+
+</project>
Added: river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-commons-5.0.1.jar
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-commons-5.0.1.jar?rev=1581750&view=auto
==============================================================================
Binary file - no diff available.
Propchange: river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-commons-5.0.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-commons-5.0.1.pom
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-commons-5.0.1.pom?rev=1581750&view=auto
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-commons-5.0.1.pom (added)
+++ river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-commons-5.0.1.pom Wed Mar 26 08:50:56 2014
@@ -0,0 +1,51 @@
+<!--
+ ! ASM: a very small and fast Java bytecode manipulation framework
+ ! Copyright (c) 2000-2011 INRIA, France Telecom
+ ! All rights reserved.
+ !
+ ! Redistribution and use in source and binary forms, with or without
+ ! modification, are permitted provided that the following conditions
+ ! are met:
+ ! 1. Redistributions of source code must retain the above copyright
+ ! notice, this list of conditions and the following disclaimer.
+ ! 2. Redistributions in binary form must reproduce the above copyright
+ ! notice, this list of conditions and the following disclaimer in the
+ ! documentation and/or other materials provided with the distribution.
+ ! 3. Neither the name of the copyright holders nor the names of its
+ ! contributors may be used to endorse or promote products derived from
+ ! this software without specific prior written permission.
+ !
+ ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ ! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ ! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ ! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ ! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ ! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ ! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ ! THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>asm-parent</artifactId>
+ <groupId>org.ow2.asm</groupId>
+ <version>5.0.1</version>
+ </parent>
+
+ <name>ASM Commons</name>
+ <artifactId>asm-commons</artifactId>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <artifactId>asm-tree</artifactId>
+ <groupId>org.ow2.asm</groupId>
+ </dependency>
+ </dependencies>
+
+</project>
Added: river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-tree-5.0.1.jar
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-tree-5.0.1.jar?rev=1581750&view=auto
==============================================================================
Binary file - no diff available.
Propchange: river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-tree-5.0.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-tree-5.0.1.pom
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-tree-5.0.1.pom?rev=1581750&view=auto
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-tree-5.0.1.pom (added)
+++ river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm-tree-5.0.1.pom Wed Mar 26 08:50:56 2014
@@ -0,0 +1,51 @@
+<!--
+ ! ASM: a very small and fast Java bytecode manipulation framework
+ ! Copyright (c) 2000-2011 INRIA, France Telecom
+ ! All rights reserved.
+ !
+ ! Redistribution and use in source and binary forms, with or without
+ ! modification, are permitted provided that the following conditions
+ ! are met:
+ ! 1. Redistributions of source code must retain the above copyright
+ ! notice, this list of conditions and the following disclaimer.
+ ! 2. Redistributions in binary form must reproduce the above copyright
+ ! notice, this list of conditions and the following disclaimer in the
+ ! documentation and/or other materials provided with the distribution.
+ ! 3. Neither the name of the copyright holders nor the names of its
+ ! contributors may be used to endorse or promote products derived from
+ ! this software without specific prior written permission.
+ !
+ ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ ! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ ! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ ! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ ! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ ! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ ! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ ! THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>asm-parent</artifactId>
+ <groupId>org.ow2.asm</groupId>
+ <version>5.0.1</version>
+ </parent>
+
+ <name>ASM Tree</name>
+ <artifactId>asm-tree</artifactId>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <artifactId>asm</artifactId>
+ <groupId>org.ow2.asm</groupId>
+ </dependency>
+ </dependencies>
+
+</project>
Added: river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm.LICENSE.txt
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm.LICENSE.txt?rev=1581750&view=auto
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm.LICENSE.txt (added)
+++ river/jtsk/skunk/qa_refactor/trunk/dep-libs/asm/asm.LICENSE.txt Wed Mar 26 08:50:56 2014
@@ -0,0 +1,31 @@
+*******************************************************************************
+* ASM: a very small and fast Java bytecode manipulation framework
+* Copyright (c) 2000-2011 INRIA, France Telecom
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the distribution.
+* 3. Neither the name of the copyright holders nor the names of its
+* contributors may be used to endorse or promote products derived from
+* this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+* THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************
+
+This directory contains the documentation of the product.
Modified: river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/tool/classdepend/AbstractDependencyVisitor.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/tool/classdepend/AbstractDependencyVisitor.java?rev=1581750&r1=1581749&r2=1581750&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/tool/classdepend/AbstractDependencyVisitor.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/tool/classdepend/AbstractDependencyVisitor.java Wed Mar 26 08:50:56 2014
@@ -37,6 +37,7 @@ import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.signature.SignatureReader;
import org.objectweb.asm.signature.SignatureVisitor;
@@ -45,14 +46,17 @@ import org.objectweb.asm.signature.Signa
*
*
*/
-abstract class AbstractDependencyVisitor extends AbstractVisitor {
+abstract class AbstractDependencyVisitor extends ClassVisitor {
- AbstractDependencyVisitor() { }
+ AbstractDependencyVisitor() {
+ super(Opcodes.ASM5);
+ }
abstract protected void addName(String name);
/* -- ClassVisitor -- */
+ @Override
public void visit(int version, int access, String name, String signature,
String superName, String[] interfaces)
{
@@ -62,13 +66,18 @@ abstract class AbstractDependencyVisitor
} else {
addSignature(signature);
}
+ super.visit(version, access, name, signature, superName, interfaces);
}
+ @Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
addDesc(desc);
- return this;
+ AnnotationVisitor ann = super.visitAnnotation(desc, visible);
+ if (ann != null) return new AnnotationVisit(Opcodes.ASM5, ann);
+ return null;
}
+ @Override
public FieldVisitor visitField(int access, String name, String desc,
String signature, Object value)
{
@@ -80,9 +89,10 @@ abstract class AbstractDependencyVisitor
if (value instanceof Type) {
addType((Type) value);
}
- return this;
+ return super.visitField(access, name, desc, signature, value);
}
+ @Override
public MethodVisitor visitMethod(int access, String name, String desc,
String signature, String[] exceptions)
{
@@ -92,9 +102,10 @@ abstract class AbstractDependencyVisitor
addSignature(signature);
}
addNames(exceptions);
- return this;
+ return new MethodVisit(Opcodes.ASM5, super.visitMethod(api, desc, desc, desc, exceptions));
}
+ @Override
public void visitInnerClass(String name, String outerName,
String innerName, int access)
{
@@ -102,116 +113,12 @@ abstract class AbstractDependencyVisitor
* Yes the old ClassDep tool includes them */
addNameInternal(outerName);
addNameInternal(name);
+ super.visitInnerClass(name, outerName, innerName, access);
}
- /* -- MethodVisitor -- */
-
- public AnnotationVisitor visitParameterAnnotation(int parameter,
- String desc,
- boolean visible)
- {
- addDesc(desc);
- return this;
- }
-
- public void visitTypeInsn(int opcode, String desc) {
- if (desc.charAt(0) == '[') {
- addDesc(desc);
- } else {
- addNameInternal(desc);
- }
- }
-
- public void visitFieldInsn(int opcode, String owner, String name,
- String desc)
- {
- addNameInternal(owner);
- addDesc(desc);
- }
-
- String pattern = "^\\[{0,2}L{0,1}(\\w+[/.]{1}[\\w$\\d/.]+);{0,1}$";
- Pattern arrayOfObjects = Pattern.compile(pattern);
- public void visitMethodInsn(int opcode, String owner, String name,
- String desc)
- {
- /* This filters out Generic's and primitive owners.
- *
- * Also when the owner is an array, containing Objects and
- * the method name is clone(), (I think it's got something to do
- * with cloning array's, this must be a new java 5 language feature
- * I tested 1.4 code without this ever occurring)
- * we can't get the Object's type
- * using Type.getType(owner) due to the nature of
- * the ASM Core API requiring bytecode be read sequentially.
- * This only occurs with clone() which returns java.lang.Object
- */
- Matcher match = arrayOfObjects.matcher(owner);
- while (match.find()){
- String object = match.group(1);
- addNameInternal(object);
- }
- addMethodDesc(desc);
- }
-
- public void visitLdcInsn(Object cst) {
- if (cst instanceof Type) {
- addType((Type) cst);
- }
- }
-
- public void visitMultiANewArrayInsn(String desc, int dims) {
- addDesc(desc);
- }
-
- public void visitLocalVariable(String name, String desc, String signature,
- Label start, Label end, int index)
- {
- if (signature != null) {
- addTypeSignature(signature);
- }
- }
-
- public void visitTryCatchBlock(Label start, Label end, Label handler,
- String type)
- {
- addNameInternal(type);
- }
-
- /* -- AnnotationVisitor -- */
-
- public void visit(String name, Object value) {
- if (value instanceof Type) {
- addType((Type) value);
- }
- }
-
- public void visitEnum(String name, String desc, String value) {
- addDesc(desc);
- }
-
- public AnnotationVisitor visitAnnotation(String name, String desc) {
- addDesc(desc);
- return this;
- }
-
- /* -- SignatureVisitor -- */
-
- public void visitTypeVariable(String name) {
- /* XXX: Need to do something? */
- //System.out.println(name);
- }
-
- public void visitClassType(String name) {
- addNameInternal(name);
- }
-
- public void visitInnerClassType(String name) {
- // This is not a fully qualified class name, ignore.
- }
-
- /* -- Utilities -- */
+ /* -- Utilities -- */
- private void addNameInternal(String name) {
+ private void addNameInternal(String name) {
if (name != null) {
addName(name.replace('/', '.'));
}
@@ -252,10 +159,171 @@ abstract class AbstractDependencyVisitor
}
private void addSignature(String signature) {
- new SignatureReader(signature).accept(this);
+ new SignatureReader(signature).accept(new SignatureVisit(Opcodes.ASM5));
}
private void addTypeSignature(String signature) {
- new SignatureReader(signature).acceptType(this);
+ new SignatureReader(signature).acceptType(new SignatureVisit(Opcodes.ASM5));
+ }
+
+ /**
+ * Annotations
+ */
+ private class AnnotationVisit extends AnnotationVisitor {
+
+ public AnnotationVisit(int i, AnnotationVisitor av) {
+ super(i, av);
+ }
+
+ @Override
+ public void visit(String name, Object value) {
+ if (value instanceof Type) {
+ addType((Type) value);
+ }
+ super.visit(name, value);
+ }
+
+ @Override
+ public void visitEnum(String name, String desc, String value) {
+ addDesc(desc);
+ super.visitEnum(name,desc,value);
+ }
+
+ @Override
+ public AnnotationVisitor visitAnnotation(String name, String desc) {
+ addDesc(desc);
+ AnnotationVisitor ann = super.visitAnnotation(name, desc);
+ if (ann != null) return new AnnotationVisit( Opcodes.ASM5, ann);
+ return null;
+ }
+
+ }
+
+ /**
+ * MethodVisit delegates to encapsulated MethodVisitor as well as
+ * recording dependencies.
+ */
+ private class MethodVisit extends MethodVisitor {
+
+ public MethodVisit(int i, MethodVisitor mv) {
+ super(i, mv);
+ }
+
+ @Override
+ public AnnotationVisitor visitParameterAnnotation(int parameter,
+ String desc,
+ boolean visible)
+ {
+ addDesc(desc);
+ AnnotationVisitor ann = super.visitParameterAnnotation(parameter, desc, visible);
+ if (ann != null) return new AnnotationVisit(Opcodes.ASM5, ann );
+ return null;
+ }
+ @Override
+ public void visitTypeInsn(int opcode, String desc) {
+ if (desc.charAt(0) == '[') {
+ addDesc(desc);
+ } else {
+ addNameInternal(desc);
+ }
+ super.visitTypeInsn(opcode, desc);
+ }
+
+ @Override
+ public void visitFieldInsn(int opcode, String owner, String name,
+ String desc)
+ {
+ addNameInternal(owner);
+ addDesc(desc);
+ super.visitFieldInsn(opcode, owner, name, desc);
+ }
+
+ String pattern = "^\\[{0,2}L{0,1}(\\w+[/.]{1}[\\w$\\d/.]+);{0,1}$";
+ Pattern arrayOfObjects = Pattern.compile(pattern);
+ @Override
+ public void visitMethodInsn(int opcode, String owner, String name,
+ String desc, boolean itf)
+ {
+ /* This filters out Generic's and primitive owners.
+ *
+ * Also when the owner is an array, containing Objects and
+ * the method name is clone(), (I think it's got something to do
+ * with cloning array's, this must be a new java 5 language feature
+ * I tested 1.4 code without this ever occurring)
+ * we can't get the Object's type
+ * using Type.getType(owner) due to the nature of
+ * the ASM Core API requiring bytecode be read sequentially.
+ * This only occurs with clone() which returns java.lang.Object
+ */
+ Matcher match = arrayOfObjects.matcher(owner);
+ while (match.find()){
+ String object = match.group(1);
+ addNameInternal(object);
+ }
+ addMethodDesc(desc);
+ super.visitMethodInsn(opcode, owner, name, desc, itf);
+ }
+
+ @Override
+ public void visitLdcInsn(Object cst) {
+ if (cst instanceof Type) {
+ addType((Type) cst);
+ }
+ super.visitLdcInsn(cst);
+ }
+
+ @Override
+ public void visitMultiANewArrayInsn(String desc, int dims) {
+ addDesc(desc);
+ super.visitMultiANewArrayInsn(desc,dims);
+ }
+
+ @Override
+ public void visitLocalVariable(String name, String desc, String signature,
+ Label start, Label end, int index)
+ {
+ if (signature != null) {
+ addTypeSignature(signature);
+ }
+ super.visitLocalVariable(name, desc, signature, start, end, index);
+ }
+
+ @Override
+ public void visitTryCatchBlock(Label start, Label end, Label handler,
+ String type)
+ {
+ addNameInternal(type);
+ super.visitTryCatchBlock(start, end, handler, type);
+ }
+ }
+
+ /**
+ * Signatures
+ */
+ private class SignatureVisit extends SignatureVisitor {
+
+ public SignatureVisit(int i) {
+ super(i);
+ }
+
+ @Override
+ public void visitTypeVariable(String name) {
+ /* XXX: Need to do something? */
+ //System.out.println(name);
+ super.visitTypeVariable(name);
+ }
+
+ @Override
+ public void visitClassType(String name) {
+ addNameInternal(name);
+ super.visitClassType(name);
+ }
+
+ @Override
+ public void visitInnerClassType(String name) {
+ // This is not a fully qualified class name, ignore.
+ super.visitInnerClassType(name);
+ }
+
}
}
Modified: river/jtsk/skunk/qa_refactor/trunk/src/manifest/tools.mf
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/manifest/tools.mf?rev=1581750&r1=1581749&r2=1581750&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/src/manifest/tools.mf (original)
+++ river/jtsk/skunk/qa_refactor/trunk/src/manifest/tools.mf Wed Mar 26 08:50:56 2014
@@ -1,3 +1,3 @@
Manifest-Version: 1.0
Main-Class: com.sun.jini.tool.ClassServer
-Class-Path: jsk-platform.jar jsk-lib.jar asm-3.2.jar asm-commons-3.2.jar
+Class-Path: jsk-platform.jar jsk-lib.jar asm-5.0.1.jar asm-commons-5.0.1.jar