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 199243 - NullPointerException at org.netbeans.modules.php.editor.model.impl.ModelVisitor.visit
Summary: NullPointerException at org.netbeans.modules.php.editor.model.impl.ModelVisit...
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0
Hardware: All All
: P2 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
: 197826 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-07 19:25 UTC by whedro
Modified: 2011-09-23 09:17 UTC (History)
8 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 176542


Attachments
stacktrace (5.72 KB, text/plain)
2011-06-07 19:25 UTC, whedro
Details
stacktrace (5.72 KB, text/plain)
2011-07-09 17:07 UTC, Martin Fousek
Details
stacktrace (5.91 KB, text/plain)
2011-07-12 08:01 UTC, Tomas Mysik
Details
stacktrace (5.91 KB, text/plain)
2011-07-15 10:13 UTC, Tomas Mysik
Details
stacktrace (5.91 KB, text/plain)
2011-07-22 09:02 UTC, Tomas Mysik
Details
stacktrace (5.91 KB, text/plain)
2011-08-23 18:51 UTC, Martin Fousek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description whedro 2011-06-07 19:25:00 UTC
Build: NetBeans IDE 7.0 (Build 201104080000)
VM: Java HotSpot(TM) 64-Bit Server VM, 19.1-b02, Java(TM) SE Runtime Environment, 1.6.0_24-b07
OS: Windows 7

User Comments:
GUEST: Scanning a Symfony 2 project

GUEST: Opened a Project with the IDE. After that the "Scanning Projects" started and came up with this error after some minutes.

LuoJun: code php5.3 namespace, project set version is php5.1/5.2.




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.php.editor.model.impl.ModelVisitor.visit(ModelVisitor.java:882)
   at org.netbeans.modules.php.editor.parser.astnodes.FunctionDeclaration.accept(FunctionDeclaration.java:116)
   at org.netbeans.modules.php.editor.parser.astnodes.visitors.DefaultVisitor.scan(DefaultVisitor.java:54)
   at org.netbeans.modules.php.editor.model.impl.ModelVisitor.scan(ModelVisitor.java:173)
   at org.netbeans.modules.php.editor.parser.astnodes.visitors.DefaultVisitor.scan(DefaultVisitor.java:61)
   at org.netbeans.modules.php.editor.parser.astnodes.visitors.DefaultVisitor.visit(DefaultVisitor.java:93)
Comment 1 whedro 2011-06-07 19:25:04 UTC
Created attachment 108785 [details]
stacktrace
Comment 2 Petr Pisl 2011-06-08 09:14:12 UTC
I don't know why this happen. Basically it shouldn't happen. I will add a few logs.
Comment 3 Martin Fousek 2011-07-09 17:07:50 UTC
Created attachment 109343 [details]
stacktrace

1, added folder with nette.min onto include path
-> NPE appears
Comment 4 Tomas Mysik 2011-07-12 08:01:50 UTC
Created attachment 109386 [details]
stacktrace

PHP project with Nette plugin
Comment 5 Tomas Mysik 2011-07-15 10:13:56 UTC
Created attachment 109451 [details]
stacktrace

first open of php project with nette framework (with minimized nette version)
Comment 6 Tomas Mysik 2011-07-22 09:02:08 UTC
Created attachment 109566 [details]
stacktrace
Comment 7 Tomas Mysik 2011-07-22 09:15:59 UTC
33 duplicates, increasing priority.

Have a look at the Exception Reporter page for possible steps to reproduce.

Thanks.
Comment 8 OndrejBrejla 2011-07-22 09:25:10 UTC
It appears when there is a file which contains a namespace declaration using bracket notation with no name (so it's default namespace). I.e. minified nette framework file.

It can't be simply fixed on the line of occurace with "!= null" expression, because then appears another CCE at another place, so I think that it should be fixed deeper...but I don't see that bottom ;) So reassigning to Petr.
Comment 9 Marian Mirilovic 2011-07-24 16:47:37 UTC
not for 7.0.1
Comment 10 Martin Fousek 2011-08-23 18:51:42 UTC
Created attachment 110168 [details]
stacktrace

opened Nette project
Comment 11 Petr Pisl 2011-08-26 09:18:20 UTC
It looks like the problem is when there are more default namespaces in one file.
Comment 12 Petr Pisl 2011-08-26 14:04:32 UTC
Fixed in webmain
Comment 13 Quality Engineering 2011-08-27 14:13:52 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/98afd1d004d1
User: Petr Pisl <ppisl@netbeans.org>
Log: #199243 - NullPointerException at org.netbeans.modules.php.editor.model.impl.ModelVisitor.visit
Comment 14 Ondrej Brejla 2011-09-07 13:51:57 UTC
*** Bug 197826 has been marked as a duplicate of this bug. ***
Comment 15 Vladimir Riha 2011-09-23 09:17:37 UTC
verified