File tree Expand file tree Collapse file tree
src/main/java/com/puppycrawl/tools/checkstyle/checks/coding Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -413,17 +413,11 @@ private static boolean isNonLocalTypeDeclaration(DetailAST typeDeclAst) {
413413 private static DetailAST getBlockContainingLocalAnonInnerClass (DetailAST literalNewAst ) {
414414 DetailAST currentAst = literalNewAst ;
415415 DetailAST result = null ;
416- DetailAST topMostLambdaAst = null ;
417416 while (currentAst != null && !TokenUtil .isOfType (currentAst , CONTAINERS_FOR_ANON_INNERS )) {
418- if (currentAst .getType () == TokenTypes .LAMBDA ) {
419- topMostLambdaAst = currentAst ;
420- }
421417 currentAst = currentAst .getParent ();
422- result = currentAst ;
423- }
424-
425- if (currentAst == null ) {
426- result = topMostLambdaAst ;
418+ if (currentAst != null ) {
419+ result = currentAst ;
420+ }
427421 }
428422 return result ;
429423 }
You can’t perform that action at this time.
0 commit comments