Example #1
0
  private void markEnumOrInnerConstructorParameterAsSynthetic(MethodVisitor mv, int i) {
    // IDEA's ClsPsi builder fails to annotate synthetic parameters
    if (state.getClassBuilderMode() == ClassBuilderMode.LIGHT_CLASSES) return;

    // This is needed to avoid RuntimeInvisibleParameterAnnotations error in javac:
    // see MethodWriter.visitParameterAnnotation()

    AnnotationVisitor av = mv.visitParameterAnnotation(i, "Ljava/lang/Synthetic;", true);
    if (av != null) {
      av.visitEnd();
    }
  }