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

Fixes getBuildCause(String classname) so that it no longer relies on class loading #85

Merged
merged 2 commits into from
Dec 11, 2018

Conversation

mikecirioli
Copy link
Contributor

@mikecirioli mikecirioli commented Dec 10, 2018

Fixes getBuildCause(String classname) so that it no longer relies on class loading to determine if a class meets the filter criteria. This eliminates possible CNFE's when checking for build causes supplied by other @extension points.

This PR supersedes #83

class loading to determine if a class meets the filter critera
@mikecirioli
Copy link
Contributor Author

@jtnord @jglick @dwnusbaum @cyrille-leclerc - FYI - comments/review please

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Looks like it should do the trick. (Was there not a test in the other PR that could be ported?)

DataWriter writer = JSON.createDataWriter(causeAction, w);
Model<CauseAction> model = new ModelBuilder().get(CauseAction.class);
model.writeTo(causeAction, writer);
// return a slightlly cleaner object by removing the outer object
Copy link
Member

Choose a reason for hiding this comment

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

typo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This case was covered by the existing tests, the last test case supplies two cause types and filters by Cause$UserIdCause to check that only one is returned.

@dwnusbaum dwnusbaum merged commit 2a639b6 into jenkinsci:master Dec 11, 2018
@mikecirioli mikecirioli deleted the fix_cnfe_2 branch December 11, 2018 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants