Skip to content

Commit

Permalink
reduce number of annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Luro02 committed Apr 4, 2024
1 parent 66df616 commit 91e81d5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import de.firemage.autograder.core.pmd.PMDCheck;
import net.sourceforge.pmd.lang.java.rule.codestyle.UseDiamondOperatorRule;

import java.util.Optional;

@ExecutableCheck(reportedProblems = {ProblemType.UNUSED_DIAMOND_OPERATOR})
public class DiamondOperatorCheck extends PMDCheck {
public DiamondOperatorCheck() {
Expand All @@ -15,4 +17,9 @@ public DiamondOperatorCheck() {
ProblemType.UNUSED_DIAMOND_OPERATOR
);
}

@Override
public Optional<Integer> maximumProblems() {
return Optional.of(3);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ public void process(CtField<?> ctField) {

@Override
public Optional<Integer> maximumProblems() {
return Optional.of(6);
return Optional.of(4);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import spoon.reflect.code.CtLiteral;
import spoon.reflect.code.CtTextBlock;

import java.util.Optional;

@ExecutableCheck(reportedProblems = { ProblemType.SYSTEM_SPECIFIC_LINE_BREAK })
public class SystemSpecificLineBreak extends IntegratedCheck {
@Override
Expand Down Expand Up @@ -44,4 +46,9 @@ public void process(CtLiteral<?> literal) {
}
});
}

@Override
public Optional<Integer> maximumProblems() {
return Optional.of(3);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Stream;

@ExecutableCheck(reportedProblems = { ProblemType.CONCRETE_COLLECTION_AS_FIELD_OR_RETURN_VALUE })
Expand Down Expand Up @@ -277,4 +278,9 @@ public void visitCtRecord(CtRecord ctRecord) {
}
});
}

@Override
public Optional<Integer> maximumProblems() {
return Optional.of(5);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import spoon.reflect.declaration.CtMethod;
import spoon.reflect.declaration.CtTypeInformation;

import java.util.Optional;

@ExecutableCheck(reportedProblems = {ProblemType.LIST_NOT_COPIED_IN_GETTER})
public class ListGetterSetterCheck extends IntegratedCheck {
@Override
Expand Down Expand Up @@ -115,4 +117,9 @@ private boolean isMutableAssignee(CtExpression<?> expression) {
return expression instanceof CtConstructorCall<?>;
}
}

@Override
public Optional<Integer> maximumProblems() {
return Optional.of(4);
}
}

0 comments on commit 91e81d5

Please sign in to comment.