code: private void patchAtomicFieldUpdaterAccessorMethods(ClassOrInterfaceDeclaration n) {
          String className = n.getNameAsString();
  
          for (FieldDeclaration field : n.getFields()) {
              if (field.getModifiers().contains(Modifier.STATIC)) {
                  // Ignore statics
                  continue;
              }
  
              boolean usesFieldUpdater = false;
              for (VariableDeclarator variable : field.getVariables()) {
                  String variableName = variable.getNameAsString();
  
                  String methodNameSuffix = capitalise(variableName);
  
                  for (MethodDeclaration method : n.getMethods()) {
                      String methodName = method.getNameAsString();
                      if (!methodName.endsWith(methodNameSuffix)) {
                          // Leave it untouched
                          continue;
                      }
  
                      String newValueName = "newValue";
                      if (methodName.startsWith("so")) {
                          usesFieldUpdater = true;
                          String fieldUpdaterFieldName = fieldUpdaterFieldName(variableName);
  
                          method.setBody(fieldUpdaterLazySet(fieldUpdaterFieldName, newValueName));
                      } else if (methodName.startsWith("cas")) {
                          usesFieldUpdater = true;
                          String fieldUpdaterFieldName = fieldUpdaterFieldName(variableName);
                          String expectedValueName = "expect";
                          method.setBody(
                                  fieldUpdaterCompareAndSet(fieldUpdaterFieldName, expectedValueName, newValueName));
                      } else if (methodName.startsWith("sv")) {
                          method.setBody(fieldAssignment(variableName, newValueName));
                      } else if (methodName.startsWith("lv") || methodName.startsWith("lp")) {
                          method.setBody(returnField(variableName));
                      } else {
                          throw new IllegalStateException("Unhandled method: " + methodName);
                      }
                  }
  
                  if (usesFieldUpdater) {
                      n.getMembers().add(0, declareLongFieldUpdater(className, variableName));
                  }
              }
  
              if (usesFieldUpdater) {
                  field.addModifier(Modifier.VOLATILE);
              }
          }
      }
docs: For each method accessor to a field, add in the calls necessary to
  AtomicFieldUpdaters. Only methods start with so/cas/sv/lv/lp followed by
  the field name are processed. Clearly <code>lv<code>, <code>lp<code> and
  <code>sv<code> are simple field accesses with only <code>so and <code>cas
  <code> using the AtomicFieldUpdaters.
  
  @param n
  the AST node for the containing class