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 232416 - NullPointerException at org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction.updateButton
Summary: NullPointerException at org.netbeans.modules.web.clientproject.browser.Active...
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Project (show other bugs)
Version: 7.4
Hardware: All All
: P1 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-09 04:50 UTC by Tomas Mysik
Modified: 2013-07-10 12:05 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 201986


Attachments
stacktrace (4.04 KB, text/plain)
2013-07-09 04:50 UTC, Tomas Mysik
Details
fix (1.11 KB, patch)
2013-07-09 05:02 UTC, David Konecny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Mysik 2013-07-09 04:50:53 UTC
Build: NetBeans IDE Dev (Build 20130708-b54b07514cda)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.25-b01, Java(TM) SE Runtime Environment, 1.7.0_25-b15
OS: Linux

User Comments:
tmysik: - start ide with html5 project opened
- open php project

-> NPE




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction.updateButton(ActiveBrowserAction.java:352)
   at org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction.activeProjectChanged(ActiveBrowserAction.java:321)
   at org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction.refreshView(ActiveBrowserAction.java:296)
   at org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction.access$500(ActiveBrowserAction.java:106)
   at org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction$6.run(ActiveBrowserAction.java:288)
   at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
Comment 1 Tomas Mysik 2013-07-09 04:50:55 UTC
Created attachment 136849 [details]
stacktrace
Comment 2 David Konecny 2013-07-09 05:02:43 UTC
Created attachment 136850 [details]
fix

I introduced this recently via issue 231455. Tomas could you please push the fix (and review it) if you can - I'm in the middle of a big refactoring and will need half a day more to finish it. Depending on how often this bug happens QA may want us to fix this for Beta - the fix is trivial. Thanks.
Comment 3 Tomas Mysik 2013-07-09 05:32:47 UTC
Taking over, will do that (the patch seems fine to me, of course). Láďo, please check whether this fix should be transplanted to Beta branch.

Thanks.
Comment 4 Tomas Mysik 2013-07-09 05:44:44 UTC
Fixed.

http://hg.netbeans.org/web-main/rev/c95b20f796a7
Comment 5 Vladimir Riha 2013-07-09 06:36:19 UTC
OK, the fix looks safe. 

musilt2: Tomasi, is there still a time to transplant it to Beta? I could verify it in web-main build (eta around noon) so we don't have to wait for trunk.
Comment 6 Tomas Danek 2013-07-09 06:44:08 UTC
Fix can technically go to beta, question is: why P3 with just one report?  How often this can happend?

(In reply to comment #5)
> OK, the fix looks safe. 
> 
> musilt2: Tomasi, is there still a time to transplant it to Beta? I could verify
> it in web-main build (eta around noon) so we don't have to wait for trunk.
Comment 7 Tomas Mysik 2013-07-09 06:49:21 UTC
(In reply to comment #6)
> Fix can technically go to beta, question is: why P3 with just one report?  How
> often this can happend?

Question for David.
Comment 8 Vladimir Riha 2013-07-09 07:03:18 UTC
Finally I managed to reproduce it with some older PHP project. If you have say 2 projects A and B (the "older" in my case), then it pops out whenever browser picker should be updated to reflect browser of the B (so e.g. if you focus file/folder/project node in Projects from B when something from project A was focused prior this change).

I didn't reproduce it with other PHP projects though.
Comment 9 Tomas Mysik 2013-07-09 07:08:31 UTC
(In reply to comment #8)
> Finally I managed to reproduce it with some older PHP project.

So every our PHP user will be able to reproduce this issue with Beta? Láďo, please create a PHP project in NB 7.3 and then open it in Beta and we will see.

Thanks.
Comment 10 Vladimir Riha 2013-07-09 07:28:37 UTC
As I wrote, I reproduced it with only one particular project, I'm not sure in which version it was created (folder's timestamp points to March 2013). I tried to create project in 7.3, 7.3.1 and some June trunk build and if I opened them in [1], I didn't reproduce it.


Product Version: NetBeans IDE Dev (Build 201307082300)
Comment 11 Tomas Mysik 2013-07-09 07:33:36 UTC
In such case, let's wait for David.

Thanks.
Comment 12 Vladimir Riha 2013-07-09 07:39:05 UTC
Note for reproducing:
 - PHP project, no mention about browser in nbproject/private/private.properties and in nbproject/project.properties, add following:

browser.id=SL[/Browsers/ChromeBrowser.INTEGRATED
browser.reload.on.save=true
Comment 13 Vladimir Riha 2013-07-09 08:35:45 UTC
I tried web-main build with the fix and the I cannot reproduce it the way I described in previous comment. Also nothing happens with projects from 7.3/7.3.1. If I now run the project, IDE's default browser is used. So I think it is OK => verified


However once I click on browser picker in main toolbar, I get issue 231194 (I guess it's not in web-main yet). The workaround is easy, use Project Properties to change browser and it is less intrusive than this issue so not a stopper. I'm just wondering how come the browser.id has incorrect (or maybe obsolote) value in project.properties? 




Product Version: NetBeans IDE Dev (Build web-main-11010-on-20130709)
Java: 1.7.0_25; Java HotSpot(TM) Client VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b15
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 14 Tomas Mysik 2013-07-09 08:51:35 UTC
(In reply to comment #13)
> I'm just wondering how come the browser.id has incorrect (or maybe obsolote)
> value in project.properties? 

Add a browser in Tools > Options, select it for project and then remove it from Tools > Options?
Comment 15 Vladimir Riha 2013-07-09 13:52:02 UTC
Yes, these steps does something similar, I'm just not sure I've ever done it :)


Anyway, Tomasi, please transplant to Beta. Thank you
Comment 16 Tomas Mysik 2013-07-09 14:20:37 UTC
(In reply to comment #15)
> Anyway, Tomasi, please transplant to Beta. Thank you

Done.

Thanks.

http://hg.netbeans.org/releases/rev/913ef516d4f4
Comment 17 David Konecny 2013-07-09 21:07:58 UTC
Thanks guys!

RE. how to reproduce - I wouldn't know. From code it looks that project's ProjectBrowserProvider.getActiveBrowser() returns null. Perhaps changing value of browser.id property to some non-existent browser like "blabla" could trigger this? There were times in the past when browser IDs got renamed little bit and I wonder whether that old PHP project was using this obsolete renamed browser ID and consequently project's active browser become "null".
Comment 18 Quality Engineering 2013-07-10 02:43:09 UTC
Integrated into 'releases/release74_beta1', will be available in build *201307092200* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/913ef516d4f4
User: Tomas Mysik <tmysik@netbeans.org>
Log: #232416 - NullPointerException at org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction.updateButton
(transplanted from c95b20f796a793512bd5caf6bf159589900a82dd)
Comment 19 Quality Engineering 2013-07-10 04:42:44 UTC
Integrated into 'main-silver', will be available in build *201307100049* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c95b20f796a7
User: Tomas Mysik <tmysik@netbeans.org>
Log: #232416 - NullPointerException at org.netbeans.modules.web.clientproject.browser.ActiveBrowserAction.updateButton
Comment 20 Vladimir Riha 2013-07-10 10:30:08 UTC
verified in Beta

Product Version: NetBeans IDE 7.4 Beta (Build 201307092200)
Java: 1.7.0_25; Java HotSpot(TM) Client VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b15
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)