
import java.io.File;

import java.io.FileOutputStream;
import java.lang.reflect.Method;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.SourceStringReader;

public class MyCode {

	public static void main(String[] args) throws Exception {
  
		Tracer.running=true;
		
		ClassLoader classLoader = ClassLoader.getSystemClassLoader();

        Class<?> loadedMyClass = classLoader.loadClass(args[0]);

        System.out.println("Loaded class name: " + loadedMyClass.getName());


		Method meth = loadedMyClass.getMethod("main", String[].class);
		String[] params = null;
		meth.invoke(null, (Object) params);


		String fileName = "Sequence.png";
		System.out.println("Output file located at " + fileName);
		SourceStringReader reader = new SourceStringReader("@startuml\nactor InitialActor"
				+ Tracer.getSequence()
				+"\n@enduml");
		Tracer.running=false;

		FileOutputStream output = new FileOutputStream(new File(fileName));
		reader.generateImage(output, new FileFormatOption(FileFormat.PNG));
	}

}





@@ -422,24 +422,20 @@
 lass%3C?%3E 
-loadedMy
+main
 Class = 
@@ -471,86 +471,8 @@
 );%0A%0A
-        System.out.println(%22Loaded class name: %22 + loadedMyClass.getName());%0A%0A
 %0A%09%09M
@@ -482,22 +482,24 @@
 od m
+ainM
 eth
+od
  = 
-loadedMy
+main
 Clas
@@ -564,19 +564,25 @@
 ull;%0A%09%09m
+ainM
 eth
+od
 .invoke(
@@ -641,10 +641,10 @@
 nce.
-pn
+sv
 g%22;%0A
@@ -778,15 +778,8 @@
 tor 
-Initial
 Acto
@@ -989,10 +989,10 @@
 mat.
-PN
+SV
 G));
@@ -998,12 +998,8 @@
 ;%0A%09%7D%0A%0A%7D%0A
-%0A%0A%0A%0A

Update MyCode.java