[
https://issues.apache.org/jira/browse/OPENNLP-1091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16045144#comment-16045144
]
ASF GitHub Bot commented on OPENNLP-1091:
-----------------------------------------
GitHub user kinow opened a pull request:
https://github.com/apache/opennlp/pull/229
OPENNLP-1091 Findbugs issues and IDE warnings
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:
- [x] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
- [x] 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.
- [x] Has your PR been rebased against the latest commit within the target
branch (typically master)?
- [ ] Is your initial contribution a single, squashed commit?
- Not yet, intentionally, in case we decide to trim some of the changes
### For code changes:
- [x] 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](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] 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 travis-ci for build
issues and submit an update to your PR as soon as possible.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/kinow/opennlp findbugs-issues
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/opennlp/pull/229.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #229
----
commit 6b815cee11b8297933ae1ddf37c071cb3a92984e
Author: Bruno P. Kinoshita <[email protected]>
Date: 2017-06-09T13:28:29Z
Fixing few issues found in FindBugs
commit fee514d290ab718c1406675168e595a76809db2c
Author: Bruno P. Kinoshita <[email protected]>
Date: 2017-06-09T22:18:16Z
Fix warnings found with IDE
----
> Fixing issues found via FindBugs and warnings found via IDE
> -----------------------------------------------------------
>
> Key: OPENNLP-1091
> URL: https://issues.apache.org/jira/browse/OPENNLP-1091
> Project: OpenNLP
> Issue Type: Improvement
> Affects Versions: 1.8.0
> Reporter: Bruno P. Kinoshita
> Assignee: Bruno P. Kinoshita
> Priority: Minor
> Labels: findbugs, static-analysis, warnings
>
> There are several issues that can be found using *FindBugs*.
> {noformat}
> mvn clean install findbugs:findbugs findbugs:gui
> {noformat}
> The _opennlp-tools_ is the only project with issues. Some are mere cosmetics,
> or not so important. The pull request mentioned in this issue does not fix
> all issues found, only the ones that I thought would be more important, and
> that would not have huge impact in the code (i.e. would not have to change
> much of the current behaviour/code base).
> Some changes are quite useful, such as optimizations that replace string
> concatenation and use _Map#entrySet_ instead of _Map#keySet_ + another call
> to _Map#get_. All the optimizations changes put together, I expect we should
> see at least a few milliseconds improvement.
> Other changes are quite important, such as comparisons with
> _Object.equals(anArray, anotherArray)_, which will compare two objects with
> _==_, meaning that even when the arrays are equals, it would still return
> false.
> In the pull request, I intentionally did not squash it now, as the second
> commit include warnings found via the IDE (Eclipse in this case, but I
> believe it's independent of the IDE). Such as _suppressWarnings_ that are not
> necessary, and - the most importants - resource leak.
> This latter issue was fixed with Java8 try-with-resources, mainly in tests,
> but also in some tools.
> Cheers
> Bruno
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)