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

View file

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

View file

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