Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a1279d7

Browse filesBrowse files
author
daan.vandenheuvel
committed
add extra model stuff, not final
1 parent 1696783 commit a1279d7
Copy full SHA for a1279d7

File tree

Expand file treeCollapse file tree

5 files changed

+62
-10
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+62
-10
lines changed

‎src/main/java/model/DataFlowGraph.java

Copy file name to clipboardExpand all lines: src/main/java/model/DataFlowGraph.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,13 @@ public Optional<OwnedNode<?>> getOwner() {
178178
}
179179

180180
@Override
181-
Collection<OwnerNode<?>> getOwnedOwners() {
181+
public Collection<OwnerNode<?>> getOwnedOwners() {
182182
// streaming and collecting needed for casting.
183183
return this.methods.values().stream().collect(Collectors.toList());
184184
}
185185

186186
@Override
187-
Collection<DataFlowNode> getDirectOwnedNodes() {
187+
public Collection<DataFlowNode> getDirectOwnedNodes() {
188188
return this.fields;
189189
}
190190

‎src/main/java/model/OwnerNode.java

Copy file name to clipboardExpand all lines: src/main/java/model/OwnerNode.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ public final Set<DataFlowNode> getOwnedNodes() {
6666
/**
6767
* @return all nodes directly owned by this {@link OwnerNode} for which it holds that
6868
*/
69-
abstract Collection<OwnerNode<?>> getOwnedOwners();
69+
abstract public Collection<OwnerNode<?>> getOwnedOwners();
7070

7171
/**
7272
* @return all {@link DataFlowNode}s directly owned by this {@link OwnerNode}.
7373
*/
74-
abstract Collection<DataFlowNode> getDirectOwnedNodes();
74+
abstract public Collection<DataFlowNode> getDirectOwnedNodes();
7575

7676
}

‎src/main/java/model/CodeBlockCondition.java renamed to ‎src/main/java/model/controlflow/CodeBlockCondition.java

Copy file name to clipboardExpand all lines: src/main/java/model/controlflow/CodeBlockCondition.java
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
* interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including
99
* negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
1010
*/
11-
package model;
11+
package model.controlflow;
12+
13+
import model.DataFlowNode;
1214

1315
/**
1416
* The condition that needs to be true before a {@link DataFlowCodeBlock} is executed.
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) 2022 by Eyefreight BV (www.eyefreight.com). All rights reserved.
3+
*
4+
* This software is provided by the copyright holder and contributors "as is" and any express or implied warranties, including, but
5+
* not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall
6+
* Eyefreight BV or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages
7+
* (including, but not limited to, procurement of substitute goods or services; * loss of use, data, or profits; or business
8+
* interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including
9+
* negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
10+
*/
11+
package model.controlflow;
12+
13+
/**
14+
* TODO javadoc
15+
*
16+
* @author daan.vandenheuvel
17+
*/
18+
public class ControlFlowGraph {
19+
20+
}

‎src/main/java/model/DataFlowCodeBlock.java renamed to ‎src/main/java/model/controlflow/DataFlowCodeBlock.java

Copy file name to clipboardExpand all lines: src/main/java/model/controlflow/DataFlowCodeBlock.java
+35-5Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,27 @@
88
* interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including
99
* negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
1010
*/
11-
package model;
11+
package model.controlflow;
1212

1313
import java.util.Collection;
1414
import java.util.List;
1515
import java.util.Optional;
1616

1717
import org.apache.commons.lang3.tuple.Pair;
1818

19+
import com.github.javaparser.ast.stmt.BlockStmt;
20+
21+
import model.DataFlowNode;
22+
import model.OwnedNode;
23+
import model.OwnerNode;
24+
1925
/**
2026
* A block of code in a java class. This contains a list of nodes that will be executed in sequence. A code block has a (possibly empty) list of codeBlock's
2127
* that succeed this codeBlock as well as a list preceeding it.
2228
*
2329
* @author daan.vandenheuvel
2430
*/
25-
public class DataFlowCodeBlock extends OwnerNode { // TODO find the JavaParser Node that represents a code block and add it as type argument.
31+
public class DataFlowCodeBlock extends OwnerNode<BlockStmt> { // TODO find the JavaParser Node that represents a code block and add it as type argument.
2632

2733
// TODO methods and classes should extend this.
2834

@@ -40,21 +46,45 @@ public class DataFlowCodeBlock extends OwnerNode { // TODO find the JavaParser N
4046
private List<DataFlowNode> dataFlowNodes;
4147

4248
@Override
43-
Collection getOwnedOwners() {
49+
public Collection<OwnerNode<?>> getOwnedOwners() {
4450
// TODO Auto-generated method stub
4551
return null;
4652
}
4753

4854
@Override
49-
Collection getDirectOwnedNodes() {
55+
public Collection<DataFlowNode> getDirectOwnedNodes() {
5056
// TODO Auto-generated method stub
5157
return null;
5258
}
5359

5460
@Override
55-
public Optional getOwner() {
61+
public Optional<OwnedNode<?>> getOwner() {
5662
// TODO Auto-generated method stub
5763
return null;
5864
}
5965

66+
public List<DataFlowCodeBlock> getCalledBy() {
67+
return calledBy;
68+
}
69+
70+
public void setCalledBy(List<DataFlowCodeBlock> calledBy) {
71+
this.calledBy = calledBy;
72+
}
73+
74+
public List<Pair<CodeBlockCondition, DataFlowCodeBlock>> getCalled() {
75+
return called;
76+
}
77+
78+
public void setCalled(List<Pair<CodeBlockCondition, DataFlowCodeBlock>> called) {
79+
this.called = called;
80+
}
81+
82+
public List<DataFlowNode> getDataFlowNodes() {
83+
return dataFlowNodes;
84+
}
85+
86+
public void setDataFlowNodes(List<DataFlowNode> dataFlowNodes) {
87+
this.dataFlowNodes = dataFlowNodes;
88+
}
89+
6090
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.