ERROR:
reference to IndexOutOfBoundsException is ambiguous, both class com.sun.star.lang.IndexOutOfBoundsException in com.sun.star.lang and class java.lang.IndexOutOfBoundsException in java.lang match
CODE:
public void insertIntoCell(int CellX, int CellY, String theValue,
XSpreadsheet TT1,
String flag) throws IndexOutOfBoundsException {
XCell oCell = null;
oCell = TT1.getCellByPosition(CellX, CellY);
if (flag.equals("V")) {
oCell.setValue((new Float(theValue)).floatValue());
} else {
if (theValue!=null && theValue.length()>0 && theValue.length()!=0) {
oCell.setFormula("'"+(String)theValue.toString());
} else {
oCell.setFormula((String)theValue.toString());
}
}
}
Fully qualify the exception type.
I’m presuming here that you do not intend to throw
java.lang.IndexOutOfBoundsException, which is an uncheckedRuntimeException, but I could be wrong.You can also use a single-type import declaration instead:
But this can potentially cause a lot more confusion down the pipe.