Skip to content

Commit

Permalink
fix mappings checker improperly searching for mapped children
Browse files Browse the repository at this point in the history
  • Loading branch information
ix0rai committed Dec 3, 2024
1 parent f10caad commit 03805c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ CLASS a
METHOD <init> (Ljava/lang/String;)V
ARG 1
METHOD a ()Ljava/lang/String;
CLASS b
METHOD b (Ljava/lang/String;)V
ARG 2
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public boolean validateParameterIndex(LocalVariableEntry parameter) {
.filter(node -> node.name.equals(parent.getName()) && node.desc.equals(parent.getDesc().toString()))
.findFirst().ifPresent(node -> {
// occasionally it's possible to run into a method that has parameters, yet whose max locals is 0. java is stupid. we ignore those cases
if (node.parameters.size() <= node.maxLocals) {
if (!(node.parameters != null && node.parameters.size() > node.maxLocals)) {
maxLocals.set(node.maxLocals);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ private boolean hasNoChildren(Entry<?> entry, Dropped dropped) {
// account for child mappings that have been dropped already
if (!children.isEmpty()) {
for (Entry<?> child : children) {
if (!dropped.getDroppedMappings().containsKey(child) && !this.hasNoChildren(child, dropped)) {
var mapping = this.mappings.get(child);
if (mapping != null && !(mapping.targetName() == null && mapping.javadoc() == null)) {
return false;
} else if (!dropped.getDroppedMappings().containsKey(child) && this.hasNoChildren(child, dropped)) {
return true;
}
}
Expand Down

0 comments on commit 03805c7

Please sign in to comment.