Skip to content

Commit

Permalink
FORGE-2367: Fixed StackOverflowError in Combos
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Jun 20, 2015
1 parent eb49f45 commit d023f33
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
@ServiceProvider(position = 20, service = ComponentBuilder.class)
public class ComboComponentBuilder extends ComponentBuilder<JComboBox> {

private static final String PROCESSING_STATE = "processing_state";

@Override
public JComboBox build(final Container container,
final InputComponent<?, Object> input,
Expand Down Expand Up @@ -64,8 +66,16 @@ public void itemStateChanged(ItemEvent e) {

@Override
public void updateState(JComboBox combo, InputComponent<?, ?> input) {
super.updateState(combo, input);
updateComboModel(combo, (UISelectOne<Object>) input);
if (combo.getClientProperty(PROCESSING_STATE) != null) {
return;
}
try {
combo.putClientProperty(PROCESSING_STATE, Boolean.TRUE);
super.updateState(combo, input);
updateComboModel(combo, (UISelectOne<Object>) input);
} finally {
combo.putClientProperty(PROCESSING_STATE, null);
}
}

private void updateComboModel(JComboBox combo, UISelectOne<Object> selectOne) {
Expand Down

0 comments on commit d023f33

Please sign in to comment.