You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by dk...@apache.org on 2009/04/09 15:27:23 UTC

svn commit: r763640 - /maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java

Author: dkulp
Date: Thu Apr  9 13:27:23 2009
New Revision: 763640

URL: http://svn.apache.org/viewvc?rev=763640&view=rev
Log:
Fix an issue where classes only referenced as arrays are not being properly shaded.

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=763640&r1=763639&r2=763640&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 Apr  9 13:27:23 2009
@@ -302,9 +302,52 @@
                         value = r.relocateClass( name );
                         break;
                     }
+                    if ( name.length() > 0 && name.charAt( 0 ) == '[' ) 
+                    {
+                        int count = 0;
+                        while ( name.length() > 0 && name.charAt(0) == '[' ) 
+                        {
+                            name = name.substring( 1 );
+                            ++count;
+                        }
+                        
+                        if ( name.length() > 0 
+                             && name.charAt( 0 ) == 'L'
+                             && name.charAt( name.length() - 1 ) == ';' ) 
+                        {
+                            name = name.substring( 1, name.length() - 1 );
+                                                        
+                            if ( r.canRelocatePath( name ) )
+                            {
+                                value = 'L' + r.relocatePath( name ) + ';';
+                                while ( count > 0 ) 
+                                {
+                                    value = '[' + value;
+                                    --count;
+                                }
+                                break;
+                            }
+
+                            if ( r.canRelocateClass( name ) )
+                            {
+                                value = 'L' + r.relocateClass( name ) + ';';
+                                while (count > 0) 
+                                {
+                                    value = '[' + value;
+                                    --count;
+                                }
+                                break;
+                            }
+                            
+                        }
+                    }
                 }
 
                 return value;
+            } 
+            else 
+            {
+                object = super.mapValue( object );
             }
             return object;
         }



Re: svn commit: r763640 - /maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java

Posted by Daniel Kulp <dk...@apache.org>.
On Thu April 9 2009 2:10:03 pm Benjamin Bentmann wrote:
> Hi Dan,
>
> > Author: dkulp
> > Date: Thu Apr  9 13:27:23 2009
> > New Revision: 763640
> >
> > URL: http://svn.apache.org/viewvc?rev=763640&view=rev
> > Log:
> > Fix an issue where classes only referenced as arrays are not being
> > properly shaded.
>
> For the release notes, shouldn't there be a corresponding JIRA issue?

Possible.   I THINK it's the cause of MSHADE-47 and thus MSHADE-47 may be 
resolvable, but I really don't have the time (or the hibernate knowledge) to 
verify that.

I'm also couldn't reproduce it using anything small enough to be considered 
for a test case.   Thus, I'm not even sure if the above description is really 
correct.   I just know that in SOME cases, I was seeing something like 
"[Lcom.foo.Blah;" and "[Lcom/foo/Blah;" coming into the remapper which, from a 
straight naming standpoint, means arrays, but doing something like adding 
arrays fields/params didn't trigger it.   Not really sure what was.

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r763640 - /maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java

Posted by Benjamin Bentmann <be...@udo.edu>.
Hi Dan,

> Author: dkulp
> Date: Thu Apr  9 13:27:23 2009
> New Revision: 763640
> 
> URL: http://svn.apache.org/viewvc?rev=763640&view=rev
> Log:
> Fix an issue where classes only referenced as arrays are not being properly shaded.

For the release notes, shouldn't there be a corresponding JIRA issue?


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org