diff --git a/backend/elasticsearch-aws/src/main/java/org/hibernate/search/backend/elasticsearch/aws/logging/impl/Log.java b/backend/elasticsearch-aws/src/main/java/org/hibernate/search/backend/elasticsearch/aws/logging/impl/Log.java index cdc08341012..f529ac5bec5 100644 --- a/backend/elasticsearch-aws/src/main/java/org/hibernate/search/backend/elasticsearch/aws/logging/impl/Log.java +++ b/backend/elasticsearch-aws/src/main/java/org/hibernate/search/backend/elasticsearch/aws/logging/impl/Log.java @@ -18,7 +18,8 @@ @MessageLogger(projectCode = MessageConstants.PROJECT_CODE) @ValidIdRanges({ - @ValidIdRange(min = MessageConstants.BACKEND_ES_AWS_ID_RANGE_MIN, max = MessageConstants.BACKEND_ES_AWS_ID_RANGE_MAX) + @ValidIdRange(min = MessageConstants.BACKEND_ES_AWS_ID_RANGE_MIN, + max = MessageConstants.BACKEND_ES_AWS_ID_RANGE_MAX) }) public interface Log extends BasicLogger { diff --git a/backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/logging/impl/Log.java b/backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/logging/impl/Log.java index ade1595edda..de02357ec6f 100644 --- a/backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/logging/impl/Log.java +++ b/backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/logging/impl/Log.java @@ -53,26 +53,16 @@ @MessageLogger(projectCode = MessageConstants.PROJECT_CODE) @ValidIdRanges({ @ValidIdRange(min = MessageConstants.BACKEND_ES_ID_RANGE_MIN, max = MessageConstants.BACKEND_ES_ID_RANGE_MAX), - // Exceptions for legacy messages from Search 5 (engine module) - // TODO HSEARCH-3308 add exceptions here for legacy messages from Search 5 (engine module). }) public interface Log extends BasicLogger { - // ----------------------------------- - // Pre-existing messages from Search 5 (engine module) - // DO NOT ADD ANY NEW MESSAGES HERE - // ----------------------------------- - int ID_OFFSET_1 = MessageConstants.ENGINE_ID_RANGE_MIN; - - // TODO HSEARCH-3308 migrate relevant messages from Search 5 (engine module) here - // ----------------------------------- // Pre-existing messages from Search 5 (ES module) // DO NOT ADD ANY NEW MESSAGES HERE // ----------------------------------- - int ID_OFFSET_2 = MessageConstants.BACKEND_ES_ID_RANGE_MIN; + int ID_OFFSET_LEGACY_ES = MessageConstants.BACKEND_ES_ID_RANGE_MIN; - @Message(id = ID_OFFSET_2 + 7, + @Message(id = ID_OFFSET_LEGACY_ES + 7, value = "Elasticsearch request failed: %3$s\nRequest: %1$s\nResponse: %2$s" ) SearchException elasticsearchRequestFailed( @@ -81,7 +71,7 @@ SearchException elasticsearchRequestFailed( String causeMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 8, + @Message(id = ID_OFFSET_LEGACY_ES + 8, // Note: no need to add a '\n' before "Response", since the formatter will always add one value = "Elasticsearch bulked request failed: %3$s\nRequest metadata: %1$sResponse: %2$s" ) @@ -91,111 +81,111 @@ SearchException elasticsearchBulkedRequestFailed( String causeMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 10, + @Message(id = ID_OFFSET_LEGACY_ES + 10, value = "Elasticsearch connection time-out; check the cluster status, it should be 'green'" ) SearchException elasticsearchRequestTimeout(); - @Message(id = ID_OFFSET_2 + 20, + @Message(id = ID_OFFSET_LEGACY_ES + 20, value = "Could not create mapping for index '%1$s': %2$s" ) SearchException elasticsearchMappingCreationFailed(String indexName, String causeMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 22, value = "Invalid index status: '%1$s'." + @Message(id = ID_OFFSET_LEGACY_ES + 22, value = "Invalid index status: '%1$s'." + " Valid statuses are: %2$s.") SearchException invalidIndexStatus(String invalidRepresentation, List validRepresentations); - @Message(id = ID_OFFSET_2 + 24, value = "Index '%1$s' failed to reach status '%2$s' after %3$sms.") + @Message(id = ID_OFFSET_LEGACY_ES + 24, value = "Index '%1$s' failed to reach status '%2$s' after %3$sms.") SearchException unexpectedIndexStatus(URLEncodedString indexName, String expected, int requiredStatusTimeoutInMs, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 34, + @Message(id = ID_OFFSET_LEGACY_ES + 34, value = "Could not retrieve the index metadata from Elasticsearch" ) SearchException elasticsearchIndexMetadataRetrievalFailed(@Cause Throwable cause); - @Message(id = ID_OFFSET_2 + 35, + @Message(id = ID_OFFSET_LEGACY_ES + 35, value = "Could not update mappings in index '%1$s': %2$s" ) SearchException schemaUpdateFailed(URLEncodedString indexName, String causeMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 50, + @Message(id = ID_OFFSET_LEGACY_ES + 50, value = "Index aliases [%1$s, %2$s] do not point to any index in the Elasticsearch cluster." ) SearchException indexMissing(URLEncodedString write, URLEncodedString read); @LogMessage(level = Level.DEBUG) - @Message(id = ID_OFFSET_2 + 53, + @Message(id = ID_OFFSET_LEGACY_ES + 53, value = "Executing Elasticsearch query on '%s' with parameters '%s': <%s>" ) void executingElasticsearchQuery(String path, Map parameters, String bodyParts); - @Message(id = ID_OFFSET_2 + 55, + @Message(id = ID_OFFSET_LEGACY_ES + 55, value = "Multiple tokenizer definitions with the same name: '%1$s'. The tokenizer names must be unique.") SearchException tokenizerNamingConflict(String remoteName); - @Message(id = ID_OFFSET_2 + 56, + @Message(id = ID_OFFSET_LEGACY_ES + 56, value = "Multiple char filter definitions with the same name: '%1$s'. The char filter names must be unique.") SearchException charFilterNamingConflict(String remoteName); - @Message(id = ID_OFFSET_2 + 57, + @Message(id = ID_OFFSET_LEGACY_ES + 57, value = "Multiple token filter definitions with the same name: '%1$s'. The token filter names must be unique.") SearchException tokenFilterNamingConflict(String remoteName); - @Message(id = ID_OFFSET_2 + 67, + @Message(id = ID_OFFSET_LEGACY_ES + 67, value = "Could not update settings for index '%1$s'" ) SearchException elasticsearchSettingsUpdateFailed(Object indexName, @Cause Exception e); @LogMessage(level = Level.INFO) - @Message(id = ID_OFFSET_2 + 69, + @Message(id = ID_OFFSET_LEGACY_ES + 69, value = "Closed Elasticsearch index '%1$s' automatically." ) void closedIndex(Object indexName); @LogMessage(level = Level.INFO) - @Message(id = ID_OFFSET_2 + 70, + @Message(id = ID_OFFSET_LEGACY_ES + 70, value = "Opened Elasticsearch index '%1$s' automatically." ) void openedIndex(Object indexName); @LogMessage(level = Level.WARN) - @Message(id = ID_OFFSET_2 + 73, + @Message(id = ID_OFFSET_LEGACY_ES + 73, value = "Hibernate Search will connect to Elasticsearch with authentication over plain HTTP (not HTTPS)." + " The password will be sent in clear text over the network." ) void usingPasswordOverHttp(); - @Message(id = ID_OFFSET_2 + 75, + @Message(id = ID_OFFSET_LEGACY_ES + 75, value = "Error while applying analysis configuration: %1$s") SearchException unableToApplyAnalysisConfiguration(String errorMessage, @Cause Exception e, @Param EventContext eventContext); - @Message(id = ID_OFFSET_2 + 76, + @Message(id = ID_OFFSET_LEGACY_ES + 76, value = "Invalid analyzer definition for name '%1$s'. Analyzer definitions must at least define the tokenizer.") SearchException invalidElasticsearchAnalyzerDefinition(String name); - @Message(id = ID_OFFSET_2 + 77, + @Message(id = ID_OFFSET_LEGACY_ES + 77, value = "Invalid tokenizer definition for name '%1$s'. Tokenizer definitions must at least define the tokenizer type.") SearchException invalidElasticsearchTokenizerDefinition(String name); - @Message(id = ID_OFFSET_2 + 78, + @Message(id = ID_OFFSET_LEGACY_ES + 78, value = "Invalid char filter definition for name '%1$s'. Char filter definitions must at least define the char filter type.") SearchException invalidElasticsearchCharFilterDefinition(String name); - @Message(id = ID_OFFSET_2 + 79, + @Message(id = ID_OFFSET_LEGACY_ES + 79, value = "Invalid token filter definition for name '%1$s'. Token filter definitions must at least define the token filter type.") SearchException invalidElasticsearchTokenFilterDefinition(String name); - @Message(id = ID_OFFSET_2 + 80, + @Message(id = ID_OFFSET_LEGACY_ES + 80, value = "Failed to detect the Elasticsearch version running on the cluster: %s" ) SearchException failedToDetectElasticsearchVersion(String causeMessage, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 81, + @Message(id = ID_OFFSET_LEGACY_ES + 81, value = "An unsupported Elasticsearch version runs on the Elasticsearch cluster: '%s'." + " Please refer to the documentation to know which versions are supported." ) SearchException unsupportedElasticsearchVersion(ElasticsearchVersion version); @LogMessage(level = Level.DEBUG) - @Message(id = ID_OFFSET_2 + 82, + @Message(id = ID_OFFSET_LEGACY_ES + 82, value = "Executed Elasticsearch HTTP %s request to path '%s' with query parameters %s and %d objects in payload in %dms." + " Response had status %d '%s'." ) @@ -203,20 +193,20 @@ void executedRequest(String method, String path, Map getParamete int responseStatusCode, String responseStatusMessage); @LogMessage(level = Level.WARN) - @Message(id = ID_OFFSET_2 + 85, + @Message(id = ID_OFFSET_LEGACY_ES + 85, value = "Hibernate Search may not work correctly, because an unknown Elasticsearch version runs on the Elasticsearch cluster: '%s'." ) void unknownElasticsearchVersion(ElasticsearchVersion version); - @Message(id = ID_OFFSET_2 + 89, + @Message(id = ID_OFFSET_LEGACY_ES + 89, value = "Failed to parse Elasticsearch response. Status code was '%1$d', status phrase was '%2$s'.") SearchException failedToParseElasticsearchResponse(int statusCode, String statusPhrase, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 90, + @Message(id = ID_OFFSET_LEGACY_ES + 90, value = "Elasticsearch response indicates a failure." ) SearchException elasticsearchResponseIndicatesFailure(); @LogMessage(level = Level.TRACE) - @Message(id = ID_OFFSET_2 + 93, + @Message(id = ID_OFFSET_LEGACY_ES + 93, value = "Executed Elasticsearch HTTP %s request to path '%s' with query parameters %s and %d objects in payload in %dms." + " Response had status %d '%s'. Request body: <%s>. Response body: <%s>" ) @@ -224,77 +214,75 @@ void executedRequest(String method, String path, Map getParamete int responseStatusCode, String responseStatusMessage, String requestBodyParts, String responseBody); - // TODO HSEARCH-3308 migrate relevant messages from Search 5 (ES module) here - // ----------------------------------- // New messages from Search 6 onwards // ----------------------------------- - int ID_OFFSET_3 = MessageConstants.BACKEND_ES_ID_RANGE_MIN + 500; + int ID_OFFSET = MessageConstants.BACKEND_ES_ID_RANGE_MIN + 500; - @Message(id = ID_OFFSET_3 + 2, + @Message(id = ID_OFFSET + 2, value = "A multi-index scope cannot include both an Elasticsearch index and another type of index." + " Base scope was: '%1$s', Elasticsearch index was: '%2$s'") SearchException cannotMixElasticsearchScopeWithOtherType(IndexScopeBuilder baseScope, ElasticsearchIndexManager elasticsearchIndex, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 3, + @Message(id = ID_OFFSET + 3, value = "A multi-index scope cannot span multiple Elasticsearch backends." + " Base scope was: '%1$s', index from another backend was: '%2$s'") SearchException cannotMixElasticsearchScopeWithOtherBackend(IndexScopeBuilder baseScope, ElasticsearchIndexManager indexFromOtherBackend, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 4, + @Message(id = ID_OFFSET + 4, value = "Unknown field '%1$s'.") SearchException unknownFieldForSearch(String absoluteFieldPath, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 6, + @Message(id = ID_OFFSET + 6, value = "The Elasticsearch extension can only be applied to objects" + " derived from the Elasticsearch backend. Was applied to '%1$s' instead.") SearchException elasticsearchExtensionOnUnknownType(Object context); - @Message(id = ID_OFFSET_3 + 8, + @Message(id = ID_OFFSET + 8, value = "An Elasticsearch query cannot include search predicates built using a non-Elasticsearch search scope." + " Given predicate was: '%1$s'") SearchException cannotMixElasticsearchSearchQueryWithOtherPredicates(SearchPredicate predicate); - @Message(id = ID_OFFSET_3 + 10, + @Message(id = ID_OFFSET + 10, value = "Object field '%1$s' is flattened: its structure was lost upon indexing and 'nested' features are not available.") SearchException nonNestedFieldForNestedQuery(String absoluteFieldPath, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 11, + @Message(id = ID_OFFSET + 11, value = "An Elasticsearch query cannot include search sorts built using a non-Elasticsearch search scope." + " Given sort was: '%1$s'") SearchException cannotMixElasticsearchSearchSortWithOtherSorts(SearchSort sort); - @Message(id = ID_OFFSET_3 + 14, + @Message(id = ID_OFFSET + 14, value = "Index '%1$s' requires multi-tenancy but the backend does not support it in its current configuration.") SearchException multiTenancyRequiredButNotSupportedByBackend(String indexName, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 15, value = "Invalid multi-tenancy strategy name: '%1$s'." + @Message(id = ID_OFFSET + 15, value = "Invalid multi-tenancy strategy name: '%1$s'." + " Valid names are: %2$s.") SearchException invalidMultiTenancyStrategyName(String invalidRepresentation, List validRepresentations); - @Message(id = ID_OFFSET_3 + 16, + @Message(id = ID_OFFSET + 16, value = "Tenant identifier '%1$s' is provided, but multi-tenancy is disabled for this backend.") SearchException tenantIdProvidedButMultiTenancyDisabled(String tenantId, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 17, + @Message(id = ID_OFFSET + 17, value = "Backend has multi-tenancy enabled, but no tenant identifier is provided.") SearchException multiTenancyEnabledButNoTenantIdProvided(@Param EventContext context); - @Message(id = ID_OFFSET_3 + 18, + @Message(id = ID_OFFSET + 18, value = "Attempt to unwrap the Elasticsearch low-level client to %1$s," + " but the client can only be unwrapped to %2$s.") SearchException clientUnwrappingWithUnkownType(Class requestedClass, Class actualClass); - @Message(id = ID_OFFSET_3 + 19, + @Message(id = ID_OFFSET + 19, value = "Attempt to unwrap an Elasticsearch backend to '%1$s'," + " but this backend can only be unwrapped to '%2$s'.") SearchException backendUnwrappingWithUnknownType(@FormatWith(ClassFormatter.class) Class requestedClass, @FormatWith(ClassFormatter.class) Class actualClass, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 20, + @Message(id = ID_OFFSET + 20, value = "The index schema node '%1$s' was added twice." + " Multiple bridges may be trying to access the same index field, " + " or two indexed-embeddeds may have prefixes that lead to conflicting field names," @@ -303,273 +291,273 @@ SearchException backendUnwrappingWithUnknownType(@FormatWith(ClassFormatter.clas SearchException indexSchemaNodeNameConflict(String name, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 25, + @Message(id = ID_OFFSET + 25, value = "Invalid field reference for this document element: this document element has path '%1$s', but the referenced field has a parent with path '%2$s'.") SearchException invalidFieldForDocumentElement(String expectedPath, String actualPath); - @Message(id = ID_OFFSET_3 + 26, + @Message(id = ID_OFFSET + 26, value = "Expected data was missing in the Elasticsearch response.") AssertionFailure elasticsearchResponseMissingData(); - @Message(id = ID_OFFSET_3 + 29, + @Message(id = ID_OFFSET + 29, value = "Multiple conflicting minimumShouldMatch constraints for ceiling '%1$s'") SearchException minimumShouldMatchConflictingConstraints(int ceiling); - @Message(id = ID_OFFSET_3 + 30, + @Message(id = ID_OFFSET + 30, value = "Conflicting index names: Hibernate Search indexes '%1$s' and '%2$s' both target the name or alias '%3$s'") SearchException conflictingIndexNames(String firstHibernateSearchIndexName, String secondHibernateSearchIndexName, String nameOrAlias); - @Message(id = ID_OFFSET_3 + 31, + @Message(id = ID_OFFSET + 31, value = "Could not resolve index name '%1$s' to an entity type: %2$s") SearchException elasticsearchResponseUnknownIndexName(String elasticsearchIndexName, String causeMessage, @Cause Exception e); - @Message(id = ID_OFFSET_3 + 32, + @Message(id = ID_OFFSET + 32, value = "Unable to convert DSL parameter: %1$s") SearchException cannotConvertDslParameter(String errorMessage, @Cause Exception cause, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 33, + @Message(id = ID_OFFSET + 33, value = "Attempt to unwrap an Elasticsearch index manager to '%1$s'," + " but this index manager can only be unwrapped to '%2$s'.") SearchException indexManagerUnwrappingWithUnknownType(@FormatWith(ClassFormatter.class) Class requestedClass, @FormatWith(ClassFormatter.class) Class actualClass, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 34, + @Message(id = ID_OFFSET + 34, value = "Invalid typed analyzer definition for name '%1$s'. Typed analyzer definitions must at least define the analyzer type.") SearchException invalidElasticsearchTypedAnalyzerDefinition(String name); - @Message(id = ID_OFFSET_3 + 35, + @Message(id = ID_OFFSET + 35, value = "Cannot apply both an analyzer and a normalizer. Analyzer: '%1$s', normalizer: '%2$s'.") SearchException cannotApplyAnalyzerAndNormalizer(String analyzerName, String normalizerName, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 36, + @Message(id = ID_OFFSET + 36, value = "Cannot apply an analyzer on a sortable field. Use a normalizer instead. Analyzer: '%1$s'." + " If an actual analyzer (with tokenization) is necessary, define two separate fields:" + " one with an analyzer that is not sortable, and one with a normalizer that is sortable.") SearchException cannotUseAnalyzerOnSortableField(String analyzerName, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 37, + @Message(id = ID_OFFSET + 37, value = "Multiple parameters with the same name: '%1$s'. Can't assign both value '%2$s' and '%3$s'" ) SearchException analysisComponentParameterConflict(String name, JsonElement value1, JsonElement value2); - @Message(id = ID_OFFSET_3 + 38, + @Message(id = ID_OFFSET + 38, value = "An Elasticsearch query cannot include search projections built using a non-Elasticsearch search scope." + " Given projection was: '%1$s'") SearchException cannotMixElasticsearchSearchQueryWithOtherProjections(SearchProjection projection); - @Message(id = ID_OFFSET_3 + 41, + @Message(id = ID_OFFSET + 41, value = "Inconsistent configuration for field '%1$s' in a search query across multiple indexes: %2$s") SearchException inconsistentConfigurationForFieldForSearch(String absoluteFieldPath, String causeMessage, @Param EventContext context, @Cause SearchException cause); - @Message(id = ID_OFFSET_3 + 44, value = "Failed to shut down the Elasticsearch backend.") + @Message(id = ID_OFFSET + 44, value = "Failed to shut down the Elasticsearch backend.") SearchException failedToShutdownBackend(@Cause Exception cause, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 45, value = "Cannot guess field type for input type %1$s.") + @Message(id = ID_OFFSET + 45, value = "Cannot guess field type for input type %1$s.") SearchException cannotGuessFieldType(@FormatWith(ClassFormatter.class) Class inputType, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 49, + @Message(id = ID_OFFSET + 49, value = "Inconsistent configuration for the identifier in a search query across multiple indexes: converter differs: '%1$s' vs. '%2$s'.") SearchException inconsistentConfigurationForIdentifierForSearch(ToDocumentIdentifierValueConverter component1, ToDocumentIdentifierValueConverter component2, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 50, value = "Failed to shut down the Elasticsearch index manager with name '%1$s'.") + @Message(id = ID_OFFSET + 50, value = "Failed to shut down the Elasticsearch index manager with name '%1$s'.") SearchException failedToShutdownIndexManager(String indexName, @Cause Exception cause, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 53, + @Message(id = ID_OFFSET + 53, value = "Full-text features (analysis, fuzziness) are not supported for fields of this type.") SearchException fullTextFeaturesNotSupportedByFieldType(@Param EventContext context); - @Message(id = ID_OFFSET_3 + 54, + @Message(id = ID_OFFSET + 54, value = "Incomplete field definition." + " You must call toReference() to complete the field definition.") SearchException incompleteFieldDefinition(@Param EventContext context); - @Message(id = ID_OFFSET_3 + 55, + @Message(id = ID_OFFSET + 55, value = "Multiple calls to toReference() for the same field definition." + " You must call toReference() exactly once.") SearchException cannotCreateReferenceMultipleTimes(@Param EventContext context); - @Message(id = ID_OFFSET_3 + 56, value = "Invalid Elasticsearch version: '%1$s'." + @Message(id = ID_OFFSET + 56, value = "Invalid Elasticsearch version: '%1$s'." + " The version must be in the form 'x.y.z-qualifier', where 'x', 'y' and 'z' are integers," + " and 'qualifier' is an string of word characters (alphanumeric or '_')." + " Incomplete versions are allowed, for example '7.0' or just '7'.") SearchException invalidElasticsearchVersion(String versionString); - @Message(id = ID_OFFSET_3 + 59, value = "Unexpected Elasticsearch version running on the cluster: '%2$s'." + @Message(id = ID_OFFSET + 59, value = "Unexpected Elasticsearch version running on the cluster: '%2$s'." + " Hibernate Search was configured for Elasticsearch '%1$s'.") SearchException unexpectedElasticsearchVersion(ElasticsearchVersion configuredVersion, ElasticsearchVersion actualVersion); - @Message(id = ID_OFFSET_3 + 60, value = "Cannot skip analysis on field '%1$s':" + @Message(id = ID_OFFSET + 60, value = "Cannot skip analysis on field '%1$s':" + " the Elasticsearch backend will always normalize arguments before attempting matches on normalized fields.") SearchException skipAnalysisOnNormalizedField(String absoluteFieldPath, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 61, + @Message(id = ID_OFFSET + 61, value = "Ambiguous Elasticsearch version: '%s'." + " This version matches multiple dialects." + " Please use a more precise version to remove the ambiguity." ) SearchException ambiguousElasticsearchVersion(ElasticsearchVersion version); - @Message(id = ID_OFFSET_3 + 62, value = "Index-null-as option is not supported on analyzed field. Trying to define the analyzer: '%1$s' together with index null as: '%2$s'.") + @Message(id = ID_OFFSET + 62, value = "Index-null-as option is not supported on analyzed field. Trying to define the analyzer: '%1$s' together with index null as: '%2$s'.") SearchException cannotUseIndexNullAsAndAnalyzer(String analyzerName, String indexNullAs, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 63, + @Message(id = ID_OFFSET + 63, value = "Multiple values were added to single-valued field '%1$s'." + " Declare the field as multi-valued in order to allow this." ) SearchException multipleValuesForSingleValuedField(String absolutePath); - @Message(id = ID_OFFSET_3 + 64, + @Message(id = ID_OFFSET + 64, value = "explain(Object id) cannot be used when the query targets multiple types." + " Use explain(String typeName, Object id) and pass one of %1$s as the type name." ) SearchException explainRequiresTypeName(Set targetedTypeNames); - @Message(id = ID_OFFSET_3 + 65, + @Message(id = ID_OFFSET + 65, value = "The given mapped type name '%2$s' is not among the mapped type targeted by this query: %1$s." ) SearchException explainRequiresTypeTargetedByQuery(Set targetedTypeNames, String typeName); - @Message(id = ID_OFFSET_3 + 66, + @Message(id = ID_OFFSET + 66, value = "Document with id '%1$s' does not exist in the targeted index and thus its match cannot be explained." ) SearchException explainUnknownDocument(URLEncodedString id); - @Message(id = ID_OFFSET_3 + 68, value = "Impossible to detect a decimal scale to use for this field." + @Message(id = ID_OFFSET + 68, value = "Impossible to detect a decimal scale to use for this field." + " If the value is bridged, set '.asBigDecimal().decimalScale( int )' in the bind, else verify your mapping.") SearchException nullDecimalScale(@Param EventContext eventContext); - @Message(id = ID_OFFSET_3 + 69, value = "The value '%1$s' cannot be indexed because its absolute value is too large.") + @Message(id = ID_OFFSET + 69, value = "The value '%1$s' cannot be indexed because its absolute value is too large.") SearchException scaledNumberTooLarge(Number value); - @Message(id = ID_OFFSET_3 + 70, value = "Positive decimal scale ['%1$s'] is not allowed for BigInteger fields, since a BigInteger value cannot have any decimal digits.") + @Message(id = ID_OFFSET + 70, value = "Positive decimal scale ['%1$s'] is not allowed for BigInteger fields, since a BigInteger value cannot have any decimal digits.") SearchException invalidDecimalScale(Integer decimalScale, @Param EventContext eventContext); - @Message(id = ID_OFFSET_3 + 72, value = "The predicate '%1$s' is defined on a scope targeting different indexes." + @Message(id = ID_OFFSET + 72, value = "The predicate '%1$s' is defined on a scope targeting different indexes." + " Predicate is targeting: '%2$s'. Current scope is targeting: '%3$s'.") SearchException predicateDefinedOnDifferentIndexes(SearchPredicate predicate, Set predicateIndexes, Set scopeIndexes); - @Message(id = ID_OFFSET_3 + 73, value = "The sort '%1$s' is defined on a scope targeting different indexes." + @Message(id = ID_OFFSET + 73, value = "The sort '%1$s' is defined on a scope targeting different indexes." + " Sort is targeting: '%2$s'. Current scope is targeting: '%3$s'.") SearchException sortDefinedOnDifferentIndexes(SearchSort sort, Set sortIndexes, Set scopeIndexes); - @Message(id = ID_OFFSET_3 + 74, value = "The projection '%1$s' is defined on a scope targeting different indexes." + @Message(id = ID_OFFSET + 74, value = "The projection '%1$s' is defined on a scope targeting different indexes." + " Projection is targeting: '%2$s'. Current scope is targeting: '%3$s'.") SearchException projectionDefinedOnDifferentIndexes(SearchProjection projection, Set projectionIndexes, Set scopeIndexes); - @Message(id = ID_OFFSET_3 + 76, + @Message(id = ID_OFFSET + 76, value = "Cannot apply an analyzer on an aggregable field. Use a normalizer instead. Analyzer: '%1$s'." + " If an actual analyzer (with tokenization) is necessary, define two separate fields:" + " one with an analyzer that is not aggregable, and one with a normalizer that is aggregable.") SearchException cannotUseAnalyzerOnAggregableField(String analyzerName, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 80, + @Message(id = ID_OFFSET + 80, value = "Elasticsearch range aggregations only accept ranges in the canonical form:" + " (-Infinity, ) or [, ) or [, +Infinity)." + " The given range is not in canonical form: '%1$s'.") SearchException elasticsearchRangeAggregationRequiresCanonicalFormForRanges(Range range); - @Message(id = ID_OFFSET_3 + 81, + @Message(id = ID_OFFSET + 81, value = "An Elasticsearch query cannot include search aggregations built using a non-Elasticsearch search scope." + " Given aggregation was: '%1$s'") SearchException cannotMixElasticsearchSearchQueryWithOtherAggregations(SearchAggregation aggregation); - @Message(id = ID_OFFSET_3 + 82, value = "The aggregation '%1$s' is defined on a scope targeting different indexes." + @Message(id = ID_OFFSET + 82, value = "The aggregation '%1$s' is defined on a scope targeting different indexes." + " Aggregation is targeting: '%2$s'. Current scope is targeting: '%3$s'.") SearchException aggregationDefinedOnDifferentIndexes(SearchAggregation aggregation, Set aggregationIndexes, Set scopeIndexes); - @Message(id = ID_OFFSET_3 + 85, + @Message(id = ID_OFFSET + 85, value = "Multiple aggregations with the same key: '%1$s'") SearchException duplicateAggregationKey(@FormatWith(AggregationKeyFormatter.class) AggregationKey key); - @Message(id = ID_OFFSET_3 + 87, value = "Cannot apply a search analyzer if an analyzer has not been defined on the same field." + + @Message(id = ID_OFFSET + 87, value = "Cannot apply a search analyzer if an analyzer has not been defined on the same field." + " Search analyzer: '%1$s'.") SearchException searchAnalyzerWithoutAnalyzer(String searchAnalyzer, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 88, value = "The operation failed due to the failure of the call to the bulk REST API.") + @Message(id = ID_OFFSET + 88, value = "The operation failed due to the failure of the call to the bulk REST API.") SearchException elasticsearchFailedBecauseOfBulkFailure(@Cause Throwable bulkFailure); - @Message(id = ID_OFFSET_3 + 89, value = "Invalid host/port: '%1$s'." + @Message(id = ID_OFFSET + 89, value = "Invalid host/port: '%1$s'." + " The host/port string must use the format 'host:port', for example 'mycompany.com:9200'" + " The URI scheme ('http://', 'https://') must not be included.") SearchException invalidHostAndPort(String hostAndPort, @Cause Exception e); - @Message(id = ID_OFFSET_3 + 90, value = "Request exceeded the timeout of %1$s: '%2$s'.") + @Message(id = ID_OFFSET + 90, value = "Request exceeded the timeout of %1$s: '%2$s'.") SearchTimeoutException timedOut(@FormatWith(DurationInSecondsAndFractionsFormatter.class) Duration timeout, @FormatWith(ElasticsearchRequestFormatter.class) ElasticsearchRequest request); - @Message(id = ID_OFFSET_3 + 91, value = "Invalid name for the type-name mapping strategy: '%1$s'." + @Message(id = ID_OFFSET + 91, value = "Invalid name for the type-name mapping strategy: '%1$s'." + " Valid names are: %2$s.") SearchException invalidTypeNameMappingStrategyName(String invalidRepresentation, List validRepresentations); - @Message(id = ID_OFFSET_3 + 92, + @Message(id = ID_OFFSET + 92, value = "Missing field '%1$s' for one of the search hits." + " The document was probably indexed with a different configuration: full reindexing is necessary.") SearchException missingTypeFieldInDocument(String fieldName); - @Message(id = ID_OFFSET_3 + 93, + @Message(id = ID_OFFSET + 93, value = "Index aliases [%1$s, %2$s] are assigned to a single Hibernate Search index, " + " but they are already defined in Elasticsearch and point to multiple distinct indexes: %3$s.") SearchException elasticsearchIndexNameAndAliasesMatchMultipleIndexes(URLEncodedString write, URLEncodedString read, Set matchingIndexes); - @Message(id = ID_OFFSET_3 + 94, + @Message(id = ID_OFFSET + 94, value = "Index primary name '%1$s' does not match the expected pattern '%2$s'.") SearchException invalidIndexPrimaryName(String elasticsearchIndexName, Pattern pattern); - @Message(id = ID_OFFSET_3 + 95, + @Message(id = ID_OFFSET + 95, value = "Unique key '%1$s' extracted from the index name does not match any of %2$s") SearchException invalidIndexUniqueKey(String uniqueKey, Set knownKeys); - @Message(id = ID_OFFSET_3 + 96, + @Message(id = ID_OFFSET + 96, value = "Write alias and read alias must be different, but were set to the same value: '%1$s'.") SearchException sameWriteAndReadAliases(URLEncodedString writeAndReadAlias, @Param EventContext eventContext); - @Message(id = ID_OFFSET_3 + 97, value = "Invalid Elasticsearch version: '%1$s'." + @Message(id = ID_OFFSET + 97, value = "Invalid Elasticsearch version: '%1$s'." + " When version_check.enabled is set to false, " + " the version must at least be in the form 'x.y', where 'x' and 'y' are integers") SearchException invalidElasticsearchVersionCheckConfiguration(String versionString); - @Message(id = ID_OFFSET_3 + 98, value = "The lifecycle strategy cannot be set at the index level anymore." + @Message(id = ID_OFFSET + 98, value = "The lifecycle strategy cannot be set at the index level anymore." + " Set the schema management strategy via the property 'hibernate.search.schema_management.strategy' instead.") SearchException lifecycleStrategyMovedToMapper(); - @Message(id = ID_OFFSET_3 + 99, value = "Simple query string targets fields [%1$s, %3$s] spanning multiple nested paths: %2$s, %4$s.") + @Message(id = ID_OFFSET + 99, value = "Simple query string targets fields [%1$s, %3$s] spanning multiple nested paths: %2$s, %4$s.") SearchException simpleQueryStringSpanningMultipleNestedPaths(String fieldPath1, String nestedPath1, String fieldPath2, String nestedPath2); - @Message(id = ID_OFFSET_3 + 100, + @Message(id = ID_OFFSET + 100, value = "Cannot compute the median across nested documents.") SearchException cannotComputeMedianAcrossNested(@Param EventContext context); - @Message(id = ID_OFFSET_3 + 101, + @Message(id = ID_OFFSET + 101, value = "Cannot compute the sum, average or median of a text field. Only min and max are supported.") SearchException cannotComputeSumOrAvgOrMedianForStringField(@Param EventContext context); - @Message(id = ID_OFFSET_3 + 102, + @Message(id = ID_OFFSET + 102, value = "Cannot compute the sum of a temporal field. Only min, max, avg and median are supported.") SearchException cannotComputeSumForTemporalField(@Param EventContext context); - @Message(id = ID_OFFSET_3 + 103, + @Message(id = ID_OFFSET + 103, value = "Cannot compute the sum for a distance sort. Only min, max, avg and median are supported.") SearchException cannotComputeSumForDistanceSort(@Param EventContext context); - @Message(id = ID_OFFSET_3 + 104, + @Message(id = ID_OFFSET + 104, value = "Field '%1$s' is not contained in a nested object." + " Sort filters are only available if the field to sort on is contained in a nested object.") SearchException cannotFilterSortOnRootDocumentField(String absoluteFieldPath, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 105, + @Message(id = ID_OFFSET + 105, value = "Predicate targets unexpected fields %2$s." + " Only fields that are contained in the nested object with path '%1$s'" + " are allowed here.") SearchException invalidNestedObjectPathForPredicate(String nestedObjectPath, List fieldPaths); - @Message(id = ID_OFFSET_3 + 106, + @Message(id = ID_OFFSET + 106, value = "Field '%1$s' is not contained in a nested object." + " Aggregation filters are only available if the field to aggregate on is contained in a nested object.") SearchException cannotFilterAggregationOnRootDocumentField(String absoluteFieldPath, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 107, + @Message(id = ID_OFFSET + 107, value = "The index field template '%1$s' was added twice." + " Multiple bridges may be trying to access the same index field template, " + " or two indexed-embeddeds may have prefixes that lead to conflicting field names," @@ -577,81 +565,81 @@ SearchException elasticsearchIndexNameAndAliasesMatchMultipleIndexes(URLEncodedS + " In any case, there is something wrong with your mapping and you should fix it.") SearchException indexSchemaFieldTemplateNameConflict(String name, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 108, + @Message(id = ID_OFFSET + 108, value = "Invalid value type. This field's values are of type '%1$s', which is not assignable from '%2$s'.") SearchException invalidFieldValueType(@FormatWith(ClassFormatter.class) Class fieldValueType, @FormatWith(ClassFormatter.class) Class invalidValueType, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 109, + @Message(id = ID_OFFSET + 109, value = "Unknown field '%1$s'.") SearchException unknownFieldForIndexing(String absoluteFieldPath, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 110, + @Message(id = ID_OFFSET + 110, value = "Invalid type: the index root is not an object field.") SearchException invalidIndexElementTypeRootIsNotObjectField(); - @Message(id = ID_OFFSET_3 + 111, + @Message(id = ID_OFFSET + 111, value = "Invalid type: '%1$s' is a value field, not an object field.") SearchException invalidIndexElementTypeValueFieldIsNotObjectField(String absolutePath); - @Message(id = ID_OFFSET_3 + 112, + @Message(id = ID_OFFSET + 112, value = "Invalid type: '%1$s' is an object field, not a value field.") SearchException invalidIndexElementTypeObjectFieldIsNotValueField(String absolutePath); - @Message(id = ID_OFFSET_3 + 113, + @Message(id = ID_OFFSET + 113, value = "Projection on field '%1$s' cannot be single-valued, because this field is multi-valued." + " Make sure to call '.multi()' when you create the projection.") SearchException invalidSingleValuedProjectionOnMultiValuedField(String absolutePath, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 114, value = "Cannot use '%2$s' on field '%1$s'." + @Message(id = ID_OFFSET + 114, value = "Cannot use '%2$s' on field '%1$s'." + " Make sure the field is marked as searchable/sortable/projectable/aggregable (whichever is relevant)." + " If it already is, then '%2$s' is not available for fields of this type.") SearchException cannotUseQueryElementForField(String absoluteFieldPath, String queryElementName, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 115, + @Message(id = ID_OFFSET + 115, value = "Inconsistent support for '%1$s': %2$s") SearchException inconsistentSupportForQueryElement(String queryElementName, String causeMessage, @Cause SearchException cause); - @Message(id = ID_OFFSET_3 + 116, + @Message(id = ID_OFFSET + 116, value = "Field attribute '%1$s' differs: '%2$s' vs. '%3$s'.") SearchException differentFieldAttribute(String attributeName, Object component1, Object component2); - @Message(id = ID_OFFSET_3 + 117, + @Message(id = ID_OFFSET + 117, value = "Implementation class differs: '%1$s' vs. '%2$s'.") SearchException differentImplementationClassForQueryElement(@FormatWith(ClassFormatter.class) Class class1, @FormatWith(ClassFormatter.class) Class class2); - @Message(id = ID_OFFSET_3 + 118, + @Message(id = ID_OFFSET + 118, value = "Field codec differs: '%1$s' vs. '%2$s'.") SearchException differentFieldCodecForQueryElement(Object codec1, Object codec2); - @Message(id = ID_OFFSET_3 + 119, + @Message(id = ID_OFFSET + 119, value = "'%1$s' can be used in some of the targeted indexes, but not all of them." + " Make sure the field is marked as searchable/sortable/projectable/aggregable (whichever is relevant) in all indexes," + " and that the field has the same type in all indexes.") SearchException partialSupportForQueryElement(String queryElementName); - @Message(id = ID_OFFSET_3 + 120, value = "Request exceeded the timeout of %1$s: '%2$s'.") + @Message(id = ID_OFFSET + 120, value = "Request exceeded the timeout of %1$s: '%2$s'.") SearchTimeoutException clientSideTimedOut(@FormatWith(DurationInSecondsAndFractionsFormatter.class) Duration timeout, String query); - @Message(id = ID_OFFSET_3 + 121, value = "Invalid dynamic type: '%1$s'." + @Message(id = ID_OFFSET + 121, value = "Invalid dynamic type: '%1$s'." + " Valid values are: %2$s.") SearchException invalidDynamicType(String invalidRepresentation, List validRepresentations); - @Message(id = ID_OFFSET_3 + 122, + @Message(id = ID_OFFSET + 122, value = "Multiple conflicting models for field '%1$s': '%2$s' vs. '%3$s'.") SearchException conflictingFieldModel(String absoluteFieldPath, AbstractElasticsearchIndexSchemaFieldNode fieldNode1, AbstractElasticsearchIndexSchemaFieldNode fieldNode2, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 123, value = "Cannot use '%2$s' on field '%1$s'." + @Message(id = ID_OFFSET + 123, value = "Cannot use '%2$s' on field '%1$s'." + " '%2$s' is not available for object fields.") SearchException cannotUseQueryElementForObjectField(String absoluteFieldPath, String queryElementName, @Param EventContext context); - @Message(id = ID_OFFSET_3 + 124, value = "Cannot use '%2$s' on field '%1$s': %3$s") + @Message(id = ID_OFFSET + 124, value = "Cannot use '%2$s' on field '%1$s': %3$s") SearchException cannotUseQueryElementForObjectFieldBecauseCreationException(String absoluteFieldPath, String queryElementName, String causeMessage, @Cause SearchException cause, @Param EventContext context); diff --git a/backend/lucene/src/main/java/org/hibernate/search/backend/lucene/logging/impl/Log.java b/backend/lucene/src/main/java/org/hibernate/search/backend/lucene/logging/impl/Log.java index 6f44ca256f6..e473054d16f 100644 --- a/backend/lucene/src/main/java/org/hibernate/search/backend/lucene/logging/impl/Log.java +++ b/backend/lucene/src/main/java/org/hibernate/search/backend/lucene/logging/impl/Log.java @@ -53,7 +53,7 @@ @MessageLogger(projectCode = MessageConstants.PROJECT_CODE) @ValidIdRanges({ @ValidIdRange(min = MessageConstants.BACKEND_LUCENE_ID_RANGE_MIN, max = MessageConstants.BACKEND_LUCENE_ID_RANGE_MAX), - // Exceptions for legacy messages from Search 5 + // Exceptions for legacy messages from Search 5 (engine module) @ValidIdRange(min = 35, max = 35), @ValidIdRange(min = 41, max = 41), @ValidIdRange(min = 52, max = 52), @@ -77,45 +77,44 @@ @ValidIdRange(min = 344, max = 344), @ValidIdRange(min = 345, max = 345), @ValidIdRange(min = 353, max = 353) - // TODO HSEARCH-3308 add exceptions here for legacy messages from Search 5. }) public interface Log extends BasicLogger { // ----------------------------------- - // Pre-existing messages from Search 5 + // Pre-existing messages from Search 5 (engine module) // DO NOT ADD ANY NEW MESSAGES HERE // ----------------------------------- - int ID_OFFSET_1 = MessageConstants.ENGINE_ID_RANGE_MIN; + int ID_OFFSET_LEGACY_ENGINE = MessageConstants.ENGINE_ID_RANGE_MIN; @LogMessage(level = INFO) - @Message(id = ID_OFFSET_1 + 41, value = "Index directory not found, creating: '%1$s'") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 41, value = "Index directory not found, creating: '%1$s'") void indexDirectoryNotFoundCreatingNewOne(Path absolutePath); @LogMessage(level = WARN) - @Message(id = ID_OFFSET_1 + 52, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 52, value = "Going to reset the index writer and force release of the IndexWriter lock. %1$s") void indexWriterReset(@FormatWith(EventContextFormatter.class) EventContext context); @LogMessage(level = Level.WARN) - @Message(id = ID_OFFSET_1 + 55, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 55, value = "Unable to close the index reader. %1$s") void unableToCloseIndexReader(@FormatWith(EventContextFormatter.class) EventContext context, @Cause Exception e); @LogMessage(level = WARN) - @Message(id = ID_OFFSET_1 + 75, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 75, value = "Configuration setting '%1$s' was not specified: using LATEST (currently '%2$s'). %3$s") void recommendConfiguringLuceneVersion(String key, Version latest, @FormatWith(EventContextFormatter.class) EventContext context); - @Message(id = ID_OFFSET_1 + 114, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 114, value = "Could not load resource: '%1$s'") SearchException unableToLoadResource(String fileName); - @Message(id = ID_OFFSET_1 + 118, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 118, value = "Index Merge operation on index '%1$s'") String indexMergeOperation(String indexName); @LogMessage(level = Level.WARN) - @Message(id = ID_OFFSET_1 + 225, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 225, value = "An index locking error occurred during initialization of Directory '%s'." + " This might indicate a concurrent initialization;" + " If you experience errors on this index you might need to remove the lock, or rebuild the index." @@ -123,143 +122,141 @@ public interface Log extends BasicLogger { void lockingFailureDuringInitialization(String directoryDescription, @Param EventContext context); @LogMessage(level = TRACE) - @Message(id = ID_OFFSET_1 + 226, value = "%s: %s" ) + @Message(id = ID_OFFSET_LEGACY_ENGINE + 226, value = "%s: %s" ) void logInfoStreamMessage(String componentName, String message); - @Message(id = ID_OFFSET_1 + 228, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 228, value = "Value '%1$ss' is not in a valid format to express a Lucene version: %2$s" ) SearchException illegalLuceneVersionFormat(String property, String luceneErrorMessage, @Cause Exception e); @LogMessage(level = Level.DEBUG) - @Message(id = ID_OFFSET_1 + 274, value = "Executing Lucene query '%s'" ) + @Message(id = ID_OFFSET_LEGACY_ENGINE + 274, value = "Executing Lucene query '%s'" ) void executingLuceneQuery(Query luceneQuery); - @Message(id = ID_OFFSET_1 + 284, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 284, value = "An exception occurred while opening multiple indexes." ) SearchException failureOnMultiReaderRefresh(@Param EventContext context, @Cause Exception e); - @Message(id = ID_OFFSET_1 + 329, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 329, value = "Error while applying analysis configuration: %1$s") SearchException unableToApplyAnalysisConfiguration(String errorMessage, @Cause Exception e); - @Message(id = ID_OFFSET_1 + 337, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 337, value = "Multiple parameters with the same name: '%1$s'. Can't assign both value '%2$s' and '%3$s'" ) SearchException analysisComponentParameterConflict(String name, String value1, String value2); - @Message(id = ID_OFFSET_1 + 342, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 342, value = "Cannot apply both an analyzer and a normalizer. Analyzer: '%1$s', normalizer: '%2$s'.") SearchException cannotApplyAnalyzerAndNormalizer(String analyzerName, String normalizerName, @Param EventContext context); @LogMessage(level = Level.WARN) - @Message(id = ID_OFFSET_1 + 344, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 344, value = "The normalizer for definition '%s' produced %d tokens." + " Normalizers should never produce more than one token." + " The tokens have been concatenated by Hibernate Search," + " but you should fix your normalizer definition." ) void normalizerProducedMultipleTokens(String normalizerName, int token); - @Message(id = ID_OFFSET_1 + 345, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 345, value = "Cannot apply an analyzer on a sortable field. Use a normalizer instead. Analyzer: '%1$s'." + " If an actual analyzer (with tokenization) is necessary, define two separate fields:" + " one with an analyzer that is not sortable, and one with a normalizer that is sortable.") SearchException cannotUseAnalyzerOnSortableField(String analyzerName, @Param EventContext context); - @Message(id = ID_OFFSET_1 + 353, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 353, value = "Unknown analyzer: '%1$s'. Make sure you defined this analyzer.") SearchException unknownAnalyzer(String analyzerName, @Param EventContext context); - // TODO HSEARCH-3308 migrate relevant messages from Search 5 here - // ----------------------------------- // New messages from Search 6 onwards // ----------------------------------- - int ID_OFFSET_2 = MessageConstants.BACKEND_LUCENE_ID_RANGE_MIN; + int ID_OFFSET = MessageConstants.BACKEND_LUCENE_ID_RANGE_MIN; - @Message(id = ID_OFFSET_2 + 0, + @Message(id = ID_OFFSET + 0, value = "Unknown field '%1$s'.") SearchException unknownFieldForSearch(String absoluteFieldPath, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 1, + @Message(id = ID_OFFSET + 1, value = "Path '%1$s' exists but does not point to a writable directory.") SearchException pathIsNotWriteableDirectory(Path rootDirectory); - @Message(id = ID_OFFSET_2 + 5, + @Message(id = ID_OFFSET + 5, value = "The Lucene extension can only be applied to objects" + " derived from the Lucene backend. Was applied to '%1$s' instead.") SearchException luceneExtensionOnUnknownType(Object context); - @Message(id = ID_OFFSET_2 + 10, + @Message(id = ID_OFFSET + 10, value = "A Lucene query cannot include search predicates built using a non-Lucene search scope." + " Given predicate was: '%1$s'") SearchException cannotMixLuceneSearchQueryWithOtherPredicates(SearchPredicate predicate); - @Message(id = ID_OFFSET_2 + 13, + @Message(id = ID_OFFSET + 13, value = "Object field '%1$s' is flattened: its structure was lost upon indexing and 'nested' features are not available.") SearchException nonNestedFieldForNestedQuery(String absoluteFieldPath, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 14, + @Message(id = ID_OFFSET + 14, value = "A Lucene query cannot include search sorts built using a non-Lucene search scope." + " Given sort was: '%1$s'") SearchException cannotMixLuceneSearchSortWithOtherSorts(SearchSort sort); - @Message(id = ID_OFFSET_2 + 15, + @Message(id = ID_OFFSET + 15, value = "Unable to initialize index directory: %1$s") SearchException unableToInitializeIndexDirectory(String causeMessage, @Param EventContext context, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 16, value = "Unable to index entity of type '%2$s' with identifier '%3$s' and tenant identifier '%1$s'.") + @Message(id = ID_OFFSET + 16, value = "Unable to index entity of type '%2$s' with identifier '%3$s' and tenant identifier '%1$s'.") SearchException unableToIndexEntry(String tenantId, String entityTypeName, Object entityIdentifier, @Param EventContext context, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 17, + @Message(id = ID_OFFSET + 17, value = "Unable to delete entity of type '%2$s' with identifier '%3$s' and tenant identifier '%1$s'.") SearchException unableToDeleteEntryFromIndex(String tenantId, String entityTypeName, Object entityIdentifier, @Param EventContext context, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 19, + @Message(id = ID_OFFSET + 19, value = "Unable to commit.") SearchException unableToCommitIndex(@Param EventContext context, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 24, + @Message(id = ID_OFFSET + 24, value = "A multi-index scope cannot include both a Lucene index and another type of index." + " Base scope was: '%1$s', Lucene index was: '%2$s'") SearchException cannotMixLuceneScopeWithOtherType(IndexScopeBuilder baseScope, LuceneIndexManager luceneIndex, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 25, + @Message(id = ID_OFFSET + 25, value = "A multi-index scope cannot span multiple Lucene backends." + " Base scope was: '%1$s', index from another backend was: '%2$s'") SearchException cannotMixLuceneScopeWithOtherBackend(IndexScopeBuilder baseScope, LuceneIndexManager indexFromOtherBackend, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 27, + @Message(id = ID_OFFSET + 27, value = "An IOException happened while executing the query '%1$s'.") SearchException ioExceptionOnQueryExecution(Query luceneQuery, @Param EventContext context, @Cause IOException e); - @Message(id = ID_OFFSET_2 + 29, + @Message(id = ID_OFFSET + 29, value = "Index '%1$s' requires multi-tenancy but the backend does not support it in its current configuration.") SearchException multiTenancyRequiredButNotSupportedByBackend(String indexName, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 30, + @Message(id = ID_OFFSET + 30, value = "Invalid multi-tenancy strategy name: '%1$s'. Valid names are: %2$s.") SearchException invalidMultiTenancyStrategyName(String invalidRepresentation, List validRepresentations); - @Message(id = ID_OFFSET_2 + 31, + @Message(id = ID_OFFSET + 31, value = "Tenant identifier '%1$s' is provided, but multi-tenancy is disabled for this backend.") SearchException tenantIdProvidedButMultiTenancyDisabled(String tenantId, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 32, + @Message(id = ID_OFFSET + 32, value = "Backend has multi-tenancy enabled, but no tenant identifier is provided.") SearchException multiTenancyEnabledButNoTenantIdProvided(@Param EventContext context); - @Message(id = ID_OFFSET_2 + 33, + @Message(id = ID_OFFSET + 33, value = "Attempt to unwrap a Lucene backend to '%1$s'," + " but this backend can only be unwrapped to '%2$s'.") SearchException backendUnwrappingWithUnknownType(@FormatWith(ClassFormatter.class) Class requestedClass, @FormatWith(ClassFormatter.class) Class actualClass, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 34, + @Message(id = ID_OFFSET + 34, value = "The index schema node '%1$s' was added twice." + " Multiple bridges may be trying to access the same index field, " + " or two indexed-embeddeds may have prefixes that lead to conflicting field names," @@ -268,245 +265,245 @@ SearchException backendUnwrappingWithUnknownType(@FormatWith(ClassFormatter.clas SearchException indexSchemaNodeNameConflict(String relativeFieldName, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 39, + @Message(id = ID_OFFSET + 39, value = "Invalid field reference for this document element: this document element has path '%1$s', but the referenced field has a parent with path '%2$s'.") SearchException invalidFieldForDocumentElement(String expectedPath, String actualPath); - @Message(id = ID_OFFSET_2 + 44, + @Message(id = ID_OFFSET + 44, value = "Computed minimum for minimumShouldMatch constraint is out of bounds:" + " expected a number between '1' and '%1$s', got '%2$s'.") SearchException minimumShouldMatchMinimumOutOfBounds(int totalShouldClauseNumber, int minimum); - @Message(id = ID_OFFSET_2 + 45, + @Message(id = ID_OFFSET + 45, value = "Multiple conflicting minimumShouldMatch constraints for ceiling '%1$s'") SearchException minimumShouldMatchConflictingConstraints(int ignoreConstraintCeiling); - @Message(id = ID_OFFSET_2 + 48, + @Message(id = ID_OFFSET + 48, value = "This native field does not support projection.") SearchException unsupportedProjectionForNativeField(@Param EventContext context); - @Message(id = ID_OFFSET_2 + 49, + @Message(id = ID_OFFSET + 49, value = "Invalid field path; expected path '%1$s', got '%2$s'.") SearchException invalidFieldPath(String expectedPath, String actualPath); - @Message(id = ID_OFFSET_2 + 50, + @Message(id = ID_OFFSET + 50, value = "Unable to convert DSL parameter: %1$s") SearchException cannotConvertDslParameter(String errorMessage, @Cause Exception cause, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 51, + @Message(id = ID_OFFSET + 51, value = "Attempt to unwrap a Lucene index manager to '%1$s'," + " but this index manager can only be unwrapped to '%2$s'.") SearchException indexManagerUnwrappingWithUnknownType(@FormatWith(ClassFormatter.class) Class requestedClass, @FormatWith(ClassFormatter.class) Class actualClass, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 52, + @Message(id = ID_OFFSET + 52, value = "Unable to create analyzer for name '%1$s'.") SearchException unableToCreateAnalyzer(String name, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 53, + @Message(id = ID_OFFSET + 53, value = "Unable to create normalizer for name '%1$s'.") SearchException unableToCreateNormalizer(String name, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 54, + @Message(id = ID_OFFSET + 54, value = "Unknown normalizer: '%1$s'. Make sure you defined this normalizer.") SearchException unknownNormalizer(String normalizerName, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 55, + @Message(id = ID_OFFSET + 55, value = "A Lucene query cannot include search projections built using a non-Lucene search scope." + " Given projection was: '%1$s'") SearchException cannotMixLuceneSearchQueryWithOtherProjections(SearchProjection projection); - @Message(id = ID_OFFSET_2 + 58, + @Message(id = ID_OFFSET + 58, value = "Inconsistent configuration for field '%1$s' in a search query across multiple indexes: %2$s") SearchException inconsistentConfigurationForFieldForSearch(String absoluteFieldPath, String causeMessage, @Param EventContext context, @Cause SearchException cause); - @Message(id = ID_OFFSET_2 + 61, value = "Failed to shut down the Lucene index manager.") + @Message(id = ID_OFFSET + 61, value = "Failed to shut down the Lucene index manager.") SearchException failedToShutdownBackend(@Cause Exception cause, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 62, value = "Cannot guess field type for input type: '%1$s'.") + @Message(id = ID_OFFSET + 62, value = "Cannot guess field type for input type: '%1$s'.") SearchException cannotGuessFieldType(@FormatWith(ClassFormatter.class) Class inputType, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 64, value = "Unexpected index: documentId '%1$s' was not collected." ) + @Message(id = ID_OFFSET + 64, value = "Unexpected index: documentId '%1$s' was not collected." ) SearchException documentIdNotCollected(Integer documentId); - @Message(id = ID_OFFSET_2 + 67, value = "Unable to delete all entries matching query '%1$s'.") + @Message(id = ID_OFFSET + 67, value = "Unable to delete all entries matching query '%1$s'.") SearchException unableToDeleteAllEntriesFromIndex(Query query, @Param EventContext context, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 68, + @Message(id = ID_OFFSET + 68, value = "Inconsistent configuration for the identifier in a search query across multiple indexes: converter differs: '%1$s' vs. '%2$s'.") SearchException inconsistentConfigurationForIdentifierForSearch(ToDocumentIdentifierValueConverter component1, ToDocumentIdentifierValueConverter component2, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 69, + @Message(id = ID_OFFSET + 69, value = "An IOException occurred while generating an Explanation.") SearchException ioExceptionOnExplain(@Cause IOException e); - @Message(id = ID_OFFSET_2 + 70, + @Message(id = ID_OFFSET + 70, value = "Full-text features (analysis, fuzziness) are not supported for fields of this type.") SearchException fullTextFeaturesNotSupportedByFieldType(@Param EventContext context); - @Message(id = ID_OFFSET_2 + 71, + @Message(id = ID_OFFSET + 71, value = "Incomplete field definition." + " You must call toReference() to complete the field definition.") SearchException incompleteFieldDefinition(@Param EventContext context); - @Message(id = ID_OFFSET_2 + 72, + @Message(id = ID_OFFSET + 72, value = "Multiple calls to toReference() for the same field definition." + " You must call toReference() exactly once.") SearchException cannotCreateReferenceMultipleTimes(@Param EventContext context); - @Message(id = ID_OFFSET_2 + 73, value = "Index-null-as option is not supported on analyzed field. Trying to define the analyzer: '%1$s' together with index null as: '%2$s'.") + @Message(id = ID_OFFSET + 73, value = "Index-null-as option is not supported on analyzed field. Trying to define the analyzer: '%1$s' together with index null as: '%2$s'.") SearchException cannotUseIndexNullAsAndAnalyzer(String analyzerName, String indexNullAs, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 74, + @Message(id = ID_OFFSET + 74, value = "Multiple values were added to single-valued field '%1$s'." + " Declare the field as multi-valued in order to allow this." ) SearchException multipleValuesForSingleValuedField(String absoluteFieldPath); - @Message(id = ID_OFFSET_2 + 75, + @Message(id = ID_OFFSET + 75, value = "explain(Object id) cannot be used when the query targets multiple types." + " Use explain(String typeName, Object id) and pass one of %1$s as the type name." ) SearchException explainRequiresTypeName(Set targetedTypeNames); - @Message(id = ID_OFFSET_2 + 76, + @Message(id = ID_OFFSET + 76, value = "The given mapped type name '%2$s' is not among the mapped types targeted by this query: %1$s." ) SearchException explainRequiresTypeTargetedByQuery(Set targetedTypeNames, String typeName); - @Message(id = ID_OFFSET_2 + 77, + @Message(id = ID_OFFSET + 77, value = "Document with id '%2$s' does not exist for the mapped type '%1$s' and thus its match cannot be explained." ) SearchException explainUnknownDocument(String typeName, String id); - @Message(id = ID_OFFSET_2 + 78, + @Message(id = ID_OFFSET + 78, value = "Unable to merge index segments.") SearchException unableToMergeSegments(@Param EventContext context, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 79, + @Message(id = ID_OFFSET + 79, value = "Unable to close the index writer after write failures.") SearchException unableToCloseIndexWriterAfterFailures(@Param EventContext context, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 80, value = "Impossible to detect a decimal scale to use for this field." + @Message(id = ID_OFFSET + 80, value = "Impossible to detect a decimal scale to use for this field." + " If the value is bridged, set '.asBigDecimal().decimalScale( int )' in the bind, else verify your mapping.") SearchException nullDecimalScale(@Param EventContext eventContext); - @Message(id = ID_OFFSET_2 + 81, value = "The value '%1$s' cannot be indexed because its absolute value is too large.") + @Message(id = ID_OFFSET + 81, value = "The value '%1$s' cannot be indexed because its absolute value is too large.") SearchException scaledNumberTooLarge(Number value); - @Message(id = ID_OFFSET_2 + 82, value = "Positive decimal scale ['%1$s'] is not allowed for BigInteger fields, since a BigInteger value cannot have any decimal digits.") + @Message(id = ID_OFFSET + 82, value = "Positive decimal scale ['%1$s'] is not allowed for BigInteger fields, since a BigInteger value cannot have any decimal digits.") SearchException invalidDecimalScale(Integer decimalScale, @Param EventContext eventContext); - @Message(id = ID_OFFSET_2 + 84, value = "The predicate '%1$s' is defined on a scope targeting different indexes." + @Message(id = ID_OFFSET + 84, value = "The predicate '%1$s' is defined on a scope targeting different indexes." + " Predicate is targeting: '%2$s'. Current scope is targeting: '%3$s'.") SearchException predicateDefinedOnDifferentIndexes(SearchPredicate predicate, Set predicateIndexes, Set scopeIndexes); - @Message(id = ID_OFFSET_2 + 85, value = "The sort '%1$s' is defined on a scope targeting different indexes." + @Message(id = ID_OFFSET + 85, value = "The sort '%1$s' is defined on a scope targeting different indexes." + " Sort is targeting: '%2$s'. Current scope is targeting: '%3$s'.") SearchException sortDefinedOnDifferentIndexes(SearchSort predicate, Set predicateIndexes, Set scopeIndexes); - @Message(id = ID_OFFSET_2 + 86, value = "The projection '%1$s' is defined on a scope targeting different indexes." + @Message(id = ID_OFFSET + 86, value = "The projection '%1$s' is defined on a scope targeting different indexes." + " Projection is targeting: '%2$s'. Current scope is targeting: '%3$s'.") SearchException projectionDefinedOnDifferentIndexes(SearchProjection predicate, Set predicateIndexes, Set scopeIndexes); - @Message(id = ID_OFFSET_2 + 87, + @Message(id = ID_OFFSET + 87, value = "Invalid filesystem access strategy name: '%1$s'. Valid names are: %2$s.") SearchException invalidFileSystemAccessStrategyName(String invalidRepresentation, List validRepresentations); - @Message(id = ID_OFFSET_2 + 88, + @Message(id = ID_OFFSET + 88, value = "Invalid locking strategy name: '%1$s'. Valid names are: %2$s.") SearchException invalidLockingStrategyName(String invalidRepresentation, List validRepresentations); - @Message(id = ID_OFFSET_2 + 89, + @Message(id = ID_OFFSET + 89, value = "The sharding strategy '%1$s' is not implemented properly:" + " it must call either context.setShardIdentifiers() or context.setShardingDisabled()" + " in its initialize() method, but it did not." ) SearchException missingShardIdentifiersAfterShardingStrategyInitialization(Object strategy); - @Message(id = ID_OFFSET_2 + 90, + @Message(id = ID_OFFSET + 90, value = "Missing value for property '%2$s'. The sharding strategy '%1$s' requires this property to be set.") SearchException missingPropertyValueForShardingStrategy(String strategyName, String propertyKey); - @Message(id = ID_OFFSET_2 + 91, + @Message(id = ID_OFFSET + 91, value = "Invalid routing key: '%1$s'. Valid keys are: %2$s.") SearchException invalidRoutingKeyForExplicitShardingStrategy(String invalidKey, Collection validKeys); - @Message(id = ID_OFFSET_2 + 94, + @Message(id = ID_OFFSET + 94, value = "Cannot apply an analyzer on an aggregable field. Use a normalizer instead. Analyzer: '%1$s'." + " If an actual analyzer (with tokenization) is necessary, define two separate fields:" + " one with an analyzer that is not aggregable, and one with a normalizer that is aggregable.") SearchException cannotUseAnalyzerOnAggregableField(String analyzerName, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 98, + @Message(id = ID_OFFSET + 98, value = "An Lucene query cannot include search aggregations built using a non-Lucene search scope." + " Given aggregation was: '%1$s'") SearchException cannotMixLuceneSearchQueryWithOtherAggregations(SearchAggregation aggregation); - @Message(id = ID_OFFSET_2 + 99, value = "The aggregation '%1$s' is defined on a scope targeting different indexes." + @Message(id = ID_OFFSET + 99, value = "The aggregation '%1$s' is defined on a scope targeting different indexes." + " Aggregation is targeting: '%2$s'. Current scope is targeting: '%3$s'.") SearchException aggregationDefinedOnDifferentIndexes(SearchAggregation aggregation, Set aggregationIndexes, Set scopeIndexes); - @Message(id = ID_OFFSET_2 + 102, + @Message(id = ID_OFFSET + 102, value = "Multiple aggregations with the same key: '%1$s'") SearchException duplicateAggregationKey(@FormatWith(AggregationKeyFormatter.class) AggregationKey key); - @Message(id = ID_OFFSET_2 + 104, value = "Cannot apply a search analyzer if an analyzer has not been defined on the same field." + + @Message(id = ID_OFFSET + 104, value = "Cannot apply a search analyzer if an analyzer has not been defined on the same field." + " Search analyzer: '%1$s'.") SearchException searchAnalyzerWithoutAnalyzer(String searchAnalyzer, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 105, + @Message(id = ID_OFFSET + 105, value = "Multiple conflicting models for object field '%1$s': '%2$s' vs. '%3$s'.") SearchException conflictingObjectFieldModel(String absoluteFieldPath, LuceneSearchObjectFieldContext index1Model, LuceneSearchObjectFieldContext index2Model, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 106, + @Message(id = ID_OFFSET + 106, value = "Multiple conflicting models for field '%1$s': '%2$s' vs. '%3$s'.") SearchException conflictingFieldModel(String absoluteFieldPath, AbstractLuceneIndexSchemaFieldNode fieldNode1, AbstractLuceneIndexSchemaFieldNode fieldNode2, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 107, value = "Search query exceeded the timeout of %1$s: '%2$s'.") + @Message(id = ID_OFFSET + 107, value = "Search query exceeded the timeout of %1$s: '%2$s'.") SearchTimeoutException timedOut(@FormatWith(DurationInSecondsAndFractionsFormatter.class) Duration timeout, String queryDescription); - @Message(id = ID_OFFSET_2 + 108, + @Message(id = ID_OFFSET + 108, value = "Invalid I/O strategy name: '%1$s'. Valid names are: %2$s.") SearchException invalidIOStrategyName(String invalidRepresentation, List validRepresentations); - @Message(id = ID_OFFSET_2 + 109, + @Message(id = ID_OFFSET + 109, value = "Index does not exist for directory '%1$s'") SearchException missingIndex(Directory directory, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 110, + @Message(id = ID_OFFSET + 110, value = "Unable to validate index directory: %1$s") SearchException unableToValidateIndexDirectory(String causeMessage, @Param EventContext context, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 111, + @Message(id = ID_OFFSET + 111, value = "Unable to drop index directory: %1$s") SearchException unableToDropIndexDirectory(String causeMessage, @Param EventContext context, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 113, value = "Simple query string targets fields [%1$s, %3$s] spanning multiple nested paths: %2$s, %4$s.") + @Message(id = ID_OFFSET + 113, value = "Simple query string targets fields [%1$s, %3$s] spanning multiple nested paths: %2$s, %4$s.") SearchException simpleQueryStringSpanningMultipleNestedPaths(String fieldPath1, String nestedPath1, String fieldPath2, String nestedPath2); - @Message(id = ID_OFFSET_2 + 114, + @Message(id = ID_OFFSET + 114, value = "Cannot compute the median across nested documents.") SearchException cannotComputeMedianAcrossNested(@Param EventContext context); - @Message(id = ID_OFFSET_2 + 115, + @Message(id = ID_OFFSET + 115, value = "Cannot compute the sum, average or median of a text field. Only min and max are supported.") SearchException cannotComputeSumOrAvgOrMedianForStringField(@Param EventContext context); - @Message(id = ID_OFFSET_2 + 116, + @Message(id = ID_OFFSET + 116, value = "Cannot compute the sum of a temporal field. Only min, max, avg and median are supported.") SearchException cannotComputeSumForTemporalField(@Param EventContext context); - @Message(id = ID_OFFSET_2 + 117, + @Message(id = ID_OFFSET + 117, value = "Cannot compute the sum for a distance sort. Only min, max, avg and median are supported.") SearchException cannotComputeSumForDistanceSort(@Param EventContext context); - @Message(id = ID_OFFSET_2 + 118, + @Message(id = ID_OFFSET + 118, value = "A failure occurred during a low-level write operation" + " and the index writer had to be reset." + " Some write operations may have been lost as a result." @@ -514,31 +511,31 @@ SearchException unableToDropIndexDirectory(String causeMessage, SearchException uncommittedOperationsBecauseOfFailure(String causeMessage, @Param EventContext context, @Cause Throwable cause); - @Message(id = ID_OFFSET_2 + 120, + @Message(id = ID_OFFSET + 120, value = "Field '%1$s' is not contained in a nested object." + " Sort filters are only available if the field to sort on is contained in a nested object.") SearchException cannotFilterSortOnRootDocumentField(String absoluteFieldPath, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 121, + @Message(id = ID_OFFSET + 121, value = "Predicate targets unexpected fields %2$s." + " Only fields that are contained in the nested object with path '%1$s'" + " are allowed here.") SearchException invalidNestedObjectPathForPredicate(String nestedObjectPath, List fieldPaths); - @Message(id = ID_OFFSET_2 + 122, + @Message(id = ID_OFFSET + 122, value = "Field '%1$s' is not contained in a nested object." + " Aggregation filters are only available if the field to aggregate on is contained in a nested object.") SearchException cannotFilterAggregationOnRootDocumentField(String absoluteFieldPath, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 123, + @Message(id = ID_OFFSET + 123, value = "IndexWriter setting '%1$s' cannot be set to '%2$s': %3$s") SearchException illegalIndexWriterSetting(String settingName, Object settingValue, String message, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 124, + @Message(id = ID_OFFSET + 124, value = "Merge policy setting '%1$s' cannot be set to '%2$s': %3$s") SearchException illegalMergePolicySetting(String settingName, Object settingValue, String message, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 125, + @Message(id = ID_OFFSET + 125, value = "The index field template '%1$s' was added twice." + " Multiple bridges may be trying to access the same index field template, " + " or two indexed-embeddeds may have prefixes that lead to conflicting field names," @@ -546,78 +543,78 @@ SearchException uncommittedOperationsBecauseOfFailure(String causeMessage, + " In any case, there is something wrong with your mapping and you should fix it.") SearchException indexSchemaFieldTemplateNameConflict(String name, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 126, + @Message(id = ID_OFFSET + 126, value = "Invalid value type. This field's values are of type '%1$s', which is not assignable from '%2$s'.") SearchException invalidFieldValueType(@FormatWith(ClassFormatter.class) Class fieldValueType, @FormatWith(ClassFormatter.class) Class invalidValueType, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 127, + @Message(id = ID_OFFSET + 127, value = "Unknown field '%1$s'.") SearchException unknownFieldForIndexing(String absoluteFieldPath, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 128, + @Message(id = ID_OFFSET + 128, value = "Invalid type: the index root is not an object field.") SearchException invalidIndexElementTypeRootIsNotObjectField(); - @Message(id = ID_OFFSET_2 + 129, + @Message(id = ID_OFFSET + 129, value = "Invalid type: '%1$s' is a value field, not an object field.") SearchException invalidIndexElementTypeValueFieldIsNotObjectField(String absolutePath); - @Message(id = ID_OFFSET_2 + 130, + @Message(id = ID_OFFSET + 130, value = "Invalid type: '%1$s' is an object field, not a value field.") SearchException invalidIndexElementTypeObjectFieldIsNotValueField(String absolutePath); - @Message(id = ID_OFFSET_2 + 131, + @Message(id = ID_OFFSET + 131, value = "Projection on field '%1$s' cannot be single-valued, because this field is multi-valued." + " Make sure to call '.multi()' when you create the projection.") SearchException invalidSingleValuedProjectionOnMultiValuedField(String absolutePath, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 132, value = "Cannot use '%2$s' on field '%1$s'." + @Message(id = ID_OFFSET + 132, value = "Cannot use '%2$s' on field '%1$s'." + " Make sure the field is marked as searchable/sortable/projectable/aggregable (whichever is relevant)." + " If it already is, then '%2$s' is not available for fields of this type.") SearchException cannotUseQueryElementForField(String absoluteFieldPath, String queryElementName, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 133, + @Message(id = ID_OFFSET + 133, value = "Inconsistent support for '%1$s': %2$s") SearchException inconsistentSupportForQueryElement(String queryElementName, String causeMessage, @Cause SearchException cause); - @Message(id = ID_OFFSET_2 + 134, + @Message(id = ID_OFFSET + 134, value = "Field attribute '%1$s' differs: '%2$s' vs. '%3$s'.") SearchException differentFieldAttribute(String attributeName, Object component1, Object component2); - @Message(id = ID_OFFSET_2 + 135, + @Message(id = ID_OFFSET + 135, value = "Implementation class differs: '%1$s' vs. '%2$s'.") SearchException differentImplementationClassForQueryElement(@FormatWith(ClassFormatter.class) Class class1, @FormatWith(ClassFormatter.class) Class class2); - @Message(id = ID_OFFSET_2 + 136, + @Message(id = ID_OFFSET + 136, value = "Field codec differs: '%1$s' vs. '%2$s'.") SearchException differentFieldCodecForQueryElement(Object codec1, Object codec2); - @Message(id = ID_OFFSET_2 + 137, + @Message(id = ID_OFFSET + 137, value = "'%1$s' can be used in some of the targeted indexes, but not all of them." + " Make sure the field is marked as searchable/sortable/projectable/aggregable (whichever is relevant) in all indexes," + " and that the field has the same type in all indexes.") SearchException partialSupportForQueryElement(String queryElementName); @LogMessage(level = WARN) - @Message(id = ID_OFFSET_2 + 138, value = "Using deprecated filesystem access strategy '%1$s'," + @Message(id = ID_OFFSET + 138, value = "Using deprecated filesystem access strategy '%1$s'," + " which will be removed in a future version of Lucene." + " %2$s") void deprecatedFileSystemAccessStrategy(String accessStrategyName, @FormatWith(EventContextFormatter.class) EventContext eventContext); - @Message(id = ID_OFFSET_2 + 139, value = "Cannot use '%2$s' on field '%1$s'." + @Message(id = ID_OFFSET + 139, value = "Cannot use '%2$s' on field '%1$s'." + " '%2$s' is not available for object fields.") SearchException cannotUseQueryElementForObjectField(String absoluteFieldPath, String queryElementName, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 140, value = "Cannot use '%2$s' on field '%1$s': %3$s") + @Message(id = ID_OFFSET + 140, value = "Cannot use '%2$s' on field '%1$s': %3$s") SearchException cannotUseQueryElementForObjectFieldBecauseCreationException(String absoluteFieldPath, String queryElementName, String causeMessage, @Cause SearchException cause, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 141, + @Message(id = ID_OFFSET + 141, value = "Unable to compute size of index.") SearchException unableToComputeIndexSize(@Param EventContext context, @Cause Exception e); } diff --git a/batch-jsr352/core/src/main/java/org/hibernate/search/batch/jsr352/core/logging/impl/Log.java b/batch-jsr352/core/src/main/java/org/hibernate/search/batch/jsr352/core/logging/impl/Log.java index 250c508049d..a747facbc4c 100644 --- a/batch-jsr352/core/src/main/java/org/hibernate/search/batch/jsr352/core/logging/impl/Log.java +++ b/batch-jsr352/core/src/main/java/org/hibernate/search/batch/jsr352/core/logging/impl/Log.java @@ -29,27 +29,14 @@ */ @MessageLogger(projectCode = MessageConstants.PROJECT_CODE) @ValidIdRanges({ - @ValidIdRange(min = MessageConstants.BATCH_JSR352_CORE_ID_RANGE_MIN, max = MessageConstants.BATCH_JSR352_CORE_ID_RANGE_MAX), - // Exceptions for legacy messages from Search 5 (engine module) - // TODO HSEARCH-3308 add exceptions here for legacy messages from Search 5 (engine module). + @ValidIdRange(min = MessageConstants.BATCH_JSR352_CORE_ID_RANGE_MIN, + max = MessageConstants.BATCH_JSR352_CORE_ID_RANGE_MAX), }) public interface Log extends BasicLogger { - // ----------------------------------- - // Pre-existing messages from Search 5 (engine module) - // DO NOT ADD ANY NEW MESSAGES HERE - // ----------------------------------- - int ID_OFFSET_1 = MessageConstants.ENGINE_ID_RANGE_MIN; + int ID_OFFSET = MessageConstants.BATCH_JSR352_CORE_ID_RANGE_MIN; - // TODO HSEARCH-3308 migrate relevant messages from Search 5 (engine module) here - - // ----------------------------------- - // Pre-existing messages from Search 5 (ES module) - // DO NOT ADD ANY NEW MESSAGES HERE - // ----------------------------------- - int ID_OFFSET_2 = MessageConstants.BATCH_JSR352_CORE_ID_RANGE_MIN; - - @Message(id = ID_OFFSET_2 + 1, + @Message(id = ID_OFFSET + 1, value = "An '" + MassIndexingJobParameters.ENTITY_MANAGER_FACTORY_NAMESPACE + "' parameter was defined," + " but the '" + MassIndexingJobParameters.ENTITY_MANAGER_FACTORY_REFERENCE + "' parameter is empty." + " Please also set the '" + MassIndexingJobParameters.ENTITY_MANAGER_FACTORY_REFERENCE + "' parameter" @@ -58,11 +45,11 @@ public interface Log extends BasicLogger { ) SearchException entityManagerFactoryReferenceIsEmpty(); - @Message(id = ID_OFFSET_2 + 3, + @Message(id = ID_OFFSET + 3, value = "Unknown entity manager factory namespace: '%1$s'. Please use a supported namespace.") SearchException unknownEntityManagerFactoryNamespace(String namespace); - @Message(id = ID_OFFSET_2 + 6, + @Message(id = ID_OFFSET + 6, value = "No entity manager factory has been created with this persistence unit name yet: '%1$s'." + " Make sure you use the JPA API to create your entity manager factory (use a 'persistence.xml' file)" + " and that the entity manager factory has already been created and wasn't closed before" @@ -70,7 +57,7 @@ public interface Log extends BasicLogger { ) SearchException cannotFindEntityManagerFactoryByPUName(String persistentUnitName); - @Message(id = ID_OFFSET_2 + 7, + @Message(id = ID_OFFSET + 7, value = "No entity manager factory has been created with this name yet: '%1$s'." + " Make sure your entity manager factory is named (for instance by setting the '" + AvailableSettings.SESSION_FACTORY_NAME + "' option) and that the entity manager factory has" @@ -78,14 +65,14 @@ public interface Log extends BasicLogger { ) SearchException cannotFindEntityManagerFactoryByName(String entityManagerFactoryName); - @Message(id = ID_OFFSET_2 + 8, + @Message(id = ID_OFFSET + 8, value = "No entity manager factory has been created yet." + " Make sure that the entity manager factory has already been created and wasn't closed before" + " you launched the job." ) SearchException noEntityManagerFactoryCreated(); - @Message(id = ID_OFFSET_2 + 9, + @Message(id = ID_OFFSET + 9, value = "Multiple entity manager factories are currently active." + " Please provide the name of the selected persistence unit to the batch indexing job through" + " the '" + MassIndexingJobParameters.ENTITY_MANAGER_FACTORY_REFERENCE @@ -95,116 +82,111 @@ public interface Log extends BasicLogger { SearchException tooManyActiveEntityManagerFactories(); @LogMessage(level = Level.INFO) - @Message(id = ID_OFFSET_2 + 10, + @Message(id = ID_OFFSET + 10, value = "%1$s" ) void analyzeIndexProgress(String progress); @LogMessage(level = Level.INFO) - @Message(id = ID_OFFSET_2 + 15, + @Message(id = ID_OFFSET + 15, value = "Optimizing all entities ..." ) void startOptimization(); @LogMessage(level = Level.DEBUG) - @Message(id = ID_OFFSET_2 + 16, + @Message(id = ID_OFFSET + 16, value = "%1$d criteria found." ) void criteriaSize(int size); @LogMessage(level = Level.DEBUG) - @Message(id = ID_OFFSET_2 + 17, + @Message(id = ID_OFFSET + 17, value = "Checkpoint reached. Sending checkpoint ID to batch runtime... (entity='%1$s', checkpointInfo='%2$s')" ) void checkpointReached(String entityName, Object checkpointInfo); @LogMessage(level = Level.DEBUG) - @Message(id = ID_OFFSET_2 + 18, + @Message(id = ID_OFFSET + 18, value = "Opening EntityReader of partitionId='%1$s', entity='%2$s'." ) void openingReader(String partitionId, String entityName); @LogMessage(level = Level.DEBUG) - @Message(id = ID_OFFSET_2 + 19, + @Message(id = ID_OFFSET + 19, value = "Closing EntityReader of partitionId='%1$s', entity='%2$s'." ) void closingReader(String partitionId, String entityName); @LogMessage(level = Level.TRACE) - @Message(id = ID_OFFSET_2 + 21, + @Message(id = ID_OFFSET + 21, value = "Reading entity..." ) void readingEntity(); @LogMessage(level = Level.INFO) - @Message(id = ID_OFFSET_2 + 22, + @Message(id = ID_OFFSET + 22, value = "No more results, read ends." ) void noMoreResults(); @LogMessage(level = Level.TRACE) - @Message(id = ID_OFFSET_2 + 23, + @Message(id = ID_OFFSET + 23, value = "Processing entity with id: '%1$s'" ) void processEntity(Object entityId); @LogMessage(level = Level.INFO) - @Message(id = ID_OFFSET_2 + 26, + @Message(id = ID_OFFSET + 26, value = "%1$d partitions, %2$d threads." ) void partitionsPlan(int partitionSize, int threadSize); @LogMessage(level = Level.INFO) - @Message(id = ID_OFFSET_2 + 27, + @Message(id = ID_OFFSET + 27, value = "entityName: '%1$s', rowsToIndex: %2$d") void rowsToIndex(String entityName, Long rowsToIndex); - @Message(id = ID_OFFSET_2 + 28, + @Message(id = ID_OFFSET + 28, value = "Failed to serialize job parameter of type %1$s") SearchException failedToSerializeJobParameter(@FormatWith(ClassFormatter.class) Class type, @Cause Throwable e); - @Message(id = ID_OFFSET_2 + 29, + @Message(id = ID_OFFSET + 29, value = "Unable to parse value '%2$s' for job parameter '%1$s'." ) SearchException unableToParseJobParameter(String parameterName, Object parameterValue, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 30, + @Message(id = ID_OFFSET + 30, value = "The value of parameter '" + MassIndexingJobParameters.CHECKPOINT_INTERVAL + "' (value=%1$d) should be equal to or less than the value of parameter '" + MassIndexingJobParameters.ROWS_PER_PARTITION + "' (value=%2$d)." ) SearchException illegalCheckpointInterval(int checkpointInterval, int rowsPerPartition); - @Message(id = ID_OFFSET_2 + 31, + @Message(id = ID_OFFSET + 31, value = "The value of parameter '%1$s' (value=%2$d) should be greater than 0." ) SearchException negativeValueOrZero(String parameterName, Number parameterValue); - @Message(id = ID_OFFSET_2 + 32, + @Message(id = ID_OFFSET + 32, value = "The following selected entity types aren't indexable: %1$s. Please check if the annotation" + " '@Indexed' has been added to each of them." ) SearchException failingEntityTypes(String failingEntityNames); - @Message(id = ID_OFFSET_2 + 33, + @Message(id = ID_OFFSET + 33, value = "The value of parameter '" + MassIndexingJobParameters.SESSION_CLEAR_INTERVAL + "' (value=%1$d) should be equal to or less than the value of parameter '" + MassIndexingJobParameters.CHECKPOINT_INTERVAL + "' (value=%2$d)." ) SearchException illegalSessionClearInterval(int sessionClearInterval, int checkpointInterval); - // ----------------------------------- - // New messages from Search 6 onwards - // ----------------------------------- - int ID_OFFSET_3 = MessageConstants.BATCH_JSR352_CORE_ID_RANGE_MIN + 500; - @LogMessage(level = Level.DEBUG) - @Message(id = ID_OFFSET_3 + 1, + @Message(id = ID_OFFSET + 34, value = "Opening EntityWriter of partitionId='%1$s', entity='%2$s'.") void openingEntityWriter(String partitionId, String entityName); @LogMessage(level = Level.DEBUG) - @Message(id = ID_OFFSET_3 + 2, + @Message(id = ID_OFFSET + 35, value = "Closing EntityWriter of partitionId='%1$s', entity='%2$s'.") void closingEntityWriter(String partitionId, String entityName); diff --git a/batch-jsr352/jberet/src/main/java/org/hibernate/search/batch/jsr352/jberet/logging/impl/Log.java b/batch-jsr352/jberet/src/main/java/org/hibernate/search/batch/jsr352/jberet/logging/impl/Log.java index 8285e98328c..5a10aa1ec5e 100644 --- a/batch-jsr352/jberet/src/main/java/org/hibernate/search/batch/jsr352/jberet/logging/impl/Log.java +++ b/batch-jsr352/jberet/src/main/java/org/hibernate/search/batch/jsr352/jberet/logging/impl/Log.java @@ -17,10 +17,11 @@ @MessageLogger(projectCode = MessageConstants.PROJECT_CODE) @ValidIdRanges({ - // Search 5 : - @ValidIdRange(min = MessageConstants.BATCH_JSR352_CORE_ID_RANGE_MIN, max = MessageConstants.BATCH_JSR352_CORE_ID_RANGE_MIN + 5), - // Search 6 : - @ValidIdRange(min = MessageConstants.BATCH_JSR352_JBERET_ID_RANGE_MIN, max = MessageConstants.BATCH_JSR352_JBERET_ID_RANGE_MAX) + @ValidIdRange(min = MessageConstants.BATCH_JSR352_JBERET_ID_RANGE_MIN, + max = MessageConstants.BATCH_JSR352_JBERET_ID_RANGE_MAX), + // Exceptions for legacy messages from Search 5 (JSR-352 Core module) + @ValidIdRange(min = MessageConstants.BATCH_JSR352_CORE_ID_RANGE_MIN, + max = MessageConstants.BATCH_JSR352_CORE_ID_RANGE_MIN + 5), }) public interface Log extends BasicLogger { @@ -28,26 +29,26 @@ public interface Log extends BasicLogger { // Pre-existing messages from Search 5 (JSR-352 Core module) // DO NOT ADD ANY NEW MESSAGES HERE // ----------------------------------- - int ID_OFFSET_1 = MessageConstants.BATCH_JSR352_CORE_ID_RANGE_MIN; + int ID_OFFSET_LEGACY = MessageConstants.BATCH_JSR352_CORE_ID_RANGE_MIN; - @Message(id = ID_OFFSET_1 + 2, + @Message(id = ID_OFFSET_LEGACY + 2, value = "No entity manager factory available in the CDI context with this bean name: '%1$s'." + " Make sure your entity manager factory is a named bean." ) SearchException noAvailableEntityManagerFactoryInCDI(String reference); - @Message(id = ID_OFFSET_1 + 3, + @Message(id = ID_OFFSET_LEGACY + 3, value = "Unknown entity manager factory namespace: '%1$s'. Please use a supported namespace.") SearchException unknownEntityManagerFactoryNamespace(String namespace); - @Message(id = ID_OFFSET_1 + 4, + @Message(id = ID_OFFSET_LEGACY + 4, value = "Exception while retrieving the EntityManagerFactory using @PersistenceUnit." + " This generally happens either because the persistence wasn't configured properly" + " or because there are multiple persistence units." ) SearchException cannotRetrieveEntityManagerFactoryInJsr352(); - @Message(id = ID_OFFSET_1 + 5, + @Message(id = ID_OFFSET_LEGACY + 5, value = "Multiple entity manager factories have been registered in the CDI context." + " Please provide the bean name for the selected entity manager factory to the batch indexing job through" + " the 'entityManagerFactoryReference' parameter." @@ -57,6 +58,6 @@ public interface Log extends BasicLogger { // ----------------------------------- // New messages from Search 6 onwards // ----------------------------------- - int ID_OFFSET_2 = MessageConstants.BATCH_JSR352_JBERET_ID_RANGE_MIN; + int ID_OFFSET = MessageConstants.BATCH_JSR352_JBERET_ID_RANGE_MIN; } diff --git a/engine/src/main/java/org/hibernate/search/engine/logging/impl/Log.java b/engine/src/main/java/org/hibernate/search/engine/logging/impl/Log.java index 53928a550af..0df4350e62d 100644 --- a/engine/src/main/java/org/hibernate/search/engine/logging/impl/Log.java +++ b/engine/src/main/java/org/hibernate/search/engine/logging/impl/Log.java @@ -42,71 +42,66 @@ @MessageLogger(projectCode = MessageConstants.PROJECT_CODE) @ValidIdRanges({ @ValidIdRange(min = MessageConstants.ENGINE_ID_RANGE_MIN, max = MessageConstants.ENGINE_ID_RANGE_MAX), - // Exceptions for legacy messages from Search 5 - - // TODO HSEARCH-3308 add exceptions here for legacy messages from Search 5. See the Lucene logger for examples. }) public interface Log extends BasicLogger { // ----------------------------------- - // Pre-existing messages from Search 5 + // Pre-existing messages from Search 5 (engine module) // DO NOT ADD ANY NEW MESSAGES HERE // ----------------------------------- - int ID_OFFSET_1 = MessageConstants.ENGINE_ID_RANGE_MIN; + int ID_OFFSET_LEGACY = MessageConstants.ENGINE_ID_RANGE_MIN; @LogMessage(level = DEBUG) - @Message(id = ID_OFFSET_1 + 230, value = "Starting executor '%1$s'" ) + @Message(id = ID_OFFSET_LEGACY + 230, value = "Starting executor '%1$s'" ) void startingExecutor(String name); @LogMessage(level = DEBUG) - @Message(id = ID_OFFSET_1 + 231, value = "Stopping executor '%1$s'") + @Message(id = ID_OFFSET_LEGACY + 231, value = "Stopping executor '%1$s'") void stoppingExecutor(String indexName); - @Message(id = ID_OFFSET_1 + 242, + @Message(id = ID_OFFSET_LEGACY + 242, value = "Hibernate Search failed to initialize component '%1$s' as class '%2$s' doesn't have a public no-arguments constructor") SearchException noPublicNoArgConstructor(String componentName, @FormatWith(ClassFormatter.class) Class clazz); - // TODO HSEARCH-3308 migrate relevant messages from Search 5 here - // ----------------------------------- // New messages from Search 6 onwards // ----------------------------------- - int ID_OFFSET_2 = MessageConstants.ENGINE_ID_RANGE_MIN + 500; + int ID_OFFSET = MessageConstants.ENGINE_ID_RANGE_MIN + 500; - @Message(id = ID_OFFSET_2 + 1, + @Message(id = ID_OFFSET + 1, value = "Unable to convert configuration property '%1$s' with value '%2$s': %3$s") SearchException unableToConvertConfigurationProperty(String key, Object rawValue, String errorMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 2, + @Message(id = ID_OFFSET + 2, value = "Invalid value: expected either an instance of '%1$s' or a String that can be parsed. %2$s") SearchException invalidPropertyValue(@FormatWith(ClassFormatter.class) Class expectedType, String errorMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 3, + @Message(id = ID_OFFSET + 3, value = "Invalid Boolean value: expected either a Boolean, the String 'true' or the String 'false'. %1$s") SearchException invalidBooleanPropertyValue(String nestedErrorMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 4, + @Message(id = ID_OFFSET + 4, value = "Invalid Integer value: expected either a Number or a String that can be parsed into an Integer. %1$s") SearchException invalidIntegerPropertyValue(String nestedErrorMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 5, + @Message(id = ID_OFFSET + 5, value = "Invalid Long value: expected either a Number or a String that can be parsed into a Long. %1$s") SearchException invalidLongPropertyValue(String nestedErrorMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 6, + @Message(id = ID_OFFSET + 6, value = "Invalid multi value: expected either a Collection or a String.") SearchException invalidMultiPropertyValue(); - @Message(id = ID_OFFSET_2 + 12, + @Message(id = ID_OFFSET + 12, value = "Invalid value: at least one bound in range predicates must be non-null.") SearchException rangePredicateCannotMatchNullValue(@Param EventContext context); - @Message(id = ID_OFFSET_2 + 14, + @Message(id = ID_OFFSET + 14, value = "Field name '%1$s' is invalid: field names cannot be null or empty.") SearchException relativeFieldNameCannotBeNullOrEmpty(String relativeFieldName, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 15, + @Message(id = ID_OFFSET + 15, value = "Field name '%1$s' is invalid: field names cannot contain a dot ('.')." + " Remove the dot from your field name," + " or if you are declaring the field in a bridge and want a tree of fields," @@ -114,22 +109,22 @@ SearchException relativeFieldNameCannotBeNullOrEmpty(String relativeFieldName, SearchException relativeFieldNameCannotContainDot(String relativeFieldName, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 16, + @Message(id = ID_OFFSET + 16, value = "Invalid polygon: the first point '%1$s' should be identical to the last point '%2$s' to properly close the polygon." ) IllegalArgumentException invalidGeoPolygonFirstPointNotIdenticalToLastPoint(GeoPoint firstPoint, GeoPoint lastPoint); - @Message(id = ID_OFFSET_2 + 19, + @Message(id = ID_OFFSET + 19, value = "Hibernate Search encountered failures during %1$s. Stopped collecting failures after '%3$s' failures." + " Failures:\n%2$s") SearchException collectedFailureLimitReached(String process, String renderedFailures, int failureCount); - @Message(id = ID_OFFSET_2 + 20, + @Message(id = ID_OFFSET + 20, value = "Hibernate Search encountered failures during %1$s." + " Failures:\n%2$s") SearchException collectedFailures(String process, String renderedFailures); @LogMessage(level = Logger.Level.ERROR) - @Message(id = ID_OFFSET_2 + 21, + @Message(id = ID_OFFSET + 21, value = "Hibernate Search encountered a failure during %1$s;" + " continuing for now to list all problems," + " but the process will ultimately be aborted.\n" @@ -139,134 +134,134 @@ SearchException relativeFieldNameCannotContainDot(String relativeFieldName, void newCollectedFailure(String process, String context, @Cause Throwable failure); @LogMessage(level = Logger.Level.DEBUG) - @Message(id = ID_OFFSET_2 + 22, + @Message(id = ID_OFFSET + 22, value = "Unexpected empty event context; there is a bug in Hibernate Search, please report it") void unexpectedEmptyEventContext(@Cause Throwable exceptionForStackTrace); - @Message(id = ID_OFFSET_2 + 25, + @Message(id = ID_OFFSET + 25, value = "Cannot call ifSupported(...) after orElse(...)." + " Use a separate extension() context, or move the orElse(...) call last." ) SearchException cannotCallDslExtensionIfSupportedAfterOrElse(); - @Message(id = ID_OFFSET_2 + 26, + @Message(id = ID_OFFSET + 26, value = "None of the provided extensions can be applied to the current context. " + " Attempted extensions: %1$s." + " If you want to ignore this, use .extension().ifSupported(...).orElse(ignored -> { })." ) SearchException dslExtensionNoMatch(List attemptedExtensions); - @Message(id = ID_OFFSET_2 + 27, value = "Unable to instantiate %1$s, class '%2$s': %3$s") + @Message(id = ID_OFFSET + 27, value = "Unable to instantiate %1$s, class '%2$s': %3$s") SearchException unableToInstantiateComponent(String componentDescription, @FormatWith(ClassFormatter.class) Class classToLoad, String causeMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 28, value = "%2$s defined for component %1$s could not be instantiated because of a security manager error") + @Message(id = ID_OFFSET + 28, value = "%2$s defined for component %1$s could not be instantiated because of a security manager error") SearchException securityManagerLoadingError(String componentDescription, @FormatWith(ClassFormatter.class) Class classToLoad, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 29, value = "Unable to find %1$s implementation class: %2$s") + @Message(id = ID_OFFSET + 29, value = "Unable to find %1$s implementation class: %2$s") SearchException unableToFindComponentImplementation(String componentDescription, String classNameToLoad, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 30, value = "Unable to load class [%1$s]") + @Message(id = ID_OFFSET + 30, value = "Unable to load class [%1$s]") ClassLoadingException unableToLoadTheClass(String className, @Cause Throwable cause); - @Message(id = ID_OFFSET_2 + 33, value = "No backend registered for backend name: '%1$s'.") + @Message(id = ID_OFFSET + 33, value = "No backend registered for backend name: '%1$s'.") SearchException noBackendRegistered(String backendName); - @Message(id = ID_OFFSET_2 + 34, value = "No index manager registered for index manager name: '%1$s'.") + @Message(id = ID_OFFSET + 34, value = "No index manager registered for index manager name: '%1$s'.") SearchException noIndexManagerRegistered(String indexManagerName); - @Message(id = ID_OFFSET_2 + 40, value = "Unable to instantiate class '%1$s': %2$s.") + @Message(id = ID_OFFSET + 40, value = "Unable to instantiate class '%1$s': %2$s.") SearchException unableToInstantiateClass(@FormatWith(ClassFormatter.class) Class classToLoad, String causeMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 41, value = "Wrong configuration of %1$s: class %2$s does not implement interface %3$s.") + @Message(id = ID_OFFSET + 41, value = "Wrong configuration of %1$s: class %2$s does not implement interface %3$s.") SearchException interfaceImplementedExpected(String component, @FormatWith(ClassFormatter.class) Class classToLoad, @FormatWith(ClassFormatter.class) Class superType); - @Message(id = ID_OFFSET_2 + 42, value = "Wrong configuration of %1$s: class %2$s is not a subtype of %3$s.") + @Message(id = ID_OFFSET + 42, value = "Wrong configuration of %1$s: class %2$s is not a subtype of %3$s.") SearchException subtypeExpected(String component, @FormatWith(ClassFormatter.class) Class classToLoad, @FormatWith(ClassFormatter.class) Class superType); - @Message(id = ID_OFFSET_2 + 43, value = "%2$s defined for component %1$s is an interface: implementation required.") + @Message(id = ID_OFFSET + 43, value = "%2$s defined for component %1$s is an interface: implementation required.") SearchException implementationRequired(String component, @FormatWith(ClassFormatter.class) Class classToLoad); - @Message(id = ID_OFFSET_2 + 44, value = "%2$s defined for component %1$s is missing an appropriate constructor: expected a public constructor with a single parameter of type Map.") + @Message(id = ID_OFFSET + 44, value = "%2$s defined for component %1$s is missing an appropriate constructor: expected a public constructor with a single parameter of type Map.") SearchException missingConstructor(String component, @FormatWith(ClassFormatter.class) Class classToLoad); - @Message(id = ID_OFFSET_2 + 45, value = "Unable to load class for %1$s. Configured implementation %2$s is not assignable to type %3$s.") + @Message(id = ID_OFFSET + 45, value = "Unable to load class for %1$s. Configured implementation %2$s is not assignable to type %3$s.") SearchException notAssignableImplementation(String component, String classToLoad, @FormatWith(ClassFormatter.class) Class superType); - @Message(id = ID_OFFSET_2 + 46, value = "Found an infinite IndexedEmbedded recursion involving path '%1$s' on type '%2$s'.") + @Message(id = ID_OFFSET + 46, value = "Found an infinite IndexedEmbedded recursion involving path '%1$s' on type '%2$s'.") SearchException indexedEmbeddedCyclicRecursion(String cyclicRecursionPath, @FormatWith(MappableTypeModelFormatter.class) MappableTypeModel parentTypeModel); - @Message(id = ID_OFFSET_2 + 47, + @Message(id = ID_OFFSET + 47, value = "Invalid BeanReference value: expected an instance of '%1$s', BeanReference, String or Class. %2$s") SearchException invalidBeanReferencePropertyValue(@FormatWith(ClassFormatter.class) Class expectedType, String nestedErrorMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 48, + @Message(id = ID_OFFSET + 48, value = "Invalid bean type: type '%2$s' is not assignable to '%1$s'.") SearchException invalidBeanType( @FormatWith(ClassFormatter.class) Class expectedSuperType, @FormatWith(ClassFormatter.class) Class actualType); - @Message(id = ID_OFFSET_2 + 51, + @Message(id = ID_OFFSET + 51, value = "It is not possible to use per-field boosts together with withConstantScore option" ) SearchException perFieldBoostWithConstantScore(); - @Message(id = ID_OFFSET_2 + 53, + @Message(id = ID_OFFSET + 53, value = "Invalid slop: %1$d. The slop must be positive or zero.") SearchException invalidPhrasePredicateSlop(int slop); - @Message(id = ID_OFFSET_2 + 54, + @Message(id = ID_OFFSET + 54, value = "Invalid maximum edit distance: %1$d. The value must be 0, 1 or 2.") SearchException invalidFuzzyMaximumEditDistance(int maximumEditDistance); - @Message(id = ID_OFFSET_2 + 55, + @Message(id = ID_OFFSET + 55, value = "Invalid exact prefix length: %1$d. The value must be positive or zero.") SearchException invalidExactPrefixLength(int exactPrefixLength); - @Message(id = ID_OFFSET_2 + 57, value = "'%1$s' instance cannot be parsed from value: '%2$s', using the expected formatter: '%3$s'.") + @Message(id = ID_OFFSET + 57, value = "'%1$s' instance cannot be parsed from value: '%2$s', using the expected formatter: '%3$s'.") SearchException unableToParseTemporal(@FormatWith(SimpleNameClassFormatter.class) Class type, String value, DateTimeFormatter formatter, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 58, value = "Invalid %1$s value: expected either a Number or a String that can be parsed into a %1$s. %2$s") + @Message(id = ID_OFFSET + 58, value = "Invalid %1$s value: expected either a Number or a String that can be parsed into a %1$s. %2$s") SearchException invalidNumberPropertyValue(@FormatWith(SimpleNameClassFormatter.class) Class type, String nestedErrorMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 59, value = "Invalid '%1$s' value for type '%2$s'.") + @Message(id = ID_OFFSET + 59, value = "Invalid '%1$s' value for type '%2$s'.") SearchException invalidStringForType(String value, @FormatWith(ClassFormatter.class) Class type, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 60, value = "Invalid '%1$s' value for enum '%2$s'.") + @Message(id = ID_OFFSET + 60, value = "Invalid '%1$s' value for enum '%2$s'.") SearchException invalidStringForEnum(String value, @FormatWith(ClassFormatter.class) Class enumType, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 61, value = "Multiple hits when a single hit was expected.") + @Message(id = ID_OFFSET + 61, value = "Multiple hits when a single hit was expected.") SearchException nonSingleHit(); - @Message(id = ID_OFFSET_2 + 62, + @Message(id = ID_OFFSET + 62, value = "The thread was interrupted while a work was being submitted to '%1$s'." + " The work has been discarded." ) SearchException threadInterruptedWhileSubmittingWork(String orchestratorName); - @Message(id = ID_OFFSET_2 + 63, + @Message(id = ID_OFFSET + 63, value = "A work was submitted to '%1$s', but this orchestrator was stopped." + " The work has been discarded." ) SearchException submittedWorkToStoppedOrchestrator(String orchestratorName); - @Message(id = ID_OFFSET_2 + 64, value = "Unable to parse the provided geo-point value: '%1$s'. The expected format is latitude, longitude.") + @Message(id = ID_OFFSET + 64, value = "Unable to parse the provided geo-point value: '%1$s'. The expected format is latitude, longitude.") SearchException unableToParseGeoPoint(String value); - @Message(id = ID_OFFSET_2 + 65, + @Message(id = ID_OFFSET + 65, value = "Unknown aggregation key '%1$s'. This key was not used when building the search query." ) SearchException unknownAggregationKey(AggregationKey key); - @Message(id = ID_OFFSET_2 + 66, + @Message(id = ID_OFFSET + 66, value = "Invalid configuration property checking strategy name: '%1$s'. Valid names are: %2$s.") SearchException invalidConfigurationPropertyCheckingStrategyName(String invalidRepresentation, List validRepresentations); @LogMessage(level = Logger.Level.INFO) - @Message(id = ID_OFFSET_2 + 67, + @Message(id = ID_OFFSET + 67, value = "Configuration property tracking is disabled; unused properties will not be logged.") void configurationPropertyTrackingDisabled(); @LogMessage(level = Logger.Level.WARN) - @Message(id = ID_OFFSET_2 + 68, + @Message(id = ID_OFFSET + 68, value = "Some properties in the Hibernate Search configuration were not used;" + " there might be misspelled property keys in your configuration. Unused properties were: %1$s." + " To disable this warning, set the property '%2$s' to '%3$s'.") @@ -274,83 +269,83 @@ void configurationPropertyTrackingUnusedProperties(Set propertyKeys, Str String disableWarningValue); @LogMessage(level = Logger.Level.ERROR) - @Message(id = ID_OFFSET_2 + 69, + @Message(id = ID_OFFSET + 69, value = "The background failure handler threw an exception while handling a previous failure." + " The failure may not have been reported.") void failureInFailureHandler(@Cause Throwable t); - @Message(id = ID_OFFSET_2 + 70, + @Message(id = ID_OFFSET + 70, value = "Field template name '%1$s' is invalid: field template names cannot be null or empty.") SearchException fieldTemplateNameCannotBeNullOrEmpty(String templateName, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 71, + @Message(id = ID_OFFSET + 71, value = "Field template name '%1$s' is invalid: field template names cannot contain a dot ('.').") SearchException fieldTemplateNameCannotContainDot(String relativeFieldName, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 72, + @Message(id = ID_OFFSET + 72, value = "Found multiple values while projecting on a supposedly single-valued field: [%1$s, %2$s].") SearchException unexpectedMultiValuedField(Object value1, Object value2); - @Message(id = ID_OFFSET_2 + 73, + @Message(id = ID_OFFSET + 73, value = "Some properties in the given Hibernate Search configuration were only valid in Hibernate Search 5" + " and are now obsolete: configuration properties changed in Hibernate Search 6." + " Check out the reference documentation and upgrade your configuration." + " Obsolete properties: %1$s.") SearchException obsoleteConfigurationPropertiesFromSearch5(Set propertyKeys); - @Message(id = ID_OFFSET_2 + 75, value = "No default backend registered.") + @Message(id = ID_OFFSET + 75, value = "No default backend registered.") SearchException noDefaultBackendRegistered(); - @Message(id = ID_OFFSET_2 + 76, value = "Multiple beans registered for type '%1$s': %2$s.") + @Message(id = ID_OFFSET + 76, value = "Multiple beans registered for type '%1$s': %2$s.") SearchException multipleConfiguredBeanReferencesForType(@FormatWith(ClassFormatter.class) Class exposedType, List> references); - @Message(id = ID_OFFSET_2 + 77, value = "No beans registered for type '%1$s'.") + @Message(id = ID_OFFSET + 77, value = "No beans registered for type '%1$s'.") SearchException noConfiguredBeanReferenceForType(@FormatWith(ClassFormatter.class) Class exposedType); - @Message(id = ID_OFFSET_2 + 78, value = "No beans registered for type '%1$s' and name '%2$s'.") + @Message(id = ID_OFFSET + 78, value = "No beans registered for type '%1$s' and name '%2$s'.") SearchException noConfiguredBeanReferenceForTypeAndName(@FormatWith(ClassFormatter.class) Class exposedType, String nameReference); - @Message(id = ID_OFFSET_2 + 79, value = "Cannot resolve bean reference to type '%1$s' and name '%2$s'." + @Message(id = ID_OFFSET + 79, value = "Cannot resolve bean reference to type '%1$s' and name '%2$s'." + " Failed to resolve bean from bean provider with exception: %3$s." + " Failed to resolve bean from built-in beans with exception: %4$s.") SearchException cannotResolveBeanReference(@FormatWith(ClassFormatter.class) Class typeReference, String nameReference, String beanProviderFailureMessage, String configuredBeansFailureMessage, @Cause SearchException beanProviderFailure, @Suppressed RuntimeException configuredBeansFailure); - @Message(id = ID_OFFSET_2 + 80, value = "Cannot resolve bean reference to type '%1$s'." + @Message(id = ID_OFFSET + 80, value = "Cannot resolve bean reference to type '%1$s'." + " Failed to resolve bean from bean provider with exception: %2$s." + " Failed to resolve bean from built-in beans with exception: %3$s.") SearchException cannotResolveBeanReference(@FormatWith(ClassFormatter.class) Class typeReference, String beanProviderFailureMessage, String configuredBeansFailureMessage, @Cause SearchException beanProviderFailure, @Suppressed RuntimeException configuredBeansFailure); - @Message(id = ID_OFFSET_2 + 81, value = "Configuration property '%1$s' is not set, and no backend was found in the classpath." + @Message(id = ID_OFFSET + 81, value = "Configuration property '%1$s' is not set, and no backend was found in the classpath." + " Did you forget to add the desired backend to your project's dependencies?") SearchException noBackendFactoryRegistered(String propertyKey); - @Message(id = ID_OFFSET_2 + 82, value = "Configuration property '%1$s' is not set, and multiple backend types were found in the classpath." + @Message(id = ID_OFFSET + 82, value = "Configuration property '%1$s' is not set, and multiple backend types were found in the classpath." + " Set property '%1$s' to one of the following to select the backend type: %2$s") SearchException multipleBackendFactoriesRegistered(String propertyKey, Collection backendTypeNames); - @Message(id = ID_OFFSET_2 + 83, value = "Invalid type for DSL arguments: '%1$s'. Expected '%2$s' or a subtype.") + @Message(id = ID_OFFSET + 83, value = "Invalid type for DSL arguments: '%1$s'. Expected '%2$s' or a subtype.") SearchException invalidDslArgumentType(@FormatWith(ClassFormatter.class) Class type, @FormatWith(ClassFormatter.class) Class correctType, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 84, value = "Invalid type for returned values: '%1$s'. Expected '%2$s' or a supertype.") + @Message(id = ID_OFFSET + 84, value = "Invalid type for returned values: '%1$s'. Expected '%2$s' or a supertype.") SearchException invalidOutputTypeForField(@FormatWith(ClassFormatter.class) Class type, @FormatWith(ClassFormatter.class) Class correctType, @Param EventContext context); - @Message(id = ID_OFFSET_2 + 86, value = "Search query loading exceeded the timeout of %1$s milliseconds.") + @Message(id = ID_OFFSET + 86, value = "Search query loading exceeded the timeout of %1$s milliseconds.") SearchTimeoutException timedOut(Long timeoutMs); - @Message(id = ID_OFFSET_2 + 87, value = "Trying to get the exact total hit count, but it is a lower bound.") + @Message(id = ID_OFFSET + 87, value = "Trying to get the exact total hit count, but it is a lower bound.") SearchException notExactTotalHitCount(); - @Message(id = ID_OFFSET_2 + 88, value = "Trying to target the same index '%1$s' from different types: '%2$s', '%3$s'. ") + @Message(id = ID_OFFSET + 88, value = "Trying to target the same index '%1$s' from different types: '%2$s', '%3$s'. ") SearchException twoTypesTargetSameIndex(String indexName, String mappedTypeName, String anotherMappedTypeName); } diff --git a/mapper/javabean/src/main/java/org/hibernate/search/mapper/javabean/log/impl/Log.java b/mapper/javabean/src/main/java/org/hibernate/search/mapper/javabean/log/impl/Log.java index 58394ed3c2c..3d3d2c3dcc9 100644 --- a/mapper/javabean/src/main/java/org/hibernate/search/mapper/javabean/log/impl/Log.java +++ b/mapper/javabean/src/main/java/org/hibernate/search/mapper/javabean/log/impl/Log.java @@ -23,35 +23,35 @@ @ValidIdRange(min = MessageConstants.MAPPER_JAVABEAN_ID_RANGE_MIN, max = MessageConstants.MAPPER_JAVABEAN_ID_RANGE_MAX) public interface Log extends BasicLogger { - int ID_OFFSET_1 = MessageConstants.MAPPER_JAVABEAN_ID_RANGE_MIN; + int ID_OFFSET = MessageConstants.MAPPER_JAVABEAN_ID_RANGE_MIN; - @Message(id = ID_OFFSET_1 + 3, value = "Exception while retrieving the type model for '%1$s'.") + @Message(id = ID_OFFSET + 3, value = "Exception while retrieving the type model for '%1$s'.") SearchException errorRetrievingTypeModel(@FormatWith(ClassFormatter.class) Class clazz, @Cause Exception cause); - @Message(id = ID_OFFSET_1 + 5, + @Message(id = ID_OFFSET + 5, value = "The JavaBean mapper cannot load entities," + " but there was an attempt to load the entity corresponding to document '%1$s'." + " There is probably an entity projection in the query definition: it should be removed." ) SearchException cannotLoadEntity(DocumentReference reference); - @Message(id = ID_OFFSET_1 + 6, value = "Multiple entity types configured with the same name '%1$s': '%2$s', '%3$s'") + @Message(id = ID_OFFSET + 6, value = "Multiple entity types configured with the same name '%1$s': '%2$s', '%3$s'") SearchException multipleEntityTypesWithSameName(String entityName, Class previousType, Class type); - @Message(id = ID_OFFSET_1 + 7, + @Message(id = ID_OFFSET + 7, value = "The JavaBean mapper does not support named types. The type with name '%1$s' does not exist." ) SearchException namedTypesNotSupported(String name); - @Message(id = ID_OFFSET_1 + 8, + @Message(id = ID_OFFSET + 8, value = "The JavaBean mapper cannot load entities," + " but there was an attempt to configure entity loading." ) SearchException entityLoadingConfigurationNotSupported(); - @Message(id = ID_OFFSET_1 + 9, value = "Type '%1$s' is not an entity type, or the entity is not indexed.") + @Message(id = ID_OFFSET + 9, value = "Type '%1$s' is not an entity type, or the entity is not indexed.") SearchException notIndexedEntityType(@FormatWith(ClassFormatter.class) Class type); - @Message(id = ID_OFFSET_1 + 10, value = "Entity '%1$s' does not exist or is not indexed.") + @Message(id = ID_OFFSET + 10, value = "Entity '%1$s' does not exist or is not indexed.") SearchException notIndexedEntityName(String name); } diff --git a/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/logging/impl/Log.java b/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/logging/impl/Log.java index 1cfbb697161..b66e3f499f1 100644 --- a/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/logging/impl/Log.java +++ b/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/logging/impl/Log.java @@ -42,7 +42,7 @@ @MessageLogger(projectCode = MessageConstants.PROJECT_CODE) @ValidIdRanges({ @ValidIdRange(min = MessageConstants.ORM_ID_RANGE_MIN, max = MessageConstants.ORM_ID_RANGE_MAX), - // Exceptions for legacy messages from Search 5 + // Exceptions for legacy messages from Search 5 (engine module) @ValidIdRange(min = 27, max = 28), @ValidIdRange(min = 30, max = 30), @ValidIdRange(min = 31, max = 31), @@ -57,7 +57,6 @@ @ValidIdRange(min = 235, max = 235), @ValidIdRange(min = 276, max = 276), @ValidIdRange(min = 348, max = 349) - // TODO HSEARCH-3308 add exceptions here for legacy messages from Search 5. See the Lucene logger for examples. }) public interface Log extends BasicLogger { @@ -65,42 +64,42 @@ public interface Log extends BasicLogger { // Pre-existing messages from Search 5 // DO NOT ADD ANY NEW MESSAGES HERE // ----------------------------------- - int ID_OFFSET_1 = MessageConstants.ENGINE_ID_RANGE_MIN; + int ID_OFFSET_LEGACY_ENGINE = MessageConstants.ENGINE_ID_RANGE_MIN; @LogMessage(level = INFO) - @Message(id = ID_OFFSET_1 + 27, value = "Going to reindex %d entities") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 27, value = "Going to reindex %d entities") void indexingEntities(long count); @LogMessage(level = INFO) - @Message(id = ID_OFFSET_1 + 28, value = "Reindexed %1$d entities") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 28, value = "Reindexed %1$d entities") void indexingEntitiesCompleted(long nbrOfEntities); @LogMessage(level = INFO) - @Message(id = ID_OFFSET_1 + 30, value = "%1$d documents indexed in %2$d ms") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 30, value = "%1$d documents indexed in %2$d ms") void indexingDocumentsCompleted(long doneCount, long elapsedMs); @LogMessage(level = INFO) - @Message(id = ID_OFFSET_1 + 31, value = "Indexing speed: %1$f documents/second; progress: %2$.2f%%") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 31, value = "Indexing speed: %1$f documents/second; progress: %2$.2f%%") void indexingSpeed(float estimateSpeed, float estimatePercentileComplete); @LogMessage(level = INFO) - @Message(id = ID_OFFSET_1 + 34, value = "Hibernate Search version %1$s") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 34, value = "Hibernate Search version %1$s") void version(String versionString); @LogMessage(level = WARN) - @Message(id = ID_OFFSET_1 + 36, value = "Cannot guess the Transaction Status: not starting a JTA transaction") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 36, value = "Cannot guess the Transaction Status: not starting a JTA transaction") void cannotGuessTransactionStatus(@Cause Exception e); @LogMessage(level = WARN) - @Message(id = ID_OFFSET_1 + 39, value = "Unable to properly close scroll in ScrollableResults") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 39, value = "Unable to properly close scroll in ScrollableResults") void unableToCloseSearcherInScrollableResult(@Cause Exception e); @LogMessage(level = ERROR) - @Message(id = ID_OFFSET_1 + 62, value = "Mass indexing was interrupted") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 62, value = "Mass indexing was interrupted") void interruptedBatchIndexing(); @LogMessage(level = ERROR) - @Message(id = ID_OFFSET_1 + 65, value = "Error while rolling back transaction after %1$s") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 65, value = "Error while rolling back transaction after %1$s") void errorRollingBackTransaction(String message, @Cause Exception e1); /* @@ -122,74 +121,72 @@ public interface Log extends BasicLogger { String massIndexingLoadingAndExtractingEntityData(String entityName); @LogMessage(level = DEBUG) - @Message(id = ID_OFFSET_1 + 235, value = "Default automatic indexing synchronization strategy set to '%s'." ) + @Message(id = ID_OFFSET_LEGACY_ENGINE + 235, value = "Default automatic indexing synchronization strategy set to '%s'." ) void defaultAutomaticIndexingSynchronizationStrategy(Object strategy); - @Message(id = ID_OFFSET_1 + 276, value = "No transaction is active while indexing entity '%1$s'; Consider increasing the connection time-out") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 276, value = "No transaction is active while indexing entity '%1$s'; Consider increasing the connection time-out") SearchException transactionNotActiveWhileProducingIdsForBatchIndexing(String entityName); - // TODO HSEARCH-3308 migrate relevant messages from Search 5 here - // ----------------------------------- // New messages from Search 6 onwards // ----------------------------------- - int ID_OFFSET_2 = MessageConstants.ORM_ID_RANGE_MIN; + int ID_OFFSET = MessageConstants.ORM_ID_RANGE_MIN; - @Message(id = ID_OFFSET_2 + 1, + @Message(id = ID_OFFSET + 1, value = "Hibernate Search was not initialized.") SearchException hibernateSearchNotInitialized(); - @Message(id = ID_OFFSET_2 + 2, + @Message(id = ID_OFFSET + 2, value = "Unexpected entity name for a query hit: '%1$s'. Expected one of %2$s.") SearchException unexpectedSearchHitEntityName(String entityName, Collection expectedNames); - @Message(id = ID_OFFSET_2 + 3, + @Message(id = ID_OFFSET + 3, value = "Invalid automatic indexing strategy name: '%1$s'. Valid names are: %2$s.") SearchException invalidAutomaticIndexingStrategyName(String invalidRepresentation, List validRepresentations); - @Message(id = ID_OFFSET_2 + 7, + @Message(id = ID_OFFSET + 7, value = "Path '%1$s' cannot be resolved to a persisted value in Hibernate ORM metadata." + " If this path points to a transient value, use @IndexingDependency(derivedFrom = ...)" + " to specify which persisted values it is derived from." + " See the reference documentation for more information.") SearchException unknownPathForDirtyChecking(@FormatWith(PojoModelPathFormatter.class) PojoModelPath path, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 8, + @Message(id = ID_OFFSET + 8, value = "Path '%1$s' can be resolved using Hibernate ORM metadata," + " but points to value '%2$s' that will never be reported as dirty by Hibernate ORM." + " Check that you didn't declare an invalid indexing dependency.") SearchException unreportedPathForDirtyChecking(@FormatWith(PojoModelPathFormatter.class) PojoModelPath path, Value value); - @Message(id = ID_OFFSET_2 + 9, + @Message(id = ID_OFFSET + 9, value = "Container value extractor with name '%2$s' cannot be applied to" + " Hibernate ORM metadata node of type '%1$s'.") SearchException invalidContainerExtractorForDirtyChecking(Class ormMappingClass, String extractorName); - @Message(id = ID_OFFSET_2 + 11, value = "Mapping service cannot create a SearchSession using a different session factory. Expected: '%1$s'. In use: '%2$s'.") + @Message(id = ID_OFFSET + 11, value = "Mapping service cannot create a SearchSession using a different session factory. Expected: '%1$s'. In use: '%2$s'.") SearchException usingDifferentSessionFactories(SessionFactory expectedSessionFactory, SessionFactory usedSessionFactory); - @Message(id = ID_OFFSET_2 + 12, value = "Exception while retrieving property type model for '%1$s' on '%2$s'.") + @Message(id = ID_OFFSET + 12, value = "Exception while retrieving property type model for '%1$s' on '%2$s'.") SearchException errorRetrievingPropertyTypeModel(String propertyModelName, @FormatWith(PojoTypeModelFormatter.class) PojoRawTypeModel parentTypeModel, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 13, value = "Mass indexing was interrupted; index will be left in unknown state!") + @Message(id = ID_OFFSET + 13, value = "Mass indexing was interrupted; index will be left in unknown state!") SearchException massIndexingThreadInterrupted(@Cause InterruptedException e); - @Message(id = ID_OFFSET_2 + 15, + @Message(id = ID_OFFSET + 15, value = "Invalid reflection strategy name: '%1$s'. Valid names are: %2$s.") SearchException invalidReflectionStrategyName(String invalidRepresentation, List validRepresentations); - @Message(id = ID_OFFSET_2 + 16, value = "Error trying to access Hibernate ORM session." ) + @Message(id = ID_OFFSET + 16, value = "Error trying to access Hibernate ORM session." ) SearchException hibernateSessionAccessError(@Cause IllegalStateException cause); - @Message(id = ID_OFFSET_2 + 17, value = "Underlying Hibernate ORM Session seems to be closed." ) + @Message(id = ID_OFFSET + 17, value = "Underlying Hibernate ORM Session seems to be closed." ) SearchException hibernateSessionIsClosed(@Cause IllegalStateException cause); - @Message(id = ID_OFFSET_2 + 18, + @Message(id = ID_OFFSET + 18, value = "Invalid automatic indexing synchronization strategy name: '%1$s'. Valid names are: %2$s.") SearchException invalidAutomaticIndexingSynchronizationStrategyName(String invalidRepresentation, List validRepresentations); @LogMessage(level = DEBUG) - @Message(id = ID_OFFSET_2 + 19, + @Message(id = ID_OFFSET + 19, value = "The entity loader for '%1$s' will ignore the cache lookup strategy '%2$s'," + " because document IDs are distinct from entity IDs " + "and thus cannot be used for persistence context or second level cache lookups.") @@ -197,37 +194,37 @@ void skippingPreliminaryCacheLookupsForNonEntityIdEntityLoader(String entityName EntityLoadingCacheLookupStrategy cacheLookupStrategy); @LogMessage(level = DEBUG) - @Message(id = ID_OFFSET_2 + 20, + @Message(id = ID_OFFSET + 20, value = "The entity loader for '%1$s' will ignore the second-level cache " + " even though it was instructed to use it," + " because caching is not enabled for this entity type.") void skippingSecondLevelCacheLookupsForNonCachedEntityTypeEntityLoader(String entityName); - @Message(id = ID_OFFSET_2 + 21, value = "Error trying to access Hibernate ORM session factory." ) + @Message(id = ID_OFFSET + 21, value = "Error trying to access Hibernate ORM session factory." ) SearchException hibernateSessionFactoryAccessError(@Cause IllegalStateException cause); - @Message(id = ID_OFFSET_2 + 22, value = "Indexing failure: %1$s.\nThe following entities may not have been updated correctly in the index: %2$s." ) + @Message(id = ID_OFFSET + 22, value = "Indexing failure: %1$s.\nThe following entities may not have been updated correctly in the index: %2$s." ) SearchException indexingFailure(String causeMessage, List failingEntities, @Cause Throwable cause); @Message(value = "Automatic indexing of Hibernate ORM entities") String automaticIndexing(); - @Message(id = ID_OFFSET_2 + 23, value = "Automatic indexing failed before transaction completion: %1$s" ) + @Message(id = ID_OFFSET + 23, value = "Automatic indexing failed before transaction completion: %1$s" ) SearchException synchronizationBeforeTransactionFailure(String causeMessage, @Cause Throwable cause); - @Message(id = ID_OFFSET_2 + 24, value = "Automatic indexing failed after transaction completion: %1$s" ) + @Message(id = ID_OFFSET + 24, value = "Automatic indexing failed after transaction completion: %1$s" ) SearchException synchronizationAfterTransactionFailure(String causeMessage, @Cause Throwable cause); - @Message(id = ID_OFFSET_2 + 25, value = "Exception while handling transactions: %1$s") + @Message(id = ID_OFFSET + 25, value = "Exception while handling transactions: %1$s") SearchException massIndexingTransactionHandlingException(String causeMessage, @Cause Throwable cause); - @Message(id = ID_OFFSET_2 + 26, value = "%1$s entities could not be indexed. See the logs for details." + @Message(id = ID_OFFSET + 26, value = "%1$s entities could not be indexed. See the logs for details." + " First failure on entity '%2$s': %3$s") SearchException massIndexingEntityFailures(long finalFailureCount, EntityReference firstFailureEntity, String firstFailureMessage, @Cause Throwable firstFailure); - @Message(id = ID_OFFSET_2 + 27, + @Message(id = ID_OFFSET + 27, value = "Unknown type: '%1$s'. Available named types: %2$s." + " For entity types, the correct type name is the entity name." + " For component types (embeddeds, ...) in dynamic-map entities," @@ -237,12 +234,12 @@ SearchException massIndexingEntityFailures(long finalFailureCount, ) SearchException unknownNamedType(String typeName, Collection availableNamedTypes); - @Message(id = ID_OFFSET_2 + 28, + @Message(id = ID_OFFSET + 28, value = "Unknown entity name: '%1$s'. Available entity names: %2$s." ) SearchException invalidEntityName(String entityName, Collection availableEntityNames); - @Message(id = ID_OFFSET_2 + 29, + @Message(id = ID_OFFSET + 29, value = "Invalid type for '%1$s': expected the entity to extend '%2$s'," + " but entity type '%3$s' does not." ) @@ -250,7 +247,7 @@ SearchException invalidEntitySuperType(String entityName, @FormatWith(ClassFormatter.class) Class expectedSuperType, @FormatWith(ClassFormatter.class) Class actualJavaType); - @Message(id = ID_OFFSET_2 + 30, + @Message(id = ID_OFFSET + 30, value = "Type '%1$s' doesn't have any representation in the JPA metamodel." + " As a result, Hibernate Search cannot use the Criteria API to automatically build queries targeting this type." + " This means in particular that this type cannot:" @@ -259,41 +256,41 @@ SearchException invalidEntitySuperType(String entityName, SearchException nonJpaEntityType(PojoRawTypeIdentifier typeIdentifier); @LogMessage(level = Logger.Level.ERROR) - @Message(id = ID_OFFSET_2 + 31, + @Message(id = ID_OFFSET + 31, value = "The mass indexing failure handler threw an exception while handling a previous failure." + " The failure may not have been reported.") void failureInMassIndexingFailureHandler(@Cause Throwable t); - @Message(id = ID_OFFSET_2 + 32, value = "Invalid schema management strategy name: '%1$s'." + @Message(id = ID_OFFSET + 32, value = "Invalid schema management strategy name: '%1$s'." + " Valid names are: %2$s.") SearchException invalidSchemaManagementStrategyName(String invalidRepresentation, List validRepresentations); - @Message(id = ID_OFFSET_2 + 33, value = "Type '%1$s' is not an entity type, or the entity is not indexed.") + @Message(id = ID_OFFSET + 33, value = "Type '%1$s' is not an entity type, or the entity is not indexed.") SearchException notIndexedEntityType(@FormatWith(ClassFormatter.class) Class type); - @Message(id = ID_OFFSET_2 + 34, value = "Entity '%1$s' is not indexed.") + @Message(id = ID_OFFSET + 34, value = "Entity '%1$s' is not indexed.") SearchException notIndexedEntityName(String name); @LogMessage(level = Logger.Level.ERROR) - @Message(id = ID_OFFSET_2 + 35, value = "Hibernate Search shutdown failed: %1$s") + @Message(id = ID_OFFSET + 35, value = "Hibernate Search shutdown failed: %1$s") void shutdownFailed(String causeMessage, @Cause Throwable cause); - @Message(id = ID_OFFSET_2 + 36, value = "Cannot use scroll() with scroll mode '%1$s' with Hibernate Search queries:" + @Message(id = ID_OFFSET + 36, value = "Cannot use scroll() with scroll mode '%1$s' with Hibernate Search queries:" + " only ScrollMode.FORWARDS_ONLY is supported.") SearchException canOnlyUseScrollWithScrollModeForwardsOnly(ScrollMode scrollMode); - @Message(id = ID_OFFSET_2 + 37, value = "Cannot scroll backwards with Hibernate Search scrolls: they are forwards-only." + @Message(id = ID_OFFSET + 37, value = "Cannot scroll backwards with Hibernate Search scrolls: they are forwards-only." + " Ensure you always increment the scroll position, and never decrement it.") SearchException cannotScrollBackwards(); - @Message(id = ID_OFFSET_2 + 38, value = "Cannot set the scroll position relative to the end with Hibernate Search scrolls." + @Message(id = ID_OFFSET + 38, value = "Cannot set the scroll position relative to the end with Hibernate Search scrolls." + " Ensure you always pass a positive number to setRowNumber().") SearchException cannotSetScrollPositionRelativeToEnd(); - @Message(id = ID_OFFSET_2 + 39, value = "Cannot use this ScrollableResults instance: it is closed.") + @Message(id = ID_OFFSET + 39, value = "Cannot use this ScrollableResults instance: it is closed.") SearchException cannotUseClosedScrollableResults(); - @Message(id = ID_OFFSET_2 + 40, value = "Found multiple entities of type '%1$s' with '%2$s' set to '%3$s'." + @Message(id = ID_OFFSET + 40, value = "Found multiple entities of type '%1$s' with '%2$s' set to '%3$s'." + " '%2$s' is the document ID and must be assigned unique values.") SearchException foundMultipleEntitiesForDocumentId(String entityName, String documentIdSourcePropertyName, Object id); diff --git a/mapper/pojo-base/src/main/java/org/hibernate/search/mapper/pojo/logging/impl/Log.java b/mapper/pojo-base/src/main/java/org/hibernate/search/mapper/pojo/logging/impl/Log.java index 575a2b26689..02134740c82 100644 --- a/mapper/pojo-base/src/main/java/org/hibernate/search/mapper/pojo/logging/impl/Log.java +++ b/mapper/pojo-base/src/main/java/org/hibernate/search/mapper/pojo/logging/impl/Log.java @@ -45,23 +45,20 @@ @MessageLogger(projectCode = MessageConstants.PROJECT_CODE) @ValidIdRanges({ @ValidIdRange(min = MessageConstants.MAPPER_POJO_ID_RANGE_MIN, max = MessageConstants.MAPPER_POJO_ID_RANGE_MAX), - // Exceptions for legacy messages from Search 5 + // Exceptions for legacy messages from Search 5 (engine module) @ValidIdRange(min = 216, max = 216), @ValidIdRange(min = 295, max = 295), @ValidIdRange(min = 297, max = 297) - // TODO HSEARCH-3308 add exceptions here for legacy messages from Search 5. See the Lucene logger for examples. }) public interface Log extends BasicLogger { // ----------------------------------- - // Pre-existing messages from Search 5 + // Pre-existing messages from Search 5 (engine module) // DO NOT ADD ANY NEW MESSAGES HERE // ----------------------------------- - int ID_OFFSET_1 = MessageConstants.ENGINE_ID_RANGE_MIN; + int ID_OFFSET_LEGACY_ENGINE = MessageConstants.ENGINE_ID_RANGE_MIN; - // TODO HSEARCH-3308 migrate relevant messages from Search 5 here - - @Message(id = ID_OFFSET_1 + 216, + @Message(id = ID_OFFSET_LEGACY_ENGINE + 216, value = "An IndexedEmbedded defines includePaths filters that do not match anything." + " Non-matching includePaths filters: %1$s." + " Encountered field paths: %2$s." @@ -70,60 +67,60 @@ public interface Log extends BasicLogger { SearchException uselessIncludePathFilters(Set nonMatchingIncludePaths, Set encounteredFieldPaths, @Param EventContext eventContext); - @Message(id = ID_OFFSET_1 + 295, value = "String '$1%s' cannot be parsed into a '$2%s'") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 295, value = "String '$1%s' cannot be parsed into a '$2%s'") SearchException parseException(String text, @FormatWith(ClassFormatter.class) Class readerClass, @Cause Exception e); - @Message(id = ID_OFFSET_1 + 297, value = " Value of '%2$s' for type '%1$s' is too big for the conversion") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 297, value = " Value of '%2$s' for type '%1$s' is too big for the conversion") SearchException valueTooLargeForConversionException(@FormatWith(ClassFormatter.class) Class type, Object duration, @Cause Exception ae); // ----------------------------------- // New messages from Search 6 onwards // ----------------------------------- - int ID_OFFSET_2 = MessageConstants.MAPPER_POJO_ID_RANGE_MIN; + int ID_OFFSET = MessageConstants.MAPPER_POJO_ID_RANGE_MIN; - @Message(id = ID_OFFSET_2 + 1, + @Message(id = ID_OFFSET + 1, value = "Unable to find a default identifier bridge implementation for type '%1$s'") SearchException unableToResolveDefaultIdentifierBridgeFromSourceType( @FormatWith(PojoTypeModelFormatter.class) PojoTypeModel sourceType); - @Message(id = ID_OFFSET_2 + 2, + @Message(id = ID_OFFSET + 2, value = "Unable to find a default value bridge implementation for type '%1$s'") SearchException unableToResolveDefaultValueBridgeFromSourceType( @FormatWith(PojoTypeModelFormatter.class) PojoTypeModel sourceType); - @Message(id = ID_OFFSET_2 + 3, + @Message(id = ID_OFFSET + 3, value = "The binder reference is empty.") SearchException missingBinderReferenceInBinding(); - @Message(id = ID_OFFSET_2 + 5, + @Message(id = ID_OFFSET + 5, value = "The field annotation defines both valueBridge and valueBinder." + " Only one of those can be defined, not both." ) SearchException invalidFieldDefiningBothBridgeReferenceAndBinderReference(); - @Message(id = ID_OFFSET_2 + 6, + @Message(id = ID_OFFSET + 6, value = "@DocumentId defines both identifierBridge and identifierBinder." + " Only one of those can be defined, not both." ) SearchException invalidDocumentIdDefiningBothBridgeReferenceAndBinderReference(); - @Message(id = ID_OFFSET_2 + 7, + @Message(id = ID_OFFSET + 7, value = "Invalid empty target for a scoped operation." + " If you want to target all indexes, use 'Object.class' as the target type." ) SearchException invalidEmptyTargetForScope(); - @Message(id = ID_OFFSET_2 + 10, + @Message(id = ID_OFFSET + 10, value = "Bridge '%1$s' cannot be applied to input type '%2$s'.") SearchException invalidInputTypeForBridge(Object bridge, @FormatWith(PojoTypeModelFormatter.class) PojoTypeModel typeModel); - @Message(id = ID_OFFSET_2 + 11, + @Message(id = ID_OFFSET + 11, value = "Missing field name for GeoPointBinding on type %1$s." + " The field name is mandatory when the bridge is applied on an type, optional when applied on a property.") SearchException missingFieldNameForGeoPointBridgeOnType(String typeName); - @Message(id = ID_OFFSET_2 + 15, + @Message(id = ID_OFFSET + 15, value = "Cannot interpret the type arguments to the ContainerExtractor interface in " + " implementation '%1$s'. Only the following implementations of ContainerExtractor are valid: " + " 1) implementations setting both type parameters to *raw* types," @@ -139,7 +136,7 @@ SearchException cannotInferContainerExtractorClassTypePattern( @FormatWith(ClassFormatter.class) Class extractorClass, @Cause Exception e); @SuppressWarnings("rawtypes") - @Message(id = ID_OFFSET_2 + 16, + @Message(id = ID_OFFSET + 16, value = "Cannot apply the requested container value extractor '%1$s' (implementation class: '%2$s') to type '%3$s'") SearchException invalidContainerExtractorForType( String extractorName, @@ -147,23 +144,23 @@ SearchException invalidContainerExtractorForType( @FormatWith(PojoTypeModelFormatter.class) PojoGenericTypeModel extractedType); @LogMessage(level = Logger.Level.DEBUG) - @Message(id = ID_OFFSET_2 + 17, + @Message(id = ID_OFFSET + 17, value = "Created POJO indexed type manager: %1$s") void createdPojoIndexedTypeManager( @FormatWith(ToStringTreeAppendableMultilineFormatter.class) PojoIndexedTypeManager typeManager); @LogMessage(level = Logger.Level.DEBUG) - @Message(id = ID_OFFSET_2 + 18, + @Message(id = ID_OFFSET + 18, value = "Detected entity types: %1$s, indexed types: %2$s") void detectedEntityTypes(Set> entityTypes, Set> indexedTypes); @LogMessage(level = Logger.Level.DEBUG) - @Message(id = ID_OFFSET_2 + 19, + @Message(id = ID_OFFSET + 19, value = "Created POJO contained type manager: %1$s") void createdPojoContainedTypeManager( @FormatWith(ToStringTreeAppendableMultilineFormatter.class) PojoContainedTypeManager typeManager); - @Message(id = ID_OFFSET_2 + 20, + @Message(id = ID_OFFSET + 20, value = "Cannot find the inverse side of the association on type '%2$s' at path '%3$s'." + " Hibernate Search needs this information in order to reindex '%2$s' when '%1$s' is modified." + " You can solve this error by defining the inverse side of this association, " @@ -177,7 +174,7 @@ SearchException cannotInvertAssociationForReindexing( @FormatWith(PojoTypeModelFormatter.class) PojoRawTypeModel typeModel, @FormatWith(PojoModelPathFormatter.class) PojoModelPathValueNode associationPath); - @Message(id = ID_OFFSET_2 + 21, + @Message(id = ID_OFFSET + 21, value = "Cannot apply the path '%2$s' to type '%1$s'." + " This path was resolved as the inverse side of the association '%4$s' on type '%3$s'." + " Hibernate Search needs to apply this path in order to reindex '%3$s' when '%1$s' is modified." @@ -190,39 +187,39 @@ SearchException cannotApplyImplicitInverseAssociationPath( String errorMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 22, + @Message(id = ID_OFFSET + 22, value = "The inverse association targets type '%1$s'," + " but a supertype or subtype of '%2$s' was expected.") SearchException incorrectTargetTypeForInverseAssociation( @FormatWith(PojoTypeModelFormatter.class) PojoRawTypeModel inverseAssociationTargetType, @FormatWith(PojoTypeModelFormatter.class) PojoRawTypeModel entityType); - @Message(id = ID_OFFSET_2 + 23, + @Message(id = ID_OFFSET + 23, value = "@AssociationInverseSide.inversePath is empty.") SearchException missingInversePathInAssociationInverseSideMapping(); - @Message(id = ID_OFFSET_2 + 24, + @Message(id = ID_OFFSET + 24, value = "Found an infinite embedded recursion involving path '%2$s' on type '%1$s'") SearchException infiniteRecursionForAssociationEmbeddeds( @FormatWith(PojoTypeModelFormatter.class) PojoRawTypeModel typeModel, @FormatWith(PojoModelPathFormatter.class) PojoModelPathValueNode path); - @Message(id = ID_OFFSET_2 + 27, + @Message(id = ID_OFFSET + 27, value = "Type '%1$s' is not marked as an entity type and is not abstract, yet it is indexed or targeted" + " by an association from an indexed type. Please check your configuration.") SearchException missingEntityTypeMetadata(@FormatWith(PojoTypeModelFormatter.class) PojoRawTypeModel typeModel); - @Message(id = ID_OFFSET_2 + 28, + @Message(id = ID_OFFSET + 28, value = "There isn't any explicit document ID mapping for indexed type '%1$s'," + " and the entity ID cannot be used as a default because" + " the property representing the entity ID cannot be found.") SearchException missingIdentifierMapping(@FormatWith(PojoTypeModelFormatter.class) PojoRawTypeModel typeModel); - @Message(id = ID_OFFSET_2 + 29, + @Message(id = ID_OFFSET + 29, value = "@IndexingDependency.derivedFrom contains an empty path.") SearchException missingPathInIndexingDependencyDerivedFrom(); - @Message(id = ID_OFFSET_2 + 30, + @Message(id = ID_OFFSET + 30, value = "Found a cyclic dependency between derived properties involving path '%2$s' on type '%1$s'." + " Derived properties cannot be marked as derived from themselves, even indirectly through other " + " derived properties." @@ -234,7 +231,7 @@ SearchException infiniteRecursionForDerivedFrom( @FormatWith(PojoTypeModelFormatter.class) PojoRawTypeModel typeModel, @FormatWith(PojoModelPathFormatter.class) PojoModelPathValueNode path); - @Message(id = ID_OFFSET_2 + 31, + @Message(id = ID_OFFSET + 31, value = "This property's mapping expects a standard String type for the index field," + " but the assigned value bridge or value binder declares a non-standard or non-String type." + " Make sure to use a compatible bridge or binder." @@ -244,13 +241,13 @@ SearchException infiniteRecursionForDerivedFrom( SearchException invalidFieldEncodingForStringFieldMapping(IndexFieldTypeOptionsStep step, @FormatWith(ClassFormatter.class) Class expectedContextType); - @Message(id = ID_OFFSET_2 + 34, value = "Could not find a property with the '%1$s' marker for field '%2$s' (marker set: '%3$s').") + @Message(id = ID_OFFSET + 34, value = "Could not find a property with the '%1$s' marker for field '%2$s' (marker set: '%3$s').") SearchException propertyMarkerNotFound(String markerName, String fieldName, String markerSet); - @Message(id = ID_OFFSET_2 + 35, value = "Found multiple properties with the '%1$s' marker for field '%2$s' (marker set: '%3$s').") + @Message(id = ID_OFFSET + 35, value = "Found multiple properties with the '%1$s' marker for field '%2$s' (marker set: '%3$s').") SearchException multiplePropertiesForMarker(String markerName, String fieldName, String markerSet); - @Message(id = ID_OFFSET_2 + 36, + @Message(id = ID_OFFSET + 36, value = "Some of the given types cannot be targeted." + " These types are not indexed, nor is any of their subtypes: %1$s." + " Note that some of them are indexed-embedded in an indexed entity, but this is not enough to be targeted" @@ -259,36 +256,36 @@ SearchException invalidFieldEncodingForStringFieldMapping(IndexFieldTypeOptionsS SearchException invalidScopeTarget(Collection> nonIndexedTypes, Collection> containedTypes); - @Message(id = ID_OFFSET_2 + 37, value = "Cannot work on type '%1$s', because it is not indexed, neither directly nor as a contained entity in another type.") + @Message(id = ID_OFFSET + 37, value = "Cannot work on type '%1$s', because it is not indexed, neither directly nor as a contained entity in another type.") SearchException notIndexedTypeNorAsDelegate(PojoRawTypeIdentifier targetedType); - @Message(id = ID_OFFSET_2 + 38, value = "The identifier for this entity should always be provided, but the provided identifier was null." ) + @Message(id = ID_OFFSET + 38, value = "The identifier for this entity should always be provided, but the provided identifier was null." ) SearchException nullProvidedIdentifier(); - @Message(id = ID_OFFSET_2 + 39, value = "Requested incompatible type for '%1$s': '%2$s'") + @Message(id = ID_OFFSET + 39, value = "Requested incompatible type for '%1$s': '%2$s'") SearchException incompatibleRequestedType(@FormatWith(PojoModelPathFormatter.class) PojoModelPathValueNode accessor, @FormatWith(ClassFormatter.class) Class requestedType); - @Message(id = ID_OFFSET_2 + 40, value = "Cannot work on type '%1$s', because it is not directly indexed.") + @Message(id = ID_OFFSET + 40, value = "Cannot work on type '%1$s', because it is not directly indexed.") SearchException notDirectlyIndexedType(PojoRawTypeIdentifier targetedType); - @Message(id = ID_OFFSET_2 + 41, + @Message(id = ID_OFFSET + 41, value = "A chain of multiple container extractors cannot include the default extractors." + " Either use only the default extractors, or explicitly reference every single extractor to be applied instead." ) SearchException cannotUseDefaultExtractorsInMultiExtractorChain(); - @Message(id = ID_OFFSET_2 + 43, value = "Error creating URL from String '%1$s'.") + @Message(id = ID_OFFSET + 43, value = "Error creating URL from String '%1$s'.") SearchException malformedURL(String value, @Cause MalformedURLException e); - @Message(id = ID_OFFSET_2 + 44, value = "Error creating URI from String '%1$s'.") + @Message(id = ID_OFFSET + 44, value = "Error creating URI from String '%1$s'.") SearchException badURISyntax(String value, @Cause URISyntaxException e); - @Message(id = ID_OFFSET_2 + 45, + @Message(id = ID_OFFSET + 45, value = "A PojoModelPath must include at least one property." ) SearchException cannotDefinePojoModelPathWithoutProperty(); - @Message(id = ID_OFFSET_2 + 46, + @Message(id = ID_OFFSET + 46, value = "Cannot apply the path '%2$s' to type '%1$s'." + " This path was declared as a path to collect entities of type '%3$s' to be reindexed." + " Hibernate Search needs to apply this path in order to reindex '%3$s' when '%1$s' is modified." @@ -300,32 +297,32 @@ SearchException cannotApplyExplicitInverseAssociationPath( String errorMessage, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 47, + @Message(id = ID_OFFSET + 47, value = "'fromOtherEntity' can only be used when the bridged element has an entity type," + " but the bridged element has type '%1$s'," + " which is not an entity type.") SearchException cannotDefineOtherEntityDependencyOnNonEntityBridgedType( @FormatWith(PojoTypeModelFormatter.class) PojoRawTypeModel bridgedTypeModel); - @Message(id = ID_OFFSET_2 + 48, + @Message(id = ID_OFFSET + 48, value = "'fromOtherEntity' expects an entity type; type '%1$s' is not an entity type.") SearchException cannotDefineOtherEntityDependencyFromNonEntityType( @FormatWith(PojoTypeModelFormatter.class) PojoRawTypeModel otherType); - @Message(id = ID_OFFSET_2 + 49, + @Message(id = ID_OFFSET + 49, value = "The binder did not declare any dependency to the entity model during binding." + " Declare dependencies using context.dependencies().use(...) or," + " if the bridge really does not depend on the entity model, context.dependencies().useRootOnly()." ) SearchException missingBridgeDependencyDeclaration(); - @Message(id = ID_OFFSET_2 + 50, + @Message(id = ID_OFFSET + 50, value = "The binder called context.dependencies().useRootOnly() during binding," + " but also declared extra dependencies to the entity model." ) SearchException inconsistentBridgeDependencyDeclaration(); - @Message(id = ID_OFFSET_2 + 51, + @Message(id = ID_OFFSET + 51, value = "This property's mapping expects a scaled number type (BigDecimal or BigInteger) for the index field," + " but the assigned value bridge or value binder declares a non-scaled type." + " Make sure to use a compatible bridge or binder." @@ -335,14 +332,14 @@ SearchException cannotDefineOtherEntityDependencyFromNonEntityType( SearchException invalidFieldEncodingForScaledNumberFieldMapping(IndexFieldTypeOptionsStep step, @FormatWith(ClassFormatter.class) Class expectedContextType); - @Message(id = ID_OFFSET_2 + 52, + @Message(id = ID_OFFSET + 52, value = "Extractors cannot be defined explicitly when extract = ContainerExtract.NO." + " Either leave 'extract' to its default value to define extractors explicitly" + " or leave the 'extractor' list to its default, empty value to disable extraction." ) SearchException cannotReferenceExtractorsWhenExtractionDisabled(); - @Message(id = ID_OFFSET_2 + 53, + @Message(id = ID_OFFSET + 53, value = "Cannot resolve container extractor name '%1$s'." + " Check that this name matches a container extractor," + " either a builtin one whose name is a constant in '%2$s'" @@ -351,43 +348,43 @@ SearchException invalidFieldEncodingForScaledNumberFieldMapping(IndexFieldTypeOp SearchException cannotResolveContainerExtractorName(String extractorName, @FormatWith(ClassFormatter.class) Class builtinExtractorConstantsClass); - @Message(id = ID_OFFSET_2 + 55, + @Message(id = ID_OFFSET + 55, value = "Type '%1$s' is contained in an indexed type but is not itself indexed," + " thus entity with identifier '%2$s' cannot be purged." + " Use delete() and pass the entity instead of just the identifier." ) SearchException cannotPurgeNonIndexedContainedType(PojoRawTypeIdentifier type, Object providedId); - @Message(id = ID_OFFSET_2 + 56, value = "Could not access to the org.hibernate.annotations.common.reflection.java.JavaXMember#getMember method") + @Message(id = ID_OFFSET + 56, value = "Could not access to the org.hibernate.annotations.common.reflection.java.JavaXMember#getMember method") SearchException cannotAccessPropertyMember(@Cause Exception cause); - @Message(id = ID_OFFSET_2 + 57, value = "The underlying member of property '%1$s' is supposed to be a method") + @Message(id = ID_OFFSET + 57, value = "The underlying member of property '%1$s' is supposed to be a method") SearchException cannotAccessPropertyMethod(String propertyName); - @Message(id = ID_OFFSET_2 + 58, + @Message(id = ID_OFFSET + 58, value = "The bind() method of binder '%1$s' is not implemented correctly:" + " it did not call context.bridge().") SearchException missingBridgeForBinder(Object binder); - @Message(id = ID_OFFSET_2 + 59, + @Message(id = ID_OFFSET + 59, value = "The bind() method of binder '%1$s' is not implemented correctly:" + " it did not call context.marker(...).") SearchException missingMarkerForBinder(Object binder); - @Message(id = ID_OFFSET_2 + 60, + @Message(id = ID_OFFSET + 60, value = "Entity processing was triggered while already processing entities, which is not supported." + " Make sure you do not change entities within an entity getter or a custom bridge used for indexing," + " and avoid any event that could trigger entity processing." + " Hibernate ORM flushes, in particular, must be avoided in entity getters and bridges.") SearchException recursiveIndexingPlanProcess(); - @Message(id = ID_OFFSET_2 + 61, value = "Type '%1$s' cannot be indexed-embedded, because no index mapping (@GenericField, @FullTextField, ...) is defined for that type.") + @Message(id = ID_OFFSET + 61, value = "Type '%1$s' cannot be indexed-embedded, because no index mapping (@GenericField, @FullTextField, ...) is defined for that type.") SearchException invalidIndexedEmbedded(@FormatWith(PojoTypeModelFormatter.class) PojoTypeModel typeModel); - @Message(id = ID_OFFSET_2 + 64, value = "Multiple entity names assigned to the same type: '%1$s', '%2$s'.") + @Message(id = ID_OFFSET + 64, value = "Multiple entity names assigned to the same type: '%1$s', '%2$s'.") SearchException multipleEntityNames(String entityName, String otherEntityName); - @Message(id = ID_OFFSET_2 + 65, + @Message(id = ID_OFFSET + 65, value = "This property's mapping expects a standard type for the index field," + " but the assigned value bridge or value binder declares a non-standard type." + " Make sure to use a compatible bridge or binder." @@ -397,7 +394,7 @@ SearchException cannotResolveContainerExtractorName(String extractorName, SearchException invalidFieldEncodingForStandardFieldMapping(IndexFieldTypeOptionsStep step, @FormatWith(ClassFormatter.class) Class expectedContextType); - @Message(id = ID_OFFSET_2 + 66, + @Message(id = ID_OFFSET + 66, value = "This property's mapping expects a non-standard type for the index field," + " but the assigned value bridge or value binder declares a standard type." + " Switch to a standard field annotation such as @GenericField." @@ -407,61 +404,61 @@ SearchException invalidFieldEncodingForStandardFieldMapping(IndexFieldTypeOption SearchException invalidFieldEncodingForNonStandardFieldMapping(IndexFieldTypeOptionsStep step, @FormatWith(ClassFormatter.class) Class expectedContextType); - @Message(id = ID_OFFSET_2 + 67, + @Message(id = ID_OFFSET + 67, value = "Annotation processor '%1$s' expects annotations of incompatible type '%2$s'.") SearchException invalidAnnotationTypeForAnnotationProcessor(Object annotationProcessor, @FormatWith(ClassFormatter.class) Class processorAnnotationType); - @Message(id = ID_OFFSET_2 + 68, + @Message(id = ID_OFFSET + 68, value = "The processor reference in meta-annotation '%1$s' is empty.") SearchException missingProcessorReferenceInMappingAnnotation( @FormatWith(ClassFormatter.class) Class metaAnnotationType); - @Message(id = ID_OFFSET_2 + 69, + @Message(id = ID_OFFSET + 69, value = "Cannot set both the name and prefix in @IndexedEmbedded. Name was '%1$s', prefix was '%2$s'.") SearchException cannotSetBothIndexedEmbeddedNameAndPrefix(String relativeFieldName, String prefix); - @Message(id = ID_OFFSET_2 + 70, + @Message(id = ID_OFFSET + 70, value = "Index field name '%1$s' is invalid: field names cannot contain a dot ('.').") SearchException invalidFieldNameDotNotAllowed(String relativeFieldName); - @Message(id = ID_OFFSET_2 + 71, value = "Could not find any property marked with @Alternative(id = %1$s)." + @Message(id = ID_OFFSET + 71, value = "Could not find any property marked with @Alternative(id = %1$s)." + " There must be exactly one such property in order to map property '%2$s' to multi-alternative fields.") SearchException cannotFindAlternativeDiscriminator(String alternativeId, String fieldValueSourcePropertyName); - @Message(id = ID_OFFSET_2 + 72, value = "Found multiple properties marked with @Alternative(id = %1$s)." + @Message(id = ID_OFFSET + 72, value = "Found multiple properties marked with @Alternative(id = %1$s)." + " There must be exactly one such property in order to map property '%2$s' to multi-alternative fields.") SearchException conflictingAlternativeDiscriminators(String alternativeId, String fieldValueSourcePropertyName); - @Message(id = ID_OFFSET_2 + 73, + @Message(id = ID_OFFSET + 73, value = "Routing bridge '%1$s' cannot be applied to entity type '%2$s'.") SearchException invalidInputTypeForRoutingBridge(Object routingBridge, @FormatWith(PojoTypeModelFormatter.class) PojoTypeModel typeModel); - @Message(id = ID_OFFSET_2 + 75, + @Message(id = ID_OFFSET + 75, value = "Routing bridge '%1$s' did not define any current route. Exactly one current route must be defined," + " or you can call notIndexed() to explicitly indicate no route is necessary.") SearchException noCurrentRoute(Object routingBridge); - @Message(id = ID_OFFSET_2 + 76, + @Message(id = ID_OFFSET + 76, value = "Routing bridge '%1$s' defined multiple current routes. At most one current route must be defined.") SearchException multipleCurrentRoutes(Object routingBridge); - @Message(id = ID_OFFSET_2 + 77, + @Message(id = ID_OFFSET + 77, value = "Routing bridge '%1$s' did not define any previous route. At least one previous route must be defined," + " or you can call notIndexed() to explicitly indicate no route was necessary.") SearchException noPreviousRoute(Object routingBridge); - @Message(id = ID_OFFSET_2 + 78, + @Message(id = ID_OFFSET + 78, value = "Unable to find a readable property '%2$s' on type '%1$s'.") SearchException cannotFindReadableProperty(@FormatWith(PojoTypeModelFormatter.class) PojoRawTypeModel typeModel, String propertyName); - @Message(id = ID_OFFSET_2 + 79, value = "Exception while retrieving property type model for '%1$s' on '%2$s'.") + @Message(id = ID_OFFSET + 79, value = "Exception while retrieving property type model for '%1$s' on '%2$s'.") SearchException errorRetrievingPropertyTypeModel(String propertyModelName, @FormatWith(PojoTypeModelFormatter.class) PojoRawTypeModel parentTypeModel, @Cause Exception cause); - @Message(id = ID_OFFSET_2 + 80, + @Message(id = ID_OFFSET + 80, value = "Bridge '%1$s' implements ValueBridge," + " but sets the generic type parameter F to '%2$s'." + " The field type can only be inferred automatically" @@ -470,7 +467,7 @@ SearchException errorRetrievingPropertyTypeModel(String propertyModelName, + " or set the type parameter F to a definite, raw type.") SearchException invalidGenericParameterToInferFieldType(Object bridge, @FormatWith(TypeFormatter.class) Type type); - @Message(id = ID_OFFSET_2 + 81, + @Message(id = ID_OFFSET + 81, value = "Bridge '%1$s' implements IdentifierBridge," + " but sets the generic type parameter I to '%2$s'." + " The expected identifier type can only be inferred automatically" @@ -479,7 +476,7 @@ SearchException errorRetrievingPropertyTypeModel(String propertyModelName, + " or set the type parameter I to a definite, raw type.") SearchException invalidGenericParameterToInferIdentifierType(Object bridge, @FormatWith(TypeFormatter.class) Type type); - @Message(id = ID_OFFSET_2 + 82, + @Message(id = ID_OFFSET + 82, value = "Bridge '%1$s' implements ValueBridge," + " but sets the generic type parameter V to '%2$s'." + " The expected value type can only be inferred automatically" @@ -488,12 +485,12 @@ SearchException errorRetrievingPropertyTypeModel(String propertyModelName, + " or set the type parameter V to a definite, raw type.") SearchException invalidGenericParameterToInferValueType(Object bridge, @FormatWith(TypeFormatter.class) Type type); - @Message(id = ID_OFFSET_2 + 83, + @Message(id = ID_OFFSET + 83, value = "Exception while building document for entity '%1$s': %2$s") SearchException errorBuildingDocument(Object entityReference, String message, @Cause Exception e); - @Message(id = ID_OFFSET_2 + 84, + @Message(id = ID_OFFSET + 84, value = "Exception while resolving other entities to reindex as a result of changes on entity '%1$s': %2$s") SearchException errorResolvingEntitiesToReindex(Object entityReference, String message, @Cause Exception e); diff --git a/util/common/src/main/java/org/hibernate/search/util/common/logging/impl/Log.java b/util/common/src/main/java/org/hibernate/search/util/common/logging/impl/Log.java index 4799f378c0e..fb47c16977f 100644 --- a/util/common/src/main/java/org/hibernate/search/util/common/logging/impl/Log.java +++ b/util/common/src/main/java/org/hibernate/search/util/common/logging/impl/Log.java @@ -27,8 +27,7 @@ @MessageLogger(projectCode = MessageConstants.PROJECT_CODE) @ValidIdRanges({ @ValidIdRange(min = MessageConstants.UTIL_ID_RANGE_MIN, max = MessageConstants.UTIL_ID_RANGE_MAX), - // Exceptions for legacy messages from Search 5 - // TODO HSEARCH-3308 add exceptions here for legacy messages from Search 5. + // Exceptions for legacy messages from Search 5 (engine module) @ValidIdRange(min = 17, max = 17), @ValidIdRange(min = 18, max = 18), @ValidIdRange(min = 58, max = 58) @@ -36,76 +35,74 @@ public interface Log extends BasicLogger { // ----------------------------------- - // Pre-existing messages from Search 5 + // Pre-existing messages from Search 5 (engine module) // DO NOT ADD ANY NEW MESSAGES HERE // ----------------------------------- - int ID_OFFSET_1 = MessageConstants.ENGINE_ID_RANGE_MIN; + int ID_OFFSET_LEGACY_ENGINE = MessageConstants.ENGINE_ID_RANGE_MIN; @LogMessage(level = ERROR) - @Message(id = ID_OFFSET_1 + 17, value = "Work discarded, thread was interrupted while waiting for space to schedule: %1$s") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 17, value = "Work discarded, thread was interrupted while waiting for space to schedule: %1$s") void interruptedWorkError(Runnable r); @LogMessage(level = ERROR) - @Message(id = ID_OFFSET_1 + 58, value = "%1$s") + @Message(id = ID_OFFSET_LEGACY_ENGINE + 58, value = "%1$s") void exceptionOccurred(String errorMsg, @Cause Throwable exceptionThatOccurred); - // TODO HSEARCH-3308 migrate relevant messages from Search 5 here - // ----------------------------------- // New messages from Search 6 onwards // ----------------------------------- - int ID_OFFSET_2 = MessageConstants.UTIL_ID_RANGE_MIN; + int ID_OFFSET = MessageConstants.UTIL_ID_RANGE_MIN; - @Message(id = ID_OFFSET_2 + 0, + @Message(id = ID_OFFSET + 0, value = "'%1$s' must not be null.") IllegalArgumentException mustNotBeNull(String objectDescription); - @Message(id = ID_OFFSET_2 + 1, + @Message(id = ID_OFFSET + 1, value = "'%1$s' must not be null or empty.") IllegalArgumentException collectionMustNotBeNullNorEmpty(String objectDescription); - @Message(id = ID_OFFSET_2 + 2, + @Message(id = ID_OFFSET + 2, value = "'%1$s' must be positive or zero.") IllegalArgumentException mustBePositiveOrZero(String objectDescription); - @Message(id = ID_OFFSET_2 + 3, + @Message(id = ID_OFFSET + 3, value = "'%1$s' must not be null or empty.") IllegalArgumentException stringMustNotBeNullNorEmpty(String objectDescription); - @Message(id = ID_OFFSET_2 + 4, + @Message(id = ID_OFFSET + 4, value = "'%1$s' must not be null or empty.") IllegalArgumentException arrayMustNotBeNullNorEmpty(String objectDescription); - @Message(id = ID_OFFSET_2 + 5, value = "Exception while invoking '%1$s' on '%2$s'.") + @Message(id = ID_OFFSET + 5, value = "Exception while invoking '%1$s' on '%2$s'.") SearchException errorInvokingMember(Member member, String componentAsString, @Cause Throwable e); - @Message(id = ID_OFFSET_2 + 6, + @Message(id = ID_OFFSET + 6, value = "Requested type argument %3$s to type %2$s" + " in implementing type %1$s, but %2$s doesn't declare any type parameter") IllegalArgumentException cannotRequestTypeParameterOfUnparameterizedType(@FormatWith(TypeFormatter.class) Type type, @FormatWith(ClassFormatter.class) Class rawSuperType, int typeArgumentIndex); - @Message(id = ID_OFFSET_2 + 7, + @Message(id = ID_OFFSET + 7, value = "Requested type argument %3$s to type %2$s" + " in implementing type %1$s, but %2$s only declares %4$s type parameter(s)") IllegalArgumentException typeParameterIndexOutOfBound(@FormatWith(TypeFormatter.class) Type type, @FormatWith(ClassFormatter.class) Class rawSuperType, int typeArgumentIndex, int typeParametersLength); - @Message(id = ID_OFFSET_2 + 8, + @Message(id = ID_OFFSET + 8, value = "Requested type argument index %3$s to type %2$s" + " in implementing type %1$s should be 0 or greater") IllegalArgumentException invalidTypeParameterIndex(@FormatWith(TypeFormatter.class) Type type, @FormatWith(ClassFormatter.class) Class rawSuperType, int typeArgumentIndex); @LogMessage(level = Logger.Level.INFO) - @Message(id = ID_OFFSET_2 + 9, + @Message(id = ID_OFFSET + 9, value = "Cannot access the value of containing annotation '%1$s'." + " Ignoring annotation.") void cannotAccessRepeateableContainingAnnotationValue( @FormatWith(ClassFormatter.class) Class containingAnnotationType, @Cause Throwable e); - @Message(id = ID_OFFSET_2 + 10, + @Message(id = ID_OFFSET + 10, value = "'%1$s' must be strictly positive.") IllegalArgumentException mustBeStrictlyPositive(String objectDescription);