src/net/java/sip/communicator/impl/protocol/jabber/OperationSetServerStoredAccountInfoJabberImpl.java
/**
     * Replaces the currentDetailValue detail with newDetailValue and returns
     * true if the operation was a success or false if currentDetailValue did
     * not previously exist (in this case an additional call to addDetail is
     * required).
     * <p>
     * @param currentDetailValue the detail value we'd like to replace.
     * @param newDetailValue the value of the detail that we'd like to replace
     * currentDetailValue with.
     * @return true if the operation was a success or false if
     * currentDetailValue did not previously exist (in this case an additional
     * call to addDetail is required).
     * @throws ClassCastException if newDetailValue is not an instance of the
     * same class as currentDetailValue.
     */
Replaces the currentDetailValue detail with newDetailValue and returns
true if the operation was a success or false if currentDetailValue did
not previously exist (in this case an additional call to addDetail is
required).

@param currentDetailValue the detail value we'd like to replace.
@param newDetailValue the value of the detail that we'd like to replace
currentDetailValue with.
@return true if the operation was a success or false if
currentDetailValue did not previously exist (in this case an additional
call to addDetail is required).
@throws ClassCastException if newDetailValue is not an instance of the
same class as currentDetailValue.
Replaces the currentDetailValue detail with newDetailValue and returns true if the operation was a success or false if currentDetailValue did not previously exist ( in this case an additional call to addDetail is required ) . @param currentDetailValue the detail value we ' d like to replace . @param newDetailValue the value of the detail that we ' d like to replace currentDetailValue with . @return true if the operation was a success or false if currentDetailValue did not previously exist ( in this case an additional call to addDetail is required ) . @throws ClassCastException if newDetailValue is not an instance of the same class as currentDetailValue .
public boolean replaceDetail(
                    ServerStoredDetails.GenericDetail currentDetailValue,
                    ServerStoredDetails.GenericDetail newDetailValue)
        throws ClassCastException
    {
        if (!newDetailValue.getClass().equals(currentDetailValue.getClass()))
        {
            throw new ClassCastException(
                    "New value to be replaced is not as the current one");
        }
        if (currentDetailValue.equals(newDetailValue))
        {
            return true;
        }
        boolean isFound = false;
        Iterator<GenericDetail> iter =
                infoRetreiver.getDetails(uin, currentDetailValue.getClass());
        while (iter.hasNext())
        {
            GenericDetail item = iter.next();
            if (item.equals(currentDetailValue))
            {
                isFound = true;
                break;
            }
        }
        if (!isFound)
        {
            return false;
        }
        removeDetail(currentDetailValue);
        addDetail(newDetailValue);
        return true;
    }
public boolean replaceDetail ( ServerStoredDetails . GenericDetail currentDetailValue , ServerStoredDetails . GenericDetail newDetailValue ) throws ClassCastException { if ( ! newDetailValue . getClass ( ) . equals ( currentDetailValue . getClass ( ) ) ) { throw new ClassCastException ( "New value to be replaced is not as the current one" ) ; } if ( currentDetailValue . equals ( newDetailValue ) ) { return true ; } boolean isFound = false ; Iterator < GenericDetail > iter = infoRetreiver . getDetails ( uin , currentDetailValue . getClass ( ) ) ; while ( iter . hasNext ( ) ) { GenericDetail item = iter . next ( ) ; if ( item . equals ( currentDetailValue ) ) { isFound = true ; break ; } } if ( ! isFound ) { return false ; } removeDetail ( currentDetailValue ) ; addDetail ( newDetailValue ) ; return true ; }
Replaces the currentDetailValue detail with newDetailValue and returns
 true if the operation was a success or false if currentDetailValue did
 not previously exist (in this case an additional call to addDetail is
 required).
Replaces the currentDetailValue detail with newDetailValue and returns true if the operation was a success or false if currentDetailValue did not previously exist ( in this case an additional call to addDetail is required ) .
// if values are the same no change // current detail value does not exist