Merge remote-tracking branch 'origin/master'

This commit is contained in:
sergey.vasiliev
2017-08-07 14:09:13 +02:00
4 changed files with 21 additions and 3 deletions
@@ -308,6 +308,7 @@ class RefCountHolder {
ProgressIndicator result;
if (myState.compareAndSet(EMPTY, indicator)) {
if (!file.getTextRange().equals(dirtyScope)) {
log(" RefCountHolder: invalid scope " + dirtyScope);
// empty holder needs filling before it can be used, so restart daemon to re-analyze the whole file
myState.set(EMPTY);
return false;
@@ -64,11 +64,19 @@ class JdkUtilTest : BareTestFixtureTestCase() {
}
@Test fun noDynamicClasspathInJarMode() {
parameters.setUseDynamicClasspath(false)
parameters.mainClass = null
parameters.jarPath = "/classes/main.jar"
doTest("-Xmx256m", "-Dan.option=1", "-classpath", "/classes/hello.jar", "-jar", "/classes/main.jar", "hello")
}
@Test fun `do not use CommandLineWrapper for 'java -jar' command`() {
parameters.mainClass = null
parameters.classPath.clear()
parameters.jarPath = "/classes/main.jar"
doTest("-Xmx256m", "-Dan.option=1", "-jar", "/classes/main.jar", "hello")
}
@Test fun dynamicClasspathWithJar() {
parameters.isUseClasspathJar = true
doTest("-Xmx256m", "-Dan.option=1", "-classpath", "#classpath.jar#", "hello.Main", "hello")
@@ -68,6 +68,15 @@ public class ProgressWrapper extends AbstractProgressIndicatorBase implements Wr
}
}
@Nullable
@Override
protected Throwable getCancellationTrace() {
if (myOriginal instanceof AbstractProgressIndicatorBase) {
return ((AbstractProgressIndicatorBase)myOriginal).getCancellationTrace();
}
return super.getCancellationTrace();
}
private boolean isCanceledRaw() { return super.isCanceled(); }
private void checkCanceledRaw() { super.checkCanceled(); }
@@ -207,7 +207,8 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
DaemonCodeAnalyzerSettings settings = DaemonCodeAnalyzerSettings.getInstance();
ProcessCanceledException exception = null;
for (int i = 0; i < 1000; i++) {
int retries = 1000;
for (int i = 0; i < retries; i++) {
int oldDelay = settings.AUTOREPARSE_DELAY;
try {
settings.AUTOREPARSE_DELAY = 0;
@@ -231,8 +232,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
settings.AUTOREPARSE_DELAY = oldDelay;
}
}
// unable to highlight after 100 retries
throw exception;
throw new AssertionError("Unable to highlight after " + retries + " retries", exception);
}
public static void ensureIndexesUpToDate(@NotNull Project project) {