diff --git a/build/scripts/utils.gant b/build/scripts/utils.gant
index 2ac5d37aaa07..ed09424fa0c4 100644
--- a/build/scripts/utils.gant
+++ b/build/scripts/utils.gant
@@ -333,9 +333,6 @@ binding.setVariable("layoutMacApp", { String path, String ch, Map args ->
String fullName = args.fullName != null ? args.fullName : p("component.names.fullname")
String vmOptions = "-Dfile.encoding=UTF-8 ${vmOptions()} -Xverify:none"
- if (isEap() && !args.mac_no_yjp) {
- vmOptions += " ${yjpOptions(args.system_selector)}"
- }
String minor = p("component.version.minor")
String version = isEap() && !minor.contains("RC") && !minor.contains("Beta") ? "EAP $args.buildNumber" : "${p("component.version.major")}.${minor}"
@@ -354,7 +351,11 @@ binding.setVariable("layoutMacApp", { String path, String ch, Map args ->
}
new File("$path/bin/idea.properties").text = effectiveProperties.toString()
- new File("$path/bin/idea.vmoptions").text = "$mem64 -XX:+UseCompressedOops".split(" ").join("\n")
+ String ideaVmOptions = "$mem64 -XX:+UseCompressedOops".split(" ").join("\n")
+ if (isEap() && !args.mac_no_yjp) {
+ ideaVmOptions += " ${yjpOptions(args.system_selector)}"
+ }
+ new File("$path/bin/idea.vmoptions").text = ideaVmOptions
String classPath = classPathLibs.collect {"\$APP_PACKAGE/Contents/lib/${it}" }.join(":")
diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java
index f10491282d0e..a733888f9501 100644
--- a/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java
+++ b/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java
@@ -1157,7 +1157,12 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
public ArrayReference newInstance(final ArrayType arrayType,
final int dimension)
throws EvaluateException {
- return arrayType.newInstance(dimension);
+ try {
+ return arrayType.newInstance(dimension);
+ }
+ catch (Exception e) {
+ throw EvaluateExceptionUtil.createEvaluateException(e);
+ }
}
@Override
diff --git a/java/debugger/openapi/src/com/intellij/debugger/engine/DebuggerUtils.java b/java/debugger/openapi/src/com/intellij/debugger/engine/DebuggerUtils.java
index 9da05817277c..ed150d588c3c 100644
--- a/java/debugger/openapi/src/com/intellij/debugger/engine/DebuggerUtils.java
+++ b/java/debugger/openapi/src/com/intellij/debugger/engine/DebuggerUtils.java
@@ -291,30 +291,37 @@ public abstract class DebuggerUtils {
}
if (subType instanceof ClassType) {
- result = getSuperType(((ClassType)subType).superclass(), superType);
- if (result != null) {
- return result;
- }
-
- List ifaces = ((ClassType)subType).allInterfaces();
- for (Object iface : ifaces) {
- InterfaceType interfaceType = (InterfaceType)iface;
- if (typeEquals(interfaceType, superType)) {
- return interfaceType;
+ try {
+ final ClassType clsType = (ClassType)subType;
+ result = getSuperType(clsType.superclass(), superType);
+ if (result != null) {
+ return result;
}
+
+ for (InterfaceType iface : clsType.allInterfaces()) {
+ if (typeEquals(iface, superType)) {
+ return iface;
+ }
+ }
+ }
+ catch (ClassNotPreparedException e) {
+ LOG.info(e);
}
return null;
}
if (subType instanceof InterfaceType) {
- List ifaces = ((InterfaceType)subType).superinterfaces();
- for (Object iface : ifaces) {
- InterfaceType interfaceType = (InterfaceType)iface;
- result = getSuperType(interfaceType, superType);
- if (result != null) {
- return result;
+ try {
+ for (InterfaceType iface : ((InterfaceType)subType).superinterfaces()) {
+ result = getSuperType(iface, superType);
+ if (result != null) {
+ return result;
+ }
}
}
+ catch (ClassNotPreparedException e) {
+ LOG.info(e);
+ }
}
else if (subType instanceof ArrayType) {
if (superType.endsWith("[]")) {
@@ -324,7 +331,7 @@ public abstract class DebuggerUtils {
return instanceOf(subTypeItem, superTypeItem) ? subType : null;
}
catch (ClassNotLoadedException e) {
- LOG.debug(e);
+ LOG.info(e);
}
}
}
diff --git a/java/java-psi-api/src/com/intellij/psi/util/RedundantCastUtil.java b/java/java-psi-api/src/com/intellij/psi/util/RedundantCastUtil.java
index 0fbfa4a059f9..65c3ce81812d 100644
--- a/java/java-psi-api/src/com/intellij/psi/util/RedundantCastUtil.java
+++ b/java/java-psi-api/src/com/intellij/psi/util/RedundantCastUtil.java
@@ -504,9 +504,21 @@ public class RedundantCastUtil {
return;
}
if (parent instanceof PsiForeachStatement) {
- if (InheritanceUtil.isInheritor(PsiUtil.resolveClassInType(opType), false, CommonClassNames.JAVA_LANG_ITERABLE)) {
- addToResults(typeCast);
- return;
+ final PsiClassType.ClassResolveResult castResolveResult = PsiUtil.resolveGenericsClassInType(opType);
+ final PsiClass psiClass = castResolveResult.getElement();
+ if (psiClass != null) {
+ final PsiClass iterableClass = JavaPsiFacade.getInstance(parent.getProject()).findClass(CommonClassNames.JAVA_LANG_ITERABLE, psiClass.getResolveScope());
+ if (iterableClass != null && InheritanceUtil.isInheritorOrSelf(psiClass, iterableClass, true)) {
+ final PsiTypeParameter[] iterableTypeParameters = iterableClass.getTypeParameters();
+ if (iterableTypeParameters.length == 1) {
+ final PsiType resultedParamType = TypeConversionUtil.getSuperClassSubstitutor(iterableClass, psiClass, castResolveResult.getSubstitutor()).substitute(iterableTypeParameters[0]);
+ if (resultedParamType != null &&
+ TypeConversionUtil.isAssignable(((PsiForeachStatement)parent).getIterationParameter().getType(), resultedParamType)) {
+ addToResults(typeCast);
+ return;
+ }
+ }
+ }
}
}
if (parent instanceof PsiThrowStatement) {
diff --git a/java/java-tests/testData/inspection/redundantCast/generics/ForEachValueIDEA126166/expected.xml b/java/java-tests/testData/inspection/redundantCast/generics/ForEachValueIDEA126166/expected.xml
new file mode 100644
index 000000000000..4704d91e891d
--- /dev/null
+++ b/java/java-tests/testData/inspection/redundantCast/generics/ForEachValueIDEA126166/expected.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/redundantCast/generics/ForEachValueIDEA126166/src/Test.java b/java/java-tests/testData/inspection/redundantCast/generics/ForEachValueIDEA126166/src/Test.java
new file mode 100644
index 000000000000..18bf47f111b5
--- /dev/null
+++ b/java/java-tests/testData/inspection/redundantCast/generics/ForEachValueIDEA126166/src/Test.java
@@ -0,0 +1,11 @@
+import java.util.ArrayList;
+import java.util.List;
+
+class SomeClass {
+ public void test() {
+ List> objects = new ArrayList<>();
+ for (String value : (Iterable extends String>) objects) {
+ System.out.println(value);
+ }
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java b/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java
index 4dd29648e055..a8b27ab21089 100644
--- a/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/RedundantCast15Test.java
@@ -49,6 +49,7 @@ public class RedundantCast15Test extends InspectionTestCase {
public void testGetClassProcessing() throws Exception { doTest();}
public void testInstanceOfChecks() throws Exception { doTest();}
public void testForEachValue() throws Exception { doTest();}
+ public void testForEachValueIDEA126166() throws Exception { doTest();}
public void testCaseThrowable() throws Exception { doTest();}
public void testSafeTempVarName() throws Exception { doTest();}
diff --git a/java/testFramework/src/com/intellij/ide/projectWizard/ProjectWizardTestCase.java b/java/testFramework/src/com/intellij/ide/projectWizard/ProjectWizardTestCase.java
index 3e8e07a5b6bc..7008c185f308 100644
--- a/java/testFramework/src/com/intellij/ide/projectWizard/ProjectWizardTestCase.java
+++ b/java/testFramework/src/com/intellij/ide/projectWizard/ProjectWizardTestCase.java
@@ -216,6 +216,9 @@ public abstract class ProjectWizardTestCase ext
}
});
SelectTemplateSettings.getInstance().setLastTemplate(null, null);
+ UIUtil.dispatchAllInvocationEvents();
+ Thread.sleep(2000); //wait for JBCardLayout release timers
+ UIUtil.dispatchAllInvocationEvents();
super.tearDown();
}
diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java
index fe3242e47b44..29cb27933d7c 100644
--- a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java
+++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java
@@ -48,7 +48,7 @@ public interface EditorColors {
TextAttributesKey FOLDED_TEXT_ATTRIBUTES = TextAttributesKey.createTextAttributesKey("FOLDED_TEXT_ATTRIBUTES");
TextAttributesKey DELETED_TEXT_ATTRIBUTES = TextAttributesKey.createTextAttributesKey("DELETED_TEXT_ATTRIBUTES");
- ColorKey GUTTER_BACKGROUND = ColorKey.createColorKey("GUTTER_BACKGROUND");
+ ColorKey GUTTER_BACKGROUND = ColorKey.createColorKey("GUTTER_BACKGROUND", new JBColor(0xf0f0f0, 0x313335));
@Deprecated ColorKey LEFT_GUTTER_BACKGROUND = GUTTER_BACKGROUND;
ColorKey NOTIFICATION_BACKGROUND = ColorKey.createColorKey("NOTIFICATION_BACKGROUND");
diff --git a/platform/lang-impl/src/com/intellij/execution/impl/SingleConfigurationConfigurable.java b/platform/lang-impl/src/com/intellij/execution/impl/SingleConfigurationConfigurable.java
index 930fc2868359..4c58ab7029b3 100644
--- a/platform/lang-impl/src/com/intellij/execution/impl/SingleConfigurationConfigurable.java
+++ b/platform/lang-impl/src/com/intellij/execution/impl/SingleConfigurationConfigurable.java
@@ -109,7 +109,7 @@ public final class SingleConfigurationConfigurable myAlreadyAddedFiles = new ArrayList();
- private ArrayList myAlreadyAddedActions = new ArrayList();
private volatile ActionCallback myCurrentWorker = ActionCallback.DONE;
private int myHistoryIndex = 0;
boolean mySkipFocusGain = false;
@@ -255,7 +254,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA
}, null);
}
- private JBPopup myBalloon;
+ private volatile JBPopup myBalloon;
private int myPopupActualWidth;
private Component myFocusOwner;
private ChooseByNamePopup myFileChooseByName;
@@ -497,7 +496,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA
public void run() {
if (myCalcThread != null) {
myCalcThread.cancel();
- myCalcThread = null;
+ //myCalcThread = null;
}
myAlarm.cancelAllRequests();
if (myBalloon != null && !myBalloon.isDisposed() && myPopup != null && !myPopup.isDisposed()) {
@@ -1199,9 +1198,12 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA
private class CalcThread implements Runnable {
private final Project project;
private final String pattern;
- private ProgressIndicator myProgressIndicator = new ProgressIndicatorBase();
+ private final ProgressIndicator myProgressIndicator = new ProgressIndicatorBase();
private final ActionCallback myDone = new ActionCallback();
- private SearchListModel myListModel = new SearchListModel();
+ private final SearchListModel myListModel = new SearchListModel();
+ private final ArrayList myAlreadyAddedFiles = new ArrayList();
+ private final ArrayList myAlreadyAddedActions = new ArrayList();
+
public CalcThread(Project project, String pattern) {
this.project = project;
@@ -1293,9 +1295,10 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA
protected void check() {
myProgressIndicator.checkCanceled();
if (myDone.isRejected()) throw new ProcessCanceledException();
+ if (myBalloon == null || myBalloon.isDisposed()) throw new ProcessCanceledException();
}
- private void buildToolWindows(String pattern) {
+ private synchronized void buildToolWindows(String pattern) {
if (myActions == null) {
if (myActionModel == null) {
myActionModel = createActionModel();
@@ -1331,7 +1334,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA
});
}
- private void buildActionsAndSettings(String pattern) {
+ private synchronized void buildActionsAndSettings(String pattern) {
final Set