Skip to content

Commit 66afe96

Browse files
CrazyHZMralf0131
authored andcommitted
Modified to lower camel case (#3003)
1 parent 0e0fbd5 commit 66afe96

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

dubbo-common/src/main/java/org/apache/dubbo/common/compiler/support/ClassUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ public static Object newInstance(String name) {
5656

5757
public static Class<?> forName(String[] packages, String className) {
5858
try {
59-
return _forName(className);
59+
return classForName(className);
6060
} catch (ClassNotFoundException e) {
6161
if (packages != null && packages.length > 0) {
6262
for (String pkg : packages) {
6363
try {
64-
return _forName(pkg + "." + className);
64+
return classForName(pkg + "." + className);
6565
} catch (ClassNotFoundException e2) {
6666
}
6767
}
@@ -72,13 +72,13 @@ public static Class<?> forName(String[] packages, String className) {
7272

7373
public static Class<?> forName(String className) {
7474
try {
75-
return _forName(className);
75+
return classForName(className);
7676
} catch (ClassNotFoundException e) {
7777
throw new IllegalStateException(e.getMessage(), e);
7878
}
7979
}
8080

81-
public static Class<?> _forName(String className) throws ClassNotFoundException {
81+
public static Class<?> classForName(String className) throws ClassNotFoundException {
8282
switch (className) {
8383
case "boolean":
8484
return boolean.class;

dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/AbortPolicyWithReport.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ public void run() {
8585

8686
SimpleDateFormat sdf;
8787

88-
String OS = System.getProperty("os.name").toLowerCase();
88+
String os = System.getProperty("os.name").toLowerCase();
8989

9090
// window system don't support ":" in file name
91-
if(OS.contains("win")){
91+
if(os.contains("win")){
9292
sdf = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss");
9393
}else {
9494
sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");

dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/server/handler/HttpProcessHandler.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,27 @@ protected void channelRead0(ChannelHandlerContext ctx, HttpRequest msg) throws E
5858
// return 404 when fail to construct command context
5959
if (commandContext == null) {
6060
log.warn("can not found commandContext url: " + msg.getUri());
61-
FullHttpResponse response = http_404();
61+
FullHttpResponse response = http404();
6262
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
6363
} else {
6464
commandContext.setRemote(ctx.channel());
6565
try {
6666
String result = commandExecutor.execute(commandContext);
67-
FullHttpResponse response = http_200(result);
67+
FullHttpResponse response = http200(result);
6868
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
6969
} catch (NoSuchCommandException ex) {
7070
log.error("can not find commandContext: " + commandContext, ex);
71-
FullHttpResponse response = http_404();
71+
FullHttpResponse response = http404();
7272
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
7373
} catch (Exception qosEx) {
7474
log.error("execute commandContext: " + commandContext + " got exception", qosEx);
75-
FullHttpResponse response = http_500(qosEx.getMessage());
75+
FullHttpResponse response = http500(qosEx.getMessage());
7676
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
7777
}
7878
}
7979
}
8080

81-
private static final FullHttpResponse http_200(String result) {
81+
private static final FullHttpResponse http200(String result) {
8282
FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK,
8383
Unpooled.wrappedBuffer(result.getBytes()));
8484
HttpHeaders httpHeaders = response.headers();
@@ -87,15 +87,15 @@ private static final FullHttpResponse http_200(String result) {
8787
return response;
8888
}
8989

90-
private static final FullHttpResponse http_404() {
90+
private static final FullHttpResponse http404() {
9191
FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.NOT_FOUND);
9292
HttpHeaders httpHeaders = response.headers();
9393
httpHeaders.set(HttpHeaders.Names.CONTENT_TYPE, "text/plain");
9494
httpHeaders.set(HttpHeaders.Names.CONTENT_LENGTH, response.content().readableBytes());
9595
return response;
9696
}
9797

98-
private static final FullHttpResponse http_500(String errorMessage) {
98+
private static final FullHttpResponse http500(String errorMessage) {
9999
FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.INTERNAL_SERVER_ERROR
100100
, Unpooled.wrappedBuffer(errorMessage.getBytes()));
101101
HttpHeaders httpHeaders = response.headers();

dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboProtocol.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,17 +364,17 @@ public <T> Invoker<T> refer(Class<T> serviceType, URL url) throws RpcException {
364364

365365
private ExchangeClient[] getClients(URL url) {
366366
// whether to share connection
367-
boolean service_share_connect = false;
367+
boolean serviceShareConnect = false;
368368
int connections = url.getParameter(Constants.CONNECTIONS_KEY, 0);
369369
// if not configured, connection is shared, otherwise, one connection for one service
370370
if (connections == 0) {
371-
service_share_connect = true;
371+
serviceShareConnect = true;
372372
connections = 1;
373373
}
374374

375375
ExchangeClient[] clients = new ExchangeClient[connections];
376376
for (int i = 0; i < clients.length; i++) {
377-
if (service_share_connect) {
377+
if (serviceShareConnect) {
378378
clients[i] = getSharedClient(url);
379379
} else {
380380
clients[i] = initClient(url);

dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/LogTelnetHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,20 @@ public String telnet(Channel channel, String message) {
5252
if (!StringUtils.isInteger(str[0])) {
5353
LoggerFactory.setLevel(Level.valueOf(message.toUpperCase()));
5454
} else {
55-
int SHOW_LOG_LENGTH = Integer.parseInt(str[0]);
55+
int showLogLength = Integer.parseInt(str[0]);
5656

5757
if (file != null && file.exists()) {
5858
try {
5959
FileInputStream fis = new FileInputStream(file);
6060
FileChannel filechannel = fis.getChannel();
6161
size = filechannel.size();
6262
ByteBuffer bb;
63-
if (size <= SHOW_LOG_LENGTH) {
63+
if (size <= showLogLength) {
6464
bb = ByteBuffer.allocate((int) size);
6565
filechannel.read(bb, 0);
6666
} else {
67-
int pos = (int) (size - SHOW_LOG_LENGTH);
68-
bb = ByteBuffer.allocate(SHOW_LOG_LENGTH);
67+
int pos = (int) (size - showLogLength);
68+
bb = ByteBuffer.allocate(showLogLength);
6969
filechannel.read(bb, pos);
7070
}
7171
bb.flip();

0 commit comments

Comments
 (0)