#56 Exception thrown should be more helpful

GroboUtils v4
open
Matt Albrecht
5
2004-04-27
2004-04-27
Curt Cox
No

I'm not sure what the problem is, but the exception
should be better. Running the coveragepostcompile task
from Ant, I get:

BUILD FAILED
V:\ccox_mercury\jutl\build\build.xml:80: I/O exception
during execution.

Adding -verbose gives:

V:\ccox_mercury\jutl\build>set
ANT=C:\apache-ant-1.6.1-bin\bin\ant.bat

V:\ccox_mercury\jutl\build>set JAVA_HOME=C:\j2sdk1.4.2

V:\ccox_mercury\jutl\build>C:\apache-ant-1.6.1-bin\bin\ant.bat
-f build.xml -verbose postcompile
Apache Ant version 1.6.1 compiled on February 12 2004
Buildfile: build.xml
Detected Java version: 1.4 in: C:\j2sdk1.4.2\jre
Detected OS: Windows 2000
parsing buildfile V:\ccox_mercury\jutl\build\build.xml
with URI = file:///V:/ccox_mercury/jutl/build
/build.xml
Project base dir set to: V:\ccox_mercury\jutl\build
Property ${clover.jar} has not been set
Build sequence for target `postcompile' is [postcompile]
Complete build sequence is [postcompile, report, tests,
compile, run, ]

postcompile:
[coveragepostcompiler] Writing meta-data to directory
'V:\ccox_mercury\jutl\source'.
[coveragepostcompiler] Recompiling class
'V:\ccox_mercury\jutl\source\com\tripos\hts\AbstractConstan
t$Suit.class' to file
'V:\ccox_mercury\jutl\source\com\tripos\hts\AbstractConstant$Suit.class'.

BUILD FAILED
V:\ccox_mercury\jutl\build\build.xml:80: I/O exception
during execution.
at
net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask.execute(CoverageP
ostCompilerTask.java:198)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at
org.apache.tools.ant.Target.execute(Target.java:301)
at
org.apache.tools.ant.Target.performTasks(Target.java:328)
at
org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at
org.apache.tools.ant.Project.executeTargets(Project.java:1063)
at
org.apache.tools.ant.Main.runBuild(Main.java:632)
at
org.apache.tools.ant.Main.startAnt(Main.java:183)
at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
Caused by: java.io.EOFException
at
java.io.DataInputStream.readInt(DataInputStream.java:448)
at
org.apache.bcel.classfile.ClassParser.readID(ClassParser.java:285)
at
org.apache.bcel.classfile.ClassParser.parse(ClassParser.java:155)
at
net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass.updateClassGen(Modified
Class.java:329)
at
net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass.<init>(ModifiedClass.ja
va:131)
at
net.sourceforge.groboutils.codecoverage.v2.compiler.PostCompileClass.postCompile(PostComp
ileClass.java:109)
at
net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask.execute(CoverageP
ostCompilerTask.java:183)
... 10 more
--- Nested Exception ---
java.io.EOFException
at
java.io.DataInputStream.readInt(DataInputStream.java:448)
at
org.apache.bcel.classfile.ClassParser.readID(ClassParser.java:285)
at
org.apache.bcel.classfile.ClassParser.parse(ClassParser.java:155)
at
net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass.updateClassGen(Modified
Class.java:329)
at
net.sourceforge.groboutils.codecoverage.v2.compiler.ModifiedClass.<init>(ModifiedClass.ja
va:131)
at
net.sourceforge.groboutils.codecoverage.v2.compiler.PostCompileClass.postCompile(PostComp
ileClass.java:109)
at
net.sourceforge.groboutils.codecoverage.v2.ant.CoveragePostCompilerTask.execute(CoverageP
ostCompilerTask.java:183)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at
org.apache.tools.ant.Target.execute(Target.java:301)
at
org.apache.tools.ant.Target.performTasks(Target.java:328)
at
org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at
org.apache.tools.ant.Project.executeTargets(Project.java:1063)
at
org.apache.tools.ant.Main.runBuild(Main.java:632)
at
org.apache.tools.ant.Main.startAnt(Main.java:183)
at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)

Total time: 1 minute 2 seconds

Which is better, but still doesn't point very strongly
to a solution. Whatever the problem is, the error
message needs to be clearer.

Thanks,
Curt

Discussion