Skip to content

Commit

Permalink
HSEARCH-5144 Upgrade to JBoss logging 3.6.0.Final
Browse files Browse the repository at this point in the history
  • Loading branch information
marko-bekhta committed May 8, 2024
1 parent d35863f commit 6fc9ef8
Show file tree
Hide file tree
Showing 28 changed files with 72 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public class ElasticsearchClientImpl implements ElasticsearchClientImplementor {

private static final Log log = LoggerFactory.make( Log.class, MethodHandles.lookup() );

private static final Log requestLog = LoggerFactory.make( Log.class, ElasticsearchLogCategories.REQUEST );
private static final Log requestLog =
LoggerFactory.make( Log.class, ElasticsearchLogCategories.REQUEST, MethodHandles.lookup() );

private final BeanHolder<? extends RestClient> restClientHolder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.hibernate.search.util.common.logging.impl.LoggerFactory;

/**
* Log categories to be used with {@link LoggerFactory#make(Class, LogCategory)}.
* Log categories to be used with {@link LoggerFactory#make(Class, LogCategory, java.lang.invoke.MethodHandles.Lookup)}.
*
*/
public final class ElasticsearchLogCategories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.backend.elasticsearch.reporting.impl;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.util.common.logging.impl.MessageConstants;

import org.jboss.logging.Messages;
Expand All @@ -18,7 +20,8 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface ElasticsearchEventContextMessages {

ElasticsearchEventContextMessages INSTANCE = Messages.getBundle( ElasticsearchEventContextMessages.class );
ElasticsearchEventContextMessages INSTANCE =
Messages.getBundle( MethodHandles.lookup(), ElasticsearchEventContextMessages.class );

@Message(value = "attribute '%1$s'")
String mappingAttribute(String name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.backend.elasticsearch.reporting.impl;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.engine.backend.reporting.spi.BackendSearchHints;
import org.hibernate.search.util.common.logging.impl.MessageConstants;

Expand All @@ -16,7 +18,7 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface ElasticsearchSearchHints extends BackendSearchHints {

ElasticsearchSearchHints INSTANCE = Messages.getBundle( ElasticsearchSearchHints.class );
ElasticsearchSearchHints INSTANCE = Messages.getBundle( MethodHandles.lookup(), ElasticsearchSearchHints.class );

@Message(
value = "A JSON hit projection represents a root hit object and adding it as a part of the nested object projection might produce misleading results.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
package org.hibernate.search.backend.elasticsearch.reporting.impl;

import java.lang.invoke.MethodHandles;
import java.util.List;

import org.jboss.logging.Messages;
Expand All @@ -19,7 +20,8 @@
@MessageBundle(projectCode = "HSEARCH")
public interface ElasticsearchValidationMessages {

ElasticsearchValidationMessages INSTANCE = Messages.getBundle( ElasticsearchValidationMessages.class );
ElasticsearchValidationMessages INSTANCE =
Messages.getBundle( MethodHandles.lookup(), ElasticsearchValidationMessages.class );

@Message(
value = "Validation of the existing index in the Elasticsearch cluster failed. See below for details."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
package org.hibernate.search.backend.elasticsearch.work.impl;

import java.lang.invoke.MethodHandles;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
Expand All @@ -23,7 +24,7 @@

public class SearchWork<R> extends AbstractNonBulkableWork<R> {

private static final Log queryLog = LoggerFactory.make( Log.class, DefaultLogCategories.QUERY );
private static final Log queryLog = LoggerFactory.make( Log.class, DefaultLogCategories.QUERY, MethodHandles.lookup() );

private final ElasticsearchSearchResultExtractor<R> resultExtractor;
private final Deadline deadline;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.hibernate.search.util.common.logging.impl.LoggerFactory;

/**
* Log categories to be used with {@link LoggerFactory#make(Class, LogCategory)}.
* Log categories to be used with {@link LoggerFactory#make(Class, LogCategory, java.lang.invoke.MethodHandles.Lookup)}.
*
* @author Gunnar Morling
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.backend.lucene.lowlevel.writer.impl;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.backend.lucene.logging.impl.Log;
import org.hibernate.search.backend.lucene.logging.impl.LuceneLogCategories;
import org.hibernate.search.util.common.logging.impl.LoggerFactory;
Expand All @@ -18,7 +20,8 @@
*/
public class LoggerInfoStream extends InfoStream {

private static final Log log = LoggerFactory.make( Log.class, LuceneLogCategories.INFOSTREAM_LOGGER_CATEGORY );
private static final Log log =
LoggerFactory.make( Log.class, LuceneLogCategories.INFOSTREAM_LOGGER_CATEGORY, MethodHandles.lookup() );

@Override
public void message(String component, String message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.backend.lucene.reporting.impl;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.engine.backend.reporting.spi.BackendSearchHints;
import org.hibernate.search.util.common.logging.impl.MessageConstants;

Expand All @@ -16,7 +18,7 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface LuceneSearchHints extends BackendSearchHints {

LuceneSearchHints INSTANCE = Messages.getBundle( LuceneSearchHints.class );
LuceneSearchHints INSTANCE = Messages.getBundle( MethodHandles.lookup(), LuceneSearchHints.class );

@Message("A document projection represents a root document and adding it as a part of the nested object projection might produce misleading results.")
String documentProjectionNestingNotSupportedHint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LuceneSearcherImpl<H> implements LuceneSearcher<LuceneLoadableSearchResult
private static final int PREFETCH_TOTAL_HIT_COUNT_THRESHOLD = 10_000;

private static final Log log = LoggerFactory.make( Log.class, MethodHandles.lookup() );
private static final Log queryLog = LoggerFactory.make( Log.class, DefaultLogCategories.QUERY );
private static final Log queryLog = LoggerFactory.make( Log.class, DefaultLogCategories.QUERY, MethodHandles.lookup() );

private final LuceneSearchQueryRequestContext requestContext;

Expand Down
2 changes: 1 addition & 1 deletion build/parents/build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<!-- Main dependencies -->

<!-- >>> Common -->
<version.org.jboss.logging.jboss-logging>3.5.3.Final</version.org.jboss.logging.jboss-logging>
<version.org.jboss.logging.jboss-logging>3.6.0.Final</version.org.jboss.logging.jboss-logging>
<!--Once the tools version is upgraded see if org.codehaus.plexus can be upgraded as well and update the dependabot config accordingly. -->
<version.org.jboss.logging.jboss-logging-tools>2.2.1.Final</version.org.jboss.logging.jboss-logging-tools>
<javadoc.org.hibernate.search.url>https://docs.jboss.org/hibernate/search/${parsed-version.org.hibernate.search.majorVersion}.${parsed-version.org.hibernate.search.minorVersion}/api/</javadoc.org.hibernate.search.url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.engine.backend.reporting.spi;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.util.common.logging.impl.MessageConstants;

import org.jboss.logging.Messages;
Expand All @@ -15,7 +17,7 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface BackendMappingHints {

BackendMappingHints NONE = Messages.getBundle( BackendMappingHints.class );
BackendMappingHints NONE = Messages.getBundle( MethodHandles.lookup(), BackendMappingHints.class );

@Message(value = "")
String noEntityProjectionAvailable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.engine.backend.reporting.spi;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.util.common.logging.impl.MessageConstants;

import org.jboss.logging.Messages;
Expand All @@ -15,7 +17,7 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface BackendSearchHints {

BackendSearchHints NONE = Messages.getBundle( BackendSearchHints.class );
BackendSearchHints NONE = Messages.getBundle( MethodHandles.lookup(), BackendSearchHints.class );

@Message("An ID projection represents the document ID and adding it as a part of the nested object projection might produce misleading results "
+ "since it is always a root document ID and not a nested object ID.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
package org.hibernate.search.engine.reporting.impl;

import java.lang.invoke.MethodHandles;
import java.util.List;
import java.util.Set;

Expand All @@ -21,7 +22,7 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface EngineEventContextMessages {

EngineEventContextMessages INSTANCE = Messages.getBundle( EngineEventContextMessages.class );
EngineEventContextMessages INSTANCE = Messages.getBundle( MethodHandles.lookup(), EngineEventContextMessages.class );

@Message(value = "bootstrap")
String bootstrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.mapper.orm.reporting.impl;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.util.common.logging.impl.MessageConstants;

import org.jboss.logging.Messages;
Expand All @@ -18,7 +20,8 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface HibernateOrmEventContextMessages {

HibernateOrmEventContextMessages INSTANCE = Messages.getBundle( HibernateOrmEventContextMessages.class );
HibernateOrmEventContextMessages INSTANCE =
Messages.getBundle( MethodHandles.lookup(), HibernateOrmEventContextMessages.class );

@Message(value = "Hibernate ORM mapping")
String mapping();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.mapper.orm.reporting.impl;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.mapper.orm.cfg.HibernateOrmMapperSettings;
import org.hibernate.search.mapper.pojo.reporting.spi.MapperHints;
import org.hibernate.search.util.common.logging.impl.MessageConstants;
Expand All @@ -17,7 +19,7 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface HibernateOrmMapperHints extends MapperHints {

HibernateOrmMapperHints INSTANCE = Messages.getBundle( HibernateOrmMapperHints.class );
HibernateOrmMapperHints INSTANCE = Messages.getBundle( MethodHandles.lookup(), HibernateOrmMapperHints.class );

@Message("Prebuild the missing Jandex indexes and make them available to Hibernate Search"
+ " or use a combination of configuration properties ("
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.mapper.orm.reporting.impl;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.engine.backend.reporting.spi.BackendMappingHints;
import org.hibernate.search.util.common.logging.impl.MessageConstants;

Expand All @@ -16,7 +18,7 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface HibernateOrmMappingHints extends BackendMappingHints {

HibernateOrmMappingHints INSTANCE = Messages.getBundle( HibernateOrmMappingHints.class );
HibernateOrmMappingHints INSTANCE = Messages.getBundle( MethodHandles.lookup(), HibernateOrmMappingHints.class );

@Override
@Message(value = "This is likely a bug, as Hibernate ORM entities should always be loadable from the database.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.mapper.pojo.reporting.impl;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.util.common.logging.impl.MessageConstants;

import org.jboss.logging.Messages;
Expand All @@ -19,7 +21,7 @@
public interface PojoConstructorProjectionDefinitionMessages {

PojoConstructorProjectionDefinitionMessages INSTANCE = Messages.getBundle(
PojoConstructorProjectionDefinitionMessages.class
MethodHandles.lookup(), PojoConstructorProjectionDefinitionMessages.class
);

@Message(value = "Executed constructor path:")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.mapper.pojo.reporting.impl;

import java.lang.annotation.Annotation;
import java.lang.invoke.MethodHandles;

import org.hibernate.search.util.common.logging.impl.ClassFormatter;
import org.hibernate.search.util.common.logging.impl.CommaSeparatedClassesFormatter;
Expand All @@ -23,7 +24,7 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface PojoEventContextMessages {

PojoEventContextMessages INSTANCE = Messages.getBundle( PojoEventContextMessages.class );
PojoEventContextMessages INSTANCE = Messages.getBundle( MethodHandles.lookup(), PojoEventContextMessages.class );

@Message(value = "Schema management")
String schemaManagement();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.mapper.pojo.reporting.spi;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.util.common.logging.impl.MessageConstants;

import org.jboss.logging.Messages;
Expand All @@ -15,7 +17,7 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface MapperHints {

MapperHints NONE = Messages.getBundle( MapperHints.class );
MapperHints NONE = Messages.getBundle( MethodHandles.lookup(), MapperHints.class );

@Message("")
String cannotReadJandexRootMapping();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.mapper.pojo.standalone.reporting.impl;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.util.common.logging.impl.MessageConstants;

import org.jboss.logging.Messages;
Expand All @@ -18,7 +20,8 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface StandalonePojoEventContextMessages {

StandalonePojoEventContextMessages INSTANCE = Messages.getBundle( StandalonePojoEventContextMessages.class );
StandalonePojoEventContextMessages INSTANCE =
Messages.getBundle( MethodHandles.lookup(), StandalonePojoEventContextMessages.class );

@Message(value = "Standalone POJO mapping")
String mapping();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.mapper.pojo.standalone.reporting.impl;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.mapper.pojo.reporting.spi.MapperHints;
import org.hibernate.search.mapper.pojo.standalone.cfg.StandalonePojoMapperSettings;
import org.hibernate.search.util.common.logging.impl.MessageConstants;
Expand All @@ -17,7 +19,7 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface StandalonePojoMapperHints extends MapperHints {

StandalonePojoMapperHints INSTANCE = Messages.getBundle( StandalonePojoMapperHints.class );
StandalonePojoMapperHints INSTANCE = Messages.getBundle( MethodHandles.lookup(), StandalonePojoMapperHints.class );

@Message("Prebuild the missing Jandex indexes and make them available to Hibernate Search"
+ " or use a combination of configuration properties ("
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package org.hibernate.search.mapper.pojo.standalone.reporting.impl;

import java.lang.invoke.MethodHandles;

import org.hibernate.search.engine.backend.reporting.spi.BackendMappingHints;
import org.hibernate.search.util.common.logging.impl.MessageConstants;

Expand All @@ -16,7 +18,7 @@
@MessageBundle(projectCode = MessageConstants.PROJECT_CODE)
public interface StandalonePojoMappingHints extends BackendMappingHints {

StandalonePojoMappingHints INSTANCE = Messages.getBundle( StandalonePojoMappingHints.class );
StandalonePojoMappingHints INSTANCE = Messages.getBundle( MethodHandles.lookup(), StandalonePojoMappingHints.class );

@Message("To enable loading of entity instances from an external source, provide a SelectionLoadingStrategy"
+ " when registering the entity type to the mapping builder."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
package org.hibernate.search.util.common.logging.impl;

/**
* Log categories to be used with {@link LoggerFactory#make(Class, LogCategory)}.
* Log categories to be used with {@link LoggerFactory#make(Class, LogCategory, java.lang.invoke.MethodHandles.Lookup)}.
*
* @author Gunnar Morling
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


/**
* Log category to be used with {@link LoggerFactory#make(Class, LogCategory)}.
* Log category to be used with {@link LoggerFactory#make(Class, LogCategory, java.lang.invoke.MethodHandles.Lookup)}.
*
* @author Gunnar Morling
*/
Expand Down

0 comments on commit 6fc9ef8

Please sign in to comment.