Skip to content

[native-image] When two substitutions are present the error is not helpful #1715

@graemerocher

Description

@graemerocher

Currently register looks like:

   private static <T> void register(Map<T, T> substitutions, T annotated, T original, T target) {
        if (annotated != null) {
            guarantee(!substitutions.containsKey(annotated) || substitutions.get(annotated) == original || substitutions.get(annotated) == target, "Already registered: %s", annotated);
            substitutions.put(annotated, target);
        }
        ...
    }

The output message only indicates the substitution is already registered but not what is causing the conflict. This means the only way for the user to find out is to attach a debugger and set a breakpoint at this line.

The error message should include more information about the two substitutions that conflict so that the user can potentially take appropriate action to remove one of them.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions