]> source.dussan.org Git - aspectj.git/commitdiff
UnresolvedType.signatureToName: fix '*' case for generic type '?'
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Tue, 17 Jan 2023 15:02:03 +0000 (16:02 +0100)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Fri, 12 Apr 2024 13:32:39 +0000 (15:32 +0200)
In generic type lists, after a '*' in any type parameter list, sometimes
the '*' (which should be converted to '?') itself and always the
subsequent parameters would be missing from the signature:

  - '[Pjava/util/Collection<*>;' yielded
    'java.util.Collection<>[]', but should be
    'java.util.Collection<?>[]'

  - '[Pjava/util/Map<*Pjava/util/List<[Ljava/lang/Integer;>;>;' yielded
    'java.util.Map<?>[]', but should be
    'java.util.Map<?,java.util.List<java.lang.Integer[]>>[]'

This is now fixed.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
org.aspectj.matcher/src/main/java/org/aspectj/weaver/UnresolvedType.java

index 37780023c56465bfc7e1c3b8a95c0a4c5950733f..e911ba44fc3afac45e14dd653974735561885764 100644 (file)
@@ -676,7 +676,7 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement {
                                                if (paramNestLevel > 0) {
                                                        innerBuff.append(c);
                                                }
-                                               if (c == ';' && paramNestLevel == 1) {
+                                               if ((c == ';' || c == '*') && paramNestLevel == 1) {
                                                        nameBuff.append(signatureToName(innerBuff.toString()));
                                                        if (signature.charAt(i + 1) != '>') {
                                                                nameBuff.append(',');