Skip to content

OPENNLP-1434 Enhance JavaDoc in opennlp.uima packages#479

Merged
jzonthemtn merged 2 commits intoapache:mainfrom
mawiesne:OPENNLP-1434_Enhance_JavaDoc_in_opennlp.uima_packages
Jan 3, 2023
Merged

OPENNLP-1434 Enhance JavaDoc in opennlp.uima packages#479
jzonthemtn merged 2 commits intoapache:mainfrom
mawiesne:OPENNLP-1434_Enhance_JavaDoc_in_opennlp.uima_packages

Conversation

@mawiesne
Copy link
Contributor

@mawiesne mawiesne commented Jan 2, 2023

Change

  • adds missing JavaDoc
  • improves existing documentation for clarity
  • removes superfluous text
  • adds test-scoped dependency to slf4j-simple logger binding to avoid NOOP error messages when UIMA tests are run
  • adds 'final' modifier where useful and applicable
  • adds 'Override' annotation where useful and applicable
  • fixes several (funny) typos, eg in ExceptionMessages

Tasks

Thank you for contributing to Apache OpenNLP.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • Does your PR title start with OPENNLP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • Has your PR been rebased against the latest commit within the target branch (typically main)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • Have you ensured that the full suite of tests is executed via mvn clean install at the root opennlp folder?
  • Have you written or updated unit tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file in opennlp folder?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found in opennlp folder?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check GitHub Actions for build issues and submit an update to your PR as soon as possible.

- adds missing JavaDoc
- improves existing documentation for clarity
- removes superfluous text
- adds test-scoped dependency to slf4j-simple logger binding to avoid NOOP error messages when UIMA tests are run
- adds 'final' modifier where useful and applicable
- adds 'Override' annotation where useful and applicable
- fixes several (funny) typos, eg in `ExceptionMessages`
* @param remove The {@link Character} to remove from {@code s}.
*/
private static String removeChar(String string, char remove) {
private static String removeChar(String s, char remove) {
Copy link
Contributor

@rzo1 rzo1 Jan 2, 2023

Choose a reason for hiding this comment

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

This is basically a s.replace(remove, "") (replace all occurences of the given char in the given String literal). Sadly, were is no String#replace(char,String) available, but we could do s.replace(Character.toString(remove), "") (or change the method signature). No blocker, but would reduce code complexity.

Copy link
Contributor

@rzo1 rzo1 Jan 2, 2023

Choose a reason for hiding this comment

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

Alternative: As the method is private and only used for removing ' ' from a given String, we could avoid dealing with the hell of whitespace and just replace it with a call to s.replaceAll("\\s+", ""); ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Since that's more than a Javadoc change and so we can merge this, I wrote OPENNLP-1437 to change the function.

@jzonthemtn jzonthemtn merged commit c5bceff into apache:main Jan 3, 2023
@mawiesne mawiesne deleted the OPENNLP-1434_Enhance_JavaDoc_in_opennlp.uima_packages branch January 3, 2023 14:57
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.

4 participants