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


Tom Tromey wrote:
"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.
Ok, no problem.
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.)
So you want, postExceptionEvent instead of post_exception_event. What about the two native calls should they be sendEvent and checkCatch. Also do you want the variable names changed to throwMeth, catchLoc etc? And while I'm at it, should it be funtion() or function () in java files outside of classpath, I think I've seen both?. I'm sorry to keep asking about/screwing this up but I find it can be a little confusing to know which conventions to use sometimes.
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.
Other than these is this ok to go in?

- Kyle


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