Skip to content

Commit

Permalink
Fix a few misplaced @WithConverter
Browse files Browse the repository at this point in the history
The @WithConverter annotation is different from the @ConvertWith
annotation and needs to be placed appropriately on the transformed type.

After this PR, they should all be correctly positioned.
  • Loading branch information
gsmet committed Feb 17, 2025
1 parent 2df8c69 commit bc3fe92
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ public interface NativeConfig {
*
* @deprecated Use the global quarkus.default-locale.
*/
@WithConverter(TrimmedStringConverter.class)
@Deprecated
Optional<String> userLanguage();
Optional<@WithConverter(TrimmedStringConverter.class) String> userLanguage();

/**
* Defines the user country used for building the native executable.
Expand All @@ -108,9 +107,8 @@ public interface NativeConfig {
*
* @deprecated Use the global quarkus.default-locale.
*/
@WithConverter(TrimmedStringConverter.class)
@Deprecated
Optional<String> userCountry();
Optional<@WithConverter(TrimmedStringConverter.class) String> userCountry();

/**
* Defines the file encoding as in {@code -Dfile.encoding=...}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public interface DataSourceJdbcBuildTimeConfig {
/**
* The datasource driver class name
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> driver();
Optional<@WithConverter(TrimmedStringConverter.class) String> driver();

/**
* Whether we want to use regular JDBC transactions, XA, or disable all transactional capabilities.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public interface DataSourceJdbcRuntimeConfig {
/**
* The datasource URL
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> url();
Optional<@WithConverter(TrimmedStringConverter.class) String> url();

/**
* The initial size of the pool. Usually you will want to set the initial size to match at least the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ public interface DataSourceBuildTimeConfig {
/**
* The kind of database we will connect to (e.g. h2, postgresql...).
*/
@WithConverter(DatabaseKindConverter.class)
Optional<String> dbKind();
Optional<@WithConverter(DatabaseKindConverter.class) String> dbKind();

/**
* The version of the database we will connect to (e.g. '10.0').
Expand Down Expand Up @@ -46,8 +45,7 @@ public interface DataSourceBuildTimeConfig {
*
* @asciidoclet
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> dbVersion();
Optional<@WithConverter(TrimmedStringConverter.class) String> dbVersion();

/**
* Dev Services.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ public interface DataSourceRuntimeConfig {
/**
* The credentials provider name
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> credentialsProvider();
Optional<@WithConverter(TrimmedStringConverter.class) String> credentialsProvider();

/**
* The credentials provider bean name.
Expand All @@ -45,6 +44,5 @@ public interface DataSourceRuntimeConfig {
* <p>
* For Vault, the credentials provider bean name is {@code vault-credentials-provider}.
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> credentialsProviderName();
Optional<@WithConverter(TrimmedStringConverter.class) String> credentialsProviderName();
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public interface DevServicesBuildTimeConfig {
* <p>
* This has no effect if the provider is not a container-based database, such as H2 or Derby.
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> imageName();
Optional<@WithConverter(TrimmedStringConverter.class) String> imageName();

/**
* Environment variables that are passed to the container.
Expand Down Expand Up @@ -65,13 +64,12 @@ public interface DevServicesBuildTimeConfig {
* <p>
* This has no effect if the provider is not a container-based database, such as H2 or Derby.
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> command();
Optional<@WithConverter(TrimmedStringConverter.class) String> command();

/**
* The database name to use if this Dev Service supports overriding it.
*/
Optional<String> dbName();
Optional<@WithConverter(TrimmedStringConverter.class) String> dbName();

/**
* The username to use if this Dev Service supports overriding it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public interface HibernateOrmConfigPersistenceUnit {
* <p>
* If undefined, it will use the default datasource.
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> datasource();
Optional<@WithConverter(TrimmedStringConverter.class) String> datasource();

/**
* The packages in which the entities affected to this persistence unit are located.
Expand Down Expand Up @@ -113,16 +112,14 @@ public interface HibernateOrmConfigPersistenceUnit {
*
* Class name of the Hibernate PhysicalNamingStrategy implementation
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> physicalNamingStrategy();
Optional<@WithConverter(TrimmedStringConverter.class) String> physicalNamingStrategy();

/**
* Pluggable strategy for applying implicit naming rules when an explicit name is not given.
*
* Class name of the Hibernate ImplicitNamingStrategy implementation
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> implicitNamingStrategy();
Optional<@WithConverter(TrimmedStringConverter.class) String> implicitNamingStrategy();

/**
* Class name of a custom
Expand All @@ -140,8 +137,7 @@ public interface HibernateOrmConfigPersistenceUnit {
*
* @asciidoclet
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> metadataBuilderContributor();
Optional<@WithConverter(TrimmedStringConverter.class) String> metadataBuilderContributor();

/**
* XML files to configure the entity mapping, e.g. {@code META-INF/my-orm.xml}.
Expand Down Expand Up @@ -223,8 +219,7 @@ public interface HibernateOrmConfigPersistenceUnit {
*
* @asciidoclet
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> multitenant();
Optional<@WithConverter(TrimmedStringConverter.class) String> multitenant();

/**
* Defines the name of the datasource to use in case of SCHEMA approach. The datasource of the persistence unit will be used
Expand All @@ -233,8 +228,7 @@ public interface HibernateOrmConfigPersistenceUnit {
* @deprecated Use {@link #datasource()} instead.
*/
@Deprecated
@WithConverter(TrimmedStringConverter.class)
Optional<String> multitenantSchemaDatasource();
Optional<@WithConverter(TrimmedStringConverter.class) String> multitenantSchemaDatasource();

/**
* If hibernate is not auto generating the schema, and Quarkus is running in development mode
Expand Down Expand Up @@ -302,8 +296,7 @@ interface HibernateOrmConfigPersistenceUnitDialect {
*/
@WithParentName
@ConfigDocDefault("selected automatically for most popular databases")
@WithConverter(TrimmedStringConverter.class)
Optional<String> dialect();
Optional<@WithConverter(TrimmedStringConverter.class) String> dialect();

/**
* The storage engine to use when the dialect supports multiple storage engines.
Expand All @@ -312,8 +305,7 @@ interface HibernateOrmConfigPersistenceUnitDialect {
*
* @asciidoclet
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> storageEngine();
Optional<@WithConverter(TrimmedStringConverter.class) String> storageEngine();

default boolean isAnyPropertySet() {
return dialect().isPresent() || storageEngine().isPresent();
Expand Down Expand Up @@ -537,8 +529,7 @@ interface HibernateOrmConfigPersistenceUnitJdbc {
*
* See `quarkus.hibernate-orm.mapping.timezone.default-storage`.
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> timezone();
Optional<@WithConverter(TrimmedStringConverter.class) String> timezone();

/**
* How many rows are fetched at a time by the JDBC driver.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,12 @@ interface HibernateOrmConfigPersistenceUnitDatabase {
/**
* The default catalog to use for the database objects.
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> defaultCatalog();
Optional<@WithConverter(TrimmedStringConverter.class) String> defaultCatalog();

/**
* The default schema to use for the database objects.
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> defaultSchema();
Optional<@WithConverter(TrimmedStringConverter.class) String> defaultSchema();

/**
* Whether Hibernate ORM should check on startup
Expand Down Expand Up @@ -175,14 +173,12 @@ interface HibernateOrmConfigPersistenceUnitScriptGeneration {
/**
* Filename or URL where the database create DDL file should be generated.
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> createTarget();
Optional<@WithConverter(TrimmedStringConverter.class) String> createTarget();

/**
* Filename or URL where the database drop DDL file should be generated.
*/
@WithConverter(TrimmedStringConverter.class)
Optional<String> dropTarget();
Optional<@WithConverter(TrimmedStringConverter.class) String> dropTarget();

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ enum ResponseMode {
/**
* Request URL query parameters which, if present, are added to the authentication redirect URI.
*/
Optional<@WithConverter(TrimmedStringConverter.class) List<String>> forwardParams();
Optional<List<@WithConverter(TrimmedStringConverter.class) String>> forwardParams();

/**
* If enabled the state, session, and post logout cookies have their `secure` parameter set to `true`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ public Map<String, String> extraParams() {
}

@Override
public Optional<@WithConverter(TrimmedStringConverter.class) List<String>> forwardParams() {
public Optional<List<@WithConverter(TrimmedStringConverter.class) String>> forwardParams() {
invocationsRecorder.put(ConfigMappingMethods.AUTHENTICATION_FORWARD_PARAMS, true);
return Optional.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface RedisClientBuildTimeConfig {
* </ul>
*/
@ConfigDocDefault("import.redis in DEV, TEST ; no-file otherwise")
Optional<@WithConverter(TrimmedStringConverter.class) List<String>> loadScript();
Optional<List<@WithConverter(TrimmedStringConverter.class) String>> loadScript();

/**
* When using {@code redisLoadScript}, indicates if the Redis database must be flushed (erased) before importing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ public interface SpringCloudConfigClientConfig {
* TrustStore to be used containing the SSL certificate used by the Config server
* Can be either a classpath resource or a file system path
*/
@WithConverter(PathConverter.class)
Optional<Path> trustStore();
Optional<@WithConverter(PathConverter.class) Path> trustStore();

/**
* Password of TrustStore to be used containing the SSL certificate used by the Config server
Expand All @@ -94,8 +93,7 @@ public interface SpringCloudConfigClientConfig {
* KeyStore to be used containing the SSL certificate for authentication with the Config server
* Can be either a classpath resource or a file system path
*/
@WithConverter(PathConverter.class)
Optional<Path> keyStore();
Optional<@WithConverter(PathConverter.class) Path> keyStore();

/**
* Password of KeyStore to be used containing the SSL certificate for authentication with the Config server
Expand Down

0 comments on commit bc3fe92

Please sign in to comment.