Buggy code:
public void addPackageFromDslr ( final Resource resource ) throws IOException , DroolsParserException { } PackageDescr dslrToPackageDescr ( Resource resource ) throws DroolsParserException { } public void addPackageFromBrl ( final Resource resource ) throws DroolsParserException { } PackageDescr brlToPackageDescr ( Resource resource ) throws Exception { } public void addDsl ( Resource resource ) throws IOException { } public void addRuleFlow ( Reader processSource ) { } public void addProcessFromXml ( Resource resource ) { } public void addProcessFromXml ( Reader processSource ) { } public void addKnowledgeResource ( Resource resource , ResourceType type , ResourceConfiguration configuration ) { } void addPackageForExternalType ( Resource resource , ResourceType type , ResourceConfiguration configuration ) throws Exception { } void addPackageFromPMML ( Resource resource , ResourceType type , ResourceConfiguration configuration ) throws IOException { } void addPackageFromXSD ( Resource resource , JaxbConfigurationImpl configuration ) throws IOException { } void addPackageFromChangeSet ( Resource resource ) throws IOException , SAXException { } void addPackageFromInputStream ( Resource resource ) throws IOException , ClassNotFoundException { } public void addPackage ( final PackageDescr packageDescr ) { } void compileAllRules ( PackageDescr packageDescr , PackageRegistry pkgRegistry ) { } PackageRegistry initPackageRegistry ( PackageDescr packageDescr ) { } private void compileRules ( PackageDescr packageDescr , PackageRegistry pkgRegistry ) { } private void initPackage ( PackageDescr packageDescr ) { } private String getPackageDialect ( PackageDescr packageDescr ) { } private boolean checkNamespace ( String newName ) { } public boolean isEmpty ( String string ) { } public void updateResults ( ) { } public void compileAll ( ) { } public void reloadAll ( ) { } private List getResults ( List results ) { } public synchronized void addPackage ( final Package newPkg ) { } private void mergePackage ( final Package pkg , final Package newPkg ) { } private void validateUniqueRuleNames ( final PackageDescr packageDescr ) { } private PackageRegistry newPackage ( final PackageDescr packageDescr ) { } private void mergePackage ( PackageRegistry pkgRegistry , PackageDescr packageDescr ) { } void processOtherDeclarations ( PackageRegistry pkgRegistry , PackageDescr packageDescr ) { } private void processGlobals ( PackageRegistry pkgRegistry , PackageDescr packageDescr ) { } private void processFunctions ( PackageRegistry pkgRegistry , PackageDescr packageDescr ) { } void processUnresolvedTypes ( PackageRegistry pkgRegistry , List < PackageBuilder . TypeDefinition > unresolvedTypeDefinitions ) { } public TypeDeclaration getAndRegisterTypeDeclaration ( Class < ? > cls , String packageName ) { } public TypeDeclaration getTypeDeclaration ( Class < ? > cls ) { } private TypeDeclaration createTypeDeclaration ( Class < ? > cls ) { } private TypeDeclaration getCachedTypeDeclaration ( Class < ? > cls ) { } private TypeDeclaration getExistingTypeDeclaration ( Class < ? > cls ) { } private void initTypeDeclaration ( Class < ? > cls , TypeDeclaration typeDeclaration ) { } private TypeDeclaration createTypeDeclarationForBean ( Class < ? > cls ) { } private void processModifiedProps ( Class < ? > cls , ClassDefinition clsDef ) { } private void processFieldsPosition ( Class < ? > cls , ClassDefinition clsDef ) { } public void buildTypeDeclarations ( Class < ? > cls , Set < TypeDeclaration > tdecls ) { } public boolean buildTypeDeclarationInterfaces ( Class cls , Set < TypeDeclaration > tdecls ) { } private String resolveType ( String sup , PackageDescr packageDescr , PackageRegistry pkgRegistry ) { for ( ImportDescr id : packageDescr . getImports ( ) ) { if ( id . getTarget ( ) . endsWith ( ( "." + sup ) ) ) { return id . getTarget ( ) ; } } if ( pkgRegistry != null ) { for ( String declaredName : pkgRegistry . getPackage ( ) . getTypeDeclarations ( ) . keySet ( ) ) { <START_BUG> if ( declaredName . endsWith ( sup ) ) <END_BUG> sup = pkgRegistry . getPackage ( ) . getTypeDeclaration ( declaredName ) . getTypeClass ( ) . getName ( ) ; } } if ( ( ( sup != null ) && ( ! ( sup . contains ( "." ) ) ) ) && ( ( ( packageDescr . getNamespace ( ) ) != null ) && ( ( packageDescr . getNamespace ( ) . length ( ) ) > 0 ) ) ) { for ( AbstractClassTypeDeclarationDescr td : packageDescr . getClassAndEnumDeclarationDescrs ( ) ) { if ( sup . equals ( td . getTypeName ( ) ) ) sup = ( ( packageDescr . getNamespace ( ) ) + "." ) + sup ; } } return sup ; } private void fillSuperType ( TypeDeclarationDescr typeDescr , PackageDescr packageDescr ) { } private void fillFieldTypes ( AbstractClassTypeDeclarationDescr typeDescr , PackageDescr packageDescr ) { } private boolean mergeInheritedFields ( TypeDeclarationDescr typeDescr ) { } private boolean mergeInheritedFields ( String simpleSuperTypeName , String superTypePackageName , String fullSuper , TypeDeclarationDescr typeDescr ) { } void processEntryPointDeclarations ( PackageRegistry pkgRegistry , PackageDescr packageDescr ) { } private void processWindowDeclarations ( PackageRegistry pkgRegistry , PackageDescr packageDescr ) { } void registerGeneratedType ( AbstractClassTypeDeclarationDescr typeDescr ) { } List < PackageBuilder . TypeDefinition > processTypeDeclarations ( PackageRegistry pkgRegistry , PackageDescr packageDescr ) { } private boolean processTypeFields ( PackageRegistry pkgRegistry , AbstractClassTypeDeclarationDescr typeDescr , TypeDeclaration type , boolean firstAttempt ) { } private void updateTraitDefinition ( TypeDeclaration type , Class concrete ) { } private boolean isNovelClass ( AbstractClassTypeDeclarationDescr typeDescr ) { } private Class resolveAnnotation ( String annotation , TypeResolver resolver ) { } private void buildFieldAccessors ( final TypeDeclaration type , final PackageRegistry pkgRegistry ) throws IntrospectionException , IOException , ClassNotFoundException , IllegalAccessException , IllegalArgumentException , InstantiationException , NoSuchFieldException , NoSuchMethodException , SecurityException , InvocationTargetException { } private void generateDeclaredBean ( AbstractClassTypeDeclarationDescr typeDescr , TypeDeclaration type , PackageRegistry pkgRegistry ) { } private void generateDeclaredBean ( AbstractClassTypeDeclarationDescr typeDescr , TypeDeclaration type , PackageRegistry pkgRegistry , ClassDefinition def ) { } private PriorityQueue < FieldDefinition > sortFields ( Map < String , TypeFieldDescr > flds , PackageRegistry pkgRegistry ) { } private void addFunction ( final FunctionDescr functionDescr ) { }

Fix:
if ( declaredName . equals ( sup ) )