From a10ba4bd8bb1bc390985b8fdd48c2e6b2ce21fb6 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Tue, 5 Oct 2010 06:16:16 +0000 Subject: [PATCH] Cosmetics. --- .../core/dom/parser/CLanguageKeywords.java | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/CLanguageKeywords.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/CLanguageKeywords.java index ac5ec02b5cb..cb54e9cd27c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/CLanguageKeywords.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/CLanguageKeywords.java @@ -28,7 +28,6 @@ import org.eclipse.cdt.internal.core.parser.token.KeywordSets; * @since 5.1 */ public class CLanguageKeywords implements ICLanguageKeywords { - private final ParserLanguage language; private final IScannerExtensionConfiguration config; @@ -36,26 +35,23 @@ public class CLanguageKeywords implements ICLanguageKeywords { private String[] keywords = null; private String[] builtinTypes = null; private String[] preprocessorKeywords = null; - - + /** * @throws NullPointerException if either parameter is null */ public CLanguageKeywords(ParserLanguage language, IScannerExtensionConfiguration config) { - if(language == null) + if (language == null) throw new NullPointerException("language is null"); //$NON-NLS-1$ - if(config == null) + if (config == null) throw new NullPointerException("config is null"); //$NON-NLS-1$ this.language = language; this.config = config; } - public String[] getKeywords() { - if(keywords == null) { + if (keywords == null) { Set keywordSet = new HashSet(KeywordSets.getKeywords(KeywordSetKey.KEYWORDS, language)); - CharArrayIntMap additionalKeywords = config.getAdditionalKeywords(); if (additionalKeywords != null) { for (Iterator iterator = additionalKeywords.toList().iterator(); iterator.hasNext(); ) { @@ -67,20 +63,17 @@ public class CLanguageKeywords implements ICLanguageKeywords { } return keywords; } - - public String[] getBuiltinTypes() { - if(builtinTypes == null) { + if (builtinTypes == null) { Set types = KeywordSets.getKeywords(KeywordSetKey.TYPES, language); builtinTypes = types.toArray(new String[types.size()]); } return builtinTypes; } - public String[] getPreprocessorKeywords() { - if(preprocessorKeywords == null) { + if (preprocessorKeywords == null) { Set keywords = new HashSet(KeywordSets.getKeywords(KeywordSetKey.PP_DIRECTIVE, language)); CharArrayIntMap additionalKeywords= config.getAdditionalPreprocessorKeywords(); if (additionalKeywords != null) { @@ -93,6 +86,4 @@ public class CLanguageKeywords implements ICLanguageKeywords { } return preprocessorKeywords; } - - }