We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interpreter's classloader returns empty enumeration when requested using getResources (same code executed as application returns single entry)
import collection.JavaConverters._ class MyClass val cl = classOf[MyClass].getClassLoader val resName = classOf[MyClass].getName.replace(".","/")+".class" println(s"getResource: ${cl.getResource(resName)}") println(s"getResourceAsStream: ${cl.getResourceAsStream(resName)}") println(s"getResources: ${cl.getResources(resName).asScala.mkString}")
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-8843?orig=1 Reporter: Marcin Kielar (zorba128) Affected Versions: 2.11.2 See #6026
Sorry, something went wrong.
@som-snytt said: For those who can't remember which java "replace" method takes a regex:
scala> class X defined class X scala> classOf[X].getClassLoader getResource classOf[X].getName.replace(".","/")+".class" res0: java.net.URL = repldir:(memory)/X.class scala> classOf[X].getClassLoader getResources classOf[X].getName.replace(".","/")+".class" res1: java.util.Enumeration[java.net.URL] = sun.misc.CompoundEnumeration@73a8dfcc scala> .hasMoreElements res2: Boolean = false
@som-snytt said: scala/scala#4030
som-snytt
No branches or pull requests
Interpreter's classloader returns empty enumeration when requested using getResources (same code executed as application returns single entry)
The text was updated successfully, but these errors were encountered: