Buggy code:
@ Override public boolean start ( ) { } @ Override public boolean stop ( ) { } @ Override public String getName ( ) { } @ Override public Type getType ( ) { } protected void fillHostInfo ( StartupRoutingCommand cmd ) { } protected void setupServer ( ) throws IOException { } @ Override public StartupCommand [ ] initialize ( ) { } @ Override public PingCommand getCurrentStatus ( long id ) { } protected ReadyAnswer execute ( ReadyCommand cmd ) { } protected void createNfsSr ( StorageFilerTO pool ) throws XmlRpcException { } protected void createOCFS2Sr ( StorageFilerTO pool ) throws XmlRpcException { } private void setupHeartBeat ( String poolUuid ) { } protected Answer execute ( ModifyStoragePoolCommand cmd ) { } protected Answer execute ( CreateStoragePoolCommand cmd ) { } protected PrimaryStorageDownloadAnswer execute ( final PrimaryStorageDownloadCommand cmd ) { } protected CreateAnswer execute ( CreateCommand cmd ) { } protected void applySpecToVm ( OvmVm . Details vm , VirtualMachineTO spec ) { } protected void createVbds ( OvmVm . Details vm , VirtualMachineTO spec ) throws URISyntaxException { } private String createVlanBridge ( String networkName , String vlanId ) throws XmlRpcException { } protected String getNetwork ( NicTO nic ) throws XmlRpcException { } protected Details createVif ( NicTO nic ) throws XmlRpcException { } protected void createVifs ( OvmVm . Details vm , VirtualMachineTO spec ) throws CloudRuntimeException , XmlRpcException { } protected void startVm ( OvmVm . Details vm ) throws XmlRpcException { } private void cleanupNetwork ( List < OvmVif . Details > vifs ) throws XmlRpcException { } protected void cleanup ( OvmVm . Details vm ) { } @ Override public synchronized StartAnswer execute ( StartCommand cmd ) { } protected Answer execute ( GetHostStatsCommand cmd ) { } @ Override public StopAnswer execute ( StopCommand cmd ) { } @ Override public RebootAnswer execute ( RebootCommand cmd ) { } private PowerState toPowerState ( String vmName , String s ) { } protected HashMap < String , HostVmStateReportEntry > getHostVmStateReport ( ) throws XmlRpcException { } protected HashMap < String , PowerState > getAllVms ( ) throws XmlRpcException { } protected GetStorageStatsAnswer execute ( final GetStorageStatsCommand cmd ) { } private VmStatsEntry getVmStat ( String vmName ) throws XmlRpcException { } protected GetVmStatsAnswer execute ( GetVmStatsCommand cmd ) { } protected AttachVolumeAnswer execute ( AttachVolumeCommand cmd ) { } public Answer execute ( DestroyCommand cmd ) { } protected PrepareForMigrationAnswer execute ( PrepareForMigrationCommand cmd ) { } protected MigrateAnswer execute ( final MigrateCommand cmd ) { } protected CheckVirtualMachineAnswer execute ( final CheckVirtualMachineCommand cmd ) { } protected MaintainAnswer execute ( MaintainCommand cmd ) { } protected GetVncPortAnswer execute ( GetVncPortCommand cmd ) { } protected Answer execute ( PingTestCommand cmd ) { } protected FenceAnswer execute ( FenceCommand cmd ) { } protected Answer execute ( AttachIsoCommand cmd ) { } private Answer execute ( SecurityGroupRulesCmd cmd ) { } private Answer execute ( CleanupNetworkRulesCmd cmd ) { } protected boolean defaultNetworkRulesForUserVm ( String vmName , Long vmId , NicTO nic ) throws XmlRpcException { } protected boolean deleteAllNetworkRulesForVm ( String vmName ) throws XmlRpcException { } protected boolean addNetworkRules ( String vmName , String vmId , String guestIp , String signature , String seqno , String vifMacAddress , String rules , String vifDeviceName , String bridgeName ) throws XmlRpcException { } protected boolean cleanupNetworkRules ( ) throws XmlRpcException { } protected boolean canBridgeFirewall ( ) throws XmlRpcException { } protected Details getVifFromVm ( String vmName , Integer deviceId ) throws XmlRpcException { } protected List < OvmVif . Details > getInterfaces ( String vmName ) throws XmlRpcException { } protected Answer execute ( PrepareOCFS2NodesCommand cmd ) { } protected CreatePrivateTemplateAnswer execute ( final CreatePrivateTemplateFromVolumeCommand cmd ) { String secondaryStorageUrl = cmd . getSecondaryStorageUrl ( ) ; String volumePath = cmd . getVolumePath ( ) ; Long accountId = cmd . getAccountId ( ) ; Long templateId = cmd . getTemplateId ( ) ; int wait = cmd . getWait ( ) ; if ( wait == 0 ) { wait = 7200 ; } try { URI uri ; uri = new URI ( secondaryStorageUrl ) ; String secondaryStorageMountPath = ( ( uri . getHost ( ) ) + ":" ) + ( uri . getPath ( ) ) ; String installPath = ( ( "template//tmpl//" + accountId ) + "//" ) + templateId ; Map < String , String > res = OvmStoragePool . createTemplateFromVolume ( _conn , secondaryStorageMountPath , installPath , volumePath , wait ) ; <START_BUG> return new CreatePrivateTemplateAnswer ( cmd , true , null , res . get ( "installPath" ) , Long . valueOf ( res . get ( "virtualSize" ) ) , Long . valueOf ( res . get ( "physicalSize" ) ) , res . get ( "templateFileName" ) , ImageFormat . RAW ) ; <END_BUG> } catch ( Exception e ) { OvmResourceBase . s_logger . debug ( "Create<seq2seq4repair_space>template<seq2seq4repair_space>failed" , e ) ; return new CreatePrivateTemplateAnswer ( cmd , false , e . getMessage ( ) ) ; } } protected CopyVolumeAnswer execute ( CopyVolumeCommand cmd ) { } protected Answer execute ( DeleteStoragePoolCommand cmd ) { } protected CheckNetworkAnswer execute ( CheckNetworkCommand cmd ) { } private boolean isNetworkSetupByName ( String nameTag ) { } @ Override public Answer executeRequest ( Command cmd ) { } @ Override public void disconnected ( ) { } @ Override public IAgentControl getAgentControl ( ) { } @ Override public void setAgentControl ( IAgentControl agentControl ) { } @ Override public void setName ( String name ) { } @ Override public void setConfigParams ( Map < String , Object > params ) { } @ Override public Map < String , Object > getConfigParams ( ) { } @ Override public int getRunLevel ( ) { } @ Override public void setRunLevel ( int level ) { } }

Fix:
return new CreatePrivateTemplateAnswer ( cmd , true , null , res . get ( "installPath" ) , Long . valueOf ( res . get ( "virtualSize" ) ) , Long . parseLong ( res . get ( "physicalSize" ) ) , res . get ( "templateFileName" ) , ImageFormat . RAW ) ;