minor cleanup to remove Java warnings (no behavioral changes)

This commit is contained in:
Matthew Adams
2014-01-23 11:37:22 -06:00
parent 572238b125
commit 9144fa90c4
17 changed files with 11 additions and 61 deletions

View File

@@ -15,8 +15,6 @@
*/
package org.springframework.cassandra.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.cassandra.core.CassandraOperations;
@@ -31,23 +29,25 @@ import com.datastax.driver.core.Session;
*/
public class CassandraTemplateFactoryBean implements FactoryBean<CassandraOperations>, InitializingBean {
private static final Logger log = LoggerFactory.getLogger(CassandraTemplateFactoryBean.class);
private CassandraTemplate template;
private Session session;
@Override
public CassandraOperations getObject() {
return template;
}
@Override
public Class<? extends CassandraOperations> getObjectType() {
return CassandraOperations.class;
}
@Override
public boolean isSingleton() {
return true;
}
@Override
public void afterPropertiesSet() throws Exception {
if (session == null) {

View File

@@ -22,8 +22,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
@@ -48,8 +46,6 @@ import org.springframework.util.Assert;
public class KeyspaceActionSpecificationFactoryBean implements FactoryBean<Set<KeyspaceActionSpecification<?>>>,
InitializingBean, DisposableBean {
private final static Logger log = LoggerFactory.getLogger(KeyspaceActionSpecificationFactoryBean.class);
private KeyspaceAction action;
private String name;
private List<String> networkTopologyDataCenters = new LinkedList<String>();

View File

@@ -20,8 +20,6 @@ import static org.springframework.data.config.ParsingUtils.getSourceBeanDefiniti
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
@@ -55,8 +53,6 @@ import com.datastax.driver.core.SocketOptions;
*/
public class CassandraClusterParser extends AbstractBeanDefinitionParser {
private final static Logger log = LoggerFactory.getLogger(CassandraClusterParser.class);
@Override
protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext)
throws BeanDefinitionStoreException {

View File

@@ -25,6 +25,8 @@ import com.datastax.driver.core.Host;
*/
public final class RingMember implements Serializable {
private static final long serialVersionUID = -2582309141903132916L;
/*
* Ring attributes
*/

View File

@@ -23,7 +23,7 @@ package org.springframework.cassandra.core.keyspace;
*/
public class DropIndexSpecification extends IndexNameSpecification<DropIndexSpecification> {
private boolean ifExists;
// private boolean ifExists;
/**
* Entry point into the {@link DropIndexSpecification}'s fluent API to drop a table. Convenient if imported

View File

@@ -6,8 +6,6 @@ import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cassandra.core.CassandraOperations;
import org.springframework.cassandra.test.integration.AbstractKeyspaceCreatingIntegrationTest;
import org.springframework.cassandra.test.integration.config.IntegrationTestUtils;
@@ -20,8 +18,6 @@ import com.datastax.driver.core.Session;
@ContextConfiguration
public class PropertyPlaceholderNamespaceCreatingXmlConfigTest extends AbstractKeyspaceCreatingIntegrationTest {
private static Logger log = LoggerFactory.getLogger(PropertyPlaceholderNamespaceCreatingXmlConfigTest.class);
@Inject
Session s;

View File

@@ -3,8 +3,6 @@ package org.springframework.cassandra.test.integration.core.cql.generator;
import static org.springframework.cassandra.test.integration.core.cql.generator.CqlTableSpecificationAssertions.assertTable;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cassandra.test.integration.AbstractKeyspaceCreatingIntegrationTest;
import org.springframework.cassandra.test.unit.core.cql.generator.CreateTableCqlGeneratorTests.BasicTest;
import org.springframework.cassandra.test.unit.core.cql.generator.CreateTableCqlGeneratorTests.CompositePartitionKeyTest;
@@ -17,8 +15,6 @@ import org.springframework.cassandra.test.unit.core.cql.generator.CreateTableCql
*/
public class CreateTableCqlGeneratorIntegrationTests {
private final static Logger log = LoggerFactory.getLogger(CreateTableCqlGeneratorIntegrationTests.class);
/**
* Integration test base class that knows how to do everything except instantiate the concrete unit test type T.
*

View File

@@ -20,7 +20,6 @@ import static org.springframework.cassandra.test.integration.core.cql.generator.
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cassandra.test.integration.AbstractEmbeddedCassandraIntegrationTest;
import org.springframework.cassandra.test.integration.AbstractKeyspaceCreatingIntegrationTest;
import org.springframework.cassandra.test.unit.core.cql.generator.CreateTableCqlGeneratorTests;

View File

@@ -1090,22 +1090,6 @@ public class CassandraOperationsTest extends AbstractKeyspaceCreatingIntegration
return b;
}
/**
* Convert List<Object> to a Book
*
* @param bookElements
* @return
*/
private Book listToBook(List<Object> bookElements) {
Book b = new Book();
b.setIsbn((String) bookElements.get(0));
b.setTitle((String) bookElements.get(1));
b.setAuthor((String) bookElements.get(2));
b.setPages((Integer) bookElements.get(3));
return b;
}
/**
* Assert that 2 Book objects are the same
*
@@ -1129,7 +1113,7 @@ public class CassandraOperationsTest extends AbstractKeyspaceCreatingIntegration
*/
public Book getBook(final String isbn) {
Book b = this.cassandraTemplate.query("select * from book where isbn = ?", new PreparedStatementBinder() {
Book b = cassandraTemplate.query("select * from book where isbn = ?", new PreparedStatementBinder() {
@Override
public BoundStatement bindValues(PreparedStatement ps) throws DriverException {

View File

@@ -4,7 +4,6 @@ import static org.junit.Assert.assertTrue;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.junit.Test;
import org.springframework.cassandra.config.KeyspaceAttributes;

View File

@@ -19,7 +19,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.cassandra.core.keyspace.CreateTableSpecification;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.convert.support.DefaultConversionService;

View File

@@ -7,7 +7,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cassandra.core.SessionCallback;
import org.springframework.cassandra.core.cql.generator.CreateTableCqlGenerator;
import org.springframework.cassandra.core.keyspace.CreateTableSpecification;
import org.springframework.cassandra.support.CassandraAccessor;
import org.springframework.cassandra.support.CassandraExceptionTranslator;
import org.springframework.cassandra.support.exception.CassandraTableExistsException;
@@ -49,7 +48,7 @@ public class CassandraAdminTemplate extends CassandraAccessor implements Cassand
public void setCassandraConverter(CassandraConverter converter) {
Assert.notNull(converter);
this.converter = converter;
setMappingContext(converter.getCassandraMappingContext());
setMappingContext(this.converter.getCassandraMappingContext());
}
protected void setMappingContext(CassandraMappingContext mappingContext) {

View File

@@ -23,6 +23,8 @@ package org.springframework.data.cassandra.exception;
*/
public class EntityWriterException extends Exception {
private static final long serialVersionUID = -3068204776019978031L;
/**
* @param message
*/

View File

@@ -3,13 +3,8 @@ package org.springframework.data.cassandra.util;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cassandra.core.CassandraTemplate;
import org.springframework.cassandra.core.QueryOptions;
import org.springframework.cassandra.core.cql.generator.CreateTableCqlGenerator;
import org.springframework.cassandra.core.keyspace.CreateTableSpecification;
import org.springframework.data.cassandra.convert.CassandraConverter;
import org.springframework.data.cassandra.exception.EntityWriterException;
import org.springframework.data.cassandra.mapping.CassandraPersistentEntity;
import org.springframework.data.cassandra.mapping.CassandraPersistentProperty;
@@ -37,8 +32,6 @@ import com.datastax.driver.core.querybuilder.Update;
*/
public abstract class CqlUtils {
private static Logger log = LoggerFactory.getLogger(CqlUtils.class);
/**
* Create the List of CQL for the indexes required for Cassandra mapped Table.
*

View File

@@ -150,7 +150,6 @@ public class UserRepositoryIntegrationTests {
@AfterClass
public static void stopCassandra() {
EmbeddedCassandraServerHelper.cleanEmbeddedCassandra();
EmbeddedCassandraServerHelper.stopEmbeddedCassandra();
}
private static void assertEquals(User user1, User user2) {

View File

@@ -29,8 +29,6 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cassandra.core.CassandraOperations;
import org.springframework.context.ApplicationContext;
@@ -53,8 +51,6 @@ public class CassandraAdminTest {
@Mock
ApplicationContext context;
private static Logger log = LoggerFactory.getLogger(CassandraAdminTest.class);
@BeforeClass
public static void startCassandra() throws IOException, TTransportException, ConfigurationException,
InterruptedException {

View File

@@ -28,7 +28,6 @@ import org.cassandraunit.dataset.cql.ClassPathCQLDataSet;
import org.cassandraunit.dataset.yaml.ClassPathYamlDataSet;
import org.cassandraunit.utils.EmbeddedCassandraServerHelper;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Rule;
@@ -691,9 +690,4 @@ public class CassandraDataOperationsTest {
EmbeddedCassandraServerHelper.cleanEmbeddedCassandra();
}
@AfterClass
public static void stopCassandra() {
EmbeddedCassandraServerHelper.stopEmbeddedCassandra();
}
}