diff options
author | Roel Spilker <r.spilker@gmail.com> | 2011-07-18 23:49:26 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2011-07-18 23:49:26 +0200 |
commit | a24daba66ce4705429b266972319ad15b1db0d70 (patch) | |
tree | 64ff8bedd8fced00f72e0a356ce0da80bde97ce4 /src/core/lombok | |
parent | 23754573c1221c70596b6287a68b05580f7c39e9 (diff) | |
download | lombok-a24daba66ce4705429b266972319ad15b1db0d70.tar.gz lombok-a24daba66ce4705429b266972319ad15b1db0d70.tar.bz2 lombok-a24daba66ce4705429b266972319ad15b1db0d70.zip |
Upgraded the issue 164 reporter to replace what we had. I think we'll roll this out in 0.10.0-RC2.
Diffstat (limited to 'src/core/lombok')
-rw-r--r-- | src/core/lombok/core/debug/DebugSnapshot.java | 2 | ||||
-rw-r--r-- | src/core/lombok/core/debug/DebugSnapshotStore.java | 7 | ||||
-rw-r--r-- | src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 6 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/core/lombok/core/debug/DebugSnapshot.java b/src/core/lombok/core/debug/DebugSnapshot.java index f12cbcc4..d94798e8 100644 --- a/src/core/lombok/core/debug/DebugSnapshot.java +++ b/src/core/lombok/core/debug/DebugSnapshot.java @@ -43,7 +43,7 @@ public class DebugSnapshot implements Comparable<DebugSnapshot> { public String shortToString() { StringBuilder out = new StringBuilder(); out.append(String.format("WHEN: %14d THREAD: %s AST: %s", when, threadName, ownerName())); - if (message != null) out.append(String.format(message, params)); + if (message != null) out.append(" ").append(String.format(message, params)); return out.toString(); } diff --git a/src/core/lombok/core/debug/DebugSnapshotStore.java b/src/core/lombok/core/debug/DebugSnapshotStore.java index fda3ba14..7abfc07c 100644 --- a/src/core/lombok/core/debug/DebugSnapshotStore.java +++ b/src/core/lombok/core/debug/DebugSnapshotStore.java @@ -31,7 +31,7 @@ public class DebugSnapshotStore { } } - public void print(CompilationUnitDeclaration owner, String message, Object... params) { + public String print(CompilationUnitDeclaration owner, String message, Object... params) { List<DebugSnapshot> list; synchronized (map) { @@ -54,14 +54,17 @@ public class DebugSnapshotStore { } try { - OutputStream stream = new FileOutputStream(new File(System.getProperty("user.home", "."), String.format("lombok164-%d.err", System.currentTimeMillis()))); + File logFile = new File(System.getProperty("user.home", "."), String.format("lombok164-%d.err", System.currentTimeMillis())); + OutputStream stream = new FileOutputStream(logFile); try { stream.write(out.toString().getBytes("UTF-8")); } finally { stream.close(); } + return logFile.getAbsolutePath(); } catch (Exception e) { System.err.println(out); + return "(can't write log file - emitted to system err)"; } } } diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index 5f6691fd..45d58df3 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -467,10 +467,8 @@ public class EclipseHandlerUtil { if (report) { CompilationUnitDeclaration cud = (CompilationUnitDeclaration) type.top().get(); - DebugSnapshotStore.INSTANCE.print(cud, "Printing: injecting whilst scope is already built."); -// Eclipse.warning("State: " + Issue164Fixer.getState(cud) + " -- We believe you may have just stumbled on lombok issue #164. Please " + -// "report the stack trace associated with this message at:\n" + -// "http://code.google.com/p/projectlombok/issues/detail?id=164. Occurred on class " + new String(parent.name), new Throwable()); + String logFileLocation = DebugSnapshotStore.INSTANCE.print(cud, "Printing: injecting whilst scope is already built."); + Eclipse.warning("We believe you may have stumbled on issue 164. Please upload file " + logFileLocation + " to: http://code.google.com/p/projectlombok/issues/detail?id=164", new Throwable()); } } |