From 28a39064ffb889fbc88273ddc0a28beaea156b41 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Tue, 31 Jul 2018 16:49:09 +0200 Subject: [PATCH] =?UTF-8?q?cleanup=20=E2=80=94=20notNull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javac/JavacConfigurationMacroFilter.java | 19 +++---------------- .../openapi/application/PathMacroFilter.java | 4 +--- .../RunConfigurationPathMacroFilter.java | 4 ++-- .../intellij/run/PathMacrosCollectorTest.java | 4 ++-- .../components/CompositePathMacroFilter.java | 2 +- .../impl/stores/DirectoryStorageUtil.java | 18 ++---------------- 6 files changed, 11 insertions(+), 40 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacConfigurationMacroFilter.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacConfigurationMacroFilter.java index d9d93529ba9a..a01c21d131cc 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacConfigurationMacroFilter.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacConfigurationMacroFilter.java @@ -1,30 +1,17 @@ -/* - * Copyright 2000-2013 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-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. package com.intellij.compiler.impl.javaCompiler.javac; import com.intellij.openapi.application.PathMacroFilter; import org.jdom.Attribute; import org.jdom.Element; +import org.jetbrains.annotations.NotNull; /** * @author nik */ public class JavacConfigurationMacroFilter extends PathMacroFilter { @Override - public boolean recursePathMacros(Attribute attribute) { + public boolean recursePathMacros(@NotNull Attribute attribute) { if (attribute.getName().equals("value")) { Element parent = attribute.getParent(); if (parent != null && "option".equals(parent.getName()) && "ADDITIONAL_OPTIONS_STRING".equals(parent.getAttributeValue("name"))) { diff --git a/jps/model-serialization/src/com/intellij/openapi/application/PathMacroFilter.java b/jps/model-serialization/src/com/intellij/openapi/application/PathMacroFilter.java index 9bb39b1d7293..c6d1e5198442 100644 --- a/jps/model-serialization/src/com/intellij/openapi/application/PathMacroFilter.java +++ b/jps/model-serialization/src/com/intellij/openapi/application/PathMacroFilter.java @@ -7,8 +7,6 @@ import org.jetbrains.annotations.NotNull; /** * Allows to disable expansion of path macros in the values of certain properties. - * - * @author yole */ public abstract class PathMacroFilter { public boolean skipPathMacros(@NotNull Element element) { @@ -19,7 +17,7 @@ public abstract class PathMacroFilter { return false; } - public boolean recursePathMacros(Attribute attribute) { + public boolean recursePathMacros(@NotNull Attribute attribute) { return false; } } diff --git a/platform/lang-impl/src/com/intellij/execution/configuration/RunConfigurationPathMacroFilter.java b/platform/lang-impl/src/com/intellij/execution/configuration/RunConfigurationPathMacroFilter.java index 1a640094b3cb..e6387e55d780 100644 --- a/platform/lang-impl/src/com/intellij/execution/configuration/RunConfigurationPathMacroFilter.java +++ b/platform/lang-impl/src/com/intellij/execution/configuration/RunConfigurationPathMacroFilter.java @@ -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-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. package com.intellij.execution.configuration; import com.intellij.openapi.application.PathMacroFilter; @@ -16,7 +16,7 @@ class RunConfigurationPathMacroFilter extends PathMacroFilter { } @Override - public boolean recursePathMacros(Attribute attribute) { + public boolean recursePathMacros(@NotNull Attribute attribute) { final Element parent = attribute.getParent(); if (parent != null && "option".equals(parent.getName())) { final Element grandParent = parent.getParentElement(); diff --git a/platform/platform-tests/testSrc/com/intellij/run/PathMacrosCollectorTest.java b/platform/platform-tests/testSrc/com/intellij/run/PathMacrosCollectorTest.java index 419bf7a1b909..5bece138da2f 100644 --- a/platform/platform-tests/testSrc/com/intellij/run/PathMacrosCollectorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/run/PathMacrosCollectorTest.java @@ -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-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. package com.intellij.run; import com.intellij.application.options.PathMacrosCollector; @@ -43,7 +43,7 @@ public class PathMacrosCollectorTest extends TestCase { final Set macros = PathMacrosCollector.getMacroNames(root, new PathMacroFilter() { @Override - public boolean recursePathMacros(Attribute attribute) { + public boolean recursePathMacros(@NotNull Attribute attribute) { return "value".equals(attribute.getName()); } }, new PathMacrosImpl()); diff --git a/platform/projectModel-impl/src/com/intellij/openapi/components/CompositePathMacroFilter.java b/platform/projectModel-impl/src/com/intellij/openapi/components/CompositePathMacroFilter.java index 20ec24b2ae9b..d6b0b30bce0c 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/components/CompositePathMacroFilter.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/components/CompositePathMacroFilter.java @@ -37,7 +37,7 @@ public class CompositePathMacroFilter extends PathMacroFilter { } @Override - public boolean recursePathMacros(Attribute attribute) { + public boolean recursePathMacros(@NotNull Attribute attribute) { for (PathMacroFilter filter : myFilters) { if (filter.recursePathMacros(attribute)) return true; } diff --git a/platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/DirectoryStorageUtil.java b/platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/DirectoryStorageUtil.java index 822ee13f7900..29624c4d12de 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/DirectoryStorageUtil.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/DirectoryStorageUtil.java @@ -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-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. package com.intellij.openapi.components.impl.stores; import com.intellij.application.options.PathMacrosCollector; @@ -72,7 +58,7 @@ public class DirectoryStorageUtil { continue; } - Element state = (Element)elementChildren.get(0).detach(); + Element state = elementChildren.get(0).detach(); if (JDOMUtil.isEmpty(state)) { continue; }