diff --git a/platform/core-impl/src/org/jetbrains/ide/script/Jsr223IdeScriptEngineManagerImpl.java b/platform/core-impl/src/org/jetbrains/ide/script/Jsr223IdeScriptEngineManagerImpl.java index c4ed7782241a..e38a4f8e607a 100644 --- a/platform/core-impl/src/org/jetbrains/ide/script/Jsr223IdeScriptEngineManagerImpl.java +++ b/platform/core-impl/src/org/jetbrains/ide/script/Jsr223IdeScriptEngineManagerImpl.java @@ -36,9 +36,7 @@ import java.io.IOException; import java.io.Reader; import java.io.Writer; import java.net.URL; -import java.util.Enumeration; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.Callable; import java.util.concurrent.Future; @@ -50,7 +48,12 @@ class Jsr223IdeScriptEngineManagerImpl extends IdeScriptEngineManager { public ScriptEngineManager call() { long start = System.currentTimeMillis(); try { - return new ScriptEngineManager(); + return ClassLoaderUtil.runWithClassLoader(AllPluginsLoader.INSTANCE, new Computable() { + @Override + public ScriptEngineManager compute() { + return new ScriptEngineManager(); + } + }); } finally { long end = System.currentTimeMillis(); @@ -300,13 +303,38 @@ class Jsr223IdeScriptEngineManagerImpl extends IdeScriptEngineManager { throw new ClassNotFoundException(name); } + private static boolean isAllowedPluginResource(String name) { + // allow plugin engines but suppress all other resources + return "META-INF/services/javax.script.ScriptEngineFactory".equals(name); + } + @Override protected URL findResource(String name) { + if (isAllowedPluginResource(name)) { + for (IdeaPluginDescriptor descriptor : PluginManagerCore.getPlugins()) { + ClassLoader l = descriptor.getPluginClassLoader(); + URL url = l == null ? null : l.getResource(name); + if (url != null) return url; + } + } return getClass().getClassLoader().getResource(name); } @Override protected Enumeration findResources(String name) throws IOException { + if (isAllowedPluginResource(name)) { + Set result = null; + for (IdeaPluginDescriptor descriptor : PluginManagerCore.getPlugins()) { + ClassLoader l = descriptor.getPluginClassLoader(); + Enumeration urls = l == null ? null : l.getResources(name); + if (urls == null || !urls.hasMoreElements()) continue; + if (result == null) result = ContainerUtil.newLinkedHashSet(); + ContainerUtil.addAll(result, urls); + } + if (result != null) { + return Collections.enumeration(result); + } + } return getClass().getClassLoader().getResources(name); } } diff --git a/platform/util/src/com/intellij/util/ui/MouseEventAdapter.java b/platform/util/src/com/intellij/util/ui/MouseEventAdapter.java index be9fe2bdad1d..f7c7b4745d24 100644 --- a/platform/util/src/com/intellij/util/ui/MouseEventAdapter.java +++ b/platform/util/src/com/intellij/util/ui/MouseEventAdapter.java @@ -24,8 +24,7 @@ import java.awt.event.*; /** * @author Sergey.Malenkov */ -public class MouseEventAdapter extends MouseAdapter implements MouseListener, MouseInputListener, - MouseMotionListener, MouseWheelListener { +public class MouseEventAdapter extends MouseAdapter implements MouseInputListener { private final T myAdapter; public MouseEventAdapter(T adapter) { diff --git a/platform/util/src/com/intellij/util/ui/MouseEventHandler.java b/platform/util/src/com/intellij/util/ui/MouseEventHandler.java index 92aa467b364e..7e0da37c9e0f 100644 --- a/platform/util/src/com/intellij/util/ui/MouseEventHandler.java +++ b/platform/util/src/com/intellij/util/ui/MouseEventHandler.java @@ -21,8 +21,7 @@ import java.awt.event.*; /** * @author Sergey.Malenkov */ -public abstract class MouseEventHandler extends MouseAdapter implements MouseListener, MouseInputListener, - MouseMotionListener, MouseWheelListener { +public abstract class MouseEventHandler extends MouseAdapter implements MouseInputListener { protected abstract void handle(MouseEvent event); @Override diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/TestMethodWithoutAssertionInspectionBase.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/TestMethodWithoutAssertionInspectionBase.java index 0415bcab5d19..62bb0b940c86 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/TestMethodWithoutAssertionInspectionBase.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/TestMethodWithoutAssertionInspectionBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -152,6 +152,10 @@ public class TestMethodWithoutAssertionInspectionBase extends BaseInspection { @Override public void visitElement(@NotNull PsiElement element) { + if ((element instanceof PsiCompiledElement)) { + // assume no assertions in libraries (prevents assertion in recursive element walking visitor) + return; + } if (!containsAssertion) { super.visitElement(element); } diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/SuspiciousLiteralUnderscoreInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/SuspiciousLiteralUnderscoreInspection.java index ce00828c0a62..28f390c8e8ea 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/SuspiciousLiteralUnderscoreInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/SuspiciousLiteralUnderscoreInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,6 +95,10 @@ public class SuspiciousLiteralUnderscoreInspection extends BaseInspection { return; } } + if (digit == 0) { + // literal ends with underscore (which does not compile) + return; + } if (dot ? digit > 3 : digit != 3) { registerErrorAtOffset(expression, length - digit, digit); } diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/EqualsReplaceableByObjectsCall.html b/plugins/InspectionGadgets/src/inspectionDescriptions/EqualsReplaceableByObjectsCall.html index 5a55c5b308f7..80c33db1a5d0 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/EqualsReplaceableByObjectsCall.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/EqualsReplaceableByObjectsCall.html @@ -9,6 +9,6 @@ For example: still makes sense, but slightly changes the semantics. For the cases where only equivalent replacement is needed, there's the check box Report only null safe 'equals' calls to enforce that.

- This inspection only applies to projects and modules configured to use the language level of 7 or higher. + This inspection only applies to projects and modules configured to use a language level of 7 or higher. \ No newline at end of file diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/suspicious_literal_underscore/SuspiciousLiteralUnderscore.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/suspicious_literal_underscore/SuspiciousLiteralUnderscore.java index 55201d2a1b98..757da7defc50 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/suspicious_literal_underscore/SuspiciousLiteralUnderscore.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/suspicious_literal_underscore/SuspiciousLiteralUnderscore.java @@ -8,6 +8,7 @@ class SuspiciousLiteralUnderscore {{ int i = 1_000_00; int j = 1_000_0000; long k = 1_000_000L; + int l = 100_; double g = 12_34d; double h = 1.123_4567e3;