code: private static void makeSharedFieldProtectedAndVolatile(Field field) {
      AstUtil.setVisibility(field.getAst(), Opcodes.ACC_PROTECTED);
      field.getAst().setModifiers(field.getAst().getModifiers() | Opcodes.ACC_VOLATILE);
    }
docs: /*
  We would prefer to make shared fields private, but this doesn't work in the following case:
  
  class BaseSpec {
  public sharedInstance
  private sharedField = 5
  
  def sharedFieldGetter() { sharedInstance.sharedField }
  }
  
  class DerivedSpec extends BaseSpec {}
  
  when DerivedSpec is run:
  
  def sharedInstance = new DerivedSpec()
  
  def spec = new DerivedSpec()
  spec.sharedInstance = sharedInstance
  
  spec.sharedFieldGetter() // would normally occur within a specification
  
  groovy.lang.MissingPropertyException: No such property: sharedField for class: DerivedSpec
  
  Solutions:
  1. Make sharedField protected
  2. Route all accesses to sharedField through sharedInstance's (!) sharedFieldGetter()
  (from there, sharedField can be accessed w/o qualification)
  
  Reasons why we chose 1:
  - A bit easier to implement
  - We might at some point decide that we need to reroute some
  VariableExpression/AttributeExpression/PropertyExpression that accesses
  sharedField directly (but on the wrong instance). However, these kinds of
  expressions cannot be replaced with a MethodCallExpression (calling
  sharedFieldGetter/Setter). Instead, we would have to replace them with
  an AttributeExpression/PropertyExpression of the form sharedInstance.sharedField,
  which would again require as to make sharedField protected.
  
  If we find that making shared fields protected can potentially cause name clashes within
  an inheritance chain, we should make sure that shared field names are unique within
  a chain. For example, this could be done by mixing in a number that measures
  the distance between the declaring class and class Specification. (That's how it's done
  in Groovy.)