From 95a7f3228b3c5625f731e5e5c4bbfb43d55dd8db Mon Sep 17 00:00:00 2001
From: dgelessus <dgelessus@users.noreply.github.com>
Date: Wed, 24 Jan 2024 16:15:58 +0100
Subject: [PATCH] Fix Java 21 warnings about possible this escape in
 constructor

---
 src/main/java/org/sablecc/sablecc/In_Production.java | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/sablecc/sablecc/In_Production.java b/src/main/java/org/sablecc/sablecc/In_Production.java
index 63b00d5..433161b 100644
--- a/src/main/java/org/sablecc/sablecc/In_Production.java
+++ b/src/main/java/org/sablecc/sablecc/In_Production.java
@@ -23,7 +23,7 @@ public class In_Production
 
   public In_Production(AProd prod)
   {
-    setName(prod.getId().getText());
+    this.name = prod.getId().getText();
 
     AElem[] prodTransforms = prod.getProdTransform().toArray(new AElem[0]);
     prodTransformElems = new String[prodTransforms.length];
@@ -57,11 +57,6 @@ public class In_Production
     nbAlts = alts.length;
   }
 
-  public void setName(String name)
-  {
-    this.name = name;
-  }
-
   public String getName()
   {
     return name;
@@ -72,7 +67,7 @@ public class In_Production
     return nbAlts;
   }
 
-  public void addAlternative(int position, In_Alternative alt)
+  private void addAlternative(int position, In_Alternative alt)
   {
     alternatives[position] = alt;
   }
-- 
GitLab