From f7a4613eaa2364dcaf10f96f04a6b1afb2feb7ed Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Fri, 10 Feb 2023 10:13:04 +0100 Subject: [PATCH] [MCOMPILER-526] Reformat # Conflicts: # src/test/java/org/apache/maven/plugin/compiler/CompilerMojoTestCase.java --- pom.xml | 50 +- .../MCOMPILER-129/src/main/java/MyClass.java | 44 +- .../main/java/org/issue/SimpleAnnotation.java | 7 +- .../org/issue/SimpleAnnotationProcessor.java | 46 +- .../src/main/java/org/issue/SimpleObject.java | 8 +- .../test/java/org/issue/SimpleTestObject.java | 8 +- .../apache/maven/plugins/compiler/it/App.java | 36 +- .../maven/plugins/compiler/it/App2.java | 36 +- .../maven/plugins/compiler/it/App3.java | 36 +- .../maven/plugins/compiler/it/App4.java | 36 +- .../maven/plugins/compiler/it/App5.java | 36 +- .../maven/plugins/compiler/it/App6.java | 36 +- .../maven/plugins/compiler/it/App7.java | 36 +- .../maven/plugins/compiler/it/AppTest.java | 27 +- .../apache/maven/plugins/compiler/it/App.java | 36 +- .../maven/plugins/compiler/it/App2.java | 36 +- .../maven/plugins/compiler/it/App3.java | 36 +- .../maven/plugins/compiler/it/App4.java | 36 +- .../maven/plugins/compiler/it/App5.java | 36 +- .../maven/plugins/compiler/it/App6.java | 36 +- .../maven/plugins/compiler/it/App7.java | 36 +- .../maven/plugins/compiler/it/AppTest.java | 27 +- .../apache/maven/plugins/compiler/it/App.java | 36 +- .../maven/plugins/compiler/it/App2.java | 36 +- .../maven/plugins/compiler/it/App3.java | 36 +- .../maven/plugins/compiler/it/App4.java | 36 +- .../maven/plugins/compiler/it/App5.java | 36 +- .../maven/plugins/compiler/it/App6.java | 36 +- .../maven/plugins/compiler/it/App7.java | 36 +- .../maven/plugins/compiler/it/AppTest.java | 27 +- .../apache/maven/plugins/compiler/it/App.java | 36 +- .../maven/plugins/compiler/it/App2.java | 36 +- .../maven/plugins/compiler/it/App3.java | 36 +- .../maven/plugins/compiler/it/App4.java | 36 +- .../maven/plugins/compiler/it/App5.java | 36 +- .../maven/plugins/compiler/it/App6.java | 36 +- .../maven/plugins/compiler/it/App7.java | 36 +- .../maven/plugins/compiler/it/AppTest.java | 27 +- .../java/org/example/pce/sample/Dummy.java | 14 +- .../src/main/java/dummy/HelloWorld.java | 53 +- src/it/MCOMPILER-192/verify.groovy | 1 - .../src/main/java/org/issue/Person.java | 4 +- .../org/issue/SimpleAnnotationProcessor.java | 226 ++- .../main/java/org/issue/SimpleAnnotation.java | 59 +- .../src/main/java/org/issue/SimpleObject.java | 48 +- .../test/java/org/issue/SimpleTestObject.java | 48 +- .../src/main/java/dummy/HelloWorld.java | 53 +- .../src/main/java/dummy/package-info.java | 2 +- src/it/MCOMPILER-205/verify.groovy | 1 - .../src/main/java/org/issue/MCompiler224.java | 13 +- .../MCompiler224AnnotationProcessor.java | 39 +- .../src/main/java/org/issue/user/User.java | 13 +- .../src/main/java/example/FinalExample.java | 89 +- .../src/main/java/com/foo/MyClass.java | 46 +- .../src/main/java/com/foo/MyClass.java | 46 +- .../src/main/java/module-info.java | 44 +- .../src/test/java/com/foo/MyTest.java | 53 +- .../src/main/java/MyClass.java | 44 +- .../src/test/java/MyTest.java | 49 +- .../src/main/java/processor1/Processor1.java | 17 +- .../src/main/java/processor2/dep/Foo.java | 9 +- .../src/main/java/processor2/Processor2.java | 17 +- .../src/main/java/project/Project.java | 14 +- .../src/main/java/com/foo/MyClass.java | 46 +- .../src/main/java/module-info.java | 43 +- .../src/test/java/com/foo/MyTest.java | 53 +- .../src/main/java/com/foo/MyClass.java | 12 +- .../src/test/java/com/foo/MyTest.java | 11 +- .../app/src/main/java/module-info.java | 44 +- .../main/java/org/maven/test/app/Main.java | 63 +- .../lib/src/main/java/module-info.java | 44 +- .../main/java/org/maven/test/lib/Sout.java | 64 +- .../src/main/java/com/foo/ParameterClass.java | 10 +- .../src/test/java/com/foo/ParameterTest.java | 20 +- .../src/main/java/module-info.java | 8 +- .../src/test/java/test/MyTest.java | 11 +- .../src/main/java/MyClass.java | 9 +- .../a/src/main/java/module-info.java | 4 +- .../b/src/main/java/module-info.java | 3 +- .../b/src/main/java/test/Foo.java | 6 +- .../b/src/main/java/test/package-info.java | 5 +- .../server/PooledJenkinsController.java | 41 +- .../dependent-module/src/main/java/Main.java | 8 +- .../service/src/main/java/TestService.java | 10 +- .../verify.groovy | 1 - .../main360/src/main/java/module-info.java | 7 +- .../src/main/java/module-info.java | 10 +- .../src/main/java/org/maven/test/Main.java | 13 +- .../src/main/java/org/maven/bug/A.java | 13 +- .../src/main/java/org/maven/bug/B.java | 13 +- .../src/main/java11/org/maven/bug/B.java | 13 +- .../src/main/java9/org/maven/bug/A9.java | 13 +- .../src/main/java9/org/maven/bug/B.java | 13 +- .../src/main/java/com/natros/mcp/Foo.java | 7 +- .../dependent-module/src/main/java/Main.java | 6 +- .../service/src/main/java/TestService.java | 8 +- .../verify.groovy | 1 - .../app/src/main/java/org/test/app/Main.java | 7 +- .../src/test/java/org/test/app/MainTest.java | 9 +- .../java/org/test/service/JSONService.java | 6 +- .../main/java/org/test/service/Service.java | 7 +- .../src/main/java/dummy/HelloWorld.java | 13 +- .../src/main/java/dummy/package-info.java | 2 +- src/it/MCOMPILER-485/verify.groovy | 1 - .../src/main/java/dummy/package-info.java | 2 +- src/it/MCOMPILER-495/verify.groovy | 1 - .../src/main/java/dummy/Person.java | 4 +- .../src/main/java/dummy/foo/Person.java | 4 +- .../src/main/java/dummy/package-info.java | 2 +- .../verify.groovy | 1 - .../AnnotationProcessorDependencyV1.java | 6 +- .../AnnotationProcessorDependencyV2.java | 6 +- .../SimpleAnnotationProcessor.java | 83 +- .../java/mcompiler503/SimpleAnnotation.java | 6 +- .../main/java/mcompiler503/SimpleObject.java | 6 +- .../java/mcompiler503/SimpleTestObject.java | 6 +- .../src/main/java/dummy/Main.java | 12 +- .../src/test/java/dummy/Test.java | 11 +- .../SimpleAnnotation.java | 8 +- .../SimpleObject.java | 8 +- .../src/main/java/module-info.java | 43 +- .../src/main/java/org/maven/test/Main.java | 63 +- .../src/main/java/module-info.java | 47 +- .../src/main/java/org/maven/test/Main.java | 63 +- .../src/main/java/module-info.java | 43 +- .../src/main/java/org/maven/test/Main.java | 53 +- .../src/main/java/module-info.java | 47 +- .../src/main/java/org/maven/test/Main.java | 63 +- .../src/main/java/MyClass.java | 9 +- .../src/test/java/MyTest.java | 10 +- .../default-fork/src/main/java/MyClass.java | 9 +- src/it/default-fork/src/test/java/MyTest.java | 10 +- .../src/main/java/foo/MyClass.java | 9 +- .../src/test/java/foo/MyTest.java | 10 +- src/it/default/src/main/java/MyClass.java | 9 +- src/it/default/src/test/java/MyTest.java | 10 +- .../verify.groovy | 1 - .../java/org/apache/maven/it0055/Person.java | 21 +- .../org/apache/maven/it0055/PersonTwo.java | 21 +- .../org/apache/maven/it0055/PersonTest.java | 23 +- .../apache/maven/it0055/PersonTwoTest.java | 23 +- .../com/mycompany/jdk16annotation/App.java | 16 +- .../jdk16annotation/ServiceProvider.java | 12 +- .../ServiceProviderProcessor.java | 40 +- .../mycompany/jdk16annotation/AppTest.java | 29 +- .../bar/src/main/java/module-info.java | 44 +- .../foo/src/main/java/foo/Foo.java | 43 +- .../foo/src/main/java/module-info.java | 45 +- .../src/main/java/module-info.java | 41 +- .../src/main/java/org/maven/test/Main.java | 69 +- .../src/test/java/bar/BarTests.java | 11 +- .../src/test/java/module-info.java | 3 +- .../src/main/java/foo/Foo.java | 9 +- .../src/main/java/module-info.java | 4 +- .../src/test/java/bar/BarTests.java | 15 +- .../src/test/java/module-info.java | 3 +- .../src/main/java/foo/Foo.java | 9 +- .../src/main/java/module-info.java | 3 +- .../src/test/java/foo/FooTests.java | 15 +- .../src/test/java/module-info.java | 3 +- .../src/main/java/module-info.java | 41 +- .../src/main/java/org/maven/test/Main.java | 69 +- .../test/java/org/maven/test/MainTest.java | 59 +- .../mcompiler-106/src/main/java/MyClass.java | 9 +- .../src/main/java/org/maven/test/Main.java | 9 +- src/it/mcompiler-120/verify.groovy | 1 - .../mcompiler-135/src/main/java/MyClass.java | 9 +- .../src/main/java/org/maven/test/MyClass.java | 8 +- src/it/mcompiler-182/src/main/java/BeanA.java | 6 +- .../mcompiler-182/src/main/java/BeanA2.java | 4 +- src/it/mcompiler-182/verify.groovy | 1 - .../src/main/java/BeanA.java | 6 +- .../src/main/java/BeanA2.java | 4 +- .../mcompiler-21_class-remove/verify.groovy | 1 - .../src/main/java/BeanA.java | 6 +- .../src/main/java/BeanA2.java | 4 +- .../verify.groovy | 1 - .../src/main/java/base/Base.java | 3 +- .../multirelease-base/src/main/java/mr/A.java | 8 +- .../multirelease-base/src/main/java/mr/I.java | 8 +- .../src/test/java/mr/ATest.java | 44 +- .../multirelease-nine/src/main/java/mr/A.java | 14 +- .../src/test/java/mr/ATest.java | 46 +- .../src/main/java/base/Base.java | 3 +- .../multirelease-base/src/main/java/mr/A.java | 8 +- .../multirelease-base/src/main/java/mr/I.java | 8 +- .../src/test/java/mr/ATest.java | 44 +- .../multirelease-nine/src/main/java/mr/A.java | 14 +- .../src/test/java/mr/ATest.java | 46 +- .../src/main/java-mr/9/module-info.java | 7 +- .../src/main/java-mr/9/mr/A.java | 14 +- .../src/main/java/base/Base.java | 3 +- .../packaging-plugin/src/main/java/mr/A.java | 8 +- .../packaging-plugin/src/main/java/mr/I.java | 8 +- .../src/test/java/mr/ATest.java | 40 +- .../src/main/java/base/Base.java | 3 +- .../src/main/java/mr/A.java | 8 +- .../src/main/java/mr/I.java | 8 +- .../src/main/java9/module-info.java | 7 +- .../src/main/java9/mr/A.java | 14 +- .../src/test/java/mr/ATest.java | 40 +- .../src/main/java/base/Base.java | 3 +- .../src/main/java/mr/A.java | 8 +- .../src/main/java/mr/I.java | 8 +- .../src/main/java9/module-info.java | 7 +- .../src/main/java9/mr/A.java | 14 +- .../src/test/java/mr/ATest.java | 40 +- .../src/main/java/MyClass.java | 13 +- .../src/test/java/MyTest.java | 13 +- src/it/non-english-warnings/verify.bsh | 1 + .../SourcePathReadGoal.java | 78 +- .../src/main/java/com/ta3/MyClass.java | 46 +- .../src/main/java/com/ta2/MyClass.java | 46 +- .../src/main/java/module-info.java | 46 +- .../src/main/java/com/ta2/MyClass.java | 46 +- .../src/main/java/com/ta2/plus/MyClass.java | 46 +- .../src/main/java/module-info.java | 46 +- src/it/test1/src/main/java/MyClass.java | 9 +- .../plugin/compiler/AbstractCompilerMojo.java | 1459 +++++++---------- .../compiler/CompilationFailureException.java | 38 +- .../maven/plugin/compiler/CompilerMojo.java | 340 ++-- .../plugin/compiler/DependencyCoordinate.java | 328 ++-- .../plugin/compiler/TestCompilerMojo.java | 344 ++-- .../plugin/compiler/CompilerMojoTestCase.java | 468 +++--- .../compiler/stubs/CompilerManagerStub.java | 20 +- .../plugin/compiler/stubs/CompilerStub.java | 69 +- .../compiler/stubs/DebugEnabledLog.java | 13 +- .../src/main/java/TestCompile0.java | 11 +- .../src/test/java/TestCompile0Test.java | 9 +- .../src/main/java/TestCompile0.java | 11 +- .../src/main/java/TestCompile0.java | 11 +- .../src/test/java/TestCompile0Test.java | 9 +- .../src/main/java/TestCompile0.java | 11 +- .../src/test/java/TestCompile0Test.java | 9 +- .../src/main/java/TestCompile0.java | 11 +- .../src/test/java/TestCompile0Test.java | 9 +- .../src/main/java/TestCompile1.java | 11 +- .../src/test/java/TestCompile1TestCase.java | 9 +- .../src/main/java/TestCompile2.java | 11 +- .../src/main/java/TestCompile3.java | 11 +- .../src/main/java/TestCompile4.java | 11 +- .../src/test/java/TestCompile2TestCase.java | 9 +- .../src/test/java/TestCompile3TestCase.java | 9 +- .../src/test/java/TestCompile4TestCase.java | 9 +- .../src/main/java/TestCompile2.java | 11 +- .../src/main/java/TestCompile3.java | 11 +- .../src/main/java/TestCompile4.java | 11 +- .../src/test/java/TestCompile2TestCase.java | 9 +- .../src/test/java/TestCompile3TestCase.java | 9 +- .../src/test/java/TestCompile4TestCase.java | 9 +- .../src/main/java/TestCompile2.java | 10 +- .../src/main/java/TestCompile3.java | 11 +- .../src/main/java/TestCompile4.java | 11 +- .../src/test/java/TestCompile2TestCase.java | 9 +- .../src/test/java/TestCompile3TestCase.java | 9 +- .../src/test/java/TestCompile4TestCase.java | 9 +- .../src/main/java/TestSkipMainCompile0.java | 11 +- .../test/java/TestSkipMainCompile0Test.java | 11 +- .../src/main/java/TestSkipTestCompile0.java | 11 +- .../test/java/TestSkipTestCompile0Test.java | 9 +- 260 files changed, 3660 insertions(+), 4991 deletions(-) diff --git a/pom.xml b/pom.xml index a20f8b9f..774e6069 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,4 @@ - - + - 4.0.0 @@ -37,6 +35,12 @@ under the License. The Compiler Plugin is used to compile the sources of your project. 2001 + + + Jan Sievers + + + ${mavenVersion} @@ -44,8 +48,8 @@ under the License. scm:git:https://github.com/apache/maven-compiler-plugin.git scm:git:https://github.com/apache/maven-compiler-plugin.git - https://github.com/apache/maven-compiler-plugin/tree/${project.scm.tag} maven-compiler-plugin-3.10.0 + https://github.com/apache/maven-compiler-plugin/tree/${project.scm.tag} JIRA @@ -80,25 +84,6 @@ under the License. org.apache.maven.plugins.compiler.its - - - Jan Sievers - - - - - - plexus.snapshots - https://oss.sonatype.org/content/repositories/plexus-snapshots - - false - - - true - - - - @@ -145,16 +130,16 @@ under the License. 1.1 - maven-core org.apache.maven + maven-core - maven-plugin-api org.apache.maven + maven-plugin-api - maven-shared-utils org.apache.maven.shared + maven-shared-utils @@ -209,6 +194,19 @@ under the License. + + + + false + + + true + + plexus.snapshots + https://oss.sonatype.org/content/repositories/plexus-snapshots + + + diff --git a/src/it/MCOMPILER-129/src/main/java/MyClass.java b/src/it/MCOMPILER-129/src/main/java/MyClass.java index 80144b07..d4132bb2 100644 --- a/src/it/MCOMPILER-129/src/main/java/MyClass.java +++ b/src/it/MCOMPILER-129/src/main/java/MyClass.java @@ -1,23 +1,21 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 MyClass -{ - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 foo; + +public class MyClass {} diff --git a/src/it/MCOMPILER-157/annotation-processor/src/main/java/org/issue/SimpleAnnotation.java b/src/it/MCOMPILER-157/annotation-processor/src/main/java/org/issue/SimpleAnnotation.java index ccae1639..5339365e 100644 --- a/src/it/MCOMPILER-157/annotation-processor/src/main/java/org/issue/SimpleAnnotation.java +++ b/src/it/MCOMPILER-157/annotation-processor/src/main/java/org/issue/SimpleAnnotation.java @@ -1,5 +1,3 @@ -package org.issue; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package org.issue; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -26,6 +25,4 @@ @Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) -public @interface SimpleAnnotation { - -} +public @interface SimpleAnnotation {} diff --git a/src/it/MCOMPILER-157/annotation-processor/src/main/java/org/issue/SimpleAnnotationProcessor.java b/src/it/MCOMPILER-157/annotation-processor/src/main/java/org/issue/SimpleAnnotationProcessor.java index 30823a1d..b95f3e22 100644 --- a/src/it/MCOMPILER-157/annotation-processor/src/main/java/org/issue/SimpleAnnotationProcessor.java +++ b/src/it/MCOMPILER-157/annotation-processor/src/main/java/org/issue/SimpleAnnotationProcessor.java @@ -1,5 +1,3 @@ -package org.issue; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,10 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - -import java.io.IOException; -import java.io.Writer; -import java.util.Set; +package org.issue; import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.Filer; @@ -37,44 +32,39 @@ import javax.tools.FileObject; import javax.tools.StandardLocation; -@SupportedSourceVersion( SourceVersion.RELEASE_6 ) -@SupportedAnnotationTypes( "org.issue.SimpleAnnotation" ) -public class SimpleAnnotationProcessor - extends AbstractProcessor -{ +import java.io.IOException; +import java.io.Writer; +import java.util.Set; + +@SupportedSourceVersion(SourceVersion.RELEASE_6) +@SupportedAnnotationTypes("org.issue.SimpleAnnotation") +public class SimpleAnnotationProcessor extends AbstractProcessor { @Override - public boolean process( Set annotations, RoundEnvironment roundEnv ) - { + public boolean process(Set annotations, RoundEnvironment roundEnv) { Filer filer = processingEnv.getFiler(); Elements elementUtils = processingEnv.getElementUtils(); - Set elements = roundEnv.getElementsAnnotatedWith( SimpleAnnotation.class ); + Set elements = roundEnv.getElementsAnnotatedWith(SimpleAnnotation.class); - for ( Element element : elements ) - { + for (Element element : elements) { Name name = element.getSimpleName(); - PackageElement packageElement = elementUtils.getPackageOf( element ); + PackageElement packageElement = elementUtils.getPackageOf(element); - try - { - FileObject resource = - filer.createResource( StandardLocation.SOURCE_OUTPUT, packageElement.getQualifiedName(), name - + ".txt", element ); + try { + FileObject resource = filer.createResource( + StandardLocation.SOURCE_OUTPUT, packageElement.getQualifiedName(), name + ".txt", element); Writer writer = resource.openWriter(); - writer.write( name.toString() ); + writer.write(name.toString()); writer.close(); - } - catch ( IOException e ) - { - throw new RuntimeException( e ); + } catch (IOException e) { + throw new RuntimeException(e); } } return !elements.isEmpty(); } - } diff --git a/src/it/MCOMPILER-157/annotation-user/src/main/java/org/issue/SimpleObject.java b/src/it/MCOMPILER-157/annotation-user/src/main/java/org/issue/SimpleObject.java index 56524fb8..18b8fc43 100644 --- a/src/it/MCOMPILER-157/annotation-user/src/main/java/org/issue/SimpleObject.java +++ b/src/it/MCOMPILER-157/annotation-user/src/main/java/org/issue/SimpleObject.java @@ -1,5 +1,3 @@ -package org.issue; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,9 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package org.issue; @SimpleAnnotation -public class SimpleObject -{ - -} +public class SimpleObject {} diff --git a/src/it/MCOMPILER-157/annotation-user/src/test/java/org/issue/SimpleTestObject.java b/src/it/MCOMPILER-157/annotation-user/src/test/java/org/issue/SimpleTestObject.java index 9024f6a3..706dccf1 100644 --- a/src/it/MCOMPILER-157/annotation-user/src/test/java/org/issue/SimpleTestObject.java +++ b/src/it/MCOMPILER-157/annotation-user/src/test/java/org/issue/SimpleTestObject.java @@ -1,5 +1,3 @@ -package org.issue; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,9 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package org.issue; @SimpleAnnotation -public class SimpleTestObject -{ - -} +public class SimpleTestObject {} diff --git a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App.java b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App.java index bcbf5dd6..3fa54ed1 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App.java +++ b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,35 +16,29 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App2.java b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App2.java index 6a22d395..9a6511fc 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App2.java +++ b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App2.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App2 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App2 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App3.java b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App3.java index d970eecf..eb55f16f 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App3.java +++ b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App3.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App3 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App3 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App4.java b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App4.java index 1cce4d8d..1156f54d 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App4.java +++ b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App4.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App4 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App4 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App5.java b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App5.java index beab680b..dd3c028a 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App5.java +++ b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App5.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App5 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App5 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App6.java b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App6.java index c748ea2c..ca09789f 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App6.java +++ b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App6.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App6 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App6 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App7.java b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App7.java index 0b09cdfa..e0f50da0 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App7.java +++ b/src/it/MCOMPILER-170/mcompiler-170-1/src/main/java/org/apache/maven/plugins/compiler/it/App7.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App7 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App7 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-1/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java b/src/it/MCOMPILER-170/mcompiler-170-1/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java index 464f9af3..af3a4542 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-1/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java +++ b/src/it/MCOMPILER-170/mcompiler-170-1/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; import junit.framework.Test; import junit.framework.TestCase; @@ -27,32 +25,27 @@ /** * Unit test for simple App. */ -public class AppTest - extends TestCase -{ +public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ - public AppTest( String testName ) - { - super( testName ); + public AppTest(String testName) { + super(testName); } /** * @return the suite of tests being tested */ - public static Test suite() - { - return new TestSuite( AppTest.class ); + public static Test suite() { + return new TestSuite(AppTest.class); } /** * Rigourous Test :-) */ - public void testApp() - { - assertTrue( true ); + public void testApp() { + assertTrue(true); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App.java b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App.java index bcbf5dd6..3fa54ed1 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App.java +++ b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,35 +16,29 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App2.java b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App2.java index 6a22d395..9a6511fc 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App2.java +++ b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App2.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App2 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App2 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App3.java b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App3.java index d970eecf..eb55f16f 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App3.java +++ b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App3.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App3 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App3 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App4.java b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App4.java index 1cce4d8d..1156f54d 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App4.java +++ b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App4.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App4 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App4 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App5.java b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App5.java index beab680b..dd3c028a 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App5.java +++ b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App5.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App5 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App5 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App6.java b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App6.java index c748ea2c..ca09789f 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App6.java +++ b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App6.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App6 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App6 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App7.java b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App7.java index 0b09cdfa..e0f50da0 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App7.java +++ b/src/it/MCOMPILER-170/mcompiler-170-2/src/main/java/org/apache/maven/plugins/compiler/it/App7.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App7 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App7 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-2/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java b/src/it/MCOMPILER-170/mcompiler-170-2/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java index 464f9af3..af3a4542 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-2/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java +++ b/src/it/MCOMPILER-170/mcompiler-170-2/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; import junit.framework.Test; import junit.framework.TestCase; @@ -27,32 +25,27 @@ /** * Unit test for simple App. */ -public class AppTest - extends TestCase -{ +public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ - public AppTest( String testName ) - { - super( testName ); + public AppTest(String testName) { + super(testName); } /** * @return the suite of tests being tested */ - public static Test suite() - { - return new TestSuite( AppTest.class ); + public static Test suite() { + return new TestSuite(AppTest.class); } /** * Rigourous Test :-) */ - public void testApp() - { - assertTrue( true ); + public void testApp() { + assertTrue(true); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App.java b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App.java index bcbf5dd6..3fa54ed1 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App.java +++ b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,35 +16,29 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App2.java b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App2.java index 6a22d395..9a6511fc 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App2.java +++ b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App2.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App2 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App2 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App3.java b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App3.java index d970eecf..eb55f16f 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App3.java +++ b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App3.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App3 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App3 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App4.java b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App4.java index 1cce4d8d..1156f54d 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App4.java +++ b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App4.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App4 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App4 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App5.java b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App5.java index beab680b..dd3c028a 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App5.java +++ b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App5.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App5 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App5 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App6.java b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App6.java index c748ea2c..ca09789f 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App6.java +++ b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App6.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App6 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App6 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App7.java b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App7.java index 0b09cdfa..e0f50da0 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App7.java +++ b/src/it/MCOMPILER-170/mcompiler-170-3/src/main/java/org/apache/maven/plugins/compiler/it/App7.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App7 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App7 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-3/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java b/src/it/MCOMPILER-170/mcompiler-170-3/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java index 464f9af3..af3a4542 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-3/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java +++ b/src/it/MCOMPILER-170/mcompiler-170-3/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; import junit.framework.Test; import junit.framework.TestCase; @@ -27,32 +25,27 @@ /** * Unit test for simple App. */ -public class AppTest - extends TestCase -{ +public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ - public AppTest( String testName ) - { - super( testName ); + public AppTest(String testName) { + super(testName); } /** * @return the suite of tests being tested */ - public static Test suite() - { - return new TestSuite( AppTest.class ); + public static Test suite() { + return new TestSuite(AppTest.class); } /** * Rigourous Test :-) */ - public void testApp() - { - assertTrue( true ); + public void testApp() { + assertTrue(true); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App.java b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App.java index bcbf5dd6..3fa54ed1 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App.java +++ b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,35 +16,29 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App2.java b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App2.java index 6a22d395..9a6511fc 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App2.java +++ b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App2.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App2 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App2 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App3.java b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App3.java index d970eecf..eb55f16f 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App3.java +++ b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App3.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App3 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App3 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App4.java b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App4.java index 1cce4d8d..1156f54d 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App4.java +++ b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App4.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App4 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App4 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App5.java b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App5.java index beab680b..dd3c028a 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App5.java +++ b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App5.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App5 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App5 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App6.java b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App6.java index c748ea2c..ca09789f 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App6.java +++ b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App6.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App6 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App6 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App7.java b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App7.java index 0b09cdfa..e0f50da0 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App7.java +++ b/src/it/MCOMPILER-170/mcompiler-170-4/src/main/java/org/apache/maven/plugins/compiler/it/App7.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,36 +16,30 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; /** * Hello world! * */ -public class App7 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App7 { + public static void main(String[] args) { + System.out.println("Hello World!"); } - public static void mainFoo( String[] args ) - { - System.out.println( "Hello World!" ); + public static void mainFoo(String[] args) { + System.out.println("Hello World!"); } - public void bar( String[] args ) - { - System.out.println( "Hello World!" ); + public void bar(String[] args) { + System.out.println("Hello World!"); } - public void foo( String[] args ) - { - System.out.println( "Hello World!" ); + public void foo(String[] args) { + System.out.println("Hello World!"); } - public void barfoo( String[] args ) - { - System.out.println( "Hello World!" ); + public void barfoo(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/MCOMPILER-170/mcompiler-170-4/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java b/src/it/MCOMPILER-170/mcompiler-170-4/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java index 464f9af3..af3a4542 100644 --- a/src/it/MCOMPILER-170/mcompiler-170-4/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java +++ b/src/it/MCOMPILER-170/mcompiler-170-4/src/test/java/org/apache/maven/plugins/compiler/it/AppTest.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.plugins.compiler.it; import junit.framework.Test; import junit.framework.TestCase; @@ -27,32 +25,27 @@ /** * Unit test for simple App. */ -public class AppTest - extends TestCase -{ +public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ - public AppTest( String testName ) - { - super( testName ); + public AppTest(String testName) { + super(testName); } /** * @return the suite of tests being tested */ - public static Test suite() - { - return new TestSuite( AppTest.class ); + public static Test suite() { + return new TestSuite(AppTest.class); } /** * Rigourous Test :-) */ - public void testApp() - { - assertTrue( true ); + public void testApp() { + assertTrue(true); } } diff --git a/src/it/MCOMPILER-190/src/main/java/org/example/pce/sample/Dummy.java b/src/it/MCOMPILER-190/src/main/java/org/example/pce/sample/Dummy.java index 96a49ffc..00225397 100644 --- a/src/it/MCOMPILER-190/src/main/java/org/example/pce/sample/Dummy.java +++ b/src/it/MCOMPILER-190/src/main/java/org/example/pce/sample/Dummy.java @@ -1,5 +1,3 @@ -package org.example.pce.sample; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ - +package org.example.pce.sample; public class Dummy { - public static void main(final String[] args) { - String dummy = new Integer(1); - } + public static void main(final String[] args) { + String dummy = new Integer(1); + } } diff --git a/src/it/MCOMPILER-192/src/main/java/dummy/HelloWorld.java b/src/it/MCOMPILER-192/src/main/java/dummy/HelloWorld.java index f223c74d..7ceb91cb 100644 --- a/src/it/MCOMPILER-192/src/main/java/dummy/HelloWorld.java +++ b/src/it/MCOMPILER-192/src/main/java/dummy/HelloWorld.java @@ -1,28 +1,25 @@ -package dummy; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 HelloWorld -{ - public static void main(String[] argv) { - System.out.println("Hello World"); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 dummy; + +public class HelloWorld { + public static void main(String[] argv) { + System.out.println("Hello World"); + } +} diff --git a/src/it/MCOMPILER-192/verify.groovy b/src/it/MCOMPILER-192/verify.groovy index 4e6e3b0a..a23fe871 100644 --- a/src/it/MCOMPILER-192/verify.groovy +++ b/src/it/MCOMPILER-192/verify.groovy @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/src/it/MCOMPILER-197/src/main/java/org/issue/Person.java b/src/it/MCOMPILER-197/src/main/java/org/issue/Person.java index 701035c0..d80a49b9 100644 --- a/src/it/MCOMPILER-197/src/main/java/org/issue/Person.java +++ b/src/it/MCOMPILER-197/src/main/java/org/issue/Person.java @@ -1,5 +1,3 @@ -package org.issue; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package org.issue; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -28,6 +27,7 @@ public class Person { @Id @GeneratedValue private long id; + private String name; public long getId() { diff --git a/src/it/MCOMPILER-203-processorpath/annotation-processor/src/main/java/org/issue/SimpleAnnotationProcessor.java b/src/it/MCOMPILER-203-processorpath/annotation-processor/src/main/java/org/issue/SimpleAnnotationProcessor.java index a3dcbf9b..b2dfd6ca 100644 --- a/src/it/MCOMPILER-203-processorpath/annotation-processor/src/main/java/org/issue/SimpleAnnotationProcessor.java +++ b/src/it/MCOMPILER-203-processorpath/annotation-processor/src/main/java/org/issue/SimpleAnnotationProcessor.java @@ -1,121 +1,105 @@ -package org.issue; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.io.IOException; -import java.io.Writer; -import java.util.Set; - -import javax.annotation.processing.AbstractProcessor; -import javax.annotation.processing.Filer; -import javax.annotation.processing.RoundEnvironment; -import javax.annotation.processing.SupportedAnnotationTypes; -import javax.annotation.processing.SupportedSourceVersion; -import javax.lang.model.SourceVersion; -import javax.lang.model.element.Element; -import javax.lang.model.element.Name; -import javax.lang.model.element.PackageElement; -import javax.lang.model.element.TypeElement; -import javax.lang.model.util.Elements; -import javax.tools.FileObject; -import javax.tools.JavaFileObject; -import javax.tools.StandardLocation; - -@SupportedSourceVersion( SourceVersion.RELEASE_6 ) -@SupportedAnnotationTypes( "org.issue.SimpleAnnotation" ) -public class SimpleAnnotationProcessor - extends AbstractProcessor -{ - - @Override - public boolean process( Set annotations, RoundEnvironment roundEnv ) - { - if ( annotations.isEmpty() ) - { - return true; - } - - // assert that commons-lang3 is on the classpath - try - { - getClass().getClassLoader().loadClass( "org.apache.commons.lang3.StringUtils" ); - } - catch ( ClassNotFoundException expected ) - { - throw new RuntimeException( "Expected org.apache.commons.lang3.StringUtils to be on the processorpath," - + "because it is a declared dependency of the annotation processor." ); - } - - // assert that commons-io is NOT on the classpath, as it is only a project dependency in "annotation-user" - try - { - getClass().getClassLoader().loadClass( "org.apache.commons.io.IOUtils" ); - throw new RuntimeException( "Expected a ClassNotFoundException because " - + "org.apache.commons.io.IOUtils is not supposed to be on the processorpath." ); - } - catch ( ClassNotFoundException expected ) - { - // expected. - } - - Filer filer = processingEnv.getFiler(); - - Elements elementUtils = processingEnv.getElementUtils(); - - Set elements = roundEnv.getElementsAnnotatedWith( annotations.iterator().next() ); - - for ( Element element : elements ) - { - Name name = element.getSimpleName(); - - PackageElement packageElement = elementUtils.getPackageOf( element ); - - try - { - Name packageName = packageElement.getQualifiedName(); - FileObject resource = - filer.createResource( StandardLocation.SOURCE_OUTPUT, packageName, name - + ".txt", element ); - - Writer writer = resource.openWriter(); - writer.write( name.toString() ); - writer.close(); - - String className = name + "Companion"; - JavaFileObject javaFile = filer.createSourceFile( packageName + "." + className, element ); - - Writer javaWriter = javaFile.openWriter(); - javaWriter.append( "package " ).append( packageName ).append( ";\n\n" ); - javaWriter.append( "public class " ).append( className ).append( " {\n" ); - javaWriter.append( " public " ).append( className ).append( "() {\n" ); - javaWriter.append( " System.out.println(\"Hey there!\");\n" ); - javaWriter.append( " }\n}\n" ); - javaWriter.close(); - } - catch ( IOException e ) - { - throw new RuntimeException( e ); - } - } - - return !elements.isEmpty(); - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.issue; + +import javax.annotation.processing.AbstractProcessor; +import javax.annotation.processing.Filer; +import javax.annotation.processing.RoundEnvironment; +import javax.annotation.processing.SupportedAnnotationTypes; +import javax.annotation.processing.SupportedSourceVersion; +import javax.lang.model.SourceVersion; +import javax.lang.model.element.Element; +import javax.lang.model.element.Name; +import javax.lang.model.element.PackageElement; +import javax.lang.model.element.TypeElement; +import javax.lang.model.util.Elements; +import javax.tools.FileObject; +import javax.tools.JavaFileObject; +import javax.tools.StandardLocation; + +import java.io.IOException; +import java.io.Writer; +import java.util.Set; + +@SupportedSourceVersion(SourceVersion.RELEASE_6) +@SupportedAnnotationTypes("org.issue.SimpleAnnotation") +public class SimpleAnnotationProcessor extends AbstractProcessor { + + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + if (annotations.isEmpty()) { + return true; + } + + // assert that commons-lang3 is on the classpath + try { + getClass().getClassLoader().loadClass("org.apache.commons.lang3.StringUtils"); + } catch (ClassNotFoundException expected) { + throw new RuntimeException("Expected org.apache.commons.lang3.StringUtils to be on the processorpath," + + "because it is a declared dependency of the annotation processor."); + } + + // assert that commons-io is NOT on the classpath, as it is only a project dependency in "annotation-user" + try { + getClass().getClassLoader().loadClass("org.apache.commons.io.IOUtils"); + throw new RuntimeException("Expected a ClassNotFoundException because " + + "org.apache.commons.io.IOUtils is not supposed to be on the processorpath."); + } catch (ClassNotFoundException expected) { + // expected. + } + + Filer filer = processingEnv.getFiler(); + + Elements elementUtils = processingEnv.getElementUtils(); + + Set elements = + roundEnv.getElementsAnnotatedWith(annotations.iterator().next()); + + for (Element element : elements) { + Name name = element.getSimpleName(); + + PackageElement packageElement = elementUtils.getPackageOf(element); + + try { + Name packageName = packageElement.getQualifiedName(); + FileObject resource = + filer.createResource(StandardLocation.SOURCE_OUTPUT, packageName, name + ".txt", element); + + Writer writer = resource.openWriter(); + writer.write(name.toString()); + writer.close(); + + String className = name + "Companion"; + JavaFileObject javaFile = filer.createSourceFile(packageName + "." + className, element); + + Writer javaWriter = javaFile.openWriter(); + javaWriter.append("package ").append(packageName).append(";\n\n"); + javaWriter.append("public class ").append(className).append(" {\n"); + javaWriter.append(" public ").append(className).append("() {\n"); + javaWriter.append(" System.out.println(\"Hey there!\");\n"); + javaWriter.append(" }\n}\n"); + javaWriter.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + return !elements.isEmpty(); + } +} diff --git a/src/it/MCOMPILER-203-processorpath/annotation-user/src/main/java/org/issue/SimpleAnnotation.java b/src/it/MCOMPILER-203-processorpath/annotation-user/src/main/java/org/issue/SimpleAnnotation.java index b867beb5..5339365e 100644 --- a/src/it/MCOMPILER-203-processorpath/annotation-user/src/main/java/org/issue/SimpleAnnotation.java +++ b/src/it/MCOMPILER-203-processorpath/annotation-user/src/main/java/org/issue/SimpleAnnotation.java @@ -1,31 +1,28 @@ -package org.issue; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.SOURCE) -public @interface SimpleAnnotation { - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.issue; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.SOURCE) +public @interface SimpleAnnotation {} diff --git a/src/it/MCOMPILER-203-processorpath/annotation-user/src/main/java/org/issue/SimpleObject.java b/src/it/MCOMPILER-203-processorpath/annotation-user/src/main/java/org/issue/SimpleObject.java index 5b7a43f6..18b8fc43 100644 --- a/src/it/MCOMPILER-203-processorpath/annotation-user/src/main/java/org/issue/SimpleObject.java +++ b/src/it/MCOMPILER-203-processorpath/annotation-user/src/main/java/org/issue/SimpleObject.java @@ -1,26 +1,22 @@ -package org.issue; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -@SimpleAnnotation -public class SimpleObject -{ - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.issue; + +@SimpleAnnotation +public class SimpleObject {} diff --git a/src/it/MCOMPILER-203-processorpath/annotation-user/src/test/java/org/issue/SimpleTestObject.java b/src/it/MCOMPILER-203-processorpath/annotation-user/src/test/java/org/issue/SimpleTestObject.java index 48aed126..706dccf1 100644 --- a/src/it/MCOMPILER-203-processorpath/annotation-user/src/test/java/org/issue/SimpleTestObject.java +++ b/src/it/MCOMPILER-203-processorpath/annotation-user/src/test/java/org/issue/SimpleTestObject.java @@ -1,26 +1,22 @@ -package org.issue; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -@SimpleAnnotation -public class SimpleTestObject -{ - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.issue; + +@SimpleAnnotation +public class SimpleTestObject {} diff --git a/src/it/MCOMPILER-205/src/main/java/dummy/HelloWorld.java b/src/it/MCOMPILER-205/src/main/java/dummy/HelloWorld.java index f223c74d..7ceb91cb 100644 --- a/src/it/MCOMPILER-205/src/main/java/dummy/HelloWorld.java +++ b/src/it/MCOMPILER-205/src/main/java/dummy/HelloWorld.java @@ -1,28 +1,25 @@ -package dummy; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 HelloWorld -{ - public static void main(String[] argv) { - System.out.println("Hello World"); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 dummy; + +public class HelloWorld { + public static void main(String[] argv) { + System.out.println("Hello World"); + } +} diff --git a/src/it/MCOMPILER-205/src/main/java/dummy/package-info.java b/src/it/MCOMPILER-205/src/main/java/dummy/package-info.java index ed72542b..9d2deff2 100644 --- a/src/it/MCOMPILER-205/src/main/java/dummy/package-info.java +++ b/src/it/MCOMPILER-205/src/main/java/dummy/package-info.java @@ -20,4 +20,4 @@ /** * This is the package javadoc */ -package dummy; \ No newline at end of file +package dummy; diff --git a/src/it/MCOMPILER-205/verify.groovy b/src/it/MCOMPILER-205/verify.groovy index 1526f866..1041376b 100644 --- a/src/it/MCOMPILER-205/verify.groovy +++ b/src/it/MCOMPILER-205/verify.groovy @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/src/it/MCOMPILER-224/annotation-processor/src/main/java/org/issue/MCompiler224.java b/src/it/MCOMPILER-224/annotation-processor/src/main/java/org/issue/MCompiler224.java index c47ffa04..045a64b1 100644 --- a/src/it/MCOMPILER-224/annotation-processor/src/main/java/org/issue/MCompiler224.java +++ b/src/it/MCOMPILER-224/annotation-processor/src/main/java/org/issue/MCompiler224.java @@ -1,5 +1,3 @@ -package org.issue; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,9 +16,6 @@ * specific language governing permissions and limitations * under the License. */ +package org.issue; - -public @interface MCompiler224 -{ - -} +public @interface MCompiler224 {} diff --git a/src/it/MCOMPILER-224/annotation-processor/src/main/java/org/issue/MCompiler224AnnotationProcessor.java b/src/it/MCOMPILER-224/annotation-processor/src/main/java/org/issue/MCompiler224AnnotationProcessor.java index 2e92f08c..c7ded6bc 100644 --- a/src/it/MCOMPILER-224/annotation-processor/src/main/java/org/issue/MCompiler224AnnotationProcessor.java +++ b/src/it/MCOMPILER-224/annotation-processor/src/main/java/org/issue/MCompiler224AnnotationProcessor.java @@ -1,5 +1,3 @@ -package org.issue; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,9 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - - -import java.util.Set; +package org.issue; import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.Messager; @@ -31,38 +27,31 @@ import javax.lang.model.element.TypeElement; import javax.tools.Diagnostic.Kind; +import java.util.Set; + /* @formatter:off */ -@SupportedAnnotationTypes( { - "org.issue.MCompiler224" -} ) +@SupportedAnnotationTypes({"org.issue.MCompiler224"}) /* @formatter:on */ -@SupportedSourceVersion( SourceVersion.RELEASE_6 ) -public class MCompiler224AnnotationProcessor - extends AbstractProcessor -{ +@SupportedSourceVersion(SourceVersion.RELEASE_6) +public class MCompiler224AnnotationProcessor extends AbstractProcessor { @Override - public boolean process( final Set elts, final RoundEnvironment env ) - { - if ( elts.isEmpty() ) - { + public boolean process(final Set elts, final RoundEnvironment env) { + if (elts.isEmpty()) { return true; } final Messager messager = this.processingEnv.getMessager(); - for ( final Kind kind : Kind.values() ) - { - if ( Kind.ERROR == kind ) - { + for (final Kind kind : Kind.values()) { + if (Kind.ERROR == kind) { continue; } - System.out.println( "Testing message for: " + kind ); - messager.printMessage( kind, kind + " Test message." ); + System.out.println("Testing message for: " + kind); + messager.printMessage(kind, kind + " Test message."); } return true; } - } diff --git a/src/it/MCOMPILER-224/annotation-user/src/main/java/org/issue/user/User.java b/src/it/MCOMPILER-224/annotation-user/src/main/java/org/issue/user/User.java index 38b2ebd5..660beafe 100644 --- a/src/it/MCOMPILER-224/annotation-user/src/main/java/org/issue/user/User.java +++ b/src/it/MCOMPILER-224/annotation-user/src/main/java/org/issue/user/User.java @@ -1,5 +1,3 @@ -package org.issue.user; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,12 +16,9 @@ * specific language governing permissions and limitations * under the License. */ - +package org.issue.user; import org.issue.MCompiler224; @MCompiler224 -public class User -{ - -} +public class User {} diff --git a/src/it/MCOMPILER-228/src/main/java/example/FinalExample.java b/src/it/MCOMPILER-228/src/main/java/example/FinalExample.java index bb577774..dd510e86 100644 --- a/src/it/MCOMPILER-228/src/main/java/example/FinalExample.java +++ b/src/it/MCOMPILER-228/src/main/java/example/FinalExample.java @@ -1,49 +1,40 @@ -package example; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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; - -public class FinalExample -{ - public static final Comparator comparator = ( o1, o2 ) -> - { - final String desc1 = o1; - final String desc2 = o2; - final int compareTo; - if ( desc1 == null ) - { - compareTo = -1; - } - else if ( desc2 == null ) - { - compareTo = 1; - } - else - { - compareTo = desc1.compareTo( desc2 ); - } - if ( compareTo == 0 ) - { - return 3; - } - return compareTo; - }; -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 example; + +import java.util.Comparator; + +public class FinalExample { + public static final Comparator comparator = (o1, o2) -> { + final String desc1 = o1; + final String desc2 = o2; + final int compareTo; + if (desc1 == null) { + compareTo = -1; + } else if (desc2 == null) { + compareTo = 1; + } else { + compareTo = desc1.compareTo(desc2); + } + if (compareTo == 0) { + return 3; + } + return compareTo; + }; +} diff --git a/src/it/MCOMPILER-260_customArguments/src/main/java/com/foo/MyClass.java b/src/it/MCOMPILER-260_customArguments/src/main/java/com/foo/MyClass.java index dae085a4..f646e4ae 100644 --- a/src/it/MCOMPILER-260_customArguments/src/main/java/com/foo/MyClass.java +++ b/src/it/MCOMPILER-260_customArguments/src/main/java/com/foo/MyClass.java @@ -1,25 +1,21 @@ -package com.foo; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 MyClass -{ - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.foo; + +public class MyClass {} diff --git a/src/it/MCOMPILER-268_modulepath/src/main/java/com/foo/MyClass.java b/src/it/MCOMPILER-268_modulepath/src/main/java/com/foo/MyClass.java index dae085a4..f646e4ae 100644 --- a/src/it/MCOMPILER-268_modulepath/src/main/java/com/foo/MyClass.java +++ b/src/it/MCOMPILER-268_modulepath/src/main/java/com/foo/MyClass.java @@ -1,25 +1,21 @@ -package com.foo; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 MyClass -{ - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.foo; + +public class MyClass {} diff --git a/src/it/MCOMPILER-268_modulepath/src/main/java/module-info.java b/src/it/MCOMPILER-268_modulepath/src/main/java/module-info.java index d9800e36..029b6e71 100644 --- a/src/it/MCOMPILER-268_modulepath/src/main/java/module-info.java +++ b/src/it/MCOMPILER-268_modulepath/src/main/java/module-info.java @@ -1,22 +1,22 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -module M.N { - requires org.apache.commons.lang3; -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module M.N { + requires org.apache.commons.lang3; +} diff --git a/src/it/MCOMPILER-268_modulepath/src/test/java/com/foo/MyTest.java b/src/it/MCOMPILER-268_modulepath/src/test/java/com/foo/MyTest.java index efb936e6..072b8086 100644 --- a/src/it/MCOMPILER-268_modulepath/src/test/java/com/foo/MyTest.java +++ b/src/it/MCOMPILER-268_modulepath/src/test/java/com/foo/MyTest.java @@ -1,28 +1,25 @@ -package com.foo; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 junit.framework.TestCase; - -public class MyTest - extends TestCase -{ - private MyClass myClass = new MyClass(); -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.foo; + +import junit.framework.TestCase; + +public class MyTest extends TestCase { + private MyClass myClass = new MyClass(); +} diff --git a/src/it/MCOMPILER-270_release/src/main/java/MyClass.java b/src/it/MCOMPILER-270_release/src/main/java/MyClass.java index 4f947346..d4132bb2 100644 --- a/src/it/MCOMPILER-270_release/src/main/java/MyClass.java +++ b/src/it/MCOMPILER-270_release/src/main/java/MyClass.java @@ -1,23 +1,21 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 MyClass -{ - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 foo; + +public class MyClass {} diff --git a/src/it/MCOMPILER-270_release/src/test/java/MyTest.java b/src/it/MCOMPILER-270_release/src/test/java/MyTest.java index d80ce855..77db4f1d 100644 --- a/src/it/MCOMPILER-270_release/src/test/java/MyTest.java +++ b/src/it/MCOMPILER-270_release/src/test/java/MyTest.java @@ -1,26 +1,23 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 junit.framework.TestCase; - -public class MyTest - extends TestCase -{ - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 foo; + +import junit.framework.TestCase; + +public class MyTest extends TestCase {} diff --git a/src/it/MCOMPILER-272/processor1/src/main/java/processor1/Processor1.java b/src/it/MCOMPILER-272/processor1/src/main/java/processor1/Processor1.java index 319d2740..d1638492 100644 --- a/src/it/MCOMPILER-272/processor1/src/main/java/processor1/Processor1.java +++ b/src/it/MCOMPILER-272/processor1/src/main/java/processor1/Processor1.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,21 +18,18 @@ */ package processor1; -import java.util.Set; - import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; import javax.lang.model.element.TypeElement; +import java.util.Set; + @SupportedAnnotationTypes({"java.lang.SuppressWarnings"}) -public class Processor1 - extends AbstractProcessor -{ +public class Processor1 extends AbstractProcessor { @Override - public boolean process ( Set annotations, RoundEnvironment roundEnv ) - { - System.out.println( "Run processor1" ); + public boolean process(Set annotations, RoundEnvironment roundEnv) { + System.out.println("Run processor1"); return false; } } diff --git a/src/it/MCOMPILER-272/processor2-dep/src/main/java/processor2/dep/Foo.java b/src/it/MCOMPILER-272/processor2-dep/src/main/java/processor2/dep/Foo.java index bd1e92a4..f9fa52a5 100644 --- a/src/it/MCOMPILER-272/processor2-dep/src/main/java/processor2/dep/Foo.java +++ b/src/it/MCOMPILER-272/processor2-dep/src/main/java/processor2/dep/Foo.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,7 +18,4 @@ */ package processor2.dep; -public class Foo -{ - -} +public class Foo {} diff --git a/src/it/MCOMPILER-272/processor2/src/main/java/processor2/Processor2.java b/src/it/MCOMPILER-272/processor2/src/main/java/processor2/Processor2.java index b96a20f4..c2adcb04 100644 --- a/src/it/MCOMPILER-272/processor2/src/main/java/processor2/Processor2.java +++ b/src/it/MCOMPILER-272/processor2/src/main/java/processor2/Processor2.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,21 +18,18 @@ */ package processor2; -import java.util.Set; - import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; import javax.lang.model.element.TypeElement; +import java.util.Set; + @SupportedAnnotationTypes({"java.lang.SuppressWarnings"}) -public class Processor2 - extends AbstractProcessor -{ +public class Processor2 extends AbstractProcessor { @Override - public boolean process ( Set annotations, RoundEnvironment roundEnv ) - { - System.out.println( "Run processor2" ); + public boolean process(Set annotations, RoundEnvironment roundEnv) { + System.out.println("Run processor2"); new processor2.dep.Foo(); return false; } diff --git a/src/it/MCOMPILER-272/project/src/main/java/project/Project.java b/src/it/MCOMPILER-272/project/src/main/java/project/Project.java index 9f00a997..be9e170a 100644 --- a/src/it/MCOMPILER-272/project/src/main/java/project/Project.java +++ b/src/it/MCOMPILER-272/project/src/main/java/project/Project.java @@ -6,9 +6,9 @@ * to you 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 @@ -20,11 +20,7 @@ import java.util.List; -public class Project -{ - @SuppressWarnings( "rawtypes" ) - public void foo( List toto ) - { - - } +public class Project { + @SuppressWarnings("rawtypes") + public void foo(List toto) {} } diff --git a/src/it/MCOMPILER-275_separate-moduleinfo/src/main/java/com/foo/MyClass.java b/src/it/MCOMPILER-275_separate-moduleinfo/src/main/java/com/foo/MyClass.java index dae085a4..f646e4ae 100644 --- a/src/it/MCOMPILER-275_separate-moduleinfo/src/main/java/com/foo/MyClass.java +++ b/src/it/MCOMPILER-275_separate-moduleinfo/src/main/java/com/foo/MyClass.java @@ -1,25 +1,21 @@ -package com.foo; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 MyClass -{ - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.foo; + +public class MyClass {} diff --git a/src/it/MCOMPILER-275_separate-moduleinfo/src/main/java/module-info.java b/src/it/MCOMPILER-275_separate-moduleinfo/src/main/java/module-info.java index c0e023a4..e30faf17 100644 --- a/src/it/MCOMPILER-275_separate-moduleinfo/src/main/java/module-info.java +++ b/src/it/MCOMPILER-275_separate-moduleinfo/src/main/java/module-info.java @@ -1,22 +1,21 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -module M.N { - -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.foo; + +module M.N {} diff --git a/src/it/MCOMPILER-275_separate-moduleinfo/src/test/java/com/foo/MyTest.java b/src/it/MCOMPILER-275_separate-moduleinfo/src/test/java/com/foo/MyTest.java index efb936e6..072b8086 100644 --- a/src/it/MCOMPILER-275_separate-moduleinfo/src/test/java/com/foo/MyTest.java +++ b/src/it/MCOMPILER-275_separate-moduleinfo/src/test/java/com/foo/MyTest.java @@ -1,28 +1,25 @@ -package com.foo; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 junit.framework.TestCase; - -public class MyTest - extends TestCase -{ - private MyClass myClass = new MyClass(); -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.foo; + +import junit.framework.TestCase; + +public class MyTest extends TestCase { + private MyClass myClass = new MyClass(); +} diff --git a/src/it/MCOMPILER-284/src/main/java/com/foo/MyClass.java b/src/it/MCOMPILER-284/src/main/java/com/foo/MyClass.java index 7370ac08..f646e4ae 100644 --- a/src/it/MCOMPILER-284/src/main/java/com/foo/MyClass.java +++ b/src/it/MCOMPILER-284/src/main/java/com/foo/MyClass.java @@ -1,5 +1,3 @@ -package com.foo; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,8 +16,6 @@ * specific language governing permissions and limitations * under the License. */ +package com.foo; -public class MyClass -{ - -} +public class MyClass {} diff --git a/src/it/MCOMPILER-284/src/test/java/com/foo/MyTest.java b/src/it/MCOMPILER-284/src/test/java/com/foo/MyTest.java index f152b90e..072b8086 100644 --- a/src/it/MCOMPILER-284/src/test/java/com/foo/MyTest.java +++ b/src/it/MCOMPILER-284/src/test/java/com/foo/MyTest.java @@ -1,5 +1,3 @@ -package com.foo; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,11 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +package com.foo; import junit.framework.TestCase; -public class MyTest - extends TestCase -{ +public class MyTest extends TestCase { private MyClass myClass = new MyClass(); } diff --git a/src/it/MCOMPILER-294/app/src/main/java/module-info.java b/src/it/MCOMPILER-294/app/src/main/java/module-info.java index 3cda7211..d90b8a19 100644 --- a/src/it/MCOMPILER-294/app/src/main/java/module-info.java +++ b/src/it/MCOMPILER-294/app/src/main/java/module-info.java @@ -1,22 +1,22 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -module org.maven.test.app { - requires org.maven.test.lib; -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.maven.test.app { + requires org.maven.test.lib; +} diff --git a/src/it/MCOMPILER-294/app/src/main/java/org/maven/test/app/Main.java b/src/it/MCOMPILER-294/app/src/main/java/org/maven/test/app/Main.java index 5d94eec5..cdd399a9 100644 --- a/src/it/MCOMPILER-294/app/src/main/java/org/maven/test/app/Main.java +++ b/src/it/MCOMPILER-294/app/src/main/java/org/maven/test/app/Main.java @@ -1,32 +1,31 @@ -package org.maven.test.app; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 org.maven.test.lib.Sout; - -public class Main { - - /** - * @param args - */ - public static void main(String[] args) { - Sout.println( args ); - } -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.maven.test.app; + +import org.maven.test.lib.Sout; + +public class Main { + + /** + * @param args + */ + public static void main(String[] args) { + Sout.println(args); + } +} diff --git a/src/it/MCOMPILER-294/lib/src/main/java/module-info.java b/src/it/MCOMPILER-294/lib/src/main/java/module-info.java index a218436f..52414cf8 100644 --- a/src/it/MCOMPILER-294/lib/src/main/java/module-info.java +++ b/src/it/MCOMPILER-294/lib/src/main/java/module-info.java @@ -1,22 +1,22 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -module org.maven.test.lib { - exports org.maven.test.lib; -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.maven.test.lib { + exports org.maven.test.lib; +} diff --git a/src/it/MCOMPILER-294/lib/src/main/java/org/maven/test/lib/Sout.java b/src/it/MCOMPILER-294/lib/src/main/java/org/maven/test/lib/Sout.java index 658044ec..99c65f94 100644 --- a/src/it/MCOMPILER-294/lib/src/main/java/org/maven/test/lib/Sout.java +++ b/src/it/MCOMPILER-294/lib/src/main/java/org/maven/test/lib/Sout.java @@ -1,33 +1,31 @@ -package org.maven.test.lib; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 Sout { - - /** - * @param args - */ - public static void println(String[] args) { - for ( String string : args ) - { - System.out.println( args ); - } - } -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.maven.test.lib; + +public class Sout { + + /** + * @param args + */ + public static void println(String[] args) { + for (String string : args) { + System.out.println(args); + } + } +} diff --git a/src/it/MCOMPILER-298/src/main/java/com/foo/ParameterClass.java b/src/it/MCOMPILER-298/src/main/java/com/foo/ParameterClass.java index 439e1e1e..44d79122 100644 --- a/src/it/MCOMPILER-298/src/main/java/com/foo/ParameterClass.java +++ b/src/it/MCOMPILER-298/src/main/java/com/foo/ParameterClass.java @@ -1,5 +1,3 @@ -package com.foo; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,12 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +package com.foo; - -public class ParameterClass -{ - public void method( String parameterName ) - { +public class ParameterClass { + public void method(String parameterName) { // nothing } } diff --git a/src/it/MCOMPILER-298/src/test/java/com/foo/ParameterTest.java b/src/it/MCOMPILER-298/src/test/java/com/foo/ParameterTest.java index b552b774..42d771df 100644 --- a/src/it/MCOMPILER-298/src/test/java/com/foo/ParameterTest.java +++ b/src/it/MCOMPILER-298/src/test/java/com/foo/ParameterTest.java @@ -1,5 +1,3 @@ -package com.foo; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,19 +16,21 @@ * specific language governing permissions and limitations * under the License. */ - -import static org.junit.Assert.*; +package com.foo; import org.junit.Test; +import static org.junit.Assert.*; - -public class ParameterTest -{ +public class ParameterTest { @Test - public void testParameter() throws Exception - { - assertEquals( "parameterName", ParameterClass.class.getMethod( "method", String.class ).getParameters()[0].getName() ); + public void testParameter() throws Exception { + assertEquals( + "parameterName", + ParameterClass.class + .getMethod("method", String.class) + .getParameters()[0] + .getName()); } } diff --git a/src/it/MCOMPILER-321_pathexceptions/src/main/java/module-info.java b/src/it/MCOMPILER-321_pathexceptions/src/main/java/module-info.java index 0f43b063..a57384df 100644 --- a/src/it/MCOMPILER-321_pathexceptions/src/main/java/module-info.java +++ b/src/it/MCOMPILER-321_pathexceptions/src/main/java/module-info.java @@ -6,9 +6,9 @@ * to you 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 @@ -17,6 +17,4 @@ * under the License. */ -module M.N { - -} \ No newline at end of file +module M.N {} diff --git a/src/it/MCOMPILER-321_pathexceptions/src/test/java/test/MyTest.java b/src/it/MCOMPILER-321_pathexceptions/src/test/java/test/MyTest.java index e2e08352..c42edd69 100644 --- a/src/it/MCOMPILER-321_pathexceptions/src/test/java/test/MyTest.java +++ b/src/it/MCOMPILER-321_pathexceptions/src/test/java/test/MyTest.java @@ -1,5 +1,3 @@ -package test; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ +package test; -public class MyTest -{ -} \ No newline at end of file +public class MyTest {} diff --git a/src/it/MCOMPILER-328_multiReleaseOutput/src/main/java/MyClass.java b/src/it/MCOMPILER-328_multiReleaseOutput/src/main/java/MyClass.java index 90a93702..d4132bb2 100644 --- a/src/it/MCOMPILER-328_multiReleaseOutput/src/main/java/MyClass.java +++ b/src/it/MCOMPILER-328_multiReleaseOutput/src/main/java/MyClass.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,7 +18,4 @@ */ package foo; -public class MyClass -{ - -} +public class MyClass {} diff --git a/src/it/MCOMPILER-336_incremental-modulepath/a/src/main/java/module-info.java b/src/it/MCOMPILER-336_incremental-modulepath/a/src/main/java/module-info.java index 234b5f94..aef91dbb 100644 --- a/src/it/MCOMPILER-336_incremental-modulepath/a/src/main/java/module-info.java +++ b/src/it/MCOMPILER-336_incremental-modulepath/a/src/main/java/module-info.java @@ -16,6 +16,4 @@ * specific language governing permissions and limitations * under the License. */ -module test.a -{ -} +module test.a {} diff --git a/src/it/MCOMPILER-336_incremental-modulepath/b/src/main/java/module-info.java b/src/it/MCOMPILER-336_incremental-modulepath/b/src/main/java/module-info.java index c9f16f17..f2213e3c 100644 --- a/src/it/MCOMPILER-336_incremental-modulepath/b/src/main/java/module-info.java +++ b/src/it/MCOMPILER-336_incremental-modulepath/b/src/main/java/module-info.java @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -module test.b -{ +module test.b { requires transitive test.a; } diff --git a/src/it/MCOMPILER-336_incremental-modulepath/b/src/main/java/test/Foo.java b/src/it/MCOMPILER-336_incremental-modulepath/b/src/main/java/test/Foo.java index c22b20aa..0ec20eb3 100644 --- a/src/it/MCOMPILER-336_incremental-modulepath/b/src/main/java/test/Foo.java +++ b/src/it/MCOMPILER-336_incremental-modulepath/b/src/main/java/test/Foo.java @@ -1,5 +1,3 @@ -package org.opengis.annotation; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +16,6 @@ * specific language governing permissions and limitations * under the License. */ +package org.opengis.annotation; -public class Foo { -} +public class Foo {} diff --git a/src/it/MCOMPILER-336_incremental-modulepath/b/src/main/java/test/package-info.java b/src/it/MCOMPILER-336_incremental-modulepath/b/src/main/java/test/package-info.java index 41a65d1f..d4eae974 100644 --- a/src/it/MCOMPILER-336_incremental-modulepath/b/src/main/java/test/package-info.java +++ b/src/it/MCOMPILER-336_incremental-modulepath/b/src/main/java/test/package-info.java @@ -1,5 +1,3 @@ -package org.opengis.annotation; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -17,4 +15,5 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - */ \ No newline at end of file + */ +package org.opengis.annotation; diff --git a/src/it/MCOMPILER-346/src/main/java/org/jenkinsci/test/acceptance/server/PooledJenkinsController.java b/src/it/MCOMPILER-346/src/main/java/org/jenkinsci/test/acceptance/server/PooledJenkinsController.java index f7fbf61f..06706f90 100644 --- a/src/it/MCOMPILER-346/src/main/java/org/jenkinsci/test/acceptance/server/PooledJenkinsController.java +++ b/src/it/MCOMPILER-346/src/main/java/org/jenkinsci/test/acceptance/server/PooledJenkinsController.java @@ -1,5 +1,3 @@ -package org.jenkinsci.test.acceptance.server; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,8 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +package org.jenkinsci.test.acceptance.server; import javax.inject.Inject; + import java.io.File; import java.io.IOException; import java.net.URL; @@ -27,23 +27,22 @@ import java.util.List; import java.util.concurrent.Executors; -import org.jenkinsci.remoting.RoleChecker; -import org.jenkinsci.test.acceptance.controller.IJenkinsController; -import org.jenkinsci.test.acceptance.controller.JenkinsController; -import org.jenkinsci.test.acceptance.controller.LocalController.LocalFactoryImpl; -import org.jenkinsci.test.acceptance.log.LogListenable; -import org.jenkinsci.test.acceptance.log.LogListener; -import org.jenkinsci.test.acceptance.log.LogSplitter; - import com.cloudbees.sdk.extensibility.Extension; import com.google.inject.Injector; - import hudson.remoting.Callable; import hudson.remoting.Channel; import hudson.remoting.Channel.Mode; import hudson.remoting.ChannelBuilder; import jnr.unixsocket.UnixSocketAddress; import jnr.unixsocket.UnixSocketChannel; +import org.jenkinsci.remoting.RoleChecker; +import org.jenkinsci.test.acceptance.controller.IJenkinsController; +import org.jenkinsci.test.acceptance.controller.JenkinsController; +import org.jenkinsci.test.acceptance.controller.LocalController.LocalFactoryImpl; +import org.jenkinsci.test.acceptance.log.LogListenable; +import org.jenkinsci.test.acceptance.log.LogListener; +import org.jenkinsci.test.acceptance.log.LogSplitter; + import static java.lang.System.*; /** @@ -76,7 +75,7 @@ public void removeLogListener(LogListener l) { } private boolean connect() throws IOException { - if (conn != null) return false; + if (conn != null) return false; System.out.println("Requesting jut instance using socket " + socket.getAbsolutePath()); UnixSocketAddress address = new UnixSocketAddress(socket); @@ -87,7 +86,7 @@ private boolean connect() throws IOException { .build(ChannelStream.in(conn), ChannelStream.out(conn)); try { - controller = (IJenkinsController)channel.waitForRemoteProperty("controller"); + controller = (IJenkinsController) channel.waitForRemoteProperty("controller"); controller.start(); url = controller.getUrl(); @@ -96,7 +95,7 @@ private boolean connect() throws IOException { } final LogListener l = channel.export(LogListener.class, splitter); - channel.call(new InstallLogger(controller,l)); + channel.call(new InstallLogger(controller, l)); for (byte[] content : toUnpack) { controller.populateJenkinsHome(content, false); @@ -133,8 +132,7 @@ public void populateJenkinsHome(byte[] template, boolean clean) throws IOExcepti @Override public URL getUrl() { - if (url==null) - throw new IllegalStateException("This controller has not been started"); + if (url == null) throw new IllegalStateException("This controller has not been started"); return url; } @@ -146,8 +144,7 @@ public void tearDown() throws IOException { } catch (InterruptedException e) { throw new IOException(e); } finally { - if (conn !=null) - conn.close(); + if (conn != null) conn.close(); conn = null; } } @@ -156,7 +153,7 @@ public void tearDown() throws IOException { public void diagnose(Throwable cause) { // TODO: Report jenkins log cause.printStackTrace(out); - if(getenv("INTERACTIVE") != null && getenv("INTERACTIVE").equals("true")){ + if (getenv("INTERACTIVE") != null && getenv("INTERACTIVE").equals("true")) { out.println("Commencing interactive debugging. Browser session was kept open."); out.println("Press return to proceed."); try { @@ -169,7 +166,8 @@ public void diagnose(Throwable cause) { @Extension public static class FactoryImpl extends LocalFactoryImpl { - @Inject Injector i; + @Inject + Injector i; @Override public String getId() { @@ -204,8 +202,7 @@ public Void call() throws IOException { } @Override - public void checkRoles(RoleChecker checker) throws SecurityException { - } + public void checkRoles(RoleChecker checker) throws SecurityException {} private static final long serialVersionUID = 1L; } diff --git a/src/it/MCOMPILER-349_dependencyChanged/dependent-module/src/main/java/Main.java b/src/it/MCOMPILER-349_dependencyChanged/dependent-module/src/main/java/Main.java index 1d0ba1f1..3f50a05e 100644 --- a/src/it/MCOMPILER-349_dependencyChanged/dependent-module/src/main/java/Main.java +++ b/src/it/MCOMPILER-349_dependencyChanged/dependent-module/src/main/java/Main.java @@ -18,11 +18,9 @@ */ package foo; -public class Main -{ - public static void main( String[] args ) - { +public class Main { + public static void main(String[] args) { TestService testService = new TestService(); testService.run(); } -} \ No newline at end of file +} diff --git a/src/it/MCOMPILER-349_dependencyChanged/service/src/main/java/TestService.java b/src/it/MCOMPILER-349_dependencyChanged/service/src/main/java/TestService.java index 2e1d747a..08e2016a 100644 --- a/src/it/MCOMPILER-349_dependencyChanged/service/src/main/java/TestService.java +++ b/src/it/MCOMPILER-349_dependencyChanged/service/src/main/java/TestService.java @@ -18,11 +18,7 @@ */ package foo; -public class TestService -{ +public class TestService { - public void run() - { - - } -} \ No newline at end of file + public void run() {} +} diff --git a/src/it/MCOMPILER-349_dependencyChanged/verify.groovy b/src/it/MCOMPILER-349_dependencyChanged/verify.groovy index c2182819..f09d28da 100644 --- a/src/it/MCOMPILER-349_dependencyChanged/verify.groovy +++ b/src/it/MCOMPILER-349_dependencyChanged/verify.groovy @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/src/it/MCOMPILER-360/main360/src/main/java/module-info.java b/src/it/MCOMPILER-360/main360/src/main/java/module-info.java index 2ad68325..084009f0 100644 --- a/src/it/MCOMPILER-360/main360/src/main/java/module-info.java +++ b/src/it/MCOMPILER-360/main360/src/main/java/module-info.java @@ -6,9 +6,9 @@ * to you 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 @@ -17,5 +17,4 @@ * under the License. */ -module org.maven.test.app { -} +module org.maven.test.app {} diff --git a/src/it/MCOMPILER-366/src/main/java/module-info.java b/src/it/MCOMPILER-366/src/main/java/module-info.java index 95e72665..543dc053 100644 --- a/src/it/MCOMPILER-366/src/main/java/module-info.java +++ b/src/it/MCOMPILER-366/src/main/java/module-info.java @@ -6,9 +6,9 @@ * to you 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 @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -module lib -{ +module lib { requires plexus.utils; requires plexus.resources; + exports org.maven.test; -} \ No newline at end of file +} diff --git a/src/it/MCOMPILER-366/src/main/java/org/maven/test/Main.java b/src/it/MCOMPILER-366/src/main/java/org/maven/test/Main.java index f2c4a2fa..833bee54 100644 --- a/src/it/MCOMPILER-366/src/main/java/org/maven/test/Main.java +++ b/src/it/MCOMPILER-366/src/main/java/org/maven/test/Main.java @@ -1,5 +1,3 @@ -package org.maven.test; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,9 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +package org.maven.test; -import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.resource.ResourceManager; +import org.codehaus.plexus.util.StringUtils; public class Main { @@ -28,7 +27,7 @@ public class Main { * @param args */ public static void main(String[] args) { - System.out.println( StringUtils.concatenate( args ) ); + System.out.println(StringUtils.concatenate(args)); ResourceManager manager = null; } -} \ No newline at end of file +} diff --git a/src/it/MCOMPILER-373_mrjar/src/main/java/org/maven/bug/A.java b/src/it/MCOMPILER-373_mrjar/src/main/java/org/maven/bug/A.java index 03303316..7360b4a5 100644 --- a/src/it/MCOMPILER-373_mrjar/src/main/java/org/maven/bug/A.java +++ b/src/it/MCOMPILER-373_mrjar/src/main/java/org/maven/bug/A.java @@ -1,5 +1,3 @@ -package org.maven.bug; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,11 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +package org.maven.bug; -public class A -{ - static int getCount() - { +public class A { + static int getCount() { return 1; } } diff --git a/src/it/MCOMPILER-373_mrjar/src/main/java/org/maven/bug/B.java b/src/it/MCOMPILER-373_mrjar/src/main/java/org/maven/bug/B.java index e30f7296..aec29939 100644 --- a/src/it/MCOMPILER-373_mrjar/src/main/java/org/maven/bug/B.java +++ b/src/it/MCOMPILER-373_mrjar/src/main/java/org/maven/bug/B.java @@ -1,5 +1,3 @@ -package org.maven.bug; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,11 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +package org.maven.bug; -public class B -{ - static int getCount() - { +public class B { + static int getCount() { return A.getCount() + 1; } } diff --git a/src/it/MCOMPILER-373_mrjar/src/main/java11/org/maven/bug/B.java b/src/it/MCOMPILER-373_mrjar/src/main/java11/org/maven/bug/B.java index 8963f312..1797e69e 100644 --- a/src/it/MCOMPILER-373_mrjar/src/main/java11/org/maven/bug/B.java +++ b/src/it/MCOMPILER-373_mrjar/src/main/java11/org/maven/bug/B.java @@ -1,5 +1,3 @@ -package org.maven.bug; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,11 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +package org.maven.bug; -public class B -{ - int getCount() - { +public class B { + int getCount() { return A9.getCount() + 2; } } diff --git a/src/it/MCOMPILER-373_mrjar/src/main/java9/org/maven/bug/A9.java b/src/it/MCOMPILER-373_mrjar/src/main/java9/org/maven/bug/A9.java index 16fcc261..4b56281d 100644 --- a/src/it/MCOMPILER-373_mrjar/src/main/java9/org/maven/bug/A9.java +++ b/src/it/MCOMPILER-373_mrjar/src/main/java9/org/maven/bug/A9.java @@ -1,5 +1,3 @@ -package org.maven.bug; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,11 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +package org.maven.bug; -public class A9 -{ - static int getCount() - { +public class A9 { + static int getCount() { return A.getCount() + 1; } } diff --git a/src/it/MCOMPILER-373_mrjar/src/main/java9/org/maven/bug/B.java b/src/it/MCOMPILER-373_mrjar/src/main/java9/org/maven/bug/B.java index cfb033b6..1e54a47e 100644 --- a/src/it/MCOMPILER-373_mrjar/src/main/java9/org/maven/bug/B.java +++ b/src/it/MCOMPILER-373_mrjar/src/main/java9/org/maven/bug/B.java @@ -1,5 +1,3 @@ -package org.maven.bug; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,11 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +package org.maven.bug; -public class B -{ - static int getCount() - { +public class B { + static int getCount() { return A9.getCount() + 1; } } diff --git a/src/it/MCOMPILER-379/module2/src/main/java/com/natros/mcp/Foo.java b/src/it/MCOMPILER-379/module2/src/main/java/com/natros/mcp/Foo.java index 7e6d55c2..c63e6e40 100644 --- a/src/it/MCOMPILER-379/module2/src/main/java/com/natros/mcp/Foo.java +++ b/src/it/MCOMPILER-379/module2/src/main/java/com/natros/mcp/Foo.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,5 +18,4 @@ */ package com.natros.mcp; -public class Foo { -} +public class Foo {} diff --git a/src/it/MCOMPILER-474_recompile-dependent-when-package/dependent-module/src/main/java/Main.java b/src/it/MCOMPILER-474_recompile-dependent-when-package/dependent-module/src/main/java/Main.java index 14039917..3f50a05e 100644 --- a/src/it/MCOMPILER-474_recompile-dependent-when-package/dependent-module/src/main/java/Main.java +++ b/src/it/MCOMPILER-474_recompile-dependent-when-package/dependent-module/src/main/java/Main.java @@ -18,10 +18,8 @@ */ package foo; -public class Main -{ - public static void main( String[] args ) - { +public class Main { + public static void main(String[] args) { TestService testService = new TestService(); testService.run(); } diff --git a/src/it/MCOMPILER-474_recompile-dependent-when-package/service/src/main/java/TestService.java b/src/it/MCOMPILER-474_recompile-dependent-when-package/service/src/main/java/TestService.java index 4fb1ade5..08e2016a 100644 --- a/src/it/MCOMPILER-474_recompile-dependent-when-package/service/src/main/java/TestService.java +++ b/src/it/MCOMPILER-474_recompile-dependent-when-package/service/src/main/java/TestService.java @@ -18,11 +18,7 @@ */ package foo; -public class TestService -{ +public class TestService { - public void run() - { - - } + public void run() {} } diff --git a/src/it/MCOMPILER-474_recompile-dependent-when-package/verify.groovy b/src/it/MCOMPILER-474_recompile-dependent-when-package/verify.groovy index 11789f72..e32f7a63 100644 --- a/src/it/MCOMPILER-474_recompile-dependent-when-package/verify.groovy +++ b/src/it/MCOMPILER-474_recompile-dependent-when-package/verify.groovy @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/src/it/MCOMPILER-481-requires-static-included/app/src/main/java/org/test/app/Main.java b/src/it/MCOMPILER-481-requires-static-included/app/src/main/java/org/test/app/Main.java index 6debb0cf..631169b8 100644 --- a/src/it/MCOMPILER-481-requires-static-included/app/src/main/java/org/test/app/Main.java +++ b/src/it/MCOMPILER-481-requires-static-included/app/src/main/java/org/test/app/Main.java @@ -1,5 +1,3 @@ -package org.test.app; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ +package org.test.app; -public class Main -{ -} +public class Main {} diff --git a/src/it/MCOMPILER-481-requires-static-included/app/src/test/java/org/test/app/MainTest.java b/src/it/MCOMPILER-481-requires-static-included/app/src/test/java/org/test/app/MainTest.java index 9c220a88..216b3a9a 100644 --- a/src/it/MCOMPILER-481-requires-static-included/app/src/test/java/org/test/app/MainTest.java +++ b/src/it/MCOMPILER-481-requires-static-included/app/src/test/java/org/test/app/MainTest.java @@ -1,5 +1,3 @@ -package org.test.app; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,16 +16,15 @@ * specific language governing permissions and limitations * under the License. */ +package org.test.app; import org.eclipse.jetty.util.ajax.JSON; import org.junit.jupiter.api.Test; import org.test.service.JSONService; -public class MainTest -{ +public class MainTest { @Test - public void test() - { + public void test() { JSON json = new JSONService().json; System.err.println("json = " + json); } diff --git a/src/it/MCOMPILER-481-requires-static-included/service/src/main/java/org/test/service/JSONService.java b/src/it/MCOMPILER-481-requires-static-included/service/src/main/java/org/test/service/JSONService.java index 0bca3de1..022fd19a 100644 --- a/src/it/MCOMPILER-481-requires-static-included/service/src/main/java/org/test/service/JSONService.java +++ b/src/it/MCOMPILER-481-requires-static-included/service/src/main/java/org/test/service/JSONService.java @@ -1,5 +1,3 @@ -package org.test.service; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +package org.test.service; import org.eclipse.jetty.util.ajax.JSON; -public class JSONService extends Service -{ +public class JSONService extends Service { public final JSON json = new JSON(); } diff --git a/src/it/MCOMPILER-481-requires-static-included/service/src/main/java/org/test/service/Service.java b/src/it/MCOMPILER-481-requires-static-included/service/src/main/java/org/test/service/Service.java index 69b865f1..7bd21cf5 100644 --- a/src/it/MCOMPILER-481-requires-static-included/service/src/main/java/org/test/service/Service.java +++ b/src/it/MCOMPILER-481-requires-static-included/service/src/main/java/org/test/service/Service.java @@ -1,5 +1,3 @@ -package org.test.service; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ +package org.test.service; -public abstract class Service -{ -} +public abstract class Service {} diff --git a/src/it/MCOMPILER-485/src/main/java/dummy/HelloWorld.java b/src/it/MCOMPILER-485/src/main/java/dummy/HelloWorld.java index cda1006a..7ceb91cb 100644 --- a/src/it/MCOMPILER-485/src/main/java/dummy/HelloWorld.java +++ b/src/it/MCOMPILER-485/src/main/java/dummy/HelloWorld.java @@ -1,5 +1,3 @@ -package dummy; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,11 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +package dummy; - -public class HelloWorld -{ - public static void main(String[] argv) { - System.out.println("Hello World"); - } +public class HelloWorld { + public static void main(String[] argv) { + System.out.println("Hello World"); + } } diff --git a/src/it/MCOMPILER-485/src/main/java/dummy/package-info.java b/src/it/MCOMPILER-485/src/main/java/dummy/package-info.java index ed72542b..9d2deff2 100644 --- a/src/it/MCOMPILER-485/src/main/java/dummy/package-info.java +++ b/src/it/MCOMPILER-485/src/main/java/dummy/package-info.java @@ -20,4 +20,4 @@ /** * This is the package javadoc */ -package dummy; \ No newline at end of file +package dummy; diff --git a/src/it/MCOMPILER-485/verify.groovy b/src/it/MCOMPILER-485/verify.groovy index 2384fecd..d8ccdafe 100644 --- a/src/it/MCOMPILER-485/verify.groovy +++ b/src/it/MCOMPILER-485/verify.groovy @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/src/it/MCOMPILER-495/src/main/java/dummy/package-info.java b/src/it/MCOMPILER-495/src/main/java/dummy/package-info.java index ed72542b..9d2deff2 100644 --- a/src/it/MCOMPILER-495/src/main/java/dummy/package-info.java +++ b/src/it/MCOMPILER-495/src/main/java/dummy/package-info.java @@ -20,4 +20,4 @@ /** * This is the package javadoc */ -package dummy; \ No newline at end of file +package dummy; diff --git a/src/it/MCOMPILER-495/verify.groovy b/src/it/MCOMPILER-495/verify.groovy index 2384fecd..d8ccdafe 100644 --- a/src/it/MCOMPILER-495/verify.groovy +++ b/src/it/MCOMPILER-495/verify.groovy @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/src/it/MCOMPILER-500-package-info-incr/src/main/java/dummy/Person.java b/src/it/MCOMPILER-500-package-info-incr/src/main/java/dummy/Person.java index e5fbf583..f07d0f37 100644 --- a/src/it/MCOMPILER-500-package-info-incr/src/main/java/dummy/Person.java +++ b/src/it/MCOMPILER-500-package-info-incr/src/main/java/dummy/Person.java @@ -1,5 +1,3 @@ -package dummy; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - +package dummy; public class Person { private long id; diff --git a/src/it/MCOMPILER-500-package-info-incr/src/main/java/dummy/foo/Person.java b/src/it/MCOMPILER-500-package-info-incr/src/main/java/dummy/foo/Person.java index 9b56c1d6..15d396d1 100644 --- a/src/it/MCOMPILER-500-package-info-incr/src/main/java/dummy/foo/Person.java +++ b/src/it/MCOMPILER-500-package-info-incr/src/main/java/dummy/foo/Person.java @@ -1,5 +1,3 @@ -package dummy.foo; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - +package dummy.foo; public class Person { private long id; diff --git a/src/it/MCOMPILER-500-package-info-incr/src/main/java/dummy/package-info.java b/src/it/MCOMPILER-500-package-info-incr/src/main/java/dummy/package-info.java index ed72542b..9d2deff2 100644 --- a/src/it/MCOMPILER-500-package-info-incr/src/main/java/dummy/package-info.java +++ b/src/it/MCOMPILER-500-package-info-incr/src/main/java/dummy/package-info.java @@ -20,4 +20,4 @@ /** * This is the package javadoc */ -package dummy; \ No newline at end of file +package dummy; diff --git a/src/it/MCOMPILER-500-package-info-incr/verify.groovy b/src/it/MCOMPILER-500-package-info-incr/verify.groovy index ecba9c29..ef41bdec 100644 --- a/src/it/MCOMPILER-500-package-info-incr/verify.groovy +++ b/src/it/MCOMPILER-500-package-info-incr/verify.groovy @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-processor-dep-v1/src/main/java/mcompiler503/AnnotationProcessorDependencyV1.java b/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-processor-dep-v1/src/main/java/mcompiler503/AnnotationProcessorDependencyV1.java index 3df98c47..35fe82b1 100644 --- a/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-processor-dep-v1/src/main/java/mcompiler503/AnnotationProcessorDependencyV1.java +++ b/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-processor-dep-v1/src/main/java/mcompiler503/AnnotationProcessorDependencyV1.java @@ -1,4 +1,3 @@ -package mcompiler503; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -17,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ +package mcompiler503; -public class AnnotationProcessorDependencyV1 -{ -} \ No newline at end of file +public class AnnotationProcessorDependencyV1 {} diff --git a/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-processor-dep-v2/src/main/java/mcompiler503/AnnotationProcessorDependencyV2.java b/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-processor-dep-v2/src/main/java/mcompiler503/AnnotationProcessorDependencyV2.java index 43f09f39..08c5067d 100644 --- a/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-processor-dep-v2/src/main/java/mcompiler503/AnnotationProcessorDependencyV2.java +++ b/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-processor-dep-v2/src/main/java/mcompiler503/AnnotationProcessorDependencyV2.java @@ -1,4 +1,3 @@ -package mcompiler503; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -17,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ +package mcompiler503; -public class AnnotationProcessorDependencyV2 -{ -} \ No newline at end of file +public class AnnotationProcessorDependencyV2 {} diff --git a/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-processor/src/main/java/mcompiler503/SimpleAnnotationProcessor.java b/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-processor/src/main/java/mcompiler503/SimpleAnnotationProcessor.java index 05f205c0..74c44a4b 100644 --- a/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-processor/src/main/java/mcompiler503/SimpleAnnotationProcessor.java +++ b/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-processor/src/main/java/mcompiler503/SimpleAnnotationProcessor.java @@ -1,4 +1,3 @@ -package mcompiler503; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -17,10 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - -import java.io.IOException; -import java.io.Writer; -import java.util.Set; +package mcompiler503; import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.Filer; @@ -37,43 +33,37 @@ import javax.tools.JavaFileObject; import javax.tools.StandardLocation; -@SupportedSourceVersion( SourceVersion.RELEASE_6 ) -@SupportedAnnotationTypes( "mcompiler503.SimpleAnnotation" ) -public class SimpleAnnotationProcessor - extends AbstractProcessor -{ +import java.io.IOException; +import java.io.Writer; +import java.util.Set; + +@SupportedSourceVersion(SourceVersion.RELEASE_6) +@SupportedAnnotationTypes("mcompiler503.SimpleAnnotation") +public class SimpleAnnotationProcessor extends AbstractProcessor { @Override - public boolean process( Set annotations, RoundEnvironment roundEnv ) - { - if ( annotations.isEmpty() ) - { + public boolean process(Set annotations, RoundEnvironment roundEnv) { + if (annotations.isEmpty()) { return true; } // assert that mcompiler503-annotation-processor-dep:2.0.0-SNAPSHOT is on the classpath - try - { - getClass().getClassLoader().loadClass( "mcompiler503.AnnotationProcessorDependencyV2" ); - } - catch ( ClassNotFoundException expected ) - { - throw new RuntimeException( "Expected mcompiler503.AnnotationProcessorDependencyV2 to be on the" + try { + getClass().getClassLoader().loadClass("mcompiler503.AnnotationProcessorDependencyV2"); + } catch (ClassNotFoundException expected) { + throw new RuntimeException("Expected mcompiler503.AnnotationProcessorDependencyV2 to be on the" + "processorpath, because mcompiler503-annotation-processor-dep:2.0.0-SNAPSHOT is specifically" - + "configured as one the elements of the processorpath." ); + + "configured as one the elements of the processorpath."); } // assert that mcompiler503-annotation-processor-dep:1.0.0-SNAPSHOT is NOT on the classpath, // since it should be replaced by mcompiler503-annotation-processor-dep:2.0.0-SNAPSHOT // when resolving annotation processors and their dependencies - try - { - getClass().getClassLoader().loadClass( "mcompiler503.AnnotationProcessorDependencyV1" ); - throw new RuntimeException( "Expected a ClassNotFoundException, because " - + "mcompiler503.AnnotationProcessorDependencyV1 is not supposed to be on the processorpath." ); - } - catch ( ClassNotFoundException expected ) - { + try { + getClass().getClassLoader().loadClass("mcompiler503.AnnotationProcessorDependencyV1"); + throw new RuntimeException("Expected a ClassNotFoundException, because " + + "mcompiler503.AnnotationProcessorDependencyV1 is not supposed to be on the processorpath."); + } catch (ClassNotFoundException expected) { // expected. } @@ -81,38 +71,35 @@ public boolean process( Set annotations, RoundEnvironment Elements elementUtils = processingEnv.getElementUtils(); - Set elements = roundEnv.getElementsAnnotatedWith( annotations.iterator().next() ); + Set elements = + roundEnv.getElementsAnnotatedWith(annotations.iterator().next()); - for ( Element element : elements ) - { + for (Element element : elements) { Name name = element.getSimpleName(); - PackageElement packageElement = elementUtils.getPackageOf( element ); + PackageElement packageElement = elementUtils.getPackageOf(element); - try - { + try { Name packageName = packageElement.getQualifiedName(); FileObject resource = - filer.createResource( StandardLocation.SOURCE_OUTPUT, packageName, name + ".txt", element ); + filer.createResource(StandardLocation.SOURCE_OUTPUT, packageName, name + ".txt", element); Writer writer = resource.openWriter(); - writer.write( name.toString() ); + writer.write(name.toString()); writer.close(); String className = name + "Companion"; - JavaFileObject javaFile = filer.createSourceFile( packageName + "." + className, element ); + JavaFileObject javaFile = filer.createSourceFile(packageName + "." + className, element); Writer javaWriter = javaFile.openWriter(); - javaWriter.append( "package " ).append( packageName ).append( ";\n\n" ); - javaWriter.append( "public class " ).append( className ).append( " {\n" ); - javaWriter.append( " public " ).append( className ).append( "() {\n" ); - javaWriter.append( " System.out.println(\"Hey there!\");\n" ); - javaWriter.append( " }\n}\n" ); + javaWriter.append("package ").append(packageName).append(";\n\n"); + javaWriter.append("public class ").append(className).append(" {\n"); + javaWriter.append(" public ").append(className).append("() {\n"); + javaWriter.append(" System.out.println(\"Hey there!\");\n"); + javaWriter.append(" }\n}\n"); javaWriter.close(); - } - catch ( IOException e ) - { - throw new RuntimeException( e ); + } catch (IOException e) { + throw new RuntimeException(e); } } diff --git a/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-user/src/main/java/mcompiler503/SimpleAnnotation.java b/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-user/src/main/java/mcompiler503/SimpleAnnotation.java index 72649385..40846cd5 100644 --- a/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-user/src/main/java/mcompiler503/SimpleAnnotation.java +++ b/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-user/src/main/java/mcompiler503/SimpleAnnotation.java @@ -1,4 +1,3 @@ -package mcompiler503; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -17,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package mcompiler503; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -25,6 +25,4 @@ @Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) -public @interface SimpleAnnotation -{ -} +public @interface SimpleAnnotation {} diff --git a/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-user/src/main/java/mcompiler503/SimpleObject.java b/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-user/src/main/java/mcompiler503/SimpleObject.java index faa913f6..954d70e6 100644 --- a/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-user/src/main/java/mcompiler503/SimpleObject.java +++ b/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-user/src/main/java/mcompiler503/SimpleObject.java @@ -1,4 +1,3 @@ -package mcompiler503; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -17,8 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package mcompiler503; @SimpleAnnotation -public class SimpleObject -{ -} +public class SimpleObject {} diff --git a/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-user/src/test/java/mcompiler503/SimpleTestObject.java b/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-user/src/test/java/mcompiler503/SimpleTestObject.java index 5c47d303..43640f43 100644 --- a/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-user/src/test/java/mcompiler503/SimpleTestObject.java +++ b/src/it/MCOMPILER-503-processorpath-duplicated-deps/annotation-user/src/test/java/mcompiler503/SimpleTestObject.java @@ -1,4 +1,3 @@ -package mcompiler503; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -17,8 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package mcompiler503; @SimpleAnnotation -public class SimpleTestObject -{ -} +public class SimpleTestObject {} diff --git a/src/it/MCOMPILER-512/src/main/java/dummy/Main.java b/src/it/MCOMPILER-512/src/main/java/dummy/Main.java index 7b36fb73..09cdacc5 100644 --- a/src/it/MCOMPILER-512/src/main/java/dummy/Main.java +++ b/src/it/MCOMPILER-512/src/main/java/dummy/Main.java @@ -1,5 +1,3 @@ -package dummy; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,15 +16,13 @@ * specific language governing permissions and limitations * under the License. */ +package dummy; import javax.smartcardio.TerminalFactory; -public class Main -{ +public class Main { - public static void main(String[] args) - { - TerminalFactory tf = TerminalFactory.getDefault(); + public static void main(String[] args) { + TerminalFactory tf = TerminalFactory.getDefault(); } - } diff --git a/src/it/MCOMPILER-512/src/test/java/dummy/Test.java b/src/it/MCOMPILER-512/src/test/java/dummy/Test.java index a0cc02cf..eb7058cd 100644 --- a/src/it/MCOMPILER-512/src/test/java/dummy/Test.java +++ b/src/it/MCOMPILER-512/src/test/java/dummy/Test.java @@ -1,5 +1,3 @@ -package dummy; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,13 +16,12 @@ * specific language governing permissions and limitations * under the License. */ +package dummy; import javax.smartcardio.TerminalFactory; -public class Test -{ - public void test() - { - TerminalFactory tf = TerminalFactory.getDefault(); +public class Test { + public void test() { + TerminalFactory tf = TerminalFactory.getDefault(); } } diff --git a/src/it/MCOMPILER-522-unresolvable-dependency/src/main/java/org/apache.maven.plugins.compiler.it/SimpleAnnotation.java b/src/it/MCOMPILER-522-unresolvable-dependency/src/main/java/org/apache.maven.plugins.compiler.it/SimpleAnnotation.java index 0c79335f..f84e9d09 100644 --- a/src/it/MCOMPILER-522-unresolvable-dependency/src/main/java/org/apache.maven.plugins.compiler.it/SimpleAnnotation.java +++ b/src/it/MCOMPILER-522-unresolvable-dependency/src/main/java/org/apache.maven.plugins.compiler.it/SimpleAnnotation.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package org.apache.maven.plugins.compiler.it; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -26,7 +25,4 @@ @Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) -public @interface SimpleAnnotation -{ - -} +public @interface SimpleAnnotation {} diff --git a/src/it/MCOMPILER-522-unresolvable-dependency/src/main/java/org/apache.maven.plugins.compiler.it/SimpleObject.java b/src/it/MCOMPILER-522-unresolvable-dependency/src/main/java/org/apache.maven.plugins.compiler.it/SimpleObject.java index 5d8760e5..9f507195 100644 --- a/src/it/MCOMPILER-522-unresolvable-dependency/src/main/java/org/apache.maven.plugins.compiler.it/SimpleObject.java +++ b/src/it/MCOMPILER-522-unresolvable-dependency/src/main/java/org/apache.maven.plugins.compiler.it/SimpleObject.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugins.compiler.it; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,9 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package org.apache.maven.plugins.compiler.it; @SimpleAnnotation -public class SimpleObject -{ - -} +public class SimpleObject {} diff --git a/src/it/automodules-application/src/main/java/module-info.java b/src/it/automodules-application/src/main/java/module-info.java index 047359df..cd75a746 100644 --- a/src/it/automodules-application/src/main/java/module-info.java +++ b/src/it/automodules-application/src/main/java/module-info.java @@ -1,22 +1,21 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ -module app -{ - requires plexus.utils; -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ +module app { + requires plexus.utils; +} diff --git a/src/it/automodules-application/src/main/java/org/maven/test/Main.java b/src/it/automodules-application/src/main/java/org/maven/test/Main.java index eea50369..76cd55e4 100644 --- a/src/it/automodules-application/src/main/java/org/maven/test/Main.java +++ b/src/it/automodules-application/src/main/java/org/maven/test/Main.java @@ -1,32 +1,31 @@ -package org.maven.test; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 org.codehaus.plexus.util.StringUtils; - -public class Main { - - /** - * @param args - */ - public static void main(String[] args) { - System.out.println( StringUtils.concatenate( args ) ); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.maven.test; + +import org.codehaus.plexus.util.StringUtils; + +public class Main { + + /** + * @param args + */ + public static void main(String[] args) { + System.out.println(StringUtils.concatenate(args)); + } +} diff --git a/src/it/automodules-library/src/main/java/module-info.java b/src/it/automodules-library/src/main/java/module-info.java index 17205e31..ace11219 100644 --- a/src/it/automodules-library/src/main/java/module-info.java +++ b/src/it/automodules-library/src/main/java/module-info.java @@ -1,24 +1,23 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ -module lib -{ - requires plexus.utils; - - exports org.maven.test; -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ +module lib { + requires plexus.utils; + + exports org.maven.test; +} diff --git a/src/it/automodules-library/src/main/java/org/maven/test/Main.java b/src/it/automodules-library/src/main/java/org/maven/test/Main.java index 463feac7..76cd55e4 100644 --- a/src/it/automodules-library/src/main/java/org/maven/test/Main.java +++ b/src/it/automodules-library/src/main/java/org/maven/test/Main.java @@ -1,32 +1,31 @@ -package org.maven.test; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 org.codehaus.plexus.util.StringUtils; - -public class Main { - - /** - * @param args - */ - public static void main(String[] args) { - System.out.println( StringUtils.concatenate( args ) ); - } -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.maven.test; + +import org.codehaus.plexus.util.StringUtils; + +public class Main { + + /** + * @param args + */ + public static void main(String[] args) { + System.out.println(StringUtils.concatenate(args)); + } +} diff --git a/src/it/automodules-manifest/src/main/java/module-info.java b/src/it/automodules-manifest/src/main/java/module-info.java index 5bd017f6..684f7e3b 100644 --- a/src/it/automodules-manifest/src/main/java/module-info.java +++ b/src/it/automodules-manifest/src/main/java/module-info.java @@ -1,22 +1,21 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ -module app -{ - requires com.ta3; -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ +module app { + requires com.ta3; +} diff --git a/src/it/automodules-manifest/src/main/java/org/maven/test/Main.java b/src/it/automodules-manifest/src/main/java/org/maven/test/Main.java index b81a7208..642ee05f 100644 --- a/src/it/automodules-manifest/src/main/java/org/maven/test/Main.java +++ b/src/it/automodules-manifest/src/main/java/org/maven/test/Main.java @@ -1,28 +1,25 @@ -package org.maven.test; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 Main -{ - public static void main( String[] args ) - { - System.out.println( com.ta3.MyClass.class.getName() ); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.maven.test; + +public class Main { + public static void main(String[] args) { + System.out.println(com.ta3.MyClass.class.getName()); + } +} diff --git a/src/it/automodules-transitive-module/src/main/java/module-info.java b/src/it/automodules-transitive-module/src/main/java/module-info.java index 17205e31..ace11219 100644 --- a/src/it/automodules-transitive-module/src/main/java/module-info.java +++ b/src/it/automodules-transitive-module/src/main/java/module-info.java @@ -1,24 +1,23 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ -module lib -{ - requires plexus.utils; - - exports org.maven.test; -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ +module lib { + requires plexus.utils; + + exports org.maven.test; +} diff --git a/src/it/automodules-transitive-module/src/main/java/org/maven/test/Main.java b/src/it/automodules-transitive-module/src/main/java/org/maven/test/Main.java index 463feac7..76cd55e4 100644 --- a/src/it/automodules-transitive-module/src/main/java/org/maven/test/Main.java +++ b/src/it/automodules-transitive-module/src/main/java/org/maven/test/Main.java @@ -1,32 +1,31 @@ -package org.maven.test; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 org.codehaus.plexus.util.StringUtils; - -public class Main { - - /** - * @param args - */ - public static void main(String[] args) { - System.out.println( StringUtils.concatenate( args ) ); - } -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.maven.test; + +import org.codehaus.plexus.util.StringUtils; + +public class Main { + + /** + * @param args + */ + public static void main(String[] args) { + System.out.println(StringUtils.concatenate(args)); + } +} diff --git a/src/it/default-fork-windows/src/main/java/MyClass.java b/src/it/default-fork-windows/src/main/java/MyClass.java index 90a93702..d4132bb2 100644 --- a/src/it/default-fork-windows/src/main/java/MyClass.java +++ b/src/it/default-fork-windows/src/main/java/MyClass.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,7 +18,4 @@ */ package foo; -public class MyClass -{ - -} +public class MyClass {} diff --git a/src/it/default-fork-windows/src/test/java/MyTest.java b/src/it/default-fork-windows/src/test/java/MyTest.java index 33d41784..77db4f1d 100644 --- a/src/it/default-fork-windows/src/test/java/MyTest.java +++ b/src/it/default-fork-windows/src/test/java/MyTest.java @@ -6,9 +6,9 @@ * to you 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 @@ -20,8 +20,4 @@ import junit.framework.TestCase; -public class MyTest - extends TestCase -{ - -} +public class MyTest extends TestCase {} diff --git a/src/it/default-fork/src/main/java/MyClass.java b/src/it/default-fork/src/main/java/MyClass.java index 90a93702..d4132bb2 100644 --- a/src/it/default-fork/src/main/java/MyClass.java +++ b/src/it/default-fork/src/main/java/MyClass.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,7 +18,4 @@ */ package foo; -public class MyClass -{ - -} +public class MyClass {} diff --git a/src/it/default-fork/src/test/java/MyTest.java b/src/it/default-fork/src/test/java/MyTest.java index 33d41784..77db4f1d 100644 --- a/src/it/default-fork/src/test/java/MyTest.java +++ b/src/it/default-fork/src/test/java/MyTest.java @@ -6,9 +6,9 @@ * to you 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 @@ -20,8 +20,4 @@ import junit.framework.TestCase; -public class MyTest - extends TestCase -{ - -} +public class MyTest extends TestCase {} diff --git a/src/it/default-incremental-disable/src/main/java/foo/MyClass.java b/src/it/default-incremental-disable/src/main/java/foo/MyClass.java index 90a93702..d4132bb2 100644 --- a/src/it/default-incremental-disable/src/main/java/foo/MyClass.java +++ b/src/it/default-incremental-disable/src/main/java/foo/MyClass.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,7 +18,4 @@ */ package foo; -public class MyClass -{ - -} +public class MyClass {} diff --git a/src/it/default-incremental-disable/src/test/java/foo/MyTest.java b/src/it/default-incremental-disable/src/test/java/foo/MyTest.java index 33d41784..77db4f1d 100644 --- a/src/it/default-incremental-disable/src/test/java/foo/MyTest.java +++ b/src/it/default-incremental-disable/src/test/java/foo/MyTest.java @@ -6,9 +6,9 @@ * to you 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 @@ -20,8 +20,4 @@ import junit.framework.TestCase; -public class MyTest - extends TestCase -{ - -} +public class MyTest extends TestCase {} diff --git a/src/it/default/src/main/java/MyClass.java b/src/it/default/src/main/java/MyClass.java index 90a93702..d4132bb2 100644 --- a/src/it/default/src/main/java/MyClass.java +++ b/src/it/default/src/main/java/MyClass.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,7 +18,4 @@ */ package foo; -public class MyClass -{ - -} +public class MyClass {} diff --git a/src/it/default/src/test/java/MyTest.java b/src/it/default/src/test/java/MyTest.java index 33d41784..77db4f1d 100644 --- a/src/it/default/src/test/java/MyTest.java +++ b/src/it/default/src/test/java/MyTest.java @@ -6,9 +6,9 @@ * to you 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 @@ -20,8 +20,4 @@ import junit.framework.TestCase; -public class MyTest - extends TestCase -{ - -} +public class MyTest extends TestCase {} diff --git a/src/it/groovy-project-with-new-plexus-compiler/verify.groovy b/src/it/groovy-project-with-new-plexus-compiler/verify.groovy index 500f7f96..4ea3c478 100644 --- a/src/it/groovy-project-with-new-plexus-compiler/verify.groovy +++ b/src/it/groovy-project-with-new-plexus-compiler/verify.groovy @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/src/it/includes-excludes/src/main/java/org/apache/maven/it0055/Person.java b/src/it/includes-excludes/src/main/java/org/apache/maven/it0055/Person.java index d1ecf61c..1fa3d8cf 100644 --- a/src/it/includes-excludes/src/main/java/org/apache/maven/it0055/Person.java +++ b/src/it/includes-excludes/src/main/java/org/apache/maven/it0055/Person.java @@ -1,5 +1,3 @@ -package org.apache.maven.it0055; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,19 +16,16 @@ * specific language governing permissions and limitations * under the License. */ +package org.apache.maven.it0055; - -public class Person -{ +public class Person { private String name; - - public void setName( String name ) - { + + public void setName(String name) { this.name = name; } - - public String getName() - { + + public String getName() { return name; } } diff --git a/src/it/includes-excludes/src/main/java/org/apache/maven/it0055/PersonTwo.java b/src/it/includes-excludes/src/main/java/org/apache/maven/it0055/PersonTwo.java index 7f1914b6..8bb36452 100644 --- a/src/it/includes-excludes/src/main/java/org/apache/maven/it0055/PersonTwo.java +++ b/src/it/includes-excludes/src/main/java/org/apache/maven/it0055/PersonTwo.java @@ -1,5 +1,3 @@ -package org.apache.maven.it0055; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,19 +16,16 @@ * specific language governing permissions and limitations * under the License. */ +package org.apache.maven.it0055; - -public class PersonTwo -{ +public class PersonTwo { private String name; - - public void setName( String name ) - { + + public void setName(String name) { this.name = name; } - - public String getName() - { + + public String getName() { return name; } } diff --git a/src/it/includes-excludes/src/test/java/org/apache/maven/it0055/PersonTest.java b/src/it/includes-excludes/src/test/java/org/apache/maven/it0055/PersonTest.java index c8c40ed0..f3601658 100644 --- a/src/it/includes-excludes/src/test/java/org/apache/maven/it0055/PersonTest.java +++ b/src/it/includes-excludes/src/test/java/org/apache/maven/it0055/PersonTest.java @@ -1,5 +1,3 @@ -package org.apache.maven.it0055; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,19 +16,16 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.it0055; import junit.framework.TestCase; -public class PersonTest - extends TestCase -{ - public void testPerson() - { +public class PersonTest extends TestCase { + public void testPerson() { Person person = new Person(); - - person.setName( "foo" ); - - assertEquals( "foo", person.getName() ); + + person.setName("foo"); + + assertEquals("foo", person.getName()); } } diff --git a/src/it/includes-excludes/src/test/java/org/apache/maven/it0055/PersonTwoTest.java b/src/it/includes-excludes/src/test/java/org/apache/maven/it0055/PersonTwoTest.java index 6a51799c..a9096ee3 100644 --- a/src/it/includes-excludes/src/test/java/org/apache/maven/it0055/PersonTwoTest.java +++ b/src/it/includes-excludes/src/test/java/org/apache/maven/it0055/PersonTwoTest.java @@ -1,5 +1,3 @@ -package org.apache.maven.it0055; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,19 +16,16 @@ * specific language governing permissions and limitations * under the License. */ - +package org.apache.maven.it0055; import junit.framework.TestCase; -public class PersonTwoTest - extends TestCase -{ - public void testPerson() - { +public class PersonTwoTest extends TestCase { + public void testPerson() { Person person = new Person(); - - person.setName( "foo" ); - - assertEquals( "foo", person.getName() ); + + person.setName("foo"); + + assertEquals("foo", person.getName()); } } diff --git a/src/it/jdk16-annotation/src/main/java/com/mycompany/jdk16annotation/App.java b/src/it/jdk16-annotation/src/main/java/com/mycompany/jdk16annotation/App.java index 814edb98..41ebecd3 100644 --- a/src/it/jdk16-annotation/src/main/java/com/mycompany/jdk16annotation/App.java +++ b/src/it/jdk16-annotation/src/main/java/com/mycompany/jdk16annotation/App.java @@ -1,5 +1,3 @@ -package com.mycompany.jdk16annotation; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,16 +16,14 @@ * specific language governing permissions and limitations * under the License. */ - +package com.mycompany.jdk16annotation; /** * Hello world! * */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); +public class App { + public static void main(String[] args) { + System.out.println("Hello World!"); } } diff --git a/src/it/jdk16-annotation/src/main/java/com/mycompany/jdk16annotation/ServiceProvider.java b/src/it/jdk16-annotation/src/main/java/com/mycompany/jdk16annotation/ServiceProvider.java index b87cc680..a7921fdb 100644 --- a/src/it/jdk16-annotation/src/main/java/com/mycompany/jdk16annotation/ServiceProvider.java +++ b/src/it/jdk16-annotation/src/main/java/com/mycompany/jdk16annotation/ServiceProvider.java @@ -1,5 +1,3 @@ -package com.mycompany.jdk16annotation; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,19 +16,19 @@ * specific language governing permissions and limitations * under the License. */ - +package com.mycompany.jdk16annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - - @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface ServiceProvider { Class service(); + int position() default Integer.MAX_VALUE; + String path() default ""; } diff --git a/src/it/jdk16-annotation/src/main/java/com/mycompany/jdk16annotation/ServiceProviderProcessor.java b/src/it/jdk16-annotation/src/main/java/com/mycompany/jdk16annotation/ServiceProviderProcessor.java index 8f39d10c..f5777e90 100644 --- a/src/it/jdk16-annotation/src/main/java/com/mycompany/jdk16annotation/ServiceProviderProcessor.java +++ b/src/it/jdk16-annotation/src/main/java/com/mycompany/jdk16annotation/ServiceProviderProcessor.java @@ -1,5 +1,3 @@ -package com.mycompany.jdk16annotation; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,33 +16,31 @@ * specific language governing permissions and limitations * under the License. */ +package com.mycompany.jdk16annotation; - -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; - import javax.tools.Diagnostic.Kind; import javax.tools.FileObject; import javax.tools.StandardLocation; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + @SupportedSourceVersion(SourceVersion.RELEASE_6) public class ServiceProviderProcessor extends AbstractProcessor { public @Override Set getSupportedAnnotationTypes() { - return new HashSet(Arrays.asList( - ServiceProvider.class.getCanonicalName() - )); + return new HashSet(Arrays.asList(ServiceProvider.class.getCanonicalName())); } /** public for ServiceLoader */ @@ -61,14 +57,18 @@ public boolean process(Set annotations, RoundEnvironment } else { return true; } - } private void writeServices() { try { - FileObject out = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", "META-INF/one",new Element[0]); + FileObject out = processingEnv + .getFiler() + .createResource(StandardLocation.CLASS_OUTPUT, "", "META-INF/one", new Element[0]); OutputStream os = out.openOutputStream(); - OutputStream os2 = processingEnv.getFiler().createSourceFile("org.Milos", new Element[0]).openOutputStream(); + OutputStream os2 = processingEnv + .getFiler() + .createSourceFile("org.Milos", new Element[0]) + .openOutputStream(); OutputStreamWriter osr = new OutputStreamWriter(os2); try { PrintWriter w = new PrintWriter(new OutputStreamWriter(os, "UTF-8")); @@ -82,10 +82,8 @@ private void writeServices() { os.close(); } - } catch (IOException x) { processingEnv.getMessager().printMessage(Kind.ERROR, "Failed to write to one: " + x.toString()); } } - } diff --git a/src/it/jdk16-annotation/src/test/java/com/mycompany/jdk16annotation/AppTest.java b/src/it/jdk16-annotation/src/test/java/com/mycompany/jdk16annotation/AppTest.java index 9faeebec..63bde8ed 100644 --- a/src/it/jdk16-annotation/src/test/java/com/mycompany/jdk16annotation/AppTest.java +++ b/src/it/jdk16-annotation/src/test/java/com/mycompany/jdk16annotation/AppTest.java @@ -1,5 +1,3 @@ -package com.mycompany.jdk16annotation; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - +package com.mycompany.jdk16annotation; import junit.framework.Test; import junit.framework.TestCase; @@ -27,33 +25,28 @@ /** * Unit test for simple App. */ -@ServiceProvider(service=App.class, path="xxx", position=1) -public class AppTest - extends TestCase -{ +@ServiceProvider(service = App.class, path = "xxx", position = 1) +public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ - public AppTest( String testName ) - { - super( testName ); + public AppTest(String testName) { + super(testName); } /** * @return the suite of tests being tested */ - public static Test suite() - { - return new TestSuite( AppTest.class ); + public static Test suite() { + return new TestSuite(AppTest.class); } /** * Rigourous Test :-) */ - public void testApp() - { - assertTrue( true ); + public void testApp() { + assertTrue(true); } } diff --git a/src/it/jdk9-exportsto/bar/src/main/java/module-info.java b/src/it/jdk9-exportsto/bar/src/main/java/module-info.java index 22d23765..5cdec552 100644 --- a/src/it/jdk9-exportsto/bar/src/main/java/module-info.java +++ b/src/it/jdk9-exportsto/bar/src/main/java/module-info.java @@ -1,22 +1,22 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -module bar { - requires foo; -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module bar { + requires foo; +} diff --git a/src/it/jdk9-exportsto/foo/src/main/java/foo/Foo.java b/src/it/jdk9-exportsto/foo/src/main/java/foo/Foo.java index 156976c8..0fd6b804 100644 --- a/src/it/jdk9-exportsto/foo/src/main/java/foo/Foo.java +++ b/src/it/jdk9-exportsto/foo/src/main/java/foo/Foo.java @@ -1,22 +1,21 @@ -package foo; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 {} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 foo; + +public class Foo {} diff --git a/src/it/jdk9-exportsto/foo/src/main/java/module-info.java b/src/it/jdk9-exportsto/foo/src/main/java/module-info.java index 17d226f2..48dd5786 100644 --- a/src/it/jdk9-exportsto/foo/src/main/java/module-info.java +++ b/src/it/jdk9-exportsto/foo/src/main/java/module-info.java @@ -1,22 +1,23 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -module foo { - exports foo to bar; -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module foo { + exports foo to + bar; +} diff --git a/src/it/jpms_add-exports/src/main/java/module-info.java b/src/it/jpms_add-exports/src/main/java/module-info.java index c48284ef..cfa968a8 100644 --- a/src/it/jpms_add-exports/src/main/java/module-info.java +++ b/src/it/jpms_add-exports/src/main/java/module-info.java @@ -1,22 +1,19 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ -module app -{ - -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ +module app {} diff --git a/src/it/jpms_add-exports/src/main/java/org/maven/test/Main.java b/src/it/jpms_add-exports/src/main/java/org/maven/test/Main.java index 51d5c4a6..8fab0b26 100644 --- a/src/it/jpms_add-exports/src/main/java/org/maven/test/Main.java +++ b/src/it/jpms_add-exports/src/main/java/org/maven/test/Main.java @@ -1,36 +1,33 @@ -package org.maven.test; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 Main { - - /** - * @param args - */ - public static void main(String[] args) { - try { - Class.forName( "jdk.internal.util.Preconditions" ).newInstance(); - } - catch ( Exception e ) - { - // noop - } - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.maven.test; + +public class Main { + + /** + * @param args + */ + public static void main(String[] args) { + try { + Class.forName("jdk.internal.util.Preconditions").newInstance(); + } catch (Exception e) { + // noop + } + } +} diff --git a/src/it/jpms_compile-main-empty-test-bar/src/test/java/bar/BarTests.java b/src/it/jpms_compile-main-empty-test-bar/src/test/java/bar/BarTests.java index 872ca40f..2316ac32 100644 --- a/src/it/jpms_compile-main-empty-test-bar/src/test/java/bar/BarTests.java +++ b/src/it/jpms_compile-main-empty-test-bar/src/test/java/bar/BarTests.java @@ -19,15 +19,14 @@ package bar; import javax.script.*; + import org.junit.jupiter.api.*; -class BarTests -{ +class BarTests { @Test - void scripting() throws ScriptException - { + void scripting() throws ScriptException { ScriptEngineManager factory = new ScriptEngineManager(); - ScriptEngine engine = factory.getEngineByName( "JavaScript" ); - Assertions.assertDoesNotThrow​( () -> engine.eval( "print('Hello, World')" ), "Script evaluation failed!" ); + ScriptEngine engine = factory.getEngineByName("JavaScript"); + Assertions.assertDoesNotThrow(() -> engine.eval("print('Hello, World')"), "Script evaluation failed!"); } } diff --git a/src/it/jpms_compile-main-empty-test-bar/src/test/java/module-info.java b/src/it/jpms_compile-main-empty-test-bar/src/test/java/module-info.java index ed157adf..55840434 100644 --- a/src/it/jpms_compile-main-empty-test-bar/src/test/java/module-info.java +++ b/src/it/jpms_compile-main-empty-test-bar/src/test/java/module-info.java @@ -17,8 +17,7 @@ * under the License. */ -open module bar -{ +open module bar { requires java.scripting; requires org.junit.jupiter.api; } diff --git a/src/it/jpms_compile-main-foo-test-bar/src/main/java/foo/Foo.java b/src/it/jpms_compile-main-foo-test-bar/src/main/java/foo/Foo.java index efcf8221..f361b016 100644 --- a/src/it/jpms_compile-main-foo-test-bar/src/main/java/foo/Foo.java +++ b/src/it/jpms_compile-main-foo-test-bar/src/main/java/foo/Foo.java @@ -16,15 +16,12 @@ * specific language governing permissions and limitations * under the License. */ - package foo; import org.apache.commons.lang3.*; -public class Foo -{ - public Foo() - { - System.out.println( StringUtils.swapCase( "fOO" ) + " created!" ); +public class Foo { + public Foo() { + System.out.println(StringUtils.swapCase("fOO") + " created!"); } } diff --git a/src/it/jpms_compile-main-foo-test-bar/src/main/java/module-info.java b/src/it/jpms_compile-main-foo-test-bar/src/main/java/module-info.java index ec0bd80f..fd24faa4 100644 --- a/src/it/jpms_compile-main-foo-test-bar/src/main/java/module-info.java +++ b/src/it/jpms_compile-main-foo-test-bar/src/main/java/module-info.java @@ -17,8 +17,8 @@ * under the License. */ -module foo -{ +module foo { requires org.apache.commons.lang3; + exports foo; } diff --git a/src/it/jpms_compile-main-foo-test-bar/src/test/java/bar/BarTests.java b/src/it/jpms_compile-main-foo-test-bar/src/test/java/bar/BarTests.java index 25d48191..60ba2856 100644 --- a/src/it/jpms_compile-main-foo-test-bar/src/test/java/bar/BarTests.java +++ b/src/it/jpms_compile-main-foo-test-bar/src/test/java/bar/BarTests.java @@ -21,18 +21,15 @@ import foo.*; import org.junit.jupiter.api.*; -class BarTests -{ +class BarTests { @Test - void constructor() - { - Assertions.assertNotNull( new Foo() ); + void constructor() { + Assertions.assertNotNull(new Foo()); } @Test - void moduleNameIsFoo() - { - Assertions.assertTrue( Foo.class.getModule().isNamed(), "Foo resides in a named module" ); - Assertions.assertEquals( "foo", Foo.class.getModule().getName() ); + void moduleNameIsFoo() { + Assertions.assertTrue(Foo.class.getModule().isNamed(), "Foo resides in a named module"); + Assertions.assertEquals("foo", Foo.class.getModule().getName()); } } diff --git a/src/it/jpms_compile-main-foo-test-bar/src/test/java/module-info.java b/src/it/jpms_compile-main-foo-test-bar/src/test/java/module-info.java index ed971d40..9bd6f9c1 100644 --- a/src/it/jpms_compile-main-foo-test-bar/src/test/java/module-info.java +++ b/src/it/jpms_compile-main-foo-test-bar/src/test/java/module-info.java @@ -17,8 +17,7 @@ * under the License. */ -open module bar -{ +open module bar { requires foo; requires java.scripting; requires org.junit.jupiter.api; diff --git a/src/it/jpms_compile-main-foo-test-foo/src/main/java/foo/Foo.java b/src/it/jpms_compile-main-foo-test-foo/src/main/java/foo/Foo.java index 8d00c098..5e99dc28 100644 --- a/src/it/jpms_compile-main-foo-test-foo/src/main/java/foo/Foo.java +++ b/src/it/jpms_compile-main-foo-test-foo/src/main/java/foo/Foo.java @@ -16,15 +16,12 @@ * specific language governing permissions and limitations * under the License. */ - package foo; import org.apache.commons.lang3.*; -class Foo -{ - Foo() - { - System.out.println( StringUtils.swapCase( "fOO" ) + " created!" ); +class Foo { + Foo() { + System.out.println(StringUtils.swapCase("fOO") + " created!"); } } diff --git a/src/it/jpms_compile-main-foo-test-foo/src/main/java/module-info.java b/src/it/jpms_compile-main-foo-test-foo/src/main/java/module-info.java index dbd4fea8..84db0b19 100644 --- a/src/it/jpms_compile-main-foo-test-foo/src/main/java/module-info.java +++ b/src/it/jpms_compile-main-foo-test-foo/src/main/java/module-info.java @@ -17,7 +17,6 @@ * under the License. */ -module foo -{ +module foo { requires org.apache.commons.lang3; } diff --git a/src/it/jpms_compile-main-foo-test-foo/src/test/java/foo/FooTests.java b/src/it/jpms_compile-main-foo-test-foo/src/test/java/foo/FooTests.java index 78d1ae1c..98fb088f 100644 --- a/src/it/jpms_compile-main-foo-test-foo/src/test/java/foo/FooTests.java +++ b/src/it/jpms_compile-main-foo-test-foo/src/test/java/foo/FooTests.java @@ -20,18 +20,15 @@ import org.junit.jupiter.api.*; -class FooTests -{ +class FooTests { @Test - void constructor() - { - Assertions.assertNotNull( new Foo() ); + void constructor() { + Assertions.assertNotNull(new Foo()); } @Test - void moduleNameIsFoo() - { - Assertions.assertTrue( Foo.class.getModule().isNamed(), "Foo resides in a named module" ); - Assertions.assertEquals( "foo", Foo.class.getModule().getName() ); + void moduleNameIsFoo() { + Assertions.assertTrue(Foo.class.getModule().isNamed(), "Foo resides in a named module"); + Assertions.assertEquals("foo", Foo.class.getModule().getName()); } } diff --git a/src/it/jpms_compile-main-foo-test-foo/src/test/java/module-info.java b/src/it/jpms_compile-main-foo-test-foo/src/test/java/module-info.java index 1196f176..38ecd13f 100644 --- a/src/it/jpms_compile-main-foo-test-foo/src/test/java/module-info.java +++ b/src/it/jpms_compile-main-foo-test-foo/src/test/java/module-info.java @@ -17,8 +17,7 @@ * under the License. */ -open module foo -{ +open module foo { // main requires org.apache.commons.lang3; diff --git a/src/it/jpms_patch-module/src/main/java/module-info.java b/src/it/jpms_patch-module/src/main/java/module-info.java index c48284ef..cfa968a8 100644 --- a/src/it/jpms_patch-module/src/main/java/module-info.java +++ b/src/it/jpms_patch-module/src/main/java/module-info.java @@ -1,22 +1,19 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ -module app -{ - -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ +module app {} diff --git a/src/it/jpms_patch-module/src/main/java/org/maven/test/Main.java b/src/it/jpms_patch-module/src/main/java/org/maven/test/Main.java index 51d5c4a6..8fab0b26 100644 --- a/src/it/jpms_patch-module/src/main/java/org/maven/test/Main.java +++ b/src/it/jpms_patch-module/src/main/java/org/maven/test/Main.java @@ -1,36 +1,33 @@ -package org.maven.test; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 Main { - - /** - * @param args - */ - public static void main(String[] args) { - try { - Class.forName( "jdk.internal.util.Preconditions" ).newInstance(); - } - catch ( Exception e ) - { - // noop - } - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.maven.test; + +public class Main { + + /** + * @param args + */ + public static void main(String[] args) { + try { + Class.forName("jdk.internal.util.Preconditions").newInstance(); + } catch (Exception e) { + // noop + } + } +} diff --git a/src/it/jpms_patch-module/src/test/java/org/maven/test/MainTest.java b/src/it/jpms_patch-module/src/test/java/org/maven/test/MainTest.java index a6fd3af5..dbcfba6f 100644 --- a/src/it/jpms_patch-module/src/test/java/org/maven/test/MainTest.java +++ b/src/it/jpms_patch-module/src/test/java/org/maven/test/MainTest.java @@ -1,30 +1,29 @@ -package org.maven.test; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 MainTest { - - /** - * @param args - */ - public static void main(String[] args) { - Main.main( args ); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.maven.test; + +public class MainTest { + + /** + * @param args + */ + public static void main(String[] args) { + Main.main(args); + } +} diff --git a/src/it/mcompiler-106/src/main/java/MyClass.java b/src/it/mcompiler-106/src/main/java/MyClass.java index 90a93702..d4132bb2 100644 --- a/src/it/mcompiler-106/src/main/java/MyClass.java +++ b/src/it/mcompiler-106/src/main/java/MyClass.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,7 +18,4 @@ */ package foo; -public class MyClass -{ - -} +public class MyClass {} diff --git a/src/it/mcompiler-120/src/main/java/org/maven/test/Main.java b/src/it/mcompiler-120/src/main/java/org/maven/test/Main.java index 695e93d1..4298c7eb 100644 --- a/src/it/mcompiler-120/src/main/java/org/maven/test/Main.java +++ b/src/it/mcompiler-120/src/main/java/org/maven/test/Main.java @@ -1,5 +1,3 @@ -package org.maven.test; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,12 +16,11 @@ * specific language governing permissions and limitations * under the License. */ +package org.maven.test; import java.util.ArrayList; import java.util.List; - - public class Main { /** * @param args diff --git a/src/it/mcompiler-120/verify.groovy b/src/it/mcompiler-120/verify.groovy index c04959f6..cd6ef26e 100644 --- a/src/it/mcompiler-120/verify.groovy +++ b/src/it/mcompiler-120/verify.groovy @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/src/it/mcompiler-135/src/main/java/MyClass.java b/src/it/mcompiler-135/src/main/java/MyClass.java index 90a93702..d4132bb2 100644 --- a/src/it/mcompiler-135/src/main/java/MyClass.java +++ b/src/it/mcompiler-135/src/main/java/MyClass.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,7 +18,4 @@ */ package foo; -public class MyClass -{ - -} +public class MyClass {} diff --git a/src/it/mcompiler-179/src/main/java/org/maven/test/MyClass.java b/src/it/mcompiler-179/src/main/java/org/maven/test/MyClass.java index bfa8aafc..386f9fed 100644 --- a/src/it/mcompiler-179/src/main/java/org/maven/test/MyClass.java +++ b/src/it/mcompiler-179/src/main/java/org/maven/test/MyClass.java @@ -1,5 +1,3 @@ -package org.maven.test; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -8,9 +6,9 @@ * to you 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 @@ -18,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - +package org.maven.test; import java.util.ArrayList; import java.util.List; diff --git a/src/it/mcompiler-182/src/main/java/BeanA.java b/src/it/mcompiler-182/src/main/java/BeanA.java index aa6a35ee..c53e6bd6 100644 --- a/src/it/mcompiler-182/src/main/java/BeanA.java +++ b/src/it/mcompiler-182/src/main/java/BeanA.java @@ -6,9 +6,9 @@ * to you 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 @@ -23,7 +23,7 @@ */ public class BeanA { - private int i,y; + private int i, y; public int getI() { return i; diff --git a/src/it/mcompiler-182/src/main/java/BeanA2.java b/src/it/mcompiler-182/src/main/java/BeanA2.java index 42731363..076a1fc2 100644 --- a/src/it/mcompiler-182/src/main/java/BeanA2.java +++ b/src/it/mcompiler-182/src/main/java/BeanA2.java @@ -6,9 +6,9 @@ * to you 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 diff --git a/src/it/mcompiler-182/verify.groovy b/src/it/mcompiler-182/verify.groovy index fdff21e0..40cb317c 100644 --- a/src/it/mcompiler-182/verify.groovy +++ b/src/it/mcompiler-182/verify.groovy @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/src/it/mcompiler-21_class-remove/src/main/java/BeanA.java b/src/it/mcompiler-21_class-remove/src/main/java/BeanA.java index aa6a35ee..c53e6bd6 100644 --- a/src/it/mcompiler-21_class-remove/src/main/java/BeanA.java +++ b/src/it/mcompiler-21_class-remove/src/main/java/BeanA.java @@ -6,9 +6,9 @@ * to you 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 @@ -23,7 +23,7 @@ */ public class BeanA { - private int i,y; + private int i, y; public int getI() { return i; diff --git a/src/it/mcompiler-21_class-remove/src/main/java/BeanA2.java b/src/it/mcompiler-21_class-remove/src/main/java/BeanA2.java index 42731363..076a1fc2 100644 --- a/src/it/mcompiler-21_class-remove/src/main/java/BeanA2.java +++ b/src/it/mcompiler-21_class-remove/src/main/java/BeanA2.java @@ -6,9 +6,9 @@ * to you 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 diff --git a/src/it/mcompiler-21_class-remove/verify.groovy b/src/it/mcompiler-21_class-remove/verify.groovy index 306622da..3e4f8d17 100644 --- a/src/it/mcompiler-21_class-remove/verify.groovy +++ b/src/it/mcompiler-21_class-remove/verify.groovy @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/src/it/mcompiler-21_methodname-change/src/main/java/BeanA.java b/src/it/mcompiler-21_methodname-change/src/main/java/BeanA.java index aa6a35ee..c53e6bd6 100644 --- a/src/it/mcompiler-21_methodname-change/src/main/java/BeanA.java +++ b/src/it/mcompiler-21_methodname-change/src/main/java/BeanA.java @@ -6,9 +6,9 @@ * to you 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 @@ -23,7 +23,7 @@ */ public class BeanA { - private int i,y; + private int i, y; public int getI() { return i; diff --git a/src/it/mcompiler-21_methodname-change/src/main/java/BeanA2.java b/src/it/mcompiler-21_methodname-change/src/main/java/BeanA2.java index 42731363..076a1fc2 100644 --- a/src/it/mcompiler-21_methodname-change/src/main/java/BeanA2.java +++ b/src/it/mcompiler-21_methodname-change/src/main/java/BeanA2.java @@ -6,9 +6,9 @@ * to you 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 diff --git a/src/it/mcompiler-21_methodname-change/verify.groovy b/src/it/mcompiler-21_methodname-change/verify.groovy index 306622da..3e4f8d17 100644 --- a/src/it/mcompiler-21_methodname-change/verify.groovy +++ b/src/it/mcompiler-21_methodname-change/verify.groovy @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/src/it/multirelease-patterns/multimodule/multirelease-base/src/main/java/base/Base.java b/src/it/multirelease-patterns/multimodule/multirelease-base/src/main/java/base/Base.java index 513f9099..19ec7d8f 100644 --- a/src/it/multirelease-patterns/multimodule/multirelease-base/src/main/java/base/Base.java +++ b/src/it/multirelease-patterns/multimodule/multirelease-base/src/main/java/base/Base.java @@ -1,5 +1,3 @@ -package base; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package base; public class Base { diff --git a/src/it/multirelease-patterns/multimodule/multirelease-base/src/main/java/mr/A.java b/src/it/multirelease-patterns/multimodule/multirelease-base/src/main/java/mr/A.java index 6c2eb86b..0e48eee6 100644 --- a/src/it/multirelease-patterns/multimodule/multirelease-base/src/main/java/mr/A.java +++ b/src/it/multirelease-patterns/multimodule/multirelease-base/src/main/java/mr/A.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,15 +16,15 @@ * specific language governing permissions and limitations * under the License. */ +package mr; import base.Base; -public class A implements I -{ +public class A implements I { public static String getString() { return Base.get() + " -> 8"; } - + @Override public Class introducedClass() { return java.time.LocalDateTime.class; diff --git a/src/it/multirelease-patterns/multimodule/multirelease-base/src/main/java/mr/I.java b/src/it/multirelease-patterns/multimodule/multirelease-base/src/main/java/mr/I.java index f9858cfc..a0523266 100644 --- a/src/it/multirelease-patterns/multimodule/multirelease-base/src/main/java/mr/I.java +++ b/src/it/multirelease-patterns/multimodule/multirelease-base/src/main/java/mr/I.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ +package mr; -public interface I -{ +public interface I { Class introducedClass(); -} \ No newline at end of file +} diff --git a/src/it/multirelease-patterns/multimodule/multirelease-base/src/test/java/mr/ATest.java b/src/it/multirelease-patterns/multimodule/multirelease-base/src/test/java/mr/ATest.java index cca71135..c5ba719e 100644 --- a/src/it/multirelease-patterns/multimodule/multirelease-base/src/test/java/mr/ATest.java +++ b/src/it/multirelease-patterns/multimodule/multirelease-base/src/test/java/mr/ATest.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,37 +16,35 @@ * specific language governing permissions and limitations * under the License. */ - -import static org.junit.Assert.assertThat; -import static org.junit.Assume.assumeThat; -import static org.hamcrest.CoreMatchers.is; +package mr; import org.junit.Ignore; import org.junit.Test; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; +import static org.junit.Assume.assumeThat; + public class ATest { - - private static final String javaVersion = System.getProperty( "java.version" ); - + + private static final String javaVersion = System.getProperty("java.version"); + @Test - public void testGet8() throws Exception - { -// assumeThat( javaVersion, is( "8" ) ); - - assertThat( A.getString(), is( "BASE -> 8" ) ); + public void testGet8() throws Exception { + // assumeThat( javaVersion, is( "8" ) ); + + assertThat(A.getString(), is("BASE -> 8")); - assertThat( new A().introducedClass().getName(), is( "java.time.LocalDateTime" ) ); + assertThat(new A().introducedClass().getName(), is("java.time.LocalDateTime")); } - + @Test - @Ignore( "Maven module only creates Java 8 classes" ) - public void testGet9() throws Exception - { - assumeThat( javaVersion, is( "9" ) ); + @Ignore("Maven module only creates Java 8 classes") + public void testGet9() throws Exception { + assumeThat(javaVersion, is("9")); - assertThat( A.getString(), is( "BASE -> 9" ) ); + assertThat(A.getString(), is("BASE -> 9")); - assertThat( new A().introducedClass().getName(), is( "java.lang.Module" ) ); + assertThat(new A().introducedClass().getName(), is("java.lang.Module")); } - -} \ No newline at end of file +} diff --git a/src/it/multirelease-patterns/multimodule/multirelease-nine/src/main/java/mr/A.java b/src/it/multirelease-patterns/multimodule/multirelease-nine/src/main/java/mr/A.java index e2b9598e..5083e1ce 100644 --- a/src/it/multirelease-patterns/multimodule/multirelease-nine/src/main/java/mr/A.java +++ b/src/it/multirelease-patterns/multimodule/multirelease-nine/src/main/java/mr/A.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,17 +16,17 @@ * specific language governing permissions and limitations * under the License. */ - -import base.Base; +package mr; import java.util.Optional; -public class A implements I -{ +import base.Base; + +public class A implements I { public static String getString() { - return Base.get() + " -> " + Optional.of( "9" ).get(); + return Base.get() + " -> " + Optional.of("9").get(); } - + @Override public Class introducedClass() { return Module.class; diff --git a/src/it/multirelease-patterns/multimodule/multirelease-nine/src/test/java/mr/ATest.java b/src/it/multirelease-patterns/multimodule/multirelease-nine/src/test/java/mr/ATest.java index ef26fe6d..c86fc468 100644 --- a/src/it/multirelease-patterns/multimodule/multirelease-nine/src/test/java/mr/ATest.java +++ b/src/it/multirelease-patterns/multimodule/multirelease-nine/src/test/java/mr/ATest.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,37 +16,35 @@ * specific language governing permissions and limitations * under the License. */ - -import static org.junit.Assert.assertThat; -import static org.junit.Assume.assumeThat; -import static org.hamcrest.CoreMatchers.is; +package mr; import org.junit.Ignore; import org.junit.Test; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; +import static org.junit.Assume.assumeThat; + public class ATest { - - private static final String javaVersion = System.getProperty( "java.version" ); - + + private static final String javaVersion = System.getProperty("java.version"); + @Test - @Ignore( "Maven module only creates Java 9 classes" ) - public void testGet8() throws Exception - { - assumeThat( javaVersion, is( "8" ) ); - - assertThat( A.getString(), is( "BASE -> 8" ) ); - - assertThat( new A().introducedClass().getName(), is( "java.time.LocalDateTime" ) ); + @Ignore("Maven module only creates Java 9 classes") + public void testGet8() throws Exception { + assumeThat(javaVersion, is("8")); + + assertThat(A.getString(), is("BASE -> 8")); + + assertThat(new A().introducedClass().getName(), is("java.time.LocalDateTime")); } - + @Test - public void testGet9() throws Exception - { -// assumeThat( javaVersion, is( "9" ) ); + public void testGet9() throws Exception { + // assumeThat( javaVersion, is( "9" ) ); - assertThat( A.getString(), is( "BASE -> 9" ) ); + assertThat(A.getString(), is("BASE -> 9")); - assertThat( new A().introducedClass().getName(), is( "java.lang.Module" ) ); + assertThat(new A().introducedClass().getName(), is("java.lang.Module")); } - -} \ No newline at end of file +} diff --git a/src/it/multirelease-patterns/multiproject/multirelease-base/src/main/java/base/Base.java b/src/it/multirelease-patterns/multiproject/multirelease-base/src/main/java/base/Base.java index 513f9099..19ec7d8f 100644 --- a/src/it/multirelease-patterns/multiproject/multirelease-base/src/main/java/base/Base.java +++ b/src/it/multirelease-patterns/multiproject/multirelease-base/src/main/java/base/Base.java @@ -1,5 +1,3 @@ -package base; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package base; public class Base { diff --git a/src/it/multirelease-patterns/multiproject/multirelease-base/src/main/java/mr/A.java b/src/it/multirelease-patterns/multiproject/multirelease-base/src/main/java/mr/A.java index 6c2eb86b..0e48eee6 100644 --- a/src/it/multirelease-patterns/multiproject/multirelease-base/src/main/java/mr/A.java +++ b/src/it/multirelease-patterns/multiproject/multirelease-base/src/main/java/mr/A.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,15 +16,15 @@ * specific language governing permissions and limitations * under the License. */ +package mr; import base.Base; -public class A implements I -{ +public class A implements I { public static String getString() { return Base.get() + " -> 8"; } - + @Override public Class introducedClass() { return java.time.LocalDateTime.class; diff --git a/src/it/multirelease-patterns/multiproject/multirelease-base/src/main/java/mr/I.java b/src/it/multirelease-patterns/multiproject/multirelease-base/src/main/java/mr/I.java index f9858cfc..a0523266 100644 --- a/src/it/multirelease-patterns/multiproject/multirelease-base/src/main/java/mr/I.java +++ b/src/it/multirelease-patterns/multiproject/multirelease-base/src/main/java/mr/I.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ +package mr; -public interface I -{ +public interface I { Class introducedClass(); -} \ No newline at end of file +} diff --git a/src/it/multirelease-patterns/multiproject/multirelease-base/src/test/java/mr/ATest.java b/src/it/multirelease-patterns/multiproject/multirelease-base/src/test/java/mr/ATest.java index cca71135..c5ba719e 100644 --- a/src/it/multirelease-patterns/multiproject/multirelease-base/src/test/java/mr/ATest.java +++ b/src/it/multirelease-patterns/multiproject/multirelease-base/src/test/java/mr/ATest.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,37 +16,35 @@ * specific language governing permissions and limitations * under the License. */ - -import static org.junit.Assert.assertThat; -import static org.junit.Assume.assumeThat; -import static org.hamcrest.CoreMatchers.is; +package mr; import org.junit.Ignore; import org.junit.Test; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; +import static org.junit.Assume.assumeThat; + public class ATest { - - private static final String javaVersion = System.getProperty( "java.version" ); - + + private static final String javaVersion = System.getProperty("java.version"); + @Test - public void testGet8() throws Exception - { -// assumeThat( javaVersion, is( "8" ) ); - - assertThat( A.getString(), is( "BASE -> 8" ) ); + public void testGet8() throws Exception { + // assumeThat( javaVersion, is( "8" ) ); + + assertThat(A.getString(), is("BASE -> 8")); - assertThat( new A().introducedClass().getName(), is( "java.time.LocalDateTime" ) ); + assertThat(new A().introducedClass().getName(), is("java.time.LocalDateTime")); } - + @Test - @Ignore( "Maven module only creates Java 8 classes" ) - public void testGet9() throws Exception - { - assumeThat( javaVersion, is( "9" ) ); + @Ignore("Maven module only creates Java 8 classes") + public void testGet9() throws Exception { + assumeThat(javaVersion, is("9")); - assertThat( A.getString(), is( "BASE -> 9" ) ); + assertThat(A.getString(), is("BASE -> 9")); - assertThat( new A().introducedClass().getName(), is( "java.lang.Module" ) ); + assertThat(new A().introducedClass().getName(), is("java.lang.Module")); } - -} \ No newline at end of file +} diff --git a/src/it/multirelease-patterns/multiproject/multirelease-nine/src/main/java/mr/A.java b/src/it/multirelease-patterns/multiproject/multirelease-nine/src/main/java/mr/A.java index e2b9598e..5083e1ce 100644 --- a/src/it/multirelease-patterns/multiproject/multirelease-nine/src/main/java/mr/A.java +++ b/src/it/multirelease-patterns/multiproject/multirelease-nine/src/main/java/mr/A.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,17 +16,17 @@ * specific language governing permissions and limitations * under the License. */ - -import base.Base; +package mr; import java.util.Optional; -public class A implements I -{ +import base.Base; + +public class A implements I { public static String getString() { - return Base.get() + " -> " + Optional.of( "9" ).get(); + return Base.get() + " -> " + Optional.of("9").get(); } - + @Override public Class introducedClass() { return Module.class; diff --git a/src/it/multirelease-patterns/multiproject/multirelease-nine/src/test/java/mr/ATest.java b/src/it/multirelease-patterns/multiproject/multirelease-nine/src/test/java/mr/ATest.java index ef26fe6d..c86fc468 100644 --- a/src/it/multirelease-patterns/multiproject/multirelease-nine/src/test/java/mr/ATest.java +++ b/src/it/multirelease-patterns/multiproject/multirelease-nine/src/test/java/mr/ATest.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,37 +16,35 @@ * specific language governing permissions and limitations * under the License. */ - -import static org.junit.Assert.assertThat; -import static org.junit.Assume.assumeThat; -import static org.hamcrest.CoreMatchers.is; +package mr; import org.junit.Ignore; import org.junit.Test; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; +import static org.junit.Assume.assumeThat; + public class ATest { - - private static final String javaVersion = System.getProperty( "java.version" ); - + + private static final String javaVersion = System.getProperty("java.version"); + @Test - @Ignore( "Maven module only creates Java 9 classes" ) - public void testGet8() throws Exception - { - assumeThat( javaVersion, is( "8" ) ); - - assertThat( A.getString(), is( "BASE -> 8" ) ); - - assertThat( new A().introducedClass().getName(), is( "java.time.LocalDateTime" ) ); + @Ignore("Maven module only creates Java 9 classes") + public void testGet8() throws Exception { + assumeThat(javaVersion, is("8")); + + assertThat(A.getString(), is("BASE -> 8")); + + assertThat(new A().introducedClass().getName(), is("java.time.LocalDateTime")); } - + @Test - public void testGet9() throws Exception - { -// assumeThat( javaVersion, is( "9" ) ); + public void testGet9() throws Exception { + // assumeThat( javaVersion, is( "9" ) ); - assertThat( A.getString(), is( "BASE -> 9" ) ); + assertThat(A.getString(), is("BASE -> 9")); - assertThat( new A().introducedClass().getName(), is( "java.lang.Module" ) ); + assertThat(new A().introducedClass().getName(), is("java.lang.Module")); } - -} \ No newline at end of file +} diff --git a/src/it/multirelease-patterns/packaging-plugin/src/main/java-mr/9/module-info.java b/src/it/multirelease-patterns/packaging-plugin/src/main/java-mr/9/module-info.java index 2407e6b1..36f00e07 100644 --- a/src/it/multirelease-patterns/packaging-plugin/src/main/java-mr/9/module-info.java +++ b/src/it/multirelease-patterns/packaging-plugin/src/main/java-mr/9/module-info.java @@ -16,8 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -module example.mrjar -{ - exports base; - exports mr; +module example.mrjar { + exports base; + exports mr; } diff --git a/src/it/multirelease-patterns/packaging-plugin/src/main/java-mr/9/mr/A.java b/src/it/multirelease-patterns/packaging-plugin/src/main/java-mr/9/mr/A.java index e2b9598e..5083e1ce 100644 --- a/src/it/multirelease-patterns/packaging-plugin/src/main/java-mr/9/mr/A.java +++ b/src/it/multirelease-patterns/packaging-plugin/src/main/java-mr/9/mr/A.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,17 +16,17 @@ * specific language governing permissions and limitations * under the License. */ - -import base.Base; +package mr; import java.util.Optional; -public class A implements I -{ +import base.Base; + +public class A implements I { public static String getString() { - return Base.get() + " -> " + Optional.of( "9" ).get(); + return Base.get() + " -> " + Optional.of("9").get(); } - + @Override public Class introducedClass() { return Module.class; diff --git a/src/it/multirelease-patterns/packaging-plugin/src/main/java/base/Base.java b/src/it/multirelease-patterns/packaging-plugin/src/main/java/base/Base.java index 513f9099..19ec7d8f 100644 --- a/src/it/multirelease-patterns/packaging-plugin/src/main/java/base/Base.java +++ b/src/it/multirelease-patterns/packaging-plugin/src/main/java/base/Base.java @@ -1,5 +1,3 @@ -package base; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package base; public class Base { diff --git a/src/it/multirelease-patterns/packaging-plugin/src/main/java/mr/A.java b/src/it/multirelease-patterns/packaging-plugin/src/main/java/mr/A.java index 6c2eb86b..0e48eee6 100644 --- a/src/it/multirelease-patterns/packaging-plugin/src/main/java/mr/A.java +++ b/src/it/multirelease-patterns/packaging-plugin/src/main/java/mr/A.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,15 +16,15 @@ * specific language governing permissions and limitations * under the License. */ +package mr; import base.Base; -public class A implements I -{ +public class A implements I { public static String getString() { return Base.get() + " -> 8"; } - + @Override public Class introducedClass() { return java.time.LocalDateTime.class; diff --git a/src/it/multirelease-patterns/packaging-plugin/src/main/java/mr/I.java b/src/it/multirelease-patterns/packaging-plugin/src/main/java/mr/I.java index f9858cfc..a0523266 100644 --- a/src/it/multirelease-patterns/packaging-plugin/src/main/java/mr/I.java +++ b/src/it/multirelease-patterns/packaging-plugin/src/main/java/mr/I.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ +package mr; -public interface I -{ +public interface I { Class introducedClass(); -} \ No newline at end of file +} diff --git a/src/it/multirelease-patterns/packaging-plugin/src/test/java/mr/ATest.java b/src/it/multirelease-patterns/packaging-plugin/src/test/java/mr/ATest.java index 07a207ca..510fb1c4 100644 --- a/src/it/multirelease-patterns/packaging-plugin/src/test/java/mr/ATest.java +++ b/src/it/multirelease-patterns/packaging-plugin/src/test/java/mr/ATest.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,35 +16,33 @@ * specific language governing permissions and limitations * under the License. */ +package mr; +import org.junit.Test; + +import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import static org.junit.Assume.assumeThat; -import static org.hamcrest.CoreMatchers.is; - -import org.junit.Test; public class ATest { - - private static final String javaVersion = System.getProperty( "java.version" ); - + + private static final String javaVersion = System.getProperty("java.version"); + @Test - public void testGet8() throws Exception - { - assumeThat( javaVersion, is( "8" ) ); - - assertThat( A.getString(), is( "BASE -> 8" ) ); + public void testGet8() throws Exception { + assumeThat(javaVersion, is("8")); - assertThat( new A().introducedClass().getName(), is( "java.time.LocalDateTime" ) ); + assertThat(A.getString(), is("BASE -> 8")); + + assertThat(new A().introducedClass().getName(), is("java.time.LocalDateTime")); } - + @Test - public void testGet9() throws Exception - { - assumeThat( javaVersion, is( "9" ) ); + public void testGet9() throws Exception { + assumeThat(javaVersion, is("9")); - assertThat( A.getString(), is( "BASE -> 9" ) ); + assertThat(A.getString(), is("BASE -> 9")); - assertThat( new A().introducedClass().getName(), is( "java.lang.Module" ) ); + assertThat(new A().introducedClass().getName(), is("java.lang.Module")); } - -} \ No newline at end of file +} diff --git a/src/it/multirelease-patterns/singleproject-runtime/src/main/java/base/Base.java b/src/it/multirelease-patterns/singleproject-runtime/src/main/java/base/Base.java index 513f9099..19ec7d8f 100644 --- a/src/it/multirelease-patterns/singleproject-runtime/src/main/java/base/Base.java +++ b/src/it/multirelease-patterns/singleproject-runtime/src/main/java/base/Base.java @@ -1,5 +1,3 @@ -package base; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package base; public class Base { diff --git a/src/it/multirelease-patterns/singleproject-runtime/src/main/java/mr/A.java b/src/it/multirelease-patterns/singleproject-runtime/src/main/java/mr/A.java index 6c2eb86b..0e48eee6 100644 --- a/src/it/multirelease-patterns/singleproject-runtime/src/main/java/mr/A.java +++ b/src/it/multirelease-patterns/singleproject-runtime/src/main/java/mr/A.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,15 +16,15 @@ * specific language governing permissions and limitations * under the License. */ +package mr; import base.Base; -public class A implements I -{ +public class A implements I { public static String getString() { return Base.get() + " -> 8"; } - + @Override public Class introducedClass() { return java.time.LocalDateTime.class; diff --git a/src/it/multirelease-patterns/singleproject-runtime/src/main/java/mr/I.java b/src/it/multirelease-patterns/singleproject-runtime/src/main/java/mr/I.java index f9858cfc..a0523266 100644 --- a/src/it/multirelease-patterns/singleproject-runtime/src/main/java/mr/I.java +++ b/src/it/multirelease-patterns/singleproject-runtime/src/main/java/mr/I.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ +package mr; -public interface I -{ +public interface I { Class introducedClass(); -} \ No newline at end of file +} diff --git a/src/it/multirelease-patterns/singleproject-runtime/src/main/java9/module-info.java b/src/it/multirelease-patterns/singleproject-runtime/src/main/java9/module-info.java index 2407e6b1..36f00e07 100644 --- a/src/it/multirelease-patterns/singleproject-runtime/src/main/java9/module-info.java +++ b/src/it/multirelease-patterns/singleproject-runtime/src/main/java9/module-info.java @@ -16,8 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -module example.mrjar -{ - exports base; - exports mr; +module example.mrjar { + exports base; + exports mr; } diff --git a/src/it/multirelease-patterns/singleproject-runtime/src/main/java9/mr/A.java b/src/it/multirelease-patterns/singleproject-runtime/src/main/java9/mr/A.java index e2b9598e..5083e1ce 100644 --- a/src/it/multirelease-patterns/singleproject-runtime/src/main/java9/mr/A.java +++ b/src/it/multirelease-patterns/singleproject-runtime/src/main/java9/mr/A.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,17 +16,17 @@ * specific language governing permissions and limitations * under the License. */ - -import base.Base; +package mr; import java.util.Optional; -public class A implements I -{ +import base.Base; + +public class A implements I { public static String getString() { - return Base.get() + " -> " + Optional.of( "9" ).get(); + return Base.get() + " -> " + Optional.of("9").get(); } - + @Override public Class introducedClass() { return Module.class; diff --git a/src/it/multirelease-patterns/singleproject-runtime/src/test/java/mr/ATest.java b/src/it/multirelease-patterns/singleproject-runtime/src/test/java/mr/ATest.java index 07a207ca..510fb1c4 100644 --- a/src/it/multirelease-patterns/singleproject-runtime/src/test/java/mr/ATest.java +++ b/src/it/multirelease-patterns/singleproject-runtime/src/test/java/mr/ATest.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,35 +16,33 @@ * specific language governing permissions and limitations * under the License. */ +package mr; +import org.junit.Test; + +import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import static org.junit.Assume.assumeThat; -import static org.hamcrest.CoreMatchers.is; - -import org.junit.Test; public class ATest { - - private static final String javaVersion = System.getProperty( "java.version" ); - + + private static final String javaVersion = System.getProperty("java.version"); + @Test - public void testGet8() throws Exception - { - assumeThat( javaVersion, is( "8" ) ); - - assertThat( A.getString(), is( "BASE -> 8" ) ); + public void testGet8() throws Exception { + assumeThat(javaVersion, is("8")); - assertThat( new A().introducedClass().getName(), is( "java.time.LocalDateTime" ) ); + assertThat(A.getString(), is("BASE -> 8")); + + assertThat(new A().introducedClass().getName(), is("java.time.LocalDateTime")); } - + @Test - public void testGet9() throws Exception - { - assumeThat( javaVersion, is( "9" ) ); + public void testGet9() throws Exception { + assumeThat(javaVersion, is("9")); - assertThat( A.getString(), is( "BASE -> 9" ) ); + assertThat(A.getString(), is("BASE -> 9")); - assertThat( new A().introducedClass().getName(), is( "java.lang.Module" ) ); + assertThat(new A().introducedClass().getName(), is("java.lang.Module")); } - -} \ No newline at end of file +} diff --git a/src/it/multirelease-patterns/singleproject-toolchains/src/main/java/base/Base.java b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java/base/Base.java index 513f9099..19ec7d8f 100644 --- a/src/it/multirelease-patterns/singleproject-toolchains/src/main/java/base/Base.java +++ b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java/base/Base.java @@ -1,5 +1,3 @@ -package base; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package base; public class Base { diff --git a/src/it/multirelease-patterns/singleproject-toolchains/src/main/java/mr/A.java b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java/mr/A.java index 6c2eb86b..0e48eee6 100644 --- a/src/it/multirelease-patterns/singleproject-toolchains/src/main/java/mr/A.java +++ b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java/mr/A.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,15 +16,15 @@ * specific language governing permissions and limitations * under the License. */ +package mr; import base.Base; -public class A implements I -{ +public class A implements I { public static String getString() { return Base.get() + " -> 8"; } - + @Override public Class introducedClass() { return java.time.LocalDateTime.class; diff --git a/src/it/multirelease-patterns/singleproject-toolchains/src/main/java/mr/I.java b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java/mr/I.java index f9858cfc..a0523266 100644 --- a/src/it/multirelease-patterns/singleproject-toolchains/src/main/java/mr/I.java +++ b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java/mr/I.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ +package mr; -public interface I -{ +public interface I { Class introducedClass(); -} \ No newline at end of file +} diff --git a/src/it/multirelease-patterns/singleproject-toolchains/src/main/java9/module-info.java b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java9/module-info.java index 2407e6b1..36f00e07 100644 --- a/src/it/multirelease-patterns/singleproject-toolchains/src/main/java9/module-info.java +++ b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java9/module-info.java @@ -16,8 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -module example.mrjar -{ - exports base; - exports mr; +module example.mrjar { + exports base; + exports mr; } diff --git a/src/it/multirelease-patterns/singleproject-toolchains/src/main/java9/mr/A.java b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java9/mr/A.java index e2b9598e..5083e1ce 100644 --- a/src/it/multirelease-patterns/singleproject-toolchains/src/main/java9/mr/A.java +++ b/src/it/multirelease-patterns/singleproject-toolchains/src/main/java9/mr/A.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,17 +16,17 @@ * specific language governing permissions and limitations * under the License. */ - -import base.Base; +package mr; import java.util.Optional; -public class A implements I -{ +import base.Base; + +public class A implements I { public static String getString() { - return Base.get() + " -> " + Optional.of( "9" ).get(); + return Base.get() + " -> " + Optional.of("9").get(); } - + @Override public Class introducedClass() { return Module.class; diff --git a/src/it/multirelease-patterns/singleproject-toolchains/src/test/java/mr/ATest.java b/src/it/multirelease-patterns/singleproject-toolchains/src/test/java/mr/ATest.java index 07a207ca..510fb1c4 100644 --- a/src/it/multirelease-patterns/singleproject-toolchains/src/test/java/mr/ATest.java +++ b/src/it/multirelease-patterns/singleproject-toolchains/src/test/java/mr/ATest.java @@ -1,5 +1,3 @@ -package mr; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,35 +16,33 @@ * specific language governing permissions and limitations * under the License. */ +package mr; +import org.junit.Test; + +import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import static org.junit.Assume.assumeThat; -import static org.hamcrest.CoreMatchers.is; - -import org.junit.Test; public class ATest { - - private static final String javaVersion = System.getProperty( "java.version" ); - + + private static final String javaVersion = System.getProperty("java.version"); + @Test - public void testGet8() throws Exception - { - assumeThat( javaVersion, is( "8" ) ); - - assertThat( A.getString(), is( "BASE -> 8" ) ); + public void testGet8() throws Exception { + assumeThat(javaVersion, is("8")); - assertThat( new A().introducedClass().getName(), is( "java.time.LocalDateTime" ) ); + assertThat(A.getString(), is("BASE -> 8")); + + assertThat(new A().introducedClass().getName(), is("java.time.LocalDateTime")); } - + @Test - public void testGet9() throws Exception - { - assumeThat( javaVersion, is( "9" ) ); + public void testGet9() throws Exception { + assumeThat(javaVersion, is("9")); - assertThat( A.getString(), is( "BASE -> 9" ) ); + assertThat(A.getString(), is("BASE -> 9")); - assertThat( new A().introducedClass().getName(), is( "java.lang.Module" ) ); + assertThat(new A().introducedClass().getName(), is("java.lang.Module")); } - -} \ No newline at end of file +} diff --git a/src/it/non-english-warnings/src/main/java/MyClass.java b/src/it/non-english-warnings/src/main/java/MyClass.java index 62c02eea..16ecae3e 100644 --- a/src/it/non-english-warnings/src/main/java/MyClass.java +++ b/src/it/non-english-warnings/src/main/java/MyClass.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,13 +18,10 @@ */ package foo; -public class MyClass -{ +public class MyClass { - public static void main( String[] args ) - { + public static void main(String[] args) { // the date constructor is deprecated and will cause a warning - System.out.println( new java.util.Date( 2010, 8, 29 ) ); + System.out.println(new java.util.Date(2010, 8, 29)); } - } diff --git a/src/it/non-english-warnings/src/test/java/MyTest.java b/src/it/non-english-warnings/src/test/java/MyTest.java index a51de2bb..b9427e90 100644 --- a/src/it/non-english-warnings/src/test/java/MyTest.java +++ b/src/it/non-english-warnings/src/test/java/MyTest.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,13 +18,10 @@ */ package foo; -public class MyTest -{ +public class MyTest { - public static void main( String[] args ) - { + public static void main(String[] args) { // the date constructor is deprecated and will cause a warning - System.out.println( new java.util.Date( 2010, 8, 29 ) ); + System.out.println(new java.util.Date(2010, 8, 29)); } - } diff --git a/src/it/non-english-warnings/verify.bsh b/src/it/non-english-warnings/verify.bsh index 919db9da..db162700 100644 --- a/src/it/non-english-warnings/verify.bsh +++ b/src/it/non-english-warnings/verify.bsh @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package foo; import java.io.*; import java.util.*; diff --git a/src/it/setup_annotation-verify-plugin/src/main/java/org.apache.maven.plugins.compiler.it/SourcePathReadGoal.java b/src/it/setup_annotation-verify-plugin/src/main/java/org.apache.maven.plugins.compiler.it/SourcePathReadGoal.java index 668809a8..46b7d2b6 100644 --- a/src/it/setup_annotation-verify-plugin/src/main/java/org.apache.maven.plugins.compiler.it/SourcePathReadGoal.java +++ b/src/it/setup_annotation-verify-plugin/src/main/java/org.apache.maven.plugins.compiler.it/SourcePathReadGoal.java @@ -1,4 +1,3 @@ -package org.apache.maven.plugins.compiler.it; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -17,25 +16,23 @@ * specific language governing permissions and limitations * under the License. */ +package org.apache.maven.plugins.compiler.it; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.util.List; -import java.util.StringJoiner; import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; -@Mojo( name = "read-source", defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES ) -public class SourcePathReadGoal - extends AbstractMojo -{ +@Mojo(name = "read-source", defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES) +public class SourcePathReadGoal extends AbstractMojo { @Parameter protected String sourceClass; @@ -43,62 +40,49 @@ public class SourcePathReadGoal @Parameter protected String testSourceClass; - @Parameter( defaultValue = "${project}" ) + @Parameter(defaultValue = "${project}") protected MavenProject project; - @SuppressWarnings( "unchecked" ) - public void execute() - throws MojoExecutionException, MojoFailureException - { - if ( sourceClass != null ) - { - getLog().info( "Checking compile source roots for: '" + sourceClass + "'" ); - assertGeneratedSourceFileFor( sourceClass, project.getCompileSourceRoots() ); + @SuppressWarnings("unchecked") + public void execute() throws MojoExecutionException, MojoFailureException { + if (sourceClass != null) { + getLog().info("Checking compile source roots for: '" + sourceClass + "'"); + assertGeneratedSourceFileFor(sourceClass, project.getCompileSourceRoots()); } - if ( testSourceClass != null ) - { - getLog().info( "Checking test-compile source roots for: '" + testSourceClass + "'" ); - assertGeneratedSourceFileFor( testSourceClass, project.getTestCompileSourceRoots() ); + if (testSourceClass != null) { + getLog().info("Checking test-compile source roots for: '" + testSourceClass + "'"); + assertGeneratedSourceFileFor(testSourceClass, project.getTestCompileSourceRoots()); } } - private void assertGeneratedSourceFileFor( String sourceClass, List sourceRoots ) - throws MojoFailureException, MojoExecutionException - { - String sourceFile = sourceClass.replace( '.', '/' ) - .concat( ".txt" ); + private void assertGeneratedSourceFileFor(String sourceClass, List sourceRoots) + throws MojoFailureException, MojoExecutionException { + String sourceFile = sourceClass.replace('.', '/').concat(".txt"); boolean found = false; - for ( String root : sourceRoots ) - { - File f = new File( root, sourceFile ); - getLog().info( "Looking for: " + f ); - if ( f.exists() ) - { - try - { - String[] nameParts = sourceClass.split( "\\." ); - String content = new String( Files.readAllBytes( f.toPath() ) ); - if ( !nameParts[nameParts.length-1].equals( content ) ) - { - throw new MojoFailureException( "Non-matching content in: " + f + "\n expected: '" - + sourceClass + "'\n found: '" + content + "'" ); + for (String root : sourceRoots) { + File f = new File(root, sourceFile); + getLog().info("Looking for: " + f); + if (f.exists()) { + try { + String[] nameParts = sourceClass.split("\\."); + String content = new String(Files.readAllBytes(f.toPath())); + if (!nameParts[nameParts.length - 1].equals(content)) { + throw new MojoFailureException("Non-matching content in: " + f + "\n expected: '" + sourceClass + + "'\n found: '" + content + "'"); } found = true; break; - } - catch ( IOException e ) - { - throw new MojoExecutionException( "Cannot read contents of: " + f, e ); + } catch (IOException e) { + throw new MojoExecutionException("Cannot read contents of: " + f, e); } } } - if ( !found ) - { - throw new MojoFailureException( "Cannot find generated source file: " + sourceFile + " in:\n " - + String.join( "\n ", sourceRoots ) ); + if (!found) { + throw new MojoFailureException( + "Cannot find generated source file: " + sourceFile + " in:\n " + String.join("\n ", sourceRoots)); } } } diff --git a/src/it/setup_jar_automodule/src/main/java/com/ta3/MyClass.java b/src/it/setup_jar_automodule/src/main/java/com/ta3/MyClass.java index e6cbd8bd..728c244a 100644 --- a/src/it/setup_jar_automodule/src/main/java/com/ta3/MyClass.java +++ b/src/it/setup_jar_automodule/src/main/java/com/ta3/MyClass.java @@ -1,25 +1,21 @@ -package com.ta3; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 MyClass -{ - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.ta3; + +public class MyClass {} diff --git a/src/it/setup_jar_module/src/main/java/com/ta2/MyClass.java b/src/it/setup_jar_module/src/main/java/com/ta2/MyClass.java index 4309cae8..5d1cc1fa 100644 --- a/src/it/setup_jar_module/src/main/java/com/ta2/MyClass.java +++ b/src/it/setup_jar_module/src/main/java/com/ta2/MyClass.java @@ -1,25 +1,21 @@ -package com.ta2; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 MyClass -{ - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.ta2; + +public class MyClass {} diff --git a/src/it/setup_jar_module/src/main/java/module-info.java b/src/it/setup_jar_module/src/main/java/module-info.java index 85677180..11a00624 100644 --- a/src/it/setup_jar_module/src/main/java/module-info.java +++ b/src/it/setup_jar_module/src/main/java/module-info.java @@ -1,24 +1,22 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -module ta2 { - - exports com.ta2; - -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module ta2 { + exports com.ta2; +} diff --git a/src/it/setup_x/setup_jar_classic/src/main/java/com/ta2/MyClass.java b/src/it/setup_x/setup_jar_classic/src/main/java/com/ta2/MyClass.java index 4309cae8..5d1cc1fa 100644 --- a/src/it/setup_x/setup_jar_classic/src/main/java/com/ta2/MyClass.java +++ b/src/it/setup_x/setup_jar_classic/src/main/java/com/ta2/MyClass.java @@ -1,25 +1,21 @@ -package com.ta2; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 MyClass -{ - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.ta2; + +public class MyClass {} diff --git a/src/it/setup_x/setup_module-transitive/src/main/java/com/ta2/plus/MyClass.java b/src/it/setup_x/setup_module-transitive/src/main/java/com/ta2/plus/MyClass.java index ce9abfee..2ec4f195 100644 --- a/src/it/setup_x/setup_module-transitive/src/main/java/com/ta2/plus/MyClass.java +++ b/src/it/setup_x/setup_module-transitive/src/main/java/com/ta2/plus/MyClass.java @@ -1,25 +1,21 @@ -package com.ta2.plus; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 MyClass -{ - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.ta2.plus; + +public class MyClass {} diff --git a/src/it/setup_x/setup_module-transitive/src/main/java/module-info.java b/src/it/setup_x/setup_module-transitive/src/main/java/module-info.java index 642a635d..bf7ff9d6 100644 --- a/src/it/setup_x/setup_module-transitive/src/main/java/module-info.java +++ b/src/it/setup_x/setup_module-transitive/src/main/java/module-info.java @@ -1,24 +1,22 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -module ta2.plus { - - exports com.ta2.plus; - -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module ta2.plus { + exports com.ta2.plus; +} diff --git a/src/it/test1/src/main/java/MyClass.java b/src/it/test1/src/main/java/MyClass.java index 90a93702..d4132bb2 100644 --- a/src/it/test1/src/main/java/MyClass.java +++ b/src/it/test1/src/main/java/MyClass.java @@ -6,9 +6,9 @@ * to you 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 @@ -18,7 +18,4 @@ */ package foo; -public class MyClass -{ - -} +public class MyClass {} diff --git a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java index 03cd6af1..b199e24d 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java +++ b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugin.compiler; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package org.apache.maven.plugin.compiler; import java.io.File; import java.io.IOException; @@ -98,10 +97,8 @@ * @author Trygve Laugstøl * @since 2.0 */ -public abstract class AbstractCompilerMojo - extends AbstractMojo -{ - protected static final String PS = System.getProperty( "path.separator" ); +public abstract class AbstractCompilerMojo extends AbstractMojo { + protected static final String PS = System.getProperty("path.separator"); private static final String INPUT_FILES_LST_FILENAME = "inputFiles.lst"; @@ -111,7 +108,7 @@ public abstract class AbstractCompilerMojo // Used to compare with older targets static final String MODULE_INFO_TARGET = "1.9"; - + // ---------------------------------------------------------------------- // Configurables // ---------------------------------------------------------------------- @@ -121,48 +118,47 @@ public abstract class AbstractCompilerMojo * * @since 2.0.2 */ - @Parameter( property = "maven.compiler.failOnError", defaultValue = "true" ) + @Parameter(property = "maven.compiler.failOnError", defaultValue = "true") private boolean failOnError = true; - + /** * Indicates whether the build will continue even if there are compilation warnings. * * @since 3.6 */ - @Parameter( property = "maven.compiler.failOnWarning", defaultValue = "false" ) - private boolean failOnWarning; + @Parameter(property = "maven.compiler.failOnWarning", defaultValue = "false") + private boolean failOnWarning; /** * Set to true to include debugging information in the compiled class files. */ - @Parameter( property = "maven.compiler.debug", defaultValue = "true" ) + @Parameter(property = "maven.compiler.debug", defaultValue = "true") private boolean debug = true; /** * Set to true to generate metadata for reflection on method parameters. * @since 3.6.2 */ - @Parameter( property = "maven.compiler.parameters", defaultValue = "false" ) + @Parameter(property = "maven.compiler.parameters", defaultValue = "false") private boolean parameters; - /** * Set to true to Enable preview language features of the java compiler * @since 3.10.1 */ - @Parameter( property = "maven.compiler.enablePreview", defaultValue = "false" ) + @Parameter(property = "maven.compiler.enablePreview", defaultValue = "false") private boolean enablePreview; /** * Set to true to show messages about what the compiler is doing. */ - @Parameter( property = "maven.compiler.verbose", defaultValue = "false" ) + @Parameter(property = "maven.compiler.verbose", defaultValue = "false") private boolean verbose; /** * Sets whether to show source locations where deprecated APIs are used. */ - @Parameter( property = "maven.compiler.showDeprecation", defaultValue = "false" ) + @Parameter(property = "maven.compiler.showDeprecation", defaultValue = "false") private boolean showDeprecation; /** @@ -170,13 +166,13 @@ public abstract class AbstractCompilerMojo * @deprecated This property is a no-op in {@code javac}. */ @Deprecated - @Parameter( property = "maven.compiler.optimize", defaultValue = "false" ) + @Parameter(property = "maven.compiler.optimize", defaultValue = "false") private boolean optimize; /** * Set to false to disable warnings during compilation. */ - @Parameter( property = "maven.compiler.showWarnings", defaultValue = "true" ) + @Parameter(property = "maven.compiler.showWarnings", defaultValue = "true") private boolean showWarnings; /** @@ -187,7 +183,7 @@ public abstract class AbstractCompilerMojo *

Since 3.9.0 the default value has changed from 1.6 to 1.7

*

Since 3.11.0 the default value has changed from 1.7 to 1.8

*/ - @Parameter( property = "maven.compiler.source", defaultValue = DEFAULT_SOURCE ) + @Parameter(property = "maven.compiler.source", defaultValue = DEFAULT_SOURCE) protected String source; /** @@ -198,50 +194,50 @@ public abstract class AbstractCompilerMojo *

Since 3.9.0 the default value has changed from 1.6 to 1.7

*

Since 3.11.0 the default value has changed from 1.7 to 1.8

*/ - @Parameter( property = "maven.compiler.target", defaultValue = DEFAULT_TARGET ) + @Parameter(property = "maven.compiler.target", defaultValue = DEFAULT_TARGET) protected String target; /** * The -release argument for the Java compiler, supported since Java9 - * + * * @since 3.6 */ - @Parameter( property = "maven.compiler.release" ) + @Parameter(property = "maven.compiler.release") protected String release; - + /** * The -encoding argument for the Java compiler. * * @since 2.1 */ - @Parameter( property = "encoding", defaultValue = "${project.build.sourceEncoding}" ) + @Parameter(property = "encoding", defaultValue = "${project.build.sourceEncoding}") private String encoding; /** * Sets the granularity in milliseconds of the last modification * date for testing whether a source needs recompilation. */ - @Parameter( property = "lastModGranularityMs", defaultValue = "0" ) + @Parameter(property = "lastModGranularityMs", defaultValue = "0") private int staleMillis; /** * The compiler id of the compiler to use. See this * guide for more information. */ - @Parameter( property = "maven.compiler.compilerId", defaultValue = "javac" ) + @Parameter(property = "maven.compiler.compilerId", defaultValue = "javac") private String compilerId; /** * Version of the compiler to use, ex. "1.3", "1.5", if {@link #fork} is set to true. */ - @Parameter( property = "maven.compiler.compilerVersion" ) + @Parameter(property = "maven.compiler.compilerVersion") private String compilerVersion; /** * Allows running the compiler in a separate process. * If false it uses the built in compiler, while if true it will use an executable. */ - @Parameter( property = "maven.compiler.fork", defaultValue = "false" ) + @Parameter(property = "maven.compiler.fork", defaultValue = "false") private boolean fork; /** @@ -250,7 +246,7 @@ public abstract class AbstractCompilerMojo * * @since 2.0.1 */ - @Parameter( property = "maven.compiler.meminitial" ) + @Parameter(property = "maven.compiler.meminitial") private String meminitial; /** @@ -259,13 +255,13 @@ public abstract class AbstractCompilerMojo * * @since 2.0.1 */ - @Parameter( property = "maven.compiler.maxmem" ) + @Parameter(property = "maven.compiler.maxmem") private String maxmem; /** * Sets the executable of the compiler to use when {@link #fork} is true. */ - @Parameter( property = "maven.compiler.executable" ) + @Parameter(property = "maven.compiler.executable") private String executable; /** @@ -408,7 +404,7 @@ public abstract class AbstractCompilerMojo * * @since 2.1 */ - @Parameter( property = "maven.compiler.debuglevel" ) + @Parameter(property = "maven.compiler.debuglevel") private String debuglevel; /** @@ -416,7 +412,7 @@ public abstract class AbstractCompilerMojo * * @since 3.10.2 */ - @Parameter( property = "maven.compiler.implicit" ) + @Parameter(property = "maven.compiler.implicit") private String implicit; /** @@ -433,7 +429,7 @@ public abstract class AbstractCompilerMojo *

* (see Guide to Toolchains for more * info) - * + * *
      * <configuration>
      *   <jdkToolchain>
@@ -451,7 +447,7 @@ public abstract class AbstractCompilerMojo
      * </configuration>
      * 
* note: requires at least Maven 3.3.1 - * + * * @since 3.6 */ @Parameter @@ -464,13 +460,13 @@ public abstract class AbstractCompilerMojo /** * The directory to run the compiler from if fork is true. */ - @Parameter( defaultValue = "${basedir}", required = true, readonly = true ) + @Parameter(defaultValue = "${basedir}", required = true, readonly = true) private File basedir; /** * The target directory of the compiler if fork is true. */ - @Parameter( defaultValue = "${project.build.directory}", required = true, readonly = true ) + @Parameter(defaultValue = "${project.build.directory}", required = true, readonly = true) private File buildDirectory; /** @@ -482,14 +478,14 @@ public abstract class AbstractCompilerMojo /** * The current build session instance. This is used for toolchain manager API calls. */ - @Parameter( defaultValue = "${session}", readonly = true, required = true ) + @Parameter(defaultValue = "${session}", readonly = true, required = true) private MavenSession session; /** * The current project instance. This is used for propagating generated-sources paths as compile/testCompile source * roots. */ - @Parameter( defaultValue = "${project}", readonly = true, required = true ) + @Parameter(defaultValue = "${project}", readonly = true, required = true) private MavenProject project; /** @@ -505,13 +501,13 @@ public abstract class AbstractCompilerMojo * * @since 2.5 */ - @Parameter( defaultValue = "${reuseCreated}", property = "maven.compiler.compilerReuseStrategy" ) + @Parameter(defaultValue = "${reuseCreated}", property = "maven.compiler.compilerReuseStrategy") private String compilerReuseStrategy = "reuseCreated"; /** * @since 2.5 */ - @Parameter( defaultValue = "false", property = "maven.compiler.skipMultiThreadWarning" ) + @Parameter(defaultValue = "false", property = "maven.compiler.skipMultiThreadWarning") private boolean skipMultiThreadWarning; /** @@ -520,13 +516,13 @@ public abstract class AbstractCompilerMojo * * @since 3.0 */ - @Parameter( defaultValue = "false", property = "maven.compiler.forceJavacCompilerUse" ) + @Parameter(defaultValue = "false", property = "maven.compiler.forceJavacCompilerUse") private boolean forceJavacCompilerUse; /** * @since 3.0 needed for storing the status for the incremental build support. */ - @Parameter( defaultValue = "${mojoExecution}", readonly = true, required = true ) + @Parameter(defaultValue = "${mojoExecution}", readonly = true, required = true) private MojoExecution mojoExecution; /** @@ -554,7 +550,7 @@ public abstract class AbstractCompilerMojo * * @since 3.1 */ - @Parameter( defaultValue = "true", property = "maven.compiler.useIncrementalCompilation" ) + @Parameter(defaultValue = "true", property = "maven.compiler.useIncrementalCompilation") private boolean useIncrementalCompilation = true; /** @@ -566,10 +562,10 @@ public abstract class AbstractCompilerMojo * * @since 3.10 */ - @Parameter( defaultValue = "true", property = "maven.compiler.createMissingPackageInfoClass" ) + @Parameter(defaultValue = "true", property = "maven.compiler.createMissingPackageInfoClass") private boolean createMissingPackageInfoClass = true; - @Parameter( defaultValue = "false", property = "maven.compiler.showCompilationChanges" ) + @Parameter(defaultValue = "false", property = "maven.compiler.showCompilationChanges") private boolean showCompilationChanges = false; /** * Resolves the artifacts needed. @@ -583,9 +579,9 @@ public abstract class AbstractCompilerMojo @Component private ArtifactHandlerManager artifactHandlerManager; - protected abstract SourceInclusionScanner getSourceInclusionScanner( int staleMillis ); + protected abstract SourceInclusionScanner getSourceInclusionScanner(int staleMillis); - protected abstract SourceInclusionScanner getSourceInclusionScanner( String inputFileEnding ); + protected abstract SourceInclusionScanner getSourceInclusionScanner(String inputFileEnding); protected abstract List getClasspathElements(); @@ -594,8 +590,8 @@ public abstract class AbstractCompilerMojo protected abstract Map getPathElements(); protected abstract List getCompileSourceRoots(); - - protected abstract void preparePaths( Set sourceFiles ); + + protected abstract void preparePaths(Set sourceFiles); protected abstract File getOutputDirectory(); @@ -613,17 +609,14 @@ public abstract class AbstractCompilerMojo protected abstract String getDebugFileName(); - protected final MavenProject getProject() - { + protected final MavenProject getProject() { return project; } private boolean targetOrReleaseSet; @Override - public void execute() - throws MojoExecutionException, CompilationFailureException - { + public void execute() throws MojoExecutionException, CompilationFailureException { // ---------------------------------------------------------------------- // Look up the compiler. This is done before other code than can // cause the mojo to return before the lookup is done possibly resulting @@ -632,57 +625,50 @@ public void execute() Compiler compiler; - getLog().debug( "Using compiler '" + compilerId + "'." ); + getLog().debug("Using compiler '" + compilerId + "'."); - try - { - compiler = compilerManager.getCompiler( compilerId ); - } - catch ( NoSuchCompilerException e ) - { - throw new MojoExecutionException( "No such compiler '" + e.getCompilerId() + "'." ); + try { + compiler = compilerManager.getCompiler(compilerId); + } catch (NoSuchCompilerException e) { + throw new MojoExecutionException("No such compiler '" + e.getCompilerId() + "'."); } - //-----------toolchains start here ---------------------------------- - //use the compilerId as identifier for toolchains as well. + // -----------toolchains start here ---------------------------------- + // use the compilerId as identifier for toolchains as well. Toolchain tc = getToolchain(); - if ( tc != null ) - { - getLog().info( "Toolchain in maven-compiler-plugin: " + tc ); - if ( executable != null ) - { - getLog().warn( "Toolchains are ignored, 'executable' parameter is set to " + executable ); - } - else - { + if (tc != null) { + getLog().info("Toolchain in maven-compiler-plugin: " + tc); + if (executable != null) { + getLog().warn("Toolchains are ignored, 'executable' parameter is set to " + executable); + } else { fork = true; - //TODO somehow shaky dependency between compilerId and tool executable. - executable = tc.findTool( compilerId ); + // TODO somehow shaky dependency between compilerId and tool executable. + executable = tc.findTool(compilerId); } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- - List compileSourceRoots = removeEmptyCompileSourceRoots( getCompileSourceRoots() ); + List compileSourceRoots = removeEmptyCompileSourceRoots(getCompileSourceRoots()); - if ( compileSourceRoots.isEmpty() ) - { - getLog().info( "No sources to compile" ); + if (compileSourceRoots.isEmpty()) { + getLog().info("No sources to compile"); return; } // Verify that target or release is set - if ( !targetOrReleaseSet ) - { - MessageBuilder mb = MessageUtils.buffer().a( "No explicit value set for target or release! " ) - .a( "To ensure the same result even after upgrading this plugin, please add " ).newline() - .newline(); + if (!targetOrReleaseSet) { + MessageBuilder mb = MessageUtils.buffer() + .a("No explicit value set for target or release! ") + .a("To ensure the same result even after upgrading this plugin, please add ") + .newline() + .newline(); - writePlugin( mb ); + writePlugin(mb); - getLog().warn( mb.toString() ); + getLog().warn(mb.toString()); } // ---------------------------------------------------------------------- @@ -691,721 +677,575 @@ public void execute() CompilerConfiguration compilerConfiguration = new CompilerConfiguration(); - compilerConfiguration.setOutputLocation( getOutputDirectory().getAbsolutePath() ); + compilerConfiguration.setOutputLocation(getOutputDirectory().getAbsolutePath()); - compilerConfiguration.setOptimize( optimize ); + compilerConfiguration.setOptimize(optimize); - compilerConfiguration.setDebug( debug ); + compilerConfiguration.setDebug(debug); - compilerConfiguration.setDebugFileName( getDebugFileName() ); + compilerConfiguration.setDebugFileName(getDebugFileName()); - compilerConfiguration.setImplicitOption( implicit ); + compilerConfiguration.setImplicitOption(implicit); - if ( debug && StringUtils.isNotEmpty( debuglevel ) ) - { - String[] split = StringUtils.split( debuglevel, "," ); - for ( String aSplit : split ) - { - if ( !( aSplit.equalsIgnoreCase( "none" ) || aSplit.equalsIgnoreCase( "lines" ) - || aSplit.equalsIgnoreCase( "vars" ) || aSplit.equalsIgnoreCase( "source" ) ) ) - { - throw new IllegalArgumentException( "The specified debug level: '" + aSplit + "' is unsupported. " - + "Legal values are 'none', 'lines', 'vars', and 'source'." ); + if (debug && StringUtils.isNotEmpty(debuglevel)) { + String[] split = StringUtils.split(debuglevel, ","); + for (String aSplit : split) { + if (!(aSplit.equalsIgnoreCase("none") + || aSplit.equalsIgnoreCase("lines") + || aSplit.equalsIgnoreCase("vars") + || aSplit.equalsIgnoreCase("source"))) { + throw new IllegalArgumentException("The specified debug level: '" + aSplit + "' is unsupported. " + + "Legal values are 'none', 'lines', 'vars', and 'source'."); } } - compilerConfiguration.setDebugLevel( debuglevel ); + compilerConfiguration.setDebugLevel(debuglevel); } - compilerConfiguration.setParameters( parameters ); + compilerConfiguration.setParameters(parameters); - compilerConfiguration.setEnablePreview( enablePreview ); + compilerConfiguration.setEnablePreview(enablePreview); - compilerConfiguration.setVerbose( verbose ); + compilerConfiguration.setVerbose(verbose); - compilerConfiguration.setShowWarnings( showWarnings ); + compilerConfiguration.setShowWarnings(showWarnings); - compilerConfiguration.setFailOnWarning( failOnWarning ); + compilerConfiguration.setFailOnWarning(failOnWarning); - if ( failOnWarning && !showWarnings ) - { - getLog().warn( "The property failOnWarning is set to true, but showWarnings is set to false." ); - getLog().warn( "With compiler's warnings silenced the failOnWarning has no effect." ); + if (failOnWarning && !showWarnings) { + getLog().warn("The property failOnWarning is set to true, but showWarnings is set to false."); + getLog().warn("With compiler's warnings silenced the failOnWarning has no effect."); } - compilerConfiguration.setShowDeprecation( showDeprecation ); + compilerConfiguration.setShowDeprecation(showDeprecation); - compilerConfiguration.setSourceVersion( getSource() ); + compilerConfiguration.setSourceVersion(getSource()); - compilerConfiguration.setTargetVersion( getTarget() ); - - compilerConfiguration.setReleaseVersion( getRelease() ); + compilerConfiguration.setTargetVersion(getTarget()); - compilerConfiguration.setProc( proc ); + compilerConfiguration.setReleaseVersion(getRelease()); + + compilerConfiguration.setProc(proc); File generatedSourcesDirectory = getGeneratedSourcesDirectory(); - compilerConfiguration.setGeneratedSourcesDirectory( generatedSourcesDirectory != null - ? generatedSourcesDirectory.getAbsoluteFile() : null ); + compilerConfiguration.setGeneratedSourcesDirectory( + generatedSourcesDirectory != null ? generatedSourcesDirectory.getAbsoluteFile() : null); - if ( generatedSourcesDirectory != null ) - { - if ( !generatedSourcesDirectory.exists() ) - { + if (generatedSourcesDirectory != null) { + if (!generatedSourcesDirectory.exists()) { generatedSourcesDirectory.mkdirs(); } String generatedSourcesPath = generatedSourcesDirectory.getAbsolutePath(); - compileSourceRoots.add( generatedSourcesPath ); + compileSourceRoots.add(generatedSourcesPath); - if ( isTestCompile() ) - { - getLog().debug( "Adding " + generatedSourcesPath + " to test-compile source roots:\n " - + StringUtils.join( project.getTestCompileSourceRoots() - .iterator(), "\n " ) ); + if (isTestCompile()) { + getLog().debug("Adding " + generatedSourcesPath + " to test-compile source roots:\n " + + StringUtils.join(project.getTestCompileSourceRoots().iterator(), "\n ")); - project.addTestCompileSourceRoot( generatedSourcesPath ); + project.addTestCompileSourceRoot(generatedSourcesPath); - getLog().debug( "New test-compile source roots:\n " - + StringUtils.join( project.getTestCompileSourceRoots() - .iterator(), "\n " ) ); - } - else - { - getLog().debug( "Adding " + generatedSourcesPath + " to compile source roots:\n " - + StringUtils.join( project.getCompileSourceRoots() - .iterator(), "\n " ) ); + getLog().debug("New test-compile source roots:\n " + + StringUtils.join(project.getTestCompileSourceRoots().iterator(), "\n ")); + } else { + getLog().debug("Adding " + generatedSourcesPath + " to compile source roots:\n " + + StringUtils.join(project.getCompileSourceRoots().iterator(), "\n ")); - project.addCompileSourceRoot( generatedSourcesPath ); + project.addCompileSourceRoot(generatedSourcesPath); - getLog().debug( "New compile source roots:\n " + StringUtils.join( project.getCompileSourceRoots() - .iterator(), "\n " ) ); + getLog().debug("New compile source roots:\n " + + StringUtils.join(project.getCompileSourceRoots().iterator(), "\n ")); } } - compilerConfiguration.setSourceLocations( compileSourceRoots ); + compilerConfiguration.setSourceLocations(compileSourceRoots); - compilerConfiguration.setAnnotationProcessors( annotationProcessors ); + compilerConfiguration.setAnnotationProcessors(annotationProcessors); - compilerConfiguration.setProcessorPathEntries( resolveProcessorPathEntries() ); + compilerConfiguration.setProcessorPathEntries(resolveProcessorPathEntries()); - compilerConfiguration.setSourceEncoding( encoding ); + compilerConfiguration.setSourceEncoding(encoding); - compilerConfiguration.setFork( fork ); + compilerConfiguration.setFork(fork); - if ( fork ) - { - if ( !StringUtils.isEmpty( meminitial ) ) - { - String value = getMemoryValue( meminitial ); + if (fork) { + if (!StringUtils.isEmpty(meminitial)) { + String value = getMemoryValue(meminitial); - if ( value != null ) - { - compilerConfiguration.setMeminitial( value ); - } - else - { - getLog().info( "Invalid value for meminitial '" + meminitial + "'. Ignoring this option." ); + if (value != null) { + compilerConfiguration.setMeminitial(value); + } else { + getLog().info("Invalid value for meminitial '" + meminitial + "'. Ignoring this option."); } } - if ( !StringUtils.isEmpty( maxmem ) ) - { - String value = getMemoryValue( maxmem ); + if (!StringUtils.isEmpty(maxmem)) { + String value = getMemoryValue(maxmem); - if ( value != null ) - { - compilerConfiguration.setMaxmem( value ); - } - else - { - getLog().info( "Invalid value for maxmem '" + maxmem + "'. Ignoring this option." ); + if (value != null) { + compilerConfiguration.setMaxmem(value); + } else { + getLog().info("Invalid value for maxmem '" + maxmem + "'. Ignoring this option."); } } } - compilerConfiguration.setExecutable( executable ); + compilerConfiguration.setExecutable(executable); - compilerConfiguration.setWorkingDirectory( basedir ); + compilerConfiguration.setWorkingDirectory(basedir); - compilerConfiguration.setCompilerVersion( compilerVersion ); + compilerConfiguration.setCompilerVersion(compilerVersion); - compilerConfiguration.setBuildDirectory( buildDirectory ); + compilerConfiguration.setBuildDirectory(buildDirectory); - compilerConfiguration.setOutputFileName( outputFileName ); + compilerConfiguration.setOutputFileName(outputFileName); - if ( CompilerConfiguration.CompilerReuseStrategy.AlwaysNew.getStrategy().equals( this.compilerReuseStrategy ) ) - { - compilerConfiguration.setCompilerReuseStrategy( CompilerConfiguration.CompilerReuseStrategy.AlwaysNew ); - } - else if ( CompilerConfiguration.CompilerReuseStrategy.ReuseSame.getStrategy().equals( - this.compilerReuseStrategy ) ) - { - if ( getRequestThreadCount() > 1 ) - { - if ( !skipMultiThreadWarning ) - { - getLog().warn( "You are in a multi-thread build and compilerReuseStrategy is set to reuseSame." - + " This can cause issues in some environments (os/jdk)!" - + " Consider using reuseCreated strategy." - + System.getProperty( "line.separator" ) - + "If your env is fine with reuseSame, you can skip this warning with the " - + "configuration field skipMultiThreadWarning " - + "or -Dmaven.compiler.skipMultiThreadWarning=true" ); + if (CompilerConfiguration.CompilerReuseStrategy.AlwaysNew.getStrategy().equals(this.compilerReuseStrategy)) { + compilerConfiguration.setCompilerReuseStrategy(CompilerConfiguration.CompilerReuseStrategy.AlwaysNew); + } else if (CompilerConfiguration.CompilerReuseStrategy.ReuseSame.getStrategy() + .equals(this.compilerReuseStrategy)) { + if (getRequestThreadCount() > 1) { + if (!skipMultiThreadWarning) { + getLog().warn("You are in a multi-thread build and compilerReuseStrategy is set to reuseSame." + + " This can cause issues in some environments (os/jdk)!" + + " Consider using reuseCreated strategy." + + System.getProperty("line.separator") + + "If your env is fine with reuseSame, you can skip this warning with the " + + "configuration field skipMultiThreadWarning " + + "or -Dmaven.compiler.skipMultiThreadWarning=true"); } } - compilerConfiguration.setCompilerReuseStrategy( CompilerConfiguration.CompilerReuseStrategy.ReuseSame ); - } - else - { + compilerConfiguration.setCompilerReuseStrategy(CompilerConfiguration.CompilerReuseStrategy.ReuseSame); + } else { - compilerConfiguration.setCompilerReuseStrategy( CompilerConfiguration.CompilerReuseStrategy.ReuseCreated ); + compilerConfiguration.setCompilerReuseStrategy(CompilerConfiguration.CompilerReuseStrategy.ReuseCreated); } - getLog().debug( "CompilerReuseStrategy: " + compilerConfiguration.getCompilerReuseStrategy().getStrategy() ); + getLog().debug("CompilerReuseStrategy: " + + compilerConfiguration.getCompilerReuseStrategy().getStrategy()); - compilerConfiguration.setForceJavacCompilerUse( forceJavacCompilerUse ); + compilerConfiguration.setForceJavacCompilerUse(forceJavacCompilerUse); boolean canUpdateTarget; - IncrementalBuildHelper incrementalBuildHelper = new IncrementalBuildHelper( mojoExecution, session ); + IncrementalBuildHelper incrementalBuildHelper = new IncrementalBuildHelper(mojoExecution, session); final Set sources; IncrementalBuildHelperRequest incrementalBuildHelperRequest = null; - if ( useIncrementalCompilation ) - { - getLog().debug( "useIncrementalCompilation enabled" ); - try - { - canUpdateTarget = compiler.canUpdateTarget( compilerConfiguration ); + if (useIncrementalCompilation) { + getLog().debug("useIncrementalCompilation enabled"); + try { + canUpdateTarget = compiler.canUpdateTarget(compilerConfiguration); - sources = getCompileSources( compiler, compilerConfiguration ); - - preparePaths( sources ); + sources = getCompileSources(compiler, compilerConfiguration); - incrementalBuildHelperRequest = new IncrementalBuildHelperRequest().inputFiles( sources ); + preparePaths(sources); - DirectoryScanResult dsr = computeInputFileTreeChanges( incrementalBuildHelper, sources ); + incrementalBuildHelperRequest = new IncrementalBuildHelperRequest().inputFiles(sources); + + DirectoryScanResult dsr = computeInputFileTreeChanges(incrementalBuildHelper, sources); boolean idk = compiler.getCompilerOutputStyle() - .equals( CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES ) && !canUpdateTarget; + .equals(CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES) + && !canUpdateTarget; boolean dependencyChanged = isDependencyChanged(); - boolean sourceChanged = isSourceChanged( compilerConfiguration, compiler ); - boolean inputFileTreeChanged = hasInputFileTreeChanged( dsr ); + boolean sourceChanged = isSourceChanged(compilerConfiguration, compiler); + boolean inputFileTreeChanged = hasInputFileTreeChanged(dsr); // CHECKSTYLE_OFF: LineLength - if ( idk - || dependencyChanged - || sourceChanged - || inputFileTreeChanged ) - // CHECKSTYLE_ON: LineLength + if (idk || dependencyChanged || sourceChanged || inputFileTreeChanged) + // CHECKSTYLE_ON: LineLength { - String cause = idk ? "idk" : ( dependencyChanged ? "dependency" - : ( sourceChanged ? "source" : "input tree" ) ); - getLog().info( "Changes detected - recompiling the module! :" + cause ); - if ( showCompilationChanges ) - { - for ( String fileAdded : dsr.getFilesAdded() ) - { - getLog().info( "\t+ " + fileAdded ); + String cause = idk + ? "idk" + : (dependencyChanged ? "dependency" : (sourceChanged ? "source" : "input tree")); + getLog().info("Changes detected - recompiling the module! :" + cause); + if (showCompilationChanges) { + for (String fileAdded : dsr.getFilesAdded()) { + getLog().info("\t+ " + fileAdded); } - for ( String fileRemoved : dsr.getFilesRemoved() ) - { - getLog().info( "\t- " + fileRemoved ); + for (String fileRemoved : dsr.getFilesRemoved()) { + getLog().info("\t- " + fileRemoved); } } - compilerConfiguration.setSourceFiles( sources ); - } - else - { - getLog().info( "Nothing to compile - all classes are up to date" ); + compilerConfiguration.setSourceFiles(sources); + } else { + getLog().info("Nothing to compile - all classes are up to date"); return; } + } catch (CompilerException e) { + throw new MojoExecutionException("Error while computing stale sources.", e); } - catch ( CompilerException e ) - { - throw new MojoExecutionException( "Error while computing stale sources.", e ); - } - } - else - { - getLog().debug( "useIncrementalCompilation disabled" ); - + } else { + getLog().debug("useIncrementalCompilation disabled"); + Set staleSources; - try - { + try { staleSources = - computeStaleSources( compilerConfiguration, compiler, getSourceInclusionScanner( staleMillis ) ); + computeStaleSources(compilerConfiguration, compiler, getSourceInclusionScanner(staleMillis)); - canUpdateTarget = compiler.canUpdateTarget( compilerConfiguration ); + canUpdateTarget = compiler.canUpdateTarget(compilerConfiguration); - if ( compiler.getCompilerOutputStyle().equals( CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES ) - && !canUpdateTarget ) - { - getLog().info( "RESCANNING!" ); + if (compiler.getCompilerOutputStyle().equals(CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES) + && !canUpdateTarget) { + getLog().info("RESCANNING!"); // TODO: This second scan for source files is sub-optimal - String inputFileEnding = compiler.getInputFileEnding( compilerConfiguration ); + String inputFileEnding = compiler.getInputFileEnding(compilerConfiguration); - staleSources = computeStaleSources( compilerConfiguration, compiler, - getSourceInclusionScanner( inputFileEnding ) ); + staleSources = computeStaleSources( + compilerConfiguration, compiler, getSourceInclusionScanner(inputFileEnding)); } - - } - catch ( CompilerException e ) - { - throw new MojoExecutionException( "Error while computing stale sources.", e ); + + } catch (CompilerException e) { + throw new MojoExecutionException("Error while computing stale sources.", e); } - if ( staleSources.isEmpty() ) - { - getLog().info( "Nothing to compile - all classes are up to date" ); + if (staleSources.isEmpty()) { + getLog().info("Nothing to compile - all classes are up to date"); return; } - compilerConfiguration.setSourceFiles( staleSources ); - - try - { + compilerConfiguration.setSourceFiles(staleSources); + + try { // MCOMPILER-366: if sources contain the module-descriptor it must be used to define the modulepath - sources = getCompileSources( compiler, compilerConfiguration ); + sources = getCompileSources(compiler, compilerConfiguration); - if ( getLog().isDebugEnabled() ) - { - getLog().debug( "#sources: " + sources.size() ); - for ( File file : sources ) - { - getLog().debug( file.getPath() ); + if (getLog().isDebugEnabled()) { + getLog().debug("#sources: " + sources.size()); + for (File file : sources) { + getLog().debug(file.getPath()); } } - preparePaths( sources ); - } - catch ( CompilerException e ) - { - throw new MojoExecutionException( "Error while computing stale sources.", e ); + preparePaths(sources); + } catch (CompilerException e) { + throw new MojoExecutionException("Error while computing stale sources.", e); } } - + // Dividing pathElements of classPath and modulePath is based on sourceFiles - compilerConfiguration.setClasspathEntries( getClasspathElements() ); + compilerConfiguration.setClasspathEntries(getClasspathElements()); + + compilerConfiguration.setModulepathEntries(getModulepathElements()); - compilerConfiguration.setModulepathEntries( getModulepathElements() ); - - compilerConfiguration.setIncludes( getIncludes() ); + compilerConfiguration.setIncludes(getIncludes()); - compilerConfiguration.setExcludes( getExcludes() ); + compilerConfiguration.setExcludes(getExcludes()); Map effectiveCompilerArguments = getCompilerArguments(); String effectiveCompilerArgument = getCompilerArgument(); - if ( ( effectiveCompilerArguments != null ) || ( effectiveCompilerArgument != null ) - || ( compilerArgs != null ) ) - { - if ( effectiveCompilerArguments != null ) - { - for ( Map.Entry me : effectiveCompilerArguments.entrySet() ) - { + if ((effectiveCompilerArguments != null) || (effectiveCompilerArgument != null) || (compilerArgs != null)) { + if (effectiveCompilerArguments != null) { + for (Map.Entry me : effectiveCompilerArguments.entrySet()) { String key = me.getKey(); String value = me.getValue(); - if ( !key.startsWith( "-" ) ) - { + if (!key.startsWith("-")) { key = "-" + key; } - if ( key.startsWith( "-A" ) && StringUtils.isNotEmpty( value ) ) - { - compilerConfiguration.addCompilerCustomArgument( key + "=" + value, null ); - } - else - { - compilerConfiguration.addCompilerCustomArgument( key, value ); + if (key.startsWith("-A") && StringUtils.isNotEmpty(value)) { + compilerConfiguration.addCompilerCustomArgument(key + "=" + value, null); + } else { + compilerConfiguration.addCompilerCustomArgument(key, value); } } } - if ( !StringUtils.isEmpty( effectiveCompilerArgument ) ) - { - compilerConfiguration.addCompilerCustomArgument( effectiveCompilerArgument, null ); + if (!StringUtils.isEmpty(effectiveCompilerArgument)) { + compilerConfiguration.addCompilerCustomArgument(effectiveCompilerArgument, null); } - if ( compilerArgs != null ) - { - for ( String arg : compilerArgs ) - { - compilerConfiguration.addCompilerCustomArgument( arg, null ); + if (compilerArgs != null) { + for (String arg : compilerArgs) { + compilerConfiguration.addCompilerCustomArgument(arg, null); } } } - + // ---------------------------------------------------------------------- // Dump configuration // ---------------------------------------------------------------------- - if ( getLog().isDebugEnabled() ) - { - getLog().debug( "Classpath:" ); + if (getLog().isDebugEnabled()) { + getLog().debug("Classpath:"); - for ( String s : getClasspathElements() ) - { - getLog().debug( " " + s ); + for (String s : getClasspathElements()) { + getLog().debug(" " + s); } - if ( !getModulepathElements().isEmpty() ) - { - getLog().debug( "Modulepath:" ); - for ( String s : getModulepathElements() ) - { - getLog().debug( " " + s ); + if (!getModulepathElements().isEmpty()) { + getLog().debug("Modulepath:"); + for (String s : getModulepathElements()) { + getLog().debug(" " + s); } } - getLog().debug( "Source roots:" ); + getLog().debug("Source roots:"); - for ( String root : getCompileSourceRoots() ) - { - getLog().debug( " " + root ); + for (String root : getCompileSourceRoots()) { + getLog().debug(" " + root); } - try - { - if ( fork ) - { - if ( compilerConfiguration.getExecutable() != null ) - { - getLog().debug( "Excutable: " ); - getLog().debug( " " + compilerConfiguration.getExecutable() ); + try { + if (fork) { + if (compilerConfiguration.getExecutable() != null) { + getLog().debug("Excutable: "); + getLog().debug(" " + compilerConfiguration.getExecutable()); } } - String[] cl = compiler.createCommandLine( compilerConfiguration ); - if ( cl != null && cl.length > 0 ) - { + String[] cl = compiler.createCommandLine(compilerConfiguration); + if (cl != null && cl.length > 0) { StringBuilder sb = new StringBuilder(); - sb.append( cl[0] ); - for ( int i = 1; i < cl.length; i++ ) - { - sb.append( " " ); - sb.append( cl[i] ); + sb.append(cl[0]); + for (int i = 1; i < cl.length; i++) { + sb.append(" "); + sb.append(cl[i]); } - getLog().debug( "Command line options:" ); - getLog().debug( sb ); + getLog().debug("Command line options:"); + getLog().debug(sb); } - } - catch ( CompilerException ce ) - { - getLog().debug( ce ); + } catch (CompilerException ce) { + getLog().debug(ce); } } - List jpmsLines = new ArrayList<>(); - + // See http://openjdk.java.net/jeps/261 - final List runtimeArgs = Arrays.asList( "--upgrade-module-path", - "--add-exports", - "--add-reads", - "--add-modules", - "--limit-modules" ); - + final List runtimeArgs = Arrays.asList( + "--upgrade-module-path", "--add-exports", "--add-reads", "--add-modules", "--limit-modules"); + // Custom arguments are all added as keys to an ordered Map Iterator> entryIter = - compilerConfiguration.getCustomCompilerArgumentsEntries().iterator(); - while ( entryIter.hasNext() ) - { + compilerConfiguration.getCustomCompilerArgumentsEntries().iterator(); + while (entryIter.hasNext()) { Map.Entry entry = entryIter.next(); - - if ( runtimeArgs.contains( entry.getKey() ) ) - { - jpmsLines.add( entry.getKey() ); - + + if (runtimeArgs.contains(entry.getKey())) { + jpmsLines.add(entry.getKey()); + String value = entry.getValue(); - if ( value == null ) - { + if (value == null) { entry = entryIter.next(); value = entry.getKey(); } - jpmsLines.add( value ); - } - else if ( "--patch-module".equals( entry.getKey() ) ) - { + jpmsLines.add(value); + } else if ("--patch-module".equals(entry.getKey())) { String value = entry.getValue(); - if ( value == null ) - { + if (value == null) { entry = entryIter.next(); value = entry.getKey(); } - - String[] values = value.split( "=" ); - StringBuilder patchModule = new StringBuilder( values[0] ); - patchModule.append( '=' ); + String[] values = value.split("="); + + StringBuilder patchModule = new StringBuilder(values[0]); + patchModule.append('='); Set patchModules = new LinkedHashSet<>(); - Set sourceRoots = new HashSet<>( getCompileSourceRoots().size() ); - for ( String sourceRoot : getCompileSourceRoots() ) - { - sourceRoots.add( Paths.get( sourceRoot ) ); + Set sourceRoots = new HashSet<>(getCompileSourceRoots().size()); + for (String sourceRoot : getCompileSourceRoots()) { + sourceRoots.add(Paths.get(sourceRoot)); } - String[] files = values[1].split( PS ); + String[] files = values[1].split(PS); - for ( String file : files ) - { - Path filePath = Paths.get( file ); - if ( getOutputDirectory().toPath().equals( filePath ) ) - { - patchModules.add( "_" ); // this jar - } - else if ( getOutputDirectory().toPath().startsWith( filePath ) ) - { + for (String file : files) { + Path filePath = Paths.get(file); + if (getOutputDirectory().toPath().equals(filePath)) { + patchModules.add("_"); // this jar + } else if (getOutputDirectory().toPath().startsWith(filePath)) { // multirelease, can be ignored continue; - } - else if ( sourceRoots.contains( filePath ) ) - { - patchModules.add( "_" ); // this jar - } - else - { - JavaModuleDescriptor descriptor = getPathElements().get( file ); - - if ( descriptor == null ) - { - if ( Files.isDirectory( filePath ) ) - { - patchModules.add( file ); + } else if (sourceRoots.contains(filePath)) { + patchModules.add("_"); // this jar + } else { + JavaModuleDescriptor descriptor = getPathElements().get(file); + + if (descriptor == null) { + if (Files.isDirectory(filePath)) { + patchModules.add(file); + } else { + getLog().warn("Can't locate " + file); } - else - { - getLog().warn( "Can't locate " + file ); - } - } - else if ( !values[0].equals( descriptor.name() ) ) - { - patchModules.add( descriptor.name() ); + } else if (!values[0].equals(descriptor.name())) { + patchModules.add(descriptor.name()); } } } StringBuilder sb = new StringBuilder(); - - if ( !patchModules.isEmpty() ) - { - for ( String mod : patchModules ) - { - if ( sb.length() > 0 ) - { - sb.append( ", " ); + + if (!patchModules.isEmpty()) { + for (String mod : patchModules) { + if (sb.length() > 0) { + sb.append(", "); } // use 'invalid' separator to ensure values are transformed - sb.append( mod ); + sb.append(mod); } - jpmsLines.add( "--patch-module" ); - jpmsLines.add( patchModule + sb.toString() ); + jpmsLines.add("--patch-module"); + jpmsLines.add(patchModule + sb.toString()); } - } } - - if ( !jpmsLines.isEmpty() ) - { - Path jpmsArgs = Paths.get( getOutputDirectory().getAbsolutePath(), "META-INF/jpms.args" ); - try - { - Files.createDirectories( jpmsArgs.getParent() ); - - Files.write( jpmsArgs, jpmsLines, Charset.defaultCharset() ); - } - catch ( IOException e ) - { - getLog().warn( e.getMessage() ); + + if (!jpmsLines.isEmpty()) { + Path jpmsArgs = Paths.get(getOutputDirectory().getAbsolutePath(), "META-INF/jpms.args"); + try { + Files.createDirectories(jpmsArgs.getParent()); + + Files.write(jpmsArgs, jpmsLines, Charset.defaultCharset()); + } catch (IOException e) { + getLog().warn(e.getMessage()); } } - // ---------------------------------------------------------------------- // Compile! // ---------------------------------------------------------------------- - if ( StringUtils.isEmpty( compilerConfiguration.getSourceEncoding() ) ) - { - getLog().warn( "File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING - + ", i.e. build is platform dependent!" ); + if (StringUtils.isEmpty(compilerConfiguration.getSourceEncoding())) { + getLog().warn("File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING + + ", i.e. build is platform dependent!"); } CompilerResult compilerResult; + if (useIncrementalCompilation) { + incrementalBuildHelperRequest.outputDirectory(getOutputDirectory()); - if ( useIncrementalCompilation ) - { - incrementalBuildHelperRequest.outputDirectory( getOutputDirectory() ); - - incrementalBuildHelper.beforeRebuildExecution( incrementalBuildHelperRequest ); + incrementalBuildHelper.beforeRebuildExecution(incrementalBuildHelperRequest); - getLog().debug( "incrementalBuildHelper#beforeRebuildExecution" ); + getLog().debug("incrementalBuildHelper#beforeRebuildExecution"); } - try - { - compilerResult = compiler.performCompile( compilerConfiguration ); - } - catch ( Exception e ) - { + try { + compilerResult = compiler.performCompile(compilerConfiguration); + } catch (Exception e) { // TODO: don't catch Exception - throw new MojoExecutionException( "Fatal error compiling", e ); + throw new MojoExecutionException("Fatal error compiling", e); } - if ( createMissingPackageInfoClass && compilerResult.isSuccess() - && compiler.getCompilerOutputStyle() == CompilerOutputStyle.ONE_OUTPUT_FILE_PER_INPUT_FILE ) - { - try - { - SourceMapping sourceMapping = getSourceMapping( compilerConfiguration, compiler ); - createMissingPackageInfoClasses( compilerConfiguration, sourceMapping, sources ); - } - catch ( Exception e ) - { - getLog().warn( "Error creating missing package info classes", e ); - + if (createMissingPackageInfoClass + && compilerResult.isSuccess() + && compiler.getCompilerOutputStyle() == CompilerOutputStyle.ONE_OUTPUT_FILE_PER_INPUT_FILE) { + try { + SourceMapping sourceMapping = getSourceMapping(compilerConfiguration, compiler); + createMissingPackageInfoClasses(compilerConfiguration, sourceMapping, sources); + } catch (Exception e) { + getLog().warn("Error creating missing package info classes", e); } } - if ( useIncrementalCompilation ) - { - if ( incrementalBuildHelperRequest.getOutputDirectory().exists() ) - { - getLog().debug( "incrementalBuildHelper#afterRebuildExecution" ); + if (useIncrementalCompilation) { + if (incrementalBuildHelperRequest.getOutputDirectory().exists()) { + getLog().debug("incrementalBuildHelper#afterRebuildExecution"); // now scan the same directory again and create a diff - incrementalBuildHelper.afterRebuildExecution( incrementalBuildHelperRequest ); - } - else - { + incrementalBuildHelper.afterRebuildExecution(incrementalBuildHelperRequest); + } else { getLog().debug( - "skip incrementalBuildHelper#afterRebuildExecution as the output directory doesn't exist" ); + "skip incrementalBuildHelper#afterRebuildExecution as the output directory doesn't exist"); } } List warnings = new ArrayList<>(); List errors = new ArrayList<>(); List others = new ArrayList<>(); - for ( CompilerMessage message : compilerResult.getCompilerMessages() ) - { - if ( message.getKind() == CompilerMessage.Kind.ERROR ) - { - errors.add( message ); - } - else if ( message.getKind() == CompilerMessage.Kind.WARNING - || message.getKind() == CompilerMessage.Kind.MANDATORY_WARNING ) - { - warnings.add( message ); - } - else - { - others.add( message ); + for (CompilerMessage message : compilerResult.getCompilerMessages()) { + if (message.getKind() == CompilerMessage.Kind.ERROR) { + errors.add(message); + } else if (message.getKind() == CompilerMessage.Kind.WARNING + || message.getKind() == CompilerMessage.Kind.MANDATORY_WARNING) { + warnings.add(message); + } else { + others.add(message); } } - if ( failOnError && !compilerResult.isSuccess() ) - { - for ( CompilerMessage message : others ) - { + if (failOnError && !compilerResult.isSuccess()) { + for (CompilerMessage message : others) { assert message.getKind() != CompilerMessage.Kind.ERROR - && message.getKind() != CompilerMessage.Kind.WARNING - && message.getKind() != CompilerMessage.Kind.MANDATORY_WARNING; - getLog().info( message.toString() ); + && message.getKind() != CompilerMessage.Kind.WARNING + && message.getKind() != CompilerMessage.Kind.MANDATORY_WARNING; + getLog().info(message.toString()); } - if ( !warnings.isEmpty() ) - { - getLog().info( "-------------------------------------------------------------" ); - getLog().warn( "COMPILATION WARNING : " ); - getLog().info( "-------------------------------------------------------------" ); - for ( CompilerMessage warning : warnings ) - { - getLog().warn( warning.toString() ); + if (!warnings.isEmpty()) { + getLog().info("-------------------------------------------------------------"); + getLog().warn("COMPILATION WARNING : "); + getLog().info("-------------------------------------------------------------"); + for (CompilerMessage warning : warnings) { + getLog().warn(warning.toString()); } - getLog().info( warnings.size() + ( ( warnings.size() > 1 ) ? " warnings " : " warning" ) ); - getLog().info( "-------------------------------------------------------------" ); + getLog().info(warnings.size() + ((warnings.size() > 1) ? " warnings " : " warning")); + getLog().info("-------------------------------------------------------------"); } - if ( !errors.isEmpty() ) - { - getLog().info( "-------------------------------------------------------------" ); - getLog().error( "COMPILATION ERROR : " ); - getLog().info( "-------------------------------------------------------------" ); - for ( CompilerMessage error : errors ) - { - getLog().error( error.toString() ); + if (!errors.isEmpty()) { + getLog().info("-------------------------------------------------------------"); + getLog().error("COMPILATION ERROR : "); + getLog().info("-------------------------------------------------------------"); + for (CompilerMessage error : errors) { + getLog().error(error.toString()); } - getLog().info( errors.size() + ( ( errors.size() > 1 ) ? " errors " : " error" ) ); - getLog().info( "-------------------------------------------------------------" ); + getLog().info(errors.size() + ((errors.size() > 1) ? " errors " : " error")); + getLog().info("-------------------------------------------------------------"); } - if ( !errors.isEmpty() ) - { - throw new CompilationFailureException( errors ); - } - else - { - throw new CompilationFailureException( warnings ); + if (!errors.isEmpty()) { + throw new CompilationFailureException(errors); + } else { + throw new CompilationFailureException(warnings); } - } - else - { - for ( CompilerMessage message : compilerResult.getCompilerMessages() ) - { - switch ( message.getKind() ) - { + } else { + for (CompilerMessage message : compilerResult.getCompilerMessages()) { + switch (message.getKind()) { case NOTE: case OTHER: - getLog().info( message.toString() ); + getLog().info(message.toString()); break; case ERROR: - getLog().error( message.toString() ); + getLog().error(message.toString()); break; case MANDATORY_WARNING: case WARNING: default: - getLog().warn( message.toString() ); + getLog().warn(message.toString()); break; } } } } - private void createMissingPackageInfoClasses( CompilerConfiguration compilerConfiguration, - SourceMapping sourceMapping, - Set sources ) - throws InclusionScanException, IOException - { - for ( File source : sources ) - { + private void createMissingPackageInfoClasses( + CompilerConfiguration compilerConfiguration, SourceMapping sourceMapping, Set sources) + throws InclusionScanException, IOException { + for (File source : sources) { String path = source.toString(); - if ( path.endsWith( File.separator + "package-info.java" ) ) - { - for ( String root : getCompileSourceRoots() ) - { + if (path.endsWith(File.separator + "package-info.java")) { + for (String root : getCompileSourceRoots()) { root = root + File.separator; - if ( path.startsWith( root ) ) - { - String rel = path.substring( root.length() ); - Set files = sourceMapping.getTargetFiles( getOutputDirectory(), rel ); - for ( File file : files ) - { - if ( !file.exists() ) - { + if (path.startsWith(root)) { + String rel = path.substring(root.length()); + Set files = sourceMapping.getTargetFiles(getOutputDirectory(), rel); + for (File file : files) { + if (!file.exists()) { File parentFile = file.getParentFile(); - - if ( !parentFile.exists() ) - { - Files.createDirectories( parentFile.toPath() ); + + if (!parentFile.exists()) { + Files.createDirectories(parentFile.toPath()); } - - byte[] bytes = generatePackage( compilerConfiguration, rel ); - Files.write( file.toPath(), bytes ); + + byte[] bytes = generatePackage(compilerConfiguration, rel); + Files.write(file.toPath(), bytes); } } } @@ -1414,89 +1254,78 @@ private void createMissingPackageInfoClasses( CompilerConfiguration compilerConf } } - private byte[] generatePackage( CompilerConfiguration compilerConfiguration, String javaFile ) - { - int version = getOpcode( compilerConfiguration ); - String internalPackageName = javaFile.substring( 0, javaFile.length() - ".java".length() ); - if ( File.separatorChar != '/' ) - { - internalPackageName = internalPackageName.replace( File.separatorChar, '/' ); + private byte[] generatePackage(CompilerConfiguration compilerConfiguration, String javaFile) { + int version = getOpcode(compilerConfiguration); + String internalPackageName = javaFile.substring(0, javaFile.length() - ".java".length()); + if (File.separatorChar != '/') { + internalPackageName = internalPackageName.replace(File.separatorChar, '/'); } - ClassWriter cw = new ClassWriter( 0 ); - cw.visit( version, + ClassWriter cw = new ClassWriter(0); + cw.visit( + version, Opcodes.ACC_SYNTHETIC | Opcodes.ACC_ABSTRACT | Opcodes.ACC_INTERFACE, - internalPackageName, null, "java/lang/Object", null ); - cw.visitSource( "package-info.java", null ); + internalPackageName, + null, + "java/lang/Object", + null); + cw.visitSource("package-info.java", null); return cw.toByteArray(); } - private int getOpcode( CompilerConfiguration compilerConfiguration ) - { + private int getOpcode(CompilerConfiguration compilerConfiguration) { String version = compilerConfiguration.getReleaseVersion(); - if ( version == null ) - { + if (version == null) { version = compilerConfiguration.getTargetVersion(); - if ( version == null ) - { + if (version == null) { version = "1.5"; } } - if ( version.startsWith( "1." ) ) - { - version = version.substring( 2 ); + if (version.startsWith("1.")) { + version = version.substring(2); } - int iVersion = Integer.parseInt( version ); - if ( iVersion < 2 ) - { - throw new IllegalArgumentException( "Unsupported java version '" + version + "'" ); + int iVersion = Integer.parseInt(version); + if (iVersion < 2) { + throw new IllegalArgumentException("Unsupported java version '" + version + "'"); } return iVersion - 2 + Opcodes.V1_2; } - protected boolean isTestCompile() - { + protected boolean isTestCompile() { return false; } /** * @return all source files for the compiler */ - private Set getCompileSources( Compiler compiler, CompilerConfiguration compilerConfiguration ) - throws MojoExecutionException, CompilerException - { - String inputFileEnding = compiler.getInputFileEnding( compilerConfiguration ); - if ( StringUtils.isEmpty( inputFileEnding ) ) - { + private Set getCompileSources(Compiler compiler, CompilerConfiguration compilerConfiguration) + throws MojoExecutionException, CompilerException { + String inputFileEnding = compiler.getInputFileEnding(compilerConfiguration); + if (StringUtils.isEmpty(inputFileEnding)) { // see MCOMPILER-199 GroovyEclipseCompiler doesn't set inputFileEnding // so we can presume it's all files from the source directory inputFileEnding = ".*"; } - SourceInclusionScanner scanner = getSourceInclusionScanner( inputFileEnding ); + SourceInclusionScanner scanner = getSourceInclusionScanner(inputFileEnding); - SourceMapping mapping = getSourceMapping( compilerConfiguration, compiler ); + SourceMapping mapping = getSourceMapping(compilerConfiguration, compiler); - scanner.addSourceMapping( mapping ); + scanner.addSourceMapping(mapping); Set compileSources = new HashSet<>(); - for ( String sourceRoot : getCompileSourceRoots() ) - { - File rootFile = new File( sourceRoot ); + for (String sourceRoot : getCompileSourceRoots()) { + File rootFile = new File(sourceRoot); - if ( !rootFile.isDirectory() - || rootFile.getAbsoluteFile().equals( compilerConfiguration.getGeneratedSourcesDirectory() ) ) - { + if (!rootFile.isDirectory() + || rootFile.getAbsoluteFile().equals(compilerConfiguration.getGeneratedSourcesDirectory())) { continue; } - try - { - compileSources.addAll( scanner.getIncludedSources( rootFile, null ) ); - } - catch ( InclusionScanException e ) - { + try { + compileSources.addAll(scanner.getIncludedSources(rootFile, null)); + } catch (InclusionScanException e) { throw new MojoExecutionException( - "Error scanning source root: '" + sourceRoot + "' for stale files to recompile.", e ); + "Error scanning source root: '" + sourceRoot + "' for stale files to recompile.", e); } } @@ -1512,181 +1341,145 @@ private Set getCompileSources( Compiler compiler, CompilerConfiguration co * @param compiler * @return true if at least a single source file is newer than it's class file */ - private boolean isSourceChanged( CompilerConfiguration compilerConfiguration, Compiler compiler ) - throws CompilerException, MojoExecutionException - { + private boolean isSourceChanged(CompilerConfiguration compilerConfiguration, Compiler compiler) + throws CompilerException, MojoExecutionException { Set staleSources = - computeStaleSources( compilerConfiguration, compiler, getSourceInclusionScanner( staleMillis ) ); - - if ( getLog().isDebugEnabled() || showCompilationChanges ) - { - for ( File f : staleSources ) - { - if ( showCompilationChanges ) - { - getLog().info( "Stale source detected: " + f.getAbsolutePath() ); - } - else - { - getLog().debug( "Stale source detected: " + f.getAbsolutePath() ); + computeStaleSources(compilerConfiguration, compiler, getSourceInclusionScanner(staleMillis)); + + if (getLog().isDebugEnabled() || showCompilationChanges) { + for (File f : staleSources) { + if (showCompilationChanges) { + getLog().info("Stale source detected: " + f.getAbsolutePath()); + } else { + getLog().debug("Stale source detected: " + f.getAbsolutePath()); } } } return !staleSources.isEmpty(); } - /** * try to get thread count if a Maven 3 build, using reflection as the plugin must not be maven3 api dependent * * @return number of thread for this build or 1 if not multi-thread build */ - protected int getRequestThreadCount() - { + protected int getRequestThreadCount() { return session.getRequest().getDegreeOfConcurrency(); } - protected Date getBuildStartTime() - { + protected Date getBuildStartTime() { MavenExecutionRequest request = session.getRequest(); Date buildStartTime = request == null ? new Date() : request.getStartTime(); return buildStartTime == null ? new Date() : buildStartTime; } - - private String getMemoryValue( String setting ) - { + private String getMemoryValue(String setting) { String value = null; // Allow '128' or '128m' - if ( isDigits( setting ) ) - { + if (isDigits(setting)) { value = setting + "m"; - } - else if ( ( isDigits( setting.substring( 0, setting.length() - 1 ) ) ) - && ( setting.toLowerCase().endsWith( "m" ) ) ) - { + } else if ((isDigits(setting.substring(0, setting.length() - 1))) + && (setting.toLowerCase().endsWith("m"))) { value = setting; } return value; } - //TODO remove the part with ToolchainManager lookup once we depend on - //3.0.9 (have it as prerequisite). Define as regular component field then. - protected final Toolchain getToolchain() - { + // TODO remove the part with ToolchainManager lookup once we depend on + // 3.0.9 (have it as prerequisite). Define as regular component field then. + protected final Toolchain getToolchain() { Toolchain tc = null; - - if ( jdkToolchain != null ) - { + + if (jdkToolchain != null) { // Maven 3.3.1 has plugin execution scoped Toolchain Support - try - { - Method getToolchainsMethod = - toolchainManager.getClass().getMethod( "getToolchains", MavenSession.class, String.class, - Map.class ); + try { + Method getToolchainsMethod = toolchainManager + .getClass() + .getMethod("getToolchains", MavenSession.class, String.class, Map.class); - @SuppressWarnings( "unchecked" ) + @SuppressWarnings("unchecked") List tcs = - (List) getToolchainsMethod.invoke( toolchainManager, session, "jdk", - jdkToolchain ); + (List) getToolchainsMethod.invoke(toolchainManager, session, "jdk", jdkToolchain); - if ( tcs != null && !tcs.isEmpty() ) - { - tc = tcs.get( 0 ); + if (tcs != null && !tcs.isEmpty()) { + tc = tcs.get(0); } - } - catch ( NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException - | InvocationTargetException e ) - { + } catch (NoSuchMethodException + | SecurityException + | IllegalAccessException + | IllegalArgumentException + | InvocationTargetException e) { // ignore } } - - if ( tc == null ) - { - tc = toolchainManager.getToolchainFromBuildContext( "jdk", session ); + + if (tc == null) { + tc = toolchainManager.getToolchainFromBuildContext("jdk", session); } - + return tc; } - private boolean isDigits( String string ) - { - for ( int i = 0; i < string.length(); i++ ) - { - if ( !Character.isDigit( string.charAt( i ) ) ) - { + private boolean isDigits(String string) { + for (int i = 0; i < string.length(); i++) { + if (!Character.isDigit(string.charAt(i))) { return false; } } return true; } - private Set computeStaleSources( CompilerConfiguration compilerConfiguration, Compiler compiler, - SourceInclusionScanner scanner ) - throws MojoExecutionException, CompilerException - { - SourceMapping mapping = getSourceMapping( compilerConfiguration, compiler ); + private Set computeStaleSources( + CompilerConfiguration compilerConfiguration, Compiler compiler, SourceInclusionScanner scanner) + throws MojoExecutionException, CompilerException { + SourceMapping mapping = getSourceMapping(compilerConfiguration, compiler); File outputDirectory; CompilerOutputStyle outputStyle = compiler.getCompilerOutputStyle(); - if ( outputStyle == CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES ) - { + if (outputStyle == CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES) { outputDirectory = buildDirectory; - } - else - { + } else { outputDirectory = getOutputDirectory(); } - scanner.addSourceMapping( mapping ); + scanner.addSourceMapping(mapping); Set staleSources = new HashSet<>(); - for ( String sourceRoot : getCompileSourceRoots() ) - { - File rootFile = new File( sourceRoot ); + for (String sourceRoot : getCompileSourceRoots()) { + File rootFile = new File(sourceRoot); - if ( !rootFile.isDirectory() ) - { + if (!rootFile.isDirectory()) { continue; } - try - { - staleSources.addAll( scanner.getIncludedSources( rootFile, outputDirectory ) ); - } - catch ( InclusionScanException e ) - { + try { + staleSources.addAll(scanner.getIncludedSources(rootFile, outputDirectory)); + } catch (InclusionScanException e) { throw new MojoExecutionException( - "Error scanning source root: \'" + sourceRoot + "\' for stale files to recompile.", e ); + "Error scanning source root: \'" + sourceRoot + "\' for stale files to recompile.", e); } } return staleSources; } - private SourceMapping getSourceMapping( CompilerConfiguration compilerConfiguration, Compiler compiler ) - throws CompilerException, MojoExecutionException - { + private SourceMapping getSourceMapping(CompilerConfiguration compilerConfiguration, Compiler compiler) + throws CompilerException, MojoExecutionException { CompilerOutputStyle outputStyle = compiler.getCompilerOutputStyle(); SourceMapping mapping; - if ( outputStyle == CompilerOutputStyle.ONE_OUTPUT_FILE_PER_INPUT_FILE ) - { - mapping = new SuffixMapping( compiler.getInputFileEnding( compilerConfiguration ), - compiler.getOutputFileEnding( compilerConfiguration ) ); - } - else if ( outputStyle == CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES ) - { - mapping = new SingleTargetSourceMapping( compiler.getInputFileEnding( compilerConfiguration ), - compiler.getOutputFile( compilerConfiguration ) ); + if (outputStyle == CompilerOutputStyle.ONE_OUTPUT_FILE_PER_INPUT_FILE) { + mapping = new SuffixMapping( + compiler.getInputFileEnding(compilerConfiguration), + compiler.getOutputFileEnding(compilerConfiguration)); + } else if (outputStyle == CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES) { + mapping = new SingleTargetSourceMapping( + compiler.getInputFileEnding(compilerConfiguration), compiler.getOutputFile(compilerConfiguration)); - } - else - { - throw new MojoExecutionException( "Unknown compiler output style: '" + outputStyle + "'." ); + } else { + throw new MojoExecutionException("Unknown compiler output style: '" + outputStyle + "'."); } return mapping; } @@ -1695,17 +1488,13 @@ else if ( outputStyle == CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES * @todo also in ant plugin. This should be resolved at some point so that it does not need to * be calculated continuously - or should the plugins accept empty source roots as is? */ - private static List removeEmptyCompileSourceRoots( List compileSourceRootsList ) - { + private static List removeEmptyCompileSourceRoots(List compileSourceRootsList) { List newCompileSourceRootsList = new ArrayList<>(); - if ( compileSourceRootsList != null ) - { + if (compileSourceRootsList != null) { // copy as I may be modifying it - for ( String srcDir : compileSourceRootsList ) - { - if ( !newCompileSourceRootsList.contains( srcDir ) && new File( srcDir ).exists() ) - { - newCompileSourceRootsList.add( srcDir ); + for (String srcDir : compileSourceRootsList) { + if (!newCompileSourceRootsList.contains(srcDir) && new File(srcDir).exists()) { + newCompileSourceRootsList.add(srcDir); } } } @@ -1719,40 +1508,31 @@ private static List removeEmptyCompileSourceRoots( List compileS * * @return true if at least one single dependency has changed. */ - protected boolean isDependencyChanged() - { - if ( session == null ) - { + protected boolean isDependencyChanged() { + if (session == null) { // we just cannot determine it, so don't do anything beside logging - getLog().info( "Cannot determine build start date, skipping incremental build detection." ); + getLog().info("Cannot determine build start date, skipping incremental build detection."); return false; } - if ( fileExtensions == null || fileExtensions.isEmpty() ) - { - fileExtensions = Collections.unmodifiableList( Arrays.asList( "class", "jar" ) ); + if (fileExtensions == null || fileExtensions.isEmpty()) { + fileExtensions = Collections.unmodifiableList(Arrays.asList("class", "jar")); } Date buildStartTime = getBuildStartTime(); List pathElements = new ArrayList<>(); - pathElements.addAll( getClasspathElements() ); - pathElements.addAll( getModulepathElements() ); - - for ( String pathElement : pathElements ) - { - File artifactPath = new File( pathElement ); - if ( artifactPath.isDirectory() || artifactPath.isFile() ) - { - if ( hasNewFile( artifactPath, buildStartTime ) ) - { - if ( showCompilationChanges ) - { - getLog().info( "New dependency detected: " + artifactPath.getAbsolutePath() ); - } - else - { - getLog().debug( "New dependency detected: " + artifactPath.getAbsolutePath() ); + pathElements.addAll(getClasspathElements()); + pathElements.addAll(getModulepathElements()); + + for (String pathElement : pathElements) { + File artifactPath = new File(pathElement); + if (artifactPath.isDirectory() || artifactPath.isFile()) { + if (hasNewFile(artifactPath, buildStartTime)) { + if (showCompilationChanges) { + getLog().info("New dependency detected: " + artifactPath.getAbsolutePath()); + } else { + getLog().debug("New dependency detected: " + artifactPath.getAbsolutePath()); } return true; } @@ -1768,25 +1548,20 @@ protected boolean isDependencyChanged() * @param buildStartTime time build start * @return if any changes occurred */ - private boolean hasNewFile( File classPathEntry, Date buildStartTime ) - { - if ( !classPathEntry.exists() ) - { + private boolean hasNewFile(File classPathEntry, Date buildStartTime) { + if (!classPathEntry.exists()) { return false; } - if ( classPathEntry.isFile() ) - { + if (classPathEntry.isFile()) { return classPathEntry.lastModified() >= buildStartTime.getTime() - && fileExtensions.contains( FileUtils.getExtension( classPathEntry.getName() ) ); + && fileExtensions.contains(FileUtils.getExtension(classPathEntry.getName())); } File[] children = classPathEntry.listFiles(); - for ( File child : children ) - { - if ( hasNewFile( child, buildStartTime ) ) - { + for (File child : children) { + if (hasNewFile(child, buildStartTime)) { return true; } } @@ -1794,168 +1569,134 @@ private boolean hasNewFile( File classPathEntry, Date buildStartTime ) return false; } - private List resolveProcessorPathEntries() - throws MojoExecutionException - { - if ( annotationProcessorPaths == null || annotationProcessorPaths.isEmpty() ) - { + private List resolveProcessorPathEntries() throws MojoExecutionException { + if (annotationProcessorPaths == null || annotationProcessorPaths.isEmpty()) { return null; } Set elements = new LinkedHashSet<>(); - try - { - List dependencies = convertToDependencies( annotationProcessorPaths ); - CollectRequest collectRequest = new CollectRequest( dependencies, Collections.emptyList(), - project.getRemoteProjectRepositories() ); + try { + List dependencies = convertToDependencies(annotationProcessorPaths); + CollectRequest collectRequest = + new CollectRequest(dependencies, Collections.emptyList(), project.getRemoteProjectRepositories()); DependencyRequest dependencyRequest = new DependencyRequest(); - dependencyRequest.setCollectRequest( collectRequest ); - DependencyResult dependencyResult = repositorySystem.resolveDependencies( - session.getRepositorySession(), dependencyRequest ); + dependencyRequest.setCollectRequest(collectRequest); + DependencyResult dependencyResult = + repositorySystem.resolveDependencies(session.getRepositorySession(), dependencyRequest); - for ( ArtifactResult resolved : dependencyResult.getArtifactResults() ) - { - elements.add( resolved.getArtifact().getFile().getAbsolutePath() ); + for (ArtifactResult resolved : dependencyResult.getArtifactResults()) { + elements.add(resolved.getArtifact().getFile().getAbsolutePath()); } - return new ArrayList<>( elements ); - } - catch ( Exception e ) - { - throw new MojoExecutionException( "Resolution of annotationProcessorPath dependencies failed: " - + e.getLocalizedMessage(), e ); + return new ArrayList<>(elements); + } catch (Exception e) { + throw new MojoExecutionException( + "Resolution of annotationProcessorPath dependencies failed: " + e.getLocalizedMessage(), e); } } - private List convertToDependencies( List annotationProcessorPaths ) - { + private List convertToDependencies(List annotationProcessorPaths) { List dependencies = new ArrayList<>(); - for ( DependencyCoordinate annotationProcessorPath : annotationProcessorPaths ) - { - ArtifactHandler handler = artifactHandlerManager.getArtifactHandler( annotationProcessorPath.getType() ); + for (DependencyCoordinate annotationProcessorPath : annotationProcessorPaths) { + ArtifactHandler handler = artifactHandlerManager.getArtifactHandler(annotationProcessorPath.getType()); Artifact artifact = new DefaultArtifact( annotationProcessorPath.getGroupId(), annotationProcessorPath.getArtifactId(), annotationProcessorPath.getClassifier(), handler.getExtension(), - annotationProcessorPath.getVersion() ); - dependencies.add( new Dependency( artifact, JavaScopes.RUNTIME ) ); + annotationProcessorPath.getVersion()); + dependencies.add(new Dependency(artifact, JavaScopes.RUNTIME)); } return dependencies; } - private void writePlugin( MessageBuilder mb ) - { - mb.a( " " ).newline(); - mb.a( " org.apache.maven.plugins" ).newline(); - mb.a( " maven-compiler-plugin" ).newline(); - + private void writePlugin(MessageBuilder mb) { + mb.a(" ").newline(); + mb.a(" org.apache.maven.plugins").newline(); + mb.a(" maven-compiler-plugin").newline(); + String version = getMavenCompilerPluginVersion(); - if ( version != null ) - { - mb.a( " " ).a( version ).a( "" ).newline(); + if (version != null) { + mb.a(" ").a(version).a("").newline(); } - writeConfig( mb ); - - mb.a( " " ).newline(); + writeConfig(mb); + + mb.a(" ").newline(); } - private void writeConfig( MessageBuilder mb ) - { - mb.a( " " ).newline(); + private void writeConfig(MessageBuilder mb) { + mb.a(" ").newline(); - if ( release != null ) - { - mb.a( " " ).a( release ).a( "" ).newline(); - } - else if ( JavaVersion.JAVA_VERSION.isAtLeast( "9" ) ) - { - String rls = target.replaceAll( ".\\.", "" ); + if (release != null) { + mb.a(" ").a(release).a("").newline(); + } else if (JavaVersion.JAVA_VERSION.isAtLeast("9")) { + String rls = target.replaceAll(".\\.", ""); // when using Java9+, motivate to use release instead of source/target - mb.a( " " ).a( rls ).a( "" ).newline(); - } - else - { - mb.a( " " ).a( source ).a( "" ).newline(); - mb.a( " " ).a( target ).a( "" ).newline(); + mb.a(" ").a(rls).a("").newline(); + } else { + mb.a(" ").a(source).a("").newline(); + mb.a(" ").a(target).a("").newline(); } - mb.a( " " ).newline(); + mb.a(" ").newline(); } - private String getMavenCompilerPluginVersion() - { + private String getMavenCompilerPluginVersion() { Properties pomProperties = new Properties(); - try ( InputStream is = AbstractCompilerMojo.class - .getResourceAsStream( "/META-INF/maven/org.apache.maven.plugins/maven-compiler-plugin/pom.properties" ) ) - { - if ( is != null ) - { - pomProperties.load( is ); + try (InputStream is = AbstractCompilerMojo.class.getResourceAsStream( + "/META-INF/maven/org.apache.maven.plugins/maven-compiler-plugin/pom.properties")) { + if (is != null) { + pomProperties.load(is); } - } - catch ( IOException e ) - { + } catch (IOException e) { // noop } - return pomProperties.getProperty( "version" ); + return pomProperties.getProperty("version"); } - private DirectoryScanResult computeInputFileTreeChanges( IncrementalBuildHelper ibh, Set inputFiles ) - throws MojoExecutionException - { + private DirectoryScanResult computeInputFileTreeChanges(IncrementalBuildHelper ibh, Set inputFiles) + throws MojoExecutionException { File mojoConfigBase = ibh.getMojoStatusDirectory(); - File mojoConfigFile = new File( mojoConfigBase, INPUT_FILES_LST_FILENAME ); + File mojoConfigFile = new File(mojoConfigBase, INPUT_FILES_LST_FILENAME); String[] oldInputFiles = new String[0]; - if ( mojoConfigFile.exists() ) - { - try - { - oldInputFiles = FileUtils.fileReadArray( mojoConfigFile ); - } - catch ( IOException e ) - { - throw new MojoExecutionException( "Error reading old mojo status " + mojoConfigFile, e ); + if (mojoConfigFile.exists()) { + try { + oldInputFiles = FileUtils.fileReadArray(mojoConfigFile); + } catch (IOException e) { + throw new MojoExecutionException("Error reading old mojo status " + mojoConfigFile, e); } } - String[] inputFileNames = inputFiles.stream().map( File::getAbsolutePath ).toArray( String[]::new ); + String[] inputFileNames = inputFiles.stream().map(File::getAbsolutePath).toArray(String[]::new); - DirectoryScanResult dsr = DirectoryScanner.diffFiles( oldInputFiles, inputFileNames ); + DirectoryScanResult dsr = DirectoryScanner.diffFiles(oldInputFiles, inputFileNames); - try - { - FileUtils.fileWriteArray( mojoConfigFile, inputFileNames ); - } - catch ( IOException e ) - { - throw new MojoExecutionException( "Error while storing the mojo status", e ); + try { + FileUtils.fileWriteArray(mojoConfigFile, inputFileNames); + } catch (IOException e) { + throw new MojoExecutionException("Error while storing the mojo status", e); } return dsr; } - private boolean hasInputFileTreeChanged( DirectoryScanResult dsr ) - { - return ( dsr.getFilesAdded().length > 0 || dsr.getFilesRemoved().length > 0 ); + private boolean hasInputFileTreeChanged(DirectoryScanResult dsr) { + return (dsr.getFilesAdded().length > 0 || dsr.getFilesRemoved().length > 0); } - public void setTarget( String target ) - { + public void setTarget(String target) { this.target = target; targetOrReleaseSet = true; } - public void setRelease( String release ) - { + public void setRelease(String release) { this.release = release; targetOrReleaseSet = true; } - final String getImplicit() - { + final String getImplicit() { return implicit; } } diff --git a/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java b/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java index 4d624540..fa55b16e 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java +++ b/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugin.compiler; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,21 +16,20 @@ * specific language governing permissions and limitations * under the License. */ +package org.apache.maven.plugin.compiler; + +import java.util.List; import org.apache.maven.plugin.MojoFailureException; import org.codehaus.plexus.compiler.CompilerMessage; -import java.util.List; - /** * @author Jason van Zyl * @since 2.0 */ -@SuppressWarnings( "serial" ) -public class CompilationFailureException - extends MojoFailureException -{ - private static final String LS = System.getProperty( "line.separator" ); +@SuppressWarnings("serial") +public class CompilationFailureException extends MojoFailureException { + private static final String LS = System.getProperty("line.separator"); /** * Wrap error messages from the compiler @@ -40,9 +37,8 @@ public class CompilationFailureException * @param messages the messages, not null * @since 2.0 */ - public CompilationFailureException( List messages ) - { - super( null, shortMessage( messages ), longMessage( messages ) ); + public CompilationFailureException(List messages) { + super(null, shortMessage(messages), longMessage(messages)); } /** @@ -52,13 +48,11 @@ public CompilationFailureException( List messages ) * @return the long error message * @since 2.0 */ - public static String longMessage( List messages ) - { + public static String longMessage(List messages) { StringBuilder sb = new StringBuilder(); - for ( CompilerMessage compilerError : messages ) - { - sb.append( compilerError ).append( LS ); + for (CompilerMessage compilerError : messages) { + sb.append(compilerError).append(LS); } return sb.toString(); @@ -71,13 +65,11 @@ public static String longMessage( List messages ) * @return the short error message * @since 2.0.2 */ - public static String shortMessage( List messages ) - { - StringBuilder sb = new StringBuilder( "Compilation failure" ); + public static String shortMessage(List messages) { + StringBuilder sb = new StringBuilder("Compilation failure"); - if ( messages.size() == 1 ) - { - sb.append( LS ).append( messages.get( 0 ) ).append( LS ); + if (messages.size() == 1) { + sb.append(LS).append(messages.get(0)).append(LS); } return sb.toString(); diff --git a/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java index e7efa7f1..228643e4 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java +++ b/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugin.compiler; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package org.apache.maven.plugin.compiler; import java.io.File; import java.io.IOException; @@ -28,8 +27,8 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.Map.Entry; +import java.util.Set; import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.MojoExecutionException; @@ -57,21 +56,22 @@ * @author Jason van Zyl * @since 2.0 */ -@Mojo( name = "compile", defaultPhase = LifecyclePhase.COMPILE, threadSafe = true, - requiresDependencyResolution = ResolutionScope.COMPILE ) -public class CompilerMojo - extends AbstractCompilerMojo -{ +@Mojo( + name = "compile", + defaultPhase = LifecyclePhase.COMPILE, + threadSafe = true, + requiresDependencyResolution = ResolutionScope.COMPILE) +public class CompilerMojo extends AbstractCompilerMojo { /** * The source directories containing the sources to be compiled. */ - @Parameter( defaultValue = "${project.compileSourceRoots}", readonly = false, required = true ) + @Parameter(defaultValue = "${project.compileSourceRoots}", readonly = false, required = true) private List compileSourceRoots; /** * The directory for compiled classes. */ - @Parameter( defaultValue = "${project.build.outputDirectory}", required = true, readonly = true ) + @Parameter(defaultValue = "${project.build.outputDirectory}", required = true, readonly = true) private File outputDirectory; /** @@ -79,7 +79,7 @@ public class CompilerMojo * * @todo this is an export variable, really */ - @Parameter( defaultValue = "${project.artifact}", readonly = true, required = true ) + @Parameter(defaultValue = "${project.artifact}", readonly = true, required = true) private Artifact projectArtifact; /** @@ -108,17 +108,17 @@ public class CompilerMojo * * @since 2.2 */ - @Parameter( defaultValue = "${project.build.directory}/generated-sources/annotations" ) + @Parameter(defaultValue = "${project.build.directory}/generated-sources/annotations") private File generatedSourcesDirectory; /** * Set this to 'true' to bypass compilation of main sources. Its use is NOT RECOMMENDED, but quite convenient on * occasion. */ - @Parameter( property = "maven.main.skip" ) + @Parameter(property = "maven.main.skip") private boolean skipMain; - @Parameter( defaultValue = "${project.compileClasspathElements}", readonly = true, required = true ) + @Parameter(defaultValue = "${project.compileClasspathElements}", readonly = true, required = true) private List compilePath; /** @@ -130,7 +130,7 @@ public class CompilerMojo * Multi-Release: true. You need to set this by configuring the maven-jar-plugin. * This implies that you cannot test a multirelease jar using the outputDirectory. - * + * * @since 3.7.1 */ @Parameter @@ -140,7 +140,7 @@ public class CompilerMojo * when forking and debug activated the commandline used will be dumped in this file * @since 3.10.0 */ - @Parameter( defaultValue = "javac" ) + @Parameter(defaultValue = "javac") private String debugFileName; final LocationManager locationManager = new LocationManager(); @@ -148,326 +148,266 @@ public class CompilerMojo private List classpathElements; private List modulepathElements; - + private Map pathElements; - protected List getCompileSourceRoots() - { + protected List getCompileSourceRoots() { return compileSourceRoots; } @Override - protected List getClasspathElements() - { + protected List getClasspathElements() { return classpathElements; } @Override - protected List getModulepathElements() - { + protected List getModulepathElements() { return modulepathElements; } @Override - protected Map getPathElements() - { + protected Map getPathElements() { return pathElements; } - - protected File getOutputDirectory() - { + + protected File getOutputDirectory() { File dir; - if ( !multiReleaseOutput ) - { + if (!multiReleaseOutput) { dir = outputDirectory; - } - else - { - dir = new File( outputDirectory, "META-INF/versions/" + release ); + } else { + dir = new File(outputDirectory, "META-INF/versions/" + release); } return dir; } - public void execute() - throws MojoExecutionException, CompilationFailureException - { - if ( skipMain ) - { - getLog().info( "Not compiling main sources" ); + public void execute() throws MojoExecutionException, CompilationFailureException { + if (skipMain) { + getLog().info("Not compiling main sources"); return; } - - if ( multiReleaseOutput && release == null ) - { - throw new MojoExecutionException( "When using 'multiReleaseOutput' the release must be set" ); + + if (multiReleaseOutput && release == null) { + throw new MojoExecutionException("When using 'multiReleaseOutput' the release must be set"); } super.execute(); - if ( outputDirectory.isDirectory() ) - { - projectArtifact.setFile( outputDirectory ); + if (outputDirectory.isDirectory()) { + projectArtifact.setFile(outputDirectory); } } @Override - protected Set getIncludes() - { + protected Set getIncludes() { return includes; } @Override - protected Set getExcludes() - { + protected Set getExcludes() { return excludes; } @Override - protected void preparePaths( Set sourceFiles ) - { - //assert compilePath != null; + protected void preparePaths(Set sourceFiles) { + // assert compilePath != null; File moduleDescriptorPath = null; boolean hasModuleDescriptor = false; - for ( File sourceFile : sourceFiles ) - { - if ( "module-info.java".equals( sourceFile.getName() ) ) - { + for (File sourceFile : sourceFiles) { + if ("module-info.java".equals(sourceFile.getName())) { moduleDescriptorPath = sourceFile; hasModuleDescriptor = true; break; } } - if ( hasModuleDescriptor ) - { + if (hasModuleDescriptor) { // For now only allow named modules. Once we can create a graph with ASM we can specify exactly the modules // and we can detect if auto modules are used. In that case, MavenProject.setFile() should not be used, so // you cannot depend on this project and so it won't be distributed. - modulepathElements = new ArrayList<>( compilePath.size() ); - classpathElements = new ArrayList<>( compilePath.size() ); - pathElements = new LinkedHashMap<>( compilePath.size() ); + modulepathElements = new ArrayList<>(compilePath.size()); + classpathElements = new ArrayList<>(compilePath.size()); + pathElements = new LinkedHashMap<>(compilePath.size()); ResolvePathsResult resolvePathsResult; - try - { - Collection dependencyArtifacts = getCompileClasspathElements( getProject() ); - - ResolvePathsRequest request = - ResolvePathsRequest.ofFiles( dependencyArtifacts ) - .setIncludeStatic( true ) - .setMainModuleDescriptor( moduleDescriptorPath ); - + try { + Collection dependencyArtifacts = getCompileClasspathElements(getProject()); + + ResolvePathsRequest request = ResolvePathsRequest.ofFiles(dependencyArtifacts) + .setIncludeStatic(true) + .setMainModuleDescriptor(moduleDescriptorPath); + Toolchain toolchain = getToolchain(); - if ( toolchain instanceof DefaultJavaToolChain ) - { - request.setJdkHome( new File( ( (DefaultJavaToolChain) toolchain ).getJavaHome() ) ); + if (toolchain instanceof DefaultJavaToolChain) { + request.setJdkHome(new File(((DefaultJavaToolChain) toolchain).getJavaHome())); } - resolvePathsResult = locationManager.resolvePaths( request ); - - for ( Entry pathException : resolvePathsResult.getPathExceptions().entrySet() ) - { + resolvePathsResult = locationManager.resolvePaths(request); + + for (Entry pathException : + resolvePathsResult.getPathExceptions().entrySet()) { Throwable cause = pathException.getValue(); - while ( cause.getCause() != null ) - { + while (cause.getCause() != null) { cause = cause.getCause(); } String fileName = pathException.getKey().getName(); - getLog().warn( "Can't extract module name from " + fileName + ": " + cause.getMessage() ); + getLog().warn("Can't extract module name from " + fileName + ": " + cause.getMessage()); } - + JavaModuleDescriptor moduleDescriptor = resolvePathsResult.getMainModuleDescriptor(); - detectFilenameBasedAutomodules( resolvePathsResult, moduleDescriptor ); - - for ( Map.Entry entry : resolvePathsResult.getPathElements().entrySet() ) - { - pathElements.put( entry.getKey().getPath(), entry.getValue() ); + detectFilenameBasedAutomodules(resolvePathsResult, moduleDescriptor); + + for (Map.Entry entry : + resolvePathsResult.getPathElements().entrySet()) { + pathElements.put(entry.getKey().getPath(), entry.getValue()); } - if ( compilerArgs == null ) - { + if (compilerArgs == null) { compilerArgs = new ArrayList<>(); } - for ( File file : resolvePathsResult.getClasspathElements() ) - { - classpathElements.add( file.getPath() ); - - if ( multiReleaseOutput ) - { - if ( getOutputDirectory().toPath().startsWith( file.getPath() ) ) - { - compilerArgs.add( "--patch-module" ); - compilerArgs.add( String.format( "%s=%s", moduleDescriptor.name(), file.getPath() ) ); + for (File file : resolvePathsResult.getClasspathElements()) { + classpathElements.add(file.getPath()); + + if (multiReleaseOutput) { + if (getOutputDirectory().toPath().startsWith(file.getPath())) { + compilerArgs.add("--patch-module"); + compilerArgs.add(String.format("%s=%s", moduleDescriptor.name(), file.getPath())); } } } - - for ( File file : resolvePathsResult.getModulepathElements().keySet() ) - { - modulepathElements.add( file.getPath() ); + + for (File file : resolvePathsResult.getModulepathElements().keySet()) { + modulepathElements.add(file.getPath()); } - - compilerArgs.add( "--module-version" ); - compilerArgs.add( getProject().getVersion() ); - - } - catch ( IOException e ) - { - getLog().warn( e.getMessage() ); + + compilerArgs.add("--module-version"); + compilerArgs.add(getProject().getVersion()); + + } catch (IOException e) { + getLog().warn(e.getMessage()); } - } - else - { + } else { classpathElements = new ArrayList<>(); - for ( File element : getCompileClasspathElements( getProject() ) ) - { - classpathElements.add( element.getPath() ); + for (File element : getCompileClasspathElements(getProject())) { + classpathElements.add(element.getPath()); } modulepathElements = Collections.emptyList(); } } - private void detectFilenameBasedAutomodules( final ResolvePathsResult resolvePathsResult, - final JavaModuleDescriptor moduleDescriptor ) - { + private void detectFilenameBasedAutomodules( + final ResolvePathsResult resolvePathsResult, final JavaModuleDescriptor moduleDescriptor) { List automodulesDetected = new ArrayList<>(); - for ( Entry entry : resolvePathsResult.getModulepathElements().entrySet() ) - { - if ( ModuleNameSource.FILENAME.equals( entry.getValue() ) ) - { - automodulesDetected.add( entry.getKey().getName() ); + for (Entry entry : + resolvePathsResult.getModulepathElements().entrySet()) { + if (ModuleNameSource.FILENAME.equals(entry.getValue())) { + automodulesDetected.add(entry.getKey().getName()); } } - if ( !automodulesDetected.isEmpty() ) - { + if (!automodulesDetected.isEmpty()) { final String message = "Required filename-based automodules detected: " - + automodulesDetected + ". " + + automodulesDetected + ". " + "Please don't publish this project to a public artifact repository!"; - if ( moduleDescriptor.exports().isEmpty() ) - { + if (moduleDescriptor.exports().isEmpty()) { // application - getLog().info( message ); - } - else - { + getLog().info(message); + } else { // library - writeBoxedWarning( message ); + writeBoxedWarning(message); } } } - - private List getCompileClasspathElements( MavenProject project ) - { - // 3 is outputFolder + 2 preserved for multirelease - List list = new ArrayList<>( project.getArtifacts().size() + 3 ); - - if ( multiReleaseOutput ) - { - File versionsFolder = new File( project.getBuild().getOutputDirectory(), "META-INF/versions" ); - + + private List getCompileClasspathElements(MavenProject project) { + // 3 is outputFolder + 2 preserved for multirelease + List list = new ArrayList<>(project.getArtifacts().size() + 3); + + if (multiReleaseOutput) { + File versionsFolder = new File(project.getBuild().getOutputDirectory(), "META-INF/versions"); + // in reverse order - for ( int version = Integer.parseInt( getRelease() ) - 1; version >= 9 ; version-- ) - { - File versionSubFolder = new File( versionsFolder, String.valueOf( version ) ); - if ( versionSubFolder.exists() ) - { - list.add( versionSubFolder ); + for (int version = Integer.parseInt(getRelease()) - 1; version >= 9; version--) { + File versionSubFolder = new File(versionsFolder, String.valueOf(version)); + if (versionSubFolder.exists()) { + list.add(versionSubFolder); } } } - list.add( new File( project.getBuild().getOutputDirectory() ) ); + list.add(new File(project.getBuild().getOutputDirectory())); - for ( Artifact a : project.getArtifacts() ) - { - list.add( a.getFile() ); + for (Artifact a : project.getArtifacts()) { + list.add(a.getFile()); } return list; } - - protected SourceInclusionScanner getSourceInclusionScanner( int staleMillis ) - { - if ( includes.isEmpty() && excludes.isEmpty() && incrementalExcludes.isEmpty() ) - { - return new StaleSourceScanner( staleMillis ); + + protected SourceInclusionScanner getSourceInclusionScanner(int staleMillis) { + if (includes.isEmpty() && excludes.isEmpty() && incrementalExcludes.isEmpty()) { + return new StaleSourceScanner(staleMillis); } - if ( includes.isEmpty() ) - { - includes.add( "**/*.java" ); + if (includes.isEmpty()) { + includes.add("**/*.java"); } - Set excludesIncr = new HashSet<>( excludes ); - excludesIncr.addAll( this.incrementalExcludes ); - return new StaleSourceScanner( staleMillis, includes, excludesIncr ); + Set excludesIncr = new HashSet<>(excludes); + excludesIncr.addAll(this.incrementalExcludes); + return new StaleSourceScanner(staleMillis, includes, excludesIncr); } - protected SourceInclusionScanner getSourceInclusionScanner( String inputFileEnding ) - { + protected SourceInclusionScanner getSourceInclusionScanner(String inputFileEnding) { // it's not defined if we get the ending with or without the dot '.' - String defaultIncludePattern = "**/*" + ( inputFileEnding.startsWith( "." ) ? "" : "." ) + inputFileEnding; + String defaultIncludePattern = "**/*" + (inputFileEnding.startsWith(".") ? "" : ".") + inputFileEnding; - if ( includes.isEmpty() ) - { - includes.add( defaultIncludePattern ); + if (includes.isEmpty()) { + includes.add(defaultIncludePattern); } - Set excludesIncr = new HashSet<>( excludes ); - excludesIncr.addAll( excludesIncr ); - return new SimpleSourceInclusionScanner( includes, excludesIncr ); + Set excludesIncr = new HashSet<>(excludes); + excludesIncr.addAll(excludesIncr); + return new SimpleSourceInclusionScanner(includes, excludesIncr); } - protected String getSource() - { + protected String getSource() { return source; } - protected String getTarget() - { + protected String getTarget() { return target; } @Override - protected String getRelease() - { + protected String getRelease() { return release; } - protected String getCompilerArgument() - { + protected String getCompilerArgument() { return compilerArgument; } - protected Map getCompilerArguments() - { + protected Map getCompilerArguments() { return compilerArguments; } - protected File getGeneratedSourcesDirectory() - { + protected File getGeneratedSourcesDirectory() { return generatedSourcesDirectory; } @Override - protected String getDebugFileName() - { + protected String getDebugFileName() { return debugFileName; } - private void writeBoxedWarning( String message ) - { - String line = StringUtils.repeat( "*", message.length() + 4 ); - getLog().warn( line ); - getLog().warn( "* " + MessageUtils.buffer().strong( message ) + " *" ); - getLog().warn( line ); + private void writeBoxedWarning(String message) { + String line = StringUtils.repeat("*", message.length() + 4); + getLog().warn(line); + getLog().warn("* " + MessageUtils.buffer().strong(message) + " *"); + getLog().warn(line); } - - - } diff --git a/src/main/java/org/apache/maven/plugin/compiler/DependencyCoordinate.java b/src/main/java/org/apache/maven/plugin/compiler/DependencyCoordinate.java index 71f0ce8d..593ca5ef 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/DependencyCoordinate.java +++ b/src/main/java/org/apache/maven/plugin/compiler/DependencyCoordinate.java @@ -1,183 +1,145 @@ -package org.apache.maven.plugin.compiler; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -/** - * Simple representation of Maven-coordinates of a dependency. - * - * @author Andreas Gudian - * @since 3.4 - */ -public class DependencyCoordinate -{ - private String groupId; - - private String artifactId; - - private String version; - - private String classifier; - - private String type = "jar"; - - public String getGroupId() - { - return groupId; - } - - public void setGroupId( String groupId ) - { - this.groupId = groupId; - } - - public String getArtifactId() - { - return artifactId; - } - - public void setArtifactId( String artifactId ) - { - this.artifactId = artifactId; - } - - public String getVersion() - { - return version; - } - - public void setVersion( String version ) - { - this.version = version; - } - - public String getClassifier() - { - return classifier; - } - - public void setClassifier( String classifier ) - { - this.classifier = classifier; - } - - public String getType() - { - return type; - } - - public void setType( String type ) - { - this.type = type; - } - - @Override - public int hashCode() - { - final int prime = 31; - int result = 1; - result = prime * result + ( ( artifactId == null ) ? 0 : artifactId.hashCode() ); - result = prime * result + ( ( classifier == null ) ? 0 : classifier.hashCode() ); - result = prime * result + ( ( groupId == null ) ? 0 : groupId.hashCode() ); - result = prime * result + ( ( type == null ) ? 0 : type.hashCode() ); - result = prime * result + ( ( version == null ) ? 0 : version.hashCode() ); - return result; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - if ( obj == null ) - { - return false; - } - if ( getClass() != obj.getClass() ) - { - return false; - } - DependencyCoordinate other = (DependencyCoordinate) obj; - if ( artifactId == null ) - { - if ( other.artifactId != null ) - { - return false; - } - } - else if ( !artifactId.equals( other.artifactId ) ) - { - return false; - } - if ( classifier == null ) - { - if ( other.classifier != null ) - { - return false; - } - } - else if ( !classifier.equals( other.classifier ) ) - { - return false; - } - if ( groupId == null ) - { - if ( other.groupId != null ) - { - return false; - } - } - else if ( !groupId.equals( other.groupId ) ) - { - return false; - } - if ( type == null ) - { - if ( other.type != null ) - { - return false; - } - } - else if ( !type.equals( other.type ) ) - { - return false; - } - if ( version == null ) - { - if ( other.version != null ) - { - return false; - } - } - else if ( !version.equals( other.version ) ) - { - return false; - } - return true; - } - - @Override - public String toString() - { - return groupId + ":" + artifactId + ( version != null ? ":" + version : "" ) - + ( classifier != null ? ":" + classifier : "" ) + ( type != null ? "." + type : "" ); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.apache.maven.plugin.compiler; + +/** + * Simple representation of Maven-coordinates of a dependency. + * + * @author Andreas Gudian + * @since 3.4 + */ +public class DependencyCoordinate { + private String groupId; + + private String artifactId; + + private String version; + + private String classifier; + + private String type = "jar"; + + public String getGroupId() { + return groupId; + } + + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + public String getArtifactId() { + return artifactId; + } + + public void setArtifactId(String artifactId) { + this.artifactId = artifactId; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getClassifier() { + return classifier; + } + + public void setClassifier(String classifier) { + this.classifier = classifier; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((artifactId == null) ? 0 : artifactId.hashCode()); + result = prime * result + ((classifier == null) ? 0 : classifier.hashCode()); + result = prime * result + ((groupId == null) ? 0 : groupId.hashCode()); + result = prime * result + ((type == null) ? 0 : type.hashCode()); + result = prime * result + ((version == null) ? 0 : version.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + DependencyCoordinate other = (DependencyCoordinate) obj; + if (artifactId == null) { + if (other.artifactId != null) { + return false; + } + } else if (!artifactId.equals(other.artifactId)) { + return false; + } + if (classifier == null) { + if (other.classifier != null) { + return false; + } + } else if (!classifier.equals(other.classifier)) { + return false; + } + if (groupId == null) { + if (other.groupId != null) { + return false; + } + } else if (!groupId.equals(other.groupId)) { + return false; + } + if (type == null) { + if (other.type != null) { + return false; + } + } else if (!type.equals(other.type)) { + return false; + } + if (version == null) { + if (other.version != null) { + return false; + } + } else if (!version.equals(other.version)) { + return false; + } + return true; + } + + @Override + public String toString() { + return groupId + ":" + artifactId + (version != null ? ":" + version : "") + + (classifier != null ? ":" + classifier : "") + (type != null ? "." + type : ""); + } +} diff --git a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java index 1c854fa6..4bbdc7e0 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java +++ b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugin.compiler; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +package org.apache.maven.plugin.compiler; import java.io.File; import java.io.IOException; @@ -55,28 +54,29 @@ * @author Jason van Zyl * @since 2.0 */ -@Mojo( name = "testCompile", defaultPhase = LifecyclePhase.TEST_COMPILE, threadSafe = true, - requiresDependencyResolution = ResolutionScope.TEST ) -public class TestCompilerMojo - extends AbstractCompilerMojo -{ +@Mojo( + name = "testCompile", + defaultPhase = LifecyclePhase.TEST_COMPILE, + threadSafe = true, + requiresDependencyResolution = ResolutionScope.TEST) +public class TestCompilerMojo extends AbstractCompilerMojo { /** * Set this to 'true' to bypass compilation of test sources. * Its use is NOT RECOMMENDED, but quite convenient on occasion. */ - @Parameter ( property = "maven.test.skip" ) + @Parameter(property = "maven.test.skip") private boolean skip; /** * The source directories containing the test-source to be compiled. */ - @Parameter ( defaultValue = "${project.testCompileSourceRoots}", readonly = true, required = true ) + @Parameter(defaultValue = "${project.testCompileSourceRoots}", readonly = true, required = true) private List compileSourceRoots; /** * The directory where compiled test classes go. */ - @Parameter ( defaultValue = "${project.build.testOutputDirectory}", required = true, readonly = true ) + @Parameter(defaultValue = "${project.build.testOutputDirectory}", required = true, readonly = true) private File outputDirectory; /** @@ -103,7 +103,7 @@ public class TestCompilerMojo * * @since 2.1 */ - @Parameter ( property = "maven.compiler.testSource" ) + @Parameter(property = "maven.compiler.testSource") private String testSource; /** @@ -111,15 +111,15 @@ public class TestCompilerMojo * * @since 2.1 */ - @Parameter ( property = "maven.compiler.testTarget" ) + @Parameter(property = "maven.compiler.testTarget") private String testTarget; /** * the -release argument for the test Java compiler - * + * * @since 3.6 */ - @Parameter ( property = "maven.compiler.testRelease" ) + @Parameter(property = "maven.compiler.testRelease") private String testRelease; /** @@ -158,367 +158,299 @@ public class TestCompilerMojo * * @since 2.2 */ - @Parameter ( defaultValue = "${project.build.directory}/generated-test-sources/test-annotations" ) + @Parameter(defaultValue = "${project.build.directory}/generated-test-sources/test-annotations") private File generatedTestSourcesDirectory; - @Parameter( defaultValue = "${project.testClasspathElements}", readonly = true ) + @Parameter(defaultValue = "${project.testClasspathElements}", readonly = true) private List testPath; - /** * when forking and debug activated the commandline used will be dumped in this file * @since 3.10.0 */ - @Parameter( defaultValue = "javac-test" ) + @Parameter(defaultValue = "javac-test") private String debugFileName; final LocationManager locationManager = new LocationManager(); private Map pathElements; - + private Collection classpathElements; private Collection modulepathElements; - public void execute() - throws MojoExecutionException, CompilationFailureException - { - if ( skip ) - { - getLog().info( "Not compiling test sources" ); + public void execute() throws MojoExecutionException, CompilationFailureException { + if (skip) { + getLog().info("Not compiling test sources"); return; } super.execute(); } - protected List getCompileSourceRoots() - { + protected List getCompileSourceRoots() { return compileSourceRoots; } @Override - protected Map getPathElements() - { + protected Map getPathElements() { return pathElements; } - protected List getClasspathElements() - { - return new ArrayList<>( classpathElements ); + protected List getClasspathElements() { + return new ArrayList<>(classpathElements); } @Override - protected List getModulepathElements() - { - return new ArrayList<>( modulepathElements ); + protected List getModulepathElements() { + return new ArrayList<>(modulepathElements); } - protected File getOutputDirectory() - { + protected File getOutputDirectory() { return outputDirectory; } @Override - protected void preparePaths( Set sourceFiles ) - { - File mainOutputDirectory = new File( getProject().getBuild().getOutputDirectory() ); + protected void preparePaths(Set sourceFiles) { + File mainOutputDirectory = new File(getProject().getBuild().getOutputDirectory()); - File mainModuleDescriptorClassFile = new File( mainOutputDirectory, "module-info.class" ); + File mainModuleDescriptorClassFile = new File(mainOutputDirectory, "module-info.class"); JavaModuleDescriptor mainModuleDescriptor = null; - File testModuleDescriptorJavaFile = new File( "module-info.java" ); + File testModuleDescriptorJavaFile = new File("module-info.java"); JavaModuleDescriptor testModuleDescriptor = null; // Go through the source files to respect includes/excludes - for ( File sourceFile : sourceFiles ) - { + for (File sourceFile : sourceFiles) { // @todo verify if it is the root of a sourcedirectory? - if ( "module-info.java".equals( sourceFile.getName() ) ) - { + if ("module-info.java".equals(sourceFile.getName())) { testModuleDescriptorJavaFile = sourceFile; break; } } // Get additional information from the main module descriptor, if available - if ( mainModuleDescriptorClassFile.exists() ) - { + if (mainModuleDescriptorClassFile.exists()) { ResolvePathsResult result; - try - { - ResolvePathsRequest request = - ResolvePathsRequest.ofStrings( testPath ) - .setIncludeStatic( true ) - .setMainModuleDescriptor( mainModuleDescriptorClassFile.getAbsolutePath() ); + try { + ResolvePathsRequest request = ResolvePathsRequest.ofStrings(testPath) + .setIncludeStatic(true) + .setMainModuleDescriptor(mainModuleDescriptorClassFile.getAbsolutePath()); Toolchain toolchain = getToolchain(); - if ( toolchain instanceof DefaultJavaToolChain ) - { - request.setJdkHome( ( (DefaultJavaToolChain) toolchain ).getJavaHome() ); + if (toolchain instanceof DefaultJavaToolChain) { + request.setJdkHome(((DefaultJavaToolChain) toolchain).getJavaHome()); } - result = locationManager.resolvePaths( request ); - - for ( Entry pathException : result.getPathExceptions().entrySet() ) - { + result = locationManager.resolvePaths(request); + + for (Entry pathException : + result.getPathExceptions().entrySet()) { Throwable cause = pathException.getValue(); - while ( cause.getCause() != null ) - { + while (cause.getCause() != null) { cause = cause.getCause(); } - String fileName = Paths.get( pathException.getKey() ).getFileName().toString(); - getLog().warn( "Can't extract module name from " + fileName + ": " + cause.getMessage() ); + String fileName = + Paths.get(pathException.getKey()).getFileName().toString(); + getLog().warn("Can't extract module name from " + fileName + ": " + cause.getMessage()); } - } - catch ( IOException e ) - { - throw new RuntimeException( e ); + } catch (IOException e) { + throw new RuntimeException(e); } mainModuleDescriptor = result.getMainModuleDescriptor(); - pathElements = new LinkedHashMap<>( result.getPathElements().size() ); - pathElements.putAll( result.getPathElements() ); + pathElements = new LinkedHashMap<>(result.getPathElements().size()); + pathElements.putAll(result.getPathElements()); modulepathElements = result.getModulepathElements().keySet(); classpathElements = result.getClasspathElements(); } // Get additional information from the test module descriptor, if available - if ( testModuleDescriptorJavaFile.exists() ) - { + if (testModuleDescriptorJavaFile.exists()) { ResolvePathsResult result; - try - { - ResolvePathsRequest request = - ResolvePathsRequest.ofStrings( testPath ) - .setMainModuleDescriptor( testModuleDescriptorJavaFile.getAbsolutePath() ); + try { + ResolvePathsRequest request = ResolvePathsRequest.ofStrings(testPath) + .setMainModuleDescriptor(testModuleDescriptorJavaFile.getAbsolutePath()); Toolchain toolchain = getToolchain(); - if ( toolchain instanceof DefaultJavaToolChain ) - { - request.setJdkHome( ( (DefaultJavaToolChain) toolchain ).getJavaHome() ); + if (toolchain instanceof DefaultJavaToolChain) { + request.setJdkHome(((DefaultJavaToolChain) toolchain).getJavaHome()); } - result = locationManager.resolvePaths( request ); - } - catch ( IOException e ) - { - throw new RuntimeException( e ); + result = locationManager.resolvePaths(request); + } catch (IOException e) { + throw new RuntimeException(e); } testModuleDescriptor = result.getMainModuleDescriptor(); } - if ( StringUtils.isNotEmpty( getRelease() ) ) - { - if ( Integer.parseInt( getRelease() ) < 9 ) - { + if (StringUtils.isNotEmpty(getRelease())) { + if (Integer.parseInt(getRelease()) < 9) { pathElements = Collections.emptyMap(); modulepathElements = Collections.emptyList(); classpathElements = testPath; return; } - } - else if ( Double.parseDouble( getTarget() ) < Double.parseDouble( MODULE_INFO_TARGET ) ) - { + } else if (Double.parseDouble(getTarget()) < Double.parseDouble(MODULE_INFO_TARGET)) { pathElements = Collections.emptyMap(); modulepathElements = Collections.emptyList(); classpathElements = testPath; return; } - - if ( testModuleDescriptor != null ) - { + + if (testModuleDescriptor != null) { modulepathElements = testPath; classpathElements = Collections.emptyList(); - if ( mainModuleDescriptor != null ) - { - if ( getLog().isDebugEnabled() ) - { - getLog().debug( "Main and test module descriptors exist:" ); - getLog().debug( " main module = " + mainModuleDescriptor.name() ); - getLog().debug( " test module = " + testModuleDescriptor.name() ); + if (mainModuleDescriptor != null) { + if (getLog().isDebugEnabled()) { + getLog().debug("Main and test module descriptors exist:"); + getLog().debug(" main module = " + mainModuleDescriptor.name()); + getLog().debug(" test module = " + testModuleDescriptor.name()); } - if ( testModuleDescriptor.name().equals( mainModuleDescriptor.name() ) ) - { - if ( compilerArgs == null ) - { + if (testModuleDescriptor.name().equals(mainModuleDescriptor.name())) { + if (compilerArgs == null) { compilerArgs = new ArrayList<>(); } - compilerArgs.add( "--patch-module" ); + compilerArgs.add("--patch-module"); StringBuilder patchModuleValue = new StringBuilder(); - patchModuleValue.append( testModuleDescriptor.name() ); - patchModuleValue.append( '=' ); - - for ( String root : getProject().getCompileSourceRoots() ) - { - if ( Files.exists( Paths.get( root ) ) ) - { - patchModuleValue.append( root ).append( PS ); + patchModuleValue.append(testModuleDescriptor.name()); + patchModuleValue.append('='); + + for (String root : getProject().getCompileSourceRoots()) { + if (Files.exists(Paths.get(root))) { + patchModuleValue.append(root).append(PS); } } - compilerArgs.add( patchModuleValue.toString() ); + compilerArgs.add(patchModuleValue.toString()); + } else { + getLog().debug("Black-box testing - all is ready to compile"); } - else - { - getLog().debug( "Black-box testing - all is ready to compile" ); - } - } - else - { + } else { // No main binaries available? Means we're a test-only project. - if ( !mainOutputDirectory.exists() ) - { + if (!mainOutputDirectory.exists()) { return; } // very odd // Means that main sources must be compiled with -modulesource and -Xmodule: - // However, this has a huge impact since you can't simply use it as a classpathEntry + // However, this has a huge impact since you can't simply use it as a classpathEntry // due to extra folder in between - throw new UnsupportedOperationException( "Can't compile test sources " - + "when main sources are missing a module descriptor" ); + throw new UnsupportedOperationException( + "Can't compile test sources " + "when main sources are missing a module descriptor"); } - } - else - { - if ( mainModuleDescriptor != null ) - { - if ( compilerArgs == null ) - { + } else { + if (mainModuleDescriptor != null) { + if (compilerArgs == null) { compilerArgs = new ArrayList<>(); } - compilerArgs.add( "--patch-module" ); - - StringBuilder patchModuleValue = new StringBuilder( mainModuleDescriptor.name() ) - .append( '=' ) - .append( mainOutputDirectory ) - .append( PS ); - for ( String root : compileSourceRoots ) - { - patchModuleValue.append( root ).append( PS ); + compilerArgs.add("--patch-module"); + + StringBuilder patchModuleValue = new StringBuilder(mainModuleDescriptor.name()) + .append('=') + .append(mainOutputDirectory) + .append(PS); + for (String root : compileSourceRoots) { + patchModuleValue.append(root).append(PS); } - - compilerArgs.add( patchModuleValue.toString() ); - - compilerArgs.add( "--add-reads" ); - compilerArgs.add( mainModuleDescriptor.name() + "=ALL-UNNAMED" ); - } - else - { + + compilerArgs.add(patchModuleValue.toString()); + + compilerArgs.add("--add-reads"); + compilerArgs.add(mainModuleDescriptor.name() + "=ALL-UNNAMED"); + } else { modulepathElements = Collections.emptyList(); classpathElements = testPath; } } } - protected SourceInclusionScanner getSourceInclusionScanner( int staleMillis ) - { + protected SourceInclusionScanner getSourceInclusionScanner(int staleMillis) { SourceInclusionScanner scanner; - if ( testIncludes.isEmpty() && testExcludes.isEmpty() && testIncrementalExcludes.isEmpty() ) - { - scanner = new StaleSourceScanner( staleMillis ); - } - else - { - if ( testIncludes.isEmpty() ) - { - testIncludes.add( "**/*.java" ); + if (testIncludes.isEmpty() && testExcludes.isEmpty() && testIncrementalExcludes.isEmpty()) { + scanner = new StaleSourceScanner(staleMillis); + } else { + if (testIncludes.isEmpty()) { + testIncludes.add("**/*.java"); } - Set excludesIncr = new HashSet<>( testExcludes ); - excludesIncr.addAll( this.testIncrementalExcludes ); - scanner = new StaleSourceScanner( staleMillis, testIncludes, excludesIncr ); + Set excludesIncr = new HashSet<>(testExcludes); + excludesIncr.addAll(this.testIncrementalExcludes); + scanner = new StaleSourceScanner(staleMillis, testIncludes, excludesIncr); } return scanner; } - protected SourceInclusionScanner getSourceInclusionScanner( String inputFileEnding ) - { + protected SourceInclusionScanner getSourceInclusionScanner(String inputFileEnding) { SourceInclusionScanner scanner; // it's not defined if we get the ending with or without the dot '.' - String defaultIncludePattern = "**/*" + ( inputFileEnding.startsWith( "." ) ? "" : "." ) + inputFileEnding; - - if ( testIncludes.isEmpty() && testExcludes.isEmpty() && testIncrementalExcludes.isEmpty() ) - { - testIncludes = Collections.singleton( defaultIncludePattern ); - scanner = new SimpleSourceInclusionScanner( testIncludes, Collections.emptySet() ); - } - else - { - if ( testIncludes.isEmpty() ) - { - testIncludes.add( defaultIncludePattern ); + String defaultIncludePattern = "**/*" + (inputFileEnding.startsWith(".") ? "" : ".") + inputFileEnding; + + if (testIncludes.isEmpty() && testExcludes.isEmpty() && testIncrementalExcludes.isEmpty()) { + testIncludes = Collections.singleton(defaultIncludePattern); + scanner = new SimpleSourceInclusionScanner(testIncludes, Collections.emptySet()); + } else { + if (testIncludes.isEmpty()) { + testIncludes.add(defaultIncludePattern); } - Set excludesIncr = new HashSet<>( testExcludes ); - excludesIncr.addAll( this.testIncrementalExcludes ); - scanner = new SimpleSourceInclusionScanner( testIncludes, excludesIncr ); + Set excludesIncr = new HashSet<>(testExcludes); + excludesIncr.addAll(this.testIncrementalExcludes); + scanner = new SimpleSourceInclusionScanner(testIncludes, excludesIncr); } return scanner; } - protected String getSource() - { + protected String getSource() { return testSource == null ? source : testSource; } - protected String getTarget() - { + protected String getTarget() { return testTarget == null ? target : testTarget; } - + @Override - protected String getRelease() - { + protected String getRelease() { return testRelease == null ? release : testRelease; } - protected String getCompilerArgument() - { + protected String getCompilerArgument() { return testCompilerArgument == null ? compilerArgument : testCompilerArgument; } - protected Map getCompilerArguments() - { + protected Map getCompilerArguments() { return testCompilerArguments == null ? compilerArguments : testCompilerArguments; } - protected File getGeneratedSourcesDirectory() - { + protected File getGeneratedSourcesDirectory() { return generatedTestSourcesDirectory; } @Override - protected String getDebugFileName() - { + protected String getDebugFileName() { return debugFileName; } @Override - protected boolean isTestCompile() - { + protected boolean isTestCompile() { return true; } @Override - protected Set getIncludes() - { + protected Set getIncludes() { return testIncludes; } @Override - protected Set getExcludes() - { + protected Set getExcludes() { return testExcludes; } - } diff --git a/src/test/java/org/apache/maven/plugin/compiler/CompilerMojoTestCase.java b/src/test/java/org/apache/maven/plugin/compiler/CompilerMojoTestCase.java index ae3e6708..a19ce747 100644 --- a/src/test/java/org/apache/maven/plugin/compiler/CompilerMojoTestCase.java +++ b/src/test/java/org/apache/maven/plugin/compiler/CompilerMojoTestCase.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugin.compiler; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,12 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - -import static org.mockito.ArgumentMatchers.startsWith; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +package org.apache.maven.plugin.compiler; import java.io.File; import java.net.URI; @@ -47,58 +40,60 @@ import org.apache.maven.plugin.testing.stubs.ArtifactStub; import org.apache.maven.project.MavenProject; -public class CompilerMojoTestCase - extends AbstractMojoTestCase -{ +import static org.mockito.ArgumentMatchers.startsWith; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +public class CompilerMojoTestCase extends AbstractMojoTestCase { /** * tests the ability of the plugin to compile a basic file * * @throws Exception */ - public void testCompilerBasic() - throws Exception - { - CompilerMojo compileMojo = getCompilerMojo( "target/test-classes/unit/compiler-basic-test/plugin-config.xml" ); - - Log log = mock( Log.class ); - - compileMojo.setLog( log ); - + public void testCompilerBasic() throws Exception { + CompilerMojo compileMojo = getCompilerMojo("target/test-classes/unit/compiler-basic-test/plugin-config.xml"); + + Log log = mock(Log.class); + + compileMojo.setLog(log); + compileMojo.execute(); - File testClass = new File( compileMojo.getOutputDirectory(), "foo/TestCompile0.class" ); + File testClass = new File(compileMojo.getOutputDirectory(), "foo/TestCompile0.class"); - assertTrue( testClass.exists() ); + assertTrue(testClass.exists()); TestCompilerMojo testCompileMojo = - getTestCompilerMojo( compileMojo, "target/test-classes/unit/compiler-basic-test/plugin-config.xml" ); + getTestCompilerMojo(compileMojo, "target/test-classes/unit/compiler-basic-test/plugin-config.xml"); testCompileMojo.execute(); - Artifact projectArtifact = (Artifact) getVariableValueFromObject( compileMojo, "projectArtifact" ); - assertNotNull( "MCOMPILER-94: artifact file should only be null if there is nothing to compile", - projectArtifact.getFile() ); + Artifact projectArtifact = (Artifact) getVariableValueFromObject(compileMojo, "projectArtifact"); + assertNotNull( + "MCOMPILER-94: artifact file should only be null if there is nothing to compile", + projectArtifact.getFile()); - testClass = new File( testCompileMojo.getOutputDirectory(), "foo/TestCompile0Test.class" ); - - verify( log ).warn( startsWith( "No explicit value set for target or release!" ) ); + testClass = new File(testCompileMojo.getOutputDirectory(), "foo/TestCompile0Test.class"); - assertTrue( testClass.exists() ); + verify(log).warn(startsWith("No explicit value set for target or release!")); + + assertTrue(testClass.exists()); } - - public void testCompilerBasicSourceTarget() - throws Exception - { - CompilerMojo compileMojo = getCompilerMojo( "target/test-classes/unit/compiler-basic-sourcetarget/plugin-config.xml" ); - - Log log = mock( Log.class ); - - compileMojo.setLog( log ); - + + public void testCompilerBasicSourceTarget() throws Exception { + CompilerMojo compileMojo = + getCompilerMojo("target/test-classes/unit/compiler-basic-sourcetarget/plugin-config.xml"); + + Log log = mock(Log.class); + + compileMojo.setLog(log); + compileMojo.execute(); - - verify( log, never() ).warn( startsWith( "No explicit value set for target or release!" ) ); + + verify(log, never()).warn(startsWith("No explicit value set for target or release!")); } /** @@ -106,26 +101,24 @@ public void testCompilerBasicSourceTarget() * * @throws Exception */ - public void testCompilerEmptySource() - throws Exception - { + public void testCompilerEmptySource() throws Exception { CompilerMojo compileMojo = - getCompilerMojo( "target/test-classes/unit/compiler-empty-source-test/plugin-config.xml" ); + getCompilerMojo("target/test-classes/unit/compiler-empty-source-test/plugin-config.xml"); compileMojo.execute(); - assertFalse( compileMojo.getOutputDirectory().exists() ); + assertFalse(compileMojo.getOutputDirectory().exists()); - Artifact projectArtifact = (Artifact) getVariableValueFromObject( compileMojo, "projectArtifact" ); - assertNull( "MCOMPILER-94: artifact file should be null if there is nothing to compile", - projectArtifact.getFile() ); + Artifact projectArtifact = (Artifact) getVariableValueFromObject(compileMojo, "projectArtifact"); + assertNull( + "MCOMPILER-94: artifact file should be null if there is nothing to compile", projectArtifact.getFile()); - TestCompilerMojo testCompileMojo = - getTestCompilerMojo( compileMojo, "target/test-classes/unit/compiler-empty-source-test/plugin-config.xml" ); + TestCompilerMojo testCompileMojo = getTestCompilerMojo( + compileMojo, "target/test-classes/unit/compiler-empty-source-test/plugin-config.xml"); testCompileMojo.execute(); - assertFalse( testCompileMojo.getOutputDirectory().exists() ); + assertFalse(testCompileMojo.getOutputDirectory().exists()); } /** @@ -133,48 +126,46 @@ public void testCompilerEmptySource() * * @throws Exception */ - public void testCompilerIncludesExcludes() - throws Exception - { + public void testCompilerIncludesExcludes() throws Exception { CompilerMojo compileMojo = - getCompilerMojo( "target/test-classes/unit/compiler-includes-excludes-test/plugin-config.xml" ); + getCompilerMojo("target/test-classes/unit/compiler-includes-excludes-test/plugin-config.xml"); Set includes = new HashSet<>(); - includes.add( "**/TestCompile4*.java" ); - setVariableValueToObject( compileMojo, "includes", includes ); + includes.add("**/TestCompile4*.java"); + setVariableValueToObject(compileMojo, "includes", includes); Set excludes = new HashSet<>(); - excludes.add( "**/TestCompile2*.java" ); - excludes.add( "**/TestCompile3*.java" ); - setVariableValueToObject( compileMojo, "excludes", excludes ); + excludes.add("**/TestCompile2*.java"); + excludes.add("**/TestCompile3*.java"); + setVariableValueToObject(compileMojo, "excludes", excludes); compileMojo.execute(); - File testClass = new File( compileMojo.getOutputDirectory(), "foo/TestCompile2.class" ); - assertFalse( testClass.exists() ); + File testClass = new File(compileMojo.getOutputDirectory(), "foo/TestCompile2.class"); + assertFalse(testClass.exists()); - testClass = new File( compileMojo.getOutputDirectory(), "foo/TestCompile3.class" ); - assertFalse( testClass.exists() ); + testClass = new File(compileMojo.getOutputDirectory(), "foo/TestCompile3.class"); + assertFalse(testClass.exists()); - testClass = new File( compileMojo.getOutputDirectory(), "foo/TestCompile4.class" ); - assertTrue( testClass.exists() ); + testClass = new File(compileMojo.getOutputDirectory(), "foo/TestCompile4.class"); + assertTrue(testClass.exists()); - TestCompilerMojo testCompileMojo = getTestCompilerMojo( compileMojo, - "target/test-classes/unit/compiler-includes-excludes-test/plugin-config.xml" ); + TestCompilerMojo testCompileMojo = getTestCompilerMojo( + compileMojo, "target/test-classes/unit/compiler-includes-excludes-test/plugin-config.xml"); - setVariableValueToObject( testCompileMojo, "testIncludes", includes ); - setVariableValueToObject( testCompileMojo, "testExcludes", excludes ); + setVariableValueToObject(testCompileMojo, "testIncludes", includes); + setVariableValueToObject(testCompileMojo, "testExcludes", excludes); testCompileMojo.execute(); - testClass = new File( testCompileMojo.getOutputDirectory(), "foo/TestCompile2TestCase.class" ); - assertFalse( testClass.exists() ); + testClass = new File(testCompileMojo.getOutputDirectory(), "foo/TestCompile2TestCase.class"); + assertFalse(testClass.exists()); - testClass = new File( testCompileMojo.getOutputDirectory(), "foo/TestCompile3TestCase.class" ); - assertFalse( testClass.exists() ); + testClass = new File(testCompileMojo.getOutputDirectory(), "foo/TestCompile3TestCase.class"); + assertFalse(testClass.exists()); - testClass = new File( testCompileMojo.getOutputDirectory(), "foo/TestCompile4TestCase.class" ); - assertTrue( testClass.exists() ); + testClass = new File(testCompileMojo.getOutputDirectory(), "foo/TestCompile4TestCase.class"); + assertTrue(testClass.exists()); } /** @@ -182,304 +173,275 @@ public void testCompilerIncludesExcludes() * * @throws Exception */ - public void testCompilerFork() - throws Exception - { - CompilerMojo compileMojo = getCompilerMojo( "target/test-classes/unit/compiler-fork-test/plugin-config.xml" ); + public void testCompilerFork() throws Exception { + CompilerMojo compileMojo = getCompilerMojo("target/test-classes/unit/compiler-fork-test/plugin-config.xml"); // JAVA_HOME doesn't have to be on the PATH. - setVariableValueToObject( compileMojo, "executable", new File( System.getenv( "JAVA_HOME" ), "bin/javac" ).getPath() ); + setVariableValueToObject( + compileMojo, "executable", new File(System.getenv("JAVA_HOME"), "bin/javac").getPath()); compileMojo.execute(); - File testClass = new File( compileMojo.getOutputDirectory(), "foo/TestCompile1.class" ); - assertTrue( testClass.exists() ); + File testClass = new File(compileMojo.getOutputDirectory(), "foo/TestCompile1.class"); + assertTrue(testClass.exists()); TestCompilerMojo testCompileMojo = - getTestCompilerMojo( compileMojo, "target/test-classes/unit/compiler-fork-test/plugin-config.xml" ); + getTestCompilerMojo(compileMojo, "target/test-classes/unit/compiler-fork-test/plugin-config.xml"); // JAVA_HOME doesn't have to be on the PATH. - setVariableValueToObject( testCompileMojo, "executable", new File( System.getenv( "JAVA_HOME" ), "bin/javac" ).getPath() ); + setVariableValueToObject( + testCompileMojo, "executable", new File(System.getenv("JAVA_HOME"), "bin/javac").getPath()); testCompileMojo.execute(); - testClass = new File( testCompileMojo.getOutputDirectory(), "foo/TestCompile1TestCase.class" ); - assertTrue( testClass.exists() ); + testClass = new File(testCompileMojo.getOutputDirectory(), "foo/TestCompile1TestCase.class"); + assertTrue(testClass.exists()); } - public void testOneOutputFileForAllInput() - throws Exception - { + public void testOneOutputFileForAllInput() throws Exception { CompilerMojo compileMojo = - getCompilerMojo( "target/test-classes/unit/compiler-one-output-file-test/plugin-config.xml" ); + getCompilerMojo("target/test-classes/unit/compiler-one-output-file-test/plugin-config.xml"); - setVariableValueToObject( compileMojo, "compilerManager", new CompilerManagerStub() ); + setVariableValueToObject(compileMojo, "compilerManager", new CompilerManagerStub()); compileMojo.execute(); - File testClass = new File( compileMojo.getOutputDirectory(), "compiled.class" ); - assertTrue( testClass.exists() ); + File testClass = new File(compileMojo.getOutputDirectory(), "compiled.class"); + assertTrue(testClass.exists()); - TestCompilerMojo testCompileMojo = getTestCompilerMojo( compileMojo, - "target/test-classes/unit/compiler-one-output-file-test/plugin-config.xml" ); + TestCompilerMojo testCompileMojo = getTestCompilerMojo( + compileMojo, "target/test-classes/unit/compiler-one-output-file-test/plugin-config.xml"); - setVariableValueToObject( testCompileMojo, "compilerManager", new CompilerManagerStub() ); + setVariableValueToObject(testCompileMojo, "compilerManager", new CompilerManagerStub()); testCompileMojo.execute(); - testClass = new File( testCompileMojo.getOutputDirectory(), "compiled.class" ); - assertTrue( testClass.exists() ); + testClass = new File(testCompileMojo.getOutputDirectory(), "compiled.class"); + assertTrue(testClass.exists()); } - public void testCompilerArgs() - throws Exception - { - CompilerMojo compileMojo = getCompilerMojo( "target/test-classes/unit/compiler-args-test/plugin-config.xml" ); + public void testCompilerArgs() throws Exception { + CompilerMojo compileMojo = getCompilerMojo("target/test-classes/unit/compiler-args-test/plugin-config.xml"); - setVariableValueToObject( compileMojo, "compilerManager", new CompilerManagerStub() ); + setVariableValueToObject(compileMojo, "compilerManager", new CompilerManagerStub()); compileMojo.execute(); - File testClass = new File( compileMojo.getOutputDirectory(), "compiled.class" ); - assertTrue( testClass.exists() ); - assertEquals( Arrays.asList( "key1=value1","-Xlint","-my&special:param-with+chars/not>allowed_in_XML_element_names" ), compileMojo.compilerArgs ); + File testClass = new File(compileMojo.getOutputDirectory(), "compiled.class"); + assertTrue(testClass.exists()); + assertEquals( + Arrays.asList("key1=value1", "-Xlint", "-my&special:param-with+chars/not>allowed_in_XML_element_names"), + compileMojo.compilerArgs); } - public void testImplicitFlagNone() - throws Exception - { - CompilerMojo compileMojo = getCompilerMojo( "target/test-classes/unit/compiler-implicit-test/plugin-config-none.xml" ); + public void testImplicitFlagNone() throws Exception { + CompilerMojo compileMojo = + getCompilerMojo("target/test-classes/unit/compiler-implicit-test/plugin-config-none.xml"); - assertEquals( "none", compileMojo.getImplicit() ); + assertEquals("none", compileMojo.getImplicit()); } - public void testImplicitFlagNotSet() - throws Exception - { - CompilerMojo compileMojo = getCompilerMojo( "target/test-classes/unit/compiler-implicit-test/plugin-config-not-set.xml" ); + public void testImplicitFlagNotSet() throws Exception { + CompilerMojo compileMojo = + getCompilerMojo("target/test-classes/unit/compiler-implicit-test/plugin-config-not-set.xml"); - assertNull( compileMojo.getImplicit() ); + assertNull(compileMojo.getImplicit()); } - public void testOneOutputFileForAllInput2() - throws Exception - { + public void testOneOutputFileForAllInput2() throws Exception { CompilerMojo compileMojo = - getCompilerMojo( "target/test-classes/unit/compiler-one-output-file-test2/plugin-config.xml" ); + getCompilerMojo("target/test-classes/unit/compiler-one-output-file-test2/plugin-config.xml"); - setVariableValueToObject( compileMojo, "compilerManager", new CompilerManagerStub() ); + setVariableValueToObject(compileMojo, "compilerManager", new CompilerManagerStub()); Set includes = new HashSet<>(); - includes.add( "**/TestCompile4*.java" ); - setVariableValueToObject( compileMojo, "includes", includes ); + includes.add("**/TestCompile4*.java"); + setVariableValueToObject(compileMojo, "includes", includes); Set excludes = new HashSet<>(); - excludes.add( "**/TestCompile2*.java" ); - excludes.add( "**/TestCompile3*.java" ); - setVariableValueToObject( compileMojo, "excludes", excludes ); + excludes.add("**/TestCompile2*.java"); + excludes.add("**/TestCompile3*.java"); + setVariableValueToObject(compileMojo, "excludes", excludes); compileMojo.execute(); - File testClass = new File( compileMojo.getOutputDirectory(), "compiled.class" ); - assertTrue( testClass.exists() ); + File testClass = new File(compileMojo.getOutputDirectory(), "compiled.class"); + assertTrue(testClass.exists()); - TestCompilerMojo testCompileMojo = getTestCompilerMojo( compileMojo, - "target/test-classes/unit/compiler-one-output-file-test2/plugin-config.xml" ); + TestCompilerMojo testCompileMojo = getTestCompilerMojo( + compileMojo, "target/test-classes/unit/compiler-one-output-file-test2/plugin-config.xml"); - setVariableValueToObject( testCompileMojo, "compilerManager", new CompilerManagerStub() ); - setVariableValueToObject( testCompileMojo, "testIncludes", includes ); - setVariableValueToObject( testCompileMojo, "testExcludes", excludes ); + setVariableValueToObject(testCompileMojo, "compilerManager", new CompilerManagerStub()); + setVariableValueToObject(testCompileMojo, "testIncludes", includes); + setVariableValueToObject(testCompileMojo, "testExcludes", excludes); testCompileMojo.execute(); - testClass = new File( testCompileMojo.getOutputDirectory(), "compiled.class" ); - assertTrue( testClass.exists() ); + testClass = new File(testCompileMojo.getOutputDirectory(), "compiled.class"); + assertTrue(testClass.exists()); } - public void testCompileFailure() - throws Exception - { - CompilerMojo compileMojo = getCompilerMojo( "target/test-classes/unit/compiler-fail-test/plugin-config.xml" ); + public void testCompileFailure() throws Exception { + CompilerMojo compileMojo = getCompilerMojo("target/test-classes/unit/compiler-fail-test/plugin-config.xml"); - setVariableValueToObject( compileMojo, "compilerManager", new CompilerManagerStub( true ) ); + setVariableValueToObject(compileMojo, "compilerManager", new CompilerManagerStub(true)); - try - { + try { compileMojo.execute(); - fail( "Should throw an exception" ); - } - catch ( CompilationFailureException e ) - { - //expected + fail("Should throw an exception"); + } catch (CompilationFailureException e) { + // expected } } - public void testCompileFailOnError() - throws Exception - { + public void testCompileFailOnError() throws Exception { CompilerMojo compileMojo = - getCompilerMojo( "target/test-classes/unit/compiler-failonerror-test/plugin-config.xml" ); + getCompilerMojo("target/test-classes/unit/compiler-failonerror-test/plugin-config.xml"); - setVariableValueToObject( compileMojo, "compilerManager", new CompilerManagerStub( true ) ); + setVariableValueToObject(compileMojo, "compilerManager", new CompilerManagerStub(true)); - try - { + try { compileMojo.execute(); - assertTrue( true ); - } - catch ( CompilationFailureException e ) - { - fail( "The compilation error should have been consumed because failOnError = false" ); + assertTrue(true); + } catch (CompilationFailureException e) { + fail("The compilation error should have been consumed because failOnError = false"); } } - + /** * Tests that setting 'skipMain' to true skips compilation of the main Java source files, but that test Java source * files are still compiled. * @throws Exception */ - public void testCompileSkipMain() - throws Exception - { - CompilerMojo compileMojo = getCompilerMojo( "target/test-classes/unit/compiler-skip-main/plugin-config.xml" ); - setVariableValueToObject( compileMojo, "skipMain", true ); + public void testCompileSkipMain() throws Exception { + CompilerMojo compileMojo = getCompilerMojo("target/test-classes/unit/compiler-skip-main/plugin-config.xml"); + setVariableValueToObject(compileMojo, "skipMain", true); compileMojo.execute(); - File testClass = new File( compileMojo.getOutputDirectory(), "foo/TestSkipMainCompile0.class" ); - assertFalse( testClass.exists() ); + File testClass = new File(compileMojo.getOutputDirectory(), "foo/TestSkipMainCompile0.class"); + assertFalse(testClass.exists()); TestCompilerMojo testCompileMojo = - getTestCompilerMojo( compileMojo, "target/test-classes/unit/compiler-skip-main/plugin-config.xml" ); + getTestCompilerMojo(compileMojo, "target/test-classes/unit/compiler-skip-main/plugin-config.xml"); testCompileMojo.execute(); - testClass = new File( testCompileMojo.getOutputDirectory(), "foo/TestSkipMainCompile0Test.class" ); - assertTrue( testClass.exists() ); + testClass = new File(testCompileMojo.getOutputDirectory(), "foo/TestSkipMainCompile0Test.class"); + assertTrue(testClass.exists()); } - + /** * Tests that setting 'skip' to true skips compilation of the test Java source files, but that main Java source * files are still compiled. * @throws Exception */ - public void testCompileSkipTest() - throws Exception - { - CompilerMojo compileMojo = getCompilerMojo( "target/test-classes/unit/compiler-skip-test/plugin-config.xml" ); + public void testCompileSkipTest() throws Exception { + CompilerMojo compileMojo = getCompilerMojo("target/test-classes/unit/compiler-skip-test/plugin-config.xml"); compileMojo.execute(); - File testClass = new File( compileMojo.getOutputDirectory(), "foo/TestSkipTestCompile0.class" ); - assertTrue( testClass.exists() ); + File testClass = new File(compileMojo.getOutputDirectory(), "foo/TestSkipTestCompile0.class"); + assertTrue(testClass.exists()); TestCompilerMojo testCompileMojo = - getTestCompilerMojo( compileMojo, "target/test-classes/unit/compiler-skip-test/plugin-config.xml" ); - setVariableValueToObject( testCompileMojo, "skip", true ); + getTestCompilerMojo(compileMojo, "target/test-classes/unit/compiler-skip-test/plugin-config.xml"); + setVariableValueToObject(testCompileMojo, "skip", true); testCompileMojo.execute(); - testClass = new File( testCompileMojo.getOutputDirectory(), "foo/TestSkipTestCompile0Test.class" ); - assertFalse( testClass.exists() ); + testClass = new File(testCompileMojo.getOutputDirectory(), "foo/TestSkipTestCompile0Test.class"); + assertFalse(testClass.exists()); } - private CompilerMojo getCompilerMojo( String pomXml ) - throws Exception - { - File testPom = new File( getBasedir(), pomXml ); + private CompilerMojo getCompilerMojo(String pomXml) throws Exception { + File testPom = new File(getBasedir(), pomXml); - CompilerMojo mojo = (CompilerMojo) lookupMojo( "compile", testPom ); + CompilerMojo mojo = (CompilerMojo) lookupMojo("compile", testPom); - setVariableValueToObject( mojo, "log", new DebugEnabledLog() ); - setVariableValueToObject( mojo, "projectArtifact", new ArtifactStub() ); - setVariableValueToObject( mojo, "compilePath", Collections.EMPTY_LIST ); - setVariableValueToObject( mojo, "session", getMockMavenSession() ); - setVariableValueToObject( mojo, "project", getMockMavenProject() ); - setVariableValueToObject( mojo, "mojoExecution", getMockMojoExecution() ); - setVariableValueToObject( mojo, "source", AbstractCompilerMojo.DEFAULT_SOURCE ); - setVariableValueToObject( mojo, "target", AbstractCompilerMojo.DEFAULT_TARGET ); + setVariableValueToObject(mojo, "log", new DebugEnabledLog()); + setVariableValueToObject(mojo, "projectArtifact", new ArtifactStub()); + setVariableValueToObject(mojo, "compilePath", Collections.EMPTY_LIST); + setVariableValueToObject(mojo, "session", getMockMavenSession()); + setVariableValueToObject(mojo, "project", getMockMavenProject()); + setVariableValueToObject(mojo, "mojoExecution", getMockMojoExecution()); + setVariableValueToObject(mojo, "source", AbstractCompilerMojo.DEFAULT_SOURCE); + setVariableValueToObject(mojo, "target", AbstractCompilerMojo.DEFAULT_TARGET); return mojo; } - private TestCompilerMojo getTestCompilerMojo( CompilerMojo compilerMojo, String pomXml ) - throws Exception - { - File testPom = new File( getBasedir(), pomXml ); + private TestCompilerMojo getTestCompilerMojo(CompilerMojo compilerMojo, String pomXml) throws Exception { + File testPom = new File(getBasedir(), pomXml); - TestCompilerMojo mojo = (TestCompilerMojo) lookupMojo( "testCompile", testPom ); + TestCompilerMojo mojo = (TestCompilerMojo) lookupMojo("testCompile", testPom); - setVariableValueToObject( mojo, "log", new DebugEnabledLog() ); + setVariableValueToObject(mojo, "log", new DebugEnabledLog()); - File buildDir = (File) getVariableValueFromObject( compilerMojo, "buildDirectory" ); - File testClassesDir = new File( buildDir, "test-classes" ); - setVariableValueToObject( mojo, "outputDirectory", testClassesDir ); + File buildDir = (File) getVariableValueFromObject(compilerMojo, "buildDirectory"); + File testClassesDir = new File(buildDir, "test-classes"); + setVariableValueToObject(mojo, "outputDirectory", testClassesDir); List testClasspathList = new ArrayList<>(); - - Artifact junitArtifact = mock( Artifact.class ); - ArtifactHandler handler = mock( ArtifactHandler.class ); - when( handler.isAddedToClasspath() ).thenReturn( true ); - when( junitArtifact.getArtifactHandler() ).thenReturn( handler ); + + Artifact junitArtifact = mock(Artifact.class); + ArtifactHandler handler = mock(ArtifactHandler.class); + when(handler.isAddedToClasspath()).thenReturn(true); + when(junitArtifact.getArtifactHandler()).thenReturn(handler); File artifactFile; - String localRepository = System.getProperty( "localRepository" ); - if ( localRepository != null ) - { - artifactFile = new File( localRepository, "junit/junit/3.8.1/junit-3.8.1.jar" ); - } - else - { + String localRepository = System.getProperty("localRepository"); + if (localRepository != null) { + artifactFile = new File(localRepository, "junit/junit/3.8.1/junit-3.8.1.jar"); + } else { // for IDE - String junitURI = org.junit.Test.class.getResource( "Test.class" ).toURI().toString(); - junitURI = junitURI.substring( "jar:".length(), junitURI.indexOf( '!' ) ); - artifactFile = new File( URI.create( junitURI ) ); + String junitURI = + org.junit.Test.class.getResource("Test.class").toURI().toString(); + junitURI = junitURI.substring("jar:".length(), junitURI.indexOf('!')); + artifactFile = new File(URI.create(junitURI)); } - when ( junitArtifact.getFile() ).thenReturn( artifactFile ); - - testClasspathList.add( artifactFile.getAbsolutePath() ); - testClasspathList.add( compilerMojo.getOutputDirectory().getPath() ); + when(junitArtifact.getFile()).thenReturn(artifactFile); + + testClasspathList.add(artifactFile.getAbsolutePath()); + testClasspathList.add(compilerMojo.getOutputDirectory().getPath()); String testSourceRoot = testPom.getParent() + "/src/test/java"; - setVariableValueToObject( mojo, "compileSourceRoots", Collections.singletonList( testSourceRoot ) ); + setVariableValueToObject(mojo, "compileSourceRoots", Collections.singletonList(testSourceRoot)); MavenProject project = getMockMavenProject(); - project.setFile( testPom ); - project.addCompileSourceRoot("/src/main/java" ); - project.setArtifacts( Collections.singleton( junitArtifact ) ); - project.getBuild().setOutputDirectory( new File( buildDir, "classes" ).getAbsolutePath() ); - setVariableValueToObject( mojo, "project", project ); - setVariableValueToObject( mojo, "testPath", testClasspathList ); - setVariableValueToObject( mojo, "session", getMockMavenSession() ); - setVariableValueToObject( mojo, "mojoExecution", getMockMojoExecution() ); - setVariableValueToObject( mojo, "source", AbstractCompilerMojo.DEFAULT_SOURCE ); - setVariableValueToObject( mojo, "target", AbstractCompilerMojo.DEFAULT_TARGET ); + project.setFile(testPom); + project.addCompileSourceRoot("/src/main/java"); + project.setArtifacts(Collections.singleton(junitArtifact)); + project.getBuild().setOutputDirectory(new File(buildDir, "classes").getAbsolutePath()); + setVariableValueToObject(mojo, "project", project); + setVariableValueToObject(mojo, "testPath", testClasspathList); + setVariableValueToObject(mojo, "session", getMockMavenSession()); + setVariableValueToObject(mojo, "mojoExecution", getMockMojoExecution()); + setVariableValueToObject(mojo, "source", AbstractCompilerMojo.DEFAULT_SOURCE); + setVariableValueToObject(mojo, "target", AbstractCompilerMojo.DEFAULT_TARGET); return mojo; } - - private MavenProject getMockMavenProject() - { + + private MavenProject getMockMavenProject() { MavenProject mp = new MavenProject(); - mp.getBuild().setDirectory( "target" ); - mp.getBuild().setOutputDirectory( "target/classes" ); - mp.getBuild().setSourceDirectory( "src/main/java" ); - mp.getBuild().setTestOutputDirectory( "target/test-classes" ); + mp.getBuild().setDirectory("target"); + mp.getBuild().setOutputDirectory("target/classes"); + mp.getBuild().setSourceDirectory("src/main/java"); + mp.getBuild().setTestOutputDirectory("target/test-classes"); return mp; } - private MavenSession getMockMavenSession() - { - MavenSession session = mock( MavenSession.class ); + private MavenSession getMockMavenSession() { + MavenSession session = mock(MavenSession.class); // when( session.getPluginContext( isA(PluginDescriptor.class), isA(MavenProject.class) ) ).thenReturn( // Collections.emptyMap() ); - when( session.getCurrentProject() ).thenReturn( getMockMavenProject() ); + when(session.getCurrentProject()).thenReturn(getMockMavenProject()); return session; } - private MojoExecution getMockMojoExecution() - { + private MojoExecution getMockMojoExecution() { MojoDescriptor md = new MojoDescriptor(); - md.setGoal( "compile" ); + md.setGoal("compile"); - MojoExecution me = new MojoExecution( md ); + MojoExecution me = new MojoExecution(md); PluginDescriptor pd = new PluginDescriptor(); - pd.setArtifactId( "maven-compiler-plugin" ); - md.setPluginDescriptor( pd ); + pd.setArtifactId("maven-compiler-plugin"); + md.setPluginDescriptor(pd); return me; } diff --git a/src/test/java/org/apache/maven/plugin/compiler/stubs/CompilerManagerStub.java b/src/test/java/org/apache/maven/plugin/compiler/stubs/CompilerManagerStub.java index eff1ce34..59f0a839 100644 --- a/src/test/java/org/apache/maven/plugin/compiler/stubs/CompilerManagerStub.java +++ b/src/test/java/org/apache/maven/plugin/compiler/stubs/CompilerManagerStub.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugin.compiler.stubs; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,29 +16,25 @@ * specific language governing permissions and limitations * under the License. */ +package org.apache.maven.plugin.compiler.stubs; import org.codehaus.plexus.compiler.manager.CompilerManager; /** * @author Edwin Punzalan */ -public class CompilerManagerStub - implements CompilerManager -{ +public class CompilerManagerStub implements CompilerManager { private boolean shouldFail; - public CompilerManagerStub() - { - this( false ); + public CompilerManagerStub() { + this(false); } - public CompilerManagerStub( boolean shouldFail ) - { + public CompilerManagerStub(boolean shouldFail) { this.shouldFail = shouldFail; } - public org.codehaus.plexus.compiler.Compiler getCompiler( String compilerId ) - { - return new CompilerStub( shouldFail ); + public org.codehaus.plexus.compiler.Compiler getCompiler(String compilerId) { + return new CompilerStub(shouldFail); } } diff --git a/src/test/java/org/apache/maven/plugin/compiler/stubs/CompilerStub.java b/src/test/java/org/apache/maven/plugin/compiler/stubs/CompilerStub.java index 23eb392a..8131fa77 100644 --- a/src/test/java/org/apache/maven/plugin/compiler/stubs/CompilerStub.java +++ b/src/test/java/org/apache/maven/plugin/compiler/stubs/CompilerStub.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugin.compiler.stubs; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +16,11 @@ * specific language governing permissions and limitations * under the License. */ +package org.apache.maven.plugin.compiler.stubs; + +import java.io.File; +import java.io.IOException; +import java.util.Collections; import org.codehaus.plexus.compiler.CompilerConfiguration; import org.codehaus.plexus.compiler.CompilerException; @@ -25,79 +28,59 @@ import org.codehaus.plexus.compiler.CompilerOutputStyle; import org.codehaus.plexus.compiler.CompilerResult; -import java.io.File; -import java.io.IOException; -import java.util.Collections; - /** * @author Edwin Punzalan */ -public class CompilerStub - implements org.codehaus.plexus.compiler.Compiler -{ +public class CompilerStub implements org.codehaus.plexus.compiler.Compiler { private boolean shouldFail; - public CompilerStub() - { - this( false ); + public CompilerStub() { + this(false); } - public CompilerStub( boolean shouldFail ) - { + public CompilerStub(boolean shouldFail) { this.shouldFail = shouldFail; } - public CompilerOutputStyle getCompilerOutputStyle() - { + public CompilerOutputStyle getCompilerOutputStyle() { return CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES; } - public String getInputFileEnding( CompilerConfiguration compilerConfiguration ) - { + public String getInputFileEnding(CompilerConfiguration compilerConfiguration) { return "java"; } - public String getOutputFileEnding( CompilerConfiguration compilerConfiguration ) - { + public String getOutputFileEnding(CompilerConfiguration compilerConfiguration) { return "class"; } - public String getOutputFile( CompilerConfiguration compilerConfiguration ) - { + public String getOutputFile(CompilerConfiguration compilerConfiguration) { return "output-file"; } - public boolean canUpdateTarget( CompilerConfiguration compilerConfiguration ) - { + public boolean canUpdateTarget(CompilerConfiguration compilerConfiguration) { return false; } - public CompilerResult performCompile( CompilerConfiguration compilerConfiguration ) - throws CompilerException - { - File outputDir = new File( compilerConfiguration.getOutputLocation() ); + public CompilerResult performCompile(CompilerConfiguration compilerConfiguration) throws CompilerException { + File outputDir = new File(compilerConfiguration.getOutputLocation()); - try - { + try { outputDir.mkdirs(); - File outputFile = new File( outputDir, "compiled.class" ); - if ( !outputFile.exists() && !outputFile.createNewFile() ) - { - throw new CompilerException( "could not create output file: " + outputFile.getAbsolutePath() ); + File outputFile = new File(outputDir, "compiled.class"); + if (!outputFile.exists() && !outputFile.createNewFile()) { + throw new CompilerException("could not create output file: " + outputFile.getAbsolutePath()); } + } catch (IOException e) { + throw new CompilerException("An exception occurred while creating output file", e); } - catch ( IOException e ) - { - throw new CompilerException( "An exception occurred while creating output file", e ); - } - - return new CompilerResult( !shouldFail, - Collections.singletonList( new CompilerMessage( "message 1", CompilerMessage.Kind.OTHER ) ) ); + + return new CompilerResult( + !shouldFail, Collections.singletonList(new CompilerMessage("message 1", CompilerMessage.Kind.OTHER))); } - public String[] createCommandLine( CompilerConfiguration compilerConfiguration ) - { + public String[] createCommandLine(CompilerConfiguration compilerConfiguration) { return new String[0]; } } diff --git a/src/test/java/org/apache/maven/plugin/compiler/stubs/DebugEnabledLog.java b/src/test/java/org/apache/maven/plugin/compiler/stubs/DebugEnabledLog.java index 5655c67a..4663fa18 100644 --- a/src/test/java/org/apache/maven/plugin/compiler/stubs/DebugEnabledLog.java +++ b/src/test/java/org/apache/maven/plugin/compiler/stubs/DebugEnabledLog.java @@ -1,5 +1,3 @@ -package org.apache.maven.plugin.compiler.stubs; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,22 +16,19 @@ * specific language governing permissions and limitations * under the License. */ +package org.apache.maven.plugin.compiler.stubs; import org.apache.maven.plugin.logging.SystemStreamLog; /** * @author Edwin Punzalan */ -public class DebugEnabledLog - extends SystemStreamLog -{ - public DebugEnabledLog() - { +public class DebugEnabledLog extends SystemStreamLog { + public DebugEnabledLog() { super(); } - public boolean isDebugEnabled() - { + public boolean isDebugEnabled() { return true; } } diff --git a/src/test/resources/unit/compiler-args-test/src/main/java/TestCompile0.java b/src/test/resources/unit/compiler-args-test/src/main/java/TestCompile0.java index 959bdc77..1ccfd289 100644 --- a/src/test/resources/unit/compiler-args-test/src/main/java/TestCompile0.java +++ b/src/test/resources/unit/compiler-args-test/src/main/java/TestCompile0.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile0 -{ +public class TestCompile0 { - public TestCompile0() - { + public TestCompile0() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-args-test/src/test/java/TestCompile0Test.java b/src/test/resources/unit/compiler-args-test/src/test/java/TestCompile0Test.java index e4a02f7d..837ab649 100644 --- a/src/test/resources/unit/compiler-args-test/src/test/java/TestCompile0Test.java +++ b/src/test/resources/unit/compiler-args-test/src/test/java/TestCompile0Test.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile0Test - extends TestCase -{ - public void testCompile0Test() - { +public class TestCompile0Test extends TestCase { + public void testCompile0Test() { TestCompile0 test = new TestCompile0(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-basic-sourcetarget/src/main/java/TestCompile0.java b/src/test/resources/unit/compiler-basic-sourcetarget/src/main/java/TestCompile0.java index 959bdc77..1ccfd289 100644 --- a/src/test/resources/unit/compiler-basic-sourcetarget/src/main/java/TestCompile0.java +++ b/src/test/resources/unit/compiler-basic-sourcetarget/src/main/java/TestCompile0.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile0 -{ +public class TestCompile0 { - public TestCompile0() - { + public TestCompile0() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-basic-test/src/main/java/TestCompile0.java b/src/test/resources/unit/compiler-basic-test/src/main/java/TestCompile0.java index 959bdc77..1ccfd289 100644 --- a/src/test/resources/unit/compiler-basic-test/src/main/java/TestCompile0.java +++ b/src/test/resources/unit/compiler-basic-test/src/main/java/TestCompile0.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile0 -{ +public class TestCompile0 { - public TestCompile0() - { + public TestCompile0() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-basic-test/src/test/java/TestCompile0Test.java b/src/test/resources/unit/compiler-basic-test/src/test/java/TestCompile0Test.java index e4a02f7d..837ab649 100644 --- a/src/test/resources/unit/compiler-basic-test/src/test/java/TestCompile0Test.java +++ b/src/test/resources/unit/compiler-basic-test/src/test/java/TestCompile0Test.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile0Test - extends TestCase -{ - public void testCompile0Test() - { +public class TestCompile0Test extends TestCase { + public void testCompile0Test() { TestCompile0 test = new TestCompile0(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-fail-test/src/main/java/TestCompile0.java b/src/test/resources/unit/compiler-fail-test/src/main/java/TestCompile0.java index 959bdc77..1ccfd289 100644 --- a/src/test/resources/unit/compiler-fail-test/src/main/java/TestCompile0.java +++ b/src/test/resources/unit/compiler-fail-test/src/main/java/TestCompile0.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile0 -{ +public class TestCompile0 { - public TestCompile0() - { + public TestCompile0() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-fail-test/src/test/java/TestCompile0Test.java b/src/test/resources/unit/compiler-fail-test/src/test/java/TestCompile0Test.java index e4a02f7d..837ab649 100644 --- a/src/test/resources/unit/compiler-fail-test/src/test/java/TestCompile0Test.java +++ b/src/test/resources/unit/compiler-fail-test/src/test/java/TestCompile0Test.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile0Test - extends TestCase -{ - public void testCompile0Test() - { +public class TestCompile0Test extends TestCase { + public void testCompile0Test() { TestCompile0 test = new TestCompile0(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-failonerror-test/src/main/java/TestCompile0.java b/src/test/resources/unit/compiler-failonerror-test/src/main/java/TestCompile0.java index 959bdc77..1ccfd289 100644 --- a/src/test/resources/unit/compiler-failonerror-test/src/main/java/TestCompile0.java +++ b/src/test/resources/unit/compiler-failonerror-test/src/main/java/TestCompile0.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile0 -{ +public class TestCompile0 { - public TestCompile0() - { + public TestCompile0() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-failonerror-test/src/test/java/TestCompile0Test.java b/src/test/resources/unit/compiler-failonerror-test/src/test/java/TestCompile0Test.java index e4a02f7d..837ab649 100644 --- a/src/test/resources/unit/compiler-failonerror-test/src/test/java/TestCompile0Test.java +++ b/src/test/resources/unit/compiler-failonerror-test/src/test/java/TestCompile0Test.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile0Test - extends TestCase -{ - public void testCompile0Test() - { +public class TestCompile0Test extends TestCase { + public void testCompile0Test() { TestCompile0 test = new TestCompile0(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-fork-test/src/main/java/TestCompile1.java b/src/test/resources/unit/compiler-fork-test/src/main/java/TestCompile1.java index c694c3fc..bbc5f788 100644 --- a/src/test/resources/unit/compiler-fork-test/src/main/java/TestCompile1.java +++ b/src/test/resources/unit/compiler-fork-test/src/main/java/TestCompile1.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile1 -{ +public class TestCompile1 { - public TestCompile1() - { + public TestCompile1() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-fork-test/src/test/java/TestCompile1TestCase.java b/src/test/resources/unit/compiler-fork-test/src/test/java/TestCompile1TestCase.java index cf276f99..14288af1 100644 --- a/src/test/resources/unit/compiler-fork-test/src/test/java/TestCompile1TestCase.java +++ b/src/test/resources/unit/compiler-fork-test/src/test/java/TestCompile1TestCase.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile1TestCase - extends TestCase -{ - public void testCompile1() - { +public class TestCompile1TestCase extends TestCase { + public void testCompile1() { TestCompile1 test = new TestCompile1(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-includes-excludes-test/src/main/java/TestCompile2.java b/src/test/resources/unit/compiler-includes-excludes-test/src/main/java/TestCompile2.java index ff8fa234..6e2a6ec2 100644 --- a/src/test/resources/unit/compiler-includes-excludes-test/src/main/java/TestCompile2.java +++ b/src/test/resources/unit/compiler-includes-excludes-test/src/main/java/TestCompile2.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile2 -{ +public class TestCompile2 { - public TestCompile2() - { + public TestCompile2() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-includes-excludes-test/src/main/java/TestCompile3.java b/src/test/resources/unit/compiler-includes-excludes-test/src/main/java/TestCompile3.java index e618ca9a..2f33e30e 100644 --- a/src/test/resources/unit/compiler-includes-excludes-test/src/main/java/TestCompile3.java +++ b/src/test/resources/unit/compiler-includes-excludes-test/src/main/java/TestCompile3.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile3 -{ +public class TestCompile3 { - public TestCompile3() - { + public TestCompile3() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-includes-excludes-test/src/main/java/TestCompile4.java b/src/test/resources/unit/compiler-includes-excludes-test/src/main/java/TestCompile4.java index 779c8d0a..7e519324 100644 --- a/src/test/resources/unit/compiler-includes-excludes-test/src/main/java/TestCompile4.java +++ b/src/test/resources/unit/compiler-includes-excludes-test/src/main/java/TestCompile4.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile4 -{ +public class TestCompile4 { - public TestCompile4() - { + public TestCompile4() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-includes-excludes-test/src/test/java/TestCompile2TestCase.java b/src/test/resources/unit/compiler-includes-excludes-test/src/test/java/TestCompile2TestCase.java index b0520395..ea864c36 100644 --- a/src/test/resources/unit/compiler-includes-excludes-test/src/test/java/TestCompile2TestCase.java +++ b/src/test/resources/unit/compiler-includes-excludes-test/src/test/java/TestCompile2TestCase.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile2TestCase - extends TestCase -{ - public void testCompile2() - { +public class TestCompile2TestCase extends TestCase { + public void testCompile2() { TestCompile2 test = new TestCompile2(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-includes-excludes-test/src/test/java/TestCompile3TestCase.java b/src/test/resources/unit/compiler-includes-excludes-test/src/test/java/TestCompile3TestCase.java index 9f77f435..4f1fe01c 100644 --- a/src/test/resources/unit/compiler-includes-excludes-test/src/test/java/TestCompile3TestCase.java +++ b/src/test/resources/unit/compiler-includes-excludes-test/src/test/java/TestCompile3TestCase.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile3TestCase - extends TestCase -{ - public void testCompile3() - { +public class TestCompile3TestCase extends TestCase { + public void testCompile3() { TestCompile3 test = new TestCompile3(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-includes-excludes-test/src/test/java/TestCompile4TestCase.java b/src/test/resources/unit/compiler-includes-excludes-test/src/test/java/TestCompile4TestCase.java index 2210fc13..c357cb87 100644 --- a/src/test/resources/unit/compiler-includes-excludes-test/src/test/java/TestCompile4TestCase.java +++ b/src/test/resources/unit/compiler-includes-excludes-test/src/test/java/TestCompile4TestCase.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile4TestCase - extends TestCase -{ - public void testCompile4() - { +public class TestCompile4TestCase extends TestCase { + public void testCompile4() { TestCompile4 test = new TestCompile4(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-one-output-file-test/src/main/java/TestCompile2.java b/src/test/resources/unit/compiler-one-output-file-test/src/main/java/TestCompile2.java index ff8fa234..6e2a6ec2 100644 --- a/src/test/resources/unit/compiler-one-output-file-test/src/main/java/TestCompile2.java +++ b/src/test/resources/unit/compiler-one-output-file-test/src/main/java/TestCompile2.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile2 -{ +public class TestCompile2 { - public TestCompile2() - { + public TestCompile2() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-one-output-file-test/src/main/java/TestCompile3.java b/src/test/resources/unit/compiler-one-output-file-test/src/main/java/TestCompile3.java index e618ca9a..2f33e30e 100644 --- a/src/test/resources/unit/compiler-one-output-file-test/src/main/java/TestCompile3.java +++ b/src/test/resources/unit/compiler-one-output-file-test/src/main/java/TestCompile3.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile3 -{ +public class TestCompile3 { - public TestCompile3() - { + public TestCompile3() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-one-output-file-test/src/main/java/TestCompile4.java b/src/test/resources/unit/compiler-one-output-file-test/src/main/java/TestCompile4.java index 779c8d0a..7e519324 100644 --- a/src/test/resources/unit/compiler-one-output-file-test/src/main/java/TestCompile4.java +++ b/src/test/resources/unit/compiler-one-output-file-test/src/main/java/TestCompile4.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile4 -{ +public class TestCompile4 { - public TestCompile4() - { + public TestCompile4() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-one-output-file-test/src/test/java/TestCompile2TestCase.java b/src/test/resources/unit/compiler-one-output-file-test/src/test/java/TestCompile2TestCase.java index b0520395..ea864c36 100644 --- a/src/test/resources/unit/compiler-one-output-file-test/src/test/java/TestCompile2TestCase.java +++ b/src/test/resources/unit/compiler-one-output-file-test/src/test/java/TestCompile2TestCase.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile2TestCase - extends TestCase -{ - public void testCompile2() - { +public class TestCompile2TestCase extends TestCase { + public void testCompile2() { TestCompile2 test = new TestCompile2(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-one-output-file-test/src/test/java/TestCompile3TestCase.java b/src/test/resources/unit/compiler-one-output-file-test/src/test/java/TestCompile3TestCase.java index 9f77f435..4f1fe01c 100644 --- a/src/test/resources/unit/compiler-one-output-file-test/src/test/java/TestCompile3TestCase.java +++ b/src/test/resources/unit/compiler-one-output-file-test/src/test/java/TestCompile3TestCase.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile3TestCase - extends TestCase -{ - public void testCompile3() - { +public class TestCompile3TestCase extends TestCase { + public void testCompile3() { TestCompile3 test = new TestCompile3(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-one-output-file-test/src/test/java/TestCompile4TestCase.java b/src/test/resources/unit/compiler-one-output-file-test/src/test/java/TestCompile4TestCase.java index 2210fc13..c357cb87 100644 --- a/src/test/resources/unit/compiler-one-output-file-test/src/test/java/TestCompile4TestCase.java +++ b/src/test/resources/unit/compiler-one-output-file-test/src/test/java/TestCompile4TestCase.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile4TestCase - extends TestCase -{ - public void testCompile4() - { +public class TestCompile4TestCase extends TestCase { + public void testCompile4() { TestCompile4 test = new TestCompile4(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-one-output-file-test2/src/main/java/TestCompile2.java b/src/test/resources/unit/compiler-one-output-file-test2/src/main/java/TestCompile2.java index e187e0c4..6e2a6ec2 100644 --- a/src/test/resources/unit/compiler-one-output-file-test2/src/main/java/TestCompile2.java +++ b/src/test/resources/unit/compiler-one-output-file-test2/src/main/java/TestCompile2.java @@ -18,12 +18,10 @@ */ package foo; -public class TestCompile2 -{ +public class TestCompile2 { - public TestCompile2() - { + public TestCompile2() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-one-output-file-test2/src/main/java/TestCompile3.java b/src/test/resources/unit/compiler-one-output-file-test2/src/main/java/TestCompile3.java index e618ca9a..2f33e30e 100644 --- a/src/test/resources/unit/compiler-one-output-file-test2/src/main/java/TestCompile3.java +++ b/src/test/resources/unit/compiler-one-output-file-test2/src/main/java/TestCompile3.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile3 -{ +public class TestCompile3 { - public TestCompile3() - { + public TestCompile3() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-one-output-file-test2/src/main/java/TestCompile4.java b/src/test/resources/unit/compiler-one-output-file-test2/src/main/java/TestCompile4.java index 779c8d0a..7e519324 100644 --- a/src/test/resources/unit/compiler-one-output-file-test2/src/main/java/TestCompile4.java +++ b/src/test/resources/unit/compiler-one-output-file-test2/src/main/java/TestCompile4.java @@ -18,13 +18,10 @@ */ package foo; -public class TestCompile4 -{ +public class TestCompile4 { - public TestCompile4() - { + public TestCompile4() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-one-output-file-test2/src/test/java/TestCompile2TestCase.java b/src/test/resources/unit/compiler-one-output-file-test2/src/test/java/TestCompile2TestCase.java index b0520395..ea864c36 100644 --- a/src/test/resources/unit/compiler-one-output-file-test2/src/test/java/TestCompile2TestCase.java +++ b/src/test/resources/unit/compiler-one-output-file-test2/src/test/java/TestCompile2TestCase.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile2TestCase - extends TestCase -{ - public void testCompile2() - { +public class TestCompile2TestCase extends TestCase { + public void testCompile2() { TestCompile2 test = new TestCompile2(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-one-output-file-test2/src/test/java/TestCompile3TestCase.java b/src/test/resources/unit/compiler-one-output-file-test2/src/test/java/TestCompile3TestCase.java index 9f77f435..4f1fe01c 100644 --- a/src/test/resources/unit/compiler-one-output-file-test2/src/test/java/TestCompile3TestCase.java +++ b/src/test/resources/unit/compiler-one-output-file-test2/src/test/java/TestCompile3TestCase.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile3TestCase - extends TestCase -{ - public void testCompile3() - { +public class TestCompile3TestCase extends TestCase { + public void testCompile3() { TestCompile3 test = new TestCompile3(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-one-output-file-test2/src/test/java/TestCompile4TestCase.java b/src/test/resources/unit/compiler-one-output-file-test2/src/test/java/TestCompile4TestCase.java index 2210fc13..c357cb87 100644 --- a/src/test/resources/unit/compiler-one-output-file-test2/src/test/java/TestCompile4TestCase.java +++ b/src/test/resources/unit/compiler-one-output-file-test2/src/test/java/TestCompile4TestCase.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestCompile4TestCase - extends TestCase -{ - public void testCompile4() - { +public class TestCompile4TestCase extends TestCase { + public void testCompile4() { TestCompile4 test = new TestCompile4(); } -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-skip-main/src/main/java/TestSkipMainCompile0.java b/src/test/resources/unit/compiler-skip-main/src/main/java/TestSkipMainCompile0.java index a7805d70..2a118bf2 100644 --- a/src/test/resources/unit/compiler-skip-main/src/main/java/TestSkipMainCompile0.java +++ b/src/test/resources/unit/compiler-skip-main/src/main/java/TestSkipMainCompile0.java @@ -18,13 +18,10 @@ */ package foo; -public class TestSkipMainCompile0 -{ +public class TestSkipMainCompile0 { - public TestSkipMainCompile0() - { + public TestSkipMainCompile0() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-skip-main/src/test/java/TestSkipMainCompile0Test.java b/src/test/resources/unit/compiler-skip-main/src/test/java/TestSkipMainCompile0Test.java index d3d66b49..e6c7d965 100644 --- a/src/test/resources/unit/compiler-skip-main/src/test/java/TestSkipMainCompile0Test.java +++ b/src/test/resources/unit/compiler-skip-main/src/test/java/TestSkipMainCompile0Test.java @@ -20,11 +20,6 @@ import junit.framework.TestCase; -public class TestSkipMainCompile0Test - extends TestCase -{ - public void testSkipMainCompile0Test() - { - - } -} \ No newline at end of file +public class TestSkipMainCompile0Test extends TestCase { + public void testSkipMainCompile0Test() {} +} diff --git a/src/test/resources/unit/compiler-skip-test/src/main/java/TestSkipTestCompile0.java b/src/test/resources/unit/compiler-skip-test/src/main/java/TestSkipTestCompile0.java index 08911a95..ebb007e2 100644 --- a/src/test/resources/unit/compiler-skip-test/src/main/java/TestSkipTestCompile0.java +++ b/src/test/resources/unit/compiler-skip-test/src/main/java/TestSkipTestCompile0.java @@ -18,13 +18,10 @@ */ package foo; -public class TestSkipTestCompile0 -{ +public class TestSkipTestCompile0 { - public TestSkipTestCompile0() - { + public TestSkipTestCompile0() { - System.out.println( "Woo Hoo!" ); + System.out.println("Woo Hoo!"); } - -} \ No newline at end of file +} diff --git a/src/test/resources/unit/compiler-skip-test/src/test/java/TestSkipTestCompile0Test.java b/src/test/resources/unit/compiler-skip-test/src/test/java/TestSkipTestCompile0Test.java index 0c64e554..d316c10d 100644 --- a/src/test/resources/unit/compiler-skip-test/src/test/java/TestSkipTestCompile0Test.java +++ b/src/test/resources/unit/compiler-skip-test/src/test/java/TestSkipTestCompile0Test.java @@ -20,11 +20,8 @@ import junit.framework.TestCase; -public class TestSkipTestCompile0Test - extends TestCase -{ - public void testSkipTestCompile0Test() - { +public class TestSkipTestCompile0Test extends TestCase { + public void testSkipTestCompile0Test() { TestSkipTestCompile0 test = new TestSkipTestCompile0(); } -} \ No newline at end of file +}