1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-23 00:03:53 +02:00

fix for case where line is not a line

This commit is contained in:
David McKnight 2006-10-04 18:03:54 +00:00
parent 634009cabd
commit 73241e5bd6

View file

@ -67,30 +67,49 @@ public class DStoreServiceCommandShell extends ServiceCommandShell
{ {
DataElement line = (DataElement)lineObj; DataElement line = (DataElement)lineObj;
String type = line.getType(); String type = line.getType();
String src = line.getSource();
if (event.isError()) if (event.isError())
{ {
output = new RemoteError(this, type); output = new RemoteError(this, type);
} }
else else
{ {
output = new RemoteOutput(this, type); output = new RemoteOutput(this, type);
} }
output.setText(line.getName()); output.setText(line.getName());
String src = line.getSource();
int colonSep = src.indexOf(':'); int colonSep = src.indexOf(':');
// line numbers // line numbers
if (colonSep > 0) if (colonSep > 0)
{ {
String lineNo = src.substring(colonSep + 1); String lineNo = src.substring(colonSep + 1);
String file = src.substring(0, colonSep); String file = src.substring(0, colonSep);
output.setAbsolutePath(file); int linen = 0;
output.setLine(Integer.parseInt(lineNo)); try
{
linen = Integer.parseInt(lineNo);
}
catch (Exception e)
{
}
if (linen != 0)
{
output.setAbsolutePath(file);
output.setLine(linen);
}
else
{
output.setAbsolutePath(src);
}
} }
else else
{ {
output.setAbsolutePath(src); output.setAbsolutePath(src);
} }
addOutput(output); addOutput(output);
outputs[i] = output; outputs[i] = output;