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 227988 - NullPointerException at org.netbeans.modules.db.sql.loader.SQLCloneableEditor$SQLExecutionImpl$3.run
Summary: NullPointerException at org.netbeans.modules.db.sql.loader.SQLCloneableEditor...
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords: NETFIX
Depends on:
Blocks:
 
Reported: 2013-03-27 10:48 UTC by Petr Jiricka
Modified: 2013-03-27 15:21 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 197268


Attachments
stacktrace (7.14 KB, text/plain)
2013-03-27 10:48 UTC, Petr Jiricka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2013-03-27 10:48:56 UTC
Build: NetBeans IDE Dev (Build web-main-10182-on-20130327)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.7-b01, Java(TM) SE Runtime Environment, 1.7.0_15-b03
OS: Mac OS X

User Comments:
pjiricka: I was doing something very unrelated, namely creating new PHP project. But previously I was playing with JPA features and had an SQL file open in the editor - though at the time this exception occurred, that editor window was already closed.

GUEST: Try to excute statement




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.db.sql.loader.SQLCloneableEditor$SQLExecutionImpl$3.run(SQLCloneableEditor.java:773)
   at org.netbeans.modules.db.sql.loader.SQLCloneableEditor$SQLExecutionImpl$3.run(SQLCloneableEditor.java:769)
   at org.openide.util.Mutex.doEventAccess(Mutex.java:1363)
   at org.openide.util.Mutex.readAccess(Mutex.java:273)
   at org.netbeans.modules.db.sql.loader.SQLCloneableEditor$SQLExecutionImpl.isSelection(SQLCloneableEditor.java:769)
   at org.netbeans.modules.db.sql.editor.ui.actions.RunSQLSelectionAction.getDisplayName(RunSQLSelectionAction.java:80)
Comment 1 Petr Jiricka 2013-03-27 10:48:58 UTC
Created attachment 133124 [details]
stacktrace
Comment 2 matthias42 2013-03-27 11:52:01 UTC
Based on this:

http://hg.netbeans.org/web-main/file/deb0dadc091e/db.core/src/org/netbeans/modules/db/sql/loader/SQLCloneableEditor.java

I would move the code in line 773 down and put this in between:

if(editorPane == null) {
    return false;
}

==> No EditorPane, no selection, although without an editor pane also no current statement, but then for just displaying the action name this is IMHO the right way ...
Comment 3 Jaroslav Havlin 2013-03-27 15:21:54 UTC
(In reply to comment #2)
> I would move the code in line 773 down and put this in between:
> 
> if(editorPane == null) {
>     return false;
> }
>
> ==> No EditorPane, no selection, although without an editor pane also no
> current statement, but then for just displaying the action name this is IMHO
> the right way ...

http://hg.netbeans.org/core-main/rev/a684976d8ae2
It's reasonable. Thank you, Matthias.