From 509950e9af724d7c5e6cdd30c949b864edfc6de9 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Fri, 12 Jun 2009 19:12:35 +0000 Subject: [PATCH] Fixed a bug in CLI where the state of command executions may interfere with each other. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@18852 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/cli/CLICommand.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/cli/CLICommand.java b/core/src/main/java/hudson/cli/CLICommand.java index cf099f07c2..56ece76bd5 100644 --- a/core/src/main/java/hudson/cli/CLICommand.java +++ b/core/src/main/java/hudson/cli/CLICommand.java @@ -186,8 +186,10 @@ public abstract class CLICommand implements ExtensionPoint, Cloneable { for (CLICommand cmd : all()) { if(name.equals(cmd.getName())) { try { - return (CLICommand)cmd.clone(); - } catch (CloneNotSupportedException e) { + return cmd.getClass().newInstance(); + } catch (IllegalAccessException e) { + throw new AssertionError(e); + } catch (InstantiationException e) { throw new AssertionError(e); } } -- GitLab