Uploaded image for project: 'LAMS Development'
  1. LAMS Development
  2. LDEV-2473

Non-integer character in answer for checkbox type daco stops everyone from viewing daco

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.3
    • Fix Version/s: 2.4, 2.3.4
    • Component/s: Tool Data Collection
    • Labels:
      None

      Description

      Found a value of '2&' in the answer column of a question of type checkbox. Results in number format exception:

      java.lang.NumberFormatException: For input string: "2&"
              at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
              at java.lang.Integer.parseInt(Integer.java:456)
              at java.lang.Integer.parseInt(Integer.java:497)
              at org.lamsfoundation.lams.tool.daco.dao.hibernate.DacoAnswerDAOHibernate.addAnswerEnumerationSummary(DacoAnswerDAOHibernate.java:119)
              at org.lamsfoundation.lams.tool.daco.dao.hibernate.DacoAnswerDAOHibernate.getQuestionSummaries(DacoAnswerDAOHibernate.java:85)
              at org.lamsfoundation.lams.tool.daco.service.DacoServiceImpl.getQuestionSummaries(DacoServiceImpl.java:489)

      Once this value is saved, no one can open the daco without getting the exception.

        Activity

        jundirl Jun-Dir Liew created issue -
        jundirl Jun-Dir Liew made changes -
        Field Original Value New Value
        Description Found a value of '2&' in the answer column of a question of type checkbox. Results in number format exception:

        java.lang.NumberFormatException: For input string: "2&"
                at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
                at java.lang.Integer.parseInt(Integer.java:456)
                at java.lang.Integer.parseInt(Integer.java:497)
                at org.lamsfoundation.lams.tool.daco.dao.hibernate.DacoAnswerDAOHibernate.addAnswerEnumerationSummary(DacoAnswerDAOHibernate.java:119)
                at org.lamsfoundation.lams.tool.daco.dao.hibernate.DacoAnswerDAOHibernate.getQuestionSummaries(DacoAnswerDAOHibernate.java:85)
                at org.lamsfoundation.lams.tool.daco.service.DacoServiceImpl.getQuestionSummaries(DacoServiceImpl.java:489)

        Once this value is saved, no one can open the daco without getting the exception.

        Could be a specific browser that somehow entered the ampersand in the checkbox value. One solutino is to regexp-replace the non-numerals from a known-integer value.
        Found a value of '2&' in the answer column of a question of type checkbox. Results in number format exception:

        java.lang.NumberFormatException: For input string: "2&"
                at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
                at java.lang.Integer.parseInt(Integer.java:456)
                at java.lang.Integer.parseInt(Integer.java:497)
                at org.lamsfoundation.lams.tool.daco.dao.hibernate.DacoAnswerDAOHibernate.addAnswerEnumerationSummary(DacoAnswerDAOHibernate.java:119)
                at org.lamsfoundation.lams.tool.daco.dao.hibernate.DacoAnswerDAOHibernate.getQuestionSummaries(DacoAnswerDAOHibernate.java:85)
                at org.lamsfoundation.lams.tool.daco.service.DacoServiceImpl.getQuestionSummaries(DacoServiceImpl.java:489)

        Once this value is saved, no one can open the daco without getting the exception.
        jundirl Jun-Dir Liew made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        ernieg Ernie Ghiglione made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            ernieg Ernie Ghiglione
            Reporter:
            jundirl Jun-Dir Liew
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development