Skip to content

Commit 20cf8b2

Browse files
committed
Merge pull request #1453 from GabrielBrascher/brascher-removeUnusedClasses2
Remove classes with no referencesI used UCDetector (http://www.ucdetector.org/) as a plugin for Eclipse. With this tool, I discovered a lot of code without any reference (variables, methods and classes). Following the work that was done at [#1448]; this pull request had the goal of removing some of these classes. To check if I wasn't missing anything I searched for any file that could reference some of those classes. As I haven't found any way of these classes being used, they were removed. Note that some of them I found other references, but references such as commented lines or tests, nothing that could indicate their use (as XML files configuring beans or another class instantiating an object with "new"). Waiting for tests. Please tell me if I am missing something. Removed Classes: - org.apache.cloudstack.framework.jobs.JobCancellationException (**Note:** removed variable JobCancellationException in com.cloud.utils.SerialVersionUID) - org.apache.cloudstack.ldap.NoSuchLdapUserException (**Note:** removed test file /cloud-plugin-user-authenticator-ldap/test/groovy/org/apache/cloudstack/ldap/NoSuchLdapUserExceptionSpec.groovy) - com.cloud.agent.api.storage.CreateVolumeOVAAnswer - com.cloud.exception.MissingParameterValueException - org.apache.cloudstack.api.response.StatusResponse - org.apache.cloudstack.api.response.VolumeDetailResponse - org.apache.cloudstack.api.response.UpgradeVmResponse - org.apache.cloudstack.api.response.AddIpToVmNicResponse - org.apache.cloudstack.api.response.TemplateZoneResponse (**Note:** at org.apache.cloudstack.api.response.TemplateResponse, there is this comment "To avoid breaking backwards compatibility, we still treat a template at different zones as different templates, so not embedding template_zone information in this TemplateZoneResponse set. `private Set<TemplateZoneResponse> zones;`" but right now it is not used) - org.apache.cloudstack.api.response.NicDetailResponse * pr/1453: Removed classes with no reference Signed-off-by: Will Stevens <williamstevens@gmail.com>
2 parents 3f97908 + 4179606 commit 20cf8b2

14 files changed

Lines changed: 1 addition & 925 deletions

File tree

api/src/com/cloud/agent/api/storage/CreateVolumeOVAAnswer.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

api/src/com/cloud/agent/api/storage/PrepareOVAPackingAnswer.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

api/src/com/cloud/exception/MissingParameterValueException.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

api/src/org/apache/cloudstack/api/response/AddIpToVmNicResponse.java

Lines changed: 0 additions & 88 deletions
This file was deleted.

api/src/org/apache/cloudstack/api/response/NicDetailResponse.java

Lines changed: 0 additions & 76 deletions
This file was deleted.

api/src/org/apache/cloudstack/api/response/StatusResponse.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

api/src/org/apache/cloudstack/api/response/TemplateResponse.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@
2121
import java.util.Map;
2222
import java.util.Set;
2323

24-
import com.google.gson.annotations.SerializedName;
25-
2624
import org.apache.cloudstack.api.ApiConstants;
2725
import org.apache.cloudstack.api.BaseResponseWithTagInformation;
2826
import org.apache.cloudstack.api.EntityReference;
2927

3028
import com.cloud.serializer.Param;
3129
import com.cloud.storage.Storage.ImageFormat;
3230
import com.cloud.template.VirtualMachineTemplate;
31+
import com.google.gson.annotations.SerializedName;
3332

3433
@EntityReference(value = VirtualMachineTemplate.class)
3534
@SuppressWarnings("unused")
@@ -170,11 +169,6 @@ public class TemplateResponse extends BaseResponseWithTagInformation implements
170169
@Param(description = "additional key/value details tied with template")
171170
private Map details;
172171

173-
// To avoid breaking backwards compatibility, we still treat a template at different zones as different templates, so not embedding
174-
// template_zone information in this TemplateZoneResponse set.
175-
// @SerializedName("zones") @Param(description="list of zones associated with tempate", responseObject = TemplateZoneResponse.class)
176-
// private Set<TemplateZoneResponse> zones;
177-
178172
@SerializedName(ApiConstants.SSHKEY_ENABLED)
179173
@Param(description = "true if template is sshkey enabled, false otherwise")
180174
private Boolean sshKeyEnabled;
@@ -184,7 +178,6 @@ public class TemplateResponse extends BaseResponseWithTagInformation implements
184178
private Boolean isDynamicallyScalable;
185179

186180
public TemplateResponse() {
187-
// zones = new LinkedHashSet<TemplateZoneResponse>();
188181
tags = new LinkedHashSet<ResourceTagResponse>();
189182
}
190183

0 commit comments

Comments
 (0)