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 162491 - ClassCastException: org.netbeans.modules.cnd.makeproject.MakeProject
Summary: ClassCastException: org.netbeans.modules.cnd.makeproject.MakeProject
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Milan Kubec
URL: http://statistics.netbeans.org/except...
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2009-04-13 05:40 UTC by Exceptions Reporter
Modified: 2009-05-13 07:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 116871


Attachments
stacktrace (1.26 KB, text/plain)
2009-04-13 05:41 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2009-04-13 05:40:59 UTC
Build: NetBeans IDE 6.5 (Build 200811100001)
VM: Java HotSpot(TM) 64-Bit Server VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03
OS: Windows Vista, 6.0, amd64

User Comments:
vieiro: Again, closing a project

akrasny: On change host in CND

vieiro: Closing a module project (inside a module suite)

sreque: I closed a C project. There were no remaining open projects.



Stacktrace: 
java.lang.ClassCastException: org.netbeans.modules.cnd.makeproject.MakeProject
        at org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.saveProject(AntBasedProjectFactorySingleton.java:285)
        at org.netbeans.api.project.ProjectManager$6.run(ProjectManager.java:597)
        at org.netbeans.api.project.ProjectManager$6.run(ProjectManager.java:587)
        at org.openide.util.Mutex.writeAccess(Mutex.java:433)
        at org.netbeans.api.project.ProjectManager.saveProject(ProjectManager.java:586)
        at org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfigurationDescriptor.ConfigurationProjectXMLWriter(MakeConfigurationDescriptor.java:622)
Comment 1 Exceptions Reporter 2009-04-13 05:41:04 UTC
Created attachment 79958 [details]
stacktrace
Comment 2 Jesse Glick 2009-04-13 16:22:04 UTC
Possibly due to an attempt to save a project still inside its constructor?
Comment 3 Vladimir Voskresensky 2009-04-15 04:39:12 UTC
same exception on saving NbModuleProject, so probably not related to CND at all
http://statistics.netbeans.org/exceptions/exception.do?id=126091
http://statistics.netbeans.org/exceptions/exception.do?id=126093
somehow project disappeared from AntBasedProjectFactorySingleton.project2Helper collection => couldn't be find on
saveProject call:
    public void saveProject(Project project) throws IOException, ClassCastException {
        Reference<AntProjectHelper> helperRef = project2Helper.get(project);
        if (helperRef == null) {
            throw new ClassCastException(project.getClass().getName());
        }
        ........
Btw, do not see, any project2Helper.remove calls.
May be it's worth to extend exception message and print content of project2Helper map with hash codes of entries + hash
code of input parameter
Comment 4 Vladimir Voskresensky 2009-04-15 04:41:30 UTC
re# "Possibly due to an attempt to save a project still inside its constructor?"
in cnd related stacks I see exception on saving during close project + saving on project property change, nothing in
construction phase, so project should be in list of opened projects
Comment 5 Jesse Glick 2009-04-15 18:18:58 UTC
Probably nothing to be done for now except improve diagnostic message, unless it is known how to reproduce.
Comment 6 Milan Kubec 2009-04-23 10:42:36 UTC
Anybody able to reproduce the issue? On current dev build?

Only project types in those reports are apisupport project and CND project.
Comment 7 Vladimir Voskresensky 2009-04-23 10:51:50 UTC
even if it is not reproducible, could you, please, extend error message information with I suggested (content of
project2Helper map with hash codes of entries + hash code of input parameter)

Btw, it could be related to non symmetric equals between real project and lazy project. See OpenProjects.isProjectOpen
which uses double equals check
Comment 8 Milan Kubec 2009-05-12 10:33:36 UTC
Better diagnostic message will be printed in the exception.

http://hg.netbeans.org/cdev/rev/73533aefffb7
Comment 9 Quality Engineering 2009-05-13 07:40:30 UTC
Integrated into 'main-golden', will be available in build *200905130201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/73533aefffb7
User: Milan Kubec <mkubec@netbeans.org>
Log: #162491: better diagnostic message