mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[compiler-openapi] use Couple
This commit is contained in:
@@ -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.
|
||||
@@ -25,7 +25,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ModifiableRootModel;
|
||||
import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.roots.ModuleRootModel;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import com.intellij.util.Chunk;
|
||||
import com.intellij.util.Processor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -136,7 +136,7 @@ public final class ModuleCompilerUtil {
|
||||
* @return pair of modules which become circular after adding dependency, or null if all remains OK
|
||||
*/
|
||||
@Nullable
|
||||
public static Pair<Module, Module> addingDependencyFormsCircularity(final Module currentModule, Module toDependOn) {
|
||||
public static Couple<Module> addingDependencyFormsCircularity(final Module currentModule, Module toDependOn) {
|
||||
assert currentModule != toDependOn;
|
||||
// whatsa lotsa of @&#^%$ codes-a!
|
||||
|
||||
@@ -159,7 +159,7 @@ public final class ModuleCompilerUtil {
|
||||
for (Chunk<ModifiableRootModel> chunk : nodesAfter) {
|
||||
if (chunk.containsNode(toDependOnModel) && chunk.containsNode(currentModel)) {
|
||||
Iterator<ModifiableRootModel> nodes = chunk.getNodes().iterator();
|
||||
return Pair.create(nodes.next().getModule(), nodes.next().getModule());
|
||||
return Couple.newOne(nodes.next().getModule(), nodes.next().getModule());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.intellij.compiler.ant;
|
||||
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -78,10 +79,10 @@ public class Tag extends CompositeGenerator {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected static Pair<String, String> pair(@NonNls String v1, @Nullable @NonNls String v2) {
|
||||
protected static Couple<String> pair(@NonNls String v1, @Nullable @NonNls String v2) {
|
||||
if (v2 == null) {
|
||||
return null;
|
||||
}
|
||||
return Pair.create(v1, v2);
|
||||
return Couple.newOne(v1, v2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
|
||||
/**
|
||||
* @author Eugene Zhuravlev
|
||||
@@ -27,6 +27,6 @@ import com.intellij.openapi.util.Pair;
|
||||
public class AntCall extends Tag{
|
||||
|
||||
public AntCall(final String target) {
|
||||
super("antcall", new Pair[] {Pair.create("target", target)});
|
||||
super("antcall", Couple.newOne("target", target));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
@@ -27,6 +27,6 @@ import org.jetbrains.annotations.NonNls;
|
||||
public class AntProject extends Tag {
|
||||
public AntProject(@NonNls String name, @NonNls String defaultTarget) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("project", new Pair[]{Pair.create("name", name), Pair.create("default", defaultTarget)});
|
||||
super("project", Couple.newOne("name", name), Couple.newOne("default", defaultTarget));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
@@ -27,6 +27,6 @@ import org.jetbrains.annotations.NonNls;
|
||||
public class Attribute extends Tag{
|
||||
public Attribute(@NonNls String name, String value) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("attribute", new Pair[] {Pair.create("name", name),Pair.create("value", value)});
|
||||
super("attribute", Couple.newOne("name", name), Couple.newOne("value", value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
@@ -27,10 +27,10 @@ import org.jetbrains.annotations.NonNls;
|
||||
public class Copy extends Tag {
|
||||
public Copy(@NonNls String toDir) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("copy", new Pair[] {Pair.create("todir", toDir)});
|
||||
super("copy", Couple.newOne("todir", toDir));
|
||||
}
|
||||
public Copy(@NonNls String file, @NonNls String toFile) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("copy", new Pair[] {Pair.create("file", file), Pair.create("tofile", toFile)});
|
||||
super("copy", Couple.newOne("file", file), Couple.newOne("tofile", toFile));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
@@ -27,6 +27,6 @@ import org.jetbrains.annotations.NonNls;
|
||||
public class Delete extends Tag{
|
||||
public Delete(@NonNls String dir) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("delete", new Pair[] {Pair.create("dir", dir)});
|
||||
super("delete", Couple.newOne("dir", dir));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
@@ -28,6 +28,6 @@ public class DirSet extends Tag{
|
||||
|
||||
public DirSet(@NonNls final String dir) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("dirset", new Pair[] {Pair.create("dir", dir)});
|
||||
super("dirset", Couple.newOne("dir", dir));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
@@ -27,6 +27,6 @@ import org.jetbrains.annotations.NonNls;
|
||||
public class Dirname extends Tag{
|
||||
public Dirname(@NonNls String property, @NonNls String file) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("dirname", new Pair[] {Pair.create("property", property), Pair.create("file", file)});
|
||||
super("dirname", Couple.newOne("property", property), Couple.newOne("file", file));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ public class Exclude extends Tag {
|
||||
|
||||
public Exclude(@NonNls final String name) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("exclude", new Pair[] {Pair.create("name", name)});
|
||||
super("exclude", Couple.newOne("name", name));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
@@ -27,11 +27,11 @@ import org.jetbrains.annotations.NonNls;
|
||||
public class Import extends Tag{
|
||||
public Import(@NonNls String file, boolean optional) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("import", new Pair[] {Pair.create("file", file), Pair.create("optional", optional ? "true" : "false")});
|
||||
super("import", Couple.newOne("file", file), Couple.newOne("optional", optional ? "true" : "false"));
|
||||
}
|
||||
|
||||
public Import(@NonNls String file) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("import", new Pair[] {Pair.create("file", file)});
|
||||
super("import", Couple.newOne("file", file));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -18,10 +18,12 @@ package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.compiler.make.ManifestBuilder;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.jar.Attributes;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Eugene Zhuravlev
|
||||
@@ -29,7 +31,7 @@ import java.util.*;
|
||||
*/
|
||||
public class Manifest extends Tag{
|
||||
public Manifest() {
|
||||
super("manifest", new Pair[] {});
|
||||
super("manifest");
|
||||
}
|
||||
|
||||
public void applyAttributes(final java.util.jar.Manifest manifest) {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
@@ -27,6 +27,6 @@ import org.jetbrains.annotations.NonNls;
|
||||
public class Mkdir extends Tag {
|
||||
public Mkdir(@NonNls String directory) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("mkdir", new Pair[] {Pair.create("dir", directory)});
|
||||
super("mkdir", Couple.newOne("dir", directory));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
@@ -27,10 +27,7 @@ import org.jetbrains.annotations.NonNls;
|
||||
public class Param extends Tag {
|
||||
public Param(@NonNls final String name, final String value) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("param", new Pair[] {
|
||||
Pair.create("name", name),
|
||||
Pair.create("value", value)
|
||||
});
|
||||
super("param", Couple.newOne("name", name), Couple.newOne("value", value));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
@@ -27,7 +26,7 @@ import org.jetbrains.annotations.NonNls;
|
||||
public class PathRef extends Tag{
|
||||
|
||||
public PathRef(@NonNls final String refid) {
|
||||
super("path", new Pair[] {pair("refid", refid)});
|
||||
super("path", pair("refid", refid));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
@@ -27,6 +27,6 @@ import org.jetbrains.annotations.NonNls;
|
||||
public class PatternSetRef extends Tag{
|
||||
public PatternSetRef(@NonNls final String refid) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("patternset", new Pair[] {Pair.create("refid", refid)});
|
||||
super("patternset", Couple.newOne("refid", refid));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
@@ -28,17 +28,12 @@ public class Property extends Tag {
|
||||
|
||||
public Property(@NonNls final String name, final String value) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("property", new Pair[] {
|
||||
Pair.create("name", name),
|
||||
Pair.create("value", value)
|
||||
});
|
||||
super("property", Couple.newOne("name", name), Couple.newOne("value", value));
|
||||
}
|
||||
|
||||
public Property(@NonNls final String filePath) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("property", new Pair[] {
|
||||
Pair.create("file", filePath),
|
||||
});
|
||||
super("property", Couple.newOne("file", filePath));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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,12 +21,12 @@
|
||||
package com.intellij.compiler.ant.taskdefs;
|
||||
|
||||
import com.intellij.compiler.ant.Tag;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
public class Zip extends Tag {
|
||||
public Zip(@NonNls final String destFile) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
super("zip", new Pair[] {Pair.create("destfile", destFile)});
|
||||
super("zip", Couple.newOne("destfile", destFile));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user