Skip to content

Commit 951a406

Browse files
authored
Adding analyzer feedback for booking-up-for-beauty concept exercise (#2753)
* Adding analyzer feedback for concept exercise * Updating comments to actionables instead of essentials * Adding other compliant method to the haspassed comment
1 parent 9dca37e commit 951a406

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

exercises/concept/booking-up-for-beauty/.meta/design.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,19 @@
2222

2323
- `strings`: know how to use string formatting.
2424
- `numbers`: know how to apply basic mathematical operators.
25+
26+
## Analyzer
27+
28+
This exercise could benefit from the following rules in the [analyzer]:
29+
30+
- `actionable`: If the student did not use `ofPattern` and `parse` methods in the `schedule` method, instruct the student to do so.
31+
- `actionable`: If the student did not use `isBefore` or `compareTo` methods in the `hasPassed` method, instruct the student to do so.
32+
- `actionable`: If the student did not use `getHour` in the `isAfternoonAppointment` method, instruct the student to do so.
33+
- `actionable`: If the student did not use `ofPattern` and `DateTimeFormatter.format` methods in the `getDescription` method, instruct the student to do so.
34+
- `actionable`: If the student did not use `getYear` in the `getAnniversaryDate` method, instruct the student to do so.
35+
- `informative`: If the solution uses `String.format` in the `getDescription` method, inform the student that this cause a small performance penalty compared to string concatenation.
36+
37+
If the solution does not receive any of the above feedback, it must be exemplar.
38+
Leave a `celebratory` comment to celebrate the success!
39+
40+
[analyzer]: https://github.com/exercism/java-analyzer

exercises/concept/booking-up-for-beauty/.meta/src/reference/java/AppointmentScheduler.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
class AppointmentScheduler {
88

9-
private static final LocalDate OPENING_DATE = LocalDate.of(2015, Month.SEPTEMBER, 15);
10-
119
public LocalDateTime schedule(String appointmentDateDescription) {
1210
var formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy HH:mm:ss", Locale.ENGLISH);
1311
return LocalDateTime.parse(appointmentDateDescription, formatter);
@@ -27,6 +25,6 @@ public String getDescription(LocalDateTime appointmentDate) {
2725
}
2826

2927
public LocalDate getAnniversaryDate() {
30-
return OPENING_DATE.withYear(LocalDate.now().getYear());
28+
return LocalDate.of(LocalDate.now().getYear(), Month.SEPTEMBER, 15);
3129
}
3230
}

0 commit comments

Comments
 (0)