Skip to content

Commit

Permalink
Revert "Fixes eclipse-jdt#3213 - NPE and stack overflow protection"
Browse files Browse the repository at this point in the history
This reverts commit 97de32f.
  • Loading branch information
Rob Stryker committed Nov 7, 2024
1 parent 43c5eab commit ede027f
Showing 1 changed file with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1711,9 +1711,6 @@ public RecordComponentBinding getComponent(char[] componentName, boolean needRes
// NOTE: the return type, arg & exception types of each method of a source type are resolved when needed
@Override
public MethodBinding[] getMethods(char[] selector) {
return getMethods(selector, true);
}
public MethodBinding[] getMethods(char[] selector, boolean shouldTryAgain) {
if (!isPrototype())
return this.prototype.getMethods(selector);

Expand Down Expand Up @@ -1743,11 +1740,8 @@ public MethodBinding[] getMethods(char[] selector, boolean shouldTryAgain) {
for (int i = start; i <= end; i++) {
MethodBinding method = this.methods[i];
if (resolveTypesFor(method) == null || method.returnType == null) {
if( shouldTryAgain ) {
methods();
return getMethods(selector, false); // try again since the problem methods have been removed
}
return new MethodBinding[0];
methods();
return getMethods(selector); // try again since the problem methods have been removed
}
}
int length = end - start + 1;
Expand All @@ -1763,11 +1757,8 @@ public MethodBinding[] getMethods(char[] selector, boolean shouldTryAgain) {
? method.areParameterErasuresEqual(result[j])
: method.areParametersEqual(result[j]);
if (paramsMatch) {
if( shouldTryAgain ) {
methods();
return getMethods(selector); // try again since the duplicate methods have been removed
}
return new MethodBinding[0];
methods();
return getMethods(selector); // try again since the duplicate methods have been removed
}
}
}
Expand Down Expand Up @@ -2078,9 +2069,6 @@ private int getImplicitMethod(MethodBinding[] resolvedMethods, char[] name) {
// NOTE: the return type, arg & exception types of each method of a source type are resolved when needed
@Override
public MethodBinding[] methods() {
if( this.scope == null ) {
return new MethodBinding[0];
}

components(); // In a record declaration, the components should be complete prior to fields and probably for methods

Expand Down Expand Up @@ -2555,10 +2543,6 @@ public FieldBinding resolveTypeFor(FieldBinding field) {
}

public MethodBinding resolveTypesFor(MethodBinding method) {
if( scope == null ) {
return null;
}

ProblemReporter problemReporter = this.scope.problemReporter();
try {
IErrorHandlingPolicy suspendedPolicy = problemReporter.suspendTempErrorHandlingPolicy();
Expand Down

0 comments on commit ede027f

Please sign in to comment.