HHH-9803 - Checkstyle fix ups

This commit is contained in:
Steve Ebersole 2015-05-18 21:49:44 -05:00
parent cf1971b4bb
commit d5951c6e02
8 changed files with 54 additions and 110 deletions

View File

@ -238,7 +238,6 @@ subprojects { subProject ->
sourceSets = [ subProject.sourceSets.main ] sourceSets = [ subProject.sourceSets.main ]
configFile = rootProject.file( 'shared/config/checkstyle/checkstyle.xml' ) configFile = rootProject.file( 'shared/config/checkstyle/checkstyle.xml' )
showViolations = false showViolations = false
ignoreFailures = true
} }
// exclude generated java sources - by explicitly setting the base source dir // exclude generated java sources - by explicitly setting the base source dir
checkstyleMain.source = 'src/main/java' checkstyleMain.source = 'src/main/java'

View File

@ -28,4 +28,4 @@
<p> <p>
Classes in this package extend the ANTLR-generated parser classes. Classes in this package extend the ANTLR-generated parser classes.
</p> </p>
</body></html> </body></html>

View File

@ -395,8 +395,8 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
boolean isLongestQuery; boolean isLongestQuery;
//noinspection StatementWithEmptyBody //noinspection StatementWithEmptyBody
for ( long old = naturalIdQueryExecutionMaxTime.get(); for ( long old = naturalIdQueryExecutionMaxTime.get();
( isLongestQuery = time > old ) && ( !naturalIdQueryExecutionMaxTime.compareAndSet( old, time ) ); ( isLongestQuery = time > old ) && ( !naturalIdQueryExecutionMaxTime.compareAndSet( old, time ) );
old = naturalIdQueryExecutionMaxTime.get() ) { old = naturalIdQueryExecutionMaxTime.get() ) {
// nothing to do here given the odd loop structure... // nothing to do here given the odd loop structure...
} }
if ( isLongestQuery && regionName != null ) { if ( isLongestQuery && regionName != null ) {
@ -409,13 +409,13 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
@Override @Override
public void queryExecuted(String hql, int rows, long time) { public void queryExecuted(String hql, int rows, long time) {
LOG.hql(hql, time, (long) rows ); LOG.hql(hql, time, (long) rows );
queryExecutionCount.getAndIncrement(); queryExecutionCount.getAndIncrement();
boolean isLongestQuery; boolean isLongestQuery;
//noinspection StatementWithEmptyBody //noinspection StatementWithEmptyBody
for ( long old = queryExecutionMaxTime.get(); for ( long old = queryExecutionMaxTime.get();
( isLongestQuery = time > old ) && ( !queryExecutionMaxTime.compareAndSet( old, time ) ); ( isLongestQuery = time > old ) && ( !queryExecutionMaxTime.compareAndSet( old, time ) );
old = queryExecutionMaxTime.get() ) { old = queryExecutionMaxTime.get() ) {
// nothing to do here given the odd loop structure... // nothing to do here given the odd loop structure...
} }
if ( isLongestQuery ) { if ( isLongestQuery ) {
@ -860,7 +860,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
} }
@Override @Override
public String toString() { public String toString() {
return new StringBuilder() return new StringBuilder()
.append( "Statistics[" ) .append( "Statistics[" )
.append( "start time=" ).append( startTime ) .append( "start time=" ).append( startTime )

View File

@ -63,7 +63,7 @@ import org.hibernate.type.CompositeType;
import org.hibernate.type.EntityType; import org.hibernate.type.EntityType;
import org.hibernate.type.Type; import org.hibernate.type.Type;
import org.jboss.logging.Logger; import static org.hibernate.internal.CoreLogging.messageLogger;
/** /**
* Centralizes metamodel information about an entity. * Centralizes metamodel information about an entity.
@ -71,8 +71,7 @@ import org.jboss.logging.Logger;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class EntityMetamodel implements Serializable { public class EntityMetamodel implements Serializable {
private static final CoreMessageLogger LOG = messageLogger( EntityMetamodel.class );
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, EntityMetamodel.class.getName());
private static final int NO_VERSION_INDX = -66; private static final int NO_VERSION_INDX = -66;
@ -331,7 +330,7 @@ public class EntityMetamodel implements Serializable {
hasNonIdentifierPropertyNamedId = foundNonIdentifierPropertyNamedId; hasNonIdentifierPropertyNamedId = foundNonIdentifierPropertyNamedId;
versionPropertyIndex = tempVersionProperty; versionPropertyIndex = tempVersionProperty;
hasLazyProperties = hasLazy; hasLazyProperties = hasLazy;
if (hasLazyProperties) { if (hasLazyProperties) {
LOG.lazyPropertyFetchingAvailable(name); LOG.lazyPropertyFetchingAvailable(name);
} }

View File

@ -0,0 +1,43 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) $year, 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 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
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
/**
* Defines handling of the standard JDBC-defined types.
*
* We omit certain JDBC types here solely because Hibernate does not use them itself, not due to any
* inability to provide proper descriptors for them. Known omissions include:<ul>
* <li>{@link java.sql.Types#ARRAY ARRAY}</li>
* <li>{@link java.sql.Types#DATALINK DATALINK}</li>
* <li>{@link java.sql.Types#DISTINCT DISTINCT}</li>
* <li>{@link java.sql.Types#STRUCT STRUCT}</li>
* <li>{@link java.sql.Types#REF REF}</li>
* <li>{@link java.sql.Types#JAVA_OBJECT JAVA_OBJECT}</li>
* </ul>
* <p/>
* See <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html#996857">http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html#996857</a>
* for more information.
*
* @see java.sql.Types
*/
package org.hibernate.type.descriptor.sql;

View File

@ -1,49 +0,0 @@
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
~ Copyright (c) 2010, 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 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
~ Lesser General Public License, as published by the Free Software Foundation.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
~ for more details.
~
~ You should have received a copy of the GNU Lesser General Public License
~ along with this distribution; if not, write to:
~ Free Software Foundation, Inc.
~ 51 Franklin Street, Fifth Floor
~ Boston, MA 02110-1301 USA
-->
<html>
<head></head>
<body>
<p>
Defines handling of the standard <tt>JDBC</tt>-defined types, as declared by {@link java.sql.Types}.
</p>
<p>
We omit certain <tt>JDBC</tt> types here solely because Hibernate does not use them itself, not due to any
inability to provide proper descriptors for them. Known omissions include:
</p>
<ul>
<li>{@link java.sql.Types#ARRAY ARRAY}</li>
<li>{@link java.sql.Types#DATALINK DATALINK}</li>
<li>{@link java.sql.Types#DISTINCT DISTINCT}</li>
<li>{@link java.sql.Types#STRUCT STRUCT}</li>
<li>{@link java.sql.Types#REF REF}</li>
<li>{@link java.sql.Types#JAVA_OBJECT JAVA_OBJECT}</li>
</ul>
<p>
See <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html#996857">http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html#996857</a>
for more information.
</p>
</body>
</html>

View File

@ -23,8 +23,6 @@
*/ */
package org.hibernate.cache.ehcache.management.impl; package org.hibernate.cache.ehcache.management.impl;
import java.awt.Color;
/** /**
* CacheRegionUtils * CacheRegionUtils
* *
@ -32,52 +30,6 @@ import java.awt.Color;
*/ */
@SuppressWarnings("UnusedDeclaration") @SuppressWarnings("UnusedDeclaration")
public abstract class CacheRegionUtils { public abstract class CacheRegionUtils {
/**
* HIT_COLOR
*/
public static final Color HIT_COLOR = Color.green;
/**
* MISS_COLOR
*/
public static final Color MISS_COLOR = Color.red;
/**
* PUT_COLOR
*/
public static final Color PUT_COLOR = Color.blue;
/**
* HIT_FILL_COLOR
*/
public static final Color HIT_FILL_COLOR = CacheRegionUtils.HIT_COLOR.brighter().brighter().brighter();
/**
* MISS_FILL_COLOR
*/
public static final Color MISS_FILL_COLOR = CacheRegionUtils.MISS_COLOR.brighter().brighter().brighter();
/**
* PUT_FILL_COLOR
*/
public static final Color PUT_FILL_COLOR = CacheRegionUtils.PUT_COLOR.brighter().brighter().brighter();
/**
* HIT_DRAW_COLOR
*/
public static final Color HIT_DRAW_COLOR = CacheRegionUtils.HIT_COLOR.darker();
/**
* MISS_DRAW_COLOR
*/
public static final Color MISS_DRAW_COLOR = CacheRegionUtils.MISS_COLOR.darker();
/**
* PUT_DRAW_COLOR
*/
public static final Color PUT_DRAW_COLOR = CacheRegionUtils.PUT_COLOR.darker();
/** /**
* Determine a short name from the full name * Determine a short name from the full name
* *

View File

@ -69,7 +69,7 @@ import static org.hibernate.jpa.internal.HEMLogging.messageLogger;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class PersistenceXmlParser { public class PersistenceXmlParser {
private static final EntityManagerMessageLogger LOG = messageLogger( PersistenceXmlParser.class ); private static final EntityManagerMessageLogger LOG = messageLogger( PersistenceXmlParser.class );
private final ClassLoaderService classLoaderService; private final ClassLoaderService classLoaderService;
private final PersistenceUnitTransactionType defaultTransactionType; private final PersistenceUnitTransactionType defaultTransactionType;