public static Integer convertOverrideIdentifier ( String overrideIdentifier ) throws Exception { Integer overrideId = - 1 ; try { // there is an issue with parseInt where it does not parse negative values correctly boolean isNegative = false ; if ( overrideIdentifier . startsWith ( "-" ) ) { isNegative = true ; overrideIdentifier = overrideIdentifier . substring ( 1 ) ; } overrideId = Integer . parseInt ( overrideIdentifier ) ; if ( isNegative ) { overrideId = 0 - overrideId ; } } catch ( NumberFormatException ne ) { // this is OK.. just means it's not a # // split into two parts String className = null ; String methodName = null ; int lastDot = overrideIdentifier . lastIndexOf ( "." ) ; className = overrideIdentifier . substring ( 0 , lastDot ) ; methodName = overrideIdentifier . substring ( lastDot + 1 ) ; overrideId = OverrideService . getInstance ( ) . getOverrideIdForMethod ( className , methodName ) ; } return overrideId ; }
Obtain override ID