summaryrefslogtreecommitdiffstats
path: root/util/src
diff options
context:
space:
mode:
Diffstat (limited to 'util/src')
-rw-r--r--util/src/org/aspectj/util/FileUtil.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/util/src/org/aspectj/util/FileUtil.java b/util/src/org/aspectj/util/FileUtil.java
index c7663ae63..34bf103a9 100644
--- a/util/src/org/aspectj/util/FileUtil.java
+++ b/util/src/org/aspectj/util/FileUtil.java
@@ -341,10 +341,14 @@ public class FileUtil {
*/
public static String getBestPath(File file) {
LangUtil.throwIaxIfNull(file, "file");
- try {
- return file.getCanonicalPath();
- } catch (IOException e) {
- return file.getAbsolutePath();
+ if (file.exists()) {
+ try {
+ return file.getCanonicalPath();
+ } catch (IOException e) {
+ return file.getAbsolutePath();
+ }
+ } else {
+ return file.getPath();
}
}