Skip to content

Commit

Permalink
Revert "Improve lambda type check by name for java21. Fix #300 (#302)" (
Browse files Browse the repository at this point in the history
#303)

This reverts commit a6c1b81.
  • Loading branch information
SarikaSinha committed Sep 4, 2023
1 parent a6c1b81 commit a6819c3
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;

Expand All @@ -42,7 +41,6 @@
public class LambdaUtils {

private static final String LAMBDA_METHOD_PREFIX = "lambda$"; //$NON-NLS-1$
private static final Pattern LAMBDA_TYPE_PATTERN = Pattern.compile(".*\\$\\$Lambda[\\$,\\.].*"); //$NON-NLS-1$

/**
* Inspects the top stack frame of the context; if that frame is a lambda frame, looks for a variable with the specified name in that frame and
Expand Down Expand Up @@ -207,8 +205,7 @@ public static boolean isLambdaFrame(IJavaStackFrame frame) throws DebugException
* @since 3.15
*/
public static boolean isLambdaField(IVariable variable) throws DebugException {
return (variable instanceof IJavaFieldVariable) &&
LAMBDA_TYPE_PATTERN.matcher(((IJavaFieldVariable) variable).getDeclaringType().getName()).matches();
return (variable instanceof IJavaFieldVariable) && ((IJavaFieldVariable) variable).getDeclaringType().getName().contains("$Lambda$"); //$NON-NLS-1$
}

/**
Expand Down

0 comments on commit a6819c3

Please sign in to comment.