You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2015/04/17 09:52:59 UTC
[jira] [Commented] (OAK-2784) Potential NPEs in
BackgroundObserverMBean
[ https://issues.apache.org/jira/browse/OAK-2784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14499421#comment-14499421 ]
angela commented on OAK-2784:
-----------------------------
[~chetanm]], since you introduced that code just yesterday... maybe you can take a quick look and get it fixed?
btw: you can most probably configure your IDE to spot that kind of issues right away.
> Potential NPEs in BackgroundObserverMBean
> -----------------------------------------
>
> Key: OAK-2784
> URL: https://issues.apache.org/jira/browse/OAK-2784
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: core
> Reporter: angela
> Labels: technical_debt
> Fix For: 1.3.0
>
>
> {code}
> @Override
> public int getLocalEventCount() {
> return size(filter(queue, new Predicate<ContentChange>() {
> @Override
> public boolean apply(@Nullable ContentChange input) {
> return input.info != null;
> }
> }));
> }
> @Override
> public int getExternalEventCount() {
> return size(filter(queue, new Predicate<ContentChange>() {
> @Override
> public boolean apply(@Nullable ContentChange input) {
> return input.info == null;
> }
> }));
> }
> {code}
> both methods should probably check for {{input}} being null before accessing {{input.info}}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)