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 151886 - PHP autocompletion causes NPE when completing HTML attribute value quotes
Summary: PHP autocompletion causes NPE when completing HTML attribute value quotes
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomasz Slota
URL:
Keywords: RANDOM
: 136828 152291 152487 154082 156462 159720 166010 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-30 17:09 UTC by Mikhail Matveev
Modified: 2009-09-10 13:31 UTC (History)
10 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exception stacktrace (2.79 KB, text/plain)
2008-10-30 17:09 UTC, Mikhail Matveev
Details
IDE log (21.78 KB, text/plain)
2008-11-06 13:56 UTC, Mikhail Matveev
Details
stacktrace (2.99 KB, text/plain)
2009-03-02 09:17 UTC, cyb3r
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Matveev 2008-10-30 17:09:04 UTC
1. Create a new PHP file.
2. At the end of file, type

<a href="

Result: when you type ", no " symbols appears, and NPE comes.
Comment 1 Mikhail Matveev 2008-10-30 17:09:35 UTC
Created attachment 72930 [details]
Exception stacktrace
Comment 2 Tomasz Slota 2008-11-04 15:21:43 UTC
I am not able to reproduce it. The stack trace doesn't tell me much, it was probably a random failure in the lexer. Please reopen if you can provide steps to 
reproduce it.
Comment 3 Mikhail Matveev 2008-11-05 15:54:09 UTC
I'm able to reproduce it steadily with the steps described above.

Product Version: NetBeans IDE 6.5 RC2 (Build 200810270001)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb)

Do you want me to check it against trunk builds?
Comment 4 Mikhail Matveev 2008-11-06 13:28:09 UTC
Reproducible in FCS.
Comment 5 Tomasz Slota 2008-11-06 13:41:39 UTC
it works for me in trunk as well as in RC2. Can you please attach the full IDE log? Thanks
Comment 6 Mikhail Matveev 2008-11-06 13:56:43 UTC
Created attachment 73377 [details]
IDE log
Comment 7 Mikhail Matveev 2008-11-06 15:17:20 UTC
Can't reproduce on Linux. Possibly a platform-dependent issue.
Comment 8 Mikhail Matveev 2008-11-06 19:06:09 UTC
*** Issue 152487 has been marked as a duplicate of this issue. ***
Comment 9 Mikhail Matveev 2008-11-06 19:07:55 UTC
See also 152147. So it seems that it happens when you type " or ' at the last line of file.
Comment 10 Mikhail Matveev 2008-11-28 18:52:41 UTC
*** Issue 154082 has been marked as a duplicate of this issue. ***
Comment 11 Mikhail Matveev 2008-12-23 17:42:48 UTC
*** Issue 136828 has been marked as a duplicate of this issue. ***
Comment 12 Tomasz Slota 2009-01-07 10:41:33 UTC
*** Issue 152291 has been marked as a duplicate of this issue. ***
Comment 13 Tomasz Slota 2009-01-08 16:11:03 UTC
*** Issue 156462 has been marked as a duplicate of this issue. ***
Comment 14 cyb3r 2009-03-02 09:17:21 UTC
Build: NetBeans IDE 6.5 (Build 200811100001)
VM: Java HotSpot(TM) Client VM, 10.0-b23, Java(TM) SE Runtime Environment, 1.6.0_07-b06
OS: Windows XP, 5.1, x86

User Comments: 
Cant input quotation marks in Editor when creating link (<a href=)
In PHP code in this same documents, marks works fine.

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.php.editor.indent.PHPBracketCompleter.completeQuote(PHPBracketCompleter.java:1629)
        at org.netbeans.modules.php.editor.indent.PHPBracketCompleter.beforeCharInserted(PHPBracketCompleter.java:902)
        at org.netbeans.modules.gsf.GsfEditorKitFactory$GsfEditorKit$GsfDefaultKeyTypedAction.insertString(GsfEditorKitFactory.java:265)
        at org.netbeans.editor.BaseKit$DefaultKeyTypedAction$1.run(BaseKit.java:1113)
        at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:354)
        at org.netbeans.editor.BaseKit$DefaultKeyTypedAction.actionPerformed(BaseKit.java:1084)
Comment 15 cyb3r 2009-03-02 09:17:35 UTC
Created attachment 77539 [details]
stacktrace
Comment 16 Marian Mirilovic 2009-03-26 14:06:54 UTC
145 duplicates ... P2

Tomas, all reports are for NB 6.5 & 2 reports for NB 6.5.1 so far, so FIXED ?
Comment 17 Filip Zamboj 2009-03-26 19:39:54 UTC
was not reproduced nor on WIN nor on Ubuntu
 
Product Version: NetBeans IDE Dev (Build 200903260733)
Java: 1.6.0_12; Java HotSpot(TM) Client VM 11.2-b01

Tomas, it's fixed or should we expect some fix here?  
Comment 18 Tomasz Slota 2009-03-30 14:08:30 UTC
This NPE is thrown is a pretty obscure part of code. This issue is random and I cannot reproduce it and therefore cannot determine the real source of the 
problem.

I was reluctant to commit a hotfix earlie but I am doing it now as it seems to be a safe solution:
http://hg.netbeans.org/web-main/rev/13c3d3dedced
Comment 19 Filip Zamboj 2009-03-30 14:40:07 UTC
I can't reproduce on 
Product Version: NetBeans IDE Dev (Build 200903291205)
Java: 1.6.0_13; Java HotSpot(TM) 64-Bit Server VM 11.3-b02

Is there somebody who can? Please submit a report if yes. 

Comment 20 Quality Engineering 2009-04-03 07:50:21 UTC
Integrated into 'main-golden', will be available in build *200904030200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/13c3d3dedced
User: Tomasz Slota <tslota@netbeans.org>
Log: #151886: PHP autocompletion causes NPE when completing HTML attribute value quotes
Comment 21 Filip Zamboj 2009-04-20 16:49:57 UTC
verified ... again sorry for the mess I did with reopening 
Comment 22 Jiri Prox 2009-05-27 13:38:21 UTC
*** Issue 166010 has been marked as a duplicate of this issue. ***
Comment 23 Filip Zamboj 2009-09-10 13:31:01 UTC
*** Issue 159720 has been marked as a duplicate of this issue. ***