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 124887

Summary: Show History throws NPE
Product: versioncontrol Reporter: Jiri Skrivanek <jskrivanek>
Component: MercurialAssignee: issues@versioncontrol <issues>
Status: VERIFIED WORKSFORME    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: Proposed patch

Description Jiri Skrivanek 2008-01-08 13:58:23 UTC
NullPointerException is thrown when you call Show History command. To reproduce:

- hg clone http://hg.netbeans.org/main
- open main/openide.util
- open org.openide.LifecycleManager.java
- call 'Mercurial|Show History' but it fails with NPE and it the output window is printed history but project name is null:

INFO History for file(s): [D:\Development\hg\main\openide.util\src\org\openide\LifecycleManager.java]
INFO Project Name:   null


Mercurial Pluging: 1.4.3.42.1
Mercurial Runtime: 0.9.5
Product Version: NetBeans IDE Dev (Build 20080107122025)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
Comment 1 Padraig Obriain 2008-01-09 11:41:40 UTC
This works for me on Solaris. I get a project name of "Utilities API".

We should avoid the NPE if project name is null.
Comment 2 John Rice 2008-01-11 23:52:33 UTC
Can't reproduce this on Windows XP with plugin from CVS Head. Added some additional checking to avoid NPE in the
getProjectName() code.

INFO History for file(s): [C:\main\openide.util\src\org\openide\LifecycleManager.java]
INFO Project Name:   Utilities API

If you can reproduce it, please reopen and attach the stack trace for the NPE.
Comment 3 John Rice 2008-01-11 23:56:02 UTC
Created attachment 54984 [details]
Proposed patch
Comment 4 John Rice 2008-01-11 23:58:18 UTC
IDE:-------------------------------------------------
IDE: [11/01/08 23:57] Committing started
Checking in HgProjectUtils.java;
/cvs/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/util/HgProjectUtils.java,v  <--  HgProjectUtils.java
new revision: 1.10; previous revision: 1.9
done
IDE: [11/01/08 23:57] Committing finished
Comment 5 Jiri Skrivanek 2008-01-14 14:51:05 UTC
Verified. It works for me with latest plugin.