<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=error
org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
Bundle-SymbolicName: org.eclipse.linuxtools.tmf.ui;singleton:=true
Bundle-Activator: org.eclipse.linuxtools.internal.tmf.ui.Activator
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: org.eclipse.core.expressions,
org.eclipse.core.resources,
org.eclipse.core.runtime,
}
private IStatus saveImpl(IProgressMonitor monitor) {
- final BufferedWriter bw;
- try {
- bw = new BufferedWriter(new FileWriter(destination));
- } catch (IOException ex) {
- Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID,
- MessageFormat.format(Messages.ExportToTextJob_Unable_to_export_trace, destination),
- ex);
- return status;
- }
- try {
+ try (final BufferedWriter bw = new BufferedWriter(new FileWriter(destination));) {
if (fHeader != null) {
bw.write(fHeader);
bw.append('\n');
MessageFormat.format(Messages.ExportToTextJob_Unable_to_export_trace, destination),
ex);
return status;
- } finally {
- try {
- bw.close();
- } catch (IOException e) {
- }
}
}
*/
public CustomEvent(CustomTraceDefinition definition) {
fDefinition = definition;
- fData = new HashMap<String, String>();
+ fData = new HashMap<>();
}
/**
public CustomEvent(CustomTraceDefinition definition, TmfEvent other) {
super(other);
fDefinition = definition;
- fData = new HashMap<String, String>();
+ fData = new HashMap<>();
/* Set our overridden fields */
customEventTimestamp = other.getTimestamp();
/* Do not use upstream's fields for stuff we override */
super(parentTrace, null, source, null, null, reference);
fDefinition = definition;
- fData = new HashMap<String, String>();
+ fData = new HashMap<>();
/* Set our overridden fields */
customEventTimestamp = timestamp;
if (fDefinition == null) {
return;
}
- List<ColumnData> columnData = new LinkedList<ColumnData>();
+ List<ColumnData> columnData = new LinkedList<>();
for (OutputColumn outputColumn : fDefinition.outputs) {
ColumnData column = new ColumnData(outputColumn.name, 0, SWT.LEFT);
columnData.add(column);
CustomTxtEvent event = parseFirstLine(context);
- final HashMap<InputLine, Integer> countMap = new HashMap<InputLine, Integer>();
+ final HashMap<InputLine, Integer> countMap = new HashMap<>();
InputLine currentInput = null;
if (context.inputLine.childrenInputs != null && context.inputLine.childrenInputs.size() > 0) {
currentInput = context.inputLine.childrenInputs.get(0);
*/
public void addChild(InputLine input) {
if (childrenInputs == null) {
- childrenInputs = new ArrayList<InputLine>(1);
+ childrenInputs = new ArrayList<>(1);
} else if (childrenInputs.size() > 0) {
InputLine last = childrenInputs.get(childrenInputs.size() - 1);
last.nextInput = input;
*/
public void addColumn(InputData column) {
if (columns == null) {
- columns = new ArrayList<InputData>(1);
+ columns = new ArrayList<>(1);
}
columns.add(column);
}
* @return The next list of lines.
*/
public List<InputLine> getNextInputs(Map<InputLine, Integer> countMap) {
- List<InputLine> nextInputs = new ArrayList<InputLine>();
+ List<InputLine> nextInputs = new ArrayList<>();
InputLine next = nextInput;
while (next != null) {
nextInputs.add(next);
transformer.transform(source, result);
String xmlString = result.getWriter().toString();
- FileWriter writer = new FileWriter(file);
- writer.write(xmlString);
- writer.close();
+ try (FileWriter writer = new FileWriter(file);) {
+ writer.write(xmlString);
+ }
} catch (ParserConfigurationException e) {
Activator.getDefault().logError("Error saving CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$
} catch (TransformerConfigurationException e) {
return new CustomTxtTraceDefinition[0];
}
- ArrayList<CustomTxtTraceDefinition> defList = new ArrayList<CustomTxtTraceDefinition>();
+ ArrayList<CustomTxtTraceDefinition> defList = new ArrayList<>();
NodeList nodeList = root.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
transformer.transform(source, result);
String xmlString = result.getWriter().toString();
- FileWriter writer = new FileWriter(file);
- writer.write(xmlString);
- writer.close();
+ try (FileWriter writer = new FileWriter(file);) {
+ writer.write(xmlString);
+ }
} catch (ParserConfigurationException e) {
Activator.getDefault().logError("Error deleting CustomTxtTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$
} catch (SAXException e) {
*/
public void addAttribute(InputAttribute attribute) {
if (attributes == null) {
- attributes = new ArrayList<InputAttribute>(1);
+ attributes = new ArrayList<>(1);
}
attributes.add(attribute);
}
*/
public void addChild(InputElement input) {
if (childElements == null) {
- childElements = new ArrayList<InputElement>(1);
+ childElements = new ArrayList<>(1);
} else if (childElements.size() > 0) {
InputElement last = childElements.get(childElements.size() - 1);
last.nextElement = input;
transformer.transform(source, result);
String xmlString = result.getWriter().toString();
- FileWriter writer = new FileWriter(file);
- writer.write(xmlString);
- writer.close();
+ try (FileWriter writer = new FileWriter(file);) {
+ writer.write(xmlString);
+ }
} catch (ParserConfigurationException e) {
Activator.getDefault().logError("Error saving CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$
} catch (TransformerConfigurationException e) {
return new CustomXmlTraceDefinition[0];
}
- ArrayList<CustomXmlTraceDefinition> defList = new ArrayList<CustomXmlTraceDefinition>();
+ ArrayList<CustomXmlTraceDefinition> defList = new ArrayList<>();
NodeList nodeList = root.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
transformer.transform(source, result);
String xmlString = result.getWriter().toString();
- FileWriter writer = new FileWriter(file);
- writer.write(xmlString);
- writer.close();
+ try (FileWriter writer = new FileWriter(file);) {
+ writer.write(xmlString);
+ }
} catch (ParserConfigurationException e) {
Activator.getDefault().logError("Error deleteing CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$
} catch (SAXException e) {
* @return The list of input names
*/
public List<String> getInputNames() {
- List<String> inputs = new ArrayList<String>();
+ List<String> inputs = new ArrayList<>();
for (InputLine inputLine : definition.inputs) {
for (String inputName : getInputNames(inputLine)) {
if (!inputs.contains(inputName)) {
* @return The list of input names
*/
public List<String> getInputNames(InputLine inputLine) {
- List<String> inputs = new ArrayList<String>();
+ List<String> inputs = new ArrayList<>();
if (inputLine.columns != null) {
for (InputData inputData : inputLine.columns) {
String inputName = inputData.name;
}
inputText.setStyleRanges(new StyleRange[] {});
- Scanner scanner = new Scanner(inputText.getText());
- scanner.useDelimiter("\n"); //$NON-NLS-1$
- int rawPos = 0;
- // skip starting delimiters
- String skip = scanner.findWithinHorizon("\\A\n+", 0); //$NON-NLS-1$
- if (skip != null) {
- rawPos += skip.length();
- }
+ try (Scanner scanner = new Scanner(inputText.getText());) {
+ scanner.useDelimiter("\n"); //$NON-NLS-1$
- timeStampFormat = null;
- if (selectedLine != null) {
- for (InputGroup input : selectedLine.inputs) {
- input.previewText.setText(Messages.CustomTxtParserInputWizardPage_noMathcingLine);
+ int rawPos = 0;
+ // skip starting delimiters
+ String skip = scanner.findWithinHorizon("\\A\n+", 0); //$NON-NLS-1$
+ if (skip != null) {
+ rawPos += skip.length();
}
- }
- Map<String, String> data = new HashMap<String, String>();
- int rootLineMatches = 0;
- String firstEntryTimeStamp = null;
- String firstEntryTimeStampInputFormat = null;
- String log = null;
- event:
- while (scanner.hasNext()) {
- if (rootLineMatches > 0 && !updateAll) {
- break;
- }
- if (log == null) {
- log = scanner.next();
+ timeStampFormat = null;
+ if (selectedLine != null) {
+ for (InputGroup input : selectedLine.inputs) {
+ input.previewText.setText(Messages.CustomTxtParserInputWizardPage_noMathcingLine);
+ }
}
- int length = log.length();
- for (InputLine rootInputLine : definition.inputs) {
- Pattern pattern;
- try {
- pattern = rootInputLine.getPattern();
- } catch (PatternSyntaxException e) {
- continue;
+
+ Map<String, String> data = new HashMap<>();
+ int rootLineMatches = 0;
+ String firstEntryTimeStamp = null;
+ String firstEntryTimeStampInputFormat = null;
+ String log = null;
+ event: while (scanner.hasNext()) {
+ if (rootLineMatches > 0 && !updateAll) {
+ break;
}
- Matcher matcher = pattern.matcher(log);
- if (matcher.find()) {
- rootLineMatches++;
- inputText.setStyleRange(new StyleRange(rawPos, length,
- COLOR_BLACK, COLOR_YELLOW, SWT.ITALIC));
- data = new HashMap<String, String>();
- timeStampFormat = null;
- updatePreviewLine(rootInputLine, matcher, data, rawPos, rootLineMatches);
- if (rootLineMatches == 1) {
- firstEntryTimeStamp = data.get(CustomTraceDefinition.TAG_TIMESTAMP);
- firstEntryTimeStampInputFormat = timeStampFormat;
- }
- HashMap<InputLine, Integer> countMap = new HashMap<InputLine, Integer>();
- InputLine currentInput = null;
- if (rootInputLine.childrenInputs != null && rootInputLine.childrenInputs.size() > 0) {
- currentInput = rootInputLine.childrenInputs.get(0);
- countMap.put(currentInput, 0);
+ if (log == null) {
+ log = scanner.next();
+ }
+ int length = log.length();
+ for (InputLine rootInputLine : definition.inputs) {
+ Pattern pattern;
+ try {
+ pattern = rootInputLine.getPattern();
+ } catch (PatternSyntaxException e) {
+ continue;
}
- rawPos += length + 1; // +1 for \n
- while (scanner.hasNext()) {
- log = scanner.next();
- length = log.length();
- boolean processed = false;
- if (currentInput == null) {
- for (InputLine input : definition.inputs) {
- matcher = input.getPattern().matcher(log);
- if (matcher.find()) {
- continue event;
+ Matcher matcher = pattern.matcher(log);
+ if (matcher.find()) {
+ rootLineMatches++;
+ inputText.setStyleRange(new StyleRange(rawPos, length,
+ COLOR_BLACK, COLOR_YELLOW, SWT.ITALIC));
+ data = new HashMap<>();
+ timeStampFormat = null;
+ updatePreviewLine(rootInputLine, matcher, data, rawPos, rootLineMatches);
+ if (rootLineMatches == 1) {
+ firstEntryTimeStamp = data.get(CustomTraceDefinition.TAG_TIMESTAMP);
+ firstEntryTimeStampInputFormat = timeStampFormat;
+ }
+ HashMap<InputLine, Integer> countMap = new HashMap<>();
+ InputLine currentInput = null;
+ if (rootInputLine.childrenInputs != null && rootInputLine.childrenInputs.size() > 0) {
+ currentInput = rootInputLine.childrenInputs.get(0);
+ countMap.put(currentInput, 0);
+ }
+ rawPos += length + 1; // +1 for \n
+ while (scanner.hasNext()) {
+ log = scanner.next();
+ length = log.length();
+ boolean processed = false;
+ if (currentInput == null) {
+ for (InputLine input : definition.inputs) {
+ matcher = input.getPattern().matcher(log);
+ if (matcher.find()) {
+ continue event;
+ }
}
- }
- } else {
- if (countMap.get(currentInput) >= currentInput.getMinCount()) {
- List<InputLine> nextInputs = currentInput.getNextInputs(countMap);
- if (nextInputs.size() == 0 || nextInputs.get(nextInputs.size() - 1).getMinCount() == 0) {
- for (InputLine input : definition.inputs) {
+ } else {
+ if (countMap.get(currentInput) >= currentInput.getMinCount()) {
+ List<InputLine> nextInputs = currentInput.getNextInputs(countMap);
+ if (nextInputs.size() == 0 || nextInputs.get(nextInputs.size() - 1).getMinCount() == 0) {
+ for (InputLine input : definition.inputs) {
+ matcher = input.getPattern().matcher(log);
+ if (matcher.find()) {
+ continue event;
+ }
+ }
+ }
+ for (InputLine input : nextInputs) {
matcher = input.getPattern().matcher(log);
if (matcher.find()) {
- continue event;
+ inputText.setStyleRange(new StyleRange(rawPos, length,
+ COLOR_BLACK, COLOR_LIGHT_YELLOW, SWT.ITALIC));
+ currentInput = input;
+ updatePreviewLine(currentInput, matcher, data, rawPos, rootLineMatches);
+ if (countMap.get(currentInput) == null) {
+ countMap.put(currentInput, 1);
+ } else {
+ countMap.put(currentInput, countMap.get(currentInput) + 1);
+ }
+ Iterator<InputLine> iter = countMap.keySet().iterator();
+ while (iter.hasNext()) {
+ InputLine inputLine = iter.next();
+ if (inputLine.level > currentInput.level) {
+ iter.remove();
+ }
+ }
+ if (currentInput.childrenInputs != null && currentInput.childrenInputs.size() > 0) {
+ currentInput = currentInput.childrenInputs.get(0);
+ countMap.put(currentInput, 0);
+ } else {
+ if (countMap.get(currentInput) >= currentInput.getMaxCount()) {
+ if (currentInput.getNextInputs(countMap).size() > 0) {
+ currentInput = currentInput.getNextInputs(countMap).get(0);
+ if (countMap.get(currentInput) == null) {
+ countMap.put(currentInput, 0);
+ }
+ iter = countMap.keySet().iterator();
+ while (iter.hasNext()) {
+ InputLine inputLine = iter.next();
+ if (inputLine.level > currentInput.level) {
+ iter.remove();
+ }
+ }
+ } else {
+ currentInput = null;
+ }
+ }
+ }
+ processed = true;
+ break;
}
}
}
- for (InputLine input : nextInputs) {
- matcher = input.getPattern().matcher(log);
+ if (!processed && currentInput != null) {
+ matcher = currentInput.getPattern().matcher(log);
if (matcher.find()) {
inputText.setStyleRange(new StyleRange(rawPos, length,
COLOR_BLACK, COLOR_LIGHT_YELLOW, SWT.ITALIC));
- currentInput = input;
updatePreviewLine(currentInput, matcher, data, rawPos, rootLineMatches);
- if (countMap.get(currentInput) == null) {
- countMap.put(currentInput, 1);
- } else {
- countMap.put(currentInput, countMap.get(currentInput) + 1);
- }
- Iterator<InputLine> iter = countMap.keySet().iterator();
- while (iter.hasNext()) {
- InputLine inputLine = iter.next();
- if (inputLine.level > currentInput.level) {
- iter.remove();
- }
- }
+ countMap.put(currentInput, countMap.get(currentInput) + 1);
if (currentInput.childrenInputs != null && currentInput.childrenInputs.size() > 0) {
currentInput = currentInput.childrenInputs.get(0);
countMap.put(currentInput, 0);
if (countMap.get(currentInput) == null) {
countMap.put(currentInput, 0);
}
- iter = countMap.keySet().iterator();
+ Iterator<InputLine> iter = countMap.keySet().iterator();
while (iter.hasNext()) {
InputLine inputLine = iter.next();
if (inputLine.level > currentInput.level) {
}
}
}
- processed = true;
- break;
- }
- }
- }
- if (!processed && currentInput != null) {
- matcher = currentInput.getPattern().matcher(log);
- if (matcher.find()) {
- inputText.setStyleRange(new StyleRange(rawPos, length,
- COLOR_BLACK, COLOR_LIGHT_YELLOW, SWT.ITALIC));
- updatePreviewLine(currentInput, matcher, data, rawPos, rootLineMatches);
- countMap.put(currentInput, countMap.get(currentInput) + 1);
- if (currentInput.childrenInputs != null && currentInput.childrenInputs.size() > 0) {
- currentInput = currentInput.childrenInputs.get(0);
- countMap.put(currentInput, 0);
- } else {
- if (countMap.get(currentInput) >= currentInput.getMaxCount()) {
- if (currentInput.getNextInputs(countMap).size() > 0) {
- currentInput = currentInput.getNextInputs(countMap).get(0);
- if (countMap.get(currentInput) == null) {
- countMap.put(currentInput, 0);
- }
- Iterator<InputLine> iter = countMap.keySet().iterator();
- while (iter.hasNext()) {
- InputLine inputLine = iter.next();
- if (inputLine.level > currentInput.level) {
- iter.remove();
- }
- }
- } else {
- currentInput = null;
- }
- }
}
}
}
+ rawPos += length + 1; // +1 for \n
}
- rawPos += length + 1; // +1 for \n
- }
- break;
- }
- }
- rawPos += length + 1; // +1 for \n
- log = null;
- }
- scanner.close();
- if (rootLineMatches == 1) {
- firstEntryTimeStamp = data.get(CustomTraceDefinition.TAG_TIMESTAMP);
- firstEntryTimeStampInputFormat = timeStampFormat;
- }
- if (firstEntryTimeStamp == null) {
- timestampPreviewText.setText(Messages.CustomTxtParserInputWizardPage_noTimestampGroup);
- if (selectedLine != null) {
- for (InputGroup group : selectedLine.inputs) {
- if (group.tagCombo.getText().equals(CustomTraceDefinition.TAG_TIMESTAMP)) {
- timestampPreviewText.setText(Messages.CustomTxtParserInputWizardPage_noMatchingTimestamp);
break;
}
}
+ rawPos += length + 1; // +1 for \n
+ log = null;
}
- } else {
- try {
- SimpleDateFormat dateFormat = new SimpleDateFormat(firstEntryTimeStampInputFormat);
- Date date = dateFormat.parse(firstEntryTimeStamp);
- dateFormat = new SimpleDateFormat(timestampOutputFormatText.getText().trim());
- timestampPreviewText.setText(dateFormat.format(date));
- } catch (ParseException e) {
- timestampPreviewText.setText("*parse exception* [" + firstEntryTimeStamp + "] <> [" + firstEntryTimeStampInputFormat + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- } catch (IllegalArgumentException e) {
- timestampPreviewText.setText("*parse exception* [Illegal Argument]"); //$NON-NLS-1$
+
+ if (rootLineMatches == 1) {
+ firstEntryTimeStamp = data.get(CustomTraceDefinition.TAG_TIMESTAMP);
+ firstEntryTimeStampInputFormat = timeStampFormat;
}
+ if (firstEntryTimeStamp == null) {
+ timestampPreviewText.setText(Messages.CustomTxtParserInputWizardPage_noTimestampGroup);
+ if (selectedLine != null) {
+ for (InputGroup group : selectedLine.inputs) {
+ if (group.tagCombo.getText().equals(CustomTraceDefinition.TAG_TIMESTAMP)) {
+ timestampPreviewText.setText(Messages.CustomTxtParserInputWizardPage_noMatchingTimestamp);
+ break;
+ }
+ }
+ }
+ } else {
+ try {
+ SimpleDateFormat dateFormat = new SimpleDateFormat(firstEntryTimeStampInputFormat);
+ Date date = dateFormat.parse(firstEntryTimeStamp);
+ dateFormat = new SimpleDateFormat(timestampOutputFormatText.getText().trim());
+ timestampPreviewText.setText(dateFormat.format(date));
+ } catch (ParseException e) {
+ timestampPreviewText.setText("*parse exception* [" + firstEntryTimeStamp + "] <> [" + firstEntryTimeStampInputFormat + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ } catch (IllegalArgumentException e) {
+ timestampPreviewText.setText("*parse exception* [Illegal Argument]"); //$NON-NLS-1$
+ }
+ }
}
}
private Label cardinalityMaxLabel;
private Text cardinalityMaxText;
private Button infiniteButton;
- private List<InputGroup> inputs = new ArrayList<InputGroup>();
+ private List<InputGroup> inputs = new ArrayList<>();
private Button addGroupButton;
private Label addGroupLabel;
inputLine.cardinality = Cardinality.ZERO_OR_MORE;
break;
}
- inputLine.columns = new ArrayList<InputData>(inputs.size());
+ inputLine.columns = new ArrayList<>(inputs.size());
for (int i = 0; i < inputs.size(); i++) {
InputGroup grp = inputs.get(i);
InputData inputData = new InputData();
private static final Image DOWN_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/down_button.gif"); //$NON-NLS-1$
private final CustomTxtParserWizard wizard;
private CustomTxtTraceDefinition definition;
- private List<Output> outputs = new ArrayList<Output>();
+ private List<Output> outputs = new ArrayList<>();
private Composite container;
private SashForm sash;
private ScrolledComposite outputsScrolledComposite;
private void updatePreviewTable() {
final int CACHE_SIZE = 50;
definition.outputs = extractOutputs();
+ tmpFile = Activator.getDefault().getStateLocation().addTrailingSeparator().append("customwizard.tmp").toFile(); //$NON-NLS-1$
- try {
- tmpFile = Activator.getDefault().getStateLocation().addTrailingSeparator().append("customwizard.tmp").toFile(); //$NON-NLS-1$
- final FileWriter writer = new FileWriter(tmpFile);
+ try (final FileWriter writer = new FileWriter(tmpFile);) {
writer.write(wizard.inputPage.getInputText());
- writer.close();
+ } catch (final IOException e) {
+ Activator.getDefault().logError("Error creating CustomTxtTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$
+ }
+ try {
final CustomTxtTrace trace = new CustomTxtTrace(null, definition, tmpFile.getAbsolutePath(), CACHE_SIZE);
trace.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, false);
previewTable.dispose();
previewTable.setTrace(trace, true);
} catch (final TmfTraceException e) {
Activator.getDefault().logError("Error creating CustomTxtTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$
- } catch (final IOException e) {
- Activator.getDefault().logError("Error creating CustomTxtTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$
}
tableContainer.layout();
numColumns++;
}
}
- final List<OutputColumn> outputColumns = new ArrayList<OutputColumn>(numColumns);
+ final List<OutputColumn> outputColumns = new ArrayList<>(numColumns);
numColumns = 0;
for (int i = 0; i < outputs.size(); i++) {
final Output output = outputs.get(i);
* @return The input names for this element
*/
public List<String> getInputNames(InputElement inputElement) {
- List<String> inputs = new ArrayList<String>();
+ List<String> inputs = new ArrayList<>();
if (inputElement.inputName != null && !inputElement.inputName.equals(CustomXmlTraceDefinition.TAG_IGNORE)) {
String inputName = inputElement.inputName;
if (!inputs.contains(inputName)) {
}
}
if (inputStream != null) {
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(inputStream));
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));) {
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n"); //$NON-NLS-1$
}
parseXmlInput(sb.toString());
- reader.close();
return sb.toString();
} catch (IOException e) {
return ""; //$NON-NLS-1$
private class ElementNode {
private final InputElement inputElement;
private final Group group;
- private List<Attribute> attributes = new ArrayList<Attribute>();
- private List<ElementNode> childElements = new ArrayList<ElementNode>();
+ private List<Attribute> attributes = new ArrayList<>();
+ private List<ElementNode> childElements = new ArrayList<>();
private Text elementNameText;
private Composite tagComposite;
private Combo tagCombo;
}
inputElement.inputAction = actionCombo.getSelectionIndex();
}
- inputElement.attributes = new ArrayList<InputAttribute>(attributes.size());
+ inputElement.attributes = new ArrayList<>(attributes.size());
for (int i = 0; i < attributes.size(); i++) {
Attribute attribute = attributes.get(i);
InputAttribute inputAttribute = new InputAttribute();
if (!documentElement.getNodeName().equals(definition.rootInputElement.elementName)) {
return null;
}
- ArrayList<String> elementNames = new ArrayList<String>();
+ ArrayList<String> elementNames = new ArrayList<>();
while (currentElement != null) {
elementNames.add(currentElement.elementName);
currentElement = currentElement.parentElement;
private static final Image DOWN_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/down_button.gif"); //$NON-NLS-1$
private final CustomXmlParserWizard wizard;
private CustomXmlTraceDefinition definition;
- private List<Output> outputs = new ArrayList<Output>();
+ private List<Output> outputs = new ArrayList<>();
private Composite container;
private SashForm sash;
private ScrolledComposite outputsScrolledComposite;
private void updatePreviewTable() {
final int CACHE_SIZE = 50;
definition.outputs = extractOutputs();
+ tmpFile = Activator.getDefault().getStateLocation().addTrailingSeparator().append("customwizard.tmp").toFile(); //$NON-NLS-1$
- try {
- tmpFile = Activator.getDefault().getStateLocation().addTrailingSeparator().append("customwizard.tmp").toFile(); //$NON-NLS-1$
- final FileWriter writer = new FileWriter(tmpFile);
+ try (final FileWriter writer = new FileWriter(tmpFile);) {
writer.write(wizard.inputPage.getInputText());
- writer.close();
+ } catch (final IOException e) {
+ Activator.getDefault().logError("Error creating CustomXmlTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$
+ }
+ try {
final CustomXmlTrace trace = new CustomXmlTrace(null, definition, tmpFile.getAbsolutePath(), CACHE_SIZE);
trace.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, false);
previewTable.dispose();
previewTable.setTrace(trace, true);
} catch (final TmfTraceException e) {
Activator.getDefault().logError("Error creating CustomXmlTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$
- } catch (final IOException e) {
- Activator.getDefault().logError("Error creating CustomXmlTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$
}
tableContainer.layout();
numColumns++;
}
}
- final List<OutputColumn> outputColumns = new ArrayList<OutputColumn>(numColumns);
+ final List<OutputColumn> outputColumns = new ArrayList<>(numColumns);
numColumns = 0;
for (int i = 0; i < outputs.size(); i++) {
final Output output = outputs.get(i);
TreeSelection sel = (TreeSelection) selection;
// There should be only one item selected as per the plugin.xml
Object element = sel.getFirstElement();
- List<IResource> resourcesList = new ArrayList<IResource>();
+ List<IResource> resourcesList = new ArrayList<>();
if (element instanceof TmfExperimentElement) {
resourcesList.addAll(experimentResources);
// Map to know which trace to close for each resource
- HashMap<IResource, TmfTraceElement> traceMap = new HashMap<IResource, TmfTraceElement>();
+ HashMap<IResource, TmfTraceElement> traceMap = new HashMap<>();
for (TmfTraceElement aTrace : experiment.getTraces()) {
return null;
}
- List<WorkspaceModifyOperation> removeOps = new ArrayList<WorkspaceModifyOperation>();
+ List<WorkspaceModifyOperation> removeOps = new ArrayList<>();
TmfExperimentFolder experimentFolder = newTrace.getProject().getExperimentsFolder();
for (final ITmfProjectModelElement experiment : experimentFolder.getChildren()) {
for (final ITmfProjectModelElement trace : experiment.getChildren()) {
@Override
protected IContributionItem[] getContributionItems() {
- Set<String> selectedTraceTypes = new HashSet<String>();
+ Set<String> selectedTraceTypes = new HashSet<>();
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = window.getActivePage();
ISelection selection = page.getSelection();
}
}
- List<IContributionItem> list = new LinkedList<IContributionItem>();
+ List<IContributionItem> list = new LinkedList<>();
- Map<String, MenuManager> categoriesMap = new HashMap<String, MenuManager>();
+ Map<String, MenuManager> categoriesMap = new HashMap<>();
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(
TmfTraceType.TMF_TRACE_TYPE_ID);
for (IConfigurationElement ce : config) {
MenuManager subMenu) {
Map<String, String> params;
- params = new HashMap<String, String>();
+ params = new HashMap<>();
params.put(BUNDLE_PARAMETER, traceBundle);
params.put(TYPE_PARAMETER, traceTypeId);
params.put(ICON_PARAMETER, traceIcon);
if (window == null) {
return null;
}
- List<IStatus> statuses = new ArrayList<IStatus>();
+ List<IStatus> statuses = new ArrayList<>();
boolean ok = true;
for (Object element : fSelection.toList()) {
TmfTraceElement trace = (TmfTraceElement) element;
// Make sure selection contains only traces
fSelection = null;
- final ArrayList<TmfTraceElement> tl = new ArrayList<TmfTraceElement>();
- final ArrayList<TmfExperimentElement> uiexperiment = new ArrayList<TmfExperimentElement>();
+ final ArrayList<TmfTraceElement> tl = new ArrayList<>();
+ final ArrayList<TmfExperimentElement> uiexperiment = new ArrayList<>();
if (selection instanceof TreeSelection) {
fSelection = (TreeSelection) selection;
Iterator<Object> iterator = fSelection.iterator();
@Override
public Enumeration<? extends ArchiveEntry> entries() {
- Vector<ArchiveEntry> v = new Vector<ArchiveEntry>();
+ Vector<ArchiveEntry> v = new Vector<>();
for (Enumeration<?> e = fTarFile.entries(); e.hasMoreElements();) {
v.add(new TarArchiveEntry((TarEntry) e.nextElement()));
}
@Override
public Enumeration<? extends ArchiveEntry> entries() {
- Vector<ArchiveEntry> v = new Vector<ArchiveEntry>();
+ Vector<ArchiveEntry> v = new Vector<>();
for (Enumeration<?> e = fZipFile.entries(); e.hasMoreElements();) {
v.add(new ZipAchiveEntry((ZipEntry) e.nextElement()));
}
}
private static String[] addToHistory(String[] history, String newEntry) {
- ArrayList<String> l = new ArrayList<String>(Arrays.asList(history));
+ ArrayList<String> l = new ArrayList<>(Arrays.asList(history));
addToHistory(l, newEntry);
String[] r = new String[l.size()];
l.toArray(r);
ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
IStructuredSelection sec = StructuredSelection.EMPTY;
- List<TmfTraceElement> selectedTraces = new ArrayList<TmfTraceElement>();
+ List<TmfTraceElement> selectedTraces = new ArrayList<>();
if (currentSelection instanceof IStructuredSelection) {
sec = (IStructuredSelection) currentSelection;
Object[] selectedElements = sec.toArray();
private ArrayList<TmfTraceElement> getCheckedTraces() {
TableItem[] items = fTraceTable.getItems();
- ArrayList<TmfTraceElement> traces = new ArrayList<TmfTraceElement>();
+ ArrayList<TmfTraceElement> traces = new ArrayList<>();
for (TableItem item : items) {
if (item.getChecked()) {
TmfTraceElement trace = (TmfTraceElement) item.getData();
section = workbenchSettings.addNewSection(STORE_EXPORT_TRACE_WIZARD);
}
setDialogSettings(section);
- fSelectedTraces = new ArrayList<TmfTraceElement>();
+ fSelectedTraces = new ArrayList<>();
}
/**
@Override
protected Object createElementViewerInput() {
- List<TracePackageTraceElement> traceElements = new ArrayList<TracePackageTraceElement>();
+ List<TracePackageTraceElement> traceElements = new ArrayList<>();
for (TmfTraceElement tmfTraceElement : fSelectedTraces) {
TracePackageTraceElement traceElement = new TracePackageTraceElement(null, tmfTraceElement);
// Trace files
- List<TracePackageElement> children = new ArrayList<TracePackageElement>();
+ List<TracePackageElement> children = new ArrayList<>();
TracePackageFilesElement filesElement = new TracePackageFilesElement(traceElement, tmfTraceElement.getResource());
filesElement.setChecked(true);
children.add(filesElement);
// Supplementary files
IResource[] supplementaryResources = tmfTraceElement.getSupplementaryResources();
- List<TracePackageElement> suppFilesChildren = new ArrayList<TracePackageElement>();
+ List<TracePackageElement> suppFilesChildren = new ArrayList<>();
TracePackageSupplFilesElement suppFilesElement = new TracePackageSupplFilesElement(traceElement);
children.add(suppFilesElement);
for (IResource res : supplementaryResources) {
private boolean checkForOverwrite() {
TracePackageElement[] traceElements = (TracePackageElement[]) getElementViewer().getInput();
- List<TracePackageTraceElement> noImportTraces = new ArrayList<TracePackageTraceElement>();
+ List<TracePackageTraceElement> noImportTraces = new ArrayList<>();
boolean noToAll = false;
for (TracePackageElement packageElement : traceElements) {
TracePackageTraceElement traceElement = (TracePackageTraceElement) packageElement;
fTraceExportElements = traceExportElements;
fUseCompression = useCompression;
fUseTar = useTar;
- fResources = new HashSet<IResource>();
+ fResources = new HashSet<>();
}
/**
}
private IStatus exportToArchive(IProgressMonitor monitor, int totalWork) throws InvocationTargetException, InterruptedException {
- ArchiveFileExportOperation op = new ArchiveFileExportOperation(new ArrayList<IResource>(fResources), getFileName());
+ ArchiveFileExportOperation op = new ArchiveFileExportOperation(new ArrayList<>(fResources), getFileName());
op.setCreateLeadupStructure(false);
op.setUseCompression(fUseCompression);
op.setUseTarFormat(fUseTar);
private TracePackageElement[] generateElementsFromArchive() {
ArchiveFile archiveFile = getSpecifiedArchiveFile();
Enumeration<?> entries = archiveFile.entries();
- Set<String> traceFileNames = new HashSet<String>();
+ Set<String> traceFileNames = new HashSet<>();
while (entries.hasMoreElements()) {
ArchiveEntry entry = (ArchiveEntry) entries.nextElement();
String entryName = entry.getName();
}
}
- List<TracePackageElement> packageElements = new ArrayList<TracePackageElement>();
+ List<TracePackageElement> packageElements = new ArrayList<>();
for (String traceFileName : traceFileNames) {
TracePackageTraceElement traceElement = new TracePackageTraceElement(null, traceFileName, null);
traceElement.setChildren(new TracePackageElement[] { new TracePackageFilesElement(traceElement, traceFileName) });
}
private static TracePackageElement[] loadElementsFromManifest(InputStream inputStream) throws IOException, SAXException, ParserConfigurationException {
- List<TracePackageElement> packageElements = new ArrayList<TracePackageElement>();
+ List<TracePackageElement> packageElements = new ArrayList<>();
TracePackageElement element = null;
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
String traceType = traceElement.getAttribute(ITracePackageConstants.TRACE_TYPE_ATTRIB);
element = new TracePackageTraceElement(null, traceName, traceType);
- List<TracePackageElement> children = new ArrayList<TracePackageElement>();
+ List<TracePackageElement> children = new ArrayList<>();
NodeList fileElements = traceElement.getElementsByTagName(ITracePackageConstants.TRACE_FILE_ELEMENT);
for (int j = 0; j < fileElements.getLength(); ++j) {
Node fileNode = fileElements.item(j);
TracePackageSupplFilesElement supplFilesElement = new TracePackageSupplFilesElement(element);
// Supplementary files
- List<TracePackageSupplFileElement> suppFiles = new ArrayList<TracePackageSupplFileElement>();
+ List<TracePackageSupplFileElement> suppFiles = new ArrayList<>();
NodeList suppFilesElements = traceElement.getElementsByTagName(ITracePackageConstants.SUPPLEMENTARY_FILE_ELEMENT);
for (int j = 0; j < suppFilesElements.getLength(); ++j) {
Node suppFileNode = suppFilesElements.item(j);
}
// bookmarks
- List<Map<String, String>> bookmarkAttribs = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> bookmarkAttribs = new ArrayList<>();
NodeList bookmarksElements = traceElement.getElementsByTagName(ITracePackageConstants.BOOKMARKS_ELEMENT);
for (int j = 0; j < bookmarksElements.getLength(); ++j) {
Node bookmarksNode = bookmarksElements.item(j);
if (bookmarkNode.getNodeType() == Node.ELEMENT_NODE) {
Element bookmarkElement = (Element) bookmarkNode;
NamedNodeMap attributesMap = bookmarkElement.getAttributes();
- Map<String, String> attribs = new HashMap<String, String>();
+ Map<String, String> attribs = new HashMap<>();
for (int l = 0; l < attributesMap.getLength(); ++l) {
Node item = attributesMap.item(l);
attribs.put(item.getNodeName(), item.getNodeValue());
}
private IStatus importTraceFiles(TracePackageFilesElement traceFilesElement, IProgressMonitor monitor) {
- List<String> fileNames = new ArrayList<String>();
+ List<String> fileNames = new ArrayList<>();
fileNames.add(traceFilesElement.getFileName());
IPath containerPath = fTmfTraceFolder.getPath();
IStatus status = importFiles(getSpecifiedArchiveFile(), fileNames, containerPath, monitor);
}
private IStatus importSupplFiles(TracePackageSupplFilesElement suppFilesElement, TracePackageTraceElement traceElement, IProgressMonitor monitor) {
- List<String> fileNames = new ArrayList<String>();
+ List<String> fileNames = new ArrayList<>();
for (TracePackageElement child : suppFilesElement.getChildren()) {
TracePackageSupplFileElement supplFile = (TracePackageSupplFileElement) child;
fileNames.add(supplFile.getText());
}
private IStatus importFiles(ArchiveFile archiveFile, List<String> fileNames, IPath destinationContainerPath, IProgressMonitor monitor) {
- List<ArchiveProviderElement> objects = new ArrayList<ArchiveProviderElement>();
+ List<ArchiveProviderElement> objects = new ArrayList<>();
Enumeration<?> entries = archiveFile.entries();
while (entries.hasMoreElements()) {
ArchiveEntry entry = (ArchiveEntry) entries.nextElement();
* @return Array of analysis elements
*/
public List<TmfAnalysisOutputElement> getAvailableOutputs() {
- List<TmfAnalysisOutputElement> list = new ArrayList<TmfAnalysisOutputElement>();
+ List<TmfAnalysisOutputElement> list = new ArrayList<>();
IAnalysisModuleHelper helper = TmfAnalysisManager.getAnalysisModule(fAnalysisId);
if (helper == null) {
*/
public List<TmfTraceElement> getTraces() {
List<ITmfProjectModelElement> children = getChildren();
- List<TmfTraceElement> traces = new ArrayList<TmfTraceElement>();
+ List<TmfTraceElement> traces = new ArrayList<>();
for (ITmfProjectModelElement child : children) {
if (child instanceof TmfTraceElement) {
traces.add((TmfTraceElement) child);
* @since 3.0
*/
public List<TmfAnalysisElement> getAvailableAnalysis() {
- List<TmfAnalysisElement> list = new ArrayList<TmfAnalysisElement>();
+ List<TmfAnalysisElement> list = new ArrayList<>();
/**
* TODO : implement this cleanly and test it when experiment types are
private Object[] getProjectChildren(IProject project) {
// The children structure
- List<Object> children = new ArrayList<Object>();
+ List<Object> children = new ArrayList<>();
// Get the children from the model
- Map<String, ITmfProjectModelElement> childrenMap = new HashMap<String, ITmfProjectModelElement>();
+ Map<String, ITmfProjectModelElement> childrenMap = new HashMap<>();
TmfProjectElement tmfProject = TmfProjectRegistry.getProject(project, true);
for (ITmfProjectModelElement element : tmfProject.getChildren()) {
if (element instanceof TmfTraceFolder) {
private Object[] getTraceFolderChildren(TmfTraceFolder tmfTraceFolder) {
// The children structure
- List<Object> children = new ArrayList<Object>();
+ List<Object> children = new ArrayList<>();
// Get the children from the model
- Map<String, ITmfProjectModelElement> childrenMap = new HashMap<String, ITmfProjectModelElement>();
+ Map<String, ITmfProjectModelElement> childrenMap = new HashMap<>();
for (ITmfProjectModelElement element : tmfTraceFolder.getChildren()) {
if (element instanceof TmfTraceElement) {
String name = element.getResource().getName();
private Object[] getExperimentFolderChildren(TmfExperimentFolder tmfExperimentFolder) {
// The children structure
- List<Object> children = new ArrayList<Object>();
+ List<Object> children = new ArrayList<>();
// Get the children from the model
- Map<String, ITmfProjectModelElement> childrenMap = new HashMap<String, ITmfProjectModelElement>();
+ Map<String, ITmfProjectModelElement> childrenMap = new HashMap<>();
for (ITmfProjectModelElement element : tmfExperimentFolder.getChildren()) {
if (element instanceof TmfExperimentElement) {
String name = element.getResource().getName();
private Object[] getExperimentChildren(TmfExperimentElement tmfExperiment) {
// The children structure
- List<Object> children = new ArrayList<Object>();
+ List<Object> children = new ArrayList<>();
// Get the children from the model
- Map<String, ITmfProjectModelElement> childrenMap = new HashMap<String, ITmfProjectModelElement>();
+ Map<String, ITmfProjectModelElement> childrenMap = new HashMap<>();
for (ITmfProjectModelElement element : tmfExperiment.getChildren()) {
if (element instanceof TmfTraceElement) {
String name = element.getResource().getName();
private static Object[] getTraceChildren(TmfTraceElement parentElement) {
// The children structure
- List<Object> children = new ArrayList<Object>();
+ List<Object> children = new ArrayList<>();
for (TmfAnalysisElement analysis : parentElement.getAvailableAnalysis()) {
children.add(analysis);
private static Object[] getAnalysisChildren(TmfAnalysisElement parentElement) {
// The children structure
- List<Object> children = new ArrayList<Object>();
+ List<Object> children = new ArrayList<>();
for (TmfAnalysisOutputElement output : parentElement.getAvailableOutputs()) {
children.add(output);
private void cleanupModel(ITmfProjectModelElement parent, Map<String, ITmfProjectModelElement> danglingChildren) {
if (parent != null) {
for (ITmfProjectModelElement child : danglingChildren.values()) {
- Map<String, ITmfProjectModelElement> grandChildren = new HashMap<String, ITmfProjectModelElement>();
+ Map<String, ITmfProjectModelElement> grandChildren = new HashMap<>();
for (ITmfProjectModelElement element : child.getChildren()) {
String name = element.getResource().getName();
grandChildren.put(name, element);
fPath = resource.getFullPath();
fLocation = resource.getLocationURI();
fParent = parent;
- fChildren = new ArrayList<ITmfProjectModelElement>();
+ fChildren = new ArrayList<>();
ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
}
public class TmfProjectRegistry {
// The map of project resource to project model elements
- private static Map<IProject, TmfProjectElement> registry = new HashMap<IProject, TmfProjectElement>();
+ private static Map<IProject, TmfProjectElement> registry = new HashMap<>();
/**
* Get the project model element for a project resource
// The mapping of available trace type IDs to their corresponding
// configuration element
- private static final Map<String, IConfigurationElement> sfTraceTypeAttributes = new HashMap<String, IConfigurationElement>();
- private static final Map<String, IConfigurationElement> sfTraceCategories = new HashMap<String, IConfigurationElement>();
+ private static final Map<String, IConfigurationElement> sfTraceTypeAttributes = new HashMap<>();
+ private static final Map<String, IConfigurationElement> sfTraceCategories = new HashMap<>();
/**
* Initialize statically at startup by getting extensions from the platform
}
}
}
- return new HashMap<String, String>();
+ return new HashMap<>();
}
@Override
// Propagate the removal to traces
for (ITmfProjectModelElement experiment : experimentFolder.getChildren()) {
- List<ITmfProjectModelElement> toRemove = new LinkedList<ITmfProjectModelElement>();
+ List<ITmfProjectModelElement> toRemove = new LinkedList<>();
for (ITmfProjectModelElement child : experiment.getChildren()) {
if (child.getName().equals(getName())) {
toRemove.add(child);
* @since 3.0
*/
public List<TmfAnalysisElement> getAvailableAnalysis() {
- List<TmfAnalysisElement> list = new ArrayList<TmfAnalysisElement>();
+ List<TmfAnalysisElement> list = new ArrayList<>();
TraceTypeHelper helper = TmfTraceType.getInstance().getTraceType(getTraceType());
*/
public List<TmfTraceElement> getTraces() {
List<ITmfProjectModelElement> children = getChildren();
- List<TmfTraceElement> traces = new ArrayList<TmfTraceElement>();
+ List<TmfTraceElement> traces = new ArrayList<>();
for (ITmfProjectModelElement child : children) {
if (child instanceof TmfTraceElement) {
traces.add((TmfTraceElement) child);
// The mapping of available trace type IDs to their corresponding
// configuration element
- private final Map<String, IConfigurationElement> fTraceTypeAttributes = new HashMap<String, IConfigurationElement>();
- private final Map<String, IConfigurationElement> fTraceCategories = new HashMap<String, IConfigurationElement>();
- private final Map<String, TraceTypeHelper> fTraceTypes = new LinkedHashMap<String, TraceTypeHelper>();
+ private final Map<String, IConfigurationElement> fTraceTypeAttributes = new HashMap<>();
+ private final Map<String, IConfigurationElement> fTraceCategories = new HashMap<>();
+ private final Map<String, TraceTypeHelper> fTraceTypes = new LinkedHashMap<>();
private static TmfTraceType fInstance = null;
public static IConfigurationElement[] getTypeElements() {
IConfigurationElement[] elements = Platform.getExtensionRegistry()
.getConfigurationElementsFor(TMF_TRACE_TYPE_ID);
- List<IConfigurationElement> typeElements = new LinkedList<IConfigurationElement>();
+ List<IConfigurationElement> typeElements = new LinkedList<>();
for (IConfigurationElement element : elements) {
if (element.getName().equals(TYPE_ELEM)) {
typeElements.add(element);
public String[] getAvailableTraceTypes() {
// Generate the list of Category:TraceType to populate the ComboBox
- List<String> traceTypes = new ArrayList<String>();
+ List<String> traceTypes = new ArrayList<>();
// re-populate custom trace types
getCustomTraceTypes();
* @since 2.0
*/
public static List<String> getCustomTraceTypes(String type) {
- List<String> traceTypes = new ArrayList<String>();
+ List<String> traceTypes = new ArrayList<>();
if (type.equals(CUSTOM_TXT_CATEGORY)) {
for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
String traceTypeName = def.definitionName;
* @since 2.0
*/
public List<String> getCustomTraceTypes() {
- List<String> traceTypes = new ArrayList<String>();
+ List<String> traceTypes = new ArrayList<>();
// remove the customTraceTypes
final String[] keySet = fTraceTypes.keySet().toArray(new String[0]);
for (String key : keySet) {
* @since 2.0
*/
public List<String> getTraceCategories() {
- List<String> categoryNames = new ArrayList<String>();
+ List<String> categoryNames = new ArrayList<>();
for (String key : fTraceTypes.keySet()) {
final String categoryName = fTraceTypes.get(key).getCategoryName();
if (!categoryNames.contains(categoryName)) {
public List<TraceTypeHelper> getTraceTypes(String categoryName) {
init();
- List<TraceTypeHelper> traceNames = new ArrayList<TraceTypeHelper>();
+ List<TraceTypeHelper> traceNames = new ArrayList<>();
for (String key : fTraceTypes.keySet()) {
final String storedCategoryName = fTraceTypes.get(key).getCategoryName();
if (storedCategoryName.equals(categoryName)) {
private static List<File> isolateTraces(List<FileSystemElement> selectedResources) {
- List<File> traces = new ArrayList<File>();
+ List<File> traces = new ArrayList<>();
// Get the selection
Iterator<FileSystemElement> resources = selectedResources.iterator();
// Get the sorted list of unique entries
- Map<String, File> fileSystemObjects = new HashMap<String, File>();
+ Map<String, File> fileSystemObjects = new HashMap<>();
while (resources.hasNext()) {
File resource = (File) resources.next().getFileSystemObject();
String key = resource.getAbsolutePath();
fileSystemObjects.put(key, resource);
}
- List<String> files = new ArrayList<String>(fileSystemObjects.keySet());
+ List<String> files = new ArrayList<>(fileSystemObjects.keySet());
Collections.sort(files);
// After sorting, traces correspond to the unique prefixes
* @since 2.2
*/
public TraceTypeHelper selectTraceType(String path, Shell shell, String traceTypeHint) throws TmfTraceImportException {
- List<TraceTypeHelper> validCandidates = new ArrayList<TraceTypeHelper>();
+ List<TraceTypeHelper> validCandidates = new ArrayList<>();
getCustomTraceTypes();
final Set<String> traceTypes = fTraceTypes.keySet();
for (String traceType : traceTypes) {
}
private static List<TraceTypeHelper> reduce(List<TraceTypeHelper> candidates) {
- List<TraceTypeHelper> retVal = new ArrayList<TraceTypeHelper>();
+ List<TraceTypeHelper> retVal = new ArrayList<>();
// get all the tracetypes that are unique in that stage
for (TraceTypeHelper trace : candidates) {
}
private TraceTypeHelper getTraceTypeToSet(List<TraceTypeHelper> candidates, Shell shell) {
- final Map<String, String> names = new HashMap<String, String>();
+ final Map<String, String> names = new HashMap<>();
Shell shellToShow = new Shell(shell);
shellToShow.setText(Messages.TmfTraceType_SelectTraceType);
final String candidatesToSet[] = new String[1];
public Object[] getElements(Object inputElement) {
if (inputElement instanceof TmfTraceFolder) {
TmfTraceFolder folder = (TmfTraceFolder) inputElement;
- List<ITmfProjectModelElement> elements = new ArrayList<ITmfProjectModelElement>();
+ List<ITmfProjectModelElement> elements = new ArrayList<>();
for (ITmfProjectModelElement element : folder.getChildren()) {
if (element instanceof TmfTraceElement) {
TmfTraceElement trace = (TmfTraceElement) element;
*/
public static List<IProject> getOpenedTmfProjects() {
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- List<IProject> tmfProjects = new ArrayList<IProject>();
+ List<IProject> tmfProjects = new ArrayList<>();
for (IProject project : projects) {
try {
if (project.isAccessible() && project.getNature(TmfProjectNature.ID) != null) {
tableColumn.setText(Messages.SelectTracesWizardPage_TraceColumnHeader);
// Get the list of traces already part of the experiment
- fPreviousTraces = new HashMap<String, TmfTraceElement>();
+ fPreviousTraces = new HashMap<>();
for (ITmfProjectModelElement child : fExperiment.getChildren()) {
if (child instanceof TmfTraceElement) {
TmfTraceElement trace = (TmfTraceElement) child;
* Get the list of selected traces
*/
private TmfTraceElement[] getSelection() {
- Vector<TmfTraceElement> traces = new Vector<TmfTraceElement>();
+ Vector<TmfTraceElement> traces = new Vector<>();
Object[] selection = fCheckboxTableViewer.getCheckedElements();
for (Object sel : selection) {
if (sel instanceof TmfTraceElement) {
private IWizardPage fSelectTypePage;
private IWizardPage fOptions;
- private final List<String> fTraceTypesToScan = new ArrayList<String>();
- private final Set<String> fParentFilesToScan = new HashSet<String>();
+ private final List<String> fTraceTypesToScan = new ArrayList<>();
+ private final Set<String> fParentFilesToScan = new HashSet<>();
private ImportTraceContentProvider fScannedTraces = new ImportTraceContentProvider(fTraceTypesToScan, fParentFilesToScan);
- private final Map<TraceValidationHelper, Boolean> fResults = new HashMap<TraceValidationHelper, Boolean>();
+ private final Map<TraceValidationHelper, Boolean> fResults = new HashMap<>();
private boolean fOverwrite = true;
private boolean fLinked = true;
private BlockingQueue<TraceValidationHelper> fTracesToScan;
- private final Set<FileAndName> fTraces = new TreeSet<FileAndName>();
+ private final Set<FileAndName> fTraces = new TreeSet<>();
- private Map<String, Set<String>> fParentFiles = new HashMap<String, Set<String>>();
+ private Map<String, Set<String>> fParentFiles = new HashMap<>();
// Target import directory ('Traces' folder)
private IFolder fTargetFolder;
}
}
else {
- List<File> subList = new ArrayList<File>();
+ List<File> subList = new ArrayList<>();
IPath path = fTargetFolder.getFullPath();
File parentFile = traceToImport.getFile();
final boolean isFile = parentFile.isFile();
if (fOverwrite || !resource.exists()) {
subList.add(parentFile);
parentFile = parentFile.getParentFile();
- final FileInputStream source = new FileInputStream(traceToImport.getFile());
- if (resource.exists()) {
- resource.delete(IResource.FORCE, new NullProgressMonitor());
+ try (final FileInputStream source = new FileInputStream(traceToImport.getFile());) {
+ if (resource.exists()) {
+ resource.delete(IResource.FORCE, new NullProgressMonitor());
+ }
+ resource.create(source, true, new NullProgressMonitor());
}
- resource.create(source, true, new NullProgressMonitor());
- source.close();
setTraceType(traceToImport);
success = true;
}
public void setTraceTypesToScan(List<String> tracesToScan) {
// intersection to know if there's a diff.
// if there's a diff, we need to re-enque everything
- List<String> added = new ArrayList<String>();
+ List<String> added = new ArrayList<>();
for (String traceLoc : tracesToScan) {
if (!fTraceTypesToScan.contains(traceLoc)) {
added.add(traceLoc);
private void updateTracesToScan(final List<String> added) {
// Treeset is used instead of a hashset since the traces should be read
// in the order they were added.
- final Set<String> filesToScan = new TreeSet<String>();
+ final Set<String> filesToScan = new TreeSet<>();
for (String name : fParentFiles.keySet()) {
filesToScan.addAll(fParentFiles.get(name));
}
* I am a job. Make me work
*/
private synchronized IStatus updateFiles(IProgressMonitor monitor, String traceToScanAbsPath) {
- final Set<String> filesToScan = new TreeSet<String>();
+ final Set<String> filesToScan = new TreeSet<>();
int workToDo = 1;
for (String name : fParentFiles.keySet()) {
*/
class ImportTraceContentProvider implements ITreeContentProvider {
- private final Map<String, String> fTraceTypes = new HashMap<String, String>();
- private final Map<String, Set<FileAndName>> fTraceFiles = new HashMap<String, Set<FileAndName>>();
+ private final Map<String, String> fTraceTypes = new HashMap<>();
+ private final Map<String, Set<FileAndName>> fTraceFiles = new HashMap<>();
private final List<String> fTraceTypesToScan;
private final Set<String> fParentFilesToScan;
@Override
public synchronized Object[] getElements(Object inputElement) {
- List<String> candidates = new ArrayList<String>();
+ List<String> candidates = new ArrayList<>();
for (String candidate : fTraceTypesToScan) {
for (Entry<String, String> entry : fTraceTypes.entrySet()) {
if (parentElement instanceof String) {
final Set<FileAndName> children = fTraceFiles.get(fTraceTypes.get(parentElement));
if (children != null) {
- Set<FileAndName> candidates = new TreeSet<FileAndName>();
+ Set<FileAndName> candidates = new TreeSet<>();
for (FileAndName child : children) {
for (String parent : fParentFilesToScan) {
// this is going to be slow, but less slow than UI
public class ImportTraceWizardPageOptions extends AbstractImportTraceWizardPage {
private List fProjects;
- private final Map<String, IProject> fProjectsMap = new LinkedHashMap<String, IProject>();
+ private final Map<String, IProject> fProjectsMap = new LinkedHashMap<>();
/**
* Import page that tells where the trace will go
private CheckboxTreeViewer traceTypeViewer;
final ScanRunnable fRunnable = new ScanRunnable("Scan job"); //$NON-NLS-1$
- final private BlockingQueue<TraceValidationHelper> fTracesToScan = new ArrayBlockingQueue<TraceValidationHelper>(MAX_TRACES);
+ final private BlockingQueue<TraceValidationHelper> fTracesToScan = new ArrayBlockingQueue<>(MAX_TRACES);
private volatile boolean fCanRun = true;
// --------------------------------------------------------------------------------
@Override
public boolean canFlipToNextPage() {
- List<String> tracesToScan = new ArrayList<String>();
+ List<String> tracesToScan = new ArrayList<>();
String elements[] = (String[]) fProvider.getElements(null);
for (String traceFamily : elements) {
final TraceTypeHelper[] children = (TraceTypeHelper[]) fProvider.getChildren(traceFamily);
*/
public class TraceTypeContentProvider implements ITreeContentProvider {
- private final List<String> fTraceCategory = new ArrayList<String>();
- private final Map<String, List<TraceTypeHelper>> fTraceType = new HashMap<String, List<TraceTypeHelper>>();
+ private final List<String> fTraceCategory = new ArrayList<>();
+ private final Map<String, List<TraceTypeHelper>> fTraceType = new HashMap<>();
/**
* Default Constructor
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
- List<IPropertyDescriptor> descriptors= new ArrayList<IPropertyDescriptor>(fContent.getFields().length);
+ List<IPropertyDescriptor> descriptors= new ArrayList<>(fContent.getFields().length);
for (ITmfEventField field : fContent.getFields()) {
if (field != null) {
descriptors.add(new ReadOnlyTextPropertyDescriptor(field, field.getName()));
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
- List<IPropertyDescriptor> descriptors= new ArrayList<IPropertyDescriptor>();
+ List<IPropertyDescriptor> descriptors= new ArrayList<>();
if (fSourceLookup.getCallsite() != null) {
descriptors.add(new ReadOnlyTextPropertyDescriptor(ID_FILE_NAME, NAME_FILE_NAME));
descriptors.add(new ReadOnlyTextPropertyDescriptor(ID_LINE_NUMBER, NAME_LINE_NUMBER));
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
- List<IPropertyDescriptor> descriptors = new ArrayList<IPropertyDescriptor>();
+ List<IPropertyDescriptor> descriptors = new ArrayList<>();
for (String customAttribute : event.listCustomAttributes()) {
descriptors.add(new ReadOnlyTextPropertyDescriptor(customAttribute, customAttribute));
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
- List<IPropertyDescriptor> descriptors= new ArrayList<IPropertyDescriptor>();
+ List<IPropertyDescriptor> descriptors= new ArrayList<>();
/* Display basic event information */
descriptors.add(new ReadOnlyTextPropertyDescriptor(ID_TIMESTAMP, NAME_TIMESTAMP));
private ITmfTrace fTrace;
private final TmfEventsTable fTable;
private ITmfFilter fFilter;
- private final List<Integer> fFilterIndex = new ArrayList<Integer>(); // contains the event rank at each 'cache size' filtered events
+ private final List<Integer> fFilterIndex = new ArrayList<>(); // contains the event rank at each 'cache size' filtered events
/**
* Constructor for the event cache
private ListenerList selectionChangedListeners = new ListenerList();
// Bookmark map <Rank, MarkerId>
- private Map<Long, Long> fBookmarksMap = new HashMap<Long, Long>();
+ private Map<Long, Long> fBookmarksMap = new HashMap<>();
private IFile fBookmarksFile;
private long fPendingGotoRank = -1;
try {
String fileName = cs.getFileName();
final String trimmedPath = fileName.replaceAll("\\.\\./", ""); //$NON-NLS-1$ //$NON-NLS-2$
- final ArrayList<IFile> files = new ArrayList<IFile>();
+ final ArrayList<IFile> files = new ArrayList<>();
ResourcesPlugin.getWorkspace().getRoot().accept(new IResourceVisitor() {
@Override
public boolean visit(IResource resource) throws CoreException {
IHandlerService handlerService = (IHandlerService) activePage.getActiveEditor().getSite().getService(IHandlerService.class);
ICommandService cmdService = (ICommandService) activePage.getActiveEditor().getSite().getService(ICommandService.class);
try {
- HashMap<String, Object> parameters = new HashMap<String, Object>();
+ HashMap<String, Object> parameters = new HashMap<>();
StringBuilder header = new StringBuilder();
boolean needTab = false;
for (TableColumn tc: fTable.getColumns()) {
if (fTable == null || fTable.isDisposed()) {
return StructuredSelection.EMPTY;
}
- List<Object> list = new ArrayList<Object>(fTable.getSelection().length);
+ List<Object> list = new ArrayList<>(fTable.getSelection().length);
for (TableItem item : fTable.getSelection()) {
if (item.getData() != null) {
list.add(item.getData());
/**
* Level for which statistics should not be displayed.
*/
- protected Set<String> fFolderLevels = new HashSet<String>(Arrays.asList(new String[] { "Event Types" })); //$NON-NLS-1$
+ protected Set<String> fFolderLevels = new HashSet<>(Arrays.asList(new String[] { "Event Types" })); //$NON-NLS-1$
/**
* Create basic columns to represent the statistics data
*/
public TmfBaseColumnDataProvider() {
/* List that will be used to create the table. */
- fColumnData = new Vector<TmfBaseColumnData>();
+ fColumnData = new Vector<>();
/* Column showing the name of the events and its level in the tree */
fColumnData.add(new TmfBaseColumnData(LEVEL_COLUMN, 200, SWT.LEFT, LEVEL_COLUMN_TIP, new ColumnLabelProvider() {
@Override
/**
* Contains the experiment name as the key and the traces data
*/
- private static final Map<String, TmfStatisticsTree> fTreeInstances = new HashMap<String, TmfStatisticsTree>();
+ private static final Map<String, TmfStatisticsTree> fTreeInstances = new HashMap<>();
/**
* Provide a statisticsTree instance per trace
fTree = tree;
fPath = path;
fParent = parent;
- fChildren = new HashMap<String, TmfStatisticsTreeNode>();
+ fChildren = new HashMap<>();
fValues = new TmfStatisticsValues();
}
private String fFunctionName;
private long fStartTime;
private long fEndTime;
- private List<ITimeEvent> fEventList = new ArrayList<ITimeEvent>(1);
+ private List<ITimeEvent> fEventList = new ArrayList<>(1);
private List<ITimeEvent> fZoomedEventList = null;
/**
private ITmfTrace fTrace;
// The selected thread map
- private final Map<ITmfTrace, String> fSelectedThreadMap = new HashMap<ITmfTrace, String>();
+ private final Map<ITmfTrace, String> fSelectedThreadMap = new HashMap<>();
// The time graph entry list
private List<ThreadEntry> fEntryList;
// The trace to entry list hash map
- private final Map<ITmfTrace, ArrayList<ThreadEntry>> fEntryListMap = new HashMap<ITmfTrace, ArrayList<ThreadEntry>>();
+ private final Map<ITmfTrace, ArrayList<ThreadEntry>> fEntryListMap = new HashMap<>();
// The trace to build thread hash map
- private final Map<ITmfTrace, BuildThread> fBuildThreadMap = new HashMap<ITmfTrace, BuildThread>();
+ private final Map<ITmfTrace, BuildThread> fBuildThreadMap = new HashMap<>();
/** The map to map function addresses to function names */
private Map<String, String> fNameMapping;
public ThreadEntry(ITmfTrace trace, String name, int threadQuark, long startTime, long endTime) {
fThreadTrace = trace;
- fChildren = new ArrayList<CallStackEntry>();
+ fChildren = new ArrayList<>();
fName = name;
fTraceStartTime = startTime;
fTraceEndTime = endTime;
} else {
traces = new ITmfTrace[] { trace };
}
- ArrayList<ThreadEntry> entryList = new ArrayList<ThreadEntry>();
+ ArrayList<ThreadEntry> entryList = new ArrayList<>();
for (ITmfTrace aTrace : traces) {
if (monitor.isCanceled()) {
return;
}
}
synchronized (fEntryListMap) {
- fEntryListMap.put(trace, new ArrayList<ThreadEntry>(entryList));
+ fEntryListMap.put(trace, new ArrayList<>(entryList));
}
if (trace == fTrace) {
refresh();
List<ITimeEvent> eventList = null;
try {
List<ITmfStateInterval> stackIntervals = ss.queryHistoryRange(entry.getQuark(), start, end - 1, resolution, monitor);
- eventList = new ArrayList<ITimeEvent>(stackIntervals.size());
+ eventList = new ArrayList<>(stackIntervals.size());
long lastEndTime = -1;
boolean lastIsNull = true;
for (ITmfStateInterval statusInterval : stackIntervals) {
synchronized (fEntryListMap) {
fEntryList = fEntryListMap.get(fTrace);
if (fEntryList == null) {
- fEntryList = new ArrayList<ThreadEntry>();
+ fEntryList = new ArrayList<>();
}
entries = fEntryList.toArray(new ITimeGraphEntry[0]);
}
class FunctionNameMapper {
public static @Nullable Map<String, String> mapFromNmTextFile(File mappingFile) {
- Map<String, String> map = new HashMap<String, String>();
+ Map<String, String> map = new HashMap<>();
- FileReader fr;
- try {
- fr = new FileReader(mappingFile);
- } catch (FileNotFoundException e) {
- return null;
- }
- BufferedReader reader = new BufferedReader(fr);
-
- try {
+ try (FileReader fr = new FileReader(mappingFile);
+ BufferedReader reader = new BufferedReader(fr);) {
for (String line = reader.readLine(); line != null; line = reader.readLine()) {
String[] elems = line.split(" "); //$NON-NLS-1$
/* Only lines with 3 elements contain addresses */
map.put(address, name);
}
}
-
+ } catch (FileNotFoundException e) {
+ return null;
} catch (IOException e) {
/* Stop reading the file at this point */
- } finally {
- try {
- reader.close();
- } catch (IOException e) {}
}
if (map.isEmpty()) {
private static ColorSetting[] fColorSettings = ColorSettingsXML.load(COLOR_SETTINGS_PATH_NAME);
// The listener list
- private static List<IColorSettingsListener> fListeners = new ArrayList<IColorSettingsListener>();
+ private static List<IColorSettingsListener> fListeners = new ArrayList<>();
/**
* Returns an array of color settings.
// Helper class
private static class ColorSettingsContentHandler extends DefaultHandler {
- private List<ColorSetting> colorSettings = new ArrayList<ColorSetting>(0);
+ private List<ColorSetting> colorSettings = new ArrayList<>(0);
private RGB fg = new RGB(0, 0, 0);
private RGB bg = new RGB(255, 255, 255);
private RGB tickColor = new RGB(0, 0, 0);
public void startElement(String uri, String localName, String qName, Attributes attributes)
throws SAXException {
if (localName.equals(COLOR_SETTINGS_TAG)) {
- colorSettings = new ArrayList<ColorSetting>();
+ colorSettings = new ArrayList<>();
} else if (localName.equals(COLOR_SETTING_TAG)) {
fg = null;
bg = null;
gl.verticalSpacing = 1;
fListComposite.setLayout(gl);
- fColorSettings = new ArrayList<ColorSetting>(Arrays.asList(ColorSettingsManager.getColorSettings()));
+ fColorSettings = new ArrayList<>(Arrays.asList(ColorSettingsManager.getColorSettings()));
for (ColorSetting colorSetting : fColorSettings) {
new ColorSettingRow(fListComposite, colorSetting);
}
control.dispose();
}
}
- fColorSettings = new ArrayList<ColorSetting>();
+ fColorSettings = new ArrayList<>();
fSelectedRow = null;
}
}
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof ITmfFilterTreeNode) {
- ArrayList<ITmfFilterTreeNode> result = new ArrayList<ITmfFilterTreeNode>();
+ ArrayList<ITmfFilterTreeNode> result = new ArrayList<>();
for (int i = 0; i < ((ITmfFilterTreeNode) inputElement).getChildrenCount(); i++) {
result.add(((ITmfFilterTreeNode) inputElement).getChild(i));
}
@Override
public Object[] getChildren(Object parentElement) {
- ArrayList<ITmfFilterTreeNode> result = new ArrayList<ITmfFilterTreeNode>();
+ ArrayList<ITmfFilterTreeNode> result = new ArrayList<>();
for (int i = 0; i < ((ITmfFilterTreeNode) parentElement).getChildrenCount(); i++) {
result.add(((ITmfFilterTreeNode) parentElement).getChild(i));
}
}
protected String[] getFieldsList(ITmfFilterTreeNode node) {
- ArrayList<String> fieldsList = new ArrayList<String>();
+ ArrayList<String> fieldsList = new ArrayList<>();
ITmfFilterTreeNode curNode = node;
while (curNode != null) {
if (curNode instanceof TmfFilterEventTypeNode) {
}
protected Map<String, Object> getEventsTypeMap() {
- Map<String, Object> eventsTypeMap = new LinkedHashMap<String, Object>();
+ Map<String, Object> eventsTypeMap = new LinkedHashMap<>();
for (IConfigurationElement ce : TmfTraceType.getTypeElements()) {
String categoryName = TmfTraceType.getCategoryName(ce.getAttribute(TmfTraceType.CATEGORY_ATTR));
String text = categoryName + " : " + ce.getAttribute(TmfTraceType.NAME_ATTR); //$NON-NLS-1$
* sub-tree in the UI thread.
*/
Map<String, ITmfStateSystemAnalysisModule> modules = currentTrace.getAnalysisModules(ITmfStateSystemAnalysisModule.class);
- final Map<String, ITmfStateSystem> sss = new HashMap<String, ITmfStateSystem>();
+ final Map<String, ITmfStateSystem> sss = new HashMap<>();
final Map<String, List<ITmfStateInterval>> fullStates =
- new LinkedHashMap<String, List<ITmfStateInterval>>();
+ new LinkedHashMap<>();
for (Entry<String, ITmfStateSystemAnalysisModule> entry : modules.entrySet()) {
/*
* FIXME: For now, this view is a way to execute and display
TimeChartAnalysisEntry(ITmfTrace trace, int modelSize) {
fTrace = trace;
- fTraceEvents = new Vector<TimeChartEvent>(modelSize);
+ fTraceEvents = new Vector<>(modelSize);
}
/**
public class TimeChartDecorationProvider {
private final IFile fBookmarksFile;
- private final Set<Long> fBookmarksSet = new HashSet<Long>();
+ private final Set<Long> fBookmarksSet = new HashSet<>();
private ITmfFilter fFilterFilter;
private ITmfFilter fSearchFilter;
private final int fDisplayWidth;
private TimeGraphViewer fViewer;
- private final ArrayList<TimeChartAnalysisEntry> fTimeAnalysisEntries = new ArrayList<TimeChartAnalysisEntry>();
- private final Map<ITmfTrace, TimeChartDecorationProvider> fDecorationProviders = new HashMap<ITmfTrace, TimeChartDecorationProvider>();
- private final ArrayList<DecorateThread> fDecorateThreads = new ArrayList<DecorateThread>();
+ private final ArrayList<TimeChartAnalysisEntry> fTimeAnalysisEntries = new ArrayList<>();
+ private final Map<ITmfTrace, TimeChartDecorationProvider> fDecorationProviders = new HashMap<>();
+ private final ArrayList<DecorateThread> fDecorateThreads = new ArrayList<>();
private long fStartTime = 0;
private long fStopTime = Long.MAX_VALUE;
private boolean fRefreshBusy = false;
private List<TimeGraphEntry> fEntryList;
/** The trace to entry list hash map */
- private final Map<ITmfTrace, List<TimeGraphEntry>> fEntryListMap = new HashMap<ITmfTrace, List<TimeGraphEntry>>();
+ private final Map<ITmfTrace, List<TimeGraphEntry>> fEntryListMap = new HashMap<>();
/* The trace to build thread hash map */
- private final Map<ITmfTrace, BuildThread> fBuildThreadMap = new HashMap<ITmfTrace, BuildThread>();
+ private final Map<ITmfTrace, BuildThread> fBuildThreadMap = new HashMap<>();
/** The start time */
private long fStartTime;
*/
protected List<ILinkEvent> getLinkList(long startTime, long endTime,
long resolution, IProgressMonitor monitor) {
- return new ArrayList<ILinkEvent>();
+ return new ArrayList<>();
}
synchronized (fEntryListMap) {
fEntryList = fEntryListMap.get(fTrace);
if (fEntryList == null) {
- fEntryList = new ArrayList<TimeGraphEntry>();
+ fEntryList = new ArrayList<>();
}
entries = fEntryList.toArray(new ITimeGraphEntry[0]);
}
public SDWidget(Composite c, int s) {
super(c, s | SWT.NO_BACKGROUND, true);
setOverviewEnabled(true);
- fSelectedNodeList = new ArrayList<GraphNode>();
+ fSelectedNodeList = new ArrayList<>();
fSelProvider = new SDWidgetSelectionProvider();
SDViewPref.getInstance().addPropertyChangeListener(this);
fToolTip = new DiagramToolTip(getViewControl());
fCollapaseCaretImg = Activator.getDefault().getImageFromPath(ITmfImageConstants.IMG_UI_ARROW_COLLAPSE_OBJ);
fArrowUpCaretImg = Activator.getDefault().getImageFromPath(ITmfImageConstants.IMG_UI_ARROW_UP_OBJ);
- fReorderList = new ArrayList<Lifeline[]>();
+ fReorderList = new ArrayList<>();
getViewControl().addTraverseListener(new LocalTraverseListener());
addTraverseListener(new LocalTraverseListener());
}
if (event.keyCode == SWT.SHIFT) {
fShiftSelection = true;
- fPrevList = new ArrayList<GraphNode>();
+ fPrevList = new ArrayList<>();
fPrevList.addAll(getSelection());
}
* Standard constructor
*/
protected SDWidgetSelectionProvider() {
- fListenerList = new ArrayList<ISelectionChangedListener>();
+ fListenerList = new ArrayList<>();
}
// ------------------------------------------------------------------------
super(parent, s | SWT.NO_BACKGROUND, false);
setVScrollBarMode(ScrollView.ALWAYS_OFF);
setHScrollBarMode(ScrollView.ALWAYS_OFF);
- fListenerList = new ArrayList<ITimeCompressionListener>();
+ fListenerList = new ArrayList<>();
fColors = new ColorImpl[NUMBER_STEPS];
int greenBlue = BASE_GREEN_BLUE_VALUE;
final int step = COLOR_STEP;
if (fFrame == null) {
return;
}
- fNodeList = new ArrayList<SDTimeEvent>();
+ fNodeList = new ArrayList<>();
int messageArraysStep = 1;
if ((Metrics.getMessageFontHeigth() + Metrics.MESSAGES_NAME_SPACING * 2) * fZoomValue < Metrics.MESSAGE_SIGNIFICANT_VSPACING + 1) {
*/
protected List<SDTimeEvent> buildTimeArray() {
if (!hasChildren()) {
- return new ArrayList<SDTimeEvent>();
+ return new ArrayList<>();
}
Iterator<String> it = getForwardSortMap().keySet().iterator();
- List<SDTimeEvent> timeArray = new ArrayList<SDTimeEvent>();
+ List<SDTimeEvent> timeArray = new ArrayList<>();
while (it.hasNext()) {
String nodeType = it.next();
List<GraphNode> list = getNodeMap().get(nodeType);
protected List<SDTimeEvent> buildTimeArray() {
if (!hasChildren()) {
- return new ArrayList<SDTimeEvent>();
+ return new ArrayList<>();
}
List<SDTimeEvent> timeArray = super.buildTimeArray();
SDTimeEvent f = new SDTimeEvent(time, event, eo);
timeArray.add(f);
if (fExecutionOccurrencesWithTime == null) {
- fExecutionOccurrencesWithTime = new ArrayList<SDTimeEvent>();
+ fExecutionOccurrencesWithTime = new ArrayList<>();
}
fExecutionOccurrencesWithTime.add(f);
event = eo.getEndOccurrence();
*/
public void addNode(GraphNode nodeToAdd) {
if (!fHasChilden) {
- fNodes = new HashMap<String, List<GraphNode>>(2);
- fForwardNodes = new HashMap<String, List<GraphNode>>(2);
- fBackwardNodes = new HashMap<String, List<GraphNode>>(2);
- fIndexes = new HashMap<String, Integer>(2);
- fBackwardSort = new HashMap<String, Boolean>(2);
- fForwardSort = new HashMap<String, Boolean>(2);
+ fNodes = new HashMap<>(2);
+ fForwardNodes = new HashMap<>(2);
+ fBackwardNodes = new HashMap<>(2);
+ fIndexes = new HashMap<>(2);
+ fBackwardSort = new HashMap<>(2);
+ fForwardSort = new HashMap<>(2);
fHasChilden = true;
}
}
if (fNodeList == null) {
- fNodeList = new ArrayList<GraphNode>();
+ fNodeList = new ArrayList<>();
}
fNodeList.add(nodeToAdd);
* @return the list of nodes
*/
public List<GraphNode> getNodeList(GraphNode from, GraphNode to) {
- List<GraphNode> result = new ArrayList<GraphNode>();
+ List<GraphNode> result = new ArrayList<>();
if (from != null) {
result.add(from);
if (hasChildren()) {
return getNodeMap().get(BasicExecutionOccurrence.EXEC_OCC_TAG);
}
- return new ArrayList<GraphNode>();
+ return new ArrayList<>();
}
@Override
* @return graph node summary
*/
public String getGraphNodeSummary(ISDFilterProvider provider, String loaderClassName) {
- ArrayList<String> list = new ArrayList<String>();
+ ArrayList<String> list = new ArrayList<>();
if (provider != null) {
if (isLifeLineSelected()) {
@Override
public void okPressed() {
if (fTable.getItemCount() > 0) {
- fFilters = new ArrayList<FilterCriteria>();
+ fFilters = new ArrayList<>();
} else {
fFilters = null;
}
int i = 0;
DialogSettings section = null;
int size = 0;
- List<FilterCriteria> globalFilters = new ArrayList<FilterCriteria>();
+ List<FilterCriteria> globalFilters = new ArrayList<>();
if (settings != null) {
try {
size = settings.getInt(FILTERS_LIST_SIZE);
fCriteria.save(section);
if (fCriteria.getExpression().length() > 0) {
- ArrayList<String> list = new ArrayList<String>();
+ ArrayList<String> list = new ArrayList<>();
for (int i = 0; i < fExpressionList.length; i++) {
list.add(fExpressionList[i]);
}
/**
* The list of view names.
*/
- private Set<String> fViews = new HashSet<String>();
+ private Set<String> fViews = new HashSet<>();
/**
* The list of activations Activations to store
*/
- private List<IHandlerActivation> fHandlerActivations = new ArrayList<IHandlerActivation>();
+ private List<IHandlerActivation> fHandlerActivations = new ArrayList<>();
/**
* The action reference for moving to a message in view.
*/
/**
* Map for caching information (view ID to loader class)
*/
- private Map<String, IUml2SDLoader> fViewLoaderMap = new HashMap<String, IUml2SDLoader>();
+ private Map<String, IUml2SDLoader> fViewLoaderMap = new HashMap<>();
/**
* Map for caching information (view ID to list of configuration elements)
*/
- private Map<String, ArrayList<IConfigurationElement>> fViewLoadersList = new HashMap<String, ArrayList<IConfigurationElement>>();
+ private Map<String, ArrayList<IConfigurationElement>> fViewLoadersList = new HashMap<>();
// ------------------------------------------------------------------------
// Constructor
return list;
}
- ArrayList<IConfigurationElement> ret = new ArrayList<IConfigurationElement>();
+ ArrayList<IConfigurationElement> ret = new ArrayList<>();
IExtensionPoint iep = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, LOADER_TAG);
if (iep == null) {
return ret;
/**
* The list of sequence diagram events of current page.
*/
- protected List<ITmfSyncSequenceDiagramEvent> fEvents = new ArrayList<ITmfSyncSequenceDiagramEvent>();
+ protected List<ITmfSyncSequenceDiagramEvent> fEvents = new ArrayList<>();
// Checkpoint and page attributes
/**
* The checkpoints of the whole sequence diagram trace (i.e. start time stamp of each page)
*/
- protected List<TmfTimeRange> fCheckPoints = new ArrayList<TmfTimeRange>(MAX_NUM_OF_MSG);
+ protected List<TmfTimeRange> fCheckPoints = new ArrayList<>(MAX_NUM_OF_MSG);
/**
* The current page displayed.
*/
/**
* List of found nodes within a page.
*/
- protected List<GraphNode> fFindResults = new ArrayList<GraphNode>();
+ protected List<GraphNode> fFindResults = new ArrayList<>();
/**
* The current find criteria reference
*/
private ITmfTimestamp fFirstTime = null;
private ITmfTimestamp fLastTime = null;
private int fNbSeqEvents = 0;
- private final List<ITmfSyncSequenceDiagramEvent> fSdEvents = new ArrayList<ITmfSyncSequenceDiagramEvent>(MAX_NUM_OF_MSG);
+ private final List<ITmfSyncSequenceDiagramEvent> fSdEvents = new ArrayList<>(MAX_NUM_OF_MSG);
@Override
public void handleData(ITmfEvent event) {
}
if ((fFindResults == null) || (fFindCriteria == null) || !fFindCriteria.compareTo(toSearch)) {
- fFindResults = new CopyOnWriteArrayList<GraphNode>();
+ fFindResults = new CopyOnWriteArrayList<>();
fFindCriteria = toSearch;
if (fFindCriteria.isLifeLineSelected()) {
for (int i = 0; i < fFrame.lifeLinesCount(); i++) {
}
}
- ArrayList<GraphNode> msgs = new ArrayList<GraphNode>();
+ ArrayList<GraphNode> msgs = new ArrayList<>();
if (fFindCriteria.isSyncMessageSelected()) {
for (int i = 0; i < fFrame.syncMessageCount(); i++) {
if (fFindCriteria.matches(fFrame.getSyncMessage(i).getName())) {
cancelOngoingRequests();
if (filters == null) {
- fFilterCriteria = new ArrayList<FilterCriteria>();
+ fFilterCriteria = new ArrayList<>();
} else {
List<FilterCriteria> list = filters;
- fFilterCriteria = new ArrayList<FilterCriteria>(list);
+ fFilterCriteria = new ArrayList<>(list);
}
fillCurrentPage(fEvents);
fLock.lock();
try {
- fEvents = new ArrayList<ITmfSyncSequenceDiagramEvent>(events);
+ fEvents = new ArrayList<>(events);
if (fView != null && !events.isEmpty()) {
fView.toggleWaitCursorAsync(true);
}
final Frame frame = new Frame();
if (!events.isEmpty()) {
- Map<String, Lifeline> nodeToLifelineMap = new HashMap<String, Lifeline>();
+ Map<String, Lifeline> nodeToLifelineMap = new HashMap<>();
frame.setName(Messages.TmfUml2SDSyncLoader_FrameName);
fPageRequest = new TmfEventRequest(ITmfEvent.class, window, 0,
ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.FOREGROUND) {
- private final List<ITmfSyncSequenceDiagramEvent> fSdEvent = new ArrayList<ITmfSyncSequenceDiagramEvent>();
+ private final List<ITmfSyncSequenceDiagramEvent> fSdEvent = new ArrayList<>();
@Override
public void handleData(ITmfEvent event) {
fPrefStore.setDefault(PREF_USE_GRADIENT, true);
fPrefStore.setDefault(PREF_TOOLTIP, true);
- fFontPref = new Hashtable<String, IFont>();
- fForeColorPref = new Hashtable<String, IColor>();
- fBackColorPref = new Hashtable<String, IColor>();
- fTextColorPref = new Hashtable<String, IColor>();
+ fFontPref = new Hashtable<>();
+ fForeColorPref = new Hashtable<>();
+ fBackColorPref = new Hashtable<>();
+ fTextColorPref = new Hashtable<>();
for (int i = 0; i < FONT_LIST.length; i++) {
if (FONT_LIST[i].equals(PREF_FRAME_NAME)) {
private Font fFixedFont;
private Slider fSlider;
- private final List<LineData> fLines = new ArrayList<LineData>();
+ private final List<LineData> fLines = new ArrayList<>();
private boolean fActualRanks = false;
private int fTopLineIndex;
private int fLastTopLineIndex;
super(parent, style);
setLayout(new FillLayout());
- fViewers = new HashMap<String, ITmfViewer>();
+ fViewers = new HashMap<>();
initFolder();
}
private List<? extends ITimeGraphEntry> fTopInput;
/** The selection listener map */
- private final Map<ITimeGraphSelectionListener, SelectionListenerWrapper> fSelectionListenerMap = new HashMap<ITimeGraphSelectionListener, SelectionListenerWrapper>();
+ private final Map<ITimeGraphSelectionListener, SelectionListenerWrapper> fSelectionListenerMap = new HashMap<>();
/** The map of viewer filters */
- private final Map<ViewerFilter, ViewerFilter> fViewerFilterMap = new HashMap<ViewerFilter, ViewerFilter>();
+ private final Map<ViewerFilter, ViewerFilter> fViewerFilterMap = new HashMap<>();
/**
* Flag to block the tree selection changed listener when triggered by the
fFilterDialog.setMessage(Messages.TmfTimeFilterDialog_MESSAGE);
fFilterDialog.setExpandedElements(allElements.toArray());
if (fFilter.getFiltered() != null) {
- ArrayList<? extends ITimeGraphEntry> nonFilteredElements = new ArrayList<ITimeGraphEntry>(allElements);
+ ArrayList<? extends ITimeGraphEntry> nonFilteredElements = new ArrayList<>(allElements);
nonFilteredElements.removeAll(fFilter.getFiltered());
fFilterDialog.setInitialElementSelections(nonFilteredElements);
} else {
* @param input the input of this time graph combo, or <code>null</code> if none
*/
public void setInput(ITimeGraphEntry[] input) {
- fTopInput = new ArrayList<ITimeGraphEntry>(Arrays.asList(input));
+ fTopInput = new ArrayList<>(Arrays.asList(input));
fFilter.setFiltered(null);
fInhibitTreeSelection = true;
fTreeViewer.setInput(input);
// ------------------------------------------------------------------------
private List<TreeItem> getVisibleExpandedItems(Tree tree) {
- ArrayList<TreeItem> items = new ArrayList<TreeItem>();
+ ArrayList<TreeItem> items = new ArrayList<>();
for (TreeItem item : tree.getItems()) {
if (item.getData() == FILLER) {
break;
}
private List<TreeItem> getVisibleExpandedItems(TreeItem treeItem) {
- ArrayList<TreeItem> items = new ArrayList<TreeItem>();
+ ArrayList<TreeItem> items = new ArrayList<>();
for (TreeItem item : treeItem.getItems()) {
items.add(item);
if (item.getExpanded()) {
* @return All the inputs
*/
private List<? extends ITimeGraphEntry> listAllInputs(List<? extends ITimeGraphEntry> inputs) {
- ArrayList<ITimeGraphEntry> items = new ArrayList<ITimeGraphEntry>();
+ ArrayList<ITimeGraphEntry> items = new ArrayList<>();
for (ITimeGraphEntry entry : inputs) {
items.add(entry);
if (entry.hasChildren()) {
private final String fStateTypeName;
// The list of listeners for graph color changes
- private final List<ITimeGraphColorListener> fListeners = new ArrayList<ITimeGraphColorListener>();
+ private final List<ITimeGraphColorListener> fListeners = new ArrayList<>();
// ------------------------------------------------------------------------
// Constants
private TimeGraphColorScheme fColorScheme;
private ITimeGraphPresentationProvider fTimeGraphProvider;
- private List<ITimeGraphSelectionListener> fSelectionListeners = new ArrayList<ITimeGraphSelectionListener>();
- private List<ITimeGraphTimeListener> fTimeListeners = new ArrayList<ITimeGraphTimeListener>();
- private List<ITimeGraphRangeListener> fRangeListeners = new ArrayList<ITimeGraphRangeListener>();
+ private List<ITimeGraphSelectionListener> fSelectionListeners = new ArrayList<>();
+ private List<ITimeGraphTimeListener> fTimeListeners = new ArrayList<>();
+ private List<ITimeGraphRangeListener> fRangeListeners = new ArrayList<>();
// Time format, using Epoch reference, Relative time format(default) or
// Number
*/
public TimeGraphFilterDialog(Shell parent) {
super(parent);
- setResult(new ArrayList<Object>(0));
+ setResult(new ArrayList<>(0));
setStatusLineAboveButtons(true);
setHelpAvailable(false);
fExpandedElements = null;
*/
public void addFilter(ViewerFilter filter) {
if (fFilters == null) {
- fFilters = new ArrayList<ViewerFilter>();
+ fFilters = new ArrayList<>();
}
fFilters.add(filter);
}
*/
@Override
public Pair<ITimeEvent, ITimeEvent> split(long time) {
- Pair<ITimeEvent, ITimeEvent> pair = new Pair<ITimeEvent, ITimeEvent>();
+ Pair<ITimeEvent, ITimeEvent> pair = new Pair<>();
if (time > fTime) {
pair.setFirst(new TimeEvent(fEntry, fTime, Math.min(fDuration, time - fTime), fValue));
}
private TimeGraphEntry fParent = null;
/** List of child entries */
- private final List<TimeGraphEntry> fChildren = new ArrayList<TimeGraphEntry>();
+ private final List<TimeGraphEntry> fChildren = new ArrayList<>();
/** Name of this entry (text to show) */
private String fName;
private long fStartTime = -1;
private long fEndTime = -1;
- private List<ITimeEvent> fEventList = new ArrayList<ITimeEvent>();
- private List<ITimeEvent> fZoomedEventList = new ArrayList<ITimeEvent>();
+ private List<ITimeEvent> fEventList = new ArrayList<>();
+ private List<ITimeEvent> fZoomedEventList = new ArrayList<>();
/**
* Constructor
*/
public void setEventList(List<ITimeEvent> eventList) {
if (eventList != null) {
- fEventList = new ArrayList<ITimeEvent>(eventList);
+ fEventList = new ArrayList<>(eventList);
} else {
- fEventList = new ArrayList<ITimeEvent>();
+ fEventList = new ArrayList<>();
}
}
*/
public void setZoomedEventList(List<ITimeEvent> eventList) {
if (eventList != null) {
- fZoomedEventList = new ArrayList<ITimeEvent>(eventList);
+ fZoomedEventList = new ArrayList<>(eventList);
} else {
- fZoomedEventList = new ArrayList<ITimeEvent>();
+ fZoomedEventList = new ArrayList<>();
}
}
private ITimeGraphPresentationProvider fTimeGraphProvider = null;
private ItemData fItemData = null;
private List<SelectionListener> fSelectionListeners;
- private final List<ISelectionChangedListener> fSelectionChangedListeners = new ArrayList<ISelectionChangedListener>();
- private final List<ITimeGraphTreeListener> fTreeListeners = new ArrayList<ITimeGraphTreeListener>();
- private final List<MenuDetectListener> fTimeGraphEntryMenuListeners = new ArrayList<MenuDetectListener>();
- private final List<MenuDetectListener> fTimeEventMenuListeners = new ArrayList<MenuDetectListener>();
+ private final List<ISelectionChangedListener> fSelectionChangedListeners = new ArrayList<>();
+ private final List<ITimeGraphTreeListener> fTreeListeners = new ArrayList<>();
+ private final List<MenuDetectListener> fTimeGraphEntryMenuListeners = new ArrayList<>();
+ private final List<MenuDetectListener> fTimeEventMenuListeners = new ArrayList<>();
private final Cursor fDragCursor = Display.getDefault().getSystemCursor(SWT.CURSOR_HAND);
private final Cursor fResizeCursor = Display.getDefault().getSystemCursor(SWT.CURSOR_IBEAM);
private final Cursor fWaitCursor = Display.getDefault().getSystemCursor(SWT.CURSOR_WAIT);
private final Cursor fZoomCursor = Display.getDefault().getSystemCursor(SWT.CURSOR_SIZEWE);
- private final List<ViewerFilter> fFilters = new ArrayList<ViewerFilter>();
+ private final List<ViewerFilter> fFilters = new ArrayList<>();
private MenuDetectEvent fPendingMenuDetectEvent = null;
private boolean fHideArrows = false;
SWT.error(SWT.ERROR_NULL_ARGUMENT);
}
if (null == fSelectionListeners) {
- fSelectionListeners = new ArrayList<SelectionListener>();
+ fSelectionListeners = new ArrayList<>();
}
fSelectionListeners.add(listener);
}
* @return The expanded elements
*/
public ITimeGraphEntry[] getExpandedElements() {
- ArrayList<ITimeGraphEntry> elements = new ArrayList<ITimeGraphEntry>();
+ ArrayList<ITimeGraphEntry> elements = new ArrayList<>();
for (Item item : fItemData.fExpandedItems) {
elements.add(item.fTrace);
}
private Item[] fExpandedItems = new Item[0];
private Item[] fItems = new Item[0];
private ITimeGraphEntry fTraces[] = new ITimeGraphEntry[0];
- private List<ILinkEvent> fLinks = new ArrayList<ILinkEvent>();
+ private List<ILinkEvent> fLinks = new ArrayList<>();
private boolean fTraceFilter[] = new boolean[0];
- private final ArrayList<ITimeGraphEntry> fFilteredOut = new ArrayList<ITimeGraphEntry>();
+ private final ArrayList<ITimeGraphEntry> fFilteredOut = new ArrayList<>();
public ItemData() {
}
}
public void refreshData() {
- List<Item> itemList = new ArrayList<Item>();
+ List<Item> itemList = new ArrayList<>();
fFilteredOut.clear();
ITimeGraphEntry selection = getSelectedTrace();
for (int i = 0; i < fTraces.length; i++) {
}
public void updateExpandedItems() {
- List<Item> expandedItemList = new ArrayList<Item>();
+ List<Item> expandedItemList = new ArrayList<>();
for (int i = 0; i < fTraces.length; i++) {
ITimeGraphEntry entry = fTraces[i];
Item item = findItem(entry);
if (events != null) {
fLinks = events;
} else {
- fLinks = new ArrayList<ILinkEvent>();
+ fLinks = new ArrayList<>();
}
}
this.fTrace = trace;
this.fName = name;
this.fLevel = level;
- this.fChildren = new ArrayList<Item>();
+ this.fChildren = new ArrayList<>();
}
@Override
*/
public class TimeGraphSelection implements IStructuredSelection {
- private List<Object> list = new ArrayList<Object>();
+ private List<Object> list = new ArrayList<>();
/**
* Default constructor