mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fixes a NPE, bug 215056.
This commit is contained in:
parent
75f29e6d15
commit
9284cb176d
1 changed files with 9 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2007 IBM Corporation and others.
|
||||
* Copyright (c) 2005, 2008 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -38,24 +38,23 @@ public class GCCErrorParser extends AbstractErrorParser {
|
|||
@Override
|
||||
public String getVarName(Matcher matcher) {
|
||||
String desc = getDesc(matcher);
|
||||
Matcher varMatcher = null;
|
||||
for (int i = 0; i < varPatterns.length; ++i) {
|
||||
varMatcher = varPatterns[i].matcher(desc);
|
||||
if (varMatcher.find())
|
||||
break;
|
||||
else
|
||||
varMatcher = null;
|
||||
}
|
||||
if (desc == null)
|
||||
return null;
|
||||
|
||||
return varMatcher != null ? varMatcher.group(1) : null;
|
||||
for (int i = 0; i < varPatterns.length; ++i) {
|
||||
Matcher varMatcher = varPatterns[i].matcher(desc);
|
||||
if (varMatcher.find())
|
||||
return varMatcher.group(1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public int getSeverity(Matcher matcher) {
|
||||
String warningGroup = matcher.group(4);
|
||||
if (warningGroup != null && warningGroup.indexOf("arning") >= 0) //$NON-NLS-1$
|
||||
return IMarkerGenerator.SEVERITY_WARNING;
|
||||
else
|
||||
return IMarkerGenerator.SEVERITY_ERROR_RESOURCE;
|
||||
|
||||
return IMarkerGenerator.SEVERITY_ERROR_RESOURCE;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue