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 192816 - NullPointerException at org.netbeans.modules.python.editor.PythonFormatter$1.run
Summary: NullPointerException at org.netbeans.modules.python.editor.PythonFormatter$1.run
Status: VERIFIED FIXED
Alias: None
Product: python
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0
Hardware: All All
: P4 normal (vote)
Assignee: Jenselme
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-02 18:53 UTC by shantanoo
Modified: 2015-11-27 22:22 UTC (History)
11 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 174109


Attachments
stacktrace (1.26 KB, text/plain)
2010-12-02 18:54 UTC, shantanoo
Details
stacktrace (1.26 KB, text/plain)
2011-02-20 11:22 UTC, michbarsinai
Details
stacktrace (1.64 KB, text/plain)
2015-09-06 05:39 UTC, Lou Dasaro
Details
stacktrace (1.66 KB, text/plain)
2015-09-19 17:45 UTC, Lou Dasaro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shantanoo 2010-12-02 18:53:59 UTC
Build: NetBeans IDE 7.0 Beta (Build 201011152355)
VM: Java HotSpot(TM) 64-Bit Server VM, 17.1-b03-307, Java(TM) SE Runtime Environment, 1.6.0_22-b04-307-10M3261
OS: Mac OS X

User Comments:
shantanoo: Trying to change global paramters for Editor -> Formating, Language - Python

GUEST: I have the python plugin installed. I went to Options -> Editor -> Formatting; selected Python as the language and then selected "Spaces" as the category. After a few seconds loading (netbook) this error popped up.

GUEST: project specific formatting options for python / spaces




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.python.editor.PythonFormatter$1.run(PythonFormatter.java:411)
   at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:314)
   at org.netbeans.modules.python.editor.PythonFormatter.reindent(PythonFormatter.java:349)
   at org.netbeans.modules.python.editor.PythonFormatter.reformat(PythonFormatter.java:126)
   at org.netbeans.modules.python.editor.options.FmtOptions$CategorySupport.refreshPreview(FmtOptions.java:667)
   at org.netbeans.modules.options.indentation.FormattingPanel$3.run(FormattingPanel.java:204)
Comment 1 shantanoo 2010-12-02 18:54:02 UTC
Created attachment 103545 [details]
stacktrace
Comment 2 Exceptions Reporter 2010-12-10 03:18:56 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=174109
Comment 3 michbarsinai 2011-02-20 11:22:21 UTC
Created attachment 106212 [details]
stacktrace

looking at the "spaces" pane in options->editor->formatting [language: python]
Comment 4 Lou Dasaro 2015-09-06 05:39:40 UTC
Created attachment 155920 [details]
stacktrace

Please assign to Python.
To reproduce:
Using an existing Python Ant project, 
Select a project top-level node, invoke Properties->Formatting
Check "Use project specific options"
Change the Category drop-down to "Spaces"
Comment 5 Lou Dasaro 2015-09-19 17:45:00 UTC
Created attachment 156303 [details]
stacktrace

Product = Python
Steps to reproduce
With a project open, Invoke "Project Properties" on that project
Click "Formatting"
Change "Category" to "Spaces"
Exception occurs.
Comment 6 Jenselme 2015-09-29 15:50:37 UTC
user:        Julien Enselme <jenselme@netbeans.org>
date:        Tue Sep 29 17:48:26 2015 +0200
files:       python.source/src/org/netbeans/modules/python/source/PythonFormatter.java
description:
#192816 avoid NullPointerException

Check that context is not null before using it. This prevents the exception from
occuring. However, the parameters are not taken into account.

I'll try to complete the work soon.
Comment 7 Jenselme 2015-11-27 16:50:47 UTC
Presumed fixed in Python .151118 (for IDE 8.1)
Comment 8 Lou Dasaro 2015-11-27 22:22:45 UTC
Verified, Fixed. Presumably by http://hg.netbeans.org/main/contrib/rev/dfeab4f40dfd