Buggy code:
public class GradlePomModuleDescriptorBuilder { private static final int DEPENDENCY_MANAGEMENT_KEY_PARTS_COUNT = 4 ; public static final Configuration [ ] MAVEN2_CONFIGURATIONS = new Configuration [ ] { new Configuration ( "default" , Visibility . PUBLIC , "runtime<seq2seq4repair_space>dependencies<seq2seq4repair_space>and<seq2seq4repair_space>master<seq2seq4repair_space>artifact<seq2seq4repair_space>can<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>with<seq2seq4repair_space>this<seq2seq4repair_space>conf" , new String [ ] { "runtime" , "master" } , true , null ) , new Configuration ( "master" , Visibility . PUBLIC , ( "contains<seq2seq4repair_space>only<seq2seq4repair_space>the<seq2seq4repair_space>artifact<seq2seq4repair_space>published<seq2seq4repair_space>by<seq2seq4repair_space>this<seq2seq4repair_space>module<seq2seq4repair_space>itself,<seq2seq4repair_space>" + "with<seq2seq4repair_space>no<seq2seq4repair_space>transitive<seq2seq4repair_space>dependencies" ) , new String [ 0 ] , true , null ) , new Configuration ( "compile" , Visibility . PUBLIC , ( "this<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>default<seq2seq4repair_space>scope,<seq2seq4repair_space>used<seq2seq4repair_space>if<seq2seq4repair_space>none<seq2seq4repair_space>is<seq2seq4repair_space>specified.<seq2seq4repair_space>" + "Compile<seq2seq4repair_space>dependencies<seq2seq4repair_space>are<seq2seq4repair_space>available<seq2seq4repair_space>in<seq2seq4repair_space>all<seq2seq4repair_space>classpaths." ) , new String [ 0 ] , true , null ) , new Configuration ( "provided" , Visibility . PUBLIC , ( "this<seq2seq4repair_space>is<seq2seq4repair_space>much<seq2seq4repair_space>like<seq2seq4repair_space>compile,<seq2seq4repair_space>but<seq2seq4repair_space>indicates<seq2seq4repair_space>you<seq2seq4repair_space>expect<seq2seq4repair_space>the<seq2seq4repair_space>JDK<seq2seq4repair_space>or<seq2seq4repair_space>a<seq2seq4repair_space>container<seq2seq4repair_space>" + ( "to<seq2seq4repair_space>provide<seq2seq4repair_space>it.<seq2seq4repair_space>" + "It<seq2seq4repair_space>is<seq2seq4repair_space>only<seq2seq4repair_space>available<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>compilation<seq2seq4repair_space>classpath,<seq2seq4repair_space>and<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>transitive." ) ) , new String [ 0 ] , true , null ) , new Configuration ( "runtime" , Visibility . PUBLIC , ( "this<seq2seq4repair_space>scope<seq2seq4repair_space>indicates<seq2seq4repair_space>that<seq2seq4repair_space>the<seq2seq4repair_space>dependency<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>required<seq2seq4repair_space>for<seq2seq4repair_space>compilation,<seq2seq4repair_space>" + ( "but<seq2seq4repair_space>is<seq2seq4repair_space>for<seq2seq4repair_space>execution.<seq2seq4repair_space>It<seq2seq4repair_space>is<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>runtime<seq2seq4repair_space>and<seq2seq4repair_space>test<seq2seq4repair_space>classpaths,<seq2seq4repair_space>" + "but<seq2seq4repair_space>not<seq2seq4repair_space>the<seq2seq4repair_space>compile<seq2seq4repair_space>classpath." ) ) , new String [ ] { "compile" } , true , null ) , new Configuration ( "test" , Visibility . PRIVATE , ( "this<seq2seq4repair_space>scope<seq2seq4repair_space>indicates<seq2seq4repair_space>that<seq2seq4repair_space>the<seq2seq4repair_space>dependency<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>required<seq2seq4repair_space>for<seq2seq4repair_space>normal<seq2seq4repair_space>use<seq2seq4repair_space>of<seq2seq4repair_space>" + ( "the<seq2seq4repair_space>application,<seq2seq4repair_space>and<seq2seq4repair_space>is<seq2seq4repair_space>only<seq2seq4repair_space>available<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>test<seq2seq4repair_space>compilation<seq2seq4repair_space>and<seq2seq4repair_space>" + "execution<seq2seq4repair_space>phases." ) ) , new String [ ] { "runtime" } , true , null ) , new Configuration ( "system" , Visibility . PUBLIC , ( "this<seq2seq4repair_space>scope<seq2seq4repair_space>is<seq2seq4repair_space>similar<seq2seq4repair_space>to<seq2seq4repair_space>provided<seq2seq4repair_space>except<seq2seq4repair_space>that<seq2seq4repair_space>you<seq2seq4repair_space>have<seq2seq4repair_space>to<seq2seq4repair_space>provide<seq2seq4repair_space>the<seq2seq4repair_space>JAR<seq2seq4repair_space>" + ( "which<seq2seq4repair_space>contains<seq2seq4repair_space>it<seq2seq4repair_space>explicitly.<seq2seq4repair_space>The<seq2seq4repair_space>artifact<seq2seq4repair_space>is<seq2seq4repair_space>always<seq2seq4repair_space>available<seq2seq4repair_space>and<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>" + "looked<seq2seq4repair_space>up<seq2seq4repair_space>in<seq2seq4repair_space>a<seq2seq4repair_space>repository." ) ) , new String [ 0 ] , true , null ) , new Configuration ( "sources" , Visibility . PUBLIC , "this<seq2seq4repair_space>configuration<seq2seq4repair_space>contains<seq2seq4repair_space>the<seq2seq4repair_space>source<seq2seq4repair_space>artifact<seq2seq4repair_space>of<seq2seq4repair_space>this<seq2seq4repair_space>module,<seq2seq4repair_space>if<seq2seq4repair_space>any." , new String [ 0 ] , true , null ) , new Configuration ( "javadoc" , Visibility . PUBLIC , "this<seq2seq4repair_space>configuration<seq2seq4repair_space>contains<seq2seq4repair_space>the<seq2seq4repair_space>javadoc<seq2seq4repair_space>artifact<seq2seq4repair_space>of<seq2seq4repair_space>this<seq2seq4repair_space>module,<seq2seq4repair_space>if<seq2seq4repair_space>any." , new String [ 0 ] , true , null ) , new Configuration ( "optional" , Visibility . PUBLIC , "contains<seq2seq4repair_space>all<seq2seq4repair_space>optional<seq2seq4repair_space>dependencies" , new String [ 0 ] , true , null ) } ; static final Map < String , GradlePomModuleDescriptorBuilder . ConfMapper > MAVEN2_CONF_MAPPING = new HashMap < String , GradlePomModuleDescriptorBuilder . ConfMapper > ( ) ; private static final String DEPENDENCY_MANAGEMENT = "m:dependency.management" ; private static final String PROPERTIES = "m:properties" ; private static final String EXTRA_INFO_DELIMITER = "__" ; private static final Collection < String > JAR_PACKAGINGS = Arrays . asList ( "ejb" , "bundle" , "maven-plugin" ) ; static interface ConfMapper { public void addMappingConfs ( DefaultDependencyDescriptor dd , boolean isOptional ) { } } private final DefaultModuleDescriptor ivyModuleDescriptor ; private ModuleRevisionId mrid ; private DefaultArtifact mainArtifact ; private ParserSettings parserSettings ; private static final String WRONG_NUMBER_OF_PARTS_MSG = "what<seq2seq4repair_space>seemed<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>dependency<seq2seq4repair_space>" + "management<seq2seq4repair_space>extra<seq2seq4repair_space>info<seq2seq4repair_space>exclusion<seq2seq4repair_space>had<seq2seq4repair_space>the<seq2seq4repair_space>wrong<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>parts<seq2seq4repair_space>(should<seq2seq4repair_space>have<seq2seq4repair_space>2)<seq2seq4repair_space>" ; public GradlePomModuleDescriptorBuilder ( ModuleDescriptorParser parser , Resource res , ParserSettings ivySettings ) { } public ModuleDescriptor getModuleDescriptor ( ) { } public void setModuleRevId ( String groupId , String artifactId , String version ) { } public void setHomePage ( String homePage ) { } public void setDescription ( String description ) { } public void setLicenses ( License [ ] licenses ) { } public void addMainArtifact ( String artifactId , String packaging ) { } public void addDependency ( PomDependencyData dep ) { String scope = dep . getScope ( ) ; if ( ( ( scope != null ) && ( ( scope . length ( ) ) > 0 ) ) && ( ! ( GradlePomModuleDescriptorBuilder . MAVEN2_CONF_MAPPING . containsKey ( scope ) ) ) ) { scope = "compile" ; } String version = dep . getVersion ( ) ; version = ( ( version == null ) || ( ( version . length ( ) ) == 0 ) ) ? getDefaultVersion ( dep ) : version ; ModuleRevisionId moduleRevId = ModuleRevisionId . newInstance ( dep . getGroupId ( ) , dep . getArtifactId ( ) , version ) ; ModuleRevisionId mRevId = ivyModuleDescriptor . getModuleRevisionId ( ) ; if ( ( mRevId != null ) && ( mRevId . getModuleId ( ) . equals ( moduleRevId . getModuleId ( ) ) ) ) { return ; } DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor ( ivyModuleDescriptor , moduleRevId , true , false , true ) ; scope = ( ( scope == null ) || ( ( scope . length ( ) ) == 0 ) ) ? getDefaultScope ( dep ) : scope ; GradlePomModuleDescriptorBuilder . ConfMapper mapping = GradlePomModuleDescriptorBuilder . MAVEN2_CONF_MAPPING . get ( scope ) ; mapping . addMappingConfs ( dd , dep . isOptional ( ) ) ; Map < String , String > extraAtt = new HashMap < String , String > ( ) ; <START_BUG> boolean hasClassifier = ( dep . getClassifier ( ) ) != null ; <END_BUG> boolean hasNonJarType = ( ( dep . getType ( ) ) != null ) && ( ! ( "jar" . equals ( dep . getType ( ) ) ) ) ; if ( hasClassifier || hasNonJarType ) { String type = "jar" ; if ( ( dep . getType ( ) ) != null ) { type = dep . getType ( ) ; } String ext = type ; if ( "test-jar" . equals ( type ) ) { ext = "jar" ; extraAtt . put ( "m:classifier" , "tests" ) ; } else if ( GradlePomModuleDescriptorBuilder . JAR_PACKAGINGS . contains ( type ) ) { ext = "jar" ; } if ( ( dep . getClassifier ( ) ) != null ) { extraAtt . put ( "m:classifier" , dep . getClassifier ( ) ) ; } DefaultDependencyArtifactDescriptor depArtifact = new DefaultDependencyArtifactDescriptor ( dd , dd . getDependencyId ( ) . getName ( ) , type , ext , null , extraAtt ) ; String optionalizedScope = ( dep . isOptional ( ) ) ? "optional" : scope ; dd . addDependencyArtifact ( optionalizedScope , depArtifact ) ; } List excluded = dep . getExcludedModules ( ) ; if ( excluded . isEmpty ( ) ) { excluded = GradlePomModuleDescriptorBuilder . getDependencyMgtExclusions ( ivyModuleDescriptor , dep . getGroupId ( ) , dep . getArtifactId ( ) ) ; } for ( Object anExcluded : excluded ) { ModuleId excludedModule = ( ( ModuleId ) ( anExcluded ) ) ;

Fix:
boolean hasClassifier = ( ( dep . getClassifier ( ) ) != null ) && ( ( dep . getClassifier ( ) . length ( ) ) > 0 ) ;