protected final AbstractInsnNode cloneAnnotations ( final AbstractInsnNode insn ) { if ( insn . visibleTypeAnnotations != null ) { this . visibleTypeAnnotations = new ArrayList < TypeAnnotationNode > ( ) ; for ( int i = 0 ; i < insn . visibleTypeAnnotations . size ( ) ; ++ i ) { TypeAnnotationNode src = insn . visibleTypeAnnotations . get ( i ) ; TypeAnnotationNode ann = new TypeAnnotationNode ( src . typeRef , src . typePath , src . desc ) ; src . accept ( ann ) ; this . visibleTypeAnnotations . add ( ann ) ; } } if ( insn . invisibleTypeAnnotations != null ) { this . invisibleTypeAnnotations = new ArrayList < TypeAnnotationNode > ( ) ; for ( int i = 0 ; i < insn . invisibleTypeAnnotations . size ( ) ; ++ i ) { TypeAnnotationNode src = insn . invisibleTypeAnnotations . get ( i ) ; TypeAnnotationNode ann = new TypeAnnotationNode ( src . typeRef , src . typePath , src . desc ) ; src . accept ( ann ) ; this . invisibleTypeAnnotations . add ( ann ) ; } } return this ; }
Clones the annotations of the given instruction into this instruction .