United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6740210 : Update Gervill with more post 1.0 fixes

Details
Type:
Bug
Submit Date:
2008-08-22
Status:
Resolved
Updated Date:
2011-01-19
Project Name:
JDK
Resolved Date:
2008-08-25
Component:
client-libs
OS:
generic
Sub-Component:
javax.sound
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
OpenJDK6
Fixed Versions:
OpenJDK6 (b12)

Related Reports
Backport:
Relates:
Relates:
Relates:

Sub Tasks

Description
Since the previous update to Gervill was integrated (6717691), the CVS master has been changed.  Those changes should be incorporated too.

                                    

Comments
SUGGESTED FIX

Interal webrev at:
http://javaweb.sfbay/~darcy/Webrevs/6740210

Patch file:
--- old/src/share/classes/com/sun/media/sound/SoftMixingMixer.java	Thu Aug 21 21:06:18 2008
+++ new/src/share/classes/com/sun/media/sound/SoftMixingMixer.java	Thu Aug 21 21:06:18 2008
@@ -62,7 +62,7 @@
 
     protected static final String INFO_DESCRIPTION = "Software Sound Mixer";
 
-    protected static final String INFO_VERSION = "0.9";
+    protected static final String INFO_VERSION = "1.0";
 
     protected final static Mixer.Info info = new Info();
 
--- old/src/share/classes/com/sun/media/sound/ModelInstrument.java	Thu Aug 21 21:06:20 2008
+++ new/src/share/classes/com/sun/media/sound/ModelInstrument.java	Thu Aug 21 21:06:20 2008
@@ -88,10 +88,10 @@
     // This information is generated from ModelPerformer.getName()
     // returned from getPerformers().
     public String[] getKeys() {
-        String[] keys = new String[127];
+        String[] keys = new String[128];
         for (ModelPerformer performer : getPerformers()) {
             for (int k = performer.getKeyFrom(); k <= performer.getKeyTo(); k++) {
-                if (keys[k] == null) {
+                if (k >= 0 && k < 128 && keys[k] == null) {
                     String name = performer.getName();
                     if (name == null)
                         name = "untitled";
--- old/src/share/classes/com/sun/media/sound/ModelByteBuffer.java	Thu Aug 21 21:06:21 2008
+++ new/src/share/classes/com/sun/media/sound/ModelByteBuffer.java	Thu Aug 21 21:06:21 2008
@@ -45,7 +45,7 @@
     private long fileoffset;
     private byte[] buffer;
     private long offset;
-    private long len;
+    private final long len;
 
     private class RandomFileInputStream extends InputStream {
 
@@ -107,11 +107,12 @@
         }
 
         public int read(byte[] b) throws IOException {
+            int len = b.length;
             if (len > left)
                 len = (int)left;
             if (left == 0)
                 return -1;
-            int len = raf.read(b);
+            len = raf.read(b, 0, len);
             if (len == -1)
                 return -1;
             left -= len;
@@ -119,12 +120,12 @@
         }
 
         public int read() throws IOException {
-            if (len == 0)
+            if (left == 0)
                 return -1;
             int b = raf.read();
             if (b == -1)
                 return -1;
-            len--;
+            left--;
             return b;
         }
 
@@ -137,15 +138,15 @@
             long beginIndex, long endIndex, boolean independent) {
         this.root = parent.root;
         this.offset = 0;
-        this.len = parent.len;
+        long parent_len = parent.len;
         if (beginIndex < 0)
             beginIndex = 0;
-        if (beginIndex > len)
-            beginIndex = len;
+        if (beginIndex > parent_len)
+            beginIndex = parent_len;
         if (endIndex < 0)
             endIndex = 0;
-        if (endIndex > len)
-            endIndex = len;
+        if (endIndex > parent_len)
+            endIndex = parent_len;
         if (beginIndex > endIndex)
             beginIndex = endIndex;
         offset = beginIndex;
                                     
2008-08-25
EVALUATION

Yes.
                                     
2008-08-22



Hardware and Software, Engineered to Work Together