1414@ NullMarked ()
1515public 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