File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,6 @@ private import semmle.code.java.dataflow.internal.FlowSummaryImpl as FlowSummary
1010private import semmle.code.java.dataflow.TaintTracking
1111private import semmle.code.java.dataflow.internal.ModelExclusions
1212
13- private string containerAsJar ( Container container ) {
14- if container instanceof JarFile then result = container .getBaseName ( ) else result = "rt.jar"
15- }
16-
1713/** Holds if the given callable is not worth supporting. */
1814private predicate isUninteresting ( Callable c ) {
1915 c .getDeclaringType ( ) instanceof TestLibrary or
@@ -35,10 +31,18 @@ class ExternalApi extends Callable {
3531 "#" + this .getName ( ) + paramsString ( this )
3632 }
3733
34+ private string getJarName ( ) {
35+ result = this .getCompilationUnit ( ) .getParentContainer * ( ) .( JarFile ) .getBaseName ( )
36+ }
37+
3838 /**
3939 * Gets the jar file containing this API. Normalizes the Java Runtime to "rt.jar" despite the presence of modules.
4040 */
41- string jarContainer ( ) { result = containerAsJar ( this .getCompilationUnit ( ) .getParentContainer * ( ) ) }
41+ string jarContainer ( ) {
42+ result = this .getJarName ( )
43+ or
44+ not exists ( this .getJarName ( ) ) and result = "rt.jar"
45+ }
4246
4347 /** Gets a node that is an input to a call to this API. */
4448 private DataFlow:: Node getAnInput ( ) {
You can’t perform that action at this time.
0 commit comments