void () { final StringBuilder builder = new StringBuilder(); boolean first = true; for (String variable : myOutputVariables) { if (myVariablesMap!=null){ final AbstractVariableData data = myVariablesMap.get(variable); final String outputName = data != null ? data.getName() : variable; if (first){ first = false; } else { builder.append(", "); } builder.append(outputName); } } myOutputVariablesTextArea.setText(builder.length() > 0 ? builder.toString() : RefactoringBundle.message("refactoring.extract.method.dialog.empty")); }