@@ -126,7 +126,7 @@ public static String getSignature(ITypeBinding typeBinding) {
126126 return Signature .C_EXTENDS + Stream .of (upper ).map (SignatureUtils ::getSignature ).collect (Collectors .joining ());
127127 }
128128 var lower = typeBinding .getWildcard ();
129- if (lower != null ) {
129+ if (lower != null && lower != typeBinding ) {
130130 return Signature .C_SUPER + SignatureUtils .getSignature (lower );
131131 }
132132 // TODO if typeBinding.getBounds(): C_EXTENDS, C_SUPER
@@ -144,7 +144,10 @@ public static String getSignature(ITypeBinding typeBinding) {
144144 res .deleteCharAt (res .length () - 1 );
145145 return res .toString ()
146146 + Signature .C_GENERIC_START
147- + Stream .of (typeBinding .getTypeArguments ()).map (SignatureUtils ::getSignature ).collect (Collectors .joining ())
147+ + Stream .of (typeBinding .getTypeArguments ())
148+ .map (SignatureUtils ::getSignature )
149+ .map (sig -> "+Ljava.lang.Object;" .equals (sig ) ? "*" : sig )
150+ .collect (Collectors .joining ())
148151 + Signature .C_GENERIC_END
149152 + Signature .C_NAME_END ;
150153 }
@@ -177,7 +180,11 @@ public static String getSignatureForTypeKey(String key) {
177180 }
178181
179182 public static String getSignature (IMethodBinding methodBinding ) {
180- return getSignatureForMethodKey (methodBinding .getKey ());
183+ return Signature .C_PARAM_START
184+ + Stream .of (methodBinding .getParameterTypes ()).map (SignatureUtils ::getSignature ).collect (Collectors .joining ())
185+ + Signature .C_PARAM_END
186+ + SignatureUtils .getSignature (methodBinding .getReturnType ());
187+ // exceptions? type params?
181188 }
182189
183190 /**
@@ -187,7 +194,7 @@ public static String getSignature(IMethodBinding methodBinding) {
187194 * @return the signature of the given method binding as a character array
188195 */
189196 public static char [] getSignatureChar (IMethodBinding methodBinding ) {
190- return getSignatureForMethodKey (methodBinding . getKey () ).toCharArray ();
197+ return getSignature (methodBinding ).toCharArray ();
191198 }
192199
193200 public static char [] getSignatureChar (IMethod method ) {
@@ -203,7 +210,7 @@ public static char[] getSignatureChar(IMethod method) {
203210 public static String getSignatureForMethodKey (String key ) {
204211 String fullKey = key
205212 .replace ('/' , '.' )
206- .replace ("< +Ljava.lang.Object;> " , "<*> " )
213+ .replace ("+Ljava.lang.Object;" , "* " )
207214 .replace ("<>;" , ";" );
208215 String removeName = fullKey .substring (fullKey .indexOf ('(' ));
209216 int firstException = removeName .indexOf ('|' );
0 commit comments