Skip to content

Commit 73ebd21

Browse files
committed
Java: Refactor most of the logic out of the model editor query files
1 parent 509b7fe commit 73ebd21

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

java/ql/src/utils/modeleditor/ApplicationModeEndpoints.ql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88
*/
99

1010
private import java
11+
private import ApplicationModeEndpointsQuery
1112
private import ModelEditor
1213

13-
class ExternalEndpoint extends Endpoint {
14-
ExternalEndpoint() { not this.fromSource() }
15-
}
16-
1714
private Call aUsage(ExternalEndpoint endpoint) {
1815
result.getCallee().getSourceDeclaration() = endpoint
1916
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
private import java
2+
private import ModelEditor
3+
4+
/**
5+
* A class of effectively public callables in library code.
6+
*/
7+
class ExternalEndpoint extends Endpoint {
8+
ExternalEndpoint() { not this.fromSource() }
9+
}

java/ql/src/utils/modeleditor/FrameworkModeEndpoints.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88
*/
99

1010
private import java
11-
private import semmle.code.java.dataflow.internal.ModelExclusions
11+
private import FrameworkModeEndpointsQuery
1212
private import ModelEditor
1313

14-
class PublicEndpointFromSource extends Endpoint, ModelApi { }
15-
1614
from PublicEndpointFromSource endpoint, string apiName, boolean supported, string type
1715
where
1816
apiName = endpoint.getApiName() and
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
private import java
2+
private import semmle.code.java.dataflow.internal.ModelExclusions
3+
private import ModelEditor
4+
5+
/**
6+
* A class of effectively public callables from source code.
7+
*/
8+
class PublicEndpointFromSource extends Endpoint, ModelApi { }

0 commit comments

Comments
 (0)