Menu

#132 StreamingDataSet.toString() throws UnsupportedOperationExcep

closed-fixed
Bug (232)
5
2008-06-15
2007-01-15
No

When you define a StreamingDataSet and then call toString on it, it calls

AbstractDataSet.toString()

by default, because it's not defined in the class itself.

But AbstractDataSet defines the class as:

public String toString()
{
try
{
return Arrays.asList(getTableNames()).toString();
}
catch (DataSetException e)
{
return super.toString();
}
}

And getTableNames() in StreamingDataSet is:

public String[] getTableNames() throws DataSetException
{
throw new UnsupportedOperationException();
}

This is serious, because we can't do this:

public void logDataSet(IDataSet dataSet)
{
LOGGER.info("Using dataset: " + dataSet);
}

without the possibility of throwing an exception.

Discussion

  • Sébastien Le Callonnec

    Logged In: YES
    user_id=1232035
    Originator: NO

    This also now causes StreamingDataSet to fail, as logging statements try to perform toString on the StreamingDataSet and therefore throw the error above (UnsupportedOperationException), so it is urgent to fix this problem.

     
  • Sébastien Le Callonnec

    • assigned_to: rlogiacco --> slecallonnec
     
  • Sébastien Le Callonnec

    • labels: --> Bug
    • status: open --> closed-fixed
     

Log in to post a comment.