New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide more context information when unable to read input during instrumentation #527

Merged
merged 1 commit into from May 4, 2017

Conversation

Projects
None yet
3 participants
@Godin
Member

Godin commented May 3, 2017

In #400 we updated Analyzer, but not Instrumenter.

So that for example for the same broken.zip Analyzer.analyzeAll produces:

java.io.IOException: Error while analyzing /tmp/jacoco/in/broken.zip@brokenentry.txt.

while Instrumenter.instrumentAll:

java.util.zip.ZipException: invalid distance too far back

This difference is also visible between Ant tasks report and instrument when they used for archives that contain corrupted nested archives - in a stack trace in case of report name of a nested corrupted archive is shown, while in case of instrument not.

@mathjeff

This comment has been minimized.

Show comment
Hide comment
@mathjeff

mathjeff May 3, 2017

Hey, thanks for this

mathjeff commented May 3, 2017

Hey, thanks for this

@Godin Godin requested a review from marchof May 4, 2017

@Godin Godin added this to the 0.7.10 milestone May 4, 2017

@marchof

@Godin I propose a minor change to remove duplicated code.

@marchof

marchof approved these changes May 4, 2017

@marchof marchof merged commit a973267 into master May 4, 2017

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@marchof marchof deleted the issue-527 branch May 4, 2017

@Godin

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin May 4, 2017

Member

@marchof BTW while working on this I noticed that Javadocs states

IOException - if reading data from the stream fails or the class can't be instrumented

but what about case when write fails? Also was wondering how consumers such as Ant Task behave in such case...

Member

Godin commented May 4, 2017

@marchof BTW while working on this I noticed that Javadocs states

IOException - if reading data from the stream fails or the class can't be instrumented

but what about case when write fails? Also was wondering how consumers such as Ant Task behave in such case...

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof May 4, 2017

Member

@Godin I was thinking the same. But there will be a specific IOException naming the file which cannot be written. Generating the class data itself is already protected within the instrument() method.

Member

marchof commented May 4, 2017

@Godin I was thinking the same. But there will be a specific IOException naming the file which cannot be written. Generating the class data itself is already protected within the instrument() method.

@jacoco jacoco locked as resolved and limited conversation to collaborators Jan 11, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.