Skip to content

Commit

Permalink
addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vicente-romero-oracle committed Jan 10, 2024
1 parent 20ff11b commit b9703e8
Showing 1 changed file with 7 additions and 11 deletions.
Expand Up @@ -1331,18 +1331,14 @@ public ClassSymbol(long flags, Name name, Symbol owner) {
}

public void addPermittedSubclass(ClassSymbol csym, int pos) {
if (isPermittedExplicit) {
// in this case just add the permitted subclasses clause is explicit
permitted.add(new PermittedClassWithPos(csym, pos));
} else {
// in this case we need to insert at the right pos
PermittedClassWithPos element = new PermittedClassWithPos(csym, pos);
int index = Collections.binarySearch(permitted, element, java.util.Comparator.comparing(PermittedClassWithPos::pos));
if (index < 0) {
index = -index - 1;
}
permitted.add(index, element);
Assert.check(!isPermittedExplicit);
// we need to insert at the right pos
PermittedClassWithPos element = new PermittedClassWithPos(csym, pos);
int index = Collections.binarySearch(permitted, element, java.util.Comparator.comparing(PermittedClassWithPos::pos));
if (index < 0) {
index = -index - 1;
}
permitted.add(index, element);
}

public boolean isPermittedSubclass(Symbol csym) {
Expand Down

0 comments on commit b9703e8

Please sign in to comment.