Skip to content

Commit 69b3820

Browse files
committed
Rename the variable for consistency
1 parent 50060a6 commit 69b3820

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/main/java/org/apache/ibatis/executor/loader/javassist/JavassistProxyFactory.java

Lines changed: 4 additions & 4 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.
@@ -100,14 +100,14 @@ static Object createStaticProxy(Class<?> type, MethodHandler callback, List<Clas
100100
}
101101

102102
private static class EnhancedResultObjectProxyImpl implements MethodHandler {
103-
private final ReentrantLock reentrantLock = new ReentrantLock();
104103
private final Class<?> type;
105104
private final ResultLoaderMap lazyLoader;
106105
private final boolean aggressive;
107106
private final Set<String> lazyLoadTriggerMethods;
108107
private final ObjectFactory objectFactory;
109108
private final List<Class<?>> constructorArgTypes;
110109
private final List<Object> constructorArgs;
110+
private final ReentrantLock lock = new ReentrantLock();
111111

112112
private EnhancedResultObjectProxyImpl(Class<?> type, ResultLoaderMap lazyLoader, Configuration configuration,
113113
ObjectFactory objectFactory, List<Class<?>> constructorArgTypes, List<Object> constructorArgs) {
@@ -133,7 +133,7 @@ public static Object createProxy(Object target, ResultLoaderMap lazyLoader, Conf
133133
@Override
134134
public Object invoke(Object enhanced, Method method, Method methodProxy, Object[] args) throws Throwable {
135135
final String methodName = method.getName();
136-
reentrantLock.lock();
136+
lock.lock();
137137
try {
138138
if (WRITE_REPLACE_METHOD.equals(methodName)) {
139139
Object original;
@@ -167,7 +167,7 @@ public Object invoke(Object enhanced, Method method, Method methodProxy, Object[
167167
} catch (Throwable t) {
168168
throw ExceptionUtil.unwrapThrowable(t);
169169
} finally {
170-
reentrantLock.unlock();
170+
lock.unlock();
171171
}
172172
}
173173
}

src/main/java/org/apache/ibatis/io/JBoss6VFS.java

Lines changed: 4 additions & 4 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.
@@ -33,7 +33,7 @@
3333
*/
3434
public class JBoss6VFS extends VFS {
3535
private static final Log log = LogFactory.getLog(JBoss6VFS.class);
36-
private static final ReentrantLock reentrantLock = new ReentrantLock();
36+
private static final ReentrantLock lock = new ReentrantLock();
3737

3838
/** A class that mimics a tiny subset of the JBoss VirtualFile class. */
3939
static class VirtualFile {
@@ -87,7 +87,7 @@ static VirtualFile getChild(URL url) throws IOException {
8787

8888
/** Find all the classes and methods that are required to access the JBoss 6 VFS. */
8989
protected static void initialize() {
90-
reentrantLock.lock();
90+
lock.lock();
9191
try {
9292
if (valid == null) {
9393
// Assume valid. It will get flipped later if something goes wrong.
@@ -109,7 +109,7 @@ protected static void initialize() {
109109
checkReturnType(VirtualFile.getPathNameRelativeTo, String.class);
110110
}
111111
} finally {
112-
reentrantLock.unlock();
112+
lock.unlock();
113113
}
114114
}
115115

src/main/java/org/apache/ibatis/logging/LogFactory.java

Lines changed: 4 additions & 4 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.
@@ -29,7 +29,7 @@ public final class LogFactory {
2929
*/
3030
public static final String MARKER = "MYBATIS";
3131

32-
private static final ReentrantLock reentrantLock = new ReentrantLock();
32+
private static final ReentrantLock lock = new ReentrantLock();
3333
private static Constructor<? extends Log> logConstructor;
3434

3535
static {
@@ -104,7 +104,7 @@ private static void tryImplementation(Runnable runnable) {
104104
}
105105

106106
private static void setImplementation(Class<? extends Log> implClass) {
107-
reentrantLock.lock();
107+
lock.lock();
108108
try {
109109
Constructor<? extends Log> candidate = implClass.getConstructor(String.class);
110110
Log log = candidate.newInstance(LogFactory.class.getName());
@@ -115,7 +115,7 @@ private static void setImplementation(Class<? extends Log> implClass) {
115115
} catch (Throwable t) {
116116
throw new LogException("Error setting Log implementation. Cause: " + t, t);
117117
} finally {
118-
reentrantLock.unlock();
118+
lock.unlock();
119119
}
120120
}
121121

0 commit comments

Comments
 (0)