diff --git a/.idea/libraries/winp.xml b/.idea/libraries/winp.xml
index ca5008ccc110..6e23b6ef4581 100644
--- a/.idea/libraries/winp.xml
+++ b/.idea/libraries/winp.xml
@@ -1,11 +1,11 @@
-
+
-
+
\ No newline at end of file
diff --git a/build/scripts/libLicenses.gant b/build/scripts/libLicenses.gant
index e998a02881f5..853e8e76af1a 100644
--- a/build/scripts/libLicenses.gant
+++ b/build/scripts/libLicenses.gant
@@ -235,7 +235,7 @@ libraryLicense(name: "TestNG", version: "5.7 snapshot", license: "Apache 2.0", u
libraryLicense(name: "Trilead SSH", libraryName: "trilead-ssh2", version: "build 213", license: "BSD style (see LICENSE.txt in trilead.jar)", url: "http://www.trilead.com/SSH_Library/")
libraryLicense(name: "Trove4j", version: "1.1 (with patches by JetBrains)", license: "LGPL", url: "http://trove4j.sourceforge.net/", licenseUrl: "http://trove4j.sourceforge.net/html/license.html")
libraryLicense(name: "Velocity", version: "1.7", license: "Apache 2.0", url: "http://velocity.apache.org/", licenseUrl: "http://velocity.apache.org/index.html")
-libraryLicense(name: "winp", version: "1.16 (patched)", license: "MIT", url: "http://java.net/projects/winp", licenseUrl: "http://opensource.org/licenses/mit-license.php")
+libraryLicense(name: "winp", version: "1.17 (patched)", license: "MIT", url: "http://java.net/projects/winp", licenseUrl: "http://opensource.org/licenses/mit-license.php")
libraryLicense(name: "Xalan", libraryName:"Xalan-2.7.1", version: "2.7.1", license: "Apache 2.0", url: "http://xml.apache.org/xalan-j/", licenseUrl: "http://xml.apache.org/xalan-j/")
libraryLicense(name: "Xerces", version: "2.9.1", license: "Apache 2.0", url: "http://xerces.apache.org/xerces2-j/", licenseUrl: "http://xerces.apache.org/xerces2-j/")
libraryLicense(name: "XML Commons (xml-apis.jar, resolver.jar)", version: "", license: "Apache 2.0, W3C Software License , public domain", url: "http://xml.apache.org/commons/", licenseUrl: "http://xml.apache.org/commons/licenses.html")
diff --git a/colorSchemes/src/colorSchemes/Darcula.xml b/colorSchemes/src/colorSchemes/Darcula.xml
index 9d5d944c35ca..5debddc000c6 100644
--- a/colorSchemes/src/colorSchemes/Darcula.xml
+++ b/colorSchemes/src/colorSchemes/Darcula.xml
@@ -26,7 +26,7 @@
-
+
@@ -35,10 +35,11 @@
-
+
+
-
+
@@ -1615,7 +1616,7 @@
diff --git a/java/compiler/impl/src/com/intellij/compiler/options/CompilerOptionsPanel.form b/java/compiler/impl/src/com/intellij/compiler/options/CompilerOptionsPanel.form
index 729a320ebec4..976e2ed482a3 100644
--- a/java/compiler/impl/src/com/intellij/compiler/options/CompilerOptionsPanel.form
+++ b/java/compiler/impl/src/com/intellij/compiler/options/CompilerOptionsPanel.form
@@ -1,6 +1,6 @@
diff --git a/java/compiler/impl/src/com/intellij/compiler/options/CompilerUIConfigurable.java b/java/compiler/impl/src/com/intellij/compiler/options/CompilerUIConfigurable.java
index 57e1ad71c8f7..1119311d695e 100644
--- a/java/compiler/impl/src/com/intellij/compiler/options/CompilerUIConfigurable.java
+++ b/java/compiler/impl/src/com/intellij/compiler/options/CompilerUIConfigurable.java
@@ -55,6 +55,7 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
private JTextField myVMOptionsField;
private JLabel myHeapSizeLabel;
private JLabel myVMOptionsLabel;
+ private JCheckBox myCbRebuildOnDependencyChange;
public CompilerUIConfigurable(final Project project) {
myProject = project;
@@ -84,6 +85,7 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
myCbUseExternalBuild.setSelected(workspaceConfiguration.USE_COMPILE_SERVER);
myCbEnableAutomake.setSelected(workspaceConfiguration.MAKE_PROJECT_ON_SAVE);
myCbParallelCompilation.setSelected(workspaceConfiguration.PARALLEL_COMPILATION);
+ myCbRebuildOnDependencyChange.setSelected(workspaceConfiguration.REBUILD_ON_DEPENDENCY_CHANGE);
myHeapSizeField.setText(String.valueOf(workspaceConfiguration.COMPILER_PROCESS_HEAP_SIZE));
final String options = workspaceConfiguration.COMPILER_PROCESS_ADDITIONAL_VM_OPTIONS;
myVMOptionsField.setText(options == null? "" : options.trim());
@@ -115,6 +117,7 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
workspaceConfiguration.USE_COMPILE_SERVER = myCbUseExternalBuild.isSelected();
workspaceConfiguration.MAKE_PROJECT_ON_SAVE = myCbEnableAutomake.isSelected();
workspaceConfiguration.PARALLEL_COMPILATION = myCbParallelCompilation.isSelected();
+ workspaceConfiguration.REBUILD_ON_DEPENDENCY_CHANGE = myCbRebuildOnDependencyChange.isSelected();
try {
workspaceConfiguration.COMPILER_PROCESS_HEAP_SIZE = Integer.parseInt(myHeapSizeField.getText().trim());
}
@@ -173,6 +176,7 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
isModified |= ComparingUtils.isModified(myCbUseExternalBuild, workspaceConfiguration.USE_COMPILE_SERVER);
isModified |= ComparingUtils.isModified(myCbEnableAutomake, workspaceConfiguration.MAKE_PROJECT_ON_SAVE);
isModified |= ComparingUtils.isModified(myCbParallelCompilation, workspaceConfiguration.PARALLEL_COMPILATION);
+ isModified |= ComparingUtils.isModified(myCbRebuildOnDependencyChange, workspaceConfiguration.REBUILD_ON_DEPENDENCY_CHANGE);
isModified |= ComparingUtils.isModified(myHeapSizeField, workspaceConfiguration.COMPILER_PROCESS_HEAP_SIZE);
isModified |= ComparingUtils.isModified(myVMOptionsField, workspaceConfiguration.COMPILER_PROCESS_ADDITIONAL_VM_OPTIONS);
@@ -211,6 +215,7 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
private void updateExternalMakeOptionControls(boolean enabled) {
myCbEnableAutomake.setEnabled(enabled);
myCbParallelCompilation.setEnabled(enabled);
+ myCbRebuildOnDependencyChange.setEnabled(enabled);
myHeapSizeField.setEnabled(enabled);
myVMOptionsField.setEnabled(enabled);
myHeapSizeLabel.setEnabled(enabled);
diff --git a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java
index c37fd886da48..e16b3d91c4c1 100644
--- a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java
+++ b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java
@@ -827,6 +827,7 @@ public class BuildManager implements ApplicationComponent{
cmdLine.addParameter("-D"+ GlobalOptions.GENERATE_CLASSPATH_INDEX_OPTION +"=" + shouldGenerateIndex);
}
cmdLine.addParameter("-D"+ GlobalOptions.COMPILE_PARALLEL_OPTION +"=" + Boolean.toString(config.PARALLEL_COMPILATION));
+ cmdLine.addParameter("-D"+ GlobalOptions.REBUILD_ON_DEPENDENCY_CHANGE_OPTION + "=" + Boolean.toString(config.REBUILD_ON_DEPENDENCY_CHANGE));
if (Boolean.TRUE.equals(Boolean.valueOf(System.getProperty("java.net.preferIPv4Stack", "false")))) {
cmdLine.addParameter("-Djava.net.preferIPv4Stack=true");
diff --git a/java/compiler/openapi/src/com/intellij/compiler/CompilerWorkspaceConfiguration.java b/java/compiler/openapi/src/com/intellij/compiler/CompilerWorkspaceConfiguration.java
index 89fdd636d344..0445ab0cd742 100644
--- a/java/compiler/openapi/src/com/intellij/compiler/CompilerWorkspaceConfiguration.java
+++ b/java/compiler/openapi/src/com/intellij/compiler/CompilerWorkspaceConfiguration.java
@@ -42,6 +42,7 @@ public class CompilerWorkspaceConfiguration implements PersistentStateComponent<
public boolean PARALLEL_COMPILATION = false;
public int COMPILER_PROCESS_HEAP_SIZE = DEFAULT_COMPILE_PROCESS_HEAP_SIZE;
public String COMPILER_PROCESS_ADDITIONAL_VM_OPTIONS = DEFAULT_COMPILE_PROCESS_VM_OPTIONS;
+ public boolean REBUILD_ON_DEPENDENCY_CHANGE = true;
public static CompilerWorkspaceConfiguration getInstance(Project project) {
return ServiceManager.getService(project, CompilerWorkspaceConfiguration.class);
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointWithHighlighter.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointWithHighlighter.java
index a285463aeea4..0cf455de5068 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointWithHighlighter.java
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointWithHighlighter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -616,6 +616,11 @@ public abstract class BreakpointWithHighlighter extends Breakpoint {
return myDescription;
}
+ @Override
+ public Alignment getAlignment() {
+ return Alignment.RIGHT;
+ }
+
@Override
public AnAction getClickAction() {
return new AnAction() {
diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaMemberNameCompletionContributor.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaMemberNameCompletionContributor.java
index 4a1ac632a868..1a21b65af873 100644
--- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaMemberNameCompletionContributor.java
+++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaMemberNameCompletionContributor.java
@@ -24,7 +24,6 @@ import com.intellij.patterns.ElementPattern;
import com.intellij.patterns.PsiJavaPatterns;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.*;
-import com.intellij.psi.codeStyle.CodeStyleManager;
import com.intellij.psi.codeStyle.JavaCodeStyleManager;
import com.intellij.psi.codeStyle.SuggestedNameInfo;
import com.intellij.psi.codeStyle.VariableKind;
@@ -366,46 +365,36 @@ public class JavaMemberNameCompletionContributor extends CompletionContributor {
final boolean staticContext,
final PsiType varType,
final PsiElement element) {
- class Change implements Runnable {
- private String[] result;
+ final List propertyHandlers = new ArrayList();
- @Override
- public void run() {
- final List propertyHandlers = new ArrayList();
- final PsiField[] fields = psiClass.getFields();
+ for (final PsiField field : psiClass.getFields()) {
+ if (field == element) continue;
- for (final PsiField field : fields) {
- if (field == element) continue;
+ assert field.isValid() : "invalid field: " + field;
+ PsiType fieldType = field.getType();
+ assert fieldType.isValid() : "invalid field type: " + field + "; " + fieldType + " of " + fieldType.getClass();
- assert field.isValid() : "invalid field: " + field;
- PsiType fieldType = field.getType();
- assert fieldType.isValid() : "invalid field type: " + field + "; " + fieldType + " of " + fieldType.getClass();
+ final PsiModifierList modifierList = field.getModifierList();
+ if (staticContext && (modifierList != null && !modifierList.hasModifierProperty(PsiModifier.STATIC))) continue;
- final PsiModifierList modifierList = field.getModifierList();
- if (staticContext && (modifierList != null && !modifierList.hasModifierProperty(PsiModifier.STATIC))) continue;
+ if (fieldType.equals(varType)) {
+ final String getterName = PropertyUtil.suggestGetterName(field.getProject(), field);
+ if ((psiClass.findMethodsByName(getterName, true).length == 0 ||
+ psiClass.findMethodBySignature(PropertyUtil.generateGetterPrototype(field), true) == null)) {
+ propertyHandlers.add(getterName);
+ }
+ }
- if (fieldType.equals(varType)) {
- final String getterName = PropertyUtil.suggestGetterName(field.getProject(), field);
- if ((psiClass.findMethodsByName(getterName, true).length == 0 ||
- psiClass.findMethodBySignature(PropertyUtil.generateGetterPrototype(field), true) == null)) {
- propertyHandlers.add(getterName);
- }
- }
-
- if (PsiType.VOID.equals(varType)) {
- final String setterName = PropertyUtil.suggestSetterName(field.getProject(), field);
- if ((psiClass.findMethodsByName(setterName, true).length == 0 ||
- psiClass.findMethodBySignature(PropertyUtil.generateSetterPrototype(field), true) == null)) {
- propertyHandlers.add(setterName);
- }
- }
+ if (PsiType.VOID.equals(varType)) {
+ final String setterName = PropertyUtil.suggestSetterName(field.getProject(), field);
+ if ((psiClass.findMethodsByName(setterName, true).length == 0 ||
+ psiClass.findMethodBySignature(PropertyUtil.generateSetterPrototype(field), true) == null)) {
+ propertyHandlers.add(setterName);
}
- result = ArrayUtil.toStringArray(propertyHandlers);
}
}
- final Change result = new Change();
- CodeStyleManager.getInstance(element.getProject()).performActionWithFormatterDisabled(result);
- return result.result;
+
+ return ArrayUtil.toStringArray(propertyHandlers);
}
private static void addLookupItems(Set lookupElements, @Nullable final SuggestedNameInfo callback, PrefixMatcher matcher, Project project, String... strings) {
diff --git a/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/MethodParameterInfoHandler.java b/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/MethodParameterInfoHandler.java
index 8008c75ab5b6..73ac96b7a5d3 100644
--- a/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/MethodParameterInfoHandler.java
+++ b/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/MethodParameterInfoHandler.java
@@ -431,7 +431,13 @@ public class MethodParameterInfoHandler implements ParameterInfoHandlerWithTabAc
public void updateUI(final Object p, final ParameterInfoUIContext context) {
if (p instanceof CandidateInfo) {
CandidateInfo info = (CandidateInfo)p;
- updateMethodPresentation((PsiMethod)info.getElement(), getCandidateInfoSubstitutor(info), context);
+ PsiMethod method = (PsiMethod)info.getElement();
+ if (!method.isValid()) {
+ context.setUIComponentEnabled(false);
+ return;
+ }
+
+ updateMethodPresentation(method, getCandidateInfoSubstitutor(info), context);
}
else {
updateMethodPresentation((PsiMethod)p, null, context);
diff --git a/java/java-impl/src/com/intellij/codeInspection/AnnotateMethodFix.java b/java/java-impl/src/com/intellij/codeInspection/AnnotateMethodFix.java
index 88cc269db319..6861ff990ac7 100644
--- a/java/java-impl/src/com/intellij/codeInspection/AnnotateMethodFix.java
+++ b/java/java-impl/src/com/intellij/codeInspection/AnnotateMethodFix.java
@@ -76,7 +76,7 @@ public class AnnotateMethodFix implements LocalQuickFix {
if (annotateOverriddenMethods()) {
PsiMethod[] methods = OverridingMethodsSearch.search(method, GlobalSearchScope.allScope(project), true).toArray(PsiMethod.EMPTY_ARRAY);
for (PsiMethod psiMethod : methods) {
- if (!AnnotationUtil.isAnnotated(psiMethod, myAnnotation, false, false) && psiMethod.getManager().isInProject(psiMethod)) {
+ if (AnnotationUtil.isAnnotatingApplicable(psiMethod, myAnnotation) && !AnnotationUtil.isAnnotated(psiMethod, myAnnotation, false, false) && psiMethod.getManager().isInProject(psiMethod)) {
toAnnotate.add(psiMethod);
}
}
diff --git a/java/java-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java b/java/java-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java
index e3170217680f..4b99a0540ebb 100644
--- a/java/java-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java
+++ b/java/java-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java
@@ -1218,7 +1218,7 @@ class ControlFlowAnalyzer extends JavaElementVisitor {
ConditionalGotoInstruction cond = new ConditionalGotoInstruction(NOT_FOUND, false, null);
addInstruction(cond);
addInstruction(new EmptyStackInstruction());
- addInstruction(new PushInstruction(myFactory.getTypeFactory().create(ref), null));
+ addInstruction(new PushInstruction(myFactory.getNotNullFactory().create(ref), null));
addThrowCode(ref);
cond.setOffset(myCurrentFlow.getInstructionCount());
}
@@ -1305,7 +1305,8 @@ class ControlFlowAnalyzer extends JavaElementVisitor {
return true;
}
}
- else if ("junit.framework.Assert".equals(className) || "org.junit.Assert".equals(className) || "org.testng.Assert".equals(className)) {
+ else if ("junit.framework.Assert".equals(className) || "org.junit.Assert".equals(className) ||
+ "junit.framework.TestCase".equals(className) || "org.testng.Assert".equals(className)) {
boolean testng = "org.testng.Assert".equals(className);
if ("fail".equals(methodName)) {
pushParameters(params, false, !testng);
diff --git a/java/java-impl/src/com/intellij/codeInspection/dataFlow/DataFlowRunner.java b/java/java-impl/src/com/intellij/codeInspection/dataFlow/DataFlowRunner.java
index dd5183d451d8..6a1ce9b2e82d 100644
--- a/java/java-impl/src/com/intellij/codeInspection/dataFlow/DataFlowRunner.java
+++ b/java/java-impl/src/com/intellij/codeInspection/dataFlow/DataFlowRunner.java
@@ -46,7 +46,7 @@ import java.util.*;
public class DataFlowRunner {
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.dataFlow.DataFlowRunner");
- private static final Key TOO_EXPENSIVE_SIZE = Key.create("TOO_EXPENSIVE_SIZE");
+ private static final Key TOO_EXPENSIVE_HASH = Key.create("TOO_EXPENSIVE_HASH");
public static final long ourTimeLimit = 1000 * 1000 * 1000; //1 sec in nanoseconds
private Instruction[] myInstructions;
@@ -103,14 +103,16 @@ public class DataFlowRunner {
myFields = flow.getFields();
if (LOG.isDebugEnabled()) {
+ LOG.debug("Analyzing code block: " + psiBlock.getText());
for (int i = 0; i < myInstructions.length; i++) {
Instruction instruction = myInstructions[i];
LOG.debug(i + ": " + instruction.toString());
}
}
- Integer tooExpensiveSize = psiBlock.getUserData(TOO_EXPENSIVE_SIZE);
- if (tooExpensiveSize != null && tooExpensiveSize == psiBlock.getText().hashCode()) {
+ Integer tooExpensiveHash = psiBlock.getUserData(TOO_EXPENSIVE_HASH);
+ if (tooExpensiveHash != null && tooExpensiveHash == psiBlock.getText().hashCode()) {
+ LOG.debug("Too complex because hasn't changed since being too complex already");
return RunnerResult.TOO_COMPLEX;
}
@@ -125,7 +127,8 @@ public class DataFlowRunner {
int count = 0;
while (!queue.isEmpty()) {
if (count % 50 == 0 && !unitTestMode && measurer.isTimeOver()) {
- psiBlock.putUserData(TOO_EXPENSIVE_SIZE, psiBlock.getText().hashCode());
+ LOG.debug("Too complex because the analysis took too long");
+ psiBlock.putUserData(TOO_EXPENSIVE_HASH, psiBlock.getText().hashCode());
return RunnerResult.TOO_COMPLEX;
}
ProgressManager.checkCanceled();
@@ -140,11 +143,14 @@ public class DataFlowRunner {
if (instruction instanceof BranchingInstruction) {
if (!instruction.setMemoryStateProcessed(instructionState.getMemoryState().createCopy())) {
+ LOG.debug("Too complex because too many different possible states");
return RunnerResult.TOO_COMPLEX; // Too complex :(
}
}
- //System.out.println(instructionState);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug(instructionState.toString());
+ }
DfaInstructionState[] after = instruction.accept(this, instructionState.getMemoryState(), visitor);
if (after != null) {
@@ -160,15 +166,18 @@ public class DataFlowRunner {
count++;
}
- psiBlock.putUserData(TOO_EXPENSIVE_SIZE, null);
+ psiBlock.putUserData(TOO_EXPENSIVE_HASH, null);
+ LOG.debug("Analysis ok");
return RunnerResult.OK;
}
catch (ArrayIndexOutOfBoundsException e) {
- LOG.error(psiBlock.getText(), e); /* TODO[max] !!! hack (of 18186). Please fix in better times. */
+ LOG.error(psiBlock.getText(), e); // TODO fix in better times
return RunnerResult.ABORTED;
}
catch (EmptyStackException e) {
- //LOG.error(psiBlock.getText(), e); /* TODO[max] !!! hack (of 18186). Please fix in better times. */
+ if (LOG.isDebugEnabled()) {
+ LOG.error(e); // TODO fix in better times
+ }
return RunnerResult.ABORTED;
}
}
diff --git a/java/java-impl/src/com/intellij/codeInspection/nullable/AnnotateOverriddenMethodParameterFix.java b/java/java-impl/src/com/intellij/codeInspection/nullable/AnnotateOverriddenMethodParameterFix.java
index a8edce01d507..03a202db332e 100644
--- a/java/java-impl/src/com/intellij/codeInspection/nullable/AnnotateOverriddenMethodParameterFix.java
+++ b/java/java-impl/src/com/intellij/codeInspection/nullable/AnnotateOverriddenMethodParameterFix.java
@@ -81,7 +81,9 @@ public class AnnotateOverriddenMethodParameterFix implements LocalQuickFix {
for (PsiParameter psiParam : toAnnotate) {
try {
assert psiParam != null : toAnnotate;
- new AddAnnotationFix(myAnnotation, psiParam, myAnnosToRemove).invoke(project, null, psiParam.getContainingFile());
+ if (AnnotationUtil.isAnnotatingApplicable(psiParam, myAnnotation)) {
+ new AddAnnotationFix(myAnnotation, psiParam, myAnnosToRemove).invoke(project, null, psiParam.getContainingFile());
+ }
}
catch (IncorrectOperationException e) {
LOG.error(e);
diff --git a/java/java-impl/src/com/intellij/codeInspection/nullable/ChangeNullableDefaultsFix.java b/java/java-impl/src/com/intellij/codeInspection/nullable/ChangeNullableDefaultsFix.java
new file mode 100644
index 000000000000..53b439f0d2d5
--- /dev/null
+++ b/java/java-impl/src/com/intellij/codeInspection/nullable/ChangeNullableDefaultsFix.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.codeInspection.nullable;
+
+import com.intellij.codeInsight.NullableNotNullManager;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiAnnotation;
+import org.jetbrains.annotations.NotNull;
+
+/**
+* User: anna
+* Date: 2/22/13
+*/
+class ChangeNullableDefaultsFix implements LocalQuickFix {
+ private final NullableNotNullManager myManager;
+ private final String myNotNullName;
+ private final String myNullableName;
+
+ public ChangeNullableDefaultsFix(PsiAnnotation notNull, PsiAnnotation nullable, NullableNotNullManager manager) {
+ myNotNullName = notNull != null ? notNull.getQualifiedName() : null;
+ myNullableName = nullable != null ? nullable.getQualifiedName() : null;
+ myManager = manager;
+ }
+
+ ChangeNullableDefaultsFix(String notNull, String nullable, NullableNotNullManager manager) {
+ myManager = manager;
+ myNotNullName = notNull;
+ myNullableName = nullable;
+ }
+
+ @NotNull
+ @Override
+ public String getName() {
+ return "Make \"" + (myNotNullName != null ? myNotNullName : myNullableName) + "\" default annotation";
+ }
+
+ @NotNull
+ @Override
+ public String getFamilyName() {
+ return getName();
+ }
+
+ @Override
+ public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
+ if (myNotNullName != null) {
+ myManager.setDefaultNotNull(myNotNullName);
+ } else {
+ myManager.setDefaultNullable(myNullableName);
+ }
+ }
+}
diff --git a/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java b/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java
index c2eb806257b7..b59d821bbecf 100644
--- a/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java
+++ b/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java
@@ -85,6 +85,14 @@ public class NullableStuffInspection extends BaseLocalInspectionTool {
final String anno = annotated.isDeclaredNotNull ? manager.getDefaultNotNull() : manager.getDefaultNullable();
final List annoToRemove = annotated.isDeclaredNotNull ? manager.getNullables() : manager.getNotNulls();
+ if (!AnnotationUtil.isAnnotatingApplicable(field, anno)) {
+ final PsiAnnotation notNull = AnnotationUtil.findAnnotation(field, manager.getNotNulls());
+ final PsiAnnotation nullable = AnnotationUtil.findAnnotation(field, manager.getNullables());
+ holder.registerProblem(field.getNameIdentifier(), "Nullable/NotNull defaults are not accessible in current context",
+ new ChangeNullableDefaultsFix(notNull, nullable, manager));
+ return;
+ }
+
String propName = JavaCodeStyleManager.getInstance(project).variableNameToPropertyName(field.getName(), VariableKind.FIELD);
final boolean isStatic = field.hasModifierProperty(PsiModifier.STATIC);
final PsiMethod getter = PropertyUtil.findPropertyGetter(field.getContainingClass(), propName, isStatic, false);
@@ -289,9 +297,13 @@ public class NullableStuffInspection extends BaseLocalInspectionTool {
reported_not_annotated_method_overrides_notnull = true;
final String defaultNotNull = nullableManager.getDefaultNotNull();
final String[] annotationsToRemove = ArrayUtil.toStringArray(nullableManager.getNullables());
+ final LocalQuickFix fix = AnnotationUtil.isAnnotatingApplicable(method, defaultNotNull)
+ ? createAnnotateMethodFix(defaultNotNull, annotationsToRemove)
+ : createChangeDefaultNotNullFix(nullableManager, superMethod);
holder.registerProblem(method.getNameIdentifier(),
InspectionsBundle.message("inspection.nullable.problems.method.overrides.NotNull"),
- ProblemHighlightType.GENERIC_ERROR_OR_WARNING, createAnnotateMethodFix(defaultNotNull, annotationsToRemove));
+ ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
+ wrapFix(fix));
}
if (REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE || REPORT_NOT_ANNOTATED_METHOD_OVERRIDES_NOTNULL) {
PsiParameter[] superParameters = superMethod.getParameterList().getParameters();
@@ -313,10 +325,13 @@ public class NullableStuffInspection extends BaseLocalInspectionTool {
if (!AnnotationUtil.isAnnotated(parameter, nullableManager.getAllAnnotations(), false, false) &&
nullableManager.isNotNull(superParameter, false)) {
reported_not_annotated_parameter_overrides_notnull[i] = true;
+ final LocalQuickFix fix = AnnotationUtil.isAnnotatingApplicable(parameter, nullableManager.getDefaultNotNull())
+ ? new AddNotNullAnnotationFix(parameter)
+ : createChangeDefaultNotNullFix(nullableManager, superParameter);
holder.registerProblem(parameter.getNameIdentifier(),
InspectionsBundle.message("inspection.nullable.problems.parameter.overrides.NotNull"),
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
- new AddNotNullAnnotationFix(parameter));
+ wrapFix(fix));
}
}
}
@@ -334,22 +349,34 @@ public class NullableStuffInspection extends BaseLocalInspectionTool {
}
if (hasAnnotatedParameter || annotated.isDeclaredNotNull) {
PsiManager manager = method.getManager();
+ final String defaultNotNull = nullableManager.getDefaultNotNull();
+ final boolean superMethodApplicable = AnnotationUtil.isAnnotatingApplicable(method, defaultNotNull);
PsiMethod[] overridings =
OverridingMethodsSearch.search(method, GlobalSearchScope.allScope(manager.getProject()), true).toArray(PsiMethod.EMPTY_ARRAY);
boolean methodQuickFixSuggested = false;
for (PsiMethod overriding : overridings) {
if (!manager.isInProject(overriding)) continue;
+
+ final boolean applicable = AnnotationUtil.isAnnotatingApplicable(overriding, defaultNotNull);
if (!methodQuickFixSuggested
&& annotated.isDeclaredNotNull
&& !nullableManager.isNotNull(overriding, false)
&& (nullableManager.isNullable(overriding, false) || !nullableManager.isNullable(overriding, true))) {
method.getNameIdentifier(); //load tree
- PsiAnnotation annotation = AnnotationUtil.findAnnotation(method, nullableManager.getNotNulls());
- final String defaultNotNull = nullableManager.getDefaultNotNull();
+ PsiAnnotation annotation = AnnotationUtil.findAnnotation(method, nullableManager.getNotNulls());
final String[] annotationsToRemove = ArrayUtil.toStringArray(nullableManager.getNullables());
+
+ final LocalQuickFix fix;
+ if (applicable) {
+ fix = new MyAnnotateMethodFix(defaultNotNull, annotationsToRemove);
+ }
+ else {
+ fix = superMethodApplicable ? null : createChangeDefaultNotNullFix(nullableManager, method);
+ }
+
holder.registerProblem(annotation, InspectionsBundle.message("nullable.stuff.problems.overridden.methods.are.not.annotated"),
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
- new MyAnnotateMethodFix(defaultNotNull, annotationsToRemove));
+ wrapFix(fix));
methodQuickFixSuggested = true;
}
if (hasAnnotatedParameter) {
@@ -363,7 +390,7 @@ public class NullableStuffInspection extends BaseLocalInspectionTool {
holder.registerProblem(annotation,
InspectionsBundle.message("nullable.stuff.problems.overridden.method.parameters.are.not.annotated"),
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
- new AnnotateOverriddenMethodParameterFix(nullableManager.getDefaultNotNull(), nullableManager.getDefaultNullable()));
+ wrapFix(!applicable ? createChangeDefaultNotNullFix(nullableManager, parameters[i]) : new AnnotateOverriddenMethodParameterFix(defaultNotNull, nullableManager.getDefaultNullable())));
parameterQuickFixSuggested[i] = true;
}
}
@@ -373,6 +400,19 @@ public class NullableStuffInspection extends BaseLocalInspectionTool {
}
}
+ private static LocalQuickFix[] wrapFix(LocalQuickFix fix) {
+ if (fix == null) return LocalQuickFix.EMPTY_ARRAY;
+ return new LocalQuickFix[]{fix};
+ }
+
+ private static LocalQuickFix createChangeDefaultNotNullFix(NullableNotNullManager nullableManager, PsiModifierListOwner modifierListOwner) {
+ final PsiAnnotation annotation = AnnotationUtil.findAnnotation(modifierListOwner, nullableManager.getNotNulls());
+ if (annotation != null) {
+ return new ChangeNullableDefaultsFix(annotation.getQualifiedName(), null, nullableManager);
+ }
+ return null;
+ }
+
protected AnnotateMethodFix createAnnotateMethodFix(final String defaultNotNull, final String[] annotationsToRemove) {
return new AnnotateMethodFix(defaultNotNull, annotationsToRemove);
}
diff --git a/java/java-impl/src/com/intellij/openapi/module/BasePackageParameterFactory.java b/java/java-impl/src/com/intellij/openapi/module/BasePackageParameterFactory.java
index e2f3308f7ef2..809f65d80d7d 100644
--- a/java/java-impl/src/com/intellij/openapi/module/BasePackageParameterFactory.java
+++ b/java/java-impl/src/com/intellij/openapi/module/BasePackageParameterFactory.java
@@ -60,7 +60,7 @@ public class BasePackageParameterFactory extends ProjectTemplateParameterFactory
@Override
public String getLabel() {
- return "Base package:";
+ return "Base \u001Bpackage:";
}
@Override
diff --git a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/ImportHelper.java b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/ImportHelper.java
index ae1e9773bc8c..15716567cab7 100644
--- a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/ImportHelper.java
+++ b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/ImportHelper.java
@@ -78,63 +78,10 @@ public class ImportHelper{
}
});
- int[] entryForName = ArrayUtil.newIntArray(names.size());
- PackageEntry[] entries = mySettings.IMPORT_LAYOUT_TABLE.getEntries();
- for(int i = 0; i < names.size(); i++){
- Pair pair = names.get(i);
- String packageName = pair.getFirst();
- Boolean isStatic = pair.getSecond();
- entryForName[i] = findEntryIndex(packageName, isStatic, entries);
- }
-
- List> resultList = new ArrayList>(names.size());
- for(int i = 0; i < entries.length; i++){
- for(int j = 0; j < names.size(); j++){
- if (entryForName[j] == i){
- resultList.add(names.get(j));
- names.set(j, null);
- }
- }
- }
- for (Pair name : names) {
- if (name != null) resultList.add(name);
- }
-
- TObjectIntHashMap packageToCountMap = new TObjectIntHashMap();
- TObjectIntHashMap classToCountMap = new TObjectIntHashMap();
- for (Pair pair : resultList) {
- String name = pair.getFirst();
- Boolean isStatic = pair.getSecond();
- String packageOrClassName = getPackageOrClassName(name);
- if (packageOrClassName.length() == 0) continue;
- if (isStatic) {
- int count = classToCountMap.get(packageOrClassName);
- classToCountMap.put(packageOrClassName, count + 1);
- }
- else {
- int count = packageToCountMap.get(packageOrClassName);
- packageToCountMap.put(packageOrClassName, count + 1);
- }
- }
+ List> resultList = sortItemsAccordingToSettings(names, mySettings);
final Set classesOrPackagesToImportOnDemand = new THashSet();
- class MyVisitorProcedure implements TObjectIntProcedure {
- private final boolean myIsVisitingPackages;
-
- MyVisitorProcedure(boolean isVisitingPackages) {
- myIsVisitingPackages = isVisitingPackages;
- }
-
- @Override
- public boolean execute(final String packageOrClassName, final int count) {
- if (isToUseImportOnDemand(packageOrClassName, count, !myIsVisitingPackages)){
- classesOrPackagesToImportOnDemand.add(packageOrClassName);
- }
- return true;
- }
- }
- classToCountMap.forEachEntry(new MyVisitorProcedure(false));
- packageToCountMap.forEachEntry(new MyVisitorProcedure(true));
+ collectOnDemandImports(resultList, classesOrPackagesToImportOnDemand, ImportHelper.this.mySettings);
Set classesToUseSingle = findSingleImports(file, resultList, classesOrPackagesToImportOnDemand);
Set toReimport = new THashSet();
@@ -176,6 +123,71 @@ public class ImportHelper{
}
}
+ public static void collectOnDemandImports(List> resultList,
+ final Set classesOrPackagesToImportOnDemand,
+ final CodeStyleSettings settings) {
+ TObjectIntHashMap packageToCountMap = new TObjectIntHashMap();
+ TObjectIntHashMap classToCountMap = new TObjectIntHashMap();
+ for (Pair pair : resultList) {
+ String name = pair.getFirst();
+ Boolean isStatic = pair.getSecond();
+ String packageOrClassName = getPackageOrClassName(name);
+ if (packageOrClassName.length() == 0) continue;
+ if (isStatic) {
+ int count = classToCountMap.get(packageOrClassName);
+ classToCountMap.put(packageOrClassName, count + 1);
+ }
+ else {
+ int count = packageToCountMap.get(packageOrClassName);
+ packageToCountMap.put(packageOrClassName, count + 1);
+ }
+ }
+
+
+ class MyVisitorProcedure implements TObjectIntProcedure {
+ private final boolean myIsVisitingPackages;
+
+ MyVisitorProcedure(boolean isVisitingPackages) {
+ myIsVisitingPackages = isVisitingPackages;
+ }
+
+ @Override
+ public boolean execute(final String packageOrClassName, final int count) {
+ if (isToUseImportOnDemand(packageOrClassName, count, !myIsVisitingPackages, settings)){
+ classesOrPackagesToImportOnDemand.add(packageOrClassName);
+ }
+ return true;
+ }
+ }
+ classToCountMap.forEachEntry(new MyVisitorProcedure(false));
+ packageToCountMap.forEachEntry(new MyVisitorProcedure(true));
+ }
+
+ public static List> sortItemsAccordingToSettings(List> names, final CodeStyleSettings settings) {
+ int[] entryForName = ArrayUtil.newIntArray(names.size());
+ PackageEntry[] entries = settings.IMPORT_LAYOUT_TABLE.getEntries();
+ for(int i = 0; i < names.size(); i++){
+ Pair pair = names.get(i);
+ String packageName = pair.getFirst();
+ Boolean isStatic = pair.getSecond();
+ entryForName[i] = findEntryIndex(packageName, isStatic, entries);
+ }
+
+ List> resultList = new ArrayList>(names.size());
+ for(int i = 0; i < entries.length; i++){
+ for(int j = 0; j < names.size(); j++){
+ if (entryForName[j] == i){
+ resultList.add(names.get(j));
+ names.set(j, null);
+ }
+ }
+ }
+ for (Pair name : names) {
+ if (name != null) resultList.add(name);
+ }
+ return resultList;
+ }
+
@NotNull
private static Set findSingleImports(@NotNull final PsiJavaFile file,
@NotNull List> names,
@@ -620,13 +632,16 @@ public class ImportHelper{
return maxSpace;
}
- private boolean isToUseImportOnDemand(@NotNull String packageName, int classCount, boolean isStaticImportNeeded){
- if (!mySettings.USE_SINGLE_CLASS_IMPORTS) return true;
- int limitCount = isStaticImportNeeded ? mySettings.NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND :
- mySettings.CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND;
+ private static boolean isToUseImportOnDemand(@NotNull String packageName,
+ int classCount,
+ boolean isStaticImportNeeded,
+ final CodeStyleSettings settings){
+ if (!settings.USE_SINGLE_CLASS_IMPORTS) return true;
+ int limitCount = isStaticImportNeeded ? settings.NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND :
+ settings.CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND;
if (classCount >= limitCount) return true;
if (packageName.length() == 0) return false;
- PackageEntryTable table = mySettings.PACKAGES_TO_USE_IMPORT_ON_DEMAND;
+ PackageEntryTable table = settings.PACKAGES_TO_USE_IMPORT_ON_DEMAND;
return table != null && table.contains(packageName);
}
diff --git a/java/java-psi-api/src/com/intellij/codeInsight/AnnotationUtil.java b/java/java-psi-api/src/com/intellij/codeInsight/AnnotationUtil.java
index 0ca2c3709680..d67dec73361f 100644
--- a/java/java-psi-api/src/com/intellij/codeInsight/AnnotationUtil.java
+++ b/java/java-psi-api/src/com/intellij/codeInsight/AnnotationUtil.java
@@ -293,9 +293,13 @@ public class AnnotationUtil {
}
public static boolean isAnnotatingApplicable(@NotNull PsiElement elt) {
+ return isAnnotatingApplicable(elt, NullableNotNullManager.getInstance(elt.getProject()).getDefaultNullable());
+ }
+
+ public static boolean isAnnotatingApplicable(@NotNull PsiElement elt, final String annotationFQN) {
final Project project = elt.getProject();
return PsiUtil.isLanguageLevel5OrHigher(elt) &&
- JavaPsiFacade.getInstance(project).findClass(NullableNotNullManager.getInstance(project).getDefaultNullable(), elt.getResolveScope()) != null;
+ JavaPsiFacade.getInstance(project).findClass(annotationFQN, elt.getResolveScope()) != null;
}
public static boolean isJetbrainsAnnotation(@NonNls final String simpleName) {
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/PsiImportListImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/PsiImportListImpl.java
index 05b5a6b86a1f..b49a615f0285 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/PsiImportListImpl.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/PsiImportListImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,10 @@ import com.intellij.psi.*;
import com.intellij.psi.impl.java.stubs.JavaStubElementTypes;
import com.intellij.psi.impl.java.stubs.PsiImportListStub;
import com.intellij.psi.impl.source.tree.ElementType;
-import com.intellij.util.containers.HashMap;
+import com.intellij.psi.impl.source.tree.JavaElementType;
+import com.intellij.psi.tree.TokenSet;
import com.intellij.util.ArrayFactory;
+import com.intellij.util.containers.HashMap;
import org.jetbrains.annotations.NotNull;
import java.util.Map;
@@ -63,17 +65,19 @@ public class PsiImportListImpl extends JavaStubPsiElement imp
super.subtreeChanged();
}
+ private static final TokenSet IMPORT_STATEMENT_BIT_SET = TokenSet.create(JavaElementType.IMPORT_STATEMENT);
+ private static final TokenSet IMPORT_STATIC_STATEMENT_BIT_SET = TokenSet.create(JavaElementType.IMPORT_STATIC_STATEMENT);
+
@Override
@NotNull
public PsiImportStatement[] getImportStatements() {
- return getStubOrPsiChildren(ElementType.IMPORT_STATEMENT_BIT_SET, PsiImportStatementImpl.ARRAY_FACTORY);
+ return getStubOrPsiChildren(IMPORT_STATEMENT_BIT_SET, PsiImportStatementImpl.ARRAY_FACTORY);
}
@Override
@NotNull
public PsiImportStaticStatement[] getImportStaticStatements() {
- return getStubOrPsiChildren(ElementType.IMPORT_STATIC_STATEMENT_BIT_SET, PsiImportStaticStatementImpl.ARRAY_FACTORY);
-
+ return getStubOrPsiChildren(IMPORT_STATIC_STATEMENT_BIT_SET, PsiImportStaticStatementImpl.ARRAY_FACTORY);
}
@Override
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiResolveHelperImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiResolveHelperImpl.java
index 5af0d2dae5b3..6f0b5c6a4ec4 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiResolveHelperImpl.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiResolveHelperImpl.java
@@ -205,6 +205,7 @@ public class PsiResolveHelperImpl implements PsiResolveHelper {
sortLambdaExpressionsLast(paramTypes, argTypes);
boolean rawType = false;
boolean nullPassed = false;
+ boolean lambdaRaw = false;
for (int j = 0; j < argTypes.length; j++) {
PsiType argumentType = argTypes[j];
if (argumentType == null) continue;
@@ -228,6 +229,12 @@ public class PsiResolveHelperImpl implements PsiResolveHelper {
if (currentSubstitution == FAILED_INFERENCE || (currentSubstitution == null && lowerBound == PsiType.NULL)) return RAW_INFERENCE;
}
if (nullPassed && currentSubstitution == null) return RAW_INFERENCE;
+ if (currentSubstitution != null && currentSubstitution.first == null) {
+ lambdaRaw = true;
+ }
+ if (currentSubstitution == null && lambdaRaw) {
+ return new Pair(PsiType.getJavaLangObject(typeParameter.getManager(), typeParameter.getResolveScope()), ConstraintType.EQUALS);
+ }
} else if (argumentType instanceof PsiMethodReferenceType) {
final PsiMethodReferenceExpression referenceExpression = ((PsiMethodReferenceType)argumentType).getExpression();
currentSubstitution = inferConstraintFromFunctionalInterfaceMethod(typeParameter, referenceExpression, partialSubstitutor.substitute(parameterType), partialSubstitutor, policy);
@@ -998,7 +1005,7 @@ public class PsiResolveHelperImpl implements PsiResolveHelper {
return null;
}
- private static Pair inferMethodTypeParameterFromParent(PsiElement parent,
+ private static Pair inferMethodTypeParameterFromParent(final PsiElement parent,
PsiExpression methodCall,
final PsiTypeParameter typeParameter,
PsiSubstitutor substitutor,
@@ -1065,16 +1072,24 @@ public class PsiResolveHelperImpl implements PsiResolveHelper {
}
}
} else if (parent instanceof PsiLambdaExpression) {
- expectedType = LambdaUtil.getFunctionalInterfaceReturnType(((PsiLambdaExpression)parent).getFunctionalInterfaceType());
+ expectedType = ourGraphGuard.doPreventingRecursion(methodCall, true, new Computable() {
+ @Override
+ public PsiType compute() {
+ return LambdaUtil.getFunctionalInterfaceReturnType(((PsiLambdaExpression)parent).getFunctionalInterfaceType());
+ }
+ });
if (expectedType == null) {
- return getFailedInferenceConstraint(typeParameter);
+ return null;
}
} else if (parent instanceof PsiTypeCastExpression) {
expectedType = ((PsiTypeCastExpression)parent).getType();
} else if (parent instanceof PsiConditionalExpression) {
if (PsiUtil.isLanguageLevel8OrHigher(parent)) {
try {
- return inferMethodTypeParameterFromParent(PsiUtil.skipParenthesizedExprUp(parent.getParent()), (PsiExpression)parent, typeParameter, substitutor, policy);
+ final Pair pair = inferFromConditionalExpression(parent, methodCall, typeParameter, substitutor, policy);
+ if (pair != null) {
+ return pair;
+ }
}
finally {
GraphInferencePolicy.forget(parent);
@@ -1175,6 +1190,42 @@ public class PsiResolveHelperImpl implements PsiResolveHelper {
return result;
}
+ private static Pair inferFromConditionalExpression(PsiElement parent,
+ PsiExpression methodCall,
+ PsiTypeParameter typeParameter,
+ PsiSubstitutor substitutor,
+ ParameterTypeInferencePolicy policy) {
+ Pair pair =
+ inferMethodTypeParameterFromParent(PsiUtil.skipParenthesizedExprUp(parent.getParent()), (PsiExpression)parent, typeParameter, substitutor, policy);
+ if (pair == null) {
+ final PsiExpression thenExpression = ((PsiConditionalExpression)parent).getThenExpression();
+ final PsiExpression elseExpression = ((PsiConditionalExpression)parent).getElseExpression();
+ final PsiType[] paramTypes = {((PsiMethod)typeParameter.getOwner()).getReturnType()};
+ if (methodCall.equals(PsiUtil.skipParenthesizedExprDown(elseExpression)) && thenExpression != null) {
+ final PsiType thenType = ourGraphGuard.doPreventingRecursion(thenExpression, true, new Computable() {
+ @Override
+ public PsiType compute() {
+ return thenExpression.getType();
+ }
+ });
+ if (thenType != null) {
+ pair = inferTypeForMethodTypeParameterInner(typeParameter, paramTypes, new PsiType[] {thenType}, substitutor, null, policy);
+ }
+ } else if (methodCall.equals(PsiUtil.skipParenthesizedExprDown(thenExpression)) && elseExpression != null) {
+ final PsiType elseType = ourGraphGuard.doPreventingRecursion(elseExpression, true, new Computable() {
+ @Override
+ public PsiType compute() {
+ return elseExpression.getType();
+ }
+ });
+ if (elseType != null) {
+ pair = inferTypeForMethodTypeParameterInner(typeParameter, paramTypes, new PsiType[] {elseType}, substitutor, null, policy);
+ }
+ }
+ }
+ return pair;
+ }
+
private static final ProcessCandidateParameterTypeInferencePolicy GRAPH_INFERENCE_POLICY = new GraphInferencePolicy();
private static Pair graphInferenceFromCallContext(@NotNull final PsiExpression methodCall,
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/ElementType.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/ElementType.java
index eb8328047d1e..b61fb3d147f5 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/ElementType.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/ElementType.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -70,12 +70,8 @@ public interface ElementType extends JavaTokenType, JavaDocTokenType, JavaElemen
WHILE_STATEMENT, FOR_STATEMENT, FOREACH_STATEMENT, DO_WHILE_STATEMENT, SWITCH_STATEMENT, SWITCH_LABEL_STATEMENT, BREAK_STATEMENT,
CONTINUE_STATEMENT, RETURN_STATEMENT, THROW_STATEMENT, SYNCHRONIZED_STATEMENT, TRY_STATEMENT, LABELED_STATEMENT, ASSERT_STATEMENT);
- TokenSet TYPES_BIT_SET = TokenSet.create(TYPE);
- TokenSet IMPORT_STATEMENT_BIT_SET = TokenSet.create(IMPORT_STATEMENT);
- TokenSet IMPORT_STATIC_STATEMENT_BIT_SET = TokenSet.create(IMPORT_STATIC_STATEMENT);
TokenSet IMPORT_STATEMENT_BASE_BIT_SET = TokenSet.create(IMPORT_STATEMENT, IMPORT_STATIC_STATEMENT);
TokenSet CLASS_KEYWORD_BIT_SET = TokenSet.create(CLASS_KEYWORD, INTERFACE_KEYWORD, ENUM_KEYWORD);
TokenSet MEMBER_BIT_SET = TokenSet.create(CLASS, FIELD, ENUM_CONSTANT, METHOD, ANNOTATION_METHOD);
TokenSet FULL_MEMBER_BIT_SET = TokenSet.orSet(MEMBER_BIT_SET, TokenSet.create(CLASS_INITIALIZER));
- TokenSet ANNOTATIONS = TokenSet.create(ANNOTATION);
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/ClassElement.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/ClassElement.java
index e3830e5d6be8..8b33ab278903 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/ClassElement.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/ClassElement.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -214,7 +214,7 @@ public class ClassElement extends CompositeElement implements Constants {
}
}
}
-
+
super.deleteChildInternal(child);
}
@@ -364,7 +364,7 @@ public class ClassElement extends CompositeElement implements Constants {
else if (i == JavaDocElementType.DOC_COMMENT) {
return getChildRole(child, ChildRole.DOC_COMMENT);
}
- else if (i == C_STYLE_COMMENT || i == END_OF_LINE_COMMENT) {
+ else if (ElementType.JAVA_PLAIN_COMMENT_BIT_SET.contains(i)) {
return ChildRoleBase.NONE;
}
else if (i == MODIFIER_LIST) {
@@ -376,7 +376,7 @@ public class ClassElement extends CompositeElement implements Constants {
else if (i == IMPLEMENTS_LIST) {
return ChildRole.IMPLEMENTS_LIST;
}
- else if (i == CLASS_KEYWORD || i == INTERFACE_KEYWORD || i == ENUM_KEYWORD) {
+ else if (ElementType.CLASS_KEYWORD_BIT_SET.contains(i)) {
return getChildRole(child, ChildRole.CLASS_OR_INTERFACE_KEYWORD);
}
else if (i == IDENTIFIER) {
@@ -403,5 +403,4 @@ public class ClassElement extends CompositeElement implements Constants {
protected boolean isVisibilitySupported() {
return true;
}
-
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiReferenceParameterListImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiReferenceParameterListImpl.java
index 0cdbf5c21e5a..e85e81cb4bd8 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiReferenceParameterListImpl.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiReferenceParameterListImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ public class PsiReferenceParameterListImpl extends CompositePsiElement implement
@Override
@NotNull
public PsiTypeElement[] getTypeParameterElements() {
- return getChildrenAsPsiElements(ElementType.TYPES_BIT_SET, PsiTypeElement.ARRAY_FACTORY);
+ return getChildrenAsPsiElements(JavaElementType.TYPE, PsiTypeElement.ARRAY_FACTORY);
}
@Override
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiTypeParameterImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiTypeParameterImpl.java
index d56a69b0bfb7..12bc9fb34ca2 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiTypeParameterImpl.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiTypeParameterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,8 +28,6 @@ import com.intellij.psi.impl.java.stubs.PsiTypeParameterStub;
import com.intellij.psi.impl.light.LightEmptyImplementsList;
import com.intellij.psi.impl.meta.MetaRegistry;
import com.intellij.psi.impl.source.JavaStubPsiElement;
-import com.intellij.psi.impl.source.tree.ChildRole;
-import com.intellij.psi.impl.source.tree.ElementType;
import com.intellij.psi.javadoc.PsiDocComment;
import com.intellij.psi.meta.PsiMetaData;
import com.intellij.psi.scope.PsiScopeProcessor;
@@ -44,7 +42,7 @@ import java.util.Collection;
import java.util.List;
/**
- * @author dsl
+ * @author dsl
*/
public class PsiTypeParameterImpl extends JavaStubPsiElement implements PsiTypeParameter {
private final LightEmptyImplementsList myLightEmptyImplementsList = new LightEmptyImplementsList(null) {
@@ -169,7 +167,7 @@ public class PsiTypeParameterImpl extends JavaStubPsiElement
+ }
+
+ void rMethod() {}
+}
+
+enum Zoo {
+ LEFT, RIGHT
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/AcceptRawSubstForLambda.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/AcceptRawSubstForLambda.java
new file mode 100644
index 000000000000..9f7573f82c4a
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/AcceptRawSubstForLambda.java
@@ -0,0 +1,30 @@
+public class CyclicReferenceTest {
+ void test(Match match) {
+ Match matcher = match.or(s -> Optional.empty(), i -> 2);
+ Match matcher1 = match.or(s -> s.startsWith("_") ? Optional.of(1) : Optional.empty(), i -> 2);
+ }
+}
+
+class Match {
+ public Match or(Extractor e, Function c) {
+ return this;
+ }
+}
+
+interface Extractor {
+ Optional unapply(T t);
+}
+
+interface Function {
+ public V apply(W t);
+}
+
+class Optional {
+ public static Optional empty() {
+ return null;
+ }
+
+ public static Optional of(T value) {
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/NotNullCatchParameter.java b/java/java-tests/testData/inspection/dataFlow/fixture/NotNullCatchParameter.java
new file mode 100644
index 000000000000..cb8849b090d7
--- /dev/null
+++ b/java/java-tests/testData/inspection/dataFlow/fixture/NotNullCatchParameter.java
@@ -0,0 +1,21 @@
+class MyException extends Exception {}
+
+class Foo {
+ public static void main(String[] args) {
+ try {
+ bar();
+ } catch (Exception e) {
+ if (e instanceof MyException) {
+ return;
+ }
+ if (e instanceof RuntimeException) {
+ return;
+ }
+ e.printStackTrace();
+ }
+ }
+
+ private static void bar() throws MyException {
+ }
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionOrderingTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionOrderingTest.groovy
index d9fa374fbe7e..c1fc757f89e5 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionOrderingTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionOrderingTest.groovy
@@ -98,11 +98,11 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
}
public void testDispreferDeclared() throws Throwable {
- checkPreferredItems(0, "aabbb", "aaa");
+ checkPreferredItems(0, "aabbb", "Aaaaaaa", "aaa");
}
public void testDispreferDeclaredOfExpectedType() throws Throwable {
- checkPreferredItems(0, "aabbb", "aaa");
+ checkPreferredItems(0, "aabbb", "Aaaaaaa", "aaa");
}
public void testDispreferImpls() throws Throwable {
@@ -596,4 +596,12 @@ import java.lang.annotation.Target;
assertPreferredItems 0, 'setText', 'setOurText'
}
+ public void testEnumConstantStartMatching() {
+ checkPreferredItems(0, 'rMethod', 'Zoo.RIGHT')
+ myFixture.type('i\n;\nreturn r')
+ myFixture.completeBasic()
+ assertPreferredItems 0, 'Zoo.RIGHT', 'rMethod'
+
+ }
+
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaHighlightingTest.java
index fb83818521de..53fa466743e8 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaHighlightingTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/LambdaHighlightingTest.java
@@ -216,6 +216,10 @@ public class LambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
doTest();
}
+ public void testAcceptRawSubstForLambda() throws Exception {
+ doTest();
+ }
+
public void testCheckFunctionalInterfaceAccess() throws Exception {
doTest();
}
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java
index 56fa8115d95f..eb2ec6a3fd5a 100644
--- a/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java
@@ -90,6 +90,7 @@ public class DataFlowInspectionTest extends LightCodeInsightFixtureTestCase {
public void testReturningNullFromVoidMethod() throws Throwable { doTest(); }
public void testCatchRuntimeException() throws Throwable { doTest(); }
+ public void testNotNullCatchParameter() { doTest(); }
public void testAssertFailInCatch() throws Throwable {
myFixture.addClass("package org.junit; public class Assert { public static void fail() {}}");
diff --git a/java/java-tests/testSrc/com/intellij/ide/fileStructure/JavaFileStructureFilteringTest.java b/java/java-tests/testSrc/com/intellij/ide/fileStructure/JavaFileStructureFilteringTest.java
index e2632105a56c..abbb1522855d 100644
--- a/java/java-tests/testSrc/com/intellij/ide/fileStructure/JavaFileStructureFilteringTest.java
+++ b/java/java-tests/testSrc/com/intellij/ide/fileStructure/JavaFileStructureFilteringTest.java
@@ -38,10 +38,10 @@ public class JavaFileStructureFilteringTest extends JavaFileStructureTestCase {
public void testSelectLeafFirst3() throws Exception {checkTree("clear");}
public void testSelectLeafFirst4() throws Exception {checkTree("clear");}
- @Bombed(user = "peter", month = Calendar.MARCH, day = 1)
+ @Bombed(user = "peter", month = Calendar.MAY, day = 10)
public void testMatcher1() throws Exception {checkTree("ico");}
- @Bombed(user = "peter", month = Calendar.MARCH, day = 1)
+ @Bombed(user = "peter", month = Calendar.MAY, day = 10)
public void testMatcher2() throws Exception {checkTree("ico");}
- @Bombed(user = "peter", month = Calendar.MARCH, day = 1)
+ @Bombed(user = "peter", month = Calendar.MAY, day = 10)
public void testAnonymousMatcher2() throws Exception {checkTree("ico");}
}
diff --git a/jps/jps-builders/src/org/jetbrains/jps/api/GlobalOptions.java b/jps/jps-builders/src/org/jetbrains/jps/api/GlobalOptions.java
index d772b3c6c1b4..67073eb67b94 100644
--- a/jps/jps-builders/src/org/jetbrains/jps/api/GlobalOptions.java
+++ b/jps/jps-builders/src/org/jetbrains/jps/api/GlobalOptions.java
@@ -25,4 +25,5 @@ public interface GlobalOptions {
String GENERATE_CLASSPATH_INDEX_OPTION = "generate.classpath.index";
String COMPILE_PARALLEL_OPTION = "compile.parallel";
String COMPILE_PARALLEL_MAX_THREADS_OPTION = "compile.parallel.max.threads";
+ String REBUILD_ON_DEPENDENCY_CHANGE_OPTION = "rebuild.on.dependency.change";
}
diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/BuildOperations.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/BuildOperations.java
index c924d6d5e345..25effec23dca 100644
--- a/jps/jps-builders/src/org/jetbrains/jps/incremental/BuildOperations.java
+++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/BuildOperations.java
@@ -22,10 +22,13 @@ import org.jetbrains.jps.builders.*;
import org.jetbrains.jps.builders.impl.BuildOutputConsumerImpl;
import org.jetbrains.jps.builders.impl.BuildTargetChunk;
import org.jetbrains.jps.builders.impl.DirtyFilesHolderBase;
+import org.jetbrains.jps.builders.java.JavaModuleBuildTargetType;
import org.jetbrains.jps.builders.logging.ProjectBuilderLogger;
import org.jetbrains.jps.builders.storage.SourceToOutputMapping;
import org.jetbrains.jps.cmdline.ProjectDescriptor;
import org.jetbrains.jps.incremental.fs.BuildFSState;
+import org.jetbrains.jps.incremental.messages.BuildMessage;
+import org.jetbrains.jps.incremental.messages.CompilerMessage;
import org.jetbrains.jps.incremental.messages.DoneSomethingNotification;
import org.jetbrains.jps.incremental.messages.FileDeletedEvent;
import org.jetbrains.jps.incremental.storage.BuildDataManager;
@@ -48,17 +51,25 @@ public class BuildOperations {
final ProjectDescriptor pd = context.getProjectDescriptor();
final Timestamps timestamps = pd.timestamps.getStorage();
final BuildTargetConfiguration configuration = pd.getTargetsState().getTargetConfiguration(target);
-
+ boolean isTargetConfigChange = false;
if (context.isProjectRebuild()) {
FSOperations.markDirtyFiles(context, target, timestamps, true, null, null);
pd.fsState.markInitialScanPerformed(target);
configuration.save();
}
- else if (context.getScope().isRecompilationForced(target) || configuration.isTargetDirty() || configuration.outputRootWasDeleted(context)) {
+ else if (context.getScope().isRecompilationForced(target) ||
+ (isTargetConfigChange = configuration.isTargetDirty()) ||
+ configuration.outputRootWasDeleted(context)) {
initTargetFSState(context, target, true);
IncProjectBuilder.clearOutputFiles(context, target);
pd.dataManager.cleanTargetStorages(target);
configuration.save();
+
+ if (isTargetConfigChange && ModuleBuildTarget.REBUILD_ON_DEPENDENCY_CHANGE && JavaModuleBuildTargetType.PRODUCTION.equals(target.getTargetType())) {
+ final String moduleName = ((ModuleBuildTarget)target).getModule().getName();
+ context.processMessage(new CompilerMessage("", BuildMessage.Kind.INFO, "Rebuilding module \"" + moduleName + "\" because of dependencies change"));
+ }
+
}
else if (!pd.fsState.isInitialScanPerformed(target)) {
initTargetFSState(context, target, false);
diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/ModuleBuildTarget.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/ModuleBuildTarget.java
index e27534b98d40..2ae917dcf319 100644
--- a/jps/jps-builders/src/org/jetbrains/jps/incremental/ModuleBuildTarget.java
+++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/ModuleBuildTarget.java
@@ -22,6 +22,7 @@ import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.ProjectPaths;
+import org.jetbrains.jps.api.GlobalOptions;
import org.jetbrains.jps.builders.*;
import org.jetbrains.jps.builders.java.ExcludedJavaSourceRootProvider;
import org.jetbrains.jps.builders.java.JavaModuleBuildTargetType;
@@ -50,6 +51,9 @@ import java.util.Set;
* @author nik
*/
public final class ModuleBuildTarget extends JVMModuleBuildTarget {
+ public static final Boolean REBUILD_ON_DEPENDENCY_CHANGE = Boolean.valueOf(
+ System.getProperty(GlobalOptions.REBUILD_ON_DEPENDENCY_CHANGE_OPTION, "true")
+ );
private final JavaModuleBuildTargetType myTargetType;
public ModuleBuildTarget(@NotNull JpsModule module, JavaModuleBuildTargetType targetType) {
@@ -169,10 +173,13 @@ public final class ModuleBuildTarget extends JVMModuleBuildTarget() {
@Override
public boolean value(String s) {
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByLineCommentHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByLineCommentHandler.java
index db00b690b06a..3e12b980eae1 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByLineCommentHandler.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByLineCommentHandler.java
@@ -36,6 +36,7 @@ import com.intellij.openapi.fileTypes.impl.CustomSyntaxTableFileType;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
@@ -46,7 +47,6 @@ import com.intellij.psi.codeStyle.Indent;
import com.intellij.psi.util.PsiUtilBase;
import com.intellij.util.DocumentUtil;
import com.intellij.util.StringBuilderSpinAllocator;
-import com.intellij.util.SystemProperties;
import com.intellij.util.containers.IntArrayList;
import com.intellij.util.text.CharArrayUtil;
import gnu.trove.THashMap;
@@ -57,9 +57,6 @@ import java.util.Map;
public class CommentByLineCommentHandler implements CodeInsightActionHandler {
- private static final int MIN_LINES_TO_COMMENT_TO_USE_BULK_PROCESSING
- = SystemProperties.getIntProperty("idea.bulk.comment.lines.trigger", 100);
-
private Project myProject;
private PsiFile myFile;
private Document myDocument;
@@ -424,7 +421,8 @@ public class CommentByLineCommentHandler implements CodeInsightActionHandler {
}
public void doDefaultCommenting(final Commenter commenter) {
- DocumentUtil.executeInBulk(myDocument, myEndLine - myStartLine >= MIN_LINES_TO_COMMENT_TO_USE_BULK_PROCESSING, new Runnable() {
+ DocumentUtil.executeInBulk(
+ myDocument, myEndLine - myStartLine >= Registry.intValue("comment.by.line.bulk.lines.trigger"), new Runnable() {
@Override
public void run() {
for (int line = myEndLine; line >= myStartLine; line--) {
@@ -440,7 +438,8 @@ public class CommentByLineCommentHandler implements CodeInsightActionHandler {
final FileType fileType = myFile.getFileType();
final Indent minIndent = computeMinIndent(myStartLine, myEndLine, chars, myCodeStyleManager, fileType);
- DocumentUtil.executeInBulk(myDocument, myEndLine - myStartLine > MIN_LINES_TO_COMMENT_TO_USE_BULK_PROCESSING, new Runnable() {
+ DocumentUtil.executeInBulk(
+ myDocument, myEndLine - myStartLine > Registry.intValue("comment.by.line.bulk.lines.trigger"), new Runnable() {
@Override
public void run() {
for (int line = myEndLine; line >= myStartLine; line--) {
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/ImplementationViewComponent.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/ImplementationViewComponent.java
index 715fd486f772..efa6561c24a0 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/hint/ImplementationViewComponent.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/ImplementationViewComponent.java
@@ -420,6 +420,7 @@ public class ImplementationViewComponent extends JPanel {
}
+ @Nullable
public static String getNewText(PsiElement elt) {
Project project = elt.getProject();
PsiFile psiFile = getContainingFile(elt);
@@ -427,6 +428,10 @@ public class ImplementationViewComponent extends JPanel {
final Document doc = PsiDocumentManager.getInstance(project).getDocument(psiFile);
if (doc == null) return null;
+ if (elt.getTextRange() == null) {
+ return null;
+ }
+
final ImplementationTextSelectioner implementationTextSelectioner =
LanguageImplementationTextSelectioner.INSTANCE.forLanguage(elt.getLanguage());
int start = implementationTextSelectioner.getTextStartOffset(elt);
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoController.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoController.java
index a486736b6c4d..a16223f1fd49 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoController.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoController.java
@@ -274,7 +274,7 @@ public class ParameterInfoController {
if (elementForUpdating != null) {
myHandler.updateParameterInfo(elementForUpdating, context);
- if (myHint.isVisible() && myEditor.getComponent().getRootPane() != null) {
+ if (!myDisposed && myHint.isVisible() && myEditor.getComponent().getRootPane() != null) {
myComponent.update();
Pair pos = myProvider.getBestPointPosition(myHint, (PsiElement)elementForUpdating, offset, true, HintManager.UNDER);
HintManagerImpl.adjustEditorHintPosition(myHint, myEditor, pos.getFirst(), pos.getSecond());
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/GotoTypeDeclarationAction.java b/platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/GotoTypeDeclarationAction.java
index e0d06b82b14f..ba7bc9d08159 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/GotoTypeDeclarationAction.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/GotoTypeDeclarationAction.java
@@ -84,7 +84,7 @@ public class GotoTypeDeclarationAction extends BaseCodeInsightAction implements
private static void navigate(@NotNull Project project, @NotNull PsiElement symbolType) {
PsiElement element = symbolType.getNavigationElement();
- assert element != null;
+ assert element != null : "SymbolType :"+symbolType+"; file: "+symbolType.getContainingFile();
VirtualFile file = element.getContainingFile().getVirtualFile();
if (file != null) {
OpenFileDescriptor descriptor = new OpenFileDescriptor(project, file, element.getTextOffset());
diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java
index 103560466ea5..b60b58736eb3 100644
--- a/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java
+++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java
@@ -261,7 +261,8 @@ public class InspectionProfileImpl extends ProfileEx implements ModifiableModel,
StringInterner interner = new StringInterner();
for (final Object o : element.getChildren(INSPECTION_TOOL_TAG)) {
- Element toolElement = (Element)o;
+ // make clone to avoid retaining memory via o.parent pointers
+ Element toolElement = (Element)((Element)o).clone();
JDOMUtil.internElement(toolElement, interner);
String toolClassName = toolElement.getAttributeValue(CLASS_TAG);
diff --git a/platform/lang-impl/src/com/intellij/execution/impl/ExecutionManagerImpl.java b/platform/lang-impl/src/com/intellij/execution/impl/ExecutionManagerImpl.java
index 333683dcb07a..62873194e340 100644
--- a/platform/lang-impl/src/com/intellij/execution/impl/ExecutionManagerImpl.java
+++ b/platform/lang-impl/src/com/intellij/execution/impl/ExecutionManagerImpl.java
@@ -261,7 +261,7 @@ public class ExecutionManagerImpl extends ExecutionManager implements ProjectCom
public void restartRunProfile(@NotNull final Project project,
@NotNull final Executor executor,
@NotNull final ExecutionTarget target,
- @NotNull final RunnerAndConfigurationSettings configuration,
+ @Nullable final RunnerAndConfigurationSettings configuration,
@Nullable final ProcessHandler processHandler) {
if (processHandler != null) {
for (RunContentDescriptor descriptor : getContentManager().getAllDescriptors()) {
@@ -279,13 +279,18 @@ public class ExecutionManagerImpl extends ExecutionManager implements ProjectCom
public void restartRunProfile(@NotNull final Project project,
@NotNull final Executor executor,
@NotNull final ExecutionTarget target,
- @NotNull final RunnerAndConfigurationSettings configuration,
+ @Nullable final RunnerAndConfigurationSettings configuration,
@Nullable final RunContentDescriptor currentDescriptor) {
- if (ProgramRunnerUtil.getRunner(executor.getId(), configuration) == null) {
+ if (configuration != null && ProgramRunnerUtil.getRunner(executor.getId(), configuration) == null) {
+ LOG.error("Cannot find runner for " + configuration.getName());
+ return;
+ }
+ if (configuration == null && (currentDescriptor == null || currentDescriptor.getRestarter() == null)) {
+ LOG.error("Nothing to restart");
return;
}
final List descriptorsToStop = new ArrayList();
- if (configuration.isSingleton()) {
+ if (configuration != null && configuration.isSingleton()) {
descriptorsToStop.addAll(getRunningDescriptors(configuration));
}
else if (currentDescriptor != null) {
@@ -293,7 +298,7 @@ public class ExecutionManagerImpl extends ExecutionManager implements ProjectCom
}
if (!descriptorsToStop.isEmpty()) {
- if ((descriptorsToStop.size() > 1 || currentDescriptor == null || descriptorsToStop.get(0) != currentDescriptor) &&
+ if (configuration != null && (descriptorsToStop.size() > 1 || currentDescriptor == null || descriptorsToStop.get(0) != currentDescriptor) &&
!userApprovesStop(project, configuration.getName(), descriptorsToStop.size())) {
return;
}
@@ -302,7 +307,7 @@ public class ExecutionManagerImpl extends ExecutionManager implements ProjectCom
}
}
else {
- ProgramRunnerUtil.executeConfiguration(project, configuration, executor, target, currentDescriptor, true);
+ start(project, configuration, executor, target, currentDescriptor);
return;
}
@@ -316,12 +321,26 @@ public class ExecutionManagerImpl extends ExecutionManager implements ProjectCom
return;
}
}
- ProgramRunnerUtil.executeConfiguration(project, configuration, executor, target, currentDescriptor, true);
+ start(project, configuration, executor, target, currentDescriptor);
}
};
awaitingTerminationAlarm.addRequest(runnable, 100);
}
+ private static void start(@NotNull Project project,
+ @Nullable RunnerAndConfigurationSettings configuration,
+ @NotNull Executor executor,
+ @NotNull ExecutionTarget target,
+ @Nullable RunContentDescriptor descriptor) {
+ Runnable restarter = descriptor != null ? descriptor.getRestarter() : null;
+ if (configuration != null) {
+ ProgramRunnerUtil.executeConfiguration(project, configuration, executor, target, descriptor, true);
+ }
+ else if (restarter != null) {
+ restarter.run();
+ }
+ }
+
private static boolean userApprovesStop(Project project, String configName, int instancesCount) {
RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(project);
final RunManagerConfig config = runManager.getConfig();
@@ -376,7 +395,7 @@ public class ExecutionManagerImpl extends ExecutionManager implements ProjectCom
}
- private void stop(RunContentDescriptor runContentDescriptor) {
+ private static void stop(RunContentDescriptor runContentDescriptor) {
ProcessHandler processHandler = runContentDescriptor != null ? runContentDescriptor.getProcessHandler() : null;
if (processHandler == null) {
return;
diff --git a/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.java b/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.java
index 58ae0b7e4d9a..876a4303f50c 100644
--- a/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.java
+++ b/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.java
@@ -19,6 +19,7 @@ package com.intellij.execution.impl;
import com.intellij.execution.*;
import com.intellij.execution.configurations.*;
import com.intellij.ide.util.PropertiesComponent;
+import com.intellij.ide.util.projectWizard.ProjectTemplateComponent;
import com.intellij.openapi.components.ProjectComponent;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
@@ -39,7 +40,7 @@ import javax.swing.*;
import java.util.*;
-public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable, ProjectComponent {
+public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable, ProjectComponent, ProjectTemplateComponent {
private final Project myProject;
private final Map myTypesByName = new LinkedHashMap();
@@ -1140,4 +1141,9 @@ public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable,
myProviderKeysMap.put(id.toString(), id);
}
}
+
+ @Override
+ public String getStorageFile() {
+ return "workspace.xml";
+ }
}
diff --git a/platform/lang-impl/src/com/intellij/execution/runners/RestartAction.java b/platform/lang-impl/src/com/intellij/execution/runners/RestartAction.java
index a0605c6b8e21..03e302bbf4d0 100644
--- a/platform/lang-impl/src/com/intellij/execution/runners/RestartAction.java
+++ b/platform/lang-impl/src/com/intellij/execution/runners/RestartAction.java
@@ -108,31 +108,24 @@ public class RestartAction extends FakeRerunAction implements DumbAware, AnActio
public void actionPerformed(final AnActionEvent e) {
Project project = myEnvironment.getProject();
- RunnerAndConfigurationSettings settings = myEnvironment.getRunnerAndConfigurationSettings();
if (project == null)
return;
- if (settings != null) {
if (myProcessHandler != null) {
ExecutionManager.getInstance(project).restartRunProfile(project,
myExecutor,
myEnvironment.getExecutionTarget(),
- settings,
+ myEnvironment.getRunnerAndConfigurationSettings(),
myProcessHandler);
}
else {
ExecutionManager.getInstance(project).restartRunProfile(project,
myExecutor,
myEnvironment.getExecutionTarget(),
- settings,
+ myEnvironment.getRunnerAndConfigurationSettings(),
myDescriptor);
}
- }
- else {
- restart();
- }
}
- //Should be used by android framework only
public void restart() {
final Project project = PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(myDescriptor.getComponent()));
if (ExecutorRegistry.getInstance().isStarting(project, myExecutor.getId(), myRunner.getRunnerId())) {
diff --git a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeViewPanel.java b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeViewPanel.java
index 84b29b056686..6c5cf7f9f8d0 100644
--- a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeViewPanel.java
+++ b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeViewPanel.java
@@ -588,19 +588,20 @@ public class FavoritesTreeViewPanel extends JPanel implements DataProvider, Dock
window.setTitleActions(collapseAction);
final DefaultActionGroup group = new DefaultActionGroup();
- if (!PlatformUtils.isAppCode()) {
- group.add(new FavoritesShowMembersAction(myProject, myBuilder));
- }
-
final ProjectViewDirectoryHelper helper = ProjectViewDirectoryHelper.getInstance(myProject);
if (helper.supportsFlattenPackages()) {
group.add(new FavoritesFlattenPackagesAction(myProject, myBuilder));
}
-
if (helper.supportsHideEmptyMiddlePackages()) {
group.add(new FavoritesCompactEmptyMiddlePackagesAction(myProject, myBuilder));
}
+ if (helper.supportsFlattenPackages()) {
+ group.addAction(new FavoritesAbbreviatePackageNamesAction(myProject, myBuilder));
+ }
+ if (!PlatformUtils.isAppCode()) {
+ group.add(new FavoritesShowMembersAction(myProject, myBuilder));
+ }
final FavoritesAutoscrollFromSourceHandler handler = new FavoritesAutoscrollFromSourceHandler(myProject, myBuilder);
handler.install();
diff --git a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesViewSettings.java b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesViewSettings.java
index 915d59df0440..4870d4e605b2 100644
--- a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesViewSettings.java
+++ b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesViewSettings.java
@@ -39,6 +39,9 @@ public class FavoritesViewSettings implements ViewSettings {
@PropertyName("favorites.view.settings.hide.empty.middle.packages")
public boolean myHideEmptyMiddlePackages = true;
+ @PropertyName("favorites.view.settings.abbreviate.qualified.package.names")
+ public boolean myAbbreviateQualifiedPackages = false;
+
public FavoritesViewSettings() {
PropertiesComponent.getInstance().loadFields(this);
@@ -89,7 +92,7 @@ public class FavoritesViewSettings implements ViewSettings {
@Override
public boolean isAbbreviatePackageNames() {
- return false;
+ return myAbbreviateQualifiedPackages;
}
@Override
@@ -115,4 +118,9 @@ public class FavoritesViewSettings implements ViewSettings {
myHideEmptyMiddlePackages = hide;
save();
}
+
+ public void setAbbreviateQualifiedPackages(boolean abbreviate) {
+ myAbbreviateQualifiedPackages = abbreviate;
+ save();
+ }
}
diff --git a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/actions/FavoritesAbbreviatePackageNamesAction.java b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/actions/FavoritesAbbreviatePackageNamesAction.java
new file mode 100644
index 000000000000..ea686dd178ab
--- /dev/null
+++ b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/actions/FavoritesAbbreviatePackageNamesAction.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.ide.favoritesTreeView.actions;
+
+import com.intellij.icons.AllIcons;
+import com.intellij.ide.IdeBundle;
+import com.intellij.ide.favoritesTreeView.FavoritesViewTreeBuilder;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.project.Project;
+
+/**
+ * User: Vassiliy.Kudryashov
+ */
+public class FavoritesAbbreviatePackageNamesAction extends FavoritesToolbarButtonAction {
+ public FavoritesAbbreviatePackageNamesAction(Project project, FavoritesViewTreeBuilder builder) {
+ super(project, builder, IdeBundle.message("action.abbreviate.qualified.package.names"), AllIcons.ObjectBrowser.AbbreviatePackageNames);
+ }
+
+ @Override
+ public boolean isOptionEnabled() {
+ return getViewSettings().isAbbreviatePackageNames();
+ }
+
+ @Override
+ public void setOption(boolean enabled) {
+ getViewSettings().setAbbreviateQualifiedPackages(enabled);
+ }
+
+ @Override
+ public void updateButton(AnActionEvent e) {
+ super.updateButton(e);
+ setVisible(getViewSettings().isFlattenPackages());
+ }
+}
diff --git a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/actions/FavoritesCompactEmptyMiddlePackagesAction.java b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/actions/FavoritesCompactEmptyMiddlePackagesAction.java
index 38e73a631048..9781ff8d4249 100644
--- a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/actions/FavoritesCompactEmptyMiddlePackagesAction.java
+++ b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/actions/FavoritesCompactEmptyMiddlePackagesAction.java
@@ -18,12 +18,35 @@ package com.intellij.ide.favoritesTreeView.actions;
import com.intellij.icons.AllIcons;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.favoritesTreeView.FavoritesViewTreeBuilder;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.project.Project;
/**
* @author Konstantin Bulenkov
*/
public class FavoritesCompactEmptyMiddlePackagesAction extends FavoritesToolbarButtonAction {
+ public FavoritesCompactEmptyMiddlePackagesAction(Project project, FavoritesViewTreeBuilder builder) {
+ super(project, builder,
+ IdeBundle.message("action.compact.empty.middle.packages"),
+ AllIcons.ObjectBrowser.CompactEmptyPackages);
+ }
+
+ @Override
+ public void updateButton(AnActionEvent e) {
+ super.updateButton(e);
+ Presentation presentation = e.getPresentation();
+ if (getViewSettings().isFlattenPackages()) {
+ presentation.setText(IdeBundle.message("action.hide.empty.middle.packages"));
+ presentation.setDescription(IdeBundle.message("action.show.hide.empty.middle.packages"));
+ }
+ else {
+ presentation.setText(IdeBundle.message("action.compact.empty.middle.packages"));
+ presentation.setDescription(IdeBundle.message("action.show.compact.empty.middle.packages"));
+ }
+
+ }
+
@Override
public boolean isOptionEnabled() {
return getViewSettings().isHideEmptyMiddlePackages();
@@ -33,10 +56,4 @@ public class FavoritesCompactEmptyMiddlePackagesAction extends FavoritesToolbarB
public void setOption(boolean hide) {
getViewSettings().setHideEmptyMiddlePackages(hide);
}
-
- public FavoritesCompactEmptyMiddlePackagesAction(Project project, FavoritesViewTreeBuilder builder) {
- super(project, builder,
- IdeBundle.message("action.compact.empty.middle.packages"),
- AllIcons.ObjectBrowser.CompactEmptyPackages);
- }
}
diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexImpl.java b/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexImpl.java
index edb2bb87bf70..7a4a7a01e852 100644
--- a/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexImpl.java
+++ b/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexImpl.java
@@ -139,7 +139,7 @@ public class DirectoryIndexImpl extends DirectoryIndex {
}
}
- protected void dispatchPendingEvents() {
+ private void dispatchPendingEvents() {
myConnection.deliverImmediately();
}
@@ -414,7 +414,7 @@ public class DirectoryIndexImpl extends DirectoryIndex {
return myInitialized;
}
- protected void doInitialize() {
+ private void doInitialize() {
IndexState newState = new IndexState();
newState.doInitialize(false);
myState = newState;
@@ -428,7 +428,7 @@ public class DirectoryIndexImpl extends DirectoryIndex {
}
@NotNull
- protected static ContentEntry[] getContentEntries(@NotNull Module module) {
+ private static ContentEntry[] getContentEntries(@NotNull Module module) {
return ModuleRootManager.getInstance(module).getContentEntries();
}
@@ -478,12 +478,12 @@ public class DirectoryIndexImpl extends DirectoryIndex {
}
@Nullable
- protected static String getPackageNameForSubdir(String parentPackageName, String subdirName) {
+ private static String getPackageNameForSubdir(String parentPackageName, String subdirName) {
if (parentPackageName == null) return null;
return parentPackageName.isEmpty() ? subdirName : parentPackageName + "." + subdirName;
}
- class IndexState {
+ private class IndexState {
private final TIntObjectHashMap> myExcludeRootsMap = new TIntObjectHashMap>();
private final TIntHashSet myProjectExcludeRoots = new TIntHashSet();
private final TIntObjectHashMap myDirToInfoMap = new TIntObjectHashMap();
@@ -551,11 +551,10 @@ public class DirectoryIndexImpl extends DirectoryIndex {
}
@Nullable
- DirectoryInfo getInfo(int fileId) {
+ private DirectoryInfo getInfo(int fileId) {
return myDirToInfoMap.get(fileId);
}
-
private void storeInfo(@NotNull DirectoryInfo info, int id) {
if (CHECK) {
VirtualFile file = findFileById(id);
@@ -567,7 +566,7 @@ public class DirectoryIndexImpl extends DirectoryIndex {
myDirToInfoMap.put(id, info);
}
- void assertAncestorsConsistent() {
+ private void assertAncestorsConsistent() {
if (CHECK) {
myDirToInfoMap.forEachEntry(new TIntObjectProcedure() {
@Override
@@ -594,10 +593,10 @@ public class DirectoryIndexImpl extends DirectoryIndex {
}
}
- void fillMapWithModuleContent(@NotNull NewVirtualFile root,
- final Module module,
- final NewVirtualFile contentRoot,
- @Nullable final ProgressIndicator progress) {
+ private void fillMapWithModuleContent(@NotNull NewVirtualFile root,
+ final Module module,
+ final NewVirtualFile contentRoot,
+ @Nullable final ProgressIndicator progress) {
final int contentRootId = contentRoot == null ? 0 : contentRoot.getId();
if (contentRoot != null) {
assert VfsUtilCore.isAncestor(contentRoot, root, false) : "Root: "+root+"; contentRoot: "+contentRoot;
@@ -725,13 +724,13 @@ public class DirectoryIndexImpl extends DirectoryIndex {
}
}
- protected void fillMapWithModuleSource(@NotNull final Module module,
- @NotNull final NewVirtualFile contentRoot,
- @NotNull final NewVirtualFile dir,
- @NotNull final String packageName,
- @NotNull final NewVirtualFile sourceRoot,
- final boolean isTestSource,
- @Nullable final ProgressIndicator progress) {
+ private void fillMapWithModuleSource(@NotNull final Module module,
+ @NotNull final NewVirtualFile contentRoot,
+ @NotNull final NewVirtualFile dir,
+ @NotNull final String packageName,
+ @NotNull final NewVirtualFile sourceRoot,
+ final boolean isTestSource,
+ @Nullable final ProgressIndicator progress) {
assert VfsUtilCore.isAncestor(sourceRoot, dir, false) : "SourceRoot: "+sourceRoot+" ("+sourceRoot.getFileSystem()+"); dir: "+dir+" ("+dir.getFileSystem()+")";
VfsUtilCore.visitChildrenRecursively(dir, new DirectoryVisitor() {
private final Stack myPackages = new Stack();
@@ -945,7 +944,7 @@ public class DirectoryIndexImpl extends DirectoryIndex {
}
}
- protected void setPackageName(int dirId, @Nullable String newPackageName) {
+ private void setPackageName(int dirId, @Nullable String newPackageName) {
String oldPackageName = myDirToPackageName.get(dirId);
if (oldPackageName != null) {
removeDirFromPackage(oldPackageName, dirId);
@@ -962,13 +961,13 @@ public class DirectoryIndexImpl extends DirectoryIndex {
}
// orderEntries must be sorted BY_OWNER_MODULE
- protected void fillMapWithOrderEntries(@NotNull NewVirtualFile root,
- @NotNull final OrderEntry[] orderEntries,
- @Nullable final Module module,
- @Nullable final NewVirtualFile libraryClassRoot,
- @Nullable final NewVirtualFile librarySourceRoot,
- @Nullable final DirectoryInfo parentInfo,
- @Nullable final ProgressIndicator progress) {
+ private void fillMapWithOrderEntries(@NotNull NewVirtualFile root,
+ @NotNull final OrderEntry[] orderEntries,
+ @Nullable final Module module,
+ @Nullable final NewVirtualFile libraryClassRoot,
+ @Nullable final NewVirtualFile librarySourceRoot,
+ @Nullable final DirectoryInfo parentInfo,
+ @Nullable final ProgressIndicator progress) {
VfsUtilCore.visitChildrenRecursively(root, new DirectoryVisitor() {
private final Stack myEntries = new Stack();
@@ -1014,7 +1013,7 @@ public class DirectoryIndexImpl extends DirectoryIndex {
});
}
- protected void doInitialize(boolean reverseAllSets/* for testing order independence*/) {
+ private void doInitialize(boolean reverseAllSets/* for testing order independence*/) {
assertAncestorsConsistent();
ProgressIndicator progress = ProgressIndicatorProvider.getGlobalProgressIndicator();
if (progress == null) progress = new EmptyProgressIndicator();
@@ -1148,7 +1147,7 @@ public class DirectoryIndexImpl extends DirectoryIndex {
}
@NotNull
- IndexState copy(@Nullable final TIntProcedure idFilter) {
+ private IndexState copy(@Nullable final TIntProcedure idFilter) {
final IndexState copy = new IndexState();
myExcludeRootsMap.forEachEntry(new TIntObjectProcedure>() {
diff --git a/platform/lang-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/CommonMoveUtil.java b/platform/lang-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/CommonMoveUtil.java
index 475c16c2f326..4a1591dbac98 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/CommonMoveUtil.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/CommonMoveUtil.java
@@ -1,6 +1,9 @@
package com.intellij.refactoring.move.moveClassesOrPackages;
import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.ProperTextRange;
+import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiReference;
import com.intellij.refactoring.util.MoveRenameUsageInfo;
@@ -8,9 +11,7 @@ import com.intellij.refactoring.util.NonCodeUsageInfo;
import com.intellij.usageView.UsageInfo;
import com.intellij.util.IncorrectOperationException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
public class CommonMoveUtil {
@@ -21,6 +22,24 @@ public class CommonMoveUtil {
public static NonCodeUsageInfo[] retargetUsages(final UsageInfo[] usages, final Map oldToNewElementsMapping)
throws IncorrectOperationException {
+ Arrays.sort(usages, new Comparator() {
+ @Override
+ public int compare(UsageInfo o1, UsageInfo o2) {
+ final VirtualFile file1 = o1.getVirtualFile();
+ final VirtualFile file2 = o2.getVirtualFile();
+ if (Comparing.equal(file1, file2)) {
+ final ProperTextRange rangeInElement1 = o1.getRangeInElement();
+ final ProperTextRange rangeInElement2 = o2.getRangeInElement();
+ if (rangeInElement1 != null && rangeInElement2 != null) {
+ return rangeInElement2.getStartOffset() - rangeInElement1.getStartOffset();
+ }
+ return 0;
+ }
+ if (file1 == null) return -1;
+ if (file2 == null) return 1;
+ return Comparing.compare(file1.getPath(), file2.getPath());
+ }
+ });
List nonCodeUsages = new ArrayList();
for (UsageInfo usage : usages) {
if (usage instanceof NonCodeUsageInfo) {
diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/RenamePsiElementProcessor.java b/platform/lang-impl/src/com/intellij/refactoring/rename/RenamePsiElementProcessor.java
index 3a095feff05a..736f482259da 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/rename/RenamePsiElementProcessor.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/rename/RenamePsiElementProcessor.java
@@ -59,6 +59,11 @@ public abstract class RenamePsiElementProcessor {
RenameUtil.doRenameGenericNamedElement(element, newName, usages, listener);
}
+ @NotNull
+ public Collection findReferences(final PsiElement element, boolean searchInCommentsAndStrings) {
+ return findReferences(element);
+ }
+
@NotNull
public Collection findReferences(final PsiElement element) {
return ReferencesSearch.search(element).findAll();
diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/RenameUtil.java b/platform/lang-impl/src/com/intellij/refactoring/rename/RenameUtil.java
index c810f88cc359..05acdf4257d2 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/rename/RenameUtil.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/rename/RenameUtil.java
@@ -68,7 +68,7 @@ public class RenameUtil {
GlobalSearchScope projectScope = GlobalSearchScope.projectScope(manager.getProject());
RenamePsiElementProcessor processor = RenamePsiElementProcessor.forElement(element);
- Collection refs = processor.findReferences(element);
+ Collection refs = processor.findReferences(element, searchInStringsAndComments);
for (final PsiReference ref : refs) {
if (ref == null) {
LOG.error("null reference from processor " + processor);
diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/RenameChooser.java b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/RenameChooser.java
index dce7f6da2baa..36aa8673efa1 100644
--- a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/RenameChooser.java
+++ b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/RenameChooser.java
@@ -15,6 +15,7 @@
*/
package com.intellij.refactoring.rename.inplace;
+import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.colors.EditorColors;
import com.intellij.openapi.editor.colors.EditorColorsManager;
@@ -26,6 +27,7 @@ import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiReference;
+import com.intellij.refactoring.RefactoringSettings;
import com.intellij.ui.components.JBList;
import org.jetbrains.annotations.NonNls;
@@ -54,6 +56,11 @@ abstract class RenameChooser {
public void showChooser(final Collection refs,
final Collection> stringUsages) {
+ if (ApplicationManager.getApplication().isUnitTestMode()) {
+ runRenameTemplate(
+ RefactoringSettings.getInstance().RENAME_SEARCH_IN_COMMENTS_FOR_FILE ? stringUsages : new ArrayList>());
+ return;
+ }
final DefaultListModel model = new DefaultListModel();
model.addElement(CODE_OCCURRENCES);
diff --git a/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java b/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java
index a790520b165a..e4100a58f23e 100644
--- a/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java
+++ b/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java
@@ -499,18 +499,18 @@ public class VfsUtil extends VfsUtilCore {
return prefix + ":///" + suffix;
}
}
- else if (SystemInfoRt.isWindows && url.regionMatches(0, LocalFileSystem.PROTOCOL_PREFIX, 0, LocalFileSystem.PROTOCOL_PREFIX.length())) {
+ else if (url.charAt(index + 3) == '/' && SystemInfoRt.isWindows && url.regionMatches(0, LocalFileSystem.PROTOCOL_PREFIX, 0, LocalFileSystem.PROTOCOL_PREFIX.length())) {
// file:///C:/test/file.js -> file://C:/test/file.js
- for (int i = index + 3; i < url.length(); i++) {
+ for (int i = index + 4; i < url.length(); i++) {
char c = url.charAt(i);
if (c == '/') {
- return url;
- }
- else if (c == ':') {
break;
}
+ else if (c == ':') {
+ return LocalFileSystem.PROTOCOL_PREFIX + url.substring(index + 4);
+ }
}
- return LocalFileSystem.PROTOCOL_PREFIX + url.substring(index + 3);
+ return url;
}
return url;
}
diff --git a/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/RefreshQueue.java b/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/RefreshQueue.java
index 4e1a9d40afbc..0f7fe1f1f941 100644
--- a/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/RefreshQueue.java
+++ b/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/RefreshQueue.java
@@ -38,7 +38,7 @@ public abstract class RefreshQueue {
public abstract RefreshSession createSession(boolean async, boolean recursive, @Nullable Runnable finishRunnable, @NotNull ModalityState state);
- public final void refresh(boolean async, boolean recursive, @Nullable Runnable finishRunnable, VirtualFile... files) {
+ public final void refresh(boolean async, boolean recursive, @Nullable Runnable finishRunnable, @NotNull VirtualFile... files) {
refresh(async, recursive, finishRunnable, getDefaultModalityState(), files);
}
@@ -50,7 +50,7 @@ public abstract class RefreshQueue {
boolean recursive,
@Nullable Runnable finishRunnable,
@NotNull ModalityState state,
- VirtualFile... files) {
+ @NotNull VirtualFile... files) {
RefreshSession session = createSession(async, recursive, finishRunnable, state);
session.addAllFiles(files);
session.launch();
diff --git a/platform/platform-api/src/com/intellij/ui/CollectionComboBoxModel.java b/platform/platform-api/src/com/intellij/ui/CollectionComboBoxModel.java
index 162bb82a1e42..51703470e7cf 100644
--- a/platform/platform-api/src/com/intellij/ui/CollectionComboBoxModel.java
+++ b/platform/platform-api/src/com/intellij/ui/CollectionComboBoxModel.java
@@ -32,6 +32,10 @@ public class CollectionComboBoxModel extends AbstractCollectionComboBoxModel {
myItems = Collections.unmodifiableList(items);
}
+ public CollectionComboBoxModel(List items) {
+ super(items.isEmpty() ? null : items.get(0));
+ myItems = items;
+ }
@NotNull
final protected List getItems() {
diff --git a/platform/platform-impl/src/com/intellij/ide/actions/ShowLogAction.java b/platform/platform-impl/src/com/intellij/ide/actions/ShowLogAction.java
index d68063ead8aa..33eae3e47f7a 100644
--- a/platform/platform-impl/src/com/intellij/ide/actions/ShowLogAction.java
+++ b/platform/platform-impl/src/com/intellij/ide/actions/ShowLogAction.java
@@ -20,7 +20,6 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.project.DumbAware;
-import com.intellij.openapi.util.SystemInfo;
import org.jetbrains.annotations.NotNull;
import java.io.File;
@@ -44,6 +43,6 @@ public class ShowLogAction extends AnAction implements DumbAware {
@NotNull
public static String getActionName() {
- return SystemInfo.isMac ? "Reveal Log in Finder" : "Show Log in " + ShowFilePathAction.getFileManagerName();
+ return "Show Log in " + ShowFilePathAction.getFileManagerName();
}
}
diff --git a/platform/platform-impl/src/com/intellij/ide/ui/laf/IdeaDarkMetalTheme.java b/platform/platform-impl/src/com/intellij/ide/ui/laf/DarculaMetalTheme.java
similarity index 71%
rename from platform/platform-impl/src/com/intellij/ide/ui/laf/IdeaDarkMetalTheme.java
rename to platform/platform-impl/src/com/intellij/ide/ui/laf/DarculaMetalTheme.java
index e891f4e91f76..25937fa14835 100644
--- a/platform/platform-impl/src/com/intellij/ide/ui/laf/IdeaDarkMetalTheme.java
+++ b/platform/platform-impl/src/com/intellij/ide/ui/laf/DarculaMetalTheme.java
@@ -1,6 +1,6 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,7 @@
*/
package com.intellij.ide.ui.laf;
-import com.intellij.ui.UIBundle;
-
+import javax.swing.*;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.metal.DefaultMetalTheme;
import java.awt.*;
@@ -25,27 +24,46 @@ import java.awt.*;
/**
* @author Konstantin Bulenkov
*/
-public class IdeaDarkMetalTheme extends DefaultMetalTheme {
- public String getName() {
- return UIBundle.message("idea.blue.metal.theme.name");
- }
+public class DarculaMetalTheme extends DefaultMetalTheme {
- private static final ColorUIResource darkGray = new ColorUIResource(132, 130, 132);
+ private final ColorUIResource myControlHighlightColor = new ColorUIResource(108, 111, 113);
+ private final ColorUIResource myControlDarkShadowColor = new ColorUIResource(39, 42, 44);
+ private final ColorUIResource myControlColor = new ColorUIResource(UIManager.getColor("control"));
private static final ColorUIResource white = new ColorUIResource(255, 255, 255);
private static final ColorUIResource darkBlue = new ColorUIResource(82, 108, 164);
- // private static ColorUIResource lightGray = new ColorUIResource(214, 211, 206);
private static final ColorUIResource lightGray = new ColorUIResource(214, 214, 214);
+ private final ColorUIResource mySeparatorForeground = new ColorUIResource(53, 56, 58);
+
+ public static final ColorUIResource primary1 = new ColorUIResource(53, 56, 58);
+ private static final ColorUIResource primary2 = new ColorUIResource(91, 135, 206);
+ private static final ColorUIResource primary3 = new ColorUIResource(166, 202, 240);
+
+
+
+ public String getName() {
+ return "Darcula theme";
+ }
public ColorUIResource getControl() {
- return lightGray;
+ return myControlColor;
+ }
+
+ @Override
+ public ColorUIResource getControlHighlight() {
+ return myControlHighlightColor;
+ }
+
+ @Override
+ public ColorUIResource getControlDarkShadow() {
+ return myControlDarkShadowColor;
}
public ColorUIResource getSeparatorBackground() {
- return white;
+ return getControl();
}
public ColorUIResource getSeparatorForeground() {
- return darkGray;
+ return mySeparatorForeground;
}
public ColorUIResource getMenuBackground() {
@@ -64,10 +82,6 @@ public class IdeaDarkMetalTheme extends DefaultMetalTheme {
return white;
}
- public static final ColorUIResource primary1 = new ColorUIResource(10, 36, 106);
- private static final ColorUIResource primary2 = new ColorUIResource(91, 135, 206);
- private static final ColorUIResource primary3 = new ColorUIResource(166, 202, 240);
-
public ColorUIResource getFocusColor() {
return new ColorUIResource(Color.black);
}
diff --git a/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java b/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java
index c3d7661d9e42..0a7752d3383a 100644
--- a/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java
+++ b/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -344,7 +344,6 @@ public final class LafManagerImpl extends LafManager implements ApplicationCompo
}
else if (DarculaLookAndFeelInfo.CLASS_NAME.equals(lookAndFeelInfo.getClassName())) {
DarculaLaf laf = new DarculaLaf();
- MetalLookAndFeel.setCurrentTheme(new IdeaDarkMetalTheme());
try {
UIManager.setLookAndFeel(laf);
}
diff --git a/platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/DarculaLaf.java b/platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/DarculaLaf.java
index e3efb78edfe5..fabcfaae1416 100644
--- a/platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/DarculaLaf.java
+++ b/platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/DarculaLaf.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package com.intellij.ide.ui.laf.darcula;
+import com.intellij.ide.ui.laf.DarculaMetalTheme;
import com.intellij.ide.ui.laf.IdeaLaf;
import com.intellij.ide.ui.laf.LafManagerImpl;
import com.intellij.openapi.util.IconLoader;
@@ -91,6 +92,7 @@ public final class DarculaLaf extends BasicLookAndFeel {
patchComboBox(metalDefaults, defaults);
defaults.remove("Spinner.arrowButtonBorder");
defaults.put("Spinner.arrowButtonSize", new Dimension(16, 5));
+ MetalLookAndFeel.setCurrentTheme(new DarculaMetalTheme());
return defaults;
}
catch (Exception ignore) {
diff --git a/platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/darcula.properties b/platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/darcula.properties
index c558d085f8b9..91eeaafa552e 100644
--- a/platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/darcula.properties
+++ b/platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/darcula.properties
@@ -89,6 +89,8 @@ Spinner.background=3c3f41
Spinner.arrowButtonInsets=1,1,1,1
Spinner.editorBorderPainted=false
+SplitPane.highlight=3c3f41
+
Hyperlink.linkColor=589df6
Tree.collapsedIcon=AllIcons.Mac.Tree_white_right_arrow
diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorComposite.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorComposite.java
index 14dca00e485d..a21d7e2cb349 100644
--- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorComposite.java
+++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorComposite.java
@@ -405,6 +405,11 @@ public abstract class EditorComposite implements Disposable {
}
public void dispose() {
+ for (FileEditor editor : myEditors) {
+ if (!Disposer.isDisposed(editor)) {
+ Disposer.dispose(editor);
+ }
+ }
}
private static class TopBottomPanel extends JPanel {
diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorsSplitters.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorsSplitters.java
index f33b29e377d1..cb82d467761b 100644
--- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorsSplitters.java
+++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorsSplitters.java
@@ -38,6 +38,7 @@ import com.intellij.openapi.wm.ex.WindowManagerEx;
import com.intellij.openapi.wm.impl.FrameTitleBuilder;
import com.intellij.openapi.wm.impl.IdeFrameImpl;
import com.intellij.ui.Gray;
+import com.intellij.ui.JBColor;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.components.JBPanel;
import com.intellij.ui.docking.DockManager;
@@ -159,11 +160,11 @@ public class EditorsSplitters extends JBPanel {
if (showEmptyText()) {
UIUtil.applyRenderingHints(g);
- g.setColor(UIUtil.isUnderDarcula() ? Gray._200 : Gray._100);
+ g.setColor(new JBColor(Gray._100, Gray._160));
g.setFont(UIUtil.getLabelFont().deriveFont(UIUtil.isUnderDarcula() ? 24f : 18f));
final UIUtil.TextPainter painter = new UIUtil.TextPainter().withShadow(true).withLineSpacing(1.4f);
- painter.appendLine("No files are open").underlined(UIUtil.isUnderDarcula()? Gray._200 : Gray._150);
+ painter.appendLine("No files are open").underlined(new JBColor(Gray._150, Gray._100));
if (!isProjectViewVisible()) {
painter.appendLine("Open Project View with " + KeymapUtil.getShortcutText(new KeyboardShortcut(
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 5017b9e4b2a3..ed39011cc635 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
@@ -719,6 +719,12 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Projec
providers = newSelectedComposite.getProviders();
}
else {
+ if (UISettings.getInstance().EDITOR_TAB_PLACEMENT == UISettings.TABS_NONE) {
+ for (EditorWithProviderComposite composite : window.getEditors()) {
+ Disposer.dispose(composite);
+ }
+ }
+
// File is not opened yet. In this case we have to create editors
// and select the created EditorComposite.
final FileEditorProviderManager editorProviderManager = FileEditorProviderManager.getInstance();
diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/win32/Win32FsCache.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/win32/Win32FsCache.java
index 5612b530f0f6..d135f39c4fb7 100644
--- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/win32/Win32FsCache.java
+++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/win32/Win32FsCache.java
@@ -15,6 +15,7 @@
*/
package com.intellij.openapi.vfs.impl.win32;
+import com.intellij.openapi.util.io.FileAttributes;
import com.intellij.openapi.util.io.win32.FileInfo;
import com.intellij.openapi.util.io.win32.IdeaWin32;
import com.intellij.openapi.vfs.VirtualFile;
@@ -34,19 +35,19 @@ import java.util.Map;
*/
class Win32FsCache {
private final IdeaWin32 myKernel = IdeaWin32.getInstance();
- private Reference