portals-pluto-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pluto-...@jakarta.apache.org
Subject [jira] Resolved: (PLUTO-66) TestPortlet assumes testId will be a number
Date Fri, 15 Oct 2004 02:03:51 GMT

   The following issue has been resolved as FIXED.

   Resolver: David DeWolf
       Date: Thu, 14 Oct 2004 7:03 PM

Thanks!  Patch Applied
View the issue:

Here is an overview of the issue:
        Key: PLUTO-66
    Summary: TestPortlet assumes testId will be a number
       Type: Bug

     Status: Resolved
   Priority: Major
 Resolution: FIXED

    Project: Pluto
   Fix Fors:
             Current CVS
             Current CVS

   Reporter: Ken Weiner

    Created: Wed, 22 Sep 2004 5:58 PM
    Updated: Thu, 14 Oct 2004 7:03 PM

In TestPortlet.doDispatch(), the following code assumes that the test portlet will be a number
(line 127):

        TestConfig config = null;
        if(testId != null) {
            config = (TestConfig)configs.get(Integer.parseInt(testId));

This throws a java.lang.NumberFormatException when the testId has no value which is currently
the case when you click the "Return to Index" button in the test portlet.  

One way to fix this is to check for the case when testId is an empty String or when testId
is not a number inside the getTestId(PortletRequest req) method.  In that case, the method
should return null.

For example, the first "if" block in that method could be changed to this (line 181):

        if((testId == null || testId.trim().length() == 0) && 
           next == null && previous == null && tests.size() > 0) {
            return null;

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

View raw message