Skip to content

Commit b37c236

Browse files
authored
Merge pull request #3360 from hazendaz/pom-cleanup
Fix casing
2 parents 9a6c49a + 1aa1937 commit b37c236

File tree

5 files changed

+22
-21
lines changed

5 files changed

+22
-21
lines changed

src/main/java/org/apache/ibatis/datasource/jndi/JndiDataSourceFactory.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,15 @@ public DataSource getDataSource() {
6666
}
6767

6868
private static Properties getEnvProperties(Properties allProps) {
69-
final String PREFIX = ENV_PREFIX;
7069
Properties contextProperties = null;
7170
for (Entry<Object, Object> entry : allProps.entrySet()) {
7271
String key = (String) entry.getKey();
7372
String value = (String) entry.getValue();
74-
if (key.startsWith(PREFIX)) {
73+
if (key.startsWith(ENV_PREFIX)) {
7574
if (contextProperties == null) {
7675
contextProperties = new Properties();
7776
}
78-
contextProperties.put(key.substring(PREFIX.length()), value);
77+
contextProperties.put(key.substring(ENV_PREFIX.length()), value);
7978
}
8079
}
8180
return contextProperties;

src/main/java/org/apache/ibatis/scripting/LanguageDriverRegistry.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
*/
2626
public class LanguageDriverRegistry {
2727

28-
private final Map<Class<? extends LanguageDriver>, LanguageDriver> LANGUAGE_DRIVER_MAP = new HashMap<>();
28+
private final Map<Class<? extends LanguageDriver>, LanguageDriver> languageDriverMap = new HashMap<>();
2929

3030
private Class<? extends LanguageDriver> defaultDriverClass;
3131

3232
public void register(Class<? extends LanguageDriver> cls) {
3333
if (cls == null) {
3434
throw new IllegalArgumentException("null is not a valid Language Driver");
3535
}
36-
MapUtil.computeIfAbsent(LANGUAGE_DRIVER_MAP, cls, k -> {
36+
MapUtil.computeIfAbsent(languageDriverMap, cls, k -> {
3737
try {
3838
return k.getDeclaredConstructor().newInstance();
3939
} catch (Exception ex) {
@@ -47,13 +47,13 @@ public void register(LanguageDriver instance) {
4747
throw new IllegalArgumentException("null is not a valid Language Driver");
4848
}
4949
Class<? extends LanguageDriver> cls = instance.getClass();
50-
if (!LANGUAGE_DRIVER_MAP.containsKey(cls)) {
51-
LANGUAGE_DRIVER_MAP.put(cls, instance);
50+
if (!languageDriverMap.containsKey(cls)) {
51+
languageDriverMap.put(cls, instance);
5252
}
5353
}
5454

5555
public LanguageDriver getDriver(Class<? extends LanguageDriver> cls) {
56-
return LANGUAGE_DRIVER_MAP.get(cls);
56+
return languageDriverMap.get(cls);
5757
}
5858

5959
public LanguageDriver getDefaultDriver() {

src/test/java/org/apache/ibatis/autoconstructor/ExtensiveSubject.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -53,6 +53,6 @@ public ExtensiveSubject(final byte aByte, final short aShort, final char aChar,
5353
}
5454

5555
public enum TestEnum {
56-
AVALUE, BVALUE, CVALUE;
56+
AVALUE, BVALUE, CVALUE
5757
}
5858
}

src/test/java/org/apache/ibatis/builder/XmlConfigBuilderTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public E getNullableResult(CallableStatement cs, int columnIndex) throws SQLExce
155155

156156
@Test
157157
void registerJavaTypeInitializingTypeHandler() {
158-
final String MAPPER_CONFIG = """
158+
final String mapperConfig = """
159159
<?xml version="1.0" encoding="UTF-8" ?>
160160
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "https://mybatis.org/dtd/mybatis-3-config.dtd">
161161
<configuration>
@@ -166,7 +166,7 @@ void registerJavaTypeInitializingTypeHandler() {
166166
</configuration>
167167
""";
168168

169-
XMLConfigBuilder builder = new XMLConfigBuilder(new StringReader(MAPPER_CONFIG));
169+
XMLConfigBuilder builder = new XMLConfigBuilder(new StringReader(mapperConfig));
170170
builder.parse();
171171

172172
TypeHandlerRegistry typeHandlerRegistry = builder.getConfiguration().getTypeHandlerRegistry();
@@ -283,7 +283,7 @@ void parseIsTwice() throws Exception {
283283

284284
@Test
285285
void unknownSettings() {
286-
final String MAPPER_CONFIG = """
286+
final String mapperConfig = """
287287
<?xml version="1.0" encoding="UTF-8" ?>
288288
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "https://mybatis.org/dtd/mybatis-3-config.dtd">
289289
<configuration>
@@ -293,15 +293,15 @@ void unknownSettings() {
293293
</configuration>
294294
""";
295295

296-
XMLConfigBuilder builder = new XMLConfigBuilder(new StringReader(MAPPER_CONFIG));
296+
XMLConfigBuilder builder = new XMLConfigBuilder(new StringReader(mapperConfig));
297297
when(builder::parse);
298298
then(caughtException()).isInstanceOf(BuilderException.class)
299299
.hasMessageContaining("The setting foo is not known. Make sure you spelled it correctly (case sensitive).");
300300
}
301301

302302
@Test
303303
void unknownJavaTypeOnTypeHandler() {
304-
final String MAPPER_CONFIG = """
304+
final String mapperConfig = """
305305
<?xml version="1.0" encoding="UTF-8" ?>
306306
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "https://mybatis.org/dtd/mybatis-3-config.dtd">
307307
<configuration>
@@ -311,23 +311,23 @@ void unknownJavaTypeOnTypeHandler() {
311311
</configuration>
312312
""";
313313

314-
XMLConfigBuilder builder = new XMLConfigBuilder(new StringReader(MAPPER_CONFIG));
314+
XMLConfigBuilder builder = new XMLConfigBuilder(new StringReader(mapperConfig));
315315
when(builder::parse);
316316
then(caughtException()).isInstanceOf(BuilderException.class)
317317
.hasMessageContaining("Error registering typeAlias for 'null'. Cause: ");
318318
}
319319

320320
@Test
321321
void propertiesSpecifyResourceAndUrlAtSameTime() {
322-
final String MAPPER_CONFIG = """
322+
final String mapperConfig = """
323323
<?xml version="1.0" encoding="UTF-8" ?>
324324
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "https://mybatis.org/dtd/mybatis-3-config.dtd">
325325
<configuration>
326326
<properties resource="a/b/c/foo.properties" url="file:./a/b/c/jdbc.properties"/>
327327
</configuration>
328328
""";
329329

330-
XMLConfigBuilder builder = new XMLConfigBuilder(new StringReader(MAPPER_CONFIG));
330+
XMLConfigBuilder builder = new XMLConfigBuilder(new StringReader(mapperConfig));
331331
when(builder::parse);
332332
then(caughtException()).isInstanceOf(BuilderException.class).hasMessageContaining(
333333
"The properties element cannot specify both a URL and a resource based property file reference. Please specify one or the other.");

src/test/java/org/apache/ibatis/submitted/camelcase/Camel.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,8 @@ public class Camel {
1919

2020
private String id;
2121
private String firstName;
22+
23+
// Required to be upper cased
2224
private String LAST_NAME;
2325

2426
public String getId() {
@@ -41,8 +43,8 @@ public String getLAST_NAME() {
4143
return LAST_NAME;
4244
}
4345

44-
public void setLAST_NAME(String last_name) {
45-
LAST_NAME = last_name;
46+
public void setLAST_NAME(String lastName) {
47+
LAST_NAME = lastName;
4648
}
4749

4850
}

0 commit comments

Comments
 (0)