diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/Ambiguity.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/Ambiguity.after.java index 1148785ca874..bb1dbf0f2d8e 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/Ambiguity.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/Ambiguity.after.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 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 class MyTest { static void m(Integer i) { assertTrue(true); } @@ -14,6 +29,6 @@ public class MyTest { static void call(int i, I2 s) {} public static void main(String[] args) { - call(1, (i) -> m(i)); + call(1, i -> m(i)); } } diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayConstructorRef.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayConstructorRef.after.java index 7d38741a60ab..4fc1afca7f8e 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayConstructorRef.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayConstructorRef.after.java @@ -1,6 +1,21 @@ +/* + * Copyright 2000-2016 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 class Foo { static void foo() { - Ar a = (p) -> new String[p]; + Ar a = p -> new String[p]; } interface Ar { diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayConstructorRef2Dim.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayConstructorRef2Dim.after.java index f12bd0757c40..8f8986363ec5 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayConstructorRef2Dim.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayConstructorRef2Dim.after.java @@ -1,6 +1,21 @@ +/* + * Copyright 2000-2016 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 class Foo { static void foo() { - Ar a = (p) -> new String[p][]; + Ar a = p -> new String[p][]; } interface Ar { diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayConstructorRefUniqueParamName.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayConstructorRefUniqueParamName.after.java index a97db7b453f1..ab83b68a03bf 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayConstructorRefUniqueParamName.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayConstructorRefUniqueParamName.after.java @@ -1,7 +1,22 @@ +/* + * Copyright 2000-2016 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 class Foo { public void test() { Object i = null; - long[][] avg = collect((i1) -> new long[i1][]); + long[][] avg = collect(i1 -> new long[i1][]); } interface P { diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayMethodRef.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayMethodRef.after.java index 94c8d2f42151..36cc1b85fdb2 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayMethodRef.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ArrayMethodRef.after.java @@ -1,6 +1,21 @@ +/* + * Copyright 2000-2016 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 class Foo { static void foo() { - Cln j = (ints) -> ints.clone(); + Cln j = ints -> ints.clone(); } interface Cln { diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/CollapseToExpressionLambdaWhenCast.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/CollapseToExpressionLambdaWhenCast.after.java index 26b3d4d4d21d..a76f9a0d6ab4 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/CollapseToExpressionLambdaWhenCast.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/CollapseToExpressionLambdaWhenCast.after.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 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. + */ import java.util.Collection; import java.util.HashMap; import java.util.Map; @@ -7,7 +22,7 @@ import java.util.stream.Collectors; class Collectors2 { static Map combine(Collection> pMaps) { return pMaps.stream() - .map((java.util.function.Function, java.util.Set>>) (integerMap) -> integerMap.entrySet()) + .map((java.util.function.Function, java.util.Set>>) integerMap -> integerMap.entrySet()) .flatMap(Collection::stream) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (pEntry1, pEntry2) -> pEntry1 + pEntry2, diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsInference.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsInference.after.java index cd937894625e..9c7e0593bad3 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsInference.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsInference.after.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 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 class MyTest { MyTest(X x) {} @@ -11,6 +26,6 @@ public class MyTest { } static { - I s = (x) -> new MyTest(x); + I s = x -> new MyTest(x); } } \ No newline at end of file diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsInference1.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsInference1.after.java index 44694a4b9fa6..912c0332b652 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsInference1.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsInference1.after.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 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 class MyTest { interface I { void m(Integer s); @@ -10,6 +25,6 @@ public class MyTest { static void m(I s) {} static { - m((x) -> new Foo(x)); + m(x -> new Foo(x)); } } diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsInnerClass.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsInnerClass.after.java index 0d1106d8e4b6..c047263fee78 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsInnerClass.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsInnerClass.after.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 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 MyTest { static class Inner { Inner(MyTest mt) {}; @@ -8,6 +23,6 @@ class MyTest { } static { - I i1 = (mt) -> new Inner(mt); + I i1 = mt -> new Inner(mt); } } diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsStaticInnerClass.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsStaticInnerClass.after.java index c26cd8a6d244..e6ea03c49f31 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsStaticInnerClass.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/NewRefsStaticInnerClass.after.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 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 MyTest { static class Inner { Inner(MyTest outer) {}; @@ -10,6 +25,6 @@ class MyTest { static { - I i1 = (outer) -> new Inner(outer); + I i1 = outer -> new Inner(outer); } } diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/PreserveExpressionQualifier.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/PreserveExpressionQualifier.after.java index 48b9c049a3a9..f6fdd313a650 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/PreserveExpressionQualifier.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/PreserveExpressionQualifier.after.java @@ -1,10 +1,25 @@ +/* + * Copyright 2000-2016 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. + */ import java.util.function.Function; abstract class Result { public abstract Result map(Function f); void m(final Result b) { - Function, Result> map = (f) -> b.map(f); + Function, Result> map = f -> b.map(f); } } \ No newline at end of file diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/Receiver.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/Receiver.after.java index 5b3eaf82c2b9..fb718d06694c 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/Receiver.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/Receiver.after.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 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 class MyTest { interface I { void m(MyTest receiver); @@ -11,6 +26,6 @@ public class MyTest { } static { - I i = (I) (myTest) -> myTest.m(); + I i = (I) myTest -> myTest.m(); } } diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/RedundantCast.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/RedundantCast.after.java index 7b69213d2db4..57b7f923b83a 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/RedundantCast.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/RedundantCast.after.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 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. + */ import java.util.Comparator; class A { @@ -5,5 +20,5 @@ class A { return 1; } - Comparator comparator = Comparator.comparingInt((a) -> a.get()); + Comparator comparator = Comparator.comparingInt(a -> a.get()); } \ No newline at end of file diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/StaticMethodRef.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/StaticMethodRef.after.java index 419afbc398dc..527cfb7cff19 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/StaticMethodRef.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/StaticMethodRef.after.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 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 class MyTest { interface I { void foo(int i); } @@ -7,6 +22,6 @@ public class MyTest { } static { - I sam = (i) -> print(i); + I sam = i -> print(i); } } \ No newline at end of file diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/SuperRefs.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/SuperRefs.after.java index f7c7004f070f..12e40e553bad 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/SuperRefs.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/SuperRefs.after.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 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 class MyTest { interface I { @@ -10,7 +25,7 @@ public class MyTest { static class B extends A { void m(int i1) { - I i = (i2) -> super.m(i2); + I i = i2 -> super.m(i2); } } } diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ThisRefs.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ThisRefs.after.java index 9294bea19652..1514a8e65021 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ThisRefs.after.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/style/methodRefs2lambda/ThisRefs.after.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 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 MyTest { static interface SAM { void m(Integer i); @@ -6,5 +21,5 @@ class MyTest { void m(Integer i) {} void m(Double d) {} - SAM s = (i) -> m(i); + SAM s = i -> m(i); }