diff --git a/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/compiler/JavaCompilingVisitor.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/compiler/JavaCompilingVisitor.java index 270446bf1304..5baf840e9c4a 100644 --- a/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/compiler/JavaCompilingVisitor.java +++ b/java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/compiler/JavaCompilingVisitor.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.structuralsearch.impl.matcher.compiler; import com.intellij.dupLocator.iterators.NodeIterator; @@ -307,13 +322,8 @@ public class JavaCompilingVisitor extends JavaRecursiveElementWalkingVisitor { final PsiElement previousNonWhiteSpace = PsiTreeUtil.skipSiblingsBackward(psiDeclarationStatement, PsiWhiteSpace.class); if (previousNonWhiteSpace instanceof PsiComment) { - ((DeclarationStatementHandler)handler) - .setCommentHandler(myCompilingVisitor.getContext().getPattern().getHandler(previousNonWhiteSpace)); - - myCompilingVisitor.getContext().getPattern().setHandler( - previousNonWhiteSpace, - handler - ); + ((DeclarationStatementHandler)handler).setCommentHandler(myCompilingVisitor.getContext().getPattern().getHandler(previousNonWhiteSpace)); + myCompilingVisitor.getContext().getPattern().setHandler(previousNonWhiteSpace, handler); } // detect typed symbol, it will have no variable diff --git a/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTestCase.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTestCase.java index 6b8aceaba590..d376a2018a7f 100644 --- a/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTestCase.java +++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTestCase.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.structuralsearch; import com.intellij.codeInsight.daemon.quickFix.LightQuickFixTestCase; @@ -46,19 +61,18 @@ abstract class StructuralSearchTestCase extends LightQuickFixTestCase { String pattern, boolean filePattern, FileType patternFileType, - Language patternLanugage, + Language patternLanguage, FileType sourceFileType, String sourceExtension, boolean physicalSourceFile) { - return findMatches(in, pattern, filePattern, patternFileType, patternLanugage, sourceFileType, sourceExtension, physicalSourceFile, - true); + return findMatches(in, pattern, filePattern, patternFileType, patternLanguage, sourceFileType, sourceExtension, physicalSourceFile, true); } protected List findMatches(String in, String pattern, boolean filePattern, FileType patternFileType, - Language patternLanugage, + Language patternLanguage, FileType sourceFileType, String sourceExtension, boolean physicalSourceFile, @@ -70,7 +84,7 @@ abstract class StructuralSearchTestCase extends LightQuickFixTestCase { } pattern = options.getSearchPattern(); options.setFileType(patternFileType); - options.setDialect(patternLanugage); + options.setDialect(patternLanguage); MatcherImpl.validate(getProject(), options); return testMatcher.testFindMatches(in, pattern, options, filePattern, sourceFileType, sourceExtension, physicalSourceFile); @@ -88,10 +102,6 @@ abstract class StructuralSearchTestCase extends LightQuickFixTestCase { return findMatchesCount(in,pattern,false); } - protected List findMatches(String in, String pattern) { - return findMatches(in,pattern,false, StdFileTypes.JAVA); - } - protected String loadFile(String fileName) throws IOException { return FileUtilRt.loadFile(new File(getTestDataPath() + fileName), CharsetToolkit.UTF8, true); }