apache / apache/maven-scripting-plugin

ResourceScriptEvaluator NullPointerException

Open
#66 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
15
Forks
10
PR merge metrics
No merged PRs in 30d

Description

### 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

Contributor guide

No contributing guide indexed for this repository

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.