diff options
author | Manoj Palat | 2018-08-16 09:20:12 +0000 |
---|---|---|
committer | Manoj Palat | 2018-08-17 03:26:21 +0000 |
commit | 5c1f8dfb7df86db618eaf450c367e5fce7e6663d (patch) | |
tree | 72e93796cebdecaca16282fbeb556040127a6df9 /org.eclipse.jdt.core | |
parent | 7879f2df9b95dd9e68390b59043451d2ddac7ffc (diff) | |
download | eclipse.jdt.core-5c1f8dfb7df86db618eaf450c367e5fce7e6663d.tar.gz eclipse.jdt.core-5c1f8dfb7df86db618eaf450c367e5fce7e6663d.tar.xz eclipse.jdt.core-5c1f8dfb7df86db618eaf450c367e5fce7e6663d.zip |
Bug 537593 Eclipse cannot make up its mind if there is synthetic access
code involved or not
Diffstat (limited to 'org.eclipse.jdt.core')
-rw-r--r-- | org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java index 02c0f5127e..9a86b92edc 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java @@ -33,6 +33,7 @@ import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding; import org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment; import org.eclipse.jdt.internal.compiler.lookup.MethodScope; import org.eclipse.jdt.internal.compiler.lookup.ModuleBinding; +import org.eclipse.jdt.internal.compiler.lookup.Scope; import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; import org.eclipse.jdt.internal.compiler.lookup.TypeIds; import org.eclipse.jdt.internal.compiler.parser.NLSTag; @@ -553,8 +554,17 @@ public void recordStringLiteral(StringLiteral literal, boolean fromRecovery) { this.stringLiterals[this.stringLiteralsPtr++] = literal; } -public void recordSuppressWarnings(IrritantSet irritants, Annotation annotation, int scopeStart, int scopeEnd, ReferenceContext context) { +private boolean isLambdaExpressionCopyContext(ReferenceContext context) { if (context instanceof LambdaExpression && context != ((LambdaExpression) context).original()) + return true; // Do not record from copies. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=441929 + Scope cScope = context instanceof AbstractMethodDeclaration ? ((AbstractMethodDeclaration) context).scope : + context instanceof TypeDeclaration ? ((TypeDeclaration) context).scope : + context instanceof LambdaExpression ? ((LambdaExpression) context).scope : + null; + return cScope != null ? isLambdaExpressionCopyContext(cScope.parent.referenceContext()) : false; +} +public void recordSuppressWarnings(IrritantSet irritants, Annotation annotation, int scopeStart, int scopeEnd, ReferenceContext context) { + if (isLambdaExpressionCopyContext(context)) return; // Do not record from copies. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=441929 if (this.suppressWarningIrritants == null) { |