diff --git a/build/conf/nsis/paths.nsi b/build/conf/nsis/paths.nsi index 0e9299aaffba..c9e28527f1ea 100644 --- a/build/conf/nsis/paths.nsi +++ b/build/conf/nsis/paths.nsi @@ -1,6 +1,6 @@ ; Installer images !define IMAGES_LOCATION "${BASE_DIR}\build\images\idea" -!define LICENSE_FILE "${BASE_DIR}\license\IDEA_license" +;!define LICENSE_FILE "${BASE_DIR}\license\IDEA_license" !define PRODUCT_PROPERTIES_FILE "${BASE_DIR}\out\release\dist.all\bin\idea.properties" !define PRODUCT_VM_OPTIONS_NAME idea*.exe.vmoptions !define PRODUCT_VM_OPTIONS_FILE "${BASE_DIR}\out\release\dist.win\bin\${PRODUCT_VM_OPTIONS_NAME}" \ No newline at end of file diff --git a/build/scripts/dist.gant b/build/scripts/dist.gant index 652a97d759bf..607a28263ff1 100644 --- a/build/scripts/dist.gant +++ b/build/scripts/dist.gant @@ -144,8 +144,11 @@ def layoutAll(Map args, String home, String out, Paths _paths = null, buildJps = include(name: "*.*") } } + dir("license") { - fileset(dir: "${home}/license") + fileset(dir: "${home}/license") { + exclude(name: "placeholder.txt") + } } fileset(file: "${home}/LICENSE.txt") fileset(file: "${home}/NOTICE.txt") diff --git a/java/structuralsearch-java/src/com/intellij/structuralsearch/JavaReplaceHandler.java b/java/structuralsearch-java/src/com/intellij/structuralsearch/JavaReplaceHandler.java index b95b01fe08d0..2ae17d8756a9 100644 --- a/java/structuralsearch-java/src/com/intellij/structuralsearch/JavaReplaceHandler.java +++ b/java/structuralsearch-java/src/com/intellij/structuralsearch/JavaReplaceHandler.java @@ -269,7 +269,7 @@ public class JavaReplaceHandler extends StructuralReplaceHandler { if (firstChild instanceof PsiModifierList) { final PsiModifierList modifierList = (PsiModifierList)firstChild; for (PsiElement child : modifierList.getChildren()) { - elementParent.add(child); + elementParent.addBefore(child, elementToReplace); } } } diff --git a/platform/core-impl/src/com/intellij/openapi/progress/util/AbstractProgressIndicatorBase.java b/platform/core-impl/src/com/intellij/openapi/progress/util/AbstractProgressIndicatorBase.java index af8546cb6147..2cf43d397fd4 100644 --- a/platform/core-impl/src/com/intellij/openapi/progress/util/AbstractProgressIndicatorBase.java +++ b/platform/core-impl/src/com/intellij/openapi/progress/util/AbstractProgressIndicatorBase.java @@ -23,6 +23,7 @@ import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.util.UserDataHolderBase; +import com.intellij.ui.mac.foundation.MacUtil; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.DoubleArrayList; import com.intellij.util.containers.Stack; @@ -43,6 +44,7 @@ public class AbstractProgressIndicatorBase extends UserDataHolderBase implements private volatile boolean myFinished; private volatile boolean myIndeterminate; + private volatile Object myMacActivity; private Stack myTextStack; private DoubleArrayList myFractionStack; @@ -68,6 +70,7 @@ public class AbstractProgressIndicatorBase extends UserDataHolderBase implements myText = ""; myFraction = 0; myText2 = ""; + myMacActivity = MacUtil.wakeUpNeo(toString()); myRunning = true; } @@ -82,6 +85,8 @@ public class AbstractProgressIndicatorBase extends UserDataHolderBase implements LOG.assertTrue(myRunning, "stop() should be called only if start() called before"); myRunning = false; myFinished = true; + MacUtil.matrixHasYou(myMacActivity); + myMacActivity = null; } @Override diff --git a/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java index 6c204de6ea05..8086ffc0d86a 100644 --- a/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java +++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java @@ -2259,15 +2259,15 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase { public void testReplaceAnnotation() { String in = "@SuppressWarnings(\"ALL\")\n" + - "class A {}"; + "public class A {}"; String what = "@SuppressWarnings(\"ALL\")"; final String by1 = ""; - assertEquals("class A {}", replacer.testReplace(in, what, by1, options, false)); + assertEquals("public class A {}", replacer.testReplace(in, what, by1, options, false)); final String by2 = "@SuppressWarnings(\"NONE\") @Deprecated"; assertEquals("@SuppressWarnings(\"NONE\") @Deprecated\n" + - "class A {}", replacer.testReplace(in, what, by2, options, false)); + "public class A {}", replacer.testReplace(in, what, by2, options, false)); } public void testReplacePolyadicExpression() { diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index 9f8ea66e2b7b..941f2f758cc6 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -74,6 +74,9 @@ idea.fix.mac.env=true idea.fix.mac.env.restartRequired=true idea.fix.mac.env.description=On Mac, use shell environment for external processes. +idea.mac.prevent.app.nap=false +idea.mac.prevent.app.nap.description=Prevent app nap during indexing and inspection + ide.x11.override.wm=true ide.appIcon.progress=true diff --git a/platform/util/src/com/intellij/ui/mac/foundation/MacUtil.java b/platform/util/src/com/intellij/ui/mac/foundation/MacUtil.java index 8ee9ee9206fb..58b6cdd53591 100644 --- a/platform/util/src/com/intellij/ui/mac/foundation/MacUtil.java +++ b/platform/util/src/com/intellij/ui/mac/foundation/MacUtil.java @@ -33,8 +33,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.concurrent.atomic.AtomicBoolean; -import static com.intellij.ui.mac.foundation.Foundation.invoke; -import static com.intellij.ui.mac.foundation.Foundation.toStringViaUTF8; +import static com.intellij.ui.mac.foundation.Foundation.*; /** * @author pegov @@ -192,4 +191,27 @@ public class MacUtil { } return windowTitle; } + + public static Object wakeUpNeo(String reason) { + // http://lists.apple.com/archives/java-dev/2014/Feb/msg00053.html + // https://developer.apple.com/library/prerelease/ios/documentation/Cocoa/Reference/Foundation/Classes/NSProcessInfo_Class/index.html#//apple_ref/c/tdef/NSActivityOptions + if (SystemInfo.isMacOSMavericks && Registry.is("idea.mac.prevent.app.nap")) { + ID processInfo = invoke("NSProcessInfo", "processInfo"); + ID activity = invoke(processInfo, "beginActivityWithOptions:reason:", + (0x00FFFFFFL & ~(1L << 20)) /* NSActivityUserInitiatedAllowingIdleSystemSleep */ | + 0xFF00000000L /* NSActivityLatencyCritical */, + nsString(reason)); + cfRetain(activity); + return activity; + } + return null; + } + + public static void matrixHasYou(Object activity) { + if (activity != null) { + ID processInfo = invoke("NSProcessInfo", "processInfo"); + invoke(processInfo, "endActivity:", activity); + cfRelease((ID)activity); + } + } } diff --git a/platform/util/src/com/intellij/util/CloseableThrowableProcessor.java b/platform/util/src/com/intellij/util/CloseableThrowableProcessor.java new file mode 100644 index 000000000000..d15fba49ba6c --- /dev/null +++ b/platform/util/src/com/intellij/util/CloseableThrowableProcessor.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.util; + +import java.io.Closeable; + +/** + * @author Irina.Chernushina on 6/11/2015. + */ +public interface CloseableThrowableProcessor extends Closeable { + boolean process(S s) throws T; +} diff --git a/platform/util/src/com/intellij/util/ui/MacUIUtil.java b/platform/util/src/com/intellij/util/ui/MacUIUtil.java index af3b55023539..b5899bc95c46 100644 --- a/platform/util/src/com/intellij/util/ui/MacUIUtil.java +++ b/platform/util/src/com/intellij/util/ui/MacUIUtil.java @@ -136,27 +136,16 @@ public class MacUIUtil { g.setColor(c.getBackground()); g.fillRect(x1, y1, width1, height1); - + if (!myEnabledComponent.isEnabled()) { ((Graphics2D)g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.4f)); } g.setColor(new Color(100, 100, 100, 200)); - g.drawLine(x1, y1, x1 + width1 - 1, y1); - - g.setColor(new Color(212, 212, 212, 200)); - g.drawLine(x1, y1 + 1, x1 + width1 - 1, y1 + 1); + g.drawRect(x1, y1, width1 - 1, height1 - 1); g.setColor(Gray._225); - g.drawLine(x1 + 1, y1 + height1 - 1, x1 + width1 - 2, y1 + height1 - 1); - - g.setColor(new Color(30, 30, 30, 70)); - g.drawLine(x1, y1, x1, y1 + height1 - 1); - g.drawLine(x1 + width1 - 1, y1, x1 + width1 - 1, y1 + height1 - 1); - - g.setColor(new Color(30, 30, 30, 10)); - g.drawLine(x1 + 1, y1, x1 + 1, y1 + height1 - 1); - g.drawLine(x1 + width1 - 2, y1, x1 + width1 - 2, y1 + height1 - 1); + g.drawRect(x1 + 1, y1 + 1, width1 - 3, height1 - 3); if (myEnabledComponent.isEnabled() && myEnabledComponent.isVisible() && hasFocus(myEnabledComponent)) { paintTextFieldFocusRing((Graphics2D) g, new Rectangle(x1, y1, width1, height1)); diff --git a/platform/util/testSrc/com/intellij/execution/process/ProcessWaitForTest.java b/platform/util/testSrc/com/intellij/execution/process/ProcessWaitForTest.java index 4042b0b450b4..d596bce075e9 100644 --- a/platform/util/testSrc/com/intellij/execution/process/ProcessWaitForTest.java +++ b/platform/util/testSrc/com/intellij/execution/process/ProcessWaitForTest.java @@ -15,6 +15,7 @@ */ package com.intellij.execution.process; +import com.intellij.openapi.util.SystemInfo; import com.intellij.util.Consumer; import com.intellij.util.concurrency.Semaphore; import org.junit.Test; @@ -27,7 +28,7 @@ import static org.junit.Assert.assertTrue; public class ProcessWaitForTest { @Test(timeout = 10000) public void notification() throws IOException, InterruptedException { - File jvm = new File(System.getProperty("java.home"), "bin/java"); + File jvm = new File(System.getProperty("java.home") + (SystemInfo.isWindows ? "\\bin\\java.exe" : "/bin/java")); assertTrue(jvm.canExecute()); final Semaphore semaphore = new Semaphore(); diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java index cb93462706f6..bc5288599510 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java @@ -33,7 +33,6 @@ import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.ui.popup.PopupStep; import com.intellij.openapi.ui.popup.util.BaseListPopupStep; import com.intellij.openapi.util.AsyncResult; -import com.intellij.openapi.util.Computable; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; @@ -130,9 +129,9 @@ public class XDebuggerUtilImpl extends XDebuggerUtil { @NotNull final XSourcePosition position, final boolean temporary, final RelativePoint relativePoint) { - return ApplicationManager.getApplication().runWriteAction(new Computable>() { + return new WriteAction>() { @Override - public AsyncResult compute() { + protected void run(@NotNull Result> result) throws Throwable { final VirtualFile file = position.getFile(); final int line = position.getLine(); final XBreakpointManager breakpointManager = XDebuggerManager.getInstance(project).getBreakpointManager(); @@ -173,21 +172,25 @@ public class XDebuggerUtilImpl extends XDebuggerUtil { return FINAL_CHOICE; } }).show(relativePoint); - return res; + result.setResult(res); + return; } else { P properties = (P)variants.get(0).createProperties(); - return AsyncResult.done( - (XLineBreakpoint)breakpointManager.addLineBreakpoint(type, file.getUrl(), line, properties, temporary)); + result.setResult(AsyncResult.done( + (XLineBreakpoint)breakpointManager.addLineBreakpoint(type, file.getUrl(), line, properties, temporary))); + return; } } } P properties = type.createBreakpointProperties(file, line); - return AsyncResult.done((XLineBreakpoint)breakpointManager.addLineBreakpoint(type, file.getUrl(), line, properties, temporary)); + result.setResult(AsyncResult + .done((XLineBreakpoint)breakpointManager.addLineBreakpoint(type, file.getUrl(), line, properties, temporary))); + return; } - return AsyncResult.rejected(); + result.setResult(AsyncResult.rejected()); } - }); + }.execute().getResultObject(); } @Override diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/AbstractMethodOverridesAbstractMethodInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/AbstractMethodOverridesAbstractMethodInspection.java index 137374f12006..aeb7fc2e69b5 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/AbstractMethodOverridesAbstractMethodInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/AbstractMethodOverridesAbstractMethodInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2012 Dave Griffith, Bas Leijdekkers + * Copyright 2003-2015 Dave Griffith, Bas Leijdekkers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -148,6 +148,9 @@ public class AbstractMethodOverridesAbstractMethodInspection extends BaseInspect final PsiParameter[] superParameters = superParameterList.getParameters(); final PsiParameterList parameterList = method.getParameterList(); final PsiParameter[] parameters = parameterList.getParameters(); + if (parameters.length != superParameters.length) { + return false; + } for (int i = 0, length = superParameters.length; i < length; i++) { final PsiParameter superParameter = superParameters[i]; final PsiParameter parameter = parameters[i]; @@ -171,7 +174,7 @@ public class AbstractMethodOverridesAbstractMethodInspection extends BaseInspect final Set annotationsSet = new HashSet(Arrays.asList(superAnnotations)); for (PsiAnnotation annotation : annotations) { final String qualifiedName = annotation.getQualifiedName(); - if ("java.lang.Override".equals(qualifiedName)) { + if (CommonClassNames.JAVA_LANG_OVERRIDE.equals(qualifiedName)) { continue; } if (!annotationsSet.contains(annotation)) {