Commit 742cb4e7 authored by Lukáš Marek's avatar Lukáš Marek

more Java 6 fixes

parent 3c8eb717
......@@ -7,103 +7,124 @@ import ch.usi.dag.disl.processorcontext.ArgumentProcessorMode;
import ch.usi.dag.disl.staticcontext.MethodStaticContext;
public class DiSLClass {
@AfterReturning(marker = BodyMarker.class, scope = "TargetClass.*")
public static void postcondition(MethodStaticContext sc, ArgumentProcessorContext pc) {
public static void postcondition(final MethodStaticContext sc, final ArgumentProcessorContext pc) {
System.out.printf("disl: args for %s %s\n", sc.thisMethodFullName(), sc.thisMethodDescriptor());
Object[] args = pc.getArgs(ArgumentProcessorMode.METHOD_ARGS);
for(int i = 0 ; i < args.length; ++i) {
final Object[] args = pc.getArgs(ArgumentProcessorMode.METHOD_ARGS);
LEVEL1: for(int i = 0 ; i < args.length; ++i) {
System.out.printf("disl: \targ[%d]\n", i);
if (args[i] instanceof Object[]) {
Object[] argsarr = (Object[])args[i];
for (Object arg : argsarr) {
final Object[] argsarr = (Object[])args[i];
LEVEL2: for (final Object arg : argsarr) {
if (arg instanceof Object[]) {
Object[] argsarr2 = (Object[])arg;
for (Object arg2 : argsarr2) {
Object a = (Object)arg2;
String n = a.getClass().getCanonicalName();
switch (n) {
case "java.lang.Integer":
final Object[] argsarr2 = (Object[])arg;
LEVEL3: for (final Object arg2 : argsarr2) {
final Object a = arg2;
final String n = a.getClass().getCanonicalName();
// code duplication as this is DiSL class
// and we would have to move it out
if(n.equals ("java.lang.Integer")) {
System.out.printf("disl: \t\t\t\t%s\n", n);
System.out.printf("disl: \t\t\t\t%s\n", a.toString());
break;
case "java.lang.Float":
continue LEVEL3;
}
if(n.equals ("java.lang.Float")) {
System.out.printf("disl: \t\t\t\t%s\n", n);
System.out.printf("disl: \t\t\t\t%s\n", a.toString());
break;
case "java.lang.Double":
continue LEVEL3;
}
if(n.equals ("java.lang.Double")) {
System.out.printf("disl: \t\t\t\t%s\n", n);
System.out.printf("disl: \t\t\t\t%s\n", a.toString());
break;
case "java.lang.String":
continue LEVEL3;
}
if(n.equals ("java.lang.String")) {
System.out.printf("disl: \t\t\t\t%s\n", n);
System.out.printf("disl: \t\t\t\t%s\n", a.toString());
break;
default:
System.out.printf("disl: \t\t\t\t%s\n", n);
System.out.printf("disl: \t\t\t\t== cannot print ==\n");
break;
}
continue LEVEL3;
}
// default
System.out.printf("disl: \t\t\t\t%s\n", n);
System.out.printf("disl: \t\t\t\t== cannot print ==\n");
}
} else {
Object a = (Object)arg;
String n = a.getClass().getCanonicalName();
switch (n) {
case "java.lang.Integer":
System.out.printf("disl: \t\t\t%s\n", n);
System.out.printf("disl: \t\t\t%s\n", a.toString());
break;
case "java.lang.Float":
System.out.printf("disl: \t\t\t%s\n", n);
System.out.printf("disl: \t\t\t%s\n", a.toString());
break;
case "java.lang.Double":
System.out.printf("disl: \t\t\t%s\n", n);
System.out.printf("disl: \t\t\t%s\n", a.toString());
break;
case "java.lang.String":
System.out.printf("disl: \t\t\t%s\n", n);
System.out.printf("disl: \t\t\t%s\n", a.toString());
break;
default:
System.out.printf("disl: \t\t\t%s\n", n);
System.out.printf("disl: \t\t\t== cannot print ==\n");
break;
}
}
}
final Object a = arg;
final String n = a.getClass().getCanonicalName();
if(n.equals ("java.lang.Integer")) {
System.out.printf("disl: \t\t\t%s\n", n);
System.out.printf("disl: \t\t\t%s\n", a.toString());
continue LEVEL2;
}
if(n.equals ("java.lang.Float")) {
System.out.printf("disl: \t\t\t%s\n", n);
System.out.printf("disl: \t\t\t%s\n", a.toString());
continue LEVEL2;
}
if(n.equals ("java.lang.Double")) {
System.out.printf("disl: \t\t\t%s\n", n);
System.out.printf("disl: \t\t\t%s\n", a.toString());
continue LEVEL2;
}
if(n.equals ("java.lang.String")) {
System.out.printf("disl: \t\t\t%s\n", n);
System.out.printf("disl: \t\t\t%s\n", a.toString());
continue LEVEL2;
}
// default
System.out.printf("disl: \t\t\t%s\n", n);
System.out.printf("disl: \t\t\t== cannot print ==\n");
}
}
} else {
Object a = args[i];
String n = a.getClass().getCanonicalName();
switch (n) {
case "java.lang.Integer":
System.out.printf("disl: \t\t%s\n", n);
System.out.printf("disl: \t\t%s\n", a.toString());
break;
case "java.lang.Float":
System.out.printf("disl: \t\t%s\n", n);
System.out.printf("disl: \t\t%s\n", a.toString());
break;
case "java.lang.Double":
System.out.printf("disl: \t\t%s\n", n);
System.out.printf("disl: \t\t%s\n", a.toString());
break;
case "java.lang.String":
System.out.printf("disl: \t\t%s\n", n);
System.out.printf("disl: \t\t%s\n", a.toString());
break;
default:
System.out.printf("disl: \t\t%s\n", n);
System.out.printf("disl: \t\t== cannot print ==\n");
break;
}
final Object a = args[i];
final String n = a.getClass().getCanonicalName();
if(n.equals ("java.lang.Integer")) {
System.out.printf("disl: \t\t%s\n", n);
System.out.printf("disl: \t\t%s\n", a.toString());
continue LEVEL1;
}
if(n.equals ("java.lang.Float")) {
System.out.printf("disl: \t\t%s\n", n);
System.out.printf("disl: \t\t%s\n", a.toString());
continue LEVEL1;
}
if(n.equals ("java.lang.Double")) {
System.out.printf("disl: \t\t%s\n", n);
System.out.printf("disl: \t\t%s\n", a.toString());
continue LEVEL1;
}
if(n.equals ("java.lang.String")) {
System.out.printf("disl: \t\t%s\n", n);
System.out.printf("disl: \t\t%s\n", a.toString());
continue LEVEL1;
}
// default
System.out.printf("disl: \t\t%s\n", n);
System.out.printf("disl: \t\t== cannot print ==\n");
}
}
}
......
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