Skip to content

Commit

Permalink
HHH-9803 - Checkstyle fix ups
Browse files Browse the repository at this point in the history
  • Loading branch information
sebersole committed May 18, 2015
1 parent 42bb593 commit bbfacee
Show file tree
Hide file tree
Showing 147 changed files with 3,208 additions and 3,190 deletions.
49 changes: 30 additions & 19 deletions hibernate-core/src/main/java/org/hibernate/Interceptor.java
Expand Up @@ -26,7 +26,6 @@
import java.io.Serializable;
import java.util.Iterator;

import org.hibernate.resource.jdbc.spi.StatementInspector;
import org.hibernate.type.Type;

/**
Expand Down Expand Up @@ -71,7 +70,7 @@ public interface Interceptor {
*
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
*/
public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException;
boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException;

/**
* Called when an object is detected to be dirty, during a flush. The interceptor may modify the detected
Expand All @@ -94,7 +93,13 @@ public interface Interceptor {
*
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
*/
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) throws CallbackException;
boolean onFlushDirty(
Object entity,
Serializable id,
Object[] currentState,
Object[] previousState,
String[] propertyNames,
Type[] types) throws CallbackException;

/**
* Called before an object is saved. The interceptor may modify the <tt>state</tt>, which will be used for
Expand All @@ -110,7 +115,7 @@ public interface Interceptor {
*
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
*/
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException;
boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException;

/**
* Called before an object is deleted. It is not recommended that the interceptor modify the <tt>state</tt>.
Expand All @@ -123,7 +128,7 @@ public interface Interceptor {
*
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
*/
public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException;
void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException;

/**
* Called before a collection is (re)created.
Expand All @@ -133,7 +138,7 @@ public interface Interceptor {
*
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
*/
public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException;
void onCollectionRecreate(Object collection, Serializable key) throws CallbackException;

/**
* Called before a collection is deleted.
Expand All @@ -143,7 +148,7 @@ public interface Interceptor {
*
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
*/
public void onCollectionRemove(Object collection, Serializable key) throws CallbackException;
void onCollectionRemove(Object collection, Serializable key) throws CallbackException;

/**
* Called before a collection is updated.
Expand All @@ -153,7 +158,7 @@ public interface Interceptor {
*
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
*/
public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException;
void onCollectionUpdate(Object collection, Serializable key) throws CallbackException;

/**
* Called before a flush.
Expand All @@ -162,7 +167,7 @@ public interface Interceptor {
*
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
*/
public void preFlush(Iterator entities) throws CallbackException;
void preFlush(Iterator entities) throws CallbackException;

/**
* Called after a flush that actually ends in execution of the SQL statements required to synchronize
Expand All @@ -172,7 +177,7 @@ public interface Interceptor {
*
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
*/
public void postFlush(Iterator entities) throws CallbackException;
void postFlush(Iterator entities) throws CallbackException;

/**
* Called to distinguish between transient and detached entities. The return value determines the
Expand All @@ -186,7 +191,7 @@ public interface Interceptor {
* @param entity a transient or detached entity
* @return Boolean or <tt>null</tt> to choose default behaviour
*/
public Boolean isTransient(Object entity);
Boolean isTransient(Object entity);

/**
* Called from <tt>flush()</tt>. The return value determines whether the entity is updated
Expand All @@ -207,7 +212,13 @@ public interface Interceptor {
*
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
*/
public int[] findDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types);
int[] findDirty(
Object entity,
Serializable id,
Object[] currentState,
Object[] previousState,
String[] propertyNames,
Type[] types);
/**
* Instantiate the entity class. Return <tt>null</tt> to indicate that Hibernate should use
* the default constructor of the class. The identifier property of the returned instance
Expand All @@ -221,7 +232,7 @@ public interface Interceptor {
*
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
*/
public Object instantiate(String entityName, EntityMode entityMode, Serializable id) throws CallbackException;
Object instantiate(String entityName, EntityMode entityMode, Serializable id) throws CallbackException;

/**
* Get the entity name for a persistent or transient instance.
Expand All @@ -232,7 +243,7 @@ public interface Interceptor {
*
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
*/
public String getEntityName(Object object) throws CallbackException;
String getEntityName(Object object) throws CallbackException;

/**
* Get a fully loaded entity instance that is cached externally.
Expand All @@ -244,7 +255,7 @@ public interface Interceptor {
*
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
*/
public Object getEntity(String entityName, Serializable id) throws CallbackException;
Object getEntity(String entityName, Serializable id) throws CallbackException;

/**
* Called when a Hibernate transaction is begun via the Hibernate <tt>Transaction</tt>
Expand All @@ -253,21 +264,21 @@ public interface Interceptor {
*
* @param tx The Hibernate transaction facade object
*/
public void afterTransactionBegin(Transaction tx);
void afterTransactionBegin(Transaction tx);

/**
* Called before a transaction is committed (but not before rollback).
*
* @param tx The Hibernate transaction facade object
*/
public void beforeTransactionCompletion(Transaction tx);
void beforeTransactionCompletion(Transaction tx);

/**
* Called after a transaction is committed or rolled back.
*
* @param tx The Hibernate transaction facade object
*/
public void afterTransactionCompletion(Transaction tx);
void afterTransactionCompletion(Transaction tx);

/**
* Called when sql string is being prepared.
Expand All @@ -278,5 +289,5 @@ public interface Interceptor {
* to inspect and alter SQL statements.
*/
@Deprecated
public String onPrepareStatement(String sql);
String onPrepareStatement(String sql);
}
24 changes: 11 additions & 13 deletions hibernate-core/src/main/java/org/hibernate/Transaction.java
Expand Up @@ -25,8 +25,6 @@

import javax.transaction.Synchronization;

import org.hibernate.engine.transaction.spi.IsolationDelegate;
import org.hibernate.engine.transaction.spi.LocalStatus;
import org.hibernate.resource.transaction.spi.TransactionStatus;

/**
Expand All @@ -53,16 +51,16 @@ public interface Transaction {
*
* @throws HibernateException Indicates a problem beginning the transaction.
*/
public void begin();
void begin();

/**
* Commit this transaction. This might entail a number of things depending on the context:<ul>
* <li>
* If this transaction is the {@link #isInitiator initiator}, {@link Session#flush} the {@link Session}
* with which it is associated (unless {@link Session} is in {@link FlushMode#MANUAL}).
* If the underlying transaction was initiated from this Transaction the Session will be flushed,
* unless the Session is in {@link FlushMode#MANUAL} FlushMode.
* </li>
* <li>
* If this transaction is the {@link #isInitiator initiator}, commit the underlying transaction.
* If the underlying transaction was initiated from this Transaction, commit the underlying transaction.
* </li>
* <li>
* Coordinate various callbacks
Expand All @@ -71,15 +69,15 @@ public interface Transaction {
*
* @throws HibernateException Indicates a problem committing the transaction.
*/
public void commit();
void commit();

/**
* Rollback this transaction. Either rolls back the underlying transaction or ensures it cannot later commit
* (depending on the actual underlying strategy).
*
* @throws HibernateException Indicates a problem rolling back the transaction.
*/
public void rollback();
void rollback();

/**
* Get the current local status of this transaction.
Expand All @@ -89,7 +87,7 @@ public interface Transaction {
*
* @return The current local status.
*/
public TransactionStatus getStatus();
TransactionStatus getStatus();

/**
* Register a user synchronization callback for this transaction.
Expand All @@ -98,25 +96,25 @@ public interface Transaction {
*
* @throws HibernateException Indicates a problem registering the synchronization.
*/
public void registerSynchronization(Synchronization synchronization) throws HibernateException;
void registerSynchronization(Synchronization synchronization) throws HibernateException;

/**
* Set the transaction timeout for any transaction started by a subsequent call to {@link #begin} on this instance.
*
* @param seconds The number of seconds before a timeout.
*/
public void setTimeout(int seconds);
void setTimeout(int seconds);

/**
* Retrieve the transaction timeout set for this transaction. A negative indicates no timeout has been set.
*
* @return The timeout, in seconds.
*/
public int getTimeout();
int getTimeout();

/**
* Make a best effort to mark the underlying transaction for rollback only.
*/
public void markRollbackOnly();
void markRollbackOnly();

}
Expand Up @@ -23,7 +23,6 @@
*/
package org.hibernate.boot;

import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
import org.hibernate.internal.util.StringHelper;

Expand All @@ -36,35 +35,41 @@ public enum SchemaAutoTooling {
/**
* Drop the schema and recreate it on SessionFactory startup.
*/
CREATE,
CREATE( "create" ),
/**
* Drop the schema and recreate it on SessionFactory startup. Additionally, drop the
* schema on SessionFactory shutdown.
*/
CREATE_DROP,
CREATE_DROP( "create-drop" ),
/**
* Update (alter) the schema on SessionFactory startup.
*/
UPDATE,
UPDATE( "update" ),
/**
* Validate the schema on SessionFactory startup.
*/
VALIDATE;
VALIDATE( "validate" );

private final String externalForm;

SchemaAutoTooling(String externalForm) {
this.externalForm = externalForm;
}

public static SchemaAutoTooling interpret(String configurationValue) {
if ( StringHelper.isEmpty( configurationValue ) ) {
return null;
}
else if ( "validate".equals( configurationValue ) ) {
else if ( VALIDATE.externalForm.equals( configurationValue ) ) {
return VALIDATE;
}
else if ( "update".equals( configurationValue ) ) {
else if ( UPDATE.externalForm.equals( configurationValue ) ) {
return UPDATE;
}
else if ( "create".equals( configurationValue ) ) {
else if ( CREATE.externalForm.equals( configurationValue ) ) {
return CREATE;
}
else if ( "create-drop".equals( configurationValue ) ) {
else if ( CREATE_DROP.externalForm.equals( configurationValue ) ) {
return CREATE_DROP;
}
else {
Expand Down
Expand Up @@ -35,7 +35,6 @@
import org.hibernate.boot.archive.scan.spi.ScanParameters;
import org.hibernate.boot.archive.scan.spi.ScanResult;

import org.jboss.jandex.ClassInfo;
import org.jboss.logging.Logger;

/**
Expand Down
Expand Up @@ -26,7 +26,6 @@
import java.lang.reflect.Constructor;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import javax.persistence.Converter;

Expand Down

0 comments on commit bbfacee

Please sign in to comment.