This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 225959 - Display a special notification when an exception is thrown from user code. Do not use Exceptions Reporter for that.
Summary: Display a special notification when an exception is thrown from user code. Do...
Status: RESOLVED DUPLICATE of bug 227618
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: UI
: 226224 226226 226227 226228 226229 226231 226233 226234 226235 (view as bug list)
Depends on: 226053
Blocks:
  Show dependency tree
 
Reported: 2013-02-11 02:17 UTC by Chiana
Modified: 2014-07-16 12:35 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 198487


Attachments
stacktrace (2.29 KB, text/plain)
2013-02-11 02:17 UTC, Chiana
Details
Screenshot of debugger status window (112.72 KB, image/jpeg)
2013-02-17 15:53 UTC, Chiana
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chiana 2013-02-11 02:17:21 UTC
Build: NetBeans IDE Dev (Build 201302060843)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.7-b01, Java(TM) SE Runtime Environment, 1.7.0_13-b20
OS: Windows 7

User Comments:
Chiana: Was debugging. This is probable caused by debugger using the .toString() method to display values




Stacktrace: 
java.lang.NullPointerException: 
   at ent.EntityClasses.Storage.toString(Storage.java:111)
   at se.dfx.simplesql.EntityManagerImpl.performPersist(EntityManagerImpl.java:332)
   at se.dfx.simplesql.EntityManagerImpl.merge(EntityManagerImpl.java:81)
   at se.dfx.simplesql.EntityManagerImpl.persist(EntityManagerImpl.java:40)
   at rmiserver.ent.manager.AbstractRegManager.persist(AbstractRegManager.java:109)
   at rmiserver.ent.manager.storageRegManager.setInt(storageRegManager.java:89)
Comment 1 Chiana 2013-02-11 02:17:23 UTC
Created attachment 131213 [details]
stacktrace
Comment 2 Chiana 2013-02-11 02:44:43 UTC
Didn't manage to reproduce this with 7.3, however there were something fishy, could just not set my finger on it as it stepped into the unhandled exception handler now and then, I shall see if a more direct approach can shed some light on this... aka...
String toString() {
  throw new NullPointerException("Catch this...");
}

somewhere...
Comment 3 Jiri Skrivanek 2013-02-11 07:46:21 UTC
It is a problem in se.dfx.simplesql package. It is probably some third-party library which you use. We can't help with it.
Comment 4 Chiana 2013-02-11 09:56:04 UTC
Yes, I can see that too, that's the package I'm currently developing, but the question is, why is an exception thrown in my code affecting the debugger? And why is it displayed as an exception as if it had occured in the IDE?
Comment 5 Jiri Skrivanek 2013-02-11 10:17:27 UTC
Probably you are right that debugger should catch the exception. Passing to debugger category for evaluation.
Comment 6 Martin Entlicher 2013-02-11 10:50:34 UTC
I agree that we should display the error in user code in another way.
Comment 7 Chiana 2013-02-11 16:52:45 UTC
My suggestion would be that a "better" dialog is displayed if an exception is thrown from the .toString() informing that it was thrown from user code and suggest an alternate method of displaying the value as there exists one method (telling the debugger what method to be used for the particular class) to do this.
An alternate method is to use some sort of flagging for a "debugger safe" method to use instead, something like;

@Deprecated
private String debugSafeToString() { return "safe"; } 

or like;
private String toString(Object notUsed) { return "safe"; }
the latter can easily be autodetected and used by the debugger if present.
Comment 8 Chiana 2013-02-17 15:43:57 UTC
*** Bug 226224 has been marked as a duplicate of this bug. ***
Comment 9 Chiana 2013-02-17 15:53:11 UTC
Created attachment 131486 [details]
Screenshot of debugger status window

This is what is in the variables windows showing the red-marked entry blown up.
Comment 10 Jiri Skrivanek 2013-02-18 08:41:38 UTC
*** Bug 226226 has been marked as a duplicate of this bug. ***
Comment 11 Jiri Skrivanek 2013-02-18 08:42:00 UTC
*** Bug 226227 has been marked as a duplicate of this bug. ***
Comment 12 Jiri Skrivanek 2013-02-18 08:42:16 UTC
*** Bug 226228 has been marked as a duplicate of this bug. ***
Comment 13 Jiri Skrivanek 2013-02-18 08:42:50 UTC
*** Bug 226229 has been marked as a duplicate of this bug. ***
Comment 14 Jiri Skrivanek 2013-02-18 08:43:28 UTC
*** Bug 226231 has been marked as a duplicate of this bug. ***
Comment 15 Jiri Skrivanek 2013-02-18 08:44:18 UTC
*** Bug 226233 has been marked as a duplicate of this bug. ***
Comment 16 Jiri Skrivanek 2013-02-18 08:44:42 UTC
*** Bug 226234 has been marked as a duplicate of this bug. ***
Comment 17 Jiri Skrivanek 2013-02-18 08:45:03 UTC
*** Bug 226235 has been marked as a duplicate of this bug. ***
Comment 18 Ondrej Vrabec 2014-07-16 12:35:11 UTC
omg, martine, i've been looking at this for about two hours and eventually realized this has already been fixed: in bug 227618.

*** This bug has been marked as a duplicate of bug 227618 ***