When I get a
com.vladium.emma.EMMARuntimeException: [CLASS_STAMP_MISMATCH]
I still get an exit code 0 (even if I use the "-exit" flag).
Therefore I cannot react accordingly in my shell script.
Any hints?
Regards, Georg
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A quick browse through code shows that this should not happen. Before I consider this as a new bug, is it possible that your EMMA invocation is wrapped in a shell script that loses the process return code? Also, which EMMA tool is this, merge or report?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
>java -cp /.../emma.jar emma report -exit -r txt -in coverage.es
EMMA: processing input files ...
EMMA: 1 file(s) read and merged in 129 ms
com.vladium.emma.EMMARuntimeException: [CLASS_STAMP_MISMATCH] runtime version of class [...] in the coverage data is not consistent with the version of this class in the metadata, possibly because stale met
adata is being used for report generation.
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:35)
at java.lang.RuntimeException.<init>(RuntimeException.java:40)
at com.vladium.util.exception.AbstractRuntimeException.<init>(AbstractRuntimeException.java:124)
at com.vladium.emma.EMMARuntimeException.<init>(Compiled Code)
at com.vladium.emma.report.ReportDataModel.getView(Compiled Code)
at com.vladium.emma.report.AbstractReportGenerator.initialize(Compiled Code)
at com.vladium.emma.report.txt.ReportGenerator.process(Compiled Code)
at com.vladium.emma.report.ReportProcessor._run(Compiled Code)
at com.vladium.emma.Processor.run(Processor.java:54)
at com.vladium.emma.report.reportCommand.run(Compiled Code)
at emma.main(emma.java:40)
>echo $?
0
I think, this should not be 0.
In another error case the exit code ist 1 (as expected):
>java -cp /.../emma.jar emma xxx
Exception in thread "main" java.lang.IllegalArgumentException: unknown command: [xxx]
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:35)
at java.lang.RuntimeException.<init>(RuntimeException.java:40)
at java.lang.IllegalArgumentException.<init>(IllegalArgumentException.java:36)
at com.vladium.emma.Command.create(Command.java:51)
at emma.main(emma.java:39)
>echo $?
1
Kind Regards, Georg
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
When I get a
com.vladium.emma.EMMARuntimeException: [CLASS_STAMP_MISMATCH]
I still get an exit code 0 (even if I use the "-exit" flag).
Therefore I cannot react accordingly in my shell script.
Any hints?
Regards, Georg
A quick browse through code shows that this should not happen. Before I consider this as a new bug, is it possible that your EMMA invocation is wrapped in a shell script that loses the process return code? Also, which EMMA tool is this, merge or report?
Hi Vlad!
Here you see, what I did and the result:
>java -cp /.../emma.jar emma report -exit -r txt -in coverage.es
EMMA: processing input files ...
EMMA: 1 file(s) read and merged in 129 ms
com.vladium.emma.EMMARuntimeException: [CLASS_STAMP_MISMATCH] runtime version of class [...] in the coverage data is not consistent with the version of this class in the metadata, possibly because stale met
adata is being used for report generation.
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:35)
at java.lang.RuntimeException.<init>(RuntimeException.java:40)
at com.vladium.util.exception.AbstractRuntimeException.<init>(AbstractRuntimeException.java:124)
at com.vladium.emma.EMMARuntimeException.<init>(Compiled Code)
at com.vladium.emma.report.ReportDataModel.getView(Compiled Code)
at com.vladium.emma.report.AbstractReportGenerator.initialize(Compiled Code)
at com.vladium.emma.report.txt.ReportGenerator.process(Compiled Code)
at com.vladium.emma.report.ReportProcessor._run(Compiled Code)
at com.vladium.emma.Processor.run(Processor.java:54)
at com.vladium.emma.report.reportCommand.run(Compiled Code)
at emma.main(emma.java:40)
>echo $?
0
I think, this should not be 0.
In another error case the exit code ist 1 (as expected):
>java -cp /.../emma.jar emma xxx
Exception in thread "main" java.lang.IllegalArgumentException: unknown command: [xxx]
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:35)
at java.lang.RuntimeException.<init>(RuntimeException.java:40)
at java.lang.IllegalArgumentException.<init>(IllegalArgumentException.java:36)
at com.vladium.emma.Command.create(Command.java:51)
at emma.main(emma.java:39)
>echo $?
1
Kind Regards, Georg
Now I have entered this error as Request 1076297 in the Tracker.
Oh, I should not have entered this in the RFE tracker, but in the BUG tracker.
Now I did so (1079004).