Skip to content

Fixes #759 - Plugin generates corrupted shaded sources beyond recognition #759#760

Open
ursaj wants to merge 1 commit intoapache:masterfrom
ursaj:master
Open

Fixes #759 - Plugin generates corrupted shaded sources beyond recognition #759#760
ursaj wants to merge 1 commit intoapache:masterfrom
ursaj:master

Conversation

@ursaj
Copy link

@ursaj ursaj commented Sep 29, 2025

This PR adds support for binary operations and missing Java keywords into shade sources functionality of the maven-shade-plugin as reported in #759.

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.

  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.

  • You have run the integration tests successfully (mvn -Prun-its clean verify).

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004

  • Plugin generates corrupted shaded sources beyond recognition #759

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.

  • Each commit in the pull request should have a meaningful subject line and body.

  • Format the pull request title like [MSHADE-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace MSHADE-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.

  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.

  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.

  • You have run the integration tests successfully (mvn -Prun-its clean verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

Copy link
Member

@kwin kwin left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and sorry for the late review.

* Match dot, slash or space at end of string
*/
private static final Pattern RX_ENDS_WITH_DOT_SLASH_SPACE = Pattern.compile("[./ ]$");
private static final Pattern RX_ENDS_WITH_DOT_SLASH_SPACE = Pattern.compile("(\\.|/|[^<?:+\\-*/^|&] )$");
Copy link
Member

Choose a reason for hiding this comment

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

Why are three conditions necessary when the first and the second can never be true without the last one? Isn't the last one sufficient then? This also requires some renaming of this constant.

Copy link
Member

Choose a reason for hiding this comment

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

Also a comment would be much appreciated why those characters are not allowed...

Copy link
Author

@ursaj ursaj Mar 9, 2026

Choose a reason for hiding this comment

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

original regex was:

  • ether dot
  • or slash
  • or space at the end of string

new regex matches

  • either dot
  • or slash
  • or space at the end of string. where string does NOT end with operator (generic type, binary, trinary)

regarding comment or renaming - I don't mind. your suggestions?

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.

2 participants