Skip to content

Commit 31cc4ae

Browse files
author
Evan Hu
committed
Merge remote-tracking branch 'origin/master'
2 parents ea922f1 + 6a49cdf commit 31cc4ae

File tree

6 files changed

+238
-237
lines changed

6 files changed

+238
-237
lines changed

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,14 @@
186186
</execution>
187187
</executions>
188188
</plugin>
189+
<plugin>
190+
<groupId>org.apache.maven.plugins</groupId>
191+
<artifactId>maven-surefire-plugin</artifactId>
192+
<version>2.22.2</version>
193+
<configuration>
194+
<skipTests>true</skipTests>
195+
</configuration>
196+
</plugin>
189197
</plugins>
190198
</build>
191199

src/main/java/info/xiaomo/gengine/ai/btree/BehaviorTreeManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ private LeafTask<AbsPerson> createLeafTask(Element element) {
261261
Class<?> leafTaskClass;
262262
try {
263263
leafTaskClass = Class.forName(classStr);
264-
leafTask = (LeafTask<AbsPerson>) leafTaskClass.newInstance();
264+
leafTask = (LeafTask<AbsPerson>) leafTaskClass.getDeclaredConstructor().newInstance();
265265

266266
// 设置属性
267267
if (element.attributeCount() < 2) { // 没有设置属性参数

src/main/java/info/xiaomo/gengine/ai/util/BinaryHeap.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public boolean isEmpty() {
5959
return (size < 1);
6060
}
6161

62+
@SuppressWarnings("unchecked")
6263
protected void doubleCapacityIfFull() {
6364
if (size >= elements.length - 1) {
6465
// not enough room -- create a new array and copy

src/main/java/info/xiaomo/gengine/network/netty/handler/DefaultInBoundHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ protected void channelRead0(ChannelHandlerContext ctx, IDMessage msg) throws Exc
3333
return;
3434
}
3535
Class<? extends IHandler> handlerClass = ScriptManager.getInstance().getTcpHandler(msg.getMsgId());
36-
TcpHandler handler = (TcpHandler) handlerClass.newInstance();
36+
TcpHandler handler = (TcpHandler) handlerClass.getDeclaredConstructor().newInstance();
3737
handler.setCreateTime(TimeUtil.currentTimeMillis());
3838
HandlerEntity handlerEntity = ScriptManager.getInstance().getTcpHandlerEntity(msg.getMsgId());
3939
Message message = MsgUtil.buildMessage(handlerEntity.msg(), (byte[]) msg.getMsg());
4040
handler.setMessage(message);
4141
handler.setRid(msg.getUserID());
4242
handler.setChannel(ctx.channel());
43-
messagehandler(handler, handlerEntity);
43+
messageHandler(handler, handlerEntity);
4444
}
4545

4646

@@ -52,7 +52,7 @@ protected void channelRead0(ChannelHandlerContext ctx, IDMessage msg) throws Exc
5252
*
5353
* @param handler
5454
*/
55-
protected void messagehandler(TcpHandler handler, HandlerEntity handlerEntity) {
55+
protected void messageHandler(TcpHandler handler, HandlerEntity handlerEntity) {
5656
if (getService() != null) {
5757
Executor executor = getService().getExecutor(handlerEntity.thread());
5858
if (executor != null) {

src/main/java/info/xiaomo/gengine/persist/cache/MemoryPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public T get(Class<? extends T> c) {
8383
return cache.remove(0);
8484
}
8585
try {
86-
return c.newInstance();
86+
return c.getDeclaredConstructor().newInstance();
8787
} catch (Exception e) {
8888
e.printStackTrace();
8989
}

0 commit comments

Comments
 (0)