Buggy code:
public class DelegatingSmartContextLoader implements SmartContextLoader { private static final Log logger = LogFactory . getLog ( DelegatingSmartContextLoader . class ) ; private final SmartContextLoader xmlLoader = new GenericXmlContextLoader ( ) ; private final SmartContextLoader annotationConfigLoader = new AnnotationConfigContextLoader ( ) ; private static String name ( SmartContextLoader loader ) { } private static void delegateProcessing ( SmartContextLoader loader , ContextConfigurationAttributes configAttributes ) { } private static boolean supports ( SmartContextLoader loader , MergedContextConfiguration mergedConfig ) { } public void processContextConfiguration ( final ContextConfigurationAttributes configAttributes ) { Assert . notNull ( configAttributes , "configAttributes<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; <START_BUG> Assert . isTrue ( ( ( configAttributes . hasLocations ( ) ) && ( configAttributes . hasClasses ( ) ) ) , String . format ( ( "Cannot<seq2seq4repair_space>process<seq2seq4repair_space>locations<seq2seq4repair_space>AND<seq2seq4repair_space>configuration<seq2seq4repair_space>classes<seq2seq4repair_space>for<seq2seq4repair_space>context<seq2seq4repair_space>" + "configuration<seq2seq4repair_space>%s;<seq2seq4repair_space>configure<seq2seq4repair_space>one<seq2seq4repair_space>or<seq2seq4repair_space>the<seq2seq4repair_space>other,<seq2seq4repair_space>but<seq2seq4repair_space>not<seq2seq4repair_space>both." ) , configAttributes ) ) ; <END_BUG> if ( configAttributes . hasLocations ( ) ) { DelegatingSmartContextLoader . delegateProcessing ( xmlLoader , configAttributes ) ; } else if ( configAttributes . hasClasses ( ) ) { DelegatingSmartContextLoader . delegateProcessing ( annotationConfigLoader , configAttributes ) ; } else { DelegatingSmartContextLoader . delegateProcessing ( xmlLoader , configAttributes ) ; boolean xmlLoaderDetectedDefaults = configAttributes . hasLocations ( ) ; if ( xmlLoaderDetectedDefaults ) { if ( DelegatingSmartContextLoader . logger . isInfoEnabled ( ) ) { DelegatingSmartContextLoader . logger . info ( String . format ( "%s<seq2seq4repair_space>detected<seq2seq4repair_space>default<seq2seq4repair_space>locations<seq2seq4repair_space>for<seq2seq4repair_space>context<seq2seq4repair_space>configuration<seq2seq4repair_space>%s." , DelegatingSmartContextLoader . name ( xmlLoader ) , configAttributes ) ) ; } } if ( configAttributes . hasClasses ( ) ) { throw new IllegalStateException ( String . format ( "%s<seq2seq4repair_space>should<seq2seq4repair_space>NOT<seq2seq4repair_space>have<seq2seq4repair_space>detected<seq2seq4repair_space>default<seq2seq4repair_space>configuration<seq2seq4repair_space>classes<seq2seq4repair_space>for<seq2seq4repair_space>context<seq2seq4repair_space>configuration<seq2seq4repair_space>%s." , DelegatingSmartContextLoader . name ( xmlLoader ) , configAttributes ) ) ; } DelegatingSmartContextLoader . delegateProcessing ( annotationConfigLoader , configAttributes ) ; if ( configAttributes . hasClasses ( ) ) { if ( DelegatingSmartContextLoader . logger . isInfoEnabled ( ) ) { DelegatingSmartContextLoader . logger . info ( String . format ( "%s<seq2seq4repair_space>detected<seq2seq4repair_space>default<seq2seq4repair_space>configuration<seq2seq4repair_space>classes<seq2seq4repair_space>for<seq2seq4repair_space>context<seq2seq4repair_space>configuration<seq2seq4repair_space>%s." , DelegatingSmartContextLoader . name ( annotationConfigLoader ) , configAttributes ) ) ; } } if ( ( ! xmlLoaderDetectedDefaults ) && ( configAttributes . hasLocations ( ) ) ) { throw new IllegalStateException ( String . format ( "%s<seq2seq4repair_space>should<seq2seq4repair_space>NOT<seq2seq4repair_space>have<seq2seq4repair_space>detected<seq2seq4repair_space>default<seq2seq4repair_space>locations<seq2seq4repair_space>for<seq2seq4repair_space>context<seq2seq4repair_space>configuration<seq2seq4repair_space>%s." , DelegatingSmartContextLoader . name ( annotationConfigLoader ) , configAttributes ) ) ; } if ( ! ( configAttributes . hasResources ( ) ) ) { throw new IllegalStateException ( String . format ( "Neither<seq2seq4repair_space>%s<seq2seq4repair_space>nor<seq2seq4repair_space>%s<seq2seq4repair_space>was<seq2seq4repair_space>able<seq2seq4repair_space>to<seq2seq4repair_space>detect<seq2seq4repair_space>defaults<seq2seq4repair_space>for<seq2seq4repair_space>context<seq2seq4repair_space>configuration<seq2seq4repair_space>%s." , DelegatingSmartContextLoader . name ( xmlLoader ) , DelegatingSmartContextLoader . name ( annotationConfigLoader ) , configAttributes ) ) ; } if ( ( configAttributes . hasLocations ( ) ) && ( configAttributes . hasClasses ( ) ) ) { String message = String . format ( ( "Configuration<seq2seq4repair_space>error:<seq2seq4repair_space>both<seq2seq4repair_space>default<seq2seq4repair_space>locations<seq2seq4repair_space>AND<seq2seq4repair_space>default<seq2seq4repair_space>configuration<seq2seq4repair_space>classes<seq2seq4repair_space>" + "were<seq2seq4repair_space>detected<seq2seq4repair_space>for<seq2seq4repair_space>context<seq2seq4repair_space>configuration<seq2seq4repair_space>%s;<seq2seq4repair_space>configure<seq2seq4repair_space>one<seq2seq4repair_space>or<seq2seq4repair_space>the<seq2seq4repair_space>other,<seq2seq4repair_space>but<seq2seq4repair_space>not<seq2seq4repair_space>both." ) , configAttributes ) ; DelegatingSmartContextLoader . logger . error ( message ) ; throw new IllegalStateException ( message ) ; } } } public ApplicationContext loadContext ( MergedContextConfiguration mergedConfig ) throws Exception { } public String [ ] processLocations ( Class < ? > clazz , String ... locations ) { } public ApplicationContext loadContext ( String ... locations ) throws Exception { } }

Fix:
Assert . isTrue ( ( ! ( ( configAttributes . hasLocations ( ) ) && ( configAttributes . hasClasses ( ) ) ) ) , String . format ( ( "Cannot<seq2seq4repair_space>process<seq2seq4repair_space>locations<seq2seq4repair_space>AND<seq2seq4repair_space>configuration<seq2seq4repair_space>classes<seq2seq4repair_space>for<seq2seq4repair_space>context<seq2seq4repair_space>" + "configuration<seq2seq4repair_space>%s;<seq2seq4repair_space>configure<seq2seq4repair_space>one<seq2seq4repair_space>or<seq2seq4repair_space>the<seq2seq4repair_space>other,<seq2seq4repair_space>but<seq2seq4repair_space>not<seq2seq4repair_space>both." ) , configAttributes ) ) ;