IllegalStateException, when you create a New Project. See attachment
Created attachment 37075 [details]
When I am creating a new file from MIDP|VisualMIDlet template, I get similar
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
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
invalid; you may not call getNodeDelegate on it any more; see #17020 and please
fix your code
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