Skip to content

Commit

Permalink
undoing last change
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Bodden authored and Eric Bodden committed Aug 3, 2010
1 parent 8b0bc12 commit e582fa9
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions PlayInAgent/src/de/bodden/tamiflex/playin/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@
******************************************************************************/
package de.bodden.tamiflex.playin;

import java.io.File;
import java.io.IOException;
import java.lang.instrument.IllegalClassFormatException;
import java.lang.instrument.Instrumentation;
import java.lang.instrument.UnmodifiableClassException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.jar.JarFile;

import de.bodden.tamiflex.normalizer.Hasher;

Expand All @@ -41,13 +37,9 @@ public static void premain(String agentArgs, Instrumentation inst) throws IOExce
Hasher.dontNormalize();
}
if(agentArgs.equals("")) usage();

appendRtJarToBootClassPath(inst);

final ClassReplacer replacer = new ClassReplacer(agentArgs,verbose);
inst.addTransformer(replacer,true);


Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
Expand All @@ -69,18 +61,6 @@ public void run() {
}
}
}

private static void appendRtJarToBootClassPath(Instrumentation inst) throws URISyntaxException, IOException {
URL locationOfAgent = Agent.class.getResource("/de/bodden/tamiflex/normalizer/Hasher.class");
if(locationOfAgent==null) {
System.err.println("Support library for reflection log not found on classpath.");
System.exit(1);
}
String agentJarFilePath = locationOfAgent.getPath().substring(0, locationOfAgent.getPath().indexOf("!"));
URI uri = new URI(agentJarFilePath);
JarFile jarFile = new JarFile(new File(uri));
inst.appendToBootstrapClassLoaderSearch(jarFile);
}

private static void usage() {
System.out.println("TamiFlex version "+Agent.class.getPackage().getImplementationVersion()+", Play-in Agent \n");
Expand Down

0 comments on commit e582fa9

Please sign in to comment.