StackTraceElement.java: Made final.

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
This commit is contained in:
Jeroen Frijters
2004-11-18 15:26:45 +00:00
committed by Michael Koch
parent 9ef8069a0c
commit a734981608
22 changed files with 107 additions and 34 deletions
+1 -1
View 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+.
+5
View 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.
*/
+4
View 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.
@@ -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));
@@ -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.
+4 -11
View 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();
}
}
+1 -1
View 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,
+2 -2
View 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))
+1 -1
View 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);
}
+1
View 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;
}
+1 -1
View 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;
+1 -1
View 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;