< prev index next >

src/java.desktop/share/classes/javax/sound/midi/Track.java

Print this page

        

@@ -63,16 +63,16 @@
 public class Track {
 
     // TODO: use arrays for faster access
 
     // the list containing the events
-    private ArrayList<MidiEvent> eventsList = new ArrayList<>();
+    private final ArrayList<MidiEvent> eventsList = new ArrayList<>();
 
     // use a hashset to detect duplicate events in add(MidiEvent)
-    private HashSet<MidiEvent> set = new HashSet<>();
+    private final HashSet<MidiEvent> set = new HashSet<>();
 
-    private MidiEvent eotEvent;
+    private final MidiEvent eotEvent;
 
     /**
      * Package-private constructor. Constructs a new, empty Track object, which
      * initially contains one event, the meta-event End of Track.
      */

@@ -262,10 +262,11 @@
             data[0] = (byte) META;
             data[1] = MidiUtils.META_END_OF_TRACK_TYPE;
             data[2] = 0;
         }
 
+        @Override
         public void setMessage(int type, byte[] data, int length) throws InvalidMidiDataException {
             throw new InvalidMidiDataException("cannot modify end of track message");
         }
     }
 }
< prev index next >