@@ -19,19 +19,35 @@ private class RequestDispatcherSink extends UnsafeUrlForwardSink {
1919 }
2020}
2121
22- /** The `getResource` and `getResourceAsStream` methods of `Class`. */
22+ /** The `getResource` method of `Class`. */
2323class GetClassResourceMethod extends Method {
2424 GetClassResourceMethod ( ) {
2525 this .getSourceDeclaration ( ) .getDeclaringType ( ) .hasQualifiedName ( "java.lang" , "Class" ) and
26- this .hasName ( [ "getResource" , "getResourceAsStream" ] )
26+ this .hasName ( "getResource" )
27+ }
28+ }
29+
30+ /** The `getResourceAsStream` method of `Class`. */
31+ class GetClassResourceAsStreamMethod extends Method {
32+ GetClassResourceAsStreamMethod ( ) {
33+ this .getSourceDeclaration ( ) .getDeclaringType ( ) .hasQualifiedName ( "java.lang" , "Class" ) and
34+ this .hasName ( "getResourceAsStream" )
2735 }
2836}
2937
30- /** The `getResource` and `getResourceAsStream` methods of `ClassLoader`. */
38+ /** The `getResource` method of `ClassLoader`. */
3139class GetClassLoaderResourceMethod extends Method {
3240 GetClassLoaderResourceMethod ( ) {
3341 this .getDeclaringType ( ) .hasQualifiedName ( "java.lang" , "ClassLoader" ) and
34- this .hasName ( [ "getResource" , "getResourceAsStream" ] )
42+ this .hasName ( "getResource" )
43+ }
44+ }
45+
46+ /** The `getResourceAsStream` method of `ClassLoader`. */
47+ class GetClassLoaderResourceAsStreamMethod extends Method {
48+ GetClassLoaderResourceAsStreamMethod ( ) {
49+ this .getDeclaringType ( ) .hasQualifiedName ( "java.lang" , "ClassLoader" ) and
50+ this .hasName ( "getResourceAsStream" )
3551 }
3652}
3753
@@ -66,13 +82,14 @@ class GetVirtualFileMethod extends Method {
6682/** An argument to `getResource()` or `getResourceAsStream()`. */
6783private class GetResourceSink extends UnsafeUrlForwardSink {
6884 GetResourceSink ( ) {
85+ sinkNode ( this , "open-url" )
86+ or
6987 exists ( MethodAccess ma |
7088 (
71- ma .getMethod ( ) instanceof GetServletResourceMethod or
72- ma .getMethod ( ) instanceof GetFacesResourceMethod or
73- ma .getMethod ( ) instanceof GetClassResourceMethod or
74- ma .getMethod ( ) instanceof GetClassLoaderResourceMethod or
75- ma .getMethod ( ) instanceof GetWildflyResourceMethod or
89+ ma .getMethod ( ) instanceof GetServletResourceAsStreamMethod or
90+ ma .getMethod ( ) instanceof GetFacesResourceAsStreamMethod or
91+ ma .getMethod ( ) instanceof GetClassResourceAsStreamMethod or
92+ ma .getMethod ( ) instanceof GetClassLoaderResourceAsStreamMethod or
7693 ma .getMethod ( ) instanceof GetVirtualFileMethod
7794 ) and
7895 ma .getArgument ( 0 ) = this .asExpr ( )
0 commit comments