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

[REFACTOR CODE] Change StringUtils.java's Name And Convert All Static Methods Into Instance To For Readability #19

Open
raymond-jgler opened this issue Dec 2, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@raymond-jgler
Copy link
Owner

Issue:

This does not look readable when expected chaining logic demanded on StringUtils' methods

public static String cleanseClassPath(String raw) {
   String resolved = StringUtils
           .stripUntilClassPath(StringUtils
                           .stripDoubleEndedNonAlphaNumeric(StringUtils
                                   .resolveReplaces(raw,
                                           "class ",
                                           "",
                                           ">",
                                           "",
                                           "<",
                                           "", "[", "", "]", "", "[]","")),
                   '.', '$', '_');
   /**
    * Ok by far the fishiest logic for weird class strings here
    */
   if (resolved.contains("L") && resolved.indexOf(".") < resolved.indexOf("L")) {
     return resolved;
   }
   return StringUtils.resolveReplaces(resolved, "L", "");
 }
@raymond-jgler raymond-jgler added the enhancement New feature or request label Dec 2, 2023
@raymond-jgler raymond-jgler changed the title Change StringUtils.java's Name And Convert All Static Methods Into Instance To For Readability [REFACTOR CODE] Change StringUtils.java's Name And Convert All Static Methods Into Instance To For Readability Dec 2, 2023
@raymond-jgler
Copy link
Owner Author

raymond-jgler commented Dec 3, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants