diff options
author | Alexander Kurtakov | 2014-04-14 17:57:36 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2014-04-15 07:02:22 +0000 |
commit | 55ae03bf1bc6822481c5514906803645fd41a78f (patch) | |
tree | b706958832366f6f1fbaec86a921a524dba8bb03 /systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal | |
parent | ce2036ab67c0eb642237ba2c401433e47cdc336f (diff) | |
download | org.eclipse.linuxtools-55ae03bf1bc6822481c5514906803645fd41a78f.tar.gz org.eclipse.linuxtools-55ae03bf1bc6822481c5514906803645fd41a78f.tar.xz org.eclipse.linuxtools-55ae03bf1bc6822481c5514906803645fd41a78f.zip |
systemtap: Remove dead code all around.
And fix small inconsitencies as spotted.
Change-Id: I7c4a63e9dbaa7651630b26068bb1df30cf3e0bcd
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Reviewed-on: https://git.eclipse.org/r/24992
Diffstat (limited to 'systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal')
10 files changed, 56 insertions, 62 deletions
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 1a328a172e..8838a5da03 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 @@ -376,7 +376,7 @@ public class RunScriptHandler extends AbstractHandler { * @return The command to invoke to start the script running in stap. * @since 2.0 */ - protected String[] buildStandardScript() { + private String[] buildStandardScript() { getImportedTapsets(cmdList); if(isGuru()) { @@ -392,7 +392,7 @@ public class RunScriptHandler extends AbstractHandler { * @since 2.0 */ - protected void getImportedTapsets(List<String> cmdList) { + private void getImportedTapsets(List<String> cmdList) { IPreferenceStore preferenceStore = IDEPlugin.getDefault().getPreferenceStore(); String[] tapsets = preferenceStore.getString(IDEPreferenceConstants.P_TAPSETS).split(File.pathSeparator); @@ -457,7 +457,7 @@ public class RunScriptHandler extends AbstractHandler { * @return An array suitable to pass to <code>Runtime.exec</code> to start stap on this file. * @since 2.0 */ - protected String[] finalizeScript(List<String> cmdList) { + private String[] finalizeScript(List<String> cmdList) { String[] script; diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ToggleCommentHandler.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ToggleCommentHandler.java index 104dce4ddd..6a10a253ae 100644 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ToggleCommentHandler.java +++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ToggleCommentHandler.java @@ -300,7 +300,7 @@ public class ToggleCommentHandler extends AbstractHandler { * * @param editor ITextEditor editor to associate operation target to. */ - public void updateOpTarget(ITextEditor editor) { + private void updateOpTarget(ITextEditor editor) { if (editor != null) { operationTarget = (ITextOperationTarget) editor .getAdapter(ITextOperationTarget.class); diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPConfiguration.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPConfiguration.java index ca8b230f38..7cd71d53f0 100644 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPConfiguration.java +++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPConfiguration.java @@ -81,7 +81,7 @@ public class STPConfiguration extends SourceViewerConfiguration { * * @return default element scanner. */ - protected STPElementScanner getSTPScanner() { + private STPElementScanner getSTPScanner() { if (scanner == null) { scanner = new STPElementScanner(colorManager); scanner.setDefaultReturnToken(new Token(new TextAttribute( 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 0f1d40b545..bdd1744612 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 @@ -51,7 +51,7 @@ public class STPEditor extends SimpleEditor { } @Override - protected void internal_init() { + protected void internalInit() { configureInsertMode(SMART_INSERT, false); setDocumentProvider(new STPDocumentProvider()); } 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 00db067649..f4a536f826 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 @@ -1,13 +1,13 @@ /******************************************************************************* * Copyright (c) 2008 Phil Muldoon <pkmuldoon@picobot.org>. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Phil Muldoon <pkmuldoon@picobot.org> - initial API and implementation. + * Phil Muldoon <pkmuldoon@picobot.org> - initial API and implementation. *******************************************************************************/ package org.eclipse.linuxtools.internal.systemtap.ui.ide.editors.stp; @@ -25,7 +25,7 @@ import org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension; import org.eclipse.swt.widgets.Display; /** - * + * * Reconciling strategy for Systemtap editor code folding positions. The positional aspects * of document tag discovery should really be placed with a position builder * @@ -50,13 +50,13 @@ public class STPReconcilingStrategy implements IReconcilingStrategy, // List of positions protected final ArrayList<Position> documentPositionList = new ArrayList<>(); - + // The end offset of the range to be scanned *//* protected int endOfDocumentPostion; private IDocument currentDocument; - private STPEditor currentEditor; - + private STPEditor currentEditor; + /** * Sets the current editor. */ @@ -76,7 +76,7 @@ public class STPReconcilingStrategy implements IReconcilingStrategy, * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.IRegion) */ @Override - public void reconcile(IRegion partition) { + public void reconcile(IRegion partition) { // Just rebuild the whole document initialReconcile(); } @@ -87,7 +87,7 @@ public class STPReconcilingStrategy implements IReconcilingStrategy, @Override public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) { //Just rebuild the whole document - initialReconcile(); + initialReconcile(); } /* (non-Javadoc) @@ -101,7 +101,7 @@ public class STPReconcilingStrategy implements IReconcilingStrategy, } catch (BadLocationException e) { // Cannot reconcile, return return; - } + } } /* (non-Javadoc) @@ -109,24 +109,24 @@ public class STPReconcilingStrategy implements IReconcilingStrategy, */ @Override public void setProgressMonitor(IProgressMonitor monitor) { - + } - + /** - * - * From currentDocument, calculate beginning of document + * + * From currentDocument, calculate beginning of document * to endOfDocumentPostion to build positions for code folding. - * + * * @throws BadLocationException */ private void calculatePositions() throws BadLocationException { // Clear old positions and reset to beginning of document documentPositionList.clear(); nextCharPosition = 0; - + // Build the actual document positions buildPositions(); - + // Paint the folding annotations in the background. Display.getDefault().asyncExec(new Runnable() { @Override @@ -135,15 +135,15 @@ public class STPReconcilingStrategy implements IReconcilingStrategy, } }); } - + /** - * + * * Start trying to guess if given char z, what - if any - tag this - * begins. - * + * begins. + * * @param location - location of current position * @return - tag type, if any - * + * * @throws BadLocationException */ private int classifyComponent(int location) throws BadLocationException { @@ -165,14 +165,14 @@ public class STPReconcilingStrategy implements IReconcilingStrategy, case 'p': if (isProbe()) { currentTagStart = location; - return STP_PROBE; + return STP_PROBE; } - + // The 'function' case. case 'f': if (isFunction()) { currentTagStart = location; - return STP_FUNCTION; + return STP_FUNCTION; } // No tag, don't fold region. default: @@ -180,16 +180,16 @@ public class STPReconcilingStrategy implements IReconcilingStrategy, } return STP_NO_TAG; } - + /** - * + * * Build a list of locations to mark beginning and end of folding regions. - * + * * @throws BadLocationException */ private void buildPositions() throws BadLocationException { while (nextCharPosition < endOfDocumentPostion) { - switch (classifyComponent(nextCharPosition)) + switch (classifyComponent(nextCharPosition)) { // All of these cases have found the beginning of a tag // to start folding. Each element must now be find @@ -211,16 +211,16 @@ public class STPReconcilingStrategy implements IReconcilingStrategy, } } } - + /** - * + * * Write a Position to the position list. - * + * * @param startOffset - start of position in the document. * @param length - length of position. - * + * */ - protected void writePosition(int startOffset, int length) { + private void writePosition(int startOffset, int length) { if (length > 0) documentPositionList.add(new Position(startOffset, length)); } @@ -228,7 +228,7 @@ public class STPReconcilingStrategy implements IReconcilingStrategy, private boolean isProbe() throws BadLocationException { return matchKeyWord("probe"); //$NON-NLS-1$ } - + private boolean isFunction() throws BadLocationException { return matchKeyWord("function"); //$NON-NLS-1$ } @@ -240,28 +240,28 @@ public class STPReconcilingStrategy implements IReconcilingStrategy, char ch = currentDocument.getChar(location); if ((ch == ' ') || (!Character.isLetter(ch))) break; - else + else keyWord.append(ch); location++; } if (keyWord.toString().compareTo(word) == 0) return true; - return false; + return false; } - + private int findEndOfProbeOrFunction() throws BadLocationException { int bracketCount = 0; boolean firstBracket = false; char ch; - + while (nextCharPosition < endOfDocumentPostion) { ch = currentDocument.getChar(nextCharPosition); if (ch == '{') { firstBracket = true; bracketCount++; } - if (ch == '}') - bracketCount--; + if (ch == '}') + bracketCount--; if ((bracketCount == 0) && (firstBracket)) return (nextCharPosition-currentTagStart)+2; nextCharPosition++; @@ -275,7 +275,7 @@ public class STPReconcilingStrategy implements IReconcilingStrategy, if (ch == '*') { nextCharPosition++; ch = currentDocument.getChar(nextCharPosition); - if (ch == '/') + if (ch == '/') return (nextCharPosition-currentTagStart)+2; } nextCharPosition++; 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 921a7060ed..80d66f9ae4 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 @@ -472,7 +472,7 @@ public class SystemTapScriptGraphOptionsTab extends * @param configuration * @return */ - public static ArrayList<String> createDatasetNames(ILaunchConfiguration configuration) { + public static List<String> createDatasetNames(ILaunchConfiguration configuration) { try { int numberOfRegexs = configuration.getAttribute(NUMBER_OF_REGEXS, 0); ArrayList<String> names = new ArrayList<>(numberOfRegexs); @@ -492,7 +492,7 @@ public class SystemTapScriptGraphOptionsTab extends * @param configuration The desired run configuration. * @return A list of parsers. */ - public static ArrayList<IDataSetParser> createDatasetParsers(ILaunchConfiguration configuration) { + public static List<IDataSetParser> createDatasetParsers(ILaunchConfiguration configuration) { try { int numberOfRegexs = configuration.getAttribute(NUMBER_OF_REGEXS, 0); ArrayList<IDataSetParser> parsers = new ArrayList<>(numberOfRegexs); @@ -512,7 +512,7 @@ public class SystemTapScriptGraphOptionsTab extends * @param configuration * @return */ - public static ArrayList<IFilteredDataSet> createDataset(ILaunchConfiguration configuration) { + public static List<IFilteredDataSet> createDataset(ILaunchConfiguration configuration) { try { int numberOfRegexs = configuration.getAttribute(NUMBER_OF_REGEXS, 0); ArrayList<IFilteredDataSet> datasets = new ArrayList<>(numberOfRegexs); @@ -539,7 +539,7 @@ public class SystemTapScriptGraphOptionsTab extends * @param configuration The desired run configuration. * @return A data set. */ - public static ArrayList<LinkedList<GraphData>> createGraphsFromConfiguration (ILaunchConfiguration configuration) + public static List<LinkedList<GraphData>> createGraphsFromConfiguration (ILaunchConfiguration configuration) throws CoreException { // Restrict number of regexs to at least one, so at least // one inner list will exist in the return value. @@ -642,7 +642,7 @@ public class SystemTapScriptGraphOptionsTab extends runWithChartCheckButton.setSelection(false); } - protected void createColumnSelector(Composite parent) { + private void createColumnSelector(Composite parent) { GridLayout layout = new GridLayout(); parent.setLayout(layout); @@ -1296,10 +1296,6 @@ public class SystemTapScriptGraphOptionsTab extends + (bad ? " " + Messages.SystemTapScriptGraphOptionsTab_invalidGraph : "")); //$NON-NLS-1$ //$NON-NLS-2$ } - public boolean canFlipToNextPage() { - return false; - } - @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { configuration.setAttribute(RUN_WITH_CHART, false); 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 40525c88bd..3ed71d458a 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 impleme } - protected ILaunchConfiguration findLaunchConfiguration(String scriptPath, String scriptProject) { + private ILaunchConfiguration findLaunchConfiguration(String scriptPath, String scriptProject) { ILaunchConfiguration configuration = null; ArrayList<ILaunchConfiguration> candidateConfigurations = new ArrayList<>(); try { 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 ec83991449..e28ba50e90 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 @@ -169,9 +169,7 @@ public abstract class TapsetParser extends Job { } } - } catch (JSchException e) { - ExceptionErrorDialog.openError(Messages.TapsetParser_ErrorRunningSystemtap, e); - } catch (IOException e) { + } catch (JSchException|IOException e) { ExceptionErrorDialog.openError(Messages.TapsetParser_ErrorRunningSystemtap, e); } catch (InterruptedException e) { // TODO Auto-generated catch block diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/views/BrowserView.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/views/BrowserView.java index aba44bfbc8..27d6e95148 100644 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/views/BrowserView.java +++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/views/BrowserView.java @@ -86,7 +86,7 @@ public abstract class BrowserView extends ViewPart { } } - abstract protected Image getEntryImage(TreeNode treeObj); + protected abstract Image getEntryImage(TreeNode treeObj); /** * Provides the icon and text for each entry in the tapset tree. diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/views/KernelBrowserView.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/views/KernelBrowserView.java index 7be73e8f22..2947fe9dda 100644 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/views/KernelBrowserView.java +++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/views/KernelBrowserView.java @@ -122,7 +122,7 @@ public class KernelBrowserView extends BrowserView { /** * Wires up all of the actions for this browser, such as double and right click handlers. */ - public void makeActions() { + private void makeActions() { doubleClickAction = new KernelSourceAction(getSite().getWorkbenchWindow(), this); viewer.addDoubleClickListener(doubleClickAction); IDEPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(propertyChangeListener); |