You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class TestVO1 {
private String ccy;
private BigDecimal amount;
public String getCcy() { return ccy; }
public void setCcy(String ccy) { this.ccy = ccy; }
public BigDecimal getAmount() { return amount; }
public void setAmount { this.amount = amount; }
}
public class TestDO1 {
public void calculate() {
TestVO1 testVO1 = new TestVO1();
testVO1.setAmount(testVO1.getAmount().setScale(2, testVO1.getCcy().equals("3") ? RoundingMode.HALF_UP : RoundMode.DOWN));
}
}
Then I use the flying visitor and override the MethodCallExpr visit method
@Override
public void visit(MethodCallExpr methodCallExpr, Context context) {
// some code
methodCallExpr.resolve();
// other code
}
Then com.github.javaparser.ast.Node.getData(Node.java:512) throws an IllegalStateException:
No data of this type found. Use containsData to check for this first.
I debugged into this method: LeastUpperBoundLogic.lub(Set types), this input parameter has 2 items with the same type: java.math.RoundingMode, but they are different objects so the HashSet can not reduce these 2 items and the intersection method can not find the same type either.
So this method returns null at line 101.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this bug. I can't reproduce your exception (IllegalStateException) but I found that when we calculate the erased candidates which are the intersection of all Erased Super Types sets then the enum members are not considered equal so the intersection is empty and ultimately the returned resolved type is null.
Here is my sample code:
Then I use the flying visitor and override the MethodCallExpr visit method
Then com.github.javaparser.ast.Node.getData(Node.java:512) throws an IllegalStateException:
I debugged into this method: LeastUpperBoundLogic.lub(Set types), this input parameter has 2 items with the same type: java.math.RoundingMode, but they are different objects so the HashSet can not reduce these 2 items and the intersection method can not find the same type either.
So this method returns null at line 101.
The text was updated successfully, but these errors were encountered: