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.
build 070105 IllegalStateException, when you create a New Project. See attachment
Created attachment 37075 [details] IllegalStateException
When I am creating a new file from MIDP|VisualMIDlet template, I get similar exception. I am attaching a list of stack traces (stack-traces.txt) for all setValid method calls during the file creation. Honzo, do you have an idea what is wrong?
Created attachment 37077 [details] List of stack traces of DataObject.setValid method calls
While creating a mobile data object from template there is a stage when just the .java file exists so a JavaDataObject is created as a side effect of performing some refactorings. IMO ProjectUtilities$3.run should check the data object validity (according to issue #17020). Another possibility would be to copy secondary files before the primary one (.java).
I'm just wondering - isn't it possible to copy files in a kind of atomic operation so the DataObject is not recognized until all files are there?
Fixed in FileWizardIterator by searching again for a valid data object after the one created from template is returned.
DataObject.createFromTemplate does copy files inside the atomic section. Anyway we have found the fix for the template wizard iterator in order to return the valid data object. David put it to cvs.
Observed the same exception M6 build using JDK 1.5.0_11 on XP java.lang.IllegalStateException: The data object MasterFileObject@866463[C:/Documents and Settings/user1/My Documents/NetBeansProjects/MobileApplication6/src/hello/HelloMidlet.java] is invalid; you may not call getNodeDelegate on it any more; see #17020 and please fix your code at org.openide.loaders.DataObject.getNodeDelegate(DataObject.java:245) at org.netbeans.modules.project.ui.ProjectUtilities$3.run(ProjectUtilities.java:251) at org.openide.util.Mutex.doEvent(Mutex.java:1181) at org.openide.util.Mutex.writeAccess(Mutex.java:376)
build 070115 The exception appears altmost everytime when you create a new project.
Fixed. Forcing invalidation of a data object created from HelloMidlet.java template during new-project-creation. Please, test it on your machine since this is bad race-condition and I am not sure whether the change fixes every case.
works in 070116-m6 build