Skip to content

Commit

Permalink
Support resizing of element metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
NebelNidas committed Sep 30, 2023
1 parent ab1f0b5 commit c0acf94
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ private Entry<?> getCurrentEntry(MappedElementKind targetKind) {
entry = currentEntry;
}

if (entry == null) throw new UnsupportedOperationException("Tried to visit comment before owning target");
if (entry == null) throw new UnsupportedOperationException("Tried to visit element content before owning target");
return entry;
}

Expand Down Expand Up @@ -745,6 +745,10 @@ public void setDstName(String name, int namespace) {

void resizeDstNames(int newSize) {
dstNames = Arrays.copyOf(dstNames, newSize);

for (Map.Entry<String, String[]> entry : metadata.entrySet()) {
entry.setValue(Arrays.copyOf(entry.getValue(), newSize));
}
}

void updateDstNames(int[] map) {
Expand Down

0 comments on commit c0acf94

Please sign in to comment.