Removes assert() usage throughout project and replaces with Validate from apache commons.

This commit is contained in:
Denny
2017-02-25 16:03:35 -05:00
parent a4a339b505
commit d9cf1b19f3
22 changed files with 55 additions and 27 deletions

View File

@@ -18,6 +18,7 @@
******************************************************************************/
package record.wave;
import org.apache.commons.lang3.Validate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sample.ConversionUtils;
@@ -58,7 +59,7 @@ public class MonoWaveReader implements AutoCloseable
*/
public MonoWaveReader(Path path, boolean realTime) throws IOException
{
assert( path != null );
Validate.isTrue(path != null);
mPath = path;
mRealTime = realTime;

View File

@@ -17,6 +17,8 @@
******************************************************************************/
package record.wave;
import org.apache.commons.lang3.Validate;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
@@ -59,8 +61,8 @@ public class WaveWriter implements AutoCloseable
public WaveWriter( AudioFormat format, Path file, long maxSize )
throws IOException
{
assert( format != null );
assert( file != null );
Validate.isTrue(format != null);
Validate.isTrue( file != null );
mAudioFormat = format;
mFile = file;