You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2022/03/10 13:17:33 UTC
[myfaces-tobago] branch tobago-5.x updated: fix: "for" attribute wasn't detected
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a commit to branch tobago-5.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
The following commit(s) were added to refs/heads/tobago-5.x by this push:
new 8153fb3 fix: "for" attribute wasn't detected
8153fb3 is described below
commit 8153fb3cab0294806bddfff8e65e4bed8632543b
Author: Udo Schnurpfeil <ud...@irian.eu>
AuthorDate: Thu Mar 10 14:15:06 2022 +0100
fix: "for" attribute wasn't detected
---
.../org/apache/myfaces/tobago/component/Attributes.java | 3 +++
.../myfaces/tobago/component/AttributesUnitTest.java | 14 ++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
index 790c744..1c43e24 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
@@ -455,6 +455,9 @@ public enum Attributes {
try {
return Attributes.valueOf(name);
} catch (final IllegalArgumentException e) {
+ if (name.equals("for")) {
+ return Attributes.forValue;
+ }
LOG.warn("Can't find enum for {} with name '{}'", Attributes.class.getName(), name);
return null;
}
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/component/AttributesUnitTest.java b/tobago-core/src/test/java/org/apache/myfaces/tobago/component/AttributesUnitTest.java
new file mode 100644
index 0000000..bce739f
--- /dev/null
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/component/AttributesUnitTest.java
@@ -0,0 +1,14 @@
+package org.apache.myfaces.tobago.component;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+class AttributesUnitTest {
+
+ @Test
+ void testValueOf() {
+ for (Attributes a : Attributes.values()) {
+ Assertions.assertEquals(a, Attributes.valueOfFailsafe(a.getName()));
+ }
+ }
+}