summaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-18 15:26:45 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-18 15:26:45 +0000
commitcb0199f5f65be09b21a26385a28cf4a94a55c445 (patch)
tree9338ba46e1d50f05eca700161824c4a97dbb3435 /libjava
parent6047d32f8e80b410ac5c9d77d76ccb1fdfc2a537 (diff)
downloadgcc-cb0199f5f65be09b21a26385a28cf4a94a55c445.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90866 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog45
-rw-r--r--libjava/java/lang/StackTraceElement.java2
-rw-r--r--libjava/java/nio/channels/Channels.java5
-rw-r--r--libjava/java/rmi/Naming.java4
-rw-r--r--libjava/java/rmi/registry/LocateRegistry.java4
-rw-r--r--libjava/java/rmi/server/RMIClassLoader.java5
-rw-r--r--libjava/java/security/KeyPairGeneratorSpi.java15
-rw-r--r--libjava/java/text/DateFormat.java2
-rw-r--r--libjava/java/text/DecimalFormat.java4
-rw-r--r--libjava/java/text/Format.java2
-rw-r--r--libjava/java/util/logging/Handler.java1
-rw-r--r--libjava/java/util/regex/Matcher.java2
-rw-r--r--libjava/java/util/regex/Pattern.java2
-rw-r--r--libjava/javax/crypto/CipherInputStream.java2
-rw-r--r--libjava/javax/crypto/ExemptionMechanism.java4
-rw-r--r--libjava/javax/crypto/Mac.java4
-rw-r--r--libjava/javax/imageio/ImageIO.java5
-rw-r--r--libjava/javax/imageio/stream/ImageInputStreamImpl.java2
-rw-r--r--libjava/javax/net/ssl/SSLPermission.java2
-rw-r--r--libjava/javax/print/DocFlavor.java4
-rw-r--r--libjava/javax/print/attribute/AttributeSetUtilities.java23
-rw-r--r--libjava/javax/security/auth/PrivateCredentialPermission.java2
22 files changed, 107 insertions, 34 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 0e945c549ce..f475b05b335 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -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.
diff --git a/libjava/java/lang/StackTraceElement.java b/libjava/java/lang/StackTraceElement.java
index 02500d80a8f..4495186e175 100644
--- a/libjava/java/lang/StackTraceElement.java
+++ b/libjava/java/lang/StackTraceElement.java
@@ -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+.
diff --git a/libjava/java/nio/channels/Channels.java b/libjava/java/nio/channels/Channels.java
index 9b446e461a9..3e5316efbe8 100644
--- a/libjava/java/nio/channels/Channels.java
+++ b/libjava/java/nio/channels/Channels.java
@@ -60,6 +60,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.
*/
public static InputStream newInputStream(ReadableByteChannel ch)
diff --git a/libjava/java/rmi/Naming.java b/libjava/java/rmi/Naming.java
index 74ad9626256..4df9045214a 100644
--- a/libjava/java/rmi/Naming.java
+++ b/libjava/java/rmi/Naming.java
@@ -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.
diff --git a/libjava/java/rmi/registry/LocateRegistry.java b/libjava/java/rmi/registry/LocateRegistry.java
index aaf9333f3b8..58452158c72 100644
--- a/libjava/java/rmi/registry/LocateRegistry.java
+++ b/libjava/java/rmi/registry/LocateRegistry.java
@@ -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));
diff --git a/libjava/java/rmi/server/RMIClassLoader.java b/libjava/java/rmi/server/RMIClassLoader.java
index 006bc4539f8..6add274ef3e 100644
--- a/libjava/java/rmi/server/RMIClassLoader.java
+++ b/libjava/java/rmi/server/RMIClassLoader.java
@@ -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.
diff --git a/libjava/java/security/KeyPairGeneratorSpi.java b/libjava/java/security/KeyPairGeneratorSpi.java
index 735dd6498f9..07de178cfd5 100644
--- a/libjava/java/security/KeyPairGeneratorSpi.java
+++ b/libjava/java/security/KeyPairGeneratorSpi.java
@@ -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();
}
}
diff --git a/libjava/java/text/DateFormat.java b/libjava/java/text/DateFormat.java
index 8b705663d68..6fe4461b030 100644
--- a/libjava/java/text/DateFormat.java
+++ b/libjava/java/text/DateFormat.java
@@ -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,
diff --git a/libjava/java/text/DecimalFormat.java b/libjava/java/text/DecimalFormat.java
index 94487c80204..8b2c25cd3c3 100644
--- a/libjava/java/text/DecimalFormat.java
+++ b/libjava/java/text/DecimalFormat.java
@@ -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))
diff --git a/libjava/java/text/Format.java b/libjava/java/text/Format.java
index 7310d5588cd..2c75578243c 100644
--- a/libjava/java/text/Format.java
+++ b/libjava/java/text/Format.java
@@ -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);
}
diff --git a/libjava/java/util/logging/Handler.java b/libjava/java/util/logging/Handler.java
index f4efebb11b7..c781f09f855 100644
--- a/libjava/java/util/logging/Handler.java
+++ b/libjava/java/util/logging/Handler.java
@@ -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;
}
diff --git a/libjava/java/util/regex/Matcher.java b/libjava/java/util/regex/Matcher.java
index 8b2ac3e5def..994893ad84b 100644
--- a/libjava/java/util/regex/Matcher.java
+++ b/libjava/java/util/regex/Matcher.java
@@ -45,7 +45,7 @@ import gnu.regexp.REMatch;
*
* @since 1.4
*/
-public class Matcher
+public final class Matcher
{
private Pattern pattern;
private CharSequence input;
diff --git a/libjava/java/util/regex/Pattern.java b/libjava/java/util/regex/Pattern.java
index 174bdae5878..fa722cfb9b8 100644
--- a/libjava/java/util/regex/Pattern.java
+++ b/libjava/java/util/regex/Pattern.java
@@ -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;
diff --git a/libjava/javax/crypto/CipherInputStream.java b/libjava/javax/crypto/CipherInputStream.java
index c01cb47ac4c..35d4956092d 100644
--- a/libjava/javax/crypto/CipherInputStream.java
+++ b/libjava/javax/crypto/CipherInputStream.java
@@ -294,7 +294,7 @@ public class CipherInputStream extends FilterInputStream
*
* @param mark Is ignored.
*/
- public void mark(long mark)
+ public void mark(int mark)
{
}
diff --git a/libjava/javax/crypto/ExemptionMechanism.java b/libjava/javax/crypto/ExemptionMechanism.java
index 2b2091e1505..b00ff0d5ffe 100644
--- a/libjava/javax/crypto/ExemptionMechanism.java
+++ b/libjava/javax/crypto/ExemptionMechanism.java
@@ -222,4 +222,8 @@ public class ExemptionMechanism
{
return true;
}
+
+ protected void finalize()
+ {
+ }
}
diff --git a/libjava/javax/crypto/Mac.java b/libjava/javax/crypto/Mac.java
index 301ec327e40..9bbd68c21d5 100644
--- a/libjava/javax/crypto/Mac.java
+++ b/libjava/javax/crypto/Mac.java
@@ -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;
diff --git a/libjava/javax/imageio/ImageIO.java b/libjava/javax/imageio/ImageIO.java
index 5cc7c926da9..6aa5558919c 100644
--- a/libjava/javax/imageio/ImageIO.java
+++ b/libjava/javax/imageio/ImageIO.java
@@ -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;
diff --git a/libjava/javax/imageio/stream/ImageInputStreamImpl.java b/libjava/javax/imageio/stream/ImageInputStreamImpl.java
index 27cb6c5b43a..3a5d6dcb6d7 100644
--- a/libjava/javax/imageio/stream/ImageInputStreamImpl.java
+++ b/libjava/javax/imageio/stream/ImageInputStreamImpl.java
@@ -58,7 +58,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream
// Do nothing here.
}
- protected void checkClosed()
+ protected final void checkClosed()
throws IOException
{
if (closed)
diff --git a/libjava/javax/net/ssl/SSLPermission.java b/libjava/javax/net/ssl/SSLPermission.java
index 3771eaf9828..0fa4a591bd0 100644
--- a/libjava/javax/net/ssl/SSLPermission.java
+++ b/libjava/javax/net/ssl/SSLPermission.java
@@ -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.
diff --git a/libjava/javax/print/DocFlavor.java b/libjava/javax/print/DocFlavor.java
index 381e2885e4b..11cc36d1a11 100644
--- a/libjava/javax/print/DocFlavor.java
+++ b/libjava/javax/print/DocFlavor.java
@@ -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;
diff --git a/libjava/javax/print/attribute/AttributeSetUtilities.java b/libjava/javax/print/attribute/AttributeSetUtilities.java
index 3c72480c057..32bee51b6cb 100644
--- a/libjava/javax/print/attribute/AttributeSetUtilities.java
+++ b/libjava/javax/print/attribute/AttributeSetUtilities.java
@@ -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
{
diff --git a/libjava/javax/security/auth/PrivateCredentialPermission.java b/libjava/javax/security/auth/PrivateCredentialPermission.java
index cc370ae17c7..c8573f79e88 100644
--- a/libjava/javax/security/auth/PrivateCredentialPermission.java
+++ b/libjava/javax/security/auth/PrivateCredentialPermission.java
@@ -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
{
/**