Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.classpath2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.settings/org.eclipse.jdt.core.prefs18
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/META-INF/MANIFEST.MF2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/AddStapProbe.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ProbeAliasAction.java4
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptHandler.java9
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPCompletionProcessor.java4
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterOptions.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPEditor.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPMetadataSingleton.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/ScannerContext.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/SimpleScanner.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptGraphOptionsTab.java40
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptLaunchShortcut.java4
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/preferences/ListEditor.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/StapErrorParser.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetLibrary.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetParser.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TreeSettings.java10
20 files changed, 58 insertions, 58 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.classpath
index ad32c83a78..098194ca4b 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.classpath
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.classpath
@@ -1,6 +1,6 @@
<?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"/>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.settings/org.eclipse.jdt.core.prefs b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.settings/org.eclipse.jdt.core.prefs
index 1ac25acb97..b1f1d96904 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.settings/org.eclipse.jdt.core.prefs
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.settings/org.eclipse.jdt.core.prefs
@@ -1,12 +1,17 @@
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=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.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.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
@@ -18,7 +23,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -43,6 +48,7 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warni
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
@@ -55,7 +61,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
@@ -63,6 +69,7 @@ org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
@@ -86,6 +93,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/META-INF/MANIFEST.MF
index 238c717a4e..42fa90de08 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/META-INF/MANIFEST.MF
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/META-INF/MANIFEST.MF
@@ -28,5 +28,5 @@ Import-Package: com.jcraft.jsch;version="0.1.37",
org.eclipse.linuxtools.systemtap.ui.graphing,
org.eclipse.linuxtools.systemtap.ui.graphing.views,
org.eclipse.linuxtools.tools.launch.core.factory
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/AddStapProbe.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/AddStapProbe.java
index 6f09af013a..11c76c7cf7 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/AddStapProbe.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/AddStapProbe.java
@@ -71,7 +71,7 @@ public class AddStapProbe extends AbstractRulerActionDelegate {
// gogo find comment segments
try {
- ArrayList<Integer> commentChunks = new ArrayList<Integer>();
+ ArrayList<Integer> commentChunks = new ArrayList<>();
char[] chars = s.toCharArray();
int needle = 1;
int offset = document.getLineOffset(lineno);
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ProbeAliasAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ProbeAliasAction.java
index 720f63c0c9..983c50fb72 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ProbeAliasAction.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ProbeAliasAction.java
@@ -12,8 +12,8 @@
package org.eclipse.linuxtools.internal.systemtap.ui.ide.actions;
import java.text.MessageFormat;
-import java.util.List;
import java.util.LinkedList;
+import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -143,7 +143,7 @@ public class ProbeAliasAction extends Action implements ISelectionListener, IDou
}
private IEditorPart findEditor() {
- final List<IEditorPart> allEditors = new LinkedList<IEditorPart>();
+ final List<IEditorPart> allEditors = new LinkedList<>();
for (IEditorReference ref : window.getActivePage().getEditorReferences()) {
IEditorPart editor = SynchronousActions.getRestoredEditor(ref);
if (editor instanceof STPEditor) {
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptHandler.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptHandler.java
index 7f33f8280f..dbde1a460d 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptHandler.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptHandler.java
@@ -59,6 +59,7 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.ResourceUtil;
+
import com.jcraft.jsch.JSchException;
/**
@@ -89,7 +90,7 @@ public class RunScriptHandler extends AbstractHandler {
public RunScriptHandler(){
- this.cmdList = new ArrayList<String>();
+ this.cmdList = new ArrayList<>();
}
/**
@@ -364,10 +365,8 @@ public class RunScriptHandler extends AbstractHandler {
* @return True if the script contains embedded C code.
*/
private boolean isGuru() {
- try {
- File f = new File(fileName);
- FileReader fr = new FileReader(f);
-
+ File f = new File(fileName);
+ try (FileReader fr = new FileReader(f)){
int curr = 0;
int prev = 0;
boolean front = false;
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPCompletionProcessor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPCompletionProcessor.java
index 269f468cfc..2d29e77311 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPCompletionProcessor.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPCompletionProcessor.java
@@ -135,7 +135,7 @@ public class STPCompletionProcessor implements IContentAssistProcessor, ITextHov
ICompletionProposal[] variableCompletions = getProbeVariableCompletions(document, offset, prefix);
ICompletionProposal[] functionCompletions = getFunctionCompletions(offset, prefix);
- ArrayList<ICompletionProposal> completions = new ArrayList<ICompletionProposal>(
+ ArrayList<ICompletionProposal> completions = new ArrayList<>(
variableCompletions.length + functionCompletions.length);
completions.addAll(Arrays.asList(variableCompletions));
completions.addAll(Arrays.asList(functionCompletions));
@@ -300,7 +300,7 @@ public class STPCompletionProcessor implements IContentAssistProcessor, ITextHov
private ICompletionProposal[] getGlobalKeywordCompletion(String prefix, int offset) {
- ArrayList<ICompletionProposal> completions = new ArrayList<ICompletionProposal>();
+ ArrayList<ICompletionProposal> completions = new ArrayList<>();
int prefixLength = prefix.length();
for (String[] keyword : GLOBAL_KEYWORDS) {
if (keyword[0].startsWith(prefix)){
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterOptions.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterOptions.java
index 2120bf0362..23d61d3106 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterOptions.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPDefaultCodeFormatterOptions.java
@@ -244,7 +244,7 @@ public class STPDefaultCodeFormatterOptions {
}
public Map<String, String> getMap() {
- Map<String, String> options = new HashMap<String, String>();
+ Map<String, String> options = new HashMap<>();
options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION, getAlignment(this.alignment_for_arguments_in_method_invocation));
options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT, getAlignment(this.alignment_for_assignment));
options.put(STPDefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION, getAlignment(this.alignment_for_binary_expression));
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPEditor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPEditor.java
index 2ce66496a3..e3b0f091d4 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPEditor.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPEditor.java
@@ -84,7 +84,7 @@ public class STPEditor extends SimpleEditor {
{
ProjectionAnnotation annotation;
Annotation[] updatedAnnotations = new Annotation[updatedPositions.size()];
- HashMap<ProjectionAnnotation, Position> newAnnotations = new HashMap<ProjectionAnnotation, Position>();
+ HashMap<ProjectionAnnotation, Position> newAnnotations = new HashMap<>();
for(int i =0;i<updatedPositions.size();i++)
{
annotation = new ProjectionAnnotation();
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPMetadataSingleton.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPMetadataSingleton.java
index 4f491808dc..f5a08b7149 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPMetadataSingleton.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPMetadataSingleton.java
@@ -118,7 +118,7 @@ public class STPMetadataSingleton {
}
private String[] getMatchingChildren(TreeNode node, String prefix) {
- ArrayList<String> matches = new ArrayList<String>();
+ ArrayList<String> matches = new ArrayList<>();
int n = node.getChildCount();
for (int i = 0; i < n; i++) {
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java
index 1088cb3eb6..00db067649 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java
@@ -13,6 +13,7 @@
package org.eclipse.linuxtools.internal.systemtap.ui.ide.editors.stp;
import java.util.ArrayList;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
@@ -48,7 +49,7 @@ public class STPReconcilingStrategy implements IReconcilingStrategy,
protected int currentTagEnd = 0;
// List of positions
- protected final ArrayList<Position> documentPositionList = new ArrayList<Position>();
+ protected final ArrayList<Position> documentPositionList = new ArrayList<>();
// The end offset of the range to be scanned *//*
protected int endOfDocumentPostion;
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/ScannerContext.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/ScannerContext.java
index eb5453b209..d4d72fd372 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/ScannerContext.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/ScannerContext.java
@@ -20,7 +20,7 @@ import java.util.Stack;
public class ScannerContext {
private Reader fReader;
private int fOffset;
- private Stack<Integer> fUndo = new Stack<Integer>();
+ private Stack<Integer> fUndo = new Stack<>();
public ScannerContext() {
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/SimpleScanner.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/SimpleScanner.java
index c1868bea7b..5d2d3f344f 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/SimpleScanner.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/SimpleScanner.java
@@ -25,7 +25,7 @@ import java.util.HashMap;
*/
public class SimpleScanner {
private static final int EOFCHAR= -1;
- protected static HashMap<String, Integer> fgKeywords= new HashMap<String, Integer>();
+ protected static HashMap<String, Integer> fgKeywords= new HashMap<>();
protected Token fCurrentToken;
protected ScannerContext fContext;
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptGraphOptionsTab.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptGraphOptionsTab.java
index 4f1aced6b7..fa98fc1185 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptGraphOptionsTab.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptGraphOptionsTab.java
@@ -14,7 +14,6 @@ package org.eclipse.linuxtools.internal.systemtap.ui.ide.launcher;
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.Charset;
import java.text.MessageFormat;
@@ -132,7 +131,7 @@ public class SystemTapScriptGraphOptionsTab extends
/**
* A list of error messages, each entry corresponding to an entered regular expression.
*/
- private List<String> regexErrorMessages = new ArrayList<String>();
+ private List<String> regexErrorMessages = new ArrayList<>();
/**
* The index of the selected regular expression.
@@ -142,7 +141,7 @@ public class SystemTapScriptGraphOptionsTab extends
/**
* A list containing the user-defined sample outputs associated with the regex of every index.
*/
- private List<String> outputList = new ArrayList<String>();
+ private List<String> outputList = new ArrayList<>();
/**
* A name is given to each group captured by a regular expression. This stack contains
@@ -154,27 +153,27 @@ public class SystemTapScriptGraphOptionsTab extends
/**
* A list of cachedNames stacks, containing one entry for each regular expression stored.
*/
- private List<Stack<String>> cachedNamesList = new ArrayList<Stack<String>>();
+ private List<Stack<String>> cachedNamesList = new ArrayList<>();
/**
* A two-dimensional list that holds references to the names given to each regular expression's captured groups.
*/
- private List<ArrayList<String>> columnNamesList = new ArrayList<ArrayList<String>>();
+ private List<ArrayList<String>> columnNamesList = new ArrayList<>();
/**
* A list holding the data of every graph for the selected regular expression.
*/
- private List<GraphData> graphsData = new LinkedList<GraphData>();
+ private List<GraphData> graphsData = new LinkedList<>();
/**
* A list of graphsData lists. This is needed because each regular expression has its own set of graphs.
*/
- private List<LinkedList<GraphData>> graphsDataList = new ArrayList<LinkedList<GraphData>>();
+ private List<LinkedList<GraphData>> graphsDataList = new ArrayList<>();
/**
* A list of GraphDatas that rely on series information that has been deleted from their relying regex.
*/
- private List<GraphData> badGraphs = new LinkedList<GraphData>();
+ private List<GraphData> badGraphs = new LinkedList<>();
private ModifyListener regexListener = new ModifyListener() {
@Override
@@ -208,7 +207,7 @@ public class SystemTapScriptGraphOptionsTab extends
return;
}
- ArrayList<String> columnNames = new ArrayList<String>();
+ ArrayList<String> columnNames = new ArrayList<>();
Control[] children = textFieldsComposite.getChildren();
for (int i = 0; i < numberOfVisibleColumns; i++) {
columnNames.add(((Text)children[i*2]).getText());
@@ -264,9 +263,8 @@ public class SystemTapScriptGraphOptionsTab extends
// If chosen file is not being edited or is outside of the workspace, use the saved contents of the file itself.
if (contents == null) {
- try {
- File scriptFile = scriptPath.toFile();
- FileInputStream f = new FileInputStream(scriptFile);
+ File scriptFile = scriptPath.toFile();
+ try (FileInputStream f = new FileInputStream(scriptFile)) {
byte[] data = new byte[(int)scriptFile.length()];
f.read(data);
f.close();
@@ -310,7 +308,7 @@ public class SystemTapScriptGraphOptionsTab extends
Matcher fmatch = format.matcher(printl);
int lastend = 0;
- ArrayList<String> columnNames = new ArrayList<String>();
+ ArrayList<String> columnNames = new ArrayList<>();
int r = 0;
while (fmatch.find()) {
@@ -470,7 +468,7 @@ public class SystemTapScriptGraphOptionsTab extends
public static ArrayList<String> createDatasetNames(ILaunchConfiguration configuration) {
try {
int numberOfRegexs = configuration.getAttribute(NUMBER_OF_REGEXS, 0);
- ArrayList<String> names = new ArrayList<String>(numberOfRegexs);
+ ArrayList<String> names = new ArrayList<>(numberOfRegexs);
for (int r = 0; r < numberOfRegexs; r++) {
names.add(MessageFormat.format(Messages.SystemTapScriptGraphOptionsTab_graphSetTitleBase, r + 1));
}
@@ -490,7 +488,7 @@ public class SystemTapScriptGraphOptionsTab extends
public static ArrayList<IDataSetParser> createDatasetParsers(ILaunchConfiguration configuration) {
try {
int numberOfRegexs = configuration.getAttribute(NUMBER_OF_REGEXS, 0);
- ArrayList<IDataSetParser> parsers = new ArrayList<IDataSetParser>(numberOfRegexs);
+ ArrayList<IDataSetParser> parsers = new ArrayList<>(numberOfRegexs);
for (int r = 0; r < numberOfRegexs; r++) {
parsers.add(new LineParser("^" + configuration.getAttribute(REGULAR_EXPRESSION + r, "") + "$")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -510,11 +508,11 @@ public class SystemTapScriptGraphOptionsTab extends
public static ArrayList<IDataSet> createDataset(ILaunchConfiguration configuration) {
try {
int numberOfRegexs = configuration.getAttribute(NUMBER_OF_REGEXS, 0);
- ArrayList<IDataSet> datasets = new ArrayList<IDataSet>(numberOfRegexs);
+ ArrayList<IDataSet> datasets = new ArrayList<>(numberOfRegexs);
for (int r = 0; r < numberOfRegexs; r++) {
int numberOfColumns = configuration.getAttribute(NUMBER_OF_COLUMNS + r, 0);
- ArrayList<String> labels = new ArrayList<String>(numberOfColumns);
+ ArrayList<String> labels = new ArrayList<>(numberOfColumns);
for (int c = 0; c < numberOfColumns; c++) {
labels.add(configuration.getAttribute(get2DConfigData(REGEX_BOX, r, c), "")); //$NON-NLS-1$
@@ -539,11 +537,11 @@ public class SystemTapScriptGraphOptionsTab extends
// Restrict number of regexs to at least one, so at least
// one inner list will exist in the return value.
int numberOfRegexs = Math.max(configuration.getAttribute(NUMBER_OF_REGEXS, 1), 1);
- ArrayList<LinkedList<GraphData>> graphsList = new ArrayList<LinkedList<GraphData>>(numberOfRegexs);
+ ArrayList<LinkedList<GraphData>> graphsList = new ArrayList<>(numberOfRegexs);
for (int r = 0; r < numberOfRegexs; r++) {
int numberOfGraphs = configuration.getAttribute(NUMBER_OF_GRAPHS + r, 0);
- LinkedList<GraphData> graphs = new LinkedList<GraphData>();
+ LinkedList<GraphData> graphs = new LinkedList<>();
for (int i = 0; i < numberOfGraphs; i++) {
GraphData graphData = new GraphData();
graphData.title = configuration.getAttribute(get2DConfigData(GRAPH_TITLE, r, i), (String) null);
@@ -1253,7 +1251,7 @@ public class SystemTapScriptGraphOptionsTab extends
// Save each regex's list of group names.
int numberOfColumns = configuration.getAttribute(NUMBER_OF_COLUMNS + r, 0);
- ArrayList<String> namelist = new ArrayList<String>(numberOfColumns);
+ ArrayList<String> namelist = new ArrayList<>(numberOfColumns);
for (int i = 0; i < numberOfColumns; i++) {
namelist.add(configuration.getAttribute(get2DConfigData(REGEX_BOX, r, i), (String)null));
}
@@ -1261,7 +1259,7 @@ public class SystemTapScriptGraphOptionsTab extends
//Reclaim missing column data that was required for existing graphs at the time of the previous "apply".
int numberOfExtras = configuration.getAttribute(NUMBER_OF_EXTRAS + r, 0);
- Stack<String> oldnames = new Stack<String>();
+ Stack<String> oldnames = new Stack<>();
for (int i = 0; i < numberOfExtras; i++) {
oldnames.push(configuration.getAttribute(get2DConfigData(EXTRA_BOX, r, i), (String)null));
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptLaunchShortcut.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptLaunchShortcut.java
index 2952707561..d001ef7576 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptLaunchShortcut.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptLaunchShortcut.java
@@ -69,7 +69,7 @@ public class SystemTapScriptLaunchShortcut extends ProfileLaunchShortcut {
protected ILaunchConfiguration findLaunchConfiguration(String scriptPath, String scriptProject) {
ILaunchConfiguration configuration = null;
- ArrayList<ILaunchConfiguration> candidateConfigurations = new ArrayList<ILaunchConfiguration>();
+ ArrayList<ILaunchConfiguration> candidateConfigurations = new ArrayList<>();
try {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfiguration[] configs = launchManager
@@ -83,7 +83,7 @@ public class SystemTapScriptLaunchShortcut extends ProfileLaunchShortcut {
int candidateCount = candidateConfigurations.size();
if (candidateCount == 0) {
- LinkedList<String> configNames = new LinkedList<String>();
+ LinkedList<String> configNames = new LinkedList<>();
configs = launchManager.getLaunchConfigurations();
for (ILaunchConfiguration config : configs) {
configNames.add(config.getName());
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/preferences/ListEditor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/preferences/ListEditor.java
index f787a519b2..9b47133022 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/preferences/ListEditor.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/preferences/ListEditor.java
@@ -64,7 +64,7 @@ public class ListEditor extends org.eclipse.jface.preference.ListEditor {
@Override
protected String[] parseString(String stringList) {
StringTokenizer st = new StringTokenizer(stringList, File.pathSeparator + "\n\r"); //$NON-NLS-1$
- ArrayList<Object> v = new ArrayList<Object>();
+ ArrayList<Object> v = new ArrayList<>();
while (st.hasMoreElements()) {
v.add(st.nextElement());
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/StapErrorParser.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/StapErrorParser.java
index 1dbbf84e4a..f0de0199a1 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/StapErrorParser.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/StapErrorParser.java
@@ -30,7 +30,7 @@ public final class StapErrorParser implements IErrorParser {
@Override
public String[][] parseOutput(String output) {
String[][] sErrors = null;
- ArrayList<String[]> errors = new ArrayList<String[]>();
+ ArrayList<String[]> errors = new ArrayList<>();
int errorType = TYPE;
if(null != output) {
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetLibrary.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetLibrary.java
index e2e48455c9..6cb3d9828f 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetLibrary.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetLibrary.java
@@ -55,7 +55,7 @@ public final class TapsetLibrary {
return functionTree;
}
- private static HashMap<String, String> pages = new HashMap<String, String>();
+ private static HashMap<String, String> pages = new HashMap<>();
/**
* Returns the documentation for the given probe, function, or tapset.
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetParser.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetParser.java
index 219c5edcac..0d275802b3 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetParser.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetParser.java
@@ -55,7 +55,7 @@ public abstract class TapsetParser extends Job {
protected TapsetParser(String[] tapsets, String jobTitle) {
super(jobTitle);
this.tapsets = Arrays.copyOf(tapsets, tapsets.length);
- listeners = new ArrayList<IUpdateListener>();
+ listeners = new ArrayList<>();
cancelRequested = false;
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TreeSettings.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TreeSettings.java
index 762135646e..7b5aa729cf 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TreeSettings.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TreeSettings.java
@@ -99,9 +99,7 @@ public final class TreeSettings {
return false;
}
- try {
- FileReader reader = new FileReader(settingsFile);
-
+ try (FileReader reader = new FileReader(settingsFile)) {
if(!reader.ready()) {
reader.close();
return false;
@@ -136,11 +134,7 @@ public final class TreeSettings {
child = data.getChild("modifiedDate"); //$NON-NLS-1$
treeFileDate = Long.parseLong(child.getString("date")); //$NON-NLS-1$
- } catch(FileNotFoundException fnfe) {
- return false;
- } catch(WorkbenchException we) {
- return false;
- } catch(IOException e) {
+ } catch(IOException|WorkbenchException fnfe) {
return false;
}

Back to the top