JDK-4925483 : RFE: equals() should compare string in Encoding and Type
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2003-09-19
  • Updated: 2017-05-16
  • Resolved: 2003-10-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
5.0 b24Fixed
Related Reports
Relates :  
Relates :  

Name: fb126949			Date: 09/19/2003

The classes AudioFormat.Encoding and AudioFileFormat.Type both compare the instance equality in the equals() method. However, this prevents 3rd-party vendors to publish a plug-in with a new encoding/type, since only one instance of it would be accepted.

The problem is this: when a user wants to convert an audiostream to a format that is offered by an installed plug-in (e.g. mp3 encoder), he uses the method AudioSystem.getAudioInputStream(AudioFormat, AudioInputStream) for conversion. He needs to provide an AudioFormat instance with the mp3 encoding. The only way to do that is to instanciate an own instance of AudioFormat.Encoding. But due to the implementation of equals(), Java Sound will not do the conversion, since the Encoding instance is difeerent from the one provided by the plug-in, even if they have the same name.

Encodings and Types are fully specified by their name, and not their instance.

The deficiency of the current implementation lead Tritonus, an independent group that publishes Java Sound plug-ins, to establish a quasi-standard repository which makes sure that only unique instances of Encoding and Type are used in the plug-ins and from the user. Such a repository contradicts Java Sound's idea of being open for new plug-ins.


CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b24 tiger-beta

PUBLIC COMMENTS equals() should compare string in Encoding and Type

EVALUATION ###@###.### 2003-09-19 Very important to get this fixed in tiger.