From e2ffe19d36e25a9d208e53a534f878e8605ed5ab Mon Sep 17 00:00:00 2001 From: nik Date: Mon, 8 Oct 2012 11:39:15 +0400 Subject: [PATCH] cleanup --- .../compiler/server/BuildManager.java | 25 ++++++------------- .../jetbrains/jps/api/CmdlineProtoUtil.java | 8 +++--- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java index a34084fa28ea..6fb2c80e3d80 100644 --- a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java +++ b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java @@ -137,7 +137,7 @@ public class BuildManager implements ApplicationComponent{ private final CompileServerClasspathManager myClasspathManager = new CompileServerClasspathManager(); private final Executor myPooledThreadExecutor = new Executor() { @Override - public void execute(Runnable command) { + public void execute(@NotNull Runnable command) { ApplicationManager.getApplication().executeOnPooledThread(command); } }; @@ -478,7 +478,7 @@ public class BuildManager implements ApplicationComponent{ globals = buildGlobalSettings(); myGlobals = globals; } - CmdlineRemoteProto.Message.ControllerMessage.FSEvent currentFSChanges = null; + CmdlineRemoteProto.Message.ControllerMessage.FSEvent currentFSChanges; final SequentialTaskExecutor projectTaskQueue; synchronized (myProjectDataMap) { ProjectData data = myProjectDataMap.get(projectPath); @@ -761,21 +761,12 @@ public class BuildManager implements ApplicationComponent{ cmdLine.addParameter("-D"+ GlobalOptions.HOSTNAME_OPTION + "=" + host); // javac's VM should use the same default locale that IDEA uses in order for javac to print messages in 'correct' language - final String lang = System.getProperty("user.language"); - if (lang != null) { - //noinspection HardCodedStringLiteral - cmdLine.addParameter("-Duser.language=" + lang); - } - final String country = System.getProperty("user.country"); - if (country != null) { - //noinspection HardCodedStringLiteral - cmdLine.addParameter("-Duser.country=" + country); - } - //noinspection HardCodedStringLiteral - final String region = System.getProperty("user.region"); - if (region != null) { - //noinspection HardCodedStringLiteral - cmdLine.addParameter("-Duser.region=" + region); + String[] propertyNames = {"user.language", "user.country", "user.region"}; + for (String name : propertyNames) { + final String value = System.getProperty(name); + if (value != null) { + cmdLine.addParameter("-D" + name + "=" + value); + } } cmdLine.addParameter("-classpath"); diff --git a/jps/jps-builders/src/org/jetbrains/jps/api/CmdlineProtoUtil.java b/jps/jps-builders/src/org/jetbrains/jps/api/CmdlineProtoUtil.java index 38d0aa113a45..ac843603c68b 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/api/CmdlineProtoUtil.java +++ b/jps/jps-builders/src/org/jetbrains/jps/api/CmdlineProtoUtil.java @@ -22,7 +22,7 @@ public class CmdlineProtoUtil { List scopes, final Map userData, final CmdlineRemoteProto.Message.ControllerMessage.GlobalSettings globals, - final CmdlineRemoteProto.Message.ControllerMessage.FSEvent event) { + final @Nullable CmdlineRemoteProto.Message.ControllerMessage.FSEvent event) { return createBuildParametersMessage(CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.Type.MAKE, project, scopes, userData, Collections.emptyList(), globals, event); @@ -33,7 +33,7 @@ public class CmdlineProtoUtil { Collection paths, final Map userData, final CmdlineRemoteProto.Message.ControllerMessage.GlobalSettings globals, - final CmdlineRemoteProto.Message.ControllerMessage.FSEvent event) { + final @Nullable CmdlineRemoteProto.Message.ControllerMessage.FSEvent event) { return createBuildParametersMessage(CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.Type.FORCED_COMPILATION, project, scopes, userData, paths, globals, event); } @@ -63,7 +63,7 @@ public class CmdlineProtoUtil { private static CmdlineRemoteProto.Message.ControllerMessage createBuildParametersMessage(CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.Type buildType, String project, - List scopes, + List scopes, Map userData, Collection paths, final CmdlineRemoteProto.Message.ControllerMessage.GlobalSettings globals, @@ -99,7 +99,7 @@ public class CmdlineProtoUtil { } - public static CmdlineRemoteProto.Message.Failure createFailure(String description, Throwable cause) { + public static CmdlineRemoteProto.Message.Failure createFailure(String description, @Nullable Throwable cause) { final CmdlineRemoteProto.Message.Failure.Builder builder = CmdlineRemoteProto.Message.Failure.newBuilder(); builder.setDescription(description); if (cause != null) {