Skip to content

Commit 7f66e40

Browse files
puredangerrichhickey
authored andcommitted
CLJ-2427 CompilerException toString() throws when RT not yet initialized
Signed-off-by: Rich Hickey <richhickey@gmail.com>
1 parent a1722cf commit 7f66e40

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/jvm/clojure/lang/Compiler.java

+8-10
Original file line numberDiff line numberDiff line change
@@ -6875,21 +6875,19 @@ public static String makeMsg(String source, int line, int column, Symbol sym, Ke
68756875
line + ":" + column + ").";
68766876
}
68776877

6878-
private static boolean isSpecError(Throwable t) {
6879-
return (t instanceof IExceptionInfo) && RT.get(((IExceptionInfo) t).getData(), SPEC_PROBLEMS) != null;
6880-
}
6881-
68826878
public String toString(){
68836879
Throwable cause = getCause();
68846880
if(cause != null) {
6885-
if(RT.get(data, ERR_PHASE) == PHASE_MACRO_SYNTAX_CHECK && isSpecError(cause)) {
6886-
return String.format("%s", getMessage());
6887-
} else {
6888-
return String.format("%s%n%s", getMessage(), cause.getMessage());
6881+
if (cause instanceof IExceptionInfo) {
6882+
IPersistentMap data = (IPersistentMap)((IExceptionInfo)cause).getData();
6883+
if(PHASE_MACRO_SYNTAX_CHECK.equals(data.valAt(ERR_PHASE)) && data.valAt(SPEC_PROBLEMS) != null) {
6884+
return String.format("%s", getMessage());
6885+
} else {
6886+
return String.format("%s%n%s", getMessage(), cause.getMessage());
6887+
}
68896888
}
6890-
} else {
6891-
return getMessage();
68926889
}
6890+
return getMessage();
68936891
}
68946892
}
68956893

0 commit comments

Comments
 (0)