1
0
Fork 0
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:
Markus Schorn 2008-05-28 11:56:01 +00:00
parent 75f29e6d15
commit 9284cb176d

View file

@ -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;
}
}
};