HHH-18488 Bump the jboss logging dependency

This commit is contained in:
marko-bekhta 2024-08-10 21:47:12 +02:00 committed by Steve Ebersole
parent e87a64d976
commit 28988a9a5c
130 changed files with 316 additions and 85 deletions

View File

@ -15,6 +15,8 @@ import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
import static org.jboss.logging.Logger.Level.WARN;
/**
@ -32,7 +34,7 @@ import static org.jboss.logging.Logger.Level.WARN;
public interface C3P0MessageLogger extends ConnectionInfoLogger {
String NAME = ConnectionInfoLogger.LOGGER_NAME + ".c3p0";
C3P0MessageLogger C3P0_MSG_LOGGER = Logger.getMessageLogger( C3P0MessageLogger.class, NAME );
C3P0MessageLogger C3P0_MSG_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), C3P0MessageLogger.class, NAME );
/**
* Log a message (WARN) about conflicting {@code hibernate.c3p0.XYZ} and {@code c3p0.XYZ} settings

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.community.dialect;
import java.lang.invoke.MethodHandles;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
@ -120,7 +121,7 @@ import static org.hibernate.type.descriptor.DateTimeUtils.appendAsTimestampWithM
*/
public class CockroachLegacyDialect extends Dialect {
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, CockroachLegacyDialect.class.getName() );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, CockroachLegacyDialect.class.getName() );
// KNOWN LIMITATIONS:
// * no support for java.sql.Clob

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.community.dialect;
import java.lang.invoke.MethodHandles;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.sql.Types;
@ -95,6 +96,7 @@ import static org.hibernate.type.SqlTypes.NUMERIC;
*/
public class HSQLLegacyDialect extends Dialect {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
org.hibernate.community.dialect.HSQLLegacyDialect.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.community.dialect;
import java.lang.invoke.MethodHandles;
import java.sql.Types;
import org.hibernate.LockMode;
@ -81,6 +82,7 @@ import static org.hibernate.type.SqlTypes.VARCHAR;
*/
public class RDMSOS2200Dialect extends Dialect {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
RDMSOS2200Dialect.class.getName()
);

View File

@ -10,6 +10,8 @@ import org.hibernate.internal.CoreMessageLogger;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
/**
* Indicates an attempt to access unfetched data outside the context
* of an open stateful {@link Session}.
@ -24,6 +26,7 @@ import org.jboss.logging.Logger;
public class LazyInitializationException extends HibernateException {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
LazyInitializationException.class.getName()
);

View File

@ -11,6 +11,8 @@ import org.hibernate.internal.build.AllowSysOut;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
/**
* Information about the version of Hibernate.
*
@ -41,7 +43,7 @@ public final class Version {
* Logs the Hibernate version (using {@link #getVersionString()}) to the logging system.
*/
public static void logVersion() {
Logger.getMessageLogger( CoreMessageLogger.class, Version.class.getName() ).version( getVersionString() );
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, Version.class.getName() ).version( getVersionString() );
}
/**

View File

@ -9,6 +9,7 @@ package org.hibernate.action.internal;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.invoke.MethodHandles;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Set;
@ -45,8 +46,9 @@ import static org.hibernate.pretty.MessageHelper.infoString;
*/
public class UnresolvedEntityInsertActions {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
CoreMessageLogger.class,
UnresolvedEntityInsertActions.class.getName()
MethodHandles.lookup(),
CoreMessageLogger.class,
UnresolvedEntityInsertActions.class.getName()
);
private static final int INIT_SIZE = 5;

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.boot.beanvalidation;
import java.lang.invoke.MethodHandles;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@ -47,6 +48,7 @@ public class BeanValidationEventListener
implements PreInsertEventListener, PreUpdateEventListener, PreDeleteEventListener, PreUpsertEventListener {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
BeanValidationEventListener.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.boot.beanvalidation;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Set;
@ -30,6 +31,7 @@ import org.jboss.logging.Logger;
*/
public class BeanValidationIntegrator implements Integrator {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
BeanValidationIntegrator.class.getName()
);

View File

@ -7,6 +7,7 @@
package org.hibernate.boot.beanvalidation;
import java.lang.annotation.Annotation;
import java.lang.invoke.MethodHandles;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@ -60,7 +61,7 @@ import static org.hibernate.cfg.ValidationSettings.JPA_VALIDATION_FACTORY;
*/
class TypeSafeActivator {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, TypeSafeActivator.class.getName());
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, TypeSafeActivator.class.getName() );
/**
* Used to validate a supplied ValidatorFactory instance as being castable to ValidatorFactory.

View File

@ -14,6 +14,8 @@ import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
/**
* @author Steve Ebersole
*/
@ -25,5 +27,5 @@ import org.jboss.logging.annotations.ValidIdRange;
)
public interface JaxbLogger extends BasicLogger {
String LOGGER_NAME = BootLogging.NAME + ".jaxb";
JaxbLogger JAXB_LOGGER = Logger.getMessageLogger( JaxbLogger.class, LOGGER_NAME );
JaxbLogger JAXB_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), JaxbLogger.class, LOGGER_NAME );
}

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.boot.model.internal;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -68,7 +69,7 @@ import static org.hibernate.internal.util.StringHelper.nullIfEmpty;
*/
public class AnnotatedColumn {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, AnnotatedColumn.class.getName());
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, AnnotatedColumn.class.getName() );
private Column mappingColumn;
private boolean insertable = true;

View File

@ -7,6 +7,7 @@
package org.hibernate.boot.model.internal;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.ParameterizedType;
import java.util.Collection;
import java.util.Collections;
@ -113,7 +114,7 @@ public class BasicValueBinder implements JdbcTypeIndicators {
// forward this class should undergo major changes: see the comments in #setType
// but as always the "design" of these classes make it unclear exactly how to change it properly.
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, BasicValueBinder.class.getName() );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, BasicValueBinder.class.getName() );
public enum Kind {
ATTRIBUTE( ValueMappingAccess.INSTANCE ),

View File

@ -7,6 +7,7 @@
package org.hibernate.boot.model.internal;
import java.lang.annotation.Annotation;
import java.lang.invoke.MethodHandles;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
@ -186,7 +187,7 @@ import static org.hibernate.mapping.MappingHelper.createLocalUserCollectionTypeB
* @author Emmanuel Bernard
*/
public abstract class CollectionBinder {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, CollectionBinder.class.getName());
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, CollectionBinder.class.getName() );
private static final List<Class<?>> INFERRED_CLASS_PRIORITY = List.of(
List.class,

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.boot.model.internal;
import java.lang.invoke.MethodHandles;
import java.util.Map;
import org.hibernate.MappingException;
@ -27,7 +28,7 @@ import org.jboss.logging.Logger;
*/
public abstract class CollectionSecondPass implements SecondPass {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, CollectionSecondPass.class.getName());
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, CollectionSecondPass.class.getName() );
private final Collection collection;

View File

@ -7,6 +7,7 @@
package org.hibernate.boot.model.internal;
import java.lang.annotation.Annotation;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@ -171,7 +172,7 @@ import static org.hibernate.internal.util.collections.CollectionHelper.isNotEmpt
*/
public class EntityBinder {
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, EntityBinder.class.getName() );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, EntityBinder.class.getName() );
private static final String NATURAL_ID_CACHE_SUFFIX = "##NaturalId";
private MetadataBuildingContext context;

View File

@ -7,6 +7,7 @@
package org.hibernate.boot.model.internal;
import java.lang.annotation.Annotation;
import java.lang.invoke.MethodHandles;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
@ -102,7 +103,7 @@ import static org.hibernate.internal.util.StringHelper.qualify;
* @author Emmanuel Bernard
*/
public class PropertyBinder {
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, PropertyBinder.class.getName() );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, PropertyBinder.class.getName() );
private MetadataBuildingContext buildingContext;

View File

@ -9,6 +9,7 @@
package org.hibernate.boot.model.internal;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
@ -56,7 +57,7 @@ import jakarta.persistence.Transient;
*/
public class PropertyContainer {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, PropertyContainer.class.getName());
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, PropertyContainer.class.getName() );
/**
* The class for which this container is created.

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.boot.model.internal;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@ -67,7 +68,7 @@ import static org.hibernate.internal.util.collections.CollectionHelper.setOf;
* @author Emmanuel Bernard
*/
public abstract class QueryBinder {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, QueryBinder.class.getName());
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, QueryBinder.class.getName() );
public static void bindQuery(
NamedQuery namedQuery,

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.boot.model.internal;
import java.lang.invoke.MethodHandles;
import java.util.List;
import org.hibernate.AnnotationException;
@ -57,7 +58,7 @@ import static org.hibernate.internal.util.StringHelper.unquote;
* @author Emmanuel Bernard
*/
public class TableBinder {
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, TableBinder.class.getName() );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, TableBinder.class.getName() );
private MetadataBuildingContext buildingContext;

View File

@ -16,6 +16,8 @@ import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
import static org.jboss.logging.Logger.Level.WARN;
/**
@ -32,7 +34,7 @@ public interface BytecodeInterceptorLogging extends BasicLogger {
String LOGGER_NAME = BytecodeLogging.LOGGER_NAME + "." + SUB_NAME;
Logger LOGGER = Logger.getLogger( LOGGER_NAME );
BytecodeInterceptorLogging MESSAGE_LOGGER = Logger.getMessageLogger(BytecodeInterceptorLogging.class, LOGGER_NAME );
BytecodeInterceptorLogging MESSAGE_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), BytecodeInterceptorLogging.class, LOGGER_NAME );
@LogMessage(level = WARN)
@Message(

View File

@ -16,6 +16,8 @@ import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
import static org.jboss.logging.Logger.Level.INFO;
import static org.jboss.logging.Logger.Level.WARN;
@ -31,7 +33,7 @@ import static org.jboss.logging.Logger.Level.WARN;
public interface SecondLevelCacheLogger extends BasicLogger {
String LOGGER_NAME = SubSystemLogging.BASE + ".cache";
SecondLevelCacheLogger L2CACHE_LOGGER = Logger.getMessageLogger( SecondLevelCacheLogger.class, LOGGER_NAME );
SecondLevelCacheLogger L2CACHE_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), SecondLevelCacheLogger.class, LOGGER_NAME );
int NAMESPACE = 90001000;

View File

@ -8,6 +8,7 @@ package org.hibernate.cfg;
import java.io.IOException;
import java.io.InputStream;
import java.lang.invoke.MethodHandles;
import java.util.Properties;
import org.hibernate.HibernateException;
@ -132,7 +133,7 @@ import org.jboss.logging.Logger;
*/
@Internal
public final class Environment implements AvailableSettings {
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, Environment.class.getName());
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, Environment.class.getName());
private static final Properties GLOBAL_PROPERTIES;

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.context.internal;
import java.lang.invoke.MethodHandles;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import jakarta.transaction.Synchronization;
@ -46,6 +47,7 @@ import org.jboss.logging.Logger;
*/
public class JTASessionContext extends AbstractCurrentSessionContext {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
JTASessionContext.class.getName()
);

View File

@ -10,6 +10,7 @@ import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@ -60,6 +61,7 @@ import org.jboss.logging.Logger;
*/
public class ThreadLocalSessionContext extends AbstractCurrentSessionContext {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
ThreadLocalSessionContext.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.dialect;
import java.lang.invoke.MethodHandles;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
@ -122,7 +123,7 @@ import static org.hibernate.type.descriptor.DateTimeUtils.appendAsTimestampWithM
*/
public class CockroachDialect extends Dialect {
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, CockroachDialect.class.getName() );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, CockroachDialect.class.getName() );
// KNOWN LIMITATIONS:
// * no support for java.sql.Clob

View File

@ -10,6 +10,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.lang.invoke.MethodHandles;
import java.sql.Blob;
import java.sql.CallableStatement;
import java.sql.Clob;
@ -313,7 +314,7 @@ public abstract class Dialect implements ConversionContext, TypeContributor, Fun
private static final Pattern ESCAPE_CLOSING_COMMENT_PATTERN = Pattern.compile( "\\*/" );
private static final Pattern ESCAPE_OPENING_COMMENT_PATTERN = Pattern.compile( "/\\*" );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, Dialect.class.getName() );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, Dialect.class.getName() );
//needed for converting precision from decimal to binary digits
protected static final double LOG_BASE2OF10 = log(10)/log(2);

View File

@ -14,6 +14,8 @@ import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
import static org.jboss.logging.Logger.Level.DEBUG;
/**
@ -28,7 +30,7 @@ import static org.jboss.logging.Logger.Level.DEBUG;
public interface DialectLogging {
String LOGGER_NAME = SubSystemLogging.BASE + ".dialect";
Logger DIALECT_LOGGER = Logger.getLogger(LOGGER_NAME);
DialectLogging DIALECT_MESSAGE_LOGGER = Logger.getMessageLogger(DialectLogging.class, LOGGER_NAME);
DialectLogging DIALECT_MESSAGE_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), DialectLogging.class, LOGGER_NAME );
@LogMessage(level = DEBUG)
@Message(value = "Using dialect: %s", id = 35001)

View File

@ -14,13 +14,15 @@ import org.hibernate.type.spi.TypeConfiguration;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
/**
* Encapsulates the validator, return type and argument type resolvers for the array_contains function.
* Subclasses only have to implement the rendering.
*/
public abstract class AbstractArrayContainsFunction extends AbstractSqmSelfRenderingFunctionDescriptor {
protected static final DeprecationLogger LOG = Logger.getMessageLogger( DeprecationLogger.class, AbstractArrayContainsFunction.class.getName() );
protected static final DeprecationLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), DeprecationLogger.class, AbstractArrayContainsFunction.class.getName() );
protected final boolean nullable;

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.dialect.lock;
import java.lang.invoke.MethodHandles;
import java.sql.PreparedStatement;
import java.sql.SQLException;
@ -38,6 +39,7 @@ import org.jboss.logging.Logger;
*/
public class PessimisticReadUpdateLockingStrategy implements LockingStrategy {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
PessimisticReadUpdateLockingStrategy.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.dialect.lock;
import java.lang.invoke.MethodHandles;
import java.sql.PreparedStatement;
import java.sql.SQLException;
@ -38,6 +39,7 @@ import org.jboss.logging.Logger;
*/
public class PessimisticWriteUpdateLockingStrategy implements LockingStrategy {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
PessimisticWriteUpdateLockingStrategy.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.dialect.lock;
import java.lang.invoke.MethodHandles;
import java.sql.PreparedStatement;
import java.sql.SQLException;
@ -36,6 +37,7 @@ import org.jboss.logging.Logger;
*/
public class UpdateLockingStrategy implements LockingStrategy {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
UpdateLockingStrategy.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.engine.config.internal;
import java.lang.invoke.MethodHandles;
import java.util.Collections;
import java.util.Map;
@ -29,6 +30,7 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
*/
public class ConfigurationServiceImpl implements ConfigurationService, ServiceRegistryAwareService {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
ConfigurationServiceImpl.class.getName()
);

View File

@ -7,6 +7,7 @@
package org.hibernate.engine.internal;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@ -27,6 +28,7 @@ import static java.util.Arrays.asList;
*/
public class BatchFetchQueueHelper {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
BatchFetchQueueHelper.class.getName()
);

View File

@ -24,6 +24,8 @@ import org.hibernate.type.CollectionType;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
/**
* Implements book-keeping for the collection persistence by reachability algorithm
*
@ -31,6 +33,7 @@ import org.jboss.logging.Logger;
*/
public final class Collections {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
Collections.class.getName()
);

View File

@ -11,6 +11,7 @@ import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@ -92,6 +93,7 @@ import static org.hibernate.engine.internal.ManagedTypeHelper.isPersistentAttrib
*/
public class StatefulPersistenceContext implements PersistenceContext {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
StatefulPersistenceContext.class.getName()
);

View File

@ -14,6 +14,8 @@ import org.hibernate.type.descriptor.java.VersionJavaType;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
import static org.hibernate.generator.EventType.INSERT;
import static org.hibernate.generator.EventType.UPDATE;
@ -24,6 +26,7 @@ import static org.hibernate.generator.EventType.UPDATE;
*/
public final class Versioning {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
Versioning.class.getName()
);

View File

@ -15,6 +15,8 @@ import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
import static org.jboss.logging.Logger.Level.WARN;
/**
@ -32,7 +34,7 @@ public interface JdbcLogging extends BasicLogger {
String NAME = "org.hibernate.orm.jdbc";
Logger JDBC_LOGGER = Logger.getLogger( NAME );
JdbcLogging JDBC_MESSAGE_LOGGER = Logger.getMessageLogger( JdbcLogging.class, NAME );
JdbcLogging JDBC_MESSAGE_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), JdbcLogging.class, NAME );
@LogMessage(level = WARN)
@Message(

View File

@ -15,6 +15,8 @@ import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
import static org.jboss.logging.Logger.Level.ERROR;
import static org.jboss.logging.Logger.Level.INFO;
@ -33,7 +35,7 @@ public interface JdbcBatchLogging extends BasicLogger {
String NAME = "org.hibernate.orm.jdbc.batch";
Logger BATCH_LOGGER = Logger.getLogger( NAME );
JdbcBatchLogging BATCH_MESSAGE_LOGGER = Logger.getMessageLogger( JdbcBatchLogging.class, NAME );
JdbcBatchLogging BATCH_MESSAGE_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), JdbcBatchLogging.class, NAME );
@LogMessage(level = ERROR)
@Message(id = 100501, value = "Exception executing batch [%s], SQL: %s")

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.engine.jdbc.env.internal;
import java.lang.invoke.MethodHandles;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
@ -79,6 +80,7 @@ import static org.hibernate.internal.util.config.ConfigurationHelper.getInteger;
*/
public class JdbcEnvironmentInitiator implements StandardServiceInitiator<JdbcEnvironment> {
private static final CoreMessageLogger log = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
JdbcEnvironmentInitiator.class.getName()
);

View File

@ -17,6 +17,8 @@ import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
import static org.jboss.logging.Logger.Level.DEBUG;
/**
@ -32,7 +34,7 @@ public interface LobCreationLogging extends BasicLogger {
String NAME = JdbcLogging.NAME + ".lob";
Logger LOB_LOGGER = Logger.getLogger( NAME );
LobCreationLogging LOB_MESSAGE_LOGGER = Logger.getMessageLogger( LobCreationLogging.class, NAME );
LobCreationLogging LOB_MESSAGE_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), LobCreationLogging.class, NAME );
@LogMessage(level = DEBUG)
@Message(value = "Disabling contextual LOB creation as %s is true", id = 10010001)

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.engine.jdbc.spi;
import java.lang.invoke.MethodHandles;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.SQLWarning;
@ -31,6 +32,7 @@ import org.jboss.logging.Logger.Level;
*/
public class SqlExceptionHelper {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
SqlExceptionHelper.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.engine.jdbc.spi;
import java.lang.invoke.MethodHandles;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
@ -23,6 +24,7 @@ import org.jboss.logging.Logger;
*/
public class TypeInfo {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
TypeInfo.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.engine.jndi.internal;
import java.lang.invoke.MethodHandles;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Hashtable;
@ -35,6 +36,7 @@ import org.jboss.logging.Logger;
*/
final class JndiServiceImpl implements JndiService {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
JndiServiceImpl.class.getName()
);

View File

@ -22,6 +22,7 @@ import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.type.CollectionType;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
import java.util.Iterator;
import static java.util.Collections.emptyIterator;
@ -33,6 +34,7 @@ import static org.hibernate.engine.internal.ManagedTypeHelper.isHibernateProxy;
*/
public class CascadingActions {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
CascadingAction.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.engine.transaction.jta.platform.internal;
import java.lang.invoke.MethodHandles;
import java.util.Map;
import org.hibernate.boot.registry.StandardServiceInitiator;
@ -28,7 +29,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
public class JtaPlatformInitiator implements StandardServiceInitiator<JtaPlatform> {
public static final JtaPlatformInitiator INSTANCE = new JtaPlatformInitiator();
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, JtaPlatformInitiator.class.getName());
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, JtaPlatformInitiator.class.getName() );
@Override
public Class<JtaPlatform> getServiceInitiated() {

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.event.internal;
import java.lang.invoke.MethodHandles;
import java.util.Map;
import org.hibernate.HibernateException;
@ -51,7 +52,7 @@ import static org.hibernate.engine.internal.Collections.skipRemoval;
*/
public abstract class AbstractFlushingEventListener implements JpaBootstrapSensitive {
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, AbstractFlushingEventListener.class.getName() );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, AbstractFlushingEventListener.class.getName() );
@Override
public void wasJpaBootstrap(boolean wasJpaBootstrap) {

View File

@ -21,6 +21,8 @@ import org.hibernate.stat.spi.StatisticsImplementor;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
/**
* Defines the default flush event listeners used by hibernate for
* flushing session state in response to generated auto-flush events.
@ -29,7 +31,7 @@ import org.jboss.logging.Logger;
*/
public class DefaultAutoFlushEventListener extends AbstractFlushingEventListener implements AutoFlushEventListener {
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, DefaultAutoFlushEventListener.class.getName() );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, DefaultAutoFlushEventListener.class.getName() );
/**
* Handle the given auto-flush event.

View File

@ -24,6 +24,8 @@ import org.hibernate.persister.entity.EntityPersister;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
/**
* Defines the default lock event listeners used by hibernate to lock entities
* in response to generated lock events.
@ -33,6 +35,7 @@ import org.jboss.logging.Logger;
public class DefaultLockEventListener extends AbstractLockUpgradeEventListener implements LockEventListener {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
DefaultLockEventListener.class.getName()
);

View File

@ -21,6 +21,7 @@ import org.hibernate.type.descriptor.java.JavaType;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Member;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
@ -53,6 +54,7 @@ import static org.hibernate.generator.EventTypeSets.INSERT_AND_UPDATE;
public class SourceGeneration implements BeforeExecutionGenerator {
private static final CoreMessageLogger log = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
SourceGeneration.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.id.enhanced;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Constructor;
import java.util.Properties;
@ -23,6 +24,7 @@ import static org.hibernate.internal.util.StringHelper.isNotEmpty;
*/
public class OptimizerFactory {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
OptimizerFactory.class.getName()
);

View File

@ -7,6 +7,7 @@
package org.hibernate.id.enhanced;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock;
@ -27,6 +28,7 @@ import org.jboss.logging.Logger;
*/
public class PooledLoOptimizer extends AbstractOptimizer {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
PooledLoOptimizer.class.getName()
);

View File

@ -7,6 +7,7 @@
package org.hibernate.id.enhanced;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.util.HashMap;
import java.util.Map;
@ -28,6 +29,7 @@ import org.jboss.logging.Logger;
*/
public class PooledLoThreadLocalOptimizer extends AbstractOptimizer {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
PooledLoOptimizer.class.getName()
);

View File

@ -7,6 +7,7 @@
package org.hibernate.id.enhanced;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.Lock;
@ -34,6 +35,7 @@ import org.jboss.logging.Logger;
*/
public class PooledOptimizer extends AbstractOptimizer implements InitialValueAwareOptimizer {
private static final CoreMessageLogger log = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
PooledOptimizer.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.id.enhanced;
import java.lang.invoke.MethodHandles;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
@ -32,6 +33,7 @@ import static org.hibernate.id.IdentifierGeneratorHelper.getIntegralDataTypeHold
*/
public class SequenceStructure implements DatabaseStructure {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
SequenceStructure.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.id.enhanced;
import java.lang.invoke.MethodHandles;
import java.util.Iterator;
import java.util.Properties;
import java.util.Set;
@ -112,6 +113,7 @@ public class SequenceStyleGenerator
implements PersistentIdentifierGenerator, BulkInsertionCapableIdentifierGenerator {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
SequenceStyleGenerator.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.id.enhanced;
import java.lang.invoke.MethodHandles;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -133,6 +134,7 @@ import static org.hibernate.internal.util.config.ConfigurationHelper.getString;
*/
public class TableGenerator implements PersistentIdentifierGenerator {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
TableGenerator.class.getName()
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.id.enhanced;
import java.lang.invoke.MethodHandles;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -46,6 +47,7 @@ import static org.hibernate.id.IdentifierGeneratorHelper.getIntegralDataTypeHold
*/
public class TableStructure implements DatabaseStructure {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
TableStructure.class.getName()
);

View File

@ -8,6 +8,8 @@ package org.hibernate.internal;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
/**
* Quite sad, really, when you need helpers for generating loggers...
*
@ -26,7 +28,7 @@ public class CoreLogging {
}
public static CoreMessageLogger messageLogger(String loggerName) {
return Logger.getMessageLogger( CoreMessageLogger.class, loggerName );
return Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, loggerName );
}
public static Logger logger(Class classNeedingLogging) {

View File

@ -8,6 +8,8 @@ package org.hibernate.internal;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
/**
* Sad when you need helpers for generating loggers...
*
@ -25,7 +27,7 @@ public class HEMLogging {
}
public static EntityManagerMessageLogger messageLogger(String loggerName) {
return Logger.getMessageLogger( EntityManagerMessageLogger .class, loggerName );
return Logger.getMessageLogger( MethodHandles.lookup(), EntityManagerMessageLogger .class, loggerName );
}
public static Logger logger(Class<?> classNeedingLogging) {

View File

@ -15,6 +15,8 @@ import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
import static org.jboss.logging.Logger.Level.INFO;
/**
@ -33,6 +35,7 @@ public interface ConnectionAccessLogger extends BasicLogger {
* Static access to the logging instance
*/
ConnectionAccessLogger INSTANCE = Logger.getMessageLogger(
MethodHandles.lookup(),
ConnectionAccessLogger.class,
LOGGER_NAME
);

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.internal.log;
import java.lang.invoke.MethodHandles;
import java.sql.SQLException;
import org.jboss.logging.BasicLogger;
@ -35,7 +36,7 @@ public interface ConnectionInfoLogger extends BasicLogger {
/**
* Static access to the logging instance
*/
ConnectionInfoLogger INSTANCE = Logger.getMessageLogger( ConnectionInfoLogger.class, LOGGER_NAME );
ConnectionInfoLogger INSTANCE = Logger.getMessageLogger( MethodHandles.lookup(), ConnectionInfoLogger.class, LOGGER_NAME );
@LogMessage(level = WARN)
@Message(value = "Using built-in connection pool (not intended for production use)", id = 10001002)

View File

@ -7,6 +7,7 @@
package org.hibernate.internal.log;
import java.lang.annotation.Annotation;
import java.lang.invoke.MethodHandles;
import org.hibernate.boot.jaxb.SourceType;
import org.hibernate.cfg.AvailableSettings;
@ -36,7 +37,7 @@ import static org.jboss.logging.Logger.Level.WARN;
public interface DeprecationLogger extends BasicLogger {
String CATEGORY = SubSystemLogging.BASE + ".deprecation";
DeprecationLogger DEPRECATION_LOGGER = Logger.getMessageLogger( DeprecationLogger.class, CATEGORY );
DeprecationLogger DEPRECATION_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), DeprecationLogger.class, CATEGORY );
@LogMessage(level = WARN)
@Message(

View File

@ -12,6 +12,8 @@ import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
import static org.jboss.logging.Logger.Level.WARN;
/**
@ -22,7 +24,7 @@ import static org.jboss.logging.Logger.Level.WARN;
public interface IncubationLogger {
String CATEGORY = SubSystemLogging.BASE + ".incubating";
IncubationLogger INCUBATION_LOGGER = Logger.getMessageLogger( IncubationLogger.class, CATEGORY );
IncubationLogger INCUBATION_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), IncubationLogger.class, CATEGORY );
@LogMessage(level = WARN)
@Message(

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.internal.log;
import java.lang.invoke.MethodHandles;
import java.net.URISyntaxException;
import java.net.URL;
@ -35,7 +36,7 @@ public interface UrlMessageBundle {
String LOGGER_NAME = SubSystemLogging.BASE + ".url";
Logger URL_LOGGER = Logger.getLogger( LOGGER_NAME );
UrlMessageBundle URL_MESSAGE_LOGGER = Logger.getMessageLogger( UrlMessageBundle.class, LOGGER_NAME );
UrlMessageBundle URL_MESSAGE_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), UrlMessageBundle.class, LOGGER_NAME );
/**
* Logs a warning about a malformed URL, caused by a {@link URISyntaxException}

View File

@ -8,6 +8,7 @@ package org.hibernate.internal.util.xml;
import java.io.InputStream;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.internal.util.ConfigHelper;
@ -44,7 +45,7 @@ import org.xml.sax.InputSource;
@Deprecated
public class DTDEntityResolver implements EntityResolver, Serializable {
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, DTDEntityResolver.class.getName() );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, DTDEntityResolver.class.getName() );
private static final String HIBERNATE_NAMESPACE = "http://www.hibernate.org/dtd/";
private static final String OLD_HIBERNATE_NAMESPACE = "http://hibernate.sourceforge.net/";

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.jpa.internal.util;
import java.lang.invoke.MethodHandles;
import java.net.URL;
import java.util.Enumeration;
import java.util.List;
@ -21,7 +22,7 @@ import org.jboss.logging.Logger;
* @author Steve Ebersole
*/
public final class LogHelper {
private static final EntityManagerMessageLogger log = Logger.getMessageLogger( EntityManagerMessageLogger.class, LogHelper.class.getName() );
private static final EntityManagerMessageLogger log = Logger.getMessageLogger( MethodHandles.lookup(), EntityManagerMessageLogger.class, LogHelper.class.getName() );
private LogHelper() {
}

View File

@ -13,6 +13,8 @@ import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
/**
* Logger used during mapping-model creation
*
@ -28,5 +30,5 @@ public interface MappingModelCreationLogging extends BasicLogger {
String LOGGER_NAME = SubSystemLogging.BASE + ".model.mapping.creation";
Logger MAPPING_MODEL_CREATION_LOGGER = Logger.getLogger( LOGGER_NAME );
MappingModelCreationLogging MAPPING_MODEL_CREATION_MESSAGE_LOGGER = Logger.getMessageLogger( MappingModelCreationLogging.class, LOGGER_NAME );
MappingModelCreationLogging MAPPING_MODEL_CREATION_MESSAGE_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), MappingModelCreationLogging.class, LOGGER_NAME );
}

View File

@ -17,6 +17,8 @@ import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
import static org.jboss.logging.Logger.Level.ERROR;
import static org.jboss.logging.Logger.Level.INFO;
import static org.jboss.logging.Logger.Level.WARN;
@ -34,7 +36,7 @@ public interface QueryLogging extends BasicLogger {
String LOGGER_NAME = SubSystemLogging.BASE + ".query";
Logger QUERY_LOGGER = Logger.getLogger( LOGGER_NAME );
QueryLogging QUERY_MESSAGE_LOGGER = Logger.getMessageLogger( QueryLogging.class, LOGGER_NAME );
QueryLogging QUERY_MESSAGE_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), QueryLogging.class, LOGGER_NAME );
static String subLoggerName(String subName) {
return LOGGER_NAME + '.' + subName;
@ -45,7 +47,7 @@ public interface QueryLogging extends BasicLogger {
}
static <T> T subLogger(String subName, Class<T> loggerJavaType) {
return Logger.getMessageLogger( loggerJavaType, subLoggerName( subName ) );
return Logger.getMessageLogger( MethodHandles.lookup(), loggerJavaType, subLoggerName( subName ) );
}
@LogMessage(level = ERROR)

View File

@ -18,6 +18,8 @@ import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
import static org.jboss.logging.Logger.Level.ERROR;
/**
@ -32,7 +34,7 @@ import static org.jboss.logging.Logger.Level.ERROR;
public interface HqlLogging extends BasicLogger {
String LOGGER_NAME = QueryLogging.LOGGER_NAME + ".hql";
HqlLogging QUERY_LOGGER = Logger.getMessageLogger( HqlLogging.class, LOGGER_NAME );
HqlLogging QUERY_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), HqlLogging.class, LOGGER_NAME );
static String subLoggerName(String subName) {
return LOGGER_NAME + '.' + subName;
@ -43,7 +45,7 @@ public interface HqlLogging extends BasicLogger {
}
static <T> T subLogger(String subName, Class<T> loggerJavaType) {
return Logger.getMessageLogger( loggerJavaType, subLoggerName( subName ) );
return Logger.getMessageLogger( MethodHandles.lookup(), loggerJavaType, subLoggerName( subName ) );
}
@LogMessage(level = ERROR)

View File

@ -15,6 +15,8 @@ import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
import static org.jboss.logging.Logger.Level.DEBUG;
import static org.jboss.logging.Logger.Level.INFO;
import static org.jboss.logging.Logger.Level.WARN;
@ -31,7 +33,7 @@ import static org.jboss.logging.Logger.Level.WARN;
public interface BeansMessageLogger {
String LOGGER_NAME = SubSystemLogging.BASE + ".beans";
BeansMessageLogger BEANS_MSG_LOGGER = Logger.getMessageLogger( BeansMessageLogger.class, LOGGER_NAME );
BeansMessageLogger BEANS_MSG_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), BeansMessageLogger.class, LOGGER_NAME );
@LogMessage( level = WARN )
@Message(

View File

@ -14,6 +14,8 @@ import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
/**
* Dedicated logger for rendering a SQL AST
*
@ -31,6 +33,6 @@ public interface SqlAstTreeLogger extends BasicLogger {
/**
* Static access to the logging instance
*/
SqlAstTreeLogger INSTANCE = Logger.getMessageLogger( SqlAstTreeLogger.class, LOGGER_NAME );
SqlAstTreeLogger INSTANCE = Logger.getMessageLogger( MethodHandles.lookup(), SqlAstTreeLogger.class, LOGGER_NAME );
}

View File

@ -13,6 +13,8 @@ import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
/**
* @author Steve Ebersole
*/
@ -25,5 +27,5 @@ import org.jboss.logging.annotations.ValidIdRange;
public interface SqlExecLogger extends BasicLogger {
String LOGGER_NAME = SubSystemLogging.BASE + ".sql.exec";
SqlExecLogger SQL_EXEC_LOGGER = Logger.getMessageLogger( SqlExecLogger.class, LOGGER_NAME );
SqlExecLogger SQL_EXEC_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), SqlExecLogger.class, LOGGER_NAME );
}

View File

@ -13,6 +13,8 @@ import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
/**
* @author Steve Ebersole
*/
@ -26,7 +28,7 @@ public interface LoadingLogger extends BasicLogger {
String LOGGER_NAME = ResultsLogger.LOGGER_NAME + ".loading";
Logger LOGGER = Logger.getLogger( LOGGER_NAME );
LoadingLogger MESSAGE_LOGGER = Logger.getMessageLogger( LoadingLogger.class, LOGGER_NAME );
LoadingLogger MESSAGE_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), LoadingLogger.class, LOGGER_NAME );
static String subLoggerName(String subName) {
return LOGGER_NAME + "." + subName;

View File

@ -13,6 +13,8 @@ import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import java.lang.invoke.MethodHandles;
/**
* @asciidoc
*
@ -34,7 +36,7 @@ public interface ResultsLogger extends BasicLogger {
String LOGGER_NAME = SubSystemLogging.BASE + ".results";
Logger RESULTS_LOGGER = Logger.getLogger( LOGGER_NAME );
ResultsLogger RESULTS_MESSAGE_LOGGER = Logger.getMessageLogger( ResultsLogger.class, LOGGER_NAME );
ResultsLogger RESULTS_MESSAGE_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), ResultsLogger.class, LOGGER_NAME );
// todo (6.0) : make sure sql result processing classes use this logger

View File

@ -21,13 +21,15 @@ import org.jboss.logging.Logger;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.lang.invoke.MethodHandles;
import static org.hibernate.cfg.StatisticsSettings.STATS_BUILDER;
/**
* @author Steve Ebersole
*/
public class StatisticsInitiator implements SessionFactoryServiceInitiator<StatisticsImplementor> {
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, StatisticsInitiator.class.getName() );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, StatisticsInitiator.class.getName() );
public static final StatisticsInitiator INSTANCE = new StatisticsInitiator();

View File

@ -7,6 +7,7 @@
package org.hibernate.type;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
@ -59,7 +60,7 @@ import static org.hibernate.proxy.HibernateProxy.extractLazyInitializer;
*/
public abstract class CollectionType extends AbstractType implements AssociationType {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, CollectionType.class.getName());
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, CollectionType.class.getName() );
@Internal
public static final Object UNFETCHED_COLLECTION = new MarkerObject( "UNFETCHED COLLECTION" );

View File

@ -11,6 +11,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.StringReader;
import java.lang.invoke.MethodHandles;
import java.sql.Clob;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
@ -34,7 +35,7 @@ public final class DataHelper {
/** The size of the buffer we will use to deserialize larger streams */
private static final int BUFFER_SIZE = 1024 * 4;
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, DataHelper.class.getName() );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, DataHelper.class.getName() );
public static boolean isNClob(final Class type) {
return java.sql.NClob.class.isAssignableFrom( type );

View File

@ -17,6 +17,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.StringReader;
import java.lang.invoke.MethodHandles;
import java.sql.Clob;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
@ -33,7 +34,7 @@ public final class LobStreamDataHelper {
/** The size of the buffer we will use to deserialize larger streams */
private static final int BUFFER_SIZE = 1024 * 4;
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, LobStreamDataHelper.class.getName() );
private static final CoreMessageLogger LOG = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, LobStreamDataHelper.class.getName() );
public static boolean isNClob(final Class type) {
return java.sql.NClob.class.isAssignableFrom( type );

View File

@ -7,6 +7,7 @@
package org.hibernate.orm.test.annotations.formula;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.util.List;
import org.hibernate.annotations.JoinColumnOrFormula;
@ -44,7 +45,7 @@ public class JoinFormulaManyToOneNotIgnoreLazyFetchingTest extends BaseEntityMan
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger( CoreMessageLogger.class, ToOneBinder.class.getName() )
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, ToOneBinder.class.getName() )
);
private final Triggerable triggerable = logInspection.watchForLogMessages( "HHH000491" );

View File

@ -7,6 +7,7 @@
package org.hibernate.orm.test.annotations.formula;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.util.List;
import org.hibernate.annotations.JoinColumnOrFormula;
@ -44,7 +45,7 @@ public class JoinFormulaOneToOneNotIgnoreLazyFetchingTest extends BaseEntityMana
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger( CoreMessageLogger.class, ToOneBinder.class.getName() )
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, ToOneBinder.class.getName() )
);
private final Triggerable triggerable = logInspection.watchForLogMessages( "HHH000491" );

View File

@ -7,6 +7,7 @@
package org.hibernate.orm.test.annotations.formula;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.List;
@ -46,7 +47,7 @@ public class ManyToManyNotIgnoreLazyFetchingTest extends BaseEntityManagerFuncti
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger( CoreMessageLogger.class, AnnotationBinder.class.getName() )
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, AnnotationBinder.class.getName() )
);
private Triggerable triggerable = logInspection.watchForLogMessages( "HHH000491" );

View File

@ -18,9 +18,10 @@ import org.junit.Test;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
/**
* @author Vlad Mihalcea
@ -30,7 +31,7 @@ public class ImmutableEntityUpdateQueryHandlingModeWarningTest extends BaseNonCo
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger( CoreMessageLogger.class, SqmUpdateStatement.class.getName() ) );
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, SqmUpdateStatement.class.getName() ) );
@Override
protected Class[] getAnnotatedClasses() {

View File

@ -24,6 +24,8 @@ import org.jboss.logging.Logger;
import org.junit.Rule;
import org.junit.jupiter.api.Test;
import java.lang.invoke.MethodHandles;
import static org.junit.jupiter.api.Assertions.fail;
@ -35,7 +37,7 @@ public class EntityInheritanceAttributeOverrideTest extends EntityManagerFactory
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger( CoreMessageLogger.class, EntityBinder.class.getName() ) );
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, EntityBinder.class.getName() ) );
@Override
public Class<?>[] getAnnotatedClasses() {

View File

@ -26,6 +26,8 @@ import org.jboss.logging.Logger;
import jakarta.persistence.PersistenceException;
import java.lang.invoke.MethodHandles;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
@ -48,7 +50,7 @@ public class UniqueConstraintBatchingTest {
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger( CoreMessageLogger.class, SqlExceptionHelper.class.getName() ) );
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, SqlExceptionHelper.class.getName() ) );
private Triggerable triggerable;

View File

@ -20,6 +20,8 @@ import org.junit.Test;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@ -34,6 +36,7 @@ public class OrmVersion1SupportedTest extends BaseCoreFunctionalTestCase {
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
"org.hibernate.internal.util.xml.ErrorLogger"
)

View File

@ -10,6 +10,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.dialect.SimpleDatabaseVersion.ZERO_VERSION;
import static org.junit.jupiter.api.Assertions.fail;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Field;
import java.util.stream.Stream;
@ -60,7 +61,7 @@ public class MetadataAccessTests {
@RegisterExtension
public LoggerInspectionExtension logger = LoggerInspectionExtension
.builder().setLogger(
Logger.getMessageLogger( CoreMessageLogger.class, Dialect.class.getName() )
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, Dialect.class.getName() )
).build();
@BeforeEach

View File

@ -30,6 +30,8 @@ import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.lang.invoke.MethodHandles;
import static org.assertj.core.api.Assertions.assertThat;
/**
@ -42,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class NoProxyFactoryTests extends BaseNonConfigCoreFunctionalTestCase {
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger( CoreMessageLogger.class, EntityRepresentationStrategyPojoStandard.class.getName() )
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, EntityRepresentationStrategyPojoStandard.class.getName() )
);
/**

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.orm.test.cache;
import java.lang.invoke.MethodHandles;
import java.util.HashMap;
import java.util.Map;
@ -44,7 +45,7 @@ public class NonRootEntityWithCacheAnnotationTest {
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger( CoreMessageLogger.class, EntityBinder.class.getName() )
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, EntityBinder.class.getName() )
);
@Test

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.orm.test.cache;
import java.lang.invoke.MethodHandles;
import java.util.HashMap;
import java.util.Map;
@ -45,7 +46,7 @@ public class NonRootEntityWithCacheableAnnotationTest {
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger( CoreMessageLogger.class, EntityBinder.class.getName() )
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, EntityBinder.class.getName() )
);
@Test

View File

@ -21,6 +21,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
/**
* @author Jan Schatteman
*/
@ -31,7 +33,7 @@ public class DialectMinimumVersionTest {
@RegisterExtension
public LoggerInspectionExtension logger = LoggerInspectionExtension
.builder().setLogger(
Logger.getMessageLogger( CoreMessageLogger.class, Dialect.class.getName() )
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, Dialect.class.getName() )
).build();
@BeforeEach

View File

@ -21,6 +21,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@ -34,7 +36,7 @@ public class CockroachDialectVersionTest {
@RegisterExtension
public LoggerInspectionExtension logger = LoggerInspectionExtension
.builder().setLogger(
Logger.getMessageLogger( CoreMessageLogger.class, CockroachDialect.class.getName() )
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, CockroachDialect.class.getName() )
).build();
@BeforeEach

View File

@ -7,6 +7,7 @@
package org.hibernate.orm.test.id.hhh12973;
import java.io.StringReader;
import java.lang.invoke.MethodHandles;
import java.sql.Statement;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
@ -53,6 +54,7 @@ public class PostgreSQLSequenceGeneratorWithSerialTest extends EntityManagerFact
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
SequenceStyleGenerator.class.getName()
) );

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.orm.test.id.hhh12973;
import java.lang.invoke.MethodHandles;
import java.util.EnumSet;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
@ -53,6 +54,7 @@ public class SequenceMismatchStrategyFixWithSequenceGeneratorTest extends Entity
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
SequenceStyleGenerator.class.getName()
)

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.orm.test.id.hhh12973;
import java.lang.invoke.MethodHandles;
import java.util.EnumSet;
import java.util.Map;
import jakarta.persistence.Entity;
@ -51,6 +52,7 @@ public class SequenceMismatchStrategyLogTest extends EntityManagerFactoryBasedFu
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
SequenceStyleGenerator.class.getName()
)

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.orm.test.id.hhh12973;
import java.lang.invoke.MethodHandles;
import java.util.EnumSet;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
@ -52,6 +53,7 @@ public class SequenceMismatchStrategyWithoutSequenceGeneratorTest extends Entity
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
SequenceStyleGenerator.class.getName()
)

View File

@ -35,6 +35,8 @@ import org.junit.jupiter.api.Test;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@ -46,7 +48,7 @@ public class NegativeValueSequenceTest {
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger( CoreMessageLogger.class, SequenceStyleGenerator.class.getName() )
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, SequenceStyleGenerator.class.getName() )
);
@Test

View File

@ -34,6 +34,8 @@ import org.junit.jupiter.api.Test;
import org.jboss.logging.Logger;
import java.lang.invoke.MethodHandles;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@ -46,9 +48,9 @@ public class PrivateConstructorTest {
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule( Logger.getMessageLogger(
MethodHandles.lookup(),
CoreMessageLogger.class,
proxyFactoryClass()
.getName()
proxyFactoryClass().getName()
) );
@AfterEach

View File

@ -7,6 +7,7 @@
package org.hibernate.orm.test.jpa.persistenceunit;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
@ -44,7 +45,7 @@ public class DuplicatePersistenceUnitNameTest extends BaseUnitTestCase {
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger( CoreMessageLogger.class, PersistenceXmlParser.class.getName() )
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, PersistenceXmlParser.class.getName() )
);
@Before

View File

@ -10,6 +10,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.internal.util.ConfigHelper.findAsResource;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
@ -39,7 +40,7 @@ public class PersistenceXmlParserTest {
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(
Logger.getMessageLogger( CoreMessageLogger.class, PersistenceXmlParser.class.getName() )
Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, PersistenceXmlParser.class.getName() )
);
@Test

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