UncheckedIOException

Open
#65 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

Description

bug
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.

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.