Bug 691544

Summary: Entering very large numbers in Dynagroups Recalculate Interval field causes stack trace
Product: [Other] RHQ Project Reporter: Corey Welton <cwelton>
Component: Core UIAssignee: Mike Thompson <mithomps>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: low Docs Contact:
Priority: low    
Version: 4.0.0.B02CC: hrupp, mazz, mithomps
Target Milestone: ---   
Target Release: RHQ 4.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.3.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-01 06:18:51 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 691508, 735475    

Description Corey Welton 2011-03-28 15:38:25 EDT
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.  Navigate to an existing DG or create a new one
2.  Enter the string "999999999999999999999999999" into the Recalculation Interval field.
3.  View results
  
Actual results:
Failure in datasource while processing UPDATE request.

java.lang.NumberFormatException:For input string: "1e+27"
--- STACK TRACE FOLLOWS ---
For input string: "1e+27"
    at Unknown.java_lang_NumberFormatException_$NumberFormatException__Ljava_lang_NumberFormatException_2Ljava_lang_String_2Ljava_lang_NumberFormatException_2(Unknown source:0)
    at Unknown.java_lang_Long_parseLong__Ljava_lang_String_2IJ(Unknown source:0)
    at Unknown.org_rhq_enterprise_gui_coregui_client_inventory_groups_definitions_GroupDefinitionDataSource_$copyValues__Lorg_rhq_enterprise_gui_coregui_client_inventory_groups_definitions_GroupDefinitionDataSource_2Lcom_smartgwt_client_data_Record_2Lorg_rhq_core_domain_resource_group_GroupDefinition_2(Unknown source:0)
    at Unknown.org_rhq_enterprise_gui_coregui_client_inventory_groups_definitions_GroupDefinitionDataSource_executeUpdate__Lcom_smartgwt_client_data_Record_2Lcom_smartgwt_client_data_Record_2Lcom_smartgwt_client_data_DSRequest_2Lcom_smartgwt_client_data_DSResponse_2V(Unknown source:0)
    at Unknown.org_rhq_enterprise_gui_coregui_client_util_RPCDataSource_transformRequest__Lcom_smartgwt_client_data_DSRequest_2Ljava_lang_Object_2(Unknown source:0)
    at Unknown.anonymous(Unknown source:0)
    at Unknown.com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown source:0)
    at Unknown.anonymous(Unknown source:0)
    at Unknown.isc_DataSource_getServiceInputs(Unknown source:0)
    at Unknown.isc_DataSource_sendDSRequest(Unknown source:0)
    at Unknown.isc_DataSource_performDSOperation(Unknown source:0)
    at Unknown.anonymous(Unknown source:0)
    at Unknown.anonymous(Unknown source:0)
    at Unknown.com_smartgwt_client_widgets_form_DynamicForm_$saveData__Lcom_smartgwt_client_widgets_form_DynamicForm_2Lcom_smartgwt_client_data_DSCallback_2V(Unknown source:0)
    at Unknown.org_rhq_enterprise_gui_coregui_client_inventory_groups_definitions_SingleGroupDefinitionView_$saveForm__Lorg_rhq_enterprise_gui_coregui_client_inventory_groups_definitions_SingleGroupDefinitionView_2Lorg_rhq_enterprise_gui_coregui_client_util_selenium_LocatableDynamicForm_2Lorg_rhq_enterprise_gui_coregui_client_inventory_groups_definitions_SingleGroupDefinitionView$DynaGroupChildrenView_2ZV(Unknown source:0)
    at Unknown.org_rhq_enterprise_gui_coregui_client_inventory_groups_definitions_SingleGroupDefinitionView$1_onClick__Lcom_smartgwt_client_widgets_events_ClickEvent_2V(Unknown source:0)
    at Unknown.com_smartgwt_client_widgets_events_ClickEvent_dispatch__Lcom_google_gwt_event_shared_EventHandler_2V(Unknown source:0)
    at Unknown.com_google_gwt_event_shared_HandlerManager$HandlerRegistry_$fireEvent__Lcom_google_gwt_event_shared_HandlerManager$HandlerRegistry_2Lcom_google_gwt_event_shared_GwtEvent_2ZV(Unknown source:0)
    at Unknown.com_google_gwt_event_shared_HandlerManager_$fireEvent__Lcom_google_gwt_event_shared_HandlerManager_2Lcom_google_gwt_event_shared_GwtEvent_2V(Unknown source:0)
    at Unknown.com_smartgwt_client_widgets_BaseWidget_fireEvent__Lcom_google_gwt_event_shared_GwtEvent_2V(Unknown source:0)
    at Unknown.anonymous(Unknown source:0)
    at Unknown.com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown source:0)
    at Unknown.anonymous(Unknown source:0)
    at Unknown.isc_StatefulCanvas_handleActivate(Unknown source:0)
    at Unknown.isc_StatefulCanvas_handleClick(Unknown source:0)
    at Unknown.isc_c_EventHandler_bubbleEvent(Unknown source:0)
    at Unknown.isc_c_EventHandler_handleClick(Unknown source:0)
    at Unknown.isc_c_EventHandler__handleMouseUp(Unknown source:0)
    at Unknown.isc_c_EventHandler_handleMouseUp(Unknown source:0)
    at Unknown.isc_c_EventHandler_dispatch(Unknown source:0)
    at Unknown.anonymous(Unknown source:0)
    at Unknown.anonymous(Unknown source:0)


Expected results:

Some upper bounding on numbers entered into this field.

Additional info:
Comment 1 John Mazzitelli 2012-01-27 09:28:55 EST
while we aer in here, lets see if we can fix the units. We have it where you have to enter milliseconds, which is pretty annoying. Perhaps we can allow differrent units or change the default units to something more realistic, like minutes. Under the covers we can convert to milliseconds when we pass the value to the server.
Comment 2 Mike Thompson 2012-01-30 00:08:52 EST
I did change the units to minutes (from ms) and kept the representation in the database as milliseconds as I didn't want to break any existing functionality based on those tables. The view shows in minutes and the database is still in millis.

I originally started out using various units (via DurationItem), however, things got a little complicated with min/max ranges in the various units so I dropped back to minutes as an acceptable UOM. As indicated, this fulfills the requirement and is simpler/cleaner unless multiple UOM are required.

Current maximum set to 1 week (60 * 24 * 7 minutes).

I also changed the current resource bundle (Messages.properties) to read (min) instead of (ms) however, i didn't change the other language bundles to reflect the language changes.

These changes are in the features/gwt-upgrade branch.
Comment 4 Mike Thompson 2012-01-30 12:16:32 EST
These changes are not in master yet (in feature/gwt-upgrade) so I will leave the status as ON_DEV.
Comment 5 Mike Thompson 2012-01-31 16:31:14 EST
Git commit id: 5754205
Comment 6 Mike Thompson 2012-02-21 12:42:47 EST
Now in master.

Also commented out other foreign resource bundles for re-translation.

commit: 223f5fd
Comment 7 Heiko W. Rupp 2013-09-01 06:18:51 EDT
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.