[STYLE] Rename "xorConflict" to "group"

This commit is contained in:
Sevastjan 2023-07-20 14:01:02 +03:00
parent ab7487872c
commit 61e5f94663
No known key found for this signature in database
GPG key ID: A18133AD7A67B8AB
3 changed files with 20 additions and 20 deletions

View file

@ -254,10 +254,10 @@ public void updateOptionalGraph() {
file.conflict[i] = getOptionalFile(file.conflictFile[i].name);
}
}
if(file.xorConflictFile != null) {
file.xorConflict = new OptionalFile[file.xorConflictFile.length];
for(int i = 0; i < file.xorConflictFile.length; ++i) {
file.xorConflict[i] = getOptionalFile(file.xorConflictFile[i].name);
if(file.groupFile != null) {
file.group = new OptionalFile[file.groupFile.length];
for(int i = 0; i < file.groupFile.length; ++i) {
file.group[i] = getOptionalFile(file.groupFile[i].name);
}
}
}
@ -375,10 +375,10 @@ public void verify() {
if (s == null)
throw new IllegalArgumentException(String.format("Found null entry in updateOptional.%s.dependenciesFile", f.name));
}
if(f.xorConflictFile != null)
for (OptionalDepend s : f.xorConflictFile) {
if(f.groupFile != null)
for (OptionalDepend s : f.groupFile) {
if (s == null)
throw new IllegalArgumentException(String.format("Found null entry in updateOptional.%s.xorConflictFile", f.name));
throw new IllegalArgumentException(String.format("Found null entry in updateOptional.%s.groupFile", f.name));
}
if (f.triggersList != null) {
for (OptionalTrigger trigger : f.triggersList) {

View file

@ -24,13 +24,13 @@ public class OptionalFile {
@LauncherNetworkAPI
public OptionalDepend[] conflictFile;
@LauncherNetworkAPI
public OptionalDepend[] xorConflictFile;
public OptionalDepend[] groupFile;
@LauncherNetworkAPI
public transient OptionalFile[] dependencies;
@LauncherNetworkAPI
public transient OptionalFile[] conflict;
@LauncherNetworkAPI
public transient OptionalFile[] xorConflict;
public transient OptionalFile[] group;
@LauncherNetworkAPI
public int subTreeLevel = 1;
@LauncherNetworkAPI

View file

@ -88,8 +88,8 @@ public Set<OptionalAction> getEnabledActions() {
public void fixDependencies() {
Set<OptionalFile> disabled = all.stream().filter(t -> !isEnabled(t)).collect(Collectors.toSet());
for (OptionalFile file : disabled) {
if (file.xorConflict != null && Arrays.stream(file.xorConflict).noneMatch(this::isEnabled)) {
enable(file.xorConflict[0], false, null);
if (file.group != null && Arrays.stream(file.group).noneMatch(this::isEnabled)) {
enable(file.group[0], false, null);
}
}
for (OptionalFile file : enabled) {
@ -103,9 +103,9 @@ public void fixDependencies() {
disable(conflict, null);
}
}
if (file.xorConflict != null) {
for (OptionalFile xorConflict : file.xorConflict) {
disable(xorConflict, null);
if (file.group != null) {
for (OptionalFile member : file.group) {
disable(member, null);
}
}
}
@ -142,9 +142,9 @@ public void enable(OptionalFile file, boolean manual, BiConsumer<OptionalFile, B
disable(conflict, callback);
}
}
if(file.xorConflict != null) {
for(OptionalFile xorConflict : file.xorConflict) {
disable(xorConflict, callback);
if(file.group != null) {
for(OptionalFile member : file.group) {
disable(member, callback);
}
}
}
@ -165,9 +165,9 @@ public void disable(OptionalFile file, BiConsumer<OptionalFile, Boolean> callbac
}
}
}
if (file.xorConflict != null && file.xorConflict.length != 0) {
if (Arrays.stream(file.xorConflict).noneMatch(this::isEnabled)) {
enable(file.xorConflict[0], false, callback);
if (file.group != null && file.group.length != 0) {
if (Arrays.stream(file.group).noneMatch(this::isEnabled)) {
enable(file.group[0], false, callback);
}
}
}