diff --git a/java/compiler/javac2/src/com/intellij/ant/Javac2.java b/java/compiler/javac2/src/com/intellij/ant/Javac2.java index 88095a9cdc36..e5b8aee7130a 100644 --- a/java/compiler/javac2/src/com/intellij/ant/Javac2.java +++ b/java/compiler/javac2/src/com/intellij/ant/Javac2.java @@ -466,7 +466,7 @@ public class Javac2 extends Javac { public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { classfileVersion[0] = version; } - }, 0); + }, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); return classfileVersion[0]; } diff --git a/java/debugger/impl/src/com/intellij/debugger/settings/UserRenderersConfigurable.java b/java/debugger/impl/src/com/intellij/debugger/settings/UserRenderersConfigurable.java index 3967d2239455..3a8505c7dfe8 100644 --- a/java/debugger/impl/src/com/intellij/debugger/settings/UserRenderersConfigurable.java +++ b/java/debugger/impl/src/com/intellij/debugger/settings/UserRenderersConfigurable.java @@ -35,22 +35,22 @@ import java.awt.*; import java.util.ArrayList; import java.util.List; -public class UserRenderersConfigurable implements ConfigurableUi { +public final class UserRenderersConfigurable extends JPanel implements ConfigurableUi { private static final Icon ADD_ICON = IconUtil.getAddIcon(); private static final Icon REMOVE_ICON = IconUtil.getRemoveIcon(); private static final Icon COPY_ICON = PlatformIcons.COPY_ICON; private static final Icon UP_ICON = IconUtil.getMoveUpIcon(); private static final Icon DOWN_ICON = IconUtil.getMoveDownIcon(); - private JPanel myNameFieldPanel; - private JTextField myNameField; + private final JPanel myNameFieldPanel; + private final JTextField myNameField; private ElementsChooser myRendererChooser; private NodeRenderer myCurrentRenderer = null; private final CompoundRendererConfigurable myRendererDataConfigurable = new CompoundRendererConfigurable(); - @Override - @NotNull - public JComponent getComponent() { + public UserRenderersConfigurable() { + super(new BorderLayout(4, 0)); + JPanel left = new JPanel(new BorderLayout()); left.add(createToolbar(), BorderLayout.NORTH); left.add(createRenderersList(), BorderLayout.CENTER); @@ -75,10 +75,14 @@ public class UserRenderersConfigurable implements ConfigurableUi false") public static boolean isNotPrimitiveTypeExpression(@Nullable PsiExpression expression) { - return expression != null && expression.getType() != null && !(expression.getType() instanceof PsiPrimitiveType); + if (expression == null) { + return false; + } + PsiType type = expression.getType(); + return type != null && !(type instanceof PsiPrimitiveType); } @Contract("null -> false") diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/ClassProcessingBuilder.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/ClassProcessingBuilder.java index 551c3ce2f308..bc353aa4b144 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/ClassProcessingBuilder.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/ClassProcessingBuilder.java @@ -144,7 +144,7 @@ public abstract class ClassProcessingBuilder extends ModuleLevelBuilder { public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { result.set(version); } - }, 0); + }, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); return result.get(); } diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogJoiner.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogJoiner.java index a0437a1f4e5f..fc51742b5318 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogJoiner.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogJoiner.java @@ -101,7 +101,7 @@ public class VcsLogJoiner> { searchHashes.remove(commit.getId()); } if (searchHashes.size() != 0) - throw new IllegalStateException(ILLEGAL_DATA_RELOAD_ALL); + throw new VcsLogRefreshNotEnoughDataException(); return lastIndex; } @@ -153,7 +153,7 @@ public class VcsLogJoiner> { private void markRealRedNode(@NotNull CommitId node) { if (!currentRed.remove(node)) - throw new VcsLogRefreshNotEnoughDataException(); + throw new IllegalStateException(ILLEGAL_DATA_RELOAD_ALL); // never happened allRedCommit.add(node); } @@ -173,7 +173,7 @@ public class VcsLogJoiner> { if (currentRed.isEmpty()) return lastIndex + 1; } - throw new IllegalStateException(ILLEGAL_DATA_RELOAD_ALL); + throw new IllegalStateException(ILLEGAL_DATA_RELOAD_ALL); // see VcsLogJoinerTest#illegalStateExceptionTest } public Set getAllRedCommit() { diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogRefresherImpl.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogRefresherImpl.java index f5c2f49640fa..12996f91c116 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogRefresherImpl.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsLogRefresherImpl.java @@ -377,7 +377,7 @@ public class VcsLogRefresherImpl implements VcsLogRefresher { LOG.error(e); // collecting information : how often this situation happens, do we need to try to load more or can safely reload all } catch (IllegalStateException e) { - LOG.info(e); + LOG.error(e); } return null; } diff --git a/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogJoinerTest.java b/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogJoinerTest.java deleted file mode 100644 index 63e54b910bfc..000000000000 --- a/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogJoinerTest.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.intellij.vcs.log.data; - -import com.intellij.util.ArrayUtil; -import com.intellij.util.Function; -import com.intellij.util.containers.ContainerUtil; -import com.intellij.vcs.log.Hash; -import com.intellij.vcs.log.TimedCommitParser; -import com.intellij.vcs.log.TimedVcsCommit; -import com.intellij.vcs.log.impl.HashImpl; -import org.junit.Test; - -import java.util.Collection; -import java.util.List; - -import static java.util.Arrays.asList; -import static org.junit.Assert.assertEquals; - -/** - * @author Kirill Likhodedov - */ -public class VcsLogJoinerTest { - - public void runTest(List initial, List updateBlock, List oldRefs, List newRefs, String expected) { - List savedLog = TimedCommitParser.log(ArrayUtil.toStringArray(initial)); - List firstBlock = TimedCommitParser.log(ArrayUtil.toStringArray(updateBlock)); - Collection vcsOldRefs = ContainerUtil.map(oldRefs, new Function() { - @Override - public Hash fun(String s) { - return HashImpl.build(s); - } - }); - Collection vcsNewRefs = ContainerUtil.map(newRefs, new Function() { - @Override - public Hash fun(String s) { - return HashImpl.build(s); - } - }); - - List result = new VcsLogJoiner().addCommits(savedLog, vcsOldRefs, firstBlock, vcsNewRefs).getFirst(); - assertEquals(expected, toStr(result)); - } - - @Test - public void simpleTest() { - runTest( - asList("4|-a2|-a1", "3|-b1|-a", "2|-a1|-a", "1|-a|-"), - asList("5|-f|-b1", "6|-e|-a2"), - asList("a2", "b1"), - asList("f", "e"), - "e, f, a2, b1, a1, a" - ); - } - - @Test - public void oneNodeTest() { - runTest( - asList("3|-a1|-"), - asList("3|-a1|-"), - asList("a1"), - asList("a1"), - "a1" - ); - } - - @Test - public void oneNodeResetTest() { - runTest( - asList("3|-a1|-a2", "2|-a2|-"), - asList("2|-a2|-"), - asList("a2", "a1"), - asList("a2"), - "a2" - ); - } - - @Test - public void oneNodeReset2Test() { - runTest( - asList("3|-a1|-a2", "2|-a2|-"), - asList("2|-a2|-"), - asList("a1"), - asList("a2"), - "a2" - ); - } - - @Test - public void simpleRemoveCommitsTest() { - runTest( - asList("4|-a2|-a1", "3|-b1|-a", "2|-a1|-a", "1|-a|-"), - asList("5|-f|-b1", "6|-e|-a1"), - asList("a2"), - asList("f", "e"), - "e, f, b1, a1, a" - ); - } - - @Test - public void removeCommitsTest() { - runTest( - asList("5|-a5|-a4", "4|-a4|-a2 a3", "3|-a3|-a1", "2|-a2|-a1", "1|-a1|-"), - asList("6|-a6|-a3"), - asList("a5"), - asList("a6"), - "a6, a3, a1" - ); - } - - @Test - public void removeCommitsTest2() { - runTest( - asList("2|-a2|-a1", "1|-a1|-"), - asList("5|-a5|-a4", "3|-a3|-a2", "4|-a4|-a3"), - asList("a2"), - asList("a5"), - "a5, a4, a3, a2, a1" - ); - } - - @Test - public void removeCommitsTest3() { - runTest( - asList("3|-a3|-a2", "2|-a2|-a1", "1|-a1|-"), - asList("2|-a2|-a1"), - asList("a3"), - asList("a2"), - "a2, a1" - ); - } - - private static String toStr(List commits) { - StringBuilder s = new StringBuilder(); - for (TimedVcsCommit commit : commits) { - if (s.length() != 0) { - s.append(", "); - } - s.append(commit.getId().asString()); - } - return s.toString(); - } -} diff --git a/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogJoinerTest.kt b/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogJoinerTest.kt new file mode 100644 index 000000000000..ed4218473984 --- /dev/null +++ b/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogJoinerTest.kt @@ -0,0 +1,468 @@ +/* + * Copyright 2000-2014 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.vcs.log.data + +import org.junit.Test +import java.util.ArrayList +import com.intellij.vcs.log.TimedCommitParser +import com.intellij.util.ArrayUtil +import com.intellij.vcs.log.impl.HashImpl +import com.intellij.vcs.log.TimedVcsCommit +import com.intellij.vcs.log.Hash +import org.junit.Assert.* + + +class VcsLogJoinerTest { + + class StringArrayBuilder() { + val result = ArrayList() + + fun String.plus() = result.add(this) + + fun Collection.plus() = result.addAll(this) + } + + class TestRunner() { + private var fullLog: List? = null + private var recentCommits: List? = null + private var oldRefs: List? = null + private var newRefs: List? = null + private var expected: String? = null + + private fun build(f: StringArrayBuilder.() -> Unit): List { + val stringArrayBuilder = StringArrayBuilder() + stringArrayBuilder.f() + return stringArrayBuilder.result + } + + fun fullLog(f: StringArrayBuilder.() -> Unit) {fullLog = build(f)} + + fun recentCommits(f: StringArrayBuilder.() -> Unit) {recentCommits = build(f)} + + fun oldRefs(f: StringArrayBuilder.() -> Unit) {oldRefs = build(f)} + + fun newRefs(f: StringArrayBuilder.() -> Unit) {newRefs = build(f)} + + fun expected(f: StringArrayBuilder.() -> Unit) {expected = build(f).join(separator = "\n")} + + fun run() { + val vcsFullLog = TimedCommitParser.log(fullLog!!) + val vcsRecentCommits = TimedCommitParser.log(recentCommits!!) + val vcsOldRefs = oldRefs!!.map { HashImpl.build(it) } + val vcsNewRefs = newRefs!!.map { HashImpl.build(it) } + + val result = VcsLogJoiner().addCommits(vcsFullLog, vcsOldRefs, vcsRecentCommits, vcsNewRefs).getFirst()!! + val actual = result.map { it.getId().asString() }.join(separator = "\n") + assertEquals(expected, actual) + } + } + + fun runTest(f: TestRunner.() -> Unit) { + val testRunner = TestRunner() + testRunner.f() + testRunner.run() + } + + val BIG_TIME = 100000000 + + Test fun simple() { + runTest { + fullLog { + +"4|-a2|-a1" + +"3|-b1|-a" + +"2|-a1|-a" + +"1|-a|-" + } + recentCommits { + +"5|-f|-b1" + +"6|-e|-a2" + } + oldRefs { + +"a2" + +"b1" + } + newRefs { + +"f" + +"e" + } + expected { + +"e" + +"f" + +"a2" + +"b1" + +"a1" + +"a" + } + } + } + + Test fun oneNode() { + runTest { + fullLog { + +"3|-a1|-" + } + recentCommits { + +"3|-a1|-" + } + oldRefs { + +"a1" + } + newRefs { + +"a1" + } + expected { + +"a1" + } + } + } + + Test fun oneNodeReset() { + runTest { + fullLog { + +"3|-a1|-a2" + +"2|-a2|-" + } + recentCommits { + +"2|-a2|-" + } + oldRefs { + +"a2" + +"a1" + } + newRefs { + +"a2" + } + expected { + +"a2" + } + } + } + + Test fun oneNodeReset2() { + runTest { + fullLog { + +"3|-a1|-a2" + +"2|-a2|-" + } + recentCommits { + +"2|-a2|-" + } + oldRefs { + +"a1" + } + newRefs { + +"a2" + } + expected { + +"a2" + } + } + } + + Test fun simpleRemoveCommits() { + runTest { + fullLog { + +"4|-a2|-a1" + +"3|-b1|-a" + +"2|-a1|-a" + +"1|-a|-" + } + recentCommits { + +"5|-f|-b1" + +"6|-e|-a1" + } + oldRefs { + +"a2" + } + newRefs { + +"f" + +"e" + } + expected { + +"e" + +"f" + +"b1" + +"a1" + +"a" + } + } + } + + Test fun removeCommits() { + runTest { + fullLog { + +"5|-a5|-a4" + +"4|-a4|-a2 a3" + +"3|-a3|-a1" + +"2|-a2|-a1" + +"1|-a1|-" + } + recentCommits { + +"6|-a6|-a3" + } + oldRefs { + +"a5" + } + newRefs { + +"a6" + } + expected { + +"a6" + +"a3" + +"a1" + } + } + } + + Test fun removeCommits2() { + runTest { + fullLog { + +"2|-a2|-a1" + +"1|-a1|-" + } + recentCommits { + +"5|-a5|-a4" + +"3|-a3|-a2" + +"4|-a4|-a3" + } + oldRefs { + +"a2" + } + newRefs { + +"a5" + } + expected { + +"a5" + +"a4" + +"a3" + +"a2" + +"a1" + } + } + } + + Test fun removeCommits3() { + runTest { + fullLog { + +"3|-a3|-a2" + +"2|-a2|-a1" + +"1|-a1|-" + } + recentCommits { + +"2|-a2|-a1" + } + oldRefs { + +"a3" + } + newRefs { + +"a2" + } + expected { + +"a2" + +"a1" + } + } + } + + Test fun removeOldBranch() { + runTest { + fullLog { + +"100|-e1|-e10" + +(10..100000).map { "${BIG_TIME - it}|-e${it}|-e${it + 1}" } + +"5|-e100001|-a1" + +"4|-b2|-b1" + +"3|-b1|-a1" + +"1|-a1|-" + } + recentCommits { + +"100|-e1|-e10" + } + oldRefs { + +"e1" + +"b2" + } + newRefs { + "e1" + } + expected { + +"e1" + +(10..100000).map { "e$it" } + +"e100001" + +"a1" + } + } + } + + Test fun addToOldBranch() { + runTest { + fullLog { + +"100|-e1|-e10" + +(10..100000).map { "${BIG_TIME - it}|-e${it}|-e${it + 1}" } + +"5|-e100001|-a1" + +"4|-b2|-b1" + +"3|-b1|-a1" + +"1|-a1|-" + } + recentCommits { + +"50|-b4|-b3" + +"49|-b3|-b2" + } + oldRefs { + +"e1" + +"b2" + } + newRefs { + +"e1" + +"b4" + } + expected { + +"e1" + +(10..100000).map { "e$it" } + +"b4" + +"b3" + +"e100001" + +"b2" + +"b1" + +"a1" + } + } + } + + Test fun removeLongBranch() { + runTest { + fullLog { + +"100|-e1|-e10" + +(10..100000).map { "${BIG_TIME - it}|-e${it}|-e${it + 1}" } + +"5|-e100001|-a1" + +"4|-b2|-b1" + +"3|-b1|-a1" + +"1|-a1|-" + } + recentCommits { + +"50|-b4|-b3" + +"49|-b3|-b2" + } + oldRefs { + +"e1" + +"b2" + } + newRefs { + +"b4" + } + expected { + +"b4" + +"b3" + +"b2" + +"b1" + +"a1" + } + } + } + + Test fun notEnoughDataExceptionTest() { + try { + runTest { + fullLog { + +"1|-a1|-" + } + recentCommits { + +"3|-a3|-a2" + } + oldRefs { + +"a1" + } + newRefs { + +"a3" + } + } + } catch (e: VcsLogRefreshNotEnoughDataException) { + return + } + fail() + } + + Test fun illegalStateExceptionTest() { + try { + runTest { + fullLog { + +"1|-a1|-" + } + recentCommits { + +"1|-a1|-" + } + oldRefs { + +"a1" + +"a2" + } + newRefs { + +"a1" + } + } + } catch (e: IllegalStateException) { + return + } + fail() + } + + Test fun removeParallelBranch() { + runTest { + fullLog { + +"4|-a4|-a1" + +"3|-a3|-a2" + +"2|-a2|-" + +"1|-a1|-" + } + recentCommits { + + } + oldRefs { + +"a4" + +"a3" + } + newRefs { + +"a3" + } + expected { + +"a3" + +"a2" + } + } + } + + Test fun removeAll() { + runTest { + fullLog { + +"4|-a4|-a1" + +"3|-a3|-a2" + +"2|-a2|-" + +"1|-a1|-" + } + recentCommits { + + } + oldRefs { + +"a4" + +"a3" + } + newRefs { + + } + expected { + + } + } + } +} diff --git a/platform/vcs-log/impl/vcs-log-impl.iml b/platform/vcs-log/impl/vcs-log-impl.iml index 5668888806ac..304affc03123 100644 --- a/platform/vcs-log/impl/vcs-log-impl.iml +++ b/platform/vcs-log/impl/vcs-log-impl.iml @@ -21,6 +21,7 @@ + diff --git a/python/edu/build/pycharm_edu_build.gant b/python/edu/build/pycharm_edu_build.gant index 7097ccac358f..bd14541654ec 100644 --- a/python/edu/build/pycharm_edu_build.gant +++ b/python/edu/build/pycharm_edu_build.gant @@ -20,6 +20,8 @@ import static org.jetbrains.jps.idea.IdeaProjectLoader.guessHome setProperty("home", guessHome(this as Script)) includeTargets << new File("${guessHome(this as Script)}/build/scripts/utils.gant") +// signMacZip locates in ultimate_utils.gant +includeTargets << new File("${guessHome(this)}/build/scripts/ultimate_utils.gant") includeTargets << new File("${guessHome(this)}/build/scripts/libLicenses.gant") requireProperty("buildNumber", requireProperty("build.number", snapshot)) @@ -137,8 +139,7 @@ target('default': "Build artifacts") { // "${pythonEduHome}/build/strings.nsi", "${pythonEduHome}/build/paths.nsi", // "pycharm", false, true, ".py", system_selector) - def extraArgs = ["build.code": "pycharmEDU-${buildName}", "build.number": "PE-$buildNumber", "artifacts.path": "${paths.artifacts}"] - + def extraArgs = ["build.code": "pycharmEDU-${buildNumber}", "build.number": "PE-$buildNumber", "artifacts.path": "${paths.artifacts}"] signMacZip("pycharm", extraArgs) buildDmg("pycharm", "${pythonEduHome}/build/DMG_background.png", extraArgs)