mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-21 07:05:58 +02:00
fix for case where line is not a line
This commit is contained in:
parent
634009cabd
commit
73241e5bd6
1 changed files with 24 additions and 5 deletions
|
@ -67,9 +67,11 @@ 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
|
||||||
{
|
{
|
||||||
|
@ -77,20 +79,37 @@ public class DStoreServiceCommandShell extends ServiceCommandShell
|
||||||
}
|
}
|
||||||
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);
|
||||||
|
int linen = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
linen = Integer.parseInt(lineNo);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
if (linen != 0)
|
||||||
|
{
|
||||||
output.setAbsolutePath(file);
|
output.setAbsolutePath(file);
|
||||||
output.setLine(Integer.parseInt(lineNo));
|
output.setLine(linen);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
output.setAbsolutePath(src);
|
output.setAbsolutePath(src);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
output.setAbsolutePath(src);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
addOutput(output);
|
addOutput(output);
|
||||||
outputs[i] = output;
|
outputs[i] = output;
|
||||||
|
|
Loading…
Add table
Reference in a new issue