File tree 5 files changed +25
-5
lines changed
spring-pulsar/src/main/java/org/springframework/pulsar
spring-pulsar-docs/src/main/antora/modules/ROOT/pages/reference/pulsar
5 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ Given the following listener method:
93
93
----
94
94
@PulsarListener(topics = "my-input-topic") // <1>
95
95
void listen(String msg) { // <2>
96
- var transformedMsg = msg.toUpperCase(); // <3>
96
+ var transformedMsg = msg.toUpperCase(Locale.ROOT ); // <3>
97
97
this.transactionalTemplate.send("my-output-topic", transformedMsg); // <4>
98
98
} // <5> <6>
99
99
----
@@ -215,7 +215,7 @@ The DB transaction is committed first; if the Pulsar transaction fails to commit
215
215
@PulsarListener(topics = "my-input-topic")
216
216
@Transactional("dataSourceTransactionManager")
217
217
void listen(String msg) {
218
- var transformedMsg = msg.toUpperCase();
218
+ var transformedMsg = msg.toUpperCase(Locale.ROOT );
219
219
this.pulsarTemplate.send("my-output-topic", transformedMsg);
220
220
this.jdbcTemplate.execute("insert into my_table (data) values ('%s')".formatted(transformedMsg));
221
221
}
Original file line number Diff line number Diff line change 20
20
import java .util .Collections ;
21
21
import java .util .LinkedHashMap ;
22
22
import java .util .List ;
23
+ import java .util .Locale ;
23
24
import java .util .Map ;
24
25
import java .util .Optional ;
25
26
import java .util .stream .Stream ;
@@ -314,7 +315,7 @@ private Optional<Exception> safeInvoke(Runnable invocation) {
314
315
}
315
316
316
317
private String functionDesc (PulsarFunctionOperations <?> function ) {
317
- return "'%s' %s" .formatted (function .name (), function .type ().toString ().toLowerCase ());
318
+ return "'%s' %s" .formatted (function .name (), function .type ().toString ().toLowerCase (Locale . ROOT ));
318
319
}
319
320
320
321
/**
Original file line number Diff line number Diff line change 16
16
17
17
package org .springframework .pulsar .support .header ;
18
18
19
+ import java .util .Locale ;
19
20
import java .util .Set ;
20
21
21
22
import org .springframework .core .log .LogAccessor ;
@@ -92,13 +93,13 @@ public static PatternMatch fromPatternString(String pattern) {
92
93
93
94
public PatternMatch (String pattern , boolean negate ) {
94
95
Assert .notNull (pattern , "Pattern must not be null" );
95
- this .pattern = pattern .toLowerCase ();
96
+ this .pattern = pattern .toLowerCase (Locale . ROOT );
96
97
this .negate = negate ;
97
98
}
98
99
99
100
@ Override
100
101
public boolean matchHeader (String headerName ) {
101
- if (!PatternMatchUtils .simpleMatch (this .pattern , headerName .toLowerCase ())) {
102
+ if (!PatternMatchUtils .simpleMatch (this .pattern , headerName .toLowerCase (Locale . ROOT ))) {
102
103
return false ;
103
104
}
104
105
LOGGER .debug (() -> "headerName=[%s] WILL %s be mapped, matched pattern=%s" .formatted (headerName ,
Original file line number Diff line number Diff line change 9
9
<suppress files =" PulsarFunctionAdministrationIntegrationTests" checks =" Regexp" />
10
10
<suppress files =" Proto" checks =" .*" />
11
11
<suppress files =" .*Tests" checks =" HideUtilityClassConstructor" />
12
+ <suppress files =" .*Tests" checks =" RegexpSinglelineJava" id =" toLowerCaseWithoutLocale" />
13
+ <suppress files =" .*Tests" checks =" RegexpSinglelineJava" id =" toUpperCaseWithoutLocale" />
12
14
<suppress files =" [\\/]spring-pulsar-docs[\\/]" checks =" JavadocPackage|JavadocType|JavadocVariable|SpringDeprecatedCheck" />
13
15
<suppress files =" [\\/]spring-pulsar-docs[\\/]" checks =" SpringJavadoc" message =" \@since" />
14
16
<suppress files =" [\\/]spring-pulsar-docs[\\/].*jooq" checks =" AvoidStaticImport" />
Original file line number Diff line number Diff line change 169
169
value =" Please use AssertJ imports." />
170
170
<property name =" ignoreComments" value =" true" />
171
171
</module >
172
+ <module name =" com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck" >
173
+ <property name =" id" value =" toLowerCaseWithoutLocale" />
174
+ <property name =" format" value =" \.toLowerCase\(\)" />
175
+ <property name =" maximum" value =" 0" />
176
+ <property name =" message"
177
+ value =" String.toLowerCase() should be String.toLowerCase(Locale.ROOT)" />
178
+ <property name =" ignoreComments" value =" true" />
179
+ </module >
180
+ <module name =" com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck" >
181
+ <property name =" id" value =" toUpperCaseWithoutLocale" />
182
+ <property name =" format" value =" \.toUpperCase\(\)" />
183
+ <property name =" maximum" value =" 0" />
184
+ <property name =" message"
185
+ value =" String.toUpperCase() should be String.toUpperCase(Locale.ROOT)" />
186
+ <property name =" ignoreComments" value =" true" />
187
+ </module >
172
188
<module name =" Regexp" >
173
189
<property name =" format" value =" [ \t]+$" />
174
190
<property name =" illegalPattern" value =" true" />
You can’t perform that action at this time.
0 commit comments