File tree Expand file tree Collapse file tree
semmle/code/java/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import semmle.code.java.dataflow.FlowSources
1212import DataFlow:: PathGraph
1313
1414class URLConstructor extends ClassInstanceExpr {
15- URLConstructor ( ) { this .getConstructor ( ) .getDeclaringType ( ) . getQualifiedName ( ) = "java.net.URL" }
15+ URLConstructor ( ) { this .getConstructor ( ) .getDeclaringType ( ) instanceof TypeUrl }
1616
1717 Expr stringArg ( ) {
1818 // Query only in URL's that were constructed by calling the single parameter string constructor.
@@ -26,7 +26,7 @@ class URLConstructor extends ClassInstanceExpr {
2626
2727class URLOpenStreamMethod extends Method {
2828 URLOpenStreamMethod ( ) {
29- this .getDeclaringType ( ) . getQualifiedName ( ) = "java.net.URL" and
29+ this .getDeclaringType ( ) instanceof TypeUrl and
3030 this .getName ( ) = "openStream"
3131 }
3232}
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ class TypeSocket extends RefType {
1212 TypeSocket ( ) { hasQualifiedName ( "java.net" , "Socket" ) }
1313}
1414
15+ class TypeUrl extends RefType {
16+ TypeUrl ( ) { hasQualifiedName ( "java.net" , "URL" ) }
17+ }
18+
1519class URLConnectionGetInputStreamMethod extends Method {
1620 URLConnectionGetInputStreamMethod ( ) {
1721 getDeclaringType ( ) instanceof TypeUrlConnection and
You can’t perform that action at this time.
0 commit comments