I have been playing with the eclEmma coverage tool (v. 2.0.1) [with ScalaIDE 2.0.0 in Eclipse 3.7.1]. The coverage analysis phase works fine, but when eclEmma tries to populate its View with the results it barfs if your project contains a file named "package.scala". The error message is "'package' is not a valid Java identifier" (no stack trace).
Renaming the file is a workaround, of course, if you are willing to ignore section 13.6 of "programming in Scala". eclEmma doesn't have a problem with the package object classes, just the name of the source code file, and only when it tries to display its results.
I was able to discover the stack trace:
which eventually calls
which strips the ".scala" extension and calls
which returns the error that cascades back up
CompilationUnitNameAspect.aj (see ticket #3266
) patches org.eclipse.jdt.internal.core.util.Util.isValidCompilationUnitName to accept any name that endsWith ".scala" (even if there is nothing before the dot, which seems like a ticket waiting to happen).
A similar 'around' should be applied to validateCompilationUnitName, (i.e. return JavaModelStatus.VERIFIED_OK if name endsWith ".scala")
Sigh... is it just me or is this really a bug in JDT? JavaConventions.validateCompilationUnitName should delegate to Util.isValidCompilationUnitName instead of to JavaConventions.validateIdentifier!
In which case the pointcut could just replace the whole buggy method.
No file chosen
You have an empty file field. Please select or remove it.
Drop the files anywhere in this page to upload them as attachments.