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 36623 - I18N Wizard throws NPE
Summary: I18N Wizard throws NPE
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2003-10-15 15:10 UTC by hklerks
Modified: 2007-11-05 13:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hklerks 2003-10-15 15:10:21 UTC
Under certain circumstances, the I18N wizard 
throws a NPE whilst processing selected source 
file(s):

Annotation: Exception occurred in Request 
Processor

java.lang.NullPointerException

	at 
org.netbeans.editor.LineRootElement.fixSyntaxState
Infos(LineRootElement.java:370)

	at 
org.netbeans.editor.DocumentContent$Edit.undoOrRed
o(DocumentContent.java:399)

	at 
org.netbeans.editor.DocumentContent$Edit.<init>
(DocumentContent.java:316)

	at 
org.netbeans.editor.DocumentContent.remove
(DocumentContent.java:82)

	at org.netbeans.editor.BaseDocument.remove
(BaseDocument.java:623)

	at 
org.netbeans.modules.i18n.java.JavaI18nSupport$1.r
un(JavaI18nSupport.java:792)

	at 
org.netbeans.editor.BaseDocument.runAtomicAsUser
(BaseDocument.java:890)

	at 
org.netbeans.editor.GuardedDocument.runAtomic
(GuardedDocument.java:217)

	at org.openide.text.NbDocument.runAtomic
(NbDocument.java:329)

	at 
org.netbeans.modules.i18n.java.JavaI18nSupport$Jav
aI18nReplacer.replace(JavaI18nSupport.java:786)

	at 
org.netbeans.modules.i18n.wizard.HardStringWizardP
anel$Panel.doLongTimeChanges
(HardStringWizardPanel.java:650)

	at 
org.netbeans.modules.i18n.wizard.I18nWizardDescrip
tor$ProgressThread.run
(I18nWizardDescriptor.java:260)

	at org.openide.util.Task.run
(Task.java:136)

	at 
org.openide.util.RequestProcessor$Task.run
(RequestProcessor.java:328)

[catch] at 
org.openide.util.RequestProcessor$Processor.run
(RequestProcessor.java:670)

Note that individual internationalization of each 
file in the selection works OK (which IMO rules 
out the content of the files at hand).
Comment 1 Marian Petras 2004-03-04 17:49:18 UTC
The problem seems to be in module Editor. In the stack trace, the last
call initiated from module I18n is

     org.netbeans.editor.BaseDocument.remove(int, int)

which should should check the passed parameters and throw a
BadLocationException if there are wrong (module I18n would display an
error message dialog then). Since this was not the case, the problem
is somewhere else.
Comment 2 Miloslav Metelka 2004-03-04 18:15:09 UTC
There appears to be null stateInfo in a non-first line element.
Normally this should not happen but we should add a robustness check
for that situation.
Comment 3 Martin Roskanin 2004-09-01 16:09:24 UTC
should be fixed in [maintrunk]
Affected code has been removed as a result of issue #44693 fixing...
Comment 4 Ken Frank 2007-05-29 19:04:10 UTC
v