StackTraceElement.java: Made final.
authorJeroen Frijters <jeroen@frijters.net>
Thu, 18 Nov 2004 15:26:45 +0000 (15:26 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Thu, 18 Nov 2004 15:26:45 +0000 (15:26 +0000)
2004-11-18  Jeroen Frijters  <address@bogus.example.com>

* java/lang/StackTraceElement.java: Made final.
* java/nio/channels/Channels.java: Added private constructor.
* java/rmi/Naming.java: Added private constructor.
* java/rmi/registry/LocateRegistry.java: Added private constructor.
* java/rmi/server/RMIClassLoader.java: Added private constructor.
* java/security/KeyPairGeneratorSpi.java
(clone): Made protected and simplified implementation.
* java/text/DateFormat.java
(allFields): Made package accessible.
* java/text/DecimalFormat.java
(formatInternal): Made private.
* java/text/Format.java
(formatInternal): Made private.
* java/util/logging/Handler.java: Made constructor protected.
* java/util/regex/Matcher.java: Made final.
* java/util/regex/Pattern.java: Made final.
* javax/crypto/CipherInputStream.java
(mark): Corrected mark parameter type (from long to int).
* javax/crypto/ExemptionMechanism.java
(finalize): Added.
* javax/crypto/Mac.java
(getMacLength): Made final.
(clone): Made final.
* javax/imageio/ImageIO.java: Added private constructor.
* javax/imageio/stream/ImageInputStreamImpl.java
(checkClosed): Made final.
* javax/net/ssl/SSLPermission.java: Made final.
* javax/print/DocFlavor.java
(hostEncoding): Added work-around to prevent the field from being
a compile time constant.
* javax/print/attribute/AttributeSetUtilities.java: Added private
constructor.
(UnmodifiableDocAttributeSet): Made private.
(UnmodifiablePrintJobAttributeSet): Made private.
(UnmodifiablePrintRequestAttributeSet): Made private.
(UnmodifiablePrintServiceAttributeSet): Made private.
(SynchronizedAttributeSet): Made private.
(SynchronizedDocAttributeSet): Made private.
(SynchronizedPrintJobAttributeSet): Made private.
(SynchronizedPrintRequestAttributeSet): Made private.
(SynchronizedPrintServiceAttributeSet): Made private.
* javax/security/auth/PrivateCredentialPermission.java: Made final.

From-SVN: r90866

22 files changed:
libjava/ChangeLog
libjava/java/lang/StackTraceElement.java
libjava/java/nio/channels/Channels.java
libjava/java/rmi/Naming.java
libjava/java/rmi/registry/LocateRegistry.java
libjava/java/rmi/server/RMIClassLoader.java
libjava/java/security/KeyPairGeneratorSpi.java
libjava/java/text/DateFormat.java
libjava/java/text/DecimalFormat.java
libjava/java/text/Format.java
libjava/java/util/logging/Handler.java
libjava/java/util/regex/Matcher.java
libjava/java/util/regex/Pattern.java
libjava/javax/crypto/CipherInputStream.java
libjava/javax/crypto/ExemptionMechanism.java
libjava/javax/crypto/Mac.java
libjava/javax/imageio/ImageIO.java
libjava/javax/imageio/stream/ImageInputStreamImpl.java
libjava/javax/net/ssl/SSLPermission.java
libjava/javax/print/DocFlavor.java
libjava/javax/print/attribute/AttributeSetUtilities.java
libjava/javax/security/auth/PrivateCredentialPermission.java

index 0e945c549ceb13b22e1af5a45c86ae5d542e0266..f475b05b335cb803835d2d8b74d246fa54dfb2c2 100644 (file)
@@ -1,3 +1,48 @@
+2004-11-18  Jeroen Frijters  <address@bogus.example.com>
+
+       * java/lang/StackTraceElement.java: Made final.
+       * java/nio/channels/Channels.java: Added private constructor.
+       * java/rmi/Naming.java: Added private constructor.
+       * java/rmi/registry/LocateRegistry.java: Added private constructor.
+       * java/rmi/server/RMIClassLoader.java: Added private constructor.
+       * java/security/KeyPairGeneratorSpi.java
+       (clone): Made protected and simplified implementation.
+       * java/text/DateFormat.java
+       (allFields): Made package accessible.
+       * java/text/DecimalFormat.java
+       (formatInternal): Made private.
+       * java/text/Format.java
+       (formatInternal): Made private.
+       * java/util/logging/Handler.java: Made constructor protected.
+       * java/util/regex/Matcher.java: Made final.
+       * java/util/regex/Pattern.java: Made final.
+       * javax/crypto/CipherInputStream.java
+       (mark): Corrected mark parameter type (from long to int).
+       * javax/crypto/ExemptionMechanism.java
+       (finalize): Added.
+       * javax/crypto/Mac.java
+       (getMacLength): Made final.
+       (clone): Made final.
+       * javax/imageio/ImageIO.java: Added private constructor.
+       * javax/imageio/stream/ImageInputStreamImpl.java
+       (checkClosed): Made final.
+       * javax/net/ssl/SSLPermission.java: Made final.
+       * javax/print/DocFlavor.java
+       (hostEncoding): Added work-around to prevent the field from being
+       a compile time constant.
+       * javax/print/attribute/AttributeSetUtilities.java: Added private
+       constructor.
+       (UnmodifiableDocAttributeSet): Made private.
+       (UnmodifiablePrintJobAttributeSet): Made private.
+       (UnmodifiablePrintRequestAttributeSet): Made private.
+       (UnmodifiablePrintServiceAttributeSet): Made private.
+       (SynchronizedAttributeSet): Made private.
+       (SynchronizedDocAttributeSet): Made private.
+       (SynchronizedPrintJobAttributeSet): Made private.
+       (SynchronizedPrintRequestAttributeSet): Made private.
+       (SynchronizedPrintServiceAttributeSet): Made private.
+       * javax/security/auth/PrivateCredentialPermission.java: Made final.
+
 2004-11-18  Craig Black  <craig.black@aonix.com>
 
        * gnu/java/beans/BeanInfoEmbryo.java: Use TreeMap for proper sorting.
index 02500d80a8fe80dc1204c2a7680ba0eb2b988008..4495186e1750eaec0b9db46d1bd883379a1af42f 100644 (file)
@@ -51,7 +51,7 @@ import java.io.Serializable;
  * @since 1.4
  * @status updated to 1.4
  */
-public class StackTraceElement implements Serializable
+public final class StackTraceElement implements Serializable
 {
   /**
    * Compatible with JDK 1.4+.
index 9b446e461a99403f0c924433bd64d7bdb2880bd9..3e5316efbe815a269b0da22b6c33dbd4fcaf33a0 100644 (file)
@@ -59,6 +59,11 @@ import java.nio.charset.CharsetEncoder;
  */
 public final class Channels
 {
+  /**
+   * This class isn't intended to be instantiated.
+   */
+  private Channels() {}
+
   /**
    * Constructs a stream that reads bytes from the given channel.
    */
index 74ad9626256a77e2c60a6297924a25945b799b28..4df9045214a079a2057601783a8a1a6e38e1c9bb 100644 (file)
@@ -44,6 +44,10 @@ import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;
 
 public final class Naming {
+  /**
+   * This class isn't intended to be instantiated.
+   */
+  private Naming() {}
 
 /**
  * Looks for the remote object that is associated with the named service.
index aaf9333f3b87c485a24e34711afbc24e35daf106..58452158c72f988bed9c83c9cce4eb09d97513aa 100644 (file)
@@ -50,6 +50,10 @@ import java.rmi.server.RMISocketFactory;
 import java.rmi.server.RemoteRef;
 
 public final class LocateRegistry {
+  /**
+   * This class isn't intended to be instantiated.
+   */
+  private LocateRegistry() {}
 
 public static Registry getRegistry() throws RemoteException {
        return (getRegistry("localhost", Registry.REGISTRY_PORT));
index 006bc4539f8227f3127c8f4746f314f55ed36078..6add274ef3e1c8fdee47ce023cc9f2f529e61c43 100644 (file)
@@ -55,6 +55,11 @@ import java.util.StringTokenizer;
  */
 public class RMIClassLoader
 {
+  /**
+   * This class isn't intended to be instantiated.
+   */
+  private RMIClassLoader() {}
+
   private static class MyClassLoader extends URLClassLoader
   {
     // Package-private to avoid a trampoline constructor.
index 735dd6498f97ea8b81b0bfa32e9770f851ef93b3..07de178cfd5904e604aced352fe58c2726cfd59b 100644 (file)
@@ -92,18 +92,11 @@ public abstract class KeyPairGeneratorSpi
   public abstract KeyPair generateKeyPair();
 
   /**
-     Returns a clone of this class.
-
-     If cloning is not supported, then by default the class throws a
-     CloneNotSupportedException.  The MessageDigestSpi provider
-     implementation has to overload this class in order to be
-     cloneable.
+   * We override clone here to make it accessible for use by
+   * DummyKeyPairGenerator.
    */
-  public Object clone() throws CloneNotSupportedException
+  protected Object clone() throws CloneNotSupportedException
   {
-    if (this instanceof Cloneable)
-      return super.clone();
-    else
-      throw new CloneNotSupportedException();
+    return super.clone();
   }
 }
index 8b705663d68d7f049da9b4e3c8f35991f89f1008..6fe4461b0301952c2674725052307602b8a541da 100644 (file)
@@ -137,7 +137,7 @@ public abstract class DateFormat extends Format implements Cloneable
     public static final DateFormat.Field TIME_ZONE
        = new Field("timezone", Calendar.ZONE_OFFSET);
  
-    public static final DateFormat.Field[] allFields =
+    static final DateFormat.Field[] allFields =
     {
       ERA, YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY1,
       HOUR_OF_DAY0, MINUTE, SECOND, MILLISECOND,
index 94487c8020470df3fd6c8fffbf1182cc98304c99..8b2c25cd3c3895aed872d850077057b638bb484a 100644 (file)
@@ -447,8 +447,8 @@ public class DecimalFormat extends NumberFormat
            && useExponentialNotation == dup.useExponentialNotation);
   }
 
-  protected void formatInternal (double number, FormatBuffer dest,
-                                FieldPosition fieldPos)
+  private void formatInternal (double number, FormatBuffer dest,
+                              FieldPosition fieldPos)
   {
     // A very special case.
     if (Double.isNaN(number))
index 7310d5588cd9c441ac71554a133208231e7e04f5..2c75578243cfe00e906e085f9c3e6c4a1a58c039 100644 (file)
@@ -70,7 +70,7 @@ public abstract class Format implements Serializable, Cloneable
   {
     static final long serialVersionUID = 276966692217360283L;
    
-    public Field(String name)
+    protected Field(String name)
     {
       super(name);
     }
index f4efebb11b7f34e592295c150aecf7d925ad3772..c781f09f8557c891fea98c65c65f3ea6a58906ab 100644 (file)
@@ -85,6 +85,7 @@ h.setFormatter(h.getFormatter());</pre>
    * supposed to provide a Formatter, but this is what the specification
    * says.
    */
+  protected Handler()
   {
     level = Level.ALL;
   }
index 8b2ac3e5def96001dc814c66911214cfb0e05b60..994893ad84b5b5a090894adea32d7a629508d557 100644 (file)
@@ -45,7 +45,7 @@ import gnu.regexp.REMatch;
  *
  * @since 1.4
  */
-public class Matcher
+public final class Matcher
 {
   private Pattern pattern;
   private CharSequence input;
index 174bdae58788f7eadbd8999b6b2a307bca88a62c..fa722cfb9b87f571e96189bb6498da3d1d8a7644 100644 (file)
@@ -50,7 +50,7 @@ import java.util.ArrayList;
  *
  * @since 1.4
  */
-public class Pattern implements Serializable
+public final class Pattern implements Serializable
 {
   private static final long serialVersionUID = 5073258162644648461L;
   
index c01cb47ac4cfc09d26211bc88faad889e36522c5..35d4956092d0271d1f9f549cbb4fb52506989359 100644 (file)
@@ -294,7 +294,7 @@ public class CipherInputStream extends FilterInputStream
    *
    * @param mark Is ignored.
    */
-  public void mark(long mark)
+  public void mark(int mark)
   {
   }
 
index 2b2091e15056652f1e99bf18c3f70a914faacf5d..b00ff0d5ffe0e4b7abdb388561b5ca343dcbe4d6 100644 (file)
@@ -222,4 +222,8 @@ public class ExemptionMechanism
   {
     return true;
   }
+
+  protected void finalize()
+  {
+  }
 }
index 301ec327e4006552457696545fd4ae4c7735a390..9bbd68c21d5489dbd0269f7a521f12e2b8103b41 100644 (file)
@@ -290,7 +290,7 @@ public class Mac implements Cloneable
    *
    * @return The MAC length.
    */
-  public int getMacLength()
+  public final int getMacLength()
   {
     return macSpi.engineGetMacLength();
   }
@@ -404,7 +404,7 @@ public class Mac implements Cloneable
    * @throws java.lang.CloneNotSupportedException If the underlying
    *         implementation is not cloneable.
    */
-  public Object clone() throws CloneNotSupportedException
+  public final Object clone() throws CloneNotSupportedException
   {
     Mac result = new Mac((MacSpi) macSpi.clone(), provider, algorithm);
     result.virgin = virgin;
index 5cc7c926da900a6d52918c30ca5ff024afb30a52..6aa5558919c9aa3550e10509ddffbc90c0d25f12 100644 (file)
@@ -51,6 +51,11 @@ import javax.imageio.spi.ServiceRegistry;
 
 public final class ImageIO
 {
+  /**
+   * This class isn't intended to be instantiated.
+   */
+  private ImageIO() {}
+
   private static final class ReaderFormatFilter implements ServiceRegistry.Filter
   {
     private String formatName;
index 27cb6c5b43a265adc2cc111e63e276574b3ecdd5..3a5d6dcb6d776001b897e62fc720a6a54f733d6d 100644 (file)
@@ -58,7 +58,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream
     // Do nothing here.
   }
 
-  protected void checkClosed()
+  protected final void checkClosed()
     throws IOException
   {
     if (closed)
index 3771eaf9828805e8ebf81ba6e7b404670f42ac98..0fa4a591bd07a986cdf26ca39c8beb7be247abc0 100644 (file)
@@ -43,7 +43,7 @@ import java.security.BasicPermission;
 /**
  * A permission used for accessing SSL classes.
  */
-public class SSLPermission extends BasicPermission
+public final class SSLPermission extends BasicPermission
 {
 
   // Constant.
index 381e2885e4b764ccdd567d0acc62e6f4a2acc839..11cc36d1a1156b6bb037d0096e71ef9612d4d957 100644 (file)
@@ -217,7 +217,9 @@ public class DocFlavor implements Cloneable, Serializable
   
   private static final long serialVersionUID = -4512080796965449721L;
   
-  public static final String hostEncoding = "US-ASCII";
+  // FIXME: Get the host encoding from somewhere. Note that the new String is to make
+  // sure the field won't be a compile time constant.
+  public static final String hostEncoding = new String("US-ASCII");
 
   private String mediaSubtype;
   private String mediaType;
index 3c72480c057193f5c1b5127da571a9d8fa456078..32bee51b6cb611d99d7f31518c994973f9f9e3fe 100644 (file)
@@ -41,6 +41,11 @@ import java.io.Serializable;
 
 public final class AttributeSetUtilities
 {
+  /**
+   * This class isn't intended to be instantiated.
+   */
+  private AttributeSetUtilities() {}
+
   private static class UnmodifiableAttributeSet
     implements AttributeSet, Serializable
   {
@@ -120,7 +125,7 @@ public final class AttributeSetUtilities
     }
   }
 
-  public static class UnmodifiableDocAttributeSet
+  private static class UnmodifiableDocAttributeSet
     extends UnmodifiableAttributeSet
     implements DocAttributeSet, Serializable
   {
@@ -130,7 +135,7 @@ public final class AttributeSetUtilities
     }
   }
 
-  public static class UnmodifiablePrintJobAttributeSet
+  private static class UnmodifiablePrintJobAttributeSet
     extends UnmodifiableAttributeSet
     implements PrintJobAttributeSet, Serializable
   {
@@ -140,7 +145,7 @@ public final class AttributeSetUtilities
     }
   }
 
-  public static class UnmodifiablePrintRequestAttributeSet
+  private static class UnmodifiablePrintRequestAttributeSet
     extends UnmodifiableAttributeSet
     implements PrintRequestAttributeSet, Serializable
   {
@@ -150,7 +155,7 @@ public final class AttributeSetUtilities
     }
   }
 
-  public static class UnmodifiablePrintServiceAttributeSet
+  private static class UnmodifiablePrintServiceAttributeSet
     extends UnmodifiableAttributeSet
     implements PrintServiceAttributeSet, Serializable
   {
@@ -160,7 +165,7 @@ public final class AttributeSetUtilities
     }
   }
 
-  public static class SynchronizedAttributeSet
+  private static class SynchronizedAttributeSet
     implements AttributeSet, Serializable
   {
     private AttributeSet set;
@@ -239,7 +244,7 @@ public final class AttributeSetUtilities
     }
   }
 
-  public static class SynchronizedDocAttributeSet
+  private static class SynchronizedDocAttributeSet
     extends SynchronizedAttributeSet
     implements DocAttributeSet, Serializable
   {
@@ -249,7 +254,7 @@ public final class AttributeSetUtilities
     }
   }
 
-  public static class SynchronizedPrintJobAttributeSet
+  private static class SynchronizedPrintJobAttributeSet
     extends SynchronizedAttributeSet
     implements PrintJobAttributeSet, Serializable
   {
@@ -259,7 +264,7 @@ public final class AttributeSetUtilities
     }
   }
 
-  public static class SynchronizedPrintRequestAttributeSet
+  private static class SynchronizedPrintRequestAttributeSet
     extends SynchronizedAttributeSet
     implements PrintRequestAttributeSet, Serializable
   {
@@ -269,7 +274,7 @@ public final class AttributeSetUtilities
     }
   }
 
-  public static class SynchronizedPrintServiceAttributeSet
+  private static class SynchronizedPrintServiceAttributeSet
     extends SynchronizedAttributeSet
     implements PrintServiceAttributeSet, Serializable
   {
index cc370ae17c7fac90c0b853e0b3c15d54b63d8193..c8573f79e88c3d445267c7cd9c24341dcf6d4f01 100644 (file)
@@ -63,7 +63,7 @@ import java.util.StringTokenizer;
  * <i>PrincipalName</i> is a string representing the principal, or the
  * wildcard character.</p>
  */
-public class PrivateCredentialPermission extends Permission
+public final class PrivateCredentialPermission extends Permission
   implements Serializable
 {
   /**