kriegaex commented on a change in pull request #95:
URL: https://github.com/apache/maven-shade-plugin/pull/95#discussion_r637089383



##########
File path: src/main/java/org/apache/maven/plugins/shade/DefaultShader.java
##########
@@ -694,6 +702,11 @@ private void addResource( Set<String> resources, 
JarOutputStream jos, String nam
 
         List<Relocator> relocators;
 
+        // Use thread-local, just in case 'map*' calls are ever done 
concurrently. Make sure that the using class
+        // initialises this value according to its needs, usually setting the 
value to false per file before starting
+        // relocation.
+        ThreadLocal<Boolean> wasRelocated = new ThreadLocal<>();

Review comment:
       > Start by creating a ShadeClassRemapper... 
   
   It is after midnight here, maybe I can look into it tomorrow when I can 
think straight again. Thanks. 
   
   > Another thing to test is just to compare the byte[] before and after
   
   No, that is exactly what is **not** working and what my change is about: to 
determine that no relocation had taken place, even though the byte code is 
different due to rewriting with ASM. Those different files, even though I was 
sure they were unrelated to any relocation, were what triggered my attention 
and made me discover what was going on here. So that idea is a dead end. Maybe 
check out and use my code, looking at it as a whole instead of focusing on the 
thread-local, if you have not done so yet, don't just look at it on GitHub.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to