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

Internal error: Unknown element: "number" #80

Open
AttiliaTheHun opened this issue Feb 8, 2024 · 0 comments
Open

Internal error: Unknown element: "number" #80

AttiliaTheHun opened this issue Feb 8, 2024 · 0 comments

Comments

@AttiliaTheHun
Copy link

In my project (a JavaFX desktop app) I use the version 3.4 of ClassIndex. When I try to build my project in IntelliJ, I get this message java: [ClassIndexProcessor] Internal error: Unknown element: "number" which I traced to ClassIndexProcessor#process(Set<? extends TypeElement>, RoundEnvironment) but do not really understand.

My use case of ClassIndex library is to automatically load my Plugin classes that have the @AutoRegister annotation.

AutoRegister.java excerpt

@IndexAnnotated
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface AutoRegister { }

The only interaction with the library beside that is here in my PluginManager:

PluginManager.java excerpt

private void autoRegisterPlugins() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        Iterable<Class<?>> autoRegisterPlugins = ClassIndex.getAnnotated(AutoRegister.class);

        for (final Class c : autoRegisterPlugins) {
            System.out.println(c.getSimpleName());
            if (c.getSuperclass() != null && c.getSuperclass().equals(Plugin.class)) {
                ((Plugin)c.getMethod("getInstance").invoke(null)).register();
            }
        }
    }

However from my understanding of compile-time annotation processing, this code never even gets executed (so I do not really know if it works lol) and so the problem can not be in my code, but somewhere within the library or my environment.

As mentioned, my environment is Windows 10, IntelliJ somewhere from 2021 I think and Java 19. My current course of action would be to try to implement the functionality myself as I do not require all the features of the library.

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