drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Barclay (Drill) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-2624) org.apache.drill.common.StackTrace prints garbage for line numbers
Date Mon, 30 Mar 2015 18:03:53 GMT
Daniel Barclay (Drill) created DRILL-2624:
---------------------------------------------

             Summary: org.apache.drill.common.StackTrace prints garbage for line numbers
                 Key: DRILL-2624
                 URL: https://issues.apache.org/jira/browse/DRILL-2624
             Project: Apache Drill
          Issue Type: Bug
            Reporter: Daniel Barclay (Drill)


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.






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message