-
Notifications
You must be signed in to change notification settings - Fork 42
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
Is it intended not to index anon classes? #39
Comments
Actually this is intended. I think in most of the cases its not what the user of the library would expect. Such a feature could be added with a (disabled by default) configuration option though. |
Adding a configuration option would be great, perhaps something like |
@twwwt I'm trying to understand the purpose of such an index. I don't see how it can be useful to have an index of anonymous classes, because they have exactly one instance and it is hidden inside some class or method. What is your use case? |
@sentinelt Consider the following class hierarchy @IndexSubclasses
public interface Indexed { /* ... */ }
public class SomeClass {
public static final Indexed SOME_CONSTANT = new Indexed() {
// Anon class with some logic inside.
};
}
public interface SubIndexed extends Indexed {
public static final SubIndexed ANOTHER_CONSTANT = new SubIndexed() {
// Anon class with some logic inside.
};
}
public enum EnumIndexed implements Indexed {
one, two, three;
} We want to find the constants implementing |
Consider the following example
I would expect that the anon class (which compiles to a class file name SomeClass$1, disregarding the package name) would be included in the index of the interface
I
. However, a test showed that this is not the case, which brings me to the question whether this is intended?The text was updated successfully, but these errors were encountered: