From 1937fb154d2ebcc6fb46dae7ea40ca87bc127b92 Mon Sep 17 00:00:00 2001
From: Jan Vales <jan@jvales.net>
Date: Thu, 13 Jun 2013 16:44:32 +0200
Subject: [PATCH] CSVParser now does not set the Applications' ids (moved to
 inseide of Application-class)

---
 src/at/ac/tuwien/lsdc/util/CSVParser.java | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/at/ac/tuwien/lsdc/util/CSVParser.java b/src/at/ac/tuwien/lsdc/util/CSVParser.java
index 388fdd8..5488742 100644
--- a/src/at/ac/tuwien/lsdc/util/CSVParser.java
+++ b/src/at/ac/tuwien/lsdc/util/CSVParser.java
@@ -11,9 +11,6 @@ import au.com.bytecode.opencsv.CSVReader;
 import au.com.bytecode.opencsv.CSVWriter;
 
 public class CSVParser {
-
-	private static int count = 0;
-
 	public static LinkedList<Application> parseFile(File csvFile)
 			throws IOException {
 		CSVReader reader = new CSVReader(new FileReader(csvFile), ';',
@@ -25,7 +22,9 @@ public class CSVParser {
 			String[] line = file.get(i);
 			if (line.length != 5) {
 				reader.close();
-				throw new IOException("CSVParser: Not right amount of elements in line " + i + 1);
+				throw new IOException(
+						"CSVParser: Not right amount of elements in line " + i
+								+ 1);
 			} else {
 				try {
 					Application a = parseLine(line);
@@ -42,15 +41,12 @@ public class CSVParser {
 
 	private static Application parseLine(String[] appStr)
 			throws NumberFormatException {
-		int id = count;
-		count++;
 		long timestamp = Long.parseLong(appStr[0]);
 		int size = Integer.parseInt(appStr[1]);
 		int ram = Integer.parseInt(appStr[2]);
 		int cpu = Integer.parseInt(appStr[3]);
 		int duration = Integer.parseInt(appStr[4]);
-		Application app = new Application(id, timestamp, size, ram, cpu,
-				duration);
+		Application app = new Application(timestamp, size, ram, cpu, duration);
 		return app;
 	}
 
-- 
2.43.0