public String getCompletePath() {
StringBuilder completePath = new StringBuilder();
ProjectFileImpl currentProjectFile = this;
- do {
- completePath.insert(0, File.separatorChar).insert(0, this.getName());
- } while ((currentProjectFile = currentProjectFile.parentProjectFile) != null);
- return completePath.substring(1);
+ while ((currentProjectFile != null) && (currentProjectFile.parentProjectFile != null)) {
+ completePath.insert(0, currentProjectFile.getName()).insert(0, File.separatorChar);
+ currentProjectFile = currentProjectFile.parentProjectFile;
+ }
+ return completePath.toString();
}
/**