cherry-pick form

85e41523ee
ffa0574dff
56e6c8602c
This commit is contained in:
Nico Mexis 2021-08-09 22:52:12 +02:00 committed by Bob Pan
parent 62eba635fd
commit c577db0da3
2 changed files with 9 additions and 13 deletions

View File

@ -3,6 +3,7 @@ Copyright (c) 2009-2014 Panxiaobo
contributors
- Bob Pan <pxb1988#gmail.com>
- HyperSpeeed <nico.mexis#kabelmail.de>
- Enea Stanzani <aeneas.ltr#gmail.com>
- t3stwhat <t3stwhat#gmail.com>
- paulhooijenga <paulhooijenga#gmail.com>

View File

@ -335,23 +335,18 @@ public class TypeTransformer implements Transformer {
public boolean addUses(String ele) {
assert this.next == null;
TypeRef t = this;
if (t.uses != null) {
return t.uses.add(ele);
} else {
t.uses = new HashSet<>();
return t.uses.add(ele);
if (this.uses == null) {
this.uses = new HashSet<>();
}
return this.uses.add(ele);
}
public boolean addAllUses(Set<String> uses) {
assert this.next == null;
if (uses != null) {
return uses.addAll(uses);
} else {
uses = new HashSet<>();
return uses.addAll(uses);
if (this.uses == null) {
this.uses = new HashSet<>();
}
return this.uses.addAll(uses);
}
}
@ -632,10 +627,10 @@ public class TypeTransformer implements Transformer {
return mergeObjectType(a, b);
} else {
String elementTypeA = a.substring(as);
String elementTypeB = a.substring(bs);
String elementTypeB = b.substring(bs);
if (as < bs) {
return buildArray(elementTypeB.charAt(0) == 'L' ? bs : bs - 1, "L");
} else if (bs > as) {
} else if (as > bs) {
return buildArray(elementTypeA.charAt(0) == 'L' ? as : as - 1, "L");
} else { // as==bs
if (elementTypeA.charAt(0) != 'L' || elementTypeB.charAt(0) != 'L') {