From 524a58cabc470c3a89f12a83776ff5e59c332cef Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Thu, 28 Apr 2016 17:01:43 +0200 Subject: [PATCH 01/19] IG: option to ignore arguments to specified methods (IDEA-155025) --- .../com/siyeh/ig/psiutils/MethodMatcher.java | 35 ++++----------- ...haredThreadLocalRandomInspectionBase.java} | 45 +++++++++++++++---- .../SharedThreadLocalRandomInspection.java | 44 ++++++++++++++++++ .../SharedThreadLocalRandom.html | 2 + ...SharedThreadLocalRandomInspectionTest.java | 13 +++++- 5 files changed, 103 insertions(+), 36 deletions(-) rename plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/threading/{SharedThreadLocalRandomInspection.java => SharedThreadLocalRandomInspectionBase.java} (70%) create mode 100644 plugins/InspectionGadgets/src/com/siyeh/ig/threading/SharedThreadLocalRandomInspection.java diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/MethodMatcher.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/MethodMatcher.java index 40c7c7a2f6b7..002c3e19f126 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/MethodMatcher.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/MethodMatcher.java @@ -17,15 +17,16 @@ package com.siyeh.ig.psiutils; import com.intellij.openapi.util.InvalidDataException; import com.intellij.openapi.util.WriteExternalException; +import com.intellij.psi.PsiCall; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiMethod; import com.intellij.psi.PsiMethodCallExpression; -import com.intellij.psi.PsiReferenceExpression; import com.intellij.psi.util.InheritanceUtil; import com.intellij.util.containers.ContainerUtil; import com.siyeh.ig.BaseInspection; import org.jdom.Element; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.List; import java.util.Map; @@ -111,7 +112,10 @@ public class MethodMatcher { return myClassNames; } - public boolean matches(PsiMethod method) { + public boolean matches(@Nullable PsiMethod method) { + if (method == null) { + return false; + } final String methodName = method.getName(); final PsiClass aClass = method.getContainingClass(); if (aClass == null) { @@ -130,31 +134,8 @@ public class MethodMatcher { return false; } - public boolean matches(PsiMethodCallExpression methodCallExpression) { - final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression(); - final String methodName = methodExpression.getReferenceName(); - if (methodName == null) { - return false; - } - PsiClass aClass = null; - for (int i = 0, size = myMethodNamePatterns.size(); i < size; i++) { - final Pattern pattern = getPattern(i); - if (pattern == null || !pattern.matcher(methodName).matches()) { - continue; - } - if (aClass == null) { - final PsiMethod method = methodCallExpression.resolveMethod(); - if (method == null || method.isConstructor()) { - return false; - } - aClass = method.getContainingClass(); - } - final String className = myClassNames.get(i); - if (InheritanceUtil.isInheritor(aClass, className)) { - return true; - } - } - return false; + public boolean matches(PsiCall call) { + return matches(call.resolveMethod()); } private Pattern getPattern(int i) { diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/threading/SharedThreadLocalRandomInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/threading/SharedThreadLocalRandomInspectionBase.java similarity index 70% rename from plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/threading/SharedThreadLocalRandomInspection.java rename to plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/threading/SharedThreadLocalRandomInspectionBase.java index 97adc033c5b1..1ad40a066096 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/threading/SharedThreadLocalRandomInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/threading/SharedThreadLocalRandomInspectionBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -15,14 +15,18 @@ */ package com.siyeh.ig.threading; +import com.intellij.openapi.util.InvalidDataException; +import com.intellij.openapi.util.WriteExternalException; import com.intellij.psi.*; import com.intellij.psi.util.InheritanceUtil; import com.intellij.psi.util.PsiTreeUtil; import com.siyeh.InspectionGadgetsBundle; import com.siyeh.ig.BaseInspection; import com.siyeh.ig.BaseInspectionVisitor; +import com.siyeh.ig.psiutils.MethodMatcher; import com.siyeh.ig.psiutils.ParenthesesUtils; import com.siyeh.ig.psiutils.VariableAccessUtils; +import org.jdom.Element; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -30,7 +34,16 @@ import org.jetbrains.annotations.NotNull; /** * @author Bas Leijdekkers */ -public class SharedThreadLocalRandomInspection extends BaseInspection { +public class SharedThreadLocalRandomInspectionBase extends BaseInspection { + + protected final MethodMatcher myMethodMatcher; + + public SharedThreadLocalRandomInspectionBase() { + myMethodMatcher = new MethodMatcher(true, "ignoreArgumentToMethods") + .add("java.math.BigInteger", ".*") + .add("java.util.Collections", "shuffle"); + } + @Nls @NotNull @Override @@ -44,12 +57,24 @@ public class SharedThreadLocalRandomInspection extends BaseInspection { return InspectionGadgetsBundle.message("shared.thread.local.random.problem.descriptor"); } + @Override + public void readSettings(@NotNull Element element) throws InvalidDataException { + super.readSettings(element); + myMethodMatcher.readSettings(element); + } + + @Override + public void writeSettings(@NotNull Element element) throws WriteExternalException { + super.writeSettings(element); + myMethodMatcher.writeSettings(element); + } + @Override public BaseInspectionVisitor buildVisitor() { return new SharedThreadLocalRandomVisitor(); } - private static class SharedThreadLocalRandomVisitor extends BaseInspectionVisitor { + private class SharedThreadLocalRandomVisitor extends BaseInspectionVisitor { @Override public void visitMethodCallExpression(PsiMethodCallExpression expression) { @@ -77,24 +102,28 @@ public class SharedThreadLocalRandomInspection extends BaseInspection { } else if (variable instanceof PsiLocalVariable) { final PsiCodeBlock context = PsiTreeUtil.getParentOfType(variable, PsiCodeBlock.class); - if (VariableAccessUtils.variableIsPassedAsMethodArgument(variable, context) || - VariableAccessUtils.variableIsUsedInInnerClass(variable, context)) { + final boolean passed = VariableAccessUtils.variableIsPassedAsMethodArgument(variable, context, myMethodMatcher::matches); + if (passed || VariableAccessUtils.variableIsUsedInInnerClass(variable, context)) { registerMethodCallError(expression); } } } } - private static boolean isArgumentToMethodCall(PsiExpression expression) { + private boolean isArgumentToMethodCall(PsiExpression expression) { final PsiElement parent = ParenthesesUtils.getParentSkipParentheses(expression); if (!(parent instanceof PsiExpressionList)) { return false; } final PsiElement grandParent = parent.getParent(); - return grandParent instanceof PsiMethodCallExpression; + if (!(grandParent instanceof PsiMethodCallExpression)) { + return false; + } + final PsiMethodCallExpression methodCallExpression = (PsiMethodCallExpression)grandParent; + return !myMethodMatcher.matches(methodCallExpression); } - private static PsiVariable assignedToVariable(PsiMethodCallExpression expression) { + private PsiVariable assignedToVariable(PsiMethodCallExpression expression) { final PsiElement parent = PsiTreeUtil.skipParentsOfType(expression, PsiParenthesizedExpression.class); if (parent instanceof PsiVariable) { return (PsiVariable)parent; diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/threading/SharedThreadLocalRandomInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/threading/SharedThreadLocalRandomInspection.java new file mode 100644 index 000000000000..409bfb5275ea --- /dev/null +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/threading/SharedThreadLocalRandomInspection.java @@ -0,0 +1,44 @@ +/* + * 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. + */ + +/** + * (c) 2016 Silent Forest AB + * created: 28 April 2016 + */ +package com.siyeh.ig.threading; + +import com.intellij.codeInspection.ui.ListTable; +import com.intellij.codeInspection.ui.ListWrappingTableModel; +import com.siyeh.InspectionGadgetsBundle; +import com.siyeh.ig.ui.UiUtils; + +import javax.swing.*; +import java.util.Arrays; + +/** + * @author Bas Leijdekkers + */ +public class SharedThreadLocalRandomInspection extends SharedThreadLocalRandomInspectionBase { + + @Override + public JComponent createOptionsPanel() { + final ListTable table = new ListTable(new ListWrappingTableModel( + Arrays.asList(myMethodMatcher.getClassNames(), myMethodMatcher.getMethodNamePatterns()), + InspectionGadgetsBundle.message("result.of.method.call.ignored.class.column.title"), + InspectionGadgetsBundle.message("result.of.method.call.ignored.method.column.title"))); + return UiUtils.createAddRemoveTreeClassChooserPanel(table, "Choose class"); + } +} diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/SharedThreadLocalRandom.html b/plugins/InspectionGadgets/src/inspectionDescriptions/SharedThreadLocalRandom.html index 88be483c39bf..c3bbd92b40b7 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/SharedThreadLocalRandom.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/SharedThreadLocalRandom.html @@ -10,5 +10,7 @@ Usages of ThreadLocalRandom should typically look like ThreadLocalRand When all usages are in this form, ThreadLocalRandom instances can not be used accidentally by multiple threads.

+Use the table below to specify methods that are safe to pass a ThreadLocalRandom to, as an argument. +

\ No newline at end of file diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/threading/SharedThreadLocalRandomInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/threading/SharedThreadLocalRandomInspectionTest.java index b15bc350fd6b..505cbb1ab18f 100644 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/threading/SharedThreadLocalRandomInspectionTest.java +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/threading/SharedThreadLocalRandomInspectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -74,4 +74,15 @@ public class SharedThreadLocalRandomInspectionTest extends LightInspectionTestCa " }" + "}"); } + + public void testCollectionsShuffle() { + doStatementTest("java.util.Collections.shuffle(new java.util.ArrayList(), java.util.concurrent.ThreadLocalRandom.current());"); + } + + public void testCollectionsShuffle2() { + doMemberTest("void f(java.util.List l) {" + + " java.util.Random r = java.util.concurrent.ThreadLocalRandom.current();" + + " java.util.Collections.shuffle(l, r);" + + "}"); + } } From 752156cffedef58cd12d683253fee47a7e8c9b22 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 28 Apr 2016 16:02:52 +0300 Subject: [PATCH 02/19] new test for no cls/psi mixed up --- .../psi/search/ClassInheritorsTest.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 java/java-tests/testSrc/com/intellij/psi/search/ClassInheritorsTest.java diff --git a/java/java-tests/testSrc/com/intellij/psi/search/ClassInheritorsTest.java b/java/java-tests/testSrc/com/intellij/psi/search/ClassInheritorsTest.java new file mode 100644 index 000000000000..965809599a48 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/psi/search/ClassInheritorsTest.java @@ -0,0 +1,52 @@ +/* + * 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. + */ +package com.intellij.psi.search; + +import com.intellij.codeInsight.daemon.DaemonAnalyzerTestCase; +import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.psi.PsiClass; +import com.intellij.psi.impl.compiled.ClsClassImpl; +import com.intellij.psi.impl.source.PsiClassImpl; +import com.intellij.psi.search.searches.ClassInheritorsSearch; +import com.intellij.psi.search.searches.DirectClassInheritorsSearch; +import com.intellij.testFramework.IdeaTestUtil; + +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.stream.Collectors; + +public class ClassInheritorsTest extends DaemonAnalyzerTestCase { + @Override + protected Sdk getTestProjectJdk() { + // there must be src.zip + return IdeaTestUtil.getMockJdk17("1.7"); + } + + public void testClsAndSourcesDoNotMixUp() { + PsiClass numberClass = getJavaFacade().findClass("java.lang.Number", GlobalSearchScope.allScope(getProject())); + assertTrue(String.valueOf(numberClass), numberClass instanceof ClsClassImpl); + PsiClass n2 = (PsiClass)numberClass.getNavigationElement(); + assertTrue(String.valueOf(n2), n2 instanceof PsiClassImpl); + Collection subClasses = DirectClassInheritorsSearch.search(n2, GlobalSearchScope.allScope(getProject())).findAll(); + List fqn = subClasses.stream().map(PsiClass::getQualifiedName).sorted().collect(Collectors.toList()); + assertEquals(fqn.toString(), fqn.size(), new HashSet<>(fqn).size()); // no dups mean no Cls/Psi mixed + + Collection allSubClasses = ClassInheritorsSearch.search(n2, GlobalSearchScope.allScope(getProject()), true).findAll(); + List allFqn = allSubClasses.stream().map(PsiClass::getQualifiedName).sorted().collect(Collectors.toList()); + assertEquals(allFqn.toString(), allFqn.size(), new HashSet<>(allFqn).size()); + } +} From 739fd0cf33191ae97b055153d0974745a8f2b5fe Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 28 Apr 2016 17:18:12 +0300 Subject: [PATCH 03/19] PsiManagerEx.getInstanceEx --- .../intellij/ide/util/treeView/TreeViewUtil.java | 4 ++-- .../psi/impl/migration/PsiMigrationManager.java | 4 ++-- .../psi/impl/source/PsiCodeFragmentImpl.java | 4 ++-- .../psi/impl/file/impl/JavaFileManagerImpl.java | 2 +- .../src/com/intellij/psi/impl/JavaPsiFacadeEx.java | 4 ++-- .../com/intellij/psi/impl/JavaPsiFacadeImpl.java | 4 ++-- .../intellij/psi/PsiModificationTrackerTest.java | 14 +++++++------- .../fixtures/JavaCodeInsightFixtureTestCase.java | 5 ++--- .../intellij/extapi/psi/ASTDelegatePsiElement.java | 3 +-- .../extapi/psi/StubBasedPsiElementBase.java | 7 +++++-- .../src/com/intellij/psi/impl/PsiManagerEx.java | 6 +++++- .../smartPointers/SmartPsiElementPointerImpl.java | 4 ++-- .../intellij/psi/impl/source/tree/TreeElement.java | 3 +-- .../com/intellij/psi/stubs/StubTreeLoaderImpl.java | 7 +++---- .../openapi/fileTypes/ex/FileTypeChooser.java | 3 +-- .../src/com/intellij/util/PsiErrorElementUtil.java | 5 ++--- .../openapi/fileTypes/impl/FileTypesTest.java | 7 +++++-- .../testFramework/FileTreeAccessFilter.java | 6 +++--- .../groovy/lang/psi/impl/GroovyPsiManager.java | 4 ++-- .../jetbrains/plugins/ipnb/psi/IpnbPyFragment.java | 2 +- .../psi/impl/PyExpressionCodeFragmentImpl.java | 5 ++--- .../changeSignature/PyExpressionCodeFragment.java | 5 ++--- .../com/intellij/util/xml/impl/DomManagerImpl.java | 9 ++++++--- 23 files changed, 61 insertions(+), 56 deletions(-) diff --git a/java/java-impl/src/com/intellij/ide/util/treeView/TreeViewUtil.java b/java/java-impl/src/com/intellij/ide/util/treeView/TreeViewUtil.java index 265c50e84e8e..310954c56883 100644 --- a/java/java-impl/src/com/intellij/ide/util/treeView/TreeViewUtil.java +++ b/java/java-impl/src/com/intellij/ide/util/treeView/TreeViewUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -45,7 +45,7 @@ public class TreeViewUtil { final ConcurrentMap newMap = ContainerUtil.createConcurrentWeakMap(); map = ((UserDataHolderEx)project).putUserDataIfAbsent(SHOULD_ABBREV_PACK_KEY, newMap); if (map == newMap) { - ((PsiManagerEx)PsiManager.getInstance(project)).registerRunnableToRunOnChange(new Runnable() { + PsiManagerEx.getInstanceEx(project).registerRunnableToRunOnChange(new Runnable() { @Override public void run() { newMap.clear(); diff --git a/java/java-impl/src/com/intellij/psi/impl/migration/PsiMigrationManager.java b/java/java-impl/src/com/intellij/psi/impl/migration/PsiMigrationManager.java index 5f24dcadfb7d..7a363c9e1462 100644 --- a/java/java-impl/src/com/intellij/psi/impl/migration/PsiMigrationManager.java +++ b/java/java-impl/src/com/intellij/psi/impl/migration/PsiMigrationManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * 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. @@ -62,6 +62,6 @@ public class PsiMigrationManager { myCurrentMigration = null; } - ((PsiManagerEx)PsiManager.getInstance(myProject)).beforeChange(true); + PsiManagerEx.getInstanceEx(myProject).beforeChange(true); } } diff --git a/java/java-impl/src/com/intellij/psi/impl/source/PsiCodeFragmentImpl.java b/java/java-impl/src/com/intellij/psi/impl/source/PsiCodeFragmentImpl.java index 10a30242b606..ed5847ee0b59 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/PsiCodeFragmentImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/PsiCodeFragmentImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -63,7 +63,7 @@ public class PsiCodeFragmentImpl extends PsiFileImpl implements JavaCodeFragment @Nullable PsiElement context) { super(TokenType.CODE_FRAGMENT, contentElementType, - ((PsiManagerEx)PsiManager.getInstance(project)).getFileManager().createFileViewProvider( + PsiManagerEx.getInstanceEx(project).getFileManager().createFileViewProvider( new LightVirtualFile(name, FileTypeManager.getInstance().getFileTypeByFileName(name), text), isPhysical) ); myContext = context; diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/file/impl/JavaFileManagerImpl.java b/java/java-indexing-impl/src/com/intellij/psi/impl/file/impl/JavaFileManagerImpl.java index cbed3d6cb1fb..bf7f9e42e17b 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/file/impl/JavaFileManagerImpl.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/file/impl/JavaFileManagerImpl.java @@ -49,7 +49,7 @@ public class JavaFileManagerImpl implements JavaFileManager, Disposable { private final PackageIndex myPackageIndex; public JavaFileManagerImpl(Project project) { - myManager = (PsiManagerEx)PsiManager.getInstance(project); + myManager = PsiManagerEx.getInstanceEx(project); myPackageIndex = PackageIndex.getInstance(myManager.getProject()); project.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() { @Override diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeEx.java b/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeEx.java index 3501a5c15064..3d9413d65fda 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeEx.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeEx.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -42,5 +42,5 @@ public abstract class JavaPsiFacadeEx extends JavaPsiFacade { } @TestOnly - public abstract void setAssertOnFileLoadingFilter(@NotNull VirtualFileFilter filter, Disposable parentDisposable); + public abstract void setAssertOnFileLoadingFilter(@NotNull VirtualFileFilter filter, @NotNull Disposable parentDisposable); } \ No newline at end of file diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeImpl.java index 678662e8bf2a..cfb2e6501d44 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -414,7 +414,7 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx { @TestOnly @Override - public void setAssertOnFileLoadingFilter(@NotNull final VirtualFileFilter filter, Disposable parentDisposable) { + public void setAssertOnFileLoadingFilter(@NotNull final VirtualFileFilter filter, @NotNull Disposable parentDisposable) { ((PsiManagerImpl)PsiManager.getInstance(myProject)).setAssertOnFileLoadingFilter(filter, parentDisposable); } diff --git a/java/java-tests/testSrc/com/intellij/psi/PsiModificationTrackerTest.java b/java/java-tests/testSrc/com/intellij/psi/PsiModificationTrackerTest.java index 6d1d9e3f9043..0eb5e71d0f59 100644 --- a/java/java-tests/testSrc/com/intellij/psi/PsiModificationTrackerTest.java +++ b/java/java-tests/testSrc/com/intellij/psi/PsiModificationTrackerTest.java @@ -247,7 +247,7 @@ public class PsiModificationTrackerTest extends CodeInsightTestCase { // gc softly-referenced file and AST PlatformTestUtil.tryGcSoftlyReachableObjects(); - final PsiManagerEx psiManager = (PsiManagerEx)PsiManager.getInstance(getProject()); + final PsiManagerEx psiManager = PsiManagerEx.getInstanceEx(getProject()); assertNull(psiManager.getFileManager().getCachedPsiFile(file)); assertFalse(count1 == tracker.getJavaStructureModificationCount()); @@ -257,7 +257,7 @@ public class PsiModificationTrackerTest extends CodeInsightTestCase { public void testClassShouldNotDisappearWithoutEvents_NoDocument() throws IOException { PsiModificationTracker tracker = PsiManager.getInstance(getProject()).getModificationTracker(); - final PsiManagerEx psiManager = (PsiManagerEx)PsiManager.getInstance(getProject()); + final PsiManagerEx psiManager = PsiManagerEx.getInstanceEx(getProject()); final VirtualFile file = addFileToProject("Foo.java", "class Foo {}").getVirtualFile(); assertNotNull(JavaPsiFacade.getInstance(getProject()).findClass("Foo", GlobalSearchScope.allScope(getProject()))); @@ -279,7 +279,7 @@ public class PsiModificationTrackerTest extends CodeInsightTestCase { PsiModificationTracker tracker = PsiManager.getInstance(getProject()).getModificationTracker(); long count0 = tracker.getJavaStructureModificationCount(); - final PsiManagerEx psiManager = (PsiManagerEx)PsiManager.getInstance(getProject()); + final PsiManagerEx psiManager = PsiManagerEx.getInstanceEx(getProject()); VirtualFile parentDir = createChildDirectory(getProject().getBaseDir(), "tmp"); assertNull(((FileManagerImpl)psiManager.getFileManager()).getCachedDirectory(parentDir)); @@ -296,7 +296,7 @@ public class PsiModificationTrackerTest extends CodeInsightTestCase { PsiModificationTracker tracker = PsiManager.getInstance(getProject()).getModificationTracker(); long count0 = tracker.getJavaStructureModificationCount(); - final PsiManagerEx psiManager = (PsiManagerEx)PsiManager.getInstance(getProject()); + final PsiManagerEx psiManager = PsiManagerEx.getInstanceEx(getProject()); VirtualFile parentDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(createTempDirectory()); assertNull(((FileManagerImpl)psiManager.getFileManager()).getCachedDirectory(parentDir)); @@ -310,7 +310,7 @@ public class PsiModificationTrackerTest extends CodeInsightTestCase { public void testClassShouldNotDisappearWithoutEvents_VirtualFileDeleted() throws IOException { PsiModificationTracker tracker = PsiManager.getInstance(getProject()).getModificationTracker(); - final PsiManagerEx psiManager = (PsiManagerEx)PsiManager.getInstance(getProject()); + final PsiManagerEx psiManager = PsiManagerEx.getInstanceEx(getProject()); final VirtualFile file = addFileToProject("Foo.java", "class Foo {}").getVirtualFile(); assertNotNull(JavaPsiFacade.getInstance(getProject()).findClass("Foo", GlobalSearchScope.allScope(getProject()))); @@ -328,7 +328,7 @@ public class PsiModificationTrackerTest extends CodeInsightTestCase { public void testClassShouldNotDisappearWithoutEvents_ParentVirtualDirectoryDeleted() throws Exception { PsiModificationTracker tracker = PsiManager.getInstance(getProject()).getModificationTracker(); - final PsiManagerEx psiManager = (PsiManagerEx)PsiManager.getInstance(getProject()); + final PsiManagerEx psiManager = PsiManagerEx.getInstanceEx(getProject()); final VirtualFile file = addFileToProject("foo/Foo.java", "package foo; class Foo {}").getVirtualFile(); assertNotNull(JavaPsiFacade.getInstance(getProject()).findClass("foo.Foo", GlobalSearchScope.allScope(getProject()))); @@ -347,7 +347,7 @@ public class PsiModificationTrackerTest extends CodeInsightTestCase { public void testVirtualFileRename_WithPsi() throws IOException { PsiModificationTracker tracker = PsiManager.getInstance(getProject()).getModificationTracker(); - final PsiManagerEx psiManager = (PsiManagerEx)PsiManager.getInstance(getProject()); + final PsiManagerEx psiManager = PsiManagerEx.getInstanceEx(getProject()); GlobalSearchScope scope = GlobalSearchScope.allScope(getProject()); final VirtualFile file = addFileToProject("foo/Foo.java", "package foo; class Foo {}").getVirtualFile(); diff --git a/java/testFramework/src/com/intellij/testFramework/fixtures/JavaCodeInsightFixtureTestCase.java b/java/testFramework/src/com/intellij/testFramework/fixtures/JavaCodeInsightFixtureTestCase.java index 9b27dec4aae8..a925b07075fb 100644 --- a/java/testFramework/src/com/intellij/testFramework/fixtures/JavaCodeInsightFixtureTestCase.java +++ b/java/testFramework/src/com/intellij/testFramework/fixtures/JavaCodeInsightFixtureTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -22,7 +22,6 @@ import com.intellij.openapi.roots.LanguageLevelProjectExtension; import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.JavaPsiFacade; import com.intellij.psi.PsiElementFactory; -import com.intellij.psi.PsiManager; import com.intellij.psi.impl.PsiManagerEx; import com.intellij.testFramework.UsefulTestCase; import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; @@ -104,7 +103,7 @@ public abstract class JavaCodeInsightFixtureTestCase extends UsefulTestCase{ } protected PsiManagerEx getPsiManager() { - return (PsiManagerEx)PsiManager.getInstance(getProject()); + return PsiManagerEx.getInstanceEx(getProject()); } public PsiElementFactory getElementFactory() { diff --git a/platform/core-impl/src/com/intellij/extapi/psi/ASTDelegatePsiElement.java b/platform/core-impl/src/com/intellij/extapi/psi/ASTDelegatePsiElement.java index 7821c1cf9e9e..1132e0fd3d0f 100644 --- a/platform/core-impl/src/com/intellij/extapi/psi/ASTDelegatePsiElement.java +++ b/platform/core-impl/src/com/intellij/extapi/psi/ASTDelegatePsiElement.java @@ -29,7 +29,6 @@ import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiInvalidElementAccessException; -import com.intellij.psi.PsiManager; import com.intellij.psi.impl.CheckUtil; import com.intellij.psi.impl.PsiElementBase; import com.intellij.psi.impl.PsiManagerEx; @@ -66,7 +65,7 @@ public abstract class ASTDelegatePsiElement extends PsiElementBase { public PsiManagerEx getManager() { Project project = ProjectCoreUtil.theOnlyOpenProject(); if (project != null) { - return (PsiManagerEx)PsiManager.getInstance(project); + return PsiManagerEx.getInstanceEx(project); } PsiElement parent = this; diff --git a/platform/core-impl/src/com/intellij/extapi/psi/StubBasedPsiElementBase.java b/platform/core-impl/src/com/intellij/extapi/psi/StubBasedPsiElementBase.java index 73f868cc4eeb..009e7d3e802b 100644 --- a/platform/core-impl/src/com/intellij/extapi/psi/StubBasedPsiElementBase.java +++ b/platform/core-impl/src/com/intellij/extapi/psi/StubBasedPsiElementBase.java @@ -27,7 +27,10 @@ import com.intellij.openapi.project.ProjectCoreUtil; import com.intellij.openapi.util.Key; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.psi.*; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiInvalidElementAccessException; +import com.intellij.psi.PsiLock; import com.intellij.psi.impl.DebugUtil; import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.impl.source.PsiFileImpl; @@ -282,7 +285,7 @@ public class StubBasedPsiElementBase extends ASTDelegateP public PsiManagerEx getManager() { Project project = ProjectCoreUtil.theOnlyOpenProject(); if (project != null) { - return (PsiManagerEx)PsiManager.getInstance(project); + return PsiManagerEx.getInstanceEx(project); } return (PsiManagerEx)getContainingFile().getManager(); } diff --git a/platform/core-impl/src/com/intellij/psi/impl/PsiManagerEx.java b/platform/core-impl/src/com/intellij/psi/impl/PsiManagerEx.java index 2c94947cd8d6..1217264ec9e0 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/PsiManagerEx.java +++ b/platform/core-impl/src/com/intellij/psi/impl/PsiManagerEx.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -15,6 +15,7 @@ */ package com.intellij.psi.impl; +import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiManager; import com.intellij.psi.impl.file.impl.FileManager; @@ -24,6 +25,9 @@ import org.jetbrains.annotations.NotNull; * @author peter */ public abstract class PsiManagerEx extends PsiManager { + public static PsiManagerEx getInstanceEx(Project project) { + return (PsiManagerEx)getInstance(project); + } public abstract boolean isBatchFilesProcessingMode(); public abstract boolean isAssertOnFileLoading(@NotNull VirtualFile file); diff --git a/platform/core-impl/src/com/intellij/psi/impl/smartPointers/SmartPsiElementPointerImpl.java b/platform/core-impl/src/com/intellij/psi/impl/smartPointers/SmartPsiElementPointerImpl.java index 73db174d0774..91bd35f0da83 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/smartPointers/SmartPsiElementPointerImpl.java +++ b/platform/core-impl/src/com/intellij/psi/impl/smartPointers/SmartPsiElementPointerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -99,7 +99,7 @@ class SmartPsiElementPointerImpl implements SmartPointerEx void cacheElement(@Nullable E element) { myElement = element == null ? null : - ((PsiManagerEx)PsiManager.getInstance(getProject())).isBatchFilesProcessingMode() ? new WeakReference(element) : + PsiManagerEx.getInstanceEx(getProject()).isBatchFilesProcessingMode() ? new WeakReference(element) : new SoftReference(element); } diff --git a/platform/core-impl/src/com/intellij/psi/impl/source/tree/TreeElement.java b/platform/core-impl/src/com/intellij/psi/impl/source/tree/TreeElement.java index 7fa637c3ba43..99fa8cb6fe59 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/source/tree/TreeElement.java +++ b/platform/core-impl/src/com/intellij/psi/impl/source/tree/TreeElement.java @@ -23,7 +23,6 @@ import com.intellij.openapi.project.ProjectCoreUtil; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiLock; -import com.intellij.psi.PsiManager; import com.intellij.psi.TokenType; import com.intellij.psi.impl.DebugUtil; import com.intellij.psi.impl.ElementBase; @@ -70,7 +69,7 @@ public abstract class TreeElement extends ElementBase implements ASTNode, Clonea public PsiManagerEx getManager() { Project project = ProjectCoreUtil.theOnlyOpenProject(); if (project != null) { - return (PsiManagerEx)PsiManager.getInstance(project); + return PsiManagerEx.getInstanceEx(project); } TreeElement element; for (element = this; element.getTreeParent() != null; element = element.getTreeParent()) { diff --git a/platform/lang-impl/src/com/intellij/psi/stubs/StubTreeLoaderImpl.java b/platform/lang-impl/src/com/intellij/psi/stubs/StubTreeLoaderImpl.java index 252a75cd3647..d44abf71d787 100644 --- a/platform/lang-impl/src/com/intellij/psi/stubs/StubTreeLoaderImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/stubs/StubTreeLoaderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -27,7 +27,6 @@ import com.intellij.openapi.util.RecursionManager; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; -import com.intellij.psi.PsiManager; import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.impl.source.PsiFileImpl; import com.intellij.psi.search.GlobalSearchScope; @@ -130,7 +129,7 @@ public class StubTreeLoaderImpl extends StubTreeLoader { if (vFile.getFileType().isBinary()) { return -1; } - PsiFile psiFile = ((PsiManagerEx)PsiManager.getInstance(project)).getFileManager().getCachedPsiFile(vFile); + PsiFile psiFile = PsiManagerEx.getInstanceEx(project).getFileManager().getCachedPsiFile(vFile); if (psiFile instanceof PsiFileImpl && ((PsiFileImpl)psiFile).isContentsLoaded()) { return psiFile.getTextLength(); } @@ -172,7 +171,7 @@ public class StubTreeLoaderImpl extends StubTreeLoader { VirtualFile file = virtualFile; int count = 0; for (Project project : ProjectManager.getInstance().getOpenProjects()) { - if (((PsiManagerEx)PsiManager.getInstance(project)).getFileManager().findCachedViewProvider(file) != null) { + if (PsiManagerEx.getInstanceEx(project).getFileManager().findCachedViewProvider(file) != null) { count++; } } diff --git a/platform/platform-impl/src/com/intellij/openapi/fileTypes/ex/FileTypeChooser.java b/platform/platform-impl/src/com/intellij/openapi/fileTypes/ex/FileTypeChooser.java index c533834f4c5b..80431efbcbf8 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileTypes/ex/FileTypeChooser.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileTypes/ex/FileTypeChooser.java @@ -25,7 +25,6 @@ import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.newvfs.impl.FakeVirtualFile; -import com.intellij.psi.PsiManager; import com.intellij.psi.impl.PsiManagerEx; import com.intellij.ui.CollectionComboBoxModel; import com.intellij.ui.DoubleClickListener; @@ -128,7 +127,7 @@ public class FileTypeChooser extends DialogWrapper { @Nullable public static FileType getKnownFileTypeOrAssociate(@NotNull VirtualFile file, @Nullable Project project) { if (project != null && !(file instanceof FakeVirtualFile)) { - ((PsiManagerEx)PsiManager.getInstance(project)).getFileManager().findFile(file); // autodetect text file if needed + PsiManagerEx.getInstanceEx(project).getFileManager().findFile(file); // autodetect text file if needed } FileType type = file.getFileType(); if (type == FileTypes.UNKNOWN) { diff --git a/platform/platform-impl/src/com/intellij/util/PsiErrorElementUtil.java b/platform/platform-impl/src/com/intellij/util/PsiErrorElementUtil.java index 1b5ed7ba7d36..7b7828b3ff32 100644 --- a/platform/platform-impl/src/com/intellij/util/PsiErrorElementUtil.java +++ b/platform/platform-impl/src/com/intellij/util/PsiErrorElementUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -25,7 +25,6 @@ import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiErrorElement; import com.intellij.psi.PsiFile; -import com.intellij.psi.PsiManager; import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.util.CachedValue; import com.intellij.psi.util.CachedValueProvider; @@ -45,7 +44,7 @@ public class PsiErrorElementUtil { if (project.isDisposed() || !virtualFile.isValid()) { return false; } - PsiManagerEx psiManager = (PsiManagerEx)PsiManager.getInstance(project); + PsiManagerEx psiManager = PsiManagerEx.getInstanceEx(project); PsiFile psiFile = psiManager.getFileManager().findFile(virtualFile); return psiFile != null && hasErrors(psiFile); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java index 5366e473721b..d841ce8f9ce7 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java @@ -36,7 +36,10 @@ import com.intellij.openapi.vfs.CharsetToolkit; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.PersistentFSConstants; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.psi.*; +import com.intellij.psi.PsiBinaryFile; +import com.intellij.psi.PsiDocumentManager; +import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiPlainTextFile; import com.intellij.psi.impl.PsiManagerEx; import com.intellij.testFramework.PlatformTestCase; import com.intellij.testFramework.PlatformTestUtil; @@ -234,7 +237,7 @@ public class FileTypesTest extends PlatformTestCase { assertEquals(PlainTextFileType.INSTANCE, vFile.getFileType()); // type autodetected during indexing - PsiFile psiFile = ((PsiManagerEx)PsiManager.getInstance(getProject())).getFileManager().findFile(vFile); // autodetect text file if needed + PsiFile psiFile = PsiManagerEx.getInstanceEx(getProject()).getFileManager().findFile(vFile); // autodetect text file if needed assertNotNull(psiFile); assertEquals(PlainTextFileType.INSTANCE, psiFile.getFileType()); } diff --git a/platform/testFramework/src/com/intellij/testFramework/FileTreeAccessFilter.java b/platform/testFramework/src/com/intellij/testFramework/FileTreeAccessFilter.java index 06155a9004ef..445f2c73877f 100755 --- a/platform/testFramework/src/com/intellij/testFramework/FileTreeAccessFilter.java +++ b/platform/testFramework/src/com/intellij/testFramework/FileTreeAccessFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -30,7 +30,7 @@ import java.util.Set; * @author cdr */ public class FileTreeAccessFilter implements VirtualFileFilter { - protected final Set myAddedClasses = new THashSet(); + private final Set myAddedClasses = new THashSet<>(); private boolean myTreeAccessAllowed; @Override @@ -52,6 +52,6 @@ public class FileTreeAccessFilter implements VirtualFileFilter { } public String toString() { - return "JAVA {allowed=" + myTreeAccessAllowed + " files=" + new ArrayList(myAddedClasses) + "}"; + return "JAVA {allowed=" + myTreeAccessAllowed + " files=" + new ArrayList<>(myAddedClasses) + "}"; } } diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyPsiManager.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyPsiManager.java index a2b367459739..2cca3e3422fd 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyPsiManager.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyPsiManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -68,7 +68,7 @@ public class GroovyPsiManager { public GroovyPsiManager(Project project) { myProject = project; - ((PsiManagerEx)PsiManager.getInstance(myProject)).registerRunnableToRunOnAnyChange(new Runnable() { + PsiManagerEx.getInstanceEx(myProject).registerRunnableToRunOnAnyChange(new Runnable() { @Override public void run() { dropTypesCache(); diff --git a/python/ipnb/src/org/jetbrains/plugins/ipnb/psi/IpnbPyFragment.java b/python/ipnb/src/org/jetbrains/plugins/ipnb/psi/IpnbPyFragment.java index 0ef5ccfbf46a..79cd638f06b6 100644 --- a/python/ipnb/src/org/jetbrains/plugins/ipnb/psi/IpnbPyFragment.java +++ b/python/ipnb/src/org/jetbrains/plugins/ipnb/psi/IpnbPyFragment.java @@ -23,7 +23,7 @@ public class IpnbPyFragment extends PyFileImpl { private FileViewProvider myViewProvider; public IpnbPyFragment(Project project, CharSequence text, boolean isPhysical, IpnbCodeSourcePanel codeSourcePanel) { - super(((PsiManagerEx)PsiManager.getInstance(project)).getFileManager().createFileViewProvider( + super(PsiManagerEx.getInstanceEx(project).getFileManager().createFileViewProvider( new LightVirtualFile("code.py", IpnbPyLanguageDialect.getInstance(), text), isPhysical) ); myPhysical = isPhysical; diff --git a/python/src/com/jetbrains/python/psi/impl/PyExpressionCodeFragmentImpl.java b/python/src/com/jetbrains/python/psi/impl/PyExpressionCodeFragmentImpl.java index 733f9b85e246..ec62e1647fd0 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyExpressionCodeFragmentImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyExpressionCodeFragmentImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -19,7 +19,6 @@ import com.intellij.openapi.fileTypes.FileTypeManager; import com.intellij.openapi.project.Project; import com.intellij.psi.FileViewProvider; import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiManager; import com.intellij.psi.SingleRootFileViewProvider; import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.impl.file.impl.FileManager; @@ -38,7 +37,7 @@ public class PyExpressionCodeFragmentImpl extends PyFileImpl implements PyExpres private FileViewProvider myViewProvider; public PyExpressionCodeFragmentImpl(Project project, @NonNls String name, CharSequence text, boolean isPhysical) { - super(((PsiManagerEx)PsiManager.getInstance(project)).getFileManager().createFileViewProvider( + super(PsiManagerEx.getInstanceEx(project).getFileManager().createFileViewProvider( new LightVirtualFile(name, FileTypeManager.getInstance().getFileTypeByFileName(name), text), isPhysical) ); myPhysical = isPhysical; diff --git a/python/src/com/jetbrains/python/refactoring/changeSignature/PyExpressionCodeFragment.java b/python/src/com/jetbrains/python/refactoring/changeSignature/PyExpressionCodeFragment.java index fd789e62b467..0a0cb9b81174 100644 --- a/python/src/com/jetbrains/python/refactoring/changeSignature/PyExpressionCodeFragment.java +++ b/python/src/com/jetbrains/python/refactoring/changeSignature/PyExpressionCodeFragment.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -18,7 +18,6 @@ package com.jetbrains.python.refactoring.changeSignature; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiCodeFragment; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.PsiManager; import com.intellij.psi.SingleRootFileViewProvider; import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.search.GlobalSearchScope; @@ -39,7 +38,7 @@ public class PyExpressionCodeFragment extends PyFileImpl implements PsiCodeFragm public PyExpressionCodeFragment(@NotNull final Project project, @NonNls final String name, @NotNull final CharSequence text) { - super(((PsiManagerEx)PsiManager.getInstance(project)).getFileManager().createFileViewProvider( + super(PsiManagerEx.getInstanceEx(project).getFileManager().createFileViewProvider( new LightVirtualFile(name, PythonFileType.INSTANCE, text), true)); ((SingleRootFileViewProvider)getViewProvider()).forceCachedPsi(this); } diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomManagerImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomManagerImpl.java index 47e46e8dfaf2..5c54349481e4 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/impl/DomManagerImpl.java +++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -35,7 +35,10 @@ import com.intellij.pom.event.PomModelEvent; import com.intellij.pom.event.PomModelListener; import com.intellij.pom.xml.XmlAspect; import com.intellij.pom.xml.XmlChangeSet; -import com.intellij.psi.*; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiFileFactory; +import com.intellij.psi.PsiManager; import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.xml.XmlAttribute; import com.intellij.psi.xml.XmlElement; @@ -160,7 +163,7 @@ public final class DomManagerImpl extends DomManager { } private PsiFile getCachedPsiFile(VirtualFile file) { - return ((PsiManagerEx)PsiManager.getInstance(myProject)).getFileManager().getCachedPsiFile(file); + return PsiManagerEx.getInstanceEx(myProject).getFileManager().getCachedPsiFile(file); } private List calcDomChangeEvents(final VirtualFile file) { From 3c593320f6e0f0ff89e70817bb98406cb0a66f7d Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 28 Apr 2016 17:32:42 +0300 Subject: [PATCH 04/19] moved setAssertOnFileLoadingFilter from JavaPsiFacade to PsiManagerEx --- .../src/com/intellij/psi/impl/JavaPsiFacadeEx.java | 5 ----- .../src/com/intellij/psi/impl/JavaPsiFacadeImpl.java | 8 -------- .../com/intellij/psi/ModifyAnnotationsTest.java | 7 ++++--- .../com/intellij/psi/Src15RepositoryUseTest.java | 10 +++++----- .../com/intellij/psi/SrcRepositoryUseTest.java | 7 ++++--- .../codeInsight/daemon/DaemonAnalyzerTestCase.java | 11 +++-------- .../daemon/LightDaemonAnalyzerTestCase.java | 9 +++++---- .../src/com/intellij/psi/impl/PsiManagerEx.java | 7 +++++++ .../src/com/intellij/psi/impl/PsiManagerImpl.java | 3 ++- .../src/com/intellij/mock/MockPsiManager.java | 10 ++++++++-- .../fixtures/impl/CodeInsightTestFixtureImpl.java | 5 +++-- .../python/fixtures/PyMultiFileResolveTestCase.java | 6 +++--- .../com/intellij/util/xml/stubs/DomStubUsingTest.java | 6 +++--- 13 files changed, 47 insertions(+), 47 deletions(-) diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeEx.java b/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeEx.java index 3d9413d65fda..92435f9efb24 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeEx.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeEx.java @@ -19,9 +19,7 @@ */ package com.intellij.psi.impl; -import com.intellij.openapi.Disposable; import com.intellij.openapi.project.Project; -import com.intellij.openapi.vfs.VirtualFileFilter; import com.intellij.psi.JavaPsiFacade; import com.intellij.psi.PsiClass; import com.intellij.psi.search.GlobalSearchScope; @@ -40,7 +38,4 @@ public abstract class JavaPsiFacadeEx extends JavaPsiFacade { public PsiClass findClass(@NotNull String qualifiedName) { return findClass(qualifiedName, GlobalSearchScope.allScope(getProject())); } - - @TestOnly - public abstract void setAssertOnFileLoadingFilter(@NotNull VirtualFileFilter filter, @NotNull Disposable parentDisposable); } \ No newline at end of file diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeImpl.java index cfb2e6501d44..567efbc9955b 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeImpl.java @@ -15,7 +15,6 @@ */ package com.intellij.psi.impl; -import com.intellij.openapi.Disposable; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.progress.ProgressIndicatorProvider; import com.intellij.openapi.project.DumbService; @@ -24,7 +23,6 @@ import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Condition; import com.intellij.openapi.util.Conditions; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.openapi.vfs.VirtualFileFilter; import com.intellij.psi.*; import com.intellij.psi.impl.file.impl.JavaFileManager; import com.intellij.psi.impl.source.DummyHolderFactory; @@ -412,12 +410,6 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx { return PsiElementFactory.SERVICE.getInstance(myProject); } - @TestOnly - @Override - public void setAssertOnFileLoadingFilter(@NotNull final VirtualFileFilter filter, @NotNull Disposable parentDisposable) { - ((PsiManagerImpl)PsiManager.getInstance(myProject)).setAssertOnFileLoadingFilter(filter, parentDisposable); - } - @TestOnly public void clearFindersCache() { myElementFinders = null; diff --git a/java/java-tests/testSrc/com/intellij/psi/ModifyAnnotationsTest.java b/java/java-tests/testSrc/com/intellij/psi/ModifyAnnotationsTest.java index e4f8b59403ab..a2fbbf3e65df 100644 --- a/java/java-tests/testSrc/com/intellij/psi/ModifyAnnotationsTest.java +++ b/java/java-tests/testSrc/com/intellij/psi/ModifyAnnotationsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -19,6 +19,7 @@ import com.intellij.JavaTestUtil; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.vfs.VirtualFileFilter; +import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.testFramework.IdeaTestUtil; import com.intellij.testFramework.PsiTestCase; @@ -40,7 +41,7 @@ public class ModifyAnnotationsTest extends PsiTestCase { public void testReplaceAnnotation() throws Exception { //be sure not to load tree - getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.ALL, myTestRootDisposable); + PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(VirtualFileFilter.ALL, myTestRootDisposable); PsiClass aClass = myJavaFacade.findClass("Test", GlobalSearchScope.allScope(myProject)); assertNotNull(aClass); final PsiAnnotation[] annotations = aClass.getModifierList().getAnnotations(); @@ -48,7 +49,7 @@ public class ModifyAnnotationsTest extends PsiTestCase { assertEquals("A", annotations[0].getNameReferenceElement().getReferenceName()); final PsiAnnotation newAnnotation = myJavaFacade.getElementFactory().createAnnotationFromText("@B", null); //here the tree is going to be loaded - getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable); + PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable); CommandProcessor.getInstance().executeCommand(myProject, new Runnable() { @Override public void run() { diff --git a/java/java-tests/testSrc/com/intellij/psi/Src15RepositoryUseTest.java b/java/java-tests/testSrc/com/intellij/psi/Src15RepositoryUseTest.java index be6000658221..7a1577548608 100644 --- a/java/java-tests/testSrc/com/intellij/psi/Src15RepositoryUseTest.java +++ b/java/java-tests/testSrc/com/intellij/psi/Src15RepositoryUseTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -16,11 +16,11 @@ package com.intellij.psi; import com.intellij.openapi.application.ex.PathManagerEx; -import com.intellij.openapi.projectRoots.impl.JavaSdkImpl; import com.intellij.openapi.roots.LanguageLevelProjectExtension; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.VirtualFileFilter; import com.intellij.pom.java.LanguageLevel; +import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.search.searches.AnnotatedMembersSearch; import com.intellij.psi.search.searches.AnnotatedPackagesSearch; @@ -294,7 +294,7 @@ public class Src15RepositoryUseTest extends PsiTestCase { } public void testAnnotationIndex() throws Exception { - getJavaFacade().setAssertOnFileLoadingFilter(new VirtualFileFilter() { + PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(new VirtualFileFilter() { @Override public boolean accept(final VirtualFile file) { return !"package-info.java".equals(file.getName()); @@ -321,11 +321,11 @@ public class Src15RepositoryUseTest extends PsiTestCase { } private void setupLoadingFilter() { - getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.ALL, myTestRootDisposable); + PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(VirtualFileFilter.ALL, myTestRootDisposable); } private void tearDownLoadingFilter() { - getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable); + PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable); } @NotNull diff --git a/java/java-tests/testSrc/com/intellij/psi/SrcRepositoryUseTest.java b/java/java-tests/testSrc/com/intellij/psi/SrcRepositoryUseTest.java index 98740f83d35e..0627b13693ff 100644 --- a/java/java-tests/testSrc/com/intellij/psi/SrcRepositoryUseTest.java +++ b/java/java-tests/testSrc/com/intellij/psi/SrcRepositoryUseTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -30,6 +30,7 @@ import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.VirtualFileFilter; import com.intellij.pom.java.LanguageLevel; +import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.impl.source.PsiFileImpl; import com.intellij.psi.impl.source.tree.CompositeElement; import com.intellij.psi.search.GlobalSearchScope; @@ -584,11 +585,11 @@ public class SrcRepositoryUseTest extends PsiTestCase{ } private void teardownLoadingFilter() { - getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable); + PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable); } private void setupLoadingFilter() { - getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.ALL, myTestRootDisposable); + PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(VirtualFileFilter.ALL, myTestRootDisposable); } public void testAnonymousClass2() throws Exception { diff --git a/java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java b/java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java index bcb68177295f..d6649cdcbb11 100644 --- a/java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java +++ b/java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java @@ -59,7 +59,7 @@ import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.*; import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.psi.*; -import com.intellij.psi.impl.JavaPsiFacadeEx; +import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.impl.cache.CacheManager; import com.intellij.psi.impl.search.IndexPatternBuilder; import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; @@ -275,10 +275,7 @@ public abstract class DaemonAnalyzerTestCase extends CodeInsightTestCase { if (!DumbService.isDumb(getProject())) { CacheManager.SERVICE.getInstance(myProject).getFilesWithWord("XXX", UsageSearchContext.IN_COMMENTS, GlobalSearchScope.allScope(myProject), true); } - final JavaPsiFacadeEx facade = getJavaFacade(); - if (facade != null) { - facade.setAssertOnFileLoadingFilter(myVirtualFileFilter, myTestRootDisposable); // check repository work - } + PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(myVirtualFileFilter, myTestRootDisposable); try { Collection infos = doHighlighting(); @@ -289,9 +286,7 @@ public abstract class DaemonAnalyzerTestCase extends CodeInsightTestCase { return infos; } finally { - if (facade != null) { - facade.setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable); - } + PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable); } } diff --git a/java/testFramework/src/com/intellij/codeInsight/daemon/LightDaemonAnalyzerTestCase.java b/java/testFramework/src/com/intellij/codeInsight/daemon/LightDaemonAnalyzerTestCase.java index b8fdd3b15109..e8a63d4eb1cb 100644 --- a/java/testFramework/src/com/intellij/codeInsight/daemon/LightDaemonAnalyzerTestCase.java +++ b/java/testFramework/src/com/intellij/codeInsight/daemon/LightDaemonAnalyzerTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -26,6 +26,7 @@ import com.intellij.openapi.editor.Editor; import com.intellij.openapi.vfs.VirtualFileFilter; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; +import com.intellij.psi.impl.PsiManagerEx; import com.intellij.testFramework.ExpectedHighlightingData; import com.intellij.testFramework.FileTreeAccessFilter; import com.intellij.testFramework.HighlightTestInfo; @@ -91,7 +92,7 @@ public abstract class LightDaemonAnalyzerTestCase extends LightCodeInsightTestCa } protected void doTestConfiguredFile(boolean checkWarnings, boolean checkWeakWarnings, boolean checkInfos, @Nullable String filePath) { - getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable); + PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable); ExpectedHighlightingData data = getExpectedHighlightingData(checkWarnings, checkWeakWarnings, checkInfos); checkHighlighting(data, composeLocalPath(filePath)); @@ -112,7 +113,7 @@ public abstract class LightDaemonAnalyzerTestCase extends LightCodeInsightTestCa PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); getFile().getText(); //to load text myJavaFilesFilter.allowTreeAccessForFile(getVFile()); - getJavaFacade().setAssertOnFileLoadingFilter(myJavaFilesFilter, myTestRootDisposable); // check repository work + PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(myJavaFilesFilter, myTestRootDisposable); try { Collection infos = doHighlighting(); @@ -120,7 +121,7 @@ public abstract class LightDaemonAnalyzerTestCase extends LightCodeInsightTestCa data.checkResult(infos, getEditor().getDocument().getText(), filePath); } finally { - getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable); + PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable); } } diff --git a/platform/core-impl/src/com/intellij/psi/impl/PsiManagerEx.java b/platform/core-impl/src/com/intellij/psi/impl/PsiManagerEx.java index 1217264ec9e0..5c790ff949c7 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/PsiManagerEx.java +++ b/platform/core-impl/src/com/intellij/psi/impl/PsiManagerEx.java @@ -15,11 +15,14 @@ */ package com.intellij.psi.impl; +import com.intellij.openapi.Disposable; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.openapi.vfs.VirtualFileFilter; import com.intellij.psi.PsiManager; import com.intellij.psi.impl.file.impl.FileManager; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.TestOnly; /** * @author peter @@ -30,6 +33,10 @@ public abstract class PsiManagerEx extends PsiManager { } public abstract boolean isBatchFilesProcessingMode(); + @TestOnly + public abstract void setAssertOnFileLoadingFilter(@NotNull VirtualFileFilter filter, @NotNull Disposable parentDisposable); + + @TestOnly public abstract boolean isAssertOnFileLoading(@NotNull VirtualFile file); /** diff --git a/platform/core-impl/src/com/intellij/psi/impl/PsiManagerImpl.java b/platform/core-impl/src/com/intellij/psi/impl/PsiManagerImpl.java index 094c145df091..b681be0366fc 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/PsiManagerImpl.java +++ b/platform/core-impl/src/com/intellij/psi/impl/PsiManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -137,6 +137,7 @@ public class PsiManagerImpl extends PsiManagerEx { return false; } + @Override @TestOnly public void setAssertOnFileLoadingFilter(@NotNull VirtualFileFilter filter, @NotNull Disposable parentDisposable) { // Find something to ensure there's no changed files waiting to be processed in repository indices. diff --git a/platform/lang-impl/src/com/intellij/mock/MockPsiManager.java b/platform/lang-impl/src/com/intellij/mock/MockPsiManager.java index c1572ccb7941..0486377dd92a 100644 --- a/platform/lang-impl/src/com/intellij/mock/MockPsiManager.java +++ b/platform/lang-impl/src/com/intellij/mock/MockPsiManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -21,6 +21,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Key; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.openapi.vfs.VirtualFileFilter; import com.intellij.psi.*; import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.impl.PsiModificationTrackerImpl; @@ -35,7 +36,7 @@ import java.util.Map; public class MockPsiManager extends PsiManagerEx { private final Project myProject; - private final Map myDirectories = new THashMap(); + private final Map myDirectories = new THashMap<>(); private MockFileManager myMockFileManager; private PsiModificationTrackerImpl myPsiModificationTracker; @@ -185,4 +186,9 @@ public class MockPsiManager extends PsiManagerEx { @Override public void beforeChildAddition(@NotNull PsiTreeChangeEventImpl event) { } + + @Override + public void setAssertOnFileLoadingFilter(@NotNull VirtualFileFilter filter, @NotNull Disposable parentDisposable) { + + } } diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java index 76c2ed0310ea..66ec057c8403 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -89,6 +89,7 @@ import com.intellij.profile.codeInspection.InspectionProfileManager; import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.psi.*; import com.intellij.psi.impl.DebugUtil; +import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.impl.PsiManagerImpl; import com.intellij.psi.impl.PsiModificationTrackerImpl; import com.intellij.psi.impl.cache.CacheManager; @@ -1626,7 +1627,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig final VirtualFileFilter fileTreeAccessFilter = myVirtualFileFilter; Disposable disposable = Disposer.newDisposable(); if (fileTreeAccessFilter != null) { - ((PsiManagerImpl)PsiManager.getInstance(project)).setAssertOnFileLoadingFilter(fileTreeAccessFilter, disposable); + PsiManagerEx.getInstanceEx(project).setAssertOnFileLoadingFilter(fileTreeAccessFilter, disposable); } // ProfilingUtil.startCPUProfiling(); diff --git a/python/testSrc/com/jetbrains/python/fixtures/PyMultiFileResolveTestCase.java b/python/testSrc/com/jetbrains/python/fixtures/PyMultiFileResolveTestCase.java index b16b20b2dc32..76d76c439c61 100644 --- a/python/testSrc/com/jetbrains/python/fixtures/PyMultiFileResolveTestCase.java +++ b/python/testSrc/com/jetbrains/python/fixtures/PyMultiFileResolveTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -19,7 +19,7 @@ import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.VirtualFileFilter; import com.intellij.psi.*; -import com.intellij.psi.impl.PsiManagerImpl; +import com.intellij.psi.impl.PsiManagerEx; import com.intellij.util.Function; import com.intellij.util.containers.ContainerUtil; import com.jetbrains.python.PythonFileType; @@ -43,7 +43,7 @@ public abstract class PyMultiFileResolveTestCase extends PyResolveTestCase { protected PsiElement doResolve(PsiFile psiFile) { final PsiReference ref = PyResolveTestCase.findReferenceByMarker(psiFile); - final PsiManagerImpl psiManager = (PsiManagerImpl)myFixture.getPsiManager(); + final PsiManagerEx psiManager = (PsiManagerEx)myFixture.getPsiManager(); psiManager.setAssertOnFileLoadingFilter(new VirtualFileFilter() { @Override public boolean accept(VirtualFile file) { diff --git a/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubUsingTest.java b/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubUsingTest.java index 42c6c7c4795d..76610f2fe3d2 100644 --- a/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubUsingTest.java +++ b/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubUsingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -19,7 +19,7 @@ import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.vfs.VirtualFileFilter; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiFile; -import com.intellij.psi.impl.PsiManagerImpl; +import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.xml.XmlAttribute; import com.intellij.psi.xml.XmlFile; import com.intellij.psi.xml.XmlTag; @@ -122,7 +122,7 @@ public class DomStubUsingTest extends DomStubTest { public void testFileLoading() throws Exception { XmlFile file = prepareFile("foo.xml"); - ((PsiManagerImpl)getPsiManager()).setAssertOnFileLoadingFilter(VirtualFileFilter.ALL, myTestRootDisposable); + ((PsiManagerEx)getPsiManager()).setAssertOnFileLoadingFilter(VirtualFileFilter.ALL, myTestRootDisposable); DomFileElement element = DomManager.getDomManager(getProject()).getFileElement(file, Foo.class); assertNotNull(element); GenericDomValue id = element.getRootElement().getId(); From 5f91021f83ff8e1164f726d45330896c856d0662 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 28 Apr 2016 18:26:46 +0300 Subject: [PATCH 05/19] notnull --- .../NullableStuffInspectionAncientTest.java | 19 ++++++- .../TestOnlyInspectionTest.java | 4 +- .../UnusedLibraryInspectionTest.java | 12 +---- .../testFramework/InspectionTestCase.java | 49 +++++++++---------- .../com/siyeh/ig/IGInspectionTestCase.java | 23 ++++----- 5 files changed, 57 insertions(+), 50 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/NullableStuffInspectionAncientTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/NullableStuffInspectionAncientTest.java index e1e7a3b13bc5..79c36144385b 100644 --- a/java/java-tests/testSrc/com/intellij/codeInspection/NullableStuffInspectionAncientTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInspection/NullableStuffInspectionAncientTest.java @@ -1,3 +1,19 @@ +/* + * 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. + */ + /* * Created by IntelliJ IDEA. * User: Alexey @@ -17,6 +33,7 @@ import com.intellij.openapi.roots.OrderRootType; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.testFramework.InspectionTestCase; import com.intellij.testFramework.PsiTestUtil; +import org.jetbrains.annotations.NotNull; public class NullableStuffInspectionAncientTest extends InspectionTestCase { private final NullableStuffInspection myInspection = new NullableStuffInspection(); @@ -38,7 +55,7 @@ public class NullableStuffInspectionAncientTest extends InspectionTestCase { } @Override - protected void setupRootModel(String testDir, VirtualFile[] sourceDir, String sdkName) { + protected void setupRootModel(@NotNull String testDir, @NotNull VirtualFile[] sourceDir, String sdkName) { super.setupRootModel(testDir, sourceDir, sdkName); Sdk sdk = ModuleRootManager.getInstance(myModule).getSdk(); removeAnnotationsJar(sdk); diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/TestOnlyInspectionTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/TestOnlyInspectionTest.java index 1a116d820520..ec5179738ba8 100644 --- a/java/java-tests/testSrc/com/intellij/codeInspection/TestOnlyInspectionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInspection/TestOnlyInspectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -26,7 +26,7 @@ import org.jetbrains.annotations.NotNull; public class TestOnlyInspectionTest extends InspectionTestCase { @Override - protected void setupRootModel(String testDir, VirtualFile[] sourceDir, String jdkName) { + protected void setupRootModel(@NotNull String testDir, @NotNull VirtualFile[] sourceDir, String jdkName) { super.setupRootModel(testDir, sourceDir, jdkName); VirtualFile projectDir = LocalFileSystem.getInstance().findFileByPath(testDir); assertNotNull(projectDir); diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/UnusedLibraryInspectionTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/UnusedLibraryInspectionTest.java index a06593a2f9cd..c64ceee52e53 100644 --- a/java/java-tests/testSrc/com/intellij/codeInspection/UnusedLibraryInspectionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInspection/UnusedLibraryInspectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -26,17 +26,9 @@ package com.intellij.codeInspection; import com.intellij.JavaTestUtil; import com.intellij.analysis.AnalysisScope; -import com.intellij.codeInspection.ex.LocalInspectionToolWrapper; -import com.intellij.codeInspection.magicConstant.MagicConstantInspection; import com.intellij.codeInspection.unusedLibraries.UnusedLibrariesInspection; -import com.intellij.openapi.projectRoots.Sdk; -import com.intellij.openapi.projectRoots.SdkModificator; -import com.intellij.openapi.roots.AnnotationOrderRootType; -import com.intellij.openapi.util.io.FileUtil; -import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.testFramework.InspectionTestCase; -import com.intellij.testFramework.PlatformTestUtil; import com.intellij.testFramework.PsiTestUtil; import org.jetbrains.annotations.NotNull; @@ -47,7 +39,7 @@ public class UnusedLibraryInspectionTest extends InspectionTestCase { } @Override - protected void setupRootModel(String testDir, VirtualFile[] sourceDir, String sdkName) { + protected void setupRootModel(@NotNull String testDir, @NotNull VirtualFile[] sourceDir, String sdkName) { super.setupRootModel(testDir, sourceDir, sdkName); PsiTestUtil.addLibrary(getModule(), "JUnit", getTestDataPath(), "/junit.jar"); } diff --git a/java/testFramework/src/com/intellij/testFramework/InspectionTestCase.java b/java/testFramework/src/com/intellij/testFramework/InspectionTestCase.java index 581b96838ac2..bf6fab22bd8d 100644 --- a/java/testFramework/src/com/intellij/testFramework/InspectionTestCase.java +++ b/java/testFramework/src/com/intellij/testFramework/InspectionTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -54,7 +54,7 @@ import java.io.File; * @author max * @since Apr 11, 2002 */ -@SuppressWarnings({"HardCodedStringLiteral"}) +@SuppressWarnings("HardCodedStringLiteral") public abstract class InspectionTestCase extends PsiTestCase { private static final Logger LOG = Logger.getInstance("#com.intellij.testFramework.InspectionTestCase"); private EntryPoint myUnusedCodeExtension; @@ -72,73 +72,70 @@ public abstract class InspectionTestCase extends PsiTestCase { return (InspectionManagerEx)InspectionManager.getInstance(myProject); } - public void doTest(@NonNls String folderName, LocalInspectionTool tool) { + public void doTest(@NonNls @NotNull String folderName, @NotNull LocalInspectionTool tool) { doTest(folderName, new LocalInspectionToolWrapper(tool)); } - public void doTest(@NonNls String folderName, GlobalInspectionTool tool) { + public void doTest(@NonNls @NotNull String folderName, @NotNull GlobalInspectionTool tool) { doTest(folderName, new GlobalInspectionToolWrapper(tool)); } - public void doTest(@NonNls String folderName, GlobalInspectionTool tool, boolean checkRange) { + public void doTest(@NonNls @NotNull String folderName, @NotNull GlobalInspectionTool tool, boolean checkRange) { doTest(folderName, new GlobalInspectionToolWrapper(tool), checkRange); } - public void doTest(@NonNls String folderName, GlobalInspectionTool tool, boolean checkRange, boolean runDeadCodeFirst) { + public void doTest(@NonNls @NotNull String folderName, @NotNull GlobalInspectionTool tool, boolean checkRange, boolean runDeadCodeFirst) { doTest(folderName, new GlobalInspectionToolWrapper(tool), "java 1.4", checkRange, runDeadCodeFirst); } - public void doTest(@NonNls String folderName, InspectionToolWrapper tool) { + public void doTest(@NonNls @NotNull String folderName, @NotNull InspectionToolWrapper tool) { doTest(folderName, tool, "java 1.4"); } - public void doTest(@NonNls String folderName, InspectionToolWrapper tool, final boolean checkRange) { + public void doTest(@NonNls @NotNull String folderName, @NotNull InspectionToolWrapper tool, final boolean checkRange) { doTest(folderName, tool, "java 1.4", checkRange); } - public void doTest(@NonNls String folderName, LocalInspectionTool tool, @NonNls final String jdkName) { + public void doTest(@NonNls @NotNull String folderName, @NotNull LocalInspectionTool tool, @NonNls final String jdkName) { doTest(folderName, new LocalInspectionToolWrapper(tool), jdkName); } - public void doTest(@NonNls String folderName, InspectionToolWrapper tool, @NonNls final String jdkName) { + public void doTest(@NonNls @NotNull String folderName, @NotNull InspectionToolWrapper tool, @NonNls final String jdkName) { doTest(folderName, tool, jdkName, false); } - public void doTest(@NonNls String folderName, InspectionToolWrapper tool, @NonNls final String jdkName, boolean checkRange) { + public void doTest(@NonNls @NotNull String folderName, @NotNull InspectionToolWrapper tool, @NonNls final String jdkName, boolean checkRange) { doTest(folderName, tool, jdkName, checkRange, false); } - public void doTest(@NonNls String folderName, - InspectionToolWrapper toolWrapper, + public void doTest(@NonNls @NotNull String folderName, + @NotNull InspectionToolWrapper toolWrapper, @NonNls final String jdkName, boolean checkRange, boolean runDeadCodeFirst, - InspectionToolWrapper... additional) { + @NotNull InspectionToolWrapper... additional) { final String testDir = getTestDataPath() + "/" + folderName; GlobalInspectionContextImpl context = runTool(testDir, jdkName, runDeadCodeFirst, toolWrapper, additional); InspectionTestUtil.compareToolResults(context, toolWrapper, checkRange, testDir); } - protected void runTool(@NonNls final String testDir, @NonNls final String jdkName, final InspectionToolWrapper tool) { + protected void runTool(@NonNls @NotNull String testDir, @NonNls final String jdkName, @NotNull InspectionToolWrapper tool) { runTool(testDir, jdkName, false, tool); } - protected GlobalInspectionContextImpl runTool(final String testDir, + protected GlobalInspectionContextImpl runTool(@NotNull final String testDir, final String jdkName, boolean runDeadCodeFirst, @NotNull InspectionToolWrapper toolWrapper, @NotNull InspectionToolWrapper... additional) { final VirtualFile[] sourceDir = new VirtualFile[1]; - ApplicationManager.getApplication().runWriteAction(new Runnable() { - @Override - public void run() { - try { - setupRootModel(testDir, sourceDir, jdkName); - } - catch (Exception e) { - LOG.error(e); - } + ApplicationManager.getApplication().runWriteAction(() -> { + try { + setupRootModel(testDir, sourceDir, jdkName); + } + catch (Exception e) { + LOG.error(e); } }); VirtualFile projectDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(testDir)); @@ -160,7 +157,7 @@ public abstract class InspectionTestCase extends PsiTestCase { return new AnalysisScope(psiManager.findDirectory(sourceDir)); } - protected void setupRootModel(final String testDir, final VirtualFile[] sourceDir, final String sdkName) { + protected void setupRootModel(@NotNull String testDir, @NotNull VirtualFile[] sourceDir, final String sdkName) { VirtualFile projectDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(testDir)); assertNotNull("could not find project dir " + testDir, projectDir); sourceDir[0] = projectDir.findChild("src"); diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/IGInspectionTestCase.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/IGInspectionTestCase.java index 82f315a392b2..827d1ce15235 100644 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/IGInspectionTestCase.java +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/IGInspectionTestCase.java @@ -1,17 +1,17 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * 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 + * 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 + * 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. + * 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.siyeh.ig; @@ -20,6 +20,7 @@ import com.intellij.codeInspection.ex.LocalInspectionToolWrapper; import com.intellij.openapi.application.PluginPathManager; import com.intellij.testFramework.InspectionTestCase; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; /** * @author Alexey @@ -31,7 +32,7 @@ public abstract class IGInspectionTestCase extends InspectionTestCase { } @Override - public void doTest(@NonNls final String folderName, final LocalInspectionTool tool) { + public void doTest(@NotNull @NonNls final String folderName, @NotNull final LocalInspectionTool tool) { super.doTest(folderName, new LocalInspectionToolWrapper(tool), "java 1.5"); } } From fb358f0ccebf8cda16f053068cbdaa95343e30bd Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 28 Apr 2016 18:28:48 +0300 Subject: [PATCH 06/19] test for not loading AST unnecessarily --- .../inspection/magic/withLibrary/expected.xml | 9 ++++ .../inspection/magic/withLibrary/src/X.java | 29 ++++++++++++ .../MagicConstantInspectionTest.java | 47 ++++++++++++++++++- 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 java/java-tests/testData/inspection/magic/withLibrary/expected.xml create mode 100644 java/java-tests/testData/inspection/magic/withLibrary/src/X.java diff --git a/java/java-tests/testData/inspection/magic/withLibrary/expected.xml b/java/java-tests/testData/inspection/magic/withLibrary/expected.xml new file mode 100644 index 000000000000..33405f685a37 --- /dev/null +++ b/java/java-tests/testData/inspection/magic/withLibrary/expected.xml @@ -0,0 +1,9 @@ + + + + X.java + 23 + Magic Constant + Should be one of: WindowConstants.DO_NOTHING_ON_CLOSE, WindowConstants.HIDE_ON_CLOSE, WindowConstants.DISPOSE_ON_CLOSE, WindowConstants.EXIT_ON_CLOSE + + diff --git a/java/java-tests/testData/inspection/magic/withLibrary/src/X.java b/java/java-tests/testData/inspection/magic/withLibrary/src/X.java new file mode 100644 index 000000000000..6ebaa13e932e --- /dev/null +++ b/java/java-tests/testData/inspection/magic/withLibrary/src/X.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2011 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import org.intellij.lang.annotations.MagicConstant; + +import java.awt.*; +import javax.swing.*; + +public class X { + void f(JFrame frame) { + frame.setDefaultCloseOperation(2); // there is beanInfo in in JFrame.java, have to parse (but added to exceptions, so ok) + } + + void f(Frame frame) { + frame.setState(2); // no beanInfo in Frame.java, no need to parse + } +} diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/MagicConstantInspectionTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/MagicConstantInspectionTest.java index 3d309cecc51f..7cf6062df848 100644 --- a/java/java-tests/testSrc/com/intellij/codeInspection/MagicConstantInspectionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInspection/MagicConstantInspectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * 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. @@ -28,15 +28,38 @@ import com.intellij.JavaTestUtil; import com.intellij.codeInspection.ex.LocalInspectionToolWrapper; import com.intellij.codeInspection.magicConstant.MagicConstantInspection; import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.openapi.vfs.LocalFileSystem; +import com.intellij.openapi.vfs.VfsUtilCore; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.openapi.vfs.VirtualFileVisitor; +import com.intellij.psi.JavaPsiFacade; +import com.intellij.psi.PsiClass; +import com.intellij.psi.impl.PsiManagerEx; +import com.intellij.psi.impl.source.PsiClassImpl; +import com.intellij.psi.search.GlobalSearchScope; +import com.intellij.testFramework.FileTreeAccessFilter; import com.intellij.testFramework.InspectionTestCase; import com.intellij.testFramework.PsiTestUtil; +import org.jetbrains.annotations.NotNull; + +import java.io.File; public class MagicConstantInspectionTest extends InspectionTestCase { + + private FileTreeAccessFilter myFilter; + @Override protected String getTestDataPath() { return JavaTestUtil.getJavaTestDataPath() + "/inspection"; } + @Override + protected void setUp() throws Exception { + super.setUp(); + myFilter = new FileTreeAccessFilter(); + PsiManagerEx.getInstanceEx(getProject()).setAssertOnFileLoadingFilter(myFilter, myTestRootDisposable); + } + @Override protected Sdk getTestProjectSdk() { return PsiTestUtil.addJdkAnnotations(super.getTestProjectSdk()); @@ -46,5 +69,27 @@ public class MagicConstantInspectionTest extends InspectionTestCase { doTest("magic/" + getTestName(true), new LocalInspectionToolWrapper(new MagicConstantInspection()), "jdk 1.7"); } + @Override + protected void setupRootModel(@NotNull String testDir, @NotNull VirtualFile[] sourceDir, String sdkName) { + super.setupRootModel(testDir, sourceDir, sdkName); + VirtualFile projectDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(testDir)); + // allow to load AST for all files to highlight + VfsUtilCore.visitChildrenRecursively(projectDir, new VirtualFileVisitor() { + @Override + public boolean visitFile(@NotNull VirtualFile v) { + myFilter.allowTreeAccessForFile(v); + return super.visitFile(v); + } + }); + // and JFrame + PsiClass cls = JavaPsiFacade.getInstance(getProject()).findClass("javax.swing.JFrame", GlobalSearchScope.allScope(getProject())); + PsiClass aClass = (PsiClass)cls.getNavigationElement(); + assertTrue(aClass instanceof PsiClassImpl); // must to have sources + + myFilter.allowTreeAccessForFile(aClass.getContainingFile().getVirtualFile()); + } + public void testSimple() throws Exception { doTest(); } + // test that the optimisation for not loading AST works + public void testWithLibrary() throws Exception { doTest(); } } From 88f7a84c070c4510d78bc1133c78f2241493cb13 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 28 Apr 2016 18:50:53 +0300 Subject: [PATCH 07/19] cleanup --- .../slicer/SliceNullnessAnalyzer.java | 60 ++++++++----------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/java/java-impl/src/com/intellij/slicer/SliceNullnessAnalyzer.java b/java/java-impl/src/com/intellij/slicer/SliceNullnessAnalyzer.java index 8aed8cd985b4..487fbe0987c3 100644 --- a/java/java-impl/src/com/intellij/slicer/SliceNullnessAnalyzer.java +++ b/java/java-impl/src/com/intellij/slicer/SliceNullnessAnalyzer.java @@ -29,8 +29,6 @@ import com.intellij.openapi.util.Computable; import com.intellij.openapi.util.Ref; import com.intellij.psi.*; import com.intellij.psi.util.PsiUtil; -import com.intellij.util.NullableFunction; -import com.intellij.util.PairProcessor; import com.intellij.util.WalkingState; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.FactoryMap; @@ -42,7 +40,7 @@ import java.util.*; /** * User: cdr */ -public class SliceNullnessAnalyzer { +class SliceNullnessAnalyzer { private static void groupByNullness(NullAnalysisResult result, SliceRootNode oldRoot, final Map map) { SliceRootNode root = createNewTree(result, oldRoot, map); @@ -51,13 +49,13 @@ public class SliceNullnessAnalyzer { } @NotNull - public static SliceRootNode createNewTree(NullAnalysisResult result, SliceRootNode oldRoot, final Map map) { + static SliceRootNode createNewTree(NullAnalysisResult result, SliceRootNode oldRoot, final Map map) { SliceRootNode root = oldRoot.copy(); assert oldRoot.myCachedChildren.size() == 1; SliceNode oldRootStart = oldRoot.myCachedChildren.get(0); root.setChanged(); root.targetEqualUsages.clear(); - root.myCachedChildren = new ArrayList(); + root.myCachedChildren = new ArrayList<>(); createValueRootNode(result, oldRoot, map, root, oldRootStart, "Null Values", NullAnalysisResult.NULLS); createValueRootNode(result, oldRoot, map, root, oldRootStart, "NotNull Values", NullAnalysisResult.NOT_NULLS); @@ -80,37 +78,31 @@ public class SliceNullnessAnalyzer { SliceLeafValueClassNode valueRoot = new SliceLeafValueClassNode(root.getProject(), root, nodeName); root.myCachedChildren.add(valueRoot); - Set uniqueValues = new THashSet(groupedByValue, SliceLeafAnalyzer.LEAF_ELEMENT_EQUALITY); + Set uniqueValues = new THashSet<>(groupedByValue, SliceLeafAnalyzer.LEAF_ELEMENT_EQUALITY); for (final PsiElement expression : uniqueValues) { - SliceNode newRoot = SliceLeafAnalyzer.filterTree(oldRootStart, new NullableFunction() { - @Override - public SliceNode fun(SliceNode oldNode) { - if (oldNode.getDuplicate() != null) { - return null; - } - - for (PsiElement nullSuspect : group(oldNode, map, group)) { - if (PsiEquivalenceUtil.areElementsEquivalent(nullSuspect, expression)) { - return oldNode.copy(); - } - } + SliceNode newRoot = SliceLeafAnalyzer.filterTree(oldRootStart, oldNode -> { + if (oldNode.getDuplicate() != null) { return null; } - },new PairProcessor>() { - @Override - public boolean process(SliceNode node, List children) { - if (!children.isEmpty()) return true; - PsiElement element = node.getValue().getElement(); - if (element == null) return false; - return PsiEquivalenceUtil.areElementsEquivalent(element, expression); // leaf can be there only if it's filtering expression + + for (PsiElement nullSuspect : group(oldNode, map, group)) { + if (PsiEquivalenceUtil.areElementsEquivalent(nullSuspect, expression)) { + return oldNode.copy(); + } } + return null; + }, (node, children) -> { + if (!children.isEmpty()) return true; + PsiElement element = node.getValue().getElement(); + if (element == null) return false; + return PsiEquivalenceUtil.areElementsEquivalent(element, expression); // leaf can be there only if it's filtering expression }); valueRoot.myCachedChildren.add(new SliceLeafValueRootNode(root.getProject(), expression, valueRoot, Collections.singletonList(newRoot), oldRoot.getValue().params)); } } - public static void startAnalyzeNullness(@NotNull AbstractTreeStructure treeStructure, @NotNull Runnable finish) { + static void startAnalyzeNullness(@NotNull AbstractTreeStructure treeStructure, @NotNull Runnable finish) { final SliceRootNode root = (SliceRootNode)treeStructure.getRootElement(); final Ref leafExpressions = Ref.create(null); final Map map = createMap(); @@ -151,7 +143,7 @@ public class SliceNullnessAnalyzer { @Override protected Map createMap() { - return ContainerUtil.newIdentityTroveMap(); + return ContainerUtil.newIdentityTroveMap(); } }; } @@ -164,9 +156,9 @@ public class SliceNullnessAnalyzer { } @NotNull - public static NullAnalysisResult calcNullableLeaves(@NotNull final SliceNode root, - @NotNull AbstractTreeStructure treeStructure, - @NotNull final Map map) { + static NullAnalysisResult calcNullableLeaves(@NotNull final SliceNode root, + @NotNull AbstractTreeStructure treeStructure, + @NotNull final Map map) { final SliceLeafAnalyzer.SliceNodeGuide guide = new SliceLeafAnalyzer.SliceNodeGuide(treeStructure); WalkingState walkingState = new WalkingState(guide) { @Override @@ -279,10 +271,10 @@ public class SliceNullnessAnalyzer { } static class NullAnalysisResult { - public static int NULLS = 0; - public static int NOT_NULLS = 1; - public static int UNKNOWNS = 2; - public final Collection[] groupedByValue = new Collection[] {new THashSet(),new THashSet(),new THashSet()}; + static final int NULLS = 0; + static final int NOT_NULLS = 1; + static final int UNKNOWNS = 2; + final Collection[] groupedByValue = new Collection[] {new THashSet(),new THashSet(),new THashSet()}; public void clear() { for (Collection elements : groupedByValue) { From 59e2d9dd9e337a92153b21583a4da8f4da5109e2 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 28 Apr 2016 18:56:38 +0300 Subject: [PATCH 08/19] minor performance: removed redundant initializers in java analysis --- .../RedundantSuppressInspectionBase.java | 6 ++--- .../StreamApiMigrationInspection.java | 4 ++-- .../bytecodeAnalysis/Analysis.java | 11 ++++++---- .../bytecodeAnalysis/Contracts.java | 11 +++++----- .../NullableMethodAnalysis.java | 12 +++++----- .../bytecodeAnalysis/Parameters.java | 22 +++++++++---------- .../asm/LeakingParameters.java | 6 ++--- .../canBeFinal/CanBeFinalInspection.java | 6 ++--- .../dataFlow/DataFlowInspectionBase.java | 10 ++++----- .../UnusedDeclarationInspectionBase.java | 2 +- .../defUse/DefUseInspectionBase.java | 2 +- .../deprecation/DeprecationInspection.java | 4 ++-- .../DuplicateThrowsInspection.java | 4 ++-- .../ex/EntryPointsManagerBase.java | 2 +- .../InheritorsStatisticalDataSearch.java | 4 ++-- .../Java15APIUsageInspectionBase.java | 4 ++-- .../javaDoc/JavaDocLocalInspectionBase.java | 12 +++++----- .../nullable/NullableStuffInspectionBase.java | 4 ++-- .../RedundantCastInspection.java | 6 ++--- .../UncheckedWarningLocalInspectionBase.java | 12 +++++----- .../visibility/VisibilityInspection.java | 2 +- .../JavaClassFindUsagesOptions.java | 14 ++++++------ .../findUsages/JavaFindUsagesOptions.java | 4 ++-- .../JavaMethodFindUsagesOptions.java | 10 ++++----- .../JavaPackageFindUsagesOptions.java | 6 ++--- .../extractMethod/InputVariables.java | 6 ++--- .../extractMethod/ParametersFolder.java | 4 ++-- .../util/duplicates/DuplicatesFinder.java | 4 ++-- .../refactoring/util/duplicates/Match.java | 6 ++--- .../java/generate/config/Config.java | 22 +++++++++---------- .../java/generate/config/FilterPattern.java | 8 +++---- .../ClassHasNoToStringMethodInspection.java | 8 +++---- .../printing/HyperlinksToClassesOption.java | 4 ++-- .../completion/AllClassesGetter.java | 4 ++-- .../completion/MemberLookupHelper.java | 17 +++++++++++++- .../completion/StaticMemberProcessor.java | 9 +++++--- .../scope/JavaCompletionProcessor.java | 14 ++++++------ .../impl/quickfix/AddMethodQualifierFix.java | 5 ++--- .../impl/quickfix/RenameWrongRefFix.java | 4 ++-- .../quickfix/SurroundWithTryCatchFix.java | 4 ++-- .../impl/quickfix/SwitchStatementBranch.java | 4 ++-- .../editorActions/AutoFormatTypedHandler.java | 2 +- .../moveUpDown/DeclarationMover.java | 4 ++-- .../generation/GenerateDelegateHandler.java | 4 ++-- .../generation/GenerateEqualsHandler.java | 8 +++---- .../GenerateMembersHandlerBase.java | 4 ++-- .../JavaExpressionSurroundDescriptor.java | 4 ++-- .../JavaWithTryCatchSurrounder.java | 4 ++-- .../HighlightImportedElementsHandler.java | 4 ++-- .../impl/AddOnDemandStaticImportAction.java | 4 ++-- .../impl/DeannotateIntentionAction.java | 4 ++-- .../impl/ReplaceCastWithVariableAction.java | 4 ++-- .../InferNullityAnnotationsAction.java | 4 ++-- .../unusedReturnValue/UnusedReturnValue.java | 4 ++-- .../CyclicDependenciesBuilder.java | 4 ++-- .../CyclicDependenciesUtil.java | 4 ++-- .../com/intellij/internal/DupIconsFinder.java | 6 ++--- .../javadoc/JavadocConfiguration.java | 10 ++++----- .../lang/java/JavaImportOptimizer.java | 4 ++-- .../ui/TreeModelBuilder.java | 22 +++++++++---------- .../psi/AbstractQualifiedReference.java | 4 ++-- .../psi/codeStyle/JavaCodeStyleSettings.java | 10 ++++----- .../filters/types/AssignableFromFilter.java | 6 ++--- .../psi/formatter/java/AbstractJavaBlock.java | 6 ++--- .../formatter/java/SyntheticCodeBlock.java | 4 ++-- .../psi/impl/cache/SmartIntToIntArrayMap.java | 4 ++-- .../psi/impl/source/PsiCodeFragmentImpl.java | 2 +- .../impl/SingleClassHierarchyBuilder.java | 4 ++-- .../refactoring/JavaRefactoringSettings.java | 12 +++++----- .../AnonymousToInnerHandler.java | 6 ++--- .../anonymousToInner/VariableInfo.java | 6 ++--- .../changeSignature/JavaChangeInfoImpl.java | 18 +++++++-------- .../extractMethod/ExtractMethodProcessor.java | 6 ++--- .../ExtractMethodObjectProcessor.java | 2 +- .../extractclass/BackpointerUsageVisitor.java | 4 ++-- .../extractclass/ExtractClassProcessor.java | 4 ++-- .../extractclass/ExtractedClassBuilder.java | 12 +++++----- .../IntroduceConstantHandler.java | 4 ++-- .../EnclosingMethodSelectionDialog.java | 5 ++--- .../InplaceIntroduceParameterUI.java | 11 ++++++---- .../IntroduceParameterDialog.java | 6 ++--- .../IntroduceParameterProcessor.java | 4 ++-- .../IntroduceParameterSettingsUI.java | 16 +++++++------- .../IntroduceVariableDialog.java | 5 ++--- ...troduceParameterObjectClassDescriptor.java | 2 +- .../ParameterObjectBuilder.java | 4 ++-- .../memberPullUp/JavaPullUpHelper.java | 4 ++-- .../memberPullUp/PullUpProcessor.java | 6 ++--- .../migration/MigrationMapSet.java | 4 ++-- ...eatingSingleSourceRootMoveDestination.java | 4 ++-- .../move/moveMembers/MoveMembersDialog.java | 10 +++++---- .../refactoring/psi/ArrayIterator.java | 4 ++-- .../TurnRefsToSuperDialog.java | 4 ++-- .../deductive/PsiTypeVariableFactory.java | 4 ++-- .../deductive/resolver/BindingFactory.java | 6 ++--- .../deductive/resolver/ResolverTree.java | 6 ++--- .../typeMigration/TypeMigrationLabeler.java | 2 +- .../util/classMembers/ElementNeedsThis.java | 4 ++-- .../InterfaceMemberDependencyGraph.java | 4 ++-- .../util/classRefs/ClassReferenceScanner.java | 4 ++-- .../duplicates/MethodDuplicatesHandler.java | 4 ++-- .../occurrences/BaseOccurrenceManager.java | 6 ++--- .../ReturnValueBeanBuilder.java | 10 ++++----- .../com/intellij/unscramble/ThreadState.java | 4 ++-- .../unscramble/UnscrambleListener.java | 4 ++-- .../ReadableExternalAnnotationsManager.java | 4 ++-- .../impl/search/AllClassesSearchExecutor.java | 4 ++-- .../ide/util/JavaAnonymousClassesHelper.java | 4 ++-- .../src/com/intellij/psi/util/ClassUtil.java | 4 ++-- 109 files changed, 354 insertions(+), 330 deletions(-) diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/RedundantSuppressInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/RedundantSuppressInspectionBase.java index 388e66022cce..7304094495c6 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/RedundantSuppressInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/RedundantSuppressInspectionBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -44,10 +44,10 @@ import java.util.*; * @author cdr */ public class RedundantSuppressInspectionBase extends GlobalInspectionTool { - private BidirectionalMap myQuickFixes = null; + private BidirectionalMap myQuickFixes; private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.RedundantSuppressInspection"); - public boolean IGNORE_ALL = false; + public boolean IGNORE_ALL; @Override @NotNull diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/StreamApiMigrationInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/StreamApiMigrationInspection.java index 02d49d6cab9a..e868a10530a4 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/StreamApiMigrationInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/StreamApiMigrationInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -51,7 +51,7 @@ import java.util.List; public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTool { private static final Logger LOG = Logger.getInstance("#" + StreamApiMigrationInspection.class.getName()); - public boolean REPLACE_TRIVIAL_FOREACH = false; + public boolean REPLACE_TRIVIAL_FOREACH; @Nullable @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Analysis.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Analysis.java index 90ae880310bd..f06b1bda7065 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Analysis.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Analysis.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -26,9 +26,12 @@ import org.jetbrains.org.objectweb.asm.tree.analysis.AnalyzerException; import org.jetbrains.org.objectweb.asm.tree.analysis.BasicValue; import org.jetbrains.org.objectweb.asm.tree.analysis.Frame; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; -import static com.intellij.codeInspection.bytecodeAnalysis.Direction.*; +import static com.intellij.codeInspection.bytecodeAnalysis.Direction.In; +import static com.intellij.codeInspection.bytecodeAnalysis.Direction.InOut; class AbstractValues { static final class ParamValue extends BasicValue { @@ -213,7 +216,7 @@ abstract class Analysis { final protected List[] computed; final Key aKey; - Res earlyResult = null; + Res earlyResult; protected Analysis(RichControlFlow richControlFlow, Direction direction, boolean stable) { this.richControlFlow = richControlFlow; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Contracts.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Contracts.java index 9d71d4218939..08a529c5a098 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Contracts.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Contracts.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -34,8 +34,9 @@ import java.util.List; import java.util.Set; import static com.intellij.codeInspection.bytecodeAnalysis.AbstractValues.*; +import static com.intellij.codeInspection.bytecodeAnalysis.Direction.InOut; +import static com.intellij.codeInspection.bytecodeAnalysis.Direction.Out; import static org.jetbrains.org.objectweb.asm.Opcodes.*; -import static com.intellij.codeInspection.bytecodeAnalysis.Direction.*; class InOutAnalysis extends Analysis { @@ -47,8 +48,8 @@ class InOutAnalysis extends Analysis { private final Value inValue; private final int generalizeShift; private Result internalResult; - private int id = 0; - private int pendingTop = 0; + private int id; + private int pendingTop; protected InOutAnalysis(RichControlFlow richControlFlow, Direction direction, boolean[] resultOrigins, boolean stable, State[] pending) { super(richControlFlow, direction, stable); @@ -273,7 +274,7 @@ class InOutInterpreter extends BasicInterpreter { final boolean[] resultOrigins; final boolean nullAnalysis; - boolean deReferenced = false; + boolean deReferenced; InOutInterpreter(Direction direction, InsnList insns, boolean[] resultOrigins) { this.direction = direction; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/NullableMethodAnalysis.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/NullableMethodAnalysis.java index 2e2924c044ed..b865a9a4af34 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/NullableMethodAnalysis.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/NullableMethodAnalysis.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -211,12 +211,12 @@ class NullableMethodInterpreter extends BasicInterpreter implements InterpreterE private final int[] originsMapping; final Key[] keys; - Constraint constraint = null; - int delta = 0; - int nullsDelta = 0; + Constraint constraint; + int delta; + int nullsDelta; int notNullInsn = -1; - int notNullCall = 0; - int notNullNull = 0; + int notNullCall; + int notNullNull; NullableMethodInterpreter(InsnList insns, boolean[] origins, int[] originsMapping) { this.insns = insns; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Parameters.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Parameters.java index 52106534d8a7..ad52d2f8a7bb 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Parameters.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/Parameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -34,9 +34,9 @@ import java.util.List; import java.util.Set; import static com.intellij.codeInspection.bytecodeAnalysis.AbstractValues.*; +import static com.intellij.codeInspection.bytecodeAnalysis.Direction.In; import static com.intellij.codeInspection.bytecodeAnalysis.PResults.*; import static org.jetbrains.org.objectweb.asm.Opcodes.*; -import static com.intellij.codeInspection.bytecodeAnalysis.Direction.*; abstract class PResults { // SoP = sum of products @@ -211,9 +211,9 @@ class NonNullInAnalysis extends Analysis { } } - private int id = 0; - private Frame nextFrame = null; - private PResult subResult = null; + private int id; + private Frame nextFrame; + private PResult subResult; @NotNull protected Equation analyze() throws AnalyzerException { @@ -383,7 +383,7 @@ class NonNullInAnalysis extends Analysis { } - private int pendingTop = 0; + private int pendingTop; private void pendingPush(PendingAction action) throws AnalyzerException { if (pendingTop >= STEPS_LIMIT) { @@ -437,11 +437,11 @@ class NullableInAnalysis extends Analysis { } } - private int id = 0; - private Frame nextFrame = null; + private int id; + private Frame nextFrame; private PResult myResult = Identity; private PResult subResult = Identity; - private boolean top = false; + private boolean top; @NotNull protected Equation analyze() throws AnalyzerException { @@ -573,7 +573,7 @@ class NullableInAnalysis extends Analysis { } - private int pendingTop = 0; + private int pendingTop; private void pendingPush(State state) throws AnalyzerException { if (pendingTop >= STEPS_LIMIT) { @@ -602,7 +602,7 @@ class NullableInAnalysis extends Analysis { } abstract class NullityInterpreter extends BasicInterpreter { - boolean top = false; + boolean top; final boolean nullableAnalysis; final int nullityMask; private PResult subResult = Identity; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/asm/LeakingParameters.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/asm/LeakingParameters.java index 42ee796d4bcf..6b7ba379f769 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/asm/LeakingParameters.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/asm/LeakingParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -299,8 +299,8 @@ class ParametersUsage extends Interpreter { class IParametersUsage extends Interpreter { static final IParamsValue val1 = new IParamsValue(0, 1); static final IParamsValue val2 = new IParamsValue(0, 2); - int leaking = 0; - int nullableLeaking = 0; + int leaking; + int nullableLeaking; int called = -1; final int rangeStart; final int rangeEnd; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/canBeFinal/CanBeFinalInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/canBeFinal/CanBeFinalInspection.java index 3582ce1a293c..9ca3844e0987 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/canBeFinal/CanBeFinalInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/canBeFinal/CanBeFinalInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -47,8 +47,8 @@ import java.awt.*; public class CanBeFinalInspection extends GlobalJavaBatchInspectionTool { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.canBeFinal.CanBeFinalInspection"); - public boolean REPORT_CLASSES = false; - public boolean REPORT_METHODS = false; + public boolean REPORT_CLASSES; + public boolean REPORT_METHODS; public boolean REPORT_FIELDS = true; public static final String DISPLAY_NAME = InspectionsBundle.message("inspection.can.be.final.display.name"); @NonNls public static final String SHORT_NAME = "CanBeFinal"; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DataFlowInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DataFlowInspectionBase.java index add2fbeced8d..231fbebfbc53 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DataFlowInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DataFlowInspectionBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -63,10 +63,10 @@ import java.util.*; public class DataFlowInspectionBase extends BaseJavaBatchLocalInspectionTool { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.dataFlow.DataFlowInspection"); @NonNls private static final String SHORT_NAME = "ConstantConditions"; - public boolean SUGGEST_NULLABLE_ANNOTATIONS = false; - public boolean DONT_REPORT_TRUE_ASSERT_STATEMENTS = false; - public boolean TREAT_UNKNOWN_MEMBERS_AS_NULLABLE = false; - public boolean IGNORE_ASSERT_STATEMENTS = false; + public boolean SUGGEST_NULLABLE_ANNOTATIONS; + public boolean DONT_REPORT_TRUE_ASSERT_STATEMENTS; + public boolean TREAT_UNKNOWN_MEMBERS_AS_NULLABLE; + public boolean IGNORE_ASSERT_STATEMENTS; public boolean REPORT_CONSTANT_REFERENCE_VALUES = true; @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspectionBase.java index c253cb159aa8..47fb7a64bca7 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspectionBase.java @@ -77,7 +77,7 @@ public class UnusedDeclarationInspectionBase extends GlobalInspectionTool { final List myExtensions = ContainerUtil.createLockFreeCopyOnWriteList(); final UnusedSymbolLocalInspectionBase myLocalInspectionBase = createUnusedSymbolLocalInspection(); - private Set myProcessedSuspicious = null; + private Set myProcessedSuspicious; private int myPhase; private GlobalInspectionContext myContext; private final boolean myEnabledInEditor; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/defUse/DefUseInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/defUse/DefUseInspectionBase.java index f3880bfef990..d7ef822d828f 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/defUse/DefUseInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/defUse/DefUseInspectionBase.java @@ -34,7 +34,7 @@ import java.util.*; import java.util.List; public class DefUseInspectionBase extends BaseJavaBatchLocalInspectionTool { - public boolean REPORT_PREFIX_EXPRESSIONS = false; + public boolean REPORT_PREFIX_EXPRESSIONS; public boolean REPORT_POSTFIX_EXPRESSIONS = true; public boolean REPORT_REDUNDANT_INITIALIZER = true; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/deprecation/DeprecationInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/deprecation/DeprecationInspection.java index b02c02657532..081053a6ed53 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/deprecation/DeprecationInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/deprecation/DeprecationInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -44,7 +44,7 @@ public class DeprecationInspection extends BaseJavaBatchLocalInspectionTool { public static final String DISPLAY_NAME = DeprecationUtil.DEPRECATION_DISPLAY_NAME; public static final String IGNORE_METHODS_OF_DEPRECATED_NAME = "IGNORE_METHODS_OF_DEPRECATED"; - public boolean IGNORE_INSIDE_DEPRECATED = false; + public boolean IGNORE_INSIDE_DEPRECATED; public boolean IGNORE_ABSTRACT_DEPRECATED_OVERRIDES = true; public boolean IGNORE_IMPORT_STATEMENTS = true; public boolean IGNORE_METHODS_OF_DEPRECATED = true; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/duplicateThrows/DuplicateThrowsInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/duplicateThrows/DuplicateThrowsInspection.java index c49057015244..5a8665a534c8 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/duplicateThrows/DuplicateThrowsInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/duplicateThrows/DuplicateThrowsInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -26,7 +26,7 @@ import javax.swing.*; public class DuplicateThrowsInspection extends BaseJavaBatchLocalInspectionTool implements CleanupLocalInspectionTool { @SuppressWarnings("PublicField") - public boolean ignoreSubclassing = false; + public boolean ignoreSubclassing; @Override @NotNull diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerBase.java index ab23d803aa57..1a5e464551eb 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerBase.java @@ -77,7 +77,7 @@ public abstract class EntryPointsManagerBase extends EntryPointsManager implemen @NonNls private static final String VERSION_ATTR = "version"; @NonNls private static final String ENTRY_POINT_ATTR = "entry_point"; private boolean myAddNonJavaEntries = true; - private boolean myResolved = false; + private boolean myResolved; protected final Project myProject; private long myLastModificationCount = -1; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/inheritance/search/InheritorsStatisticalDataSearch.java b/java/java-analysis-impl/src/com/intellij/codeInspection/inheritance/search/InheritorsStatisticalDataSearch.java index 4266b66cb6ed..c28ccc2d6096 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/inheritance/search/InheritorsStatisticalDataSearch.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/inheritance/search/InheritorsStatisticalDataSearch.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -118,7 +118,7 @@ public class InheritorsStatisticalDataSearch { myAllNotAnonymousInheritors = new HashSet(); } - private int myAnonymousInheritorsCount = 0; + private int myAnonymousInheritorsCount; private Set getAllNotAnonymousInheritors() { return myAllNotAnonymousInheritors; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/java15api/Java15APIUsageInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/java15api/Java15APIUsageInspectionBase.java index ab764a1f518e..a95ad064e8bf 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/java15api/Java15APIUsageInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/java15api/Java15APIUsageInspectionBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -98,7 +98,7 @@ public class Java15APIUsageInspectionBase extends BaseJavaBatchLocalInspectionTo ourDefaultMethods.add("java.util.Iterator#remove()"); } - protected LanguageLevel myEffectiveLanguageLevel = null; + protected LanguageLevel myEffectiveLanguageLevel; @Nullable private static Set getForbiddenApi(@NotNull LanguageLevel languageLevel) { diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/javaDoc/JavaDocLocalInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/javaDoc/JavaDocLocalInspectionBase.java index b263fc278ffe..04167ce144a4 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/javaDoc/JavaDocLocalInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/javaDoc/JavaDocLocalInspectionBase.java @@ -78,17 +78,17 @@ public class JavaDocLocalInspectionBase extends BaseJavaBatchLocalInspectionTool public Options INNER_CLASS_OPTIONS = new Options("none", ""); public Options METHOD_OPTIONS = new Options("none", "@return@param@throws or @exception"); public Options FIELD_OPTIONS = new Options("none", ""); - public boolean IGNORE_DEPRECATED = false; + public boolean IGNORE_DEPRECATED; public boolean IGNORE_JAVADOC_PERIOD = true; @SuppressWarnings("unused") @Deprecated - public boolean IGNORE_DUPLICATED_THROWS = false; - public boolean IGNORE_POINT_TO_ITSELF = false; + public boolean IGNORE_DUPLICATED_THROWS; + public boolean IGNORE_POINT_TO_ITSELF; public String myAdditionalJavadocTags = ""; private boolean myIgnoreDuplicatedThrows = true; - private boolean myIgnoreEmptyDescriptions = false; - private boolean myIgnoreSimpleAccessors = false; + private boolean myIgnoreEmptyDescriptions; + private boolean myIgnoreSimpleAccessors; public void setPackageOption(String modifier, String tags) { PACKAGE_OPTIONS.ACCESS_JAVADOC_REQUIRED_FOR = modifier; @@ -451,7 +451,7 @@ public class JavaDocLocalInspectionBase extends BaseJavaBatchLocalInspectionTool private class ProblemHolderImpl implements JavadocHighlightUtil.ProblemHolder { private final InspectionManager myManager; private final boolean myOnTheFly; - private List myProblems = null; + private List myProblems; private ProblemHolderImpl(InspectionManager manager, boolean onTheFly) { myManager = manager; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java index 229979ca347d..44a28e2c7062 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java @@ -52,9 +52,9 @@ public class NullableStuffInspectionBase extends BaseJavaBatchLocalInspectionToo @SuppressWarnings({"WeakerAccess"}) public boolean REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE = true; @Deprecated @SuppressWarnings({"WeakerAccess"}) public boolean REPORT_NOT_ANNOTATED_PARAMETER_OVERRIDES_NOTNULL = true; @SuppressWarnings({"WeakerAccess"}) public boolean REPORT_NOT_ANNOTATED_GETTER = true; - @SuppressWarnings({"WeakerAccess"}) public boolean IGNORE_EXTERNAL_SUPER_NOTNULL = false; + @SuppressWarnings({"WeakerAccess"}) public boolean IGNORE_EXTERNAL_SUPER_NOTNULL; @SuppressWarnings({"WeakerAccess"}) public boolean REQUIRE_NOTNULL_FIELDS_INITIALIZED = true; - @SuppressWarnings({"WeakerAccess"}) public boolean REPORT_NOTNULL_PARAMETERS_OVERRIDES_NOT_ANNOTATED = false; + @SuppressWarnings({"WeakerAccess"}) public boolean REPORT_NOTNULL_PARAMETERS_OVERRIDES_NOT_ANNOTATED; @Deprecated @SuppressWarnings({"WeakerAccess"}) public boolean REPORT_NOT_ANNOTATED_SETTER_PARAMETER = true; @Deprecated @SuppressWarnings({"WeakerAccess"}) public boolean REPORT_ANNOTATION_NOT_PROPAGATED_TO_OVERRIDERS = true; // remains for test @SuppressWarnings({"WeakerAccess"}) public boolean REPORT_NULLS_PASSED_TO_NON_ANNOTATED_METHOD = true; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/redundantCast/RedundantCastInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/redundantCast/RedundantCastInspection.java index 930485558c20..2e4e80599c1b 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/redundantCast/RedundantCastInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/redundantCast/RedundantCastInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -46,8 +46,8 @@ public class RedundantCastInspection extends GenericsInspectionToolBase { private static final String DISPLAY_NAME = InspectionsBundle.message("inspection.redundant.cast.display.name"); @NonNls private static final String SHORT_NAME = "RedundantCast"; - public boolean IGNORE_ANNOTATED_METHODS = false; - public boolean IGNORE_SUSPICIOUS_METHOD_CALLS = false; + public boolean IGNORE_ANNOTATED_METHODS; + public boolean IGNORE_SUSPICIOUS_METHOD_CALLS; public RedundantCastInspection() { diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/uncheckedWarnings/UncheckedWarningLocalInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/uncheckedWarnings/UncheckedWarningLocalInspectionBase.java index accdc0b2b17b..b938eef5f260 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/uncheckedWarnings/UncheckedWarningLocalInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/uncheckedWarnings/UncheckedWarningLocalInspectionBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -50,11 +50,11 @@ public class UncheckedWarningLocalInspectionBase extends BaseJavaBatchLocalInspe public static final String DISPLAY_NAME = InspectionsBundle.message("unchecked.warning"); @NonNls private static final String ID = "unchecked"; private static final Logger LOG = Logger.getInstance("#" + UncheckedWarningLocalInspectionBase.class); - public boolean IGNORE_UNCHECKED_ASSIGNMENT = false; - public boolean IGNORE_UNCHECKED_GENERICS_ARRAY_CREATION = false; - public boolean IGNORE_UNCHECKED_CALL = false; - public boolean IGNORE_UNCHECKED_CAST = false; - public boolean IGNORE_UNCHECKED_OVERRIDING = false; + public boolean IGNORE_UNCHECKED_ASSIGNMENT; + public boolean IGNORE_UNCHECKED_GENERICS_ARRAY_CREATION; + public boolean IGNORE_UNCHECKED_CALL; + public boolean IGNORE_UNCHECKED_CAST; + public boolean IGNORE_UNCHECKED_OVERRIDING; protected static JCheckBox createSetting(final String cbText, final boolean option, diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/visibility/VisibilityInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/visibility/VisibilityInspection.java index e4d3b33a5cfc..6fb30d7070d5 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/visibility/VisibilityInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/visibility/VisibilityInspection.java @@ -59,7 +59,7 @@ public class VisibilityInspection extends GlobalJavaBatchInspectionTool { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.visibility.VisibilityInspection"); public boolean SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS = true; public boolean SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES = true; - public boolean SUGGEST_PRIVATE_FOR_INNERS = false; + public boolean SUGGEST_PRIVATE_FOR_INNERS; private static final String DISPLAY_NAME = InspectionsBundle.message("inspection.visibility.display.name"); @NonNls public static final String SHORT_NAME = "WeakerAccess"; private static final String CAN_BE_PRIVATE = InspectionsBundle.message("inspection.visibility.compose.suggestion", VisibilityUtil.toPresentableText(PsiModifier.PRIVATE)); diff --git a/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaClassFindUsagesOptions.java b/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaClassFindUsagesOptions.java index 4339d36ffb38..a36824cebe36 100644 --- a/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaClassFindUsagesOptions.java +++ b/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaClassFindUsagesOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -26,13 +26,13 @@ import java.util.LinkedHashSet; * @author peter */ public class JavaClassFindUsagesOptions extends JavaFindUsagesOptions { - public boolean isMethodsUsages = false; - public boolean isFieldsUsages = false; - public boolean isDerivedClasses = false; - public boolean isImplementingClasses = false; - public boolean isDerivedInterfaces = false; + public boolean isMethodsUsages; + public boolean isFieldsUsages; + public boolean isDerivedClasses; + public boolean isImplementingClasses; + public boolean isDerivedInterfaces; public boolean isCheckDeepInheritance = true; - public boolean isIncludeInherited = false; + public boolean isIncludeInherited; public JavaClassFindUsagesOptions(@NotNull Project project) { super(project); diff --git a/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaFindUsagesOptions.java b/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaFindUsagesOptions.java index 60b650ce293a..a990879fafff 100644 --- a/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaFindUsagesOptions.java +++ b/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaFindUsagesOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -27,7 +27,7 @@ import java.util.LinkedHashSet; * @author peter */ public abstract class JavaFindUsagesOptions extends FindUsagesOptions { - public boolean isSkipImportStatements = false; + public boolean isSkipImportStatements; public JavaFindUsagesOptions(@NotNull Project project) { super(project); diff --git a/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaMethodFindUsagesOptions.java b/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaMethodFindUsagesOptions.java index ab39b82d109f..87970138d70a 100644 --- a/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaMethodFindUsagesOptions.java +++ b/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaMethodFindUsagesOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -26,11 +26,11 @@ import java.util.LinkedHashSet; * @author peter */ public class JavaMethodFindUsagesOptions extends JavaFindUsagesOptions { - public boolean isOverridingMethods = false; - public boolean isImplementingMethods = false; + public boolean isOverridingMethods; + public boolean isImplementingMethods; public boolean isCheckDeepInheritance = true; - public boolean isIncludeInherited = false; - public boolean isIncludeOverloadUsages = false; + public boolean isIncludeInherited; + public boolean isIncludeOverloadUsages; public JavaMethodFindUsagesOptions(@NotNull Project project) { super(project); diff --git a/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaPackageFindUsagesOptions.java b/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaPackageFindUsagesOptions.java index 93cc0db69e9e..081284123e7d 100644 --- a/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaPackageFindUsagesOptions.java +++ b/java/java-analysis-impl/src/com/intellij/find/findUsages/JavaPackageFindUsagesOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -26,9 +26,9 @@ import java.util.LinkedHashSet; * @author peter */ public class JavaPackageFindUsagesOptions extends JavaFindUsagesOptions { - public boolean isClassesUsages = false; + public boolean isClassesUsages; public boolean isIncludeSubpackages = true; - public boolean isSkipPackageStatements = false; + public boolean isSkipPackageStatements; public JavaPackageFindUsagesOptions(@NotNull Project project) { super(project); diff --git a/java/java-analysis-impl/src/com/intellij/refactoring/extractMethod/InputVariables.java b/java/java-analysis-impl/src/com/intellij/refactoring/extractMethod/InputVariables.java index ad9897ae8c31..ccab96611fcf 100644 --- a/java/java-analysis-impl/src/com/intellij/refactoring/extractMethod/InputVariables.java +++ b/java/java-analysis-impl/src/com/intellij/refactoring/extractMethod/InputVariables.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -48,8 +48,8 @@ public class InputVariables { private ParametersFolder myFolding; private boolean myFoldingAvailable; - private Set myUsedInstanceFields = null; - private boolean myPassFields = false; + private Set myUsedInstanceFields; + private boolean myPassFields; public InputVariables(final List inputVariables, Project project, diff --git a/java/java-analysis-impl/src/com/intellij/refactoring/extractMethod/ParametersFolder.java b/java/java-analysis-impl/src/com/intellij/refactoring/extractMethod/ParametersFolder.java index b7e0e48f8c4b..3cf591b9d34a 100644 --- a/java/java-analysis-impl/src/com/intellij/refactoring/extractMethod/ParametersFolder.java +++ b/java/java-analysis-impl/src/com/intellij/refactoring/extractMethod/ParametersFolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -44,7 +44,7 @@ public class ParametersFolder { private final Set myUsedNames = new HashSet(); private final Set myDeleted = new HashSet(); - private boolean myFoldingSelectedByDefault = false; + private boolean myFoldingSelectedByDefault; public void clear() { diff --git a/java/java-analysis-impl/src/com/intellij/refactoring/util/duplicates/DuplicatesFinder.java b/java/java-analysis-impl/src/com/intellij/refactoring/util/duplicates/DuplicatesFinder.java index c34982debacf..99d7bdeb25fa 100644 --- a/java/java-analysis-impl/src/com/intellij/refactoring/util/duplicates/DuplicatesFinder.java +++ b/java/java-analysis-impl/src/com/intellij/refactoring/util/duplicates/DuplicatesFinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -46,7 +46,7 @@ public class DuplicatesFinder { private final InputVariables myParameters; private final List myOutputParameters; private final List myPatternAsList; - private boolean myMultipleExitPoints = false; + private boolean myMultipleExitPoints; @Nullable private final ReturnValue myReturnValue; public DuplicatesFinder(PsiElement[] pattern, diff --git a/java/java-analysis-impl/src/com/intellij/refactoring/util/duplicates/Match.java b/java/java-analysis-impl/src/com/intellij/refactoring/util/duplicates/Match.java index 10a3238ae7b6..5d3cb6f9f802 100644 --- a/java/java-analysis-impl/src/com/intellij/refactoring/util/duplicates/Match.java +++ b/java/java-analysis-impl/src/com/intellij/refactoring/util/duplicates/Match.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -51,8 +51,8 @@ public final class Match { private final Map> myParameterValues = new HashMap>(); private final Map> myParameterOccurrences = new HashMap>(); private final Map myDeclarationCorrespondence = new HashMap(); - private ReturnValue myReturnValue = null; - private Ref myInstanceExpression = null; + private ReturnValue myReturnValue; + private Ref myInstanceExpression; final Map myChangedParams = new HashMap(); private final boolean myIgnoreParameterTypes; diff --git a/java/java-analysis-impl/src/org/jetbrains/java/generate/config/Config.java b/java/java-analysis-impl/src/org/jetbrains/java/generate/config/Config.java index 95b93d9f9028..a10e0d59fdba 100644 --- a/java/java-analysis-impl/src/org/jetbrains/java/generate/config/Config.java +++ b/java/java-analysis-impl/src/org/jetbrains/java/generate/config/Config.java @@ -21,24 +21,24 @@ package org.jetbrains.java.generate.config; */ public class Config { - public boolean useFullyQualifiedName = false; + public boolean useFullyQualifiedName; public InsertWhere insertNewMethodOption = InsertWhere.AT_CARET; public DuplicationPolicy whenDuplicatesOption = DuplicationPolicy.ASK; public boolean filterConstantField = true; - public boolean filterEnumField = false; - public boolean filterTransientModifier = false; + public boolean filterEnumField; + public boolean filterTransientModifier; public boolean filterStaticModifier = true; - public String filterFieldName = null; - public String filterMethodName = null; - public String filterMethodType = null; - public String filterFieldType = null; + public String filterFieldName; + public String filterMethodName; + public String filterMethodType; + public String filterFieldType; public boolean filterLoggers = true; - public boolean addImplementSerializable = false; - public boolean enableMethods = false; + public boolean addImplementSerializable; + public boolean enableMethods; public boolean jumpToMethod = true; // jump cursor to toString method - public int sortElements = 0; // 0 = none, 1 = asc, 2 = desc + public int sortElements; // 0 = none, 1 = asc, 2 = desc - private FilterPattern myPattern = null; + private FilterPattern myPattern; public boolean isUseFullyQualifiedName() { return useFullyQualifiedName; diff --git a/java/java-analysis-impl/src/org/jetbrains/java/generate/config/FilterPattern.java b/java/java-analysis-impl/src/org/jetbrains/java/generate/config/FilterPattern.java index e56ac4f3d0ee..c91c6abba820 100644 --- a/java/java-analysis-impl/src/org/jetbrains/java/generate/config/FilterPattern.java +++ b/java/java-analysis-impl/src/org/jetbrains/java/generate/config/FilterPattern.java @@ -51,10 +51,10 @@ public class FilterPattern { private boolean transientModifier; private boolean enumField; private boolean loggers; - private Pattern methodNamePattern = null; - private Pattern methodTypePattern = null; - private Pattern fieldNamePattern = null; - private Pattern fieldTypePattern = null; + private Pattern methodNamePattern; + private Pattern methodTypePattern; + private Pattern fieldNamePattern; + private Pattern fieldTypePattern; public boolean fieldMatches(PsiField field) { if (isConstantField() && PsiAdapter.isConstantField(field)) { diff --git a/java/java-analysis-impl/src/org/jetbrains/java/generate/inspection/ClassHasNoToStringMethodInspection.java b/java/java-analysis-impl/src/org/jetbrains/java/generate/inspection/ClassHasNoToStringMethodInspection.java index a5359d5a1392..3100c9fca2bb 100644 --- a/java/java-analysis-impl/src/org/jetbrains/java/generate/inspection/ClassHasNoToStringMethodInspection.java +++ b/java/java-analysis-impl/src/org/jetbrains/java/generate/inspection/ClassHasNoToStringMethodInspection.java @@ -53,13 +53,13 @@ public class ClassHasNoToStringMethodInspection extends AbstractToStringInspecti /** User options for excluded deprecated classes */ public boolean excludeDeprecated = true; // must be public for JDOMSerialization /** User options for excluded enum classes */ - public boolean excludeEnum = false; // must be public for JDOMSerialization + public boolean excludeEnum; // must be public for JDOMSerialization /** User options for excluded abstract classes */ - public boolean excludeAbstract = false; // must be public for JDOMSerialization + public boolean excludeAbstract; // must be public for JDOMSerialization - public boolean excludeTestCode = false; + public boolean excludeTestCode; - public boolean excludeInnerClasses = false; + public boolean excludeInnerClasses; public ClassHasNoToStringMethodInspection() { try { diff --git a/java/java-impl/src/com/intellij/codeEditor/printing/HyperlinksToClassesOption.java b/java/java-impl/src/com/intellij/codeEditor/printing/HyperlinksToClassesOption.java index 3326e97fe2f6..7a22d4754c94 100644 --- a/java/java-impl/src/com/intellij/codeEditor/printing/HyperlinksToClassesOption.java +++ b/java/java-impl/src/com/intellij/codeEditor/printing/HyperlinksToClassesOption.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -34,7 +34,7 @@ import java.util.TreeMap; public class HyperlinksToClassesOption extends PrintOption { private JCheckBox myCbGenerateHyperlinksToClasses; - private boolean isGenerateHyperlinksToClasses = false; + private boolean isGenerateHyperlinksToClasses; @Nullable public TreeMap collectReferences(PsiFile psiFile, Map filesMap) { diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/AllClassesGetter.java b/java/java-impl/src/com/intellij/codeInsight/completion/AllClassesGetter.java index 2a87f9fc8e29..99247cfd287f 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/AllClassesGetter.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/AllClassesGetter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -154,7 +154,7 @@ public class AllClassesGetter { int limit = Registry.intValue("ide.completion.variant.limit"); Processor processor = new Processor() { - int count = 0; + int count; final Set qNames = new THashSet(); final boolean pkgContext = JavaCompletionUtil.inSomePackage(context); final String packagePrefix = getPackagePrefix(context, parameters.getOffset()); diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/MemberLookupHelper.java b/java/java-impl/src/com/intellij/codeInsight/completion/MemberLookupHelper.java index f665920528d2..6589f4a815e3 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/MemberLookupHelper.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/MemberLookupHelper.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.codeInsight.completion; import com.intellij.codeInsight.lookup.LookupElementPresentation; @@ -16,7 +31,7 @@ public class MemberLookupHelper { private final PsiMember myMember; private final boolean myMergedOverloads; @Nullable private final PsiClass myContainingClass; - private boolean myShouldImport = false; + private boolean myShouldImport; public MemberLookupHelper(List overloads, PsiClass containingClass, boolean shouldImport) { this(overloads.get(0), containingClass, shouldImport, true); diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/StaticMemberProcessor.java b/java/java-impl/src/com/intellij/codeInsight/completion/StaticMemberProcessor.java index e79fe27ac5c2..5a152a7c6eaf 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/StaticMemberProcessor.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/StaticMemberProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -30,7 +30,10 @@ import gnu.trove.THashSet; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Set; /** * @author peter @@ -40,7 +43,7 @@ public abstract class StaticMemberProcessor { private final PsiElement myPosition; private final Project myProject; private final PsiResolveHelper myResolveHelper; - private boolean myHintShown = false; + private boolean myHintShown; private final boolean myPackagedContext; public StaticMemberProcessor(final PsiElement position) { diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/scope/JavaCompletionProcessor.java b/java/java-impl/src/com/intellij/codeInsight/completion/scope/JavaCompletionProcessor.java index 152f82650739..6a681fd182d2 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/scope/JavaCompletionProcessor.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/scope/JavaCompletionProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -50,8 +50,8 @@ import java.util.Set; public class JavaCompletionProcessor extends BaseScopeProcessor implements ElementClassHint { private final boolean myInJavaDoc; - private boolean myStatic = false; - private PsiElement myDeclarationHolder = null; + private boolean myStatic; + private PsiElement myDeclarationHolder; private final Map myResults = new LinkedHashMap<>(); private final Set mySecondRateResults = ContainerUtil.newIdentityTroveSet(); private final Set myShadowedNames = ContainerUtil.newHashSet(); @@ -60,10 +60,10 @@ public class JavaCompletionProcessor extends BaseScopeProcessor implements Eleme private final PsiElement myElement; private final PsiElement myScope; private final ElementFilter myFilter; - private boolean myMembersFlag = false; - private boolean myQualified = false; - private PsiType myQualifierType = null; - private PsiClass myQualifierClass = null; + private boolean myMembersFlag; + private boolean myQualified; + private PsiType myQualifierType; + private PsiClass myQualifierClass; private final Condition myMatcher; private final Options myOptions; private final boolean myAllowStaticWithInstanceQualifier; diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddMethodQualifierFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddMethodQualifierFix.java index 1c6fd53e460f..ce0ee8fefe91 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddMethodQualifierFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddMethodQualifierFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -27,7 +27,6 @@ import com.intellij.openapi.ui.popup.util.BaseListPopupStep; import com.intellij.psi.*; import com.intellij.ui.popup.list.ListPopupImpl; import com.intellij.util.IncorrectOperationException; -import com.intellij.util.ObjectUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.TestOnly; @@ -42,7 +41,7 @@ public class AddMethodQualifierFix implements IntentionAction { private static final boolean UNIT_TEST_MODE = ApplicationManager.getApplication().isUnitTestMode(); private final SmartPsiElementPointer myMethodCall; - private List myCandidates = null; + private List myCandidates; public AddMethodQualifierFix(final PsiMethodCallExpression methodCallExpression) { myMethodCall = SmartPointerManager.getInstance(methodCallExpression.getProject()).createSmartPsiElementPointer(methodCallExpression); diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RenameWrongRefFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RenameWrongRefFix.java index 82cca2862eac..c6ecd4b31013 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RenameWrongRefFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RenameWrongRefFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -102,7 +102,7 @@ public class RenameWrongRefFix implements IntentionAction { class MyScopeProcessor extends BaseScopeProcessor { ArrayList myResult = new ArrayList(); boolean myFilterMethods; - boolean myFilterStatics = false; + boolean myFilterStatics; MyScopeProcessor(PsiReferenceExpression refExpression) { myFilterMethods = refExpression.getParent() instanceof PsiMethodCallExpression; diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/SurroundWithTryCatchFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/SurroundWithTryCatchFix.java index b0264dc22c52..5a48b1abb2c9 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/SurroundWithTryCatchFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/SurroundWithTryCatchFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -39,7 +39,7 @@ import org.jetbrains.annotations.NotNull; public class SurroundWithTryCatchFix implements IntentionAction { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.quickfix.SurroundWithTryCatchFix"); - private PsiElement myStatement = null; + private PsiElement myStatement; public SurroundWithTryCatchFix(@NotNull PsiElement element) { final PsiFunctionalExpression functionalExpression = PsiTreeUtil.getParentOfType(element, PsiFunctionalExpression.class, false, PsiStatement.class); diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/SwitchStatementBranch.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/SwitchStatementBranch.java index f361a95e1cf7..cc7602917cc8 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/SwitchStatementBranch.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/SwitchStatementBranch.java @@ -30,8 +30,8 @@ class SwitchStatementBranch { new ArrayList(5); private final List m_pendingWhiteSpace = new ArrayList(2); - private boolean m_default = false; - private boolean m_hasStatements = false; + private boolean m_default; + private boolean m_hasStatements; public void addCaseValue(String labelString) { m_caseValues.add(labelString); diff --git a/java/java-impl/src/com/intellij/codeInsight/editorActions/AutoFormatTypedHandler.java b/java/java-impl/src/com/intellij/codeInsight/editorActions/AutoFormatTypedHandler.java index 0e2a3de30933..2a7c9f38283d 100644 --- a/java/java-impl/src/com/intellij/codeInsight/editorActions/AutoFormatTypedHandler.java +++ b/java/java-impl/src/com/intellij/codeInsight/editorActions/AutoFormatTypedHandler.java @@ -45,7 +45,7 @@ import org.jetbrains.annotations.TestOnly; import java.util.List; public class AutoFormatTypedHandler extends TypedActionHandlerBase { - private static boolean myIsEnabledInTests = false; + private static boolean myIsEnabledInTests; private static char[] NO_SPACE_AFTER = { '+', '-', '*', '/', '%', '&', '^', '|', '<', '>', '!', '=', ' ' diff --git a/java/java-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/DeclarationMover.java b/java/java-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/DeclarationMover.java index 3b56a946e281..4d2d0e5c56b4 100644 --- a/java/java-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/DeclarationMover.java +++ b/java/java-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/DeclarationMover.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -38,7 +38,7 @@ import java.util.List; class DeclarationMover extends LineMover { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.editor.actions.moveUpDown.DeclarationMover"); private PsiEnumConstant myEnumToInsertSemicolonAfter; - private boolean moveEnumConstant = false; + private boolean moveEnumConstant; @Override public void beforeMove(@NotNull final Editor editor, @NotNull final MoveInfo info, final boolean down) { diff --git a/java/java-impl/src/com/intellij/codeInsight/generation/GenerateDelegateHandler.java b/java/java-impl/src/com/intellij/codeInsight/generation/GenerateDelegateHandler.java index 6028ec3d564c..30071b845e9d 100644 --- a/java/java-impl/src/com/intellij/codeInsight/generation/GenerateDelegateHandler.java +++ b/java/java-impl/src/com/intellij/codeInsight/generation/GenerateDelegateHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -46,7 +46,7 @@ import java.util.*; */ public class GenerateDelegateHandler implements LanguageCodeInsightActionHandler { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.generation.GenerateDelegateHandler"); - private boolean myToCopyJavaDoc = false; + private boolean myToCopyJavaDoc; @Override public boolean isValidFor(Editor editor, PsiFile file) { diff --git a/java/java-impl/src/com/intellij/codeInsight/generation/GenerateEqualsHandler.java b/java/java-impl/src/com/intellij/codeInsight/generation/GenerateEqualsHandler.java index b8f5a477097d..55e6aac1da51 100644 --- a/java/java-impl/src/com/intellij/codeInsight/generation/GenerateEqualsHandler.java +++ b/java/java-impl/src/com/intellij/codeInsight/generation/GenerateEqualsHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -37,9 +37,9 @@ import java.util.List; */ public class GenerateEqualsHandler extends GenerateMembersHandlerBase { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.generation.GenerateEqualsHandler"); - private PsiField[] myEqualsFields = null; - private PsiField[] myHashCodeFields = null; - private PsiField[] myNonNullFields = null; + private PsiField[] myEqualsFields; + private PsiField[] myHashCodeFields; + private PsiField[] myNonNullFields; private static final PsiElementClassMember[] DUMMY_RESULT = new PsiElementClassMember[1]; //cannot return empty array, but this result won't be used anyway public GenerateEqualsHandler() { diff --git a/java/java-impl/src/com/intellij/codeInsight/generation/GenerateMembersHandlerBase.java b/java/java-impl/src/com/intellij/codeInsight/generation/GenerateMembersHandlerBase.java index 8e674adca489..1f9e4a55ad83 100644 --- a/java/java-impl/src/com/intellij/codeInsight/generation/GenerateMembersHandlerBase.java +++ b/java/java-impl/src/com/intellij/codeInsight/generation/GenerateMembersHandlerBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -53,7 +53,7 @@ public abstract class GenerateMembersHandlerBase implements CodeInsightActionHan private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.generation.GenerateMembersHandlerBase"); private final String myChooserTitle; - protected boolean myToCopyJavaDoc = false; + protected boolean myToCopyJavaDoc; public GenerateMembersHandlerBase(String chooserTitle) { myChooserTitle = chooserTitle; diff --git a/java/java-impl/src/com/intellij/codeInsight/generation/surroundWith/JavaExpressionSurroundDescriptor.java b/java/java-impl/src/com/intellij/codeInsight/generation/surroundWith/JavaExpressionSurroundDescriptor.java index 43924d9199c3..691e9a36831e 100644 --- a/java/java-impl/src/com/intellij/codeInsight/generation/surroundWith/JavaExpressionSurroundDescriptor.java +++ b/java/java-impl/src/com/intellij/codeInsight/generation/surroundWith/JavaExpressionSurroundDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -33,7 +33,7 @@ import java.util.Collections; * @author ven */ public class JavaExpressionSurroundDescriptor implements SurroundDescriptor { - private Surrounder[] mySurrounders = null; + private Surrounder[] mySurrounders; private static final Surrounder[] SURROUNDERS = { new JavaWithParenthesesSurrounder(), diff --git a/java/java-impl/src/com/intellij/codeInsight/generation/surroundWith/JavaWithTryCatchSurrounder.java b/java/java-impl/src/com/intellij/codeInsight/generation/surroundWith/JavaWithTryCatchSurrounder.java index 996d61483451..482ffd851162 100644 --- a/java/java-impl/src/com/intellij/codeInsight/generation/surroundWith/JavaWithTryCatchSurrounder.java +++ b/java/java-impl/src/com/intellij/codeInsight/generation/surroundWith/JavaWithTryCatchSurrounder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -32,7 +32,7 @@ import java.util.Collections; import java.util.List; public class JavaWithTryCatchSurrounder extends JavaStatementsSurrounder { - protected boolean myGenerateFinally = false; + protected boolean myGenerateFinally; @Override public String getTemplateDescription() { diff --git a/java/java-impl/src/com/intellij/codeInsight/highlighting/HighlightImportedElementsHandler.java b/java/java-impl/src/com/intellij/codeInsight/highlighting/HighlightImportedElementsHandler.java index 71e301aa91f6..9ae19918b5c2 100644 --- a/java/java-impl/src/com/intellij/codeInsight/highlighting/HighlightImportedElementsHandler.java +++ b/java/java-impl/src/com/intellij/codeInsight/highlighting/HighlightImportedElementsHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -40,7 +40,7 @@ public class HighlightImportedElementsHandler extends HighlightUsagesHandlerBase private final PsiElement myTarget; private final PsiImportStatementBase myImportStatement; private final boolean myImportStatic; - private Map> myClassReferenceListMap = null; + private Map> myClassReferenceListMap; public HighlightImportedElementsHandler(Editor editor, PsiFile file, PsiElement target, PsiImportStatementBase importStatement) { super(editor, file); diff --git a/java/java-impl/src/com/intellij/codeInsight/intention/impl/AddOnDemandStaticImportAction.java b/java/java-impl/src/com/intellij/codeInsight/intention/impl/AddOnDemandStaticImportAction.java index cc6687acbcb4..aa36b456f33d 100644 --- a/java/java-impl/src/com/intellij/codeInsight/intention/impl/AddOnDemandStaticImportAction.java +++ b/java/java-impl/src/com/intellij/codeInsight/intention/impl/AddOnDemandStaticImportAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -146,7 +146,7 @@ public class AddOnDemandStaticImportAction extends BaseElementAtCaretIntentionAc final TIntArrayList expressionToDequalifyOffsets = new TIntArrayList(); copy.accept(new JavaRecursiveElementWalkingVisitor() { - int delta = 0; + int delta; @Override public void visitReferenceElement(PsiJavaCodeReferenceElement expression) { if (isParameterizedReference(expression)) return; diff --git a/java/java-impl/src/com/intellij/codeInsight/intention/impl/DeannotateIntentionAction.java b/java/java-impl/src/com/intellij/codeInsight/intention/impl/DeannotateIntentionAction.java index 52deff695f95..60b33eb24b64 100644 --- a/java/java-impl/src/com/intellij/codeInsight/intention/impl/DeannotateIntentionAction.java +++ b/java/java-impl/src/com/intellij/codeInsight/intention/impl/DeannotateIntentionAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -44,7 +44,7 @@ import java.util.List; public class DeannotateIntentionAction implements IntentionAction, LowPriorityAction { private static final Logger LOG = Logger.getInstance("#" + DeannotateIntentionAction.class.getName()); - private String myAnnotationName = null; + private String myAnnotationName; @Override @NotNull diff --git a/java/java-impl/src/com/intellij/codeInsight/intention/impl/ReplaceCastWithVariableAction.java b/java/java-impl/src/com/intellij/codeInsight/intention/impl/ReplaceCastWithVariableAction.java index 14a85ef7e348..a612a87b3312 100644 --- a/java/java-impl/src/com/intellij/codeInsight/intention/impl/ReplaceCastWithVariableAction.java +++ b/java/java-impl/src/com/intellij/codeInsight/intention/impl/ReplaceCastWithVariableAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -116,7 +116,7 @@ public class ReplaceCastWithVariableAction extends PsiElementBaseIntentionAction scope.accept( new JavaRecursiveElementWalkingVisitor() { - private boolean inScope = false; + private boolean inScope; @Override public void visitElement(PsiElement element) { diff --git a/java/java-impl/src/com/intellij/codeInspection/inferNullity/InferNullityAnnotationsAction.java b/java/java-impl/src/com/intellij/codeInspection/inferNullity/InferNullityAnnotationsAction.java index 1d29c7308ebc..25d1294818e9 100644 --- a/java/java-impl/src/com/intellij/codeInspection/inferNullity/InferNullityAnnotationsAction.java +++ b/java/java-impl/src/com/intellij/codeInspection/inferNullity/InferNullityAnnotationsAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -197,7 +197,7 @@ public class InferNullityAnnotationsAction extends BaseAnalysisAction { @Override public void run() { scope.accept(new PsiElementVisitor() { - int myFileCount = 0; + int myFileCount; @Override public void visitFile(final PsiFile file) { diff --git a/java/java-impl/src/com/intellij/codeInspection/unusedReturnValue/UnusedReturnValue.java b/java/java-impl/src/com/intellij/codeInspection/unusedReturnValue/UnusedReturnValue.java index 2949a79562db..7a8f9d413467 100644 --- a/java/java-impl/src/com/intellij/codeInspection/unusedReturnValue/UnusedReturnValue.java +++ b/java/java-impl/src/com/intellij/codeInspection/unusedReturnValue/UnusedReturnValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -44,7 +44,7 @@ import java.util.List; public class UnusedReturnValue extends GlobalJavaBatchInspectionTool{ private MakeVoidQuickFix myQuickFix; - public boolean IGNORE_BUILDER_PATTERN = false; + public boolean IGNORE_BUILDER_PATTERN; @Override @Nullable diff --git a/java/java-impl/src/com/intellij/cyclicDependencies/CyclicDependenciesBuilder.java b/java/java-impl/src/com/intellij/cyclicDependencies/CyclicDependenciesBuilder.java index a38a1485c606..3539683dbacd 100644 --- a/java/java-impl/src/com/intellij/cyclicDependencies/CyclicDependenciesBuilder.java +++ b/java/java-impl/src/com/intellij/cyclicDependencies/CyclicDependenciesBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -46,7 +46,7 @@ public class CyclicDependenciesBuilder{ private final Map>> myBackwardFilesInDependentPackages = new HashMap>>(); private final Map> myPackageDependencies = new HashMap>(); private HashMap>> myCyclicDependencies = new HashMap>>(); - private int myFileCount = 0; + private int myFileCount; private final ForwardDependenciesBuilder myForwardBuilder; private String myRootNodeNameInUsageView; diff --git a/java/java-impl/src/com/intellij/cyclicDependencies/CyclicDependenciesUtil.java b/java/java-impl/src/com/intellij/cyclicDependencies/CyclicDependenciesUtil.java index f15268681cf3..79625827f7c4 100644 --- a/java/java-impl/src/com/intellij/cyclicDependencies/CyclicDependenciesUtil.java +++ b/java/java-impl/src/com/intellij/cyclicDependencies/CyclicDependenciesUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -33,7 +33,7 @@ public class CyclicDependenciesUtil{ final TIntArrayList sccs = dfstBuilder.getSCCs(); final List> chunks = new ArrayList>(); sccs.forEach(new TIntProcedure() { - int myTNumber = 0; + int myTNumber; public boolean execute(int size) { Set packs = new LinkedHashSet(); for (int j = 0; j < size; j++) { diff --git a/java/java-impl/src/com/intellij/internal/DupIconsFinder.java b/java/java-impl/src/com/intellij/internal/DupIconsFinder.java index 63ebcdc759de..43224cfb8e4a 100644 --- a/java/java-impl/src/com/intellij/internal/DupIconsFinder.java +++ b/java/java-impl/src/com/intellij/internal/DupIconsFinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -31,8 +31,8 @@ import java.util.Map; public class DupIconsFinder { private static final MultiMap hashes = new MultiMap(); - private static int totalClusters = 0; - private static int totalDups = 0; + private static int totalClusters; + private static int totalDups; public static void main(String[] args) throws Exception { File root = new File("/Users/max/images/icons"); diff --git a/java/java-impl/src/com/intellij/javadoc/JavadocConfiguration.java b/java/java-impl/src/com/intellij/javadoc/JavadocConfiguration.java index 0a9415f38cc4..a7248ef1694e 100644 --- a/java/java-impl/src/com/intellij/javadoc/JavadocConfiguration.java +++ b/java/java-impl/src/com/intellij/javadoc/JavadocConfiguration.java @@ -32,15 +32,15 @@ public class JavadocConfiguration { public boolean OPTION_NAVIGATOR = true; public boolean OPTION_INDEX = true; public boolean OPTION_SEPARATE_INDEX = true; - public boolean OPTION_DOCUMENT_TAG_USE = false; - public boolean OPTION_DOCUMENT_TAG_AUTHOR = false; - public boolean OPTION_DOCUMENT_TAG_VERSION = false; + public boolean OPTION_DOCUMENT_TAG_USE; + public boolean OPTION_DOCUMENT_TAG_AUTHOR; + public boolean OPTION_DOCUMENT_TAG_VERSION; public boolean OPTION_DOCUMENT_TAG_DEPRECATED = true; public boolean OPTION_DEPRECATED_LIST = true; public String OTHER_OPTIONS = ""; public String HEAP_SIZE; public String LOCALE; public boolean OPEN_IN_BROWSER = true; - public boolean OPTION_INCLUDE_LIBS = false; - public boolean OPTION_LINK_TO_JDK_DOCS = false; + public boolean OPTION_INCLUDE_LIBS; + public boolean OPTION_LINK_TO_JDK_DOCS; } \ No newline at end of file diff --git a/java/java-impl/src/com/intellij/lang/java/JavaImportOptimizer.java b/java/java-impl/src/com/intellij/lang/java/JavaImportOptimizer.java index eddd536d19fb..7601d5dee787 100644 --- a/java/java-impl/src/com/intellij/lang/java/JavaImportOptimizer.java +++ b/java/java-impl/src/com/intellij/lang/java/JavaImportOptimizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -47,7 +47,7 @@ public class JavaImportOptimizer implements ImportOptimizer { if (newImportList == null) return EmptyRunnable.getInstance(); return new CollectingInfoRunnable() { - private int myImportListLengthDiff = 0; + private int myImportListLengthDiff; @Override public void run() { diff --git a/java/java-impl/src/com/intellij/packageDependencies/ui/TreeModelBuilder.java b/java/java-impl/src/com/intellij/packageDependencies/ui/TreeModelBuilder.java index 994f2dda4796..6a7f23070da2 100644 --- a/java/java-impl/src/com/intellij/packageDependencies/ui/TreeModelBuilder.java +++ b/java/java-impl/src/com/intellij/packageDependencies/ui/TreeModelBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -71,14 +71,14 @@ public class TreeModelBuilder { private final Map> myModuleNodes = new HashMap>(); private final Map> myModuleGroupNodes = new HashMap>(); private final Map> myLibraryNodes = new HashMap>(); - private int myScannedFileCount = 0; - private int myTotalFileCount = 0; - private int myMarkedFileCount = 0; - private GeneralGroupNode myAllLibsNode = null; + private int myScannedFileCount; + private int myTotalFileCount; + private int myMarkedFileCount; + private GeneralGroupNode myAllLibsNode; - private GeneralGroupNode mySourceRoot = null; - private GeneralGroupNode myTestRoot = null; - private GeneralGroupNode myLibsRoot = null; + private GeneralGroupNode mySourceRoot; + private GeneralGroupNode myTestRoot; + private GeneralGroupNode myLibsRoot; public static final String PRODUCTION_NAME = AnalysisScopeBundle.message("package.dependencies.production.node.text"); public static final String TEST_NAME = AnalysisScopeBundle.message("package.dependencies.test.node.text"); @@ -166,8 +166,8 @@ public class TreeModelBuilder { public void run() { countFiles(project); myFileIndex.iterateContent(new ContentIterator() { - PackageDependenciesNode lastParent = null; - VirtualFile dir = null; + PackageDependenciesNode lastParent; + VirtualFile dir; public boolean processFile(VirtualFile fileOrDir) { if (!fileOrDir.isDirectory()) { if (lastParent != null && !Comparing.equal(dir, fileOrDir.getParent())) { @@ -195,7 +195,7 @@ public class TreeModelBuilder { private void processFilesRecursively(@NotNull VirtualFile file) { VfsUtilCore.visitChildrenRecursively(file, new VirtualFileVisitor() { - private PackageDependenciesNode parent = null; + private PackageDependenciesNode parent; @Override public boolean visitFile(@NotNull VirtualFile file) { diff --git a/java/java-impl/src/com/intellij/psi/AbstractQualifiedReference.java b/java/java-impl/src/com/intellij/psi/AbstractQualifiedReference.java index d0d7cce6e280..60e72e4c47ed 100644 --- a/java/java-impl/src/com/intellij/psi/AbstractQualifiedReference.java +++ b/java/java-impl/src/com/intellij/psi/AbstractQualifiedReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -245,7 +245,7 @@ public abstract class AbstractQualifiedReference myResults = new LinkedHashSet(); @Override diff --git a/java/java-impl/src/com/intellij/psi/codeStyle/JavaCodeStyleSettings.java b/java/java-impl/src/com/intellij/psi/codeStyle/JavaCodeStyleSettings.java index 9a7268339b7e..d31f94e11175 100644 --- a/java/java-impl/src/com/intellij/psi/codeStyle/JavaCodeStyleSettings.java +++ b/java/java-impl/src/com/intellij/psi/codeStyle/JavaCodeStyleSettings.java @@ -21,19 +21,19 @@ public class JavaCodeStyleSettings extends CustomCodeStyleSettings { super("JavaCodeStyleSettings", container); } - public boolean SPACES_WITHIN_ANGLE_BRACKETS = false; + public boolean SPACES_WITHIN_ANGLE_BRACKETS; //Type arguments - public boolean SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENT = false; + public boolean SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENT; //Type parameters - public boolean SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETER = false; + public boolean SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETER; public boolean SPACE_AROUND_TYPE_BOUNDS_IN_TYPE_PARAMETERS = true; - public boolean DO_NOT_WRAP_AFTER_SINGLE_ANNOTATION = false; + public boolean DO_NOT_WRAP_AFTER_SINGLE_ANNOTATION; public int ANNOTATION_PARAMETER_WRAP = CommonCodeStyleSettings.DO_NOT_WRAP; - public boolean ALIGN_MULTILINE_ANNOTATION_PARAMETERS = false; + public boolean ALIGN_MULTILINE_ANNOTATION_PARAMETERS; public int BLANK_LINES_AROUND_INITIALIZER = 1; diff --git a/java/java-impl/src/com/intellij/psi/filters/types/AssignableFromFilter.java b/java/java-impl/src/com/intellij/psi/filters/types/AssignableFromFilter.java index 23309bd687c0..8cd68e40f2e2 100644 --- a/java/java-impl/src/com/intellij/psi/filters/types/AssignableFromFilter.java +++ b/java/java-impl/src/com/intellij/psi/filters/types/AssignableFromFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -31,8 +31,8 @@ import org.jetbrains.annotations.Nullable; * To change this template use Options | File Templates. */ public class AssignableFromFilter implements ElementFilter{ - private PsiType myType = null; - private String myClassName = null; + private PsiType myType; + private String myClassName; public AssignableFromFilter(PsiType type){ myType = type; diff --git a/java/java-impl/src/com/intellij/psi/formatter/java/AbstractJavaBlock.java b/java/java-impl/src/com/intellij/psi/formatter/java/AbstractJavaBlock.java index eb662ce4ddd9..a4ecc6bf3c25 100644 --- a/java/java-impl/src/com/intellij/psi/formatter/java/AbstractJavaBlock.java +++ b/java/java-impl/src/com/intellij/psi/formatter/java/AbstractJavaBlock.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -58,9 +58,9 @@ public abstract class AbstractJavaBlock extends AbstractBlock implements JavaBlo private final Indent myIndent; protected Indent myChildIndent; protected Alignment myChildAlignment; - protected boolean myUseChildAttributes = false; + protected boolean myUseChildAttributes; @NotNull protected final AlignmentStrategy myAlignmentStrategy; - private boolean myIsAfterClassKeyword = false; + private boolean myIsAfterClassKeyword; protected Alignment myReservedAlignment; protected Alignment myReservedAlignment2; diff --git a/java/java-impl/src/com/intellij/psi/formatter/java/SyntheticCodeBlock.java b/java/java-impl/src/com/intellij/psi/formatter/java/SyntheticCodeBlock.java index 7cc75fd34bf5..30f1960119e3 100644 --- a/java/java-impl/src/com/intellij/psi/formatter/java/SyntheticCodeBlock.java +++ b/java/java-impl/src/com/intellij/psi/formatter/java/SyntheticCodeBlock.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -42,7 +42,7 @@ public class SyntheticCodeBlock implements Block, JavaBlock{ private final TextRange myTextRange; private ChildAttributes myChildAttributes; - private boolean myIsIncomplete = false; + private boolean myIsIncomplete; public SyntheticCodeBlock(List subBlocks, Alignment alignment, diff --git a/java/java-impl/src/com/intellij/psi/impl/cache/SmartIntToIntArrayMap.java b/java/java-impl/src/com/intellij/psi/impl/cache/SmartIntToIntArrayMap.java index 387962a8b03b..04fceda6884e 100644 --- a/java/java-impl/src/com/intellij/psi/impl/cache/SmartIntToIntArrayMap.java +++ b/java/java-impl/src/com/intellij/psi/impl/cache/SmartIntToIntArrayMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable; * @author max */ public class SmartIntToIntArrayMap { - @Nullable TIntObjectHashMap myMultipleValuesMap = null; + @Nullable TIntObjectHashMap myMultipleValuesMap; TIntIntHashMap mySingleValueMap = new TIntIntHashMap(10, 0.9f); public int[] keys() { diff --git a/java/java-impl/src/com/intellij/psi/impl/source/PsiCodeFragmentImpl.java b/java/java-impl/src/com/intellij/psi/impl/source/PsiCodeFragmentImpl.java index ed5847ee0b59..fa0c7e2fbb95 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/PsiCodeFragmentImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/PsiCodeFragmentImpl.java @@ -93,7 +93,7 @@ public class PsiCodeFragmentImpl extends PsiFileImpl implements JavaCodeFragment return clone; } - private FileViewProvider myViewProvider = null; + private FileViewProvider myViewProvider; @Override @NotNull diff --git a/java/java-impl/src/com/intellij/psi/stubsHierarchy/impl/SingleClassHierarchyBuilder.java b/java/java-impl/src/com/intellij/psi/stubsHierarchy/impl/SingleClassHierarchyBuilder.java index f4e44af567c5..7127414b5962 100644 --- a/java/java-impl/src/com/intellij/psi/stubsHierarchy/impl/SingleClassHierarchyBuilder.java +++ b/java/java-impl/src/com/intellij/psi/stubsHierarchy/impl/SingleClassHierarchyBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -55,7 +55,7 @@ public class SingleClassHierarchyBuilder { private final HierarchyService myHierarchyService; protected final BitSet myProcessedSet = new BitSet(); private final ProjectFileIndex myProjectIndex; - boolean isInSourceMode = false; + boolean isInSourceMode; private UnitProcessor(Project project, HierarchyService hierarchyService) { myProject = project; diff --git a/java/java-impl/src/com/intellij/refactoring/JavaRefactoringSettings.java b/java/java-impl/src/com/intellij/refactoring/JavaRefactoringSettings.java index 2e27afaeec6c..ca10fa56307c 100644 --- a/java/java-impl/src/com/intellij/refactoring/JavaRefactoringSettings.java +++ b/java/java-impl/src/com/intellij/refactoring/JavaRefactoringSettings.java @@ -60,9 +60,9 @@ public class JavaRefactoringSettings implements PersistentStateComponent myUsages = new LinkedHashSet(); private PsiClass myInnerClass; private boolean myChangeReturnType; diff --git a/java/java-impl/src/com/intellij/refactoring/extractclass/BackpointerUsageVisitor.java b/java/java-impl/src/com/intellij/refactoring/extractclass/BackpointerUsageVisitor.java index 06178817fd40..fc4f709344c2 100644 --- a/java/java-impl/src/com/intellij/refactoring/extractclass/BackpointerUsageVisitor.java +++ b/java/java-impl/src/com/intellij/refactoring/extractclass/BackpointerUsageVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -25,7 +25,7 @@ import com.intellij.psi.*; import java.util.List; class BackpointerUsageVisitor extends JavaRecursiveElementWalkingVisitor { - private PsiMember myCause = null; + private PsiMember myCause; private final List myFields; private final List myInnerClasses; diff --git a/java/java-impl/src/com/intellij/refactoring/extractclass/ExtractClassProcessor.java b/java/java-impl/src/com/intellij/refactoring/extractclass/ExtractClassProcessor.java index 3332ce2ed234..944100216317 100644 --- a/java/java-impl/src/com/intellij/refactoring/extractclass/ExtractClassProcessor.java +++ b/java/java-impl/src/com/intellij/refactoring/extractclass/ExtractClassProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -81,7 +81,7 @@ public class ExtractClassProcessor extends FixableUsagesRefactoringProcessor { private final String newClassName; private final String delegateFieldName; private final boolean requiresBackpointer; - private boolean delegationRequired = false; + private boolean delegationRequired; private final ExtractEnumProcessor myExtractEnumProcessor; private final PsiClass myClass; private boolean extractInnerClass; diff --git a/java/java-impl/src/com/intellij/refactoring/extractclass/ExtractedClassBuilder.java b/java/java-impl/src/com/intellij/refactoring/extractclass/ExtractedClassBuilder.java index 03e7138eee23..4e42bd3cab93 100644 --- a/java/java-impl/src/com/intellij/refactoring/extractclass/ExtractedClassBuilder.java +++ b/java/java-impl/src/com/intellij/refactoring/extractclass/ExtractedClassBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -38,8 +38,8 @@ import java.util.Set; class ExtractedClassBuilder { private static final Logger LOGGER = Logger.getInstance("com.siyeh.rpp.extractclass.ExtractedClassBuilder"); - private String className = null; - private String packageName = null; + private String className; + private String packageName; private final List fields = new ArrayList(5); private final List methods = new ArrayList(5); private final List initializers = new ArrayList(5); @@ -48,9 +48,9 @@ class ExtractedClassBuilder { private final List typeParams = new ArrayList(); private final List interfaces = new ArrayList(); - private boolean requiresBackPointer = false; - private String originalClassName = null; - private String backPointerName = null; + private boolean requiresBackPointer; + private String originalClassName; + private String backPointerName; private Project myProject; private JavaCodeStyleManager myJavaCodeStyleManager; private Set myFieldsNeedingSetters; diff --git a/java/java-impl/src/com/intellij/refactoring/introduceField/IntroduceConstantHandler.java b/java/java-impl/src/com/intellij/refactoring/introduceField/IntroduceConstantHandler.java index d084cb0ce339..aa2f8bd60c04 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceField/IntroduceConstantHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceField/IntroduceConstantHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -228,7 +228,7 @@ public class IntroduceConstantHandler extends BaseExpressionToFieldHandler { } private static class IsStaticFinalInitializerExpression extends ClassMemberReferencesVisitor { - private PsiElement myElementReference = null; + private PsiElement myElementReference; private final PsiExpression myInitializer; public IsStaticFinalInitializerExpression(PsiClass aClass, PsiExpression initializer) { diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/EnclosingMethodSelectionDialog.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/EnclosingMethodSelectionDialog.java index 346b1571f690..3c92436fd9eb 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/EnclosingMethodSelectionDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/EnclosingMethodSelectionDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -29,7 +29,6 @@ import com.intellij.openapi.ui.DialogWrapper; import com.intellij.psi.PsiMethod; import com.intellij.refactoring.RefactoringBundle; import com.intellij.refactoring.ui.MethodCellRenderer; -import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.ScrollPaneFactory; import com.intellij.ui.components.JBList; import org.jetbrains.annotations.NotNull; @@ -41,7 +40,7 @@ import java.util.List; public class EnclosingMethodSelectionDialog extends DialogWrapper { private final List myEnclosingMethods; - private JList myEnclosingMethodsList = null; + private JList myEnclosingMethodsList; private final JCheckBox myCbReplaceInstanceOf = new JCheckBox(RefactoringBundle.message("use.interface.superclass.in.instanceof")); private static final String REFACTORING_NAME = RefactoringBundle.message("introduce.parameter.title"); diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterUI.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterUI.java index 1dd601d63801..ec5e04232ee2 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterUI.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -15,10 +15,12 @@ */ package com.intellij.refactoring.introduceParameter; -import com.intellij.ui.ListCellRendererWrapper; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.LabeledComponent; -import com.intellij.psi.*; +import com.intellij.psi.PsiExpression; +import com.intellij.psi.PsiLocalVariable; +import com.intellij.psi.PsiMethod; +import com.intellij.psi.PsiParameter; import com.intellij.psi.codeStyle.CodeStyleSettingsManager; import com.intellij.psi.util.PsiUtil; import com.intellij.refactoring.IntroduceParameterRefactoring; @@ -27,6 +29,7 @@ import com.intellij.refactoring.RefactoringBundle; import com.intellij.refactoring.introduce.inplace.KeyboardComboSwitcher; import com.intellij.refactoring.ui.TypeSelectorManager; import com.intellij.ui.IdeBorderFactory; +import com.intellij.ui.ListCellRendererWrapper; import com.intellij.util.ui.UIUtil; import gnu.trove.TIntArrayList; @@ -40,7 +43,7 @@ import java.awt.event.ItemListener; */ public abstract class InplaceIntroduceParameterUI extends IntroduceParameterSettingsUI { private JComboBox myReplaceFieldsCb; - private boolean myHasWriteAccess = false; + private boolean myHasWriteAccess; private final Project myProject; private final TypeSelectorManager myTypeSelectorManager; private final PsiExpression[] myOccurrences; diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterDialog.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterDialog.java index 51af3a7b7cf3..9850709ba39a 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -60,7 +60,7 @@ public class IntroduceParameterDialog extends RefactoringDialog { private final boolean myMustBeFinal; private final PsiExpression myExpression; private final PsiLocalVariable myLocalVar; - protected JCheckBox myCbDeclareFinal = null; + protected JCheckBox myCbDeclareFinal; protected JCheckBox myCbCollapseToLambda; // private JComponent myParameterNameField = null; @@ -73,7 +73,7 @@ public class IntroduceParameterDialog extends RefactoringDialog { private NameSuggestionsField.DataChanged myParameterNameChangedListener; private final IntroduceParameterSettingsPanel myPanel; - private boolean myHasWriteAccess = false; + private boolean myHasWriteAccess; IntroduceParameterDialog(@NotNull Project project, @NotNull List classMembersList, diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterProcessor.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterProcessor.java index 8951fa5d86e2..6b2d3fa95559 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterProcessor.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterProcessor.java @@ -304,7 +304,7 @@ public class IntroduceParameterProcessor extends BaseRefactoringProcessor implem } public static class AnySupers extends JavaRecursiveElementWalkingVisitor { - private boolean myResult = false; + private boolean myResult; @Override public void visitSuperExpression(PsiSuperExpression expression) { myResult = true; } @@ -319,7 +319,7 @@ public class IntroduceParameterProcessor extends BaseRefactoringProcessor implem } public class AnySameNameVariables extends JavaRecursiveElementWalkingVisitor { - private Pair conflict = null; + private Pair conflict; public Pair getConflict() { return conflict; diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterSettingsUI.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterSettingsUI.java index af4c559bbc80..3daccf8cfd94 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterSettingsUI.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterSettingsUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * 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. @@ -43,18 +43,18 @@ public abstract class IntroduceParameterSettingsUI { protected final boolean myIsInvokedOnDeclaration; protected final boolean myHasInitializer; - protected StateRestoringCheckBox myCbDeleteLocalVariable = null; - protected StateRestoringCheckBox myCbUseInitializer = null; - protected JRadioButton myReplaceFieldsWithGettersNoneRadio = null; - protected JRadioButton myReplaceFieldsWithGettersInaccessibleRadio = null; - protected JRadioButton myReplaceFieldsWithGettersAllRadio = null; + protected StateRestoringCheckBox myCbDeleteLocalVariable; + protected StateRestoringCheckBox myCbUseInitializer; + protected JRadioButton myReplaceFieldsWithGettersNoneRadio; + protected JRadioButton myReplaceFieldsWithGettersInaccessibleRadio; + protected JRadioButton myReplaceFieldsWithGettersAllRadio; protected final ButtonGroup myReplaceFieldsWithGettersButtonGroup = new ButtonGroup(); protected final PsiParameter[] myParametersToRemove; protected final boolean[] myParametersToRemoveChecked; protected final boolean myIsLocalVariable; - protected JCheckBox myCbReplaceAllOccurences = null; - protected JCheckBox myCbGenerateDelegate = null; + protected JCheckBox myCbReplaceAllOccurences; + protected JCheckBox myCbGenerateDelegate; public IntroduceParameterSettingsUI(PsiLocalVariable onLocalVariable, PsiExpression onExpression, diff --git a/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableDialog.java b/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableDialog.java index 9523408a3a49..2175489557dd 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * 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. @@ -18,7 +18,6 @@ package com.intellij.refactoring.introduceVariable; import com.intellij.openapi.help.HelpManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; -import com.intellij.psi.JavaPsiFacade; import com.intellij.psi.PsiExpression; import com.intellij.psi.PsiNameHelper; import com.intellij.psi.PsiType; @@ -48,7 +47,7 @@ class IntroduceVariableDialog extends DialogWrapper implements IntroduceVariable private NameSuggestionsField myNameField; private JCheckBox myCbReplaceAll; - private StateRestoringCheckBox myCbReplaceWrite = null; + private StateRestoringCheckBox myCbReplaceWrite; private JCheckBox myCbFinal; private boolean myCbFinalState; private TypeSelector myTypeSelector; diff --git a/java/java-impl/src/com/intellij/refactoring/introduceparameterobject/JavaIntroduceParameterObjectClassDescriptor.java b/java/java-impl/src/com/intellij/refactoring/introduceparameterobject/JavaIntroduceParameterObjectClassDescriptor.java index 62c6cf0acb41..069aa33ab90d 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceparameterobject/JavaIntroduceParameterObjectClassDescriptor.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceparameterobject/JavaIntroduceParameterObjectClassDescriptor.java @@ -324,7 +324,7 @@ public class JavaIntroduceParameterObjectClassDescriptor extends IntroduceParame private final PsiParameter param; - private PsiField fieldAssigned = null; + private PsiField fieldAssigned; ParamAssignmentFinder(PsiParameter param) { this.param = param; diff --git a/java/java-impl/src/com/intellij/refactoring/introduceparameterobject/ParameterObjectBuilder.java b/java/java-impl/src/com/intellij/refactoring/introduceparameterobject/ParameterObjectBuilder.java index ac91a848aae8..13510f2de268 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceparameterobject/ParameterObjectBuilder.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceparameterobject/ParameterObjectBuilder.java @@ -30,8 +30,8 @@ import java.util.Iterator; import java.util.List; class ParameterObjectBuilder { - private String className = null; - private String packageName = null; + private String className; + private String packageName; private final List fields = new ArrayList(5); private final List typeParams = new ArrayList(); private Project myProject; diff --git a/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHelper.java b/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHelper.java index d2524b4a03a3..b660567f2c55 100644 --- a/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHelper.java +++ b/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -60,7 +60,7 @@ public class JavaPullUpHelper implements PullUpHelper { private final PsiClass myTargetSuperClass; private final boolean myIsTargetInterface; private final DocCommentPolicy myJavaDocPolicy; - private Set myMembersAfterMove = null; + private Set myMembersAfterMove; private final Set myMembersToMove; private final Project myProject; diff --git a/java/java-impl/src/com/intellij/refactoring/memberPullUp/PullUpProcessor.java b/java/java-impl/src/com/intellij/refactoring/memberPullUp/PullUpProcessor.java index 770dd19073aa..cc4faae65b6f 100644 --- a/java/java-impl/src/com/intellij/refactoring/memberPullUp/PullUpProcessor.java +++ b/java/java-impl/src/com/intellij/refactoring/memberPullUp/PullUpProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -66,8 +66,8 @@ public class PullUpProcessor extends BaseRefactoringProcessor implements PullUpD private final PsiClass myTargetSuperClass; private final MemberInfo[] myMembersToMove; private final DocCommentPolicy myJavaDocPolicy; - private Set myMembersAfterMove = null; - private Set myMovedMembers = null; + private Set myMembersAfterMove; + private Set myMovedMembers; private final Map> myProcessors = ContainerUtil.newHashMap(); public PullUpProcessor(PsiClass sourceClass, PsiClass targetSuperClass, MemberInfo[] membersToMove, DocCommentPolicy javaDocPolicy) { diff --git a/java/java-impl/src/com/intellij/refactoring/migration/MigrationMapSet.java b/java/java-impl/src/com/intellij/refactoring/migration/MigrationMapSet.java index 4c1a640a0e92..1bcc190b45de 100644 --- a/java/java-impl/src/com/intellij/refactoring/migration/MigrationMapSet.java +++ b/java/java-impl/src/com/intellij/refactoring/migration/MigrationMapSet.java @@ -1,6 +1,6 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -40,7 +40,7 @@ import java.util.Iterator; public class MigrationMapSet { private static final Logger LOG = Logger.getInstance("#com.intellij.refactoring.migration.MigrationMapSet"); - private ArrayList myMaps = null; + private ArrayList myMaps; @NonNls private static final String MIGRATION_MAP = "migrationMap"; @NonNls private static final String ENTRY = "entry"; @NonNls private static final String NAME = "name"; diff --git a/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/AutocreatingSingleSourceRootMoveDestination.java b/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/AutocreatingSingleSourceRootMoveDestination.java index ce19d6bacaa5..2ad63ce6195f 100644 --- a/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/AutocreatingSingleSourceRootMoveDestination.java +++ b/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/AutocreatingSingleSourceRootMoveDestination.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -97,7 +97,7 @@ public class AutocreatingSingleSourceRootMoveDestination extends AutocreatingMov return true; } - PsiDirectory myTargetDirectory = null; + PsiDirectory myTargetDirectory; private PsiDirectory getDirectory() throws IncorrectOperationException { if (myTargetDirectory == null) { myTargetDirectory = RefactoringUtil.createPackageDirectoryInSourceRoot(myPackage, mySourceRoot); diff --git a/java/java-impl/src/com/intellij/refactoring/move/moveMembers/MoveMembersDialog.java b/java/java-impl/src/com/intellij/refactoring/move/moveMembers/MoveMembersDialog.java index f5eb13ce7376..261a907a6606 100644 --- a/java/java-impl/src/com/intellij/refactoring/move/moveMembers/MoveMembersDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/move/moveMembers/MoveMembersDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -15,7 +15,10 @@ */ package com.intellij.refactoring.move.moveMembers; -import com.intellij.ide.util.*; +import com.intellij.ide.util.ClassFilter; +import com.intellij.ide.util.PackageUtil; +import com.intellij.ide.util.TreeClassChooser; +import com.intellij.ide.util.TreeClassChooserFactory; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.editor.event.DocumentAdapter; @@ -39,7 +42,6 @@ import com.intellij.refactoring.move.MoveDialogBase; import com.intellij.refactoring.ui.JavaVisibilityPanel; import com.intellij.refactoring.ui.MemberSelectionPanel; import com.intellij.refactoring.ui.MemberSelectionTable; -import com.intellij.refactoring.ui.RefactoringDialog; import com.intellij.refactoring.util.CommonRefactoringUtil; import com.intellij.refactoring.util.classMembers.MemberInfo; import com.intellij.refactoring.util.classMembers.UsesAndInterfacesDependencyMemberInfoModel; @@ -407,7 +409,7 @@ public class MoveMembersDialog extends MoveDialogBase implements MoveMembersOpti } private class MyMemberInfoModel extends UsesAndInterfacesDependencyMemberInfoModel { - PsiClass myTargetClass = null; + PsiClass myTargetClass; public MyMemberInfoModel() { super(mySourceClass, null, false, DEFAULT_CONTAINMENT_VERIFIER); } diff --git a/java/java-impl/src/com/intellij/refactoring/psi/ArrayIterator.java b/java/java-impl/src/com/intellij/refactoring/psi/ArrayIterator.java index 1fd8875f475f..3d492299baf6 100644 --- a/java/java-impl/src/com/intellij/refactoring/psi/ArrayIterator.java +++ b/java/java-impl/src/com/intellij/refactoring/psi/ArrayIterator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -20,7 +20,7 @@ import java.util.NoSuchElementException; class ArrayIterator implements Iterator{ private final T[] contents; - private int currentIndex = 0; + private int currentIndex; private final Object lock = new Object(); ArrayIterator(T[] contents){ diff --git a/java/java-impl/src/com/intellij/refactoring/turnRefsToSuper/TurnRefsToSuperDialog.java b/java/java-impl/src/com/intellij/refactoring/turnRefsToSuper/TurnRefsToSuperDialog.java index e1946746fae1..b3afdb12ab7f 100644 --- a/java/java-impl/src/com/intellij/refactoring/turnRefsToSuper/TurnRefsToSuperDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/turnRefsToSuper/TurnRefsToSuperDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * 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. @@ -42,7 +42,7 @@ public class TurnRefsToSuperDialog extends RefactoringDialog { @NotNull private final PsiClass mySubClass; private final List mySuperClasses; - private JList mySuperClassesList = null; + private JList mySuperClassesList; private final JCheckBox myCbReplaceInstanceOf = new JCheckBox(); TurnRefsToSuperDialog(Project project, @NotNull PsiClass subClass, List superClasses) { diff --git a/java/java-impl/src/com/intellij/refactoring/typeCook/deductive/PsiTypeVariableFactory.java b/java/java-impl/src/com/intellij/refactoring/typeCook/deductive/PsiTypeVariableFactory.java index 95535071b50e..a09e0ec1fa19 100644 --- a/java/java-impl/src/com/intellij/refactoring/typeCook/deductive/PsiTypeVariableFactory.java +++ b/java/java-impl/src/com/intellij/refactoring/typeCook/deductive/PsiTypeVariableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -27,7 +27,7 @@ import java.util.*; * @author db */ public class PsiTypeVariableFactory { - private int myCurrent = 0; + private int myCurrent; private final List> myClusters = new LinkedList>(); private final Map> myVarCluster = new HashMap>(); diff --git a/java/java-impl/src/com/intellij/refactoring/typeCook/deductive/resolver/BindingFactory.java b/java/java-impl/src/com/intellij/refactoring/typeCook/deductive/resolver/BindingFactory.java index 14b9a1715050..3e0083e58467 100644 --- a/java/java-impl/src/com/intellij/refactoring/typeCook/deductive/resolver/BindingFactory.java +++ b/java/java-impl/src/com/intellij/refactoring/typeCook/deductive/resolver/BindingFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -481,7 +481,7 @@ public class BindingFactory { if (type != null) { class Verifier extends PsiExtendedTypeVisitor { - boolean myFlag = false; + boolean myFlag; @Override public Void visitTypeVariable(final PsiTypeVariable var) { if (var.getIndex() == index) { @@ -565,7 +565,7 @@ public class BindingFactory { public int getWidth() { class MyProcecure implements TObjectProcedure { - int width = 0; + int width; public boolean execute(PsiType type) { if (substitute(type) != null) width++; return true; diff --git a/java/java-impl/src/com/intellij/refactoring/typeCook/deductive/resolver/ResolverTree.java b/java/java-impl/src/com/intellij/refactoring/typeCook/deductive/resolver/ResolverTree.java index a58e0561c449..00ec0fd5cc4b 100644 --- a/java/java-impl/src/com/intellij/refactoring/typeCook/deductive/resolver/ResolverTree.java +++ b/java/java-impl/src/com/intellij/refactoring/typeCook/deductive/resolver/ResolverTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -50,7 +50,7 @@ public class ResolverTree { private final Project myProject; private final TObjectIntHashMap myBindingDegree; //How many times this type variable is bound in the system private final Settings mySettings; - private boolean mySolutionFound = false; + private boolean mySolutionFound; private Set myConstraints; @@ -244,7 +244,7 @@ public class ResolverTree { final Map index = new HashMap(); sccs.forEach(new TIntProcedure() { - int myTNumber = 0; + int myTNumber; @Override public boolean execute(int size) { diff --git a/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java b/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java index 7d00278f324d..f93cfcb0e6bc 100644 --- a/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java +++ b/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java @@ -77,7 +77,7 @@ public class TypeMigrationLabeler { private final LinkedHashMap myNewExpressionTypeChange; private final LinkedHashMap myClassTypeArgumentsChange; - private TypeMigrationUsageInfo[] myMigratedUsages = null; + private TypeMigrationUsageInfo[] myMigratedUsages; private TypeMigrationUsageInfo myCurrentRoot; private final Map>> myRootsTree = diff --git a/java/java-impl/src/com/intellij/refactoring/util/classMembers/ElementNeedsThis.java b/java/java-impl/src/com/intellij/refactoring/util/classMembers/ElementNeedsThis.java index 8bcacc8333e9..3f3c7e7479c4 100644 --- a/java/java-impl/src/com/intellij/refactoring/util/classMembers/ElementNeedsThis.java +++ b/java/java-impl/src/com/intellij/refactoring/util/classMembers/ElementNeedsThis.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -22,7 +22,7 @@ import com.intellij.psi.util.PsiUtil; * @author dsl */ public class ElementNeedsThis extends ClassThisReferencesVisitor { - private boolean myResult = false; + private boolean myResult; private final PsiElement myMember; public ElementNeedsThis(PsiClass aClass, PsiElement member) { diff --git a/java/java-impl/src/com/intellij/refactoring/util/classMembers/InterfaceMemberDependencyGraph.java b/java/java-impl/src/com/intellij/refactoring/util/classMembers/InterfaceMemberDependencyGraph.java index d04b5b7d3c98..741a29b66226 100644 --- a/java/java-impl/src/com/intellij/refactoring/util/classMembers/InterfaceMemberDependencyGraph.java +++ b/java/java-impl/src/com/intellij/refactoring/util/classMembers/InterfaceMemberDependencyGraph.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -26,7 +26,7 @@ import java.util.Iterator; import java.util.Set; public class InterfaceMemberDependencyGraph> implements MemberDependencyGraph { - protected HashSet myInterfaceDependencies = null; + protected HashSet myInterfaceDependencies; protected HashMap> myMembersToInterfacesMap = new HashMap>(); protected HashSet myImplementedInterfaces; protected HashMap> myMethodsFromInterfaces; diff --git a/java/java-impl/src/com/intellij/refactoring/util/classRefs/ClassReferenceScanner.java b/java/java-impl/src/com/intellij/refactoring/util/classRefs/ClassReferenceScanner.java index 2ee99941aebc..faa9cdc1910d 100644 --- a/java/java-impl/src/com/intellij/refactoring/util/classRefs/ClassReferenceScanner.java +++ b/java/java-impl/src/com/intellij/refactoring/util/classRefs/ClassReferenceScanner.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -22,7 +22,7 @@ import com.intellij.psi.*; */ public abstract class ClassReferenceScanner { protected PsiClass myClass; - private PsiReference[] myReferences = null; + private PsiReference[] myReferences; public abstract PsiReference[] findReferences(); diff --git a/java/java-impl/src/com/intellij/refactoring/util/duplicates/MethodDuplicatesHandler.java b/java/java-impl/src/com/intellij/refactoring/util/duplicates/MethodDuplicatesHandler.java index a6d97af3d961..88c54b97c43e 100644 --- a/java/java-impl/src/com/intellij/refactoring/util/duplicates/MethodDuplicatesHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/util/duplicates/MethodDuplicatesHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -161,7 +161,7 @@ public class MethodDuplicatesHandler implements RefactoringActionHandler, Contex } scope.accept(new PsiRecursiveElementVisitor() { - private int myFileCount = 0; + private int myFileCount; @Override public void visitFile(final PsiFile file) { if (progressIndicator != null){ if (progressIndicator.isCanceled()) return; diff --git a/java/java-impl/src/com/intellij/refactoring/util/occurrences/BaseOccurrenceManager.java b/java/java-impl/src/com/intellij/refactoring/util/occurrences/BaseOccurrenceManager.java index 4113e2cd6ca1..dd61924b09ce 100644 --- a/java/java-impl/src/com/intellij/refactoring/util/occurrences/BaseOccurrenceManager.java +++ b/java/java-impl/src/com/intellij/refactoring/util/occurrences/BaseOccurrenceManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -28,8 +28,8 @@ import java.util.ArrayList; * @author dsl */ public abstract class BaseOccurrenceManager implements OccurrenceManager { - private PsiExpression[] myOccurrences = null; - private PsiElement myAnchorStatement = null; + private PsiExpression[] myOccurrences; + private PsiElement myAnchorStatement; protected final OccurrenceFilter myFilter; public BaseOccurrenceManager(OccurrenceFilter filter) { diff --git a/java/java-impl/src/com/intellij/refactoring/wrapreturnvalue/ReturnValueBeanBuilder.java b/java/java-impl/src/com/intellij/refactoring/wrapreturnvalue/ReturnValueBeanBuilder.java index 965083e8ddc0..b880c8402e6a 100644 --- a/java/java-impl/src/com/intellij/refactoring/wrapreturnvalue/ReturnValueBeanBuilder.java +++ b/java/java-impl/src/com/intellij/refactoring/wrapreturnvalue/ReturnValueBeanBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -29,10 +29,10 @@ import java.util.List; class ReturnValueBeanBuilder { private final List myTypeParams = new ArrayList(); - private String myClassName = null; - private String myPackageName = null; - private Project myProject = null; - private PsiType myValueType = null; + private String myClassName; + private String myPackageName; + private Project myProject; + private PsiType myValueType; private boolean myStatic; public void setClassName(String className) { diff --git a/java/java-impl/src/com/intellij/unscramble/ThreadState.java b/java/java-impl/src/com/intellij/unscramble/ThreadState.java index d4952446a3fb..2c47f96b72f5 100644 --- a/java/java-impl/src/com/intellij/unscramble/ThreadState.java +++ b/java/java-impl/src/com/intellij/unscramble/ThreadState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * 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. @@ -35,7 +35,7 @@ public class ThreadState { private String myJavaThreadState; private String myThreadStateDetail; private String myExtraState; - private boolean isDaemon = false; + private boolean isDaemon; private final Set myThreadsWaitingForMyLock = new HashSet(); private final Set myDeadlockedThreads = new HashSet(); diff --git a/java/java-impl/src/com/intellij/unscramble/UnscrambleListener.java b/java/java-impl/src/com/intellij/unscramble/UnscrambleListener.java index f0e279528494..ad42513edc03 100644 --- a/java/java-impl/src/com/intellij/unscramble/UnscrambleListener.java +++ b/java/java-impl/src/com/intellij/unscramble/UnscrambleListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -31,7 +31,7 @@ import java.util.regex.Pattern; */ public class UnscrambleListener extends ApplicationActivationListener.Adapter { private static final int MAX_STACKTRACE_SIZE = 100 * 1024; - private String stacktrace = null; + private String stacktrace; @Override public void applicationActivated(final IdeFrame ideFrame) { diff --git a/java/java-indexing-impl/src/com/intellij/codeInsight/ReadableExternalAnnotationsManager.java b/java/java-indexing-impl/src/com/intellij/codeInsight/ReadableExternalAnnotationsManager.java index 4dd8e62e78a8..c4682cfbbdc9 100644 --- a/java/java-indexing-impl/src/com/intellij/codeInsight/ReadableExternalAnnotationsManager.java +++ b/java/java-indexing-impl/src/com/intellij/codeInsight/ReadableExternalAnnotationsManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -27,7 +27,7 @@ import org.jetbrains.annotations.Nullable; import java.util.*; public class ReadableExternalAnnotationsManager extends BaseExternalAnnotationsManager { - @Nullable private Set myAnnotationsRoots = null; + @Nullable private Set myAnnotationsRoots; public ReadableExternalAnnotationsManager(PsiManager psiManager) { super(psiManager); diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/AllClassesSearchExecutor.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/AllClassesSearchExecutor.java index 067db93f8551..d90a814afe57 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/AllClassesSearchExecutor.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/AllClassesSearchExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -104,7 +104,7 @@ public class AllClassesSearchExecutor implements QueryExecutor() { - int i = 0; + int i; @Override public boolean process(String s) { diff --git a/java/java-psi-api/src/com/intellij/ide/util/JavaAnonymousClassesHelper.java b/java/java-psi-api/src/com/intellij/ide/util/JavaAnonymousClassesHelper.java index ae6b362792ad..a11fb2f2feb9 100644 --- a/java/java-psi-api/src/com/intellij/ide/util/JavaAnonymousClassesHelper.java +++ b/java/java-psi-api/src/com/intellij/ide/util/JavaAnonymousClassesHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -50,7 +50,7 @@ public class JavaAnonymousClassesHelper { public CachedValueProvider.Result> compute(final PsiClass upper) { final Map map = new THashMap(); upper.accept(new JavaRecursiveElementWalkingVisitor() { - int index = 0; + int index; @Override public void visitAnonymousClass(PsiAnonymousClass aClass) { diff --git a/java/java-psi-api/src/com/intellij/psi/util/ClassUtil.java b/java/java-psi-api/src/com/intellij/psi/util/ClassUtil.java index 9e005ffd2eef..98085e944c5b 100644 --- a/java/java-psi-api/src/com/intellij/psi/util/ClassUtil.java +++ b/java/java-psi-api/src/com/intellij/psi/util/ClassUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -112,7 +112,7 @@ public class ClassUtil { final String name = prefix.length() < indexName.length() ? indexName.substring(prefix.length()) : null; final PsiClass[] result = new PsiClass[1]; containingClass.accept(new JavaRecursiveElementVisitor() { - private int myCurrentIdx = 0; + private int myCurrentIdx; @Override public void visitElement(PsiElement element) { From 3b521f997c69cb0ca94dab154facefe949f5742c Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 29 Apr 2016 11:46:27 +0300 Subject: [PATCH 09/19] dangling javadocs removed --- .../compiler/CompilerConfigurationImpl.java | 4 --- .../intellij/compiler/impl/CompileDriver.java | 7 +---- .../packagingCompiler/IgnoredFileFilter.java | 5 +--- .../projectRoots/impl/MockJdkWrapper.java | 5 +--- .../impl/ui/actions/PackageFileAction.java | 16 ++++++++-- .../options/ExcludeEntryDescription.java | 6 +--- .../debugger/actions/ExportThreadsAction.java | 6 +--- .../debugger/actions/ThreadDumpAction.java | 5 ---- .../actions/ToggleMethodBreakpointAction.java | 6 +--- .../expression/ArrayInitializerEvaluator.java | 9 +----- .../expression/NewArrayInstanceEvaluator.java | 7 +---- .../expression/NewClassInstanceEvaluator.java | 5 ---- .../com/intellij/debugger/jdi/Bytecodes.java | 6 ++-- .../FieldBreakpointPropertiesPanel.java | 6 +--- .../ui/breakpoints/FilteredRequestorImpl.java | 4 --- .../MethodBreakpointPropertiesPanel.java | 6 +--- .../newProjectWizard/SourceRootFinder.java | 6 +--- .../impl/quickfix/CastMethodArgumentFix.java | 9 +----- .../quickfix/ConstructorParametersFixer.java | 18 +++++------ .../quickfix/QualifySuperArgumentFix.java | 16 +--------- .../impl/quickfix/QualifyThisArgumentFix.java | 9 +----- .../QualifyThisOrSuperArgumentFix.java | 24 ++++----------- .../SimplifyBooleanExpressionFix.java | 5 +--- .../impl/quickfix/VariableArrayTypeFix.java | 6 ++-- .../ChangeExtendsToImplementsFix.java | 5 +--- .../quickfix/ChangeParameterClassFix.java | 9 +----- .../quickfix/DeferFinalAssignmentFix.java | 9 +----- .../daemon/impl/quickfix/InsertNewFix.java | 5 +--- .../GenerateSuperMethodCallHandler.java | 9 ++---- .../impl/SimplifyBooleanExpressionAction.java | 5 +--- .../ide/projectView/impl/PackageViewPane.java | 10 +++---- .../libraryJar/LibraryJarDescriptors.java | 6 +--- .../source/codeStyle/javadoc/JDComment.java | 6 +--- .../anonymousToInner/VariableInfo.java | 4 --- .../ChangeSignatureViewDescriptor.java | 6 +--- .../changeSignature/ParameterInfoImpl.java | 6 +--- .../ExtractSuperclassHandler.java | 6 +--- .../IntroduceVariableSettings.java | 9 +----- .../MigrationUsagesViewDescriptor.java | 8 ++--- .../MoveClassesOrPackagesImpl.java | 6 +--- .../move/moveInner/MoveInnerDialog.java | 6 +--- .../move/moveInner/MoveInnerImpl.java | 6 +--- .../moveInner/MoveInnerViewDescriptor.java | 6 +--- .../move/moveMembers/MoveMembersImpl.java | 6 +--- .../rename/naming/AutomaticUsageRenamer.java | 4 +-- .../TurnRefsToSuperHandler.java | 7 +---- .../ui/YesNoPreviewUsagesDialog.java | 8 ++--- .../refactoring/util/ConflictsUtil.java | 6 +--- .../searches/ClassInheritorsSearch.java | 4 +-- .../com/intellij/codeInsight/ClassUtil.java | 3 -- .../UnknownGuardInspectionTest.java | 6 ++-- .../refactoring/MakeClassStaticTest.java | 16 ++++++++-- .../refactoring/MoveClassAndFileTest.java | 7 +---- .../codeInspection/InspectionManager.java | 28 ++++++++--------- .../codeInspection/ProblemHighlightType.java | 4 +-- .../src/com/intellij/profile/Profile.java | 4 +-- .../charset/Native2AsciiCharsetDecoder.java | 6 +--- .../charset/Native2AsciiCharsetEncoder.java | 16 ++++------ .../jetbrains/ide/BinaryRequestHandler.java | 2 +- .../src/org/jetbrains/ide/RestService.java | 4 +-- .../ide/util/PropertiesComponent.java | 8 ++--- .../openapi/components/RoamingType.java | 4 +-- .../openapi/options/SchemeProcessor.java | 2 +- .../intellij/openapi/util/ActionCallback.java | 8 ++--- .../intellij/openapi/util/AsyncResult.java | 30 +++++++++---------- .../com/intellij/psi/PsiTreeChangeEvent.java | 4 +-- .../intellij/lang/impl/PsiBuilderImpl.java | 6 ++-- .../intellij/ide/ui/UISettingsListener.java | 5 +--- .../colors/impl/AbstractColorsScheme.java | 3 -- .../colors/impl/DefaultColorsScheme.java | 5 +--- .../psi/search/SearchRequestCollector.java | 4 +-- .../runners/GenericProgramRunner.java | 6 ++-- .../src/com/intellij/facet/FacetTypeId.java | 4 +-- .../util/frameworkSupport/FrameworkRole.java | 4 +-- .../intellij/openapi/module/ModuleUtil.java | 5 +--- .../intellij/openapi/project/ProjectUtil.java | 4 +-- .../rename/RenameInputValidatorRegistry.java | 8 +---- .../options/colors/ClickNavigator.java | 5 +--- .../application/options/colors/TailPanel.java | 5 +--- .../colors/TextAttributesDescription.java | 5 +--- .../colors/highlighting/HighlightData.java | 5 +--- .../highlighting/HighlightsExtractor.java | 5 +--- .../daemon/impl/HighlightInfoComposite.java | 5 +--- .../DefaultHighlightingSettingProvider.java | 6 +--- .../documentation/AbstractExternalFilter.java | 6 ++-- .../QuickDocOnMouseOverManager.java | 2 +- .../moveUpDown/MoveStatementHandler.java | 5 +--- .../CommentByBlockCommentHandler.java | 8 ++--- .../highlighting/HighlightUsagesHandler.java | 6 ++-- .../impl/config/IntentionActionMetaData.java | 5 +--- .../config/IntentionDescriptionPanel.java | 5 +--- .../impl/config/IntentionSettingsTree.java | 5 +--- .../impl/config/IntentionUsagePanel.java | 5 +--- .../codeInsight/template/impl/TableMap.java | 22 +++++++------- .../PostfixTemplatesCompletionProvider.java | 6 ++-- .../logging/DebuggerLogConsoleManager.java | 6 +--- .../TerminateRemoteProcessDialog.java | 6 +--- .../execution/impl/MyDiffContainer.java | 6 ++-- .../ide/actions/TogglePopupHintsAction.java | 6 +--- .../fileTemplates/FileTemplateManager.java | 5 ++-- .../MoveModulesOutsideGroupAction.java | 5 +--- .../actions/MoveModulesToGroupAction.java | 5 +--- .../actions/MoveModulesToSubGroupAction.java | 5 +--- .../impl/AbstractProjectViewPSIPane.java | 5 +--- .../impl/AbstractProjectViewPane.java | 3 -- .../ide/projectView/impl/ModuleGroup.java | 10 +++---- .../projectView/impl/MoveModuleToGroup.java | 5 +--- .../impl/MoveModuleToGroupTopLevel.java | 5 +--- .../ide/projectView/impl/ProjectViewPane.java | 5 +--- .../StructureTreeBuilder.java | 3 +- .../ide/todo/AllTodosTreeBuilder.java | 5 +--- .../ide/todo/ChangeListTodosTreeBuilder.java | 5 +--- .../ide/todo/ScopeBasedTodosTreeBuilder.java | 5 +--- .../todo/TodoFileDirAndModuleComparator.java | 5 +--- .../psiView/ViewerNodeDescriptor.java | 7 +---- .../internal/psiView/ViewerTreeBuilder.java | 13 ++------ .../internal/psiView/ViewerTreeStructure.java | 7 +---- .../openapi/roots/impl/OrderEntryUtil.java | 5 +--- .../refactoring/actions/InlineAction.java | 8 +---- .../InlineRefactoringActionHandler.java | 8 +---- .../refactoring/move/MoveCallback.java | 8 +---- .../refactoring/move/MoveHandler.java | 6 +--- .../move/MoveMemberViewDescriptor.java | 10 ++----- .../MoveMultipleElementsViewDescriptor.java | 6 +--- .../safeDelete/UnsafeUsagesDialog.java | 6 +--- .../refactoring/ui/ConflictsDialog.java | 4 --- .../src/com/intellij/tools/FilterDialog.java | 5 +--- .../intellij/tools/OutputFiltersDialog.java | 5 +--- .../intellij/usageView/FindUsagesCommand.java | 6 +--- .../src/com/intellij/ide/BrowserUtil.java | 6 ++-- .../src/com/intellij/ide/GeneralSettings.java | 8 ++--- .../ide/ui/SplitterProportionsDataImpl.java | 5 +--- .../openapi/util/DimensionService.java | 4 +-- .../src/com/intellij/ui/ColorChooser.java | 6 ++-- .../com/intellij/ui/ColorChooserService.java | 10 +++---- .../intellij/ui/SimpleColoredComponent.java | 4 +-- .../com/intellij/ui/treeStructure/Tree.java | 8 ++--- .../src/com/intellij/util/config/Storage.java | 6 ++-- .../util/config/StorageAccessors.java | 9 +++--- .../application/options/SaveSchemeDialog.java | 3 -- .../codeInsight/hint/TooltipGroup.java | 5 +--- .../execution/DelayedDocumentWatcher.java | 8 ++--- .../execution/process/OSProcessUtil.java | 24 +++++++-------- .../com/intellij/ide/actions/RunGcAction.java | 5 +--- .../ToggleReadOnlyAttributeAction.java | 5 +--- .../ide/actions/ViewStatusBarAction.java | 5 +--- .../config/PasswordSafeSettings.java | 2 -- .../components/impl/stores/IProjectStore.java | 8 ++--- .../fileChooser/impl/FileComparator.java | 7 ++--- .../impl/FileEditorManagerImpl.java | 12 ++++---- .../openapi/project/ex/ProjectManagerEx.java | 6 ++-- .../wm/ex/IdeFocusTraversalPolicy.java | 4 +-- .../wm/ex/ToolWindowManagerAdapter.java | 5 +--- .../openapi/wm/impl/StripeButtonUI.java | 6 ++-- .../wm/impl/commands/ApplyWindowInfoCmd.java | 5 +--- .../RequestFocusInEditorComponentCmd.java | 5 +--- .../remote/VagrantBasedCredentialsHolder.java | 4 +-- .../src/com/intellij/util/Urls.java | 4 +-- .../util/ui/CollectionItemEditor.java | 4 +-- .../util/ui/CollectionModelEditor.java | 4 +-- .../src/org/jetbrains/io/LocalFileFinder.java | 17 ++++++++++- .../intellij/openapi/components/Storage.java | 6 ++-- .../openapi/components/StoragePathMacros.java | 10 +++---- .../openapi/roots/libraries/LibraryUtil.java | 5 +--- .../agent/annotation/FinalCall.java | 19 +++++++++--- .../src/org/jetbrains/debugger/Scope.java | 4 +-- .../LightPlatformCodeInsightTestCase.java | 3 -- .../com/intellij/openapi/util/IconLoader.java | 2 +- .../com/intellij/openapi/util/JDOMUtil.java | 2 +- .../com/intellij/util/ConcurrencyUtil.java | 2 +- .../util/UniqueFileNamesProvider.java | 6 ++-- .../util/concurrency/AppDelayQueue.java | 2 +- .../intellij/util/containers/LongStack.java | 5 +--- .../intellij/util/containers/MultiMap.java | 6 ++-- .../com/intellij/util/io/EqualityPolicy.java | 4 +-- .../src/com/intellij/util/ui/ColumnInfo.java | 6 ++-- .../util/ui/ComboBoxTableCellEditor.java | 4 +-- .../util/src/com/intellij/util/ui/UIUtil.java | 6 ++-- .../util/xmlb/annotations/CollectionBean.java | 6 ++-- .../checkin/BeforeCheckinDialogHandler.java | 4 +-- .../utils/impl/SmartDeltaCompressor.java | 12 ++++---- .../com/intellij/xdebugger/XDebugProcess.java | 12 ++++---- .../xdebugger/XDebugSessionAdapter.java | 2 +- .../xdebugger/settings/XDebuggerSettings.java | 6 ++-- .../intellij/xdebugger/ui/DebuggerColors.java | 5 +--- 185 files changed, 423 insertions(+), 809 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java b/java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java index 7fa8850faee9..4d8bd26f32ee 100644 --- a/java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java +++ b/java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * created at Jan 3, 2002 - * @author Jeka - */ package com.intellij.compiler; import com.intellij.CommonBundle; diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java index 95c190743443..deec5c2f92f5 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -14,11 +14,6 @@ * limitations under the License. */ -/** - * @author: Eugene Zhuravlev - * Date: Jan 17, 2003 - * Time: 1:42:26 PM - */ package com.intellij.compiler.impl; import com.intellij.CommonBundle; diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/IgnoredFileFilter.java b/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/IgnoredFileFilter.java index 5ad3f5a52c13..1522870cec67 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/IgnoredFileFilter.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/IgnoredFileFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.compiler.impl.packagingCompiler; import com.intellij.openapi.fileTypes.FileTypeManager; diff --git a/java/compiler/impl/src/com/intellij/openapi/projectRoots/impl/MockJdkWrapper.java b/java/compiler/impl/src/com/intellij/openapi/projectRoots/impl/MockJdkWrapper.java index 779df52e49e3..5120843b4e8b 100644 --- a/java/compiler/impl/src/com/intellij/openapi/projectRoots/impl/MockJdkWrapper.java +++ b/java/compiler/impl/src/com/intellij/openapi/projectRoots/impl/MockJdkWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.openapi.projectRoots.impl; import com.intellij.openapi.projectRoots.Sdk; diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/ui/actions/PackageFileAction.java b/java/compiler/impl/src/com/intellij/packaging/impl/ui/actions/PackageFileAction.java index cd3092fdb35f..9b4cca6aba01 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/ui/actions/PackageFileAction.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/ui/actions/PackageFileAction.java @@ -1,5 +1,17 @@ -/** - * @author cdr +/* + * 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. */ package com.intellij.packaging.impl.ui.actions; diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/options/ExcludeEntryDescription.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/options/ExcludeEntryDescription.java index b752e8e84dae..b52329c878e3 100644 --- a/java/compiler/openapi/src/com/intellij/openapi/compiler/options/ExcludeEntryDescription.java +++ b/java/compiler/openapi/src/com/intellij/openapi/compiler/options/ExcludeEntryDescription.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * created at Jan 3, 2002 - * @author Jeka - */ package com.intellij.openapi.compiler.options; import com.intellij.openapi.Disposable; diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/ExportThreadsAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/ExportThreadsAction.java index 25d95ed86292..da6c5fbe9553 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/ExportThreadsAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/ExportThreadsAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * class ExportThreadsAction - * @author Jeka - */ package com.intellij.debugger.actions; import com.intellij.debugger.DebuggerManagerEx; diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/ThreadDumpAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/ThreadDumpAction.java index 1d9b0e2db551..df157425e2bb 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/ThreadDumpAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/ThreadDumpAction.java @@ -14,11 +14,6 @@ * limitations under the License. */ -/** - * class ExportThreadsAction - * @author Eugene Zhuravlev - * @author Sascha Weinreuter - */ package com.intellij.debugger.actions; import com.intellij.debugger.DebuggerBundle; diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/ToggleMethodBreakpointAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/ToggleMethodBreakpointAction.java index 7474f5a42b21..43836ac9549c 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/ToggleMethodBreakpointAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/ToggleMethodBreakpointAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * class ToggleMethodBreakpointAction - * @author Jeka - */ package com.intellij.debugger.actions; import com.intellij.debugger.DebuggerManagerEx; diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/ArrayInitializerEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/ArrayInitializerEvaluator.java index 0fe3395bae7e..786c64c4fa8d 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/ArrayInitializerEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/ArrayInitializerEvaluator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,17 +14,10 @@ * limitations under the License. */ -/** - * class ArrayInitializerEvaluator - * created Jun 28, 2001 - * @author Jeka - */ package com.intellij.debugger.engine.evaluation.expression; -import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; import com.intellij.debugger.engine.evaluation.EvaluateException; import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; -import com.intellij.debugger.engine.evaluation.EvaluateException; class ArrayInitializerEvaluator implements Evaluator{ private final Evaluator[] myValueEvaluators; diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/NewArrayInstanceEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/NewArrayInstanceEvaluator.java index 6262165fc07d..5b7a731ca116 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/NewArrayInstanceEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/NewArrayInstanceEvaluator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -14,11 +14,6 @@ * limitations under the License. */ -/** - * class NewArrayInstanceEvaluator - * created Jun 27, 2001 - * @author Jeka - */ package com.intellij.debugger.engine.evaluation.expression; import com.intellij.debugger.DebuggerBundle; diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/NewClassInstanceEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/NewClassInstanceEvaluator.java index dd699cd7f11d..c3d501096842 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/NewClassInstanceEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/NewClassInstanceEvaluator.java @@ -14,11 +14,6 @@ * limitations under the License. */ -/** - * class NewArrayInstanceEvaluator - * created Jun 27, 2001 - * @author Jeka - */ package com.intellij.debugger.engine.evaluation.expression; import com.intellij.debugger.DebuggerBundle; diff --git a/java/debugger/impl/src/com/intellij/debugger/jdi/Bytecodes.java b/java/debugger/impl/src/com/intellij/debugger/jdi/Bytecodes.java index 9f82d74a37dd..d6d86c12d32b 100644 --- a/java/debugger/impl/src/com/intellij/debugger/jdi/Bytecodes.java +++ b/java/debugger/impl/src/com/intellij/debugger/jdi/Bytecodes.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -226,8 +226,8 @@ class Bytecodes { */ static final int BSM = 33; - /** - * Computes the instruction types of JVM opcodes. + /* + Computes the instruction types of JVM opcodes. */ static { int i; diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FieldBreakpointPropertiesPanel.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FieldBreakpointPropertiesPanel.java index 41f5417799b6..b81d81c688fe 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FieldBreakpointPropertiesPanel.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FieldBreakpointPropertiesPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * class FieldBreakpointPropertiesPanel - * @author Jeka - */ package com.intellij.debugger.ui.breakpoints; import com.intellij.debugger.DebuggerBundle; diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FilteredRequestorImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FilteredRequestorImpl.java index 4e25cf4ac7b1..349396284cea 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FilteredRequestorImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FilteredRequestorImpl.java @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * class FilteredRequestorImpl - * @author Jeka - */ package com.intellij.debugger.ui.breakpoints; import com.intellij.debugger.InstanceFilter; diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpointPropertiesPanel.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpointPropertiesPanel.java index c9026d152e99..289d9d20a94e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpointPropertiesPanel.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpointPropertiesPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * class MethodBreakpointPropertiesPanel - * @author Jeka - */ package com.intellij.debugger.ui.breakpoints; import com.intellij.debugger.DebuggerBundle; diff --git a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/SourceRootFinder.java b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/SourceRootFinder.java index c0a340ebe0ea..c1bbd5adc9dc 100644 --- a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/SourceRootFinder.java +++ b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/SourceRootFinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * 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. @@ -21,10 +21,6 @@ import com.intellij.openapi.util.Pair; import java.io.File; import java.util.List; -/** - * @author Maxim.Medvedev - */ - /** * @deprecated use {@link com.intellij.ide.util.projectWizard.importSources.JavaSourceRootDetector} instead */ diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CastMethodArgumentFix.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CastMethodArgumentFix.java index 0bdc0a5f1c03..2e6971a3ea9c 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CastMethodArgumentFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CastMethodArgumentFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,13 +14,6 @@ * limitations under the License. */ -/** - * Created by IntelliJ IDEA. - * User: cdr - * Date: Nov 13, 2002 - * Time: 3:26:50 PM - * To change this template use Options | File Templates. - */ package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.daemon.QuickFixBundle; diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ConstructorParametersFixer.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ConstructorParametersFixer.java index 28acb28257a7..327c54e59180 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ConstructorParametersFixer.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ConstructorParametersFixer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,20 +14,20 @@ * limitations under the License. */ -/** - * Propose to cast one argument to corresponding type - * in the constructor invocation - * E.g. - * - * User: cdr - * Date: Nov 13, 2002 +/* + Propose to cast one argument to corresponding type + in the constructor invocation + E.g. + + User: cdr + Date: Nov 13, 2002 */ package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.daemon.impl.HighlightInfo; +import com.intellij.openapi.util.TextRange; import com.intellij.psi.*; import com.intellij.psi.infos.CandidateInfo; -import com.intellij.openapi.util.TextRange; import org.jetbrains.annotations.NotNull; public class ConstructorParametersFixer { diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QualifySuperArgumentFix.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QualifySuperArgumentFix.java index 0a3048f23273..6219d0e12fe3 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QualifySuperArgumentFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QualifySuperArgumentFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -14,28 +14,14 @@ * limitations under the License. */ -/** - * Created by IntelliJ IDEA. - * User: cdr - * Date: Nov 13, 2002 - * Time: 3:26:50 PM - * To change this template use Options | File Templates. - */ package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.daemon.impl.HighlightInfo; -import com.intellij.openapi.util.TextRange; import com.intellij.psi.*; -import com.intellij.psi.infos.CandidateInfo; import com.intellij.psi.util.PsiTreeUtil; -import com.intellij.psi.util.PsiUtil; -import com.intellij.psi.util.TypeConversionUtil; import com.intellij.refactoring.util.RefactoringChangeUtil; import org.jetbrains.annotations.NotNull; -import java.util.HashSet; -import java.util.Set; - public class QualifySuperArgumentFix extends QualifyThisOrSuperArgumentFix { public QualifySuperArgumentFix(@NotNull PsiExpression expression, @NotNull PsiClass psiClass) { super(expression, psiClass); diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QualifyThisArgumentFix.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QualifyThisArgumentFix.java index c5bba7888154..0375eb834407 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QualifyThisArgumentFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QualifyThisArgumentFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -14,13 +14,6 @@ * limitations under the License. */ -/** - * Created by IntelliJ IDEA. - * User: cdr - * Date: Nov 13, 2002 - * Time: 3:26:50 PM - * To change this template use Options | File Templates. - */ package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.daemon.impl.HighlightInfo; diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QualifyThisOrSuperArgumentFix.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QualifyThisOrSuperArgumentFix.java index 2ea59ccadb91..9f3cae83b5e2 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QualifyThisOrSuperArgumentFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QualifyThisOrSuperArgumentFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -14,33 +14,19 @@ * limitations under the License. */ -/** - * Created by IntelliJ IDEA. - * User: cdr - * Date: Nov 13, 2002 - * Time: 3:26:50 PM - * To change this template use Options | File Templates. - */ package com.intellij.codeInsight.daemon.impl.quickfix; -import com.intellij.codeInsight.daemon.impl.HighlightInfo; import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.TextRange; -import com.intellij.psi.*; -import com.intellij.psi.infos.CandidateInfo; -import com.intellij.psi.util.PsiTreeUtil; -import com.intellij.psi.util.PsiUtil; -import com.intellij.psi.util.TypeConversionUtil; -import com.intellij.refactoring.util.RefactoringChangeUtil; +import com.intellij.psi.PsiClass; +import com.intellij.psi.PsiExpression; +import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiManager; import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NotNull; -import java.util.HashSet; -import java.util.Set; - public abstract class QualifyThisOrSuperArgumentFix implements IntentionAction { protected static final Logger LOG = Logger.getInstance("#" + QualifyThisOrSuperArgumentFix.class.getName()); protected final PsiExpression myExpression; diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/SimplifyBooleanExpressionFix.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/SimplifyBooleanExpressionFix.java index 96d90b24c256..914cc34cfc4d 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/SimplifyBooleanExpressionFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/SimplifyBooleanExpressionFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.FileModificationService; diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/VariableArrayTypeFix.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/VariableArrayTypeFix.java index 1087e2ec29ef..c4257b06cdb2 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/VariableArrayTypeFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/VariableArrayTypeFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -160,8 +160,8 @@ public class VariableArrayTypeFix extends LocalQuickFixOnPsiElement { final PsiArrayInitializerExpression myInitializer = (PsiArrayInitializerExpression)startElement; final PsiVariable myVariable = getVariableLocal(myInitializer); if (myVariable == null) return; - /** - * only for the case when in same statement with initialization + /* + only for the case when in same statement with initialization */ final PsiNewExpression myNewExpression = getNewExpressionLocal(myInitializer); diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ChangeExtendsToImplementsFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ChangeExtendsToImplementsFix.java index dce0d54e405b..1462dc3d2897 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ChangeExtendsToImplementsFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ChangeExtendsToImplementsFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.daemon.QuickFixBundle; diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ChangeParameterClassFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ChangeParameterClassFix.java index 6d414e5e4750..5e91052a46eb 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ChangeParameterClassFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ChangeParameterClassFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,13 +14,6 @@ * limitations under the License. */ -/** - * Created by IntelliJ IDEA. - * User: cdr - * Date: Nov 13, 2002 - * Time: 3:26:50 PM - * To change this template use Options | File Templates. - */ package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.CodeInsightUtil; diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/DeferFinalAssignmentFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/DeferFinalAssignmentFix.java index dcae6c51d727..08822884965b 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/DeferFinalAssignmentFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/DeferFinalAssignmentFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,13 +14,6 @@ * limitations under the License. */ -/** - * Created by IntelliJ IDEA. - * User: cdr - * Date: Nov 19, 2002 - * Time: 12:03:39 PM - * To change this template use Options | File Templates. - */ package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.FileModificationService; diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/InsertNewFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/InsertNewFix.java index a418efb4da15..b9dc50f31d78 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/InsertNewFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/InsertNewFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.FileModificationService; diff --git a/java/java-impl/src/com/intellij/codeInsight/generation/actions/GenerateSuperMethodCallHandler.java b/java/java-impl/src/com/intellij/codeInsight/generation/actions/GenerateSuperMethodCallHandler.java index 81a98e94a160..d88bb8d5e3e7 100644 --- a/java/java-impl/src/com/intellij/codeInsight/generation/actions/GenerateSuperMethodCallHandler.java +++ b/java/java-impl/src/com/intellij/codeInsight/generation/actions/GenerateSuperMethodCallHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,19 +14,16 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.codeInsight.generation.actions; import com.intellij.codeInsight.CodeInsightActionHandler; import com.intellij.codeInsight.CodeInsightUtilBase; import com.intellij.codeInsight.CodeInsightUtilCore; import com.intellij.codeInsight.generation.OverrideImplementUtil; -import com.intellij.openapi.project.Project; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.ScrollType; -import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.util.IncorrectOperationException; diff --git a/java/java-impl/src/com/intellij/codeInsight/intention/impl/SimplifyBooleanExpressionAction.java b/java/java-impl/src/com/intellij/codeInsight/intention/impl/SimplifyBooleanExpressionAction.java index 3ae3ddcf7498..a977ab7202e8 100644 --- a/java/java-impl/src/com/intellij/codeInsight/intention/impl/SimplifyBooleanExpressionAction.java +++ b/java/java-impl/src/com/intellij/codeInsight/intention/impl/SimplifyBooleanExpressionAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.codeInsight.intention.impl; import com.intellij.codeInsight.FileModificationService; diff --git a/java/java-impl/src/com/intellij/ide/projectView/impl/PackageViewPane.java b/java/java-impl/src/com/intellij/ide/projectView/impl/PackageViewPane.java index a8e29dedf295..e4967d286908 100644 --- a/java/java-impl/src/com/intellij/ide/projectView/impl/PackageViewPane.java +++ b/java/java-impl/src/com/intellij/ide/projectView/impl/PackageViewPane.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.ide.projectView.impl; import com.intellij.history.LocalHistory; @@ -28,7 +25,10 @@ import com.intellij.ide.SelectInTarget; import com.intellij.ide.impl.PackagesPaneSelectInTarget; import com.intellij.ide.projectView.ProjectView; import com.intellij.ide.projectView.ViewSettings; -import com.intellij.ide.projectView.impl.nodes.*; +import com.intellij.ide.projectView.impl.nodes.PackageElement; +import com.intellij.ide.projectView.impl.nodes.PackageElementNode; +import com.intellij.ide.projectView.impl.nodes.PackageUtil; +import com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode; import com.intellij.ide.util.DeleteHandler; import com.intellij.ide.util.treeView.AbstractTreeBuilder; import com.intellij.ide.util.treeView.AbstractTreeNode; diff --git a/java/java-impl/src/com/intellij/internal/statistic/libraryJar/LibraryJarDescriptors.java b/java/java-impl/src/com/intellij/internal/statistic/libraryJar/LibraryJarDescriptors.java index fbb64676422e..f9234abdfcd2 100644 --- a/java/java-impl/src/com/intellij/internal/statistic/libraryJar/LibraryJarDescriptors.java +++ b/java/java-impl/src/com/intellij/internal/statistic/libraryJar/LibraryJarDescriptors.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -15,10 +15,6 @@ */ package com.intellij.internal.statistic.libraryJar; -/** - * @author Ivan Chirkov - */ - import com.intellij.util.xmlb.annotations.AbstractCollection; import com.intellij.util.xmlb.annotations.Property; diff --git a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDComment.java b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDComment.java index d79c018139d5..2edbf1595e24 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDComment.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDComment.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -21,10 +21,6 @@ import org.jetbrains.annotations.Nullable; import java.util.List; -/** - * @author max - */ - /** * @author Dmitry Skavish */ diff --git a/java/java-impl/src/com/intellij/refactoring/anonymousToInner/VariableInfo.java b/java/java-impl/src/com/intellij/refactoring/anonymousToInner/VariableInfo.java index 9715dec7e880..eba6c3e56f01 100644 --- a/java/java-impl/src/com/intellij/refactoring/anonymousToInner/VariableInfo.java +++ b/java/java-impl/src/com/intellij/refactoring/anonymousToInner/VariableInfo.java @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * created at Sep 7, 2001 - * @author Jeka - */ package com.intellij.refactoring.anonymousToInner; import com.intellij.psi.PsiVariable; diff --git a/java/java-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureViewDescriptor.java b/java/java-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureViewDescriptor.java index cd453595851e..20b5a178d02b 100644 --- a/java/java-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureViewDescriptor.java +++ b/java/java-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureViewDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * created at Sep 17, 2001 - * @author Jeka - */ package com.intellij.refactoring.changeSignature; import com.intellij.openapi.util.text.StringUtil; diff --git a/java/java-impl/src/com/intellij/refactoring/changeSignature/ParameterInfoImpl.java b/java/java-impl/src/com/intellij/refactoring/changeSignature/ParameterInfoImpl.java index 9bc2bba3b570..7fcfc830d6a9 100644 --- a/java/java-impl/src/com/intellij/refactoring/changeSignature/ParameterInfoImpl.java +++ b/java/java-impl/src/com/intellij/refactoring/changeSignature/ParameterInfoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * created at Sep 17, 2001 - * @author Jeka - */ package com.intellij.refactoring.changeSignature; import com.intellij.openapi.diagnostic.Logger; diff --git a/java/java-impl/src/com/intellij/refactoring/extractSuperclass/ExtractSuperclassHandler.java b/java/java-impl/src/com/intellij/refactoring/extractSuperclass/ExtractSuperclassHandler.java index 31f2d25f1a0b..815f9450a8dc 100644 --- a/java/java-impl/src/com/intellij/refactoring/extractSuperclass/ExtractSuperclassHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/extractSuperclass/ExtractSuperclassHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * created at Oct 25, 2001 - * @author Jeka - */ package com.intellij.refactoring.extractSuperclass; import com.intellij.history.LocalHistory; diff --git a/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableSettings.java b/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableSettings.java index d6042f399162..a6d564198ec9 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableSettings.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,13 +14,6 @@ * limitations under the License. */ -/** - * Created by IntelliJ IDEA. - * User: dsl - * Date: Nov 15, 2002 - * Time: 4:12:48 PM - * To change this template use Options | File Templates. - */ package com.intellij.refactoring.introduceVariable; import com.intellij.psi.PsiType; diff --git a/java/java-impl/src/com/intellij/refactoring/migration/MigrationUsagesViewDescriptor.java b/java/java-impl/src/com/intellij/refactoring/migration/MigrationUsagesViewDescriptor.java index 6a6f1d816e45..7e71544ac881 100644 --- a/java/java-impl/src/com/intellij/refactoring/migration/MigrationUsagesViewDescriptor.java +++ b/java/java-impl/src/com/intellij/refactoring/migration/MigrationUsagesViewDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,16 +14,12 @@ * limitations under the License. */ -/** - * created at Nov 24, 2001 - * @author Jeka - */ package com.intellij.refactoring.migration; import com.intellij.psi.PsiElement; import com.intellij.refactoring.RefactoringBundle; -import com.intellij.usageView.UsageViewDescriptor; import com.intellij.usageView.UsageViewBundle; +import com.intellij.usageView.UsageViewDescriptor; import org.jetbrains.annotations.NotNull; class MigrationUsagesViewDescriptor implements UsageViewDescriptor { diff --git a/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesImpl.java b/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesImpl.java index 380cfa3596a4..b4fc0a915bb1 100644 --- a/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesImpl.java +++ b/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * created at Nov 27, 2001 - * @author Jeka - */ package com.intellij.refactoring.move.moveClassesOrPackages; import com.intellij.history.LocalHistory; diff --git a/java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerDialog.java b/java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerDialog.java index 305c32752abd..1e41e7188ba3 100644 --- a/java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * created at Sep 24, 2001 - * @author Jeka - */ package com.intellij.refactoring.move.moveInner; import com.intellij.openapi.application.ApplicationManager; diff --git a/java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerImpl.java b/java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerImpl.java index 9b8fc36fbd7f..3eb40a600c9e 100644 --- a/java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerImpl.java +++ b/java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * created at Nov 12, 2001 - * @author Jeka - */ package com.intellij.refactoring.move.moveInner; import com.intellij.ide.util.PackageChooserDialog; diff --git a/java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerViewDescriptor.java b/java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerViewDescriptor.java index 04e2400467aa..e90ef34878c0 100644 --- a/java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerViewDescriptor.java +++ b/java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerViewDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * created at Sep 11, 2001 - * @author Jeka - */ package com.intellij.refactoring.move.moveInner; import com.intellij.psi.PsiClass; diff --git a/java/java-impl/src/com/intellij/refactoring/move/moveMembers/MoveMembersImpl.java b/java/java-impl/src/com/intellij/refactoring/move/moveMembers/MoveMembersImpl.java index 07b76fd13fb9..4c783a4f7fff 100644 --- a/java/java-impl/src/com/intellij/refactoring/move/moveMembers/MoveMembersImpl.java +++ b/java/java-impl/src/com/intellij/refactoring/move/moveMembers/MoveMembersImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * created at Nov 21, 2001 - * @author Jeka - */ package com.intellij.refactoring.move.moveMembers; import com.intellij.openapi.project.Project; diff --git a/java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticUsageRenamer.java b/java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticUsageRenamer.java index ce258c3cd013..009230acd93b 100644 --- a/java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticUsageRenamer.java +++ b/java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticUsageRenamer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -88,10 +88,10 @@ public abstract class AutomaticUsageRenamer { return myElements; } - @Nullable /** * Element source, path. For example, package. Taken into account while sorting. */ + @Nullable public String getSourceName(T element) { return null; } diff --git a/java/java-impl/src/com/intellij/refactoring/turnRefsToSuper/TurnRefsToSuperHandler.java b/java/java-impl/src/com/intellij/refactoring/turnRefsToSuper/TurnRefsToSuperHandler.java index 1d546d6280d8..d1678668e745 100644 --- a/java/java-impl/src/com/intellij/refactoring/turnRefsToSuper/TurnRefsToSuperHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/turnRefsToSuper/TurnRefsToSuperHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,15 +14,10 @@ * limitations under the License. */ -/** - * created at Oct 25, 2001 - * @author Jeka - */ package com.intellij.refactoring.turnRefsToSuper; import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.DataContext; -import com.intellij.openapi.actionSystem.PlatformDataKeys; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.ScrollType; import com.intellij.openapi.project.Project; diff --git a/java/java-impl/src/com/intellij/refactoring/ui/YesNoPreviewUsagesDialog.java b/java/java-impl/src/com/intellij/refactoring/ui/YesNoPreviewUsagesDialog.java index 7f82cda4a051..5603e277ce36 100644 --- a/java/java-impl/src/com/intellij/refactoring/ui/YesNoPreviewUsagesDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/ui/YesNoPreviewUsagesDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,17 +14,13 @@ * limitations under the License. */ -/** - * created at Oct 8, 2001 - * @author Jeka - */ package com.intellij.refactoring.ui; import com.intellij.openapi.help.HelpManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; -import com.intellij.openapi.ui.MultiLineLabelUI; import com.intellij.openapi.ui.Messages; +import com.intellij.openapi.ui.MultiLineLabelUI; import com.intellij.refactoring.RefactoringBundle; import org.jetbrains.annotations.NotNull; diff --git a/java/java-impl/src/com/intellij/refactoring/util/ConflictsUtil.java b/java/java-impl/src/com/intellij/refactoring/util/ConflictsUtil.java index 19d1eb9bfa08..f475a46a64ec 100644 --- a/java/java-impl/src/com/intellij/refactoring/util/ConflictsUtil.java +++ b/java/java-impl/src/com/intellij/refactoring/util/ConflictsUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,10 +14,6 @@ * limitations under the License. */ -/** - * created at Oct 8, 2001 - * @author Jeka - */ package com.intellij.refactoring.util; import com.intellij.lang.findUsages.DescriptiveNameUtil; diff --git a/java/java-indexing-api/src/com/intellij/psi/search/searches/ClassInheritorsSearch.java b/java/java-indexing-api/src/com/intellij/psi/search/searches/ClassInheritorsSearch.java index 2c1e34be09d0..c36240502f21 100644 --- a/java/java-indexing-api/src/com/intellij/psi/search/searches/ClassInheritorsSearch.java +++ b/java/java-indexing-api/src/com/intellij/psi/search/searches/ClassInheritorsSearch.java @@ -147,11 +147,11 @@ public class ClassInheritorsSearch extends ExtensibleQueryFactory ApplicationManager.getApplication().runReadAction((Computable>)() -> SmartPointerManager.getInstance(psiClass.getProject()).createSmartPsiElementPointer(psiClass))); } - @NotNull - @Deprecated //todo to be removed in IDEA 17 /** * @deprecated use {@link #search(PsiClass, SearchScope, boolean)} instead */ + @NotNull + @Deprecated //todo to be removed in IDEA 17 public static Query search(@NotNull final PsiClass aClass, @NotNull SearchScope scope, final boolean checkDeep, final boolean checkInheritance) { return search(aClass, scope, checkDeep, checkInheritance, true); } diff --git a/java/java-psi-api/src/com/intellij/codeInsight/ClassUtil.java b/java/java-psi-api/src/com/intellij/codeInsight/ClassUtil.java index ed21bf290b09..90cc4b9759e9 100644 --- a/java/java-psi-api/src/com/intellij/codeInsight/ClassUtil.java +++ b/java/java-psi-api/src/com/intellij/codeInsight/ClassUtil.java @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Alexey - */ package com.intellij.codeInsight; import com.intellij.psi.*; diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/UnknownGuardInspectionTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/UnknownGuardInspectionTest.java index 5d6a46115e00..56201807523e 100644 --- a/java/java-tests/testSrc/com/intellij/codeInspection/UnknownGuardInspectionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInspection/UnknownGuardInspectionTest.java @@ -14,9 +14,9 @@ * limitations under the License. */ -/** - * (c) 2016 Silent Forest AB - * created: 18 March 2016 +/* + (c) 2016 Silent Forest AB + created: 18 March 2016 */ package com.intellij.codeInspection; diff --git a/java/java-tests/testSrc/com/intellij/refactoring/MakeClassStaticTest.java b/java/java-tests/testSrc/com/intellij/refactoring/MakeClassStaticTest.java index ba225e2ab864..4ab7b6e5be34 100644 --- a/java/java-tests/testSrc/com/intellij/refactoring/MakeClassStaticTest.java +++ b/java/java-tests/testSrc/com/intellij/refactoring/MakeClassStaticTest.java @@ -1,5 +1,17 @@ -/** - * @author ven +/* + * 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. */ package com.intellij.refactoring; diff --git a/java/java-tests/testSrc/com/intellij/refactoring/MoveClassAndFileTest.java b/java/java-tests/testSrc/com/intellij/refactoring/MoveClassAndFileTest.java index 44ec8338d5ea..dc3f426ab782 100644 --- a/java/java-tests/testSrc/com/intellij/refactoring/MoveClassAndFileTest.java +++ b/java/java-tests/testSrc/com/intellij/refactoring/MoveClassAndFileTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -15,11 +15,6 @@ */ package com.intellij.refactoring; -/** - * User: anna - * Date: Aug 31, 2010 - */ - import com.intellij.JavaTestUtil; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.vfs.LocalFileSystem; diff --git a/platform/analysis-api/src/com/intellij/codeInspection/InspectionManager.java b/platform/analysis-api/src/com/intellij/codeInspection/InspectionManager.java index 6dcede54c97e..6d899616a626 100644 --- a/platform/analysis-api/src/com/intellij/codeInspection/InspectionManager.java +++ b/platform/analysis-api/src/com/intellij/codeInspection/InspectionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -93,42 +93,42 @@ public abstract class InspectionManager { @NotNull ProblemHighlightType highlightType, boolean onTheFly, final LocalQuickFix... fixes); + /** + * use {@link #createProblemDescriptor(PsiElement, String, boolean, LocalQuickFix[], ProblemHighlightType)} instead + */ @Deprecated @NotNull - /** - * use {@link #createProblemDescriptor(PsiElement, String, boolean, LocalQuickFix, ProblemHighlightType)} instead - */ public abstract ProblemDescriptor createProblemDescriptor(@NotNull PsiElement psiElement, @NotNull String descriptionTemplate, LocalQuickFix fix, @NotNull ProblemHighlightType highlightType); - @Deprecated - @NotNull /** * use {@link #createProblemDescriptor(PsiElement, String, boolean, LocalQuickFix[], ProblemHighlightType)} instead */ + @Deprecated + @NotNull public abstract ProblemDescriptor createProblemDescriptor(@NotNull PsiElement psiElement, @NotNull String descriptionTemplate, LocalQuickFix[] fixes, @NotNull ProblemHighlightType highlightType); - @Deprecated - @NotNull /** * use {@link #createProblemDescriptor(PsiElement, String, LocalQuickFix[], ProblemHighlightType, boolean, boolean)} instead */ + @Deprecated + @NotNull public abstract ProblemDescriptor createProblemDescriptor(@NotNull PsiElement psiElement, @NotNull String descriptionTemplate, LocalQuickFix[] fixes, @NotNull ProblemHighlightType highlightType, boolean isAfterEndOfLine); - @Deprecated - @NotNull /** * use {@link #createProblemDescriptor(PsiElement, PsiElement, String, ProblemHighlightType, boolean, LocalQuickFix...)} instead */ + @Deprecated + @NotNull public abstract ProblemDescriptor createProblemDescriptor(@NotNull PsiElement startElement, @NotNull PsiElement endElement, @NotNull String descriptionTemplate, @@ -136,22 +136,22 @@ public abstract class InspectionManager { LocalQuickFix... fixes); - @Deprecated - @NotNull /** * use {@link #createProblemDescriptor(PsiElement, TextRange, String, ProblemHighlightType, boolean, LocalQuickFix...)} instead */ + @Deprecated + @NotNull public abstract ProblemDescriptor createProblemDescriptor(@NotNull final PsiElement psiElement, final TextRange rangeInElement, @NotNull final String descriptionTemplate, @NotNull ProblemHighlightType highlightType, final LocalQuickFix... fixes); - @Deprecated - @NotNull /** * use {@link #createProblemDescriptor(PsiElement, String, boolean, ProblemHighlightType, boolean, LocalQuickFix...)} instead */ + @Deprecated + @NotNull public abstract ProblemDescriptor createProblemDescriptor(@NotNull final PsiElement psiElement, @NotNull final String descriptionTemplate, final boolean showTooltip, diff --git a/platform/analysis-api/src/com/intellij/codeInspection/ProblemHighlightType.java b/platform/analysis-api/src/com/intellij/codeInspection/ProblemHighlightType.java index ce5a07e80b54..5e25416b6b43 100644 --- a/platform/analysis-api/src/com/intellij/codeInspection/ProblemHighlightType.java +++ b/platform/analysis-api/src/com/intellij/codeInspection/ProblemHighlightType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -33,9 +33,9 @@ public enum ProblemHighlightType { /** The same as {@link #GENERIC_ERROR_OR_WARNING} with enforced {@link com.intellij.codeHighlighting.HighlightDisplayLevel#ERROR} severity level */ GENERIC_ERROR, - @Deprecated /** Enforces {@link com.intellij.codeHighlighting.HighlightDisplayLevel#INFO} severity level * use #WEAK_WARNING instead*/ + @Deprecated INFO, /** Enforces {@link com.intellij.codeHighlighting.HighlightDisplayLevel#WEAK_WARNING} severity level */ diff --git a/platform/analysis-api/src/com/intellij/profile/Profile.java b/platform/analysis-api/src/com/intellij/profile/Profile.java index 7aa2370836b5..e9945762ebc0 100644 --- a/platform/analysis-api/src/com/intellij/profile/Profile.java +++ b/platform/analysis-api/src/com/intellij/profile/Profile.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -28,10 +28,10 @@ public interface Profile extends Comparable, Scheme { void setLocal(boolean isLocal); - @Deprecated /** * @deprecated Use !{@link #isProjectLevel()} */ + @Deprecated boolean isLocal(); boolean isProjectLevel(); diff --git a/platform/boot/src/com/intellij/lang/properties/charset/Native2AsciiCharsetDecoder.java b/platform/boot/src/com/intellij/lang/properties/charset/Native2AsciiCharsetDecoder.java index f4a2b411daf8..7da4b9cdf6b7 100644 --- a/platform/boot/src/com/intellij/lang/properties/charset/Native2AsciiCharsetDecoder.java +++ b/platform/boot/src/com/intellij/lang/properties/charset/Native2AsciiCharsetDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -16,10 +16,6 @@ package com.intellij.lang.properties.charset; -/** - * @author Alexey - */ - import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; import java.nio.CharBuffer; diff --git a/platform/boot/src/com/intellij/lang/properties/charset/Native2AsciiCharsetEncoder.java b/platform/boot/src/com/intellij/lang/properties/charset/Native2AsciiCharsetEncoder.java index 115a611be09d..c07e69d0b324 100644 --- a/platform/boot/src/com/intellij/lang/properties/charset/Native2AsciiCharsetEncoder.java +++ b/platform/boot/src/com/intellij/lang/properties/charset/Native2AsciiCharsetEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -16,17 +16,13 @@ package com.intellij.lang.properties.charset; -/** - * @author Alexey - */ - +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; import java.nio.charset.CoderResult; -import java.nio.charset.Charset; -import java.nio.CharBuffer; -import java.nio.ByteBuffer; -import java.nio.BufferUnderflowException; -import java.nio.BufferOverflowException; class Native2AsciiCharsetEncoder extends CharsetEncoder { diff --git a/platform/built-in-server-api/src/org/jetbrains/ide/BinaryRequestHandler.java b/platform/built-in-server-api/src/org/jetbrains/ide/BinaryRequestHandler.java index ba616c250603..ac4d54becc39 100644 --- a/platform/built-in-server-api/src/org/jetbrains/ide/BinaryRequestHandler.java +++ b/platform/built-in-server-api/src/org/jetbrains/ide/BinaryRequestHandler.java @@ -25,10 +25,10 @@ import java.util.UUID; public abstract class BinaryRequestHandler { public static final ExtensionPointName EP_NAME = ExtensionPointName.create("org.jetbrains.binaryRequestHandler"); - @NotNull /** * uuidgen on Mac OS X could be used to generate UUID */ + @NotNull public abstract UUID getId(); @NotNull diff --git a/platform/built-in-server/src/org/jetbrains/ide/RestService.java b/platform/built-in-server/src/org/jetbrains/ide/RestService.java index 2d8beb522d5a..c0938646613f 100644 --- a/platform/built-in-server/src/org/jetbrains/ide/RestService.java +++ b/platform/built-in-server/src/org/jetbrains/ide/RestService.java @@ -104,10 +104,10 @@ public abstract class RestService extends HttpRequestHandler { return false; } - @NotNull /** * Use human-readable name or UUID if it is an internal service. */ + @NotNull protected abstract String getServiceName(); protected abstract boolean isMethodSupported(@NotNull HttpMethod method); @@ -144,10 +144,10 @@ public abstract class RestService extends HttpRequestHandler { } } - @Nullable("error text or null if successful") /** * Return error or send response using {@link #sendOk(FullHttpRequest, ChannelHandlerContext)}, {@link #send(BufferExposingByteArrayOutputStream, FullHttpRequest, ChannelHandlerContext)} */ + @Nullable("error text or null if successful") public abstract String execute(@NotNull QueryStringDecoder urlDecoder, @NotNull FullHttpRequest request, @NotNull ChannelHandlerContext context) throws IOException; @NotNull diff --git a/platform/core-api/src/com/intellij/ide/util/PropertiesComponent.java b/platform/core-api/src/com/intellij/ide/util/PropertiesComponent.java index b182fa9c3215..525d42018537 100644 --- a/platform/core-api/src/com/intellij/ide/util/PropertiesComponent.java +++ b/platform/core-api/src/com/intellij/ide/util/PropertiesComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -106,12 +106,12 @@ public abstract class PropertiesComponent { return ObjectUtils.notNull(getValue(name), defaultValue); } - @SuppressWarnings("unused") - @Deprecated /** * @deprecated Use {@link #getInt(String, int)} * Init was never performed and in any case is not recommended. */ + @SuppressWarnings("unused") + @Deprecated public final int getOrInitInt(@NotNull String name, int defaultValue) { return getInt(name, defaultValue); } @@ -130,10 +130,10 @@ public abstract class PropertiesComponent { } } - @Deprecated /** * @deprecated Use {@link #getValue(String, String)} */ + @Deprecated public String getOrInit(@NonNls String name, String defaultValue) { if (!isValueSet(name)) { setValue(name, defaultValue); diff --git a/platform/core-api/src/com/intellij/openapi/components/RoamingType.java b/platform/core-api/src/com/intellij/openapi/components/RoamingType.java index 6a8b81fe578e..2258b0e62140 100644 --- a/platform/core-api/src/com/intellij/openapi/components/RoamingType.java +++ b/platform/core-api/src/com/intellij/openapi/components/RoamingType.java @@ -31,15 +31,15 @@ public enum RoamingType { */ DEFAULT, - @Deprecated /** * Use {@link #DEFAULT} instead */ + @Deprecated PER_USER, - @Deprecated /** * Use {@link #PER_OS} instead */ + @Deprecated PER_PLATFORM, } diff --git a/platform/core-api/src/com/intellij/openapi/options/SchemeProcessor.java b/platform/core-api/src/com/intellij/openapi/options/SchemeProcessor.java index a4da435f2eeb..03db46183270 100644 --- a/platform/core-api/src/com/intellij/openapi/options/SchemeProcessor.java +++ b/platform/core-api/src/com/intellij/openapi/options/SchemeProcessor.java @@ -47,11 +47,11 @@ public abstract class SchemeProcessor { throw new AbstractMethodError(); } - @Nullable /** * @param duringLoad If occurred during {@link SchemesManager#loadSchemes()} call * Returns null if element is not valid. */ + @Nullable public T readScheme(@NotNull Element element, boolean duringLoad) throws Exception { return readScheme(element); } diff --git a/platform/core-api/src/com/intellij/openapi/util/ActionCallback.java b/platform/core-api/src/com/intellij/openapi/util/ActionCallback.java index 85e2a57adca4..948d62495390 100644 --- a/platform/core-api/src/com/intellij/openapi/util/ActionCallback.java +++ b/platform/core-api/src/com/intellij/openapi/util/ActionCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -277,12 +277,12 @@ public class ActionCallback implements Disposable { }; } - @SuppressWarnings("UnusedDeclaration") - @NotNull - @Deprecated /** * @deprecated use {@link #notifyWhenRejected(ActionCallback)} */ + @SuppressWarnings("UnusedDeclaration") + @NotNull + @Deprecated public Runnable createSetRejectedRunnable() { return new Runnable() { @Override diff --git a/platform/core-api/src/com/intellij/openapi/util/AsyncResult.java b/platform/core-api/src/com/intellij/openapi/util/AsyncResult.java index 8c7a536b541f..0ba40aab1c69 100644 --- a/platform/core-api/src/com/intellij/openapi/util/AsyncResult.java +++ b/platform/core-api/src/com/intellij/openapi/util/AsyncResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -65,23 +65,23 @@ public class AsyncResult extends ActionCallback { return subResult; } - @SuppressWarnings("unused") - @NotNull - @Deprecated /** * @deprecated Don't use AsyncResult - use Promise instead. */ + @SuppressWarnings("unused") + @NotNull + @Deprecated public ActionCallback subCallback(@NotNull Consumer doneHandler) { ActionCallback subCallback = new ActionCallback(); doWhenDone(new SubCallbackDoneCallback(subCallback, doneHandler)).notifyWhenRejected(subCallback); return subCallback; } - @NotNull - @Deprecated /** * @deprecated Use {@link #doWhenDone(com.intellij.util.Consumer)} (to remove in IDEA 16) */ + @NotNull + @Deprecated public AsyncResult doWhenDone(@SuppressWarnings("deprecation") @NotNull final Handler handler) { doWhenDone(new Runnable() { @Override @@ -147,28 +147,28 @@ public class AsyncResult extends ActionCallback { return this; } - @Deprecated /** * @deprecated Use {@link com.intellij.util.Consumer} (to remove in IDEA 16) */ + @Deprecated public interface Handler { void run(T t); } - @Deprecated /** * @deprecated Don't use AsyncResult - use Promise instead. */ + @Deprecated public static class Done extends AsyncResult { public Done(T value) { setDone(value); } } - @Deprecated /** * @deprecated Don't use AsyncResult - use Promise instead. */ + @Deprecated public static class Rejected extends AsyncResult { public Rejected() { setRejected(); @@ -179,21 +179,21 @@ public class AsyncResult extends ActionCallback { } } - @NotNull - @Deprecated /** * @deprecated Don't use AsyncResult - use Promise instead. */ + @NotNull + @Deprecated public static AsyncResult rejected() { //noinspection unchecked,deprecation return new Rejected(); } - @NotNull - @Deprecated /** * @deprecated Don't use AsyncResult - use Promise instead. */ + @NotNull + @Deprecated public static AsyncResult rejected(@NotNull String errorMessage) { AsyncResult result = new AsyncResult(); result.reject(errorMessage); @@ -205,11 +205,11 @@ public class AsyncResult extends ActionCallback { return new AsyncResult().setDone(result); } - @NotNull - @Deprecated /** * @deprecated Don't use AsyncResult - use Promise instead. */ + @NotNull + @Deprecated public static AsyncResult doneList() { //noinspection unchecked return done((R)Collections.emptyList()); diff --git a/platform/core-api/src/com/intellij/psi/PsiTreeChangeEvent.java b/platform/core-api/src/com/intellij/psi/PsiTreeChangeEvent.java index b3c3de7d7a66..8f5946a42bc2 100644 --- a/platform/core-api/src/com/intellij/psi/PsiTreeChangeEvent.java +++ b/platform/core-api/src/com/intellij/psi/PsiTreeChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -34,10 +34,10 @@ public abstract class PsiTreeChangeEvent extends EventObject { @NonNls public static final String PROP_FILE_TYPES = "propFileTypes"; - @NonNls /** * In the event with this property the {@link #getOldValue()} contains virtual file of the change */ + @NonNls public static final String PROP_UNLOADED_PSI = "propUnloadedPsi"; protected PsiElement myParent; diff --git a/platform/core-impl/src/com/intellij/lang/impl/PsiBuilderImpl.java b/platform/core-impl/src/com/intellij/lang/impl/PsiBuilderImpl.java index 06a09d0b9d14..7c9f0874a347 100644 --- a/platform/core-impl/src/com/intellij/lang/impl/PsiBuilderImpl.java +++ b/platform/core-impl/src/com/intellij/lang/impl/PsiBuilderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -1766,8 +1766,8 @@ public class PsiBuilderImpl extends UserDataHolderBase implements PsiBuilder { boolean forceInsertion) { final int start = builder.myLexStarts[startLexemeIndex]; final int end = builder.myLexStarts[endLexemeIndex]; - /** Corresponding code for heavy tree is located in {@link com.intellij.lang.impl.PsiBuilderImpl#insertLeaves} - * and is applied only to plain lexemes */ + /* Corresponding code for heavy tree is located in {@link com.intellij.lang.impl.PsiBuilderImpl#insertLeaves} + and is applied only to plain lexemes */ if (start > end || !forceInsertion && start == end && !(type instanceof ILeafElementType)) { return; } diff --git a/platform/editor-ui-api/src/com/intellij/ide/ui/UISettingsListener.java b/platform/editor-ui-api/src/com/intellij/ide/ui/UISettingsListener.java index 1dcce2c076a3..56738a1e0286 100644 --- a/platform/editor-ui-api/src/com/intellij/ide/ui/UISettingsListener.java +++ b/platform/editor-ui-api/src/com/intellij/ide/ui/UISettingsListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Vladimir Kondratyev - */ package com.intellij.ide.ui; import com.intellij.util.messages.Topic; diff --git a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java index f2922966eba2..96a8a845f94a 100644 --- a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java +++ b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Yura Cangea - */ package com.intellij.openapi.editor.colors.impl; import com.intellij.application.options.EditorFontsConstants; diff --git a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java index 0673b97dddad..9f420552cbb2 100644 --- a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java +++ b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Yura Cangea - */ package com.intellij.openapi.editor.colors.impl; import com.intellij.openapi.editor.colors.ColorKey; diff --git a/platform/indexing-api/src/com/intellij/psi/search/SearchRequestCollector.java b/platform/indexing-api/src/com/intellij/psi/search/SearchRequestCollector.java index fef43be72ba5..8cd180e967c3 100644 --- a/platform/indexing-api/src/com/intellij/psi/search/SearchRequestCollector.java +++ b/platform/indexing-api/src/com/intellij/psi/search/SearchRequestCollector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -102,10 +102,10 @@ public class SearchRequestCollector { return refElement.getParent(); } - @Deprecated /** use {@link #searchWord(java.lang.String, com.intellij.psi.search.SearchScope, short, boolean, com.intellij.psi.PsiElement)} * instead */ + @Deprecated public void searchWord(@NotNull String word, @NotNull SearchScope searchScope, short searchContext, diff --git a/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java b/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java index 3c59227eb85a..22c17726ef7f 100644 --- a/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java +++ b/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -50,11 +50,11 @@ public abstract class GenericProgramRunner exte return doExecute(environment.getProject(), state, environment.getContentToReuse(), environment); } - @Deprecated - @Nullable /** * @deprecated to remove in IDEA 16 */ + @Deprecated + @Nullable protected RunContentDescriptor doExecute(@NotNull Project project, @NotNull RunProfileState state, @Nullable RunContentDescriptor contentToReuse, diff --git a/platform/lang-api/src/com/intellij/facet/FacetTypeId.java b/platform/lang-api/src/com/intellij/facet/FacetTypeId.java index ab133bcba8d8..07996f5df030 100644 --- a/platform/lang-api/src/com/intellij/facet/FacetTypeId.java +++ b/platform/lang-api/src/com/intellij/facet/FacetTypeId.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -24,10 +24,10 @@ import org.jetbrains.annotations.NonNls; public final class FacetTypeId { private final String myDebugName; - @Deprecated /** * @deprecated use {@link FacetTypeId#FacetTypeId(String)} instead */ + @Deprecated public FacetTypeId() { this("unknown"); } diff --git a/platform/lang-api/src/com/intellij/ide/util/frameworkSupport/FrameworkRole.java b/platform/lang-api/src/com/intellij/ide/util/frameworkSupport/FrameworkRole.java index 2331b27c9cae..0e22f8e082e7 100644 --- a/platform/lang-api/src/com/intellij/ide/util/frameworkSupport/FrameworkRole.java +++ b/platform/lang-api/src/com/intellij/ide/util/frameworkSupport/FrameworkRole.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -25,7 +25,7 @@ public class FrameworkRole { public static FrameworkRole[] UNKNOWN = new FrameworkRole[0]; - /** Groovy etc. */ + /* Groovy etc. */ // public static FrameworkRole JVM_LANGUAGES = new FrameworkRole(); /** servlet-based frameworks like Struts, Tapestry etc. */ diff --git a/platform/lang-api/src/com/intellij/openapi/module/ModuleUtil.java b/platform/lang-api/src/com/intellij/openapi/module/ModuleUtil.java index 54a87b825afe..e6eacfe84d4d 100644 --- a/platform/lang-api/src/com/intellij/openapi/module/ModuleUtil.java +++ b/platform/lang-api/src/com/intellij/openapi/module/ModuleUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.openapi.module; import com.intellij.openapi.project.Project; diff --git a/platform/lang-api/src/com/intellij/openapi/project/ProjectUtil.java b/platform/lang-api/src/com/intellij/openapi/project/ProjectUtil.java index dcd0e8ae3513..0792a22f57df 100644 --- a/platform/lang-api/src/com/intellij/openapi/project/ProjectUtil.java +++ b/platform/lang-api/src/com/intellij/openapi/project/ProjectUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -88,10 +88,10 @@ public class ProjectUtil { return guessProjectForContentFile(file, file.getFileType()); } - @Nullable /*** * guessProjectForFile works incorrectly - even if file is config (idea config file) first opened project will be returned */ + @Nullable public static Project guessProjectForContentFile(@NotNull VirtualFile file, @NotNull FileType fileType) { if (isProjectOrWorkspaceFile(file, fileType)) { return null; diff --git a/platform/lang-api/src/com/intellij/refactoring/rename/RenameInputValidatorRegistry.java b/platform/lang-api/src/com/intellij/refactoring/rename/RenameInputValidatorRegistry.java index 8320ce6dab3e..a03753d76590 100644 --- a/platform/lang-api/src/com/intellij/refactoring/rename/RenameInputValidatorRegistry.java +++ b/platform/lang-api/src/com/intellij/refactoring/rename/RenameInputValidatorRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Dmitry Avdeev - */ package com.intellij.refactoring.rename; import com.intellij.openapi.extensions.Extensions; @@ -27,9 +24,6 @@ import com.intellij.util.ProcessingContext; import com.intellij.util.containers.hash.LinkedHashMap; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; -import java.util.List; - public class RenameInputValidatorRegistry { private RenameInputValidatorRegistry() { } diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/ClickNavigator.java b/platform/lang-impl/src/com/intellij/application/options/colors/ClickNavigator.java index be76c42b985c..043aa0fd9bca 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/ClickNavigator.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/ClickNavigator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Yura Cangea - */ package com.intellij.application.options.colors; import com.intellij.application.options.colors.highlighting.HighlightData; diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/TailPanel.java b/platform/lang-impl/src/com/intellij/application/options/colors/TailPanel.java index dace582b3ef9..6475ea3d32ee 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/TailPanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/TailPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.application.options.colors; import javax.swing.*; diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/TextAttributesDescription.java b/platform/lang-impl/src/com/intellij/application/options/colors/TextAttributesDescription.java index 9d74f83dbbc8..85ca6d564168 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/TextAttributesDescription.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/TextAttributesDescription.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.application.options.colors; import com.intellij.openapi.editor.colors.EditorColorsScheme; diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/highlighting/HighlightData.java b/platform/lang-impl/src/com/intellij/application/options/colors/highlighting/HighlightData.java index dad941f9eeca..7d64bc12bd64 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/highlighting/HighlightData.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/highlighting/HighlightData.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Yura Cangea - */ package com.intellij.application.options.colors.highlighting; import com.intellij.openapi.editor.Editor; diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/highlighting/HighlightsExtractor.java b/platform/lang-impl/src/com/intellij/application/options/colors/highlighting/HighlightsExtractor.java index ee6325271b7f..0acca2686198 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/highlighting/HighlightsExtractor.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/highlighting/HighlightsExtractor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Yura Cangea - */ package com.intellij.application.options.colors.highlighting; import com.intellij.openapi.editor.colors.TextAttributesKey; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/HighlightInfoComposite.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/HighlightInfoComposite.java index 9e61d0708db1..864eaf1fec86 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/HighlightInfoComposite.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/HighlightInfoComposite.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.codeInsight.daemon.impl; import com.intellij.openapi.editor.RangeMarker; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/analysis/DefaultHighlightingSettingProvider.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/analysis/DefaultHighlightingSettingProvider.java index 1b0e6921c8b5..5b9275d4775b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/analysis/DefaultHighlightingSettingProvider.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/analysis/DefaultHighlightingSettingProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -22,10 +22,6 @@ import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -/** - * @author ksafonov - */ - /** * Implementation can provide default level of highlighting (one of "none", "syntax checks", "inspections") for a file. diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/AbstractExternalFilter.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/AbstractExternalFilter.java index c839358be3ae..b7b95c201f59 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/AbstractExternalFilter.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/AbstractExternalFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -440,15 +440,15 @@ public abstract class AbstractExternalFilter { * Settings used for parsing of external documentation */ protected static class ParseSettings { - @NotNull /** * Pattern defining the start of target fragment */ - private final Pattern startPattern; @NotNull + private final Pattern startPattern; /** * Pattern defining the end of target fragment */ + @NotNull private final Pattern endPattern; /** * If false, and line matching start pattern is not found, whole document will be processed diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/QuickDocOnMouseOverManager.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/QuickDocOnMouseOverManager.java index 593bc04f5813..cbd89ce27393 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/QuickDocOnMouseOverManager.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/QuickDocOnMouseOverManager.java @@ -64,7 +64,7 @@ public class QuickDocOnMouseOverManager { @NotNull private final Runnable myHintCloseCallback = new MyCloseDocCallback(); @NotNull private final Map myMonitoredDocuments = new WeakHashMap(); - private final Map /** PSI element which is located under the current mouse position */> myActiveElements + private final Map /* PSI element which is located under the current mouse position */> myActiveElements = new WeakHashMap<>(); /** Holds a reference (if any) to the documentation manager used last time to show an 'auto quick doc' popup. */ diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/MoveStatementHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/MoveStatementHandler.java index 73ddbaf5ae24..b438fa749aec 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/MoveStatementHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/MoveStatementHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.codeInsight.editorActions.moveUpDown; import com.intellij.openapi.editor.Editor; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java index 57100e14ebbe..8775a6b1c247 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -655,9 +655,9 @@ public class CommentByBlockCommentHandler extends MultiCaretCodeInsightActionHan if (commenter instanceof CustomUncommenter) { - /** - * In case of custom uncommenter, we need to ask it for list of [commentOpen-start,commentOpen-end], [commentClose-start,commentClose-end] - * and shift if according to current offset + /* + In case of custom uncommenter, we need to ask it for list of [commentOpen-start,commentOpen-end], [commentClose-start,commentClose-end] + and shift if according to current offset */ CustomUncommenter customUncommenter = (CustomUncommenter)commenter; for (Couple coupleFromCommenter : customUncommenter.getCommentRangesToDelete(text)) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HighlightUsagesHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HighlightUsagesHandler.java index f9fae6eb033b..e16bac126f08 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HighlightUsagesHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HighlightUsagesHandler.java @@ -411,12 +411,12 @@ public class HighlightUsagesHandler extends HighlightHandlerBase { highlightRanges(highlightManager, editor, attributes, clearHighlights, textRanges); } - @SuppressWarnings("unused") - @NotNull - @Deprecated /** * @deprecated Use {@link #collectRangesToHighlight} */ + @SuppressWarnings("unused") + @NotNull + @Deprecated public static List getRangesToHighlight(@NotNull PsiReference ref) { return collectRangesToHighlight(ref, new ArrayList()); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionActionMetaData.java b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionActionMetaData.java index 671c8f538c5f..2d2e23a8aeb1 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionActionMetaData.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionActionMetaData.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.codeInsight.intention.impl.config; import com.intellij.codeInsight.intention.IntentionAction; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionDescriptionPanel.java b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionDescriptionPanel.java index 0d57ba52c498..7de978eef4af 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionDescriptionPanel.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionDescriptionPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.codeInsight.intention.impl.config; import com.intellij.codeInsight.CodeInsightBundle; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionSettingsTree.java b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionSettingsTree.java index a252ebd52690..cec29cf56516 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionSettingsTree.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionSettingsTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.codeInsight.intention.impl.config; import com.intellij.codeInsight.intention.IntentionManager; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionUsagePanel.java b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionUsagePanel.java index 68c1a2547266..a99abb9d1842 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionUsagePanel.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionUsagePanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.codeInsight.intention.impl.config; class IntentionUsagePanel extends ActionUsagePanel { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TableMap.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TableMap.java index 4f4e2a986f5c..81861bdec639 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TableMap.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TableMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -16,16 +16,16 @@ package com.intellij.codeInsight.template.impl; -/** - * In a chain of data manipulators some behaviour is common. TableMap - * provides most of this behavour and can be subclassed by filters - * that only need to override a handful of specific methods. TableMap - * implements TableModel by routing all requests to its model, and - * TableModelListener by routing all events to its listeners. Inserting - * a TableMap which has not been subclassed into a chain of table filters - * should have no effect. - * - * @version 1.4 12/17/97 +/* + In a chain of data manipulators some behaviour is common. TableMap + provides most of this behavour and can be subclassed by filters + that only need to override a handful of specific methods. TableMap + implements TableModel by routing all requests to its model, and + TableModelListener by routing all events to its listeners. Inserting + a TableMap which has not been subclassed into a chain of table filters + should have no effect. + + @version 1.4 12/17/97 * @author Philip Milne */ import javax.swing.event.TableModelEvent; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/completion/PostfixTemplatesCompletionProvider.java b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/completion/PostfixTemplatesCompletionProvider.java index ee05406fbe6e..21e7c212a6a8 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/completion/PostfixTemplatesCompletionProvider.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/completion/PostfixTemplatesCompletionProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -37,8 +37,8 @@ class PostfixTemplatesCompletionProvider extends CompletionProvider { } } - @Deprecated /** * @deprecated Use {@link com.intellij.ide.util.PropertiesComponent} */ + @Deprecated public void setExtendedState(String key, int extendedState) { myKey2ExtendedState.put(key, extendedState); } - @Deprecated /** * @deprecated Use {@link com.intellij.ide.util.PropertiesComponent} */ + @Deprecated public int getExtendedState(String key) { if (!myKey2ExtendedState.containsKey(key)) return -1; return myKey2ExtendedState.get(key); diff --git a/platform/platform-api/src/com/intellij/ui/ColorChooser.java b/platform/platform-api/src/com/intellij/ui/ColorChooser.java index 9c566e820bb3..1c2c3bf7a1a3 100644 --- a/platform/platform-api/src/com/intellij/ui/ColorChooser.java +++ b/platform/platform-api/src/com/intellij/ui/ColorChooser.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -30,11 +30,11 @@ import java.util.List; * @author Konstantin Bulenkov */ public class ColorChooser { - @Nullable - @Deprecated /** * @deprecated Use {@link #chooseColor(Component, String, Color, boolean, java.util.List, boolean)} */ + @Nullable + @Deprecated public static Color chooseColor(Component parent, @Nls(capitalization = Nls.Capitalization.Title) String caption, @Nullable Color preselectedColor, diff --git a/platform/platform-api/src/com/intellij/ui/ColorChooserService.java b/platform/platform-api/src/com/intellij/ui/ColorChooserService.java index 9bb1273d1cc3..c81d808e7fb2 100644 --- a/platform/platform-api/src/com/intellij/ui/ColorChooserService.java +++ b/platform/platform-api/src/com/intellij/ui/ColorChooserService.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -30,19 +30,19 @@ public abstract class ColorChooserService { return ServiceManager.getService(ColorChooserService.class); } - @Nullable - @Deprecated /** * @deprecated Use {@link #showDialog(Component, String, Color, boolean, java.util.List, boolean)} */ + @Nullable + @Deprecated public abstract Color showDialog(Component parent, @Nls(capitalization = Nls.Capitalization.Title) String caption, Color preselectedColor, boolean enableOpacity, ColorPickerListener[] listeners); - @Nullable - @Deprecated /** * @deprecated Use {@link #showDialog(Component, String, Color, boolean, java.util.List, boolean)} */ + @Nullable + @Deprecated public abstract Color showDialog(Component parent, @Nls(capitalization = Nls.Capitalization.Title) String caption, Color preselectedColor, boolean enableOpacity, ColorPickerListener[] listeners, boolean opacityInPercent); diff --git a/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java b/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java index 1a99262a5fcf..ffff9c38e76e 100644 --- a/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java +++ b/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -221,11 +221,11 @@ public class SimpleColoredComponent extends JComponent implements Accessible, Co myFragmentTags.add(tag); } - @Deprecated /** * fragment width isn't a right name, it is actually a padding * @deprecated remove in IDEA 16 */ + @Deprecated public synchronized void appendFixedTextFragmentWidth(int width) { appendTextPadding(width); } diff --git a/platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java b/platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java index 50e261846b8b..6b7fe73d504a 100644 --- a/platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java +++ b/platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java @@ -679,10 +679,10 @@ public class Tree extends JTree implements ComponentWithEmptyText, ComponentWith e.consume(); } } - /** - * Returns true if mouseX falls - * in the area of row that is used to expand/collapse the node and - * the node at row does not represent a leaf. + /* + Returns true if mouseX falls + in the area of row that is used to expand/collapse the node and + the node at row does not represent a leaf. */ } diff --git a/platform/platform-api/src/com/intellij/util/config/Storage.java b/platform/platform-api/src/com/intellij/util/config/Storage.java index c83e54c1f2f4..51901bcf7c4a 100644 --- a/platform/platform-api/src/com/intellij/util/config/Storage.java +++ b/platform/platform-api/src/com/intellij/util/config/Storage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -24,11 +24,11 @@ import java.util.Collections; import java.util.Iterator; import java.util.Map; -@Deprecated /** * @deprecated Use {@link PropertiesComponent} directly. - * @see {@link JBSplitter} + * @see com.intellij.ui.JBSplitter */ +@Deprecated public interface Storage { void put(String key, String value); String get(String key); diff --git a/platform/platform-api/src/com/intellij/util/config/StorageAccessors.java b/platform/platform-api/src/com/intellij/util/config/StorageAccessors.java index 6f064a36ba78..d3839b69239e 100644 --- a/platform/platform-api/src/com/intellij/util/config/StorageAccessors.java +++ b/platform/platform-api/src/com/intellij/util/config/StorageAccessors.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -18,15 +18,16 @@ package com.intellij.util.config; import com.intellij.ide.util.PropertiesComponent; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; +import com.intellij.ui.JBSplitter; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; -@SuppressWarnings("unused") -@Deprecated /** * @deprecated Use {@link PropertiesComponent} directly. - * @see {@link JBSplitter} + * @see JBSplitter */ +@SuppressWarnings("unused") +@Deprecated public class StorageAccessors { private final Storage myStorage; diff --git a/platform/platform-impl/src/com/intellij/application/options/SaveSchemeDialog.java b/platform/platform-impl/src/com/intellij/application/options/SaveSchemeDialog.java index 966db2a3bdf7..1ac010575004 100644 --- a/platform/platform-impl/src/com/intellij/application/options/SaveSchemeDialog.java +++ b/platform/platform-impl/src/com/intellij/application/options/SaveSchemeDialog.java @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Yura Cangea - */ package com.intellij.application.options; import com.intellij.CommonBundle; diff --git a/platform/platform-impl/src/com/intellij/codeInsight/hint/TooltipGroup.java b/platform/platform-impl/src/com/intellij/codeInsight/hint/TooltipGroup.java index 50959ae6b20b..3af74d4202ba 100644 --- a/platform/platform-impl/src/com/intellij/codeInsight/hint/TooltipGroup.java +++ b/platform/platform-impl/src/com/intellij/codeInsight/hint/TooltipGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.codeInsight.hint; import org.jetbrains.annotations.NonNls; diff --git a/platform/platform-impl/src/com/intellij/execution/DelayedDocumentWatcher.java b/platform/platform-impl/src/com/intellij/execution/DelayedDocumentWatcher.java index 787d60fbdaeb..3eb4730d0308 100644 --- a/platform/platform-impl/src/com/intellij/execution/DelayedDocumentWatcher.java +++ b/platform/platform-impl/src/com/intellij/execution/DelayedDocumentWatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -117,9 +117,9 @@ public class DelayedDocumentWatcher { @Override public void documentChanged(DocumentEvent event) { if (myDocumentSavingInProgress) { - /** When {@link FileDocumentManager#saveAllDocuments} is called, - * {@link com.intellij.openapi.editor.impl.TrailingSpacesStripper} can change a document. - * These needless 'documentChanged' events should be filtered out. + /* When {@link FileDocumentManager#saveAllDocuments} is called, + {@link com.intellij.openapi.editor.impl.TrailingSpacesStripper} can change a document. + These needless 'documentChanged' events should be filtered out. */ return; } diff --git a/platform/platform-impl/src/com/intellij/execution/process/OSProcessUtil.java b/platform/platform-impl/src/com/intellij/execution/process/OSProcessUtil.java index 75c9dc9f365e..1ab41a7fa0e6 100644 --- a/platform/platform-impl/src/com/intellij/execution/process/OSProcessUtil.java +++ b/platform/platform-impl/src/com/intellij/execution/process/OSProcessUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -14,17 +14,6 @@ * limitations under the License. */ -/****************************************************************************** - * Copyright (C) 2013 Fabio Zadrozny - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Fabio Zadrozny - initial API and implementation - ******************************************************************************/ package com.intellij.execution.process; import com.intellij.execution.process.impl.ProcessListUtil; @@ -38,6 +27,17 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +/****************************************************************************** + * Copyright (C) 2013 Fabio Zadrozny + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Fabio Zadrozny - initial API and implementation + ******************************************************************************/ public class OSProcessUtil { private static final Logger LOG = Logger.getInstance(OSProcessUtil.class); diff --git a/platform/platform-impl/src/com/intellij/ide/actions/RunGcAction.java b/platform/platform-impl/src/com/intellij/ide/actions/RunGcAction.java index d726cba544aa..50ae53f42ad8 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/RunGcAction.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/RunGcAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Vladimir Kondratyev - */ package com.intellij.ide.actions; import com.intellij.openapi.actionSystem.AnAction; diff --git a/platform/platform-impl/src/com/intellij/ide/actions/ToggleReadOnlyAttributeAction.java b/platform/platform-impl/src/com/intellij/ide/actions/ToggleReadOnlyAttributeAction.java index a09bc3ff0749..ca6d17ced163 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/ToggleReadOnlyAttributeAction.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/ToggleReadOnlyAttributeAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Vladimir Kondratyev - */ package com.intellij.ide.actions; import com.intellij.CommonBundle; diff --git a/platform/platform-impl/src/com/intellij/ide/actions/ViewStatusBarAction.java b/platform/platform-impl/src/com/intellij/ide/actions/ViewStatusBarAction.java index 76e6ad8a3b60..82c4853d4cc3 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/ViewStatusBarAction.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/ViewStatusBarAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Vladimir Kondratyev - */ package com.intellij.ide.actions; import com.intellij.ide.ui.UISettings; diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/config/PasswordSafeSettings.java b/platform/platform-impl/src/com/intellij/ide/passwordSafe/config/PasswordSafeSettings.java index 9ab8f7f3c70f..669b99de4955 100644 --- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/config/PasswordSafeSettings.java +++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/config/PasswordSafeSettings.java @@ -22,8 +22,6 @@ import com.intellij.openapi.components.Storage; /** * The password safe settings - */ -/** * The password database. The internal component for {@link com.intellij.ide.passwordSafe.impl.providers.masterKey.MasterKeyPasswordSafe}. */ @State( diff --git a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/IProjectStore.java b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/IProjectStore.java index 49d5795a1828..4c6c02b83651 100644 --- a/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/IProjectStore.java +++ b/platform/platform-impl/src/com/intellij/openapi/components/impl/stores/IProjectStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -21,10 +21,10 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public interface IProjectStore extends IComponentStore { - @Nullable /** * System-independent path. */ + @Nullable String getProjectBasePath(); @NotNull @@ -33,16 +33,16 @@ public interface IProjectStore extends IComponentStore { @NotNull StorageScheme getStorageScheme(); - @NotNull /** * System-independent path. */ + @NotNull String getProjectFilePath(); - @Nullable /** * System-independent path. */ + @Nullable String getWorkspaceFilePath(); void loadProjectFromTemplate(@NotNull Project project); diff --git a/platform/platform-impl/src/com/intellij/openapi/fileChooser/impl/FileComparator.java b/platform/platform-impl/src/com/intellij/openapi/fileChooser/impl/FileComparator.java index a78b783e0366..96f2415d9ffa 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileChooser/impl/FileComparator.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileChooser/impl/FileComparator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,14 +14,11 @@ * limitations under the License. */ -/** - * @author Yura Cangea - */ package com.intellij.openapi.fileChooser.impl; +import com.intellij.ide.util.treeView.NodeDescriptor; import com.intellij.openapi.fileChooser.ex.FileNodeDescriptor; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.ide.util.treeView.NodeDescriptor; import java.util.Comparator; diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileEditorManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileEditorManagerImpl.java index d85e45404fa0..cc69e40fbdd0 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileEditorManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileEditorManagerImpl.java @@ -1510,8 +1510,8 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Persis final FileStatusManager fileStatusManager = FileStatusManager.getInstance(myProject); if (fileStatusManager != null) { - /** - * Updates tabs colors + /* + Updates tabs colors */ final MyFileStatusListener myFileStatusListener = new MyFileStatusListener(); fileStatusManager.addFileStatusListener(myFileStatusListener, myProject); @@ -1519,13 +1519,13 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Persis connection.subscribe(FileTypeManager.TOPIC, new MyFileTypeListener()); connection.subscribe(ProjectTopics.PROJECT_ROOTS, new MyRootsListener()); - /** - * Updates tabs names + /* + Updates tabs names */ final MyVirtualFileListener myVirtualFileListener = new MyVirtualFileListener(); VirtualFileManager.getInstance().addVirtualFileListener(myVirtualFileListener, myProject); - /** - * Extends/cuts number of opened tabs. Also updates location of tabs. + /* + Extends/cuts number of opened tabs. Also updates location of tabs. */ final MyUISettingsListener myUISettingsListener = new MyUISettingsListener(); UISettings.getInstance().addUISettingsListener(myUISettingsListener, myProject); diff --git a/platform/platform-impl/src/com/intellij/openapi/project/ex/ProjectManagerEx.java b/platform/platform-impl/src/com/intellij/openapi/project/ex/ProjectManagerEx.java index ed44bae8514c..b341b77568ad 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/ex/ProjectManagerEx.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/ex/ProjectManagerEx.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -54,12 +54,12 @@ public abstract class ProjectManagerEx extends ProjectManager { @TestOnly public abstract void openTestProject(@NotNull Project project); - @TestOnly - @NotNull /** * Without save and "check can close". * Returns remaining open test projects. */ + @TestOnly + @NotNull public abstract Collection closeTestProject(@NotNull Project project); // returns true on success diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/ex/IdeFocusTraversalPolicy.java b/platform/platform-impl/src/com/intellij/openapi/wm/ex/IdeFocusTraversalPolicy.java index 2ecb28327857..b5764e05d603 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/ex/IdeFocusTraversalPolicy.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/ex/IdeFocusTraversalPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -116,7 +116,7 @@ public class IdeFocusTraversalPolicy extends LayoutFocusTraversalPolicyExt { return false; } - /** TODO[anton,vova] implement Policy in Editor component instead */ + /* TODO[anton,vova] implement Policy in Editor component instead */ if (component instanceof EditorComponentImpl || component instanceof EditorWindowHolder) { return true; } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/ex/ToolWindowManagerAdapter.java b/platform/platform-impl/src/com/intellij/openapi/wm/ex/ToolWindowManagerAdapter.java index b7a11a17c76e..d277d0e6520d 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/ex/ToolWindowManagerAdapter.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/ex/ToolWindowManagerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Vladimir Kondratyev - */ package com.intellij.openapi.wm.ex; import org.jetbrains.annotations.NotNull; diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/StripeButtonUI.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/StripeButtonUI.java index 5c56758aae26..2c8022e7b864 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/StripeButtonUI.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/StripeButtonUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -160,11 +160,11 @@ public final class StripeButtonUI extends MetalToggleButtonUI{ } /* Draw the Text */ if(model.isEnabled()){ - /*** paint the text normally */ + /* paint the text normally */ g2.setColor(UIUtil.isUnderDarcula() && model.isSelected() ? button.getForeground().brighter() : button.getForeground()); BasicGraphicsUtils.drawString(g2,clippedText,button.getMnemonic2(),ourTextRect.x,ourTextRect.y+fm.getAscent()); } else{ - /*** paint the text disabled ***/ + /* paint the text disabled ***/ if(model.isSelected()){ g2.setColor(c.getBackground()); } else{ diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/commands/ApplyWindowInfoCmd.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/commands/ApplyWindowInfoCmd.java index 27c4df1a8fb9..49dcba6dd63c 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/commands/ApplyWindowInfoCmd.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/commands/ApplyWindowInfoCmd.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Vladimir Kondratyev - */ package com.intellij.openapi.wm.impl.commands; import com.intellij.openapi.wm.impl.InternalDecorator; diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/commands/RequestFocusInEditorComponentCmd.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/commands/RequestFocusInEditorComponentCmd.java index f9685ad1666c..3cb5c702b751 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/commands/RequestFocusInEditorComponentCmd.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/commands/RequestFocusInEditorComponentCmd.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author Vladimir Kondratyev - */ package com.intellij.openapi.wm.impl.commands; import com.intellij.openapi.diagnostic.Logger; diff --git a/platform/platform-impl/src/com/intellij/remote/VagrantBasedCredentialsHolder.java b/platform/platform-impl/src/com/intellij/remote/VagrantBasedCredentialsHolder.java index 1eabdc20b34c..ed605b396812 100644 --- a/platform/platform-impl/src/com/intellij/remote/VagrantBasedCredentialsHolder.java +++ b/platform/platform-impl/src/com/intellij/remote/VagrantBasedCredentialsHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -35,10 +35,10 @@ public class VagrantBasedCredentialsHolder { myVagrantFolder = ""; } - @Deprecated /** * @deprecated use constructor supporting multiple machines configuration */ + @Deprecated public VagrantBasedCredentialsHolder(@NotNull String folder) { myVagrantFolder = folder; } diff --git a/platform/platform-impl/src/com/intellij/util/Urls.java b/platform/platform-impl/src/com/intellij/util/Urls.java index 5ae9a7c7117c..2ed214f6114f 100644 --- a/platform/platform-impl/src/com/intellij/util/Urls.java +++ b/platform/platform-impl/src/com/intellij/util/Urls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -77,10 +77,10 @@ public final class Urls { return new UrlImpl(scheme, authority, path); } - @NotNull /** * Url will not be normalized (see {@link VfsUtilCore#toIdeaUrl(String)}), parsed as is */ + @NotNull public static Url newFromIdea(@NotNull CharSequence url) { Url result = parseFromIdea(url); LOG.assertTrue(result != null, url); diff --git a/platform/platform-impl/src/com/intellij/util/ui/CollectionItemEditor.java b/platform/platform-impl/src/com/intellij/util/ui/CollectionItemEditor.java index bf6f91ac5871..c5729a46c2ba 100644 --- a/platform/platform-impl/src/com/intellij/util/ui/CollectionItemEditor.java +++ b/platform/platform-impl/src/com/intellij/util/ui/CollectionItemEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -18,10 +18,10 @@ package com.intellij.util.ui; import org.jetbrains.annotations.NotNull; public abstract class CollectionItemEditor { - @NotNull /** * Class must have an empty constructor. */ + @NotNull public abstract Class getItemClass(); /** diff --git a/platform/platform-impl/src/com/intellij/util/ui/CollectionModelEditor.java b/platform/platform-impl/src/com/intellij/util/ui/CollectionModelEditor.java index f1dd95078ec2..f906a2ba7ad3 100644 --- a/platform/platform-impl/src/com/intellij/util/ui/CollectionModelEditor.java +++ b/platform/platform-impl/src/com/intellij/util/ui/CollectionModelEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -48,10 +48,10 @@ public abstract class CollectionModelEditor return true; } - @NotNull /** * Mutable internal list of items (must not be exposed to client) */ + @NotNull protected abstract List getItems(); public void reset(@NotNull List originalItems) { diff --git a/platform/platform-impl/src/org/jetbrains/io/LocalFileFinder.java b/platform/platform-impl/src/org/jetbrains/io/LocalFileFinder.java index 2cd8fb403b67..4bf5182c8f8e 100644 --- a/platform/platform-impl/src/org/jetbrains/io/LocalFileFinder.java +++ b/platform/platform-impl/src/org/jetbrains/io/LocalFileFinder.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.jetbrains.io; import com.google.common.cache.Cache; @@ -20,13 +35,13 @@ public final class LocalFileFinder { private LocalFileFinder() { } - @Nullable /** Behavior is not predictable and result is not guaranteed: 1) result of check cached, but cache entry invalidated on timeout (5 min after write), not on actual change of drive status. 2) even if drive exists, it could be not used due to 10 ms threshold. Method is not generic and is not suitable for all. */ + @Nullable public static VirtualFile findFile(@NotNull String path) { if (windowsDriveExists(path)) { return LocalFileSystem.getInstance().findFileByPath(path); diff --git a/platform/projectModel-api/src/com/intellij/openapi/components/Storage.java b/platform/projectModel-api/src/com/intellij/openapi/components/Storage.java index 0b3921147bf6..a1f9f5d492e4 100644 --- a/platform/projectModel-api/src/com/intellij/openapi/components/Storage.java +++ b/platform/projectModel-api/src/com/intellij/openapi/components/Storage.java @@ -25,10 +25,10 @@ import java.lang.annotation.RetentionPolicy; */ @Retention(RetentionPolicy.RUNTIME) public @interface Storage { - @Deprecated /** * @deprecated Use {@link #value()}. */ + @Deprecated String file() default ""; /** @@ -58,15 +58,15 @@ public @interface Storage { @SuppressWarnings("deprecation") Class stateSplitter() default StateSplitterEx.class; - @Deprecated /** * @deprecated Not required and not used anymore. */ + @Deprecated StorageScheme scheme() default StorageScheme.DEFAULT; - @Deprecated /** * @deprecated Not required and not used anymore. */ + @Deprecated String id() default "default"; } \ No newline at end of file diff --git a/platform/projectModel-api/src/com/intellij/openapi/components/StoragePathMacros.java b/platform/projectModel-api/src/com/intellij/openapi/components/StoragePathMacros.java index 6ffb44e8ef17..bcc771c4ac78 100644 --- a/platform/projectModel-api/src/com/intellij/openapi/components/StoragePathMacros.java +++ b/platform/projectModel-api/src/com/intellij/openapi/components/StoragePathMacros.java @@ -37,25 +37,23 @@ public class StoragePathMacros { /** * Points to the application-level options root directory. + * @deprecated Not required anymore. See {@link State#storages()}. */ @SuppressWarnings("unused") @Deprecated - /** - * @deprecated Not required anymore. See {@link State#storages()}. - */ public static final String APP_CONFIG = "$APP_CONFIG$"; - @Deprecated /** * @deprecated Not required anymore. See {@link State#storages()}. */ + @Deprecated public static final String PROJECT_FILE = "$PROJECT_FILE$"; - @SuppressWarnings("unused") - @Deprecated /** * @deprecated Not required anymore. See {@link State#storages()}. */ + @SuppressWarnings("unused") + @Deprecated public static final String PROJECT_CONFIG_DIR = "$PROJECT_CONFIG_DIR$"; /** diff --git a/platform/projectModel-api/src/com/intellij/openapi/roots/libraries/LibraryUtil.java b/platform/projectModel-api/src/com/intellij/openapi/roots/libraries/LibraryUtil.java index 3025b80ee53d..3dd21fe8ee95 100644 --- a/platform/projectModel-api/src/com/intellij/openapi/roots/libraries/LibraryUtil.java +++ b/platform/projectModel-api/src/com/intellij/openapi/roots/libraries/LibraryUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -14,9 +14,6 @@ * limitations under the License. */ -/** - * @author cdr - */ package com.intellij.openapi.roots.libraries; import com.intellij.openapi.module.Module; diff --git a/platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/annotation/FinalCall.java b/platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/annotation/FinalCall.java index 5b77d5476eee..1a8407ce4255 100644 --- a/platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/annotation/FinalCall.java +++ b/platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/annotation/FinalCall.java @@ -1,8 +1,19 @@ -package com.intellij.remoteServer.agent.annotation; - -/** - * @author michael.golubev +/* + * 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. */ +package com.intellij.remoteServer.agent.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/Scope.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/Scope.java index d380b07e5002..2e5182186a01 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/Scope.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/Scope.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -36,10 +36,10 @@ public interface Scope { @NotNull Type getType(); - @Nullable /** * Class or function or file name */ + @Nullable String getDescription(); @NotNull diff --git a/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java b/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java index 5d058fb4ea2b..683566f85eb1 100644 --- a/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java @@ -647,9 +647,6 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest /** * file parameterized tests support * @see FileBasedTestCaseHelperEx - */ - - /** * @Parameterized.Parameter fields are injected on parameterized test creation. */ @Parameterized.Parameter(0) diff --git a/platform/util/src/com/intellij/openapi/util/IconLoader.java b/platform/util/src/com/intellij/openapi/util/IconLoader.java index 31c747b25f1d..91d673143021 100644 --- a/platform/util/src/com/intellij/openapi/util/IconLoader.java +++ b/platform/util/src/com/intellij/openapi/util/IconLoader.java @@ -141,11 +141,11 @@ public final class IconLoader { } } - @Nullable /** * Might return null if icon was not found. * Use only if you expected null return value, otherwise see {@link IconLoader#getIcon(String)} */ + @Nullable public static Icon findIcon(@NonNls @NotNull String path) { Class callerClass = ReflectionUtil.getGrandCallerClass(); if (callerClass == null) return null; diff --git a/platform/util/src/com/intellij/openapi/util/JDOMUtil.java b/platform/util/src/com/intellij/openapi/util/JDOMUtil.java index 109de0f62532..333204366ea0 100644 --- a/platform/util/src/com/intellij/openapi/util/JDOMUtil.java +++ b/platform/util/src/com/intellij/openapi/util/JDOMUtil.java @@ -334,10 +334,10 @@ public class JDOMUtil { return loadDocument(new InputStreamReader(stream, CharsetToolkit.UTF8_CHARSET)); } - @Contract("null -> null; !null -> !null") /** * @deprecated Use com.intellij.util.loadElement */ + @Contract("null -> null; !null -> !null") public static Element load(Reader reader) throws JDOMException, IOException { return reader == null ? null : loadDocument(reader).detachRootElement(); } diff --git a/platform/util/src/com/intellij/util/ConcurrencyUtil.java b/platform/util/src/com/intellij/util/ConcurrencyUtil.java index 606cbf229847..37b44edf3914 100644 --- a/platform/util/src/com/intellij/util/ConcurrencyUtil.java +++ b/platform/util/src/com/intellij/util/ConcurrencyUtil.java @@ -137,10 +137,10 @@ public class ConcurrencyUtil { }; } - @TestOnly /** * Awaits for all tasks in the {@code executor} to finish for the specified {@code timeout} */ + @TestOnly public static void awaitQuiescence(@NotNull ThreadPoolExecutor executor, long timeout, @NotNull TimeUnit unit) { executor.setKeepAliveTime(1, TimeUnit.NANOSECONDS); // no need for zombies in tests executor.setCorePoolSize(0); // interrupt idle workers diff --git a/platform/util/src/com/intellij/util/UniqueFileNamesProvider.java b/platform/util/src/com/intellij/util/UniqueFileNamesProvider.java index 2774661843a2..b6390688a4fa 100644 --- a/platform/util/src/com/intellij/util/UniqueFileNamesProvider.java +++ b/platform/util/src/com/intellij/util/UniqueFileNamesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -20,11 +20,11 @@ import com.intellij.openapi.util.io.FileUtil; import java.util.ArrayList; import java.util.List; -@SuppressWarnings("unused") -@Deprecated /** * Use {@link com.intellij.util.text.UniqueNameGenerator} */ +@SuppressWarnings("unused") +@Deprecated public class UniqueFileNamesProvider { private final List myExistingNames; diff --git a/platform/util/src/com/intellij/util/concurrency/AppDelayQueue.java b/platform/util/src/com/intellij/util/concurrency/AppDelayQueue.java index 147161245a4c..8ac0dc9aab1a 100644 --- a/platform/util/src/com/intellij/util/concurrency/AppDelayQueue.java +++ b/platform/util/src/com/intellij/util/concurrency/AppDelayQueue.java @@ -33,7 +33,7 @@ class AppDelayQueue extends DelayQueue private final AtomicBoolean shutdown = new AtomicBoolean(); AppDelayQueue() { - /** this thread takes the ready-to-execute scheduled tasks off the queue and passes them for immediate execution to {@link SchedulingWrapper#backendExecutorService} */ + /* this thread takes the ready-to-execute scheduled tasks off the queue and passes them for immediate execution to {@link SchedulingWrapper#backendExecutorService} */ scheduledToPooledTransferer = new Thread(new Runnable() { @Override public void run() { diff --git a/platform/util/src/com/intellij/util/containers/LongStack.java b/platform/util/src/com/intellij/util/containers/LongStack.java index f562d4f56ae3..5b78d626c843 100644 --- a/platform/util/src/com/intellij/util/containers/LongStack.java +++ b/platform/util/src/com/intellij/util/containers/LongStack.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -15,9 +15,6 @@ */ package com.intellij.util.containers; -/** - * @author lambdamix - */ import com.intellij.util.ArrayUtil; import java.util.Arrays; diff --git a/platform/util/src/com/intellij/util/containers/MultiMap.java b/platform/util/src/com/intellij/util/containers/MultiMap.java index 712607b74f49..98d115cf8438 100644 --- a/platform/util/src/com/intellij/util/containers/MultiMap.java +++ b/platform/util/src/com/intellij/util/containers/MultiMap.java @@ -300,12 +300,12 @@ public class MultiMap implements Serializable { }; } - @Deprecated - @SuppressWarnings("unused") - @NotNull /** * @deprecated Use {@link #createSmart()} */ + @Deprecated + @SuppressWarnings("unused") + @NotNull public static MultiMap createSmartList() { return createSmart(); } diff --git a/platform/util/src/com/intellij/util/io/EqualityPolicy.java b/platform/util/src/com/intellij/util/io/EqualityPolicy.java index e1396cdc99e0..f565ee57d18b 100644 --- a/platform/util/src/com/intellij/util/io/EqualityPolicy.java +++ b/platform/util/src/com/intellij/util/io/EqualityPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -16,9 +16,9 @@ package com.intellij.util.io; -@Deprecated /** * Use {@link com.intellij.util.containers.hash.EqualityPolicy} directly */ +@Deprecated public interface EqualityPolicy extends com.intellij.util.containers.hash.EqualityPolicy{ } diff --git a/platform/util/src/com/intellij/util/ui/ColumnInfo.java b/platform/util/src/com/intellij/util/ui/ColumnInfo.java index 1be6e451deea..77781d23206d 100644 --- a/platform/util/src/com/intellij/util/ui/ColumnInfo.java +++ b/platform/util/src/com/intellij/util/ui/ColumnInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -67,11 +67,11 @@ public abstract class ColumnInfo { } - @Nullable /** * @see com.intellij.util.ui.table.IconTableCellRenderer * @see com.intellij.util.ui.LocalPathCellEditor */ + @Nullable public TableCellRenderer getRenderer(Item item) { return null; } @@ -80,10 +80,10 @@ public abstract class ColumnInfo { return renderer; } - @Nullable /** * @see com.intellij.util.ui.table.ComboBoxTableCellEditor */ + @Nullable public TableCellEditor getEditor(Item item) { return null; } diff --git a/platform/util/src/com/intellij/util/ui/ComboBoxTableCellEditor.java b/platform/util/src/com/intellij/util/ui/ComboBoxTableCellEditor.java index 79ae369b6a0c..b2ba22d192ab 100644 --- a/platform/util/src/com/intellij/util/ui/ComboBoxTableCellEditor.java +++ b/platform/util/src/com/intellij/util/ui/ComboBoxTableCellEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -23,10 +23,10 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -@Deprecated /** * @deprecated Please use {@link com.intellij.util.ui.table.ComboBoxTableCellEditor} */ +@Deprecated public class ComboBoxTableCellEditor extends AbstractTableCellEditor { public static final ComboBoxTableCellEditor INSTANCE = new ComboBoxTableCellEditor(); diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java index fe47fb4b25df..9207aee6ab13 100644 --- a/platform/util/src/com/intellij/util/ui/UIUtil.java +++ b/platform/util/src/com/intellij/util/ui/UIUtil.java @@ -354,9 +354,9 @@ public class UIUtil { return isRetina; } - /** - * Could be quite easily implemented with [NSScreen backingScaleFactor] - * and JNA + /* + Could be quite easily implemented with [NSScreen backingScaleFactor] + and JNA */ //private static boolean isAppleRetina (Graphics2D g2d) { // return false; diff --git a/platform/util/src/com/intellij/util/xmlb/annotations/CollectionBean.java b/platform/util/src/com/intellij/util/xmlb/annotations/CollectionBean.java index da60e05b4ef4..003dc367bc62 100644 --- a/platform/util/src/com/intellij/util/xmlb/annotations/CollectionBean.java +++ b/platform/util/src/com/intellij/util/xmlb/annotations/CollectionBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -20,13 +20,13 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.FIELD, ElementType.METHOD}) /** * Can read serialized JDOMExternalizableStringList, but in any case will be written in this bean format. * It is useful for application-level config, but for project-level consider to use ConverterProvider. * * Currently, only string element type supported. */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD, ElementType.METHOD}) public @interface CollectionBean { } diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/BeforeCheckinDialogHandler.java b/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/BeforeCheckinDialogHandler.java index 4d6356a06ad1..cc151ebef06d 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/BeforeCheckinDialogHandler.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/checkin/BeforeCheckinDialogHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -23,11 +23,11 @@ import org.jetbrains.annotations.NotNull; import java.util.List; public abstract class BeforeCheckinDialogHandler { - @Deprecated /** * @deprecated see {@link #beforeCommitDialogShown(com.intellij.openapi.project.Project, java.util.List, Iterable, boolean)} * @return false to cancel commit */ + @Deprecated public boolean beforeCommitDialogShownCallback(Iterable executors, boolean showVcsCommit) { throw new AbstractMethodError(); } diff --git a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/utils/impl/SmartDeltaCompressor.java b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/utils/impl/SmartDeltaCompressor.java index 772e8dc5c746..8a505ba604f1 100644 --- a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/utils/impl/SmartDeltaCompressor.java +++ b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/utils/impl/SmartDeltaCompressor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -47,11 +47,11 @@ public class SmartDeltaCompressor implements IntList { writeDelta(offset, deltaList.get(index), sizeOf, deltas); long mask = 1L << rem; - /** - * 4 -> 11 - * 3 -> 10 - * 2 -> 01 - * 1 -> 00 + /* + 4 -> 11 + 3 -> 10 + 2 -> 01 + 1 -> 00 */ if (sizeOf == 3 || sizeOf == 4) majorBits[main] |= mask; if (sizeOf == 2 || sizeOf == 4) minorBits[main] |= mask; diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugProcess.java b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugProcess.java index 9323a7b67adc..87844d448f8d 100644 --- a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugProcess.java +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugProcess.java @@ -88,10 +88,10 @@ public abstract class XDebugProcess { public void startPausing() { } - @Deprecated /** * @deprecated Use {@link #startStepOver(XSuspendContext)} instead */ + @Deprecated public void startStepOver() { throw new AbstractMethodError(); } @@ -106,10 +106,10 @@ public abstract class XDebugProcess { startStepOver(); } - @Deprecated /** * @deprecated Use {@link #startForceStepInto(XSuspendContext)} instead */ + @Deprecated public void startForceStepInto(){ //noinspection deprecation startStepInto(); @@ -127,10 +127,10 @@ public abstract class XDebugProcess { startForceStepInto(); } - @Deprecated /** * @deprecated Use {@link #startStepInto(XSuspendContext)} instead */ + @Deprecated public void startStepInto() { throw new AbstractMethodError(); } @@ -145,10 +145,10 @@ public abstract class XDebugProcess { startStepInto(); } - @Deprecated /** * @deprecated Use {@link #startStepOut(XSuspendContext)} instead */ + @Deprecated public void startStepOut() { throw new AbstractMethodError(); } @@ -186,10 +186,10 @@ public abstract class XDebugProcess { return Promise.DONE; } - @Deprecated /** * @deprecated Use {@link #resume(XSuspendContext)} instead */ + @Deprecated public void resume() { throw new AbstractMethodError(); } @@ -203,10 +203,10 @@ public abstract class XDebugProcess { resume(); } - @Deprecated /** * @deprecated Use {@link #runToPosition(XSuspendContext)} instead */ + @Deprecated public void runToPosition(@NotNull XSourcePosition position) { throw new AbstractMethodError(); } diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugSessionAdapter.java b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugSessionAdapter.java index 7ff22392ad46..8af7b0453f96 100644 --- a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugSessionAdapter.java +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugSessionAdapter.java @@ -15,9 +15,9 @@ */ package com.intellij.xdebugger; -@Deprecated /** * Is not required since Java 1.8 */ +@Deprecated public abstract class XDebugSessionAdapter implements XDebugSessionListener { } diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/settings/XDebuggerSettings.java b/platform/xdebugger-api/src/com/intellij/xdebugger/settings/XDebuggerSettings.java index 367601db12aa..62e2cb1aa22f 100644 --- a/platform/xdebugger-api/src/com/intellij/xdebugger/settings/XDebuggerSettings.java +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/settings/XDebuggerSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -53,11 +53,11 @@ public abstract class XDebuggerSettings implements PersistentStateComponent Date: Fri, 29 Apr 2016 12:19:52 +0300 Subject: [PATCH 10/19] is fireWriteActionFinished throws, the stack is not popped and write lock is never released --- .../intellij/openapi/application/impl/ApplicationImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java index 857297f0a23b..4a213e254ab9 100644 --- a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java @@ -1145,12 +1145,12 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App fireWriteActionFinished(clazz); // fire listeners before popping stack because if somebody starts write action in a listener, // there is a danger of unlocking the write lock before other listeners have been run (since write lock became non-reentrant). + } + finally { myWriteActionsStack.pop(); if (gatherWriteActionStatistics && myWriteActionsStack.isEmpty() && !myWriteActionPending) { writePauses.finished("write action ("+clazz+")"); } - } - finally { if (myWriteActionsStack.isEmpty()) { myLock.writeUnlock(); } From b6c61b55848ec5017244cd0e3857ff315c44c43b Mon Sep 17 00:00:00 2001 From: Rustam Vishnyakov Date: Fri, 29 Apr 2016 12:56:56 +0300 Subject: [PATCH 11/19] Color scheme meta info --- .../colors/impl/AbstractColorsScheme.java | 69 +++++++++++++++++++ .../colors/impl/DefaultColorsScheme.java | 1 + .../colors/impl/EditorColorsSchemeImpl.java | 1 + .../options/colors/SchemesPanel.java | 4 +- .../impl/EditorColorsSchemeImplTest.java | 2 + 5 files changed, 76 insertions(+), 1 deletion(-) diff --git a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java index 96a8a845f94a..47fa8fc58e24 100644 --- a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java +++ b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java @@ -19,6 +19,7 @@ package com.intellij.openapi.editor.colors.impl; import com.intellij.application.options.EditorFontsConstants; import com.intellij.ide.ui.ColorBlindness; import com.intellij.ide.ui.UISettings; +import com.intellij.openapi.application.ex.ApplicationInfoEx; import com.intellij.openapi.editor.HighlighterColors; import com.intellij.openapi.editor.colors.*; import com.intellij.openapi.editor.colors.ex.DefaultColorSchemesManager; @@ -28,6 +29,7 @@ import com.intellij.openapi.options.FontSize; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Couple; import com.intellij.openapi.util.WriteExternalException; +import com.intellij.util.PlatformUtils; import com.intellij.util.containers.ContainerUtilRt; import com.intellij.util.containers.HashMap; import com.intellij.util.ui.JBUI; @@ -38,6 +40,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.awt.*; +import java.text.SimpleDateFormat; import java.util.*; import java.util.List; @@ -102,6 +105,23 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme { @NonNls private static final String CONSOLE_LIGATURES = "CONSOLE_LIGATURES"; @NonNls private static final String EDITOR_QUICK_JAVADOC_FONT_SIZE = "EDITOR_QUICK_DOC_FONT_SIZE"; + + //region Meta info-related fields + private final Properties myMetaInfo = new Properties(); + private final static SimpleDateFormat META_INFO_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); + + @NonNls private static final String META_INFO_ELEMENT = "metaInfo"; + @NonNls private static final String PROPERTY_ELEMENT = "property"; + @NonNls private static final String PROPERTY_NAME_ATTR = "name"; + + @NonNls private static final String META_INFO_CREATION_TIME = "created"; + @NonNls private static final String META_INFO_MODIFIED_TIME = "modified"; + @NonNls private static final String META_INFO_IDE = "ide"; + @NonNls private static final String META_INFO_IDE_VERSION = "ideVersion"; + @NonNls private static final String META_INFO_ORIGINAL = "originalScheme"; + + //endregion + protected AbstractColorsScheme(EditorColorsScheme parentScheme) { myParentScheme = parentScheme; myFontPreferences.setChangeListener(new Runnable() { @@ -114,6 +134,16 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme { public AbstractColorsScheme() { } + + + public void setDefaultMetaInfo(@Nullable AbstractColorsScheme parentScheme) { + myMetaInfo.setProperty(META_INFO_CREATION_TIME, META_INFO_DATE_FORMAT.format(new Date())); + myMetaInfo.setProperty(META_INFO_IDE, PlatformUtils.getPlatformPrefix()); + myMetaInfo.setProperty(META_INFO_IDE_VERSION, ApplicationInfoEx.getInstanceEx().getStrictVersion()); + if (parentScheme != null && parentScheme != EmptyColorScheme.INSTANCE) { + myMetaInfo.setProperty(META_INFO_ORIGINAL, parentScheme.getName()); + } + } @NotNull @Override @@ -312,6 +342,7 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme { myParentScheme = getDefaultScheme(node.getAttributeValue(PARENT_SCHEME_ATTR, EmptyColorScheme.NAME)); } + myMetaInfo.clear(); for (final Object o : node.getChildren()) { Element childNode = (Element)o; String childName = childNode.getName(); @@ -330,6 +361,10 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme { else if (ATTRIBUTES_ELEMENT.equals(childName)) { readAttributes(childNode); } + else if(META_INFO_ELEMENT.equals(childName)) { + readMetaInfo(childNode); + } + } if (myDeprecatedBackgroundColor != null) { @@ -359,6 +394,19 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme { } return defaultScheme; } + + + private void readMetaInfo(@NotNull Element metaInfoElement) { + myMetaInfo.clear(); + for (Element e: metaInfoElement.getChildren()) { + if (META_INFO_ELEMENT.equals(e.getName())) { + String propertyName = e.getAttributeValue(PROPERTY_NAME_ATTR); + if (propertyName != null) { + myMetaInfo.setProperty(propertyName, e.getText()); + } + } + } + } public void readAttributes(@NotNull Element childNode) { for (Element e : childNode.getChildren(OPTION_ELEMENT)) { @@ -490,6 +538,10 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme { if (myParentScheme != null && myParentScheme != EmptyColorScheme.INSTANCE) { parentNode.setAttribute(PARENT_SCHEME_ATTR, myParentScheme.getName()); } + + if (!myMetaInfo.isEmpty()) { + parentNode.addContent(metaInfoToElement()); + } Element element = new Element(OPTION_ELEMENT); element.setAttribute(NAME_ATTR, LINE_SPACING); @@ -623,6 +675,23 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme { } } } + + @NotNull + private Element metaInfoToElement() { + Element metaInfoElement = new Element(META_INFO_ELEMENT); + myMetaInfo.setProperty(META_INFO_MODIFIED_TIME, META_INFO_DATE_FORMAT.format(new Date())); + ArrayList sortedPropertyNames = new ArrayList<>(myMetaInfo.size()); + sortedPropertyNames.addAll(myMetaInfo.stringPropertyNames()); + Collections.sort(sortedPropertyNames); + for (String propertyName : sortedPropertyNames) { + String value = myMetaInfo.getProperty(propertyName); + Element propertyInfo = new Element(PROPERTY_ELEMENT); + propertyInfo.setAttribute(PROPERTY_NAME_ATTR, propertyName); + propertyInfo.setText(value); + metaInfoElement.addContent(propertyInfo); + } + return metaInfoElement; + } private boolean isParentOverwritingInheritance(@NotNull TextAttributesKey key) { TextAttributes parentAttrs = diff --git a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java index 9f420552cbb2..e55ecdd5cfac 100644 --- a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java +++ b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java @@ -90,6 +90,7 @@ public class DefaultColorsScheme extends AbstractColorsScheme implements ReadOnl EditorColorsSchemeImpl newScheme = new EditorColorsSchemeImpl(this); copyTo(newScheme); newScheme.setName(DEFAULT_SCHEME_NAME); + newScheme.setDefaultMetaInfo(this); return newScheme; } } diff --git a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImpl.java b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImpl.java index 784fb54d1b13..888546bcf7d6 100644 --- a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImpl.java +++ b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImpl.java @@ -80,6 +80,7 @@ public class EditorColorsSchemeImpl extends AbstractColorsScheme implements Exte EditorColorsSchemeImpl newScheme = new EditorColorsSchemeImpl(myParentScheme); copyTo(newScheme); newScheme.setName(getName()); + newScheme.setDefaultMetaInfo(this); return newScheme; } } diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/SchemesPanel.java b/platform/lang-impl/src/com/intellij/application/options/colors/SchemesPanel.java index 856a26b48acc..c640cd996bc8 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/SchemesPanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/SchemesPanel.java @@ -21,6 +21,7 @@ import com.intellij.application.options.SaveSchemeDialog; import com.intellij.application.options.SkipSelfSearchComponent; import com.intellij.openapi.application.ApplicationBundle; import com.intellij.openapi.editor.colors.EditorColorsScheme; +import com.intellij.openapi.editor.colors.impl.AbstractColorsScheme; import com.intellij.openapi.editor.colors.impl.EditorColorsSchemeImpl; import com.intellij.openapi.editor.colors.impl.EmptyColorScheme; import com.intellij.openapi.extensions.Extensions; @@ -233,8 +234,9 @@ public class SchemesPanel extends JPanel implements SkipSelfSearchComponent { importer.importScheme(DefaultProjectFactory.getInstance().getDefaultProject(), importSource, myOptions.getSelectedScheme(), name -> { String newName = myOptions.getUniqueName(name); - EditorColorsScheme newScheme = new EditorColorsSchemeImpl(EmptyColorScheme.INSTANCE); + AbstractColorsScheme newScheme = new EditorColorsSchemeImpl(EmptyColorScheme.INSTANCE); newScheme.setName(newName); + newScheme.setDefaultMetaInfo(EmptyColorScheme.INSTANCE); return newScheme; }); if (imported != null) { diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImplTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImplTest.java index 87f159200272..ba9f9eb8ce54 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImplTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImplTest.java @@ -190,6 +190,7 @@ public class EditorColorsSchemeImplTest extends LightPlatformCodeInsightTestCase Element root = new Element("scheme"); ((AbstractColorsScheme)editorColorsScheme).writeExternal(root); root.removeChildren("option"); // Remove font options + root.removeChildren("metaInfo"); assertXmlOutputEquals("", root); } @@ -200,6 +201,7 @@ public class EditorColorsSchemeImplTest extends LightPlatformCodeInsightTestCase Element root = new Element("scheme"); ((AbstractColorsScheme)editorColorsScheme).writeExternal(root); root.removeChildren("option"); // Remove font options + root.removeChildren("metaInfo"); assertXmlOutputEquals("", root); } From 6c89ab975912b24801f3ca3c3ca1c86e03db7a34 Mon Sep 17 00:00:00 2001 From: Dennis Ushakov Date: Fri, 29 Apr 2016 13:12:31 +0300 Subject: [PATCH 12/19] add content to the disposer --- .../intellij/openapi/wm/impl/ToolWindowHeadlessManagerImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowHeadlessManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowHeadlessManagerImpl.java index a59ea310f010..3c89e2642939 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowHeadlessManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowHeadlessManagerImpl.java @@ -512,6 +512,7 @@ public class ToolWindowHeadlessManagerImpl extends ToolWindowManagerEx { @Override public void addContent(@NotNull final Content content) { myContents.add(content); + Disposer.register(this, content); ContentManagerEvent e = new ContentManagerEvent(this, content, myContents.indexOf(content), ContentManagerEvent.ContentOperation.add); myDispatcher.getMulticaster().contentAdded(e); if (mySelected == null) setSelectedContent(content); @@ -520,6 +521,7 @@ public class ToolWindowHeadlessManagerImpl extends ToolWindowManagerEx { @Override public void addContent(@NotNull Content content, int order) { myContents.add(order, content); + Disposer.register(this, content); ContentManagerEvent e = new ContentManagerEvent(this, content, myContents.indexOf(content), ContentManagerEvent.ContentOperation.add); myDispatcher.getMulticaster().contentAdded(e); if (mySelected == null) setSelectedContent(content); From 9168c65deac7cd2698fe866aeb9afcfdbe5983f2 Mon Sep 17 00:00:00 2001 From: irengrig Date: Fri, 29 Apr 2016 12:36:44 +0200 Subject: [PATCH 13/19] node.js run configurations refactoring: return part of open api (in DefaultExecutionResult.java) according to review IDEA-CR-10441 --- .../src/com/intellij/execution/DefaultExecutionResult.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/lang-api/src/com/intellij/execution/DefaultExecutionResult.java b/platform/lang-api/src/com/intellij/execution/DefaultExecutionResult.java index 214d04ed395e..3f2d8e340e96 100644 --- a/platform/lang-api/src/com/intellij/execution/DefaultExecutionResult.java +++ b/platform/lang-api/src/com/intellij/execution/DefaultExecutionResult.java @@ -61,7 +61,7 @@ public class DefaultExecutionResult implements ExecutionResult { return myActions; } - public void setActions(@NotNull final AnAction[] actions) { + public void setActions(@NotNull final AnAction... actions) { myActions = actions; } From 5f91d9ceb5fb9d0182ac8e5bf85346c122776632 Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Fri, 29 Apr 2016 13:58:58 +0300 Subject: [PATCH 14/19] IDEA-96345 Bookmark inconsistency after adding lines. --- .../com/intellij/ide/bookmarks/Bookmark.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java b/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java index 816859d102c1..ccbfc7922a85 100644 --- a/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java +++ b/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java @@ -65,7 +65,7 @@ public class Bookmark implements Navigatable, Comparable { public static final Icon DEFAULT_ICON = new MyCheckedIcon(); private final VirtualFile myFile; - @NotNull private final OpenFileDescriptor myTarget; + @NotNull private OpenFileDescriptor myTarget; private final Project myProject; private String myDescription; @@ -90,7 +90,7 @@ public class Bookmark implements Navigatable, Comparable { if (i != 0) return i; i = myFile.getName().compareTo(o.getFile().getName()); if (i != 0) return i; - return myTarget.compareTo(o.myTarget); + return getTarget().compareTo(o.getTarget()); } public void updateHighlighter() { @@ -222,17 +222,17 @@ public class Bookmark implements Navigatable, Comparable { @Override public boolean canNavigate() { - return myTarget.canNavigate(); + return getTarget().canNavigate(); } @Override public boolean canNavigateToSource() { - return myTarget.canNavigateToSource(); + return getTarget().canNavigateToSource(); } @Override public void navigate(boolean requestFocus) { - myTarget.navigate(requestFocus); + getTarget().navigate(requestFocus); } public int getLine() { @@ -254,6 +254,14 @@ public class Bookmark implements Navigatable, Comparable { return targetLine; } + private OpenFileDescriptor getTarget() { + int line = getLine(); + if (line != myTarget.getLine()) { + myTarget = new OpenFileDescriptor(myProject, myFile, line, -1, true); + } + return myTarget; + } + @Override public String toString() { StringBuilder result = new StringBuilder(getQualifiedName()); From 383ba19b593124f42a2786f8a895ce6d25e02fc5 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 29 Apr 2016 13:12:13 +0200 Subject: [PATCH 15/19] remove EnsureUpToDateFromNonAWTThread --- .../EnsureUpToDateFromNonAWTThread.java | 61 ------------------ .../vcs/changes/ChangeListManagerImpl.java | 4 +- .../idea/svn/VcsWaitForUpdateForTest.java | 62 ------------------- .../idea/svn16/VcsWaitForUpdateForTest.java | 62 ------------------- 4 files changed, 1 insertion(+), 188 deletions(-) delete mode 100644 platform/vcs-api/src/com/intellij/openapi/vcs/changes/EnsureUpToDateFromNonAWTThread.java delete mode 100644 plugins/svn4idea/testSource/org/jetbrains/idea/svn/VcsWaitForUpdateForTest.java delete mode 100644 plugins/svn4idea/testSource/org/jetbrains/idea/svn16/VcsWaitForUpdateForTest.java diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/changes/EnsureUpToDateFromNonAWTThread.java b/platform/vcs-api/src/com/intellij/openapi/vcs/changes/EnsureUpToDateFromNonAWTThread.java deleted file mode 100644 index 96240b0e9584..000000000000 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/changes/EnsureUpToDateFromNonAWTThread.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2000-2009 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. - */ -package com.intellij.openapi.vcs.changes; - -import com.intellij.diagnostic.ThreadDumper; -import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.project.Project; -import com.intellij.util.concurrency.Semaphore; -import org.jetbrains.annotations.TestOnly; - -/** - * for non-AWT threads, synchronously waits for completion of ChanegListManager update - */ -@TestOnly -public class EnsureUpToDateFromNonAWTThread { - private final Project myProject; - private volatile boolean myDone; - - public EnsureUpToDateFromNonAWTThread(final Project project) { - myProject = project; - } - - public void execute() { - assert !ApplicationManager.getApplication().isDispatchThread(); - final Semaphore lock = new Semaphore(); - - lock.down(); - - ChangeListManager.getInstance(myProject).invokeAfterUpdate(new Runnable() { - public void run() { - myDone = true; - lock.up(); - } - }, InvokeAfterUpdateMode.SILENT, null, null); - - if (myProject.isDisposed()) return; - - if (!lock.waitFor(100 * 1000) && !myProject.isDisposed()) { - //noinspection UseOfSystemOutOrSystemErr - System.out.println(ThreadDumper.dumpThreadsToString()); - throw new AssertionError("Couldn't wait for changes update"); - } - } - - public boolean isDone() { - return myDone; - } -} diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java index df48ba1c74d5..528263c9038d 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java @@ -1722,11 +1722,9 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec return true; } myVfsListener.flushDirt(); - final EnsureUpToDateFromNonAWTThread worker = new EnsureUpToDateFromNonAWTThread(myProject); - worker.execute(); myUpdater.waitUntilRefreshed(); waitUpdateAlarm(); - return worker.isDone(); + return true; } @Override diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/VcsWaitForUpdateForTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/VcsWaitForUpdateForTest.java deleted file mode 100644 index 7c95d06505f4..000000000000 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/VcsWaitForUpdateForTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - */ -package org.jetbrains.idea.svn; - -import com.intellij.openapi.util.Ref; -import com.intellij.openapi.vcs.VcsConfiguration; -import com.intellij.openapi.vcs.changes.EnsureUpToDateFromNonAWTThread; -import com.intellij.openapi.vfs.VirtualFile; -import org.junit.Test; - - -public class VcsWaitForUpdateForTest extends Svn17TestCase { - @Test - public void testRefreshes() throws Exception { - enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD); - final VirtualFile file = createFileInCommand("a.txt", "old content"); - final Object lock = new Object(); - - final Ref done = new Ref(); - final Thread thread = new Thread(new Runnable() { - @Override - public void run() { - new EnsureUpToDateFromNonAWTThread(myProject).execute(); - done.set(Boolean.TRUE); - synchronized (lock) { - lock.notifyAll(); - } - } - },"vcs refresh"); - - thread.start(); - synchronized (lock) { - final long start = System.currentTimeMillis(); - final int timeout = 3000; - - while ((System.currentTimeMillis() - start < timeout) && (! Boolean.TRUE.equals(done.get()))) { - try { - lock.wait(timeout); - } - catch (InterruptedException e) { - // - } - } - } - - assert Boolean.TRUE.equals(done.get()); - thread.join(); - } -} diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/VcsWaitForUpdateForTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/VcsWaitForUpdateForTest.java deleted file mode 100644 index f65393ae9133..000000000000 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/VcsWaitForUpdateForTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - */ -package org.jetbrains.idea.svn16; - -import com.intellij.openapi.util.Ref; -import com.intellij.openapi.vcs.VcsConfiguration; -import com.intellij.openapi.vcs.changes.EnsureUpToDateFromNonAWTThread; -import com.intellij.openapi.vfs.VirtualFile; -import org.junit.Test; - - -public class VcsWaitForUpdateForTest extends Svn16TestCase { - @Test - public void testRefreshes() throws Exception { - enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD); - final VirtualFile file = createFileInCommand("a.txt", "old content"); - final Object lock = new Object(); - - final Ref done = new Ref(); - final Thread thread = new Thread(new Runnable() { - @Override - public void run() { - new EnsureUpToDateFromNonAWTThread(myProject).execute(); - done.set(Boolean.TRUE); - synchronized (lock) { - lock.notifyAll(); - } - } - },"svn6 refresh"); - - thread.start(); - synchronized (lock) { - final long start = System.currentTimeMillis(); - final int timeout = 3000; - - while ((System.currentTimeMillis() - start < timeout) && (! Boolean.TRUE.equals(done.get()))) { - try { - lock.wait(timeout); - } - catch (InterruptedException e) { - // - } - } - } - - assert Boolean.TRUE.equals(done.get()); - thread.join(); - } -} From a2e4925d263c1a0230da32e7f454105dacb62cc1 Mon Sep 17 00:00:00 2001 From: Alexey Ushakov Date: Fri, 29 Apr 2016 14:21:49 +0300 Subject: [PATCH 16/19] Fixed JdkBundleTest.testCreateBoot and JdkBundleTest.testCreateBundle Updated JdkBundleTest to work with custom SDK versions --- .../testSrc/com/intellij/util/JdkBundleTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/platform-tests/testSrc/com/intellij/util/JdkBundleTest.java b/platform/platform-tests/testSrc/com/intellij/util/JdkBundleTest.java index cee75f9b92ef..a76106b475d9 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/JdkBundleTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/JdkBundleTest.java @@ -139,7 +139,8 @@ public class JdkBundleTest { assertNotNull(verUpdate); - assertEquals(verStr, verUpdate.first.toString() + "_" + verUpdate.second.toString()); + final String evalVerStr = verUpdate.first.toString() + "_" + verUpdate.second.toString(); + assertTrue(evalVerStr + " is not the same with " + verStr, verStr.contains(evalVerStr)); } @Test @@ -164,6 +165,7 @@ public class JdkBundleTest { assertNotNull(verUpdate); - assertEquals(verStr, verUpdate.first.toString() + "_" + verUpdate.second.toString()); + final String evalVerStr = verUpdate.first.toString() + "_" + verUpdate.second.toString(); + assertTrue(evalVerStr + " is not the same with " + verStr, verStr.contains(evalVerStr)); } } \ No newline at end of file From 5a43b5b33ab38b4507321469ed288911ca3a1705 Mon Sep 17 00:00:00 2001 From: Alexander Lobas Date: Fri, 29 Apr 2016 14:47:34 +0300 Subject: [PATCH 17/19] Padding for notification links --- .../impl/NotificationsManagerImpl.java | 132 ++++++++++++++++-- 1 file changed, 123 insertions(+), 9 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java b/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java index ed300b19030b..136dbe0da5db 100644 --- a/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java @@ -36,6 +36,7 @@ import com.intellij.openapi.ui.DialogWrapperDialog; import com.intellij.openapi.ui.MessageType; import com.intellij.openapi.ui.popup.*; import com.intellij.openapi.util.Disposer; +import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.registry.Registry; @@ -55,10 +56,7 @@ import com.intellij.util.ArrayUtil; import com.intellij.util.FontUtil; import com.intellij.util.Function; import com.intellij.util.IconUtil; -import com.intellij.util.ui.AbstractLayoutManager; -import com.intellij.util.ui.ButtonlessScrollBarUI; -import com.intellij.util.ui.JBUI; -import com.intellij.util.ui.UIUtil; +import com.intellij.util.ui.*; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -76,8 +74,7 @@ import javax.swing.text.html.HTMLEditorKit; import javax.swing.text.html.ParagraphView; import javax.swing.text.html.StyleSheet; import java.awt.*; -import java.awt.event.AdjustmentEvent; -import java.awt.event.AdjustmentListener; +import java.awt.event.*; import java.awt.geom.Rectangle2D; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; @@ -790,10 +787,20 @@ public class NotificationsManagerImpl extends NotificationsManager { buttons.setBorder(new EmptyBorder(0, 0, JBUI.scale(5), JBUI.scale(7))); } - if (buttons == null && actions) { - createActionPanel(notification, centerPanel, layoutData.configuration.actionGap); + HoverAdapter hoverAdapter = new HoverAdapter(); + hoverAdapter.addSource(content); + hoverAdapter.addSource(centerPanel); + + if (expandAction != null) { + hoverAdapter.addComponent(expandAction, new Insets(5, 5, 7, 7)); } + if (buttons == null && actions) { + createActionPanel(notification, centerPanel, layoutData.configuration.actionGap, hoverAdapter); + } + + hoverAdapter.initListeners(); + if (layoutData.mergeData != null) { createMergeAction(layoutData, content); } @@ -860,7 +867,10 @@ public class NotificationsManagerImpl extends NotificationsManager { pane.getVerticalScrollBar().setBackground(fillColor); } - private static void createActionPanel(@NotNull final Notification notification, @NotNull JPanel centerPanel, int gap) { + private static void createActionPanel(@NotNull final Notification notification, + @NotNull JPanel centerPanel, + int gap, + @NotNull HoverAdapter hoverAdapter) { JPanel actionPanel = new NonOpaquePanel(new HorizontalLayout(gap, SwingConstants.CENTER)); centerPanel.add(BorderLayout.SOUTH, actionPanel); @@ -897,6 +907,110 @@ public class NotificationsManagerImpl extends NotificationsManager { } }, action)); } + + Insets hover = new Insets(8, 5, 8, 7); + int count = actionPanel.getComponentCount(); + + for (int i = 0; i < count; i++) { + hoverAdapter.addComponent(actionPanel.getComponent(i), hover); + } + + hoverAdapter.addSource(actionPanel); + } + + private static class HoverAdapter extends MouseAdapter implements MouseMotionListener { + private final List> myComponents = new ArrayList<>(); + private List mySources = new ArrayList<>(); + private Component myLastComponent; + + public void addComponent(@NotNull Component component, @NotNull Insets hover) { + myComponents.add(Pair.create(component, hover)); + } + + public void addSource(@NotNull Component component) { + mySources.add(component); + } + + public void initListeners() { + if (!myComponents.isEmpty()) { + for (Component source : mySources) { + source.addMouseMotionListener(this); + source.addMouseListener(this); + } + mySources = null; + } + } + + public void mousePressed(MouseEvent e) { + handleEvent(e, true, false); + } + + public void mouseReleased(MouseEvent e) { + handleEvent(e, false, false); + } + + public void mouseMoved(MouseEvent e) { + handleEvent(e, false, true); + } + + public void mouseExited(MouseEvent e) { + if (myLastComponent != null) { + mouseExited(e, myLastComponent); + myLastComponent = null; + } + } + + private void handleEvent(MouseEvent e, boolean pressed, boolean moved) { + for (Pair p : myComponents) { + Component component = p.first; + Rectangle bounds = component.getBounds(); + JBInsets.addTo(bounds, p.second); + if (bounds.contains(SwingUtilities.convertPoint(e.getComponent(), e.getPoint(), component.getParent()))) { + if (myLastComponent != null && myLastComponent != component) { + mouseExited(e, myLastComponent); + } + myLastComponent = component; + + MouseEvent event = createEvent(e, component); + if (moved) { + for (MouseMotionListener listener : component.getMouseMotionListeners()) { + listener.mouseMoved(event); + } + } + else { + MouseListener[] listeners = component.getMouseListeners(); + if (pressed) { + for (MouseListener listener : listeners) { + listener.mousePressed(event); + } + } + else { + for (MouseListener listener : listeners) { + listener.mouseReleased(event); + } + } + } + return; + } + else if (component == myLastComponent) { + myLastComponent = null; + mouseExited(e, component); + } + } + } + + private static void mouseExited(MouseEvent e, Component component) { + MouseEvent event = createEvent(e, component); + MouseListener[] listeners = component.getMouseListeners(); + for (MouseListener listener : listeners) { + listener.mouseExited(event); + } + } + + @NotNull + private static MouseEvent createEvent(MouseEvent e, Component c) { + return new MouseEvent(c, e.getID(), e.getWhen(), e.getModifiers(), 5, 5, e.getClickCount(), e.isPopupTrigger(), e.getButton()); + } } private static void createMergeAction(@NotNull final BalloonLayoutData layoutData, @NotNull JPanel panel) { From 954022b07d75fdc6aea455cef888dba8b8e8f21a Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 29 Apr 2016 14:33:46 +0300 Subject: [PATCH 18/19] NPE --- .../magicConstant/MagicConstantInspection.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInspection/magicConstant/MagicConstantInspection.java b/java/java-impl/src/com/intellij/codeInspection/magicConstant/MagicConstantInspection.java index 014d40e08c99..6b8f0d6edf85 100644 --- a/java/java-impl/src/com/intellij/codeInspection/magicConstant/MagicConstantInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/magicConstant/MagicConstantInspection.java @@ -422,10 +422,12 @@ public class MagicConstantInspection extends BaseJavaLocalInspectionTool { private static AllowedValues parseBeanInfo(@NotNull PsiModifierListOwner owner, @NotNull PsiManager manager) { PsiFile containingFile = owner.getContainingFile(); - GlobalSearchScope sourceFile = GlobalSearchScope.fileScope((PsiFile)containingFile.getNavigationElement()); - if (FileBasedIndex.getInstance().getContainingFiles(IdIndex.NAME, new IdIndexEntry("beaninfo", true), sourceFile).isEmpty()) { - // optimisation: do not parse library sources if there are no "beaninfo" text in the file - return null; + if (containingFile != null) { + GlobalSearchScope sourceFile = GlobalSearchScope.fileScope((PsiFile)containingFile.getNavigationElement()); + if (FileBasedIndex.getInstance().getContainingFiles(IdIndex.NAME, new IdIndexEntry("beaninfo", true), sourceFile).isEmpty()) { + // optimisation: do not parse library sources if there are no "beaninfo" text in the file + return null; + } } PsiMethod method = null; if (owner instanceof PsiParameter) { From 747012b19b41aaff7c5bf30ec5b97c01610f221e Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 29 Apr 2016 15:01:31 +0300 Subject: [PATCH 19/19] minor performance: remove redundant initializers from volatile fields --- .../progress/EmptyProgressIndicator.java | 4 +- .../psi/search/PsiElementProcessor.java | 4 +- .../intellij/openapi/vfs/impl/ZipHandler.java | 2 +- .../psi/impl/PsiToDocumentSynchronizer.java | 2 +- .../intellij/psi/impl/meta/MetaRegistry.java | 2 +- .../intellij/psi/impl/source/DummyHolder.java | 4 +- .../com/intellij/util/CachedValueBase.java | 2 +- .../util/profiling/ResolveProfiler.java | 2 +- .../psi/search/PsiReferenceProcessor.java | 2 +- .../psi/stubs/SerializationManager.java | 2 +- .../BaseElementAtCaretIntentionAction.java | 2 +- .../psi/codeStyle/CodeStyleSettings.java | 62 +++++++++---------- .../codeStyle/CodeStyleSettingsManager.java | 8 +-- .../navigation/BackgroundUpdaterTask.java | 2 +- .../ui/CachedInspectionTreeNode.java | 4 +- .../execution/impl/RunConfigurable.java | 2 +- .../findInProject/FindInProjectManager.java | 2 +- .../psi/impl/file/impl/PsiVFSListener.java | 4 +- .../util/indexing/ValueContainer.java | 2 +- .../openapi/diff/DocumentsSynchronizer.java | 8 +-- .../com/intellij/util/proxy/CommonProxy.java | 2 +- .../src/com/intellij/util/ui/Animator.java | 2 +- .../intellij/diagnostic/DialogAppender.java | 2 +- .../intellij/ide/SaveAndSyncHandlerImpl.java | 2 +- .../errorTreeView/NewErrorTreeViewPanel.java | 4 +- .../ide/startup/impl/StartupManagerImpl.java | 8 +-- .../fileTypes/impl/IgnoredFileCache.java | 2 +- .../openapi/project/DumbServiceImpl.java | 2 +- .../vfs/impl/local/NativeFileWatcherImpl.java | 6 +- .../vfs/newvfs/persistent/RefreshWorker.java | 4 +- .../com/intellij/usages/impl/GroupNode.java | 2 +- .../intellij/usages/impl/UsageViewImpl.java | 2 +- .../intellij/util/io/PagedFileStorage.java | 2 +- .../util/io/RandomAccessDataFile.java | 16 ++--- .../util/src/com/intellij/util/ui/UIUtil.java | 4 +- .../groovy/lang/psi/impl/GrClosureType.java | 2 +- .../lang/psi/impl/GrReferenceElementImpl.java | 2 +- .../lang/psi/impl/GroovyFileBaseImpl.java | 4 +- .../groovy/lang/psi/impl/GroovyFileImpl.java | 2 +- .../psi/impl/auxiliary/GrListOrMapImpl.java | 4 +- .../psi/impl/synthetic/GrLightParameter.java | 2 +- .../psi/impl/synthetic/GroovyScriptClass.java | 6 +- .../types/GrDisjunctionTypeElementImpl.java | 2 +- .../psi/impl/source/xml/XmlAttributeImpl.java | 6 +- .../psi/impl/source/xml/XmlTagImpl.java | 14 ++--- .../psi/impl/source/xml/XmlTagValueImpl.java | 8 +-- .../psi/impl/source/xml/XmlTextImpl.java | 6 +- .../dtd/BaseXmlElementDescriptorImpl.java | 2 +- .../impl/schema/ComplexTypeDescriptor.java | 4 +- 49 files changed, 123 insertions(+), 123 deletions(-) diff --git a/platform/core-api/src/com/intellij/openapi/progress/EmptyProgressIndicator.java b/platform/core-api/src/com/intellij/openapi/progress/EmptyProgressIndicator.java index 4f68f1d25f25..a5cd279b2e23 100644 --- a/platform/core-api/src/com/intellij/openapi/progress/EmptyProgressIndicator.java +++ b/platform/core-api/src/com/intellij/openapi/progress/EmptyProgressIndicator.java @@ -20,8 +20,8 @@ import com.intellij.openapi.application.ModalityState; import org.jetbrains.annotations.NotNull; public class EmptyProgressIndicator implements StandardProgressIndicator { - private volatile boolean myIsRunning = false; - private volatile boolean myIsCanceled = false; + private volatile boolean myIsRunning; + private volatile boolean myIsCanceled; @Override public void start() { diff --git a/platform/core-api/src/com/intellij/psi/search/PsiElementProcessor.java b/platform/core-api/src/com/intellij/psi/search/PsiElementProcessor.java index 5dd855abb694..9fc7e8c58313 100644 --- a/platform/core-api/src/com/intellij/psi/search/PsiElementProcessor.java +++ b/platform/core-api/src/com/intellij/psi/search/PsiElementProcessor.java @@ -91,7 +91,7 @@ public interface PsiElementProcessor { class CollectElementsWithLimit extends CollectElements{ private final AtomicInteger myCount = new AtomicInteger(0); - private volatile boolean myOverflow = false; + private volatile boolean myOverflow; private final int myLimit; public CollectElementsWithLimit(int limit) { @@ -119,7 +119,7 @@ public interface PsiElementProcessor { } class FindElement implements PsiElementProcessor { - private volatile T myFoundElement = null; + private volatile T myFoundElement; public boolean isFound() { return myFoundElement != null; diff --git a/platform/core-impl/src/com/intellij/openapi/vfs/impl/ZipHandler.java b/platform/core-impl/src/com/intellij/openapi/vfs/impl/ZipHandler.java index 065ad388f6c2..0363d8a1b8a3 100644 --- a/platform/core-impl/src/com/intellij/openapi/vfs/impl/ZipHandler.java +++ b/platform/core-impl/src/com/intellij/openapi/vfs/impl/ZipHandler.java @@ -36,7 +36,7 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class ZipHandler extends ArchiveHandler { - private volatile String myCanonicalPathToZip = null; + private volatile String myCanonicalPathToZip; private volatile long myFileStamp; private volatile long myFileLength; diff --git a/platform/core-impl/src/com/intellij/psi/impl/PsiToDocumentSynchronizer.java b/platform/core-impl/src/com/intellij/psi/impl/PsiToDocumentSynchronizer.java index 391df3ab683d..b6ef290704ea 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/PsiToDocumentSynchronizer.java +++ b/platform/core-impl/src/com/intellij/psi/impl/PsiToDocumentSynchronizer.java @@ -46,7 +46,7 @@ public class PsiToDocumentSynchronizer extends PsiTreeChangeAdapter { private final MessageBus myBus; private final Map> myTransactionsMap = new HashMap>(); - private volatile Document mySyncDocument = null; + private volatile Document mySyncDocument; public PsiToDocumentSynchronizer(PsiDocumentManagerBase psiDocumentManager, MessageBus bus) { myPsiDocumentManager = psiDocumentManager; diff --git a/platform/core-impl/src/com/intellij/psi/impl/meta/MetaRegistry.java b/platform/core-impl/src/com/intellij/psi/impl/meta/MetaRegistry.java index 6fc82840d587..4cedf570e038 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/meta/MetaRegistry.java +++ b/platform/core-impl/src/com/intellij/psi/impl/meta/MetaRegistry.java @@ -51,7 +51,7 @@ public class MetaRegistry extends MetaDataRegistrar { private static final Logger LOG = Logger.getInstance(MetaRegistry.class); private static final List ourBindings = ContainerUtil.createLockFreeCopyOnWriteList(); - private static volatile boolean ourContributorsLoaded = false; + private static volatile boolean ourContributorsLoaded; private static final Key> META_DATA_KEY = Key.create("META DATA KEY"); diff --git a/platform/core-impl/src/com/intellij/psi/impl/source/DummyHolder.java b/platform/core-impl/src/com/intellij/psi/impl/source/DummyHolder.java index 0b26946ca61e..b0414a2c2e8e 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/source/DummyHolder.java +++ b/platform/core-impl/src/com/intellij/psi/impl/source/DummyHolder.java @@ -31,7 +31,7 @@ public class DummyHolder extends PsiFileImpl { private final CharTable myTable; private final Boolean myExplicitlyValid; private final Language myLanguage; - private volatile FileElement myFileElement = null; + private volatile FileElement myFileElement; @SuppressWarnings("EmptyClass") private static class DummyHolderTreeLock {} private final DummyHolderTreeLock myTreeElementLock = new DummyHolderTreeLock(); @@ -162,7 +162,7 @@ public class DummyHolder extends PsiFileImpl { return psiClone; } - private FileViewProvider myViewProvider = null; + private FileViewProvider myViewProvider; @Override @NotNull diff --git a/platform/core-impl/src/com/intellij/util/CachedValueBase.java b/platform/core-impl/src/com/intellij/util/CachedValueBase.java index eae0032d5b20..548ead1529d3 100644 --- a/platform/core-impl/src/com/intellij/util/CachedValueBase.java +++ b/platform/core-impl/src/com/intellij/util/CachedValueBase.java @@ -35,7 +35,7 @@ import java.util.List; */ public abstract class CachedValueBase { private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.CachedValueImpl"); - private volatile SoftReference> myData = null; + private volatile SoftReference> myData; private Data computeData(@Nullable CachedValueProvider.Result result) { T value = result == null ? null : result.getValue(); diff --git a/platform/core-impl/src/com/intellij/util/profiling/ResolveProfiler.java b/platform/core-impl/src/com/intellij/util/profiling/ResolveProfiler.java index fe653837c453..d23201542703 100644 --- a/platform/core-impl/src/com/intellij/util/profiling/ResolveProfiler.java +++ b/platform/core-impl/src/com/intellij/util/profiling/ResolveProfiler.java @@ -34,7 +34,7 @@ public class ResolveProfiler { private static final boolean DISABLED = true; private static final ThreadLocal threadMap = new ThreadLocal(); - private static volatile int fileCount = 0; + private static volatile int fileCount; private static class ThreadInfo { private final String myFileName; diff --git a/platform/indexing-api/src/com/intellij/psi/search/PsiReferenceProcessor.java b/platform/indexing-api/src/com/intellij/psi/search/PsiReferenceProcessor.java index ed4e6fcb2b15..a12f8b97191e 100644 --- a/platform/indexing-api/src/com/intellij/psi/search/PsiReferenceProcessor.java +++ b/platform/indexing-api/src/com/intellij/psi/search/PsiReferenceProcessor.java @@ -51,7 +51,7 @@ public interface PsiReferenceProcessor{ } class FindElement implements PsiReferenceProcessor{ - private volatile PsiReference myFoundElement = null; + private volatile PsiReference myFoundElement; public boolean isFound() { return myFoundElement != null; diff --git a/platform/indexing-api/src/com/intellij/psi/stubs/SerializationManager.java b/platform/indexing-api/src/com/intellij/psi/stubs/SerializationManager.java index 22a7161857be..61c82b9b8a81 100644 --- a/platform/indexing-api/src/com/intellij/psi/stubs/SerializationManager.java +++ b/platform/indexing-api/src/com/intellij/psi/stubs/SerializationManager.java @@ -31,7 +31,7 @@ import java.util.List; public abstract class SerializationManager { protected final List myAllSerializers = new ArrayList(); - private volatile boolean mySerializersLoaded = false; + private volatile boolean mySerializersLoaded; public static SerializationManager getInstance() { return ApplicationManager.getApplication().getComponent(SerializationManager.class); diff --git a/platform/lang-api/src/com/intellij/codeInsight/intention/BaseElementAtCaretIntentionAction.java b/platform/lang-api/src/com/intellij/codeInsight/intention/BaseElementAtCaretIntentionAction.java index a0b79ca7e76b..0b5f75e95e72 100644 --- a/platform/lang-api/src/com/intellij/codeInsight/intention/BaseElementAtCaretIntentionAction.java +++ b/platform/lang-api/src/com/intellij/codeInsight/intention/BaseElementAtCaretIntentionAction.java @@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable; * @author Danila Ponomarenko */ public abstract class BaseElementAtCaretIntentionAction extends BaseIntentionAction { - private volatile boolean useElementToTheLeft = false; + private volatile boolean useElementToTheLeft; @Override public final boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) { diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java b/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java index d6472836103a..fd7fe543f17c 100644 --- a/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java +++ b/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java @@ -173,9 +173,9 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea } - public boolean USE_SAME_INDENTS = false; + public boolean USE_SAME_INDENTS; - public boolean IGNORE_SAME_INDENTS_FOR_LANGUAGES = false; + public boolean IGNORE_SAME_INDENTS_FOR_LANGUAGES; public boolean AUTODETECT_INDENTS = true; @@ -228,8 +228,8 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea public final TypeToNameMap LOCAL_VARIABLE_TYPE_TO_NAME = new TypeToNameMap(); //----------------- 'final' modifier settings ------- - public boolean GENERATE_FINAL_LOCALS = false; - public boolean GENERATE_FINAL_PARAMETERS = false; + public boolean GENERATE_FINAL_LOCALS; + public boolean GENERATE_FINAL_PARAMETERS; //----------------- visibility ----------------------------- public String VISIBILITY = "public"; @@ -238,7 +238,7 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea public boolean PARENTHESES_AROUND_METHOD_ARGUMENTS = true; //----------------- annotations ---------------- - public boolean USE_EXTERNAL_ANNOTATIONS = false; + public boolean USE_EXTERNAL_ANNOTATIONS; public boolean INSERT_OVERRIDE_ANNOTATION = true; //----------------- override ------------------- @@ -247,12 +247,12 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea //----------------- IMPORTS -------------------- public boolean LAYOUT_STATIC_IMPORTS_SEPARATELY = true; - public boolean USE_FQ_CLASS_NAMES = false; + public boolean USE_FQ_CLASS_NAMES; @Deprecated public boolean USE_FQ_CLASS_NAMES_IN_JAVADOC = true; public boolean USE_SINGLE_CLASS_IMPORTS = true; - public boolean INSERT_INNER_CLASS_IMPORTS = false; + public boolean INSERT_INNER_CLASS_IMPORTS; public int CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND = 5; public int NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND = 3; public final PackageEntryTable PACKAGES_TO_USE_IMPORT_ON_DEMAND = new PackageEntryTable(); @@ -280,7 +280,7 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea * * @see #WRAP_ON_TYPING */ - public boolean WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = false; + public boolean WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN; // ---------------------------------- Javadoc formatting options ------------------------- @@ -296,14 +296,14 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea */ public boolean JD_ALIGN_EXCEPTION_COMMENTS = true; - public boolean JD_ADD_BLANK_AFTER_PARM_COMMENTS = false; - public boolean JD_ADD_BLANK_AFTER_RETURN = false; + public boolean JD_ADD_BLANK_AFTER_PARM_COMMENTS; + public boolean JD_ADD_BLANK_AFTER_RETURN; public boolean JD_ADD_BLANK_AFTER_DESCRIPTION = true; public boolean JD_P_AT_EMPTY_LINES = true; public boolean JD_KEEP_INVALID_TAGS = true; public boolean JD_KEEP_EMPTY_LINES = true; - public boolean JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = false; + public boolean JD_DO_NOT_WRAP_ONE_LINE_COMMENTS; public boolean JD_USE_THROWS_NOT_EXCEPTION = true; public boolean JD_KEEP_EMPTY_PARAMETER = true; @@ -313,8 +313,8 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea public boolean JD_LEADING_ASTERISKS_ARE_ENABLED = true; - public boolean JD_PRESERVE_LINE_FEEDS = false; - public boolean JD_PARAM_DESCRIPTION_ON_NEW_LINE = false; + public boolean JD_PRESERVE_LINE_FEEDS; + public boolean JD_PARAM_DESCRIPTION_ON_NEW_LINE; // --------------------------------------------------------------------------------------- @@ -324,7 +324,7 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea /** * @deprecated Use XmlCodeStyleSettings. */ - public boolean XML_KEEP_WHITESPACES = false; + public boolean XML_KEEP_WHITESPACES; /** * @deprecated Use XmlCodeStyleSettings. */ @@ -353,32 +353,32 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea /** * @deprecated Use XmlCodeStyleSettings. */ - public boolean XML_ALIGN_TEXT = false; + public boolean XML_ALIGN_TEXT; /** * @deprecated Use XmlCodeStyleSettings. */ - public boolean XML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE = false; + public boolean XML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE; /** * @deprecated Use XmlCodeStyleSettings. */ - public boolean XML_SPACE_AFTER_TAG_NAME = false; + public boolean XML_SPACE_AFTER_TAG_NAME; /** * @deprecated Use XmlCodeStyleSettings. */ - public boolean XML_SPACE_INSIDE_EMPTY_TAG = false; + public boolean XML_SPACE_INSIDE_EMPTY_TAG; /** * @deprecated Use XmlCodeStyleSettings. */ - public boolean XML_KEEP_WHITE_SPACES_INSIDE_CDATA = false; + public boolean XML_KEEP_WHITE_SPACES_INSIDE_CDATA; /** * @deprecated Use XmlCodeStyleSettings. */ - public int XML_WHITE_SPACE_AROUND_CDATA = 0; + public int XML_WHITE_SPACE_AROUND_CDATA; // --------------------------------------------------------------------------------------- // ---------------------------------- HTML formatting options ------------------------- - public boolean HTML_KEEP_WHITESPACES = false; + public boolean HTML_KEEP_WHITESPACES; public int HTML_ATTRIBUTE_WRAP = WRAP_AS_NEEDED; public int HTML_TEXT_WRAP = WRAP_AS_NEEDED; @@ -387,16 +387,16 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea public int HTML_KEEP_BLANK_LINES = 2; public boolean HTML_ALIGN_ATTRIBUTES = true; - public boolean HTML_ALIGN_TEXT = false; + public boolean HTML_ALIGN_TEXT; - public boolean HTML_SPACE_AROUND_EQUALITY_IN_ATTRINUTE = false; - public boolean HTML_SPACE_AFTER_TAG_NAME = false; - public boolean HTML_SPACE_INSIDE_EMPTY_TAG = false; + public boolean HTML_SPACE_AROUND_EQUALITY_IN_ATTRINUTE; + public boolean HTML_SPACE_AFTER_TAG_NAME; + public boolean HTML_SPACE_INSIDE_EMPTY_TAG; @NonNls public String HTML_ELEMENTS_TO_INSERT_NEW_LINE_BEFORE = "body,div,p,form,h1,h2,h3"; @NonNls public String HTML_ELEMENTS_TO_REMOVE_NEW_LINE_BEFORE = "br"; @NonNls public String HTML_DO_NOT_INDENT_CHILDREN_OF = "html,body,thead,tbody,tfoot"; - public int HTML_DO_NOT_ALIGN_CHILDREN_OF_MIN_LINES = 0; + public int HTML_DO_NOT_ALIGN_CHILDREN_OF_MIN_LINES; @NonNls public String HTML_KEEP_WHITESPACES_INSIDE = "span,pre,textarea"; @NonNls public String HTML_INLINE_ELEMENTS = @@ -409,19 +409,19 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea // true if <%page import="x.y.z, x.y.t"%> // false if <%page import="x.y.z"%> // <%page import="x.y.t"%> - public boolean JSP_PREFER_COMMA_SEPARATED_IMPORT_LIST = false; + public boolean JSP_PREFER_COMMA_SEPARATED_IMPORT_LIST; //---------------------------------------------------------------------------------------- // region Formatter control - public boolean FORMATTER_TAGS_ENABLED = false; + public boolean FORMATTER_TAGS_ENABLED; public String FORMATTER_ON_TAG = "@formatter:on"; public String FORMATTER_OFF_TAG = "@formatter:off"; - public volatile boolean FORMATTER_TAGS_ACCEPT_REGEXP = false; - private volatile Pattern myFormatterOffPattern = null; - private volatile Pattern myFormatterOnPattern = null; + public volatile boolean FORMATTER_TAGS_ACCEPT_REGEXP; + private volatile Pattern myFormatterOffPattern; + private volatile Pattern myFormatterOnPattern; @Nullable public Pattern getFormatterOffPattern() { diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettingsManager.java b/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettingsManager.java index 26a189660e01..67df2be8350b 100644 --- a/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettingsManager.java +++ b/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettingsManager.java @@ -33,11 +33,11 @@ import org.jetbrains.annotations.Nullable; public class CodeStyleSettingsManager implements PersistentStateComponent { private static final Logger LOG = Logger.getInstance("#" + CodeStyleSettingsManager.class.getName()); - public volatile CodeStyleSettings PER_PROJECT_SETTINGS = null; - public volatile boolean USE_PER_PROJECT_SETTINGS = false; - public volatile String PREFERRED_PROJECT_CODE_STYLE = null; + public volatile CodeStyleSettings PER_PROJECT_SETTINGS; + public volatile boolean USE_PER_PROJECT_SETTINGS; + public volatile String PREFERRED_PROJECT_CODE_STYLE; private volatile CodeStyleSettings myTemporarySettings; - private volatile boolean myIsLoaded = false; + private volatile boolean myIsLoaded; public static CodeStyleSettingsManager getInstance(@Nullable Project project) { if (project == null || project.isDefault()) return getInstance(); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/navigation/BackgroundUpdaterTask.java b/platform/lang-impl/src/com/intellij/codeInsight/navigation/BackgroundUpdaterTask.java index 85cd0952c0ad..539481824bfb 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/navigation/BackgroundUpdaterTask.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/navigation/BackgroundUpdaterTask.java @@ -50,7 +50,7 @@ public abstract class BackgroundUpdaterTask extends Task.Backgroundable { private final Alarm myAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD); private final Object lock = new Object(); - private volatile boolean myCanceled = false; + private volatile boolean myCanceled; public BackgroundUpdaterTask(Project project, String title, boolean canBeCancelled) { super(project, title, canBeCancelled); diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/CachedInspectionTreeNode.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/CachedInspectionTreeNode.java index ab3fde339d79..ef2d2ffd57e7 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/CachedInspectionTreeNode.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/CachedInspectionTreeNode.java @@ -24,8 +24,8 @@ import javax.swing.tree.TreeNode; * @author Dmitry Batkovich */ public abstract class CachedInspectionTreeNode extends InspectionTreeNode implements RefElementAndDescriptorAware { - private volatile String myPresentableName = null; - private volatile Boolean myValid = null; + private volatile String myPresentableName; + private volatile Boolean myValid; protected CachedInspectionTreeNode(Object userObject) { super(userObject); diff --git a/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.java b/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.java index 5570c7a74d61..94778ea7f7fb 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.java +++ b/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.java @@ -80,7 +80,7 @@ class RunConfigurable extends BaseConfigurable { } }; - private volatile boolean isDisposed = false; + private volatile boolean isDisposed; private final Project myProject; private RunDialogBase myRunDialog; diff --git a/platform/lang-impl/src/com/intellij/find/findInProject/FindInProjectManager.java b/platform/lang-impl/src/com/intellij/find/findInProject/FindInProjectManager.java index c99a1c25182b..abf70c2f1905 100644 --- a/platform/lang-impl/src/com/intellij/find/findInProject/FindInProjectManager.java +++ b/platform/lang-impl/src/com/intellij/find/findInProject/FindInProjectManager.java @@ -40,7 +40,7 @@ import org.jetbrains.annotations.NotNull; public class FindInProjectManager { private final Project myProject; - private volatile boolean myIsFindInProgress = false; + private volatile boolean myIsFindInProgress; public static FindInProjectManager getInstance(Project project) { return ServiceManager.getService(project, FindInProjectManager.class); diff --git a/platform/lang-impl/src/com/intellij/psi/impl/file/impl/PsiVFSListener.java b/platform/lang-impl/src/com/intellij/psi/impl/file/impl/PsiVFSListener.java index 3f13fa015525..271708941e0a 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/file/impl/PsiVFSListener.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/file/impl/PsiVFSListener.java @@ -610,8 +610,8 @@ public class PsiVFSListener extends VirtualFileAdapter { } private class MyModuleRootListener implements ModuleRootListener { - private VirtualFile[] myOldContentRoots = null; - private volatile int depthCounter = 0; + private VirtualFile[] myOldContentRoots; + private volatile int depthCounter; @Override public void beforeRootsChange(final ModuleRootEvent event) { if (!myFileManager.isInitialized()) return; diff --git a/platform/lang-impl/src/com/intellij/util/indexing/ValueContainer.java b/platform/lang-impl/src/com/intellij/util/indexing/ValueContainer.java index 145388a3310a..983a4d257c63 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/ValueContainer.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/ValueContainer.java @@ -84,7 +84,7 @@ public abstract class ValueContainer { return true; } - private volatile boolean myNeedsCompacting = false; + private volatile boolean myNeedsCompacting; boolean needsCompacting() { return myNeedsCompacting; diff --git a/platform/platform-api/src/com/intellij/openapi/diff/DocumentsSynchronizer.java b/platform/platform-api/src/com/intellij/openapi/diff/DocumentsSynchronizer.java index 618da1747700..10b1aacc5ac2 100644 --- a/platform/platform-api/src/com/intellij/openapi/diff/DocumentsSynchronizer.java +++ b/platform/platform-api/src/com/intellij/openapi/diff/DocumentsSynchronizer.java @@ -29,12 +29,12 @@ import java.beans.PropertyChangeListener; abstract class DocumentsSynchronizer { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.diff.DocumentsSynchonizer"); - private Document myOriginal = null; - private Document myCopy = null; + private Document myOriginal; + private Document myCopy; private final Project myProject; - private volatile boolean myDuringModification = false; - private int myAssignedCount = 0; + private volatile boolean myDuringModification; + private int myAssignedCount; private final DocumentAdapter myOriginalListener = new DocumentAdapter() { @Override diff --git a/platform/platform-api/src/com/intellij/util/proxy/CommonProxy.java b/platform/platform-api/src/com/intellij/util/proxy/CommonProxy.java index 890d6de95a85..b7b7899bc808 100644 --- a/platform/platform-api/src/com/intellij/util/proxy/CommonProxy.java +++ b/platform/platform-api/src/com/intellij/util/proxy/CommonProxy.java @@ -46,7 +46,7 @@ public class CommonProxy extends ProxySelector { public final static List NO_PROXY_LIST = Collections.singletonList(Proxy.NO_PROXY); private final static long ourErrorInterval = TimeUnit.MINUTES.toMillis(3); private static volatile int ourNotificationCount; - private volatile static long ourErrorTime = 0; + private volatile static long ourErrorTime; private volatile static ProxySelector ourWrong; private static final AtomicReference> ourProps = new AtomicReference>(); diff --git a/platform/platform-api/src/com/intellij/util/ui/Animator.java b/platform/platform-api/src/com/intellij/util/ui/Animator.java index 6259307949d0..cd4ac6c02c86 100644 --- a/platform/platform-api/src/com/intellij/util/ui/Animator.java +++ b/platform/platform-api/src/com/intellij/util/ui/Animator.java @@ -40,7 +40,7 @@ public abstract class Animator implements Disposable { private long myStartTime; private long myStartDeltaTime; private boolean myInitialStep; - private volatile boolean myDisposed = false; + private volatile boolean myDisposed; public Animator(@NonNls final String name, final int totalFrames, diff --git a/platform/platform-impl/src/com/intellij/diagnostic/DialogAppender.java b/platform/platform-impl/src/com/intellij/diagnostic/DialogAppender.java index b0826439d9ed..2a8cb06e8520 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/DialogAppender.java +++ b/platform/platform-impl/src/com/intellij/diagnostic/DialogAppender.java @@ -40,7 +40,7 @@ public class DialogAppender extends AppenderSkeleton { private static final ErrorLogger DEFAULT_LOGGER = new DefaultIdeaErrorLogger(); private static final int MAX_ASYNC_LOGGING_EVENTS = 5; - private volatile Runnable myDialogRunnable = null; + private volatile Runnable myDialogRunnable; private final AtomicInteger myPendingAppendCounts = new AtomicInteger(); @Override diff --git a/platform/platform-impl/src/com/intellij/ide/SaveAndSyncHandlerImpl.java b/platform/platform-impl/src/com/intellij/ide/SaveAndSyncHandlerImpl.java index 5c8954a05894..00bdb83eff4d 100644 --- a/platform/platform-impl/src/com/intellij/ide/SaveAndSyncHandlerImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/SaveAndSyncHandlerImpl.java @@ -56,7 +56,7 @@ public class SaveAndSyncHandlerImpl extends SaveAndSyncHandler implements Dispos private final SingleAlarm myRefreshDelayAlarm = new SingleAlarm(this::doScheduledRefresh, 300, this); private final AtomicInteger myBlockSaveOnFrameDeactivationCount = new AtomicInteger(); private final AtomicInteger myBlockSyncOnFrameActivationCount = new AtomicInteger(); - private volatile long myRefreshSessionId = 0; + private volatile long myRefreshSessionId; public SaveAndSyncHandlerImpl(@NotNull GeneralSettings generalSettings, @NotNull ProgressManager progressManager, diff --git a/platform/platform-impl/src/com/intellij/ide/errorTreeView/NewErrorTreeViewPanel.java b/platform/platform-impl/src/com/intellij/ide/errorTreeView/NewErrorTreeViewPanel.java index 3bcae0962ca0..5970bdd58fcc 100644 --- a/platform/platform-impl/src/com/intellij/ide/errorTreeView/NewErrorTreeViewPanel.java +++ b/platform/platform-impl/src/com/intellij/ide/errorTreeView/NewErrorTreeViewPanel.java @@ -64,12 +64,12 @@ import java.util.List; public class NewErrorTreeViewPanel extends JPanel implements DataProvider, OccurenceNavigator, MutableErrorTreeView, CopyProvider { protected static final Logger LOG = Logger.getInstance("#com.intellij.ide.errorTreeView.NewErrorTreeViewPanel"); private volatile String myProgressText = ""; - private volatile float myFraction = 0.0f; + private volatile float myFraction; private final boolean myCreateExitAction; private final ErrorViewStructure myErrorViewStructure; private final ErrorViewTreeBuilder myBuilder; private final Alarm myUpdateAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD); - private volatile boolean myIsDisposed = false; + private volatile boolean myIsDisposed; private final ErrorTreeViewConfiguration myConfiguration; public interface ProcessController { diff --git a/platform/platform-impl/src/com/intellij/ide/startup/impl/StartupManagerImpl.java b/platform/platform-impl/src/com/intellij/ide/startup/impl/StartupManagerImpl.java index 02e295b8f3a6..dcf12da8b06b 100644 --- a/platform/platform-impl/src/com/intellij/ide/startup/impl/StartupManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/startup/impl/StartupManagerImpl.java @@ -65,11 +65,11 @@ public class StartupManagerImpl extends StartupManagerEx { private final List myDumbAwarePostStartupActivities = Collections.synchronizedList(new LinkedList()); private final List myNotDumbAwarePostStartupActivities = Collections.synchronizedList(new LinkedList()); - private boolean myPostStartupActivitiesPassed = false; // guarded by this + private boolean myPostStartupActivitiesPassed; // guarded by this - private volatile boolean myPreStartupActivitiesPassed = false; - private volatile boolean myStartupActivitiesRunning = false; - private volatile boolean myStartupActivitiesPassed = false; + private volatile boolean myPreStartupActivitiesPassed; + private volatile boolean myStartupActivitiesRunning; + private volatile boolean myStartupActivitiesPassed; private final Project myProject; diff --git a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/IgnoredFileCache.java b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/IgnoredFileCache.java index 20a2af19453d..20c7e7770988 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/IgnoredFileCache.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/IgnoredFileCache.java @@ -37,7 +37,7 @@ class IgnoredFileCache { private final ConcurrentBitSet myCheckedIds = new ConcurrentBitSet(); private final ConcurrentIntObjectMap myIgnoredIds = ContainerUtil.createConcurrentIntObjectMap(); private final IgnoredPatternSet myIgnoredPatterns; - private volatile int myVfsEventNesting = 0; + private volatile int myVfsEventNesting; IgnoredFileCache(@NotNull IgnoredPatternSet ignoredPatterns) { myIgnoredPatterns = ignoredPatterns; diff --git a/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java b/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java index 1c050c8112b6..c07e78b23ad8 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java @@ -58,7 +58,7 @@ public class DumbServiceImpl extends DumbService implements Disposable, Modifica } }; private static Throwable ourForcedTrace; - private volatile boolean myDumb = false; + private volatile boolean myDumb; private volatile Throwable myDumbStart; private volatile TransactionId myDumbStartTransaction; private boolean myUpdateFinishedQueued; diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/NativeFileWatcherImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/NativeFileWatcherImpl.java index 605deccdba95..d629b7734d81 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/NativeFileWatcherImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/NativeFileWatcherImpl.java @@ -65,8 +65,8 @@ public class NativeFileWatcherImpl extends PluggableFileWatcher { private File myExecutable; private volatile MyProcessHandler myProcessHandler; - private volatile int myStartAttemptCount = 0; - private volatile boolean myIsShuttingDown = false; + private volatile int myStartAttemptCount; + private volatile boolean myIsShuttingDown; private final AtomicInteger mySettingRoots = new AtomicInteger(0); private volatile List myRecursiveWatchRoots = Collections.emptyList(); private volatile List myFlatWatchRoots = Collections.emptyList(); @@ -287,7 +287,7 @@ public class NativeFileWatcherImpl extends PluggableFileWatcher { private class MyProcessHandler extends OSProcessHandler { private final BufferedWriter myWriter; - private WatcherOp myLastOp = null; + private WatcherOp myLastOp; private final List myLines = ContainerUtil.newArrayList(); @SuppressWarnings("IOResourceOpenedButNotSafelyClosed") diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/RefreshWorker.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/RefreshWorker.java index 687ec5eca330..e6770fcc9c50 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/RefreshWorker.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/RefreshWorker.java @@ -59,7 +59,7 @@ public class RefreshWorker { private final boolean myIsRecursive; private final Queue> myRefreshQueue = new Queue>(100); private final List myEvents = new ArrayList(); - private volatile boolean myCancelled = false; + private volatile boolean myCancelled; public RefreshWorker(@NotNull NewVirtualFile refreshRoot, boolean isRecursive) { myIsRecursive = isRecursive; @@ -418,7 +418,7 @@ public class RefreshWorker { } } - private static Function ourCancellingCondition = null; + private static Function ourCancellingCondition; @TestOnly public static void setCancellingCondition(@Nullable Function condition) { diff --git a/platform/usageView/src/com/intellij/usages/impl/GroupNode.java b/platform/usageView/src/com/intellij/usages/impl/GroupNode.java index 7e8cd1f39f3f..aaf9574ede9e 100644 --- a/platform/usageView/src/com/intellij/usages/impl/GroupNode.java +++ b/platform/usageView/src/com/intellij/usages/impl/GroupNode.java @@ -44,7 +44,7 @@ public class GroupNode extends Node implements Navigatable, Comparable mySubgroupNodes = new THashMap(); private final List myUsageNodes = new SmartList(); @NotNull private final UsageViewTreeModelBuilder myUsageTreeModel; - private volatile int myRecursiveUsageCount = 0; + private volatile int myRecursiveUsageCount; public GroupNode(@Nullable UsageGroup group, int ruleIndex, @NotNull UsageViewTreeModelBuilder treeModel) { super(treeModel); diff --git a/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java b/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java index e793cada6244..18b18d270ef7 100644 --- a/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java +++ b/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java @@ -108,7 +108,7 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra private final ButtonPanel myButtonPanel = new ButtonPanel(); private final JComponent myAdditionalComponent = new JPanel(new BorderLayout()); private volatile boolean isDisposed; - private volatile boolean myChangesDetected = false; + private volatile boolean myChangesDetected; public static final Comparator USAGE_COMPARATOR = new Comparator() { @Override public int compare(final Usage o1, final Usage o2) { diff --git a/platform/util/src/com/intellij/util/io/PagedFileStorage.java b/platform/util/src/com/intellij/util/io/PagedFileStorage.java index 5cba7519db1a..405ca070ee1d 100644 --- a/platform/util/src/com/intellij/util/io/PagedFileStorage.java +++ b/platform/util/src/com/intellij/util/io/PagedFileStorage.java @@ -104,7 +104,7 @@ public class PagedFileStorage implements Forceable { private final Object myLastAccessedBufferCacheLock = new Object(); private final byte[] myTypedIOBuffer; - private volatile boolean isDirty = false; + private volatile boolean isDirty; private final File myFile; protected volatile long mySize = -1; protected final int myPageSize; diff --git a/platform/util/src/com/intellij/util/io/RandomAccessDataFile.java b/platform/util/src/com/intellij/util/io/RandomAccessDataFile.java index f035fe04ebfa..dca54a1eac33 100644 --- a/platform/util/src/com/intellij/util/io/RandomAccessDataFile.java +++ b/platform/util/src/com/intellij/util/io/RandomAccessDataFile.java @@ -31,7 +31,7 @@ public class RandomAccessDataFile implements Forceable, Closeable { protected static final Logger LOG = Logger.getInstance("#com.intellij.util.io.RandomAccessDataFile"); private static final OpenChannelsCache ourCache = new OpenChannelsCache(150, "rw"); - private static int ourFilesCount = 0; + private static int ourFilesCount; private final int myCount = ourFilesCount++; private final File myFile; @@ -43,8 +43,8 @@ public class RandomAccessDataFile implements Forceable, Closeable { private final FileWriter log; private volatile long mySize; - private volatile boolean myIsDirty = false; - private volatile boolean myIsDisposed = false; + private volatile boolean myIsDirty; + private volatile boolean myIsDisposed; private static final boolean DEBUG = false; @@ -243,12 +243,12 @@ public class RandomAccessDataFile implements Forceable, Closeable { } } - public static int totalReads = 0; - public static long totalReadBytes = 0; + public static int totalReads; + public static long totalReadBytes; - public static int seekcount = 0; - public static int totalWrites = 0; - public static long totalWriteBytes = 0; + public static int seekcount; + public static int totalWrites; + public static long totalWriteBytes; void loadPage(final Page page) { assertNotDisposed(); diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java index 9207aee6ab13..f1942b61464e 100644 --- a/platform/util/src/com/intellij/util/ui/UIUtil.java +++ b/platform/util/src/com/intellij/util/ui/UIUtil.java @@ -292,7 +292,7 @@ public class UIUtil { } }; - private static volatile Pair ourSystemFontData = null; + private static volatile Pair ourSystemFontData; public static final float DEF_SYSTEM_FONT_SIZE = 12f; // TODO: consider 12 * 1.33 to compensate JDK's 72dpi font scale @@ -3503,7 +3503,7 @@ public class UIUtil { return null; } - private static Map ourRealFontFamilies = null; + private static Map ourRealFontFamilies; //Experimental, seems to be reliable under MacOS X only diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrClosureType.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrClosureType.java index 6654eec0cf93..1f3cbe155854 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrClosureType.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrClosureType.java @@ -39,7 +39,7 @@ import java.util.List; */ public class GrClosureType extends GrLiteralClassType { private final GrSignature mySignature; - private volatile PsiType[] myTypeArgs = null; + private volatile PsiType[] myTypeArgs; private GrClosureType(LanguageLevel languageLevel, @NotNull GlobalSearchScope scope, diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrReferenceElementImpl.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrReferenceElementImpl.java index 5be457962f51..f89bb9586fad 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrReferenceElementImpl.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrReferenceElementImpl.java @@ -32,7 +32,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.types.GrTypeElement; * @author ven */ public abstract class GrReferenceElementImpl extends GroovyPsiElementImpl implements GrReferenceElement { - private volatile String myCachedQName = null; + private volatile String myCachedQName; private volatile String myCachedTextSkipWhiteSpaceAndComments; public GrReferenceElementImpl(@NotNull ASTNode node) { diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyFileBaseImpl.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyFileBaseImpl.java index f748390722b2..57c5b5484891 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyFileBaseImpl.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyFileBaseImpl.java @@ -57,7 +57,7 @@ import java.util.List; */ public abstract class GroovyFileBaseImpl extends PsiFileBase implements GroovyFileBase, GrControlFlowOwner { - private GrMethod[] myMethods = null; + private GrMethod[] myMethods; @Override public void subtreeChanged() { @@ -220,7 +220,7 @@ public abstract class GroovyFileBaseImpl extends PsiFileBase implements GroovyFi myControlFlow = null; } - private volatile SoftReference myControlFlow = null; + private volatile SoftReference myControlFlow; @Override public Instruction[] getControlFlow() { diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyFileImpl.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyFileImpl.java index 844c0d5efd3a..0f449da4ac71 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyFileImpl.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyFileImpl.java @@ -79,7 +79,7 @@ public class GroovyFileImpl extends GroovyFileBaseImpl implements GroovyFile { private volatile Boolean myScript; private volatile GroovyScriptClass myScriptClass; - private volatile GrParameter mySyntheticArgsParameter = null; + private volatile GrParameter mySyntheticArgsParameter; private volatile PsiElement myContext; public GroovyFileImpl(FileViewProvider viewProvider) { diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/auxiliary/GrListOrMapImpl.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/auxiliary/GrListOrMapImpl.java index 9ca2f9b7261c..49cec6ec1e66 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/auxiliary/GrListOrMapImpl.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/auxiliary/GrListOrMapImpl.java @@ -55,8 +55,8 @@ public class GrListOrMapImpl extends GrExpressionImpl implements GrListOrMap { private static final Function TYPES_CALCULATOR = new MyTypesCalculator(); private final PsiReference myLiteralReference = new LiteralConstructorReference(this); - private volatile GrExpression[] myInitializers = null; - private volatile GrNamedArgument[] myNamedArguments = null; + private volatile GrExpression[] myInitializers; + private volatile GrNamedArgument[] myNamedArguments; public GrListOrMapImpl(@NotNull ASTNode node) { super(node); diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightParameter.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightParameter.java index 20f0d6f3badd..d1c72d1158ea 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightParameter.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightParameter.java @@ -38,7 +38,7 @@ public class GrLightParameter extends LightVariableBuilder imp public static final GrLightParameter[] EMPTY_ARRAY = new GrLightParameter[0]; private volatile boolean myOptional; private volatile GrModifierList myModifierList; - private volatile GrExpression myInitializer = null; + private volatile GrExpression myInitializer; private final PsiElement myScope; private final GrTypeElement myTypeElement; private final PsiType myTypeGroovy; diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GroovyScriptClass.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GroovyScriptClass.java index 530398d35c86..6e848d24033b 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GroovyScriptClass.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GroovyScriptClass.java @@ -54,10 +54,10 @@ import java.util.List; */ public class GroovyScriptClass extends LightElement implements PsiClass, SyntheticElement { private final GroovyFile myFile; - private volatile PsiMethod myMainMethod = null; - private volatile PsiMethod myRunMethod = null; + private volatile PsiMethod myMainMethod; + private volatile PsiMethod myRunMethod; - private volatile boolean myInitialized = false; + private volatile boolean myInitialized; private final LightModifierList myModifierList; diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/types/GrDisjunctionTypeElementImpl.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/types/GrDisjunctionTypeElementImpl.java index 23c33953a836..c25648a4a993 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/types/GrDisjunctionTypeElementImpl.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/types/GrDisjunctionTypeElementImpl.java @@ -33,7 +33,7 @@ import java.util.ArrayList; * @author Max Medvedev */ public class GrDisjunctionTypeElementImpl extends GroovyPsiElementImpl implements GrDisjunctionTypeElement { - private volatile PsiType myCachedType = null; + private volatile PsiType myCachedType; public GrDisjunctionTypeElementImpl(@NotNull ASTNode node) { super(node); diff --git a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlAttributeImpl.java b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlAttributeImpl.java index f0c0e163adcc..eb59799bd7d5 100644 --- a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlAttributeImpl.java +++ b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlAttributeImpl.java @@ -163,9 +163,9 @@ public class XmlAttributeImpl extends XmlElementImpl implements XmlAttribute, Hi return valueElement != null ? valueElement.getValue() : null; } - private volatile String myDisplayText = null; - private volatile int[] myGapDisplayStarts = null; - private volatile int[] myGapPhysicalStarts = null; + private volatile String myDisplayText; + private volatile int[] myGapDisplayStarts; + private volatile int[] myGapPhysicalStarts; private volatile TextRange myValueTextRange; // text inside quotes, if there are any protected void appendChildToDisplayValue(StringBuilder buffer, ASTNode child) { diff --git a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTagImpl.java b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTagImpl.java index 3be34482656a..5559e940f564 100644 --- a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTagImpl.java +++ b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTagImpl.java @@ -101,13 +101,13 @@ public class XmlTagImpl extends XmlElementImpl implements XmlTag, HintedReferenc } }; private final int myHC = ourHC++; - private volatile String myName = null; + private volatile String myName; private volatile String myLocalName; - private volatile XmlAttribute[] myAttributes = null; - private volatile TextRange[] myTextElements = null; - private volatile Map myAttributeValueMap = null; - private volatile XmlTagValue myValue = null; - private volatile boolean myHasNamespaceDeclarations = false; + private volatile XmlAttribute[] myAttributes; + private volatile TextRange[] myTextElements; + private volatile Map myAttributeValueMap; + private volatile XmlTagValue myValue; + private volatile boolean myHasNamespaceDeclarations; public XmlTagImpl() { this(XmlElementType.XML_TAG); @@ -1270,7 +1270,7 @@ public class XmlTagImpl extends XmlElementImpl implements XmlTag, HintedReferenc private final ASTNode myAnchor; private final boolean myBefore; private final PomModel myModel; - private TreeElement myFirstInserted = null; + private TreeElement myFirstInserted; public InsertAttributeTransaction(final TreeElement child, final ASTNode anchor, final boolean before, final PomModel model) { super(XmlTagImpl.this); diff --git a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTagValueImpl.java b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTagValueImpl.java index dbfb181a5881..318d21718961 100644 --- a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTagValueImpl.java +++ b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTagValueImpl.java @@ -36,9 +36,9 @@ public class XmlTagValueImpl implements XmlTagValue{ private final XmlTag myTag; private final XmlTagChild[] myElements; - private volatile XmlText[] myTextElements = null; - private volatile String myText = null; - private volatile String myTrimmedText = null; + private volatile XmlText[] myTextElements; + private volatile String myText; + private volatile String myTrimmedText; public XmlTagValueImpl(@NotNull XmlTagChild[] bodyElements, @NotNull XmlTag tag) { myTag = tag; @@ -163,7 +163,7 @@ public class XmlTagValueImpl implements XmlTagValue{ final List bodyElements = new ArrayList(); tag.processElements(new PsiElementProcessor() { - boolean insideBody = false; + boolean insideBody; @Override public boolean execute(@NotNull PsiElement element) { final ASTNode treeElement = element.getNode(); diff --git a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTextImpl.java b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTextImpl.java index 9a8b11a88c2d..ae28c1f89908 100644 --- a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTextImpl.java +++ b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTextImpl.java @@ -50,9 +50,9 @@ import java.util.Arrays; public class XmlTextImpl extends XmlElementImpl implements XmlText, PsiLanguageInjectionHost { private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlTextImpl"); - private volatile String myDisplayText = null; - private volatile int[] myGapDisplayStarts = null; - private volatile int[] myGapPhysicalStarts = null; + private volatile String myDisplayText; + private volatile int[] myGapDisplayStarts; + private volatile int[] myGapPhysicalStarts; public XmlTextImpl() { super(XmlElementType.XML_TEXT); diff --git a/xml/xml-psi-impl/src/com/intellij/xml/impl/dtd/BaseXmlElementDescriptorImpl.java b/xml/xml-psi-impl/src/com/intellij/xml/impl/dtd/BaseXmlElementDescriptorImpl.java index 97e3b042c7e4..187d0237d8f2 100644 --- a/xml/xml-psi-impl/src/com/intellij/xml/impl/dtd/BaseXmlElementDescriptorImpl.java +++ b/xml/xml-psi-impl/src/com/intellij/xml/impl/dtd/BaseXmlElementDescriptorImpl.java @@ -26,7 +26,7 @@ import com.intellij.xml.XmlElementsGroup; import java.util.HashMap; public abstract class BaseXmlElementDescriptorImpl implements XmlElementDescriptor { - private volatile XmlElementDescriptor[] myElementDescriptors = null; + private volatile XmlElementDescriptor[] myElementDescriptors; private volatile XmlAttributeDescriptor[] myAttributeDescriptors; private volatile HashMap myElementDescriptorsMap; private volatile HashMap attributeDescriptorsMap; diff --git a/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/ComplexTypeDescriptor.java b/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/ComplexTypeDescriptor.java index af960f841a67..9140f87baad8 100644 --- a/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/ComplexTypeDescriptor.java +++ b/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/ComplexTypeDescriptor.java @@ -107,8 +107,8 @@ public class ComplexTypeDescriptor extends TypeDescriptor { } }; - private volatile XmlElementDescriptor[] myElementDescriptors = null; - private volatile XmlAttributeDescriptor[] myAttributeDescriptors = null; + private volatile XmlElementDescriptor[] myElementDescriptors; + private volatile XmlAttributeDescriptor[] myAttributeDescriptors; @NonNls private static final String PROHIBITED_ATTR_VALUE = "prohibited"; @NonNls