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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -38,24 +38,23 @@ public class GCCErrorParser extends AbstractErrorParser {
@Override @Override
public String getVarName(Matcher matcher) { public String getVarName(Matcher matcher) {
String desc = getDesc(matcher); String desc = getDesc(matcher);
Matcher varMatcher = null; if (desc == null)
for (int i = 0; i < varPatterns.length; ++i) { return null;
varMatcher = varPatterns[i].matcher(desc);
if (varMatcher.find())
break;
else
varMatcher = 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 @Override
public int getSeverity(Matcher matcher) { public int getSeverity(Matcher matcher) {
String warningGroup = matcher.group(4); String warningGroup = matcher.group(4);
if (warningGroup != null && warningGroup.indexOf("arning") >= 0) //$NON-NLS-1$ if (warningGroup != null && warningGroup.indexOf("arning") >= 0) //$NON-NLS-1$
return IMarkerGenerator.SEVERITY_WARNING; return IMarkerGenerator.SEVERITY_WARNING;
else
return IMarkerGenerator.SEVERITY_ERROR_RESOURCE; return IMarkerGenerator.SEVERITY_ERROR_RESOURCE;
} }
} }
}; };