Aladdin - Scala Bugtracking
[#1089] project: scala-doc priority: low category: bug
submitter assigned to status date submitted
Nikolay Sean fixed 2007-05-07 09:26:57.0
subject [contrib #458] FileNotFoundException on classes outside packages
code
When there are classes outside packages, scaladoc should either support them or report a warning or error.

2.5.0-RC1 reports an exception.




Using 2.4.0-final  (under cygwin on Windows)

$ ls
NoPackage.scala

$ cat NoPackage.scala

class NoPackage {}

$ scaladoc -version
Scala compiler version 2.4.0-final -- (c) 2002-2007 LAMP/EPFL

$ scaladoc NoPackage.scala
error: Resource file 'style.css' not found
error: Resource file 'script.js' not found
two errors found

(ignore these errors - already fixed in bug 1054)


(The generated pages aren't particularly useful: no mention of NoPackage.)



Using 2.5.0-RC1  (under cygwin on Windows)

$ scaladoc -version
Scala compiler version 2.5.0-RC1 -- (c) 2002-2007 LAMP/EPFL

$ scaladoc NoPackage.scala

Exception in thread "main" java.io.FileNotFoundException: .\<empty>$package.html (The filename, directory name, or volume label syntax is incorrect)
	at java.io.FileOutputStream.open(Native Method)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at java.io.FileWriter.<init>(Unknown Source)
	at scala.tools.nsc.doc.ModelFrames$Frame.save(ModelFrames.scala:76)
	at scala.tools.nsc.doc.ModelFrames$Frame.<init>(ModelFrames.scala:55)
	at scala.tools.nsc.doc.ModelFrames$ListClassFrame.<init>(ModelFrames.scala:192)
	at scala.tools.nsc.doc.DocDriver$$anonfun$13$$anon$4.<init>(DocDriver.scala:99)
	at scala.tools.nsc.doc.DocDriver$$anonfun$13.apply(DocDriver.scala:99)
	at scala.tools.nsc.doc.DocDriver$$anonfun$13.apply(DocDriver.scala:98)
	at scala.Iterator$class.foreach(Iterator.scala:369)
	at scala.collection.jcl.MapWrapper$IteratorWrapper.foreach(MapWrapper.scala:44)
	at scala.Iterable$class.foreach(Iterable.scala:208)
	at scala.collection.jcl.LinkedHashMap.foreach(LinkedHashMap.scala:18)
	at scala.tools.nsc.doc.DocDriver.process(DocDriver.scala:98)
	at scala.tools.nsc.Main$.process(Main.scala:63)
	at scala.tools.nsc.Main$.main(Main.scala:77)
	at scala.tools.nsc.Main.main(Main.scala)
what happened
java.io.FileNotFoundException: .\$package.html
what expected Either useful pages with links to the class, or a simple warning or error report.
[back to overview]
Changes of this bug report
Nikolay  edited on  2007-05-07 09:27:22.0
Sean  edited on  2007-05-07 13:55:09.0
This is an old issue. I'm not sure how to fix this as it requires lots of invasive changes to Scala-doc, which assume packages. Maybe if the name given to package was actually something that could be used as a file, then it would just work...
Sean  edited on  2007-05-08 14:23:56.0