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 204261 - NullPointerException at org.netbeans.modules.db.sql.editor.ui.actions.RunSQLAction.isActionEnabled
Summary: NullPointerException at org.netbeans.modules.db.sql.editor.ui.actions.RunSQLA...
Status: RESOLVED WORKSFORME
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 7.1
Hardware: All All
: P4 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-26 09:26 UTC by gerzhedowich
Modified: 2013-03-23 16:12 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 182316


Attachments
stacktrace (3.09 KB, text/plain)
2011-10-26 09:26 UTC, gerzhedowich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gerzhedowich 2011-10-26 09:26:26 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-7955-on-20110923)
VM: Java HotSpot(TM) 64-Bit Server VM, 20.1-b02, Java(TM) SE Runtime Environment, 1.6.0_26-b03
OS: Windows 7

Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.db.sql.editor.ui.actions.RunSQLAction.isActionEnabled(RunSQLAction.java:115)
   at org.netbeans.modules.project.ui.actions.FileCommandAction.globalProvider(FileCommandAction.java:125)
   at org.netbeans.modules.project.ui.actions.FileCommandAction.refresh(FileCommandAction.java:82)
   at org.netbeans.modules.project.ui.actions.LookupSensitiveAction.doRefresh(LookupSensitiveAction.java:193)
   at org.netbeans.modules.project.ui.actions.LookupSensitiveAction.run(LookupSensitiveAction.java:228)
   at org.netbeans.modules.project.ui.actions.ProjectAction.run(ProjectAction.java:66)
Comment 1 gerzhedowich 2011-10-26 09:26:30 UTC
Created attachment 112446 [details]
stacktrace
Comment 2 Jiri Rechtacek 2011-10-26 13:40:42 UTC
Only once report from code what is called Milon-times, let's wait for me such reports...
Comment 3 matthias42 2013-03-23 16:12:34 UTC
Closing this as the offending code:

if (FileUtil.getMIMEType(d.getPrimaryFile()) != null   // Line 115
      && FileUtil.getMIMEType(d.getPrimaryFile()).equals("text/x-sql")) {

could only result in an nullpointer exception if the result of context.lookupAll(DataObject.class) contained null, that was assigned to d and the exception is the result. if there is an off by one failure in the exception it could also be FileUtil.getMIMEType(d.getPrimaryFile() switching from non-null to null. 

There was no further report for about 1.5 years.