albertogoffi / toradocu

Toradocu - automated generation of test oracles from Javadoc documentation
Other
42 stars 21 forks source link

Nontermination (?) on java.sql.PreparedStatement of OpenJDK #128

Open bjkeller opened 7 years ago

bjkeller commented 7 years ago

This needs more investigation, but it seems Toradocu is hanging on java.sql.PreparedStatement from OpenJDK 8.

The last line printed is

[main] WARN org.toradocu.translator.SentenceParser - Unable to identify a predicate (governor = is) in
"sqlType is a ARRAY BLOB CLOB DATALINK JAVA_OBJECT NCHAR NCLOB NVARCHAR LONGNVARCHAR REF ROWID SQLXML or STRUCT data type and the JDBC driver does not support this data type or if the JDBC driver does not support this method"
albertogoffi commented 7 years ago

I confirm the issue. Trying why the latest version in refactor, the last lines of printed output are:

Translating @throws java.sql.SQLFeatureNotSupportedException sqlType is a ARRAY BLOB CLOB DATALINK JAVA_OBJECT NCHAR NCLOB NVARCHAR LONGNVARCHAR REF ROWID SQLXML or STRUCT data type and the JDBC driver does not support this data type or if the JDBC driver does not support this method. 
of method setNull(int parameterIndex, int sqlType, java.lang.String typeName)
albertogoffi commented 7 years ago

My investigation led me think that the issue is in the distance algorithm. This is the test case I inferred debugging Toradocu:

  @Test(timeout=100000)
  public void nonTerminationTest() throws Exception {
    String s0 = "Wrapper";
    String s1 = "ARRAY BLOB CLOB DATALINK JAVA_OBJECT NCHAR NCLOB NVARCHAR LONGNVARCHAR REF ROWID SQLXML STRUCT data type";
    Distance.editDistance(s0, s1);
  }

The test case does not run in a reasonable amount of time.