diff options
author | Jiri Vanek <[email protected]> | 2013-12-13 09:54:16 +0100 |
---|---|---|
committer | Jiri Vanek <[email protected]> | 2013-12-13 09:54:16 +0100 |
commit | 6256aac59275df0edd0feb4950272aa33573be9f (patch) | |
tree | adba1e61360cf9e18597a8736b8c50b5022605a0 /tests/test-extensions/net/sourceforge | |
parent | 26e9ef073e4ba4e625c8596113e9138ec85162e4 (diff) |
unittests warning cleanup: fixed typechecks, rawtypes, redundant casts...
ScreenFinder fixed to work partially also in headless mode.
After this clean up only "internal proprietary API and may be removed in a future release" warnings remain fro make check. Please keep itw in this way :)
Diffstat (limited to 'tests/test-extensions/net/sourceforge')
6 files changed, 19 insertions, 21 deletions
diff --git a/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java b/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java index 20a73fe..2413acd 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java +++ b/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java @@ -164,7 +164,7 @@ public class LoggingBottleneck { synchronized public String modifyMethodWithForBrowser(String methodBrowseredName, String className) { try { - Class clazz = Class.forName(className); + Class<?> clazz = Class.forName(className); /* * By using this isAssignable to ensure corect class before invocation, * then we lost possibility to track manualy set browsers, but it is correct, diff --git a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java index 6f45a23..027dcee 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java +++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java @@ -779,9 +779,9 @@ public class ServerAccess { } //probablky it is necessary to get out of net.sourceforge.jnlp. //package where are right now all test-extensions - //for now keeping exactly the three clases helping yo acces the log + //for now keeping exactly the three classes helping you access the log try { - Class clazz = Class.forName(stack[i].getClassName()); + Class<?> clazz = Class.forName(stack[i].getClassName()); String path = null; try { path = clazz.getProtectionDomain().getCodeSource().getLocation().getPath(); diff --git a/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java b/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java index a7f4a72..f41cd7d 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java +++ b/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java @@ -118,9 +118,8 @@ public class ThreadedProcess extends Thread { } } catch (Exception ex) { ex.printStackTrace(); - } finally { - return commandLine; } + return commandLine; } public Process getP() { diff --git a/tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java b/tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java index 91e1ad5..4bf3c0b 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java +++ b/tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java @@ -42,7 +42,6 @@ import java.awt.Point; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; -import java.awt.event.InputEvent; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; @@ -239,18 +238,18 @@ public abstract class AWTHelper extends RulesFolowingClosingListener implements * * @return */ - public Rule getInitStrAsRule(){ + public Rule<String, String> getInitStrAsRule(){ if( initStr != null ){ return new ContainsRule(this.initStr); }else{ - return new Rule(){ + return new Rule<String, String>(){ @Override - public void setRule(Object rule) { + public void setRule(String rule) { } @Override - public boolean evaluate(Object upon) { + public boolean evaluate(String upon) { return true; } diff --git a/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java b/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java index 1841476..1335f0d 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java +++ b/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java @@ -98,9 +98,9 @@ public class KeyboardActions { int key; if( ('0' <= ch) && ('9' >= ch) ){ - key = (int)(ch - '0') + KeyEvent.VK_0; + key = (ch - '0') + KeyEvent.VK_0; }else if( ( 'a' <= ch) && ('z' >= ch) ){ - key = (int)(ch - 'a') + KeyEvent.VK_A; + key = (ch - 'a') + KeyEvent.VK_A; }else{ key = KeyEvent.VK_SPACE; } diff --git a/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java b/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java index 3e88f06..31c2e06 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java +++ b/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java @@ -42,7 +42,7 @@ import java.util.List; public class RulesFolowingClosingListener extends CountingClosingListener { - private List<Rule> rules = new ArrayList<Rule>(); + private List<Rule<?,String>> rules = new ArrayList<Rule<?,String>>(); public static class ContainsRule extends StringRule<String> { @@ -176,19 +176,19 @@ public class RulesFolowingClosingListener extends CountingClosingListener { public RulesFolowingClosingListener() { } - public RulesFolowingClosingListener(List<Rule> l) { + public RulesFolowingClosingListener(List<Rule<?,String>> l) { addRules(l); } - public RulesFolowingClosingListener(Rule... l) { + public RulesFolowingClosingListener(Rule<?,String>... l) { addRules(l); } - public List<Rule> getRules() { + public List<Rule<?,String>> getRules() { return rules; } - public void setRules(List<Rule> rules) { + public void setRules(List<Rule<?,String>> rules) { if (rules == null) { throw new NullPointerException("rules cant be null"); } @@ -199,14 +199,14 @@ public class RulesFolowingClosingListener extends CountingClosingListener { * no more rules will be possible to add by doing this * @param rules */ - public void setRules(Rule[] rules) { + public void setRules(Rule<?,String>[] rules) { if (rules == null) { throw new NullPointerException("rules cant be null"); } this.rules = Arrays.asList(rules); } - public RulesFolowingClosingListener addRules(List<Rule> rules) { + final public RulesFolowingClosingListener addRules(List<Rule<?,String>> rules) { if (rules == null) { throw new NullPointerException("rules cant be null"); } @@ -214,7 +214,7 @@ public class RulesFolowingClosingListener extends CountingClosingListener { return this; } - public RulesFolowingClosingListener addRules(Rule... rules) { + final public RulesFolowingClosingListener addRules(Rule<?,String>... rules) { if (rules == null) { throw new NullPointerException("rules cant be null"); } @@ -227,7 +227,7 @@ public class RulesFolowingClosingListener extends CountingClosingListener { if (rules == null || rules.size() < 1) { throw new IllegalStateException("No rules specified"); } - for (Rule rule : rules) { + for (Rule<?,String> rule : rules) { if (!rule.evaluate(content)) { return false; } |