Buggy code:
public class ObjectImpl implements StringConstants , KomodoObject { private static final KLog LOGGER = KLog . getLogger ( ) ; final int index ; final String path ; final Repository repository ; public ObjectImpl ( final Repository komodoRepository , final String path , final int index ) throws KException { } ObjectImpl accessOuter ( ) { } protected Node node ( UnitOfWork uow ) throws KException { } @ Override public KomodoObject addChild ( final UnitOfWork uow , final String name , final String primaryType ) throws KException { } @ Override public void addDescriptor ( final UnitOfWork uow , final String ... descriptorNames ) throws KException { } @ Override public boolean equals ( final Object object ) { } @ Override public String getAbsolutePath ( ) { } @ Override public KomodoObject getChild ( final UnitOfWork uow , final String name ) throws KException { } @ Override public KomodoObject [ ] getChildren ( final UnitOfWork uow ) throws KException { } private KomodoObject [ ] getChildren ( final UnitOfWork transaction , final NodeIterator itr ) throws Exception { } @ Override public KomodoObject [ ] getChildren ( final UnitOfWork uow , final String name ) throws KException { } @ Override public KomodoObject [ ] getChildrenOfType ( final UnitOfWork uow , final String type ) throws KException { ArgCheck . isNotEmpty ( type , "primaryType" ) ; UnitOfWork transaction = uow ; if ( transaction == null ) { transaction = getRepository ( ) . createTransaction ( "kobject-getChildrenOfType" , true , null ) ; } assert transaction != null ; try { KomodoObject [ ] kids = getChildren ( transaction , node ( transaction ) . getNodes ( ) ) ; if ( ( kids . length ) != 0 ) { final List < KomodoObject > matches = new ArrayList < KomodoObject > ( kids . length ) ; for ( final KomodoObject kid : kids ) { <START_BUG> if ( ( type . equals ( kid . getPrimaryType ( transaction ) ) ) || ( kid . hasDescriptor ( transaction , type ) ) ) { <END_BUG> matches . add ( kid ) ; } } kids = matches . toArray ( new KomodoObject [ matches . size ( ) ] ) ; } if ( uow == null ) { transaction . commit ( ) ; } return kids ; } catch ( final Exception e ) { throw handleError ( uow , transaction , e ) ; } } @ Override public Descriptor [ ] getDescriptors ( final UnitOfWork uow ) throws KException { } @ Override public int getIndex ( ) { } @ Override public String getName ( final UnitOfWork uow ) throws KException { } @ Override public KomodoObject getParent ( final UnitOfWork uow ) throws KException { } @ Override public Descriptor getPrimaryType ( final UnitOfWork uow ) throws KException { } protected < T > T getObjectProperty ( UnitOfWork uow , Property . ValueType returnValueType , String getterName , String propertyPath ) throws KException { } @ Override public Property getProperty ( final UnitOfWork uow , final String name ) throws KException { } @ Override public String [ ] getPropertyNames ( final UnitOfWork uow ) throws KException { } @ Override public Repository getRepository ( ) { } protected Session getSession ( final UnitOfWork transaction ) { } protected KException handleError ( final UnitOfWork transactionParameter , final UnitOfWork transactionVariable , final Exception e ) { } @ Override public boolean hasChild ( final UnitOfWork uow , final String name ) throws KException { } @ Override public boolean hasChildren ( final UnitOfWork uow ) throws KException { } @ Override public boolean hasDescriptor ( final UnitOfWork uow , final String descriptorName ) throws KException { } @ Override public int hashCode ( ) { } @ Override public boolean hasProperties ( final UnitOfWork transaction ) throws KException { } @ Override public boolean hasProperty ( final UnitOfWork uow , final String name ) throws KException { } @ Override public void print ( final UnitOfWork uow ) throws KException { } @ Override public void removeChild ( final UnitOfWork uow , final String ... names ) throws KException { } @ Override public void removeDescriptor ( final UnitOfWork uow , final String ... descriptorNames ) throws KException { } void setMultiValuedProperty ( final Session session , final Node node , final ValueFactory factory , final String name , final Object [ ] propValues , final int propertyType ) throws Exception { } @ Override public void setPrimaryType ( final UnitOfWork uow , final String typeName ) throws KException { } private void setProperty ( final Session session , final Node node , final String name , final Object ... values ) throws Exception { } protected void setObjectProperty ( UnitOfWork uow , String setterName , String propertyName , Object value ) throws KException { } @ Override public void setProperty ( final UnitOfWork uow , final String propertyName , final Object ... values ) throws KException { } @ Override public String toString ( ) { } @ Override public void visit ( KomodoObjectVisitor visitor ) throws Exception { } }

Fix:
if ( ( type . equals ( kid . getPrimaryType ( transaction ) . getName ( ) ) ) || ( kid . hasDescriptor ( transaction , type ) ) ) {