Author: olamy
Date: Thu Mar  8 20:52:46 2012
New Revision: 1298572

URL: http://svn.apache.org/viewvc?rev=1298572&view=rev
Log:
[MSHADE-105] Classes processed by the relocator still have references to the 
original classes in their constant pools.
Submitted by Andreas Veithen.

Modified:
    
maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java

Modified: 
maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java?rev=1298572&r1=1298571&r2=1298572&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java
 (original)
+++ 
maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java
 Thu Mar  8 20:52:46 2012
@@ -261,7 +261,12 @@ public class DefaultShader
 
         ClassReader cr = new ClassReader( is );
 
-        ClassWriter cw = new ClassWriter( cr, 0 );
+        // We don't pass the ClassReader here. This forces the ClassWriter to 
rebuild the constant pool.
+        // Copying the original constant pool should be avoided because it 
would keep references
+        // to the original class names. This is not a problem at runtime 
(because these entries in the
+        // constant pool are never used), but confuses some tools such as 
Felix' maven-bundle-plugin
+        // that use the constant pool to determine the dependencies of a class.
+        ClassWriter cw = new ClassWriter( 0 );
 
         ClassVisitor cv = new TempRemappingClassAdapter( cw, remapper );
 


Reply via email to