maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Søren Gjesse (JIRA) <j...@apache.org>
Subject [jira] [Created] (MSHADE-288) Class Signature involving inner classes is not processed correctly
Date Wed, 30 May 2018 07:43:00 GMT
Søren Gjesse created MSHADE-288:
-----------------------------------

             Summary: Class Signature involving inner classes is not processed correctly
                 Key: MSHADE-288
                 URL: https://issues.apache.org/jira/browse/MSHADE-288
             Project: Maven Shade Plugin
          Issue Type: Bug
    Affects Versions: 3.1.1, 2.4.3
            Reporter: Søren Gjesse


The project [https://github.com/square/haha] re-package Guava and Trove as part of building.
However this cause invalid class signatures to be generated. One example is the Guava class

com.google.common.collect.AbstractMultimap$EntrySet

The original class file have this class signature:

Lcom/google/common/collect/AbstractMultimap<TK;TV;>.Entries;Ljava/util/Set<Ljava/util/Map$Entry<TK;TV;>;>;

and the class re-packaging from com.google.common to com.squareup.haha.guava has this class
signature:

Lcom/squareup/haha/guava/collect/AbstractMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMultimap$Entries;Ljava/util/Set<Ljava/util/Map$Entry<TK;TV;>;>;

which is not valid according to the specification

[https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.4|https://www.google.com/url?q=https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html%23jvms-4.3.4&sa=D&usg=AFQjCNEwyHbP2chG0jcbdAljds6pjTh4gw]

The .Entries part should not be changed to .com/squareup/haha/guava/collect/AbstractMultimap$Entries,
but stay .Entries.

After building [https://github.com/square/haha] 

$ git clone git@github.com:square/haha.git
 $ git submodule sync
 $ git submodule update --init --recursive
 $ mvn clean install

There are quite a few of these class signatures in the jar:

$ find extracted_jar -type f | xargs javap -c -s -l -v | grep Signature | grep ".*//.*\.com.*"

Signature: #42 // Lcom/squareup/haha/guava/collect/AbstractMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMultimap$Entries;Ljava/util/Set<Ljava/util/Map$Entry<TK;TV;>;>;
 Signature: #45 // (TK;Ljava/util/SortedSet<TV;>;Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$WrappedCollection;)V
 Signature: #57 // Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$WrappedCollection;Ljava/util/SortedSet<TV;>;
 Signature: #42 // Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$WrappedCollection;Ljava/util/Set<TV;>;
 Signature: #86 // (TK;Ljava/util/List<TV;>;Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$WrappedCollection;)V
 Signature: #97 // Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$WrappedCollection;Ljava/util/List<TV;>;
 Signature: #70 // Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$WrappedCollection.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$WrappedCollection$WrappedIterator;Ljava/util/ListIterator<TV;>;
 Signature: #102 // Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$WrappedCollection;
 Signature: #93 // (TK;Ljava/util/Collection<TV;>;Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$WrappedCollection;)V
 Signature: #52 // Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$KeySet;Ljava/util/SortedSet<TK;>;
 Signature: #54 // Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$AsMap;Ljava/util/SortedMap<TK;Ljava/util/Collection<TV;>;>;
 Signature: #9 // (TK;Ljava/util/List<TV;>;Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$WrappedCollection;)V
 Signature: #18 // Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$WrappedList;Ljava/util/RandomAccess;
 Signature: #25 // Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$Itr<Ljava/util/Map$Entry<TK;TV;>;>;
 Signature: #19 // Lcom/squareup/haha/guava/collect/AbstractMapBasedMultimap<TK;TV;>.com/squareup/haha/guava/collect/AbstractMapBasedMultimap$Itr<TV;>;
 Signature: #47 // Lcom/squareup/haha/trove/THashMap<TK;TV;>.com/squareup/haha/trove/THashMap$MapBackedView<Ljava/util/Map$Entry<TK;TV;>;>;
 Signature: #40 // Lcom/squareup/haha/trove/THashMap<TK;TV;>.com/squareup/haha/trove/THashMap$MapBackedView<TV;>;
 Signature: #30 // Lcom/squareup/haha/trove/THashMap<TK;TV;>.com/squareup/haha/trove/THashMap$MapBackedView<TK;>;

This is based on the findings in [https://issuetracker.google.com/80029761].



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message