<Sound Dev> [15] Review Request: 8236980 Cleanup of toString methods in JavaSound

Philip Race philip.race at oracle.com
Thu Jan 23 00:59:05 UTC 2020



On 1/22/20, 2:13 PM, Sergey Bylokhov wrote:
> On 1/22/20 8:54 am, Phil Race wrote:
>> http://cr.openjdk.java.net/~serb/8236980/webrev.00/src/java.desktop/share/classes/javax/sound/midi/MidiDevice.java.sdiff.html 
>>
>>
>> - * Provides a string representation of the device information.
>> + * Returns a string representation of the info object.
>>            *
>> - * @return a description of the info object
>> + * @return a string representation of the info object Why is this 
>> better ? What is an "info object" ? Why not ?
>> "Returns a string representation of the device"?
>
> Because technically this is not a MidiDevice class, but nested class 
> "Info".

Oh. I see. I could not tell that from the diff.
>
> And it returns the same thing as "name" anyway. Are you avoiding 
> over-specifying to that extent ?
>
> That's because I do not like to specify the content of the string if it
> was not specified before. If in the method above I'll say that the
> "name" is returned instead of some generic description, then the CSR
> will be needed for sure, because of the new "assertion".
>
> But I'm fine if this spec will be aligned to other methods that returns
> the "name" and specify this in the Javadoc.
>
> Yet you preserve that same behaviour here (and elsewhere) :- 
> http://cr.openjdk.java.net/~serb/8236980/webrev.00/src/java.desktop/share/classes/javax/sound/midi/Sequencer.java.udiff.html 
> Are you intending a CSR for any of this ? -phil
>
> The CSR will be necessary if I'll add or remove some assertions in the 
> spec.

Meaning you don't think it is currently needed ?
Although really I don't understand how this fix is of any great importance.
Who was having a problem with the existing behaviour / spec ?

-phil.
>
>>
>> On 1/12/20 12:14 PM, Sergey Bylokhov wrote:
>>> Hello.
>>> Please review a "weekend cleanup" for JDK 15.
>>>
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8236980
>>> Fix: http://cr.openjdk.java.net/~serb/8236980/webrev.00
>>>
>>> I have made these changes:
>>>  - The words in the specs are unified across the different methods
>>>  - All toString() implementations now use getXXX() methods instead
>>>    of direct access to the fields(the getxxx() methods are skipped
>>>    only if the getxxx() method is final)
>>>  - A few tests were added to check some spec, and its implementations
>>>
>>
>
>


More information about the sound-dev mailing list