Commit 29c3edf5 authored by Nikolay's avatar Nikolay

Fixed FindBugs warnings

parent 8670471c
......@@ -146,7 +146,7 @@ public class NetDatacenterBroker extends SimEntity {
getCloudletList().addAll(list);
}
public void setLinkDC(NetworkDatacenter alinkDC) {
public static void setLinkDC(NetworkDatacenter alinkDC) {
linkDC = alinkDC;
}
......
......@@ -80,7 +80,7 @@ public class NetworkDatacenter extends Datacenter {
Switchlist = new HashMap<Integer, Switch>();
}
public Map<Integer, Integer> VmToSwitchid;
public Map<Integer, Integer> VmToSwitchid = new HashMap<Integer, Integer>();
public Map<Integer, Integer> HostToSwitchid;
......
......@@ -9,6 +9,7 @@
package org.cloudbus.cloudsim.network.datacenter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
......@@ -64,13 +65,13 @@ public class Switch extends SimEntity {
// something is running on these hosts
public SortedMap<Double, List<NetworkVm>> fintimelistVM = new TreeMap<Double, List<NetworkVm>>();
public ArrayList<NetworkPacket> pktlist;
public ArrayList<NetworkPacket> pktlist = new ArrayList<NetworkPacket>();
public List<Vm> BagofTaskVm = new ArrayList<Vm>();
public double switching_delay;
public Map<Integer, NetworkVm> Vmlist;
public Map<Integer, NetworkVm> Vmlist = new HashMap<Integer, NetworkVm>();
public Switch(String name, int level, NetworkDatacenter dc) {
super(name);
......
......@@ -311,7 +311,7 @@ public class MathUtil {
double[] estimates = tricubeBySquareRegression.regress()
.getParameterEstimates();
if (estimates[0] == Double.NaN || estimates[1] == Double.NaN) {
if (Double.isNaN(estimates[0]) || Double.isNaN(estimates[1])) {
return tricubeRegression.regress().getParameterEstimates();
}
return estimates;
......
......@@ -404,8 +404,9 @@ public class WorkloadFileReader implements WorkloadModel {
// read one line at the time
int line = 1;
while (reader.ready()) {
parseValue(reader.readLine(), line);
String readLine = null;
while (reader.ready() && (readLine = reader.readLine()) != null) {
parseValue(readLine, line);
line++;
}
......@@ -435,9 +436,10 @@ public class WorkloadFileReader implements WorkloadModel {
reader = new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(fl))));
// read one line at the time
int line = 1;
while (reader.ready()) {
parseValue(reader.readLine(), line);
int line = 1;
String readLine = null;
while (reader.ready() && (readLine = reader.readLine()) != null) {
parseValue(readLine, line);
line++;
}
......@@ -475,9 +477,10 @@ public class WorkloadFileReader implements WorkloadModel {
reader = new BufferedReader(new InputStreamReader(zipFile.getInputStream(zipEntry)));
// read one line at the time
int line = 1;
while (reader.ready()) {
parseValue(reader.readLine(), line);
int line = 1;
String readLine = null;
while (reader.ready() && (readLine = reader.readLine()) != null) {
parseValue(readLine, line);
line++;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment