Skip to content

Commit bcb39bb

Browse files
committed
Merge branch 'checkstyle-11' into 'master'
fix issues found by Checkstyle 11 See merge request se2/scratch/litterbox/litterbox!741
2 parents 0abac8b + fd864a2 commit bcb39bb

5 files changed

Lines changed: 22 additions & 31 deletions

File tree

src/main/java/de/uni_passau/fim/se2/litterbox/ast/parser/StringExprConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private static AttributeOf parseSensingOf(
194194
final String property = exprBlock.getFieldValueAsString(KnownFields.PROPERTY);
195195
final Attribute attribute = switch (property) {
196196
case "y position", "x position", "direction", "costume #", "costume name", "size", "volume",
197-
"backdrop name", "backdrop #" -> new AttributeFromFixed(new FixedAttribute(property));
197+
"backdrop name", "backdrop #" -> new AttributeFromFixed(new FixedAttribute(property));
198198
default -> new AttributeFromVariable(new Variable(new StrId(property)));
199199
};
200200

src/main/java/de/uni_passau/fim/se2/litterbox/refactor/metaheuristics/algorithms/SearchAlgorithm.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,11 @@
2626
public interface SearchAlgorithm<C> {
2727

2828
/**
29-
* <p>
3029
* Runs the search algorithm and returns a possible admissible solution of the encoded problem.
31-
* </p>
32-
* <p>
33-
* Note: every run must perform a new search and must be independent of the previous one. In
30+
*
31+
* <p>Note: every run must perform a new search and must be independent of the previous one. In
3432
* particular, it must be possible to call this method multiple times in a row. Implementors
3533
* must ensure multiple runs do not interfere each other.
36-
* </p>
3734
*
3835
* @return a solution
3936
*/

src/main/java/de/uni_passau/fim/se2/litterbox/refactor/metaheuristics/fitness_functions/FitnessFunction.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,14 @@ public interface FitnessFunction<C> extends ToDoubleFunction<C> {
3232
String DEFAULT_NAME = "fitness_function";
3333

3434
/**
35-
* <p>
3635
* Computes and returns the fitness value of the given solution {@code c}. Minimizing fitness
3736
* functions must return lower values for better solutions, whereas maximizing fitness
3837
* functions are expected to return higher values.
39-
* </p>
40-
* <p>
41-
* When two solutions {@code c1} and {@code c2} are equal it is generally recommended to
38+
*
39+
* <p>When two solutions {@code c1} and {@code c2} are equal it is generally recommended to
4240
* return the same fitness value for both of them. That is, {@code c1.equals(c2)} implies {@code
4341
* getFitness(c1) == getFitness(c2)}. While this is not an absolute requirement implementations
4442
* that do not conform to this should clearly indicate this fact.
45-
* </p>
4643
*
4744
* @param c the solution to rate
4845
* @return the fitness value of the given solutions
@@ -66,20 +63,19 @@ default String getName() {
6663
* Tells whether this function is a minimizing fitness function.
6764
*
6865
* @return {@code true} if this is a minimizing fitness function, {@code false} if this is a
69-
* maximizing fitness function
66+
* maximizing fitness function
7067
*/
7168
boolean isMinimizing();
7269

7370
/**
74-
* Returns the reference point of the fitness function for the hypervolume
71+
* Returns the reference point of the fitness function for the hypervolume.
7572
*
7673
* @return {@code 1} if this is a minimizing fitness function, {@code 0} if this is a
77-
* maximizing fitness function
74+
* maximizing fitness function
7875
*/
7976
double getReferencePoint();
8077

8178
/**
82-
* <p>
8379
* Returns a comparator that compares two solutions by their fitness, taking into account
8480
* whether this is a maximizing or a minimizing fitness function. In other words, given two
8581
* solutions {@code c1} and {@code c2} with fitness values {@code f1} and {@code f2},
@@ -88,9 +84,8 @@ default String getName() {
8884
* {@code f1} is worse than {@code f2}. If this is a minimizing fitness function, smaller
8985
* fitness values are considered better, and, on the contrary, if this is a maximizing fitness
9086
* function, larger fitness values are considered better.
91-
* </p>
92-
* <p>
93-
* Example usage:
87+
*
88+
* <p>Example usage:
9489
* <pre>{@code
9590
* FitnessFunction<C> ff = ...;
9691
* C c1 = ...; // first solution to compare
@@ -105,7 +100,6 @@ default String getName() {
105100
* // c1 and c2 are equally good
106101
* }
107102
* }</pre>
108-
* </p>
109103
*
110104
* @return a {@code Comparator<C>} that uses this fitness function as extractor for its sort key
111105
*/

src/main/java/de/uni_passau/fim/se2/litterbox/refactor/metaheuristics/search_operators/RefactorSequenceMutation.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,15 @@ public RefactorSequenceMutation(List<RefactoringFinder> refactoringFinders) {
3838
}
3939

4040
/**
41-
* <p>
4241
* Returns a mutated deep copy of the given refactoring sequence.
43-
* </p>
44-
* <p>
45-
* Each integer in the production list mutates with a probability of one divided by the lists size.
46-
* If a index inside the list mutates it executes one of the following mutations with equal probability:
42+
*
43+
* <p>Each integer in the production list mutates with a probability of one divided by the lists size.
44+
* If an index inside the list mutates it executes one of the following mutations with equal probability:
4745
* <ol>
4846
* <li>add a new production to the list at the index</li>
4947
* <li>replace the current production at the index</li>
5048
* <li>remove the current production at the index</li>
5149
* </ol>
52-
* </p>
5350
*
5451
* @param refactorSequence The original RefactorSequence, that mutates.
5552
* @return A mutated deep copy of the given RefactorSequence object.
@@ -69,7 +66,13 @@ public RefactorSequence apply(RefactorSequence refactorSequence) {
6966
index++;
7067
}
7168

72-
return new RefactorSequence(refactorSequence.getOriginalProgram(), refactorSequence.getMutation(), refactorSequence.getCrossover(), mutatedProductions, refactoringFinders);
69+
return new RefactorSequence(
70+
refactorSequence.getOriginalProgram(),
71+
refactorSequence.getMutation(),
72+
refactorSequence.getCrossover(),
73+
mutatedProductions,
74+
refactoringFinders
75+
);
7376
}
7477

7578
/**

src/main/java/de/uni_passau/fim/se2/litterbox/utils/SelfTyped.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,12 @@
3333
public interface SelfTyped<S extends SelfTyped<S>> {
3434

3535
/**
36-
* <p>
3736
* Returns the runtime type of the implementor (a.k.a. "self-type"). This method must only be
3837
* implemented in concrete, non-abstract subclasses by returning a reference to {@code this},
3938
* and nothing else. Returning a reference to any other runtime type other than {@code this}
4039
* breaks the contract.
41-
* </p>
42-
* <p>
43-
* In other words, every concrete subclass {@code Foo} that implements the interface {@code
40+
*
41+
* <p>In other words, every concrete subclass {@code Foo} that implements the interface {@code
4442
* SelfTyped} must implement this method as follows:
4543
* <pre>{@code
4644
* public final class Foo implements SelfTyped<Foo> {
@@ -50,7 +48,6 @@ public interface SelfTyped<S extends SelfTyped<S>> {
5048
* }
5149
* }
5250
* }</pre>
53-
* </p>
5451
*
5552
* @return a reference to the self-type
5653
*/

0 commit comments

Comments
 (0)