Skip to content

Commit 9892e79

Browse files
committed
Removed unused imports
1 parent b40cef8 commit 9892e79

File tree

3 files changed

+41
-46
lines changed

3 files changed

+41
-46
lines changed

framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/DiagnosticsConfigDepotImpl.java

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,16 @@
1616
// under the License.
1717
package org.apache.cloudstack.framework.config.impl;
1818

19-
import org.apache.cloudstack.framework.config.*;
20-
19+
import org.apache.cloudstack.framework.config.ConfigDepot;
20+
import org.apache.cloudstack.framework.config.ConfigDepotAdmin;
21+
import org.apache.cloudstack.framework.config.ConfigKey;
22+
import org.apache.cloudstack.framework.config.Configurable;
2123
import org.apache.commons.lang.ObjectUtils;
2224
import org.apache.log4j.Logger;
2325

24-
2526
import javax.annotation.PostConstruct;
2627
import javax.inject.Inject;
27-
import java.util.HashMap;
28-
import java.util.Map;
29-
import java.util.List;
30-
import java.util.Set;
31-
import java.util.Collections;
32-
import java.util.HashSet;
33-
import java.util.ArrayList;
28+
import java.util.*;
3429

3530
public class DiagnosticsConfigDepotImpl implements ConfigDepot, ConfigDepotAdmin {
3631

@@ -86,7 +81,7 @@ protected void populateConfiguration(DiagnosticsKey<?> clazz) {
8681
}
8782
if (!diagnosticsTypeExists) {
8883
//Pair<String, DiagnosticsKey<?>> newDiagnosticsType = new Pair<String, DiagnosticsKey<?>>(clazz.key(), clazz);
89-
DiagnosticsKey<String> newDiagnosticsType = new DiagnosticsKey<String>(String.class, clazz.key(), "new diagnostics type", clazz.get_detail(), clazz.get_role());//?>>(clazz.key(), clazz);
84+
DiagnosticsKey<String> newDiagnosticsType = new DiagnosticsKey<String>(String.class, clazz.key(), "new diagnostics type", clazz.getDetail(), clazz.getRole());//?>>(clazz.key(), clazz);
9085
_allKeys.put(clazz.key(), newDiagnosticsType);
9186
createOrupdateDiagnosticsObject(clazz.key(), newDiagnosticsType );
9287
}
@@ -102,15 +97,15 @@ private void createOrupdateDiagnosticsObject(String componentName, DiagnosticsK
10297
if (vo == null) {
10398
vo = new RetrieveDiagnosticsVO(componentName, diagnosticsType);
10499
vo.setDiagnosticsType(diagnosticsType.key());
105-
vo.setRole(diagnosticsType.get_role());//to be given SystemVM type
106-
vo.setValue(diagnosticsType.get_detail());//to be populated
100+
vo.setRole(diagnosticsType.getRole());//to be given SystemVM type
101+
vo.setValue(diagnosticsType.getDetail());//to be populated
107102
_diagnosticsDao.persist(vo);
108103
} else {
109-
if (vo.getValue() != diagnosticsType.key() || !ObjectUtils.equals(vo.getRole(), diagnosticsType.get_role()) || !ObjectUtils.equals(vo.getDefaultValue(),
110-
diagnosticsType.get_detail())) {
104+
if (vo.getValue() != diagnosticsType.key() || !ObjectUtils.equals(vo.getRole(), diagnosticsType.getRole()) || !ObjectUtils.equals(vo.getDefaultValue(),
105+
diagnosticsType.getDetail())) {
111106
vo.setRole(diagnosticsType.value()); //to be changed
112107
vo.setDiagnosticsType(diagnosticsType.key());
113-
vo.setValue(diagnosticsType.get_detail()); //to be changed
108+
vo.setValue(diagnosticsType.getDetail()); //to be changed
114109
_diagnosticsDao.persist(vo);
115110
}
116111
}

framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/DiagnosticsKey.java

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public static enum DiagnosticsEntryType {
2525
IPTABLES, LOGFILES, PROPERTYFILES, DHCPFILES, USERDATA, LB, DNS, VPN, IPTABLESretrieve, IPTABLESremove
2626
}
2727

28-
private String _name;
29-
private final Class<T> _type;
30-
private String _description;
31-
private String _detail;
28+
private String name;
29+
private final Class<T> type;
30+
private String description;
31+
private String detail;
3232

3333
public String getClassName() {
3434
return className;
@@ -40,44 +40,44 @@ public void setClassName(String className) {
4040

4141
private String className;
4242

43-
public String get_detail() {
44-
return _detail;
43+
public String getDetail() {
44+
return detail;
4545
}
4646

47-
public void set_detail(String detail) {
48-
this._detail = _detail;
47+
public void setDetail(String detail) {
48+
this.detail = detail;
4949
}
5050

51-
public String get_role() {
52-
return _role;
51+
public String getRole() {
52+
return role;
5353
}
5454

55-
public void set_role(String role) {
56-
this._role = _role;
55+
public void setRole(String role) {
56+
this.role = role;
5757
}
5858

59-
private String _role;
60-
T _value = null;
59+
private String role;
60+
T value = null;
6161

6262
public Class<T> type() {
63-
return _type;
63+
return type;
6464
}
6565

6666
public final String key() {
67-
return _name;
67+
return name;
6868
}
6969

7070

7171
public String description() {
72-
return _description;
72+
return description;
7373
}
7474

7575

7676

7777
@Override
7878
public String toString()
7979
{
80-
return _name;
80+
return name;
8181
}
8282

8383
static DiagnosticsConfigDepotImpl s_depot = null;
@@ -91,24 +91,24 @@ static public void init(DiagnosticsConfigDepotImpl depot) {
9191
}*/
9292

9393
public DiagnosticsKey(Class<T> type, String name, String description, String detail, String role) {
94-
_type = type;
95-
_name = name;
96-
_description = description;
97-
_detail = detail;
98-
_role = role;
94+
this.type = type;
95+
this.name = name;
96+
this.description = description;
97+
this.detail = detail;
98+
this.role = role;
9999
}
100100

101101
@Override
102102
public int hashCode()
103103
{
104-
return _name.hashCode();
104+
return name.hashCode();
105105
}
106106

107107
@Override
108108
public boolean equals(Object obj) {
109109
if (obj instanceof DiagnosticsKey) {
110110
DiagnosticsKey that = (DiagnosticsKey)obj;
111-
return this._name.equals(that._name);
111+
return this.name.equals(that.name);
112112
}
113113
return false;
114114
}
@@ -118,20 +118,20 @@ public boolean isSameKeyAs(Object obj) {
118118
return true;
119119
} else if (obj instanceof String) {
120120
String key = (String)obj;
121-
return key.equals(_name);
121+
return key.equals(name);
122122
}
123123

124124
throw new CloudRuntimeException("Comparing Diagnostics key to " + obj.toString());
125125
}
126126

127127
public String value() {
128-
if (_name == null) {
128+
if (name == null) {
129129
RetrieveDiagnosticsVO vo = s_depot != null ? s_depot.global().findById(key()) : null;
130130
final String value = (vo != null && vo.getValue() != null) ? vo.getValue() : null;
131-
_name = (String)((value == null) ? null : valueOf(value));
131+
name = (String)((value == null) ? null : valueOf(value));
132132
}
133133

134-
return _name;
134+
return name;
135135
}
136136

137137
public String valueIn(Long id) {

framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/RetrieveDiagnosticsVO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public RetrieveDiagnosticsVO(String role, String className, String value) {
5252
}
5353

5454
public RetrieveDiagnosticsVO(String component, DiagnosticsKey<?> key) {
55-
this(key.key(), key.getClassName(), key.get_detail());
55+
this(key.key(), key.getClassName(), key.getDetail());
5656
}
5757

5858
/* public RetrieveDiagnosticsVO(String roleId, String role, String className, String value) {

0 commit comments

Comments
 (0)