@@ -46,8 +46,26 @@ public function resolve(string $javaPath, JavaClass $class = null): array
4646 case static ::RESOURCE_TYPE_INNER_CLASS :
4747 // TODO: Implement here
4848 break ;
49+ case static ::RESOURCE_TYPE_JAR :
50+ if (($ key = array_search ($ relativePath , $ this ->resolvedPaths , true )) !== false ) {
51+ return $ this ->resolvedPaths [$ relativePath ];
52+ }
53+ /**
54+ * @var JavaArchive $value
55+ */
56+ try {
57+ return $ this ->resolvedPaths [] = [
58+ static ::RESOLVED_TYPE_CLASS ,
59+ $ value ->getClassByName ($ relativePath ),
60+ ];
61+ } catch (ClassNotFoundException $ e ) {
62+ }
63+ break ;
4964 case static ::RESOURCE_TYPE_FILE :
5065 $ path = realpath ($ value . '/ ' . $ relativePath . '.class ' );
66+ if ($ path === false ) {
67+ break ;
68+ }
5169 if (($ key = array_search ($ path , $ this ->resolvedPaths , true )) !== false ) {
5270 return $ this ->resolvedPaths [$ key ];
5371 }
@@ -68,18 +86,6 @@ public function resolve(string $javaPath, JavaClass $class = null): array
6886 ];
6987 }
7088 break ;
71- case static ::RESOURCE_TYPE_JAR :
72- /**
73- * @var JavaArchive $value
74- */
75- try {
76- return $ this ->resolvedPaths [] = [
77- static ::RESOLVED_TYPE_CLASS ,
78- $ value ->getClassByName ($ relativePath ),
79- ];
80- } catch (ClassNotFoundException $ e ) {
81- }
82- break ;
8389 case static ::RESOURCE_TYPE_CLASS :
8490 /**
8591 * @var ReaderInterface $value
0 commit comments