From d5951c6e02f04acdf60ea5f19282c5d5b28c1c8d Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Mon, 18 May 2015 21:49:44 -0500 Subject: [PATCH] HHH-9803 - Checkstyle fix ups --- build.gradle | 1 - .../hibernate/hql/internal/ast/package.html | 2 +- .../internal/ConcurrentStatisticsImpl.java | 12 ++--- .../tuple/entity/EntityMetamodel.java | 7 ++- .../type/descriptor/sql/package-info.java | 43 ++++++++++++++++ .../type/descriptor/sql/package.html | 49 ------------------- .../management/impl/CacheRegionUtils.java | 48 ------------------ .../boot/internal/PersistenceXmlParser.java | 2 +- 8 files changed, 54 insertions(+), 110 deletions(-) create mode 100644 hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/package-info.java delete mode 100644 hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/package.html diff --git a/build.gradle b/build.gradle index 340a36962287..6a8d9b37dcc5 100644 --- a/build.gradle +++ b/build.gradle @@ -238,7 +238,6 @@ subprojects { subProject -> sourceSets = [ subProject.sourceSets.main ] configFile = rootProject.file( 'shared/config/checkstyle/checkstyle.xml' ) showViolations = false - ignoreFailures = true } // exclude generated java sources - by explicitly setting the base source dir checkstyleMain.source = 'src/main/java' diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/package.html b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/package.html index 1e6d98c292e3..8a1f64974f70 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/package.html +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/package.html @@ -28,4 +28,4 @@

Classes in this package extend the ANTLR-generated parser classes.

- \ No newline at end of file + diff --git a/hibernate-core/src/main/java/org/hibernate/stat/internal/ConcurrentStatisticsImpl.java b/hibernate-core/src/main/java/org/hibernate/stat/internal/ConcurrentStatisticsImpl.java index d2b410f0295a..870087de4a8d 100644 --- a/hibernate-core/src/main/java/org/hibernate/stat/internal/ConcurrentStatisticsImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/stat/internal/ConcurrentStatisticsImpl.java @@ -395,8 +395,8 @@ public void naturalIdQueryExecuted(String regionName, long time) { boolean isLongestQuery; //noinspection StatementWithEmptyBody for ( long old = naturalIdQueryExecutionMaxTime.get(); - ( isLongestQuery = time > old ) && ( !naturalIdQueryExecutionMaxTime.compareAndSet( old, time ) ); - old = naturalIdQueryExecutionMaxTime.get() ) { + ( isLongestQuery = time > old ) && ( !naturalIdQueryExecutionMaxTime.compareAndSet( old, time ) ); + old = naturalIdQueryExecutionMaxTime.get() ) { // nothing to do here given the odd loop structure... } if ( isLongestQuery && regionName != null ) { @@ -409,13 +409,13 @@ public void naturalIdQueryExecuted(String regionName, long time) { @Override public void queryExecuted(String hql, int rows, long time) { - LOG.hql(hql, time, (long) rows ); + LOG.hql(hql, time, (long) rows ); queryExecutionCount.getAndIncrement(); boolean isLongestQuery; //noinspection StatementWithEmptyBody for ( long old = queryExecutionMaxTime.get(); - ( isLongestQuery = time > old ) && ( !queryExecutionMaxTime.compareAndSet( old, time ) ); - old = queryExecutionMaxTime.get() ) { + ( isLongestQuery = time > old ) && ( !queryExecutionMaxTime.compareAndSet( old, time ) ); + old = queryExecutionMaxTime.get() ) { // nothing to do here given the odd loop structure... } if ( isLongestQuery ) { @@ -860,7 +860,7 @@ public long getOptimisticFailureCount() { } @Override - public String toString() { + public String toString() { return new StringBuilder() .append( "Statistics[" ) .append( "start time=" ).append( startTime ) diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java b/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java index 7232111505fe..babf4a7496bc 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java @@ -63,7 +63,7 @@ import org.hibernate.type.EntityType; import org.hibernate.type.Type; -import org.jboss.logging.Logger; +import static org.hibernate.internal.CoreLogging.messageLogger; /** * Centralizes metamodel information about an entity. @@ -71,8 +71,7 @@ * @author Steve Ebersole */ public class EntityMetamodel implements Serializable { - - private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, EntityMetamodel.class.getName()); + private static final CoreMessageLogger LOG = messageLogger( EntityMetamodel.class ); private static final int NO_VERSION_INDX = -66; @@ -331,7 +330,7 @@ else if ( timing == GenerationTiming.ALWAYS ) { hasNonIdentifierPropertyNamedId = foundNonIdentifierPropertyNamedId; versionPropertyIndex = tempVersionProperty; hasLazyProperties = hasLazy; - if (hasLazyProperties) { + if (hasLazyProperties) { LOG.lazyPropertyFetchingAvailable(name); } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/package-info.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/package-info.java new file mode 100644 index 000000000000..af08d50724a7 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/package-info.java @@ -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: + *

+ * See http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html#996857 + * for more information. + * + * @see java.sql.Types + */ +package org.hibernate.type.descriptor.sql; diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/package.html b/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/package.html deleted file mode 100644 index 9b459877a659..000000000000 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/package.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - -

- Defines handling of the standard JDBC-defined types, as declared by {@link java.sql.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: -

- -

-See http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html#996857 -for more information. -

- - - \ No newline at end of file diff --git a/hibernate-ehcache/src/main/java/org/hibernate/cache/ehcache/management/impl/CacheRegionUtils.java b/hibernate-ehcache/src/main/java/org/hibernate/cache/ehcache/management/impl/CacheRegionUtils.java index 8ce621b7e595..73ab593e892b 100644 --- a/hibernate-ehcache/src/main/java/org/hibernate/cache/ehcache/management/impl/CacheRegionUtils.java +++ b/hibernate-ehcache/src/main/java/org/hibernate/cache/ehcache/management/impl/CacheRegionUtils.java @@ -23,8 +23,6 @@ */ package org.hibernate.cache.ehcache.management.impl; -import java.awt.Color; - /** * CacheRegionUtils * @@ -32,52 +30,6 @@ */ @SuppressWarnings("UnusedDeclaration") 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 * diff --git a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/boot/internal/PersistenceXmlParser.java b/hibernate-entitymanager/src/main/java/org/hibernate/jpa/boot/internal/PersistenceXmlParser.java index ac75b1f81f2a..02508fefac66 100644 --- a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/boot/internal/PersistenceXmlParser.java +++ b/hibernate-entitymanager/src/main/java/org/hibernate/jpa/boot/internal/PersistenceXmlParser.java @@ -69,7 +69,7 @@ * @author Steve Ebersole */ 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 PersistenceUnitTransactionType defaultTransactionType;