public void generateStoreSaveValueIfNecessary(CodeStream codeStream) {

    // push receiver
    codeStream.aload_0();

    // push the 2 parameters of "setResult(Object, Class)"
    if (this.expression == null
        || this.expression.resolvedType
            == TypeBinding
                .VOID) { // expressionType == VoidBinding if code snippet is the expression
                         // "System.out.println()"
      // push null
      codeStream.aconst_null();

      // void.class
      codeStream.generateClassLiteralAccessForType(TypeBinding.VOID, null);
    } else {
      // swap with expression
      int valueTypeID = this.expression.resolvedType.id;
      if (valueTypeID == T_long || valueTypeID == T_double) {
        codeStream.dup_x2();
        codeStream.pop();
      } else {
        codeStream.swap();
      }

      // generate wrapper if needed
      if (this.expression.resolvedType.isBaseType()
          && this.expression.resolvedType != TypeBinding.NULL) {
        codeStream.generateBoxingConversion(this.expression.resolvedType.id);
      }

      // generate the expression type
      codeStream.generateClassLiteralAccessForType(this.expression.resolvedType, null);
    }

    // generate the invoke virtual to "setResult(Object,Class)"
    codeStream.invoke(
        Opcodes.OPC_invokevirtual, this.setResultMethod, null /* default declaringClass */);
  }
  /**
   * MessageSendDotClass code generation
   *
   * @param currentScope org.eclipse.jdt.internal.compiler.lookup.BlockScope
   * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream
   * @param valueRequired boolean
   */
  public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {
    // {ObjectTeams: role class literal?
    if (this.roleClassLiteralAccess != null) {
      this.roleClassLiteralAccess.generateCode(currentScope, codeStream, valueRequired);
      return;
    }
    // SH}
    int pc = codeStream.position;

    // in interface case, no caching occurs, since cannot make a cache field for interface
    if (valueRequired) {
      codeStream.generateClassLiteralAccessForType(this.type.resolvedType, this.syntheticField);
      codeStream.generateImplicitConversion(this.implicitConversion);
    }
    codeStream.recordPositionsFrom(pc, this.sourceStart);
  }