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 167960 - Codecoverage throws exception for main project in localized IDE
Summary: Codecoverage throws exception for main project in localized IDE
Status: NEW
Alias: None
Product: contrib
Classification: Unclassified
Component: Codecoverage (show other bugs)
Version: 6.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Martin Schovanek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-01 13:43 UTC by _ recjake
Modified: 2009-07-01 13:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ recjake 2009-07-01 13:43:45 UTC
When using a localized version of NetBeans an exception occurs and the code coverage can not become enabled.

Steps to reproduce
1. Use a localized version of NetBeans (at least JavaSE should be localized)
2. Create a project with existing sources and set it as main project
3. Open the context menu of that project (menuitem "Codecoverage" is disabled)
4. Move mouse down the menuitem

Exception can be found in the error log:
java.lang.NullPointerException
	at org.netbeans.modules.coverage.config.ProjectPropertiesReader.loadProjectProperties
(ProjectPropertiesReader.java:94)
	at org.netbeans.modules.coverage.config.Config.getInstanceForProject(Config.java:74)
	at org.netbeans.modules.coverage.utils.ModuleActivityModes.isModuleActive(ModuleActivityModes.java:72)
	at org.netbeans.modules.coverage.ProjectMenuAction$ProjectContextAwareMenuAction$ProjectMenuItems.getActions
(ProjectMenuAction.java:194)
	at org.netbeans.modules.coverage.ProjectMenuAction$ProjectContextAwareMenuAction$ProjectMenuItems.setSelected
(ProjectMenuAction.java:161)
	at javax.swing.JMenu.menuSelectionChanged(Unknown Source)


Probable Reason:
In class "ProjectMenuAction" following invocation is done:
  ProjectStructureUtils.selectProjectByName(nodes[0].getDisplayName())

The used node is a BadgingNode which wraps a normal ProjectNode.
If now a project is set as main, the display name of the node will get the appendix "[Main]" (in the english version).

In the above invoked method this appendix is appended hard coded to a project's display name. So the project will never 
be found.