-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggest to use no more than 3 checks
- Loading branch information
1 parent
59dc03f
commit fd6f664
Showing
4 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/analyzer/exercises/leap/UseMinimumNumberOfChecks.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package analyzer.exercises.leap; | ||
|
||
import analyzer.Comment; | ||
import analyzer.CommentType; | ||
|
||
/** | ||
* @see <a href="https://github.com/exercism/website-copy/blob/main/analyzer-comments/java/leap/use_minimum_number_of_checks.md">Markdown Template</a> | ||
*/ | ||
class UseMinimumNumberOfChecks extends Comment { | ||
@Override | ||
public String getKey() { | ||
return "java.leap.use_minimum_number_of_checks"; | ||
} | ||
|
||
@Override | ||
public CommentType getType() { | ||
return CommentType.ACTIONABLE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/test/resources/analyzer/exercises/leap/TooManyChecks.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Leap { | ||
boolean isLeapYear(int year) { | ||
return year % 4 == 0 && year % 100 != 0 || year % 100 == 0 && year % 400 == 0; | ||
} | ||
} |