Hello,
In the following code:
try
{
numRows = Integer.parseInt(rowsJTextField.getText());
numCols = Integer.parseInt(columnsJTextField.getText());
} catch (NumberFormatException numberFormatException)
{
JOptionPane.showMessageDialog(rootPane, numberFormatException.getMessage(), "Problem with the conversion", JOptionPane.ERROR_MESSAGE);
}
try
{
dataset = MatrixIO.loadCSV(dataSetFileName, numRows, numCols);
} catch (Exception ex)
{
JOptionPane.showMessageDialog(rootPane, ex.getMessage(), "I cannot load the file: " + datasetFile.getName(), JOptionPane.ERROR_MESSAGE);
return;
}
If I enter number of rows greater than the number that the file actually
contains then the ex.getMessage() returns null.
If instead of Exception I use IOException I cannot caught the exception - a
NullPointerException is thrown
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.ejml.ops.ReadMatrixCsv.read(Unknown Source)
at org.ejml.ops.MatrixIO.loadCSV(Unknown Source)
at ipapas.mlj.MainFrame.loadFileJButtonActionPerformed(MainFrame.java:396)
at ipapas.mlj.MainFrame.access$000(MainFrame.java:47)
If I enter number of rows less then the number that the file actually contains
then no Exception is thrown.
regards,
Ioannis P.
Original issue reported on code.google.com by peter.ab...@gmail.com on 7 Dec 2012 at 11:19
Original issue reported on code.google.com by
peter.ab...@gmail.com
on 7 Dec 2012 at 11:19