This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch v4
in repository https://gitbox.apache.org/repos/asf/causeway.git
The following commit(s) were added to refs/heads/v4 by this push:
new ef812efd004 CAUSEWAY-3889: fixes empty icon suffix case not handled
(regression)
ef812efd004 is described below
commit ef812efd0040263dacc1468584fcccaa5ec00645
Author: Andi Huber <[email protected]>
AuthorDate: Thu Sep 18 08:55:28 2025 +0200
CAUSEWAY-3889: fixes empty icon suffix case not handled (regression)
---
.../main/java/org/apache/causeway/applib/annotation/ObjectSupport.java | 3 +++
.../causeway/core/runtimeservices/icons/ObjectIconServiceDefault.java | 2 ++
2 files changed, 5 insertions(+)
diff --git
a/api/applib/src/main/java/org/apache/causeway/applib/annotation/ObjectSupport.java
b/api/applib/src/main/java/org/apache/causeway/applib/annotation/ObjectSupport.java
index 1e9dca58b9e..12099207260 100644
---
a/api/applib/src/main/java/org/apache/causeway/applib/annotation/ObjectSupport.java
+++
b/api/applib/src/main/java/org/apache/causeway/applib/annotation/ObjectSupport.java
@@ -67,6 +67,9 @@ public sealed interface IconResource
public record ClassPathIconResource(
String suffix) implements IconResource {
+ public static ClassPathIconResource emptySuffix() {
+ return new ClassPathIconResource("");
+ }
}
public record FontAwesomeIconResource(
diff --git
a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/icons/ObjectIconServiceDefault.java
b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/icons/ObjectIconServiceDefault.java
index e4e91c5f1c9..1e28f8b5fbd 100644
---
a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/icons/ObjectIconServiceDefault.java
+++
b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/icons/ObjectIconServiceDefault.java
@@ -101,6 +101,8 @@ public ObjectIcon getObjectIcon(ManagedObject
managedObject, IconWhere iconWhere
return suffixed(spec, suffixed);
throw _Exceptions.unmatchedCase(iconResource);
})
+ // also handle the empty suffix case
+ .or(()->Optional.ofNullable(suffixed(spec,
ClassPathIconResource.emptySuffix())))
.orElseGet(this::fallbackIcon);
}