Skip to content

Commit

Permalink
Respond to Fabio's review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
adinn committed Jul 11, 2023
1 parent 4d518b0 commit 615bb36
Showing 1 changed file with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ public int lowpc() {
*
* @return the highest code section offset for compiled method code belonging to this class
*/
@SuppressWarnings("unused")
public int hipc() {
assert hasCompiledEntries();
return compiledEntries.get(compiledEntries.size() - 1).getPrimary().getHi();
Expand All @@ -379,9 +378,8 @@ public void includeFile(FileEntry file) {
if (files == null) {
files = new ArrayList<>();
}
assert !files.contains(file);
// cannot add files after index has been created
assert fileIndex == null;
assert !files.contains(file) : "caller should ensure file is only included once";
assert fileIndex == null : "cannot include files after index has been created";
files.add(file);
}

Expand All @@ -394,9 +392,8 @@ public void includeDir(DirEntry dirEntry) {
if (dirs == null) {
dirs = new ArrayList<>();
}
assert !dirs.contains(dirEntry);
// cannot add dirs after index has been created
assert dirIndex == null;
assert !dirs.contains(dirEntry) : "caller should ensure dir is only included once";
assert dirIndex == null : "cannot include dirs after index has been created";
dirs.add(dirEntry);
}

Expand All @@ -406,11 +403,9 @@ public void includeDir(DirEntry dirEntry) {
*/
public void buildFileAndDirIndexes() {
// this is a one-off operation
assert fileIndex == null;
assert dirIndex == null;
assert fileIndex == null && dirIndex == null : "file and indexes can only be generated once";
if (files == null) {
// should not have any dirs if we have no files
assert dirs == null;
assert dirs == null : "should not have included any dirs if we have no files";
return;
}
int idx = 1;
Expand Down

0 comments on commit 615bb36

Please sign in to comment.