commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1393696 - /commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/analysis/ClassDifferentiator.java
Date Wed, 03 Oct 2012 19:17:45 GMT
Author: luc
Date: Wed Oct  3 19:17:44 2012
New Revision: 1393696

URL: http://svn.apache.org/viewvc?rev=1393696&view=rev
Log:
Use ASM Type instead of direct String manipulation.

Modified:
    commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/analysis/ClassDifferentiator.java

Modified: commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/analysis/ClassDifferentiator.java
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/analysis/ClassDifferentiator.java?rev=1393696&r1=1393695&r2=1393696&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/analysis/ClassDifferentiator.java
(original)
+++ commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/analysis/ClassDifferentiator.java
Wed Oct  3 19:17:44 2012
@@ -17,7 +17,6 @@
 package org.apache.commons.nabla.forward.analysis;
 
 import java.io.IOException;
-import java.io.InputStream;
 import java.lang.reflect.Field;
 import java.util.Set;
 
@@ -85,9 +84,8 @@ public class ClassDifferentiator {
 
         // get the original class
         this.primitiveClass = primitiveClass;
-        final String classResourceName = "/" + primitiveClass.getName().replace('.', '/')
+ ".class";
-        final InputStream stream = primitiveClass.getResourceAsStream(classResourceName);
-        final ClassReader reader = new ClassReader(stream);
+        final ClassReader reader =
+                new ClassReader(primitiveClass.getResourceAsStream("/" + Type.getInternalName(primitiveClass)
+ ".class"));
         primitiveNode = new ClassNode(Opcodes.ASM4);
         reader.accept(primitiveNode, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
         this.mathClasses = mathClasses;



Mime
View raw message