Beta3 said this for toString()
/**
* Override of the default method to return the resource string
represented
* by this string resource model. Useful in debugging and so on, to
avoid
* the explicit need to call the getString() method.
*
* @return The string for this model object
*/
and this for getString()
/**
* Gets the string currently represented by this string resource model.
The
* string that is returned may vary for each call to this method
depending
* on the values contained in the model and an the parameters that were
* passed when this string resource model was created.
*
* @return The string
*/
It's arguable that it is/was saying that it could be used to avoid
the explicit getString() call but as it no longer can (as it's being
used to expose internal details for logging/debugging), then it should
really be mentioned in a change note somewhere.
/Gwyn
On Wednesday, October 17, 2007, 11:21:56 AM, Maeder <[EMAIL PROTECTED]> wrote:
> Yes, but you were relying on an implementation detail which was in no
> way promised to remain stable. You should not have done that and you got
> properly burned. It's like when you call one of these public methods
> which are marked as "not part of the Wicket API, don't call this". What
> my question was aimed at was more finding out whether the doc specifies
> anything about the return value of StringResourceModel.toString().
> Thomas
>> -----Original Message-----
>> From: Jan Kriesten [mailto:[EMAIL PROTECTED]
>> Sent: Mittwoch, 17. Oktober 2007 12:07
>> To: [email protected]
>> Subject: Re: StringResourceModel toString() changed in Beta4
>> - why??? Must use getString() now.
>>
>>
>> Hi Thomas,
>>
>> > The javadoc pretty clearly says that this is "useful for
>> debugging and
>> > so on...". What lead you to believe this would always return a
>> > user-readable string?
>>
>> actually, I stumbled over this, too. I used StringResourceModel for
>> IChoiceRenderer- and IOptionRenderer-Lists (where one assumes
>> String within getDisplayValue/getIdValue). Now I have to do an
>>
>> if( obj instanceof StringResourceModel )
>> return( ((StringResourceModel) obj).getString() );
>>
>> whereas for all other cases I just return 'toString()'.
>>
>> This wasn't a nice surprise actually.
>>
>> Regards, --- Jan.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
/Gwyn
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]