You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2023/03/30 18:28:17 UTC

[myfaces-tobago] branch tobago-5.x updated: fix(StyleTag): Wrong java.lang.Number declaration in StyleTagDeclaration in flexGrow and flexShrink attribute should be float issue: TOBAGO-2209

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

bommel 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 e9f8d0012d fix(StyleTag): Wrong java.lang.Number declaration in StyleTagDeclaration in flexGrow and flexShrink attribute should be float issue: TOBAGO-2209
e9f8d0012d is described below

commit e9f8d0012d5757a4587a2319614719fda20e5426
Author: Bernd Bohmann <bo...@apache.org>
AuthorDate: Thu Mar 30 16:13:48 2023 +0200

    fix(StyleTag): Wrong java.lang.Number declaration in StyleTagDeclaration in flexGrow and flexShrink attribute should be float
    issue: TOBAGO-2209
---
 .../myfaces/tobago/internal/component/AbstractUIFlexLayout.java   | 2 +-
 .../apache/myfaces/tobago/internal/component/AbstractUIStyle.java | 8 ++++----
 .../tobago/internal/taglib/component/StyleTagDeclaration.java     | 4 ++--
 .../main/resources/org/apache/myfaces/tobago/apt/component.stg    | 4 ++++
 4 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFlexLayout.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFlexLayout.java
index d8469c997f..6275483d66 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFlexLayout.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFlexLayout.java
@@ -79,7 +79,7 @@ public abstract class AbstractUIFlexLayout extends AbstractUILayoutBase {
               if (unit == Measure.Unit.FR) {
                 final float factor = token.getValue();
                 style.setFlexGrow(factor);
-                style.setFlexShrink(0);
+                style.setFlexShrink(0f);
                 style.setFlexBasis(Measure.ZERO);
 //                style.setFlexBasis(Measure.AUTO); // is unbalanced when mixing e.g. <p> with <textarea>
               } else {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIStyle.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIStyle.java
index 7368a22027..9078410ccf 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIStyle.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIStyle.java
@@ -166,13 +166,13 @@ public abstract class AbstractUIStyle extends UIComponentBase {
 
   public abstract void setBackgroundImage(String backgroundImage);
 
-  public abstract Number getFlexGrow();
+  public abstract Float getFlexGrow();
 
-  public abstract void setFlexGrow(Number flexGrow);
+  public abstract void setFlexGrow(Float flexGrow);
 
-  public abstract Number getFlexShrink();
+  public abstract Float getFlexShrink();
 
-  public abstract void setFlexShrink(Number flexShrink);
+  public abstract void setFlexShrink(Float flexShrink);
 
   public abstract Measure getFlexBasis();
 
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java
index 4256761b3f..b674a22afe 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java
@@ -289,7 +289,7 @@ public interface StyleTagDeclaration extends HasIdBindingAndRendered {
    * @since 4.0.0
    */
   @TagAttribute
-  @UIComponentTagAttribute(type = "java.lang.Number")
+  @UIComponentTagAttribute(type = "java.lang.Float")
   void setFlexGrow(String flexGrow);
 
   /**
@@ -298,7 +298,7 @@ public interface StyleTagDeclaration extends HasIdBindingAndRendered {
    * @since 4.0.0
    */
   @TagAttribute
-  @UIComponentTagAttribute(type = "java.lang.Number")
+  @UIComponentTagAttribute(type = "java.lang.Float")
   void setFlexShrink(String flexShrink);
 
   /**
diff --git a/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg b/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg
index d3484898c5..81ef7c40c3 100644
--- a/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg
+++ b/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg
@@ -443,6 +443,10 @@ NumberProperty(property) ::= <<
 <NormalProperty(property)>
 >>
 
+FloatProperty(property) ::= <<
+<NormalProperty(property)>
+>>
+
 MethodExpressionProperty(property) ::= <<
 
 public <property.type> get<property.upperCamelCaseName>Expression() {