It would be great if the expression simplification also simplified if expressions when possible:
true ? a : b → a
false ? a : b → b
a ? b : b → b
Example
@ExternalRefinementsFor("java.awt.dnd.DropTarget")
@StateSet({"noListener", "listenerSet"})
@StateSet({"notActive", "active"})
public interface DropTargetRefinements {
@StateRefinement(to="act ? listenerSet(this) && active(this) : listenerSet(this) && notActive(this)")
public void DropTarget(Component c, int ops, DropTargetListener dtl, boolean act);
@StateRefinement(from="active(this)")
public void dragEnter(DropTargetDragEvent dtde);
}
Test
void test(){
DropTarget dt = new DropTarget(null, 42, null, false);
dt.dragEnter(null);
}
Result
false ? listenerSet(#dt_221) && active(#dt_221) : listenerSet(#dt_221) && notActive(#dt_221)
Which could be simplified to:
listenerSet(#dt_221) && notActive(#dt_221)