directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r330365 - in /directory/asn1/branches/ber-decoder/modules/runtime/src: java/org/apache/asn1/runtime/ test/org/apache/asn1/encoding/com/acme/spnego/ber/ test/org/apache/asn1/test/encoding/
Date Wed, 02 Nov 2005 21:28:42 GMT
Author: adc
Date: Wed Nov  2 13:28:39 2005
New Revision: 330365

URL: http://svn.apache.org/viewcvs?rev=330365&view=rev
Log:
Checkin to save very old work.

Modified:
    directory/asn1/branches/ber-decoder/modules/runtime/src/java/org/apache/asn1/runtime/ASN1BitString.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListEncoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitEncoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenDecoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenEncoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/test/encoding/EncodingFactoryTest.java

Modified: directory/asn1/branches/ber-decoder/modules/runtime/src/java/org/apache/asn1/runtime/ASN1BitString.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/java/org/apache/asn1/runtime/ASN1BitString.java?rev=330365&r1=330364&r2=330365&view=diff
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/java/org/apache/asn1/runtime/ASN1BitString.java
(original)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/java/org/apache/asn1/runtime/ASN1BitString.java
Wed Nov  2 13:28:39 2005
@@ -20,6 +20,8 @@
 
 
 /**
+ * Implementation of an ASN1 bit string
+ *
  * @version $Revision$ $Date: $
  */
 public class ASN1BitString extends BitSet implements ASN1Type
@@ -27,10 +29,16 @@
     private final int nbits;
     private final int nbytes;
 
+    /**
+     * @param nbits
+     * @param nbytes
+     */
     public ASN1BitString( int nbits, int nbytes )
     {
         super( nbits );
 
+        if ( nbits / 8 > nbytes ) throw new IllegalArgumentException( "Number if bits
will not fit in given number of bytes" );
+
         this.nbits = nbits;
         this.nbytes = nbytes;
     }
@@ -58,7 +66,7 @@
         {
             if ( get( i ) )
             {
-                result[i / 8] |= 1 << ( 7-  ( i % 8 ) );
+                result[i / 8] |= 1 << ( 7 - ( i % 8 ) );
             }
         }
 

Modified: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListEncoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListEncoder.java?rev=330365&r1=330364&r2=330365&view=diff
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListEncoder.java
(original)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListEncoder.java
Wed Nov  2 13:28:39 2005
@@ -24,7 +24,7 @@
  */
 public class MechTypeListEncoder implements org.apache.asn1.encoding.ber.BEREncoder
 {
-    protected org.apache.asn1.encoding.ber.BEREncoder mechTypeEncoder;
+    protected final org.apache.asn1.encoding.ber.BEREncoder mechTypeEncoder;
 
     public MechTypeListEncoder()
     {

Modified: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitEncoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitEncoder.java?rev=330365&r1=330364&r2=330365&view=diff
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitEncoder.java
(original)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitEncoder.java
Wed Nov  2 13:28:39 2005
@@ -25,10 +25,10 @@
  */
 public class NegTokenInitEncoder implements org.apache.asn1.encoding.ber.BEREncoder
 {
-    protected org.apache.asn1.encoding.ber.BEREncoder mechTypesEncoder;
-    protected org.apache.asn1.encoding.ber.BEREncoder reqFlagsEncoder;
-    protected org.apache.asn1.encoding.ber.BEREncoder mechTokenEncoder;
-    protected org.apache.asn1.encoding.ber.BEREncoder mechListMICEncoder;
+    protected final org.apache.asn1.encoding.ber.BEREncoder mechTypesEncoder;
+    protected final org.apache.asn1.encoding.ber.BEREncoder reqFlagsEncoder;
+    protected final org.apache.asn1.encoding.ber.BEREncoder mechTokenEncoder;
+    protected final org.apache.asn1.encoding.ber.BEREncoder mechListMICEncoder;
 
     public NegTokenInitEncoder()
     {

Modified: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenDecoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenDecoder.java?rev=330365&r1=330364&r2=330365&view=diff
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenDecoder.java
(original)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenDecoder.java
Wed Nov  2 13:28:39 2005
@@ -43,7 +43,6 @@
     public org.apache.asn1.runtime.ASN1Type decode( org.apache.asn1.encoding.ber.BERInputStream
stream ) throws org.apache.asn1.encoding.DecoderException
     {
         NegotiationToken negotiationToken = new NegotiationToken();
-        org.apache.asn1.runtime.ASN1Type result = negotiationToken;
 
         try
         {
@@ -75,6 +74,6 @@
             throw new org.apache.asn1.encoding.DecoderException( ioe );
         }
 
-        return result;
+        return negotiationToken;
     }
 }

Modified: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenEncoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenEncoder.java?rev=330365&r1=330364&r2=330365&view=diff
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenEncoder.java
(original)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenEncoder.java
Wed Nov  2 13:28:39 2005
@@ -22,8 +22,8 @@
  */
 public class NegotiationTokenEncoder implements org.apache.asn1.encoding.ber.BEREncoder
 {
-    protected org.apache.asn1.encoding.ber.BEREncoder negTokenInitEncoder;
-    protected org.apache.asn1.encoding.ber.BEREncoder negTokenTargEncoder;
+    protected final org.apache.asn1.encoding.ber.BEREncoder negTokenInitEncoder;
+    protected final org.apache.asn1.encoding.ber.BEREncoder negTokenTargEncoder;
 
     public NegotiationTokenEncoder()
     {

Modified: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/test/encoding/EncodingFactoryTest.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/test/encoding/EncodingFactoryTest.java?rev=330365&r1=330364&r2=330365&view=diff
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/test/encoding/EncodingFactoryTest.java
(original)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/test/encoding/EncodingFactoryTest.java
Wed Nov  2 13:28:39 2005
@@ -73,7 +73,6 @@
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         encoder.encode( out, negotiationToken );
 
-
         byte[] result = out.toByteArray();
 
         assertEquals( 1500, result.length );



Mime
View raw message