From 6a94e17ca785a27daf909dbddc6c401be9c38d50 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Tue, 29 Jul 2014 14:13:23 -0700 Subject: [PATCH] Cosmetics. --- .../parser/tests/rewrite/RewriteBaseTest.java | 6 +++--- .../scanner/InternalFileContentProvider.java | 17 ++++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteBaseTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteBaseTest.java index 70363a4f9a8..9bb6bb10658 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteBaseTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteBaseTest.java @@ -28,10 +28,10 @@ import org.eclipse.jface.text.TextSelection; /** * @author Guido Zgraggen IFS */ -public abstract class RewriteBaseTest extends BaseTestFramework implements ILogListener{ +public abstract class RewriteBaseTest extends BaseTestFramework implements ILogListener { protected static final NullProgressMonitor NULL_PROGRESS_MONITOR = new NullProgressMonitor(); - protected TreeMap fileMap = new TreeMap(); + protected TreeMap fileMap = new TreeMap<>(); protected String fileWithSelection; protected TextSelection selection; @@ -103,7 +103,7 @@ public abstract class RewriteBaseTest extends BaseTestFramework implements ILogL stackTrace.append(ste.toString()); } } - fail("Log-Message: " + status.getMessage() + stackTrace.toString()); //$NON-NLS-1$ + fail("Log-Message: " + status.getMessage() + stackTrace.toString()); } public void setFileWithSelection(String fileWithSelection) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/InternalFileContentProvider.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/InternalFileContentProvider.java index 5c3974dac0f..d43342e9468 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/InternalFileContentProvider.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/InternalFileContentProvider.java @@ -41,6 +41,7 @@ public abstract class InternalFileContentProvider extends IncludeFileContentProv public static final class DependsOnOutdatedFileException extends Exception { public final Object fTu; public final IIndexFragmentFile fIndexFile; + public DependsOnOutdatedFileException(Object tu, IIndexFragmentFile file) { fTu= tu; fIndexFile= file; @@ -48,8 +49,8 @@ public abstract class InternalFileContentProvider extends IncludeFileContentProv } private IIncludeFileResolutionHeuristics fIncludeResolutionHeuristics; - private final Map fPragmaOnce= new HashMap(); - private final Map> fLoadedVersions= new HashMap>(); + private final Map fPragmaOnce= new HashMap<>(); + private final Map> fLoadedVersions= new HashMap<>(); /** * Checks whether the specified inclusion exists. @@ -69,9 +70,10 @@ public abstract class InternalFileContentProvider extends IncludeFileContentProv /** * Creates an InclusionContent object for the given location. + * * @param filePath the absolute location of the file. * @param macroDictionary macros defined at the inclusion point. - * @return Returns an inclusion content, or null if the location does not exist. + * @return Returns an inclusion content, or {@code null} if the location does not exist. * @see InternalFileContent */ public abstract InternalFileContent getContentForInclusion(String filePath, @@ -85,7 +87,8 @@ public abstract class InternalFileContentProvider extends IncludeFileContentProv /** * Returns a file-content object of kind {@link InclusionKind#FOUND_IN_INDEX}, representing * the content from the context of the given file up to where the file actually gets included, - * or null if this cannot be done. + * or {@code null} if this cannot be done. + * * @param filePath the absolute location of the file. * @param macroDictionary macros defined at the inclusion point. * @throws DependsOnOutdatedFileException @@ -117,7 +120,7 @@ public abstract class InternalFileContentProvider extends IncludeFileContentProv } /** - * Returns a strategy for heuristically resolving includes, or null if this shall + * Returns a strategy for heuristically resolving includes, or {@code null} if this shall * not be done. */ public final IIncludeFileResolutionHeuristics getIncludeHeuristics() { @@ -140,7 +143,7 @@ public abstract class InternalFileContentProvider extends IncludeFileContentProv } else if (!list.contains(sig)) { if (list.size() == 1) { ISignificantMacros first = list.get(0); - list= new ArrayList(2); + list= new ArrayList<>(2); list.add(first); fLoadedVersions.put(path, list); } else if (reduceVersions > 0 && reduceVersions < list.size()) { @@ -151,7 +154,7 @@ public abstract class InternalFileContentProvider extends IncludeFileContentProv } /** - * Return the path of the context of null, if there is no context. + * Returns the path of the context of {@code null}, if there is no context. */ public String getContextPath() { return null;