Opened 50 years ago

Last modified 9 years ago

#932 new defect

IZ702: Wrong error message when wrong value for cs_url paramater is set

Reported by: marcingoldyn Owned by:
Priority: low Milestone:
Component: hedeby Version: 1.0u5_Beta
Severity: Keywords: Sun cli
Cc:

Description

[Imported from gridengine issuezilla http://gridengine.sunsource.net/issues/show_bug.cgi?id=702]

        Issue #:      702          Platform:     Sun          Reporter: marcingoldyn (marcingoldyn)
       Component:     hedeby          OS:        All
     Subcomponent:    cli          Version:      1.0u5_Beta      CC:    None defined
        Status:       NEW          Priority:     P4
      Resolution:                 Issue type:    DEFECT
                               Target milestone: 1.0u5next
      Assigned to:    adoerr (adoerr)
      QA Contact:     adoerr
          URL:
       * Summary:     Wrong error message when wrong value for cs_url paramater is set
   Status whiteboard:
      Attachments:


     Issue 702 blocks:
   Votes for issue 702:     Vote for this issue


   Opened: Wed Nov 25 05:54:00 -0700 2009 
------------------------


   Description:
   During the installation of managed host user has to provide cs_url parameter.
   Its a string with pattern <HOST>:<PORT>. If user will just provide host there
   like cs_url <HOST>: he will get a message like:

   "Wrong port was specified (0)"

   It should be clear error message that no port was provided.

   Evaluation:
   Its only visible during installation of managed host when user will not provide
   port number.

   Analysis:

   Problem is in the class HostAndPort.

   If the character ":" is set by user as the last chacater in a string his index
   is taken in line 100 as a last index of the whole string.

   Now, in the line 103 there is put as a argument to the function parsteInt
   another string operation substring with argument index+1. We know that our index
   of character ":" was already the last character in the whole string so moving
   the index to +1 will result in IndexOutOfBoundsException. Unfortunatelly its
   RuntimeException. Is not catch anywhere. port variable is set to null;
   Than in class AddSystemCommand.java. when it compares in line 144 the port value
   with null GrmException is thrown.

   HowToFix:

   Either we will do a check for port==null or we will extend error handling in
   line 151 of AddSystemCommand to catch also OutOfBoundsExceptions.

   HowToTest:

   provide as cs_url string "dsadas:" and see if the correct human readable message
   will be printed.

   ETC: 2PD
               ------- Additional comments from marcingoldyn Wed Nov 25 05:56:05 -0700 2009 -------
   to high priority for this it should P4

               ------- Additional comments from rhierlmeier Wed Nov 25 07:21:11 -0700 2009 -------
   Milestone changed

Change History (0)

Note: See TracTickets for help on using tickets.