mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-18 18:15:34 +00:00
Upgraded the issue 164 reporter to replace what we had. I think we'll roll this out in 0.10.0-RC2.
This commit is contained in:
1 parent
23754573c1
commit
a24daba66c
3 files changed
+8
-7
No files matched your search
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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)";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user