summaryrefslogtreecommitdiff
path: root/javax/sound/sampled/LineEvent.java
diff options
context:
space:
mode:
Diffstat (limited to 'javax/sound/sampled/LineEvent.java')
-rw-r--r--javax/sound/sampled/LineEvent.java24
1 files changed, 22 insertions, 2 deletions
diff --git a/javax/sound/sampled/LineEvent.java b/javax/sound/sampled/LineEvent.java
index 7bba2cd1d..db925935b 100644
--- a/javax/sound/sampled/LineEvent.java
+++ b/javax/sound/sampled/LineEvent.java
@@ -38,16 +38,24 @@ exception statement from your version. */
package javax.sound.sampled;
+import java.io.IOException;
+import java.io.NotSerializableException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.util.EventObject;
-// FIXME: attempts to serialize this should fail
-
/**
* This class holds information about a state change of a Line.
+ * @specnote This class is not really serializable, and attempts to
+ * serialize it will throw {@link NotSerializableException}.
* @since 1.3
*/
public class LineEvent extends EventObject
{
+ // We define this even though this class can't be serialized, in
+ // order to placate the compiler.
+ private static final long serialVersionUID = -1274246333383880410L;
+
/**
* This class represents the kinds of state changes that can occur
* to a Line. The standard states are availabe as static instances.
@@ -147,4 +155,16 @@ public class LineEvent extends EventObject
return ("type=" + type + "; framePosition=" + framePosition
+ "line=" + line);
}
+
+ private void readObject(ObjectInputStream ois)
+ throws IOException
+ {
+ throw new NotSerializableException("LineEvent is not serializable");
+ }
+
+ private void writeObject(ObjectOutputStream oos)
+ throws IOException
+ {
+ throw new NotSerializableException("LineEvent is not serializable");
+ }
}