1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 20:05:35 +02:00

added null check for macro name and alllow null value

This commit is contained in:
David Inglis 2004-04-29 19:26:34 +00:00
parent c998734235
commit 4aecba2e95

View file

@ -22,8 +22,11 @@ public class MacroEntry extends APathEntry implements IMacroEntry {
public MacroEntry (IPath path, IPath baseRef, String macroName, String macroValue, IPath[] exclusionPatterns, boolean isExported) { public MacroEntry (IPath path, IPath baseRef, String macroName, String macroValue, IPath[] exclusionPatterns, boolean isExported) {
super(IMacroEntry.CDT_MACRO, null, baseRef, path, exclusionPatterns, isExported); super(IMacroEntry.CDT_MACRO, null, baseRef, path, exclusionPatterns, isExported);
if ( macroName == null) {
throw new IllegalArgumentException("Macro name cannot be null"); //$NON-NLS-1$
}
this.macroName = macroName; this.macroName = macroName;
this.macroValue = macroValue; this.macroValue = macroValue == null ? "" : macroValue; //$NON-NLS-1$
} }
/** /**