diff options
author | Alexander Kurtakov | 2014-04-30 05:20:14 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2014-04-30 06:16:23 +0000 |
commit | 633404bb1c87db9fcd02af7939b1a5417b95b10f (patch) | |
tree | ebf66908fb79076f52707077001c1be8276bce1d /systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src | |
parent | 4f338c8d058add881bde9463f3d3b4bfcb979f9d (diff) | |
download | org.eclipse.linuxtools-633404bb1c87db9fcd02af7939b1a5417b95b10f.tar.gz org.eclipse.linuxtools-633404bb1c87db9fcd02af7939b1a5417b95b10f.tar.xz org.eclipse.linuxtools-633404bb1c87db9fcd02af7939b1a5417b95b10f.zip |
Warnings fixes.
* Naming conventions.
* Redundant modifiers.
* Private fields.
Change-Id: I2f7cc9beb9dc1e00395171a1fdca2a631aeaef5c
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Reviewed-on: https://git.eclipse.org/r/25764
Tested-by: Hudson CI
Diffstat (limited to 'systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src')
4 files changed, 19 insertions, 19 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/FunctionParser.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/FunctionParser.java index 1c5961665d..bb65ca01c8 100644 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/FunctionParser.java +++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/FunctionParser.java @@ -34,7 +34,7 @@ import org.eclipse.linuxtools.systemtap.structures.TreeNode; */ public class FunctionParser extends TapsetParser { - static FunctionParser parser = null; + private static FunctionParser parser = null; private TreeNode functions; /** @@ -42,11 +42,11 @@ public class FunctionParser extends TapsetParser { */ public static final String UNKNOWN_TYPE = "unknown"; //$NON-NLS-1$ - private static final String functionRegex = "(?s)(?<!\\w)function\\s+{0}(?:\\s*:\\s*(\\w+))?\\s*\\(([^)]+?)?\\)"; //$NON-NLS-1$ - private static final Pattern pFunction = Pattern.compile("function (?!_)(\\w+) \\(.*?\\)"); //$NON-NLS-1$ - private static final Pattern pParams = Pattern.compile("(\\w+)(?:\\s*:\\s*(\\w+))?"); //$NON-NLS-1$ - private static final Pattern pAllCaps = Pattern.compile("[A-Z_1-9]*"); //$NON-NLS-1$ - private static final Pattern pReturn = Pattern.compile("\\sreturn\\W"); //$NON-NLS-1$ + private static final String FUNC_REGEX = "(?s)(?<!\\w)function\\s+{0}(?:\\s*:\\s*(\\w+))?\\s*\\(([^)]+?)?\\)"; //$NON-NLS-1$ + private static final Pattern P_FUNCTION = Pattern.compile("function (?!_)(\\w+) \\(.*?\\)"); //$NON-NLS-1$ + private static final Pattern P_PARAM = Pattern.compile("(\\w+)(?:\\s*:\\s*(\\w+))?"); //$NON-NLS-1$ + private static final Pattern P_ALL_CAP = Pattern.compile("[A-Z_1-9]*"); //$NON-NLS-1$ + private static final Pattern P_RETURN = Pattern.compile("\\sreturn\\W"); //$NON-NLS-1$ public static FunctionParser getInstance(){ if (parser != null) { @@ -121,10 +121,10 @@ public class FunctionParser extends TapsetParser { filename = mFilename.group(1).toString(); scriptText = null; } else if (filename != null) { - Matcher mFunction = pFunction.matcher(tok); + Matcher mFunction = P_FUNCTION.matcher(tok); if (mFunction.matches()) { String functionName = mFunction.group(1); - if (pAllCaps.matcher(functionName).matches()) { + if (P_ALL_CAP.matcher(functionName).matches()) { // Ignore ALL_CAPS functions, since they are not meant for end-user use. continue; } @@ -141,14 +141,14 @@ public class FunctionParser extends TapsetParser { } private void addFunctionFromScript(String functionName, String scriptText, String scriptFilename) { - String regex = MessageFormat.format(functionRegex, functionName); + String regex = MessageFormat.format(FUNC_REGEX, functionName); Matcher mScript = Pattern.compile(regex).matcher(scriptText); if (mScript.find()) { String functionLine = mScript.group(); String functionType = mScript.group(1); // If the function has no return type, look for a "return" statement to check // if it's really a void function, or if its return type is just unspecified - if (functionType == null && getNextBlockContents(scriptText, mScript.end(), pReturn)) { + if (functionType == null && getNextBlockContents(scriptText, mScript.end(), P_RETURN)) { functionType = UNKNOWN_TYPE; } TreeDefinitionNode function = new TreeDefinitionNode( @@ -175,7 +175,7 @@ public class FunctionParser extends TapsetParser { private void addParamsFromString(String params, TreeNode parentFunction) { if (params != null) { - Matcher mParams = pParams.matcher(params); + Matcher mParams = P_PARAM.matcher(params); while (mParams.find()) { parentFunction.add(new TreeNode( new FuncparamNodeData(mParams.group(), mParams.group(2)), diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/ProbeNodeData.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/ProbeNodeData.java index 0fd3204b42..d5b63e18b9 100644 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/ProbeNodeData.java +++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/ProbeNodeData.java @@ -27,7 +27,7 @@ public class ProbeNodeData implements ISearchableNode { */ @Override public String getSearchToken() { - return MessageFormat.format(ProbeParser.probeRegex, name); + return MessageFormat.format(ProbeParser.PROBE_REGEX, name); } @Override diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/ProbeParser.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/ProbeParser.java index 2acd6ba4e7..1c04a1017c 100644 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/ProbeParser.java +++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/ProbeParser.java @@ -32,16 +32,16 @@ import org.eclipse.linuxtools.systemtap.structures.TreeNode; * @author Ryan Morse * @since 2.0 */ -public class ProbeParser extends TapsetParser { +public final class ProbeParser extends TapsetParser { - static final String probeRegex = "(?s)(?<!\\w)probe\\s+{0}\\s*\\+?="; //$NON-NLS-1$ - private static final String tapsetProbeRegex = "probe {0} \\+?="; //$NON-NLS-1$ + static final String PROBE_REGEX = "(?s)(?<!\\w)probe\\s+{0}\\s*\\+?="; //$NON-NLS-1$ + private static final String TAPSET_PROBE_REGEX = "probe {0} \\+?="; //$NON-NLS-1$ private TreeNode probes; private TreeNode statics; private TreeNode aliases; - static ProbeParser parser = null; + private static ProbeParser parser = null; public static ProbeParser getInstance(){ if (parser != null) { return parser; @@ -247,7 +247,7 @@ public class ProbeParser extends TapsetParser { private String findDefinitionOf(String probeName) { SharedParser sparser = SharedParser.getInstance(); String tapsetContents = sparser.getTapsetContents(); - Matcher probeMatcher = Pattern.compile(MessageFormat.format(tapsetProbeRegex, Pattern.quote(probeName))).matcher(tapsetContents); + Matcher probeMatcher = Pattern.compile(MessageFormat.format(TAPSET_PROBE_REGEX, Pattern.quote(probeName))).matcher(tapsetContents); if (!probeMatcher.find()) { return null; } diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/SharedParser.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/SharedParser.java index 4c4dfeffd8..66c0cc51c1 100644 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/SharedParser.java +++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/SharedParser.java @@ -18,7 +18,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.linuxtools.internal.systemtap.ui.ide.IDEPlugin; -public class SharedParser extends TapsetParser { +public final class SharedParser extends TapsetParser { static final String TAG_FILE = "# file"; //$NON-NLS-1$ /** @@ -28,7 +28,7 @@ public class SharedParser extends TapsetParser { private String tapsetContents = null; - static SharedParser parser = null; + private static SharedParser parser = null; public static SharedParser getInstance(){ if (parser != null) { return parser; |