various cosmetic code improvements

This commit is contained in:
Nathan Xu 2020-03-01 11:07:21 -05:00 committed by Steve Ebersole
parent b3254a2fa6
commit adc87b7908
103 changed files with 143 additions and 162 deletions

View File

@ -27,8 +27,7 @@ public enum ConnectionAcquisitionMode {
AS_NEEDED;
public static ConnectionAcquisitionMode interpret(String value) {
if ( value != null
&& ( "immediate".equalsIgnoreCase( value ) || "immediately".equalsIgnoreCase( value ) ) ) {
if ( "immediate".equalsIgnoreCase( value ) || "immediately".equalsIgnoreCase( value ) ) {
return IMMEDIATELY;
}

View File

@ -69,14 +69,6 @@ public class DelayedPostInsertIdentifier implements Serializable, Comparable<Del
@Override
public int compareTo(DelayedPostInsertIdentifier that) {
if ( this.identifier < that.identifier ) {
return -1;
}
else if ( this.identifier > that.identifier ) {
return 1;
}
else {
return 0;
}
return Long.compare( this.identifier, that.identifier );
}
}

View File

@ -161,7 +161,7 @@ public class UnresolvedEntityInsertActions {
for ( Object transientEntity : dependencies.getNonNullableTransientEntities() ) {
Set<AbstractEntityInsertAction> dependentActions = dependentActionsByTransientEntity.get( transientEntity );
if ( dependentActions == null ) {
dependentActions = new IdentitySet();
dependentActions = new IdentitySet<>();
dependentActionsByTransientEntity.put( transientEntity, dependentActions );
}
dependentActions.add( insert );
@ -199,7 +199,7 @@ public class UnresolvedEntityInsertActions {
// NOTE EARLY EXIT!
return Collections.emptySet();
}
final Set<AbstractEntityInsertAction> resolvedActions = new IdentitySet( );
final Set<AbstractEntityInsertAction> resolvedActions = new IdentitySet<>( );
if ( traceEnabled ) {
LOG.tracev(
"Unresolved inserts before resolving [{0}]: [{1}]",

View File

@ -25,9 +25,9 @@ import org.hibernate.boot.archive.scan.spi.Scanner;
*/
public class DisabledScanner implements Scanner {
private static final ScanResult emptyScanResult = new ScanResultImpl(
Collections.<PackageDescriptor>emptySet(),
Collections.<ClassDescriptor>emptySet(),
Collections.<MappingFileDescriptor>emptySet()
Collections.emptySet(),
Collections.emptySet(),
Collections.emptySet()
);
@Override

View File

@ -68,15 +68,15 @@ public class LoadedConfig {
}
public List<CacheRegionDefinition> getCacheRegionDefinitions() {
return cacheRegionDefinitions == null ? Collections.<CacheRegionDefinition>emptyList() : cacheRegionDefinitions;
return cacheRegionDefinitions == null ? Collections.emptyList() : cacheRegionDefinitions;
}
public List<MappingReference> getMappingReferences() {
return mappingReferences == null ? Collections.<MappingReference>emptyList() : mappingReferences;
return mappingReferences == null ? Collections.emptyList() : mappingReferences;
}
public Map<EventType, Set<String>> getEventListenerMap() {
return eventListenerMap == null ? Collections.<EventType, Set<String>>emptyMap() : eventListenerMap;
return eventListenerMap == null ? Collections.emptyMap() : eventListenerMap;
}
/**

View File

@ -688,7 +688,7 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector
@Override
public void addDefaultResultSetMapping(NamedResultSetMappingDefinition definition) {
final String name = definition.getRegistrationName();
if ( !defaultSqlResultSetMappingNames.contains( name ) && sqlResultSetMappingMap.containsKey( name ) ) {
if ( !defaultSqlResultSetMappingNames.contains( name ) ) {
sqlResultSetMappingMap.remove( name );
}
applyResultSetMapping( definition );

View File

@ -153,7 +153,7 @@ public class Identifier implements Comparable<Identifier> {
*/
public String render(Dialect dialect) {
return isQuoted
? String.valueOf( dialect.openQuote() ) + getText() + dialect.closeQuote()
? dialect.openQuote() + getText() + dialect.closeQuote()
: getText();
}

View File

@ -59,7 +59,7 @@ public abstract class AbstractAuxiliaryDatabaseObject
dialectScopes.add( dialectName );
}
public Set getDialectScopes() {
public Set<String> getDialectScopes() {
return dialectScopes;
}

View File

@ -149,13 +149,13 @@ public class Database {
public Collection<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjects() {
return auxiliaryDatabaseObjects == null
? Collections.<AuxiliaryDatabaseObject>emptyList()
? Collections.emptyList()
: auxiliaryDatabaseObjects.values();
}
public Collection<InitCommand> getInitCommands() {
return initCommands == null
? Collections.<InitCommand>emptyList()
? Collections.emptyList()
: initCommands;
}

View File

@ -180,7 +180,7 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc
@Override
public boolean shouldImplicitlyQuoteIdentifiers() {
final Object isDelimited = persistenceUnitDefaults.get( "delimited-identifier" );
return isDelimited != null && isDelimited == Boolean.TRUE;
return isDelimited == Boolean.TRUE;
}
}
);

View File

@ -38,7 +38,7 @@ public class HibernateTypeSourceImpl implements HibernateTypeSource, JavaTypeDes
}
public HibernateTypeSourceImpl(String name) {
this( name, Collections.<String, String>emptyMap() );
this( name, Collections.emptyMap() );
}
public HibernateTypeSourceImpl(String name, Map<String, String> parameters) {

View File

@ -41,7 +41,7 @@ public class PluralAttributeSequentialIndexSourceImpl
null,
new RelationalValueSourceHelper.AbstractColumnsAndFormulasSource() {
final List<JaxbHbmColumnType> columnElements = jaxbListIndex.getColumn() == null
? Collections.<JaxbHbmColumnType>emptyList()
? Collections.emptyList()
: Collections.singletonList( jaxbListIndex.getColumn() );
@Override

View File

@ -70,7 +70,7 @@ class SingularAttributeSourceOneToOneImpl
if ( StringHelper.isNotEmpty( oneToOneElement.getFormulaAttribute() ) ) {
formulaSources = Collections.singletonList(
(DerivedValueSource) new FormulaImpl( mappingDocument, logicalTableName, oneToOneElement.getFormulaAttribute() )
new FormulaImpl( mappingDocument, logicalTableName, oneToOneElement.getFormulaAttribute() )
);
}
else if ( !oneToOneElement.getFormula().isEmpty() ) {

View File

@ -16,5 +16,5 @@ public enum InheritanceType {
NO_INHERITANCE,
DISCRIMINATED,
JOINED,
UNION;
UNION
}

View File

@ -204,8 +204,7 @@ public class EnhancementHelper {
throwLazyInitializationException( Cause.NO_SF_UUID, entityName, attributeName );
}
final SessionFactoryImplementor sf = (SessionFactoryImplementor)
SessionFactoryRegistry.INSTANCE.getSessionFactory( interceptor.getSessionFactoryUuid() );
final SessionFactoryImplementor sf = SessionFactoryRegistry.INSTANCE.getSessionFactory( interceptor.getSessionFactoryUuid() );
final SharedSessionContractImplementor session = (SharedSessionContractImplementor) sf.openSession();
session.getPersistenceContextInternal().setDefaultReadOnly( true );
session.setHibernateFlushMode( FlushMode.MANUAL );

View File

@ -73,7 +73,7 @@ public class BasicProxyFactoryImpl implements BasicProxyFactory {
key.add( superClass );
}
if ( interfaces != null ) {
key.addAll( Arrays.<Class<?>>asList( interfaces ) );
key.addAll( Arrays.asList( interfaces ) );
}
return new TypeCache.SimpleKey( key );

View File

@ -69,7 +69,7 @@ public class NaturalIdCacheKey implements Serializable {
// (re-attaching a mutable natural id uses a database snapshot and hydration does not resolve associations).
// TODO: The snapshot should probably be revisited at some point. Consider semi-resolving, hydrating, etc.
if (type instanceof EntityType && type.getSemiResolvedType( factory ).getReturnedClass().isInstance( value )) {
this.naturalIdValues[i] = (Serializable) value;
this.naturalIdValues[i] = value;
}
else {
this.naturalIdValues[i] = type.disassemble( value, session, null );

View File

@ -71,7 +71,7 @@ public class RegionFactoryInitiator implements StandardServiceInitiator<RegionFa
// We should immediately return NoCachingRegionFactory if either:
// 1) both are explicitly FALSE
// 2) USE_SECOND_LEVEL_CACHE is FALSE and USE_QUERY_CACHE is null
if ( useSecondLevelCache != null && useSecondLevelCache == FALSE ) {
if ( useSecondLevelCache == FALSE ) {
if ( useQueryCache == null || useQueryCache == FALSE ) {
return NoCachingRegionFactory.INSTANCE;
}
@ -84,8 +84,7 @@ public class RegionFactoryInitiator implements StandardServiceInitiator<RegionFa
if ( setting == null && implementors.size() != 1 ) {
// if either are explicitly defined as TRUE we need a RegionFactory
if ( ( useSecondLevelCache != null && useSecondLevelCache == TRUE )
|| ( useQueryCache != null && useQueryCache == TRUE ) ) {
if ( useSecondLevelCache == TRUE || useQueryCache == TRUE ) {
throw new CacheException( "Caching was explicitly requested, but no RegionFactory was defined and there is not a single registered RegionFactory" );
}
}

View File

@ -134,7 +134,13 @@ public abstract class AbstractPropertyHolder implements PropertyHolder {
@Override
public boolean isInIdClass() {
return isInIdClass != null ? isInIdClass : parent != null ? parent.isInIdClass() : false;
if ( isInIdClass != null ) {
return isInIdClass;
}
if ( parent != null ) {
return parent.isInIdClass();
}
return false;
}
@Override

View File

@ -843,7 +843,7 @@ public class Configuration {
public java.util.Collection<NamedEntityGraphDefinition> getNamedEntityGraphs() {
return namedEntityGraphMap == null
? Collections.<NamedEntityGraphDefinition>emptyList()
? Collections.emptyList()
: namedEntityGraphMap.values();
}

View File

@ -107,7 +107,7 @@ public class JPAMetadataProvider implements MetadataProvider {
@Override
public Map<Object, Object> getDefaults() {
if ( xmlMappingEnabled == false ) {
if ( !xmlMappingEnabled ) {
return Collections.emptyMap();
}
else {

View File

@ -607,7 +607,7 @@ public class JPAOverriddenAnnotationReader implements AnnotationReader {
properties.add( Introspector.decapitalize( name.substring( "is".length() ) ) );
}
}
for ( Element subelement : (List<Element>) element.elements() ) {
for ( Element subelement : element.elements() ) {
String propertyName = subelement.attributeValue( "name" );
if ( !properties.contains( propertyName ) ) {
LOG.propertyNotFound( StringHelper.qualify( className, propertyName ) );
@ -724,7 +724,7 @@ public class JPAOverriddenAnnotationReader implements AnnotationReader {
Element element = tree != null ? tree.element( "entity-listeners" ) : null;
if ( element != null ) {
List<Class> entityListenerClasses = new ArrayList<>();
for ( Element subelement : (List<Element>) element.elements( "entity-listener" ) ) {
for ( Element subelement : element.elements( "entity-listener" ) ) {
String className = subelement.attributeValue( "class" );
try {
entityListenerClasses.add(
@ -1516,7 +1516,7 @@ public class JPAOverriddenAnnotationReader implements AnnotationReader {
Element element = tree != null ? tree.element( "attributes" ) : null;
//put entity.attributes elements
if ( element != null ) {
for ( Element subelement : (List<Element>) element.elements() ) {
for ( Element subelement : element.elements() ) {
if ( propertyName.equals( subelement.attributeValue( "name" ) ) ) {
elementsForProperty.add( subelement );
}
@ -1524,7 +1524,7 @@ public class JPAOverriddenAnnotationReader implements AnnotationReader {
}
//add pre-* etc from entity and pure entity listener classes
if ( tree != null ) {
for ( Element subelement : (List<Element>) tree.elements() ) {
for ( Element subelement : tree.elements() ) {
if ( propertyName.equals( subelement.attributeValue( "method-name" ) ) ) {
elementsForProperty.add( subelement );
}
@ -2203,7 +2203,7 @@ public class JPAOverriddenAnnotationReader implements AnnotationReader {
// process the <field-result/> sub-elements
List<FieldResult> fieldResultAnnotations = new ArrayList<>();
for ( Element fieldResult : (List<Element>) entityResultElement.elements( "field-result" ) ) {
for ( Element fieldResult : entityResultElement.elements( "field-result" ) ) {
AnnotationDescriptor fieldResultDescriptor = new AnnotationDescriptor( FieldResult.class );
copyStringAttribute( fieldResultDescriptor, fieldResult, "name", true );
copyStringAttribute( fieldResultDescriptor, fieldResult, "column", true );
@ -2259,7 +2259,7 @@ public class JPAOverriddenAnnotationReader implements AnnotationReader {
constructorResultDescriptor.setValue( "targetClass", entityClass );
List<ColumnResult> columnResultAnnotations = new ArrayList<>();
for ( Element columnResultElement : (List<Element>) constructorResultElement.elements( "column" ) ) {
for ( Element columnResultElement : constructorResultElement.elements( "column" ) ) {
columnResultAnnotations.add( buildColumnResult( columnResultElement, defaults, classLoaderAccess ) );
}
constructorResultDescriptor.setValue(
@ -2849,7 +2849,7 @@ public class JPAOverriddenAnnotationReader implements AnnotationReader {
private SecondaryTables getSecondaryTables(Element tree, XMLContext.Default defaults) {
List<Element> elements = tree == null ?
new ArrayList<>() :
(List<Element>) tree.elements( "secondary-table" );
tree.elements( "secondary-table" );
List<SecondaryTable> secondaryTables = new ArrayList<>( 3 );
for ( Element element : elements ) {
AnnotationDescriptor annotation = new AnnotationDescriptor( SecondaryTable.class );

View File

@ -196,7 +196,7 @@ public class XMLContext implements Serializable {
for ( Element converterElement : converterElements ) {
final String className = converterElement.attributeValue( "class" );
final String autoApplyAttribute = converterElement.attributeValue( "auto-apply" );
final boolean autoApply = autoApplyAttribute != null && Boolean.parseBoolean( autoApplyAttribute );
final boolean autoApply = Boolean.parseBoolean( autoApplyAttribute );
try {
final Class<? extends AttributeConverter> attributeConverterClass = classLoaderAccess.classForName(

View File

@ -253,7 +253,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
// be created even if a current session and transaction are
// open (ex: session.clear() was used). We must prevent
// multiple transactions.
( (Session) session ).beginTransaction();
session.beginTransaction();
}
session.getPersistenceContextInternal().addUninitializedDetachedCollection(
@ -273,9 +273,9 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
try {
if ( !isJTA ) {
( (Session) tempSession ).getTransaction().commit();
tempSession.getTransaction().commit();
}
( (Session) tempSession ).close();
tempSession.close();
}
catch (Exception e) {
LOG.warn( "Unable to close temporary session used to load lazy collection associated to no session" );
@ -289,8 +289,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
throwLazyInitializationException( "SessionFactory UUID not known to create temporary Session for loading" );
}
final SessionFactoryImplementor sf = (SessionFactoryImplementor)
SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
final SessionFactoryImplementor sf = SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
final SharedSessionContractImplementor session = (SharedSessionContractImplementor) sf.openSession();
session.getPersistenceContextInternal().setDefaultReadOnly( true );
session.setFlushMode( FlushMode.MANUAL );

View File

@ -36,7 +36,7 @@ public class StandardOrderedSetSemantics extends AbstractSetSemantics<LinkedHash
public LinkedHashSet<?> instantiateRaw(
int anticipatedSize,
CollectionPersister collectionDescriptor) {
return anticipatedSize < 1 ? new LinkedHashSet() : new LinkedHashSet<>( anticipatedSize );
return anticipatedSize < 1 ? new LinkedHashSet<>() : new LinkedHashSet<>( anticipatedSize );
}
@Override

View File

@ -111,7 +111,7 @@ public class ThreadLocalSessionContext extends AbstractCurrentSessionContext {
// try to make sure we don't wrap and already wrapped session
if ( Proxy.isProxyClass( session.getClass() ) ) {
final InvocationHandler invocationHandler = Proxy.getInvocationHandler( session );
if ( invocationHandler != null && TransactionProtectionWrapper.class.isInstance( invocationHandler ) ) {
if ( TransactionProtectionWrapper.class.isInstance( invocationHandler ) ) {
return false;
}
}
@ -352,7 +352,7 @@ public class ThreadLocalSessionContext extends AbstractCurrentSessionContext {
}
catch ( InvocationTargetException e ) {
if (e.getTargetException() instanceof RuntimeException) {
throw (RuntimeException)e.getTargetException();
throw e.getTargetException();
}
throw e;
}

View File

@ -502,7 +502,7 @@ public class DB2Dialect extends Dialect {
}
@Override
public boolean supportsLobValueChangePropogation() {
public boolean supportsLobValueChangePropagation() {
return false;
}

View File

@ -452,7 +452,7 @@ public class DerbyDialect extends Dialect {
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Override
public boolean supportsLobValueChangePropogation() {
public boolean supportsLobValueChangePropagation() {
return false;
}

View File

@ -2705,7 +2705,7 @@ public abstract class Dialect implements ConversionContext {
* database; false otherwise.
* @since 3.2
*/
public boolean supportsLobValueChangePropogation() {
public boolean supportsLobValueChangePropagation() {
// todo : pretty sure this is the same as the java.sql.DatabaseMetaData.locatorsUpdateCopy method added in JDBC 4, see HHH-6046
return true;
}

View File

@ -341,7 +341,7 @@ public class FirebirdDialect extends Dialect {
}
@Override
public boolean supportsLobValueChangePropogation() {
public boolean supportsLobValueChangePropagation() {
// May need changes in Jaybird for this to work
return false;
}

View File

@ -325,7 +325,7 @@ public class H2Dialect extends Dialect {
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Override
public boolean supportsLobValueChangePropogation() {
public boolean supportsLobValueChangePropagation() {
return false;
}

View File

@ -585,7 +585,7 @@ public class HSQLDialect extends Dialect {
}
@Override
public boolean supportsLobValueChangePropogation() {
public boolean supportsLobValueChangePropagation() {
return false;
}

View File

@ -638,7 +638,7 @@ public class MySQLDialect extends Dialect {
}
@Override
public boolean supportsLobValueChangePropogation() {
public boolean supportsLobValueChangePropagation() {
// note: at least my local MySQL 5.1 install shows this not working...
return false;
}

View File

@ -881,7 +881,7 @@ public class OracleDialect extends Dialect {
if ( pos > -1 ) {
final StringBuilder buffer = new StringBuilder( sql.length() + hints.length() + 8 );
if ( pos > 0 ) {
buffer.append( sql.substring( 0, pos ) );
buffer.append( sql, 0, pos );
}
buffer
.append( statementType )

View File

@ -591,7 +591,7 @@ public class PostgreSQLDialect extends Dialect {
}
@Override
public boolean supportsLobValueChangePropogation() {
public boolean supportsLobValueChangePropagation() {
return false;
}

View File

@ -18,7 +18,7 @@ public class Replacer {
private String delimiter;
private List<Replacement> replacements = new ArrayList<>();
class Replacement {
static class Replacement {
String placeholder;
String replacement;

View File

@ -309,7 +309,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
}
@Override
public boolean supportsLobValueChangePropogation() {
public boolean supportsLobValueChangePropagation() {
// note: at least my local SQL Server 2005 Express shows this not working...
return false;
}
@ -378,7 +378,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
);
final int pos = sql.indexOf( ";" );
if ( pos > -1 ) {
buffer.append( sql.substring( 0, pos ) );
buffer.append( sql, 0, pos );
}
else {
buffer.append( sql );

View File

@ -114,7 +114,6 @@ class SpannerDialectTableExporter implements Exporter<Table> {
ArrayList<String> dropStrings = new ArrayList<>();
;
for (Iterator<Index> index = table.getIndexIterator(); index.hasNext();) {
dropStrings.add( "drop index " + index.next().getName() );
}

View File

@ -395,7 +395,7 @@ public class SybaseASEDialect extends SybaseDialect {
}
@Override
public boolean supportsLobValueChangePropogation() {
public boolean supportsLobValueChangePropagation() {
return false;
}

View File

@ -366,7 +366,7 @@ public class TeradataDialect extends Dialect {
}
@Override
public boolean supportsLobValueChangePropogation() {
public boolean supportsLobValueChangePropagation() {
return false;
}

View File

@ -90,8 +90,7 @@ public class TimestampaddFunction
SqlAstNode... sqlAstArguments) {
Expression to = (Expression) sqlAstArguments[2];
return new SelfRenderingFunctionSqlAstExpression(
(sqlAppender, sqlAstArguments1, walker)
-> render(sqlAppender, sqlAstArguments1, walker),
this::render,
asList( sqlAstArguments ),
impliedResultType,
to.getExpressionType()

View File

@ -95,8 +95,7 @@ public class TimestampdiffFunction
SqlAstNode... sqlAstArguments) {
DurationUnit field = (DurationUnit) sqlAstArguments[0];
return new SelfRenderingFunctionSqlAstExpression(
(sqlAppender, sqlAstArguments1, walker)
-> render(sqlAppender, sqlAstArguments1, walker),
this::render,
asList( sqlAstArguments ),
impliedResultType,
field.getExpressionType()

View File

@ -249,7 +249,7 @@ public class EntityEntryContext {
if ( ImmutableManagedEntityHolder.class.isInstance( managedEntity ) ) {
assert entity == ( (ImmutableManagedEntityHolder) managedEntity ).managedEntity;
immutableManagedEntityXref.remove( (ManagedEntity) entity );
immutableManagedEntityXref.remove( entity );
}
else if ( !ManagedEntity.class.isInstance( entity ) ) {

View File

@ -409,7 +409,7 @@ public class StatefulPersistenceContext implements PersistenceContext {
@Override
public boolean containsEntity(EntityKey key) {
return entitiesByKey == null ? false : entitiesByKey.containsKey( key );
return entitiesByKey != null && entitiesByKey.containsKey( key );
}
@Override

View File

@ -52,7 +52,7 @@ public class MultiTenantConnectionProviderInitiator implements StandardServiceIn
// if they also specified the data source *name*, then lets assume they want
// DataSourceBasedMultiTenantConnectionProviderImpl
final Object dataSourceConfigValue = configurationValues.get( AvailableSettings.DATASOURCE );
if ( dataSourceConfigValue != null && String.class.isInstance( dataSourceConfigValue ) ) {
if ( String.class.isInstance( dataSourceConfigValue ) ) {
return new DataSourceBasedMultiTenantConnectionProviderImpl();
}

View File

@ -76,7 +76,7 @@ public class DataSourceBasedMultiTenantConnectionProviderImpl
final Object dataSourceConfigValue = serviceRegistry.getService( ConfigurationService.class )
.getSettings()
.get( AvailableSettings.DATASOURCE );
if ( dataSourceConfigValue == null || ! String.class.isInstance( dataSourceConfigValue ) ) {
if ( !String.class.isInstance( dataSourceConfigValue ) ) {
throw new HibernateException( "Improper set up of DataSourceBasedMultiTenantConnectionProviderImpl" );
}
final String jndiName = (String) dataSourceConfigValue;

View File

@ -71,7 +71,7 @@ public class ExtractedDatabaseMetaDataImpl implements ExtractedDatabaseMetaData
this.extraKeywords = extraKeywords != null
? extraKeywords
: Collections.<String>emptySet();
: Collections.emptySet();
this.typeInfoSet = typeInfoSet != null
? typeInfoSet
: new LinkedHashSet<>();

View File

@ -131,7 +131,7 @@ public final class CollectionKey implements Serializable {
SessionImplementor session) throws IOException, ClassNotFoundException {
return new CollectionKey(
(String) ois.readObject(),
(Serializable) ois.readObject(),
ois.readObject(),
(Type) ois.readObject(),
(session == null ? null : session.getFactory())
);

View File

@ -142,7 +142,7 @@ public abstract class AbstractFlushingEventListener implements JpaBootstrapSensi
//safe from concurrent modification because of how concurrentEntries() is implemented on IdentityMap
for ( Map.Entry<Object,EntityEntry> me : persistenceContext.reentrantSafeEntityEntries() ) {
// for ( Map.Entry me : IdentityMap.concurrentEntries( persistenceContext.getEntityEntries() ) ) {
EntityEntry entry = (EntityEntry) me.getValue();
EntityEntry entry = me.getValue();
Status status = entry.getStatus();
if ( status == Status.MANAGED || status == Status.SAVING || status == Status.READ_ONLY ) {
cascadeOnFlush( session, entry.getPersister(), me.getKey(), anything );

View File

@ -118,7 +118,7 @@ public class DefaultMergeEventListener extends AbstractSaveEventListener impleme
if ( interceptor instanceof EnhancementAsProxyLazinessInterceptor ) {
final EnhancementAsProxyLazinessInterceptor proxyInterceptor = (EnhancementAsProxyLazinessInterceptor) interceptor;
LOG.trace( "Ignoring uninitialized enhanced-proxy" );
event.setResult( source.load( proxyInterceptor.getEntityName(), (Serializable) proxyInterceptor.getIdentifier() ) );
event.setResult( source.load( proxyInterceptor.getEntityName(), proxyInterceptor.getIdentifier() ) );
//EARLY EXIT!
return;
}

View File

@ -30,7 +30,7 @@ public final class EntityCopyAllowedLoggedObserver implements EntityCopyObserver
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( EntityCopyAllowedLoggedObserver.class );
public static final EntityCopyObserverFactory FACTORY_OF_SELF = () -> new EntityCopyAllowedLoggedObserver();
public static final EntityCopyObserverFactory FACTORY_OF_SELF = EntityCopyAllowedLoggedObserver::new;
public static final String SHORT_NAME = "log";

View File

@ -45,9 +45,9 @@ public class OnReplicateVisitor extends ReattachVisitor {
if ( isUpdate ) {
removeCollection( persister, extractCollectionKeyFromOwner( persister ), session );
}
if ( collection != null && collection instanceof PersistentCollection ) {
if ( collection instanceof PersistentCollection ) {
final PersistentCollection wrapper = (PersistentCollection) collection;
wrapper.setCurrentSession( (SessionImplementor) session );
wrapper.setCurrentSession( session );
if ( wrapper.wasInitialized() ) {
session.getPersistenceContextInternal().addNewCollection( persister, wrapper );
}

View File

@ -76,7 +76,7 @@ public class AttributeNodeImpl<J>
return Collections.emptyMap();
}
else {
return (Map) subGraphMap;
return subGraphMap;
}
}

View File

@ -218,11 +218,11 @@ final class FastSessionServices {
HashMap<String,Object> p = new HashMap<>();
//Static defaults:
p.putIfAbsent( AvailableSettings.FLUSH_MODE, FlushMode.AUTO.name() );
p.putIfAbsent( JPA_LOCK_SCOPE, PessimisticLockScope.EXTENDED.name() );
p.putIfAbsent( JPA_LOCK_TIMEOUT, LockOptions.WAIT_FOREVER );
p.putIfAbsent( JPA_SHARED_CACHE_RETRIEVE_MODE, CacheModeHelper.DEFAULT_RETRIEVE_MODE );
p.putIfAbsent( JPA_SHARED_CACHE_STORE_MODE, CacheModeHelper.DEFAULT_STORE_MODE );
p.put( AvailableSettings.FLUSH_MODE, FlushMode.AUTO.name() );
p.put( JPA_LOCK_SCOPE, PessimisticLockScope.EXTENDED.name() );
p.put( JPA_LOCK_TIMEOUT, LockOptions.WAIT_FOREVER );
p.put( JPA_SHARED_CACHE_RETRIEVE_MODE, CacheModeHelper.DEFAULT_RETRIEVE_MODE );
p.put( JPA_SHARED_CACHE_STORE_MODE, CacheModeHelper.DEFAULT_STORE_MODE );
//Defaults defined by SessionFactory configuration:
final String[] ENTITY_MANAGER_SPECIFIC_PROPERTIES = {

View File

@ -139,7 +139,7 @@ public class FetchingScrollableResultsImpl<R> extends AbstractScrollableResults<
}
else if ( positions < 0 ) {
// scroll backward
for ( int i = 0; i < ( 0 - positions ); i++ ) {
for ( int i = 0; i < -positions; i++ ) {
more = previous();
if ( !more ) {
break;

View File

@ -2753,7 +2753,7 @@ public class SessionImpl
setFetchGraphLoadContext( getLoadQueryInfluencers().getEffectiveEntityGraph().getGraph() );
}
return loadAccess.load( (Serializable) primaryKey );
return loadAccess.load( primaryKey );
}
catch ( EntityNotFoundException ignored ) {
// DefaultLoadEventListener.returnNarrowedProxy may throw ENFE (see HHH-7861 for details),
@ -2836,7 +2836,7 @@ public class SessionImpl
checkOpen();
try {
return byId( entityClass ).getReference( (Serializable) primaryKey );
return byId( entityClass ).getReference( primaryKey );
}
catch ( MappingException | TypeMismatchException | ClassCastException e ) {
throw getExceptionConverter().convert( new IllegalArgumentException( e.getMessage(), e ) );

View File

@ -444,7 +444,7 @@ public final class StringHelper {
public static String unroot(String qualifiedName) {
int loc = qualifiedName.indexOf( '.' );
return ( loc < 0 ) ? qualifiedName : qualifiedName.substring( loc + 1, qualifiedName.length() );
return ( loc < 0 ) ? qualifiedName : qualifiedName.substring( loc + 1 );
}
public static String toString(Object[] array) {

View File

@ -14,7 +14,7 @@ import java.util.Comparator;
* @author Andrea Boriero
*/
public class ZonedDateTimeComparator implements Comparator<ZonedDateTime>, Serializable {
public static final Comparator INSTANCE = new ZonedDateTimeComparator();
public static final Comparator<ZonedDateTime> INSTANCE = new ZonedDateTimeComparator();
public int compare(ZonedDateTime one, ZonedDateTime another) {
return one.toInstant().compareTo( another.toInstant() );

View File

@ -21,6 +21,7 @@ import java.io.Serializable;
import java.util.AbstractCollection;
import java.util.AbstractMap;
import java.util.AbstractSet;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
@ -1224,7 +1225,7 @@ public class BoundedConcurrentHashMap<K, V> extends AbstractMap<K, V>
this.evictCap = evictCap;
eviction = es.make( this, evictCap, lf );
evictionListener = listener;
setTable( HashEntry.<K, V>newArray( cap ) );
setTable( HashEntry.newArray( cap ) );
}
@SuppressWarnings("unchecked")
@ -1561,9 +1562,7 @@ public class BoundedConcurrentHashMap<K, V> extends AbstractMap<K, V>
lock();
try {
HashEntry<K, V>[] tab = table;
for ( int i = 0; i < tab.length; i++ ) {
tab[i] = null;
}
Arrays.fill( tab, null );
++modCount;
eviction.clear();
count = 0; // write-volatile

View File

@ -22,6 +22,7 @@ import java.lang.ref.WeakReference;
import java.util.AbstractCollection;
import java.util.AbstractMap;
import java.util.AbstractSet;
import java.util.Arrays;
import java.util.Collection;
import java.util.EnumSet;
import java.util.Enumeration;
@ -157,8 +158,6 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V>
SOFT
}
;
public static enum Option {
/**
@ -168,8 +167,6 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V>
IDENTITY_COMPARISONS
}
;
/* ---------------- Constants -------------- */
static final ReferenceType DEFAULT_KEY_TYPE = ReferenceType.WEAK;
@ -559,7 +556,7 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V>
this.keyType = keyType;
this.valueType = valueType;
this.identityComparisons = identityComparisons;
setTable( HashEntry.<K, V>newArray( initialCapacity ) );
setTable( HashEntry.newArray( initialCapacity ) );
}
@SuppressWarnings("unchecked")
@ -885,9 +882,7 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V>
lock();
try {
HashEntry<K, V>[] tab = table;
for ( int i = 0; i < tab.length; i++ ) {
tab[i] = null;
}
Arrays.fill( tab, null );
++modCount;
// replace the reference queue to avoid unnecessary stale cleanups
refQueue = new ReferenceQueue<>();

View File

@ -431,7 +431,7 @@ public final class ConfigurationHelper {
while ( itr.hasNext() ) {
final Map.Entry entry = ( Map.Entry ) itr.next();
final Object value = entry.getValue();
if ( value != null && String.class.isInstance( value ) ) {
if ( String.class.isInstance( value ) ) {
final String resolved = resolvePlaceHolder( ( String ) value );
if ( !value.equals( resolved ) ) {
if ( resolved == null ) {

View File

@ -90,10 +90,10 @@ public class CharSequenceReader extends Reader {
return -1L;
}
else {
int dest = (int)Math.min((long)this.charSequence.length(), (long)this.position + n);
int dest = (int)Math.min(this.charSequence.length(), (long)this.position + n);
int count = dest - this.position;
this.position = dest;
return (long)count;
return count;
}
}

View File

@ -991,7 +991,7 @@ public class EntityManagerFactoryBuilderImpl implements EntityManagerFactoryBuil
final int roleStart = JACC_PREFIX.length() + 1;
final String role = keyString.substring( roleStart, keyString.indexOf( '.', roleStart ) );
final int classStart = roleStart + role.length() + 1;
final String clazz = keyString.substring( classStart, keyString.length() );
final String clazz = keyString.substring( classStart );
return new GrantedPermission( role, clazz, valueString );
}
catch ( IndexOutOfBoundsException e ) {

View File

@ -398,7 +398,7 @@ public class PersistenceXmlParser {
}
NodeList children = element.getChildNodes();
StringBuilder result = new StringBuilder("");
StringBuilder result = new StringBuilder();
for ( int i = 0; i < children.getLength() ; i++ ) {
if ( children.item( i ).getNodeType() == Node.TEXT_NODE ||
children.item( i ).getNodeType() == Node.CDATA_SECTION_NODE ) {

View File

@ -29,10 +29,10 @@ public class StandardJpaScanEnvironmentImpl implements ScanEnvironment {
this.persistenceUnitDescriptor = persistenceUnitDescriptor;
this.explicitlyListedClassNames = persistenceUnitDescriptor.getManagedClassNames() == null
? Collections.<String>emptyList()
? Collections.emptyList()
: persistenceUnitDescriptor.getManagedClassNames();
this.explicitlyListedMappingFiles = persistenceUnitDescriptor.getMappingFileNames() == null
? Collections.<String>emptyList()
? Collections.emptyList()
: persistenceUnitDescriptor.getMappingFileNames();
}

View File

@ -62,7 +62,6 @@ public final class Bootstrap {
String persistenceUnitName,
PersistenceUnitTransactionType transactionType,
Map integration) {
;
return new EntityManagerFactoryBuilderImpl(
PersistenceXmlParser.parse( persistenceXmlUrl, transactionType, integration ).get( persistenceUnitName ),
integration

View File

@ -142,7 +142,7 @@ public final class XmlHelper {
}
final NodeList children = element.getChildNodes();
final StringBuilder result = new StringBuilder("");
final StringBuilder result = new StringBuilder();
for ( int i = 0; i < children.getLength() ; i++ ) {
if ( children.item( i ).getNodeType() == Node.TEXT_NODE
|| children.item( i ).getNodeType() == Node.CDATA_SECTION_NODE ) {

View File

@ -533,7 +533,7 @@ public class Table implements RelationalModel, Serializable, Exportable {
// Try to find out the name of the primary key to create it as identity if the IdentityGenerator is used
String pkname = null;
if ( hasPrimaryKey() && identityColumn ) {
pkname = ( (Column) getPrimaryKey().getColumnIterator().next() ).getQuotedName( dialect );
pkname = getPrimaryKey().getColumnIterator().next().getQuotedName( dialect );
}
Iterator iter = getColumnIterator();

View File

@ -77,7 +77,7 @@ public abstract class AbstractManagedType<J>
@Override
@SuppressWarnings("unchecked")
public void visitAttributes(Consumer<PersistentAttribute<J, ?>> action) {
visitDeclaredAttributes( (Consumer) action );
visitDeclaredAttributes( action );
if ( getSuperType() != null ) {
getSuperType().visitAttributes( (Consumer) action );
}

View File

@ -687,7 +687,7 @@ public abstract class AbstractEntityPersister
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
this.representationStrategy = creationContext.getBootstrapContext().getRepresentationStrategySelector()
.resolveStrategy( bootDescriptor, this, (RuntimeModelCreationContext) creationContext );
.resolveStrategy( bootDescriptor, this, creationContext );
this.javaTypeDescriptor = representationStrategy.getLoadJavaTypeDescriptor();
assert javaTypeDescriptor != null;

View File

@ -1252,7 +1252,7 @@ public class JoinedSubclassEntityPersister extends AbstractEntityPersister {
}
}
private class CaseSearchedExpressionInfo{
private static class CaseSearchedExpressionInfo{
CaseSearchedExpression caseSearchedExpression;
List<ColumnReference> columnReferences = new ArrayList<>( );
}

View File

@ -300,7 +300,7 @@ public class SingleTableEntityPersister extends AbstractEntityPersister {
throw new MappingException( "discriminator mapping required for single table polymorphic persistence" );
}
forceDiscriminator = persistentClass.isForceDiscriminator();
Selectable selectable = (Selectable) discrimValue.getColumnIterator().next();
Selectable selectable = discrimValue.getColumnIterator().next();
if ( discrimValue.hasFormula() ) {
Formula formula = (Formula) selectable;
discriminatorFormula = formula.getFormula();

View File

@ -46,7 +46,7 @@ public class EnhancedSetterImpl extends SetterFieldImpl {
// This marks the attribute as initialized, so it doesn't get lazy loaded afterwards
if ( target instanceof PersistentAttributeInterceptable ) {
PersistentAttributeInterceptor interceptor = ( (PersistentAttributeInterceptable) target ).$$_hibernate_getInterceptor();
if ( interceptor != null && interceptor instanceof LazyAttributeLoadingInterceptor ) {
if ( interceptor instanceof LazyAttributeLoadingInterceptor ) {
interceptor.attributeInitialized( propertyName );
}
}

View File

@ -190,8 +190,7 @@ public abstract class AbstractLazyInitializer implements LazyInitializer {
throw new LazyInitializationException( "could not initialize proxy [" + entityName + "#" + id + "] - no Session" );
}
try {
SessionFactoryImplementor sf = (SessionFactoryImplementor)
SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
SessionFactoryImplementor sf = SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
SharedSessionContractImplementor session = (SharedSessionContractImplementor) sf.openSession();
session.getPersistenceContext().setDefaultReadOnly( true );
session.setFlushMode( FlushMode.MANUAL );

View File

@ -55,7 +55,7 @@ public class ByteBuddyProxyHelper implements Serializable {
.ignore( byteBuddyState.getProxyDefinitionHelpers().getGroovyGetMetaClassFilter() )
.with( new NamingStrategy.SuffixingRandom( PROXY_NAMING_SUFFIX, new NamingStrategy.SuffixingRandom.BaseNameResolver.ForFixedValue( persistentClass.getName() ) ) )
.subclass( interfaces.length == 1 ? persistentClass : Object.class, ConstructorStrategy.Default.IMITATE_SUPER_CLASS_OPENING )
.implement( (Type[]) interfaces )
.implement( interfaces )
.method( byteBuddyState.getProxyDefinitionHelpers().getVirtualNotFinalizerFilter() )
.intercept( byteBuddyState.getProxyDefinitionHelpers().getDelegateToInterceptorDispatcherMethodDelegation() )
.method( byteBuddyState.getProxyDefinitionHelpers().getHibernateGeneratedMethodFilter() )

View File

@ -653,7 +653,7 @@ public class NativeQueryImpl<R>
if ( querySpaces == null ) {
querySpaces = new HashSet<>();
}
querySpaces.addAll( Arrays.asList( (String[]) spaces ) );
querySpaces.addAll( Arrays.asList( spaces ) );
}
}

View File

@ -36,8 +36,7 @@ public abstract class AbstractSqmSelfRenderingFunctionDescriptor
TypeConfiguration typeConfiguration) {
return new SelfRenderingSqmFunction<>(
this,
(sqlAppender, sqlAstArguments, walker)
-> render(sqlAppender, sqlAstArguments, walker),
this::render,
arguments,
impliedResultType,
getReturnTypeResolver(),

View File

@ -1250,7 +1250,7 @@ public class SqmCriteriaNodeBuilder implements NodeBuilder, SqmCreationContext {
public <Y> JpaCoalesce<Y> coalesce(Expression<? extends Y> x, Expression<? extends Y> y) {
//noinspection unchecked
return new SqmCoalesce<>(
(AllowableFunctionReturnType) highestPrecedenceType(
highestPrecedenceType(
((SqmExpression) x).getNodeType(),
((SqmExpression) y).getNodeType()
),

View File

@ -238,7 +238,7 @@ public final class ExecuteWithIdTableHelper {
);
if ( ddlTransactionHandling == TempTableDdlTransactionHandling.NONE ) {
( (SessionImplementor) executionContext.getSession() ).doWork( idTableCreationWork );
executionContext.getSession().doWork( idTableCreationWork );
}
else {
final IsolationDelegate isolationDelegate = executionContext.getSession()
@ -274,7 +274,7 @@ public final class ExecuteWithIdTableHelper {
);
if ( ddlTransactionHandling == TempTableDdlTransactionHandling.NONE ) {
( (SessionImplementor) executionContext.getSession() ).doWork( idTableDropWork );
executionContext.getSession().doWork( idTableDropWork );
}
else {
final IsolationDelegate isolationDelegate = executionContext.getSession()

View File

@ -55,7 +55,7 @@ public class SqmBagJoin<O, E> extends AbstractSqmPluralJoin<O,Collection<E>, E>
@Override
public BagPersistentAttribute<O,E> getModel() {
return (BagPersistentAttribute<O, E>) getReferencedPathSource();
return getReferencedPathSource();
}
@Override

View File

@ -32,7 +32,7 @@ public class SqmMaxIndexPath<T> extends AbstractSqmSpecificPluralPartPath<T> {
if ( getPluralAttribute() instanceof ListPersistentAttribute ) {
//noinspection unchecked
this.indexPathSource = ( (ListPersistentAttribute) getPluralAttribute() ).getIndexPathSource();
this.indexPathSource = getPluralAttribute().getIndexPathSource();
}
else if ( getPluralAttribute() instanceof MapPersistentAttribute ) {
//noinspection unchecked

View File

@ -32,7 +32,7 @@ public class SqmMinIndexPath<T> extends AbstractSqmSpecificPluralPartPath<T> {
if ( getPluralAttribute() instanceof ListPersistentAttribute ) {
//noinspection unchecked
this.indexPathSource = ( (ListPersistentAttribute) getPluralAttribute() ).getIndexPathSource();
this.indexPathSource = getPluralAttribute().getIndexPathSource();
}
else if ( getPluralAttribute() instanceof MapPersistentAttribute ) {
//noinspection unchecked

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.sql;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@ -51,9 +52,7 @@ public class InsertSelect {
}
public InsertSelect addColumns(String[] columnNames) {
for ( String columnName : columnNames ) {
this.columnNames.add( columnName );
}
Collections.addAll( this.columnNames, columnNames );
return this;
}

View File

@ -502,7 +502,7 @@ public abstract class AbstractSqlAstWalker
castTarget.getPrecision(),
castTarget.getScale()
)
);;
);
}
@Override

View File

@ -690,7 +690,7 @@ public class StatisticsImpl implements StatisticsImplementor, Service, Manageabl
public QueryStatisticsImpl getQueryStatistics(String queryString) {
return queryStatsMap.getOrCompute(
queryString,
s -> new QueryStatisticsImpl( s )
QueryStatisticsImpl::new
);
}

View File

@ -26,5 +26,5 @@ public enum TargetType {
/**
* Write to {@link System#out}
*/
STDOUT;
STDOUT
}

View File

@ -49,7 +49,7 @@ public class SequenceInformationExtractorMariaDBDatabaseImpl extends SequenceInf
try (
final Statement statement = extractionContext.getJdbcConnection().createStatement();
final ResultSet resultSet = statement.executeQuery( lookupSql );
final ResultSet resultSet = statement.executeQuery( lookupSql )
) {
while ( resultSet.next() ) {
sequenceNames.add( resultSetSequenceName( resultSet ) );
@ -70,7 +70,7 @@ public class SequenceInformationExtractorMariaDBDatabaseImpl extends SequenceInf
try (
final Statement statement = extractionContext.getJdbcConnection().createStatement();
final ResultSet resultSet = statement.executeQuery( sequenceInfoQueryBuilder.toString() );
final ResultSet resultSet = statement.executeQuery( sequenceInfoQueryBuilder.toString() )
) {
while ( resultSet.next() ) {

View File

@ -92,7 +92,7 @@ public class SchemaCreatorImpl implements SchemaCreator {
public SchemaCreatorImpl(ServiceRegistry serviceRegistry, SchemaFilter schemaFilter) {
SchemaManagementTool smt = serviceRegistry.getService( SchemaManagementTool.class );
if ( smt == null || !HibernateSchemaManagementTool.class.isInstance( smt ) ) {
if ( !HibernateSchemaManagementTool.class.isInstance( smt ) ) {
smt = new HibernateSchemaManagementTool();
( (HibernateSchemaManagementTool) smt ).injectServices( (ServiceRegistryImplementor) serviceRegistry );
}

View File

@ -87,7 +87,7 @@ public class SchemaDropperImpl implements SchemaDropper {
public SchemaDropperImpl(ServiceRegistry serviceRegistry, SchemaFilter schemaFilter) {
SchemaManagementTool smt = serviceRegistry.getService( SchemaManagementTool.class );
if ( smt == null || !HibernateSchemaManagementTool.class.isInstance( smt ) ) {
if ( !HibernateSchemaManagementTool.class.isInstance( smt ) ) {
smt = new HibernateSchemaManagementTool();
( (HibernateSchemaManagementTool) smt ).injectServices( (ServiceRegistryImplementor) serviceRegistry );
}

View File

@ -66,7 +66,7 @@ public class StandardTableExporter implements Exporter<Table> {
// Try to find out the name of the primary key in case the dialect needs it to create an identity
String pkColName = null;
if ( table.hasPrimaryKey() ) {
Column pkColumn = (Column) table.getPrimaryKey().getColumns().iterator().next();
Column pkColumn = table.getPrimaryKey().getColumns().iterator().next();
pkColName = pkColumn.getQuotedName( dialect );
}

View File

@ -240,7 +240,7 @@ public class AnyType extends AbstractType implements CompositeType, AssociationT
throws HibernateException, SQLException {
return resolveAny(
(String) discriminatorType.nullSafeGet( rs, names[0], session, owner ),
(Serializable) identifierType.nullSafeGet( rs, names[1], session, owner ),
identifierType.nullSafeGet( rs, names[1], session, owner ),
session
);
}

View File

@ -36,6 +36,6 @@ public class ClobType extends AbstractSingleColumnStandardBasicType<Clob> {
@Override
protected Clob getReplacement(Clob original, Clob target, SharedSessionContractImplementor session) {
return session.getJdbcServices().getJdbcEnvironment().getDialect().getLobMergeStrategy().mergeClob( (Clob) original, (Clob) target, session );
return session.getJdbcServices().getJdbcEnvironment().getDialect().getLobMergeStrategy().mergeClob( original, target, session );
}
}

View File

@ -438,7 +438,7 @@ public abstract class CollectionType extends AbstractType implements Association
);
}
return (Serializable) id;
return id;
}
}

View File

@ -38,6 +38,6 @@ public class CurrencyType
}
public String objectToSQLString(Currency value, Dialect dialect) throws Exception {
return "\'" + toString( value ) + "\'";
return "'" + toString( value ) + "'";
}
}

View File

@ -374,7 +374,7 @@ public abstract class EntityType extends AbstractType implements AssociationType
}
else {
//JPA 2 case where @IdClass contains the id and not the associated entity
xid = (Serializable) x;
xid = x;
}
}
@ -388,7 +388,7 @@ public abstract class EntityType extends AbstractType implements AssociationType
}
else {
//JPA 2 case where @IdClass contains the id and not the associated entity
yid = (Serializable) y;
yid = y;
}
}

View File

@ -47,7 +47,7 @@ public class EnumJavaTypeDescriptor<T extends Enum<T>> extends AbstractTypeDescr
@Override
public T fromString(String string) {
return string == null ? null : (T) Enum.valueOf( getJavaType(), string );
return string == null ? null : Enum.valueOf( getJavaType(), string );
}
@Override

View File

@ -370,7 +370,7 @@ public class TypeConfiguration implements SessionFactoryObserver, Serializable {
if ( sessionFactoryName == null && sessionFactoryUuid == null ) {
throw new HibernateException( "TypeConfiguration was not yet scoped to SessionFactory" );
}
sessionFactory = (SessionFactoryImplementor) SessionFactoryRegistry.INSTANCE.findSessionFactory(
sessionFactory = SessionFactoryRegistry.INSTANCE.findSessionFactory(
sessionFactoryUuid,
sessionFactoryName
);
@ -420,7 +420,7 @@ public class TypeConfiguration implements SessionFactoryObserver, Serializable {
private Object readResolve() throws InvalidObjectException {
if ( sessionFactory == null ) {
if ( sessionFactoryName != null || sessionFactoryUuid != null ) {
sessionFactory = (SessionFactoryImplementor) SessionFactoryRegistry.INSTANCE.findSessionFactory(
sessionFactory = SessionFactoryRegistry.INSTANCE.findSessionFactory(
sessionFactoryUuid,
sessionFactoryName
);

View File

@ -67,7 +67,7 @@ public class BlobLocatorTest extends BaseCoreFunctionalTestCase {
s.close();
// test mutation via setting the new clob data...
if ( getDialect().supportsLobValueChangePropogation() ) {
if ( getDialect().supportsLobValueChangePropagation() ) {
s = openSession();
s.beginTransaction();
entity = ( LobHolder ) s.byId( LobHolder.class ).with( LockOptions.UPGRADE ).load( entity.getId() );

View File

@ -69,7 +69,7 @@ public class ClobLocatorTest extends BaseCoreFunctionalTestCase {
s.close();
// test mutation via setting the new clob data...
if ( getDialect().supportsLobValueChangePropogation() ) {
if ( getDialect().supportsLobValueChangePropagation() ) {
s = openSession();
s.beginTransaction();
entity = ( LobHolder ) s.byId( LobHolder.class ).with( LockOptions.UPGRADE ).load( entity.getId() );

View File

@ -23,7 +23,7 @@ import static org.junit.Assert.assertTrue;
* @author Steve Ebersole
*/
@TestForIssue( jiraKey = "HHH-2680" )
@RequiresDialectFeature( {DialectChecks.SupportsExpectedLobUsagePattern.class, DialectChecks.SupportsLobValueChangePropogation.class} ) // Skip for Sybase. HHH-6807
@RequiresDialectFeature( {DialectChecks.SupportsExpectedLobUsagePattern.class, DialectChecks.SupportsLobValueChangePropagation.class} ) // Skip for Sybase. HHH-6807
public class LobMergeTest extends BaseCoreFunctionalTestCase {
private static final int LOB_SIZE = 10000;

Some files were not shown because too many files have changed in this diff Show More