This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] JMTI Exception Events


>>>>> "Kyle" == Kyle Galloway <kgallowa@redhat.com> writes:

Kyle> +        if (!(_ex_map.get (thr).equals (ex)))

>> Without an equals() method in this class, I doubt this does what you
>> intend.  As it is this equals() will always return false, because the
>> default equals() tests object identity, and a new object is never
>> identical to any existing one.

Kyle> In this case, however, I believe I want to only equal the exact same
Kyle> exception.

Ah, thanks.  I misread this, sorry about that.

If you really intend to check identity, use '==' and not 'equals()'.
Otherwise things can be weird if a subclass happens to override equals.

Kyle> What I have done now is add a method called post_exception_event,
Kyle> which checks to see if this is a repeated throw, and if not constucts
Kyle> an ExceptionEvent and alls send event to send the JVMTI event
Kyle> notification.

Please use javaStyleNaming.  I'm more a gnu-style person myself, but
we're stuck with that.  (One of my little pet peeves is that the stack
trace stuff uses uppercase for the start of method names... weird and
somehow irritating.)

Kyle> +  public static void post_exception_event (Thread thr, long throw_meth,
Kyle> +		                                  long throw_loc, Throwable ex,
Kyle> +		                                  long catch_meth, long catch_loc)

I can't tell due to the patch stuff but the formatting of this looks
weird in my mail buffer; so please make sure it looks right before
committing.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]