To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit 8ef3e637 authored by Andreas Sewe's avatar Andreas Sewe
Browse files

Removed (obviously) dead code.

parent 9a75b43a
......@@ -15,8 +15,6 @@ import java.util.Properties;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.dacapo.digest.*;
import org.dacapo.parser.Config;
/**
......@@ -220,9 +218,7 @@ public abstract class Benchmark {
}
protected void initialize() throws Exception {
savedSystemProperties = System.getProperties();
System.setProperty("java.util.logging.config.file", fileIn(scratch, config.name + ".log"));
System.setProperty("java.util.logging.config.file", fileInScratch(config.name + ".log"));
synchronized (System.out) {
if (out == null) {
out = new TeePrintStream(System.out, new File(scratch, "stdout.log"));
......@@ -543,39 +539,6 @@ public abstract class Benchmark {
* Utility methods
*/
/**
* Copy a file to the specified directory
*
* @param inputFile File to copy
* @param outputDir Destination directory
*/
public static void copyFileTo(File inputFile, File outputDir) throws IOException {
copyFile(inputFile, new File(outputDir, inputFile.getName()));
}
/**
* Copy a file, specifying input and output file names.
*
* @param inputFile Name of the input file.
* @param outputFile Name of the output file
* @throws IOException Any exception thrown by the java.io functions used to
* perform the copy.
*/
public static void copyFile(File inputFile, File outputFile) throws IOException {
FileInputStream input = new FileInputStream(inputFile);
FileOutputStream output = new FileOutputStream(outputFile);
while (true) {
byte[] buffer = new byte[BUFFER_SIZE];
int read = input.read(buffer);
if (read == -1)
break;
output.write(buffer, 0, read);
}
input.close();
output.flush();
output.close();
}
/**
* Translate a resource name into a URL.
*
......@@ -597,23 +560,7 @@ public abstract class Benchmark {
* @return The path name of the file
*/
public String fileInScratch(String name) {
return fileIn(scratch, name);
}
private static String fileIn(File scratch, String name) {
return (new File(scratch, name)).getPath();
}
/**
* Unpack a zip archive into the specified directory.
*
* @param name Name of the zip file
* @param destination Directory to unpack into.
* @throws IOException
*/
public static void unpackZipFile(String name, File destination) throws IOException, FileNotFoundException {
BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(name));
unpackZipStream(inputStream, destination);
return new File(scratch, name).getPath();
}
/**
......@@ -697,22 +644,6 @@ public abstract class Benchmark {
file.delete();
}
public static void deleteFiles(File dir, final String pattern) {
FilenameFilter filter = new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.matches(pattern);
}
};
File[] files = dir.listFiles(filter);
for (int i = 0; i < files.length; i++) {
deleteFile(files[i]);
}
}
public static int lineCount(String file) throws IOException {
return lineCount(new File(file));
}
public static int lineCount(File file) throws IOException {
int lines = 0;
BufferedReader in = new BufferedReader(new FileReader(file));
......@@ -722,10 +653,6 @@ public abstract class Benchmark {
return lines;
}
public static long byteCount(String file) throws IOException {
return byteCount(new File(file));
}
public static long byteCount(File file) throws IOException {
return file.length();
}
......
......@@ -14,8 +14,6 @@ import java.io.FileNotFoundException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.text.DecimalFormat;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
import java.util.jar.JarFile;
......@@ -32,8 +30,6 @@ import org.dacapo.parser.Config;
* @id $Id: TestHarness.java 738 2009-12-24 00:19:36Z steveb-oss $
*/
public class TestHarness {
public static final String PROP_BUILD_NICKNAME = "build.nickname";
public static final String PROP_BUILD_VERSION = "build.version";
public static final String BUILD_NICKNAME = "Specification-Version";
public static final String BUILD_VERSION = "Implementation-Version";
......@@ -45,8 +41,6 @@ public class TestHarness {
private final Config config;
private static CommandLineArgs commandLineArgs;
public static final DecimalFormat two_dp = twoDecimalPlaces();
public static String getBuildNickName() {
return BuildNickName;
}
......@@ -55,21 +49,6 @@ public class TestHarness {
return BuildVersion;
}
private static URL getURL(String fn) {
ClassLoader cl = TestHarness.class.getClassLoader();
if (commandLineArgs.getVerbose())
System.out.println("TestHarness.getURL: returns " + cl.getResource(fn));
return cl.getResource(fn);
}
public static boolean exists(File f) {
return exists(f.getPath());
}
public static boolean exists(String fn) {
return getURL(fn) != null;
}
/**
* Calculates coefficient of variation of a set of longs (standard deviation
* divided by mean).
......@@ -228,18 +207,6 @@ public class TestHarness {
}
}
/**
* @return A Decimal Format object
*/
private static DecimalFormat twoDecimalPlaces() {
DecimalFormat two_dp;
two_dp = new DecimalFormat();
two_dp.setMaximumFractionDigits(2);
two_dp.setMinimumFractionDigits(2);
two_dp.setGroupingUsed(true);
return two_dp;
}
private static void rmdir(File dir) {
String[] files = dir.list();
if (files != null) {
......@@ -253,12 +220,6 @@ public class TestHarness {
}
}
public static int TEST(int i) {
System.err.println("In TEST");
System.err.println(i);
return 2 * i;
}
private void bmInfo(String size) {
config.describe(System.err, size);
}
......
......@@ -9,8 +9,6 @@
* @id $Id: Harness.java 738 2009-12-24 00:19:36Z steveb-oss $
*/
import java.io.File;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URI;
......@@ -29,10 +27,7 @@ public class Harness {
//
private static final String CALLBACK_CLASSPATH_PROPERTY = "dacapo.callback.classpath";
public static void main(String[] args) throws MalformedURLException,
URISyntaxException, ClassNotFoundException, SecurityException,
NoSuchMethodException, IllegalArgumentException, IllegalAccessException,
InvocationTargetException {
public static void main(String[] args) throws Exception {
ClassLoader harnessClassLoader = makeHarnessClassLoader();
Thread.currentThread().setContextClassLoader(harnessClassLoader);
......
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