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

Remove Reflections Library Usage #682

Closed
rnveach opened this issue Mar 31, 2024 · 3 comments
Closed

Remove Reflections Library Usage #682

rnveach opened this issue Mar 31, 2024 · 3 comments
Assignees

Comments

@rnveach
Copy link
Member

rnveach commented Mar 31, 2024

Pulled from #659 (comment) and #681 (comment) ,

We need to remove reflections library because since the move from Java 8, it hasn't been updated and basically does nothing. ronmamo/reflections#465 ronmamo/reflections#186

It is just doing a bare bones, common java code load. We should do that instead unless something better is found.

@rnveach rnveach changed the title Remove Reflections Usage Remove Reflections Library Usage Mar 31, 2024
@rnveach
Copy link
Member Author

rnveach commented Apr 1, 2024

For resources, Reflections basically calls ClassLoader.getResources.
https://github.com/ronmamo/reflections/blob/master/src/main/java/org/reflections/util/ClasspathHelper.java#L103

Bananeweizen added a commit that referenced this issue Apr 1, 2024
* Classgraph is used in other Eclipse projects like Xtext, too, and is
actively maintained.
* Now finds the sevntu YML files again (which the previous reflections
based code did not find at all).

fixes #515
fixes #682
@Bananeweizen Bananeweizen self-assigned this Apr 1, 2024
@Bananeweizen
Copy link
Collaborator

@rnveach if you are going to also work on this for the main project, please be aware that the usage of the classgraph library seems to avoid quite some corner cases that you would have with rolling an own implementation in Java:

  • it knows about java module paths, too, which seem to be handled differently than class paths
  • it scans without actually loading the classes, therefore it should be more performant

@rnveach
Copy link
Member Author

rnveach commented Apr 1, 2024

I am not working on this in either projects. I doubt there is even an issue in main.

For Java classes, we use google's ClassPath for scanning classes for modules with 3rd party support. This library is only used for reading the meta files (resource files) in main repo. Not for Java files.

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

2 participants