Dawn of victory and helper generation
I succeded… meanwhile trying to find a restaurant for me and Francesca’s wedding I was able to generate an helper that manages all my methods parameters and their data type.
An example will explain better.
Suppose you want to make a dynamic code review with this code:
public class dawn_2 {
public static int metodoUno(String argString) {
System.out.println(argString);
return 3;
}
public void metodoDue(String a) {
int b = 32;
if (”foo”.equals(a))
b+=3;
return;
}
public int metodoTre(int a, String b, boolean c) {
return 2;
}
}
Earlier dawn versions will simply fail generating helper for metodoTre() method because only String parameters where allowed.
From yesterday evening it is possible to generate such methods helper:
import java.io.*;
public class HelpermetodoTre{
public static void main(String[] args) {
if (args.length != 3) {
System.out.println(”invalid number or args”);
System.exit(-1);
}int a0 = new Integer(args[0]).intValue();String a1 = new String(args[1]);boolean a2 = new Boolean(args[2]).booleanValue(); System.out.println(”HELPER_IN:”+ a0+ a1+ a2+”:HELPER_IN”);
System.out.println(”HELPER_OUT:”);
metodoTre(a0, a1, a2);
System.out.println(”:HELPER_OUT”);
}
public static int metodoTre(int a, String b, boolean c){
return 2;
}}
All references to parameters are dynamically generated.
Now I have to solve how to build a generic class making inference over parameters and than I can sleep…
