diff options
| author | 2012-11-28 12:18:14 -0800 | |
|---|---|---|
| committer | 2012-11-29 16:47:37 -0800 | |
| commit | f4e58051e22ad4e21c7cd436c37cc5665c194d1c (patch) | |
| tree | 595fd043c6e78d032ffb4225f69b4230e68b6077 | |
| parent | 3251d363139cbda760af27755f5685a14afe6655 (diff) | |
Simplify throw statements
Conventional throw statement syntax does not require parentheses
Change-Id: I9cb3e76d60d688d2e0b77a18674527a87548e297
| -rw-r--r-- | media/java/android/media/AudioTrack.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java index 694e9c273b87..9dd35edfd898 100644 --- a/media/java/android/media/AudioTrack.java +++ b/media/java/android/media/AudioTrack.java @@ -317,7 +317,7 @@ public class AudioTrack audioBuffSizeCheck(bufferSizeInBytes); if (sessionId < 0) { - throw (new IllegalArgumentException("Invalid audio session ID: "+sessionId)); + throw new IllegalArgumentException("Invalid audio session ID: "+sessionId); } int[] session = new int[1]; @@ -370,7 +370,7 @@ public class AudioTrack && (streamType != AudioManager.STREAM_NOTIFICATION) && (streamType != AudioManager.STREAM_BLUETOOTH_SCO) && (streamType != AudioManager.STREAM_DTMF)) { - throw (new IllegalArgumentException("Invalid stream type.")); + throw new IllegalArgumentException("Invalid stream type."); } else { mStreamType = streamType; } @@ -378,8 +378,8 @@ public class AudioTrack //-------------- // sample rate, note these values are subject to change if ( (sampleRateInHz < 4000) || (sampleRateInHz > 48000) ) { - throw (new IllegalArgumentException(sampleRateInHz - + "Hz is not a supported sample rate.")); + throw new IllegalArgumentException(sampleRateInHz + + "Hz is not a supported sample rate."); } else { mSampleRate = sampleRateInHz; } @@ -406,7 +406,7 @@ public class AudioTrack mChannelCount = 0; mChannels = AudioFormat.CHANNEL_INVALID; mChannelConfiguration = AudioFormat.CHANNEL_INVALID; - throw(new IllegalArgumentException("Unsupported channel configuration.")); + throw new IllegalArgumentException("Unsupported channel configuration."); } else { mChannels = channelConfig; mChannelCount = Integer.bitCount(channelConfig); @@ -425,14 +425,14 @@ public class AudioTrack break; default: mAudioFormat = AudioFormat.ENCODING_INVALID; - throw(new IllegalArgumentException("Unsupported sample encoding." - + " Should be ENCODING_PCM_8BIT or ENCODING_PCM_16BIT.")); + throw new IllegalArgumentException("Unsupported sample encoding." + + " Should be ENCODING_PCM_8BIT or ENCODING_PCM_16BIT."); } //-------------- // audio load mode if ( (mode != MODE_STREAM) && (mode != MODE_STATIC) ) { - throw(new IllegalArgumentException("Invalid mode.")); + throw new IllegalArgumentException("Invalid mode."); } else { mDataLoadMode = mode; } @@ -482,7 +482,7 @@ public class AudioTrack int frameSizeInBytes = mChannelCount * (mAudioFormat == AudioFormat.ENCODING_PCM_8BIT ? 1 : 2); if ((audioBufferSize % frameSizeInBytes != 0) || (audioBufferSize < 1)) { - throw (new IllegalArgumentException("Invalid audio buffer size.")); + throw new IllegalArgumentException("Invalid audio buffer size."); } mNativeBufferSizeInBytes = audioBufferSize; @@ -889,7 +889,7 @@ public class AudioTrack public void play() throws IllegalStateException { if (mState != STATE_INITIALIZED) { - throw(new IllegalStateException("play() called on uninitialized AudioTrack.")); + throw new IllegalStateException("play() called on uninitialized AudioTrack."); } synchronized(mPlayStateLock) { @@ -909,7 +909,7 @@ public class AudioTrack public void stop() throws IllegalStateException { if (mState != STATE_INITIALIZED) { - throw(new IllegalStateException("stop() called on uninitialized AudioTrack.")); + throw new IllegalStateException("stop() called on uninitialized AudioTrack."); } // stop playing @@ -929,7 +929,7 @@ public class AudioTrack public void pause() throws IllegalStateException { if (mState != STATE_INITIALIZED) { - throw(new IllegalStateException("pause() called on uninitialized AudioTrack.")); + throw new IllegalStateException("pause() called on uninitialized AudioTrack."); } //logd("pause()"); |