summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libjava/ChangeLog19
-rw-r--r--libjava/gcj/field.h8
-rw-r--r--libjava/gnu/java/security/provider/SHA.java6
-rw-r--r--libjava/java/io/ObjectOutputStream.java2
-rw-r--r--libjava/java/io/ObjectStreamClass.java14
-rw-r--r--libjava/java/lang/Throwable.java1
-rw-r--r--libjava/java/lang/reflect/Modifier.java2
-rw-r--r--libjava/java/lang/reflect/natConstructor.cc3
-rw-r--r--libjava/java/lang/reflect/natMethod.cc3
-rw-r--r--libjava/java/security/Key.java2
-rw-r--r--libjava/java/security/interfaces/DSAPrivateKey.java2
-rw-r--r--libjava/java/security/interfaces/DSAPublicKey.java2
-rw-r--r--libjava/mauve-libgcj6
13 files changed, 50 insertions, 20 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 0c4dc025459..48743844716 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,22 @@
+2000-07-27 Warren Levy <warrenl@cygnus.com>
+
+ * mauve-libgcj: Activated serialization tests.
+ * gcj/field.h (getModifiers): Mask off unknown flags.
+ * gnu/java/security/provider/SHA.java (munch): Reset buffer to 0 so
+ spurious bits don't cause discrepancies.
+ * java/io/ObjectOutputStream.java: Fixed typo in comment.
+ * java/io/ObjectStreamClass.java: Fixed typos in comments.
+ (lookup): Applied patch from Brian Jones <cbj@gnu.org> to optimize.
+ (hasClassInitializer): Call getDeclaredMethod instead of getMethod.
+ * java/lang/Throwable.java (serialVersionUID): New field.
+ * java/lang/reflect/Modifier.java (ALL_FLAGS): Preserve STRICT if used.
+ * java/lang/reflect/natConstructor.cc (getModifiers): Mask off
+ unknown flags.
+ * java/lang/reflect/natMethod.cc: Ditto.
+ * java/security/Key.java (serialVersionUID): Removed field for now.
+ * java/security/interfaces/DSAPrivateKey.java (serialVersionUID): Ditto.
+ * java/security/interfaces/DSAPublicKey.java (serialVersionUID): Ditto.
+
2000-07-22 Tom Tromey <tromey@cygnus.com>
* java/awt/geom/RectangularShape.java (getPathIterator):
diff --git a/libjava/gcj/field.h b/libjava/gcj/field.h
index 4413fa30793..0ad381c321f 100644
--- a/libjava/gcj/field.h
+++ b/libjava/gcj/field.h
@@ -13,6 +13,7 @@ details. */
#include <java/lang/Class.h>
#include <java/lang/reflect/Field.h>
+#include <java/lang/reflect/Modifier.h>
#define _Jv_FIELD_UNRESOLVED_FLAG 0x8000
#define _Jv_FIELD_CONSTANT_VALUE 0x4000
@@ -74,8 +75,11 @@ struct _Jv_Field
return type;
}
- // FIXME - may need to mask off internal flags.
- int getModifiers() { return flags; }
+ // Need to mask off all unknown/internal flags before returning.
+ int getModifiers()
+ {
+ return flags & java::lang::reflect::Modifier::ALL_FLAGS;
+ }
#ifdef COMPACT_FIELDS
_Jv_Utf8Const * getNameUtf8Const (jclass cls)
diff --git a/libjava/gnu/java/security/provider/SHA.java b/libjava/gnu/java/security/provider/SHA.java
index cb3d3bf5d09..e2f72fc2ac0 100644
--- a/libjava/gnu/java/security/provider/SHA.java
+++ b/libjava/gnu/java/security/provider/SHA.java
@@ -1,5 +1,5 @@
/* SHA.java -- Class implementing the SHA-1 algorithm as specified in [1].
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -198,6 +198,10 @@ public class SHA extends MessageDigest implements Cloneable
H2 += C;
H3 += D;
H4 += E;
+
+ // Reset W by clearing it.
+ for (int t = 0; t < 80; ++ t)
+ W[t] = 0;
}
public Object clone ()
diff --git a/libjava/java/io/ObjectOutputStream.java b/libjava/java/io/ObjectOutputStream.java
index 23bcce49d76..a13f14a9d58 100644
--- a/libjava/java/io/ObjectOutputStream.java
+++ b/libjava/java/io/ObjectOutputStream.java
@@ -54,7 +54,7 @@ import gnu.java.lang.reflect.TypeSignature;
Using default serialization, information about the class of an
object is written, all of the non-transient, non-static fields of
- the object are written, if any of these fields are objects, the are
+ the object are written, if any of these fields are objects, they are
written out in the same manner.
An object is only written out the first time it is encountered. If
diff --git a/libjava/java/io/ObjectStreamClass.java b/libjava/java/io/ObjectStreamClass.java
index c43112d7a61..f39d365ad27 100644
--- a/libjava/java/io/ObjectStreamClass.java
+++ b/libjava/java/io/ObjectStreamClass.java
@@ -1,6 +1,6 @@
/* ObjectStreamClass.java -- Class used to write class information
about serialized objects.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,7 @@ public class ObjectStreamClass implements Serializable
/**
Returns the <code>ObjectStreamClass</code> for <code>cl</code>.
If <code>cl</code> is null, or is not <code>Serializable</code>,
- null is returned. <code>ObjectStreamClass</code>'s are memoized;
+ null is returned. <code>ObjectStreamClass</code>'s are memorized;
later calls to this method with the same class will return the
same <code>ObjectStreamClass</code> object and no recalculation
will be done.
@@ -62,13 +62,13 @@ public class ObjectStreamClass implements Serializable
{
if (cl == null)
return null;
+ if (! (Serializable.class).isAssignableFrom (cl))
+ return null;
ObjectStreamClass osc = (ObjectStreamClass)classLookupTable.get (cl);
if (osc != null)
return osc;
- else if (! (Serializable.class).isAssignableFrom (cl))
- return null;
else
{
osc = new ObjectStreamClass (cl);
@@ -161,7 +161,7 @@ public class ObjectStreamClass implements Serializable
// private void writeObject (ObjectOutputStream)
//
// This method is used by the class to override default
- // serialization behaivior.
+ // serialization behavior.
boolean hasWriteMethod ()
{
return (flags & ObjectStreamConstants.SC_WRITE_METHOD) != 0;
@@ -396,7 +396,7 @@ public class ObjectStreamClass implements Serializable
calculateOffsets ();
}
- // Sets uid be serial version UID defined by class, or if that
+ // Sets uid to be serial version UID defined by class, or if that
// isn't present, calculates value of serial version UID.
private void setUID (Class cl)
{
@@ -603,7 +603,7 @@ public class ObjectStreamClass implements Serializable
try
{
Class classArgs[] = {};
- m = clazz.getMethod ("<clinit>", classArgs);
+ m = clazz.getDeclaredMethod ("<clinit>", classArgs);
}
catch (java.lang.NoSuchMethodException e)
{
diff --git a/libjava/java/lang/Throwable.java b/libjava/java/lang/Throwable.java
index 1a0876fce3f..610a499a2cb 100644
--- a/libjava/java/lang/Throwable.java
+++ b/libjava/java/lang/Throwable.java
@@ -165,4 +165,5 @@ public class Throwable implements Serializable
private String detailMessage;
private transient byte stackTrace[];
+ private static final long serialVersionUID = -3042686055658047285L;
}
diff --git a/libjava/java/lang/reflect/Modifier.java b/libjava/java/lang/reflect/Modifier.java
index 14b0da3f095..5fddbc695e4 100644
--- a/libjava/java/lang/reflect/Modifier.java
+++ b/libjava/java/lang/reflect/Modifier.java
@@ -37,7 +37,7 @@ public class Modifier
public static final int STRICT = 0x800;
// This is only used by the C++ code, so it is not public.
- static final int ALL_FLAGS = 0x7ff;
+ static final int ALL_FLAGS = 0xfff;
public static boolean isAbstract (int mod)
{
diff --git a/libjava/java/lang/reflect/natConstructor.cc b/libjava/java/lang/reflect/natConstructor.cc
index 48f5aa345d1..a8da794bdb8 100644
--- a/libjava/java/lang/reflect/natConstructor.cc
+++ b/libjava/java/lang/reflect/natConstructor.cc
@@ -23,7 +23,8 @@ details. */
jint
java::lang::reflect::Constructor::getModifiers ()
{
- return _Jv_FromReflectedConstructor (this)->accflags;
+ // Ignore all unknown flags.
+ return _Jv_FromReflectedConstructor (this)->accflags & Modifier::ALL_FLAGS;
}
void
diff --git a/libjava/java/lang/reflect/natMethod.cc b/libjava/java/lang/reflect/natMethod.cc
index 0cee80b1ddf..ce4a15cfc17 100644
--- a/libjava/java/lang/reflect/natMethod.cc
+++ b/libjava/java/lang/reflect/natMethod.cc
@@ -182,7 +182,8 @@ java::lang::reflect::Method::invoke (jobject obj, jobjectArray args)
jint
java::lang::reflect::Method::getModifiers ()
{
- return _Jv_FromReflectedMethod (this)->accflags;
+ // Ignore all unknown flags.
+ return _Jv_FromReflectedMethod (this)->accflags & Modifier::ALL_FLAGS;
}
jstring
diff --git a/libjava/java/security/Key.java b/libjava/java/security/Key.java
index c8598db4c92..b3f2bef0432 100644
--- a/libjava/java/security/Key.java
+++ b/libjava/java/security/Key.java
@@ -21,7 +21,7 @@ import java.io.Serializable;
public interface Key extends Serializable
{
// FIXME: need to set this at some point when serialization is implemented.
- public static final long serialVersionUID = 0;
+ // public static final long serialVersionUID = 0L;
public String getAlgorithm();
public String getFormat();
diff --git a/libjava/java/security/interfaces/DSAPrivateKey.java b/libjava/java/security/interfaces/DSAPrivateKey.java
index a2cb583884a..c0efe21b490 100644
--- a/libjava/java/security/interfaces/DSAPrivateKey.java
+++ b/libjava/java/security/interfaces/DSAPrivateKey.java
@@ -22,7 +22,7 @@ import java.math.BigInteger;
public interface DSAPrivateKey extends DSAKey, PrivateKey
{
// FIXME: need to set this at some point when serialization is implemented.
- public static final long serialVersionUID = 0;
+ // public static final long serialVersionUID = 0L;
public BigInteger getX();
}
diff --git a/libjava/java/security/interfaces/DSAPublicKey.java b/libjava/java/security/interfaces/DSAPublicKey.java
index 7cab0708263..43eedaf1e84 100644
--- a/libjava/java/security/interfaces/DSAPublicKey.java
+++ b/libjava/java/security/interfaces/DSAPublicKey.java
@@ -22,7 +22,7 @@ import java.math.BigInteger;
public interface DSAPublicKey extends DSAKey, PublicKey
{
// FIXME: need to set this at some point when serialization is implemented.
- public static final long serialVersionUID = 0;
+ // public static final long serialVersionUID = 0L;
public BigInteger getY();
}
diff --git a/libjava/mauve-libgcj b/libjava/mauve-libgcj
index 1a4e48b419b..bdf807185f5 100644
--- a/libjava/mauve-libgcj
+++ b/libjava/mauve-libgcj
@@ -8,9 +8,9 @@ java.lang.Character.classify12
java.lang.String.hash
# We support 1.2 for these 3 tests.
java.lang.reflect.Modifier.toString12
-!java.io.ObjectInputOutput.InputTest
-!java.io.ObjectInputOutput.OutputTest
-!java.io.ObjectStreamClass.Test
+java.io.ObjectInputOutput.InputTest
+java.io.ObjectInputOutput.OutputTest
+java.io.ObjectStreamClass.Test
java.math
!java.rmi
java.security