From c5b863d340765d0539f3f9fd3ff554f6c86cd7e4 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Wed, 14 Mar 2007 14:38:31 +0000 Subject: [PATCH] Make ScannerInfo API compliant --- .../eclipse/cdt/core/parser/ScannerInfo.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerInfo.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerInfo.java index c83d9a6ce7b..26da24d7e81 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerInfo.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2006 IBM Corporation and others. + * Copyright (c) 2002, 2007 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 @@ -7,9 +7,11 @@ * * Contributors: * IBM Rational Software - Initial API and implementation + * Anton Leherbauer (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.core.parser; +import java.util.Collections; import java.util.Map; /** @@ -18,8 +20,8 @@ import java.util.Map; */ public class ScannerInfo implements IScannerInfo { - private Map definedSymbols = null; - private String [] includePaths = null; + private Map definedSymbols = Collections.EMPTY_MAP; + private String [] includePaths = {}; public ScannerInfo() { @@ -27,15 +29,19 @@ public class ScannerInfo implements IScannerInfo public ScannerInfo( Map d, String [] incs ) { - definedSymbols = d; - includePaths = incs; + if (d != null) { + definedSymbols = d; + } + if (incs != null) { + includePaths = incs; + } } /** * @param definitions */ public ScannerInfo(Map definitions) { - this( definitions, (String [])null); + this(definitions, (String [])null); } /* (non-Javadoc)