Checkstyle fixups

This commit is contained in:
Chris Cranford 2016-05-06 18:37:59 -05:00
parent 58473c87dd
commit 2b66cd72bb
70 changed files with 196 additions and 171 deletions

View File

@ -19,6 +19,9 @@ public interface Metamodel extends javax.persistence.metamodel.Metamodel {
*/
SessionFactory getSessionFactory();
/**
* @deprecated since 5.2
*/
@Deprecated
default EntityType getEntityTypeByName(String entityName) {
return entity( entityName );

View File

@ -444,6 +444,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @deprecated (since 5.2) use {@link ParameterMetadata#getNamedParameterNames()}
*/
@Deprecated
String[] getNamedParameters();
/**

View File

@ -818,6 +818,9 @@ public class SessionFactoryBuilderImpl implements SessionFactoryBuilderImplement
return transactionCoordinatorBuilder.getDefaultConnectionHandlingMode();
}
/**
* @deprecated since 5.2
*/
@Deprecated
private PhysicalConnectionHandlingMode interpretConnectionHandlingMode(
ConnectionAcquisitionMode specifiedAcquisitionMode,

View File

@ -860,6 +860,7 @@ public interface AvailableSettings {
* Proxool/Hibernate property prefix
* @deprecated Use {@link #PROXOOL_CONFIG_PREFIX} instead
*/
@Deprecated
String PROXOOL_PREFIX = PROXOOL_CONFIG_PREFIX;
/**

View File

@ -121,8 +121,7 @@ public class CopyIdentifierComponentSecondPass implements SecondPass {
Iterator<Property> propertyIterator = referencedValue.getPropertyIterator();
while(propertyIterator.hasNext())
{
while(propertyIterator.hasNext()) {
Property referencedComponentProperty = propertyIterator.next();
if ( referencedComponentProperty.isComposite() ) {

View File

@ -220,7 +220,8 @@ public final class Environment implements AvailableSettings {
synchronized (systemProperties) {
GLOBAL_PROPERTIES.putAll(systemProperties);
}
} catch (SecurityException se) {
}
catch (SecurityException se) {
LOG.unableToCopySystemProperties();
}

View File

@ -316,8 +316,7 @@ public abstract class ExternalSessionFactoryConfig {
}
}
private void verifyInt(String value)
{
private void verifyInt(String value) {
if ( value != null ) {
Integer.parseInt( value );
}

View File

@ -82,9 +82,11 @@ public class IndexOrUniqueKeySecondPass implements SecondPass {
"@Index references a unknown column: " + columnName
);
}
if ( unique )
if ( unique ) {
table.getOrCreateUniqueKey( indexName ).addColumn( column );
else
}
else {
table.getOrCreateIndex( indexName ).addColumn( column );
}
}
}

View File

@ -240,9 +240,10 @@ public class InheritanceState {
for (XClass xclass = clazz; xclass != null; xclass = xclass.getSuperclass()) {
if ( ( xclass.getSuperclass() == null || Object.class.getName().equals( xclass.getSuperclass().getName() ) )
&& ( xclass.isAnnotationPresent( Entity.class ) || xclass.isAnnotationPresent( MappedSuperclass.class ) )
&& xclass.isAnnotationPresent(Access.class))
&& xclass.isAnnotationPresent( Access.class ) ) {
return AccessType.getAccessStrategy( xclass.getAnnotation( Access.class ).value() );
}
}
// Guess from identifier.
// FIX: Shouldn't this be determined by the first attribute (i.e., field or property) with annotations, but without an
// explicit Access annotation, according to JPA 2.0 spec 2.3.1: Default Access Type?

View File

@ -46,5 +46,3 @@ public enum MetadataSourceType {
throw new HibernateException( "Unknown metadata source type value [" + value + "]" );
}
}

View File

@ -308,4 +308,3 @@ public class OneToOneSecondPass implements SecondPass {
return join;
}
}

View File

@ -33,7 +33,7 @@ public class PkDrivenByDefaultMapsIdSecondPass implements SecondPass {
throw new AnnotationException(
"Unknown entity name: " + referencedEntityName
);
};
}
TableBinder.linkJoinColumnWithValueOverridingNameIfImplicit(
referencedEntity,
referencedEntity.getKey().getColumnIterator(),

View File

@ -401,5 +401,3 @@ class PropertyContainer {
|| "org.hibernate.bytecode.internal.javassist.FieldHandler".equals( property.getType().getName() );
}
}

View File

@ -54,5 +54,3 @@ public class VerifyFetchProfileReferenceSecondPass implements SecondPass {
);
}
}

View File

@ -53,15 +53,17 @@ public class ListBinder extends CollectionBinder {
@Override
public void setSqlOrderBy(OrderBy orderByAnn) {
if ( orderByAnn != null )
if ( orderByAnn != null ) {
LOG.orderByAnnotationIndexedCollection();
}
}
@Override
public void setSort(Sort sortAnn) {
if ( sortAnn != null )
if ( sortAnn != null ) {
LOG.sortAnnotationIndexedCollection();
}
}
@Override
public SecondPass getSecondPass(

View File

@ -310,11 +310,21 @@ public class XMLContext implements Serializable {
public void override(Default globalDefault) {
if ( globalDefault != null ) {
if ( globalDefault.getAccess() != null ) access = globalDefault.getAccess();
if ( globalDefault.getPackageName() != null ) packageName = globalDefault.getPackageName();
if ( globalDefault.getSchema() != null ) schema = globalDefault.getSchema();
if ( globalDefault.getCatalog() != null ) catalog = globalDefault.getCatalog();
if ( globalDefault.getDelimitedIdentifier() != null ) delimitedIdentifier = globalDefault.getDelimitedIdentifier();
if ( globalDefault.getAccess() != null ) {
access = globalDefault.getAccess();
}
if ( globalDefault.getPackageName() != null ) {
packageName = globalDefault.getPackageName();
}
if ( globalDefault.getSchema() != null ) {
schema = globalDefault.getSchema();
}
if ( globalDefault.getCatalog() != null ) {
catalog = globalDefault.getCatalog();
}
if ( globalDefault.getDelimitedIdentifier() != null ) {
delimitedIdentifier = globalDefault.getDelimitedIdentifier();
}
if ( globalDefault.getMetadataComplete() != null ) {
metadataComplete = globalDefault.getMetadataComplete();
}

View File

@ -42,8 +42,10 @@ import org.jboss.logging.Logger;
public class BeanValidationEventListener
implements PreInsertEventListener, PreUpdateEventListener, PreDeleteEventListener {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
BeanValidationEventListener.class.getName());
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
CoreMessageLogger.class,
BeanValidationEventListener.class.getName()
);
private ValidatorFactory factory;
private ConcurrentHashMap<EntityPersister, Set<String>> associationsPerEntityPersister =

View File

@ -60,7 +60,8 @@ public class HibernateTraversableResolver implements TraversableResolver {
//ToOne association
else if ( type.isEntityType() || type.isAnyType() ) {
associations.add( prefix + name );
} else if ( type.isComponentType() ) {
}
else if ( type.isComponentType() ) {
CompositeType componentType = (CompositeType) type;
addAssociationsToTheSetForAllProperties(
componentType.getPropertyNames(),

View File

@ -163,7 +163,8 @@ public class ParameterParser {
// colon character has been escaped
recognizer.other( c );
indx++;
} else if ( c == ':' ) {
}
else if ( c == ':' ) {
// named parameter
final int right = StringHelper.firstIndexOfChar( sqlString, ParserHelper.HQL_SEPARATORS_BITSET, indx + 1 );
final int chopLocation = right < 0 ? sqlString.length() : right;

View File

@ -367,6 +367,7 @@ public interface SessionFactoryImplementor extends Mapping, SessionFactory, Quer
* @param entityName The entity name for which to get the collection roles.
* @return set of all the collection roles in which the given entityName participates.
*/
@Deprecated
default Set<String> getCollectionRolesByEntityParticipant(String entityName) {
return getMetamodel().getCollectionRolesByEntityParticipant( entityName );
}

View File

@ -47,15 +47,20 @@ public class GetterFieldImpl implements Getter {
if ( type.isPrimitive() ) {
if ( type == Boolean.TYPE ) {
return Boolean.valueOf( field.getBoolean( owner ) );
} else if ( type == Byte.TYPE ) {
}
else if ( type == Byte.TYPE ) {
return Byte.valueOf( field.getByte( owner ) );
} else if ( type == Character.TYPE ) {
}
else if ( type == Character.TYPE ) {
return Character.valueOf( field.getChar( owner ) );
} else if ( type == Integer.TYPE ) {
}
else if ( type == Integer.TYPE ) {
return Integer.valueOf( field.getInt( owner ) );
} else if ( type == Long.TYPE ) {
}
else if ( type == Long.TYPE ) {
return Long.valueOf( field.getLong( owner ) );
} else if ( type == Short.TYPE ) {
}
else if ( type == Short.TYPE ) {
return Short.valueOf( field.getShort( owner ) );
}
}

View File

@ -120,9 +120,10 @@ public class BindingTypeHelper {
public BasicType resolveDateTemporalTypeVariant(Class javaType, Type baseType) {
// prefer to use any Type already known
if ( baseType != null && baseType instanceof BasicType ) {
if ( baseType.getReturnedClass().isAssignableFrom( javaType ) )
if ( baseType.getReturnedClass().isAssignableFrom( javaType ) ) {
return (BasicType) baseType;
}
}
if ( Calendar.class.isAssignableFrom( javaType ) ) {
return CalendarDateType.INSTANCE;

View File

@ -10,7 +10,6 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import org.hibernate.envers.boot.internal.EnversService;
import org.hibernate.envers.configuration.EnversSettings;
import org.hibernate.envers.strategy.DefaultAuditStrategy;
import org.hibernate.internal.util.config.ConfigurationHelper;

View File

@ -375,7 +375,7 @@ public final class MetadataTools {
/**
* An iterator over column names.
*/
public static abstract class ColumnNameIterator implements Iterator<String> {
public abstract static class ColumnNameIterator implements Iterator<String> {
}
public static ColumnNameIterator getColumnNameIterator(final Iterator<Selectable> selectableIterator) {

View File

@ -20,8 +20,8 @@ import org.hibernate.envers.internal.tools.MutableInteger;
* @author Adam Warski (adam at warski dot org)
*/
public class Parameters {
public final static String AND = "and";
public final static String OR = "or";
public static final String AND = "and";
public static final String OR = "or";
/**
* Main alias of the entity.

View File

@ -69,7 +69,7 @@ public class ValidityAuditStrategy implements AuditStrategy {
/**
* getter for the revision entity field annotated with @RevisionTimestamp
*/
private Getter revisionTimestampGetter = null;
private Getter revisionTimestampGetter;
private final SessionCacheCleaner sessionCacheCleaner;