feedback-to-code/mozzarella huggingface dataset:
Repository: iluwatar/java-design-patterns
Issue: Issue with all contributors badge in Readme.md file
Labels: info: help wanted
info: good first issue
epic: documentation

Observed that when we click on the `all contributors` badge on the project page , it does not re-direct us to the sections where all the project contributors are listed . 

![image](https://user-images.githubusercontent.com/30525467/117465715-df5fc100-af49-11eb-8a72-e0181a11478b.png)

**Possible fix will be to correct the URL for this badge inside the projects Readme.md file .**



Issue comments:
Thanks, @DEV-VRUPER for mentioning the problem.

There seems to be an error due to an additional hyphen at the end of the URL.

Please do let me know if you want to raise a PR for fixing this.
@ohbus   I have fixed it and raised the PR . Please could you review .

Thanks.

Pull request review comments:
```suggestion
[![All Contributors](https://img.shields.io/badge/all_contributors-165-orange.svg?style=flat-square)](#contributors)
```

Can you explain why did you decrease the value of the number of contributors?
There was merge conflicts earlier and so to make it consistent with master i reduced the number to 164 . But i guess #1749 has been merged to `master` now ,so i've incorporated the changes in my readme file. 
I can understand that.

_As a general rule of thumb, Whenever there is a conflict try to resolve it by rebasing with the branch you are trying to make a PR._

Patch that resolved the issue:
diff --git a/README.md b/README.md
index 971fe9073997..8c520b741499 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
 [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=coverage)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns)
 [![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)
 <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
-[![All Contributors](https://img.shields.io/badge/all_contributors-165-orange.svg?style=flat-square)](#contributors-)
+[![All Contributors](https://img.shields.io/badge/all_contributors-165-orange.svg?style=flat-square)](#contributors)
 <!-- ALL-CONTRIBUTORS-BADGE:END -->
 
 <br/>


Test patch:
Repository: iluwatar/java-design-patterns
Issue: Update Lombok version (possible migration issue for JDK17)
Labels: epic: build issue
epic: dependencies
type: feature

Lombok does not work in the current master branch when using JDK16.

`[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project abstract-factory: Fatal error compiling: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x4809c771) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0x4809c771 -> [Help 1]`

To fix it i used:

```
diff --git a/pom.xml b/pom.xml
index 31cf03b4d..d7f05d796 100644
--- a/pom.xml
+++ b/pom.xml
@@ -71,7 +71,7 @@
         <system-lambda.version>1.1.0</system-lambda.version>
         <urm.version>2.0.0</urm.version>
         <mockito-junit-jupiter.version>3.5.0</mockito-junit-jupiter.version>
-        <lombok.version>1.18.14</lombok.version>
+        <lombok.version>1.18.20</lombok.version>
         <byte-buddy.version>1.10.21</byte-buddy.version>
         <javassist.version>3.27.0-GA</javassist.version>
         <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
```


Issue comments:
Thanks @beooo79 for reporting. Although we currently claim to support only JDK11, I would like to see Lombok in the most recent version. If someone is willing to work on this, update Lombok to the latest version and test that the build and the tests still work.
> Thanks @beooo79 for reporting. Although we currently claim to support only JDK11, I would like to see Lombok in the most recent version. If someone is willing to work on this, update Lombok to the latest version and test that the build and the tests still work.

I tested Lombok version 1.18 with Eclipse version v4.20 (2021-06) creating problems for me with reflection API for Java.

Pull request review comments:

Patch that resolved the issue:
diff --git a/pom.xml b/pom.xml
index cb726a43e352..3e5e51abfbc5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -71,7 +71,7 @@
         <system-lambda.version>1.1.0</system-lambda.version>
         <urm.version>2.0.0</urm.version>
         <mockito-junit-jupiter.version>3.5.0</mockito-junit-jupiter.version>
-        <lombok.version>1.18.14</lombok.version>
+        <lombok.version>1.18.20</lombok.version>
         <byte-buddy.version>1.11.5</byte-buddy.version>
         <javassist.version>3.27.0-GA</javassist.version>
         <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>


Test patch:
Repository: iluwatar/java-design-patterns
Issue: Concurrency problems in leader-followers pattern
Labels: type: bug
epic: pattern

I have found a bug in the leader-followers pattern during unit test. In the state of concurrency, there is a small chance that no new leader will be promoted. The reason is that in the worker class, there is no double check before calling the wait method of workercenter. It causes the thread which should become leader mistakenly believe that the leader already exists and waits. 

Issue comments:
I have submitted a PR for fixing this bug, please review. @iluwatar  @ohbus 

Pull request review comments:

Patch that resolved the issue:
diff --git a/leader-followers/src/main/java/com/iluwatar/leaderfollowers/Worker.java b/leader-followers/src/main/java/com/iluwatar/leaderfollowers/Worker.java
index 6c7caed244b7..21326bb0a77c 100644
--- a/leader-followers/src/main/java/com/iluwatar/leaderfollowers/Worker.java
+++ b/leader-followers/src/main/java/com/iluwatar/leaderfollowers/Worker.java
@@ -57,9 +57,11 @@ public void run() {
       try {
         if (workCenter.getLeader() != null && !workCenter.getLeader().equals(this)) {
           synchronized (workCenter) {
-            workCenter.wait();
+            if (workCenter.getLeader() != null && !workCenter.getLeader().equals(this)) {
+              workCenter.wait();
+              continue;
+            }
           }
-          continue;
         }
         final Task task = taskSet.getTask();
         synchronized (workCenter) {


Test patch:
Repository: iluwatar/java-design-patterns
Issue: Casting Issue 
Labels: type: bug
info: good first issue
epic: code quality

![CB](https://user-images.githubusercontent.com/58337761/151684862-b05babb8-180e-472d-b6c0-923b0b16127a.png)


Issue comments:
@MaheshMadushan can you explain what this issue is about?
Hi @iluwatar , There is a small casting issue. 
![image](https://user-images.githubusercontent.com/58337761/153973583-cf198d38-4525-4a32-ae44-a45b5c6f4972.png)

Hi @MaheshMadushan @iluwatar .
I'm beginner in java and during learning the java literals , I encountered one nice point which address this issue . 
In java **integer literal** can always be assigned to a **long** variable . However , to specify a **long literal** you will need to explicitly tell the compiler that the literal value is of type **long** . We can do this by appending an **uppercase** or **lowercase** **L** to the literal .
Here in this case we have variable **futureTime** as type of **long** type but the literal assigned to it is of type **integer** . So here compiler first do the casting of **1000 * 1000 * 1000 * 1000** to an integer literal and then assigned it to **futureTime** .
Solution to this problem is to use the **long literal**.
For example :

- **1000L * 1000 * 1000 * 1000**
- **1000 * 1000L * 1000 * 1000**
- **1000 * 1000 * 1000L * 1000**
- **1000 * 1000 * 1000 * 1000L**
These are few valid long literal we can use ( we can also use variation like 1000000000000L ) .
I hope you got my point here . 

I want to fix this issue! Thanks a lot. @iluwatar 
Hi is this issue still up for taking, or is it closed? I would like to contribute
Fixed with https://github.com/iluwatar/java-design-patterns/pull/1994

Pull request review comments:

Patch that resolved the issue:
diff --git a/circuit-breaker/src/main/java/com/iluwatar/circuitbreaker/DefaultCircuitBreaker.java b/circuit-breaker/src/main/java/com/iluwatar/circuitbreaker/DefaultCircuitBreaker.java
index 2194d75cbd2a..8c59f394bee1 100644
--- a/circuit-breaker/src/main/java/com/iluwatar/circuitbreaker/DefaultCircuitBreaker.java
+++ b/circuit-breaker/src/main/java/com/iluwatar/circuitbreaker/DefaultCircuitBreaker.java
@@ -38,7 +38,7 @@ public class DefaultCircuitBreaker implements CircuitBreaker {
   int failureCount;
   private final int failureThreshold;
   private State state;
-  private final long futureTime = 1000 * 1000 * 1000 * 1000;
+  private final long futureTime = 1000L * 1000 * 1000 * 1000;
 
   /**
    * Constructor to create an instance of Circuit Breaker.


Test patch:
Repository: iluwatar/java-design-patterns
Issue: Upgrade Lombok version to support Java 17
Labels: info: good first issue
epic: build issue
epic: dependencies
type: feature

This issue is a part of the Java 17 transition plan at https://github.com/iluwatar/java-design-patterns/wiki/19.-Java-17-transition.

According to https://github.com/projectlombok/lombok/issues/2898, Lombok supports Java 17 since version 1.18.22. Our version is a bit behind that, so let's upgrade to the latest.

Acceptance criteria

- Lombok version has been updated to the latest available


Issue comments:
@iluwatar : I will update those hotfixes for java 17. Will create separate branch and create pr for the same.
Ok @karshil2309 

Pull request review comments:

Patch that resolved the issue:
diff --git a/pom.xml b/pom.xml
index a9477de828d8..3e02bfd45eb2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,7 @@
     <system-lambda.version>1.1.0</system-lambda.version>
     <urm.version>2.0.0</urm.version>
     <mockito-junit-jupiter.version>3.5.0</mockito-junit-jupiter.version>
-    <lombok.version>1.18.20</lombok.version>
+    <lombok.version>1.18.22</lombok.version>
     <byte-buddy.version>1.11.5</byte-buddy.version>
     <javassist.version>3.27.0-GA</javassist.version>
     <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>


Test patch:
Repository: iluwatar/java-design-patterns
Issue: Sonar analysis failing due to obsolete Node version
Labels: type: bug
epic: build issue
epic: code quality

This came up in a recent pull request build:

> [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar (default-cli) on project java-design-patterns:
> [ERROR]
> [ERROR] The version of node.js (12) you have used to run this analysis is deprecated and we stopped accepting it.
> [ERROR] Please update to at least node.js 14. You can find more information here: https://docs.sonarcloud.io/appendices/scanner-environment/

Acceptance criteria

- Node version used in the CI build has been upgraded to fix the Sonar analysis


Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 3e35aee712dd..dad7997a8699 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -26,12 +26,14 @@ version: 2
 jobs:
   sonar-pr:
     docker:
-      - image: circleci/openjdk:11-node
+      - image: cimg/openjdk:11.0-node
     steps:
     - checkout
     - restore_cache:
         key: jdp-sonar-pr-{{ checksum "pom.xml" }}
     - run: |
+        sudo apt-get update
+        sudo apt-get install -y openjdk-11-jdk xvfb
         if [ -n "${CIRCLE_PR_NUMBER}" ]; then
           MAVEN_OPTS="-Xmx3000m" xvfb-run ./mvnw -B clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
              -Dsonar.pullrequest.key=${CIRCLE_PR_NUMBER} \


Test patch:
Repository: iluwatar/java-design-patterns
Issue: Add lombok to step-builder pattern
Labels: type: enhancement
info: good first issue
epic: code quality

This pattern doesn't have lombok added to it, we should add to have cleaner code.

Issue comments:
PR created, waiting for review.

Pull request review comments:

Patch that resolved the issue:
diff --git a/step-builder/src/main/java/com/iluwatar/stepbuilder/Character.java b/step-builder/src/main/java/com/iluwatar/stepbuilder/Character.java
index 6f04fc09d6eb..05ba3e733c48 100644
--- a/step-builder/src/main/java/com/iluwatar/stepbuilder/Character.java
+++ b/step-builder/src/main/java/com/iluwatar/stepbuilder/Character.java
@@ -26,9 +26,16 @@
 
 import java.util.List;
 
+import lombok.Getter;
+import lombok.Setter;
+
+
+
 /**
  * The class with many parameters.
  */
+@Getter
+@Setter
 public class Character {
 
   private String name;
@@ -42,53 +49,6 @@ public Character(String name) {
     this.name = name;
   }
 
-  public String getName() {
-    return name;
-  }
-
-  public void setName(String name) {
-    this.name = name;
-  }
-
-  public String getFighterClass() {
-    return fighterClass;
-  }
-
-  public void setFighterClass(String fighterClass) {
-    this.fighterClass = fighterClass;
-  }
-
-  public String getWizardClass() {
-    return wizardClass;
-  }
-
-  public void setWizardClass(String wizardClass) {
-    this.wizardClass = wizardClass;
-  }
-
-  public String getWeapon() {
-    return weapon;
-  }
-
-  public void setWeapon(String weapon) {
-    this.weapon = weapon;
-  }
-
-  public String getSpell() {
-    return spell;
-  }
-
-  public void setSpell(String spell) {
-    this.spell = spell;
-  }
-
-  public List<String> getAbilities() {
-    return abilities;
-  }
-
-  public void setAbilities(List<String> abilities) {
-    this.abilities = abilities;
-  }
 
   @Override
   public String toString() {


Test patch:
Repository: iluwatar/java-design-patterns
Issue: Integrate stale bot
Labels: type: task

There is a handy [stale bot](https://github.com/probot/stale) that can monitor issues and pull requests and mark them as stale when nothing happens for a period of time. Let's integrate it in this issue.

Acceptance criteria

- Stale bot has been integrated into the repository


Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/.github/stale.yml b/.github/stale.yml
new file mode 100644
index 000000000000..f756aa30a3d0
--- /dev/null
+++ b/.github/stale.yml
@@ -0,0 +1,59 @@
+# Configuration for probot-stale - https://github.com/probot/stale
+
+# Number of days of inactivity before an Issue or Pull Request becomes stale
+daysUntilStale: 30
+
+# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
+# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
+daysUntilClose: false
+
+# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
+onlyLabels: []
+
+# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
+exemptLabels:
+  - "info: help wanted"
+
+# Set to true to ignore issues in a project (defaults to false)
+exemptProjects: false
+
+# Set to true to ignore issues in a milestone (defaults to false)
+exemptMilestones: false
+
+# Set to true to ignore issues with an assignee (defaults to false)
+exemptAssignees: false
+
+# Label to use when marking as stale
+staleLabel: "status: stale"
+
+# Comment to post when marking as stale. Set to `false` to disable
+markComment: >
+  This issue has been automatically marked as stale because it has not had
+  recent activity. It will be closed if no further activity occurs. Thank you
+  for your contributions.
+
+# Comment to post when removing the stale label.
+# unmarkComment: >
+#   Your comment here.
+
+# Comment to post when closing a stale Issue or Pull Request.
+# closeComment: >
+#   Your comment here.
+
+# Limit the number of actions per hour, from 1-30. Default is 30
+limitPerRun: 30
+
+# Limit to only `issues` or `pulls`
+# only: issues
+
+# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
+# pulls:
+#   daysUntilStale: 30
+#   markComment: >
+#     This pull request has been automatically marked as stale because it has not had
+#     recent activity. It will be closed if no further activity occurs. Thank you
+#     for your contributions.
+
+# issues:
+#   exemptLabels:
+#     - confirmed
\ No newline at end of file


Test patch:
Repository: iluwatar/java-design-patterns
Issue: Fix pattern categories
Labels: type: bug
info: help wanted
epic: pattern

Some patterns have a small defect in the yaml frontmatter (README.md). Categories key should be renamed to category so that everything shows up correctly on the website.

Acceptance criteria

- The pattern yaml frontmatters have been checked to conform with https://github.com/iluwatar/java-design-patterns/wiki/01.-How-to-contribute


Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/identity-map/README.md b/identity-map/README.md
index a5bb4d38695a..6594f54eda9e 100644
--- a/identity-map/README.md
+++ b/identity-map/README.md
@@ -1,6 +1,6 @@
 ---
 title: Identity Map
-categories: Behavioral
+category: Behavioral
 language: en
 tags:
 - Performance
diff --git a/intercepting-filter/README.md b/intercepting-filter/README.md
index f5aef5d03032..aef71f4f5a76 100644
--- a/intercepting-filter/README.md
+++ b/intercepting-filter/README.md
@@ -1,6 +1,6 @@
 ---
 title: Intercepting Filter
-categories: Behavioral
+category: Behavioral
 language: en
 tags:
  - Decoupling
diff --git a/interpreter/README.md b/interpreter/README.md
index 61bf7501abbc..99d3c30e50ed 100644
--- a/interpreter/README.md
+++ b/interpreter/README.md
@@ -1,6 +1,6 @@
 ---
 title: Interpreter
-categories: Behavioral
+category: Behavioral
 language: en
 tags:
  - Gang of Four
diff --git a/iterator/README.md b/iterator/README.md
index 3f36d0070167..b49151eab125 100644
--- a/iterator/README.md
+++ b/iterator/README.md
@@ -1,6 +1,6 @@
 ---
 title: Iterator
-categories: Behavioral
+category: Behavioral
 language: en
 tags:
  - Gang of Four


Test patch:
Repository: iluwatar/java-design-patterns
Issue: Upgrade dependencies to support Java 17
Labels: info: good first issue
epic: build issue
epic: dependencies
type: feature

This issue is a part of the transition plan at https://github.com/iluwatar/java-design-patterns/wiki/19.-Java-17-transition. Here we upgrade the dependencies so that they support Java 17.

Acceptance criteria

- Project dependencies have been upgraded so that each of them supports Java 17


Issue comments:
Hi I am interested in your project 
Please Hire me
I would like to work on this issue . Please assign it to me

I can work on this issue. Assign it to me
To be fair, @akhilpamwani expressed interest first
Hey, its been 9 days since... do we have any upgrade ? . If not then I would like to work on this one. 
Hello Sir,
I would like to contribute to this project,
I am new to hacktoctoberfest and this would be a great beginning.
Thank you...
@iluwatar could you assign it to me?
Assigned to you @robertvolkmann 

Pull request review comments:

Patch that resolved the issue:
diff --git a/pom.xml b/pom.xml
index ee3465ca3cfe..74e54db37856 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,7 +41,8 @@
     <jacoco.version>0.8.8</jacoco.version>
     <commons-dbcp.version>1.4</commons-dbcp.version>
     <htmlunit.version>2.66.0</htmlunit.version>
-    <guice.version>4.0</guice.version>
+    <gson.version>2.10</gson.version>
+    <guice.version>5.1.0</guice.version>
     <system-lambda.version>1.1.0</system-lambda.version>
     <urm.version>2.0.0</urm.version>
     <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
@@ -230,7 +231,7 @@
       <dependency>
         <groupId>com.google.code.gson</groupId>
         <artifactId>gson</artifactId>
-        <version>2.10</version>
+        <version>${gson.version}</version>
       </dependency>
       <dependency>
         <groupId>com.google.inject</groupId>
@@ -414,4 +415,4 @@
       </plugin>
     </plugins>
   </build>
-</project>
\ No newline at end of file
+</project>


Test patch:
Repository: iluwatar/java-design-patterns
Issue: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties
Labels: type: bug
epic: build issue

When you try to build the project using `./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonarit` gives the following error:

### Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar (default-cli) on project java-design-patterns: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator

Both in local and when you try to do the pull request. 

If the project is no longer in the sonarcloud, it can be a suggestion to remove the following dependencies:

```
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>iluwatar</sonar.organization>
<sonar.projectKey>iluwatar_java-design-patterns</sonar.projectKey>
<sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
<sonar.projectName>Java Design Patterns</sonar.projectName>
```

and to build using: `./mvnw clean verify`

In order to continue to build the project and do pull request without building errors.

Issue comments:
Kind of works, see https://github.com/iluwatar/java-design-patterns/pull/2398, but maybe we can improve it

Pull request review comments:

Patch that resolved the issue:
diff --git a/.github/workflows/maven-pr-builder.yml b/.github/workflows/maven-pr-builder.yml
index 51ffbbcb9089..f2699a9c9c93 100644
--- a/.github/workflows/maven-pr-builder.yml
+++ b/.github/workflows/maven-pr-builder.yml
@@ -28,6 +28,7 @@ name: Java PR Builder
 
 on:
   pull_request:
+  pull_request_target:
     branches: [ master ]
     types: [ opened, reopened, synchronize ]
 


Test patch:
Repository: iluwatar/java-design-patterns
Issue: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties
Labels: type: bug
epic: build issue

When you try to build the project using `./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonarit` gives the following error:

### Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar (default-cli) on project java-design-patterns: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator

Both in local and when you try to do the pull request. 

If the project is no longer in the sonarcloud, it can be a suggestion to remove the following dependencies:

```
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>iluwatar</sonar.organization>
<sonar.projectKey>iluwatar_java-design-patterns</sonar.projectKey>
<sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
<sonar.projectName>Java Design Patterns</sonar.projectName>
```

and to build using: `./mvnw clean verify`

In order to continue to build the project and do pull request without building errors.

Issue comments:
Kind of works, see https://github.com/iluwatar/java-design-patterns/pull/2398, but maybe we can improve it

Pull request review comments:

Patch that resolved the issue:
diff --git a/.github/workflows/maven-pr-builder.yml b/.github/workflows/maven-pr-builder.yml
index f2699a9c9c93..fb1fdbe84f7d 100644
--- a/.github/workflows/maven-pr-builder.yml
+++ b/.github/workflows/maven-pr-builder.yml
@@ -27,7 +27,6 @@
 name: Java PR Builder
 
 on:
-  pull_request:
   pull_request_target:
     branches: [ master ]
     types: [ opened, reopened, synchronize ]


Test patch: