Skip to content

Commit a5caa10

Browse files
committed
Get rid of several warnings and errors in the agent sources
1 parent ed6c2d2 commit a5caa10

5 files changed

Lines changed: 66 additions & 56 deletions

File tree

‎agent/pom.xml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,38 @@
115115
</executions>
116116
</plugin>
117117
</plugins>
118+
<pluginManagement>
119+
<plugins>
120+
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
121+
<plugin>
122+
<groupId>org.eclipse.m2e</groupId>
123+
<artifactId>lifecycle-mapping</artifactId>
124+
<version>1.0.0</version>
125+
<configuration>
126+
<lifecycleMappingMetadata>
127+
<pluginExecutions>
128+
<pluginExecution>
129+
<pluginExecutionFilter>
130+
<groupId>
131+
org.apache.maven.plugins
132+
</groupId>
133+
<artifactId>
134+
maven-antrun-plugin
135+
</artifactId>
136+
<versionRange>[1.7,)</versionRange>
137+
<goals>
138+
<goal>run</goal>
139+
</goals>
140+
</pluginExecutionFilter>
141+
<action>
142+
<ignore></ignore>
143+
</action>
144+
</pluginExecution>
145+
</pluginExecutions>
146+
</lifecycleMappingMetadata>
147+
</configuration>
148+
</plugin>
149+
</plugins>
150+
</pluginManagement>
118151
</build>
119152
</project>

‎agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java‎

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -119,34 +119,33 @@ public boolean stop() {
119119
return true;
120120
}
121121

122-
@Override
123-
public void setName(String name) {
124-
// TODO Auto-generated method stub
125-
126-
}
127-
128-
@Override
129-
public void setConfigParams(Map<String, Object> params) {
130-
// TODO Auto-generated method stub
131-
132-
}
133-
134-
@Override
135-
public Map<String, Object> getConfigParams() {
136-
// TODO Auto-generated method stub
137-
return null;
138-
}
139-
140-
@Override
141-
public int getRunLevel() {
142-
// TODO Auto-generated method stub
143-
return 0;
144-
}
145-
146-
@Override
147-
public void setRunLevel(int level) {
148-
// TODO Auto-generated method stub
149-
150-
}
122+
@Override
123+
public void setName(String name) {
124+
// TODO Auto-generated method stub
125+
126+
}
127+
128+
@Override
129+
public void setConfigParams(Map<String, Object> params) {
130+
// TODO Auto-generated method stub
131+
132+
}
133+
134+
@Override
135+
public Map<String, Object> getConfigParams() {
136+
// TODO Auto-generated method stub
137+
return null;
138+
}
139+
140+
@Override
141+
public int getRunLevel() {
142+
// TODO Auto-generated method stub
143+
return 0;
144+
}
145+
146+
@Override
147+
public void setRunLevel(int level) {
148+
// TODO Auto-generated method stub
149+
}
151150

152151
}

‎agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919
import java.net.InetAddress;
2020
import java.net.UnknownHostException;
21-
22-
import java.util.HashMap;
23-
import java.util.Iterator;
2421
import java.util.List;
2522
import java.util.Map;
2623
import java.util.Queue;
@@ -32,8 +29,6 @@
3229

3330
import org.apache.log4j.Logger;
3431

35-
import com.cloud.agent.api.Answer;
36-
import com.cloud.agent.api.Command;
3732
import com.cloud.utils.Pair;
3833
import com.cloud.utils.net.NetUtils;
3934

‎agent/src/com/cloud/agent/mockvm/MockVm.java‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,4 @@ public int getVncPort() {
7171
return vncPort;
7272
}
7373

74-
public static void main(String[] args) {
75-
long i = 10;
76-
Long l = null;
77-
if (i == l) {
78-
System.out.print("fdfd");
79-
}
80-
}
8174
}

‎agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java‎

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@
3232

3333
import javax.naming.ConfigurationException;
3434

35-
import org.apache.cloudstack.managed.context.ManagedContextRunnable;
3635
import org.apache.log4j.Logger;
3736

37+
import com.google.gson.Gson;
38+
39+
import org.apache.cloudstack.managed.context.ManagedContextRunnable;
40+
3841
import com.cloud.agent.Agent.ExitStatus;
3942
import com.cloud.agent.api.AgentControlAnswer;
4043
import com.cloud.agent.api.Answer;
@@ -61,7 +64,6 @@
6164
import com.cloud.utils.NumbersUtil;
6265
import com.cloud.utils.net.NetUtils;
6366
import com.cloud.utils.script.Script;
64-
import com.google.gson.Gson;
6567

6668
/**
6769
*
@@ -130,19 +132,6 @@ private void disableRpFilter() {
130132
}
131133
}
132134

133-
private boolean copyCertToDirectory(String certificate, String filePath)
134-
throws IOException {
135-
boolean success;
136-
// copy cert to the dir
137-
FileWriter fstream = new FileWriter(filePath);
138-
BufferedWriter out = new BufferedWriter(fstream);
139-
out.write(certificate);
140-
// Close the output stream
141-
out.close();
142-
success = true;
143-
return success;
144-
}
145-
146135
protected Answer execute(final CheckConsoleProxyLoadCommand cmd) {
147136
return executeProxyLoadScan(cmd, cmd.getProxyVmId(),
148137
cmd.getProxyVmName(), cmd.getProxyManagementIp(),
@@ -204,6 +193,7 @@ protected String getDefaultScriptsDir() {
204193
return null;
205194
}
206195

196+
@Override
207197
public Type getType() {
208198
return Host.Type.ConsoleProxy;
209199
}

0 commit comments

Comments
 (0)