-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
enhancementNew feature or requestNew feature or requestsimplificationRelated to the simplification of expressionsRelated to the simplification of expressions
Description
It would be great if the expression simplification also simplified if expressions when possible:
true ? a : b→afalse ? a : b→ba ? 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)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestsimplificationRelated to the simplification of expressionsRelated to the simplification of expressions