Interesting... but the getMethod() call is not even accessing the
enum... Is your enum inside the TRDeal class? Did you try moving out
the enum declaration to its own file, i.e. FixStrip.java to see if the
hung goes away? :-)
On Jan 28, 2009, at 2:29 PM, Ken Anderson wrote:
A word of caution about Enums and Java 1.5... I got bit last week
by a Sun VM problem (1.5.014) combining Enums and introspection . I
had defined this:
public static enum FixStrip {
Period(14), Quarter(15), Month(12), Year(16);
private int code;
private FixStrip(int c) {
code = c;
}
public int getCode() {
return code;
}
};
and then my code does a look-up of a method in the same class, like
this:
Method method = dealClass.getMethod("dealForTRDeal", new Class[]
{TRDeal.class, CTEditingContext.class, NSMutableArray.class,
String.class});
Well guess what happened? Sun's VM HUNG on the getMethod call. All
I had to do was comment out the definition of the Enum, and the
getMethod method started working again. This worked fine on the mac
- it's just when I ran it on the Sun that I had trouble.
YMMV
Ken
On Jan 27, 2009, at 5:23 PM, Mike Schrag wrote:
yes, if you're using ERPrototypes, just use the javaEnum prototype
and set your className to your enum class ... or just look at what
it does ... it's pretty easy
ms
On Jan 27, 2009, at 5:18 PM, Ricardo J. Parada wrote:
Has anybody explored using java 1.5 enum type for an EO's
property? Is there an easy way to do this?
For example, let's say I have a UserRequest EO and I wanted to
have the following statuses:
public enum Status { Draft, Ready, InProgress, Done };
How would the setStatus() and status() accessor methods should be
written and how should the property be setup in the eomodel?
Or should I stick with using an Integer property and hard code the
integer values for each status? :-)
Thanks,
Ricardo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40mdimension.com
This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/kenlists%40anderhome.com
This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/rparada
%40mac.com
This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]