1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 23:55:26 +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;
String type = line.getType();
String src = line.getSource();
if (event.isError())
{
output = new RemoteError(this, type);
output = new RemoteError(this, type);
}
else
{
output = new RemoteOutput(this, type);
}
output.setText(line.getName());
output.setText(line.getName());
String src = line.getSource();
int colonSep = src.indexOf(':');
// line numbers
if (colonSep > 0)
{
String lineNo = src.substring(colonSep + 1);
String file = src.substring(0, colonSep);
output.setAbsolutePath(file);
output.setLine(Integer.parseInt(lineNo));
int linen = 0;
try
{
linen = Integer.parseInt(lineNo);
}
catch (Exception e)
{
}
if (linen != 0)
{
output.setAbsolutePath(file);
output.setLine(linen);
}
else
{
output.setAbsolutePath(src);
}
}
else
{
output.setAbsolutePath(src);
}
addOutput(output);
outputs[i] = output;