move check for isProjectOrWorkspaceFile to be after project's isInContent condition, to avoid content loading for non project files via getFileType() content detection (IDEA-133507)

This commit is contained in:
Maxim.Mossienko
2014-12-05 11:46:59 +01:00
parent f9359d031a
commit b199734a0e

View File

@@ -254,9 +254,6 @@ public class BuildManager implements ApplicationComponent{
if (!eventFile.isValid()) {
return true; // should be deleted
}
if (ProjectCoreUtil.isProjectOrWorkspaceFile(eventFile)) {
continue;
}
if (project == null) {
// lazy init
@@ -268,6 +265,10 @@ public class BuildManager implements ApplicationComponent{
}
if (fileIndex.isInContent(eventFile)) {
if (ProjectCoreUtil.isProjectOrWorkspaceFile(eventFile)) {
continue;
}
return true;
}
}
@@ -387,9 +388,9 @@ public class BuildManager implements ApplicationComponent{
public void clearState(Project project) {
final String projectPath = getProjectPath(project);
cancelPreloadedBuilds(projectPath);
synchronized (myProjectDataMap) {
final ProjectData data = myProjectDataMap.get(projectPath);
if (data != null) {
@@ -823,7 +824,7 @@ public class BuildManager implements ApplicationComponent{
private Future<Pair<RequestFuture<PreloadedProcessMessageHandler>, OSProcessHandler>> launchPreloadedBuildProcess(final Project project, SequentialTaskExecutor projectTaskQueue) throws Exception {
ensureListening();
// launching build process from projectTaskQueue ensures that no other build process for this project is currently running
return projectTaskQueue.submit(new Callable<Pair<RequestFuture<PreloadedProcessMessageHandler>, OSProcessHandler>>() {
public Pair<RequestFuture<PreloadedProcessMessageHandler>, OSProcessHandler> call() throws Exception {
@@ -845,7 +846,7 @@ public class BuildManager implements ApplicationComponent{
}
});
}
private OSProcessHandler launchBuildProcess(Project project, final int port, final UUID sessionId, boolean requestProjectPreload) throws ExecutionException {
final String compilerPath;
final String vmExecutablePath;
@@ -951,7 +952,7 @@ public class BuildManager implements ApplicationComponent{
cmdLine.addParameter("-Dpreload.project.path=" + FileUtil.toCanonicalPath(getProjectPath(project)));
cmdLine.addParameter("-Dpreload.config.path=" + FileUtil.toCanonicalPath(PathManager.getOptionsPath()));
}
final String shouldGenerateIndex = System.getProperty(GlobalOptions.GENERATE_CLASSPATH_INDEX_OPTION);
if (shouldGenerateIndex != null) {
cmdLine.addParameter("-D"+ GlobalOptions.GENERATE_CLASSPATH_INDEX_OPTION +"=" + shouldGenerateIndex);
@@ -975,11 +976,11 @@ public class BuildManager implements ApplicationComponent{
cmdLine.addParameter(option);
}
}
if (isProfilingMode) {
cmdLine.addParameter("-agentlib:yjpagent=disablej2ee,disablealloc,delay=10000,sessionname=ExternalBuild");
}
// debugging
final int debugPort = Registry.intValue("compiler.process.debug.port");
if (debugPort > 0) {
@@ -1016,10 +1017,10 @@ public class BuildManager implements ApplicationComponent{
final List<String> args = provider.getVMArguments();
cmdLine.addParameters(args);
}
@SuppressWarnings("UnnecessaryFullyQualifiedName")
@SuppressWarnings("UnnecessaryFullyQualifiedName")
final Class<?> launcherClass = org.jetbrains.jps.cmdline.Launcher.class;
final List<String> launcherCp = new ArrayList<String>();
launcherCp.add(ClasspathBootstrap.getResourcePath(launcherClass));
launcherCp.add(compilerPath);
@@ -1027,7 +1028,7 @@ public class BuildManager implements ApplicationComponent{
launcherCp.addAll(BuildProcessClasspathManager.getLauncherClasspath(project));
cmdLine.addParameter("-classpath");
cmdLine.addParameter(classpathToString(launcherCp));
cmdLine.addParameter(launcherClass.getName());
final List<String> cp = ClasspathBootstrap.getBuildProcessApplicationClasspath(true);
@@ -1064,7 +1065,7 @@ public class BuildManager implements ApplicationComponent{
}
}
});
return processHandler;
}
@@ -1239,7 +1240,7 @@ public class BuildManager implements ApplicationComponent{
@Override
public void onTextAvailable(ProcessEvent event, Key outputType) {
String text;
synchronized (this) {
if (myStoredLength > 2048) {
return;
@@ -1250,7 +1251,7 @@ public class BuildManager implements ApplicationComponent{
}
myStoredLength += text.length();
}
try {
myOutput.append(text);
}
@@ -1454,7 +1455,7 @@ public class BuildManager implements ApplicationComponent{
}
myPath = list.toArray();
}
public abstract String getValue();
@Override
@@ -1473,12 +1474,12 @@ public class BuildManager implements ApplicationComponent{
public int hashCode() {
return Arrays.hashCode(myPath);
}
public static InternedPath create(String path) {
return path.startsWith("/")? new XInternedPath(path) : new WinInternedPath(path);
return path.startsWith("/")? new XInternedPath(path) : new WinInternedPath(path);
}
}
private static class WinInternedPath extends InternedPath {
private WinInternedPath(String path) {
super(path);
@@ -1491,7 +1492,7 @@ public class BuildManager implements ApplicationComponent{
// handle case of windows drive letter
return name.length() == 2 && name.endsWith(":")? name + "/" : name;
}
final StringBuilder buf = new StringBuilder();
for (int element : myPath) {
if (buf.length() > 0) {