@@ -1835,4 +1835,73 @@ public static void main(String [] args) {
18351835 env .removeProject (projectPath );
18361836 }
18371837
1838+
1839+ // https://github.com/eclipse-jdt/eclipse.jdt.core/issues/4632
1840+ // The type ... from the descriptor computed for the target context is not visible here
1841+ public void testIssue4632 () throws JavaModelException {
1842+ IPath projectPath = env .addProject ("Project" , "19" );
1843+ env .addExternalJars (projectPath , Util .getJavaClassLibs ());
1844+
1845+ // remove old package fragment root so that names don't collide
1846+ env .removePackageFragmentRoot (projectPath , "" );
1847+
1848+ IPath root = env .addPackageFragmentRoot (projectPath , "src" );
1849+ env .setOutputFolder (projectPath , "bin" );
1850+
1851+ env .addClass (root , "other" , "AuthorizeHttpRequestsConfigurer" ,
1852+ """
1853+ package other;
1854+
1855+ public class AuthorizeHttpRequestsConfigurer<T> {
1856+ public class AuthorizationManagerRequestMatcherRegistry {}
1857+ }
1858+ """ );
1859+ env .addClass (root , "other" , "Customizer" ,
1860+ """
1861+ package other;
1862+
1863+ public interface Customizer<T> {
1864+ void customize(T t);
1865+ }
1866+ """ );
1867+ env .addClass (root , "other" , "HttpSecurity" ,
1868+ """
1869+ package other;
1870+
1871+ public class HttpSecurity {
1872+ }
1873+ """ );
1874+ env .addClass (root , "test" , "FrontEndSecurityCustomizer" ,
1875+ """
1876+ package test;
1877+
1878+ import other.AuthorizeHttpRequestsConfigurer;
1879+ import other.Customizer;
1880+ import other.HttpSecurity;
1881+
1882+ public interface FrontEndSecurityCustomizer extends Customizer<AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry> {
1883+
1884+ }
1885+ """ );
1886+ fullBuild (projectPath );
1887+ expectingNoProblems ();
1888+
1889+ env .addClass (root , "test" , "ProfileSecurityConfiguration" ,
1890+ """
1891+ package test;
1892+
1893+ public class ProfileSecurityConfiguration {
1894+
1895+ FrontEndSecurityCustomizer profileFrontEndSecurityCustomizer() {
1896+ return auth -> System.out.println(auth);
1897+ }
1898+ }
1899+ """ );
1900+
1901+ incrementalBuild (projectPath );
1902+ expectingNoProblems ();
1903+
1904+ env .removeProject (projectPath );
1905+ }
1906+
18381907}
0 commit comments