diff options
Diffstat (limited to 'java/java-tests/testData/refactoring/extractMethodObject4Debugger')
7 files changed, 146 insertions, 0 deletions
diff --git a/java/java-tests/testData/refactoring/extractMethodObject4Debugger/AnonymousClassParams.java b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/AnonymousClassParams.java new file mode 100644 index 000000000000..3a722d36aeea --- /dev/null +++ b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/AnonymousClassParams.java @@ -0,0 +1,8 @@ +interface I { + void foo(int i) {} +} +class Sample { + void foo() { + System.out.println("hello <caret>world"); + } +}
\ No newline at end of file diff --git a/java/java-tests/testData/refactoring/extractMethodObject4Debugger/InnerClass.java b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/InnerClass.java new file mode 100644 index 000000000000..448724bf0543 --- /dev/null +++ b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/InnerClass.java @@ -0,0 +1,30 @@ +/* + * Copyright 2000-2014 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. + */ +class Sample { + + void a() { + System.out.println("<caret>"); + } + + class I { + public I(int i) { + } + + void foo() { + bar(); + } + } +} diff --git a/java/java-tests/testData/refactoring/extractMethodObject4Debugger/InvokeReturnType.java b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/InvokeReturnType.java new file mode 100644 index 000000000000..353941357c68 --- /dev/null +++ b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/InvokeReturnType.java @@ -0,0 +1,9 @@ +package my; + +class Sample { + static void foo() { + int x =5; + int y =5; + int <caret>z =5; + } +}
\ No newline at end of file diff --git a/java/java-tests/testData/refactoring/extractMethodObject4Debugger/OffsetsAtCallSite.java b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/OffsetsAtCallSite.java new file mode 100644 index 000000000000..353564c51240 --- /dev/null +++ b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/OffsetsAtCallSite.java @@ -0,0 +1,44 @@ +package my; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +class Java8Private { + public static void main(String[] args) { + new Java8Private().foo(); + } + + private void foo() { + final Map<Integer,Integer> map = new HashMap<Integer,Integer>(); + map.put(1, 2); + //evaluate here map.entrySet().stream().filter((a) -> (a.getKey()>0)); + <caret>new Inner(map).invoke(); + map.put(3, 5); + } + + private void zoo(int a) { + System.out.println("DONE " + a); + } + + + public class Inner extends MagicAccessorBridge { + final Map<Integer,Integer> map; + + public Inner(Map<Integer, Integer> map) { + this.map = map; + } + + void invoke() { + map.entrySet().stream().forEach((a) -> accessorZoo(Java8Private.this, a.getValue())); + } + + // accessor + void accessorZoo(Java8Private obj, int a) { + obj.zoo(a); + } + } +} + +class MagicAccessorBridge { +}
\ No newline at end of file diff --git a/java/java-tests/testData/refactoring/extractMethodObject4Debugger/ResultExpr.java b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/ResultExpr.java new file mode 100644 index 000000000000..7a83d4c57bf3 --- /dev/null +++ b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/ResultExpr.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2014 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. + */ +class Sample { + + void a() { + System.out.println("<caret>"); + } + + private int foo() { + return 1; + } +} diff --git a/java/java-tests/testData/refactoring/extractMethodObject4Debugger/ResultStatements.java b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/ResultStatements.java new file mode 100644 index 000000000000..20d69ea477b4 --- /dev/null +++ b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/ResultStatements.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2014 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. + */ +class Sample { + + void a() { + System.out.println("<caret>"); + } + + int foo() { + return 1; + } +} diff --git a/java/java-tests/testData/refactoring/extractMethodObject4Debugger/SimpleGeneration.java b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/SimpleGeneration.java new file mode 100644 index 000000000000..873f2205e1af --- /dev/null +++ b/java/java-tests/testData/refactoring/extractMethodObject4Debugger/SimpleGeneration.java @@ -0,0 +1,5 @@ +class Sample { + void foo() { + System.out.println("hello <caret>world"); + } +}
\ No newline at end of file |