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
10
10
private import semmle.code.java.dataflow.TaintTracking
11
11
private import semmle.code.java.dataflow.internal.ModelExclusions
12
12
13
- private string containerAsJar ( Container container ) {
14
- if container instanceof JarFile then result = container .getBaseName ( ) else result = "rt.jar"
15
- }
16
-
17
13
/** Holds if the given callable is not worth supporting. */
18
14
private predicate isUninteresting ( Callable c ) {
19
15
c .getDeclaringType ( ) instanceof TestLibrary or
@@ -35,10 +31,18 @@ class ExternalApi extends Callable {
35
31
"#" + this .getName ( ) + paramsString ( this )
36
32
}
37
33
34
+ private string getJarName ( ) {
35
+ result = this .getCompilationUnit ( ) .getParentContainer * ( ) .( JarFile ) .getBaseName ( )
36
+ }
37
+
38
38
/**
39
39
* Gets the jar file containing this API. Normalizes the Java Runtime to "rt.jar" despite the presence of modules.
40
40
*/
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
+ }
42
46
43
47
/** Gets a node that is an input to a call to this API. */
44
48
private DataFlow:: Node getAnInput ( ) {
You can’t perform that action at this time.
0 commit comments