summaryrefslogtreecommitdiff
path: root/platform/core-api/src/com/intellij/openapi
diff options
context:
space:
mode:
Diffstat (limited to 'platform/core-api/src/com/intellij/openapi')
-rw-r--r--platform/core-api/src/com/intellij/openapi/progress/ProgressManager.java16
-rw-r--r--platform/core-api/src/com/intellij/openapi/roots/FileIndexFacade.java1
-rw-r--r--platform/core-api/src/com/intellij/openapi/vfs/JarFile.java2
-rw-r--r--platform/core-api/src/com/intellij/openapi/vfs/VfsUtilCore.java14
4 files changed, 26 insertions, 7 deletions
diff --git a/platform/core-api/src/com/intellij/openapi/progress/ProgressManager.java b/platform/core-api/src/com/intellij/openapi/progress/ProgressManager.java
index a319700b4be2..e99b8e6bebf0 100644
--- a/platform/core-api/src/com/intellij/openapi/progress/ProgressManager.java
+++ b/platform/core-api/src/com/intellij/openapi/progress/ProgressManager.java
@@ -79,7 +79,7 @@ public abstract class ProgressManager {
}
}
- public static void progress(final String text) throws ProcessCanceledException {
+ public static void progress(@NotNull String text) throws ProcessCanceledException {
progress(text, "");
}
@@ -91,7 +91,7 @@ public abstract class ProgressManager {
}
}
- public static void progress(final String text, @Nullable String text2) throws ProcessCanceledException {
+ public static void progress(@NotNull String text, @Nullable String text2) throws ProcessCanceledException {
final ProgressIndicator pi = getInstance().getProgressIndicator();
if (pi != null) {
pi.checkCanceled();
@@ -103,6 +103,7 @@ public abstract class ProgressManager {
protected abstract void doCheckCanceled() throws ProcessCanceledException;
public abstract void executeNonCancelableSection(@NotNull Runnable runnable);
+ @NotNull
public abstract NonCancelableSection startNonCancelableSection();
public abstract void setCancelButtonText(String cancelButtonText);
@@ -135,9 +136,9 @@ public abstract class ProgressManager {
* @throws E exception thrown by process
*/
public abstract <T, E extends Exception> T runProcessWithProgressSynchronously(@NotNull ThrowableComputable<T, E> process,
- @NotNull @Nls String progressTitle,
- boolean canBeCanceled,
- @Nullable Project project) throws E;
+ @NotNull @Nls String progressTitle,
+ boolean canBeCanceled,
+ @Nullable Project project) throws E;
/**
* Runs the specified operation in a background thread and shows a modal progress dialog in the
@@ -206,7 +207,10 @@ public abstract class ProgressManager {
public abstract void runProcessWithProgressAsynchronously(@NotNull Task.Backgroundable task, @NotNull ProgressIndicator progressIndicator);
protected static final ThreadLocal<ProgressIndicator> myThreadIndicator = new ThreadLocal<ProgressIndicator>();
- public void executeProcessUnderProgress(@NotNull Runnable process, ProgressIndicator progress) throws ProcessCanceledException {
+
+ public void executeProcessUnderProgress(@NotNull Runnable process,
+ @Nullable("null means reuse current progress") ProgressIndicator progress)
+ throws ProcessCanceledException {
ProgressIndicator oldIndicator = null;
boolean set = progress != null && progress != (oldIndicator = myThreadIndicator.get());
diff --git a/platform/core-api/src/com/intellij/openapi/roots/FileIndexFacade.java b/platform/core-api/src/com/intellij/openapi/roots/FileIndexFacade.java
index cc7dddd3c848..96dde81c6a80 100644
--- a/platform/core-api/src/com/intellij/openapi/roots/FileIndexFacade.java
+++ b/platform/core-api/src/com/intellij/openapi/roots/FileIndexFacade.java
@@ -45,6 +45,7 @@ public abstract class FileIndexFacade {
public abstract boolean isInLibrarySource(@NotNull VirtualFile file);
public abstract boolean isExcludedFile(@NotNull VirtualFile file);
+ public abstract boolean isUnderIgnored(@NotNull VirtualFile file);
@Nullable
public abstract Module getModuleForFile(@NotNull VirtualFile file);
diff --git a/platform/core-api/src/com/intellij/openapi/vfs/JarFile.java b/platform/core-api/src/com/intellij/openapi/vfs/JarFile.java
index c363a815577a..f8ddc7630e23 100644
--- a/platform/core-api/src/com/intellij/openapi/vfs/JarFile.java
+++ b/platform/core-api/src/com/intellij/openapi/vfs/JarFile.java
@@ -22,7 +22,7 @@ import java.io.InputStream;
import java.util.Enumeration;
import java.util.zip.ZipFile;
-/** @deprecated causes ZipFile leaks, do not use (to be removed in IDEA 15) */
+/** @deprecated causes ZipFile leaks, do not use (to be removed in IDEA 15) + can lead to crashes (IDEA-126550) */
public interface JarFile {
interface JarEntry {
String getName();
diff --git a/platform/core-api/src/com/intellij/openapi/vfs/VfsUtilCore.java b/platform/core-api/src/com/intellij/openapi/vfs/VfsUtilCore.java
index cd0f15f3796c..9e8c37880589 100644
--- a/platform/core-api/src/com/intellij/openapi/vfs/VfsUtilCore.java
+++ b/platform/core-api/src/com/intellij/openapi/vfs/VfsUtilCore.java
@@ -84,6 +84,20 @@ public class VfsUtilCore {
return false;
}
+ /**
+ * @return {@code true} if {@code url} is located under one of {@code rootUrls} or equal to one of them
+ */
+ public static boolean isUnder(@NotNull String url, @Nullable Collection<String> rootUrls) {
+ if (rootUrls == null || rootUrls.isEmpty()) return false;
+
+ for (String excludesUrl : rootUrls) {
+ if (isEqualOrAncestor(excludesUrl, url)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public static boolean isEqualOrAncestor(@NotNull String ancestorUrl, @NotNull String fileUrl) {
if (ancestorUrl.equals(fileUrl)) return true;
if (StringUtil.endsWithChar(ancestorUrl, '/')) {