mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 17:17:29 -05:00
Removes assert() usage throughout project and replaces with Validate from apache commons.
This commit is contained in:
@@ -21,6 +21,7 @@ package audio.broadcast.shoutcast.v2;
|
||||
import audio.broadcast.BroadcastConfiguration;
|
||||
import audio.broadcast.BroadcastFormat;
|
||||
import audio.broadcast.BroadcastServerType;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@@ -90,7 +91,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration
|
||||
*/
|
||||
public void setStreamID(int streamID)
|
||||
{
|
||||
assert(1 <= streamID && streamID <= Integer.MAX_VALUE);
|
||||
Validate.isTrue(1 <= streamID && streamID <= Integer.MAX_VALUE);
|
||||
mStreamID = streamID;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
******************************************************************************/
|
||||
package audio.broadcast.shoutcast.v2.ultravox;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
public class NegotiateMaxPayloadSize extends UltravoxMessage
|
||||
{
|
||||
/**
|
||||
@@ -47,8 +49,8 @@ public class NegotiateMaxPayloadSize extends UltravoxMessage
|
||||
*/
|
||||
public void setMaximumPayloadSize(int desiredMaximum, int minimum)
|
||||
{
|
||||
assert(desiredMaximum <= 16377);
|
||||
assert(minimum <= 16377);
|
||||
Validate.isTrue(desiredMaximum <= 16377);
|
||||
Validate.isTrue(minimum <= 16377);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(desiredMaximum).append(":").append(minimum);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package audio.broadcast.shoutcast.v2.ultravox;
|
||||
|
||||
import bits.BinaryMessage;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -154,7 +155,7 @@ public abstract class UltravoxMessage
|
||||
*/
|
||||
public void setSendQueuePriority(int priority)
|
||||
{
|
||||
assert(0 <= priority && priority <= 7);
|
||||
Validate.isTrue(0 <= priority && priority <= 7);
|
||||
|
||||
mMessage.setInt(priority, SEND_QUEUE_PRIORITY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user