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 2019/01/09 17:37:27 UTC

[myfaces-tobago] 01/02: don't warn for empty sheets

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

lofwyr pushed a commit to branch tobago-4.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit dadfbb2cea48b87ebfe4bf4651e19a6a4d313463
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Tue Jan 8 09:45:14 2019 +0100

    don't warn for empty sheets
    
    (cherry picked from commit 6270313cfde905052d0b95e08c8b99fc802b8a86)
---
 .../myfaces/tobago/internal/component/AbstractUIData.java      | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIData.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIData.java
index 4d4d0bc..cd4e740 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIData.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIData.java
@@ -135,10 +135,12 @@ public abstract class AbstractUIData extends javax.faces.component.UIData implem
     }
 
     if (getFirst() >= getRowCount()) {
-      LOG.warn("Illegal paging state detected, first='{}' >= rowCount='{}'. Setting first to 0. "
-          + "This might happen because the data model has changed. "
-          + "You may want to manipulate the sheet state in your application after manipulating the model "
-          + "(e. g. filtering) to avoid this warning.", getFirst(), getRowCount());
+      if (getRowCount() > 0) {
+        LOG.warn("Illegal paging state detected, first='{}' >= rowCount='{}'. Setting first to 0. "
+            + "This might happen because the data model has changed. "
+            + "You may want to manipulate the sheet state in your application after manipulating the model "
+            + "(e. g. filtering) to avoid this warning.", getFirst(), getRowCount());
+      }
       setFirst(0);
     }