Skip to content

Commit 7308e14

Browse files
committed
HHH-9803 - Checkstyle fix ups
1 parent e4e76ba commit 7308e14

File tree

137 files changed

+1606
-2643
lines changed

Some content is hidden

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

137 files changed

+1606
-2643
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ public MetadataSources addURL(URL url) {
428428
* @param document The DOM document
429429
*
430430
* @return this (for method chaining purposes)
431+
*
432+
* @deprecated since 5.0. Use one of the other methods for passing mapping source(s).
431433
*/
432434
@Deprecated
433435
public MetadataSources addDocument(Document document) {

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

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,17 +1500,17 @@ public Join locateJoin(Identifier tableName) {
15001500
}
15011501
}
15021502

1503-
private ArrayList<PkDrivenByDefaultMapsIdSecondPass> pkDrivenByDefaultMapsId_secondPassList;
1504-
private ArrayList<SetSimpleValueTypeSecondPass> setSimpleValueType_secondPassList;
1505-
private ArrayList<CopyIdentifierComponentSecondPass> copyIdentifierComponent_secondPasList;
1506-
private ArrayList<FkSecondPass> fk_secondPassList;
1507-
private ArrayList<CreateKeySecondPass> createKey_secondPasList;
1508-
private ArrayList<SecondaryTableSecondPass> secondaryTable_secondPassList;
1509-
private ArrayList<QuerySecondPass> query_secondPassList;
1510-
private ArrayList<ConstraintSecondPass> constraint_secondPassList;
1511-
private ArrayList<ImplicitColumnNamingSecondPass> implicitColumnNaming_secondPassList;
1503+
private ArrayList<PkDrivenByDefaultMapsIdSecondPass> pkDrivenByDefaultMapsIdSecondPassList;
1504+
private ArrayList<SetSimpleValueTypeSecondPass> setSimpleValueTypeSecondPassList;
1505+
private ArrayList<CopyIdentifierComponentSecondPass> copyIdentifierComponentSecondPasList;
1506+
private ArrayList<FkSecondPass> fkSecondPassList;
1507+
private ArrayList<CreateKeySecondPass> createKeySecondPasList;
1508+
private ArrayList<SecondaryTableSecondPass> secondaryTableSecondPassList;
1509+
private ArrayList<QuerySecondPass> querySecondPassList;
1510+
private ArrayList<ConstraintSecondPass> constraintSecondPassList;
1511+
private ArrayList<ImplicitColumnNamingSecondPass> implicitColumnNamingSecondPassList;
15121512

1513-
private ArrayList<SecondPass> general_secondPassList;
1513+
private ArrayList<SecondPass> generalSecondPassList;
15141514

15151515
@Override
15161516
public void addSecondPass(SecondPass secondPass) {
@@ -1548,20 +1548,20 @@ else if ( secondPass instanceof ImplicitColumnNamingSecondPass ) {
15481548
}
15491549
else {
15501550
// add to the general SecondPass list
1551-
if ( general_secondPassList == null ) {
1552-
general_secondPassList = new ArrayList<SecondPass>();
1551+
if ( generalSecondPassList == null ) {
1552+
generalSecondPassList = new ArrayList<SecondPass>();
15531553
}
1554-
addSecondPass( secondPass, general_secondPassList, onTopOfTheQueue );
1554+
addSecondPass( secondPass, generalSecondPassList, onTopOfTheQueue );
15551555
}
15561556
}
15571557

15581558
private void addPkDrivenByDefaultMapsIdSecondPass(
15591559
PkDrivenByDefaultMapsIdSecondPass secondPass,
15601560
boolean onTopOfTheQueue) {
1561-
if ( pkDrivenByDefaultMapsId_secondPassList == null ) {
1562-
pkDrivenByDefaultMapsId_secondPassList = new ArrayList<PkDrivenByDefaultMapsIdSecondPass>();
1561+
if ( pkDrivenByDefaultMapsIdSecondPassList == null ) {
1562+
pkDrivenByDefaultMapsIdSecondPassList = new ArrayList<PkDrivenByDefaultMapsIdSecondPass>();
15631563
}
1564-
addSecondPass( secondPass, pkDrivenByDefaultMapsId_secondPassList, onTopOfTheQueue );
1564+
addSecondPass( secondPass, pkDrivenByDefaultMapsIdSecondPassList, onTopOfTheQueue );
15651565
}
15661566

15671567
private <T extends SecondPass> void addSecondPass(T secondPass, ArrayList<T> secondPassList, boolean onTopOfTheQueue) {
@@ -1574,61 +1574,61 @@ private <T extends SecondPass> void addSecondPass(T secondPass, ArrayList<T> sec
15741574
}
15751575

15761576
private void addSetSimpleValueTypeSecondPass(SetSimpleValueTypeSecondPass secondPass, boolean onTopOfTheQueue) {
1577-
if ( setSimpleValueType_secondPassList == null ) {
1578-
setSimpleValueType_secondPassList = new ArrayList<SetSimpleValueTypeSecondPass>();
1577+
if ( setSimpleValueTypeSecondPassList == null ) {
1578+
setSimpleValueTypeSecondPassList = new ArrayList<SetSimpleValueTypeSecondPass>();
15791579
}
1580-
addSecondPass( secondPass, setSimpleValueType_secondPassList, onTopOfTheQueue );
1580+
addSecondPass( secondPass, setSimpleValueTypeSecondPassList, onTopOfTheQueue );
15811581
}
15821582

15831583
private void addCopyIdentifierComponentSecondPass(
15841584
CopyIdentifierComponentSecondPass secondPass,
15851585
boolean onTopOfTheQueue) {
1586-
if ( copyIdentifierComponent_secondPasList == null ) {
1587-
copyIdentifierComponent_secondPasList = new ArrayList<CopyIdentifierComponentSecondPass>();
1586+
if ( copyIdentifierComponentSecondPasList == null ) {
1587+
copyIdentifierComponentSecondPasList = new ArrayList<CopyIdentifierComponentSecondPass>();
15881588
}
1589-
addSecondPass( secondPass, copyIdentifierComponent_secondPasList, onTopOfTheQueue );
1589+
addSecondPass( secondPass, copyIdentifierComponentSecondPasList, onTopOfTheQueue );
15901590
}
15911591

15921592
private void addFkSecondPass(FkSecondPass secondPass, boolean onTopOfTheQueue) {
1593-
if ( fk_secondPassList == null ) {
1594-
fk_secondPassList = new ArrayList<FkSecondPass>();
1593+
if ( fkSecondPassList == null ) {
1594+
fkSecondPassList = new ArrayList<FkSecondPass>();
15951595
}
1596-
addSecondPass( secondPass, fk_secondPassList, onTopOfTheQueue );
1596+
addSecondPass( secondPass, fkSecondPassList, onTopOfTheQueue );
15971597
}
15981598

15991599
private void addCreateKeySecondPass(CreateKeySecondPass secondPass, boolean onTopOfTheQueue) {
1600-
if ( createKey_secondPasList == null ) {
1601-
createKey_secondPasList = new ArrayList<CreateKeySecondPass>();
1600+
if ( createKeySecondPasList == null ) {
1601+
createKeySecondPasList = new ArrayList<CreateKeySecondPass>();
16021602
}
1603-
addSecondPass( secondPass, createKey_secondPasList, onTopOfTheQueue );
1603+
addSecondPass( secondPass, createKeySecondPasList, onTopOfTheQueue );
16041604
}
16051605

16061606
private void addSecondaryTableSecondPass(SecondaryTableSecondPass secondPass, boolean onTopOfTheQueue) {
1607-
if ( secondaryTable_secondPassList == null ) {
1608-
secondaryTable_secondPassList = new ArrayList<SecondaryTableSecondPass>();
1607+
if ( secondaryTableSecondPassList == null ) {
1608+
secondaryTableSecondPassList = new ArrayList<SecondaryTableSecondPass>();
16091609
}
1610-
addSecondPass( secondPass, secondaryTable_secondPassList, onTopOfTheQueue );
1610+
addSecondPass( secondPass, secondaryTableSecondPassList, onTopOfTheQueue );
16111611
}
16121612

16131613
private void addQuerySecondPass(QuerySecondPass secondPass, boolean onTopOfTheQueue) {
1614-
if ( query_secondPassList == null ) {
1615-
query_secondPassList = new ArrayList<QuerySecondPass>();
1614+
if ( querySecondPassList == null ) {
1615+
querySecondPassList = new ArrayList<QuerySecondPass>();
16161616
}
1617-
addSecondPass( secondPass, query_secondPassList, onTopOfTheQueue );
1617+
addSecondPass( secondPass, querySecondPassList, onTopOfTheQueue );
16181618
}
16191619

16201620
private void addConstraintSecondPass(ConstraintSecondPass secondPass, boolean onTopOfTheQueue) {
1621-
if ( constraint_secondPassList == null ) {
1622-
constraint_secondPassList = new ArrayList<ConstraintSecondPass>();
1621+
if ( constraintSecondPassList == null ) {
1622+
constraintSecondPassList = new ArrayList<ConstraintSecondPass>();
16231623
}
1624-
addSecondPass( secondPass, constraint_secondPassList, onTopOfTheQueue );
1624+
addSecondPass( secondPass, constraintSecondPassList, onTopOfTheQueue );
16251625
}
16261626

16271627
private void addImplicitColumnNamingSecondPass(ImplicitColumnNamingSecondPass secondPass) {
1628-
if ( implicitColumnNaming_secondPassList == null ) {
1629-
implicitColumnNaming_secondPassList = new ArrayList<ImplicitColumnNamingSecondPass>();
1628+
if ( implicitColumnNamingSecondPassList == null ) {
1629+
implicitColumnNamingSecondPassList = new ArrayList<ImplicitColumnNamingSecondPass>();
16301630
}
1631-
implicitColumnNaming_secondPassList.add( secondPass );
1631+
implicitColumnNamingSecondPassList.add( secondPass );
16321632
}
16331633

16341634

@@ -1642,25 +1642,25 @@ public void processSecondPasses(MetadataBuildingContext buildingContext) {
16421642
inSecondPass = true;
16431643

16441644
try {
1645-
processSecondPasses( implicitColumnNaming_secondPassList );
1645+
processSecondPasses( implicitColumnNamingSecondPassList );
16461646

1647-
processSecondPasses( pkDrivenByDefaultMapsId_secondPassList );
1648-
processSecondPasses( setSimpleValueType_secondPassList );
1649-
processSecondPasses( copyIdentifierComponent_secondPasList );
1647+
processSecondPasses( pkDrivenByDefaultMapsIdSecondPassList );
1648+
processSecondPasses( setSimpleValueTypeSecondPassList );
1649+
processSecondPasses( copyIdentifierComponentSecondPasList );
16501650

16511651
processFkSecondPassesInOrder();
16521652

1653-
processSecondPasses( createKey_secondPasList );
1654-
processSecondPasses( secondaryTable_secondPassList );
1653+
processSecondPasses( createKeySecondPasList );
1654+
processSecondPasses( secondaryTableSecondPassList );
16551655

1656-
processSecondPasses( query_secondPassList );
1657-
processSecondPasses( general_secondPassList );
1656+
processSecondPasses( querySecondPassList );
1657+
processSecondPasses( generalSecondPassList );
16581658

16591659
processPropertyReferences();
16601660

16611661
secondPassCompileForeignKeys( buildingContext );
16621662

1663-
processSecondPasses( constraint_secondPassList );
1663+
processSecondPasses( constraintSecondPassList );
16641664
processUniqueConstraintHolders( buildingContext );
16651665
processJPAIndexHolders( buildingContext );
16661666

@@ -1686,15 +1686,15 @@ private void processSecondPasses(ArrayList<? extends SecondPass> secondPasses) {
16861686
}
16871687

16881688
private void processFkSecondPassesInOrder() {
1689-
if ( fk_secondPassList == null || fk_secondPassList.isEmpty() ) {
1689+
if ( fkSecondPassList == null || fkSecondPassList.isEmpty() ) {
16901690
return;
16911691
}
16921692

16931693
// split FkSecondPass instances into primary key and non primary key FKs.
16941694
// While doing so build a map of class names to FkSecondPass instances depending on this class.
16951695
Map<String, Set<FkSecondPass>> isADependencyOf = new HashMap<String, Set<FkSecondPass>>();
1696-
List<FkSecondPass> endOfQueueFkSecondPasses = new ArrayList<FkSecondPass>( fk_secondPassList.size() );
1697-
for ( FkSecondPass sp : fk_secondPassList ) {
1696+
List<FkSecondPass> endOfQueueFkSecondPasses = new ArrayList<FkSecondPass>( fkSecondPassList.size() );
1697+
for ( FkSecondPass sp : fkSecondPassList ) {
16981698
if ( sp.isInPrimaryKey() ) {
16991699
final String referenceEntityName = sp.getReferencedEntityName();
17001700
final PersistentClass classMapping = getEntityBinding( referenceEntityName );
@@ -1710,7 +1710,7 @@ private void processFkSecondPassesInOrder() {
17101710
}
17111711

17121712
// using the isADependencyOf map we order the FkSecondPass recursively instances into the right order for processing
1713-
List<FkSecondPass> orderedFkSecondPasses = new ArrayList<FkSecondPass>( fk_secondPassList.size() );
1713+
List<FkSecondPass> orderedFkSecondPasses = new ArrayList<FkSecondPass>( fkSecondPassList.size() );
17141714
for ( String tableName : isADependencyOf.keySet() ) {
17151715
buildRecursiveOrderedFkSecondPasses( orderedFkSecondPasses, isADependencyOf, tableName, tableName );
17161716
}
@@ -1722,7 +1722,7 @@ private void processFkSecondPassesInOrder() {
17221722

17231723
processEndOfQueue( endOfQueueFkSecondPasses );
17241724

1725-
fk_secondPassList.clear();
1725+
fkSecondPassList.clear();
17261726
}
17271727

17281728
/**

hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/SupportedOrmXsdVersion.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
/**
3232
* @author Steve Ebersole
33+
*
34+
* @deprecated since 5.0; no longer used internally.
3335
*/
3436
@Deprecated
3537
public enum SupportedOrmXsdVersion {

hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/UnsupportedOrmXsdVersionException.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
/**
3030
* @author Steve Ebersole
31+
*
3132
* @deprecated Use {@link org.hibernate.boot.UnsupportedOrmXsdVersionException} instead
3233
*/
3334
@Deprecated

hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/ModelBinder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ private void applyCaching(MappingDocument mappingDocument, Caching caching, Root
310310
false,
311311
TruthValue.UNKNOWN
312312
);
313+
break;
313314
}
314315
case NONE: {
315316
// Ideally we'd disable all caching...
@@ -1633,6 +1634,7 @@ private void applyCaching(MappingDocument mappingDocument, Caching caching, Coll
16331634
false,
16341635
TruthValue.UNKNOWN
16351636
);
1637+
break;
16361638
}
16371639
case NONE: {
16381640
// Ideally we'd disable all caching...

hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingSessionFactoryBuilder.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ public T applyIdentifierRollbackSupport(boolean enabled) {
152152
}
153153

154154
@Override
155-
@Deprecated
156155
@SuppressWarnings("deprecation")
157156
public T applyDefaultEntityMode(EntityMode entityMode) {
158157
delegate.applyDefaultEntityMode( entityMode );
@@ -258,7 +257,6 @@ public T applyPreferUserTransactions(boolean preferUserTransactions) {
258257
}
259258

260259
@Override
261-
@Deprecated
262260
@SuppressWarnings("deprecation")
263261
public T applyQuerySubstitutions(Map substitutions) {
264262
delegate.applyQuerySubstitutions( substitutions );

hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentIndexedElementHolder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
import org.hibernate.engine.spi.SessionImplementor;
4141
import org.hibernate.loader.CollectionAliases;
4242
import org.hibernate.persister.collection.CollectionPersister;
43+
import org.hibernate.type.StringRepresentableType;
4344
import org.hibernate.type.Type;
44-
import org.hibernate.type.XmlRepresentableType;
4545

4646
import org.dom4j.Element;
4747

@@ -204,7 +204,7 @@ public Object readFrom(ResultSet rs, CollectionPersister persister, CollectionAl
204204

205205
final Type indexType = persister.getIndexType();
206206
final Object indexValue = persister.readIndex( rs, descriptor.getSuffixedIndexAliases(), getSession() );
207-
final String index = ( (XmlRepresentableType) indexType ).toXMLString( indexValue, factory );
207+
final String index = ( (StringRepresentableType) indexType ).toString( indexValue );
208208
setIndex( elem, indexNode, index );
209209
return object;
210210
}
@@ -251,7 +251,7 @@ public Iterator getDeletes(CollectionPersister persister, boolean indexIsFormula
251251
final Map.Entry me = (Map.Entry) o;
252252
final Object object = indexIsFormula
253253
? me.getValue()
254-
: ( (XmlRepresentableType) indexType ).fromXMLString( (String) me.getKey(), persister.getFactory() );
254+
: ( (StringRepresentableType) indexType ).fromStringValue( (String) me.getKey() );
255255
if ( object != null ) {
256256
deleteList.add( object );
257257
}
@@ -279,7 +279,7 @@ public boolean needsUpdating(Object entry, int i, Type elementType) throws Hiber
279279
public Object getIndex(Object entry, int i, CollectionPersister persister) {
280280
final String index = ( (IndexedValue) entry ).index;
281281
final Type indexType = persister.getIndexType();
282-
return ( (XmlRepresentableType) indexType ).fromXMLString( index, persister.getFactory() );
282+
return ( (StringRepresentableType) indexType ).fromStringValue( index );
283283
}
284284

285285
@Override

hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentMapElementHolder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
import org.hibernate.HibernateException;
3030
import org.hibernate.engine.spi.SessionImplementor;
3131
import org.hibernate.persister.collection.CollectionPersister;
32+
import org.hibernate.type.StringRepresentableType;
3233
import org.hibernate.type.Type;
33-
import org.hibernate.type.XmlRepresentableType;
3434

3535
import org.dom4j.Element;
3636

@@ -84,7 +84,7 @@ public void initializeFromCache(CollectionPersister persister, Serializable disa
8484
final Element subElement = element.addElement( persister.getElementNodeName() );
8585
elementType.setToXMLNode( subElement, object, persister.getFactory() );
8686

87-
final String indexString = ( (XmlRepresentableType) indexType ).toXMLString( index, persister.getFactory() );
87+
final String indexString = ( (StringRepresentableType) indexType ).toString( index );
8888
setIndex( subElement, indexNodeName, indexString );
8989
}
9090
}
@@ -104,7 +104,7 @@ public Serializable disassemble(CollectionPersister persister) throws HibernateE
104104
final Element elem = (Element) elements.get( i/2 );
105105
final Object object = elementType.fromXMLNode( elem, persister.getFactory() );
106106
final String indexString = getIndex( elem, indexNodeName, i );
107-
final Object index = ( (XmlRepresentableType) indexType ).fromXMLString( indexString, persister.getFactory() );
107+
final Object index = ( (StringRepresentableType) indexType ).fromStringValue( indexString );
108108
result[i++] = indexType.disassemble( index, getSession(), null );
109109
result[i++] = elementType.disassemble( object, getSession(), null );
110110
}

hibernate-core/src/main/java/org/hibernate/dialect/function/StandardAnsiSqlAggregationFunctions.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ public String render(Type firstArgumentType, List arguments, SessionFactoryImple
6868
private String renderCountDistinct(List arguments, Dialect dialect) {
6969
final StringBuilder buffer = new StringBuilder();
7070
buffer.append( "count(distinct " );
71-
if (dialect.requiresParensForTupleDistinctCounts()) buffer.append("(");
71+
if (dialect.requiresParensForTupleDistinctCounts()) {
72+
buffer.append("(");
73+
}
7274
String sep = "";
7375
final Iterator itr = arguments.iterator();
7476
// intentionally skip first
@@ -77,7 +79,9 @@ private String renderCountDistinct(List arguments, Dialect dialect) {
7779
buffer.append( sep ).append( itr.next() );
7880
sep = ", ";
7981
}
80-
if (dialect.requiresParensForTupleDistinctCounts()) buffer.append(")");
82+
if (dialect.requiresParensForTupleDistinctCounts()) {
83+
buffer.append(")");
84+
}
8185
return buffer.append( ")" ).toString();
8286
}
8387
}

0 commit comments

Comments
 (0)