From 1ad70d1bb1e9d551635a0dcf80bff6baa23b6586 Mon Sep 17 00:00:00 2001 From: Rob Stryker Date: Mon, 25 Nov 2024 16:44:39 -0500 Subject: [PATCH] Fix testTypeParameterConstructors04 and others Signed-off-by: Rob Stryker --- .../jdt/internal/javac/dom/JavacTypeBinding.java | 10 +++++++--- .../core/search/matching/TypeParameterLocator.java | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacTypeBinding.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacTypeBinding.java index 9cfcf1465d3..e0110d61b73 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacTypeBinding.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacTypeBinding.java @@ -773,9 +773,13 @@ public String getName(boolean checkParameterized) { ITypeBinding[] types = this.getUncheckedTypeArguments(this.type, this.typeSymbol); if (types != null && types.length > 0) { builder.append("<"); - for (var typeArgument : types) { - if (typeArgument != null) { - builder.append(typeArgument.getName()); + for (int z = 0; z < types.length; z++ ) { + ITypeBinding zBinding = types[z]; + if (zBinding != null) { + builder.append(zBinding.getName()); + if( z != types.length - 1) { + builder.append(","); + } } } builder.append(">"); diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.java index 7987507a46c..1adb3026d28 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.java @@ -155,8 +155,9 @@ protected int matchTypeParameter(ITypeBinding variable, boolean matchName) { if (methBinding.getParameterTypes() == null) { if (length == 0) return ACCURATE_MATCH; } else if (methBinding.getParameterTypes().length == length){ + ITypeBinding[] p = methBinding.getParameterTypes(); for (int i=0; i