Issue: if repository fragment interface is declared inside another class, its implementation is never found
Steps to reproduce: see reference URL
I did some digging and here's what I found:
NestedFragmentInterfaceImpl is not recognized as an implementation of a repository fragment interface NestedFragmentInterface
everything works fine if repository fragment interface is not nested
the root cause of this behaviour is DefaultImplementationLookupConfiguration not being able to match expected implementation class name for +nested interface+ and actual +nested class+ name
On the last point, it looks like in the case with a nested interface DefaultImplementationLookupConfiguration "normalizes" interface name and class name differently.
Method getImplementationClassName() only shortens interface name (i.e. trims package name) and adds implementation postfix. This means that for nested interface EnclosingClass$NestedFragmentInterface we get "EnclosingClass.NestedFragmentInterfaceImpl" as a result.
In the same time method matches() not only shortens bean class name but also "localizes" it (i.e. removes enclosing class name). So even for nested class EnclosingClass$NestedFragmentInterfaceImpl we get "NestedFragmentInterfaceImpl".
In theory there are 3 options here:
leaving everything as is, accepting that repository fragment interfaces can not be nested (otherwise fragment implementations won't be found because bean class names will always be stripped of enclosing class name)
adjusting matches() to avoid using local bean class name if interface name is not local, this will allow fragment interfaces and implementation classes to be declared inside the same enclosing class (can be useful in tests)
adjusting getImplementationClassName() to use local interface name, this will allow repository interfaces and implementation classes to be declared anywhere (which also means repository interface nested in class A can have implementation nested in class B)
It makes sense to support nested fragment interfaces and fragment implementation classes to be discovered when considerNestedRepositories is configured to true. Feel free to submit a pull request along with tests that verify the desired behavior