|
Thanks Robert for reminding me. Here's the unified diff. Again my question if someone can commit this, or give me CVS access rights. Ewout Robert Schuster wrote: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Ewout, welcome onboard!(Looks like Mark should add Savannah user epr to the project.) Your 'patch' does not really look like a unified diff. What you send to classpath-patches should be: - - a unified diff of all the changes source code files, scripts etc (not the ChangeLog) as an attachment - - a ChangeLog entry describing all the details (describe what was done not why) We have a detailed Patch Submission Guide[0] in our mediation wiki. Have a look at it. cu Robert [0] - http://developer.classpath.org/mediation/ClasspathFirstSteps#head-a8b2520531202f1acefb9cb1c8b540999e4eaf21 Ewout Prangsma wrote: |
--- java\lang\Enum.java Mon Mar 21 14:10:17 2005
+++ ..\jnode\core\src\classpath\5.0\java\lang\Enum.java Fri Jul 22 19:37:59 2005
@@ -38,6 +38,8 @@
package java.lang;
import java.io.Serializable;
+import java.io.ObjectInputStream.GetField;
+import java.lang.reflect.InvocationTargetException;
/**
* @since 1.5
@@ -60,12 +62,19 @@
this.ordinal = ordinal;
}
- public static <S extends Enum<S>> Enum valueOf(Class<S> etype, String s)
- {
- if (etype == null || s == null)
- throw new NullPointerException();
- return null; // FIXME
- }
+ // @classpath-bugfix Implemented this method
+ @SuppressWarnings("unchecked")
+ public static <S extends Enum<S>> Enum valueOf(Class<S> etype, String s) {
+ if (etype == null || s == null)
+ throw new NullPointerException();
+ try {
+ return (S) etype.getDeclaredField(s).get(null);
+ } catch (NoSuchFieldException exception) {
+ throw new IllegalArgumentException(s);
+ } catch (IllegalAccessException exception) {
+ throw new Error("Unable to access Enum class");
+ }
+ }
public final boolean equals(Object o)
{
_______________________________________________ Classpath-patches mailing list [email protected] http://lists.gnu.org/mailman/listinfo/classpath-patches
