Skip to content

Commit

Permalink
Merge pull request #1588 from Atry/patch-1
Browse files Browse the repository at this point in the history
Treat name in getResourceAsStream as resource path
  • Loading branch information
paulp committed Dec 11, 2012
2 parents c916697 + 3180156 commit 70376b4
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -25,7 +25,7 @@ class AbstractFileClassLoader(val root: AbstractFile, parent: ClassLoader)

protected def findAbstractFile(name: String): AbstractFile = {
var file: AbstractFile = root
val pathParts = classNameToPath(name) split '/'
val pathParts = name split '/'

for (dirPart <- pathParts.init) {
file = file.lookupName(dirPart, true)
Expand Down Expand Up @@ -59,7 +59,7 @@ class AbstractFileClassLoader(val root: AbstractFile, parent: ClassLoader)
case null => super.getResourceAsStream(name)
case file => file.input
}
override def classBytes(name: String): Array[Byte] = findAbstractFile(name) match {
override def classBytes(name: String): Array[Byte] = findAbstractFile(classNameToPath(name)) match {
case null => super.classBytes(name)
case file => file.toByteArray
}
Expand Down

0 comments on commit 70376b4

Please sign in to comment.