Skip to content

Commit

Permalink
Merge pull request apache#1453 from GabrielBrascher/brascher-removeUn…
Browse files Browse the repository at this point in the history
…usedClasses2

Remove classes with no referencesI used UCDetector (https://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 [apache#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 <[email protected]>
  • Loading branch information
swill committed May 12, 2016
2 parents 3f97908 + 4179606 commit 20cf8b2
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 925 deletions.
26 changes: 0 additions & 26 deletions api/src/com/cloud/agent/api/storage/CreateVolumeOVAAnswer.java

This file was deleted.

26 changes: 0 additions & 26 deletions api/src/com/cloud/agent/api/storage/PrepareOVAPackingAnswer.java

This file was deleted.

26 changes: 0 additions & 26 deletions api/src/com/cloud/exception/MissingParameterValueException.java

This file was deleted.

This file was deleted.

76 changes: 0 additions & 76 deletions api/src/org/apache/cloudstack/api/response/NicDetailResponse.java

This file was deleted.

34 changes: 0 additions & 34 deletions api/src/org/apache/cloudstack/api/response/StatusResponse.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
import java.util.Map;
import java.util.Set;

import com.google.gson.annotations.SerializedName;

import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponseWithTagInformation;
import org.apache.cloudstack.api.EntityReference;

import com.cloud.serializer.Param;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.template.VirtualMachineTemplate;
import com.google.gson.annotations.SerializedName;

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

// 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.
// @SerializedName("zones") @Param(description="list of zones associated with tempate", responseObject = TemplateZoneResponse.class)
// private Set<TemplateZoneResponse> zones;

@SerializedName(ApiConstants.SSHKEY_ENABLED)
@Param(description = "true if template is sshkey enabled, false otherwise")
private Boolean sshKeyEnabled;
Expand All @@ -184,7 +178,6 @@ public class TemplateResponse extends BaseResponseWithTagInformation implements
private Boolean isDynamicallyScalable;

public TemplateResponse() {
// zones = new LinkedHashSet<TemplateZoneResponse>();
tags = new LinkedHashSet<ResourceTagResponse>();
}

Expand Down
Loading

0 comments on commit 20cf8b2

Please sign in to comment.