aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorGabor Liptak <gliptak@gmail.com>2015-06-17 13:45:37 -0400
committerGabor Liptak <gliptak@gmail.com>2015-06-17 13:45:37 -0400
commit6f7dcf0f6ad046940c37a14041e2ddd02c457776 (patch)
tree9022c22c58ff90949dc098b5866590ee56fbbdcb /sonar-core
parent8714a329c98b2610cf54632400e33447b7bf7448 (diff)
downloadsonarqube-6f7dcf0f6ad046940c37a14041e2ddd02c457776.tar.gz
sonarqube-6f7dcf0f6ad046940c37a14041e2ddd02c457776.zip
Cleanup warnings
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/BatchSession.java4
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/DaoUtils.java1
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java4
-rw-r--r--sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java4
-rw-r--r--sonar-core/src/test/java/org/sonar/core/persistence/BatchSessionTest.java9
-rw-r--r--sonar-core/src/test/java/org/sonar/core/persistence/MyBatisTest.java2
6 files changed, 13 insertions, 11 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/BatchSession.java b/sonar-core/src/main/java/org/sonar/core/persistence/BatchSession.java
index bcc1b481a18..f4603ade974 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/BatchSession.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/BatchSession.java
@@ -40,11 +40,11 @@ public class BatchSession extends DbSession {
private final int batchSize;
private int count = 0;
- BatchSession(WorkQueue queue, SqlSession session) {
+ BatchSession(WorkQueue<?> queue, SqlSession session) {
this(queue, session, MAX_BATCH_SIZE);
}
- BatchSession(WorkQueue queue, SqlSession session, int batchSize) {
+ BatchSession(WorkQueue<?> queue, SqlSession session, int batchSize) {
super(queue, session);
this.batchSize = batchSize;
}
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DaoUtils.java b/sonar-core/src/main/java/org/sonar/core/persistence/DaoUtils.java
index 03372a70717..1173dca37f3 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/DaoUtils.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/DaoUtils.java
@@ -63,7 +63,6 @@ public final class DaoUtils {
// only static stuff
}
- @SuppressWarnings("unchecked")
public static List<Class> getDaoClasses() {
return ImmutableList.<Class>of(
ActionPlanDao.class,
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java b/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
index 7a646a05c29..751f23cbad1 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
@@ -149,9 +149,9 @@ public class MyBatis {
private SqlSessionFactory sessionFactory;
// TODO this queue should directly be an IndexQueue. Pending move of persistence to sonar-server
- private WorkQueue queue;
+ private WorkQueue<?> queue;
- public MyBatis(Database database, Logback logback, WorkQueue queue) {
+ public MyBatis(Database database, Logback logback, WorkQueue<?> queue) {
this.database = database;
this.logback = logback;
this.queue = queue;
diff --git a/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java b/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java
index d6a2a258a75..c66a963ba85 100644
--- a/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java
+++ b/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java
@@ -199,7 +199,7 @@ public class ComponentContainer {
private String getName(Object extension) {
if (extension instanceof Class) {
- return ((Class) extension).getName();
+ return ((Class<?>) extension).getName();
}
return getName(extension.getClass());
}
@@ -208,7 +208,7 @@ public class ComponentContainer {
propertyDefinitions.addComponent(extension, pluginInfo != null ? pluginInfo.getName() : "");
}
- public ComponentContainer addPicoAdapter(ComponentAdapter adapter) {
+ public ComponentContainer addPicoAdapter(ComponentAdapter<?> adapter) {
pico.addAdapter(adapter);
return this;
}
diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/BatchSessionTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/BatchSessionTest.java
index d8ef766f979..71f8c6a7e66 100644
--- a/sonar-core/src/test/java/org/sonar/core/persistence/BatchSessionTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/persistence/BatchSessionTest.java
@@ -30,7 +30,7 @@ public class BatchSessionTest {
@Test
public void shouldCommitWhenReachingBatchSize() {
SqlSession mybatisSession = mock(SqlSession.class);
- WorkQueue queue = mock(WorkQueue.class);
+ WorkQueue<?> queue = mock(WorkQueue.class);
BatchSession session = new BatchSession(queue, mybatisSession, 10);
for (int i = 0; i < 9; i++) {
@@ -41,12 +41,13 @@ public class BatchSessionTest {
}
session.insert("id9");
verify(mybatisSession).commit();
+ session.close();
}
@Test
public void shouldCommitWhenReachingBatchSizeWithoutCommits() {
SqlSession mybatisSession = mock(SqlSession.class);
- WorkQueue queue = mock(WorkQueue.class);
+ WorkQueue<?> queue = mock(WorkQueue.class);
BatchSession session = new BatchSession(queue, mybatisSession, 10);
ClusterAction action = new ClusterAction() {
@@ -63,17 +64,19 @@ public class BatchSessionTest {
}
session.enqueue(action);
verify(mybatisSession).commit();
+ session.close();
}
@Test
public void shouldResetCounterAfterCommit() {
SqlSession mybatisSession = mock(SqlSession.class);
- WorkQueue queue = mock(WorkQueue.class);
+ WorkQueue<?> queue = mock(WorkQueue.class);
BatchSession session = new BatchSession(queue, mybatisSession, 10);
for (int i = 0; i < 35; i++) {
session.insert("id" + i);
}
verify(mybatisSession, times(3)).commit();
+ session.close();
}
}
diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/MyBatisTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/MyBatisTest.java
index 26e56f19347..706e1523149 100644
--- a/sonar-core/src/test/java/org/sonar/core/persistence/MyBatisTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/persistence/MyBatisTest.java
@@ -36,7 +36,7 @@ import static org.mockito.Mockito.mock;
public class MyBatisTest {
private static H2Database database;
private Logback logback = mock(Logback.class);
- private WorkQueue queue = mock(WorkQueue.class);
+ private WorkQueue<?> queue = mock(WorkQueue.class);
@BeforeClass
public static void start() {