Clojure

Cross-linking between clojure.lang.Compiler and clojure.lang.RT

Details

  • Type: Defect Defect
  • Status: Reopened Reopened
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.5
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    version 1.5.0-RC17

Description

This is my code (an example):

import clojure.lang.Compiler;
import clojure.lang.RT;
import clojure.lang.Var;

Compiler.load("(+ 5 %)");
Var foo = RT.var("bar", "foo");
Object result = foo.invoke(10);
assert result.toString().equals("15");

This is what I'm getting:

ava.lang.ExceptionInInitializerError
	at clojure.lang.Compiler.<clinit>(Compiler.java:47)
	at foo.main(Main.java:75)
Caused by: java.lang.NullPointerException
	at clojure.lang.RT.baseLoader(RT.java:2043)
	at clojure.lang.RT.load(RT.java:417)
	at clojure.lang.RT.load(RT.java:411)
	at clojure.lang.RT.doInit(RT.java:447)
	at clojure.lang.RT.<clinit>(RT.java:329)
	... 36 more

The same code worked just fine with version 1.4. Looks like Compiler is using RT and RT is using Compiler, both statically.

Activity

Hide
Yegor Bugayenko added a comment -

I cross-posted this question to SO: http://stackoverflow.com/questions/15207596

Show
Yegor Bugayenko added a comment - I cross-posted this question to SO: http://stackoverflow.com/questions/15207596
Hide
Yegor Bugayenko added a comment -

calling RT.init() before Compiler.load() solves the problem

Show
Yegor Bugayenko added a comment - calling RT.init() before Compiler.load() solves the problem
Hide
Andy Fingerhut added a comment -

Yegor, do you consider it OK to close this ticket as not being a problem, or at least one with a reasonable workaround?

Show
Andy Fingerhut added a comment - Yegor, do you consider it OK to close this ticket as not being a problem, or at least one with a reasonable workaround?
Hide
Yegor Bugayenko added a comment -

Yes, of course. Let's close it.

Show
Yegor Bugayenko added a comment - Yes, of course. Let's close it.
Hide
Andy Fingerhut added a comment -

Ticket submitter agrees that this is not an issue, or that there is a reasonable workaround.

Show
Andy Fingerhut added a comment - Ticket submitter agrees that this is not an issue, or that there is a reasonable workaround.
Hide
Andy Fingerhut added a comment -

This issue came up again on the Clojure group. https://groups.google.com/forum/?hl=en_US&fromgroups=#!topic/clojure/2xdLNMb9yyQ

I did some testing, and the issue did not exist in Clojure 1.5.0-RC3 and before, and it has existed since 1.5.0-RC4. There was only one commit between those two points:

https://github.com/clojure/clojure/commit/9b80a552fdabeabdd93951a625b55ae49c2f8d83

Maybe this new behavior is an intended consequence of that change. I don't know. In any case, it seems like perhaps the "No need to call RT.init() anymore" message might be outdated?

Show
Andy Fingerhut added a comment - This issue came up again on the Clojure group. https://groups.google.com/forum/?hl=en_US&fromgroups=#!topic/clojure/2xdLNMb9yyQ I did some testing, and the issue did not exist in Clojure 1.5.0-RC3 and before, and it has existed since 1.5.0-RC4. There was only one commit between those two points: https://github.com/clojure/clojure/commit/9b80a552fdabeabdd93951a625b55ae49c2f8d83 Maybe this new behavior is an intended consequence of that change. I don't know. In any case, it seems like perhaps the "No need to call RT.init() anymore" message might be outdated?
Hide
Andy Fingerhut added a comment -

Reopening since it came up again, and there is some more info known about the issue. I'll let someone who knows more about the issue decide whether to close it.

Show
Andy Fingerhut added a comment - Reopening since it came up again, and there is some more info known about the issue. I'll let someone who knows more about the issue decide whether to close it.
Hide
Edward added a comment -

Doing this RT.load("clojure/core"); at the top works avoids the message from RT.init()

Show
Edward added a comment - Doing this RT.load("clojure/core"); at the top works avoids the message from RT.init()
Hide
Jean Niklas L'orange added a comment -

It seems like RT.load("clojure/core") does not hide the message anymore - at least not from 1.5.1.

Show
Jean Niklas L'orange added a comment - It seems like RT.load("clojure/core") does not hide the message anymore - at least not from 1.5.1.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated: