Uploaded image for project: 'Aesh'
  1. Aesh
  2. AESH-80

Java.lang.ArithmeticException: / by zero threw if termWidth < maxLength in Parser

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 0.36, 0.33.1
    • 0.35
    • None
    • None

      In a rare case, if maxLength is long enough and maxLength > termWidth, then numColumns = 0 will cause "java.lang.ArithmeticException: / by zero"

      Parser.java
        int numColumns = termWidth / maxLength;
        if(numColumns > displayList.size()) // we dont need more columns than items
        numColumns = displayList.size();
        int numRows = displayList.size() / numColumns;
      

      This is the root reason of failure in https://bugzilla.redhat.com/show_bug.cgi?id=915594

            spederse@redhat.com Stale Pedersen
            chaowan@redhat.com Chao Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: