Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4925483
Votes 0
Synopsis RFE: equals() should compare string in Encoding and Type
Category java:classes_sound
Reported Against tiger
Release Fixed 1.5(tiger-b24)
State 10-Fix Delivered, request for enhancement
Priority: 3-Medium
Related Bugs 4663506 , 4941629
Submit Date 19-SEP-2003
Description
equals() should compare string in Encoding and Type




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.


======================================================================
Work Around
N/A
Evaluation
 xxxxx@xxxxx  2003-09-19
	Very important to get this fixed in tiger.
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang