else { instance_of = fieldClass; }
	private void genOverrrideSetArgument(Type type, Alternative alt) {		JavaGenerationParameters params = getJavaGenerationParameters();		String altClassName = className(alt);		println("  public aterm.ATermAppl setArgument(aterm.ATerm arg, int i) {");		if (type.getAltArity(alt) > 0) {			println("    switch(i) {");			Iterator fields = type.altFieldIterator(alt.getId());			for (int i = 0; fields.hasNext(); i++) {				Field field = (Field) fields.next();				String fieldType = field.getType();				String fieldClass = TypeGenerator.qualifiedClassName(params, fieldType);				String instance_of;				if (fieldType.equals("str")) {					instance_of = "aterm.ATermAppl";				}				else if (fieldType.equals("int")) {					instance_of = "aterm.ATermInt";				}				else if (fieldType.equals("real")) {					instance_of = "aterm.ATermReal";				}				else if (fieldType.equals("term")) {					instance_of = "aterm.ATerm";				}                else if (fieldType.equals("chars")) {                    instance_of = "aterm.ATermList";                }				else {					instance_of = fieldClass;				}				println("      case " + i + ":");				println("        if (! (arg instanceof " + instance_of + ")) { ");				println(					"          throw new RuntimeException(\"Argument "						+ i						+ " of a "						+ altClassName						+ " should have type "						+ fieldType						+ "\");");				println("        }");				println("        break;");			}			println(				"      default: throw new RuntimeException(\""					+ altClassName					+ " does not have an argument at \" + i );");			println("    }");			println("    return super.setArgument(arg, i);");		}		else {			println("      throw new RuntimeException(\"" + altClassName + " has no arguments\");");		}		println("  }");	}