question: private void deleteAttrs ( SvcReg reg , EntryRep entry , boolean checkDups ) { EntryClass eclass = entry . eclass ; deleteInstance ( eclass ) ; Object [ ] fields = entry . fields ; if ( fields . length == 0 ) { ArrayList regs = serviceByEmptyAttr . get ( eclass ) ; if ( regs == null || ( checkDups && hasEmptyAttr ( reg , eclass ) ) ) return ; int idx = regs . indexOf ( reg ) ; if ( idx >= 0 ) { regs . remove ( idx ) ; if ( regs . isEmpty ( ) ) serviceByEmptyAttr . remove ( eclass ) ; } return ; } for ( int fldidx = fields . length ; -- fldidx >= 0 ; ) { eclass = getDefiningClass ( eclass , fldidx ) ; HashMap [ ] attrMaps = serviceByAttr . get ( eclass ) ; if ( attrMaps == null || attrMaps [ fldidx ] == null || ( checkDups && hasAttr ( reg , eclass , fldidx , fields [ fldidx ] ) ) ) continue ; HashMap map = attrMaps [ fldidx ] ; Object value = fields [ fldidx ] ; ArrayList regs = ( ArrayList ) map . get ( value ) ; if ( regs == null ) continue ; int idx = regs . indexOf ( reg ) ; if ( idx < 0 ) continue ; regs . remove ( idx ) ; if ( ! regs . isEmpty ( ) ) continue ; map . remove ( value ) ; if ( ! map . isEmpty ( ) ) continue ; attrMaps [ fldidx ] = null ; if ( allNull ( attrMaps ) ) serviceByAttr . remove ( eclass ) ; } }
target:  If checkDups is false, delete the service (if present) from serviceByAttr under all attribute values of the given entry or from serviceByEmptyAttr if the entry has no attributes. If checkDups is true, only delete for a given attribute value if the service has no other entries of similar type that still have the same value.  Either way, delete an instance of the EntryClass, and update entryClasses as necessary.