Skip to content

Commit 7ecc12e

Browse files
committed
wip
1 parent fc228fa commit 7ecc12e

39 files changed

Lines changed: 335 additions & 252 deletions

key.ncore.java/src/adt/java-ast.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,8 @@ abstract class LoopStatement extends JavaStatement {
480480
IForUpdates updates;
481481
IGuard guard;
482482
Statement body;
483+
484+
@EqEx
483485
ImmutableList<TextualJMLConstruct> attachedJml;
484486
}
485487

key.ncore.java/src/generated/java/org/key_project/java/ast/ArrayDeclaration.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,11 @@ public Builder positionInfo(PositionInfo positionInfo) {
213213
}
214214

215215
public Builder members(MemberDeclaration members) {
216-
if (this.members == null)
217-
this.members = new ArrayList<>();
218-
this.members.add(members);
216+
if (this.members == null) {
217+
this.members = ImmutableList.of(members);
218+
return this;
219+
}
220+
this.members = this.members.append(members);
219221
return this;
220222
}
221223
}

key.ncore.java/src/generated/java/org/key_project/java/ast/ArrayReference.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ public Builder positionInfo(PositionInfo positionInfo) {
111111
}
112112

113113
public Builder inits(Expression inits) {
114-
if (this.inits == null)
115-
this.inits = new ArrayList<>();
116-
this.inits.add(inits);
114+
if (this.inits == null) {
115+
this.inits = ImmutableList.of(inits);
116+
return this;
117+
}
118+
this.inits = this.inits.append(inits);
117119
return this;
118120
}
119121
}

key.ncore.java/src/generated/java/org/key_project/java/ast/Case.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ public Builder positionInfo(PositionInfo positionInfo) {
111111
}
112112

113113
public Builder body(Statement body) {
114-
if (this.body == null)
115-
this.body = new ArrayList<>();
116-
this.body.add(body);
114+
if (this.body == null) {
115+
this.body = ImmutableList.of(body);
116+
return this;
117+
}
118+
this.body = this.body.append(body);
117119
return this;
118120
}
119121
}

key.ncore.java/src/generated/java/org/key_project/java/ast/ClassDeclaration.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,11 @@ public Builder positionInfo(PositionInfo positionInfo) {
333333
}
334334

335335
public Builder members(MemberDeclaration members) {
336-
if (this.members == null)
337-
this.members = new ArrayList<>();
338-
this.members.add(members);
336+
if (this.members == null) {
337+
this.members = ImmutableList.of(members);
338+
return this;
339+
}
340+
this.members = this.members.append(members);
339341
return this;
340342
}
341343
}

key.ncore.java/src/generated/java/org/key_project/java/ast/CompilationUnit.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,20 @@ public Builder positionInfo(PositionInfo positionInfo) {
137137
}
138138

139139
public Builder imports(Import imports) {
140-
if (this.imports == null)
141-
this.imports = new ArrayList<>();
142-
this.imports.add(imports);
140+
if (this.imports == null) {
141+
this.imports = ImmutableList.of(imports);
142+
return this;
143+
}
144+
this.imports = this.imports.append(imports);
143145
return this;
144146
}
145147

146148
public Builder typeDeclarations(TypeDeclaration typeDeclarations) {
147-
if (this.typeDeclarations == null)
148-
this.typeDeclarations = new ArrayList<>();
149-
this.typeDeclarations.add(typeDeclarations);
149+
if (this.typeDeclarations == null) {
150+
this.typeDeclarations = ImmutableList.of(typeDeclarations);
151+
return this;
152+
}
153+
this.typeDeclarations = this.typeDeclarations.append(typeDeclarations);
150154
return this;
151155
}
152156
}

key.ncore.java/src/generated/java/org/key_project/java/ast/ConstructorDeclaration.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,11 @@ public Builder voidComments(Comment[] voidComments) {
263263
}
264264

265265
public Builder parameters(ParameterDeclaration parameters) {
266-
if (this.parameters == null)
267-
this.parameters = new ArrayList<>();
268-
this.parameters.add(parameters);
266+
if (this.parameters == null) {
267+
this.parameters = ImmutableList.of(parameters);
268+
return this;
269+
}
270+
this.parameters = this.parameters.append(parameters);
269271
return this;
270272
}
271273
}

key.ncore.java/src/generated/java/org/key_project/java/ast/ContextStatementBlock.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,11 @@ public Builder statement(ImmutableList<Statement> statement) {
139139
}
140140

141141
public Builder statement(Statement statement) {
142-
if (this.statement == null)
143-
this.statement = new ArrayList<>();
144-
this.statement.add(statement);
142+
if (this.statement == null) {
143+
this.statement = ImmutableList.of(statement);
144+
return this;
145+
}
146+
this.statement = this.statement.append(statement);
145147
return this;
146148
}
147149
}

key.ncore.java/src/generated/java/org/key_project/java/ast/Default.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ public Builder positionInfo(PositionInfo positionInfo) {
8787
}
8888

8989
public Builder body(Statement body) {
90-
if (this.body == null)
91-
this.body = new ArrayList<>();
92-
this.body.add(body);
90+
if (this.body == null) {
91+
this.body = ImmutableList.of(body);
92+
return this;
93+
}
94+
this.body = this.body.append(body);
9395
return this;
9496
}
9597
}

key.ncore.java/src/generated/java/org/key_project/java/ast/Do.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
@NullMarked()
1515
public final class Do extends JavaSourceElement implements LoopStatement {
1616

17+
@EqEx
1718
private final ImmutableList<TextualJMLConstruct> attachedJml;
1819

1920
private final Statement body;
@@ -59,7 +60,7 @@ public IForUpdates updates() {
5960
return updates;
6061
}
6162

62-
public Do(ImmutableList<TextualJMLConstruct> attachedJml, Statement body, IGuard guard, ILoopInit inits, @EqEx @Nullable PositionInfo positionInfo, IForUpdates updates) {
63+
public Do(@EqEx ImmutableList<TextualJMLConstruct> attachedJml, Statement body, IGuard guard, ILoopInit inits, @EqEx @Nullable PositionInfo positionInfo, IForUpdates updates) {
6364
this.attachedJml = Objects.requireNonNull(attachedJml);
6465
this.body = Objects.requireNonNull(body);
6566
this.guard = Objects.requireNonNull(guard);
@@ -68,7 +69,7 @@ public Do(ImmutableList<TextualJMLConstruct> attachedJml, Statement body, IGuard
6869
this.updates = Objects.requireNonNull(updates);
6970
}
7071

71-
public Do(ImmutableList<TextualJMLConstruct> attachedJml, Statement body, IGuard guard, ILoopInit inits, IForUpdates updates) {
72+
public Do(@EqEx ImmutableList<TextualJMLConstruct> attachedJml, Statement body, IGuard guard, ILoopInit inits, IForUpdates updates) {
7273
this.attachedJml = Objects.requireNonNull(attachedJml);
7374
this.body = Objects.requireNonNull(body);
7475
this.guard = Objects.requireNonNull(guard);
@@ -86,10 +87,6 @@ public Do(Do other) {
8687
public MatchConditions match(java.lang.Object o, MatchConditions cond) {
8788
if (!(o instanceof Do other))
8889
return null;
89-
cond = MatchHelper.match(attachedJml, other.attachedJml, cond);
90-
if (cond == null) {
91-
return null;
92-
}
9390
cond = MatchHelper.match(body, other.body, cond);
9491
if (cond == null) {
9592
return null;
@@ -188,9 +185,11 @@ public Builder updates(IForUpdates updates) {
188185
}
189186

190187
public Builder attachedJml(TextualJMLConstruct attachedJml) {
191-
if (this.attachedJml == null)
192-
this.attachedJml = new ArrayList<>();
193-
this.attachedJml.add(attachedJml);
188+
if (this.attachedJml == null) {
189+
this.attachedJml = ImmutableList.of(attachedJml);
190+
return this;
191+
}
192+
this.attachedJml = this.attachedJml.append(attachedJml);
194193
return this;
195194
}
196195
}
@@ -212,7 +211,7 @@ public boolean equals(java.lang.Object o) {
212211
return true;
213212
if (!(o instanceof Do that))
214213
return false;
215-
return Objects.equals(attachedJml, that.attachedJml) && Objects.equals(body, that.body) && Objects.equals(guard, that.guard) && Objects.equals(inits, that.inits) && Objects.equals(updates, that.updates);
214+
return Objects.equals(body, that.body) && Objects.equals(guard, that.guard) && Objects.equals(inits, that.inits) && Objects.equals(updates, that.updates);
216215
}
217216

218217
@Override()
@@ -228,7 +227,7 @@ public String toString() {
228227
@Override()
229228
public int hashCode() {
230229
if (hashCode == null)
231-
hashCode = Objects.hash(attachedJml, body, guard, inits, updates);
230+
hashCode = Objects.hash(body, guard, inits, updates);
232231
return hashCode;
233232
}
234233

0 commit comments

Comments
 (0)