Skip to content

Commit

Permalink
Renamed variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rgoldberg authored and remkop committed Feb 7, 2022
1 parent db2da05 commit e5ee68b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/picocli/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -7095,18 +7095,18 @@ public String[] version() {
* @return this CommandSpec for method chaining
* @since 3.1 */
public CommandSpec aliases(String... aliases) {
Set<String> existingAliasSet = this.aliases;
Set<String> previousAliasSet = this.aliases;
this.aliases = new LinkedHashSet<String>(Arrays.asList(aliases == null ? new String[0] : aliases));
if (parent != null) {
//remove & add aliases
Set<String> newAliasSet = new LinkedHashSet<String>(this.aliases);
newAliasSet.removeAll(existingAliasSet);
Set<String> addedAliasSet = new LinkedHashSet<String>(this.aliases);
addedAliasSet.removeAll(previousAliasSet);
Tracer t = new Tracer();
for (String alias : newAliasSet) {
for (String alias : addedAliasSet) {
parent.addAlias(alias, name, commandLine, t);
}
existingAliasSet.removeAll(this.aliases);
for (String alias : existingAliasSet) {
previousAliasSet.removeAll(this.aliases);
for (String alias : previousAliasSet) {
parent.removeAlias(alias, commandLine, t);
}
}
Expand Down

0 comments on commit e5ee68b

Please sign in to comment.