changeset in /hg/icedtea: 2008-10-24 Omair Majid <omajid at redhat...

Omair Majid omajid at redhat.com
Wed Oct 29 11:29:42 PDT 2008


changeset ce6a731bd3b9 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=ce6a731bd3b9
description:
	2008-10-24  Omair Majid <omajid at redhat.com>

	       * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
	       (write): Check for offset being negative.
	       * pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java
	       (testMixerKnowsAboutOpenClips): Removed the assumption that mixer had no
	       other lines open.

diffstat:

3 files changed, 19 insertions(+), 6 deletions(-)
ChangeLog                                                                          |    8 +++++++
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java |    6 ++++-
pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java      |   11 +++++-----

diffs (54 lines):

diff -r b763518484a6 -r ce6a731bd3b9 ChangeLog
--- a/ChangeLog	Fri Oct 24 10:08:18 2008 -0400
+++ b/ChangeLog	Fri Oct 24 10:10:49 2008 -0400
@@ -1,3 +1,11 @@ 2008-10-24  Deepak Bhole  <dbhole at redhat
+2008-10-24  Omair Majid <omajid at redhat.com>
+
+	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
+	(write): Check for offset being negative.
+	* pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java
+	(testMixerKnowsAboutOpenClips): Removed the assumption that mixer had no
+	other lines open.
+
 2008-10-24  Deepak Bhole  <dbhole at redhat.com>
 
 	* plugin/icedtea/netscape/javascript/JSObject.java: Make long constructor
diff -r b763518484a6 -r ce6a731bd3b9 pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java	Fri Oct 24 10:08:18 2008 -0400
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java	Fri Oct 24 10:10:49 2008 -0400
@@ -153,8 +153,12 @@ public class PulseAudioSourceDataLine ex
 			throw new IllegalArgumentException("length is negative");
 		}
 
+		if (offset < 0) {
+			throw new ArrayIndexOutOfBoundsException("offset is negative: " + offset);
+		}
+		
 		if (length + offset > data.length) {
-			throw new ArrayIndexOutOfBoundsException(length + offset);
+			throw new ArrayIndexOutOfBoundsException("writing data beyond the length of the array: " + (length + offset));
 		}
 
 		int position = offset;
diff -r b763518484a6 -r ce6a731bd3b9 pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java
--- a/pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java	Fri Oct 24 10:08:18 2008 -0400
+++ b/pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java	Fri Oct 24 10:10:49 2008 -0400
@@ -605,12 +605,13 @@ public class PulseAudioClipTest {
 		AudioInputStream audioInputStream1 = AudioSystem
 				.getAudioInputStream(soundFile1);
 
-		Assert.assertEquals(0, mixer.getSourceLines().length);
+		int initiallyOpenClips = mixer.getSourceLines().length;
+		Assert.assertEquals(initiallyOpenClips, mixer.getSourceLines().length);
 		clip.open(audioInputStream1);
-		Assert.assertEquals(1, mixer.getSourceLines().length);
-		Assert.assertEquals(clip, mixer.getSourceLines()[0]);
-		clip.close();
-		Assert.assertEquals(0, mixer.getSourceLines().length);
+		Assert.assertEquals(initiallyOpenClips + 1, mixer.getSourceLines().length);
+		Assert.assertEquals(clip, mixer.getSourceLines()[initiallyOpenClips]);
+		clip.close();
+		Assert.assertEquals(initiallyOpenClips, mixer.getSourceLines().length);
 
 	}
 



More information about the distro-pkg-dev mailing list