int resolveNameAndTypeIndex ( String name , String descriptor ) { int size = 0 ; int index = 0 ; constantReadLock . lock ( ) ; try { size = getConstantPoolSize ( ) ; index = getNameAndTypeIndex ( name , descriptor ) ; } finally { constantReadLock . unlock ( ) ; } if ( index != - 1 ) { return index ; } else { int nameIndex = resolveNameIndex ( name ) ; int typeIndex = resolveNameIndex ( descriptor ) ; return addConstantInfo ( new NameAndType ( nameIndex , typeIndex ) , size ) ; } }
Returns the constant map index to name and type If entry doesn t exist it is created .