Community
Participate
Working Groups
From EC: "When I create a compilation unit using: IPackageFragment.createCompilationUnit("test.java", "", true, null); and "test.java" already exists, it does not overwrite it and instead throws a CoreException. My understanding of the force flag was that if it was set to true, it would automatically overwrite any compilation units of the same name, if they existed. However, when I set the flag to either false or true, it complains about "test.java" already existing." This is still true in latest. If the flag force is true, the existing compilation unit should be overriden. If false, the actual behavior is correct.
The operation used is a CreateCompilationUnit operation. The documentation says that this operation will fail if the compilation unit already exists. The flag force is passed to the IFile.create method where the meaning is the way the plaform should handle files which are not synchronized with the local file system. So I guess there is a confusion in the meaning of the flag force between the JDT/Core API and the Platform/Core API. CreateCompilationUnitOperation should not fail if the compilation unit already exists and the flag is true. It should simply override the contents of the existing compilation unit.
Agreed.
Fixed and released in HEAD. Model tests updated.
>> Fixed and released in HEAD. Model tests updated. What do you mean by this? What should I download to get this fix?
It means that the fix is ready for the next integration build or night build. So wait for the next integration build and you will get the fix. Is this ok for you?
I'm currently using IBM WebSphere Application Developer, which is built on the Eclipse platform. Thus, I don't think I can just download the newest build, right? Is there a way I can just replace the newest eclipse jar (for that class) on top of the one I currently have?