Skip to content

Commit d65c80e

Browse files
authored
Merge pull request #158 from secure-software-engineering/develop
Prepare for 4.2.0
2 parents e03e5e4 + 22ee0b9 commit d65c80e

File tree

170 files changed

+3870
-3791
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+3870
-3791
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,10 @@ jobs:
6969
fetch-depth: 0
7070

7171
- name: Get latest tag
72-
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
72+
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
7373

7474
- name: Create GitHub release
7575
run: |
76-
gh release create "$TAG"
76+
gh release create ${{ env.tag }} --title ${{ env.tag }} --generate-notes
7777
env:
7878
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79-
TAG: ${{ steps.get_tag.outputs.tag }}

.github/workflows/maven.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ on:
1212
jobs:
1313
BuildAndTest:
1414
strategy:
15+
fail-fast: false
1516
matrix:
16-
framework: [Soot, Opal] # TODO Add SootUp when available
17+
framework: [Soot, SootUp, Opal]
1718
runs-on: ubuntu-latest
1819
steps:
1920
- name: Checkout source code

PDS/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>de.fraunhofer.iem</groupId>
77
<artifactId>Boomerang-Parent</artifactId>
8-
<version>4.1.0</version>
8+
<version>4.1.1-SNAPSHOT</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111
<artifactId>PDS</artifactId>

SynchronizedPDS/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>de.fraunhofer.iem</groupId>
77
<artifactId>Boomerang-Parent</artifactId>
8-
<version>4.1.0</version>
8+
<version>4.1.1-SNAPSHOT</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111
<artifactId>synchronizedPDS</artifactId>

SynchronizedPDS/src/main/java/sync/pds/weights/SetDomainImpl.java

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,26 @@ public SetDomainImpl(Collection<Node<Stmt, Fact>> nodes) {
3535

3636
@NonNull
3737
@Override
38-
public Weight extendWith(Weight other) {
39-
if (other.equals(one())) {
38+
public Weight extendWith(@NonNull Weight other) {
39+
Weight one = one();
40+
if (other == one) {
4041
return this;
4142
}
42-
if (this.equals(one())) {
43-
return other;
44-
}
43+
4544
return zero();
4645
}
4746

4847
@NonNull
4948
@Override
5049
public Weight combineWith(@NonNull Weight other) {
5150

52-
if (other.equals(zero())) return this;
53-
if (this.equals(zero())) return other;
54-
if (this.equals(one()) || other.equals(one())) return one();
55-
56-
if (other instanceof SetDomainImpl) {
57-
Set<Node<Stmt, Fact>> merged = Sets.newHashSet(nodes);
58-
merged.addAll(((SetDomainImpl) other).nodes);
59-
return new SetDomainImpl<N, Stmt, Fact>(merged);
60-
}
61-
return zero();
51+
SetDomainZero zero = zero();
52+
SetDomain one = one();
53+
if (other == zero) return this;
54+
if (other == one) return one;
55+
Set<Node<Stmt, Fact>> merged = Sets.newHashSet(nodes);
56+
merged.addAll(((SetDomainImpl) other).nodes);
57+
return new SetDomainImpl<N, Stmt, Fact>(merged);
6258
}
6359

6460
@NonNull

SynchronizedPDS/src/main/java/sync/pds/weights/SetDomainOne.java

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
*/
1515
package sync.pds.weights;
1616

17-
import static sync.pds.weights.SetDomainZero.zero;
18-
1917
import java.util.Collection;
2018
import org.jspecify.annotations.NonNull;
2119
import sync.pds.solver.nodes.Node;
@@ -24,37 +22,24 @@
2422
public class SetDomainOne implements SetDomain {
2523
@NonNull private static final SetDomainOne one = new SetDomainOne();
2624

27-
public static Weight one() {
25+
private SetDomainOne() {
26+
/* Singleton*/
27+
}
28+
29+
public static SetDomainOne one() {
2830
return one;
2931
}
3032

3133
@NonNull
3234
@Override
3335
public Weight extendWith(@NonNull Weight other) {
34-
if (other.equals(one())) {
35-
return this;
36-
}
37-
if (this.equals(one())) {
38-
return other;
39-
}
40-
return zero();
36+
return other;
4137
}
4238

4339
@NonNull
4440
@Override
4541
public Weight combineWith(@NonNull Weight other) {
46-
47-
if (other.equals(zero())) return this;
48-
if (this.equals(zero())) return other;
49-
if (this.equals(one()) || other.equals(one())) return one();
50-
51-
if (other instanceof SetDomainOne) {
52-
throw new IllegalStateException("SetDomainOne.CombineWith-Dont");
53-
// Set<Node<Stmt, Fact>> merged = Sets.newHashSet(getNodes());
54-
// merged.addAll(((SetDomainImpl) other).getNodes());
55-
// return new SetDomainImpl<N, Stmt, Fact>(merged);
56-
}
57-
return zero();
42+
return this;
5843
}
5944

6045
@NonNull

SynchronizedPDS/src/main/java/sync/pds/weights/SetDomainZero.java

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414
*/
1515
package sync.pds.weights;
1616

17-
import static sync.pds.weights.SetDomainOne.one;
18-
19-
import com.google.common.collect.Sets;
2017
import java.util.Collection;
21-
import java.util.HashSet;
2218
import org.jspecify.annotations.NonNull;
2319
import sync.pds.solver.nodes.Node;
2420
import wpds.impl.Weight;
@@ -27,33 +23,24 @@ public class SetDomainZero implements SetDomain {
2723

2824
@NonNull private static final SetDomainZero zero = new SetDomainZero();
2925

26+
private SetDomainZero() {
27+
/* Singleton */
28+
}
29+
30+
public static SetDomainZero zero() {
31+
return zero;
32+
}
33+
3034
@NonNull
3135
@Override
3236
public Weight extendWith(@NonNull Weight other) {
33-
if (other.equals(one())) {
34-
return this;
35-
}
36-
if (this.equals(one())) {
37-
return other;
38-
}
39-
return zero();
37+
return this;
4038
}
4139

4240
@NonNull
4341
@Override
4442
public Weight combineWith(@NonNull Weight other) {
45-
46-
if (other.equals(zero())) return this;
47-
if (this.equals(zero())) return other;
48-
if (this.equals(one()) || other.equals(one())) return one();
49-
50-
if (other instanceof SetDomainOne) {
51-
HashSet<Node> merged = Sets.newHashSet(getNodes());
52-
merged.addAll(((SetDomainImpl) other).getNodes());
53-
throw new IllegalStateException("SetDomainZero.CombineWith-Dont");
54-
// return new SetDomainImpl<N, Stmt, Fact>(merged);
55-
}
56-
return zero();
43+
return other;
5744
}
5845

5946
@NonNull
@@ -62,10 +49,6 @@ public Collection<Node> getNodes() {
6249
throw new IllegalStateException("SetDomain.getNodes() - don't");
6350
}
6451

65-
public static SetDomainZero zero() {
66-
return zero;
67-
}
68-
6952
@NonNull
7053
@Override
7154
public Collection<Node> elements() {

WPDS/pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>de.fraunhofer.iem</groupId>
77
<artifactId>Boomerang-Parent</artifactId>
8-
<version>4.1.0</version>
8+
<version>4.1.1-SNAPSHOT</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111
<artifactId>WPDS</artifactId>
@@ -28,6 +28,7 @@
2828
<dependency>
2929
<groupId>de.fraunhofer.iem</groupId>
3030
<artifactId>PDS</artifactId>
31+
<version>4.0.0</version>
3132
</dependency>
3233
<dependency>
3334
<groupId>de.fraunhofer.iem</groupId>
@@ -37,5 +38,10 @@
3738
<groupId>junit</groupId>
3839
<artifactId>junit</artifactId>
3940
</dependency>
41+
<dependency>
42+
<groupId>org.jspecify</groupId>
43+
<artifactId>jspecify</artifactId>
44+
<version>1.0.0</version>
45+
</dependency>
4046
</dependencies>
4147
</project>

WPDS/src/test/java/tests/MinSeminringPostStarTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void twoCall() {
104104
}
105105

106106
private static MinSemiring w(int i) {
107-
return new MinSemiring(i);
107+
return new MinSemiringImpl(i);
108108
}
109109

110110
static WeightedPAutomaton<StackSymbol, Abstraction, MinSemiring> waccepts(
@@ -124,7 +124,7 @@ public StackSymbol epsilon() {
124124

125125
@Override
126126
public MinSemiring getOne() {
127-
return MinSemiring.one();
127+
return MinSemiringOne.one();
128128
}
129129

130130
@Override

WPDS/src/test/java/tests/MinSemiring.java

Lines changed: 2 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -14,84 +14,8 @@
1414
*/
1515
package tests;
1616

17-
import de.fraunhofer.iem.Location;
18-
import org.jspecify.annotations.NonNull;
1917
import wpds.impl.Weight;
2018

21-
public class MinSemiring implements Weight {
22-
int i;
23-
24-
public MinSemiring(int i) {
25-
this.i = i;
26-
}
27-
28-
private MinSemiring() {}
29-
30-
@NonNull
31-
@Override
32-
public Weight extendWith(@NonNull Weight other) {
33-
if (other.equals(one())) return this;
34-
if (this.equals(one())) return other;
35-
MinSemiring o = (MinSemiring) other;
36-
return new MinSemiring(o.i + i);
37-
}
38-
39-
@NonNull
40-
@Override
41-
public Weight combineWith(@NonNull Weight other) {
42-
if (other.equals(zero())) return this;
43-
if (this.equals(zero())) return other;
44-
MinSemiring o = (MinSemiring) other;
45-
return new MinSemiring(Math.min(o.i, i));
46-
}
47-
48-
private static MinSemiring one;
49-
50-
public static <N extends Location> MinSemiring one() {
51-
if (one == null)
52-
one =
53-
new MinSemiring(0) {
54-
@Override
55-
public String toString() {
56-
return "<ONE>";
57-
}
58-
};
59-
return one;
60-
}
61-
62-
private static MinSemiring zero;
63-
64-
public static <N extends Location> MinSemiring zero() {
65-
if (zero == null)
66-
zero =
67-
new MinSemiring(110000) {
68-
@Override
69-
public String toString() {
70-
return "<ZERO>";
71-
}
72-
};
73-
return zero;
74-
}
75-
76-
@Override
77-
public String toString() {
78-
return Integer.toString(i);
79-
}
80-
81-
@Override
82-
public int hashCode() {
83-
final int prime = 31;
84-
int result = 1;
85-
result = prime * result + i;
86-
return result;
87-
}
88-
89-
@Override
90-
public boolean equals(Object obj) {
91-
if (this == obj) return true;
92-
if (obj == null) return false;
93-
if (getClass() != obj.getClass()) return false;
94-
MinSemiring other = (MinSemiring) obj;
95-
return i == other.i;
96-
}
19+
public interface MinSemiring extends Weight {
20+
int getValue();
9721
}

0 commit comments

Comments
 (0)