HHH-8741 - More checkstyle cleanups

This commit is contained in:
Steve Ebersole 2013-11-23 21:40:59 -06:00
parent e59a0170af
commit b6c9a56136
21 changed files with 45 additions and 87 deletions

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008, 2013, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,12 +20,10 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate;
import java.util.List;
import javax.persistence.QueryHint;
import java.util.List;
import org.hibernate.criterion.CriteriaSpecification;
import org.hibernate.criterion.Criterion;
@ -34,6 +32,7 @@ import org.hibernate.criterion.Projection;
import org.hibernate.sql.JoinType;
import org.hibernate.transform.ResultTransformer;
/**
* <tt>Criteria</tt> is a simplified API for retrieving entities
* by composing <tt>Criterion</tt> objects. This is a very
@ -510,10 +509,10 @@ public interface Criteria extends CriteriaSpecification {
/**
* Add a DB query hint to the SQL. These differ from JPA's {@link QueryHint}, which is specific to the JPA
* implementation and ignores DB vendor-specific hints. Instead, these are intended solely for the vendor-specific
* hints, such as Oracle's optimizers. Multiple query hints are supported; the Dialect will determine
* concatenation and placement.
* Add a DB query hint to the SQL. These differ from JPA's {@link javax.persistence.QueryHint}, which is specific
* to the JPA implementation and ignores DB vendor-specific hints. Instead, these are intended solely for the
* vendor-specific hints, such as Oracle's optimizers. Multiple query hints are supported; the Dialect will
* determine concatenation and placement.
*
* @param hint The database specific query hint to add.
* @return this (for method chaining)

View File

@ -34,8 +34,6 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.persistence.QueryHint;
import org.hibernate.transform.ResultTransformer;
import org.hibernate.type.Type;
@ -215,10 +213,10 @@ public interface Query extends BasicQueryContract {
public Query setComment(String comment);
/**
* Add a DB query hint to the SQL. These differ from JPA's {@link QueryHint}, which is specific to the JPA
* implementation and ignores DB vendor-specific hints. Instead, these are intended solely for the vendor-specific
* hints, such as Oracle's optimizers. Multiple query hints are supported; the Dialect will determine
* concatenation and placement.
* Add a DB query hint to the SQL. These differ from JPA's {@link javax.persistence.QueryHint}, which is specific
* to the JPA implementation and ignores DB vendor-specific hints. Instead, these are intended solely for the
* vendor-specific hints, such as Oracle's optimizers. Multiple query hints are supported; the Dialect will
* determine concatenation and placement.
*
* @param hint The database specific query hint to add.
*/

View File

@ -25,24 +25,24 @@ package org.hibernate.boot.registry.internal;
import java.util.LinkedHashSet;
import org.hibernate.integrator.internal.IntegratorServiceImpl;
import org.hibernate.integrator.spi.Integrator;
import org.hibernate.integrator.spi.IntegratorService;
import org.hibernate.internal.CoreMessageLogger;
import org.jboss.logging.Logger;
import org.hibernate.boot.registry.BootstrapServiceRegistry;
import org.hibernate.service.Service;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl;
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
import org.hibernate.boot.registry.selector.internal.StrategySelectorImpl;
import org.hibernate.boot.registry.selector.spi.StrategySelector;
import org.hibernate.service.internal.AbstractServiceRegistryImpl;
import org.hibernate.integrator.internal.IntegratorServiceImpl;
import org.hibernate.integrator.spi.Integrator;
import org.hibernate.integrator.spi.IntegratorService;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.service.Service;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.spi.ServiceBinding;
import org.hibernate.service.spi.ServiceException;
import org.hibernate.service.spi.ServiceInitiator;
import org.hibernate.service.spi.ServiceRegistryImplementor;
import org.hibernate.service.spi.Stoppable;
import org.jboss.logging.Logger;
/**
* {@link ServiceRegistry} implementation containing specialized "bootstrap" services, specifically:<ul>

View File

@ -21,7 +21,6 @@
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.cache.internal;
import java.io.Serializable;
@ -30,7 +29,6 @@ import java.util.Set;
import org.jboss.logging.Logger;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.cfg.Configuration;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.event.service.spi.EventListenerRegistry;
@ -52,8 +50,8 @@ import org.hibernate.service.spi.SessionFactoryServiceRegistry;
* Allows the collection cache to be automatically evicted if an element is inserted/removed/updated *without* properly
* managing both sides of the association (ie, the ManyToOne collection is changed w/o properly managing the OneToMany).
*
* For this functionality to be used, {@link AvailableSettings#AUTO_EVICT_COLLECTION_CACHE} must be enabled. For
* performance reasons, it's disabled by default.
* For this functionality to be used, {@link org.hibernate.cfg.AvailableSettings#AUTO_EVICT_COLLECTION_CACHE} must be
* enabled. For performance reasons, it's disabled by default.
*
* @author Andreas Berger
*/

View File

@ -27,8 +27,6 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.jboss.logging.Logger;
import org.hibernate.engine.query.spi.sql.NativeSQLQueryReturn;
/**
@ -87,7 +85,7 @@ public class ResultSetMappingDefinition implements Serializable {
new NativeSQLQueryReturn.TraceLogger() {
@Override
public void writeLine(String traceLine) {
buffer.append( " " + traceLine + "\n" );
buffer.append( " " ).append( traceLine ).append( "\n" );
}
}
);

View File

@ -37,6 +37,7 @@ import org.hibernate.engine.spi.CollectionEntry;
import org.hibernate.engine.spi.EntityEntry;
import org.hibernate.engine.spi.Status;
import org.hibernate.event.spi.EventSource;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister;
@ -46,10 +47,7 @@ import org.hibernate.type.CollectionType;
import org.hibernate.type.CompositeType;
import org.hibernate.type.EntityType;
import org.hibernate.type.ForeignKeyDirection;
import org.hibernate.type.ManyToOneType;
import org.hibernate.type.OneToOneType;
import org.hibernate.type.Type;
import org.jboss.logging.Logger;
/**
* Delegate responsible for, in conjunction with the various
@ -59,10 +57,7 @@ import org.jboss.logging.Logger;
* @see org.hibernate.engine.spi.CascadingAction
*/
public final class Cascade {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
CoreMessageLogger.class,
Cascade.class.getName()
);
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( Cascade.class );
private final CascadingAction action;
private final EventSource eventSource;

View File

@ -22,9 +22,8 @@
* Boston, MA 02110-1301 USA
*/
package org.hibernate.engine.jdbc.dialect.spi;
import java.sql.SQLException;
import org.jboss.logging.Logger;
import java.sql.SQLException;
import org.hibernate.JDBCException;
import org.hibernate.exception.internal.SQLStateConverter;

View File

@ -34,16 +34,17 @@ import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import org.jboss.logging.Logger;
import org.hibernate.HibernateException;
import org.hibernate.MultiTenancyStrategy;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.Dialect;
import org.hibernate.engine.jdbc.LobCreationContext;
import org.hibernate.engine.jdbc.LobCreator;
import org.hibernate.engine.jdbc.dialect.spi.BasicSQLExceptionConverter;
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider;
import org.hibernate.engine.jdbc.cursor.internal.StandardRefCursorSupport;
import org.hibernate.engine.jdbc.dialect.spi.DatabaseMetaDataDialectResolutionInfoAdapter;
import org.hibernate.engine.jdbc.dialect.spi.DialectFactory;
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfoSource;
import org.hibernate.engine.jdbc.spi.ExtractedDatabaseMetaData;
@ -58,13 +59,10 @@ import org.hibernate.exception.internal.SQLExceptionTypeDelegate;
import org.hibernate.exception.internal.SQLStateConversionDelegate;
import org.hibernate.exception.internal.StandardSQLExceptionConverter;
import org.hibernate.exception.spi.SQLExceptionConverter;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.internal.util.config.ConfigurationHelper;
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider;
import org.hibernate.engine.jdbc.cursor.internal.StandardRefCursorSupport;
import org.hibernate.engine.jdbc.dialect.spi.DialectFactory;
import org.hibernate.service.spi.Configurable;
import org.hibernate.service.spi.ServiceRegistryAwareService;
import org.hibernate.service.spi.ServiceRegistryImplementor;
@ -75,10 +73,7 @@ import org.hibernate.service.spi.ServiceRegistryImplementor;
* @author Steve Ebersole
*/
public class JdbcServicesImpl implements JdbcServices, ServiceRegistryAwareService, Configurable {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
CoreMessageLogger.class,
JdbcServicesImpl.class.getName()
);
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( JdbcServicesImpl.class );
private ServiceRegistryImplementor serviceRegistry;

View File

@ -23,15 +23,13 @@
*/
package org.hibernate.engine.spi;
import javax.persistence.EntityGraph;
import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.persistence.EntityGraph;
import org.hibernate.Filter;
import org.hibernate.UnknownProfileException;
import org.hibernate.internal.FilterImpl;

View File

@ -43,6 +43,7 @@ import org.hibernate.context.spi.CurrentTenantIdentifierResolver;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.function.SQLFunctionRegistry;
import org.hibernate.engine.ResultSetMappingDefinition;
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
import org.hibernate.engine.profile.FetchProfile;
@ -52,9 +53,7 @@ import org.hibernate.id.IdentifierGenerator;
import org.hibernate.internal.NamedQueryRepository;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.procedure.ProcedureCallMemento;
import org.hibernate.proxy.EntityNotFoundDelegate;
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.service.spi.ServiceRegistryImplementor;
import org.hibernate.stat.spi.StatisticsImplementor;
import org.hibernate.type.Type;
@ -287,7 +286,7 @@ public interface SessionFactoryImplementor extends Mapping, SessionFactory {
/**
* Provides access to the named query repository
*
* @return
* @return The repository for named query definitions
*/
public NamedQueryRepository getNamedQueryRepository();

View File

@ -25,8 +25,6 @@ package org.hibernate.engine.transaction.synchronization.internal;
import javax.transaction.SystemException;
import org.jboss.logging.Logger;
import org.hibernate.TransactionException;
import org.hibernate.engine.transaction.internal.jta.JtaStatusHelper;
import org.hibernate.engine.transaction.spi.TransactionContext;

View File

@ -26,10 +26,6 @@ package org.hibernate.event.internal;
import java.io.Serializable;
import java.util.Arrays;
import org.hibernate.engine.spi.SelfDirtinessTracker;
import org.jboss.logging.Logger;
import org.hibernate.AssertionFailure;
import org.hibernate.CustomEntityDirtinessStrategy;
import org.hibernate.HibernateException;
@ -41,6 +37,7 @@ import org.hibernate.engine.internal.Nullability;
import org.hibernate.engine.internal.Versioning;
import org.hibernate.engine.spi.EntityEntry;
import org.hibernate.engine.spi.EntityKey;
import org.hibernate.engine.spi.SelfDirtinessTracker;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.engine.spi.Status;
import org.hibernate.event.spi.EventSource;

View File

@ -25,14 +25,12 @@ package org.hibernate.event.internal;
import java.io.Serializable;
import org.jboss.logging.Logger;
import org.hibernate.HibernateException;
import org.hibernate.cache.spi.access.NaturalIdRegionAccessStrategy;
import org.hibernate.engine.spi.CachedNaturalIdValueSource;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.event.spi.ResolveNaturalIdEvent;
import org.hibernate.event.spi.ResolveNaturalIdEventListener;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.pretty.MessageHelper;
@ -51,10 +49,7 @@ public class DefaultResolveNaturalIdEventListener
public static final Object REMOVED_ENTITY_MARKER = new Object();
public static final Object INCONSISTENT_RTN_CLASS_MARKER = new Object();
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
CoreMessageLogger.class,
DefaultResolveNaturalIdEventListener.class.getName()
);
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( DefaultResolveNaturalIdEventListener.class );
@Override
public void onResolveNaturalId(ResolveNaturalIdEvent event) throws HibernateException {

View File

@ -44,10 +44,9 @@ import org.hibernate.exception.LockAcquisitionException;
import org.hibernate.exception.SQLGrammarException;
import org.hibernate.exception.spi.AbstractSQLExceptionConversionDelegate;
import org.hibernate.exception.spi.ConversionContext;
import org.hibernate.exception.spi.SQLExceptionConverter;
/**
* {@link SQLExceptionConverter} implementation that does conversion based on the
* {@link org.hibernate.exception.spi.SQLExceptionConverter} implementation that does conversion based on the
* JDBC 4 defined {@link SQLException} sub-type hierarchy.
*
* @author Steve Ebersole
@ -57,7 +56,6 @@ public class SQLExceptionTypeDelegate extends AbstractSQLExceptionConversionDele
super( conversionContext );
}
@Override
public JDBCException convert(SQLException sqlException, String message, String sql) {
if ( SQLClientInfoException.class.isInstance( sqlException )

View File

@ -28,7 +28,6 @@ import java.util.Map;
import antlr.SemanticException;
import antlr.collections.AST;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.hql.internal.antlr.HqlSqlTokenTypes;
import org.hibernate.hql.internal.ast.util.ColumnHelper;
import org.hibernate.internal.util.StringHelper;

View File

@ -27,14 +27,13 @@ package org.hibernate.hql.internal.ast.tree;
import antlr.SemanticException;
import antlr.collections.AST;
import org.jboss.logging.Logger;
import org.hibernate.QueryException;
import org.hibernate.engine.internal.JoinSequence;
import org.hibernate.hql.internal.CollectionProperties;
import org.hibernate.hql.internal.antlr.SqlTokenTypes;
import org.hibernate.hql.internal.ast.util.ASTUtil;
import org.hibernate.hql.internal.ast.util.ColumnHelper;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.persister.collection.QueryableCollection;
@ -53,6 +52,7 @@ import org.hibernate.type.Type;
* @author Joshua Davis
*/
public class DotNode extends FromReferenceNode implements DisplayableNode, SelectExpression {
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( DotNode.class );
///////////////////////////////////////////////////////////////////////////
// USED ONLY FOR REGRESSION TESTING!!!!
@ -73,8 +73,6 @@ public class DotNode extends FromReferenceNode implements DisplayableNode, Selec
public static IllegalCollectionDereferenceExceptionBuilder ILLEGAL_COLL_DEREF_EXCP_BUILDER = DEF_ILLEGAL_COLL_DEREF_EXCP_BUILDER;
///////////////////////////////////////////////////////////////////////////
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, DotNode.class.getName());
public static enum DereferenceType {
UNKNOWN,
ENTITY,

View File

@ -23,15 +23,14 @@
*
*/
package org.hibernate.hql.internal.ast.tree;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Iterator;
import java.util.List;
import antlr.RecognitionException;
import antlr.SemanticException;
import antlr.collections.AST;
import org.jboss.logging.Logger;
import org.hibernate.QueryException;
import org.hibernate.engine.internal.JoinSequence;
@ -39,6 +38,7 @@ import org.hibernate.engine.spi.QueryParameters;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.hql.internal.ast.SqlGenerator;
import org.hibernate.hql.internal.ast.util.SessionFactoryHelper;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.param.ParameterSpecification;
import org.hibernate.persister.collection.QueryableCollection;
@ -51,8 +51,7 @@ import org.hibernate.type.Type;
* @author josh
*/
public class IndexNode extends FromReferenceNode {
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, IndexNode.class.getName() );
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( IndexNode.class );
public void setScalarColumnText(int i) throws SemanticException {
throw new UnsupportedOperationException( "An IndexNode cannot generate column text!" );

View File

@ -23,9 +23,9 @@
*
*/
package org.hibernate.hql.internal.ast.util;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Stack;
import antlr.collections.AST;
@ -37,7 +37,6 @@ import antlr.collections.AST;
* @author Strong Liu
*
*/
public class NodeTraverser {
public static interface VisitationStrategy {
public void visit( AST node );

View File

@ -40,8 +40,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.jboss.logging.Logger;
import org.hibernate.HibernateException;
import org.hibernate.LockMode;
import org.hibernate.LockOptions;

View File

@ -32,7 +32,6 @@ import antlr.collections.AST;
import org.hibernate.HibernateException;
import org.hibernate.JDBCException;
import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.hql.internal.ast.HqlSqlWalker;

View File

@ -26,7 +26,6 @@ package org.hibernate.hql.spi;
import java.util.Map;
import org.hibernate.cfg.Mappings;
import org.hibernate.dialect.Dialect;
import org.hibernate.engine.jdbc.spi.JdbcConnectionAccess;
import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.spi.Mapping;