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 148655 - NullPointerException at org.netbeans.modules.cnd.completion.csm.CsmContextUtilities.isInContext
Summary: NullPointerException at org.netbeans.modules.cnd.completion.csm.CsmContextUti...
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Alexander Simon
URL: http://statistics.netbeans.org/except...
Keywords:
: 148978 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-09-29 17:37 UTC by _ alexlamsl
Modified: 2008-12-17 15:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 120327


Attachments
stacktrace (3.15 KB, text/plain)
2008-09-29 17:37 UTC, _ alexlamsl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ alexlamsl 2008-09-29 17:37:28 UTC
Build: NetBeans IDE Dev (Build 200809181401)
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:
alexlamsl: adding "static unsigned short _getM(co|)" in between static methods



Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.cnd.completion.csm.CsmContextUtilities.isInContext(CsmContextUtilities.java:442)
        at org.netbeans.modules.cnd.completion.csm.CsmContextUtilities.canBreak(CsmContextUtilities.java:391)
        at org.netbeans.modules.cnd.completion.csm.CsmContextUtilities.findEntryDeclarations(CsmContextUtilities.java:307)
        at org.netbeans.modules.cnd.completion.csm.CsmContextUtilities.addEntryDeclarations(CsmContextUtilities.java:295)
        at org.netbeans.modules.cnd.completion.csm.CsmContextUtilities.findLocalDeclarations(CsmContextUtilities.java:286)
        at org.netbeans.modules.cnd.completion.csm.CsmContextUtilities.findFunctionLocalDeclarations(CsmContextUtilities.java:124)
Comment 1 _ alexlamsl 2008-09-29 17:37:38 UTC
Created attachment 70815 [details]
stacktrace
Comment 2 nnnnnk 2008-09-29 19:02:04 UTC
I can not reproduce this situation.
Please, could you provide example with more details?
Comment 3 _ alexlamsl 2008-09-30 15:33:34 UTC
I would love to - except that it is not a readily reproducible issue, it seems. After the report got sent and I 
restarted the IDE, the problem seems to be gone.

One thing though - whenever I restart my IDE, the .c file which I kept opened would almost always fail to have "Mark 
Occurances" working, however long I wait or edit the file.
Comment 4 nnnnnk 2008-09-30 15:57:24 UTC
I close this bug as WORKSFORME.
If you find the way to reproduce situation, please, reopen it.
Any way thank you very mach for you report.
Comment 5 _ alexlamsl 2008-10-07 10:57:07 UTC
Product Version: NetBeans IDE Dev (Build 200810040600)
Java: 1.6.0_07; Java HotSpot(TM) Client VM 10.0-b23
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)


Run into it again - but again, not readily reproducible.
Things I have done before it crash:

1) Adding a lot of comment sections into .c and .h (in pair)
2) Copied a comment section from a function (and declaration, without '{' or ';')
3) Ctrl+Click on the function in .c to jump to .h
4) Attempt to paste the comment onto the function in .h (replacing declaration line - so ';' is temporarily missing)

The editor becomes suspiciously sluggish (less than responsive) for some minutes (still usable) before this happens.
Comment 6 _ alexlamsl 2008-10-07 11:14:20 UTC
Just to add that the .c file I'm editing contains code that would trigger #148729
Comment 7 Alexander Simon 2008-10-07 13:07:49 UTC
please, review fix:
http://elif.russia.sun.com/hg/release65_cnd_freeze/rev/0768c2fa647f
Comment 8 Alexey Vladykin 2008-10-07 14:13:03 UTC
I've reviewed the fix and approve it. The only minor suggestion is to make logic in "public <T> T[] toArray(T[] a)" less
messy. Usages of "a" and "result" are a bit confusing. And the following line is redundant:
      34+            result = a;
Comment 9 sreque 2008-10-07 16:03:13 UTC
I just got this crash while using the development version of netbeans 6.5 that was up to date as of yesterday morning.
It was reported in report #120327.
 
Comment 10 sreque 2008-10-07 16:08:51 UTC
I didn't take the time to notice that you posted that you had the fix for the problem two hours before I posted that I
had seen the bug :).
Comment 11 Alexander Simon 2008-10-07 17:39:28 UTC
cosmetic changes:
http://elif.russia.sun.com/hg/release65_cnd_freeze/rev/163e825967ba
Comment 12 Alexander Simon 2008-10-08 07:13:05 UTC
*** Issue 148978 has been marked as a duplicate of this issue. ***
Comment 13 soldatov 2008-10-08 11:29:57 UTC
can not reproduce this problem in build from endif
Comment 14 Alexander Simon 2008-10-08 12:24:54 UTC
fixed in main trunk, change set:
http://hg.netbeans.org/main/rev/425df52a7f3c
Comment 15 Quality Engineering 2008-10-09 05:57:18 UTC
Integrated into 'main-golden', will be available in build *200810090201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/425df52a7f3c
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed: IZ#148655:NullPointerException at org.netbeans.modules.cnd.completion.csm.CsmContextUtilities.isInContext
Comment 16 ahot 2008-12-17 15:52:00 UTC
can not reproduce this problem in Build 200812170201