Skip to content
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

Improve error message when working on instrumented classes #703

Merged
merged 3 commits into from
Jun 27, 2018
Merged

Conversation

marchof
Copy link
Member

@marchof marchof commented Jun 26, 2018

The instrumentation and analysis process expects original, uninstrumented classes. This seems to be a common configuration issue - see #700. Therefore the error message should be improved to be more helpful:

Cannot process instrumented class X. Please supply original non-instrumented classes.

@marchof marchof requested a review from Godin June 26, 2018 18:23
Copy link
Member

@Godin Godin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few little things to address.

<h3>Non-functional Changes</h3>
<ul>
<li>Improved error message when already instrumented classes are used for
instrumentation or analysis.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing items consisting of one sentence use only one dot after link to GitHub.

InstrSupport.assertNotInstrumented("run", "Foo");
}

@Test(expected = IllegalStateException.class)
public void testAssertNotIntrumentedField() {
public void assertNotIntrumented_should_throw_exception_when_jacoco_data_field_is_present() {
InstrSupport.assertNotInstrumented("$jacocoData", "Foo");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it worth to add assertion for message especially since its change originates from a user needs. In past we have examples of catching regressions thanks to assertions for error messages.

<ul>
<li>Improved error message when already instrumented classes are used for
instrumentation or analysis.
(GitHub <a href="https://github.com/jacoco/jacoco/issues/700">#700</a>).</li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed in #668 (comment) - existing links point to PRs, not on original issue.

@marchof
Copy link
Member Author

marchof commented Jun 27, 2018

@Godin Thanks for the review. I hope I addressed your issues.

@Godin
Copy link
Member

Godin commented Jun 27, 2018

@marchof Perfect! Thank you! 👍

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

Successfully merging this pull request may close these issues.

None yet

2 participants