Skip to content

Commit

Permalink
Merge pull request #353 from Luro02/main
Browse files Browse the repository at this point in the history
Implement some things
  • Loading branch information
Luro02 authored Jan 7, 2024
2 parents a49a1e4 + 82ab367 commit ca391f4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public enum ProblemType {
REDUNDANT_MODIFIER_VISIBILITY_ENUM_CONSTRUCTOR,
REDUNDANT_VOID_RETURN,
REDUNDANT_SELF_ASSIGNMENT,
REDUNDANT_VARIABLE_BEFORE_RETURN,
REDUNDANT_VARIABLE,
REDUNDANT_BOOLEAN_EQUAL,
AVOID_RECOMPILING_REGEX,
UNUSED_IMPORT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import java.util.Map;

@ExecutableCheck(reportedProblems = {ProblemType.REDUNDANT_VARIABLE_BEFORE_RETURN})
public class RedundantVariableBeforeReturn extends IntegratedCheck {
@ExecutableCheck(reportedProblems = {ProblemType.REDUNDANT_VARIABLE})
public class RedundantVariable extends IntegratedCheck {
/**
* Checks if the given statement does not influence the variable returned by the return statement.
*
Expand Down Expand Up @@ -59,7 +59,7 @@ private void checkVariableRead(CtStatement ctStatement, CtVariableRead<?> ctVari
"suggestion", ctStatement.prettyprint().replace(ctLocalVariable.getSimpleName(), ctLocalVariable.getDefaultExpression().prettyprint())
)
),
ProblemType.REDUNDANT_VARIABLE_BEFORE_RETURN
ProblemType.REDUNDANT_VARIABLE
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

import static org.junit.jupiter.api.Assertions.assertEquals;

class TestRedundantVariableBeforeReturn extends AbstractCheckTest {
private static final List<ProblemType> PROBLEM_TYPES = List.of(ProblemType.REDUNDANT_VARIABLE_BEFORE_RETURN);
class TestRedundantVariable extends AbstractCheckTest {
private static final List<ProblemType> PROBLEM_TYPES = List.of(ProblemType.REDUNDANT_VARIABLE);

void assertEqualsRedundant(Problem problem, String name, String suggestion) {
assertEquals(
Expand Down
1 change: 1 addition & 0 deletions jreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ project:
release:
github:
overwrite: true
checksums: false
signatures: false
releaseName: '{{tagName}}'
changelog:
Expand Down
2 changes: 1 addition & 1 deletion sample_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- REDUNDANT_MODIFIER
- REDUNDANT_VOID_RETURN
- REDUNDANT_SELF_ASSIGNMENT
- REDUNDANT_VARIABLE_BEFORE_RETURN
- REDUNDANT_VARIABLE
- UNUSED_IMPORT
- PRIMITIVE_WRAPPER_INSTANTIATION
- ASSERT
Expand Down

0 comments on commit ca391f4

Please sign in to comment.