Fork me on GitHub
#off-topic
<
2021-11-24
>
slipset08:11:18

Playing around, as one does from time to time, and getting an exception. Part of the message is:

(java.lang.Long and java.lang.String are in module java.base of loader 'bootstrap')
I suspect that this comes from the jvm itself, but I’m curious if this message is useful to anyone?

p-himik08:11:49

It looks like the most important part of the exception has been left out. For example:

user=> (String/format 1 (object-array))
Execution error (ClassCastException) at user/eval4 (REPL:1).
class java.lang.Long cannot be cast to class java.lang.String (java.lang.Long and java.lang.String are in module java.base of loader 'bootstrap')

slipset09:11:01

Well, that part is obviously important, so I left it out. I’m more interested in figuring out when the part that I included is deemed important.

p-himik09:11:48

When you need to know where the classes came from.

👍 1
p-himik09:11:35

For example:

class test.X cannot be cast to class java.lang.String (test.X is in unnamed module of loader clojure.lang.DynamicClassLoader @3fcdcf; java.lang.String is in module java.base of loader 'bootstrap')
Here you can see that text.X was created in Clojure, so you can search for test.clj on the classpath, instead of searching for test/X.java.

👍 1
ghadi15:11:41

I wish they'd shorten these messages

ghadi15:11:01

if it's in java.base, skip the module attribution

slipset16:11:26

my thoughts exactly

sova-soars-the-sora15:11:34

"Add a number to another number in JavaScript"