diff --git a/build/dependencies/setupJbre.gradle b/build/dependencies/setupJbre.gradle index 9b35b8825497..afdd2bc28871 100644 --- a/build/dependencies/setupJbre.gradle +++ b/build/dependencies/setupJbre.gradle @@ -50,10 +50,12 @@ jrePlatformsToDownload(targetOs).each { platform -> commandLine 'tar', '-xpf', "${downloadOutputs.singleFile.absolutePath}", '--directory', outputDir if (platform != 'osx') { doLast { - exec { - commandLine 'mv', "$outputDir/lib/tools.jar", "$outputDir/jre/lib/" - ignoreExitValue = true - } + if (file("$outputDir/lib/tools.jar").exists()) { + exec { + commandLine 'mv', "$outputDir/lib/tools.jar", "$outputDir/jre/lib/" + ignoreExitValue = true + } + } } } } diff --git a/platform/platform-resources/src/META-INF/VcsExtensions.xml b/platform/platform-resources/src/META-INF/VcsExtensions.xml index 1d99c0ff1217..93b0a4a4ada1 100644 --- a/platform/platform-resources/src/META-INF/VcsExtensions.xml +++ b/platform/platform-resources/src/META-INF/VcsExtensions.xml @@ -31,6 +31,10 @@ serviceImplementation="com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl"/> + + diff --git a/platform/platform-resources/src/componentSets/VCS.xml b/platform/platform-resources/src/componentSets/VCS.xml index c1b2a504f1f1..f551539d0be9 100644 --- a/platform/platform-resources/src/componentSets/VCS.xml +++ b/platform/platform-resources/src/componentSets/VCS.xml @@ -97,9 +97,5 @@ com.intellij.openapi.vcs.impl.VcsBaseContentProvider com.intellij.openapi.vcs.impl.VcsFileStatusProvider - com.intellij.openapi.vcs.contentAnnotation.VcsContentAnnotation - com.intellij.openapi.vcs.contentAnnotation.VcsContentAnnotationImpl - com.intellij.openapi.vcs.contentAnnotation.ContentAnnotationCache - com.intellij.openapi.vcs.contentAnnotation.ContentAnnotationCacheImpl diff --git a/platform/util/src/com/intellij/util/containers/JBIterable.java b/platform/util/src/com/intellij/util/containers/JBIterable.java index 7ab367bc3d24..0adbf47baa7d 100644 --- a/platform/util/src/com/intellij/util/containers/JBIterable.java +++ b/platform/util/src/com/intellij/util/containers/JBIterable.java @@ -266,12 +266,19 @@ public abstract class JBIterable implements Iterable { */ @Nullable public final E get(int index) { - if (myIterable instanceof List) { - return index >= ((List)myIterable).size() ? null : ((List)myIterable).get(index); + List list = asRandomAccess(myIterable); + if (list != null) { + return index >= list.size() ? null : list.get(index); } return skip(index).first(); } + @Nullable + private static List asRandomAccess(@Nullable Iterable iterable) { + //noinspection CastConflictsWithInstanceof + return iterable instanceof RandomAccess? (List)iterable : null; + } + /** * Returns a {@code JBIterable} which iterators traverse first the elements of this iterable, * followed by those of {@code other}. The iterators are not polled until necessary. @@ -464,8 +471,9 @@ public abstract class JBIterable implements Iterable { */ @Nullable public final E first() { - if (myIterable instanceof List) { - return ((List)myIterable).isEmpty() ? null : ((List)myIterable).get(0); + List list = asRandomAccess(myIterable); + if (list != null) { + return list.isEmpty() ? null : list.get(0); } Iterator iterator = myIterable.iterator(); return iterator.hasNext() ? iterator.next() : null; @@ -476,8 +484,9 @@ public abstract class JBIterable implements Iterable { */ @Nullable public final E single() { - if (myIterable instanceof List) { - return ((List)myIterable).size() != 1 ? null : (E)((List)myIterable).get(0); + List list = asRandomAccess(myIterable); + if (list != null) { + return list.size() != 1 ? null : list.get(0); } Iterator iterator = myIterable.iterator(); E first = iterator.hasNext() ? iterator.next() : null; @@ -489,8 +498,9 @@ public abstract class JBIterable implements Iterable { */ @Nullable public final E last() { - if (myIterable instanceof List) { - return ((List)myIterable).isEmpty() ? null : (E)((List)myIterable).get(((List)myIterable).size() - 1); + List list = asRandomAccess(myIterable); + if (list != null) { + return list.isEmpty() ? null : list.get(list.size() - 1); } E cur = null; for (E e : myIterable) { diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/versionBrowser/CommittedChangeList.java b/platform/vcs-api/src/com/intellij/openapi/vcs/versionBrowser/CommittedChangeList.java index 589de8683f6a..e8cdf3f543bb 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/versionBrowser/CommittedChangeList.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/versionBrowser/CommittedChangeList.java @@ -49,7 +49,9 @@ public interface CommittedChangeList extends ChangeList { */ AbstractVcs getVcs(); - Collection getChangesWithMovedTrees(); + default Collection getChangesWithMovedTrees() { + return getChanges(); + } /** * @return true if this change list can be modified, for example, by reverting some of the changes. diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/versionBrowser/CommittedChangeListImpl.java b/platform/vcs-api/src/com/intellij/openapi/vcs/versionBrowser/CommittedChangeListImpl.java index a7c7787b60e2..c13f51385a44 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/versionBrowser/CommittedChangeListImpl.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/versionBrowser/CommittedChangeListImpl.java @@ -63,10 +63,6 @@ public class CommittedChangeListImpl implements CommittedChangeList { return null; } - public Collection getChangesWithMovedTrees() { - return getChangesWithMovedTreesImpl(this); - } - @Override public boolean isModifiable() { return true; @@ -77,10 +73,6 @@ public class CommittedChangeListImpl implements CommittedChangeList { myComment = newMessage; } - public static Collection getChangesWithMovedTreesImpl(final CommittedChangeList list) { - return list.getChanges(); - } - public Collection getChanges() { return myChanges; } diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/changeBrowser/CvsChangeList.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/changeBrowser/CvsChangeList.java index c0b887fc6d54..bc1a97dee80b 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/changeBrowser/CvsChangeList.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/changeBrowser/CvsChangeList.java @@ -26,7 +26,6 @@ import com.intellij.openapi.vcs.AbstractVcs; import com.intellij.openapi.vcs.changes.Change; import com.intellij.openapi.vcs.changes.ContentRevision; import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList; -import com.intellij.openapi.vcs.versionBrowser.CommittedChangeListImpl; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.io.IOUtil; import org.jetbrains.annotations.NonNls; @@ -110,10 +109,6 @@ public class CvsChangeList implements CommittedChangeList { return CvsVcs2.getInstance(myProject); } - public Collection getChangesWithMovedTrees() { - return CommittedChangeListImpl.getChangesWithMovedTreesImpl(this); - } - @Override public boolean isModifiable() { return true;