This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/causeway.git


The following commit(s) were added to refs/heads/main by this push:
     new ed3bd76ba0c CAUSEWAY-2297: simplifies the EmptyTabRemovalProcessor
ed3bd76ba0c is described below

commit ed3bd76ba0c5eeed1735f7e9f543657b887f548a
Author: Andi Huber <[email protected]>
AuthorDate: Thu Oct 23 15:08:34 2025 +0200

    CAUSEWAY-2297: simplifies the EmptyTabRemovalProcessor
---
 .../services/grid/bootstrap/EmptyTabRemovalProcessor.java  | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git 
a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/services/grid/bootstrap/EmptyTabRemovalProcessor.java
 
b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/services/grid/bootstrap/EmptyTabRemovalProcessor.java
index 45ae40cdd1e..6655fa7620b 100644
--- 
a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/services/grid/bootstrap/EmptyTabRemovalProcessor.java
+++ 
b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/services/grid/bootstrap/EmptyTabRemovalProcessor.java
@@ -28,16 +28,12 @@
 import org.apache.causeway.applib.layout.grid.bootstrap.BSGrid;
 import org.apache.causeway.applib.layout.grid.bootstrap.BSTab;
 
-import lombok.RequiredArgsConstructor;
-
 /**
  * Removes empty tabs from tab groups.
  */
 record EmptyTabRemovalProcessor(BSGrid bsGrid) {
 
-    @RequiredArgsConstructor
-    static final class Wrapper {
-        final BSTab tab;
+    static final class Flag {
         boolean keep = false;
     }
 
@@ -47,7 +43,7 @@ public void run() {
 
         bsGrid.visit(new BSGrid.VisitorAdapter() {
 
-            final Stack<Wrapper> stack = new Stack<Wrapper>();
+            final Stack<Flag> stack = new Stack<Flag>();
 
             @Override public void visit(ActionLayoutData actionLayoutData) { 
keep(); }
             @Override public void visit(DomainObjectLayoutData 
domainObjectLayoutData) { keep(); }
@@ -55,11 +51,11 @@ public void run() {
             @Override public void visit(CollectionLayoutData 
collectionLayoutData) { keep(); }
 
             @Override public void visit(BSTab bsTab) {
-                stack.push(new Wrapper(bsTab));
+                stack.push(new Flag());
             }
             @Override public void postVisit(BSTab bsTab) {
-                var wrapper = stack.pop();
-                if(!wrapper.keep) {
+                var flag = stack.pop();
+                if(!flag.keep) {
                     // collecting into list, so we don't risk a 
ConcurrentModificationException,
                     // when racing with the underlying iterator
                     emptyTabs.add(bsTab);

Reply via email to