static void checkAccess ( final int access , final int possibleAccess ) { if ( ( access & ~ possibleAccess ) != 0 ) { throw new IllegalArgumentException ( "Invalid access flags: " + access ) ; } int pub = ( access & Opcodes . ACC_PUBLIC ) == 0 ? 0 : 1 ; int pri = ( access & Opcodes . ACC_PRIVATE ) == 0 ? 0 : 1 ; int pro = ( access & Opcodes . ACC_PROTECTED ) == 0 ? 0 : 1 ; if ( pub + pri + pro > 1 ) { throw new IllegalArgumentException ( "public private and protected are mutually exclusive: " + access ) ; } int fin = ( access & Opcodes . ACC_FINAL ) == 0 ? 0 : 1 ; int abs = ( access & Opcodes . ACC_ABSTRACT ) == 0 ? 0 : 1 ; if ( fin + abs > 1 ) { throw new IllegalArgumentException ( "final and abstract are mutually exclusive: " + access ) ; } }
Checks that the given access flags do not contain invalid flags . This method also checks that mutually incompatible flags are not set simultaneously .