harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r396828 - /incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1Type.java
Date Tue, 25 Apr 2006 10:46:37 GMT
Author: smishura
Date: Tue Apr 25 03:46:34 2006
New Revision: 396828

URL: http://svn.apache.org/viewcvs?rev=396828&view=rev
Log:
Throw IllegalArgumentException in case of invalid parameters.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1Type.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1Type.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1Type.java?rev=396828&r1=396827&r2=396828&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1Type.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1Type.java
Tue Apr 25 03:46:34 2006
@@ -48,7 +48,7 @@
      * Constructs a primitive, universal ASN.1 type.
      * 
      * @param tagNumber - ASN.1 tag number
-     * @throws IOException TODO
+     * @throws IllegalArgumentException - if tagNumber is invalid
      */
     public ASN1Type(int tagNumber) {
         this(CLASS_UNIVERSAL, false, tagNumber);
@@ -61,18 +61,18 @@
      *     CLASS_UNIVERSAL, CLASS_APPLICATION, CLASS_CONTEXTSPECIFIC, CLASS_PRIVATE
      * @param isConstructed - is ASN.1 type is a constructed type.
      * @param tagNumber - ASN.1 tag number.
-     * @throws IOException TODO
+     * @throws IllegalArgumentException - if tagClass or tagNumber is invalid
      */
     public ASN1Type(int tagClass, boolean isConstructed, int tagNumber) {
 
         if (tagNumber < 0) {
-            throw new RuntimeException("Negative tag number");
+            throw new IllegalArgumentException("Negative tag number");
         }
 
         if (tagClass != CLASS_UNIVERSAL && tagClass != CLASS_APPLICATION
                 && tagClass != CLASS_CONTEXTSPECIFIC
                 && tagClass != CLASS_PRIVATE) {
-            throw new RuntimeException("Wrong tag class");
+            throw new IllegalArgumentException("Wrong tag class");
         }
         this.tagClass = tagClass;
         this.isConstructed = isConstructed;
@@ -87,7 +87,8 @@
             }
         } else {
             // long form
-            throw new RuntimeException("Tag long form is not implemented");
+            throw new IllegalArgumentException(
+                    "Tag long form is not implemented");
         }
     }
 



Mime
View raw message