From 4c7e541eb1d6f399e70eab3d2bd261d15a5666e8 Mon Sep 17 00:00:00 2001 From: Daniil Ovchinnikov Date: Fri, 18 Jan 2019 18:40:35 +0300 Subject: [PATCH] clean up --- .../HeavySmartTypeCompletion15Test.groovy | 80 ++++++++----------- .../HighlightUsagesHandlerTest.groovy | 20 +---- .../intention/AddImportActionTest.groovy | 18 +---- .../impl/FileTemplatesTest.groovy | 4 +- .../JavaRearrangerByNameTest.groovy | 18 +---- .../intellij/build/LibraryLicense.groovy | 22 +---- .../jetbrains/intellij/build/OsFamily.groovy | 14 ++-- .../intellij/build/impl/BuildTasksImpl.groovy | 2 +- .../intellij/build/impl/LayoutBuilder.groovy | 20 +---- .../build/impl/MacDistributionBuilder.groovy | 18 +---- .../build/impl/MavenArtifactsBuilder.groovy | 4 +- .../build/impl/NsisFileListGenerator.groovy | 22 +---- .../logging/IntelliJBuildException.groovy | 8 +- .../openapi/util/RecursionManagerTest.groovy | 20 +---- .../daemon/GradleDaemonServices.groovy | 4 +- .../builder/ExternalProjectBuilderImpl.groovy | 18 +---- .../groovy/compiler/GroovyCompilerTest.groovy | 4 +- .../groovy/compiler/GroovyDebuggerTest.groovy | 18 +---- .../JavaWithGroovyCompletionTest.groovy | 18 +---- .../lang/GroovyLiveTemplatesTest.groovy | 20 +---- ...FindOverridingMethodsAndClassesTest.groovy | 18 +---- .../lang/resolve/NumberMathTypingTest.groovy | 18 +---- .../dgm/ResolveExtensionMethodTest.groovy | 4 +- .../copy/GroovyCopyClassTest.groovy | 18 +---- .../maven/dom/MavenSurefirePluginTest.groovy | 20 +---- 25 files changed, 96 insertions(+), 334 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/HeavySmartTypeCompletion15Test.groovy b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/HeavySmartTypeCompletion15Test.groovy index 918f0098f874..3e8b8460e4ed 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/HeavySmartTypeCompletion15Test.groovy +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/HeavySmartTypeCompletion15Test.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.java.codeInsight.completion import com.intellij.JavaTestUtil @@ -25,79 +11,79 @@ import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase import groovy.transform.CompileStatic @CompileStatic -public class HeavySmartTypeCompletion15Test extends JavaCodeInsightFixtureTestCase { - private static final String BASE_PATH = "/codeInsight/completion/smartType"; +class HeavySmartTypeCompletion15Test extends JavaCodeInsightFixtureTestCase { + private static final String BASE_PATH = "/codeInsight/completion/smartType" @Override protected String getTestDataPath() { - return JavaTestUtil.getJavaTestDataPath(); + return JavaTestUtil.getJavaTestDataPath() } - public void testGetInstance() throws Throwable { + void testGetInstance() throws Throwable { myFixture.configureFromExistingVirtualFile( - myFixture.copyFileToProject(BASE_PATH + "/foo/" + getTestName(false) + ".java", "foo/" + getTestName(false) + ".java")); - myFixture.complete(CompletionType.SMART); - myFixture.type('\n'); - myFixture.checkResultByFile(BASE_PATH + "/foo/" + getTestName(false) + "-out.java"); + myFixture.copyFileToProject(BASE_PATH + "/foo/" + getTestName(false) + ".java", "foo/" + getTestName(false) + ".java")) + myFixture.complete(CompletionType.SMART) + myFixture.type('\n') + myFixture.checkResultByFile(BASE_PATH + "/foo/" + getTestName(false) + "-out.java") } - public void testProtectedAnonymousConstructor() throws Throwable { + void testProtectedAnonymousConstructor() throws Throwable { myFixture.addClass("package pkg;" + "public class Foo {" + " protected Foo(int a) {}" + - "}"); + "}") myFixture.addClass("package pkg;" + "public class Bar {" + " protected Bar(java.util.List list) {}" + - "}"); - doTest(); + "}") + doTest() } - public void testProtectedAnonymousConstructor2() throws Throwable { + void testProtectedAnonymousConstructor2() throws Throwable { myFixture.addClass("package pkg;" + "public class Foo {" + " protected Foo(int a) {}" + - "}"); + "}") myFixture.addClass("package pkg;" + "public class Bar {" + " protected Bar(java.util.List list) {}" + - "}"); - doTest(); + "}") + doTest() } - public void testUnlockDocument() throws Throwable { - myFixture.addClass("package pkg; public class Bar {}"); + void testUnlockDocument() throws Throwable { + myFixture.addClass("package pkg; public class Bar {}") myFixture.addClass("package pkg; public class Foo {" + " public static void foo(java.util.List list) {}" + - "}"); + "}") - doTest(); + doTest() } private void doTest() throws Exception { - configure(); - checkResult(); + configure() + checkResult() } private void checkResult() { - myFixture.checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + myFixture.checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java") } private void configure() { - myFixture.configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); - myFixture.complete(CompletionType.SMART); + myFixture.configureByFile(BASE_PATH + "/" + getTestName(false) + ".java") + myFixture.complete(CompletionType.SMART) } - public void testClassLiteralShouldInsertImport() throws Throwable { - myFixture.addClass("package bar; public class Intf {}"); - myFixture.addClass("package foo; public class Bar extends bar.Intf {}"); + void testClassLiteralShouldInsertImport() throws Throwable { + myFixture.addClass("package bar; public class Intf {}") + myFixture.addClass("package foo; public class Bar extends bar.Intf {}") - configure(); - myFixture.type('\n'); - checkResult(); + configure() + myFixture.type('\n') + checkResult() } - public void testInaccessibleClassAfterNew() { + void testInaccessibleClassAfterNew() { Module moduleA = PsiTestUtil.addModule(project, StdModuleTypes.JAVA, 'A', myFixture.tempDirFixture.findOrCreateDir("a")) Module moduleB = PsiTestUtil.addModule(project, StdModuleTypes.JAVA, 'B', myFixture.tempDirFixture.findOrCreateDir("b")) diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/highlighting/HighlightUsagesHandlerTest.groovy b/java/java-tests/testSrc/com/intellij/java/codeInsight/highlighting/HighlightUsagesHandlerTest.groovy index 2a0d3920f2d6..9315913f2653 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/highlighting/HighlightUsagesHandlerTest.groovy +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/highlighting/HighlightUsagesHandlerTest.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.java.codeInsight.highlighting import com.intellij.JavaTestUtil @@ -191,8 +177,8 @@ class HighlightUsagesHandlerTest extends LightCodeInsightFixtureTestCase { } void testSuppressedWarningsInInjectionHighlights() { - MyTestInjector testInjector = new MyTestInjector(getPsiManager()); - testInjector.injectAll(myFixture.getTestRootDisposable()); + MyTestInjector testInjector = new MyTestInjector(getPsiManager()) + testInjector.injectAll(myFixture.getTestRootDisposable()) myFixture.configureByText 'Foo.java', ''' public class Foo { public static void a(boolean b, String c) { diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/intention/AddImportActionTest.groovy b/java/java-tests/testSrc/com/intellij/java/codeInsight/intention/AddImportActionTest.groovy index 935f0759e355..2e79a48ea320 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/intention/AddImportActionTest.groovy +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/intention/AddImportActionTest.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.java.codeInsight.intention import com.intellij.codeInsight.daemon.impl.quickfix.ImportClassFix @@ -591,7 +577,7 @@ class Tq { void setUp() throws Exception { super.setUp() settings = CodeStyleSettingsManager.getSettings(getProject()).getCommonSettings(JavaLanguage.INSTANCE) - JavaCodeStyleSettings javaSettings = JavaCodeStyleSettings.getInstance(getProject()); + JavaCodeStyleSettings javaSettings = JavaCodeStyleSettings.getInstance(getProject()) javaSettings.CLASS_NAMES_IN_JAVADOC = JavaCodeStyleSettings.SHORTEN_NAMES_ALWAYS_AND_ADD_IMPORT } diff --git a/java/java-tests/testSrc/com/intellij/java/ide/fileTemplates/impl/FileTemplatesTest.groovy b/java/java-tests/testSrc/com/intellij/java/ide/fileTemplates/impl/FileTemplatesTest.groovy index 00e293eb2964..83523806b533 100644 --- a/java/java-tests/testSrc/com/intellij/java/ide/fileTemplates/impl/FileTemplatesTest.groovy +++ b/java/java-tests/testSrc/com/intellij/java/ide/fileTemplates/impl/FileTemplatesTest.groovy @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.java.ide.fileTemplates.impl import com.intellij.ide.fileTemplates.CreateFromTemplateHandler @@ -164,7 +164,7 @@ class FileTemplatesTest extends IdeaTestCase { void testFileNameTrimming() { CreateFromTemplateHandler handler = new DefaultCreateFromTemplateHandler() - PlatformTestUtil.registerExtension(Extensions.getRootArea(), CreateFromTemplateHandler.EP_NAME, handler, getTestRootDisposable()); + PlatformTestUtil.registerExtension(Extensions.getRootArea(), CreateFromTemplateHandler.EP_NAME, handler, getTestRootDisposable()) FileTemplate template = FileTemplateManager.getInstance(getProject()).addTemplate(name, "txt") disposeOnTearDown({ FileTemplateManager.getInstance(getProject()).removeTemplate(template) } as Disposable) template.setText('${FILE_NAME}') diff --git a/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/arrangement/JavaRearrangerByNameTest.groovy b/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/arrangement/JavaRearrangerByNameTest.groovy index b174e1a518be..0322705c16c3 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/arrangement/JavaRearrangerByNameTest.groovy +++ b/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/arrangement/JavaRearrangerByNameTest.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.java.psi.codeStyle.arrangement import com.intellij.application.options.CodeStyle @@ -97,7 +83,7 @@ class Test { void "test with formatting disabled"() { CodeStyleSettings settings = CodeStyle.getSettings(project) - NamedScopeDescriptor descriptor = new NamedScopeDescriptor("testScope"); + NamedScopeDescriptor descriptor = new NamedScopeDescriptor("testScope") descriptor.setPattern("file:*.java") settings.getExcludedFiles().addDescriptor(descriptor) diff --git a/platform/build-scripts/groovy/org/jetbrains/intellij/build/LibraryLicense.groovy b/platform/build-scripts/groovy/org/jetbrains/intellij/build/LibraryLicense.groovy index b6206089b23f..7dd22a797c5c 100644 --- a/platform/build-scripts/groovy/org/jetbrains/intellij/build/LibraryLicense.groovy +++ b/platform/build-scripts/groovy/org/jetbrains/intellij/build/LibraryLicense.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.intellij.build import com.intellij.util.containers.ContainerUtil @@ -74,15 +60,15 @@ class LibraryLicense { */ final String licenseUrl - public static jetbrainsLibrary(String libraryName) { + static jetbrainsLibrary(String libraryName) { new LibraryLicense(name: libraryName, license: JETBRAINS_OWN) } - public List getLibraryNames() { + List getLibraryNames() { return ContainerUtil.createMaybeSingletonList(libraryName ?: name) + (additionalLibraryNames ?: [] as List) } - public String getLibraryLicenseUrl() { + String getLibraryLicenseUrl() { licenseUrl ?: PREDEFINED_LICENSE_URLS[license] } } \ No newline at end of file diff --git a/platform/build-scripts/groovy/org/jetbrains/intellij/build/OsFamily.groovy b/platform/build-scripts/groovy/org/jetbrains/intellij/build/OsFamily.groovy index 2e58fbc9b19a..4e580fbc627d 100644 --- a/platform/build-scripts/groovy/org/jetbrains/intellij/build/OsFamily.groovy +++ b/platform/build-scripts/groovy/org/jetbrains/intellij/build/OsFamily.groovy @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.intellij.build @@ -11,13 +11,13 @@ enum OsFamily { MACOS("mac", BuildOptions.OS_MAC, "macOS"), LINUX("unix", BuildOptions.OS_LINUX, "Linux"); - final String distSuffix; - final String osId; - final String osName; + final String distSuffix + final String osId + final String osName OsFamily(@NotNull String distSuffix, @NotNull String osId, @NotNull String osName) { - this.distSuffix = distSuffix; - this.osId = osId; - this.osName = osName; + this.distSuffix = distSuffix + this.osId = osId + this.osName = osName } } \ No newline at end of file diff --git a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/BuildTasksImpl.groovy b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/BuildTasksImpl.groovy index fd3791fce036..cc2b88a1e091 100644 --- a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/BuildTasksImpl.groovy +++ b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/BuildTasksImpl.groovy @@ -264,7 +264,7 @@ idea.fatal.error.notification=disabled productLayout.mainModules + buildContext.productProperties.mavenArtifacts.additionalModules, buildContext.productProperties.modulesToCompileTests) - def pluginsToPublish = new LinkedHashMap(); + def pluginsToPublish = new LinkedHashMap() for (PluginLayout plugin : DistributionJARsBuilder.getPluginsByModules(buildContext, buildContext.productProperties.productLayout.pluginModulesToPublish)) { def publishingSpec = buildContext.productProperties.productLayout.getPluginPublishingSpec(plugin.mainModule) if (publishingSpec == null) { diff --git a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/LayoutBuilder.groovy b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/LayoutBuilder.groovy index 88110b759bc0..46692fec02fe 100644 --- a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/LayoutBuilder.groovy +++ b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/LayoutBuilder.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. @@ -46,7 +32,7 @@ class LayoutBuilder { this.context = context this.compressJars = compressJars - def contextLoaderRef = "GANT_CONTEXT_CLASS_LOADER"; + def contextLoaderRef = "GANT_CONTEXT_CLASS_LOADER" if (!ant.project.hasReference(contextLoaderRef)) { ClassLoader contextLoader = Thread.currentThread().contextClassLoader if (!(contextLoader instanceof AntClassLoader)) { @@ -244,7 +230,7 @@ class LayoutBuilder { if (name.startsWith("#")) { if (lib.getRoots(JpsOrderRootType.COMPILED).size() != 1) { def urls = lib.getRoots(JpsOrderRootType.COMPILED).collect { it.url } - throw new IllegalStateException("Non-single entry module library $name: $urls"); + throw new IllegalStateException("Non-single entry module library $name: $urls") } File file = lib.getFiles(JpsOrderRootType.COMPILED)[0] return file.name diff --git a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/MacDistributionBuilder.groovy b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/MacDistributionBuilder.groovy index 9d26ce5b24b7..330747635fde 100644 --- a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/MacDistributionBuilder.groovy +++ b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/MacDistributionBuilder.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.intellij.build.impl import org.jetbrains.intellij.build.* @@ -73,7 +59,7 @@ class MacDistributionBuilder extends OsSpecificDistributionBuilder { """ } - return iprAssociation + associations + customizer.additionalDocTypes; + return iprAssociation + associations + customizer.additionalDocTypes } @Override diff --git a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/MavenArtifactsBuilder.groovy b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/MavenArtifactsBuilder.groovy index 9c6ffca67293..f1f35c91295d 100644 --- a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/MavenArtifactsBuilder.groovy +++ b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/MavenArtifactsBuilder.groovy @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.intellij.build.impl import com.intellij.openapi.util.io.FileUtil @@ -137,7 +137,7 @@ class MavenArtifactsBuilder { def words = NameUtil.splitNameIntoWords(s) def result = new ArrayList() for (int i = 0; i < words.length; i++) { - String next; + String next if (i < words.length - 1 && Character.isDigit(words[i + 1].charAt(0))) { next = words[i] + words[i+1] i++ diff --git a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/NsisFileListGenerator.groovy b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/NsisFileListGenerator.groovy index 2e76ad07a97b..cdf42fb2d2ab 100644 --- a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/NsisFileListGenerator.groovy +++ b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/NsisFileListGenerator.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.intellij.build.impl import com.intellij.openapi.util.io.FileUtil @@ -60,8 +46,8 @@ class NsisFileListGenerator { directoryToFiles.keySet().toSorted().reverseEach { if (!it.empty) { - out.writeLine("RmDir /r \"${installDir}\\${toWinPath(it)}\\__pycache__\""); - out.writeLine("RmDir \"${installDir}\\${toWinPath(it)}\""); + out.writeLine("RmDir /r \"${installDir}\\${toWinPath(it)}\\__pycache__\"") + out.writeLine("RmDir \"${installDir}\\${toWinPath(it)}\"") } } out.writeLine("RmDir \"${installDir}\"") @@ -69,7 +55,7 @@ class NsisFileListGenerator { } private static String toWinPath(String dir) { - return dir.replace('/', '\\'); + return dir.replace('/', '\\') } diff --git a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/logging/IntelliJBuildException.groovy b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/logging/IntelliJBuildException.groovy index 3c0c4eff912c..0249d6764d2e 100644 --- a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/logging/IntelliJBuildException.groovy +++ b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/logging/IntelliJBuildException.groovy @@ -1,12 +1,12 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.intellij.build.impl.logging -import groovy.transform.CompileStatic; -import org.apache.tools.ant.BuildException; +import groovy.transform.CompileStatic +import org.apache.tools.ant.BuildException @CompileStatic class IntelliJBuildException extends BuildException { IntelliJBuildException(String location, String message, Throwable cause) { - super(location == null || location.isEmpty() ? message : location + ': ' + message, cause); + super(location == null || location.isEmpty() ? message : location + ': ' + message, cause) } } diff --git a/platform/util/testSrc/com/intellij/openapi/util/RecursionManagerTest.groovy b/platform/util/testSrc/com/intellij/openapi/util/RecursionManagerTest.groovy index d9c3ac407196..5aa2df30dad9 100644 --- a/platform/util/testSrc/com/intellij/openapi/util/RecursionManagerTest.groovy +++ b/platform/util/testSrc/com/intellij/openapi/util/RecursionManagerTest.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.util import groovy.transform.Immutable @@ -176,7 +162,7 @@ class RecursionManagerTest extends TestCase { @Immutable private static class RecursiveKey { - final String id; + final String id @Override int hashCode() { @@ -186,7 +172,7 @@ class RecursionManagerTest extends TestCase { @Override boolean equals(Object obj) { RecursionManager.doPreventingRecursion("abc", false) { true } - return obj instanceof RecursiveKey && obj.id == id; + return obj instanceof RecursiveKey && obj.id == id } } diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/internal/daemon/GradleDaemonServices.groovy b/plugins/gradle/src/org/jetbrains/plugins/gradle/internal/daemon/GradleDaemonServices.groovy index ceb0e873b592..0c27a7a8a146 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/internal/daemon/GradleDaemonServices.groovy +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/internal/daemon/GradleDaemonServices.groovy @@ -1,4 +1,4 @@ -// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.gradle.internal.daemon import com.intellij.openapi.application.PathManager @@ -25,7 +25,7 @@ import java.lang.reflect.Method @ApiStatus.Experimental @CompileStatic class GradleDaemonServices { - private static final Logger LOG = Logger.getInstance(GradleDaemonServices.class); + private static final Logger LOG = Logger.getInstance(GradleDaemonServices.class) static void stopDaemons() { Map connections = getConnections() diff --git a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/builder/ExternalProjectBuilderImpl.groovy b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/builder/ExternalProjectBuilderImpl.groovy index dadcd5228f9b..475afd6805c1 100644 --- a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/builder/ExternalProjectBuilderImpl.groovy +++ b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/builder/ExternalProjectBuilderImpl.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.gradle.tooling.builder import com.google.gson.GsonBuilder @@ -93,7 +79,7 @@ class ExternalProjectBuilderImpl implements ModelBuilderService { def ideaPluginModule = ideaPlugin?.model?.module def parentBuildRootProject = project.gradle.parent?.rootProject def compositePrefix = parentBuildRootProject && !project.rootProject.is(parentBuildRootProject) && ":" != project.path ? - (ideaPlugin?.model?.project?.name ?: project.rootProject.name) : ""; + (ideaPlugin?.model?.project?.name ?: project.rootProject.name) : "" def ideaModuleName = ideaPluginModule?.name ?: project.name defaultExternalProject.id = compositePrefix + (":" == project.path ? ideaModuleName : qName) defaultExternalProject.version = wrap(project.version) diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyCompilerTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyCompilerTest.groovy index 4399f79a335e..450c6e6d32ec 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyCompilerTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyCompilerTest.groovy @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.compiler import com.intellij.compiler.CompilerConfiguration @@ -974,7 +974,7 @@ class BuildContextImpl extends BuildContext { void "test report real compilation errors"() { addModule('another', true) - myFixture.addClass('class Foo {}'); + myFixture.addClass('class Foo {}') myFixture.addFileToProject('a.groovy', 'import goo.Goo; class Bar { }') shouldFail { compileModule(myModule) } } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyDebuggerTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyDebuggerTest.groovy index 02d2671c5670..933e41daa4d6 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyDebuggerTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyDebuggerTest.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.compiler import com.intellij.openapi.Disposable @@ -56,7 +42,7 @@ class GroovyDebuggerTest extends GroovyCompilerTestCase implements DebuggerMetho @Override protected void tearDown() throws Exception { - ThreadTracker.awaitJDIThreadsTermination(100, TimeUnit.SECONDS); + ThreadTracker.awaitJDIThreadsTermination(100, TimeUnit.SECONDS) super.tearDown() } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/JavaWithGroovyCompletionTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/JavaWithGroovyCompletionTest.groovy index ba4d15e19070..e67479692e09 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/JavaWithGroovyCompletionTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/JavaWithGroovyCompletionTest.groovy @@ -1,22 +1,8 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.completion import com.intellij.codeInsight.completion.CompletionType -import com.intellij.psi.PsiMethod; +import com.intellij.psi.PsiMethod /** * @author peter diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyLiveTemplatesTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyLiveTemplatesTest.groovy index 43721a78f6f2..a730dd17cafe 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyLiveTemplatesTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyLiveTemplatesTest.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.lang import com.intellij.codeInsight.lookup.Lookup @@ -28,7 +14,7 @@ import org.jetbrains.plugins.groovy.util.TestUtils /** * @author peter */ -public class GroovyLiveTemplatesTest extends LightCodeInsightFixtureTestCase { +class GroovyLiveTemplatesTest extends LightCodeInsightFixtureTestCase { @Override protected String getBasePath() { return TestUtils.getTestDataPath() + "liveTemplates/" @@ -66,7 +52,7 @@ void usage(int num, boolean someBoolean, List args){ ''' } - public static void expandTemplate(final Editor editor) { + static void expandTemplate(final Editor editor) { new ListTemplatesAction().actionPerformedImpl(editor.getProject(), editor) ((LookupImpl)LookupManager.getActiveLookup(editor)).finishLookup(Lookup.NORMAL_SELECT_CHAR) } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/FindOverridingMethodsAndClassesTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/FindOverridingMethodsAndClassesTest.groovy index 7888c1ad557d..9715be0ac53b 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/FindOverridingMethodsAndClassesTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/FindOverridingMethodsAndClassesTest.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.lang.overriding @@ -92,7 +78,7 @@ class FindOverridingMethodsAndClassesTest extends LightCodeInsightFixtureTestCas } void "test find groovy inheritor of java class in local scope"() { - def superClass = myFixture.addClass("class Super {}"); + def superClass = myFixture.addClass("class Super {}") def file = myFixture.addFileToProject("a.groovy", "class Foo extends Super {}") assert ClassInheritorsSearch.search(superClass).findAll().size() == 1 diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/NumberMathTypingTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/NumberMathTypingTest.groovy index 2f78bdd5b5bb..1b4302b1c45c 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/NumberMathTypingTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/NumberMathTypingTest.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.lang.resolve import com.intellij.psi.PsiClassType @@ -30,7 +16,7 @@ class NumberMathTypingTest extends LightGroovyTestCase { @Override void setUp() throws Exception { - super.setUp(); + super.setUp() addBigInteger() addBigDecimal() } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/dgm/ResolveExtensionMethodTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/dgm/ResolveExtensionMethodTest.groovy index 5fb9d976f1d8..8cc5e923ef7f 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/dgm/ResolveExtensionMethodTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/dgm/ResolveExtensionMethodTest.groovy @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.lang.resolve.dgm import com.intellij.psi.PsiFileFactory @@ -19,7 +19,7 @@ class ResolveExtensionMethodTest extends GroovyResolveTestCase { final LightProjectDescriptor projectDescriptor = GroovyLightProjectDescriptor.GROOVY_LATEST private void addExtension(String directory = "services", @Language("Groovy") String text) { - def factory = PsiFileFactory.getInstance(project); + def factory = PsiFileFactory.getInstance(project) def file = factory.createFileFromText('a.groovy', GroovyFileType.GROOVY_FILE_TYPE, text) as GroovyFile def fqn = file.typeDefinitions.first().qualifiedName def path = fqn.split('\\.').join('/') + '.groovy' diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/copy/GroovyCopyClassTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/copy/GroovyCopyClassTest.groovy index d7fea95677df..4085bc3c0994 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/copy/GroovyCopyClassTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/copy/GroovyCopyClassTest.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.refactoring.copy @@ -44,7 +30,7 @@ class GroovyCopyClassTest extends LightCodeInsightFixtureTestCase { def map = Collections.singletonMap(srcClass.navigationElement.containingFile, [srcClass] as PsiClass[]) def dir = srcClass.manager.findDirectory(myFixture.tempDirFixture.getFile("bar")) CopyClassesHandler.doCopyClasses(map, "${testName}_after", dir, project) - }); + }) myFixture.checkResultByFile("bar/${testName}_after.groovy", "${testName}_after.groovy", true) } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenSurefirePluginTest.groovy b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenSurefirePluginTest.groovy index 91ea522feb2e..78fb5f6d7a05 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenSurefirePluginTest.groovy +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenSurefirePluginTest.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.idea.maven.dom import org.jetbrains.idea.maven.MavenCustomRepositoryHelper @@ -24,8 +10,8 @@ class MavenSurefirePluginTest extends MavenDomTestCase { @Override protected void setUp() throws Exception { - super.setUp(); - setRepositoryPath(new MavenCustomRepositoryHelper(myDir, "plugins").getTestDataPath("plugins")); + super.setUp() + setRepositoryPath(new MavenCustomRepositoryHelper(myDir, "plugins").getTestDataPath("plugins")) } void testCompletion() {