ResourceScriptEvaluator NullPointerException

Open
#66 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
build-system

Research direction

Start at ResourceScriptEvaluator.eval, specifically the resource stream and reader setup shown in the issue. Reproduce the missing-resource case and determine how it should be reported; done means it produces a ScriptException instead of a NullPointerException.

Written by the indexing model from the issue text.

Description

bug
Affected version

HEAD

Bug description

Problem here:

    protected Object eval(ScriptEngine engine, ScriptContext context) throws ScriptException {

        try (InputStream is = this.getClass().getClassLoader().getResourceAsStream(resourceName);
                Reader reader = new InputStreamReader(is)) {
            return engine.eval(reader, context);
        } catch (IOException ex) {
            throw new UncheckedIOException(resourceName + " caused:", ex);
        }
    }

probably catch the NullPointerException and convert it to a ScriptException, or maybe do that in the calling method

Dominant language
Java
Stars
15
Forks
10
Avg merge
1d 16h
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/maven-scripting-plugin

All issues in apache/maven-scripting-plugin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.