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

Miscellaneous cleanup #458

Merged
merged 1 commit into from
Feb 15, 2023
Merged

Miscellaneous cleanup #458

merged 1 commit into from
Feb 15, 2023

Conversation

basil
Copy link
Member

@basil basil commented Feb 14, 2023

Another bunch of miscellaneous cleanup hunks that I've been collecting in a branch for a few weeks now. I tested these in BOM with PLUGINS=text-finder bash local-test.sh.

@basil basil requested a review from jtnord February 14, 2023 20:39
@basil basil requested a review from a team as a code owner February 14, 2023 20:39
@@ -488,7 +488,7 @@ public static void cloneFromScm(
* <li><code>git checkout FETCH_HEAD</code>
* </ul>
*
* @param gitURL The git native URL, see the <a
* @param gitUrl The git native URL, see the <a
Copy link
Member Author

Choose a reason for hiding this comment

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

This was not matching the case of the actual parameter.

}
return moreInfo;
Copy link
Member Author

Choose a reason for hiding this comment

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

One-line code deduplication.

Comment on lines +202 to +203
} catch (ReflectiveOperationException e) {
throw new RuntimeException("Error when loading " + c.getName(), e);
Copy link
Member Author

Choose a reason for hiding this comment

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

This should never happen, and if it does it is a serious error that would invalidate our confidence in the test run, so throw it up and halt execution.

File pom = new File(rootDir.getAbsolutePath() + "/" + pomFileName);
Document doc;
try {
doc = new SAXReader().read(pom);
} catch (DocumentException x) {
throw new IOException(x);
throw new PomTransformationException("Failed to parse pom.xml", x);
Copy link
Member Author

Choose a reason for hiding this comment

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

Making this class consistent with the error handling philosophy elsewhere of failing fast and avoiding abuse of IOException.

@basil basil merged commit 0838e05 into master Feb 15, 2023
@basil basil deleted the misc branch February 15, 2023 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants