Hi,

This fixes two small method signature errors in java.security.

2007-01-21  Mark Wielaard  <[EMAIL PROTECTED]>

    * java/security/SecureClassLoader.java (defineClass): Method returns
    Class<?>.
    * java/security/SignatureSpi.java (engineUpdate(ByteBuffer):
    Does not throw SignatureException. Chain SignatureException inside
    IllegalStateException.

The second on seems a little odd since all other engineUpdate() methods
do throw a SignatureException and I cannot see why this one shouldn't if
it is called when the engine isn't initialized. So the exception is just
chained inside an IllegalStateException.

Committed,

Mark
Index: java/security/SecureClassLoader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/security/SecureClassLoader.java,v
retrieving revision 1.15
diff -u -r1.15 SecureClassLoader.java
--- java/security/SecureClassLoader.java	10 Dec 2006 20:25:45 -0000	1.15
+++ java/security/SecureClassLoader.java	21 Jan 2007 17:04:10 -0000
@@ -99,7 +99,7 @@
    *
    * @since 1.5
    */
-  protected final Class defineClass(String name, ByteBuffer b, CodeSource cs)
+  protected final Class<?> defineClass(String name, ByteBuffer b, CodeSource cs)
   {
     return super.defineClass(name, b, getProtectionDomain(cs));
   }
Index: java/security/SignatureSpi.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/security/SignatureSpi.java,v
retrieving revision 1.13
diff -u -r1.13 SignatureSpi.java
--- java/security/SignatureSpi.java	10 Dec 2006 20:25:45 -0000	1.13
+++ java/security/SignatureSpi.java	21 Jan 2007 17:04:10 -0000
@@ -136,16 +136,23 @@
    * bytes of the given buffer.
    * 
    * @param input The input buffer.
-   * @throws SignatureException
+   * @throws IllegalStateException if the engine is not properly initialized.
    */
-  protected void engineUpdate(ByteBuffer input) throws SignatureException
+  protected void engineUpdate(ByteBuffer input)
   {
     byte[] buf = new byte[4096];
     while (input.hasRemaining())
       {
         int l = Math.min(input.remaining(), buf.length);
         input.get(buf, 0, l);
-        engineUpdate(buf, 0, l);
+        try
+          {
+            engineUpdate(buf, 0, l);
+          }
+        catch (SignatureException se)
+          {
+            throw new IllegalStateException(se);
+          }
       }
   }
   

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to