Skip to content

Commit bbfacee

Browse files
committed
HHH-9803 - Checkstyle fix ups
1 parent 42bb593 commit bbfacee

File tree

147 files changed

+3208
-3190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+3208
-3190
lines changed

hibernate-core/src/main/java/org/hibernate/Interceptor.java

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import java.io.Serializable;
2727
import java.util.Iterator;
2828

29-
import org.hibernate.resource.jdbc.spi.StatementInspector;
3029
import org.hibernate.type.Type;
3130

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

7675
/**
7776
* Called when an object is detected to be dirty, during a flush. The interceptor may modify the detected
@@ -94,7 +93,13 @@ public interface Interceptor {
9493
*
9594
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
9695
*/
97-
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) throws CallbackException;
96+
boolean onFlushDirty(
97+
Object entity,
98+
Serializable id,
99+
Object[] currentState,
100+
Object[] previousState,
101+
String[] propertyNames,
102+
Type[] types) throws CallbackException;
98103

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

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

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

138143
/**
139144
* Called before a collection is deleted.
@@ -143,7 +148,7 @@ public interface Interceptor {
143148
*
144149
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
145150
*/
146-
public void onCollectionRemove(Object collection, Serializable key) throws CallbackException;
151+
void onCollectionRemove(Object collection, Serializable key) throws CallbackException;
147152

148153
/**
149154
* Called before a collection is updated.
@@ -153,7 +158,7 @@ public interface Interceptor {
153158
*
154159
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
155160
*/
156-
public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException;
161+
void onCollectionUpdate(Object collection, Serializable key) throws CallbackException;
157162

158163
/**
159164
* Called before a flush.
@@ -162,7 +167,7 @@ public interface Interceptor {
162167
*
163168
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
164169
*/
165-
public void preFlush(Iterator entities) throws CallbackException;
170+
void preFlush(Iterator entities) throws CallbackException;
166171

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

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

191196
/**
192197
* Called from <tt>flush()</tt>. The return value determines whether the entity is updated
@@ -207,7 +212,13 @@ public interface Interceptor {
207212
*
208213
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
209214
*/
210-
public int[] findDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types);
215+
int[] findDirty(
216+
Object entity,
217+
Serializable id,
218+
Object[] currentState,
219+
Object[] previousState,
220+
String[] propertyNames,
221+
Type[] types);
211222
/**
212223
* Instantiate the entity class. Return <tt>null</tt> to indicate that Hibernate should use
213224
* the default constructor of the class. The identifier property of the returned instance
@@ -221,7 +232,7 @@ public interface Interceptor {
221232
*
222233
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
223234
*/
224-
public Object instantiate(String entityName, EntityMode entityMode, Serializable id) throws CallbackException;
235+
Object instantiate(String entityName, EntityMode entityMode, Serializable id) throws CallbackException;
225236

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

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

249260
/**
250261
* Called when a Hibernate transaction is begun via the Hibernate <tt>Transaction</tt>
@@ -253,21 +264,21 @@ public interface Interceptor {
253264
*
254265
* @param tx The Hibernate transaction facade object
255266
*/
256-
public void afterTransactionBegin(Transaction tx);
267+
void afterTransactionBegin(Transaction tx);
257268

258269
/**
259270
* Called before a transaction is committed (but not before rollback).
260271
*
261272
* @param tx The Hibernate transaction facade object
262273
*/
263-
public void beforeTransactionCompletion(Transaction tx);
274+
void beforeTransactionCompletion(Transaction tx);
264275

265276
/**
266277
* Called after a transaction is committed or rolled back.
267278
*
268279
* @param tx The Hibernate transaction facade object
269280
*/
270-
public void afterTransactionCompletion(Transaction tx);
281+
void afterTransactionCompletion(Transaction tx);
271282

272283
/**
273284
* Called when sql string is being prepared.
@@ -278,5 +289,5 @@ public interface Interceptor {
278289
* to inspect and alter SQL statements.
279290
*/
280291
@Deprecated
281-
public String onPrepareStatement(String sql);
292+
String onPrepareStatement(String sql);
282293
}

hibernate-core/src/main/java/org/hibernate/Transaction.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525

2626
import javax.transaction.Synchronization;
2727

28-
import org.hibernate.engine.transaction.spi.IsolationDelegate;
29-
import org.hibernate.engine.transaction.spi.LocalStatus;
3028
import org.hibernate.resource.transaction.spi.TransactionStatus;
3129

3230
/**
@@ -53,16 +51,16 @@ public interface Transaction {
5351
*
5452
* @throws HibernateException Indicates a problem beginning the transaction.
5553
*/
56-
public void begin();
54+
void begin();
5755

5856
/**
5957
* Commit this transaction. This might entail a number of things depending on the context:<ul>
6058
* <li>
61-
* If this transaction is the {@link #isInitiator initiator}, {@link Session#flush} the {@link Session}
62-
* with which it is associated (unless {@link Session} is in {@link FlushMode#MANUAL}).
59+
* If the underlying transaction was initiated from this Transaction the Session will be flushed,
60+
* unless the Session is in {@link FlushMode#MANUAL} FlushMode.
6361
* </li>
6462
* <li>
65-
* If this transaction is the {@link #isInitiator initiator}, commit the underlying transaction.
63+
* If the underlying transaction was initiated from this Transaction, commit the underlying transaction.
6664
* </li>
6765
* <li>
6866
* Coordinate various callbacks
@@ -71,15 +69,15 @@ public interface Transaction {
7169
*
7270
* @throws HibernateException Indicates a problem committing the transaction.
7371
*/
74-
public void commit();
72+
void commit();
7573

7674
/**
7775
* Rollback this transaction. Either rolls back the underlying transaction or ensures it cannot later commit
7876
* (depending on the actual underlying strategy).
7977
*
8078
* @throws HibernateException Indicates a problem rolling back the transaction.
8179
*/
82-
public void rollback();
80+
void rollback();
8381

8482
/**
8583
* Get the current local status of this transaction.
@@ -89,7 +87,7 @@ public interface Transaction {
8987
*
9088
* @return The current local status.
9189
*/
92-
public TransactionStatus getStatus();
90+
TransactionStatus getStatus();
9391

9492
/**
9593
* Register a user synchronization callback for this transaction.
@@ -98,25 +96,25 @@ public interface Transaction {
9896
*
9997
* @throws HibernateException Indicates a problem registering the synchronization.
10098
*/
101-
public void registerSynchronization(Synchronization synchronization) throws HibernateException;
99+
void registerSynchronization(Synchronization synchronization) throws HibernateException;
102100

103101
/**
104102
* Set the transaction timeout for any transaction started by a subsequent call to {@link #begin} on this instance.
105103
*
106104
* @param seconds The number of seconds before a timeout.
107105
*/
108-
public void setTimeout(int seconds);
106+
void setTimeout(int seconds);
109107

110108
/**
111109
* Retrieve the transaction timeout set for this transaction. A negative indicates no timeout has been set.
112110
*
113111
* @return The timeout, in seconds.
114112
*/
115-
public int getTimeout();
113+
int getTimeout();
116114

117115
/**
118116
* Make a best effort to mark the underlying transaction for rollback only.
119117
*/
120-
public void markRollbackOnly();
118+
void markRollbackOnly();
121119

122120
}

hibernate-core/src/main/java/org/hibernate/boot/SchemaAutoTooling.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
*/
2424
package org.hibernate.boot;
2525

26-
import org.hibernate.Hibernate;
2726
import org.hibernate.HibernateException;
2827
import org.hibernate.internal.util.StringHelper;
2928

@@ -36,35 +35,41 @@ public enum SchemaAutoTooling {
3635
/**
3736
* Drop the schema and recreate it on SessionFactory startup.
3837
*/
39-
CREATE,
38+
CREATE( "create" ),
4039
/**
4140
* Drop the schema and recreate it on SessionFactory startup. Additionally, drop the
4241
* schema on SessionFactory shutdown.
4342
*/
44-
CREATE_DROP,
43+
CREATE_DROP( "create-drop" ),
4544
/**
4645
* Update (alter) the schema on SessionFactory startup.
4746
*/
48-
UPDATE,
47+
UPDATE( "update" ),
4948
/**
5049
* Validate the schema on SessionFactory startup.
5150
*/
52-
VALIDATE;
51+
VALIDATE( "validate" );
52+
53+
private final String externalForm;
54+
55+
SchemaAutoTooling(String externalForm) {
56+
this.externalForm = externalForm;
57+
}
5358

5459
public static SchemaAutoTooling interpret(String configurationValue) {
5560
if ( StringHelper.isEmpty( configurationValue ) ) {
5661
return null;
5762
}
58-
else if ( "validate".equals( configurationValue ) ) {
63+
else if ( VALIDATE.externalForm.equals( configurationValue ) ) {
5964
return VALIDATE;
6065
}
61-
else if ( "update".equals( configurationValue ) ) {
66+
else if ( UPDATE.externalForm.equals( configurationValue ) ) {
6267
return UPDATE;
6368
}
64-
else if ( "create".equals( configurationValue ) ) {
69+
else if ( CREATE.externalForm.equals( configurationValue ) ) {
6570
return CREATE;
6671
}
67-
else if ( "create-drop".equals( configurationValue ) ) {
72+
else if ( CREATE_DROP.externalForm.equals( configurationValue ) ) {
6873
return CREATE_DROP;
6974
}
7075
else {

hibernate-core/src/main/java/org/hibernate/boot/archive/scan/internal/ScanResultCollector.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import org.hibernate.boot.archive.scan.spi.ScanParameters;
3636
import org.hibernate.boot.archive.scan.spi.ScanResult;
3737

38-
import org.jboss.jandex.ClassInfo;
3938
import org.jboss.logging.Logger;
4039

4140
/**

hibernate-core/src/main/java/org/hibernate/boot/internal/MetadataBuildingProcess.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import java.lang.reflect.Constructor;
2727
import java.util.Collection;
2828
import java.util.HashSet;
29-
import java.util.LinkedHashSet;
3029
import java.util.Set;
3130
import javax.persistence.Converter;
3231

0 commit comments

Comments
 (0)