rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dongefore...@apache.org
Subject [31/51] [abbrv] incubator-rocketmq git commit: Changed list creation at DynaCode() to a singleton.
Date Tue, 06 Jun 2017 03:38:51 GMT
Changed list creation at DynaCode() to a singleton.


Project: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/commit/06416b00
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/tree/06416b00
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/diff/06416b00

Branch: refs/heads/master
Commit: 06416b00f8f1a1871d234cde7129d373b3e3de5b
Parents: 0224f93
Author: shroman <rshtykh@yahoo.com>
Authored: Thu May 4 21:03:38 2017 +0900
Committer: dongeforever <zhendongliu92@yeah.net>
Committed: Tue Jun 6 11:37:29 2017 +0800

----------------------------------------------------------------------
 .../java/org/apache/rocketmq/filtersrv/filter/DynaCode.java     | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/06416b00/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/filter/DynaCode.java
----------------------------------------------------------------------
diff --git a/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/filter/DynaCode.java b/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/filter/DynaCode.java
index a57b57f..e0a94d7 100644
--- a/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/filter/DynaCode.java
+++ b/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/filter/DynaCode.java
@@ -28,7 +28,7 @@ import java.net.URL;
 import java.net.URLClassLoader;
 import java.net.URLDecoder;
 import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -71,9 +71,8 @@ public class DynaCode {
 
     private String target;
 
-    @SuppressWarnings("unchecked")
     public DynaCode(String code) {
-        this(Thread.currentThread().getContextClassLoader(), Arrays.asList(code));
+        this(Thread.currentThread().getContextClassLoader(), Collections.singletonList(code));
     }
 
     public DynaCode(ClassLoader parentClassLoader, List<String> codeStrs) {


Mime
View raw message