Skip to content

Commit 1058e6a

Browse files
author
Evan Hu
committed
upgrade dom4j
1 parent 94720ba commit 1058e6a

File tree

5 files changed

+29
-12
lines changed

5 files changed

+29
-12
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@
132132
<version>4.5.13</version>
133133
</dependency>
134134
<dependency>
135-
<groupId>dom4j</groupId>
135+
<groupId>org.dom4j</groupId>
136136
<artifactId>dom4j</artifactId>
137-
<version>1.6.1</version>
137+
<version>2.1.3</version>
138138
</dependency>
139139
</dependencies>
140140

src/main/java/info/xiaomo/core/config/util/ExcelUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static String getCellStringValue(Cell cell) {
5656
}
5757
String retValue = null;
5858
switch (cell.getCellType()) {
59-
case Cell.CELL_TYPE_NUMERIC:
59+
case NUMERIC:
6060
if (DateUtil.isCellDateFormatted(cell)) {
6161
Date date = cell.getDateCellValue();
6262
if (date != null) {
@@ -71,10 +71,10 @@ public static String getCellStringValue(Cell cell) {
7171
return String.valueOf(value);
7272
}
7373
break;
74-
case Cell.CELL_TYPE_STRING:
74+
case STRING:
7575
retValue = cell.getRichStringCellValue().getString();
7676
break;
77-
case Cell.CELL_TYPE_FORMULA:
77+
case FORMULA:
7878
try {
7979
// 先按照字符串格式获取 如果是生成的是数字 会抛出异常
8080
retValue = cell.getStringCellValue();
@@ -93,11 +93,11 @@ public static String getCellStringValue(Cell cell) {
9393
}
9494
}
9595
break;
96-
case Cell.CELL_TYPE_BOOLEAN:
96+
case BOOLEAN:
9797
retValue = String.valueOf(cell.getBooleanCellValue());
9898
break;
99-
case Cell.CELL_TYPE_BLANK:
100-
case Cell.CELL_TYPE_ERROR:
99+
case BLANK:
100+
case ERROR:
101101
default:
102102
retValue = null;
103103
break;

src/main/java/info/xiaomo/core/network/mina/handler/ClientProtocolHandler.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import info.xiaomo.core.server.BaseServerConfig;
1212
import info.xiaomo.core.server.Service;
1313
import org.apache.mina.core.session.IoSession;
14+
import org.apache.mina.filter.FilterEvent;
1415
import org.slf4j.Logger;
1516
import org.slf4j.LoggerFactory;
1617

@@ -64,10 +65,8 @@ public void messageReceived(IoSession session, Object obj) throws Exception {
6465
Message message = MsgUtil.buildMessage(handlerEntity.msg(), bytes, messageHeaderLength,
6566
bytes.length - messageHeaderLength);
6667
TcpHandler handler = (TcpHandler) handlerClass.newInstance();
67-
if (handler != null) {
68-
messageHandler(session, handlerEntity, message, handler);
69-
return;
70-
}
68+
messageHandler(session, handlerEntity, message, handler);
69+
return;
7170
}
7271
}
7372
forward(session, mid, bytes);
@@ -77,6 +76,11 @@ public void messageReceived(IoSession session, Object obj) throws Exception {
7776
}
7877
}
7978

79+
@Override
80+
public void event(IoSession ioSession, FilterEvent filterEvent) throws Exception {
81+
82+
}
83+
8084
/**
8185
* {@inheritDoc}
8286
*/

src/main/java/info/xiaomo/core/network/mina/handler/DefaultClientProtocolHandler.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import info.xiaomo.core.common.utils.IntUtil;
44
import info.xiaomo.core.network.mina.service.MinaClientService;
55
import org.apache.mina.core.session.IoSession;
6+
import org.apache.mina.filter.FilterEvent;
67

78
/**
89
* 默认内部客户端消息处理器
@@ -69,4 +70,9 @@ public void sessionClosed(IoSession session) {
6970
getService().onIoSessionClosed(session);
7071
}
7172

73+
@Override
74+
public void event(IoSession ioSession, FilterEvent filterEvent) throws Exception {
75+
76+
}
77+
7278
}

src/main/java/info/xiaomo/core/network/mina/service/GameHttpSevice.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import info.xiaomo.core.network.mina.handler.HttpServerIoHandler;
66
import info.xiaomo.core.server.Service;
77
import info.xiaomo.core.thread.ThreadPoolExecutorConfig;
8+
import org.apache.mina.core.session.IoSession;
9+
import org.apache.mina.filter.FilterEvent;
810
import org.slf4j.Logger;
911
import org.slf4j.LoggerFactory;
1012

@@ -95,4 +97,9 @@ public GameHttpServerHandler(Service<MinaServerConfig> service) {
9597
protected Service<MinaServerConfig> getService() {
9698
return service;
9799
}
100+
101+
@Override
102+
public void event(IoSession ioSession, FilterEvent filterEvent) throws Exception {
103+
104+
}
98105
}

0 commit comments

Comments
 (0)