mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
external build: access synchronized and 'equals' method added for consistency [accepted by Jeka]
This commit is contained in:
@@ -19,6 +19,11 @@ public abstract class BuildTargetType<T extends BuildTarget<?>> {
|
||||
return myTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return obj instanceof BuildTargetType && ((BuildTargetType)obj).myTypeId.equals(myTypeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return myTypeId.hashCode();
|
||||
|
||||
@@ -372,17 +372,21 @@ public class IncProjectBuilder {
|
||||
}
|
||||
|
||||
private static void registerTargetsWithClearedOutput(CompileContext context, Collection<? extends BuildTarget<?>> targets) {
|
||||
Set<BuildTarget<?>> data = context.getUserData(TARGET_WITH_CLEARED_OUTPUT);
|
||||
if (data == null) {
|
||||
data = new THashSet<BuildTarget<?>>();
|
||||
context.putUserData(TARGET_WITH_CLEARED_OUTPUT, data);
|
||||
synchronized (TARGET_WITH_CLEARED_OUTPUT) {
|
||||
Set<BuildTarget<?>> data = context.getUserData(TARGET_WITH_CLEARED_OUTPUT);
|
||||
if (data == null) {
|
||||
data = new THashSet<BuildTarget<?>>();
|
||||
context.putUserData(TARGET_WITH_CLEARED_OUTPUT, data);
|
||||
}
|
||||
data.addAll(targets);
|
||||
}
|
||||
data.addAll(targets);
|
||||
}
|
||||
|
||||
private static boolean isTargetOutputCleared(CompileContext context, BuildTarget<?> target) {
|
||||
Set<BuildTarget<?>> data = context.getUserData(TARGET_WITH_CLEARED_OUTPUT);
|
||||
return data != null && data.contains(target);
|
||||
synchronized (TARGET_WITH_CLEARED_OUTPUT) {
|
||||
Set<BuildTarget<?>> data = context.getUserData(TARGET_WITH_CLEARED_OUTPUT);
|
||||
return data != null && data.contains(target);
|
||||
}
|
||||
}
|
||||
|
||||
private void clearOutputs(CompileContext context) throws ProjectBuildException, IOException {
|
||||
|
||||
Reference in New Issue
Block a user