diff options
Diffstat (limited to 'plugins/IntentionPowerPak/test/com')
37 files changed, 395 insertions, 34 deletions
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/catchToThrows/SingleCatch.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/catchToThrows/SingleCatch.java index e4b20b45496f..d584d799a779 100644 --- a/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/catchToThrows/SingleCatch.java +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/catchToThrows/SingleCatch.java @@ -21,6 +21,6 @@ class C { /* important comment */ f(); // another comment - } <caret>catch (Exception ignore) { } + } catch (Exception <caret>ignore) { } } }
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/detail/PolyadicParentheses.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/detail/PolyadicParentheses.java new file mode 100644 index 000000000000..750abe1ab026 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/detail/PolyadicParentheses.java @@ -0,0 +1,20 @@ +package com.siyeh.ipp.exceptions.detail; + +import java.io.IOException; + +public class PolyadicParentheses { + + void box() { + try { + System.out.println(one() && (two()) && one()); + } c<caret>atch (Exception e) {} + } + + boolean one() throws IOException { + return false; + } + + boolean two() throws NoSuchFieldException { + return false; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/detail/PolyadicParentheses_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/detail/PolyadicParentheses_after.java new file mode 100644 index 000000000000..b52f62c1691c --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/detail/PolyadicParentheses_after.java @@ -0,0 +1,22 @@ +package com.siyeh.ipp.exceptions.detail; + +import java.io.IOException; + +public class PolyadicParentheses { + + void box() { + try { + System.out.println(one() && (two()) && one()); + } catch (IOException e) { + } catch (NoSuchFieldException e) { + } + } + + boolean one() throws IOException { + return false; + } + + boolean two() throws NoSuchFieldException { + return false; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitMultiCatch/Simple.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitMultiCatch/Simple.java new file mode 100644 index 000000000000..78110c3af48d --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitMultiCatch/Simple.java @@ -0,0 +1,12 @@ +package com.siyeh.ipp.exceptions.splitMultiCatch; + +import java.io.*; + +public class Simple { + void foo() { + try { + Reader reader = new FileReader(""); + } <caret>catch (IndexOutOfBoundsException | FileNotFoundException e) { + } + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitMultiCatch/Simple_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitMultiCatch/Simple_after.java new file mode 100644 index 000000000000..f10a40928fda --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitMultiCatch/Simple_after.java @@ -0,0 +1,13 @@ +package com.siyeh.ipp.exceptions.splitMultiCatch; + +import java.io.*; + +public class Simple { + void foo() { + try { + Reader reader = new FileReader(""); + } catch (IndexOutOfBoundsException e) { + } catch (FileNotFoundException e) { + } + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitMultiCatch/TypeAnno.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitMultiCatch/TypeAnno.java new file mode 100644 index 000000000000..9768360bedb6 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitMultiCatch/TypeAnno.java @@ -0,0 +1,16 @@ +package com.siyeh.ipp.exceptions.splitMultiCatch; + +import java.io.*; +import java.lang.annotation.*; + +public class Simple { + void foo() { + try { + Reader reader = new FileReader(""); + } <caret>catch (@A @TA IndexOutOfBoundsException | @TA FileNotFoundException e) { + } + } +} + +@Target(ElementType.PARAMETER) @interface A { } +@Target(ElementType.TYPE_USE) @interface TA { }
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitMultiCatch/TypeAnno_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitMultiCatch/TypeAnno_after.java new file mode 100644 index 000000000000..d8d23ae53a2a --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitMultiCatch/TypeAnno_after.java @@ -0,0 +1,17 @@ +package com.siyeh.ipp.exceptions.splitMultiCatch; + +import java.io.*; +import java.lang.annotation.*; + +public class Simple { + void foo() { + try { + Reader reader = new FileReader(""); + } catch (@A @TA IndexOutOfBoundsException e) { + } catch (@A @TA FileNotFoundException e) { + } + } +} + +@Target(ElementType.PARAMETER) @interface A { } +@Target(ElementType.TYPE_USE) @interface TA { }
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitTry/WithCatch.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitTry/WithCatch.java new file mode 100644 index 000000000000..3bdb9a4db5ad --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitTry/WithCatch.java @@ -0,0 +1,13 @@ +package com.siyeh.ipp.exceptions.splitTry; + +import java.io.*; + +public class WithCatch { + void foo(File file1, File file2) { + try (FileInputStream in = new FileInputStream(file1); <caret>FileOutputStream out = new FileOutputStream(file2)) { + + } catch (IOException e) { + e.printStackTrace(); + } + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitTry/WithCatch_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitTry/WithCatch_after.java new file mode 100644 index 000000000000..08442f0a7203 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/splitTry/WithCatch_after.java @@ -0,0 +1,15 @@ +package com.siyeh.ipp.exceptions.splitTry; + +import java.io.*; + +public class WithCatch { + void foo(File file1, File file2) { + try (FileInputStream in = new FileInputStream(file1)) { + try (FileOutputStream out = new FileOutputStream(file2)) { + + } + } catch (IOException e) { + e.printStackTrace(); + } + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/NoChange.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/NoChange.java new file mode 100644 index 000000000000..258e196f0910 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/NoChange.java @@ -0,0 +1,7 @@ +package com.siyeh.ipp.expression.flip_expression; + +public class NoChange { + int x() { + return 1 <caret>+ 1; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/NoException.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/NoException.java new file mode 100644 index 000000000000..307a095981c4 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/NoException.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.expression.flip_expression; + +public class NoException { + + void x() { + int i = 1 <caret>+ ; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/Polyadic.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/Polyadic.java new file mode 100644 index 000000000000..258cebec8bce --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/Polyadic.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.expression.flip_expression; + +public class Polyadic { + int x() { + return 1 - 2 <caret>- 3; + } + +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/Polyadic_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/Polyadic_after.java new file mode 100644 index 000000000000..f7acdf929318 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/Polyadic_after.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.expression.flip_expression; + +public class Polyadic { + int x() { + return 1 - 3 - 2; + } + +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/Prefix.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/Prefix.java new file mode 100644 index 000000000000..7a4712faa429 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/Prefix.java @@ -0,0 +1,7 @@ +package com.siyeh.ipp.expression.flip_expression; + +class Prefix { + int x() { + return 1 <caret>- -1; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/Prefix_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/Prefix_after.java new file mode 100644 index 000000000000..b4b147aff359 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/expression/flip_expression/Prefix_after.java @@ -0,0 +1,7 @@ +package com.siyeh.ipp.expression.flip_expression; + +class Prefix { + int x() { + return -1 - 1; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/interfaceToClass/ExtensionMethods.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/interfaceToClass/ExtensionMethods.java index 394e20bbf423..8e5a6597500e 100644 --- a/plugins/IntentionPowerPak/test/com/siyeh/ipp/interfaceToClass/ExtensionMethods.java +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/interfaceToClass/ExtensionMethods.java @@ -1,21 +1,5 @@ -/* - * Copyright 2000-2012 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. - */ - public interface I<caret> { - void m() default { + default void m() { System.out.println("Hi there."); } }
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/interfaceToClass/ExtensionMethods_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/interfaceToClass/ExtensionMethods_after.java index d616bc7ead37..14b7e5555bf9 100644 --- a/plugins/IntentionPowerPak/test/com/siyeh/ipp/interfaceToClass/ExtensionMethods_after.java +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/interfaceToClass/ExtensionMethods_after.java @@ -1,19 +1,3 @@ -/* - * Copyright 2000-2012 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. - */ - public abstract class I { public void m() { System.out.println("Hi there."); diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/assignment/PolyadicAssignment.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/assignment/PolyadicAssignment.java new file mode 100644 index 000000000000..c9248c1d4f42 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/assignment/PolyadicAssignment.java @@ -0,0 +1,7 @@ +package com.siyeh.ipp.opassign.assignment; + +class PolyadicAssignment { + void x(int i) { + i *= 1<caret> + 2 + 3; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/assignment/PolyadicAssignment_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/assignment/PolyadicAssignment_after.java new file mode 100644 index 000000000000..e378f5b21dfd --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/assignment/PolyadicAssignment_after.java @@ -0,0 +1,7 @@ +package com.siyeh.ipp.opassign.assignment; + +class PolyadicAssignment { + void x(int i) { + i = i * (1 + 2 + 3); + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/operator_assignment/Excluded.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/operator_assignment/Excluded.java new file mode 100644 index 000000000000..fd14af215d5f --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/operator_assignment/Excluded.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.opassign.operator_assignment; + +class Excluded { + void bug() { + boolean b = true; + b = b<caret> != false; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/operator_assignment/PolyadicExpression.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/operator_assignment/PolyadicExpression.java new file mode 100644 index 000000000000..e6bf75c6a695 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/operator_assignment/PolyadicExpression.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.opassign.operator_assignment; + +class PolyadicExpression { + + void foo(int i) { + i = i <caret>+ 1 + 2; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/operator_assignment/PolyadicExpression_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/operator_assignment/PolyadicExpression_after.java new file mode 100644 index 000000000000..fc172e9a04dd --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/opassign/operator_assignment/PolyadicExpression_after.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.opassign.operator_assignment; + +class PolyadicExpression { + + void foo(int i) { + i += 1 + 2; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/parentheses/ArrayAccessExpression2.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/parentheses/ArrayAccessExpression2.java new file mode 100644 index 000000000000..dc079b930859 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/parentheses/ArrayAccessExpression2.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.parentheses; + +class ArrayAccessExpression2 { + private static void x() { + Object info = new Object[]{"abc"}; + String s = (String)(((Object[])info)[0]<caret>); + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/parentheses/ArrayAccessExpression2_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/parentheses/ArrayAccessExpression2_after.java new file mode 100644 index 000000000000..438ea8db9782 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/parentheses/ArrayAccessExpression2_after.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.parentheses; + +class ArrayAccessExpression2 { + private static void x() { + Object info = new Object[]{"abc"}; + String s = (String) ((Object[])info)[0]; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Comments.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Comments.java new file mode 100644 index 000000000000..5a42a37ef3b0 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Comments.java @@ -0,0 +1,14 @@ +class Comments { + + String foo(int par) { + if<caret>(par == 11) + return "ciao";/* case 1 bla bla */ + else if(par == 14) + return "fourteen";//case 2 bla bla + else if(par == 15) + return "fifteen"; //case 3 chchah + else + return "default"; + + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Comments_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Comments_after.java new file mode 100644 index 000000000000..3922f442af44 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Comments_after.java @@ -0,0 +1,16 @@ +class Comments { + + String foo(int par) { + switch (par) { + case 11: + return "ciao";/* case 1 bla bla */ + case 14: + return "fourteen";//case 2 bla bla + case 15: + return "fifteen"; //case 3 chchah + default: + return "default"; + } + + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Long.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Long.java new file mode 100644 index 000000000000..14113e62e520 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Long.java @@ -0,0 +1,10 @@ +package com.siyeh.ipp.switchtoif.replace_if_with_switch; + +public class Long { + void x(long l) { + <caret>if (l == 1) { + } else if (l == 2) { + } else if (l == 3) { + } else if (l == 4) {} + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Polyadic.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Polyadic.java new file mode 100644 index 000000000000..8bb02a29e15c --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Polyadic.java @@ -0,0 +1,13 @@ +package com.siyeh.ipp.switchtoif.replace_if_with_switch; + +public class Polyadic { + void x(int i) { + <caret>if (i == 1 || i == 2 || i == 3) { + + } else if (i == 5) { + + } else { + + } + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Polyadic_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Polyadic_after.java new file mode 100644 index 000000000000..1c6313bb0e21 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/switchtoif/replace_if_with_switch/Polyadic_after.java @@ -0,0 +1,19 @@ +package com.siyeh.ipp.switchtoif.replace_if_with_switch; + +public class Polyadic { + void x(int i) { + switch (i) { + case 1: + case 2: + case 3: + + break; + case 5: + + break; + default: + + break; + } + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRef.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRef.java new file mode 100644 index 000000000000..cd14ddf1f7f2 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRef.java @@ -0,0 +1,12 @@ +public class Foo { + static void foo() { + Ar<String> a = Stri<caret>ng[]::new; + } + + interface Ar<T> { + T[] jjj(int p); + } +} + + + diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRef2Dim.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRef2Dim.java new file mode 100644 index 000000000000..b4c1520b142d --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRef2Dim.java @@ -0,0 +1,12 @@ +public class Foo { + static void foo() { + Ar<String> a = Str<caret>ing[][]::new; + } + + interface Ar<T> { + T[][] jjj(int p); + } +} + + + diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRef2Dim_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRef2Dim_after.java new file mode 100644 index 000000000000..f12bd0757c40 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRef2Dim_after.java @@ -0,0 +1,12 @@ +public class Foo { + static void foo() { + Ar<String> a = (p) -> new String[p][]; + } + + interface Ar<T> { + T[][] jjj(int p); + } +} + + + diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRefUniqueParamName.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRefUniqueParamName.java new file mode 100644 index 000000000000..9c22e194ce6c --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRefUniqueParamName.java @@ -0,0 +1,14 @@ +public class Foo { + public void test() { + Object i = null; + long[][] avg = collect(long[][]:<caret>:new); + } + + interface P<T> { + T _(int i); + } + + <T> T collect(P<T> h) { + return null; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRefUniqueParamName_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRefUniqueParamName_after.java new file mode 100644 index 000000000000..a97db7b453f1 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRefUniqueParamName_after.java @@ -0,0 +1,14 @@ +public class Foo { + public void test() { + Object i = null; + long[][] avg = collect((i1) -> new long[i1][]); + } + + interface P<T> { + T _(int i); + } + + <T> T collect(P<T> h) { + return null; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRef_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRef_after.java new file mode 100644 index 000000000000..7d38741a60ab --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayConstructorRef_after.java @@ -0,0 +1,12 @@ +public class Foo { + static void foo() { + Ar<String> a = (p) -> new String[p]; + } + + interface Ar<T> { + T[] jjj(int p); + } +} + + + diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayMethodRef.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayMethodRef.java new file mode 100644 index 000000000000..a59bb6d2041c --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayMethodRef.java @@ -0,0 +1,9 @@ +public class Foo { + static void foo() { + Cln j = i<caret>nt[]::clone; + } + + interface Cln { + Object _(int[] p); + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayMethodRef_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayMethodRef_after.java new file mode 100644 index 000000000000..65a55a55e8aa --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/methodRefs2lambda/ArrayMethodRef_after.java @@ -0,0 +1,9 @@ +public class Foo { + static void foo() { + Cln j = (p) -> p.clone(); + } + + interface Cln { + Object _(int[] p); + } +}
\ No newline at end of file |