mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 00:57:31 -05:00
Removes assert() usage throughout project and replaces with Validate from apache commons.
This commit is contained in:
@@ -22,6 +22,7 @@ import java.util.BitSet;
|
||||
import java.util.logging.LogManager;
|
||||
|
||||
import edac.CRC;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
public class BinaryMessage extends BitSet
|
||||
{
|
||||
@@ -456,7 +457,7 @@ public class BinaryMessage extends BitSet
|
||||
*/
|
||||
public byte getByte(int index)
|
||||
{
|
||||
assert((index + 7) <= size());
|
||||
Validate.isTrue((index + 7) <= size());
|
||||
|
||||
int value = 0;
|
||||
|
||||
@@ -481,7 +482,7 @@ public class BinaryMessage extends BitSet
|
||||
*/
|
||||
public void setByte(int index, byte value)
|
||||
{
|
||||
assert((index + 8) <= size());
|
||||
Validate.isTrue((index + 8) <= size());
|
||||
|
||||
int mask = 0x80;
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
******************************************************************************/
|
||||
package bits;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -39,7 +41,7 @@ public class MultiSyncPatternMatcher
|
||||
|
||||
public MultiSyncPatternMatcher( int syncSize )
|
||||
{
|
||||
assert( syncSize < 64 );
|
||||
Validate.isTrue(syncSize < 64);
|
||||
|
||||
//Setup a bit mask of all ones the length of the sync pattern
|
||||
mMask = (long)( ( Math.pow( 2, syncSize ) ) - 1 );
|
||||
|
||||
Reference in New Issue
Block a user