Skip to content

Commit bc3fe92

Browse files
committed
Fix a few misplaced @WithConverter
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.
1 parent 2df8c69 commit bc3fe92

File tree

12 files changed

+29
-54
lines changed

12 files changed

+29
-54
lines changed

core/deployment/src/main/java/io/quarkus/deployment/pkg/NativeConfig.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ public interface NativeConfig {
9595
*
9696
* @deprecated Use the global quarkus.default-locale.
9797
*/
98-
@WithConverter(TrimmedStringConverter.class)
9998
@Deprecated
100-
Optional<String> userLanguage();
99+
Optional<@WithConverter(TrimmedStringConverter.class) String> userLanguage();
101100

102101
/**
103102
* Defines the user country used for building the native executable.
@@ -108,9 +107,8 @@ public interface NativeConfig {
108107
*
109108
* @deprecated Use the global quarkus.default-locale.
110109
*/
111-
@WithConverter(TrimmedStringConverter.class)
112110
@Deprecated
113-
Optional<String> userCountry();
111+
Optional<@WithConverter(TrimmedStringConverter.class) String> userCountry();
114112

115113
/**
116114
* Defines the file encoding as in {@code -Dfile.encoding=...}.

extensions/agroal/runtime/src/main/java/io/quarkus/agroal/runtime/DataSourceJdbcBuildTimeConfig.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ public interface DataSourceJdbcBuildTimeConfig {
2121
/**
2222
* The datasource driver class name
2323
*/
24-
@WithConverter(TrimmedStringConverter.class)
25-
Optional<String> driver();
24+
Optional<@WithConverter(TrimmedStringConverter.class) String> driver();
2625

2726
/**
2827
* Whether we want to use regular JDBC transactions, XA, or disable all transactional capabilities.

extensions/agroal/runtime/src/main/java/io/quarkus/agroal/runtime/DataSourceJdbcRuntimeConfig.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ public interface DataSourceJdbcRuntimeConfig {
2121
/**
2222
* The datasource URL
2323
*/
24-
@WithConverter(TrimmedStringConverter.class)
25-
Optional<String> url();
24+
Optional<@WithConverter(TrimmedStringConverter.class) String> url();
2625

2726
/**
2827
* The initial size of the pool. Usually you will want to set the initial size to match at least the

extensions/datasource/runtime/src/main/java/io/quarkus/datasource/runtime/DataSourceBuildTimeConfig.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ public interface DataSourceBuildTimeConfig {
1414
/**
1515
* The kind of database we will connect to (e.g. h2, postgresql...).
1616
*/
17-
@WithConverter(DatabaseKindConverter.class)
18-
Optional<String> dbKind();
17+
Optional<@WithConverter(DatabaseKindConverter.class) String> dbKind();
1918

2019
/**
2120
* The version of the database we will connect to (e.g. '10.0').
@@ -46,8 +45,7 @@ public interface DataSourceBuildTimeConfig {
4645
*
4746
* @asciidoclet
4847
*/
49-
@WithConverter(TrimmedStringConverter.class)
50-
Optional<String> dbVersion();
48+
Optional<@WithConverter(TrimmedStringConverter.class) String> dbVersion();
5149

5250
/**
5351
* Dev Services.

extensions/datasource/runtime/src/main/java/io/quarkus/datasource/runtime/DataSourceRuntimeConfig.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ public interface DataSourceRuntimeConfig {
3333
/**
3434
* The credentials provider name
3535
*/
36-
@WithConverter(TrimmedStringConverter.class)
37-
Optional<String> credentialsProvider();
36+
Optional<@WithConverter(TrimmedStringConverter.class) String> credentialsProvider();
3837

3938
/**
4039
* The credentials provider bean name.
@@ -45,6 +44,5 @@ public interface DataSourceRuntimeConfig {
4544
* <p>
4645
* For Vault, the credentials provider bean name is {@code vault-credentials-provider}.
4746
*/
48-
@WithConverter(TrimmedStringConverter.class)
49-
Optional<String> credentialsProviderName();
47+
Optional<@WithConverter(TrimmedStringConverter.class) String> credentialsProviderName();
5048
}

extensions/datasource/runtime/src/main/java/io/quarkus/datasource/runtime/DevServicesBuildTimeConfig.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ public interface DevServicesBuildTimeConfig {
2929
* <p>
3030
* This has no effect if the provider is not a container-based database, such as H2 or Derby.
3131
*/
32-
@WithConverter(TrimmedStringConverter.class)
33-
Optional<String> imageName();
32+
Optional<@WithConverter(TrimmedStringConverter.class) String> imageName();
3433

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

7169
/**
7270
* The database name to use if this Dev Service supports overriding it.
7371
*/
74-
Optional<String> dbName();
72+
Optional<@WithConverter(TrimmedStringConverter.class) String> dbName();
7573

7674
/**
7775
* The username to use if this Dev Service supports overriding it.

extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmConfigPersistenceUnit.java

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ public interface HibernateOrmConfigPersistenceUnit {
3131
* <p>
3232
* If undefined, it will use the default datasource.
3333
*/
34-
@WithConverter(TrimmedStringConverter.class)
35-
Optional<String> datasource();
34+
Optional<@WithConverter(TrimmedStringConverter.class) String> datasource();
3635

3736
/**
3837
* The packages in which the entities affected to this persistence unit are located.
@@ -113,16 +112,14 @@ public interface HibernateOrmConfigPersistenceUnit {
113112
*
114113
* Class name of the Hibernate PhysicalNamingStrategy implementation
115114
*/
116-
@WithConverter(TrimmedStringConverter.class)
117-
Optional<String> physicalNamingStrategy();
115+
Optional<@WithConverter(TrimmedStringConverter.class) String> physicalNamingStrategy();
118116

119117
/**
120118
* Pluggable strategy for applying implicit naming rules when an explicit name is not given.
121119
*
122120
* Class name of the Hibernate ImplicitNamingStrategy implementation
123121
*/
124-
@WithConverter(TrimmedStringConverter.class)
125-
Optional<String> implicitNamingStrategy();
122+
Optional<@WithConverter(TrimmedStringConverter.class) String> implicitNamingStrategy();
126123

127124
/**
128125
* Class name of a custom
@@ -140,8 +137,7 @@ public interface HibernateOrmConfigPersistenceUnit {
140137
*
141138
* @asciidoclet
142139
*/
143-
@WithConverter(TrimmedStringConverter.class)
144-
Optional<String> metadataBuilderContributor();
140+
Optional<@WithConverter(TrimmedStringConverter.class) String> metadataBuilderContributor();
145141

146142
/**
147143
* XML files to configure the entity mapping, e.g. {@code META-INF/my-orm.xml}.
@@ -223,8 +219,7 @@ public interface HibernateOrmConfigPersistenceUnit {
223219
*
224220
* @asciidoclet
225221
*/
226-
@WithConverter(TrimmedStringConverter.class)
227-
Optional<String> multitenant();
222+
Optional<@WithConverter(TrimmedStringConverter.class) String> multitenant();
228223

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

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

308301
/**
309302
* The storage engine to use when the dialect supports multiple storage engines.
@@ -312,8 +305,7 @@ interface HibernateOrmConfigPersistenceUnitDialect {
312305
*
313306
* @asciidoclet
314307
*/
315-
@WithConverter(TrimmedStringConverter.class)
316-
Optional<String> storageEngine();
308+
Optional<@WithConverter(TrimmedStringConverter.class) String> storageEngine();
317309

318310
default boolean isAnyPropertySet() {
319311
return dialect().isPresent() || storageEngine().isPresent();
@@ -537,8 +529,7 @@ interface HibernateOrmConfigPersistenceUnitJdbc {
537529
*
538530
* See `quarkus.hibernate-orm.mapping.timezone.default-storage`.
539531
*/
540-
@WithConverter(TrimmedStringConverter.class)
541-
Optional<String> timezone();
532+
Optional<@WithConverter(TrimmedStringConverter.class) String> timezone();
542533

543534
/**
544535
* How many rows are fetched at a time by the JDBC driver.

extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/HibernateOrmRuntimeConfigPersistenceUnit.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,12 @@ interface HibernateOrmConfigPersistenceUnitDatabase {
8989
/**
9090
* The default catalog to use for the database objects.
9191
*/
92-
@WithConverter(TrimmedStringConverter.class)
93-
Optional<String> defaultCatalog();
92+
Optional<@WithConverter(TrimmedStringConverter.class) String> defaultCatalog();
9493

9594
/**
9695
* The default schema to use for the database objects.
9796
*/
98-
@WithConverter(TrimmedStringConverter.class)
99-
Optional<String> defaultSchema();
97+
Optional<@WithConverter(TrimmedStringConverter.class) String> defaultSchema();
10098

10199
/**
102100
* Whether Hibernate ORM should check on startup
@@ -175,14 +173,12 @@ interface HibernateOrmConfigPersistenceUnitScriptGeneration {
175173
/**
176174
* Filename or URL where the database create DDL file should be generated.
177175
*/
178-
@WithConverter(TrimmedStringConverter.class)
179-
Optional<String> createTarget();
176+
Optional<@WithConverter(TrimmedStringConverter.class) String> createTarget();
180177

181178
/**
182179
* Filename or URL where the database drop DDL file should be generated.
183180
*/
184-
@WithConverter(TrimmedStringConverter.class)
185-
Optional<String> dropTarget();
181+
Optional<@WithConverter(TrimmedStringConverter.class) String> dropTarget();
186182

187183
}
188184

extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcTenantConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ enum ResponseMode {
676676
/**
677677
* Request URL query parameters which, if present, are added to the authentication redirect URI.
678678
*/
679-
Optional<@WithConverter(TrimmedStringConverter.class) List<String>> forwardParams();
679+
Optional<List<@WithConverter(TrimmedStringConverter.class) String>> forwardParams();
680680

681681
/**
682682
* If enabled the state, session, and post logout cookies have their `secure` parameter set to `true`

extensions/oidc/runtime/src/test/java/io/quarkus/oidc/runtime/OidcTenantConfigImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ public Map<String, String> extraParams() {
654654
}
655655

656656
@Override
657-
public Optional<@WithConverter(TrimmedStringConverter.class) List<String>> forwardParams() {
657+
public Optional<List<@WithConverter(TrimmedStringConverter.class) String>> forwardParams() {
658658
invocationsRecorder.put(ConfigMappingMethods.AUTHENTICATION_FORWARD_PARAMS, true);
659659
return Optional.empty();
660660
}

0 commit comments

Comments
 (0)