1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 02:06:01 +02:00

[releng] Apply auto-clean of save to all files with Eclipse 4.23

This mostly is using diamond operator, but includes
adding missing @Override and organizing imports and
applying formatting improvements in the JDT formatter.

Change-Id: Id91cbff33b0a039cc5121945ffbc407ecba45866
This commit is contained in:
Jonah Graham 2022-04-17 15:34:43 -04:00
parent 148ae40d0f
commit a1c02e2cce
242 changed files with 518 additions and 452 deletions

View file

@ -36,7 +36,7 @@ abstract class LocationAdapter<T> {
public abstract T getLocation(IFile file); public abstract T getLocation(IFile file);
public static final LocationAdapter<IPath> PATH = new LocationAdapter<IPath>() { public static final LocationAdapter<IPath> PATH = new LocationAdapter<>() {
@Override @Override
public String extractName(IPath location) { public String extractName(IPath location) {
String name = location.lastSegment(); String name = location.lastSegment();
@ -68,7 +68,7 @@ abstract class LocationAdapter<T> {
} }
}; };
public static final LocationAdapter<URI> URI = new LocationAdapter<URI>() { public static final LocationAdapter<URI> URI = new LocationAdapter<>() {
@Override @Override
public String extractName(URI location) { public String extractName(URI location) {
String path = location.getPath(); String path = location.getPath();

View file

@ -78,7 +78,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
protected IEditorPart fEditor; protected IEditorPart fEditor;
protected IWorkingCopyManager fManager; protected IWorkingCopyManager fManager;
private Comparator<IDirective> directivesComparator = new Comparator<IDirective>() { private Comparator<IDirective> directivesComparator = new Comparator<>() {
@Override @Override
public int compare(IDirective o1, IDirective o2) { public int compare(IDirective o1, IDirective o2) {
return o1.toString().compareToIgnoreCase(o2.toString()); return o1.toString().compareToIgnoreCase(o2.toString());

View file

@ -422,7 +422,7 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis
/** /**
* Check if the resource is in the list of source entries. * Check if the resource is in the list of source entries.
*
* @param rc - resource to check. * @param rc - resource to check.
* @return {@code true} if the resource is a source folder, {@code false} otherwise. * @return {@code true} if the resource is a source folder, {@code false} otherwise.
* *

View file

@ -223,7 +223,7 @@ public class BuiltinSpecsDetectorTest extends BaseTestCase {
@Override @Override
protected List<String> parseOptions(final String line) { protected List<String> parseOptions(final String line) {
return new ArrayList<String>() { return new ArrayList<>() {
{ {
add(line); add(line);
} }

View file

@ -1424,7 +1424,7 @@ public class BuildDescription implements IBuildDescription {
depFiles = new IPath[1]; depFiles = new IPath[1];
depFiles[0] = new Path( depFiles[0] = new Path(
buildRc.getLocation().segment(buildRc.getLocation().segmentCount() - 1)) buildRc.getLocation().segment(buildRc.getLocation().segmentCount() - 1))
.removeFileExtension().addFileExtension("d"); //$NON-NLS-1$ .removeFileExtension().addFileExtension("d"); //$NON-NLS-1$
} }
if (depFiles != null) { if (depFiles != null) {

View file

@ -31,9 +31,6 @@ import org.eclipse.cdt.cmake.core.properties.CMakeGenerator;
import org.eclipse.cdt.cmake.core.properties.ICMakeProperties; import org.eclipse.cdt.cmake.core.properties.ICMakeProperties;
import org.eclipse.cdt.cmake.core.properties.ICMakePropertiesController; import org.eclipse.cdt.cmake.core.properties.ICMakePropertiesController;
import org.eclipse.cdt.cmake.core.properties.IOsOverrides; import org.eclipse.cdt.cmake.core.properties.IOsOverrides;
import org.eclipse.cdt.jsoncdb.core.CompileCommandsJsonParser;
import org.eclipse.cdt.jsoncdb.core.ISourceFileInfoConsumer;
import org.eclipse.cdt.jsoncdb.core.ParseRequest;
import org.eclipse.cdt.core.CommandLauncherManager; import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ConsoleOutputStream; import org.eclipse.cdt.core.ConsoleOutputStream;
import org.eclipse.cdt.core.ErrorParserManager; import org.eclipse.cdt.core.ErrorParserManager;
@ -50,6 +47,9 @@ import org.eclipse.cdt.core.model.ICModelMarker;
import org.eclipse.cdt.core.parser.ExtendedScannerInfo; import org.eclipse.cdt.core.parser.ExtendedScannerInfo;
import org.eclipse.cdt.core.parser.IScannerInfo; import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.core.resources.IConsole; import org.eclipse.cdt.core.resources.IConsole;
import org.eclipse.cdt.jsoncdb.core.CompileCommandsJsonParser;
import org.eclipse.cdt.jsoncdb.core.ISourceFileInfoConsumer;
import org.eclipse.cdt.jsoncdb.core.ParseRequest;
import org.eclipse.core.resources.IBuildConfiguration; import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;

View file

@ -4716,7 +4716,7 @@ public class AST2CPPTests extends AST2CPPTestBase {
IASTTranslationUnit tu = parse(getAboveComment(), CPP); IASTTranslationUnit tu = parse(getAboveComment(), CPP);
ICPPASTCastExpression dynamic_cast = (ICPPASTCastExpression) ((IASTEqualsInitializer) ((IASTSimpleDeclaration) ((IASTDeclarationStatement) ((IASTCompoundStatement) ((IASTFunctionDefinition) tu ICPPASTCastExpression dynamic_cast = (ICPPASTCastExpression) ((IASTEqualsInitializer) ((IASTSimpleDeclaration) ((IASTDeclarationStatement) ((IASTCompoundStatement) ((IASTFunctionDefinition) tu
.getDeclarations()[2]).getBody()).getStatements()[0]).getDeclaration()).getDeclarators()[0] .getDeclarations()[2]).getBody()).getStatements()[0]).getDeclaration()).getDeclarators()[0]
.getInitializer()).getInitializerClause(); .getInitializer()).getInitializerClause();
assertEquals(dynamic_cast.getOperator(), ICPPASTCastExpression.op_dynamic_cast); assertEquals(dynamic_cast.getOperator(), ICPPASTCastExpression.op_dynamic_cast);
} }

View file

@ -595,7 +595,7 @@ public class AST2KnRTests extends AST2TestBase {
.getParameterDeclarations()[0]).getDeclarators()[1].getName(); .getParameterDeclarations()[0]).getDeclarators()[1].getName();
IASTName list3 = ((IASTIdExpression) ((IASTArraySubscriptExpression) ((IASTUnaryExpression) ((IASTBinaryExpression) ((IASTExpressionStatement) ((IASTCompoundStatement) getinp IASTName list3 = ((IASTIdExpression) ((IASTArraySubscriptExpression) ((IASTUnaryExpression) ((IASTBinaryExpression) ((IASTExpressionStatement) ((IASTCompoundStatement) getinp
.getBody()).getStatements()[0]).getExpression()).getOperand1()).getOperand()).getArrayExpression()) .getBody()).getStatements()[0]).getExpression()).getOperand1()).getOperand()).getArrayExpression())
.getName(); .getName();
assertEquals(prompt1.resolveBinding(), prompt2.resolveBinding()); assertEquals(prompt1.resolveBinding(), prompt2.resolveBinding());
assertEquals(list1.resolveBinding(), list2.resolveBinding()); assertEquals(list1.resolveBinding(), list2.resolveBinding());
@ -673,10 +673,10 @@ public class AST2KnRTests extends AST2TestBase {
.getParameterDeclarations()[0]).getDeclarators()[0].getName(); .getParameterDeclarations()[0]).getDeclarators()[0].getName();
IASTName lemp_name3 = ((IASTIdExpression) ((IASTFieldReference) ((IASTArraySubscriptExpression) ((IASTFieldReference) ((IASTBinaryExpression) ((IASTExpressionStatement) ((IASTCompoundStatement) f_def IASTName lemp_name3 = ((IASTIdExpression) ((IASTFieldReference) ((IASTArraySubscriptExpression) ((IASTFieldReference) ((IASTBinaryExpression) ((IASTExpressionStatement) ((IASTCompoundStatement) f_def
.getBody()).getStatements()[0]).getExpression()).getOperand1()).getFieldOwner()).getArrayExpression()) .getBody()).getStatements()[0]).getExpression()).getOperand1()).getFieldOwner()).getArrayExpression())
.getFieldOwner()).getName(); .getFieldOwner()).getName();
IASTName symbols_name2 = ((IASTFieldReference) ((IASTArraySubscriptExpression) ((IASTFieldReference) ((IASTBinaryExpression) ((IASTExpressionStatement) ((IASTCompoundStatement) f_def IASTName symbols_name2 = ((IASTFieldReference) ((IASTArraySubscriptExpression) ((IASTFieldReference) ((IASTBinaryExpression) ((IASTExpressionStatement) ((IASTCompoundStatement) f_def
.getBody()).getStatements()[0]).getExpression()).getOperand1()).getFieldOwner()).getArrayExpression()) .getBody()).getStatements()[0]).getExpression()).getOperand1()).getFieldOwner()).getArrayExpression())
.getFieldName(); .getFieldName();
IASTName lambda_name2 = ((IASTFieldReference) ((IASTBinaryExpression) ((IASTExpressionStatement) ((IASTCompoundStatement) f_def IASTName lambda_name2 = ((IASTFieldReference) ((IASTBinaryExpression) ((IASTExpressionStatement) ((IASTCompoundStatement) f_def
.getBody()).getStatements()[0]).getExpression()).getOperand1()).getFieldName(); .getBody()).getStatements()[0]).getExpression()).getOperand1()).getFieldName();

View file

@ -2533,7 +2533,7 @@ public class AST2Tests extends AST2TestBase {
public void testBug80978() throws Exception { public void testBug80978() throws Exception {
ICASTArrayModifier mod = (ICASTArrayModifier) ((IASTArrayDeclarator) ((IASTStandardFunctionDeclarator) ((IASTSimpleDeclaration) parse( ICASTArrayModifier mod = (ICASTArrayModifier) ((IASTArrayDeclarator) ((IASTStandardFunctionDeclarator) ((IASTSimpleDeclaration) parse(
getAboveComment(), C).getDeclarations()[0]).getDeclarators()[0]).getParameters()[0].getDeclarator()) getAboveComment(), C).getDeclarations()[0]).getDeclarators()[0]).getParameters()[0].getDeclarator())
.getArrayModifiers()[0]; .getArrayModifiers()[0];
assertTrue(mod.isConst()); assertTrue(mod.isConst());
assertTrue(mod.isVariableSized()); assertTrue(mod.isVariableSized());
assertFalse(mod.isStatic()); assertFalse(mod.isStatic());
@ -2846,7 +2846,7 @@ public class AST2Tests extends AST2TestBase {
public void testBug84250() throws Exception { public void testBug84250() throws Exception {
assertTrue(((IASTDeclarationStatement) ((IASTCompoundStatement) ((IASTFunctionDefinition) parse( assertTrue(((IASTDeclarationStatement) ((IASTCompoundStatement) ((IASTFunctionDefinition) parse(
"void f() { int (*p) [2]; }", C).getDeclarations()[0]).getBody()).getStatements()[0]) //$NON-NLS-1$ "void f() { int (*p) [2]; }", C).getDeclarations()[0]).getBody()).getStatements()[0]) //$NON-NLS-1$
.getDeclaration() instanceof IASTSimpleDeclaration); .getDeclaration() instanceof IASTSimpleDeclaration);
} }
// struct s1 { struct s2 *s2p; /* ... */ }; // D1 // struct s1 { struct s2 *s2p; /* ... */ }; // D1

View file

@ -48,7 +48,7 @@ import junit.framework.Test;
* @author Vivian Kong * @author Vivian Kong
*/ */
public class PDOMSearchTest extends PDOMTestBase { public class PDOMSearchTest extends PDOMTestBase {
final Comparator<IBinding> BINDING_COMPARATOR = new Comparator<IBinding>() { final Comparator<IBinding> BINDING_COMPARATOR = new Comparator<>() {
@Override @Override
public int compare(IBinding b1, IBinding b2) { public int compare(IBinding b1, IBinding b2) {
return b1.getName().compareTo(b2.getName()); return b1.getName().compareTo(b2.getName());

View file

@ -34,7 +34,7 @@ public class ReferencedProjectsLanguageSettingsProvider extends LanguageSettings
/** ID of the provider used in extension point from plugin.xml */ /** ID of the provider used in extension point from plugin.xml */
public static final String ID = "org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider"; //$NON-NLS-1$ public static final String ID = "org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider"; //$NON-NLS-1$
final private ThreadLocal<Boolean> recursiveCallIndicator = new ThreadLocal<Boolean>() { final private ThreadLocal<Boolean> recursiveCallIndicator = new ThreadLocal<>() {
@Override @Override
protected Boolean initialValue() { protected Boolean initialValue() {
return false; return false;

View file

@ -70,7 +70,7 @@ public abstract class AbstractCProjectDescriptionStorage {
protected volatile IProject project; protected volatile IProject project;
/** Flag used to detect if setProjectDescription(...) is called by the thread already in a setProjectDescription(...) */ /** Flag used to detect if setProjectDescription(...) is called by the thread already in a setProjectDescription(...) */
final private ThreadLocal<Boolean> setProjectDescriptionOperationRunning = new ThreadLocal<Boolean>() { final private ThreadLocal<Boolean> setProjectDescriptionOperationRunning = new ThreadLocal<>() {
@Override @Override
protected Boolean initialValue() { protected Boolean initialValue() {
return false; return false;

View file

@ -822,7 +822,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
} }
/** ThreadLocal flag to let CDescriptor know whether already in a setProjectDescription */ /** ThreadLocal flag to let CDescriptor know whether already in a setProjectDescription */
ThreadLocal<Boolean> settingProjectDescription = new ThreadLocal<Boolean>() { ThreadLocal<Boolean> settingProjectDescription = new ThreadLocal<>() {
@Override @Override
protected Boolean initialValue() { protected Boolean initialValue() {
return false; return false;

View file

@ -89,7 +89,7 @@ public class ASTTypeUtil {
// sizes of type strings from getting out of control for certain code patterns. // sizes of type strings from getting out of control for certain code patterns.
private static final int TYPE_STRING_LENGTH_THRESHOLD = 100000; private static final int TYPE_STRING_LENGTH_THRESHOLD = 100000;
private static final ThreadLocal<Set<IBinding>> fSourceFileOnlyCheckInProgress = new ThreadLocal<Set<IBinding>>() { private static final ThreadLocal<Set<IBinding>> fSourceFileOnlyCheckInProgress = new ThreadLocal<>() {
@Override @Override
protected Set<IBinding> initialValue() { protected Set<IBinding> initialValue() {
return new HashSet<>(); return new HashSet<>();

View file

@ -33,7 +33,7 @@ public class CharArrayObjectMap<T> extends CharTable {
/** /**
* An empty immutable {@code CharArrayObjectMap}. * An empty immutable {@code CharArrayObjectMap}.
*/ */
public static final CharArrayObjectMap<?> EMPTY_MAP = new CharArrayObjectMap<Object>(0) { public static final CharArrayObjectMap<?> EMPTY_MAP = new CharArrayObjectMap<>(0) {
@Override @Override
public Object clone() { public Object clone() {
return this; return this;

View file

@ -41,7 +41,7 @@ public final class CollectionUtils {
* @throws NullPointerException if list is {@code null} * @throws NullPointerException if list is {@code null}
*/ */
public static <T> Iterator<T> reverseIterator(final List<T> list) { public static <T> Iterator<T> reverseIterator(final List<T> list) {
return new Iterator<T>() { return new Iterator<>() {
ListIterator<T> iterator = list.listIterator(list.size()); ListIterator<T> iterator = list.listIterator(list.size());
@Override @Override
@ -93,7 +93,7 @@ public final class CollectionUtils {
if (iter == null) if (iter == null)
throw new NullPointerException("iter parameter is null"); //$NON-NLS-1$ throw new NullPointerException("iter parameter is null"); //$NON-NLS-1$
return new Iterable<T>() { return new Iterable<>() {
@Override @Override
public Iterator<T> iterator() { public Iterator<T> iterator() {
return iter; return iter;

View file

@ -174,7 +174,7 @@ public abstract class ObjectTable<T> extends HashTable implements Iterable<T> {
*/ */
@Override @Override
public Iterator<T> iterator() { public Iterator<T> iterator() {
return new Iterator<T>() { return new Iterator<>() {
int nextIndex; int nextIndex;
@Override @Override

View file

@ -95,13 +95,13 @@ public abstract class ASTTranslationUnit extends ASTNode implements IASTTranslat
private IBuiltinBindingsProvider fBuiltinBindingsProvider; private IBuiltinBindingsProvider fBuiltinBindingsProvider;
// Caches // Caches
private final ThreadLocal<WeakHashMap<IType, String>> fUnnormalizedTypeStringCache = new ThreadLocal<WeakHashMap<IType, String>>() { private final ThreadLocal<WeakHashMap<IType, String>> fUnnormalizedTypeStringCache = new ThreadLocal<>() {
@Override @Override
protected WeakHashMap<IType, String> initialValue() { protected WeakHashMap<IType, String> initialValue() {
return new WeakHashMap<>(); return new WeakHashMap<>();
} }
}; };
private final ThreadLocal<WeakHashMap<IType, String>> fNormalizedTypeStringCache = new ThreadLocal<WeakHashMap<IType, String>>() { private final ThreadLocal<WeakHashMap<IType, String>> fNormalizedTypeStringCache = new ThreadLocal<>() {
@Override @Override
protected WeakHashMap<IType, String> initialValue() { protected WeakHashMap<IType, String> initialValue() {
return new WeakHashMap<>(); return new WeakHashMap<>();

View file

@ -160,7 +160,7 @@ public final class CompositeValue implements IValue {
// The set of class types for which composite value creation is in progress on each thread. // The set of class types for which composite value creation is in progress on each thread.
// Used to guard against infinite recursion due to a class (illegally) aggregating itself. // Used to guard against infinite recursion due to a class (illegally) aggregating itself.
private static final ThreadLocal<Set<ICPPClassType>> fCreateInProgress = new ThreadLocal<Set<ICPPClassType>>() { private static final ThreadLocal<Set<ICPPClassType>> fCreateInProgress = new ThreadLocal<>() {
@Override @Override
protected Set<ICPPClassType> initialValue() { protected Set<ICPPClassType> initialValue() {
return new TreeSet<>((type1, type2) -> { return new TreeSet<>((type1, type2) -> {

View file

@ -51,7 +51,7 @@ public class CVariable extends PlatformObject implements ICInternalBinding, IVar
* The set of CVariable objects for which initial value computation is in progress on each thread. * The set of CVariable objects for which initial value computation is in progress on each thread.
* This is used to guard against recursion during initial value computation. * This is used to guard against recursion during initial value computation.
*/ */
private static final ThreadLocal<Set<CVariable>> fInitialValueInProgress = new ThreadLocal<Set<CVariable>>() { private static final ThreadLocal<Set<CVariable>> fInitialValueInProgress = new ThreadLocal<>() {
@Override @Override
protected Set<CVariable> initialValue() { protected Set<CVariable> initialValue() {
return new HashSet<>(); return new HashSet<>();

View file

@ -54,7 +54,7 @@ public class AbstractCPPClassSpecializationScope implements ICPPClassSpecializat
// The following fields are used by the PDOM bindings and need to be volatile. // The following fields are used by the PDOM bindings and need to be volatile.
private volatile ICPPBase[] fBases; private volatile ICPPBase[] fBases;
private volatile ICPPMethod[] ownInheritedConstructors; private volatile ICPPMethod[] ownInheritedConstructors;
private final ThreadLocal<Boolean> fComputingBases = new ThreadLocal<Boolean>() { private final ThreadLocal<Boolean> fComputingBases = new ThreadLocal<>() {
@Override @Override
protected Boolean initialValue() { protected Boolean initialValue() {
return false; return false;

View file

@ -190,7 +190,7 @@ public class CPPClassSpecialization extends CPPSpecialization
private ICPPClassSpecializationScope specScope; private ICPPClassSpecializationScope specScope;
private ObjectMap specializationMap = ObjectMap.EMPTY_MAP; private ObjectMap specializationMap = ObjectMap.EMPTY_MAP;
private ICPPBase[] bases; private ICPPBase[] bases;
private final ThreadLocal<Set<IBinding>> fInProgress = new ThreadLocal<Set<IBinding>>() { private final ThreadLocal<Set<IBinding>> fInProgress = new ThreadLocal<>() {
@Override @Override
protected Set<IBinding> initialValue() { protected Set<IBinding> initialValue() {
return new HashSet<>(); return new HashSet<>();

View file

@ -69,7 +69,7 @@ public class CPPVariable extends PlatformObject implements ICPPInternalDeclaredV
* The set of CPPVariable objects for which initial value computation is in progress on each thread. * The set of CPPVariable objects for which initial value computation is in progress on each thread.
* This is used to guard against recursion during initial value computation. * This is used to guard against recursion during initial value computation.
*/ */
private static final ThreadLocal<Set<CPPVariable>> fInitialValueInProgress = new ThreadLocal<Set<CPPVariable>>() { private static final ThreadLocal<Set<CPPVariable>> fInitialValueInProgress = new ThreadLocal<>() {
@Override @Override
protected Set<CPPVariable> initialValue() { protected Set<CPPVariable> initialValue() {
return new HashSet<>(); return new HashSet<>();

View file

@ -299,14 +299,14 @@ public class CPPSemantics {
// that are not reachable via includes from the file containing the name. // that are not reachable via includes from the file containing the name.
// Generally this is not allowed, but certain consumers, such as IncludeOrganizer, // Generally this is not allowed, but certain consumers, such as IncludeOrganizer,
// need it (since the whole point of IncludeOrganizer is to find missing headers). // need it (since the whole point of IncludeOrganizer is to find missing headers).
private static final ThreadLocal<Boolean> fAllowPromiscuousBindingResolution = new ThreadLocal<Boolean>() { private static final ThreadLocal<Boolean> fAllowPromiscuousBindingResolution = new ThreadLocal<>() {
@Override @Override
protected Boolean initialValue() { protected Boolean initialValue() {
return false; return false;
} }
}; };
private static final ThreadLocal<Deque<IASTNode>> fLookupPoints = new ThreadLocal<Deque<IASTNode>>() { private static final ThreadLocal<Deque<IASTNode>> fLookupPoints = new ThreadLocal<>() {
@Override @Override
protected Deque<IASTNode> initialValue() { protected Deque<IASTNode> initialValue() {
return new ArrayDeque<>(); return new ArrayDeque<>();

View file

@ -239,13 +239,13 @@ public class CPPTemplates {
// Infrastructure to protect against rogue template metaprograms that don't terminate. // Infrastructure to protect against rogue template metaprograms that don't terminate.
private static final int TEMPLATE_INSTANTIATION_DEPTH_LIMIT = 128; private static final int TEMPLATE_INSTANTIATION_DEPTH_LIMIT = 128;
private static final ThreadLocal<Integer> fTemplateInstantiationDepth = new ThreadLocal<Integer>() { private static final ThreadLocal<Integer> fTemplateInstantiationDepth = new ThreadLocal<>() {
@Override @Override
protected Integer initialValue() { protected Integer initialValue() {
return 0; return 0;
} }
}; };
private static final ThreadLocal<Set<TypeInstantiationRequest>> instantiationsInProgress = new ThreadLocal<Set<TypeInstantiationRequest>>() { private static final ThreadLocal<Set<TypeInstantiationRequest>> instantiationsInProgress = new ThreadLocal<>() {
@Override @Override
protected Set<TypeInstantiationRequest> initialValue() { protected Set<TypeInstantiationRequest> initialValue() {
return new HashSet<>(); return new HashSet<>();

View file

@ -279,7 +279,7 @@ public class CPPVisitor extends ASTQueries {
// Thread-local set of declarators for which auto types are being created. // Thread-local set of declarators for which auto types are being created.
// Used to prevent infinite recursion while processing invalid self-referencing // Used to prevent infinite recursion while processing invalid self-referencing
// auto-type declarations. // auto-type declarations.
private static final ThreadLocal<Set<IASTDeclarator>> autoTypeDeclarators = new ThreadLocal<Set<IASTDeclarator>>() { private static final ThreadLocal<Set<IASTDeclarator>> autoTypeDeclarators = new ThreadLocal<>() {
@Override @Override
protected Set<IASTDeclarator> initialValue() { protected Set<IASTDeclarator> initialValue() {
return new HashSet<>(); return new HashSet<>();

View file

@ -39,7 +39,7 @@ public class EvalUtil {
* The set of ICPPVariable objects for which initial value computation is in progress on each thread. * The set of ICPPVariable objects for which initial value computation is in progress on each thread.
* This is used to guard against recursion during initial value computation. * This is used to guard against recursion during initial value computation.
*/ */
private static final ThreadLocal<Set<ICPPVariable>> fInitialValueInProgress = new ThreadLocal<Set<ICPPVariable>>() { private static final ThreadLocal<Set<ICPPVariable>> fInitialValueInProgress = new ThreadLocal<>() {
@Override @Override
protected Set<ICPPVariable> initialValue() { protected Set<ICPPVariable> initialValue() {
return new HashSet<>(); return new HashSet<>();

View file

@ -45,7 +45,7 @@ import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
public class CompositeCPPClassSpecialization extends CompositeCPPClassType implements ICPPClassSpecialization { public class CompositeCPPClassSpecialization extends CompositeCPPClassType implements ICPPClassSpecialization {
private ObjectMap specializationMap; private ObjectMap specializationMap;
private final ThreadLocal<Set<IBinding>> fInProgress = new ThreadLocal<Set<IBinding>>() { private final ThreadLocal<Set<IBinding>> fInProgress = new ThreadLocal<>() {
@Override @Override
protected Set<IBinding> initialValue() { protected Set<IBinding> initialValue() {
return new HashSet<>(); return new HashSet<>();

View file

@ -33,7 +33,7 @@ import org.eclipse.cdt.core.parser.util.CharArrayUtils;
public class SignificantMacros implements ISignificantMacros { public class SignificantMacros implements ISignificantMacros {
public static final char[] DEFINED = { 0 }; public static final char[] DEFINED = { 0 };
public static final char[] UNDEFINED = { 1 }; public static final char[] UNDEFINED = { 1 };
private static final Comparator<char[]> SORTER = new Comparator<char[]>() { private static final Comparator<char[]> SORTER = new Comparator<>() {
@Override @Override
public int compare(char[] s1, char[] s2) { public int compare(char[] s1, char[] s2) {
return CharArrayUtils.compare(s1, s2); return CharArrayUtils.compare(s1, s2);

View file

@ -137,7 +137,7 @@ public class Profiler {
Profiler profiler = threadProfiler.get(); Profiler profiler = threadProfiler.get();
if (profiler != null) { if (profiler != null) {
List<Map.Entry<String, Timer>> list = new ArrayList<>(profiler.timers.entrySet()); List<Map.Entry<String, Timer>> list = new ArrayList<>(profiler.timers.entrySet());
Comparator<Map.Entry<String, Timer>> c = new Comparator<Map.Entry<String, Timer>>() { Comparator<Map.Entry<String, Timer>> c = new Comparator<>() {
@Override @Override
public int compare(Entry<String, Timer> o1, Entry<String, Timer> o2) { public int compare(Entry<String, Timer> o1, Entry<String, Timer> o2) {
long diff = o2.getValue().getElapsedTime() - o1.getValue().getElapsedTime(); long diff = o2.getValue().getElapsedTime() - o1.getValue().getElapsedTime();
@ -153,7 +153,7 @@ public class Profiler {
if (!profiler.counters.isEmpty()) { if (!profiler.counters.isEmpty()) {
List<Map.Entry<String, int[]>> keyList = new ArrayList<>(profiler.counters.entrySet()); List<Map.Entry<String, int[]>> keyList = new ArrayList<>(profiler.counters.entrySet());
Comparator<Map.Entry<String, int[]>> c2 = new Comparator<Map.Entry<String, int[]>>() { Comparator<Map.Entry<String, int[]>> c2 = new Comparator<>() {
@Override @Override
public int compare(Entry<String, int[]> o1, Entry<String, int[]> o2) { public int compare(Entry<String, int[]> o1, Entry<String, int[]> o2) {
return o2.getValue()[0] - o1.getValue()[0]; return o2.getValue()[0] - o1.getValue()[0];

View file

@ -42,7 +42,7 @@ public class CModelListener implements IElementChangedListener, IResourceChangeL
public static boolean sSuppressUpdateOfLastRecentlyUsed = false; public static boolean sSuppressUpdateOfLastRecentlyUsed = false;
private PDOMManager fManager; private PDOMManager fManager;
private final LinkedHashMap<ITranslationUnit, ITranslationUnit> fLRUs = new LinkedHashMap<ITranslationUnit, ITranslationUnit>( private final LinkedHashMap<ITranslationUnit, ITranslationUnit> fLRUs = new LinkedHashMap<>(
UPDATE_LR_CHANGED_FILES_COUNT, 0.75f, true) { UPDATE_LR_CHANGED_FILES_COUNT, 0.75f, true) {
@Override @Override
protected boolean removeEldestEntry(Map.Entry<ITranslationUnit, ITranslationUnit> eldest) { protected boolean removeEldestEntry(Map.Entry<ITranslationUnit, ITranslationUnit> eldest) {

View file

@ -87,7 +87,7 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage
* The set of types currently being loaded from the index on each thread, represented as record numbers. * The set of types currently being loaded from the index on each thread, represented as record numbers.
* This is used to guard against infinite recursion while loading types. * This is used to guard against infinite recursion while loading types.
*/ */
private static final ThreadLocal<Set<Long>> fLoadTypeInProgress = new ThreadLocal<Set<Long>>() { private static final ThreadLocal<Set<Long>> fLoadTypeInProgress = new ThreadLocal<>() {
@Override @Override
protected Set<Long> initialValue() { protected Set<Long> initialValue() {
return new HashSet<>(); return new HashSet<>();

View file

@ -76,7 +76,7 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization
private volatile ICPPClassScope fScope; private volatile ICPPClassScope fScope;
private ObjectMap specializationMap; // Obtained from the synchronized PDOM cache. private ObjectMap specializationMap; // Obtained from the synchronized PDOM cache.
private final ThreadLocal<Set<IBinding>> fInProgress = new ThreadLocal<Set<IBinding>>() { private final ThreadLocal<Set<IBinding>> fInProgress = new ThreadLocal<>() {
@Override @Override
protected Set<IBinding> initialValue() { protected Set<IBinding> initialValue() {
return new HashSet<>(); return new HashSet<>();

View file

@ -18,10 +18,10 @@ import org.eclipse.cdt.core.cdtvariables.CdtVariable;
import org.eclipse.cdt.core.cdtvariables.ICdtVariable; import org.eclipse.cdt.core.cdtvariables.ICdtVariable;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Bundle; import org.osgi.framework.Bundle;
/** /**

View file

@ -35,7 +35,7 @@ abstract class LocationAdapter<T> {
public abstract T getLocation(IFile file); public abstract T getLocation(IFile file);
public static final LocationAdapter<IPath> PATH = new LocationAdapter<IPath>() { public static final LocationAdapter<IPath> PATH = new LocationAdapter<>() {
@Override @Override
public String extractName(IPath location) { public String extractName(IPath location) {
String name = location.lastSegment(); String name = location.lastSegment();
@ -61,7 +61,7 @@ abstract class LocationAdapter<T> {
} }
}; };
public static final LocationAdapter<URI> URI = new LocationAdapter<URI>() { public static final LocationAdapter<URI> URI = new LocationAdapter<>() {
@Override @Override
public String extractName(URI location) { public String extractName(URI location) {
String path = location.getPath(); String path = location.getPath();

View file

@ -46,7 +46,7 @@ public class TemplateCore {
private static Map<TemplateInfo, TemplateCore> templateCache = new HashMap<>(); private static Map<TemplateInfo, TemplateCore> templateCache = new HashMap<>();
public static final Comparator<TemplateCore> TEMPLATE_ID_CASE_INSENSITIVE_COMPARATOR = new Comparator<TemplateCore>() { public static final Comparator<TemplateCore> TEMPLATE_ID_CASE_INSENSITIVE_COMPARATOR = new Comparator<>() {
@Override @Override
public int compare(TemplateCore t1, TemplateCore t2) { public int compare(TemplateCore t1, TemplateCore t2) {
return String.CASE_INSENSITIVE_ORDER.compare(t1.getTemplateId(), t2.getTemplateId()); return String.CASE_INSENSITIVE_ORDER.compare(t1.getTemplateId(), t2.getTemplateId());

View file

@ -563,7 +563,7 @@ public class RemoveUnusedDeclarationsRefactoring extends CRefactoring {
* in the reverse order. * in the reverse order.
*/ */
private static class SortedNodeSet<T extends IASTNode> extends TreeSet<T> { private static class SortedNodeSet<T extends IASTNode> extends TreeSet<T> {
private static final Comparator<IASTNode> COMPARATOR = new Comparator<IASTNode>() { private static final Comparator<IASTNode> COMPARATOR = new Comparator<>() {
@Override @Override
public int compare(IASTNode node1, IASTNode node2) { public int compare(IASTNode node1, IASTNode node2) {
int c = Integer.compare(ASTNodes.offset(node1), ASTNodes.offset(node2)); int c = Integer.compare(ASTNodes.offset(node1), ASTNodes.offset(node2));

View file

@ -49,7 +49,7 @@ public class LinkedProposalModel {
public Iterator<LinkedProposalPositionGroup> getPositionGroupIterator() { public Iterator<LinkedProposalPositionGroup> getPositionGroupIterator() {
if (fPositionGroups == null) { if (fPositionGroups == null) {
return new Iterator<LinkedProposalPositionGroup>() { return new Iterator<>() {
@Override @Override
public boolean hasNext() { public boolean hasNext() {
return false; return false;

View file

@ -131,7 +131,7 @@ public class CreateParserLogAction implements IObjectActionDelegate {
} }
} }
private static final Comparator<String> COMP_INSENSITIVE = new Comparator<String>() { private static final Comparator<String> COMP_INSENSITIVE = new Comparator<>() {
@Override @Override
public int compare(String o1, String o2) { public int compare(String o1, String o2) {
return o1.toUpperCase().compareTo(o2.toUpperCase()); return o1.toUpperCase().compareTo(o2.toUpperCase());

View file

@ -51,7 +51,7 @@ public class CHHistoryListAction extends Action {
setTitle(CHMessages.CHHistoryListAction_HistoryDialog_title); setTitle(CHMessages.CHHistoryListAction_HistoryDialog_title);
String[] buttonLabels = new String[] { CHMessages.CHHistoryListAction_Remove_label, }; String[] buttonLabels = new String[] { CHMessages.CHHistoryListAction_Remove_label, };
IListAdapter<ICElement> adapter = new IListAdapter<ICElement>() { IListAdapter<ICElement> adapter = new IListAdapter<>() {
@Override @Override
public void customButtonPressed(ListDialogField<ICElement> field, int index) { public void customButtonPressed(ListDialogField<ICElement> field, int index) {
doCustomButtonPressed(); doCustomButtonPressed();

View file

@ -16,7 +16,7 @@ package org.eclipse.cdt.internal.ui.callhierarchy;
import java.util.Comparator; import java.util.Comparator;
public class CHReferenceInfo { public class CHReferenceInfo {
public static final Comparator<CHReferenceInfo> COMPARE_OFFSET = new Comparator<CHReferenceInfo>() { public static final Comparator<CHReferenceInfo> COMPARE_OFFSET = new Comparator<>() {
@Override @Override
public int compare(CHReferenceInfo r1, CHReferenceInfo r2) { public int compare(CHReferenceInfo r1, CHReferenceInfo r2) {
return r1.fOffset - r2.fOffset; return r1.fOffset - r2.fOffset;

View file

@ -171,7 +171,7 @@ public class CPathIncludeSymbolEntryPage extends CPathIncludeSymbolEntryBasePage
super(CPathEntryMessages.IncludeSymbolEntryPage_title); super(CPathEntryMessages.IncludeSymbolEntryPage_title);
fContext = context; fContext = context;
IncludeSymbolAdapter adapter = new IncludeSymbolAdapter(); IncludeSymbolAdapter adapter = new IncludeSymbolAdapter();
fIncludeSymPathsList = new TreeListDialogField<CPElementGroup>(adapter, buttonLabel, fIncludeSymPathsList = new TreeListDialogField<>(adapter, buttonLabel,
new CPElementLabelProvider(true, false)) { new CPElementLabelProvider(true, false)) {
@Override @Override

View file

@ -218,7 +218,7 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB
super(CPathEntryMessages.IncludeSymbolEntryPage_title); super(CPathEntryMessages.IncludeSymbolEntryPage_title);
fContext = context; fContext = context;
IncludeSymbolAdapter adapter = new IncludeSymbolAdapter(); IncludeSymbolAdapter adapter = new IncludeSymbolAdapter();
fIncludeSymPathsList = new TreeListDialogField<CPElementGroup>(adapter, buttonLabel, fIncludeSymPathsList = new TreeListDialogField<>(adapter, buttonLabel,
new CPElementLabelProvider(true, false)) { new CPElementLabelProvider(true, false)) {
@Override @Override

View file

@ -52,7 +52,7 @@ public class IBHistoryListAction extends Action {
setTitle(IBMessages.IBHistoryListAction_HistoryDialog_title); setTitle(IBMessages.IBHistoryListAction_HistoryDialog_title);
String[] buttonLabels = new String[] { IBMessages.IBHistoryListAction_Remove_label, }; String[] buttonLabels = new String[] { IBMessages.IBHistoryListAction_Remove_label, };
IListAdapter<ITranslationUnit> adapter = new IListAdapter<ITranslationUnit>() { IListAdapter<ITranslationUnit> adapter = new IListAdapter<>() {
@Override @Override
public void customButtonPressed(ListDialogField<ITranslationUnit> field, int index) { public void customButtonPressed(ListDialogField<ITranslationUnit> field, int index) {
doCustomButtonPressed(); doCustomButtonPressed();

View file

@ -158,7 +158,7 @@ final class CodeAssistAdvancedConfigurationBlock extends OptionsConfigurationBlo
} }
} }
private final Comparator<ModelElement> fCategoryComparator = new Comparator<ModelElement>() { private final Comparator<ModelElement> fCategoryComparator = new Comparator<>() {
@Override @Override
public int compare(ModelElement o1, ModelElement o2) { public int compare(ModelElement o1, ModelElement o2) {
return o1.getRank() - o2.getRank(); return o1.getRank() - o2.getRank();

View file

@ -80,7 +80,7 @@ public class HeaderSubstitutionMapEditDialog extends ResizableStatusDialog {
private static final String UTF_8 = "UTF-8"; //$NON-NLS-1$ private static final String UTF_8 = "UTF-8"; //$NON-NLS-1$
private static final String TAG_HEADER_SUBSTITUTION_MAP = "header_substitution_map"; //$NON-NLS-1$ private static final String TAG_HEADER_SUBSTITUTION_MAP = "header_substitution_map"; //$NON-NLS-1$
private static final Collator COLLATOR = Collator.getInstance(); private static final Collator COLLATOR = Collator.getInstance();
private static final Comparator<HeaderSubstitutionRule> SOURCE_COMPARATOR = new Comparator<HeaderSubstitutionRule>() { private static final Comparator<HeaderSubstitutionRule> SOURCE_COMPARATOR = new Comparator<>() {
@Override @Override
public int compare(HeaderSubstitutionRule r1, HeaderSubstitutionRule r2) { public int compare(HeaderSubstitutionRule r1, HeaderSubstitutionRule r2) {
return COLLATOR.compare(r1.getSource(), r2.getSource()); return COLLATOR.compare(r1.getSource(), r2.getSource());

View file

@ -160,53 +160,50 @@ public class NameStyleBlock extends OptionsConfigurationBlock {
Category codeCategory = new Category(PreferencesMessages.NameStyleBlock_code_node); Category codeCategory = new Category(PreferencesMessages.NameStyleBlock_code_node);
new Category(PreferencesMessages.NameStyleBlock_constant_node, new Category(PreferencesMessages.NameStyleBlock_constant_node,
PreferencesMessages.NameStyleBlock_constant_node_description, EXAMPLE_CONSTANT_NAME, codeCategory) PreferencesMessages.NameStyleBlock_constant_node_description, EXAMPLE_CONSTANT_NAME, codeCategory)
.setCapitalizationKey(KEY_CONSTANT_CAPITALIZATION) .setCapitalizationKey(KEY_CONSTANT_CAPITALIZATION).setWordDelimiterKey(KEY_CONSTANT_WORD_DELIMITER)
.setWordDelimiterKey(KEY_CONSTANT_WORD_DELIMITER).setPrefixKey(KEY_CONSTANT_PREFIX) .setPrefixKey(KEY_CONSTANT_PREFIX).setSuffixKey(KEY_CONSTANT_SUFFIX)
.setSuffixKey(KEY_CONSTANT_SUFFIX).setNameValidator(IDENTIFIER_VALIDATOR); .setNameValidator(IDENTIFIER_VALIDATOR);
new Category(PreferencesMessages.NameStyleBlock_variable_node, new Category(PreferencesMessages.NameStyleBlock_variable_node,
PreferencesMessages.NameStyleBlock_variable_node_description, EXAMPLE_VARIABLE_NAME, codeCategory) PreferencesMessages.NameStyleBlock_variable_node_description, EXAMPLE_VARIABLE_NAME, codeCategory)
.setCapitalizationKey(KEY_VARIABLE_CAPITALIZATION) .setCapitalizationKey(KEY_VARIABLE_CAPITALIZATION).setWordDelimiterKey(KEY_VARIABLE_WORD_DELIMITER)
.setWordDelimiterKey(KEY_VARIABLE_WORD_DELIMITER).setPrefixKey(KEY_VARIABLE_PREFIX) .setPrefixKey(KEY_VARIABLE_PREFIX).setSuffixKey(KEY_VARIABLE_SUFFIX)
.setSuffixKey(KEY_VARIABLE_SUFFIX).setNameValidator(IDENTIFIER_VALIDATOR); .setNameValidator(IDENTIFIER_VALIDATOR);
Category fieldCategory = new Category(PreferencesMessages.NameStyleBlock_field_node, Category fieldCategory = new Category(PreferencesMessages.NameStyleBlock_field_node,
PreferencesMessages.NameStyleBlock_field_node_description, EXAMPLE_FIELD_NAME, codeCategory) PreferencesMessages.NameStyleBlock_field_node_description, EXAMPLE_FIELD_NAME, codeCategory)
.setCapitalizationKey(KEY_FIELD_CAPITALIZATION).setWordDelimiterKey(KEY_FIELD_WORD_DELIMITER) .setCapitalizationKey(KEY_FIELD_CAPITALIZATION).setWordDelimiterKey(KEY_FIELD_WORD_DELIMITER)
.setPrefixKey(KEY_FIELD_PREFIX).setSuffixKey(KEY_FIELD_SUFFIX) .setPrefixKey(KEY_FIELD_PREFIX).setSuffixKey(KEY_FIELD_SUFFIX).setNameValidator(IDENTIFIER_VALIDATOR);
.setNameValidator(IDENTIFIER_VALIDATOR);
new Category(PreferencesMessages.NameStyleBlock_method_node, new Category(PreferencesMessages.NameStyleBlock_method_node,
PreferencesMessages.NameStyleBlock_method_node_description, EXAMPLE_METHOD_NAME, codeCategory) PreferencesMessages.NameStyleBlock_method_node_description, EXAMPLE_METHOD_NAME, codeCategory)
.setCapitalizationKey(KEY_METHOD_CAPITALIZATION).setWordDelimiterKey(KEY_METHOD_WORD_DELIMITER) .setCapitalizationKey(KEY_METHOD_CAPITALIZATION).setWordDelimiterKey(KEY_METHOD_WORD_DELIMITER)
.setPrefixKey(KEY_METHOD_PREFIX).setSuffixKey(KEY_METHOD_SUFFIX) .setPrefixKey(KEY_METHOD_PREFIX).setSuffixKey(KEY_METHOD_SUFFIX).setNameValidator(IDENTIFIER_VALIDATOR);
.setNameValidator(IDENTIFIER_VALIDATOR);
new Category(PreferencesMessages.NameStyleBlock_getter_node, new Category(PreferencesMessages.NameStyleBlock_getter_node,
PreferencesMessages.NameStyleBlock_getter_node_description, EXAMPLE_FIELD_NAME, codeCategory) PreferencesMessages.NameStyleBlock_getter_node_description, EXAMPLE_FIELD_NAME, codeCategory)
.setCapitalizationKey(KEY_GETTER_CAPITALIZATION).setWordDelimiterKey(KEY_GETTER_WORD_DELIMITER) .setCapitalizationKey(KEY_GETTER_CAPITALIZATION).setWordDelimiterKey(KEY_GETTER_WORD_DELIMITER)
.setPrefixKey(KEY_GETTER_PREFIX).setAlternativePrefixKey(KEY_GETTER_PREFIX_FOR_BOOLEAN) .setPrefixKey(KEY_GETTER_PREFIX).setAlternativePrefixKey(KEY_GETTER_PREFIX_FOR_BOOLEAN)
.setSuffixKey(KEY_GETTER_SUFFIX).setSeedNameGenerator(fieldCategory) .setSuffixKey(KEY_GETTER_SUFFIX).setSeedNameGenerator(fieldCategory)
.setNameValidator(IDENTIFIER_VALIDATOR).setTrimFieldName(true); .setNameValidator(IDENTIFIER_VALIDATOR).setTrimFieldName(true);
new Category(PreferencesMessages.NameStyleBlock_setter_node, new Category(PreferencesMessages.NameStyleBlock_setter_node,
PreferencesMessages.NameStyleBlock_setter_node_description, EXAMPLE_FIELD_NAME, codeCategory) PreferencesMessages.NameStyleBlock_setter_node_description, EXAMPLE_FIELD_NAME, codeCategory)
.setCapitalizationKey(KEY_SETTER_CAPITALIZATION).setWordDelimiterKey(KEY_SETTER_WORD_DELIMITER) .setCapitalizationKey(KEY_SETTER_CAPITALIZATION).setWordDelimiterKey(KEY_SETTER_WORD_DELIMITER)
.setPrefixKey(KEY_SETTER_PREFIX).setSuffixKey(KEY_SETTER_SUFFIX) .setPrefixKey(KEY_SETTER_PREFIX).setSuffixKey(KEY_SETTER_SUFFIX).setSeedNameGenerator(fieldCategory)
.setSeedNameGenerator(fieldCategory).setNameValidator(IDENTIFIER_VALIDATOR) .setNameValidator(IDENTIFIER_VALIDATOR).setTrimFieldName(true);
.setTrimFieldName(true);
new IncludeGuardCategory(codeCategory); new IncludeGuardCategory(codeCategory);
Category fileCategory = new Category(PreferencesMessages.NameStyleBlock_files_node); Category fileCategory = new Category(PreferencesMessages.NameStyleBlock_files_node);
new Category(PreferencesMessages.NameStyleBlock_cpp_header_node, new Category(PreferencesMessages.NameStyleBlock_cpp_header_node,
PreferencesMessages.NameStyleBlock_cpp_header_node_description, EXAMPLE_CLASS_NAME, fileCategory) PreferencesMessages.NameStyleBlock_cpp_header_node_description, EXAMPLE_CLASS_NAME, fileCategory)
.setCapitalizationKey(KEY_CPP_HEADER_CAPITALIZATION) .setCapitalizationKey(KEY_CPP_HEADER_CAPITALIZATION).setWordDelimiterKey(KEY_CPP_HEADER_WORD_DELIMITER)
.setWordDelimiterKey(KEY_CPP_HEADER_WORD_DELIMITER).setPrefixKey(KEY_CPP_HEADER_PREFIX) .setPrefixKey(KEY_CPP_HEADER_PREFIX).setSuffixKey(KEY_CPP_HEADER_SUFFIX)
.setSuffixKey(KEY_CPP_HEADER_SUFFIX).setNameValidator(FILENAME_VALIDATOR); .setNameValidator(FILENAME_VALIDATOR);
new Category(PreferencesMessages.NameStyleBlock_cpp_source_node, new Category(PreferencesMessages.NameStyleBlock_cpp_source_node,
PreferencesMessages.NameStyleBlock_cpp_source_node_description, EXAMPLE_CLASS_NAME, fileCategory) PreferencesMessages.NameStyleBlock_cpp_source_node_description, EXAMPLE_CLASS_NAME, fileCategory)
.setCapitalizationKey(KEY_CPP_SOURCE_CAPITALIZATION) .setCapitalizationKey(KEY_CPP_SOURCE_CAPITALIZATION).setWordDelimiterKey(KEY_CPP_SOURCE_WORD_DELIMITER)
.setWordDelimiterKey(KEY_CPP_SOURCE_WORD_DELIMITER).setPrefixKey(KEY_CPP_SOURCE_PREFIX) .setPrefixKey(KEY_CPP_SOURCE_PREFIX).setSuffixKey(KEY_CPP_SOURCE_SUFFIX)
.setSuffixKey(KEY_CPP_SOURCE_SUFFIX).setNameValidator(FILENAME_VALIDATOR); .setNameValidator(FILENAME_VALIDATOR);
new Category(PreferencesMessages.NameStyleBlock_cpp_test_node, new Category(PreferencesMessages.NameStyleBlock_cpp_test_node,
PreferencesMessages.NameStyleBlock_cpp_test_node_description, EXAMPLE_CLASS_NAME, fileCategory) PreferencesMessages.NameStyleBlock_cpp_test_node_description, EXAMPLE_CLASS_NAME, fileCategory)
.setCapitalizationKey(KEY_CPP_TEST_CAPITALIZATION) .setCapitalizationKey(KEY_CPP_TEST_CAPITALIZATION).setWordDelimiterKey(KEY_CPP_TEST_WORD_DELIMITER)
.setWordDelimiterKey(KEY_CPP_TEST_WORD_DELIMITER).setPrefixKey(KEY_CPP_TEST_PREFIX) .setPrefixKey(KEY_CPP_TEST_PREFIX).setSuffixKey(KEY_CPP_TEST_SUFFIX)
.setSuffixKey(KEY_CPP_TEST_SUFFIX).setNameValidator(FILENAME_VALIDATOR); .setNameValidator(FILENAME_VALIDATOR);
return new Category[] { codeCategory, fileCategory }; return new Category[] { codeCategory, fileCategory };
} }

View file

@ -34,7 +34,7 @@ public class CRefactoringMatchStore {
private Comparator<CRefactoringMatch> fOffsetComparator; private Comparator<CRefactoringMatch> fOffsetComparator;
public CRefactoringMatchStore() { public CRefactoringMatchStore() {
fOffsetComparator = new Comparator<CRefactoringMatch>() { fOffsetComparator = new Comparator<>() {
@Override @Override
public int compare(CRefactoringMatch o1, CRefactoringMatch o2) { public int compare(CRefactoringMatch o1, CRefactoringMatch o2) {
return o1.getOffset() - o2.getOffset(); return o1.getOffset() - o2.getOffset();

View file

@ -310,7 +310,7 @@ public class TextSearchWrapper {
} }
} }
final static Comparator<int[]> COMPARE_FIRST_INTEGER = new Comparator<int[]>() { final static Comparator<int[]> COMPARE_FIRST_INTEGER = new Comparator<>() {
@Override @Override
public int compare(int[] o1, int[] o2) { public int compare(int[] o1, int[] o2) {
return (o1)[0] - (o2)[0]; return (o1)[0] - (o2)[0];

View file

@ -74,7 +74,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
// may need a corresponding adjustment, and this stores the adjusted offset. // may need a corresponding adjustment, and this stores the adjusted offset.
private int fAdjustedParseOffset = -1; private int fAdjustedParseOffset = -1;
private Lazy<Integer> fContextInfoPosition = new Lazy<Integer>() { private Lazy<Integer> fContextInfoPosition = new Lazy<>() {
@Override @Override
protected Integer calculateValue() { protected Integer calculateValue() {
return guessContextInformationPosition(); return guessContextInformationPosition();
@ -83,7 +83,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
private final Lazy<ITranslationUnit> fTU; private final Lazy<ITranslationUnit> fTU;
private final Lazy<Integer> fParseOffset = new Lazy<Integer>() { private final Lazy<Integer> fParseOffset = new Lazy<>() {
@Override @Override
protected Integer calculateValue() { protected Integer calculateValue() {
int result = doCalculate(); int result = doCalculate();
@ -196,7 +196,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
return null; return null;
} }
private final Lazy<IASTCompletionNode> fCN = new Lazy<IASTCompletionNode>() { private final Lazy<IASTCompletionNode> fCN = new Lazy<>() {
@Override @Override
protected IASTCompletionNode calculateValue() { protected IASTCompletionNode calculateValue() {
int offset = getParseOffset(); int offset = getParseOffset();
@ -253,7 +253,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
} }
}; };
private final Lazy<Boolean> afterOpeningAngleBracket = new Lazy<Boolean>() { private final Lazy<Boolean> afterOpeningAngleBracket = new Lazy<>() {
@Override @Override
protected Boolean calculateValue() { protected Boolean calculateValue() {
final int parseOffset = getParseOffset(); final int parseOffset = getParseOffset();
@ -264,7 +264,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
} }
}; };
private final Lazy<Boolean> afterOpeningParenthesisOrBrace = new Lazy<Boolean>() { private final Lazy<Boolean> afterOpeningParenthesisOrBrace = new Lazy<>() {
@Override @Override
protected Boolean calculateValue() { protected Boolean calculateValue() {
final int invocationOffset = getInvocationOffset(); final int invocationOffset = getInvocationOffset();
@ -295,7 +295,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
} }
}; };
private final Lazy<Boolean> inUsingDeclaration = new Lazy<Boolean>() { private final Lazy<Boolean> inUsingDeclaration = new Lazy<>() {
/** /**
* Checks whether the invocation offset is inside a using-declaration. * Checks whether the invocation offset is inside a using-declaration.
* *
@ -331,7 +331,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
} }
}; };
private final Lazy<Boolean> followedBySemicolon = new Lazy<Boolean>() { private final Lazy<Boolean> followedBySemicolon = new Lazy<>() {
@Override @Override
protected Boolean calculateValue() { protected Boolean calculateValue() {
final IDocument doc = getDocument(); final IDocument doc = getDocument();
@ -342,7 +342,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
} }
}; };
private final Lazy<Boolean> followedByOpeningParen = new Lazy<Boolean>() { private final Lazy<Boolean> followedByOpeningParen = new Lazy<>() {
@Override @Override
protected Boolean calculateValue() { protected Boolean calculateValue() {
final IDocument doc = getDocument(); final IDocument doc = getDocument();
@ -353,7 +353,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
} }
}; };
private final Lazy<String> functionParameterDelimiter = new Lazy<String>() { private final Lazy<String> functionParameterDelimiter = new Lazy<>() {
@Override @Override
protected String calculateValue() { protected String calculateValue() {
String propertyKey = DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS; String propertyKey = DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS;
@ -362,7 +362,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
} }
}; };
private final Lazy<String> templateParameterDelimiter = new Lazy<String>() { private final Lazy<String> templateParameterDelimiter = new Lazy<>() {
@Override @Override
protected String calculateValue() { protected String calculateValue() {
String propertyKey = DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMETERS; String propertyKey = DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMETERS;
@ -387,7 +387,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
fIsCompletion = isCompletion; fIsCompletion = isCompletion;
fIsContextInformationStyle = !isCompletion; fIsContextInformationStyle = !isCompletion;
fIsAutoActivated = isAutoActivated; fIsAutoActivated = isAutoActivated;
fTU = new Lazy<ITranslationUnit>() { fTU = new Lazy<>() {
@Override @Override
protected ITranslationUnit calculateValue() { protected ITranslationUnit calculateValue() {
return CUIPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(fEditor.getEditorInput()); return CUIPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(fEditor.getEditorInput());
@ -402,7 +402,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
*/ */
public CContentAssistInvocationContext(final ITranslationUnit unit, boolean isCompletion) { public CContentAssistInvocationContext(final ITranslationUnit unit, boolean isCompletion) {
super(); super();
fTU = new Lazy<ITranslationUnit>() { fTU = new Lazy<>() {
@Override @Override
protected ITranslationUnit calculateValue() { protected ITranslationUnit calculateValue() {
return unit; return unit;

View file

@ -92,7 +92,7 @@ public class ContentAssistProcessor implements IContentAssistProcessor {
*/ */
private static final String PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY = "EmptyDefaultAssistCategory"; //$NON-NLS-1$ private static final String PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY = "EmptyDefaultAssistCategory"; //$NON-NLS-1$
private static final Comparator<CompletionProposalCategory> ORDER_COMPARATOR = new Comparator<CompletionProposalCategory>() { private static final Comparator<CompletionProposalCategory> ORDER_COMPARATOR = new Comparator<>() {
@Override @Override
public int compare(CompletionProposalCategory d1, CompletionProposalCategory d2) { public int compare(CompletionProposalCategory d1, CompletionProposalCategory d2) {
return d1.getSortOrder() - d2.getSortOrder(); return d1.getSortOrder() - d2.getSortOrder();

View file

@ -51,7 +51,7 @@ public class CSelectAnnotationRulerAction extends SelectMarkerRulerAction {
private ResourceBundle fBundle; private ResourceBundle fBundle;
// Annotations at the ruler's current line of activity, keyed by their presentation layer, // Annotations at the ruler's current line of activity, keyed by their presentation layer,
// in decreasing order (i.e. top to bottom). // in decreasing order (i.e. top to bottom).
private static Comparator<Integer> decreasingOrder = new Comparator<Integer>() { private static Comparator<Integer> decreasingOrder = new Comparator<>() {
@Override @Override
public int compare(Integer a, Integer b) { public int compare(Integer a, Integer b) {
return b - a; return b - a;

View file

@ -1312,7 +1312,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
} }
} }
Comparator<Tuple> comparator = new Comparator<Tuple>() { Comparator<Tuple> comparator = new Comparator<>() {
@Override @Override
public int compare(Tuple t1, Tuple t2) { public int compare(Tuple t1, Tuple t2) {
return t1.position.getOffset() - t2.position.getOffset(); return t1.position.getOffset() - t2.position.getOffset();

View file

@ -30,7 +30,7 @@ import org.eclipse.jface.text.templates.TemplateVariableResolver;
public class TemplateVariableProcessor implements IContentAssistProcessor { public class TemplateVariableProcessor implements IContentAssistProcessor {
private static Comparator<TemplateVariableProposal> fgTemplateVariableProposalComparator = new Comparator<TemplateVariableProposal>() { private static Comparator<TemplateVariableProposal> fgTemplateVariableProposalComparator = new Comparator<>() {
@Override @Override
public int compare(TemplateVariableProposal arg0, TemplateVariableProposal arg1) { public int compare(TemplateVariableProposal arg0, TemplateVariableProposal arg1) {
return arg0.getDisplayString().compareTo(arg1.getDisplayString()); return arg0.getDisplayString().compareTo(arg1.getDisplayString());

View file

@ -51,7 +51,7 @@ public class THHistoryListAction extends Action {
setTitle(Messages.THHistoryListAction_HistoryList_title); setTitle(Messages.THHistoryListAction_HistoryList_title);
String[] buttonLabels = new String[] { Messages.THHistoryListAction_Remove, }; String[] buttonLabels = new String[] { Messages.THHistoryListAction_Remove, };
IListAdapter<ICElement> adapter = new IListAdapter<ICElement>() { IListAdapter<ICElement> adapter = new IListAdapter<>() {
@Override @Override
public void customButtonPressed(ListDialogField<ICElement> field, int index) { public void customButtonPressed(ListDialogField<ICElement> field, int index) {
doCustomButtonPressed(); doCustomButtonPressed();

View file

@ -38,7 +38,7 @@ abstract class AbstractWorkingSetConfigsContribution extends CompoundContributio
private IWorkingSetProxy workingSet; private IWorkingSetProxy workingSet;
private Comparator<IWorkingSetConfiguration> configOrdering = new Comparator<IWorkingSetConfiguration>() { private Comparator<IWorkingSetConfiguration> configOrdering = new Comparator<>() {
private Collator collator = Collator.getInstance(); private Collator collator = Collator.getInstance();
@Override @Override

View file

@ -115,7 +115,7 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
String[] buttonLabels = new String[] { CUIMessages.BinaryParserBlock_button_up, String[] buttonLabels = new String[] { CUIMessages.BinaryParserBlock_button_up,
CUIMessages.BinaryParserBlock_button_down }; CUIMessages.BinaryParserBlock_button_down };
IListAdapter<BinaryParserConfiguration> listAdapter = new IListAdapter<BinaryParserConfiguration>() { IListAdapter<BinaryParserConfiguration> listAdapter = new IListAdapter<>() {
@Override @Override
public void customButtonPressed(ListDialogField<BinaryParserConfiguration> field, int index) { public void customButtonPressed(ListDialogField<BinaryParserConfiguration> field, int index) {
@ -131,8 +131,7 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
} }
}; };
binaryList = new CheckedListDialogField<BinaryParserConfiguration>(listAdapter, buttonLabels, binaryList = new CheckedListDialogField<>(listAdapter, buttonLabels, new BinaryParserLabelProvider()) {
new BinaryParserLabelProvider()) {
@Override @Override
protected int getListStyle() { protected int getListStyle() {

View file

@ -971,7 +971,8 @@ public class ExecutablesManager extends PlatformObject
synchronized (executablesMap) { synchronized (executablesMap) {
for (Executable executableRemoved : executablesRemoved) { for (Executable executableRemoved : executablesRemoved) {
List<Executable> execs = executablesMap.get(executableRemoved.getProject()); List<Executable> execs = executablesMap.get(executableRemoved.getProject());
assert execs != null : "considering the list was used in populating 'executablesRemoved', how could it be gone now?"; //$NON-NLS-1$ assert execs != null
: "considering the list was used in populating 'executablesRemoved', how could it be gone now?"; //$NON-NLS-1$
if (execs != null) { if (execs != null) {
execs.remove(executableRemoved); execs.remove(executableRemoved);
} }

View file

@ -86,8 +86,8 @@ public class AddWatchpointOnVariableActionDelegate extends AddWatchpointActionDe
assert false : "action should not have been available for object " + obj; //$NON-NLS-1$ assert false : "action should not have been available for object " + obj; //$NON-NLS-1$
} else if (selection instanceof StructuredSelection) { } else if (selection instanceof StructuredSelection) {
// Not sure why, but sometimes we get an extraneous empty StructuredSelection. Seems harmless enough // Not sure why, but sometimes we get an extraneous empty StructuredSelection. Seems harmless enough
assert ((StructuredSelection) selection) assert ((StructuredSelection) selection).getFirstElement() == null
.getFirstElement() == null : "action installed in unexpected type of view/part"; //$NON-NLS-1$ : "action installed in unexpected type of view/part"; //$NON-NLS-1$
} else { } else {
assert false : "action installed in unexpected type of view/part"; //$NON-NLS-1$ assert false : "action installed in unexpected type of view/part"; //$NON-NLS-1$
} }

View file

@ -49,7 +49,7 @@ public class DebugViewUtils {
/** Gets workbench view (if any) with specified ID. */ /** Gets workbench view (if any) with specified ID. */
public static IViewPart getViewWithID(String viewID) { public static IViewPart getViewWithID(String viewID) {
final String viewID_f = viewID; final String viewID_f = viewID;
RunnableWithResult<IViewPart> runnable = new RunnableWithResult<IViewPart>() { RunnableWithResult<IViewPart> runnable = new RunnableWithResult<>() {
@Override @Override
public IViewPart call() { public IViewPart call() {
IViewPart view = null; IViewPart view = null;

View file

@ -133,7 +133,7 @@ public class GdbPinProvider implements IPinProvider {
IThreadDMData data = null; IThreadDMData data = null;
final DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), fSession.getId()); final DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), fSession.getId());
try { try {
Query<IThreadDMData> query = new Query<IThreadDMData>() { Query<IThreadDMData> query = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<IThreadDMData> rm) { protected void execute(final DataRequestMonitor<IThreadDMData> rm) {
final IProcesses processes = tracker.getService(IProcesses.class); final IProcesses processes = tracker.getService(IProcesses.class);

View file

@ -46,7 +46,7 @@ public class GdbSteppingModeTarget extends DsfSteppingModeTarget {
@Override @Override
public boolean supportsInstructionStepping() { public boolean supportsInstructionStepping() {
Query<Boolean> supportInstructionStepping = new Query<Boolean>() { Query<Boolean> supportInstructionStepping = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<Boolean> rm) { protected void execute(DataRequestMonitor<Boolean> rm) {
IGDBBackend backend = fTracker.getService(IGDBBackend.class); IGDBBackend backend = fTracker.getService(IGDBBackend.class);

View file

@ -75,7 +75,7 @@ public abstract class GdbAbstractReverseStepCommand extends AbstractDebugCommand
} }
final StepType stepType = getStepType(); final StepType stepType = getStepType();
Query<Object> reverseStepQuery = new Query<Object>() { Query<Object> reverseStepQuery = new Query<>() {
@Override @Override
public void execute(DataRequestMonitor<Object> rm) { public void execute(DataRequestMonitor<Object> rm) {
IReverseRunControl runControl = fTracker.getService(IReverseRunControl.class); IReverseRunControl runControl = fTracker.getService(IReverseRunControl.class);
@ -111,7 +111,7 @@ public abstract class GdbAbstractReverseStepCommand extends AbstractDebugCommand
} }
final StepType stepType = getStepType(); final StepType stepType = getStepType();
Query<Boolean> canReverseQuery = new Query<Boolean>() { Query<Boolean> canReverseQuery = new Query<>() {
@Override @Override
public void execute(DataRequestMonitor<Boolean> rm) { public void execute(DataRequestMonitor<Boolean> rm) {
IReverseRunControl runControl = fTracker.getService(IReverseRunControl.class); IReverseRunControl runControl = fTracker.getService(IReverseRunControl.class);

View file

@ -115,7 +115,7 @@ public class GdbConnectCommand extends RefreshableDebugCommand implements IConne
*/ */
@Override @Override
public boolean canConnect() { public boolean canConnect() {
Query<Boolean> canConnectQuery = new Query<Boolean>() { Query<Boolean> canConnectQuery = new Query<>() {
@Override @Override
public void execute(DataRequestMonitor<Boolean> rm) { public void execute(DataRequestMonitor<Boolean> rm) {
IProcesses procService = fTracker.getService(IProcesses.class); IProcesses procService = fTracker.getService(IProcesses.class);
@ -271,7 +271,7 @@ public class GdbConnectCommand extends RefreshableDebugCommand implements IConne
@Override @Override
protected void doExecute(Object[] targets, IProgressMonitor monitor, final IRequest request) throws CoreException { protected void doExecute(Object[] targets, IProgressMonitor monitor, final IRequest request) throws CoreException {
Query<Boolean> connectQuery = new Query<Boolean>() { Query<Boolean> connectQuery = new Query<>() {
@Override @Override
public void execute(final DataRequestMonitor<Boolean> rm) { public void execute(final DataRequestMonitor<Boolean> rm) {
connect(new RequestMonitor(fExecutor, rm) { connect(new RequestMonitor(fExecutor, rm) {
@ -521,7 +521,7 @@ public class GdbConnectCommand extends RefreshableDebugCommand implements IConne
// Prompt the user to choose one or more processes // Prompt the user to choose one or more processes
new PromptForPidJob(LaunchUIMessages.getString("ProcessPrompter.PromptJob"), //$NON-NLS-1$ new PromptForPidJob(LaunchUIMessages.getString("ProcessPrompter.PromptJob"), //$NON-NLS-1$
processes.toArray(new IProcessExtendedInfo[processes.size()]), debuggedProcesses, processes.toArray(new IProcessExtendedInfo[processes.size()]), debuggedProcesses,
new DataRequestMonitor<Object>(fExecutor, rm) { new DataRequestMonitor<>(fExecutor, rm) {
@Override @Override
protected void handleCancel() { protected void handleCancel() {
rm.cancel(); rm.cancel();

View file

@ -95,7 +95,7 @@ public class GdbDebugNewExecutableCommand extends RefreshableDebugCommand implem
public boolean canDebugNewExecutable() { public boolean canDebugNewExecutable() {
Query<Boolean> canDebugQuery = new Query<Boolean>() { Query<Boolean> canDebugQuery = new Query<>() {
@Override @Override
public void execute(DataRequestMonitor<Boolean> rm) { public void execute(DataRequestMonitor<Boolean> rm) {
IProcesses procService = fTracker.getService(IProcesses.class); IProcesses procService = fTracker.getService(IProcesses.class);
@ -157,7 +157,7 @@ public class GdbDebugNewExecutableCommand extends RefreshableDebugCommand implem
@Override @Override
protected void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException { protected void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException {
Query<Boolean> query = new Query<Boolean>() { Query<Boolean> query = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<Boolean> rm) { protected void execute(DataRequestMonitor<Boolean> rm) {

View file

@ -64,7 +64,7 @@ public class GdbResumeWithoutSignalCommand extends AbstractDebugCommand implemen
return; return;
} }
Query<Object> query = new Query<Object>() { Query<Object> query = new Query<>() {
@Override @Override
public void execute(DataRequestMonitor<Object> rm) { public void execute(DataRequestMonitor<Object> rm) {
IRunControl runControl = fTracker.getService(IRunControl.class); IRunControl runControl = fTracker.getService(IRunControl.class);

View file

@ -64,7 +64,7 @@ public class GdbReverseResumeCommand extends AbstractDebugCommand implements IRe
return; return;
} }
Query<Object> reverseResume = new Query<Object>() { Query<Object> reverseResume = new Query<>() {
@Override @Override
public void execute(DataRequestMonitor<Object> rm) { public void execute(DataRequestMonitor<Object> rm) {
IReverseRunControl runControl = fTracker.getService(IReverseRunControl.class); IReverseRunControl runControl = fTracker.getService(IReverseRunControl.class);
@ -99,7 +99,7 @@ public class GdbReverseResumeCommand extends AbstractDebugCommand implements IRe
return false; return false;
} }
Query<Boolean> canReverseResume = new Query<Boolean>() { Query<Boolean> canReverseResume = new Query<>() {
@Override @Override
public void execute(DataRequestMonitor<Boolean> rm) { public void execute(DataRequestMonitor<Boolean> rm) {
IReverseRunControl runControl = fTracker.getService(IReverseRunControl.class); IReverseRunControl runControl = fTracker.getService(IReverseRunControl.class);

View file

@ -118,7 +118,7 @@ public class GdbReverseToggleCommand extends AbstractDebugCommand implements ICh
return; return;
} }
Query<Object> setReverseMode = new Query<Object>() { Query<Object> setReverseMode = new Query<>() {
@Override @Override
public void execute(final DataRequestMonitor<Object> rm) { public void execute(final DataRequestMonitor<Object> rm) {
final IReverseRunControl2 runControl = fTracker.getService(IReverseRunControl2.class); final IReverseRunControl2 runControl = fTracker.getService(IReverseRunControl2.class);
@ -209,7 +209,7 @@ public class GdbReverseToggleCommand extends AbstractDebugCommand implements ICh
return false; return false;
} }
Query<Boolean> canSetReverseMode = new Query<Boolean>() { Query<Boolean> canSetReverseMode = new Query<>() {
@Override @Override
public void execute(DataRequestMonitor<Boolean> rm) { public void execute(DataRequestMonitor<Boolean> rm) {
IReverseRunControl runControl = fTracker.getService(IReverseRunControl.class); IReverseRunControl runControl = fTracker.getService(IReverseRunControl.class);
@ -273,7 +273,7 @@ public class GdbReverseToggleCommand extends AbstractDebugCommand implements ICh
return false; return false;
} }
Query<Boolean> isToggledQuery = new Query<Boolean>() { Query<Boolean> isToggledQuery = new Query<>() {
@Override @Override
public void execute(final DataRequestMonitor<Boolean> rm) { public void execute(final DataRequestMonitor<Boolean> rm) {
final IReverseRunControl runControl = fTracker.getService(IReverseRunControl.class); final IReverseRunControl runControl = fTracker.getService(IReverseRunControl.class);
@ -349,7 +349,7 @@ public class GdbReverseToggleCommand extends AbstractDebugCommand implements ICh
return ReverseDebugMethod.OFF; return ReverseDebugMethod.OFF;
} }
Query<ReverseDebugMethod> reverseMethodQuery = new Query<ReverseDebugMethod>() { Query<ReverseDebugMethod> reverseMethodQuery = new Query<>() {
@Override @Override
public void execute(DataRequestMonitor<ReverseDebugMethod> rm) { public void execute(DataRequestMonitor<ReverseDebugMethod> rm) {
IReverseRunControl2 runControl = fTracker.getService(IReverseRunControl2.class); IReverseRunControl2 runControl = fTracker.getService(IReverseRunControl2.class);

View file

@ -74,7 +74,7 @@ public class GdbSaveTraceDataCommand extends AbstractDebugCommand implements ISa
PlatformUI.getWorkbench().getDisplay().syncExec(() -> fileName[0] = promptForFileName()); PlatformUI.getWorkbench().getDisplay().syncExec(() -> fileName[0] = promptForFileName());
if (fileName[0] != null) { if (fileName[0] != null) {
Query<Object> saveTraceDataQuery = new Query<Object>() { Query<Object> saveTraceDataQuery = new Query<>() {
@Override @Override
public void execute(final DataRequestMonitor<Object> rm) { public void execute(final DataRequestMonitor<Object> rm) {
IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class); IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class);
@ -110,7 +110,7 @@ public class GdbSaveTraceDataCommand extends AbstractDebugCommand implements ISa
return false; return false;
} }
Query<Boolean> canSaveQuery = new Query<Boolean>() { Query<Boolean> canSaveQuery = new Query<>() {
@Override @Override
public void execute(DataRequestMonitor<Boolean> rm) { public void execute(DataRequestMonitor<Boolean> rm) {
IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class); IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class);

View file

@ -71,7 +71,7 @@ public class GdbSelectNextTraceRecordCommand extends AbstractDebugCommand implem
return; return;
} }
Query<Object> selectRecordQuery = new Query<Object>() { Query<Object> selectRecordQuery = new Query<>() {
@Override @Override
public void execute(final DataRequestMonitor<Object> rm) { public void execute(final DataRequestMonitor<Object> rm) {
final IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class); final IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class);
@ -129,7 +129,7 @@ public class GdbSelectNextTraceRecordCommand extends AbstractDebugCommand implem
return false; return false;
} }
Query<Boolean> canSelectRecordQuery = new Query<Boolean>() { Query<Boolean> canSelectRecordQuery = new Query<>() {
@Override @Override
public void execute(final DataRequestMonitor<Boolean> rm) { public void execute(final DataRequestMonitor<Boolean> rm) {
IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class); IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class);

View file

@ -73,7 +73,7 @@ public class GdbSelectPrevTraceRecordCommand extends AbstractDebugCommand implem
return; return;
} }
Query<Object> selectRecordQuery = new Query<Object>() { Query<Object> selectRecordQuery = new Query<>() {
@Override @Override
public void execute(final DataRequestMonitor<Object> rm) { public void execute(final DataRequestMonitor<Object> rm) {
final IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class); final IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class);
@ -123,7 +123,7 @@ public class GdbSelectPrevTraceRecordCommand extends AbstractDebugCommand implem
return false; return false;
} }
Query<Boolean> canSelectRecordQuery = new Query<Boolean>() { Query<Boolean> canSelectRecordQuery = new Query<>() {
@Override @Override
public void execute(final DataRequestMonitor<Boolean> rm) { public void execute(final DataRequestMonitor<Boolean> rm) {
final IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class); final IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class);

View file

@ -66,7 +66,7 @@ public class GdbStartTracingCommand extends AbstractDebugCommand implements ISta
return; return;
} }
Query<Object> startTracingQuery = new Query<Object>() { Query<Object> startTracingQuery = new Query<>() {
@Override @Override
public void execute(final DataRequestMonitor<Object> rm) { public void execute(final DataRequestMonitor<Object> rm) {
final IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class); final IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class);
@ -110,7 +110,7 @@ public class GdbStartTracingCommand extends AbstractDebugCommand implements ISta
return false; return false;
} }
Query<Boolean> canStartTracingQuery = new Query<Boolean>() { Query<Boolean> canStartTracingQuery = new Query<>() {
@Override @Override
public void execute(DataRequestMonitor<Boolean> rm) { public void execute(DataRequestMonitor<Boolean> rm) {
IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class); IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class);

View file

@ -64,7 +64,7 @@ public class GdbStopTracingCommand extends AbstractDebugCommand implements IStop
return; return;
} }
Query<Object> stopTracingQuery = new Query<Object>() { Query<Object> stopTracingQuery = new Query<>() {
@Override @Override
public void execute(final DataRequestMonitor<Object> rm) { public void execute(final DataRequestMonitor<Object> rm) {
IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class); IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class);
@ -99,7 +99,7 @@ public class GdbStopTracingCommand extends AbstractDebugCommand implements IStop
return false; return false;
} }
Query<Boolean> canStopTracingQuery = new Query<Boolean>() { Query<Boolean> canStopTracingQuery = new Query<>() {
@Override @Override
public void execute(DataRequestMonitor<Boolean> rm) { public void execute(DataRequestMonitor<Boolean> rm) {
IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class); IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class);

View file

@ -91,7 +91,7 @@ public class AttachProcessHandler extends AbstractHandler {
return false; return false;
} }
Query<Boolean> canConnectQuery = new Query<Boolean>() { Query<Boolean> canConnectQuery = new Query<>() {
@Override @Override
public void execute(DataRequestMonitor<Boolean> rm) { public void execute(DataRequestMonitor<Boolean> rm) {
BundleContext c = GdbUIPlugin.getDefault().getBundle().getBundleContext(); BundleContext c = GdbUIPlugin.getDefault().getBundle().getBundleContext();

View file

@ -297,7 +297,7 @@ public class OSResourcesView extends ViewPart implements DsfSession.SessionEnded
GdbLaunch l = (GdbLaunch) obj; GdbLaunch l = (GdbLaunch) obj;
final DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), final DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(),
l.getSession().getId()); l.getSession().getId());
Query<IDMContext> contextQuery = new Query<IDMContext>() { Query<IDMContext> contextQuery = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<IDMContext> rm) { protected void execute(DataRequestMonitor<IDMContext> rm) {
ICommandControlService commandControl = tracker.getService(ICommandControlService.class); ICommandControlService commandControl = tracker.getService(ICommandControlService.class);

View file

@ -245,7 +245,7 @@ public class TraceControlModel {
return null; return null;
} }
Query<ITraceVariableDMData[]> query = new Query<ITraceVariableDMData[]>() { Query<ITraceVariableDMData[]> query = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<ITraceVariableDMData[]> rm) { protected void execute(final DataRequestMonitor<ITraceVariableDMData[]> rm) {
@ -292,7 +292,7 @@ public class TraceControlModel {
TracepointsMessages.TraceControlView_create_variable_error); TracepointsMessages.TraceControlView_create_variable_error);
} }
Query<String> query = new Query<String>() { Query<String> query = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<String> rm) { protected void execute(final DataRequestMonitor<String> rm) {

View file

@ -122,7 +122,7 @@ public class GdbVariableVMNode extends VariableVMNode {
getSession().getExecutor().execute(() -> { getSession().getExecutor().execute(() -> {
final IExpressions expressionService = getServicesTracker().getService(IExpressions.class); final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
if (expressionService != null) { if (expressionService != null) {
final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<IExpressionDMAddress>( final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<>(
getSession().getExecutor(), null) { getSession().getExecutor(), null) {
@Override @Override
public void handleCompleted() { public void handleCompleted() {
@ -161,7 +161,7 @@ public class GdbVariableVMNode extends VariableVMNode {
getSession().getExecutor().execute(() -> { getSession().getExecutor().execute(() -> {
final IExpressions expressionService = getServicesTracker().getService(IExpressions.class); final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
if (expressionService != null) { if (expressionService != null) {
final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<IExpressionDMAddress>( final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<>(
getSession().getExecutor(), null) { getSession().getExecutor(), null) {
@Override @Override
public void handleCompleted() { public void handleCompleted() {

View file

@ -114,7 +114,7 @@ public class GdbPlugin extends Plugin {
if (launch instanceof GdbLaunch && ((GdbLaunch) launch).getSession().isActive()) { if (launch instanceof GdbLaunch && ((GdbLaunch) launch).getSession().isActive()) {
final GdbLaunch gdbLaunch = (GdbLaunch) launch; final GdbLaunch gdbLaunch = (GdbLaunch) launch;
Query<Object> launchShutdownQuery = new Query<Object>() { Query<Object> launchShutdownQuery = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<Object> rm) { protected void execute(DataRequestMonitor<Object> rm) {
gdbLaunch.shutdownSession(rm); gdbLaunch.shutdownSession(rm);

View file

@ -104,7 +104,7 @@ public class CoreBuildLocalDebugLaunchDelegate extends CoreBuildLaunchConfigDele
gdbLaunch.addCLIProcess(gdbLaunch.getGDBPath().toOSString() + " (" + gdbVersion + ")"); //$NON-NLS-1$ //$NON-NLS-2$ gdbLaunch.addCLIProcess(gdbLaunch.getGDBPath().toOSString() + " (" + gdbVersion + ")"); //$NON-NLS-1$ //$NON-NLS-2$
Query<Object> ready = new Query<Object>() { Query<Object> ready = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<Object> rm) { protected void execute(final DataRequestMonitor<Object> rm) {
DsfServicesTracker tracker = new DsfServicesTracker( DsfServicesTracker tracker = new DsfServicesTracker(

View file

@ -235,7 +235,7 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses {
final DataRequestMonitor<IDMContext> rm) { final DataRequestMonitor<IDMContext> rm) {
final IMIContainerDMContext containerDmc = createContainerContext(procCtx, MIProcesses.UNIQUE_GROUP_ID); final IMIContainerDMContext containerDmc = createContainerContext(procCtx, MIProcesses.UNIQUE_GROUP_ID);
DataRequestMonitor<MIInfo> attachRm = new ImmediateDataRequestMonitor<MIInfo>(rm) { DataRequestMonitor<MIInfo> attachRm = new ImmediateDataRequestMonitor<>(rm) {
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
GDBProcesses.super.attachDebuggerToProcess(procCtx, new ImmediateDataRequestMonitor<IDMContext>(rm) { GDBProcesses.super.attachDebuggerToProcess(procCtx, new ImmediateDataRequestMonitor<IDMContext>(rm) {
@ -602,8 +602,7 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses {
createConsole(containerDmc, restart, new ImmediateRequestMonitor(requestMonitor) { createConsole(containerDmc, restart, new ImmediateRequestMonitor(requestMonitor) {
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
final DataRequestMonitor<MIInfo> execMonitor = new DataRequestMonitor<MIInfo>(getExecutor(), final DataRequestMonitor<MIInfo> execMonitor = new DataRequestMonitor<>(getExecutor(), requestMonitor) {
requestMonitor) {
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
if (fBackend.getSessionType() != SessionType.REMOTE) { if (fBackend.getSessionType() != SessionType.REMOTE) {

View file

@ -1473,8 +1473,7 @@ public class GDBProcesses_7_0 extends AbstractDsfService implements IGDBProcesse
}); });
} else { } else {
final DataRequestMonitor<IMIContainerDMContext[]> addExitedDRM = new ImmediateDataRequestMonitor<IMIContainerDMContext[]>( final DataRequestMonitor<IMIContainerDMContext[]> addExitedDRM = new ImmediateDataRequestMonitor<>(rm) {
rm) {
@Override @Override
protected void handleCompleted() { protected void handleCompleted() {
List<IMIContainerDMContext> containerDmcs = new ArrayList<>(Arrays.asList(getData())); List<IMIContainerDMContext> containerDmcs = new ArrayList<>(Arrays.asList(getData()));

View file

@ -1588,8 +1588,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService
// It is important to use an ImmediateExecutor for this RM, to make sure we don't risk getting a new // It is important to use an ImmediateExecutor for this RM, to make sure we don't risk getting a new
// call to ExecuteWithTargetAvailable() when we just finished executing the steps. // call to ExecuteWithTargetAvailable() when we just finished executing the steps.
fExecuteQueuedOpsStepMonitor = new MultiRequestMonitor<RequestMonitor>(ImmediateExecutor.getInstance(), fExecuteQueuedOpsStepMonitor = new MultiRequestMonitor<>(ImmediateExecutor.getInstance(), rm) {
rm) {
@Override @Override
protected void handleCompleted() { protected void handleCompleted() {
assert fOperationsPending.size() == 0; assert fOperationsPending.size() == 0;

View file

@ -809,8 +809,7 @@ public class MIBreakpoints extends AbstractDsfService implements IBreakpointsExt
expression = adjustWatchPointExpression(attributes, expression); expression = adjustWatchPointExpression(attributes, expression);
// The DataRequestMonitor for the add request // The DataRequestMonitor for the add request
DataRequestMonitor<MIBreakInsertInfo> addWatchpointDRM = new DataRequestMonitor<MIBreakInsertInfo>( DataRequestMonitor<MIBreakInsertInfo> addWatchpointDRM = new DataRequestMonitor<>(getExecutor(), drm) {
getExecutor(), drm) {
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {

View file

@ -1383,8 +1383,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
// It is important to use an ImmediateExecutor for this RM, to make sure we don't risk getting a new // It is important to use an ImmediateExecutor for this RM, to make sure we don't risk getting a new
// call to ExecuteWithTargetAvailable() when we just finished executing the steps. // call to ExecuteWithTargetAvailable() when we just finished executing the steps.
fExecuteQueuedOpsStepMonitor = new MultiRequestMonitor<RequestMonitor>(ImmediateExecutor.getInstance(), fExecuteQueuedOpsStepMonitor = new MultiRequestMonitor<>(ImmediateExecutor.getInstance(), rm) {
rm) {
@Override @Override
protected void handleCompleted() { protected void handleCompleted() {
assert fOperationsPending.size() == 0; assert fOperationsPending.size() == 0;

View file

@ -1525,7 +1525,7 @@ public class MIVariableManager implements ICommandControl {
} }
} }
final DataRequestMonitor<ChildFullExpressionInfo> childPathRm = new DataRequestMonitor<ChildFullExpressionInfo>( final DataRequestMonitor<ChildFullExpressionInfo> childPathRm = new DataRequestMonitor<>(
fSession.getExecutor(), countingRm) { fSession.getExecutor(), countingRm) {
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {

View file

@ -46,7 +46,7 @@ public class MILogActionEnabler implements ILogActionEnabler {
@Override @Override
public String evaluateExpression(final String expression) throws Exception { public String evaluateExpression(final String expression) throws Exception {
// Use a Query to synchronize the call // Use a Query to synchronize the call
Query<String> query = new Query<String>() { Query<String> query = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<String> drm) { protected void execute(final DataRequestMonitor<String> drm) {
final IExpressions expressionService = fServiceTracker.getService(IExpressions.class); final IExpressions expressionService = fServiceTracker.getService(IExpressions.class);

View file

@ -99,7 +99,7 @@ public class MIBackendCLIProcess extends AbstractCLIProcess {
} }
try { try {
Query<Object> query = new Query<Object>() { Query<Object> query = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<Object> rm) { protected void execute(final DataRequestMonitor<Object> rm) {
if (!DsfSession.isSessionActive(getSession().getId()) || isDisposed() if (!DsfSession.isSessionActive(getSession().getId()) || isDisposed()

View file

@ -295,7 +295,7 @@ public class MIInferiorProcess extends Process implements IEventListener, IComma
// with multi-process (it is re-used by the different processes). // with multi-process (it is re-used by the different processes).
// We use it still for GDB 7.2, since the single-process case is the most common. // We use it still for GDB 7.2, since the single-process case is the most common.
try { try {
Query<Integer> exitCodeQuery = new Query<Integer>() { Query<Integer> exitCodeQuery = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<Integer> rm) { protected void execute(final DataRequestMonitor<Integer> rm) {
// Guard against session disposed. // Guard against session disposed.

View file

@ -114,7 +114,7 @@ public class GdbShowVersionHandler implements IShowVersionHandler {
str = "======= GDB version: " + getData() + " ======="; //$NON-NLS-1$ //$NON-NLS-2$ str = "======= GDB version: " + getData() + " ======="; //$NON-NLS-1$ //$NON-NLS-2$
} else { } else {
str = "Could not obtain GDB version. Error: " + //$NON-NLS-1$ str = "Could not obtain GDB version. Error: " + //$NON-NLS-1$
getStatus(); getStatus();
} }
funcService.notify(context.get(), str, new RequestMonitor(fExecutor, null) { funcService.notify(context.get(), str, new RequestMonitor(fExecutor, null) {
@Override @Override

View file

@ -99,7 +99,7 @@ public class GdbExtendedFinalLaunchSequence extends FinalLaunchSequence_7_12 {
str = "======= GDB version: " + getData() + " ======="; //$NON-NLS-1$ //$NON-NLS-2$ str = "======= GDB version: " + getData() + " ======="; //$NON-NLS-1$ //$NON-NLS-2$
} else { } else {
str = "Could not obtain GDB version. Error: " + //$NON-NLS-1$ str = "Could not obtain GDB version. Error: " + //$NON-NLS-1$
getStatus(); getStatus();
} }
funcService.notify(fControl.getContext(), str, rm); funcService.notify(fControl.getContext(), str, rm);
} }

View file

@ -47,7 +47,7 @@ import org.junit.runners.Suite;
GDBRemoteTracepointsTest.class, TraceFileTest.class, GDBConsoleSynchronizingTest.class, MIMemoryTest.class, GDBRemoteTracepointsTest.class, TraceFileTest.class, GDBConsoleSynchronizingTest.class, MIMemoryTest.class,
MIDisassemblyTest.class, GDBProcessesTest.class, PostMortemCoreTest.class, CommandTimeoutTest.class, MIDisassemblyTest.class, GDBProcessesTest.class, PostMortemCoreTest.class, CommandTimeoutTest.class,
ThreadStackFrameSyncTest.class, CommandLineArgsTest.class, MIAsyncErrorProcessorTests.class ThreadStackFrameSyncTest.class, CommandLineArgsTest.class, MIAsyncErrorProcessorTests.class
/* Add your test class here */ /* Add your test class here */
}) })
public class SuiteGdb { public class SuiteGdb {

View file

@ -325,7 +325,7 @@ public class TraceFileTest extends BaseParametrizedTestCase {
|| getLineForTag("INCR_X") == tracepoint.getLineNumber()); || getLineForTag("INCR_X") == tracepoint.getLineNumber());
String[] actionNames = ((String) tracepoint.getMarker() String[] actionNames = ((String) tracepoint.getMarker()
.getAttribute(BreakpointActionManager.BREAKPOINT_ACTION_ATTRIBUTE)) .getAttribute(BreakpointActionManager.BREAKPOINT_ACTION_ATTRIBUTE))
.split(TracepointActionManager.TRACEPOINT_ACTION_DELIMITER); .split(TracepointActionManager.TRACEPOINT_ACTION_DELIMITER);
for (String name : actionNames) { for (String name : actionNames) {
ITracepointAction a = tam.findAction(name); ITracepointAction a = tam.findAction(name);
assertNotNull(a); assertNotNull(a);

View file

@ -47,7 +47,7 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (adapterType.equals(ICSourceNotFoundDescription.class) && adaptableObject instanceof IFrameDMContext) { if (adapterType.equals(ICSourceNotFoundDescription.class) && adaptableObject instanceof IFrameDMContext) {
final IFrameDMContext frameDMC = (IFrameDMContext) adaptableObject; final IFrameDMContext frameDMC = (IFrameDMContext) adaptableObject;
Query<IStack.IFrameDMData> query = new Query<IStack.IFrameDMData>() { Query<IStack.IFrameDMData> query = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<IStack.IFrameDMData> rm) { protected void execute(DataRequestMonitor<IStack.IFrameDMData> rm) {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),

View file

@ -202,7 +202,7 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
protected boolean canAddRegisterGroup(IWorkbenchPart part, IStructuredSelection selection) { protected boolean canAddRegisterGroup(IWorkbenchPart part, IStructuredSelection selection) {
try { try {
final SelectionDMContext selectionContext = new SelectionDMContext(selection); final SelectionDMContext selectionContext = new SelectionDMContext(selection);
Query<Boolean> query = new Query<Boolean>() { Query<Boolean> query = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<Boolean> rm) { protected void execute(DataRequestMonitor<Boolean> rm) {
IRegisters2 registersService; IRegisters2 registersService;
@ -267,7 +267,7 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
return false; return false;
} }
Query<Boolean> query = new Query<Boolean>() { Query<Boolean> query = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<Boolean> rm) { protected void execute(final DataRequestMonitor<Boolean> rm) {
IRegisters2 registersService; IRegisters2 registersService;
@ -346,7 +346,7 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
} }
//Prepare to Query the service and check if the selected groups can be removed //Prepare to Query the service and check if the selected groups can be removed
Query<Boolean> query = new Query<Boolean>() { Query<Boolean> query = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<Boolean> rm) { protected void execute(DataRequestMonitor<Boolean> rm) {
IRegisters2 regService; IRegisters2 regService;
@ -422,7 +422,7 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
} }
//Prepare to Query the service //Prepare to Query the service
Query<Boolean> query = new Query<Boolean>() { Query<Boolean> query = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<Boolean> rm) { protected void execute(DataRequestMonitor<Boolean> rm) {
IRegisters2 regService; IRegisters2 regService;

View file

@ -51,7 +51,7 @@ public class MoveToLine implements IMoveToLine, IMoveToAddress {
DsfSession session = DsfSession.getSession(fContext.getSessionId()); DsfSession session = DsfSession.getSession(fContext.getSessionId());
if (session != null && session.isActive()) { if (session != null && session.isActive()) {
try { try {
Query<Boolean> query = new Query<Boolean>() { Query<Boolean> query = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<Boolean> rm) { protected void execute(DataRequestMonitor<Boolean> rm) {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
@ -84,7 +84,7 @@ public class MoveToLine implements IMoveToLine, IMoveToAddress {
if (session != null && session.isActive()) { if (session != null && session.isActive()) {
Throwable exception = null; Throwable exception = null;
try { try {
Query<Object> query = new Query<Object>() { Query<Object> query = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<Object> rm) { protected void execute(final DataRequestMonitor<Object> rm) {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
@ -125,7 +125,7 @@ public class MoveToLine implements IMoveToLine, IMoveToAddress {
DsfSession session = DsfSession.getSession(fContext.getSessionId()); DsfSession session = DsfSession.getSession(fContext.getSessionId());
if (session != null && session.isActive()) { if (session != null && session.isActive()) {
try { try {
Query<Boolean> query = new Query<Boolean>() { Query<Boolean> query = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<Boolean> rm) { protected void execute(DataRequestMonitor<Boolean> rm) {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
@ -158,7 +158,7 @@ public class MoveToLine implements IMoveToLine, IMoveToAddress {
if (session != null && session.isActive()) { if (session != null && session.isActive()) {
Throwable exception = null; Throwable exception = null;
try { try {
Query<Object> query = new Query<Object>() { Query<Object> query = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<Object> rm) { protected void execute(final DataRequestMonitor<Object> rm) {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),

View file

@ -57,7 +57,7 @@ public class ResumeAtLine implements IResumeAtLine, IResumeAtAddress {
DsfSession session = DsfSession.getSession(fContext.getSessionId()); DsfSession session = DsfSession.getSession(fContext.getSessionId());
if (session != null && session.isActive()) { if (session != null && session.isActive()) {
try { try {
Query<Boolean> query = new Query<Boolean>() { Query<Boolean> query = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<Boolean> rm) { protected void execute(DataRequestMonitor<Boolean> rm) {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
@ -95,7 +95,7 @@ public class ResumeAtLine implements IResumeAtLine, IResumeAtAddress {
if (session != null && session.isActive()) { if (session != null && session.isActive()) {
Throwable exception = null; Throwable exception = null;
try { try {
Query<Object> query = new Query<Object>() { Query<Object> query = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<Object> rm) { protected void execute(final DataRequestMonitor<Object> rm) {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
@ -136,7 +136,7 @@ public class ResumeAtLine implements IResumeAtLine, IResumeAtAddress {
DsfSession session = DsfSession.getSession(fContext.getSessionId()); DsfSession session = DsfSession.getSession(fContext.getSessionId());
if (session != null && session.isActive()) { if (session != null && session.isActive()) {
try { try {
Query<Boolean> query = new Query<Boolean>() { Query<Boolean> query = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<Boolean> rm) { protected void execute(DataRequestMonitor<Boolean> rm) {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
@ -169,7 +169,7 @@ public class ResumeAtLine implements IResumeAtLine, IResumeAtAddress {
if (session != null && session.isActive()) { if (session != null && session.isActive()) {
Throwable exception = null; Throwable exception = null;
try { try {
Query<Object> query = new Query<Object>() { Query<Object> query = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<Object> rm) { protected void execute(final DataRequestMonitor<Object> rm) {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),

View file

@ -60,7 +60,7 @@ public class RunToLine implements IRunToLine, IRunToAddress {
DsfSession session = DsfSession.getSession(fContext.getSessionId()); DsfSession session = DsfSession.getSession(fContext.getSessionId());
if (session != null && session.isActive()) { if (session != null && session.isActive()) {
try { try {
Query<Boolean> query = new Query<Boolean>() { Query<Boolean> query = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<Boolean> rm) { protected void execute(DataRequestMonitor<Boolean> rm) {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
@ -99,7 +99,7 @@ public class RunToLine implements IRunToLine, IRunToAddress {
if (session != null && session.isActive()) { if (session != null && session.isActive()) {
Throwable exception = null; Throwable exception = null;
try { try {
Query<Object> query = new Query<Object>() { Query<Object> query = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<Object> rm) { protected void execute(final DataRequestMonitor<Object> rm) {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
@ -140,7 +140,7 @@ public class RunToLine implements IRunToLine, IRunToAddress {
DsfSession session = DsfSession.getSession(fContext.getSessionId()); DsfSession session = DsfSession.getSession(fContext.getSessionId());
if (session != null && session.isActive()) { if (session != null && session.isActive()) {
try { try {
Query<Boolean> query = new Query<Boolean>() { Query<Boolean> query = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<Boolean> rm) { protected void execute(DataRequestMonitor<Boolean> rm) {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
@ -173,7 +173,7 @@ public class RunToLine implements IRunToLine, IRunToAddress {
if (session != null && session.isActive()) { if (session != null && session.isActive()) {
Throwable exception = null; Throwable exception = null;
try { try {
Query<Object> query = new Query<Object>() { Query<Object> query = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<Object> rm) { protected void execute(final DataRequestMonitor<Object> rm) {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),

View file

@ -230,7 +230,7 @@ abstract public class AbstractDsfDebugTextHover extends AbstractDebugTextHover i
if (frameDmc != null) { if (frameDmc != null) {
final DsfSession dsfSession = DsfSession.getSession(frameDmc.getSessionId()); final DsfSession dsfSession = DsfSession.getSession(frameDmc.getSessionId());
if (dsfSession != null) { if (dsfSession != null) {
Callable<IExpressionDMContext> callable = new Callable<IExpressionDMContext>() { Callable<IExpressionDMContext> callable = new Callable<>() {
@Override @Override
public IExpressionDMContext call() throws Exception { public IExpressionDMContext call() throws Exception {
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),

View file

@ -118,7 +118,7 @@ public class DsfStepIntoSelectionCommand extends AbstractDebugCommand
if (fSession != null && fSession.isActive()) { if (fSession != null && fSession.isActive()) {
try { try {
Query<Boolean> query = new Query<Boolean>() { Query<Boolean> query = new Query<>() {
@Override @Override
protected void execute(DataRequestMonitor<Boolean> rm) { protected void execute(DataRequestMonitor<Boolean> rm) {
IRunControl3 runControl = fTracker.getService(IRunControl3.class); IRunControl3 runControl = fTracker.getService(IRunControl3.class);
@ -149,7 +149,7 @@ public class DsfStepIntoSelectionCommand extends AbstractDebugCommand
if (fSession != null && fSession.isActive()) { if (fSession != null && fSession.isActive()) {
Throwable exception = null; Throwable exception = null;
try { try {
Query<Object> query = new Query<Object>() { Query<Object> query = new Query<>() {
@Override @Override
protected void execute(final DataRequestMonitor<Object> rm) { protected void execute(final DataRequestMonitor<Object> rm) {
IRunControl3 runControl = fTracker.getService(IRunControl3.class); IRunControl3 runControl = fTracker.getService(IRunControl3.class);

View file

@ -166,7 +166,7 @@ public class BreakpointVMProvider extends AbstractCachingVMProvider {
private final Map<TreePath, ContainerBreakpointsCache> fContainerBreakpointsCacheMap = new HashMap<>(); private final Map<TreePath, ContainerBreakpointsCache> fContainerBreakpointsCacheMap = new HashMap<>();
private DataCache<IBreakpoint[]> fFilteredBreakpointsCache = new DataCache<IBreakpoint[]>(getExecutor()) { private DataCache<IBreakpoint[]> fFilteredBreakpointsCache = new DataCache<>(getExecutor()) {
@Override @Override
protected void retrieve(org.eclipse.cdt.dsf.concurrent.DataRequestMonitor<IBreakpoint[]> rm) { protected void retrieve(org.eclipse.cdt.dsf.concurrent.DataRequestMonitor<IBreakpoint[]> rm) {
calcFileteredBreakpoints(rm); calcFileteredBreakpoints(rm);

Some files were not shown because too many files have changed in this diff Show more