void (@NonNls StringBuilder out, boolean normalizeDeclaration) { if (hasEnumConstants()) { out.append(StringUtil.join(enumConstantFields, field -> { final @NonNls StringBuilder fieldStr = new StringBuilder(field.getName()); fieldStr.append('('); final PsiExpression initializer = field.getInitializer(); if (initializer != null) { initializer.accept(new Mutator(fieldStr)); } fieldStr.append(')'); return fieldStr.toString(); }, ", ")); out.append(";\n"); } final List<PsiClassInitializer> remainingInitializers = new ArrayList<>(initializers); for (PsiField field : fields) { if (normalizeDeclaration) { field.normalizeDeclaration(); } final Iterator<PsiClassInitializer> initializersIterator = remainingInitializers.iterator(); final int fieldOffset = field.getTextRange().getStartOffset(); while (initializersIterator.hasNext()) { final PsiClassInitializer initializer = initializersIterator.next(); if (initializer.getTextRange().getStartOffset() < fieldOffset) { initializer.accept(new Mutator(out)); initializersIterator.remove(); } } field.accept(new Mutator(out)); if (myFieldsNeedingGetter != null && myFieldsNeedingGetter.contains(field)) { out.append(GenerateMembersUtil.generateGetterPrototype(field).getText()); out.append("\n"); } if (myFieldsNeedingSetters != null && myFieldsNeedingSetters.contains(field)) { out.append(GenerateMembersUtil.generateSetterPrototype(field).getText()); out.append("\n"); } } for (PsiClassInitializer initializer : remainingInitializers) { initializer.accept(new Mutator(out)); } }