GitHub user GabrielBrascher opened a pull request:
https://github.com/apache/cloudstack/pull/1558
Remove unused code at "com.cloud.vm.UserVmManagerImpl"
# Summary
All changes in this PR started by removing unused methods from the
"UserVmManagerImpl". That results in changing two (2) of its implemented
interfaces ("UserVmManager" and "UserVmService").
Also, the "UserVmManagerImplTest" class had small changes.
One unused interface was removed ("BareMetalVmService").
# Detailed work
Changes at the interface "com.cloud.vm.UserVmManager":
- removed method "com.cloud.vm.UserVmManager.getVirtualMachines(long)"
that is not used at the class that implements this interface;
- removed method "com.cloud.vm.UserVmManager.stopVirtualMachine(long,
long)" as it is not used at the "UserVmManagerImpl" class;
Changes at the class "com.cloud.vm.UserVmManagerImpl":
- "com.cloud.vm.UserVmManagerImpl.UserVmCloneType" enum access level
from public to private;
- removed unused method
"com.cloud.vm.UserVmManagerImpl.getVirtualMachines(long)";
- removed unused method
"com.cloud.vm.UserVmManagerImpl.stopVirtualMachine(long, long)";
- removed unused method
"com.cloud.vm.UserVmManagerImpl.deletePrivateTemplateRecord(Long)";
- removed unused method
"com.cloud.vm.UserVmManagerImpl.getHypervisorTypeOfUserVM(long)";
- removed unused method
"com.cloud.vm.UserVmManagerImpl.createVirtualMachine(DeployVMCmd)";
- removed unused method
"com.cloud.vm.UserVmManagerImpl.isDisplayResourceEnabled(Long)";
- changed access level certain global variables to protected or private
(if possible);
- removed duplicated injected dependencies;
- removed null atributions to dependency injection objects (as by);
- removed unused variables.
Class "com.cloud.vm.UserVmManagerImpl.VmIpAddrFetchThread":
- changed variables access from public to private.
Class "com.cloud.vm.UserVmManagerTest":
- Used @InjectMocks to inject all
"com.cloud.vm.UserVmManagerTest._userVmMgr" dependencies, allowing the
cleaning of "manual injections" at the @Before block code
("com.cloud.vm.UserVmManagerTest.setup()").
It was removed the unused interface "com.cloud.vm.BareMetalVmService".
Interface "com.cloud.vm.UserVmService":
- removed the
"com.cloud.vm.UserVmService.deletePrivateTemplateRecord(Long)" method
that is unused at the class implementing this interface
("UserVmManagerImpl")
- removed the unused method
"com.cloud.vm.UserVmService.isDisplayResourceEnabled(Long)";
- removed the unused method
"com.cloud.vm.UserVmService.getHypervisorTypeOfUserVM(long)";
- removed the unused method
"com.cloud.vm.UserVmService.createVirtualMachine(DeployVMCmd)";
Changes at the class "com.cloud.vm.UserVmManagerImpl.VmAndCountDetails":
- removed unused method
"com.cloud.vm.UserVmManagerImpl.VmAndCountDetails.setRetrievalCount(int)";
- removed unused method
"com.cloud.vm.UserVmManagerImpl.VmAndCountDetails.setVmId(long)";
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/GabrielBrascher/cloudstack lrg-cs-hackday-026
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cloudstack/pull/1558.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1558
----
commit 40ba1d267e0c73f7526b9d2d3c0706bc8fce89e9
Author: gabrascher <[email protected]>
Date: 2016-05-22T14:48:03Z
Remove unused code (begining from) "com.cloud.vm.UserVmManagerImpl"
Changes at the interface "com.cloud.vm.UserVmManager":
- remove method "com.cloud.vm.UserVmManager.getVirtualMachines(long)"
that is not used at the class that implements this interface;
- remove method "com.cloud.vm.UserVmManager.stopVirtualMachine(long,
long)" as it is not used at the "UserVmManagerImpl" class;
Changes at the class "com.cloud.vm.UserVmManagerImpl":
- "com.cloud.vm.UserVmManagerImpl.UserVmCloneType" enum access level
from public to private;
- remove unused method
"com.cloud.vm.UserVmManagerImpl.getVirtualMachines(long)";
- remove unused method
"com.cloud.vm.UserVmManagerImpl.stopVirtualMachine(long, long)";
- remove unused method
"com.cloud.vm.UserVmManagerImpl.deletePrivateTemplateRecord(Long)";
- remove unused method
"com.cloud.vm.UserVmManagerImpl.getHypervisorTypeOfUserVM(long)";
- remove unused method
"com.cloud.vm.UserVmManagerImpl.createVirtualMachine(DeployVMCmd)";
- remove unused method
"com.cloud.vm.UserVmManagerImpl.isDisplayResourceEnabled(Long)";
- change access level certain global variables to protected or private
(if possible);
- remove duplicated injected dependencies;
- remove null atributions to dependency injection objects (as by);
- remove unused variables.
Changes at the class
"com.cloud.vm.UserVmManagerImpl.VmIpAddrFetchThread":
- change variables access from public to private.
Changes at the class "com.cloud.vm.UserVmManagerTest":
- Use @InjectMocks to inject all
"com.cloud.vm.UserVmManagerTest._userVmMgr" dependencies, allowing the
cleaning of "manual injections" at the @Before block code
("com.cloud.vm.UserVmManagerTest.setup()").
Remove unused Interface "com.cloud.vm.BareMetalVmService"
Changes at the interface "com.cloud.vm.UserVmService":
- remove the
"com.cloud.vm.UserVmService.deletePrivateTemplateRecord(Long)" method
that is unused at the class implementing this interface
("UserVmManagerImpl")
- remove the unused method
"com.cloud.vm.UserVmService.isDisplayResourceEnabled(Long)";
- remove the unused method
"com.cloud.vm.UserVmService.getHypervisorTypeOfUserVM(long)";
- remove the unused method
"com.cloud.vm.UserVmService.createVirtualMachine(DeployVMCmd)";
Changes at the class "com.cloud.vm.UserVmManagerImpl.VmAndCountDetails":
- remove unused method
"com.cloud.vm.UserVmManagerImpl.VmAndCountDetails.setRetrievalCount(int)";
- remove unused method
"com.cloud.vm.UserVmManagerImpl.VmAndCountDetails.setVmId(long)";
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---