Skip to content

Commit 1490845

Browse files
Merge remote-tracking branch 'origin/master'
2 parents 9c95701 + d3abaab commit 1490845

File tree

12 files changed

+43
-23
lines changed

12 files changed

+43
-23
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3285,6 +3285,15 @@
32853285
"contributions": [
32863286
"doc"
32873287
]
3288+
},
3289+
{
3290+
"login": "SalmaAzeem",
3291+
"name": "Salma",
3292+
"avatar_url": "https://avatars.githubusercontent.com/u/121863224?v=4",
3293+
"profile": "https://github.com/SalmaAzeem",
3294+
"contributions": [
3295+
"code"
3296+
]
32883297
}
32893298
],
32903299
"contributorsPerLine": 6,

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=coverage)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns)
77
[![Join the chat at https://gitter.im/iluwatar/java-design-patterns](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iluwatar/java-design-patterns?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
88
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
9-
[![All Contributors](https://img.shields.io/badge/all_contributors-360-orange.svg?style=flat-square)](#contributors-)
9+
[![All Contributors](https://img.shields.io/badge/all_contributors-361-orange.svg?style=flat-square)](#contributors-)
1010
<!-- ALL-CONTRIBUTORS-BADGE:END -->
1111

1212
<br/>
@@ -540,6 +540,9 @@ This project is licensed under the terms of the MIT license.
540540
<td align="center" valign="top" width="16.66%"><a href="https://github.com/proceane"><img src="https://avatars.githubusercontent.com/u/62143949?v=4?s=100" width="100px;" alt="Juyeon"/><br /><sub><b>Juyeon</b></sub></a><br /><a href="#translation-proceane" title="Translation">🌍</a></td>
541541
<td align="center" valign="top" width="16.66%"><a href="https://mammadyahya.vercel.app"><img src="https://avatars.githubusercontent.com/u/66476643?v=4?s=100" width="100px;" alt="Mammad Yahyayev"/><br /><sub><b>Mammad Yahyayev</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=mammadyahyayev" title="Documentation">📖</a></td>
542542
</tr>
543+
<tr>
544+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/SalmaAzeem"><img src="https://avatars.githubusercontent.com/u/121863224?v=4?s=100" width="100px;" alt="Salma"/><br /><sub><b>Salma</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=SalmaAzeem" title="Code">💻</a></td>
545+
</tr>
543546
</tbody>
544547
</table>
545548

event-aggregator/src/main/java/com/iluwatar/event/aggregator/KingsHand.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,7 @@ public void onEvent(Event e) {
4343

4444
@Override
4545
public void timePasses(Weekday day) {
46+
// This method is intentionally left empty because KingsHand does not handle time-based events directly.
47+
// It serves as a placeholder to fulfill the EventObserver interface contract.
4648
}
4749
}

filterer/src/main/java/com/iluwatar/filterer/threat/ThreatAwareSystem.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
/**
3131
* Represents system that is aware of threats that are present in it.
3232
*/
33-
public interface ThreatAwareSystem {
33+
public interface ThreatAwareSystem<T extends Threat> {
3434

3535
/**
3636
* Returns the system id.
@@ -43,13 +43,13 @@ public interface ThreatAwareSystem {
4343
* Returns list of threats for this system.
4444
* @return list of threats for this system.
4545
*/
46-
List<? extends Threat> threats();
46+
List<T> threats();
4747

4848
/**
4949
* Returns the instance of {@link Filterer} helper interface that allows to covariantly
5050
* specify lower bound for predicate that we want to filter by.
5151
* @return an instance of {@link Filterer} helper interface.
5252
*/
53-
Filterer<? extends ThreatAwareSystem, ? extends Threat> filtered();
53+
Filterer<ThreatAwareSystem<T>, T> filtered();
5454

5555
}

game-loop/src/test/java/com/iluwatar/gameloop/GameLoopTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@
2424
*/
2525
package com.iluwatar.gameloop;
2626

27-
import static org.junit.jupiter.api.Assertions.assertFalse;
28-
2927
import org.junit.jupiter.api.AfterEach;
3028
import org.junit.jupiter.api.Assertions;
29+
import static org.junit.jupiter.api.Assertions.assertFalse;
3130
import org.junit.jupiter.api.BeforeEach;
3231
import org.junit.jupiter.api.Test;
3332

@@ -46,6 +45,7 @@ void setup() {
4645
gameLoop = new GameLoop() {
4746
@Override
4847
protected void processGameLoop() {
48+
throw new UnsupportedOperationException("Not supported yet.");
4949
}
5050
};
5151
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<spring-boot.version>2.7.5</spring-boot.version>
4141
<jacoco.version>0.8.12</jacoco.version>
4242
<commons-dbcp.version>1.4</commons-dbcp.version>
43-
<htmlunit.version>4.5.0</htmlunit.version>
43+
<htmlunit.version>4.7.0</htmlunit.version>
4444
<gson.version>2.11.0</gson.version>
4545
<guice.version>6.0.0</guice.version>
4646
<system-lambda.version>1.1.0</system-lambda.version>

serialized-lob/src/main/java/com/iluwatar/slob/dbservice/DatabaseService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void startupService()
9292
throws SQLException {
9393
try (var connection = dataSource.getConnection();
9494
var statement = connection.createStatement()) {
95-
if (dataTypeDb.equals("BINARY")) {
95+
if (dataTypeDb.equals(BINARY_DATA)) {
9696
statement.execute(CREATE_BINARY_SCHEMA_DDL);
9797
} else {
9898
statement.execute(CREATE_TEXT_SCHEMA_DDL);

serialized-lob/src/main/java/com/iluwatar/slob/lob/Forest.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,17 @@
3737
import org.w3c.dom.Document;
3838
import org.w3c.dom.Element;
3939
import org.w3c.dom.NodeList;
40-
4140
/**
4241
* Creates an object Forest which contains animals and plants as its constituents. Animals may eat
4342
* plants or other animals in the forest.
4443
*/
44+
45+
4546
@Data
4647
@NoArgsConstructor
4748
@AllArgsConstructor
4849
public class Forest implements Serializable {
49-
50+
public static final String HORIZONTAL_DIVIDER = "\n--------------------------\n";
5051
private String name;
5152
private Set<Animal> animals = new HashSet<>();
5253
private Set<Plant> plants = new HashSet<>();
@@ -105,16 +106,16 @@ public String toString() {
105106
sb.append("Forest Name = ").append(name).append("\n");
106107
sb.append("Animals found in the ").append(name).append(" Forest: \n");
107108
for (Animal animal : animals) {
108-
sb.append("\n--------------------------\n");
109+
sb.append(HORIZONTAL_DIVIDER);
109110
sb.append(animal.toString());
110-
sb.append("\n--------------------------\n");
111+
sb.append(HORIZONTAL_DIVIDER);
111112
}
112113
sb.append("\n");
113114
sb.append("Plants in the ").append(name).append(" Forest: \n");
114115
for (Plant plant : plants) {
115-
sb.append("\n--------------------------\n");
116+
sb.append(HORIZONTAL_DIVIDER);
116117
sb.append(plant.toString());
117-
sb.append("\n--------------------------\n");
118+
sb.append(HORIZONTAL_DIVIDER);
118119
}
119120
return sb.toString();
120121
}

0 commit comments

Comments
 (0)