This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 246440 - IllegalArgumentException: Negative pageSize
Summary: IllegalArgumentException: Negative pageSize
Status: RESOLVED WONTFIX
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords: PATCH_AVAILABLE
Depends on:
Blocks:
 
Reported: 2014-08-13 13:56 UTC by miibx5
Modified: 2015-01-08 14:23 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 211218


Attachments
stacktrace (3.21 KB, text/plain)
2014-08-13 13:56 UTC, miibx5
Details

Note You need to log in before you can comment on or make changes to this bug.
Description miibx5 2014-08-13 13:56:05 UTC
Build: NetBeans IDE 8.0 (Build 201403101706)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.11-b03, Java(TM) SE Runtime Environment, 1.8.0_11-b12
OS: Windows 7

User Comments:
miibx5: running query in oracle database




Stacktrace: 
java.lang.IllegalArgumentException: Negative pageSize
   at org.netbeans.modules.db.dataview.api.DataViewPageContext.setStoredPageSize(DataViewPageContext.java:102)
   at org.netbeans.modules.db.dataview.output.DataViewActionHandler.updateActionPerformed(DataViewActionHandler.java:111)
   at org.netbeans.modules.db.dataview.output.DataViewUI$3.actionPerformed(DataViewUI.java:351)
   at javax.swing.JTextField.fireActionPerformed(JTextField.java:508)
   at javax.swing.JTextField.postActionEvent(JTextField.java:721)
   at javax.swing.JTextField$NotifyAction.actionPerformed(JTextField.java:836)
Comment 1 miibx5 2014-08-13 13:56:07 UTC
Created attachment 148685 [details]
stacktrace
Comment 2 matthias42 2014-08-13 14:20:13 UTC
Could it be, that you specified 0 as page size? Looks like that is the non checked corner-case.
Comment 3 matthias42 2014-08-24 16:35:00 UTC
Ok - no reply - so just in case my prediction is correct:

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -255,9 +255,9 @@
         int totalCount = pageContext.getTotalRows();
         try {
             int count = Integer.parseInt(refreshField.getText().trim());
-            return count < 0 ? pageSize : count;
+            return count > 0 ? count : pageSize;
         } catch (NumberFormatException ex) {
-            return totalCount < pageSize ? totalCount : pageSize;
+            return (totalCount < pageSize &&  totalCount > 0) ? totalCount : pageSize;
         }
     }
Comment 4 matthias42 2015-01-08 14:23:07 UTC
This was superseeded when #156492 was merged to allows 0 to mean infinite