diff --git a/java/java-tests/testData/refactoring/extractMethod/AnonInner_after.java b/java/java-tests/testData/refactoring/extractMethod/AnonInner_after.java index 64daea1fa040..c63341f6dc46 100644 --- a/java/java-tests/testData/refactoring/extractMethod/AnonInner_after.java +++ b/java/java-tests/testData/refactoring/extractMethod/AnonInner_after.java @@ -16,10 +16,10 @@ class Foo { public void actionPerformed( ActionEvent e ) { newMethod(); } + + private void newMethod() { + setVisible( false ); + } }; } - - private void newMethod() { - setVisible( false ); - } } diff --git a/java/java-tests/testSrc/com/intellij/refactoring/ExtractMethodTest.java b/java/java-tests/testSrc/com/intellij/refactoring/ExtractMethodTest.java index 96455722bb26..6602b68e390b 100644 --- a/java/java-tests/testSrc/com/intellij/refactoring/ExtractMethodTest.java +++ b/java/java-tests/testSrc/com/intellij/refactoring/ExtractMethodTest.java @@ -3,6 +3,8 @@ package com.intellij.refactoring; import com.intellij.codeInsight.CodeInsightUtil; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; +import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.openapi.projectRoots.impl.JavaSdkImpl; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiExpression; import com.intellij.psi.PsiFile; @@ -27,6 +29,10 @@ public class ExtractMethodTest extends LightCodeInsightTestCase { return JavaTestUtil.getJavaTestDataPath(); } + @Override + protected Sdk getProjectJDK() { + return JavaSdkImpl.getMockJdk15("java 1.5"); + } public void testExitPoints1() throws Exception { doExitPointsTest(true);