diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-10-23 11:12:33 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-10-23 11:12:33 +0200 |
commit | 8a8788fb4e8eb083935fdca81884f21fb443d6a4 (patch) | |
tree | ec0cb8c97db35104b1ceb85562e08616cb1e676c /sonar-squid/src/main | |
parent | c408b3c0bf41d1b897d58f394a9a7133f53bfd1e (diff) | |
download | sonarqube-8a8788fb4e8eb083935fdca81884f21fb443d6a4.tar.gz sonarqube-8a8788fb4e8eb083935fdca81884f21fb443d6a4.zip |
Fix quality flaws
Diffstat (limited to 'sonar-squid/src/main')
3 files changed, 11 insertions, 11 deletions
diff --git a/sonar-squid/src/main/java/org/sonar/squid/Squid.java b/sonar-squid/src/main/java/org/sonar/squid/Squid.java index 2d9ae8ca20a..246a54d82e5 100644 --- a/sonar-squid/src/main/java/org/sonar/squid/Squid.java +++ b/sonar-squid/src/main/java/org/sonar/squid/Squid.java @@ -74,12 +74,12 @@ public class Squid implements DirectedGraphAccessor<SourceCode, SourceCodeEdge>, externalCodeVisitors.add(pico.getComponent(visitor)); } - public <SCANNER extends CodeScanner> SCANNER register(Class<SCANNER> scannerClass) { + public <S extends CodeScanner> S register(Class<S> scannerClass) { if(pico.getComponent(scannerClass) != null){ throw new IllegalStateException("The Squid SCANNER '" + scannerClass.getName() + "' can't be registered multiple times."); } addToPicocontainer(scannerClass); - SCANNER scanner = pico.getComponent(scannerClass); + S scanner = pico.getComponent(scannerClass); for (Object clazz : scanner.getVisitorClasses()) { addToPicocontainer((Class) clazz); scanner.accept(pico.<CodeVisitor> getComponent((Class) clazz)); diff --git a/sonar-squid/src/main/java/org/sonar/squid/api/CodeScanner.java b/sonar-squid/src/main/java/org/sonar/squid/api/CodeScanner.java index 4eba556a2fa..b7ad8ceebba 100644 --- a/sonar-squid/src/main/java/org/sonar/squid/api/CodeScanner.java +++ b/sonar-squid/src/main/java/org/sonar/squid/api/CodeScanner.java @@ -24,17 +24,17 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -public abstract class CodeScanner<VISITOR extends CodeVisitor> { +public abstract class CodeScanner<V extends CodeVisitor> { private List<CodeVisitor> visitors = new ArrayList<CodeVisitor>(); - public abstract Collection<Class<? extends VISITOR>> getVisitorClasses(); + public abstract Collection<Class<? extends V>> getVisitorClasses(); public void accept(CodeVisitor visitor) { visitors.add(visitor); } - public List<VISITOR> getVisitors() { - return (List<VISITOR>) visitors; + public List<V> getVisitors() { + return (List<V>) visitors; } } diff --git a/sonar-squid/src/main/java/org/sonar/squid/api/SourceCode.java b/sonar-squid/src/main/java/org/sonar/squid/api/SourceCode.java index cc48228ebf6..a20544e7bce 100644 --- a/sonar-squid/src/main/java/org/sonar/squid/api/SourceCode.java +++ b/sonar-squid/src/main/java/org/sonar/squid/api/SourceCode.java @@ -203,20 +203,20 @@ public abstract class SourceCode implements Measurable, Comparable<SourceCode> { return this; } - public <SOURCECODE extends SourceCode> SOURCECODE getParent(Class<SOURCECODE> sourceCode) { + public <S extends SourceCode> S getParent(Class<S> sourceCode) { if (parent == null) { return null; } if (parent.getClass().equals(sourceCode)) { - return (SOURCECODE) parent; + return (S) parent; } return parent.getParent(sourceCode); } - public <SOURCECODE extends SourceCode> SOURCECODE getAncestor(Class<SOURCECODE> withClass) { - SOURCECODE ancestor = getParent(withClass); + public <S extends SourceCode> S getAncestor(Class<S> withClass) { + S ancestor = getParent(withClass); if (ancestor!=null) { - SOURCECODE parentAncestor = ancestor.getAncestor(withClass); + S parentAncestor = ancestor.getAncestor(withClass); if (parentAncestor!=null) { ancestor = parentAncestor; } |