Java Model Status "Invalid name specified" exception - Possible bug [message #695939] |
Tue, 12 July 2011 21:47  |
Eclipse User |
|
|
|
Hi there.
I have the following piece of code:
try {
for (IPackageFragmentRoot root : project.getPackageFragmentRoots()) {
if (root.getElementName().equals("src")) {
for (ICompilationUnit unit : root.getPackageFragment("soap.service.implementation.strongProfile.delegate").getCompilationUnits()) {
for (IImportDeclaration dec : unit.getImports()) {
dec.rename("soap.service.implementation.reader.HeadlineReader", true, null);
}
}
}
}
}catch(Exception e) {
e.printStackTrace();
}
For some strange reason, I keep getting the following exception
Java Model Exception: Java Model Status [Invalid name specified: soap.service.implementation.reader.HeadlineReader]
I actually take the import from the exception that is printed out in the console and paste it into my class and it works fine. Is this an Eclipse bug?! Is there another way that I can rename an import in an ICompilation unit? Please help. thanks
[Updated on: Wed, 13 July 2011 21:05] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03957 seconds