@@ -39,7 +39,7 @@ public class VariabilityDatasetLoaderTest {
3939 if (!SIMPLE_HISTORY_REPO_DIR .exists ()) {
4040 GitUtil .fromRemote (SPL_REPO_URI , "simple-history" , TEMP_TEST_REPO_DIR .toString ());
4141 }
42- } catch (IOException | GitAPIException e ) {
42+ } catch (final IOException | GitAPIException e ) {
4343 throw new RuntimeException (e );
4444 }
4545 }
@@ -48,7 +48,7 @@ public class VariabilityDatasetLoaderTest {
4848
4949 @ Before
5050 public void loadData () {
51- var result = new VariabilityDatasetLoader ().load (SIMPLE_VARIABILITY_METADATA_DIR );
51+ final var result = new VariabilityDatasetLoader ().load (SIMPLE_VARIABILITY_METADATA_DIR );
5252 assert result .isSuccess ();
5353 this .dataset = result .getSuccess ();
5454 }
@@ -74,8 +74,8 @@ public void successCommitsAreLoaded() {
7474 "741ee98bf3edee477c504726fdc482ae85adf0e5"
7575 };
7676
77- List <SPLCommit > successCommits = dataset .getSuccessCommits ();
78- for (var expectedCommit : expectedSuccessCommits ) {
77+ final List <SPLCommit > successCommits = dataset .getSuccessCommits ();
78+ for (final var expectedCommit : expectedSuccessCommits ) {
7979 assert Commit .contains (successCommits , expectedCommit );
8080 }
8181 assert successCommits .size () == expectedSuccessCommits .length ;
@@ -91,8 +91,8 @@ public void errorCommitsAreLoaded() {
9191 "4ea494802cd552464c2f1a47d727a206eccf1d20"
9292 };
9393
94- List <SPLCommit > errorCommits = dataset .getErrorCommits ();
95- for (var expectedCommit : expectedErrorCommits ) {
94+ final List <SPLCommit > errorCommits = dataset .getErrorCommits ();
95+ for (final var expectedCommit : expectedErrorCommits ) {
9696 assert Commit .contains (errorCommits , expectedCommit );
9797 }
9898 assert errorCommits .size () == expectedErrorCommits .length ;
@@ -107,8 +107,8 @@ public void incompletePCCommitsAreLoaded() {
107107 "f0619022ca9f6aeaba51fb1b71e77f6887cca4a4"
108108 };
109109
110- List <SPLCommit > incompletePCCommits = dataset .getPartialSuccessCommits ();
111- for (var expectedCommit : expectedSuccessCommits ) {
110+ final List <SPLCommit > incompletePCCommits = dataset .getPartialSuccessCommits ();
111+ for (final var expectedCommit : expectedSuccessCommits ) {
112112 assert Commit .contains (incompletePCCommits , expectedCommit );
113113 }
114114 assert incompletePCCommits .size () == expectedSuccessCommits .length ;
@@ -119,16 +119,16 @@ public void variabilityHistoryBuildCorrectly() {
119119 // We created a test VariabilityRepo for which we manually selected success and error commits. The following
120120 // commit lists represent all sequences of success commits that were created. Any deviation from these sequences
121121 // indicates a bug in loading the VariabilityRepo
122- var firstList = new String []{"eab1607a6f137376e57a3381c2fdae9c9d46de4d" , "78fe3d306860e11e327a43cfce2c97748a34c1e1" };
123- var secondList = new String []{"454f7da158fdf3fe4b3c3fc8110f6c15861f97fa" , "600f60df96cdbbf3319085d8e777d7e66c96e013" , "a54c3c30f2dff6dc36331f06360630b697b7562c" , "38e15e31eabccf82d3183273240cd44f2dec9fa9" , "741ee98bf3edee477c504726fdc482ae85adf0e5" };
124- var thirdList = new String []{"c79e89cd49fc17be386ca026686dd01e0985a5ea" , "48c073dfcfd0907f1e460628a7379b4bcbc8c737" };
122+ final var firstList = new String []{"eab1607a6f137376e57a3381c2fdae9c9d46de4d" , "78fe3d306860e11e327a43cfce2c97748a34c1e1" };
123+ final var secondList = new String []{"454f7da158fdf3fe4b3c3fc8110f6c15861f97fa" , "600f60df96cdbbf3319085d8e777d7e66c96e013" , "a54c3c30f2dff6dc36331f06360630b697b7562c" , "38e15e31eabccf82d3183273240cd44f2dec9fa9" , "741ee98bf3edee477c504726fdc482ae85adf0e5" };
124+ final var thirdList = new String []{"c79e89cd49fc17be386ca026686dd01e0985a5ea" , "48c073dfcfd0907f1e460628a7379b4bcbc8c737" };
125125
126- VariabilityHistory history = dataset .getVariabilityHistory (SequenceExtractors .longestNonOverlappingSequences ());
127- var commitSequences = history .commitSequences ();
126+ final VariabilityHistory history = dataset .getVariabilityHistory (SequenceExtractors .longestNonOverlappingSequences ());
127+ final var commitSequences = history .commitSequences ();
128128 // Check the size
129129 assert commitSequences .size () == 3 ;
130130
131- for (var sequence : commitSequences ) {
131+ for (final var sequence : commitSequences ) {
132132 switch (sequence .size ()) {
133133 case 2 -> {
134134 // The retrieved sequence contains 2 commits, so it must contain the same commits as either firstList or secondList
@@ -148,99 +148,99 @@ public void variabilityHistoryBuildCorrectly() {
148148
149149 @ Test
150150 public void messagesOfSuccessCommitsAreLoaded () {
151- for (SPLCommit commit : dataset .getSuccessCommits ()) {
152- String message = commit .message ().run ().orElseThrow ();
151+ for (final SPLCommit commit : dataset .getSuccessCommits ()) {
152+ final String message = commit .message ().run ().orElseThrow ();
153153 assert message .equals (COMMIT_MESSAGE );
154154 }
155155 }
156156
157157 @ Test
158158 public void messagesOfIncompletePCCommitsAreLoaded () {
159- for (SPLCommit commit : dataset .getPartialSuccessCommits ()) {
160- String message = commit .message ().run ().orElseThrow ();
159+ for (final SPLCommit commit : dataset .getPartialSuccessCommits ()) {
160+ final String message = commit .message ().run ().orElseThrow ();
161161 assert message .equals (COMMIT_MESSAGE );
162162 }
163163 }
164164
165165 @ Test
166166 public void noMessagesForErrorCommits () {
167- for (SPLCommit commit : dataset .getErrorCommits ()) {
168- Optional <String > message = commit .message ().run ();
167+ for (final SPLCommit commit : dataset .getErrorCommits ()) {
168+ final Optional <String > message = commit .message ().run ();
169169 assert message .isEmpty ();
170170 }
171171 }
172172
173173 @ Test
174174 public void logsOfEachCommitAreLoaded () {
175- for (SPLCommit commit : dataset .getAllCommits ()) {
176- String log = commit .kernelHavenLog ().run ().orElseThrow ();
175+ for (final SPLCommit commit : dataset .getAllCommits ()) {
176+ final String log = commit .kernelHavenLog ().run ().orElseThrow ();
177177 assert "" .equals (log );
178178 }
179179 }
180180
181181 @ Test
182182 public void presenceConditionsOfSuccessCommitsAreLoaded () {
183- for (SPLCommit commit : dataset .getSuccessCommits ()) {
184- Artefact trace = commit .presenceConditions ().run ().orElseThrow ();
183+ for (final SPLCommit commit : dataset .getSuccessCommits ()) {
184+ final Artefact trace = commit .presenceConditions ().run ().orElseThrow ();
185185 assert trace != null ;
186186 }
187187 }
188188
189189 @ Test
190190 public void presenceConditionsOfIncompletePCCommitsAreLoaded () {
191- for (SPLCommit commit : dataset .getPartialSuccessCommits ()) {
192- Artefact trace = commit .presenceConditions ().run ().orElseThrow ();
191+ for (final SPLCommit commit : dataset .getPartialSuccessCommits ()) {
192+ final Artefact trace = commit .presenceConditions ().run ().orElseThrow ();
193193 assert trace != null ;
194194 }
195195 }
196196
197197 @ Test
198198 public void noPresenceConditionsForErrorCommits () {
199- for (SPLCommit commit : dataset .getErrorCommits ()) {
200- Optional <Artefact > trace = commit .presenceConditions ().run ();
199+ for (final SPLCommit commit : dataset .getErrorCommits ()) {
200+ final Optional <Artefact > trace = commit .presenceConditions ().run ();
201201 assert trace .isEmpty ();
202202 }
203203 }
204204
205205 @ Test
206206 public void featureModelsOfSuccessCommitsAreLoaded () {
207- for (SPLCommit commit : dataset .getSuccessCommits ()) {
208- IFeatureModel model = commit .featureModel ().run ().orElseThrow ();
207+ for (final SPLCommit commit : dataset .getSuccessCommits ()) {
208+ final IFeatureModel model = commit .featureModel ().run ().orElseThrow ();
209209 assert model != null ;
210210 }
211211 }
212212
213213 @ Test
214214 public void featureModelsOfIncompletePCCommitsAreLoaded () {
215- for (SPLCommit commit : dataset .getPartialSuccessCommits ()) {
215+ for (final SPLCommit commit : dataset .getPartialSuccessCommits ()) {
216216 if (commit .id ().equals (COMMIT_WITH_INVALID_DIMACS_FILE )) {
217217 // I added an invalid String to one of the commits
218218 continue ;
219219 }
220- IFeatureModel model = commit .featureModel ().run ().orElseThrow ();
220+ final IFeatureModel model = commit .featureModel ().run ().orElseThrow ();
221221 assert model != null ;
222222 }
223223 }
224224
225225 @ Test
226226 public void expectParseError () {
227- for (SPLCommit commit : dataset .getPartialSuccessCommits ()) {
227+ for (final SPLCommit commit : dataset .getPartialSuccessCommits ()) {
228228 if (commit .id ().equals (COMMIT_WITH_INVALID_DIMACS_FILE )) {
229- Optional <IFeatureModel > model = commit .featureModel ().run ();
229+ final Optional <IFeatureModel > model = commit .featureModel ().run ();
230230 assert model .isEmpty ();
231231 }
232232 }
233233 }
234234
235235 @ Test
236236 public void noFeatureModelForErrorCommits () {
237- for (SPLCommit commit : dataset .getErrorCommits ()) {
238- Optional <IFeatureModel > model = commit .featureModel ().run ();
237+ for (final SPLCommit commit : dataset .getErrorCommits ()) {
238+ final Optional <IFeatureModel > model = commit .featureModel ().run ();
239239 assert model .isEmpty ();
240240 }
241241 }
242242
243- private void assertCommitIdsAreEqual (String [] ids , List <SPLCommit > commits ) {
243+ private void assertCommitIdsAreEqual (final String [] ids , final List <SPLCommit > commits ) {
244244 assert ids .length == commits .size ();
245245 for (int i = 0 ; i < ids .length ; i ++) {
246246 assert ids [i ].equals (commits .get (i ).id ());
0 commit comments