directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1689269 - in /directory/shared/trunk/asn1: api/src/main/java/org/apache/directory/api/asn1/util/ api/src/test/java/org/apache/directory/api/asn1/util/ ber/src/main/java/org/apache/directory/api/asn1/ber/ ber/src/main/java/org/apache/direct...
Date Sun, 05 Jul 2015 18:38:33 GMT
Author: seelmann
Date: Sun Jul  5 18:38:32 2015
New Revision: 1689269

URL: http://svn.apache.org/r1689269
Log:
Fix checkstyle violations

Modified:
    directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Asn1StringUtils.java
    directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/BitString.java
    directory/shared/trunk/asn1/api/src/test/java/org/apache/directory/api/asn1/util/BitStringTest.java
    directory/shared/trunk/asn1/api/src/test/java/org/apache/directory/api/asn1/util/OidTest.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BerValue.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BooleanDecoder.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/IntegerDecoder.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/LongDecoder.java
    directory/shared/trunk/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/LengthTest.java
    directory/shared/trunk/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/ValueTest.java

Modified: directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Asn1StringUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Asn1StringUtils.java?rev=1689269&r1=1689268&r2=1689269&view=diff
==============================================================================
--- directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Asn1StringUtils.java
(original)
+++ directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Asn1StringUtils.java
Sun Jul  5 18:38:32 2015
@@ -41,6 +41,10 @@ public final class Asn1StringUtils
         {};
 
 
+    private Asn1StringUtils()
+    {
+    }
+
     /**
      * Helper function that dump a byte in hex form
      *

Modified: directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/BitString.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/BitString.java?rev=1689269&r1=1689268&r2=1689269&view=diff
==============================================================================
--- directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/BitString.java
(original)
+++ directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/BitString.java
Sun Jul  5 18:38:32 2015
@@ -100,26 +100,26 @@ public class BitString
      * Set a new BitString in the BitString. It will replace the old BitString,
      * and reset the current length with the new one.
      *
-     * @param bytes The string to store
+     * @param data The string to store
      */
-    public void setData( byte[] bytes )
+    public void setData( byte[] data )
     {
-        if ( ( bytes == null ) || ( bytes.length == 0 ) )
+        if ( ( data == null ) || ( data.length == 0 ) )
         {
             nbBits = -1;
             return;
         }
 
         // The first byte contains the number of unused bits
-        nbUnusedBits = bytes[0] & 0x07;
-        nbBytes = bytes.length - 1;
+        nbUnusedBits = data[0] & 0x07;
+        nbBytes = data.length - 1;
         nbBits = ( nbBytes * 8 ) - nbUnusedBits;
         this.bytes = new byte[nbBytes];
 
         // We have to transfer the data
         for ( int i = 0; i < nbBytes; i++ )
         {
-            this.bytes[i] = bytes[i + 1];
+            this.bytes[i] = data[i + 1];
         }
     }
 

Modified: directory/shared/trunk/asn1/api/src/test/java/org/apache/directory/api/asn1/util/BitStringTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/api/src/test/java/org/apache/directory/api/asn1/util/BitStringTest.java?rev=1689269&r1=1689268&r2=1689269&view=diff
==============================================================================
--- directory/shared/trunk/asn1/api/src/test/java/org/apache/directory/api/asn1/util/BitStringTest.java
(original)
+++ directory/shared/trunk/asn1/api/src/test/java/org/apache/directory/api/asn1/util/BitStringTest.java
Sun Jul  5 18:38:32 2015
@@ -25,8 +25,6 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 
 import org.apache.directory.api.asn1.DecoderException;
-import org.apache.directory.api.asn1.util.Asn1StringUtils;
-import org.apache.directory.api.asn1.util.BitString;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 

Modified: directory/shared/trunk/asn1/api/src/test/java/org/apache/directory/api/asn1/util/OidTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/api/src/test/java/org/apache/directory/api/asn1/util/OidTest.java?rev=1689269&r1=1689268&r2=1689269&view=diff
==============================================================================
--- directory/shared/trunk/asn1/api/src/test/java/org/apache/directory/api/asn1/util/OidTest.java
(original)
+++ directory/shared/trunk/asn1/api/src/test/java/org/apache/directory/api/asn1/util/OidTest.java
Sun Jul  5 18:38:32 2015
@@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
 
 public class OidTest
 {
-    private static final Logger logger = LoggerFactory.getLogger( OidTest.class );
+    private static final Logger LOGGER = LoggerFactory.getLogger( OidTest.class );
 
 
     @Test
@@ -50,14 +50,14 @@ public class OidTest
         {
             Arrays.equals( bytes, bytes );
         }
-        logger.debug( "byte[]: {}", ( System.nanoTime() - start ) );
+        LOGGER.debug( "byte[]: {}", ( System.nanoTime() - start ) );
 
         start = System.nanoTime();
         for ( int i = 0; i < 1000; i++ )
         {
             string.equals( string );
         }
-        logger.debug( "String: {}", ( System.nanoTime() - start ) );
+        LOGGER.debug( "String: {}", ( System.nanoTime() - start ) );
     }
 
 
@@ -96,16 +96,16 @@ public class OidTest
         byte[] expectedBytes = new byte[]
             { ( byte ) 0x87, ( byte ) 0xC5, 0x10 };
 
-        logger.debug( "b_to_b: " + Arrays.toString( Oid.fromBytes( expectedBytes ).toBytes()
) );
+        LOGGER.debug( "b_to_b: " + Arrays.toString( Oid.fromBytes( expectedBytes ).toBytes()
) );
         assertTrue( Arrays.equals( expectedBytes, Oid.fromBytes( expectedBytes ).toBytes()
) );
 
-        logger.debug( "s_to_b: " + Arrays.toString( Oid.fromString( expectedString ).toBytes()
) );
+        LOGGER.debug( "s_to_b: " + Arrays.toString( Oid.fromString( expectedString ).toBytes()
) );
         assertTrue( Arrays.equals( expectedBytes, Oid.fromString( expectedString ).toBytes()
) );
 
-        logger.debug( "b_to_s: " + Oid.fromBytes( expectedBytes ).toString() );
+        LOGGER.debug( "b_to_s: " + Oid.fromBytes( expectedBytes ).toString() );
         assertEquals( expectedString, Oid.fromBytes( expectedBytes ).toString() );
 
-        logger.debug( "s_to_s: " + Oid.fromString( expectedString ).toString() );
+        LOGGER.debug( "s_to_s: " + Oid.fromString( expectedString ).toString() );
         assertEquals( expectedString, Oid.fromString( expectedString ).toString() );
     }
 

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java?rev=1689269&r1=1689268&r2=1689269&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java
Sun Jul  5 18:38:32 2015
@@ -69,7 +69,7 @@ public abstract class AbstractContainer
 
     /** A flag telling if the Value should be accumulated before being decoded
      * for constructed types */
-    private boolean isGathering = false;
+    private boolean gathering = false;
 
 
     /**
@@ -334,16 +334,16 @@ public abstract class AbstractContainer
      */
     public boolean isGathering()
     {
-        return isGathering;
+        return gathering;
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public void setGathering( boolean isGathering )
+    public void setGathering( boolean gathering )
     {
-        this.isGathering = isGathering;
+        this.gathering = gathering;
     }
 
 }

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BerValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BerValue.java?rev=1689269&r1=1689268&r2=1689269&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BerValue.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BerValue.java
Sun Jul  5 18:38:32 2015
@@ -151,8 +151,8 @@ public class BerValue
      *
      * @return Returns the data.
      */
-    @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="EI_EXPOSE_REP",
-            justification="The return of the direct value (without cloning) was intended.
Even if we modify the interned value, it won't have any impact")
+    @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "EI_EXPOSE_REP",
+            justification = "The return of the direct value (without cloning) was intended.
Even if we modify the interned value, it won't have any impact")
     public byte[] getData()
     {
         return data;

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BooleanDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BooleanDecoder.java?rev=1689269&r1=1689268&r2=1689269&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BooleanDecoder.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BooleanDecoder.java
Sun Jul  5 18:38:32 2015
@@ -37,6 +37,10 @@ public final class BooleanDecoder
     private static final Logger LOG = LoggerFactory.getLogger( BooleanDecoder.class );
 
 
+    private BooleanDecoder()
+    {
+    }
+
     /**
      * Parse a Value containing a byte[] and send back a boolean.
      *

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/IntegerDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/IntegerDecoder.java?rev=1689269&r1=1689268&r2=1689269&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/IntegerDecoder.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/IntegerDecoder.java
Sun Jul  5 18:38:32 2015
@@ -36,6 +36,11 @@ public final class IntegerDecoder
         { 0x000000FF, 0x0000FFFF, 0x00FFFFFF, 0xFFFFFFFF };
 
 
+    private IntegerDecoder()
+    {
+    }
+
+
     /**
      * Parse a byte buffer and send back an integer, controlling that this number
      * is in a specified interval.

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/LongDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/LongDecoder.java?rev=1689269&r1=1689268&r2=1689269&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/LongDecoder.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/LongDecoder.java
Sun Jul  5 18:38:32 2015
@@ -36,6 +36,11 @@ public final class LongDecoder
             0x0000FFFFFFFFFFFFL, 0x00FFFFFFFFFFFFFFL, 0xFFFFFFFFFFFFFFFFL };
 
 
+    private LongDecoder()
+    {
+    }
+
+
     /**
      * Parse a byte buffer and send back an long, controlling that this number
      * is in a specified interval.

Modified: directory/shared/trunk/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/LengthTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/LengthTest.java?rev=1689269&r1=1689268&r2=1689269&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/LengthTest.java
(original)
+++ directory/shared/trunk/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/LengthTest.java
Sun Jul  5 18:38:32 2015
@@ -25,7 +25,6 @@ import static org.junit.Assert.assertTru
 
 import java.util.Arrays;
 
-import org.apache.directory.api.asn1.ber.tlv.TLV;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 

Modified: directory/shared/trunk/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/ValueTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/ValueTest.java?rev=1689269&r1=1689268&r2=1689269&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/ValueTest.java
(original)
+++ directory/shared/trunk/asn1/ber/src/test/java/org/apache/directory/api/asn1/ber/tlv/ValueTest.java
Sun Jul  5 18:38:32 2015
@@ -29,9 +29,6 @@ import java.nio.ByteBuffer;
 import java.util.Arrays;
 
 import org.apache.directory.api.asn1.EncoderException;
-import org.apache.directory.api.asn1.ber.tlv.BerValue;
-import org.apache.directory.api.asn1.ber.tlv.IntegerDecoder;
-import org.apache.directory.api.asn1.ber.tlv.LongDecoder;
 import org.apache.directory.api.asn1.util.Asn1StringUtils;
 import org.apache.directory.api.asn1.util.BitString;
 import org.junit.Test;
@@ -123,19 +120,19 @@ public class ValueTest
                  { 0x7F },
                  
                  // 2 bytes
-                 { 0x00, (byte)0x80 }, 
-                 { 0x00, (byte)0x81 }, 
-                 { 0x7F, (byte)0xFF },
+                { 0x00, ( byte ) 0x80 },
+                { 0x00, ( byte ) 0x81 },
+                { 0x7F, ( byte ) 0xFF },
 
                  // 3 bytes
-                 { 0x00, (byte)0x80, 0x00 },
-                 { 0x00, (byte)0x80, 0x01 },
-                 { 0x7F, (byte)0xFF, (byte)0xFF },
+                { 0x00, ( byte ) 0x80, 0x00 },
+                { 0x00, ( byte ) 0x80, 0x01 },
+                { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF },
 
                  // 4 bytes
-                 { 0x00, (byte)0x80, 0x00, 0x00 },
-                 { 0x00, (byte)0x80, 0x00, 0x01 },
-                 { 0x7F, (byte)0xFF, (byte)0xFF, (byte)0xFF },
+                { 0x00, ( byte ) 0x80, 0x00, 0x00 },
+                { 0x00, ( byte ) 0x80, 0x00, 0x01 },
+                { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF }
              };
 
          int[] negativeValues = new int[]
@@ -156,33 +153,33 @@ public class ValueTest
          byte[][] expectedNegativeBytes = new byte[][]
              {
                  // 1 byte
-                 { (byte)0xFF },
-                 { (byte)0x81 }, 
-                 { (byte)0x80 }, 
+                { ( byte ) 0xFF },
+                { ( byte ) 0x81 },
+                { ( byte ) 0x80 },
      
                  // 2 bytes
-                 { (byte)0xFF, 0x7F }, 
-                 { (byte)0xFF, 0x01 }, 
-                 { (byte)0xFF, 0x00 }, 
-                 { (byte)0xFE, (byte)0xFF }, 
-                 { (byte)0x80, 0x01 }, 
-                 { (byte)0x80, 0x00 }, 
+                { ( byte ) 0xFF, 0x7F },
+                { ( byte ) 0xFF, 0x01 },
+                { ( byte ) 0xFF, 0x00 },
+                { ( byte ) 0xFE, ( byte ) 0xFF },
+                { ( byte ) 0x80, 0x01 },
+                { ( byte ) 0x80, 0x00 },
      
                  // 3 bytes
-                 { (byte)0xFF, 0x7F, (byte)0xFF }, 
-                 { (byte)0xFF, 0x00, 0x01 },
-                 { (byte)0xFF, 0x00, 0x00 },
-                 { (byte)0xFE, (byte)0xFF, (byte)0xFF },
-                 { (byte)0x80, 0x00, 0x01 },
-                 { (byte)0x80, 0x00, 0x00 },
+                { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF },
+                { ( byte ) 0xFF, 0x00, 0x01 },
+                { ( byte ) 0xFF, 0x00, 0x00 },
+                { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF },
+                { ( byte ) 0x80, 0x00, 0x01 },
+                { ( byte ) 0x80, 0x00, 0x00 },
      
                  // 4 bytes
-                 { (byte)0xFF, 0x7F, (byte)0xFF, (byte)0xFF },
-                 { (byte)0xFF, 0x00, 0x00, 0x01 },
-                 { (byte)0xFF, 0x00, 0x00, 0x00 },
-                 { (byte)0xFE, (byte)0xFF, (byte)0xFF, (byte)0xFF },
-                 { (byte)0x80, 0x00, 0x00, 0x01 },
-                 { (byte)0x80, 0x00, 0x00, 0x00 },
+                { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF },
+                { ( byte ) 0xFF, 0x00, 0x00, 0x01 },
+                { ( byte ) 0xFF, 0x00, 0x00, 0x00 },
+                { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF },
+                { ( byte ) 0x80, 0x00, 0x00, 0x01 },
+                { ( byte ) 0x80, 0x00, 0x00, 0x00 }
              };
 
          int i = 0;
@@ -195,7 +192,7 @@ public class ValueTest
              i++;
          }
          
-         i=0;
+        i = 0;
          
          for ( int value:negativeValues )
          {
@@ -220,29 +217,29 @@ public class ValueTest
         bb = BerValue.getBytes( 0x00000080 );
         assertEquals( 2, bb.length );
         assertEquals( 0x00, bb[0] );
-        assertEquals( (byte)0x80, bb[1] );
+        assertEquals( ( byte ) 0x80, bb[1] );
 
         bb = BerValue.getBytes( 0x000000FF );
         assertEquals( 2, bb.length );
         assertEquals( 0x00, bb[0] );
-        assertEquals( (byte)0xFF, bb[1] );
+        assertEquals( ( byte ) 0xFF, bb[1] );
 
         bb = BerValue.getBytes( 0x00007FFF );
         assertEquals( 2, bb.length );
         assertEquals( 0x7F, bb[0] );
-        assertEquals( (byte)0xFF, bb[1] );
+        assertEquals( ( byte ) 0xFF, bb[1] );
 
         bb = BerValue.getBytes( 0x00008000 );
         assertEquals( 3, bb.length );
         assertEquals( 0x00, bb[0] );
-        assertEquals( (byte)0x80, bb[1] );
+        assertEquals( ( byte ) 0x80, bb[1] );
         assertEquals( 0x00, bb[2] );
 
         bb = BerValue.getBytes( 0x0000FFFF );
         assertEquals( 3, bb.length );
         assertEquals( 0x00, bb[0] );
-        assertEquals( (byte)0xFF, bb[1] );
-        assertEquals( (byte)0xFF, bb[2] );
+        assertEquals( ( byte ) 0xFF, bb[1] );
+        assertEquals( ( byte ) 0xFF, bb[2] );
 
         bb = BerValue.getBytes( 0x00010000 );
         assertEquals( 3, bb.length );
@@ -253,22 +250,22 @@ public class ValueTest
         bb = BerValue.getBytes( 0x007FFFFF );
         assertEquals( 3, bb.length );
         assertEquals( 0x7F, bb[0] );
-        assertEquals( (byte)0xFF, bb[1] );
-        assertEquals( (byte)0xFF, bb[2] );
+        assertEquals( ( byte ) 0xFF, bb[1] );
+        assertEquals( ( byte ) 0xFF, bb[2] );
 
         bb = BerValue.getBytes( 0x00800000 );
         assertEquals( 4, bb.length );
         assertEquals( 0x00, bb[0] );
-        assertEquals( (byte)0x80, bb[1] );
+        assertEquals( ( byte ) 0x80, bb[1] );
         assertEquals( 0x00, bb[2] );
         assertEquals( 0x00, bb[3] );
 
         bb = BerValue.getBytes( 0x00FFFFFF );
         assertEquals( 4, bb.length );
         assertEquals( 0x00, bb[0] );
-        assertEquals( (byte)0xFF, bb[1] );
-        assertEquals( (byte)0xFF, bb[2] );
-        assertEquals( (byte)0xFF, bb[3] );
+        assertEquals( ( byte ) 0xFF, bb[1] );
+        assertEquals( ( byte ) 0xFF, bb[2] );
+        assertEquals( ( byte ) 0xFF, bb[3] );
 
         bb = BerValue.getBytes( 0x01000000 );
         assertEquals( 4, bb.length );
@@ -280,75 +277,75 @@ public class ValueTest
         bb = BerValue.getBytes( 0x7FFFFFFF );
         assertEquals( 4, bb.length );
         assertEquals( 0x7F, bb[0] );
-        assertEquals( (byte)0xFF, bb[1] );
-        assertEquals( (byte)0xFF, bb[2] );
-        assertEquals( (byte)0xFF, bb[3] );
+        assertEquals( ( byte ) 0xFF, bb[1] );
+        assertEquals( ( byte ) 0xFF, bb[2] );
+        assertEquals( ( byte ) 0xFF, bb[3] );
 
         bb = BerValue.getBytes( 0x80000000 );
         assertEquals( 4, bb.length );
-        assertEquals( (byte)0x80, bb[0] );
-        assertEquals( (byte)0x00, bb[1] );
-        assertEquals( (byte)0x00, bb[2] );
-        assertEquals( (byte)0x00, bb[3] );
+        assertEquals( ( byte ) 0x80, bb[0] );
+        assertEquals( ( byte ) 0x00, bb[1] );
+        assertEquals( ( byte ) 0x00, bb[2] );
+        assertEquals( ( byte ) 0x00, bb[3] );
         
         bb = BerValue.getBytes( 0xFFFFFFFF );
         assertEquals( 1, bb.length );
-        assertEquals( (byte)0xFF, bb[0] );
+        assertEquals( ( byte ) 0xFF, bb[0] );
         
         bb = BerValue.getBytes( 0xFFFFFF80 );
         assertEquals( 1, bb.length );
-        assertEquals( (byte)0x80, bb[0] );
+        assertEquals( ( byte ) 0x80, bb[0] );
 
         bb = BerValue.getBytes( 0xFFFFFF7F );
         assertEquals( 2, bb.length );
-        assertEquals( (byte)0xFF, bb[0] );
+        assertEquals( ( byte ) 0xFF, bb[0] );
         assertEquals( 0x7F, bb[1] );
 
         bb = BerValue.getBytes( 0xFFFFFF00 );
         assertEquals( 2, bb.length );
-        assertEquals( (byte)0xFF, bb[0] );
+        assertEquals( ( byte ) 0xFF, bb[0] );
         assertEquals( 0x00, bb[1] );
 
         bb = BerValue.getBytes( 0xFFFF8000 );
         assertEquals( 2, bb.length );
-        assertEquals( (byte)0x80, bb[0] );
+        assertEquals( ( byte ) 0x80, bb[0] );
         assertEquals( 0x00, bb[1] );
 
         bb = BerValue.getBytes( 0xFFFF7FFF );
         assertEquals( 3, bb.length );
-        assertEquals( (byte)0xFF, bb[0] );
+        assertEquals( ( byte ) 0xFF, bb[0] );
         assertEquals( 0x7F, bb[1] );
-        assertEquals( (byte)0xFF, bb[2] );
+        assertEquals( ( byte ) 0xFF, bb[2] );
 
         bb = BerValue.getBytes( 0xFFFF0000 );
         assertEquals( 3, bb.length );
-        assertEquals( (byte)0xFF, bb[0] );
+        assertEquals( ( byte ) 0xFF, bb[0] );
         assertEquals( 0x00, bb[1] );
         assertEquals( 0x00, bb[2] );
 
         bb = BerValue.getBytes( 0xFF800000 );
         assertEquals( 3, bb.length );
-        assertEquals( (byte)0x80, bb[0] );
+        assertEquals( ( byte ) 0x80, bb[0] );
         assertEquals( 0x00, bb[1] );
         assertEquals( 0x00, bb[2] );
 
         bb = BerValue.getBytes( 0xFF7FFFFF );
         assertEquals( 4, bb.length );
-        assertEquals( (byte)0xFF, bb[0] );
+        assertEquals( ( byte ) 0xFF, bb[0] );
         assertEquals( 0x7F, bb[1] );
-        assertEquals( (byte)0xFF, bb[2] );
-        assertEquals( (byte)0xFF, bb[3] );
+        assertEquals( ( byte ) 0xFF, bb[2] );
+        assertEquals( ( byte ) 0xFF, bb[3] );
 
         bb = BerValue.getBytes( 0xFF000000 );
         assertEquals( 4, bb.length );
-        assertEquals( (byte)0xFF, bb[0] );
+        assertEquals( ( byte ) 0xFF, bb[0] );
         assertEquals( 0x00, bb[1] );
         assertEquals( 0x00, bb[2] );
         assertEquals( 0x00, bb[3] );
 
         bb = BerValue.getBytes( 0x80000000 );
         assertEquals( 4, bb.length );
-        assertEquals( (byte)0x80, bb[0] );
+        assertEquals( ( byte ) 0x80, bb[0] );
         assertEquals( 0x00, bb[1] );
         assertEquals( 0x00, bb[2] );
         assertEquals( 0x00, bb[3] );
@@ -382,39 +379,40 @@ public class ValueTest
                 { 0x7F },
                 
                 // 2 bytes
-                { 0x00, (byte)0x80 }, 
-                { 0x00, (byte)0x81 }, 
-                { 0x7F, (byte)0xFF },
+                { 0x00, ( byte ) 0x80 },
+                { 0x00, ( byte ) 0x81 },
+                { 0x7F, ( byte ) 0xFF },
 
                 // 3 bytes
-                { 0x00, (byte)0x80, 0x00 },
-                { 0x00, (byte)0x80, 0x01 },
-                { 0x7F, (byte)0xFF, (byte)0xFF },
+                { 0x00, ( byte ) 0x80, 0x00 },
+                { 0x00, ( byte ) 0x80, 0x01 },
+                { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF },
 
                 // 4 bytes
-                { 0x00, (byte)0x80, 0x00, 0x00 },
-                { 0x00, (byte)0x80, 0x00, 0x01 },
-                { 0x7F, (byte)0xFF, (byte)0xFF, (byte)0xFF },
+                { 0x00, ( byte ) 0x80, 0x00, 0x00 },
+                { 0x00, ( byte ) 0x80, 0x00, 0x01 },
+                { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF },
 
                 // 5 bytes
-                { 0x00, (byte)0x80, 0x00, 0x00, 0x00 },
-                { 0x00, (byte)0x80, 0x00, 0x00, 0x01 },
-                { 0x7F, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF },
+                { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00 },
+                { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x01 },
+                { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF },
 
                 // 6 bytes
-                { 0x00, (byte)0x80, 0x00, 0x00, 0x00, 0x00 },
-                { 0x00, (byte)0x80, 0x00, 0x00, 0x00, 0x01 },
-                { 0x7F, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF },
+                { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00 },
+                { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00, 0x01 },
+                { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte
) 0xFF },
 
                 // 7 bytes
-                { 0x00, (byte)0x80, 0x00, 0x00, 0x00, 0x00, 0x00 },
-                { 0x00, (byte)0x80, 0x00, 0x00, 0x00, 0x00, 0x01 },
-                { 0x7F, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF
},
+                { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00 },
+                { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x01 },
+                { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte
) 0xFF, ( byte ) 0xFF },
 
                 // 8 bytes
-                { 0x00, (byte)0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 
-                { 0x00, (byte)0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, 
-                { 0x7F, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF,
(byte)0xFF }
+                { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+                { 0x00, ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
+                { 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte
) 0xFF, ( byte ) 0xFF,
+                    ( byte ) 0xFF }
             };
 
         long[] negativeValues = new long[]
@@ -450,67 +448,70 @@ public class ValueTest
         byte[][] expectedNegativeBytes = new byte[][]
             {
                 // 1 byte
-                { (byte)0xFF },
-                { (byte)0x81 }, 
-                { (byte)0x80 }, 
+                { ( byte ) 0xFF },
+                { ( byte ) 0x81 },
+                { ( byte ) 0x80 },
     
                 // 2 bytes
-                { (byte)0xFF, 0x7F }, 
-                { (byte)0xFF, 0x01 }, 
-                { (byte)0xFF, 0x00 }, 
-                { (byte)0xFE, (byte)0xFF }, 
-                { (byte)0x80, 0x01 }, 
-                { (byte)0x80, 0x00 }, 
+                { ( byte ) 0xFF, 0x7F },
+                { ( byte ) 0xFF, 0x01 },
+                { ( byte ) 0xFF, 0x00 },
+                { ( byte ) 0xFE, ( byte ) 0xFF },
+                { ( byte ) 0x80, 0x01 },
+                { ( byte ) 0x80, 0x00 },
     
                 // 3 bytes
-                { (byte)0xFF, 0x7F, (byte)0xFF }, 
-                { (byte)0xFF, 0x00, 0x01 },
-                { (byte)0xFF, 0x00, 0x00 },
-                { (byte)0xFE, (byte)0xFF, (byte)0xFF },
-                { (byte)0x80, 0x00, 0x01 },
-                { (byte)0x80, 0x00, 0x00 },
+                { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF },
+                { ( byte ) 0xFF, 0x00, 0x01 },
+                { ( byte ) 0xFF, 0x00, 0x00 },
+                { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF },
+                { ( byte ) 0x80, 0x00, 0x01 },
+                { ( byte ) 0x80, 0x00, 0x00 },
     
                 // 4 bytes
-                { (byte)0xFF, 0x7F, (byte)0xFF, (byte)0xFF },
-                { (byte)0xFF, 0x00, 0x00, 0x01 },
-                { (byte)0xFF, 0x00, 0x00, 0x00 },
-                { (byte)0xFE, (byte)0xFF, (byte)0xFF, (byte)0xFF },
-                { (byte)0x80, 0x00, 0x00, 0x01 },
-                { (byte)0x80, 0x00, 0x00, 0x00 },
+                { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF },
+                { ( byte ) 0xFF, 0x00, 0x00, 0x01 },
+                { ( byte ) 0xFF, 0x00, 0x00, 0x00 },
+                { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF },
+                { ( byte ) 0x80, 0x00, 0x00, 0x01 },
+                { ( byte ) 0x80, 0x00, 0x00, 0x00 },
     
                 // 5 bytes
-                { (byte)0xFF, 0x7F, (byte)0xFF, (byte)0xFF, (byte)0xFF },
-                { (byte)0xFF, 0x00, 0x00, 0x00, 0x01 },
-                { (byte)0xFF, 0x00, 0x00, 0x00, 0x00 },
-                { (byte)0xFE, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF },
-                { (byte)0x80, 0x00, 0x00, 0x00, 0x01 },
-                { (byte)0x80, 0x00, 0x00, 0x00, 0x00 },
+                { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF },
+                { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x01 },
+                { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00 },
+                { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF
},
+                { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x01 },
+                { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00 },
     
                 // 6 bytes
-                { (byte)0xFF, 0x7F, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF },
-                { (byte)0xFF, 0x00, 0x00, 0x00, 0x00, 0x01 },
-                { (byte)0xFF, 0x00, 0x00, 0x00, 0x00, 0x00 },
-                { (byte)0xFE, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF
},
-                { (byte)0x80, 0x00, 0x00, 0x00, 0x00, 0x01 },
-                { (byte)0x80, 0x00, 0x00, 0x00, 0x00, 0x00 },
+                { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte
) 0xFF },
+                { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x01 },
+                { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00 },
+                { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,
( byte ) 0xFF },
+                { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x01 },
+                { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00 },
     
                 // 7 bytes
-                { (byte)0xFF, 0x7F, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF
},
-                { (byte)0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
-                { (byte)0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
-                { (byte)0xFE, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF,
(byte)0xFF },
-                { (byte)0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
-                { (byte)0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+                { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte
) 0xFF, ( byte ) 0xFF },
+                { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
+                { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+                { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,
( byte ) 0xFF,
+                    ( byte ) 0xFF },
+                { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
+                { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
     
                 // 8 bytes
-                { (byte)0xFF, 0x7F, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF,
(byte)0xFF },
-                { (byte)0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
-                { (byte)0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
-                { (byte)0xFE, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF,
(byte)0xFF, (byte)0xFF },
-                { (byte)0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
-                { (byte)0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
+                { ( byte ) 0xFF, 0x7F, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte
) 0xFF, ( byte ) 0xFF,
+                    ( byte ) 0xFF },
+                { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
+                { ( byte ) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+                { ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,
( byte ) 0xFF,
+                    ( byte ) 0xFF, ( byte ) 0xFF },
+                { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
+                { ( byte ) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
             };
-                                                    
+
         int i = 0;
         
         for ( long value:positiveValues )
@@ -521,7 +522,7 @@ public class ValueTest
             i++;
         }
         
-        i=0;
+        i = 0;
         
         for ( long value:negativeValues )
         {
@@ -755,14 +756,15 @@ public class ValueTest
     @Test
     public void testNewByteArrayValue()
     {
-        byte[] bb = new byte[]{0x01, (byte)0xFF};
-        
+        byte[] bb = new byte[]
+            { 0x01, ( byte ) 0xFF };
+
         BerValue v = new BerValue( bb );
         byte[] vv = v.getData();
-        
+
         assertEquals( 0x01, vv[0] );
-        assertEquals( (byte)0xFF, vv[1] );
-        
+        assertEquals( ( byte ) 0xFF, vv[1] );
+
         bb[0] = 0x00;
         assertEquals( 0x01, vv[0] );
     }



Mime
View raw message