I'm checking this in.
This fixes the reverse japi bugs in javax.sound.
Tom
2006-03-15 Tom Tromey <[EMAIL PROTECTED]>
* javax/sound/midi/Track.java (Track): New constructor.
(events): Now package-private.
* javax/sound/midi/MidiUnavailableException.java
(MidiUnavailableException): Removed invalid constructors.
* javax/sound/midi/MidiSystem.java (MidiSystem): New constructor.
* javax/sound/midi/InvalidMidiDataException.java
(InvalidMidiDataException): Removed invalid constructors.
* javax/sound/midi/Sequencer.java (hashCode): Now final.
* javax/sound/midi/SysexMessage.java (SysexMessage): Now protected.
* javax/sound/midi/ShortMessage.java (ShortMessage): Now protected.
(SYSTEM_EXCLUSIVE): Removed.
(getDataLength): Updated.
* javax/sound/midi/MidiDevice.java (Info): Now protected.
(equals): Now final
(getName): Now final.
(getVendor): Now final.
(getDescription): Likewise.
(hashCode): Likewise.
(getVersion): Likewise.
(toString): Likewise.
* javax/sound/midi/MetaMessage.java (MetaMessage): Now protected.
* javax/sound/sampled/ReverbType.java (getDecayTime): Now final.
(getEarlyReflectionDelay): Likewise.
(getEarlyReflectionIntensity): Likewise.
(getLateReflectionDelay): Likewise.
(getLateReflectionIntensity): Likewise.
(toString): Likewise.
* javax/sound/sampled/Port.java (toString): Now final.
* javax/sound/sampled/LineEvent.java (getFramePosition): Now final.
(getLine): Likewise.
(getType): Likewise.
* javax/sound/sampled/Mixer.java (Info): Now protected.
(getDescription): Now final.
(getName): Likewise.
(getVendor): Likewise.
(getVersion): Likewise.
(toString): Likewise.
* javax/sound/sampled/Control.java: Now abstract.
(Type.toString): Now final.
Index: javax/sound/midi/InvalidMidiDataException.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/sound/midi/InvalidMidiDataException.java,v
retrieving revision 1.2
diff -u -r1.2 InvalidMidiDataException.java
--- javax/sound/midi/InvalidMidiDataException.java 28 Sep 2005 14:56:47
-0000 1.2
+++ javax/sound/midi/InvalidMidiDataException.java 16 Mar 2006 01:43:39
-0000
@@ -66,25 +66,4 @@
{
super(s);
}
-
- /**
- * Create an InvalidMidiDataException object.
- *
- * @param s the exception message string
- * @param cause the root cause of the exception
- */
- public InvalidMidiDataException(String s, Throwable cause)
- {
- super(s, cause);
- }
-
- /**
- * Create an InvalidMidiDataException object.
- *
- * @param cause the root cause of the exception
- */
- public InvalidMidiDataException(Throwable cause)
- {
- super(cause);
- }
}
Index: javax/sound/midi/MetaMessage.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/sound/midi/MetaMessage.java,v
retrieving revision 1.1
diff -u -r1.1 MetaMessage.java
--- javax/sound/midi/MetaMessage.java 26 Sep 2005 16:35:00 -0000 1.1
+++ javax/sound/midi/MetaMessage.java 16 Mar 2006 01:43:39 -0000
@@ -76,7 +76,7 @@
* Create a MetaMessage object.
* @param data a complete system exclusive message
*/
- public MetaMessage(byte[] data)
+ protected MetaMessage(byte[] data)
{
super(data);
int index = 2;
Index: javax/sound/midi/MidiDevice.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/sound/midi/MidiDevice.java,v
retrieving revision 1.1
diff -u -r1.1 MidiDevice.java
--- javax/sound/midi/MidiDevice.java 26 Sep 2005 16:35:00 -0000 1.1
+++ javax/sound/midi/MidiDevice.java 16 Mar 2006 01:43:39 -0000
@@ -134,7 +134,7 @@
* @param description the device description
* @param version the device version string
*/
- public Info(String name, String vendor, String description, String version)
+ protected Info(String name, String vendor, String description, String
version)
{
this.name = name;
this.vendor = vendor;
@@ -150,7 +150,7 @@
* @return true if this is the same object
* @see java.lang.Object#equals(java.lang.Object)
*/
- public boolean equals(Object obj)
+ public final boolean equals(Object obj)
{
return super.equals(obj);
}
@@ -161,7 +161,7 @@
* @return the hash code for this object
* @see java.lang.Object#hashCode()
*/
- public int hashCode()
+ public final int hashCode()
{
return super.hashCode();
}
@@ -171,7 +171,7 @@
*
* @return the device name
*/
- public String getName()
+ public final String getName()
{
return name;
}
@@ -181,7 +181,7 @@
*
* @return the device vendor
*/
- public String getVendor()
+ public final String getVendor()
{
return vendor;
}
@@ -191,7 +191,7 @@
*
* @return the device description
*/
- public String getDescription()
+ public final String getDescription()
{
return description;
}
@@ -201,7 +201,7 @@
*
* @return the device version
*/
- public String getVersion()
+ public final String getVersion()
{
return version;
}
@@ -212,7 +212,7 @@
* @return the device name
* @see java.lang.Object#toString()
*/
- public String toString()
+ public final String toString()
{
return name;
}
Index: javax/sound/midi/MidiSystem.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/sound/midi/MidiSystem.java,v
retrieving revision 1.3
diff -u -r1.3 MidiSystem.java
--- javax/sound/midi/MidiSystem.java 28 Sep 2005 03:44:05 -0000 1.3
+++ javax/sound/midi/MidiSystem.java 16 Mar 2006 01:43:39 -0000
@@ -64,6 +64,11 @@
*/
public class MidiSystem
{
+ private MidiSystem()
+ {
+ // Not instantiable.
+ }
+
/**
* Get an array of all available MIDI devices.
*
Index: javax/sound/midi/MidiUnavailableException.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/sound/midi/MidiUnavailableException.java,v
retrieving revision 1.2
diff -u -r1.2 MidiUnavailableException.java
--- javax/sound/midi/MidiUnavailableException.java 28 Sep 2005 14:56:47
-0000 1.2
+++ javax/sound/midi/MidiUnavailableException.java 16 Mar 2006 01:43:39
-0000
@@ -66,25 +66,4 @@
{
super(s);
}
-
- /**
- * Create an MidiUnavailableException object.
- *
- * @param s the exception message string
- * @param cause the root cause of the exception
- */
- public MidiUnavailableException(String s, Throwable cause)
- {
- super(s, cause);
- }
-
- /**
- * Create an MidiUnavailableException object.
- *
- * @param cause the root cause of the exception
- */
- public MidiUnavailableException(Throwable cause)
- {
- super(cause);
- }
}
Index: javax/sound/midi/Sequencer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/sound/midi/Sequencer.java,v
retrieving revision 1.3
diff -u -r1.3 Sequencer.java
--- javax/sound/midi/Sequencer.java 28 Sep 2005 03:44:05 -0000 1.3
+++ javax/sound/midi/Sequencer.java 16 Mar 2006 01:43:40 -0000
@@ -385,7 +385,7 @@
/**
* SyncMode objects use the Object hashCode.
*/
- public int hashCode()
+ public final int hashCode()
{
return super.hashCode();
}
Index: javax/sound/midi/ShortMessage.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/sound/midi/ShortMessage.java,v
retrieving revision 1.3
diff -u -r1.3 ShortMessage.java
--- javax/sound/midi/ShortMessage.java 28 Sep 2005 03:44:05 -0000 1.3
+++ javax/sound/midi/ShortMessage.java 16 Mar 2006 01:43:40 -0000
@@ -48,11 +48,6 @@
public class ShortMessage extends MidiMessage
{
/**
- * Status byte for System Exclusive message.
- */
- public static final int SYSTEM_EXCLUSIVE = 0xF0;
-
- /**
* Status byte for Time Code message.
*/
public static final int MIDI_TIME_CODE = 0xF1;
@@ -170,7 +165,7 @@
*
* @param data the message data
*/
- public ShortMessage(byte[] data)
+ protected ShortMessage(byte[] data)
{
super(data);
}
@@ -263,9 +258,6 @@
case 0xF5: // FIXME: unofficial bus select. Not in spec??
return 1;
- case SYSTEM_EXCLUSIVE:
- return 0; // FIXME: is this correct?
-
case TUNE_REQUEST:
case END_OF_EXCLUSIVE:
case TIMING_CLOCK:
Index: javax/sound/midi/SysexMessage.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/sound/midi/SysexMessage.java,v
retrieving revision 1.1
diff -u -r1.1 SysexMessage.java
--- javax/sound/midi/SysexMessage.java 26 Sep 2005 16:35:00 -0000 1.1
+++ javax/sound/midi/SysexMessage.java 16 Mar 2006 01:43:40 -0000
@@ -69,7 +69,7 @@
* Create a SysexMessage object.
* @param data a complete system exclusive message
*/
- public SysexMessage(byte[] data)
+ protected SysexMessage(byte[] data)
{
super(data);
}
Index: javax/sound/midi/Track.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/sound/midi/Track.java,v
retrieving revision 1.1
diff -u -r1.1 Track.java
--- javax/sound/midi/Track.java 26 Sep 2005 16:35:00 -0000 1.1
+++ javax/sound/midi/Track.java 16 Mar 2006 01:43:40 -0000
@@ -54,11 +54,16 @@
/**
* The list of MidiEvents for this track.
*/
- protected Vector events;
+ Vector events;
// A HashSet to speed processing
private HashSet eventSet;
-
+
+ // This is only instantiable within this package.
+ Track()
+ {
+ }
+
/**
* Add a new event to this track. Specific events may only be added once.
* The event will be inserted into the appropriate spot in the event list
Index: javax/sound/sampled/Control.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/sound/sampled/Control.java,v
retrieving revision 1.1
diff -u -r1.1 Control.java
--- javax/sound/sampled/Control.java 13 Nov 2005 17:33:44 -0000 1.1
+++ javax/sound/sampled/Control.java 16 Mar 2006 01:43:40 -0000
@@ -43,7 +43,7 @@
* for instance its volume.
* @since 1.3
*/
-public class Control
+public abstract class Control
{
/**
* This describes a single control.
@@ -75,7 +75,7 @@
/**
* Return the name of this Type.
*/
- public String toString()
+ public final String toString()
{
return name;
}
Index: javax/sound/sampled/LineEvent.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/sound/sampled/LineEvent.java,v
retrieving revision 1.2
diff -u -r1.2 LineEvent.java
--- javax/sound/sampled/LineEvent.java 12 Feb 2006 18:35:41 -0000 1.2
+++ javax/sound/sampled/LineEvent.java 16 Mar 2006 01:43:40 -0000
@@ -126,7 +126,7 @@
/**
* Return the frame position associated with this event.
*/
- public long getFramePosition()
+ public final long getFramePosition()
{
return framePosition;
}
@@ -134,7 +134,7 @@
/**
* Return the Line associated with this event.
*/
- public Line getLine()
+ public final Line getLine()
{
return line;
}
@@ -142,7 +142,7 @@
/**
* Return the Type associated with this event.
*/
- public Type getType()
+ public final Type getType()
{
return type;
}
Index: javax/sound/sampled/Mixer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/sound/sampled/Mixer.java,v
retrieving revision 1.1
diff -u -r1.1 Mixer.java
--- javax/sound/sampled/Mixer.java 13 Nov 2005 17:33:44 -0000 1.1
+++ javax/sound/sampled/Mixer.java 16 Mar 2006 01:43:40 -0000
@@ -62,7 +62,7 @@
* @param desc a descriptive string
* @param vers the mixer's version
*/
- public Info(String name, String vendor, String desc, String vers)
+ protected Info(String name, String vendor, String desc, String vers)
{
this.name = name;
this.description = desc;
@@ -83,7 +83,7 @@
/**
* Return the name of the mixer.
*/
- public String getName()
+ public final String getName()
{
return name;
}
@@ -91,7 +91,7 @@
/**
* Return the mixer's description.
*/
- public String getDescription()
+ public final String getDescription()
{
return description;
}
@@ -99,7 +99,7 @@
/**
* Return the mixer's vendor.
*/
- public String getVendor()
+ public final String getVendor()
{
return vendor;
}
@@ -107,12 +107,12 @@
/**
* Return the mixer's version.
*/
- public String getVersion()
+ public final String getVersion()
{
return version;
}
- public String toString()
+ public final String toString()
{
return ("name=" + name + "; description=" + description
+ "; vendor=" + vendor + "; version=" + version);
Index: javax/sound/sampled/Port.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/sound/sampled/Port.java,v
retrieving revision 1.1
diff -u -r1.1 Port.java
--- javax/sound/sampled/Port.java 13 Nov 2005 17:33:44 -0000 1.1
+++ javax/sound/sampled/Port.java 16 Mar 2006 01:43:40 -0000
@@ -127,7 +127,7 @@
return super.matches(other) && equals(other);
}
- public String toString()
+ public final String toString()
{
return super.toString() + "; name=" + name + "; isSource=" + isSource;
}
Index: javax/sound/sampled/ReverbType.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/sound/sampled/ReverbType.java,v
retrieving revision 1.1
diff -u -r1.1 ReverbType.java
--- javax/sound/sampled/ReverbType.java 13 Nov 2005 17:33:44 -0000 1.1
+++ javax/sound/sampled/ReverbType.java 16 Mar 2006 01:43:40 -0000
@@ -84,7 +84,7 @@
/**
* Return the decay time.
*/
- public int getDecayTime()
+ public final int getDecayTime()
{
return decayTime;
}
@@ -92,7 +92,7 @@
/**
* Return the early reflection delay.
*/
- public int getEarlyReflectionDelay()
+ public final int getEarlyReflectionDelay()
{
return earlyReflectionDelay;
}
@@ -100,7 +100,7 @@
/**
* Return the early reflection intensity.
*/
- public float getEarlyReflectionIntensity()
+ public final float getEarlyReflectionIntensity()
{
return earlyReflectionIntensity;
}
@@ -108,7 +108,7 @@
/**
* Return the late reflection delay.
*/
- public int getLateReflectionDelay()
+ public final int getLateReflectionDelay()
{
return lateReflectionDelay;
}
@@ -116,7 +116,7 @@
/**
* Return the late reflection intensity.
*/
- public float getLateReflectionIntensity()
+ public final float getLateReflectionIntensity()
{
return lateReflectionIntensity;
}
@@ -133,7 +133,7 @@
/**
* Return a description of this ReverbType.
*/
- public String toString()
+ public final String toString()
{
return ("name=" + name + "; earlyReflectionDelay=" + earlyReflectionDelay
+ "; earlyReflectionIntensity=" + earlyReflectionIntensity