diff options
author | Jonah Graham | 2018-11-20 16:20:42 +0000 |
---|---|---|
committer | Jonah Graham | 2018-11-22 21:55:36 +0000 |
commit | caf2292768deccd885b5b6989b731742e2e5edf4 (patch) | |
tree | 711a6088f2e17c7e31ebb51af1eadc1af00768e5 /codan | |
parent | 8844a8f9f22802fedffa3cb2a8a21b041aa64b74 (diff) | |
download | org.eclipse.cdt-caf2292768deccd885b5b6989b731742e2e5edf4.tar.gz org.eclipse.cdt-caf2292768deccd885b5b6989b731742e2e5edf4.tar.xz org.eclipse.cdt-caf2292768deccd885b5b6989b731742e2e5edf4.zip |
Bug 540373: Cleanup: Remove redundant type arguments
This was done by selecting all projects in Eclipse then
Source -> Clean Up... -> choosing:
- Remove redundant type arguments
and completing the wizard
Change-Id: Iaecc7010f097b4b1fabd29ccaa34ccb23a716fbf
Diffstat (limited to 'codan')
34 files changed, 64 insertions, 64 deletions
diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateParameter.java b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateParameter.java index 196867893c8..42c9a3f77dc 100644 --- a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateParameter.java +++ b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixCreateParameter.java @@ -74,8 +74,8 @@ public class QuickFixCreateParameter extends AbstractAstRewriteQuickFix { if (declarations.length == 0) { return; } - HashMap<ITranslationUnit, IASTTranslationUnit> cachedASTs = new HashMap<ITranslationUnit, IASTTranslationUnit>(); - HashMap<ITranslationUnit, ASTRewrite> cachedRewrites = new HashMap<ITranslationUnit, ASTRewrite>(); + HashMap<ITranslationUnit, IASTTranslationUnit> cachedASTs = new HashMap<>(); + HashMap<ITranslationUnit, ASTRewrite> cachedRewrites = new HashMap<>(); for (IIndexName iname : declarations) { ITranslationUnit declTU = CxxAstUtils.getTranslationUnitFromIndexName(iname); if (declTU == null) { diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AbstractClassInstantiationChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AbstractClassInstantiationChecker.java index 7b69ab1dd73..7f7e8c104f5 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AbstractClassInstantiationChecker.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AbstractClassInstantiationChecker.java @@ -56,7 +56,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics; */ public class AbstractClassInstantiationChecker extends AbstractIndexAstChecker { public static final String ER_ID = "org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation"; //$NON-NLS-1$ - private final HashMap<ICPPClassType, ICPPMethod[]> pureVirtualMethodsCache = new HashMap<ICPPClassType, ICPPMethod[]>(); + private final HashMap<ICPPClassType, ICPPMethod[]> pureVirtualMethodsCache = new HashMap<>(); @Override public void initPreferences(IProblemWorkingCopy problem) { diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ClassMembersInitializationChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ClassMembersInitializationChecker.java index 5eb22b30f1e..6542744abcb 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ClassMembersInitializationChecker.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ClassMembersInitializationChecker.java @@ -79,7 +79,7 @@ public class ClassMembersInitializationChecker extends AbstractIndexAstChecker { class OnEachClass extends ASTVisitor { // NOTE: Classes can be nested and even can be declared in constructors of the other classes - private final Stack<Set<IField>> constructorsStack = new Stack<Set<IField>>(); + private final Stack<Set<IField>> constructorsStack = new Stack<>(); private boolean skipConstructorsWithFCalls = skipConstructorsWithFCalls(); OnEachClass() { diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NonVirtualDestructor.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NonVirtualDestructor.java index 4cc19d4cb0b..68f44b1513b 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NonVirtualDestructor.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NonVirtualDestructor.java @@ -43,7 +43,7 @@ public class NonVirtualDestructor extends AbstractIndexAstChecker { public static final String PROBLEM_ID = "org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem"; //$NON-NLS-1$ // Prevent stack overflow in case: class A: public A {}; - private static HashSet<ICPPClassType> checkedClassTypes = new HashSet<ICPPClassType>(); + private static HashSet<ICPPClassType> checkedClassTypes = new HashSet<>(); @Override public void processAst(IASTTranslationUnit ast) { diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/UnusedSymbolInFileScopeChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/UnusedSymbolInFileScopeChecker.java index bf6a7f36372..1a32fb61fd7 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/UnusedSymbolInFileScopeChecker.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/UnusedSymbolInFileScopeChecker.java @@ -74,11 +74,11 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { private static final String[] USAGE_ATTRIBUTES = new String[] { "__unused__", "unused", "constructor", //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ "destructor" }; //$NON-NLS-1$ - private Map<IBinding, IASTDeclarator> externFunctionDeclarations = new HashMap<IBinding, IASTDeclarator>(); - private Map<IBinding, IASTDeclarator> staticFunctionDeclarations = new HashMap<IBinding, IASTDeclarator>(); - private Map<IBinding, IASTDeclarator> staticFunctionDefinitions = new HashMap<IBinding, IASTDeclarator>(); - private Map<IBinding, IASTDeclarator> externVariableDeclarations = new HashMap<IBinding, IASTDeclarator>(); - private Map<IBinding, IASTDeclarator> staticVariableDeclarations = new HashMap<IBinding, IASTDeclarator>(); + private Map<IBinding, IASTDeclarator> externFunctionDeclarations = new HashMap<>(); + private Map<IBinding, IASTDeclarator> staticFunctionDeclarations = new HashMap<>(); + private Map<IBinding, IASTDeclarator> staticFunctionDefinitions = new HashMap<>(); + private Map<IBinding, IASTDeclarator> externVariableDeclarations = new HashMap<>(); + private Map<IBinding, IASTDeclarator> staticVariableDeclarations = new HashMap<>(); private Set<IBinding> declarationsWithUsageAttributes = new HashSet<>(); private IProblemWorkingCopy unusedVariableProblem = null; @@ -376,7 +376,7 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { } private void reportProblems() { - List<IASTDeclarator> funcDeclarators = new ArrayList<IASTDeclarator>(); + List<IASTDeclarator> funcDeclarators = new ArrayList<>(); funcDeclarators.addAll(externFunctionDeclarations.values()); funcDeclarators.addAll(staticFunctionDeclarations.values()); for (IASTDeclarator symbol : funcDeclarators) { @@ -387,7 +387,7 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { } } - List<IASTDeclarator> varDeclarators = new ArrayList<IASTDeclarator>(); + List<IASTDeclarator> varDeclarators = new ArrayList<>(); varDeclarators.addAll(externVariableDeclarations.values()); varDeclarators.addAll(staticVariableDeclarations.values()); for (IASTDeclarator symbol : varDeclarators) { @@ -398,7 +398,7 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { } } - List<IASTDeclarator> staticFuncDeclarators = new ArrayList<IASTDeclarator>(); + List<IASTDeclarator> staticFuncDeclarators = new ArrayList<>(); staticFuncDeclarators.addAll(staticFunctionDefinitions.values()); for (IASTDeclarator symbol : staticFuncDeclarators) { IASTName astName = getAstName(symbol); diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/fs/CFormatStringParser.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/fs/CFormatStringParser.java index 22ed7aa3a75..98e4f0701d2 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/fs/CFormatStringParser.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/fs/CFormatStringParser.java @@ -86,7 +86,7 @@ public class CFormatStringParser { this.argumentPattern = Pattern.compile(STRING_FORMAT_PATTERN); this.argumentMatcher = this.argumentPattern.matcher(argument); this.vulnerablePattern = Pattern.compile(VULNERABLE_PATTERN); - this.vulnerableArguments = new ConcurrentLinkedQueue<VulnerableFormatStringArgument>(); + this.vulnerableArguments = new ConcurrentLinkedQueue<>(); extractVulnerableArguments(); } diff --git a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/externaltool/ArgsSeparator.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/externaltool/ArgsSeparator.java index 7acb86c54f0..df629a1fe2a 100644 --- a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/externaltool/ArgsSeparator.java +++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/externaltool/ArgsSeparator.java @@ -36,7 +36,7 @@ public class ArgsSeparator { } ParserState state = ParserState.NORMAL; StringBuilder current = new StringBuilder(); - List<String> args = new ArrayList<String>(); + List<String> args = new ArrayList<>(); boolean lastTokenInQuotes = false; char previous = 0; for (char c : s.toCharArray()) { diff --git a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/CxxModelsCache.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/CxxModelsCache.java index 32746f423fa..9d60649c53b 100644 --- a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/CxxModelsCache.java +++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/CxxModelsCache.java @@ -51,7 +51,7 @@ public class CxxModelsCache implements ICodanDisposable { CxxModelsCache(ITranslationUnit tu) { this.tu = tu; this.file = tu != null ? (IFile) tu.getResource() : null; - cfgmap = new WeakHashMap<IASTFunctionDefinition, IControlFlowGraph>(0); + cfgmap = new WeakHashMap<>(0); } CxxModelsCache(IASTTranslationUnit ast) { diff --git a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CheckerTestCase.java b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CheckerTestCase.java index 6a9c151a93e..7f89a01f939 100644 --- a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CheckerTestCase.java +++ b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CheckerTestCase.java @@ -135,7 +135,7 @@ public class CheckerTestCase extends CodanTestCase { public void checkNoErrorsOfKind(String problemId) { if (markers != null && markers.length > 0) { - List<IMarker> filtered = new ArrayList<IMarker>(markers.length); + List<IMarker> filtered = new ArrayList<>(markers.length); for (IMarker m : markers) { if (CodanProblemMarker.getProblemId(m).equals(problemId)) { filtered.add(m); diff --git a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanFastCxxAstTestCase.java b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanFastCxxAstTestCase.java index 978fd73055a..1bc0de9fec9 100644 --- a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanFastCxxAstTestCase.java +++ b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanFastCxxAstTestCase.java @@ -147,7 +147,7 @@ public abstract class CodanFastCxxAstTestCase extends TestCase { } } - private ArrayList<ProblemInstance> codanproblems = new ArrayList<CodanFastCxxAstTestCase.ProblemInstance>(); + private ArrayList<ProblemInstance> codanproblems = new ArrayList<>(); void runCodan(String code) { tu = parse(code); diff --git a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanTestCase.java b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanTestCase.java index 626a90f518a..1e926828042 100644 --- a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanTestCase.java +++ b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/tests/CodanTestCase.java @@ -45,13 +45,13 @@ import org.eclipse.core.runtime.Plugin; */ @SuppressWarnings("nls") public class CodanTestCase extends BaseTestCase { - ArrayList<File> tempFiles = new ArrayList<File>(); + ArrayList<File> tempFiles = new ArrayList<>(); protected File tmpDir; protected ICProject cproject; protected File currentFile; protected ICElement currentCElem; protected IFile currentIFile; - protected ArrayList<Integer> errLines = new ArrayList<Integer>(); + protected ArrayList<Integer> errLines = new ArrayList<>(); /** * diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanCorePlugin.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanCorePlugin.java index c5342d84899..c2f6ab49421 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanCorePlugin.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanCorePlugin.java @@ -195,7 +195,7 @@ public class CodanCorePlugin extends Plugin { if (bundle != null) { BundleContext context = bundle.getBundleContext(); if (context != null) { - ServiceTracker<DebugOptions, DebugOptions> tracker = new ServiceTracker<DebugOptions, DebugOptions>( + ServiceTracker<DebugOptions, DebugOptions> tracker = new ServiceTracker<>( context, DebugOptions.class.getName(), null); try { tracker.open(); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java index adfff49ab39..eb3de93f39c 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java @@ -80,7 +80,7 @@ public abstract class AbstractChecker implements IChecker { * @since 2.0 */ public List<IProblem> getProblemsByMainId(String id, IResource file) { - ArrayList<IProblem> list = new ArrayList<IProblem>(); + ArrayList<IProblem> list = new ArrayList<>(); IProblemProfile resourceProfile = CheckersRegistry.getInstance().getResourceProfile(file); IProblem[] problems = resourceProfile.getProblems(); for (int i = 0; i < problems.length; i++) { diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/FileScopeProblemPreference.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/FileScopeProblemPreference.java index f30cb20fe80..066a66d8eb1 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/FileScopeProblemPreference.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/FileScopeProblemPreference.java @@ -176,7 +176,7 @@ public class FileScopeProblemPreference extends AbstractProblemPreference { checkKeyword(tokenizer, keyword); checkChar(tokenizer, '='); checkChar(tokenizer, '>'); - ArrayList<IPath> list = new ArrayList<IPath>(); + ArrayList<IPath> list = new ArrayList<>(); int token; try { checkChar(tokenizer, '('); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/ListProblemPreference.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/ListProblemPreference.java index 6ed92ddd659..dccef8edea8 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/ListProblemPreference.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/ListProblemPreference.java @@ -31,7 +31,7 @@ public class ListProblemPreference extends AbstractProblemPreference * of all elements. */ public static final String COMMON_DESCRIPTOR_KEY = "#"; //$NON-NLS-1$ - protected ArrayList<Object> list = new ArrayList<Object>(); + protected ArrayList<Object> list = new ArrayList<>(); protected IProblemPreference childDescriptor; /** @@ -196,7 +196,7 @@ public class ListProblemPreference extends AbstractProblemPreference @Override public Object clone() { ListProblemPreference list1 = (ListProblemPreference) super.clone(); - list1.list = new ArrayList<Object>(); + list1.list = new ArrayList<>(); list1.setChildDescriptor((IProblemPreference) getChildDescriptor().clone()); for (Iterator<Object> iterator = list.iterator(); iterator.hasNext();) { Object value = iterator.next(); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/MapProblemPreference.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/MapProblemPreference.java index 0ef0cbc6154..85737b0055e 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/MapProblemPreference.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/MapProblemPreference.java @@ -131,7 +131,7 @@ public class MapProblemPreference extends AbstractProblemPreference public Object clone() { MapProblemPreference map = (MapProblemPreference) super.clone(); synchronized (hash) { - map.hash = Collections.synchronizedMap(new LinkedHashMap<String, IProblemPreference>(hash)); + map.hash = Collections.synchronizedMap(new LinkedHashMap<>(hash)); } // now we have to clone the values too for (Entry<String, IProblemPreference> entry : map.hash.entrySet()) { @@ -255,7 +255,7 @@ public class MapProblemPreference extends AbstractProblemPreference @Override public Object getValue() { synchronized (hash) { - LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>(); + LinkedHashMap<String, Object> map = new LinkedHashMap<>(); for (Iterator<IProblemPreference> iterator = hash.values().iterator(); iterator.hasNext();) { IProblemPreference pref = iterator.next(); map.put(pref.getKey(), pref.getValue()); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckerInvocationContext.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckerInvocationContext.java index deeed714134..f32ccd030e1 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckerInvocationContext.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckerInvocationContext.java @@ -34,7 +34,7 @@ public class CheckerInvocationContext implements ICheckerInvocationContext { */ public CheckerInvocationContext(IResource resource) { this.resource = resource; - objectStorage = new HashMap<Class<?>, Object>(); + objectStorage = new HashMap<>(); } @Override diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java index 7d50dd60b81..c31a1f080d0 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java @@ -64,13 +64,13 @@ public class CheckersRegistry implements Iterable<IChecker>, ICheckersRegistry { private static final String CATEGORY_ELEMENT = "category"; //$NON-NLS-1$ private static final Object DEFAULT = "DEFAULT"; //$NON-NLS-1$ public static final String CLONE_SUFFIX = ".COPY"; //$NON-NLS-1$ - private Collection<IChecker> checkers = new ArrayList<IChecker>(); + private Collection<IChecker> checkers = new ArrayList<>(); private static CheckersRegistry instance; private static boolean initialized = false; - private final Map<Object, IProblemProfile> profiles = new HashMap<Object, IProblemProfile>(); - private final Map<IChecker, Collection<IProblem>> problemList = new HashMap<IChecker, Collection<IProblem>>(); - private final Map<String, IChecker> problemCheckerMapping = new HashMap<String, IChecker>(); - private final List<ICheckerEnablementVerifier> checkerEnablementVerifiers = new ArrayList<ICheckerEnablementVerifier>(); + private final Map<Object, IProblemProfile> profiles = new HashMap<>(); + private final Map<IChecker, Collection<IProblem>> problemList = new HashMap<>(); + private final Map<String, IChecker> problemCheckerMapping = new HashMap<>(); + private final List<ICheckerEnablementVerifier> checkerEnablementVerifiers = new ArrayList<>(); private CheckersRegistry() { instance = this; @@ -301,7 +301,7 @@ public class CheckersRegistry implements Iterable<IChecker>, ICheckersRegistry { public void addRefProblem(IChecker c, IProblem p) { Collection<IProblem> plist = problemList.get(c); if (plist == null) { - plist = new ArrayList<IProblem>(); + plist = new ArrayList<>(); problemList.put(c, plist); } plist.add(p); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersTimeStats.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersTimeStats.java index 94ecf856c6d..f65a8177af4 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersTimeStats.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersTimeStats.java @@ -60,7 +60,7 @@ public class CheckersTimeStats { } } - private Map<String, TimeRecord> records = new HashMap<String, TimeRecord>(); + private Map<String, TimeRecord> records = new HashMap<>(); /** * @param id - checker id diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanApplication.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanApplication.java index 12672a22efa..238af82ec25 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanApplication.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanApplication.java @@ -35,7 +35,7 @@ import org.eclipse.osgi.util.NLS; * @noinstantiate This class is not intended to be instantiated by clients. */ public class CodanApplication implements IApplication { - private Collection<String> projects = new ArrayList<String>(); + private Collection<String> projects = new ArrayList<>(); private boolean verbose; private boolean all; diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ConnectorNode.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ConnectorNode.java index bb9317989a5..d53c042e52b 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ConnectorNode.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ConnectorNode.java @@ -23,7 +23,7 @@ import org.eclipse.cdt.codan.core.model.cfg.IJumpNode; * TODO: add description */ public class ConnectorNode extends AbstractSingleOutgoingNode implements IConnectorNode { - protected ArrayList<IBasicBlock> incoming = new ArrayList<IBasicBlock>(2); + protected ArrayList<IBasicBlock> incoming = new ArrayList<>(2); protected ConnectorNode() { super(); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ControlFlowGraph.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ControlFlowGraph.java index bae7880dab6..ecffbd3ab9a 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ControlFlowGraph.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/ControlFlowGraph.java @@ -34,7 +34,7 @@ import org.eclipse.cdt.codan.core.model.cfg.IStartNode; */ public class ControlFlowGraph implements IControlFlowGraph { private List<IExitNode> exitNodes; - private List<IBasicBlock> deadNodes = new ArrayList<IBasicBlock>(); + private List<IBasicBlock> deadNodes = new ArrayList<>(); private IStartNode start; public ControlFlowGraph(IStartNode start, Collection<IExitNode> exitNodes) { @@ -55,11 +55,11 @@ public class ControlFlowGraph implements IControlFlowGraph { public void setExitNodes(Collection<IExitNode> exitNodes) { if (this.exitNodes != null) throw new IllegalArgumentException("Cannot modify already exiting connector"); //$NON-NLS-1$ - this.exitNodes = Collections.unmodifiableList(new ArrayList<IExitNode>(exitNodes)); + this.exitNodes = Collections.unmodifiableList(new ArrayList<>(exitNodes)); } public void setUnconnectedNodes(Collection<IBasicBlock> nodes) { - this.deadNodes = Collections.unmodifiableList(new ArrayList<IBasicBlock>(nodes)); + this.deadNodes = Collections.unmodifiableList(new ArrayList<>(nodes)); } /* @@ -126,7 +126,7 @@ public class ControlFlowGraph implements IControlFlowGraph { */ @Override public Collection<IBasicBlock> getNodes() { - Collection<IBasicBlock> result = new LinkedHashSet<IBasicBlock>(); + Collection<IBasicBlock> result = new LinkedHashSet<>(); getNodes(getStartNode(), result); getDeadNodes(result); return result; @@ -150,13 +150,13 @@ public class ControlFlowGraph implements IControlFlowGraph { } public Collection<IBasicBlock> getDeadNodes() { - Collection<IBasicBlock> result = new LinkedHashSet<IBasicBlock>(); + Collection<IBasicBlock> result = new LinkedHashSet<>(); getDeadNodes(result); return result; } private void getDeadNodes(Collection<IBasicBlock> result) { - Collection<IBasicBlock> liveNodes = new LinkedHashSet<IBasicBlock>(); + Collection<IBasicBlock> liveNodes = new LinkedHashSet<>(); getNodes(getStartNode(), liveNodes); for (Iterator<IBasicBlock> iterator = deadNodes.iterator(); iterator.hasNext();) { diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/DecisionNode.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/DecisionNode.java index a55a59ba23c..ec7a9604113 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/DecisionNode.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/cfg/DecisionNode.java @@ -25,7 +25,7 @@ import org.eclipse.cdt.codan.core.model.cfg.IDecisionNode; * @see IDecisionNode */ public class DecisionNode extends AbstractSingleIncomingNode implements IDecisionNode { - private List<IBasicBlock> next = new ArrayList<IBasicBlock>(2); + private List<IBasicBlock> next = new ArrayList<>(2); private IConnectorNode conn; protected DecisionNode() { diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemCategory.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemCategory.java index 8951f69574e..d6bab54fb26 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemCategory.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemCategory.java @@ -28,7 +28,7 @@ import org.eclipse.cdt.codan.core.model.IProblemProfile; public class CodanProblemCategory extends CodanProblemElement implements IProblemCategory, Cloneable { private String id; private String name; - private ArrayList<IProblemElement> list = new ArrayList<IProblemElement>(); + private ArrayList<IProblemElement> list = new ArrayList<>(); public CodanProblemCategory(String id, String name) { this.id = id; @@ -89,7 +89,7 @@ public class CodanProblemCategory extends CodanProblemElement implements IProble * @return list of categories */ public static IProblemCategory[] findProblemCategories(IProblemCategory c, String id) { - ArrayList<IProblemCategory> list = new ArrayList<IProblemCategory>(); + ArrayList<IProblemCategory> list = new ArrayList<>(); Object[] children = c.getChildren(); for (Object object : children) { if (object instanceof IProblemCategory) { @@ -131,7 +131,7 @@ public class CodanProblemCategory extends CodanProblemElement implements IProble @Override public Object clone() { CodanProblemCategory catClone = (CodanProblemCategory) super.clone(); - catClone.list = new ArrayList<IProblemElement>(); + catClone.list = new ArrayList<>(); for (Iterator<IProblemElement> iterator = this.list.iterator(); iterator.hasNext();) { IProblemElement child = iterator.next(); IProblemElement childClone = (IProblemElement) child.clone(); diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java index f602900b23d..e75a16dccdc 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java @@ -42,7 +42,7 @@ public class ProblemProfile implements IProblemProfile, Cloneable { @Override public IProblem[] getProblems() { - Collection<IProblem> problems = new ArrayList<IProblem>(); + Collection<IProblem> problems = new ArrayList<>(); collectProblems(getRoot(), problems); return problems.toArray(new IProblem[problems.size()]); } diff --git a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/cppcheck/CppcheckChecker.java b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/cppcheck/CppcheckChecker.java index 13f63c5a1e0..1a00757ec2b 100644 --- a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/cppcheck/CppcheckChecker.java +++ b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/cppcheck/CppcheckChecker.java @@ -35,7 +35,7 @@ public class CppcheckChecker extends AbstractExternalToolBasedChecker { private static final String ERROR_PROBLEM_ID; // key: severity (error, warning, etc.) - value : problem ID associated to severity - private static final Map<Severity, String> PROBLEM_IDS = new HashMap<Severity, String>(); + private static final Map<Severity, String> PROBLEM_IDS = new HashMap<>(); static { ERROR_PROBLEM_ID = addProblemId(Severity.ERROR); diff --git a/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java b/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java index 5f2b8356962..a89a4d08106 100644 --- a/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java +++ b/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java @@ -137,7 +137,7 @@ public class ControlFlowGraphView extends ViewPart { IBasicBlock iBasicBlock = iter.next(); dead.add(iBasicBlock); } - ArrayList<Object> all = new ArrayList<Object>(); + ArrayList<Object> all = new ArrayList<>(); all.addAll(blocks); // labeled statements disjoined from the rest for (IBasicBlock node : cfg.getNodes()) { @@ -148,7 +148,7 @@ public class ControlFlowGraphView extends ViewPart { all.add(dead); return all.toArray(); } else if (parent instanceof IDecisionNode) { - ArrayList<IBasicBlock> blocks = new ArrayList<IBasicBlock>(); + ArrayList<IBasicBlock> blocks = new ArrayList<>(); IBasicBlock[] outgoingNodes = ((IDecisionNode) parent).getOutgoingNodes(); for (int i = 0; i < outgoingNodes.length; i++) { IBasicBlock arc = outgoingNodes[i]; @@ -318,7 +318,7 @@ public class ControlFlowGraphView extends ViewPart { } protected void processAst(IASTTranslationUnit ast) { - final ArrayList<IControlFlowGraph> functions = new ArrayList<IControlFlowGraph>(); + final ArrayList<IControlFlowGraph> functions = new ArrayList<>(); ASTVisitor visitor = new ASTVisitor() { { shouldVisitDeclarations = true; diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanProblemMarkerResolutionGenerator.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanProblemMarkerResolutionGenerator.java index 32939d0c832..03406b67e03 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanProblemMarkerResolutionGenerator.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CodanProblemMarkerResolutionGenerator.java @@ -115,7 +115,7 @@ public class CodanProblemMarkerResolutionGenerator implements IMarkerResolutionG return new IMarkerResolution[0]; Collection<ConditionalResolution> candidates = conditionalResolutions.get(id); - ArrayList<IMarkerResolution> resolutions = new ArrayList<IMarkerResolution>(); + ArrayList<IMarkerResolution> resolutions = new ArrayList<>(); if (candidates != null) { candidates.stream().filter(candidate -> candidate.isApplicableFor(marker)) @@ -191,7 +191,7 @@ public class CodanProblemMarkerResolutionGenerator implements IMarkerResolutionG private static void addResolution(String id, ConditionalResolution res) { Collection<ConditionalResolution> candidates = conditionalResolutions.get(id); if (candidates == null) { - candidates = new ArrayList<ConditionalResolution>(); + candidates = new ArrayList<>(); conditionalResolutions.put(id, candidates); } candidates.add(res); diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/OpenProblemPreferences.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/OpenProblemPreferences.java index cc92f8cace6..11200aa0e0f 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/OpenProblemPreferences.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/OpenProblemPreferences.java @@ -37,7 +37,7 @@ public class OpenProblemPreferences implements IObjectActionDelegate { public void run(IAction action) { if (selection instanceof IStructuredSelection) { IStructuredSelection ss = (IStructuredSelection) selection; - ArrayList<IProblem> list = new ArrayList<IProblem>(); + ArrayList<IProblem> list = new ArrayList<>(); IResource resource = null; for (Iterator<?> iterator = ss.iterator(); iterator.hasNext();) { Object el = iterator.next(); diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java index 734f225f27c..baf6e0daed7 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java @@ -107,7 +107,7 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork public void selectionChanged(SelectionChangedEvent event) { if (infoButton != null && event.getSelection() instanceof ITreeSelection) { ITreeSelection s = (ITreeSelection) event.getSelection(); - ArrayList<IProblem> list = new ArrayList<IProblem>(); + ArrayList<IProblem> list = new ArrayList<>(); for (Iterator<?> iterator = s.iterator(); iterator.hasNext();) { Object o = iterator.next(); if (o instanceof IProblem) { @@ -251,7 +251,7 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork } private static void asynchronouslyUpdateMarkers(final IResource resource) { - final Set<IFile> filesToUpdate = new HashSet<IFile>(); + final Set<IFile> filesToUpdate = new HashSet<>(); final IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow active = workbench.getActiveWorkbenchWindow(); final IWorkbenchPage page = active.getActivePage(); @@ -307,7 +307,7 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork private static void removeMarkersForDisabledProblems(IResource resource, IProgressMonitor monitor) { CheckersRegistry chegistry = CheckersRegistry.getInstance(); - Set<String> markerTypes = new HashSet<String>(); + Set<String> markerTypes = new HashSet<>(); for (IChecker checker : chegistry) { Collection<IProblem> problems = chegistry.getRefProblems(checker); for (IProblem problem : problems) { diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java index c48e0d08e42..6a47f9da134 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java @@ -51,7 +51,7 @@ import org.eclipse.ui.preferences.ScopedPreferenceStore; */ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage { // Stores all created field editors - private List<FieldEditor> editors = new ArrayList<FieldEditor>(); + private List<FieldEditor> editors = new ArrayList<>(); // Stores owning element of properties private IAdaptable element; // Additional buttons for property pages diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FileScopePreferencePage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FileScopePreferencePage.java index 764e76ec83a..2557abcdeee 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FileScopePreferencePage.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FileScopePreferencePage.java @@ -127,13 +127,13 @@ public class FileScopePreferencePage extends PreferencePage { private ListDialogField<String> createListContents(FileScopeProblemPreference entryToEdit, String key, String label, String descriptor, String[] buttonLabels) { ExclusionPatternAdapter adapter = new ExclusionPatternAdapter(); - ListDialogField<String> patternList = new ListDialogField<String>(adapter, buttonLabels, + ListDialogField<String> patternList = new ListDialogField<>(adapter, buttonLabels, new ExclusionInclusionLabelProvider(descriptor)); patternList.setDialogFieldListener(adapter); patternList.setLabelText(label); patternList.enableButton(IDX_EDIT, false); IPath[] pattern = entryToEdit.getAttribute(key); - ArrayList<String> elements = new ArrayList<String>(pattern.length); + ArrayList<String> elements = new ArrayList<>(pattern.length); for (int i = 0; i < pattern.length; i++) { String patternName = pattern[i].toString(); if (patternName.length() > 0) diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/LaunchModesPropertyPage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/LaunchModesPropertyPage.java index fd4e23f2f87..4e83a3db70e 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/LaunchModesPropertyPage.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/LaunchModesPropertyPage.java @@ -46,7 +46,7 @@ public class LaunchModesPropertyPage extends FieldEditorPreferencePage { runInEditor = false; } setPreferenceStore(prefStore); - editors = new ArrayList<FieldEditor>(); + editors = new ArrayList<>(); } @Override diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/views/ProblemDetailsExtensions.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/views/ProblemDetailsExtensions.java index 4f762cf6e61..650462267dd 100644 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/views/ProblemDetailsExtensions.java +++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/views/ProblemDetailsExtensions.java @@ -32,7 +32,7 @@ public class ProblemDetailsExtensions { public static final String ALL = "*";//$NON-NLS-1$ private static final String EXTENSION_POINT_NAME = "codanProblemDetails"; //$NON-NLS-1$ private static boolean extensionsLoaded; - private static HashMap<String, Collection<?>> map = new HashMap<String, Collection<?>>(); + private static HashMap<String, Collection<?>> map = new HashMap<>(); private static synchronized void readExtensions() { if (extensionsLoaded) @@ -109,7 +109,7 @@ public class ProblemDetailsExtensions { public static Collection<AbstractCodanProblemDetailsProvider> getProviders(String id) { readExtensions(); - Collection<AbstractCodanProblemDetailsProvider> providers = new ArrayList<AbstractCodanProblemDetailsProvider>(); + Collection<AbstractCodanProblemDetailsProvider> providers = new ArrayList<>(); Collection<?> collection1 = getCollection(id); Collection<?> collection2 = getCollection(ALL); providers.addAll(resolveProviders(collection1)); |