From 1e9eeff5f059d686a2ad95b875994cf89832d313 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 15 Jun 2020 09:56:26 +0200 Subject: [PATCH] cleanup GitOrigin-RevId: ea30d7dc1720571c24fb3ed249236c85bf045d66 --- .../intellij/ide/ApplicationLoadListener.java | 4 ++-- .../util-ex/src/com/intellij/util/io/path.kt | 9 +++------ .../incremental/groovy/GreclipseSettings.java | 20 ++----------------- .../GreclipseIdeaCompilerSettings.java | 4 ++-- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/ApplicationLoadListener.java b/platform/platform-impl/src/com/intellij/ide/ApplicationLoadListener.java index 3be026ee96f3..d8fc41f5d498 100644 --- a/platform/platform-impl/src/com/intellij/ide/ApplicationLoadListener.java +++ b/platform/platform-impl/src/com/intellij/ide/ApplicationLoadListener.java @@ -1,4 +1,4 @@ -// 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. +// Copyright 2000-2020 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.ide; import com.intellij.openapi.application.Application; @@ -6,7 +6,7 @@ import com.intellij.openapi.extensions.ExtensionPointName; import org.jetbrains.annotations.NotNull; public interface ApplicationLoadListener { - ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.ApplicationLoadListener"); + ExtensionPointName EP_NAME = new ExtensionPointName<>("com.intellij.ApplicationLoadListener"); default void beforeApplicationLoaded(@NotNull Application application, @NotNull String configPath) { } diff --git a/platform/util-ex/src/com/intellij/util/io/path.kt b/platform/util-ex/src/com/intellij/util/io/path.kt index 1e38de0a7a24..a250c5cf523d 100644 --- a/platform/util-ex/src/com/intellij/util/io/path.kt +++ b/platform/util-ex/src/com/intellij/util/io/path.kt @@ -1,4 +1,4 @@ -// 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. +// Copyright 2000-2020 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.util.io import com.intellij.openapi.util.io.FileUtilRt @@ -92,9 +92,8 @@ fun Path.delete(recursively: Boolean = true) { } private fun doDelete(file: Path) { - val attributes: BasicFileAttributes - try { - attributes = Files.readAttributes(file, BasicFileAttributes::class.java, LinkOption.NOFOLLOW_LINKS) + val attributes = try { + Files.readAttributes(file, BasicFileAttributes::class.java, LinkOption.NOFOLLOW_LINKS) } catch (e: NoSuchFileException) { return @@ -106,13 +105,11 @@ private fun doDelete(file: Path) { } Files.walkFileTree(file, object : SimpleFileVisitor() { - @Throws(IOException::class) override fun visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult { deleteFile(file) return FileVisitResult.CONTINUE } - @Throws(IOException::class) override fun postVisitDirectory(dir: Path, exc: IOException?): FileVisitResult { Files.deleteIfExists(dir) return FileVisitResult.CONTINUE diff --git a/plugins/groovy/jps-plugin/src/org/jetbrains/jps/incremental/groovy/GreclipseSettings.java b/plugins/groovy/jps-plugin/src/org/jetbrains/jps/incremental/groovy/GreclipseSettings.java index 726417a31d48..c918c32c0440 100644 --- a/plugins/groovy/jps-plugin/src/org/jetbrains/jps/incremental/groovy/GreclipseSettings.java +++ b/plugins/groovy/jps-plugin/src/org/jetbrains/jps/incremental/groovy/GreclipseSettings.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2015 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-2020 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.jps.incremental.groovy; import org.jetbrains.jps.model.java.compiler.CompilerOptions; @@ -20,13 +6,11 @@ import org.jetbrains.jps.model.java.compiler.CompilerOptions; /** * @author peter */ -public class GreclipseSettings implements CompilerOptions { +public final class GreclipseSettings implements CompilerOptions { public static final String COMPONENT_NAME = "GreclipseSettings"; public static final String COMPONENT_FILE = "compiler.xml"; public String greclipsePath = ""; public boolean debugInfo = true; public String cmdLineParams = ""; - - } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GreclipseIdeaCompilerSettings.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GreclipseIdeaCompilerSettings.java index 2fe97bba99da..92f244cdde24 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GreclipseIdeaCompilerSettings.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GreclipseIdeaCompilerSettings.java @@ -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-2020 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.components.PersistentStateComponent; @@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.jps.incremental.groovy.GreclipseSettings; @State(name = GreclipseSettings.COMPONENT_NAME, storages = @Storage(GreclipseSettings.COMPONENT_FILE)) -public class GreclipseIdeaCompilerSettings implements PersistentStateComponent { +public final class GreclipseIdeaCompilerSettings implements PersistentStateComponent { private final GreclipseSettings mySettings = new GreclipseSettings(); @Override