I20220906-1800
If element is PackageFragmentRoot then resource is Folder. If resource is already IProject then getProject() returns this - as before. This solution was already suggested in bug 467761 and 579428. To test: show Properties of "src" folder. Then Select "Java Compiler". Co-authored-by: Jörg Kubitz <jkubitz-eclipse@gmx.de>