apache / apache/maven-scripting-plugin

UncheckedIOException

Open
#65 2 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

There are several UncheckedIOExceptions for issues that can definitely happen, and that are not handled where they should be. E.g.

```
protected Object eval(ScriptEngine engine, ScriptContext context) throws ScriptException {
try (FileReader reader = new FileReader(scriptFile)) {
return engine.eval(reader, context);
} catch (IOException ex) {
throw new UncheckedIOException(scriptFile + " caused:", ex);
}
}
```

This is risky and bug prone. Ideally these should be changed to IOException, but if API compatibility prevents that it looks like most could be replaced with a ScriptException instead.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the ScriptEngine evaluation code containing the eval method and the FileReader/UncheckedIOException example, then review the other UncheckedIOException paths in the plugin. Check whether each case can expose IOException or must preserve API compatibility with ScriptException; done means the inappropriate unchecked exceptions are consistently replaced and the affected behavior is covered by the existing test suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.