+ remove @Override annotations to allow the code to be compiled on 1.5 (though it requires JDK 6 for its collection support)

This commit is contained in:
Costin Leau
2011-11-01 19:13:36 +02:00
parent 8d05e562e5
commit 72af744a1d
93 changed files with 1218 additions and 1225 deletions

View File

@@ -78,7 +78,7 @@ public class Address implements Serializable {
this.number = number;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
@@ -87,7 +87,7 @@ public class Address implements Serializable {
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;

View File

@@ -80,7 +80,7 @@ public class Person implements Serializable {
this.address = address;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
@@ -91,7 +91,7 @@ public class Person implements Serializable {
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;

View File

@@ -16,9 +16,10 @@
package org.springframework.data.redis.cache;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.Collection;
import java.util.concurrent.TimeUnit;
@@ -57,12 +58,12 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
return CollectionTestParams.testParams();
}
@Override
protected Cache createCache(RedisTemplate nativeCache) {
return new RedisCache(CACHE_NAME, CACHE_NAME.concat(":").getBytes(), nativeCache);
}
@Override
protected RedisTemplate createNativeCache() throws Exception {
return template;
}
@@ -79,7 +80,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
ConnectionFactoryTracker.cleanUp();
}
@Override
protected Object getObject() {
return objFactory.instance();
}
@@ -98,7 +99,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
final Object monitor = new Object();
Thread th = new Thread(new Runnable() {
@Override
public void run() {
synchronized (monitor) {
monitor.notify();

View File

@@ -49,7 +49,7 @@ public class NamespaceTest {
public void testSanityTest() throws Exception {
RedisMessageListenerContainer container = ctx.getBean(RedisMessageListenerContainer.class);
assertTrue(container.isRunning());
Thread.sleep(TimeUnit.SECONDS.toMillis(2));
Thread.sleep(TimeUnit.SECONDS.toMillis(8));
}
@Test
@@ -57,7 +57,7 @@ public class NamespaceTest {
StringRedisTemplate template = ctx.getBean(StringRedisTemplate.class);
template.convertAndSend("x1", "[X]test");
template.convertAndSend("z1", "[Z]test");
Thread.sleep(TimeUnit.SECONDS.toMillis(5));
Thread.sleep(TimeUnit.SECONDS.toMillis(8));
}
public void testErrorHandler() throws Exception {

View File

@@ -27,7 +27,7 @@ public class StubErrorHandler implements ErrorHandler {
public BlockingDeque<Throwable> throwables = new LinkedBlockingDeque<Throwable>();
@Override
public void handleError(Throwable t) {
throwables.add(t);
}

View File

@@ -201,7 +201,7 @@ public abstract class AbstractConnectionIntegrationTests {
final BlockingDeque<Message> queue = new LinkedBlockingDeque<Message>();
final MessageListener ml = new MessageListener() {
@Override
public void onMessage(Message message, byte[] pattern) {
queue.add(message);
System.out.println("received message");
@@ -217,7 +217,7 @@ public abstract class AbstractConnectionIntegrationTests {
final AtomicBoolean flag = new AtomicBoolean(true);
Runnable listener = new Runnable() {
@Override
public void run() {
subConn.subscribe(ml, channel);
System.out.println("Subscribed");
@@ -256,7 +256,7 @@ public abstract class AbstractConnectionIntegrationTests {
MessageListener listener = new MessageListener() {
@Override
public void onMessage(Message message, byte[] pattern) {
assertArrayEquals(expectedChannel, message.getChannel());
assertArrayEquals(expectedMessage, message.getBody());
@@ -264,7 +264,7 @@ public abstract class AbstractConnectionIntegrationTests {
};
Thread th = new Thread(new Runnable() {
@Override
public void run() {
// sleep 1 second to let the registration happen
try {
@@ -293,7 +293,7 @@ public abstract class AbstractConnectionIntegrationTests {
MessageListener listener = new MessageListener() {
@Override
public void onMessage(Message message, byte[] pattern) {
assertArrayEquals(expectedPattern, pattern);
assertArrayEquals(expectedMessage, message.getBody());
@@ -302,7 +302,7 @@ public abstract class AbstractConnectionIntegrationTests {
};
Thread th = new Thread(new Runnable() {
@Override
public void run() {
// sleep 1 second to let the registration happen
try {

View File

@@ -39,7 +39,7 @@ public class JedisConnectionIntegrationTests extends AbstractConnectionIntegrati
factory.afterPropertiesSet();
}
@Override
protected RedisConnectionFactory getConnectionFactory() {
return factory;
}

View File

@@ -37,7 +37,7 @@ public class JRedisConnectionIntegrationTests extends AbstractConnectionIntegrat
factory.afterPropertiesSet();
}
@Override
protected RedisConnectionFactory getConnectionFactory() {
return factory;
}

View File

@@ -38,7 +38,7 @@ public class RjcConnectionIntegrationTests extends AbstractConnectionIntegration
factory.afterPropertiesSet();
}
@Override
protected RedisConnectionFactory getConnectionFactory() {
return factory;
}

View File

@@ -42,7 +42,7 @@ public class SessionTest {
final StringRedisTemplate template = new StringRedisTemplate(factory);
template.execute(new SessionCallback<Object>() {
@Override
public Object execute(RedisOperations operations) {
checkConnection(template, conn);
template.discard();
@@ -56,7 +56,7 @@ public class SessionTest {
private void checkConnection(RedisTemplate<?, ?> template, final RedisConnection expectedConnection) {
template.execute(new RedisCallback<Object>() {
@Override
public Object doInRedis(RedisConnection connection) throws DataAccessException {
assertSame(expectedConnection, connection);
return null;

View File

@@ -85,7 +85,7 @@ public class MessageListenerTest {
MessageListenerAdapter adapter = new MessageListenerAdapter(mock) {
@Override
protected void handleListenerException(Throwable ex) {
throw new IllegalStateException(ex);
}

View File

@@ -24,7 +24,6 @@ import org.springframework.data.redis.connection.MessageListener;
*/
public class ThrowableMessageListener implements MessageListener {
@Override
public void onMessage(Message message, byte[] pattern) {
throw new IllegalStateException("throwing exception for message " + message);
}

View File

@@ -24,7 +24,7 @@ import org.springframework.data.redis.hash.HashMapper;
*/
public class BeanUtilsHashMapperTest extends AbstractHashMapperTest {
@Override
protected HashMapper mapperFor(Class t) {
return new BeanUtilsHashMapper(t);
}

View File

@@ -20,7 +20,7 @@ import org.springframework.data.redis.hash.JacksonHashMapper;
public class JacksonHashMapperTest extends AbstractHashMapperTest {
@Override
protected HashMapper mapperFor(Class t) {
return new JacksonHashMapper(t);
}

View File

@@ -37,7 +37,7 @@ public class SimpleRedisSerializerTests {
private static class A implements Serializable {
private Integer value = Integer.valueOf(30);
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
@@ -45,7 +45,7 @@ public class SimpleRedisSerializerTests {
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
@@ -68,7 +68,7 @@ public class SimpleRedisSerializerTests {
private String name = getClass().getName();
private A a = new A();
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
@@ -77,7 +77,7 @@ public class SimpleRedisSerializerTests {
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;

View File

@@ -93,7 +93,7 @@ public abstract class AbstractRedisCollectionTests<T> {
collection.getOperations().delete(Collections.singleton(collection.getKey()));
template.execute(new RedisCallback<Object>() {
@Override
public Object doInRedis(RedisConnection connection) {
connection.flushDb();
return null;

View File

@@ -100,7 +100,7 @@ public abstract class AbstractRedisMapTests<K, V> {
map.getOperations().delete(Collections.singleton(map.getKey()));
template.execute(new RedisCallback<Object>() {
@Override
public Object doInRedis(RedisConnection connection) {
connection.flushDb();
return null;

View File

@@ -27,7 +27,7 @@ public class PersonObjectFactory implements ObjectFactory<Person> {
private int counter = 0;
@Override
public Person instance() {
String uuid = UUID.randomUUID().toString();
return new Person(uuid, uuid, ++counter, new Address(uuid, counter));

View File

@@ -67,7 +67,7 @@ public class RedisCollectionFactoryBeanTests {
// clean up the whole db
template.execute(new RedisCallback<Object>() {
@Override
public Object doInRedis(RedisConnection connection) {
connection.flushDb();
return null;

View File

@@ -37,12 +37,12 @@ public class RedisListTests extends AbstractRedisListTests<Object> {
super(factory, template);
}
@Override
RedisStore copyStore(RedisStore store) {
return new DefaultRedisList(store.getKey().toString(), store.getOperations());
}
@Override
AbstractRedisCollection<Object> createCollection() {
String redisName = getClass().getName();
return new DefaultRedisList(redisName, template);

View File

@@ -42,7 +42,7 @@ public class RedisMapTests extends AbstractRedisMapTests<Object, Object> {
super(keyFactory, valueFactory, template);
}
@Override
RedisMap<Object, Object> createMap() {
String redisName = getClass().getSimpleName();
return new DefaultRedisMap<Object, Object>(redisName, template);

View File

@@ -66,14 +66,14 @@ public class RedisPropertiesTests extends RedisMapTests {
super(keyFactory, valueFactory, template);
}
@Override
RedisMap<Object, Object> createMap() {
String redisName = getClass().getSimpleName();
props = new RedisProperties(defaults, redisName, new StringRedisTemplate(template.getConnectionFactory()));
return props;
}
@Override
protected RedisStore copyStore(RedisStore store) {
return new RedisProperties(store.getKey(), store.getOperations());
}

View File

@@ -37,12 +37,12 @@ public class RedisSetTests extends AbstractRedisSetTests<Object> {
super(factory, template);
}
@Override
RedisStore copyStore(RedisStore store) {
return new DefaultRedisSet(store.getKey().toString(), store.getOperations());
}
@Override
AbstractRedisCollection<Object> createCollection() {
String redisName = getClass().getName();
return new DefaultRedisSet(redisName, template);

View File

@@ -37,12 +37,12 @@ public class RedisZSetTests extends AbstractRedisZSetTest<Object> {
super(factory, template);
}
@Override
RedisStore copyStore(RedisStore store) {
return new DefaultRedisZSet(store.getKey().toString(), store.getOperations());
}
@Override
AbstractRedisCollection<Object> createCollection() {
String redisName = getClass().getName();
return new DefaultRedisZSet(redisName, template);

View File

@@ -24,7 +24,7 @@ import java.util.UUID;
*/
public class StringObjectFactory implements ObjectFactory<String> {
@Override
public String instance() {
return UUID.randomUUID().toString();
}