Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look into supporting type aliases #86

Open
starksm64 opened this issue Sep 14, 2020 · 0 comments
Open

Look into supporting type aliases #86

starksm64 opened this issue Sep 14, 2020 · 0 comments

Comments

@starksm64
Copy link
Contributor

In the evolution of Jakarta EE 8 to 9 there is a package name change complicates support for the now legacy type, even though there are no semantic differences. In a prototype of arc I was looking at trying to make the minimal changes to have arc support the jakarta.* package while also handling existing code to work. This resulted in duplicate DotName instances and checks like the following:

    public static final DotName PRIORITY = create(jakarta.annotation.Priority.class);
    public static final DotName PRIORITY_JAVAX = create("javax.annotation.Priority");

...
                    } else if (DotNames.PRIORITY.equals(annotation.name())
                            || DotNames.PRIORITY_JAVAX.equals(annotation.name())) {
                        alternativePriority = annotation.value().asInt();
                    } else {

This issue is about whether an alias notion can effectively be added to jandex. It has been pointed out that:

  • DotNames can be created by extensions, and so not all instances will be updated to know about the alias
  • DotNames are not associated with an index, so introducing the alias there will also not handle existing usage without a change to DotName to be index aware.

It seems like what is needed is an alias registry in DotName that is populated by a new factory method, and that all instance would check for an alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant