From 06416b00f8f1a1871d234cde7129d373b3e3de5b Mon Sep 17 00:00:00 2001 From: shroman Date: Thu, 4 May 2017 21:03:38 +0900 Subject: [PATCH] Changed list creation at DynaCode() to a singleton. --- .../java/org/apache/rocketmq/filtersrv/filter/DynaCode.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 a57b57f3..e0a94d70 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 codeStrs) { -- GitLab