diff --git a/core/src/main/java/org/zstack/core/rest/RESTApiFacadeImpl.java b/core/src/main/java/org/zstack/core/rest/RESTApiFacadeImpl.java index e9d9ead27f3..625e1fb6d8b 100755 --- a/core/src/main/java/org/zstack/core/rest/RESTApiFacadeImpl.java +++ b/core/src/main/java/org/zstack/core/rest/RESTApiFacadeImpl.java @@ -112,9 +112,7 @@ void init() throws ClassNotFoundException, InstantiationException, IllegalAccess } } - for (APIEvent e : boundEvents) { - bus.subscribeEvent(this, e); - } + bus.subscribeEvent(this, boundEvents.toArray(new APIEvent[boundEvents.size()])); } private static int initMaxRestResultLength() {