private void handleNonSharedField(Field field) {
    boolean wasFinal = field.getAst().isFinal();
    if (wasFinal) {
      changeFinalFieldInternalName(field);
      createFinalFieldGetter(field);
      AstUtil.setFinal(field.getAst(), false);
    }
    if (field.getAst().getInitialValueExpression() != null) {
      moveInitializer(field, getInitializerMethod(), fieldInitializerCount++);
    } else if (wasFinal) {
      errorReporter.error(field.getAst(),
              "Final field '%s' is not initialized.",
              field.getName());
    }
  }
A Spec visitor responsible for most of the rewriting of a Spec's AST.

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/compiler/SpecRewriter.java