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 137482 - NullPointerException at org.netbeans.modules.gsfret.hints.infrastructure.SuggestionsTask.run
Summary: NullPointerException at org.netbeans.modules.gsfret.hints.infrastructure.Sugg...
Status: VERIFIED FIXED
Alias: None
Product: groovy
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Torbjorn Norbye
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-17 20:00 UTC by cfrias
Modified: 2008-10-30 14:25 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 63762


Attachments
stacktrace (31 bytes, text/plain)
2008-06-17 20:00 UTC, cfrias
Details
stacktrace (793 bytes, text/plain)
2008-06-24 14:31 UTC, cfrias
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cfrias 2008-06-17 20:00:48 UTC
Build: NetBeans IDE Dev (Build 200806160002)
VM: Java HotSpot(TM) Client VM, 10.0-b22, Java(TM) SE Runtime Environment, 1.6.0_06-b02
OS: Linux, 2.6.22-14-generic, i386

User Comments: 
trying to open a groovy service from within a grails app
Comment 1 cfrias 2008-06-17 20:00:59 UTC
Created attachment 62951 [details]
stacktrace
Comment 2 Torbjorn Norbye 2008-06-18 19:13:02 UTC
The stacktrace attachment only contains the word "NullPointerException", no actual stacktrace. I'm not sure what's going
on here, but since it's related to Groovy and the hints provider API, I'm hoping maybe Matthias can look at this first
and either figure out how to reproduce it, or examine the Groovy hints provider to make sure it's doing the right thing,
before asssigning it back if the problem is in GSF.
Comment 3 schmidtm 2008-06-23 16:18:15 UTC
Hi,

after opening some 20 services from my grails projects i was not able to reproduce this error. 

Could you somehow share a testcase with us?
Comment 4 cfrias 2008-06-24 14:31:29 UTC
Created attachment 63338 [details]
stacktrace
Comment 5 schmidtm 2008-06-24 15:04:54 UTC
Hi "cfrias",

Thanks for the stacktrace. This looks much better now.

@Tor: I think we should put a null guard here (sfret/hints/infrastructure/SuggestionsTask.java): 

    99	        HintsProvider provider = language.getHintsProvider();
   100	        assert provider != null; // getHintsProviderLanguage will return null if there's no provider
   101	        GsfHintsManager manager = language.getHintsManager();
   102	        RuleContext ruleContext = manager.createRuleContext(info, language, pos, -1, -1);

Could you take a look why language.getHintsManager() returns null?


Comment 6 schmidtm 2008-07-21 17:21:39 UTC
Hi Tor,

could you take a look at this issue? Under some circumstances language.getHintsManager() returns null. Although I wasn't able to reproduce this case, i 
would place a guard against null in line # 102.
Comment 7 Torbjorn Norbye 2008-07-21 19:59:05 UTC
There is something wrong going on here. If you look at language.getHintsProvider(), it should not be possible to call
language.getHintsManager() afterwards and get null back. Perhaps it's a race condition? I'm concerned that simply adding
a null pointer there is going to push the problem downstream to something trickier to figure out.
Comment 8 Torbjorn Norbye 2008-07-23 23:13:19 UTC
I've tried to make initialization safer.

Fixed in changeset 73e65900a47d.
Comment 9 Lukas Jungmann 2008-10-02 18:11:23 UTC
reporter, can I ask you to verify this, please? Thanks.
Comment 10 Lukas Jungmann 2008-10-13 14:37:19 UTC
v. Feel free to reopen if this appears again. Thanks.