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

Several potential NullPointerException bugs. #72

Open
ITWOI opened this issue Nov 14, 2019 · 2 comments
Open

Several potential NullPointerException bugs. #72

ITWOI opened this issue Nov 14, 2019 · 2 comments

Comments

@ITWOI
Copy link

ITWOI commented Nov 14, 2019

Hi all,

Our tool has found several potential NPE bugs.

  1. In the statement filters.add(new ScopedFilter(context.getSet(setSpec).getCondition(), Scope.Set)); at line 168, context.getSet(setSpec) may return null according to its definition at line 110.

  2. Similar to 1, statements String until = request.getString(Until); and String from = request.getString(From); may return null according to the definition of method getString at line 112. The usage of variables until and ```from`` is as follows (from lines 92 to 97):

        String until = request.getString(Until);
        String from = request.getString(From);
        if (isTrueThat(until, is(not(nullValue())))
                && isTrueThat(from, is(not(nullValue())))
                && from.length() != until.length())
            throw new BadArgumentException("Distinct granularities provided for until and from parameters");
  1. The method formatForPrefix may return null. The following code in method createHeader may use the null because method canDisseminate :
        MetadataFormat format = getContext().formatForPrefix(parameters
                .getMetadataPrefix());
        if (!itemIdentifier.isDeleted() && !canDisseminate(itemIdentifier, format))
            throw new InternalOAIException("The item repository is currently providing items which cannot be disseminated with format "+format.getPrefix());

Note that method canDisseminate uses the argument format by return !format.hasCondition() || format.getCondition()...; at line 129

Thanks.

@ITWOI
Copy link
Author

ITWOI commented Nov 21, 2019

Hi, we have reported the bugs a while ago would you please take a look and confirm if they are real bugs. We have been conducting an experiment to measure the accuracy of our static checker. We would be deeply appreciated if you can provide some feedback!

@tdonohue
Copy link
Member

@ITWOI : Apologies, but at this time the XOAI library is only maintained when a new DSpace release warrants a bug fix. That is why response here is rare. Unfortunately, at this time, all of our volunteer developers are concentrating on new overhaul of the DSpace software (to prepare for a v7 release). That means I expect very little attention will be paid to XOAI until that DSpace v7 development starts to ramp down sometime in 2020. In the meantime, bug tickets here may not receive a lot of attention, until a developer can be found with time to spend on these issues.

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

No branches or pull requests

2 participants