Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-2624

org.apache.drill.common.StackTrace prints garbage for line numbers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.8.0
    • 1.0.0
    • Execution - Flow
    • None

    Description

      org.apache.drill.common.StackTrace's write(...) method prints irrelevant characters instead of line numbers, for example:

      org.apache.drill.common.StackTrace.<init>:$
      org.apache.drill.exec.server.Drillbit.run:ᅢᄉ
      org.apache.drill.jdbc.DrillConnectionImpl.<init>:[
      org.apache.drill.jdbc.DrillJdbc41Factory$DrillJdbc41Connection.<init>:^
      org.apache.drill.jdbc.DrillJdbc41Factory.newDrillConnection:9
      org.apache.drill.jdbc.DrillJdbc41Factory.newDrillConnection:^A
      org.apache.drill.jdbc.DrillFactory.newConnection:6
      net.hydromatic.avatica.UnregisteredDriver.connect:~
      java.sql.DriverManager.getConnection:￈ᄏ
      java.sql.DriverManager.getConnection:ᅡᄏ
      ...

      The problem is that somebody passed a line number to Writer.write(int c)--which takes an integer representing a character, not an integer to represent as a string of characters. (Writer's write(...) methods are not like PrintWriter's and PrintStream's print(...) methods.)

      Additionally, a meta-problem is that apparently it was never verified that the code actually worked. We need to execute the code and verify that it works at least once before checking it in.

      A second meta-problem is that there no unit test for the code. We should have unit tests for most code--especially code that is isolated and easy to test as this class seems to be.

      Attachments

        Activity

          People

            cwestin Chris Westin
            dsbos Daniel Barclay
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: