Object () { String text = editor.getText().trim(); for (JrePathEditor.JreComboBoxItem item : myComboBoxModel.getItems()) { if (item.getPresentableText().equals(text)) { return item; } } return new JrePathEditor.CustomJreItem(FileUtil.toSystemIndependentName(text)); }