From 43a949af3158f5cd147e0469937083569dff94b3 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 24 Apr 2024 14:25:57 -0400 Subject: [PATCH] [WIP] address regression resulting in NPE Signed-off-by: David Thompson --- .../eclipse/jdt/internal/javac/dom/JavacMethodBinding.java | 2 +- .../org/eclipse/jdt/internal/javac/dom/JavacTypeBinding.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacMethodBinding.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacMethodBinding.java index a59363ca1d1..19090278e72 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacMethodBinding.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacMethodBinding.java @@ -113,7 +113,7 @@ public boolean isSynthetic() { @Override public IJavaElement getJavaElement() { - IJavaElement parent = this.resolver.getBinding(this.methodSymbol.owner, null).getJavaElement(); + IJavaElement parent = this.resolver.getBinding(this.methodSymbol.owner, this.methodType).getJavaElement(); if (parent instanceof IType type) { return type.getMethod(this.methodSymbol.getSimpleName().toString(), this.methodSymbol.params().stream() 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 a7879c98fd9..e69e084cfae 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 @@ -219,7 +219,7 @@ public ITypeBinding getGenericTypeOfWildcardType() { } if (this.typeSymbol.type instanceof WildcardType wildcardType) { // TODO: probably wrong, we might need to pass in the parent node from the AST - return (ITypeBinding)this.resolver.getBinding(wildcardType.type.tsym, null); + return (ITypeBinding)this.resolver.getBinding(wildcardType.type.tsym, wildcardType.type); } throw new IllegalStateException("Binding is a wildcard, but type cast failed"); } @@ -309,7 +309,7 @@ public IBinding getDeclaringMember() { if (!this.isLocal()) { return null; } - return this.resolver.getBinding(this.typeSymbol.owner, null); + return this.resolver.getBinding(this.typeSymbol.owner, this.typeSymbol.owner.type); } @Override