@ SuppressWarnings ( "static-method" ) protected void translateAnnotationsTo ( List < JvmAnnotationReference > annotations , JvmAnnotationTarget target , Class < ? > ... exceptions ) { final Set < String > excepts = new HashSet <> ( ) ; for ( final Class < ? > type : exceptions ) { excepts . add ( type . getName ( ) ) ; } final List < JvmAnnotationReference > addition = new ArrayList <> ( ) ; for ( final JvmAnnotationReference annotation : Iterables . filter ( annotations , an -> { if ( ! ANNOTATION_TRANSLATION_FILTER . apply ( an ) ) { return false ; } return ! excepts . contains ( an . getAnnotation ( ) . getIdentifier ( ) ) ; } ) ) { addition . add ( annotation ) ; } target . getAnnotations ( ) . addAll ( addition ) ; }
Copy the annotations except the ones given as parameters .