Buggy code:
public enum AAA { ; public static final String SYSTEM = "__sys" ; public static final int SUPER_USER = 9999 ; private static final ThreadLocal < Object > target = new ThreadLocal < Object > ( ) ; private static final Map < Class , DynamicPermissionCheckHelper > dynamicCheckers = C . newMap ( ) ; private static final ThreadLocal < AAAContext > context = new ThreadLocal < AAAContext > ( ) ; public static void setTarget ( Object tgt ) { } private static Object target ( ) { } public static void clearTarget ( ) { } public static void setContext ( AAAContext context ) { } public static void clearContext ( ) { } public static AAAContext context ( ) { } public static Principal currentPrincipal ( ) { } public static < T > void registerDynamicPermissionChecker ( DynamicPermissionCheckHelper < T > checker , Class < T > clz ) { } public static boolean hasAccessTo ( Principal user , Guarded guarded , AAAContext context ) { } private static DynamicPermissionCheckHelper searchDPCHfromInterfaces ( Class < ? > c ) { DynamicPermissionCheckHelper dc = AAA . dynamicCheckers . get ( c ) ; if ( null != dc ) return dc ; Class [ ] intfs = c . getInterfaces ( ) ; <START_BUG> C . List < Class > cl = C . listOf ( intfs ) . append ( ) ; <END_BUG> for ( Class c0 : cl ) { dc = AAA . dynamicCheckers . get ( c0 ) ; if ( null != dc ) return dc ; } return null ; } private static Map < Class , DynamicPermissionCheckHelper > dpchCache = new HashMap < Class , DynamicPermissionCheckHelper > ( ) ; private static final DynamicPermissionCheckHelper NULL_DPCH = new DynamicPermissionCheckHelper ( ) { @ Override public boolean isAssociated ( Object target , Principal user ) { } } ; private static DynamicPermissionCheckHelper cachedDynamicPermissionCheckHelper ( Class < ? > c ) { } private static DynamicPermissionCheckHelper searchForDynamicPermissionCheckHelper ( Class < ? > c ) { } private static void noAccess ( ) { } private static void noAccess ( String reason ) { } public static boolean hasPermission ( Object target , String permName , boolean allowSystem , AAAContext context ) { } public static boolean hasPermission ( Object target , String permName , boolean allowSystem ) { } public static boolean hasPermission ( Object target , Permission permission , boolean allowSystem , AAAContext context ) { } public static boolean hasPermission ( Object target , Permission permission , boolean allowSystem ) { } public static void requirePermission ( Permission perm ) throws NoAccessException { } public static void requirePermission ( String perm ) throws NoAccessException { } public static void requirePermission ( String perm , AAAContext context ) throws NoAccessException { } public static void requirePermission ( Permission perm , boolean allowSystem ) throws NoAccessException { } public static void requirePermission ( Permission perm , boolean allowSystem , AAAContext context ) throws NoAccessException { } public static void requirePermission ( String perm , boolean allowSystem ) throws NoAccessException { } public static void requirePermission ( String perm , boolean allowSystem , AAAContext context ) throws NoAccessException { } public static void requirePermission ( Object target , Permission perm ) throws NoAccessException { } public static void requirePermission ( Object target , Permission perm , AAAContext context ) throws NoAccessException { } public static void requirePermission ( Object target , String perm ) throws NoAccessException { } public static void requirePermission ( Object target , String perm , AAAContext context ) throws NoAccessException { } public static void requirePermission ( Object target , Permission permission , boolean allowSystem ) { } public static void requirePermission ( Object target , Permission permission , boolean allowSystem , AAAContext context ) { } public static void requirePermission ( Object target , String permName , boolean allowSystem ) { } public static void requirePermission ( Object target , String permName , boolean allowSystem , AAAContext context ) { } public static boolean hasPrivilege ( Privilege privilege , boolean allowSystem , AAAContext context ) { } public static boolean hasPrivilege ( Privilege privilege , boolean allowSystem ) { } public static boolean hasPrivilege ( String privName , boolean allowSystem , AAAContext context ) { } public static boolean hasPrivilege ( String privName , boolean allowSystem ) { } public static void requirePrivilege ( Privilege privilege ) { } public static void requirePrivilege ( Privilege privilege , AAAContext context ) { } public static void requirePrivilege ( String privName ) { } public static void requirePrivilege ( String privName , AAAContext context ) { } public static void requirePrivilege ( Privilege privilege , boolean allowSystem ) { } public static void requirePrivilege ( Privilege privilege , boolean allowSystem , AAAContext ctx ) { } public static void requirePrivilege ( String privName , boolean allowSystem ) { } public static void requirePrivilege ( String privName , boolean allowSystem , AAAContext ctx ) { } private static boolean hasPermissionOrPrivilege ( Object target , Permission permission , Privilege privilege , boolean allowSystem , AAAContext context ) { } private static boolean hasPermissionOrPrivilege ( Object target , Permission permission , Privilege privilege , boolean allowSystem ) { } private static boolean hasPermissionOrPrivilege ( Object target , String permission , String privilege , boolean allowSystem , AAAContext context ) { } private static boolean hasPermissionOrPrivilege ( Object target , String permission , String privilege , boolean allowSystem ) { } public static void requirePermissionOrPrivilege ( Object target , Permission permission , Privilege privilege , boolean allowSystem ) { } public static void requirePermissionOrPrivilege ( Object target , Permission permission , Privilege privilege , boolean allowSystem , AAAContext context ) { } public static void requirePermissionOrPrivilege ( Object target , String permission , String privilege , boolean allowSystem ) { } public static void requirePermissionOrPrivilege ( Object target , String permission , String privilege , boolean allowSystem , AAAContext ctx ) { }

Fix:
C . List < Class > cl = C . listOf ( intfs ) ;