diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java index 39b052f5c82a..cc2b19b9cb66 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java @@ -126,7 +126,7 @@ public class CompileDriver { public static volatile boolean ourDebugMode = false; private final Project myProject; - private final Map, Pair> myGenerationCompilerModuleToOutputDirMap; // [IntermediateOutputCompiler, Module] -> [ProductionSources, TestSources] + private final Map, Couple> myGenerationCompilerModuleToOutputDirMap; // [IntermediateOutputCompiler, Module] -> [ProductionSources, TestSources] private final String myCachesDirectoryPath; private boolean myShouldClearOutputDirectory; @@ -171,7 +171,7 @@ public class CompileDriver { myCachesDirectoryPath = CompilerPaths.getCacheStoreDirectory(myProject).getPath().replace('/', File.separatorChar); myShouldClearOutputDirectory = CompilerWorkspaceConfiguration.getInstance(myProject).CLEAR_OUTPUT_DIRECTORY; - myGenerationCompilerModuleToOutputDirMap = new HashMap, Pair>(); + myGenerationCompilerModuleToOutputDirMap = new HashMap, Couple>(); if (!useOutOfProcessBuild()) { final LocalFileSystem lfs = LocalFileSystem.getInstance(); @@ -183,7 +183,7 @@ public class CompileDriver { final VirtualFile productionOutput = lookupVFile(lfs, CompilerPaths.getGenerationOutputPath(compiler, module, false)); final VirtualFile testOutput = lookupVFile(lfs, CompilerPaths.getGenerationOutputPath(compiler, module, true)); final Pair pair = Pair.create(compiler, module); - final Pair outputs = Pair.create(productionOutput, testOutput); + final Couple outputs = Couple.newOne(productionOutput, testOutput); myGenerationCompilerModuleToOutputDirMap.put(pair, outputs); } if (config.getAnnotationProcessingConfiguration(module).isEnabled()) { @@ -246,8 +246,8 @@ public class CompileDriver { return false; } - for (Map.Entry, Pair> entry : myGenerationCompilerModuleToOutputDirMap.entrySet()) { - final Pair outputs = entry.getValue(); + for (Map.Entry, Couple> entry : myGenerationCompilerModuleToOutputDirMap.entrySet()) { + final Couple outputs = entry.getValue(); final Pair key = entry.getKey(); final Module module = key.getSecond(); compileContext.assignModule(outputs.getFirst(), module, false, key.getFirst()); @@ -439,10 +439,10 @@ public class CompileDriver { private CompileScope attachIntermediateOutputDirectories(CompileScope originalScope, CompilerFilter filter) { CompileScope scope = originalScope; final Set affected = new HashSet(Arrays.asList(originalScope.getAffectedModules())); - for (Map.Entry, Pair> entry : myGenerationCompilerModuleToOutputDirMap.entrySet()) { + for (Map.Entry, Couple> entry : myGenerationCompilerModuleToOutputDirMap.entrySet()) { final Module module = entry.getKey().getSecond(); if (affected.contains(module) && filter.acceptCompiler(entry.getKey().getFirst())) { - final Pair outputs = entry.getValue(); + final Couple outputs = entry.getValue(); scope = new CompositeScope(scope, new FileSetCompileScope(Arrays.asList(outputs.getFirst(), outputs.getSecond()), new Module[]{module})); } } @@ -675,8 +675,8 @@ public class CompileDriver { new CompileContextImpl(myProject, compileTask, scope, dependencyCache, !isRebuild && !forceCompile, isRebuild); if (!useExtProcessBuild) { - for (Map.Entry, Pair> entry : myGenerationCompilerModuleToOutputDirMap.entrySet()) { - final Pair outputs = entry.getValue(); + for (Map.Entry, Couple> entry : myGenerationCompilerModuleToOutputDirMap.entrySet()) { + final Couple outputs = entry.getValue(); final Pair key = entry.getKey(); final Module module = key.getSecond(); compileContext.assignModule(outputs.getFirst(), module, false, key.getFirst()); @@ -1082,7 +1082,7 @@ public class CompileDriver { outputsToRefresh.add(output); } for (Pair pair : myGenerationCompilerModuleToOutputDirMap.keySet()) { - final Pair generated = myGenerationCompilerModuleToOutputDirMap.get(pair); + final Couple generated = myGenerationCompilerModuleToOutputDirMap.get(pair); walkChildren(generated.getFirst(), context); outputsToRefresh.add(generated.getFirst()); walkChildren(generated.getSecond(), context); @@ -1881,7 +1881,7 @@ public class CompileDriver { } private VirtualFile getGenerationOutputDir(final IntermediateOutputCompiler compiler, final Module module, final boolean forTestSources) { - final Pair outputs = + final Couple outputs = myGenerationCompilerModuleToOutputDirMap.get(Pair.create(compiler, module)); return forTestSources? outputs.getSecond() : outputs.getFirst(); } diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java index cfc34412e727..e845d03ac837 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java @@ -718,7 +718,7 @@ public class BackendCompilerWrapper { if (pathsEquals) { final String outputPath = cc.pathToClass.replace(File.separatorChar, '/'); - final Pair realLocation = moveToRealLocation(outputDir, outputPath, srcFile, filesToRefresh); + final Couple realLocation = moveToRealLocation(outputDir, outputPath, srcFile, filesToRefresh); if (realLocation != null) { Collection outputs = results.get(realLocation.getFirst()); if (outputs == null) { @@ -760,7 +760,10 @@ public class BackendCompilerWrapper { } @Nullable - private Pair moveToRealLocation(String tempOutputDir, String pathToClass, VirtualFile sourceFile, final List filesToRefresh) { + private Couple moveToRealLocation(String tempOutputDir, + String pathToClass, + VirtualFile sourceFile, + final List filesToRefresh) { final Module module = myCompileContext.getModuleByFile(sourceFile); if (module == null) { final String message = @@ -768,7 +771,7 @@ public class BackendCompilerWrapper { LOG.info(message); myCompileContext.addMessage(CompilerMessageCategory.WARNING, message, sourceFile.getUrl(), -1, -1); // do not move: looks like source file has been invalidated, need recompilation - return Pair.create(tempOutputDir, pathToClass); + return Couple.newOne(tempOutputDir, pathToClass); } final String realOutputDir; if (myCompileContext.isInTestSourceContent(sourceFile)) { @@ -782,7 +785,7 @@ public class BackendCompilerWrapper { if (FileUtil.pathsEqual(tempOutputDir, realOutputDir)) { // no need to move filesToRefresh.add(new File(pathToClass)); - return Pair.create(realOutputDir, pathToClass); + return Couple.newOne(realOutputDir, pathToClass); } final String realPathToClass = realOutputDir + pathToClass.substring(tempOutputDir.length()); @@ -809,7 +812,7 @@ public class BackendCompilerWrapper { } if (success) { filesToRefresh.add(toFile); - return Pair.create(realOutputDir, realPathToClass); + return Couple.newOne(realOutputDir, realPathToClass); } return null; } diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/JarsBuilder.java b/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/JarsBuilder.java index a546480c2298..c543abe674cc 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/JarsBuilder.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/packagingCompiler/JarsBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import com.intellij.openapi.compiler.CompilerBundle; import com.intellij.openapi.compiler.CompilerMessageCategory; import com.intellij.openapi.deployment.DeploymentUtil; import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.util.Couple; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; @@ -128,7 +129,7 @@ public class JarsBuilder { private JarInfo[] sortJars() { final DFSTBuilder builder = new DFSTBuilder(GraphGenerator.create(CachingSemiGraph.create(new JarsGraph()))); if (!builder.isAcyclic()) { - final Pair dependency = builder.getCircularDependency(); + final Couple dependency = builder.getCircularDependency(); String message = CompilerBundle.message("packaging.compiler.error.cannot.build.circular.dependency.found.between.0.and.1", dependency.getFirst().getPresentableDestination(), dependency.getSecond().getPresentableDestination());