Input:
    public Config buildArchive(OS os, Arch arch, TargetType targetType) throws MojoExecutionException, MojoFailureException {
        getLog().info("Building RoboVM app for: " + os + " (" + arch + ")");
        Config.Builder builder = new Config.Builder();
        File robovmSrcDir = new File(project.getBasedir(), "src/main/robovm");
        if (propertiesFile != null) {
            if (!propertiesFile.exists()) {
                throw new MojoExecutionException("Invalid 'propertiesFile' specified for RoboVM compile: " + propertiesFile);
            }
            try {
                getLog().debug("Including properties file in RoboVM compiler config: " + propertiesFile.getAbsolutePath());
                builder.addProperties(propertiesFile);
            } catch (IOException e) {
                throw new MojoExecutionException("Failed to add properties file to RoboVM config: " + propertiesFile);
            }
        } else {
            File file = new File(robovmSrcDir, "Info.plist");
            if (file.exists()) {
                getLog().debug("Using default properties file: " + file.getAbsolutePath());
                builder.iosInfoPList(file);
            }
        }
        if (configFile != null) {
            if (!configFile.exists()) {
                throw new MojoExecutionException("Invalid 'configFile' specified for RoboVM compile: " + configFile);
            }
            try {
                getLog().debug("Loading config file for RoboVM compiler: " + configFile.getAbsolutePath());
                builder.read(configFile);
            } catch (Exception e) {
                throw new MojoExecutionException("Failed to read RoboVM config file: " + configFile);
            }
        } else {
            File file = new File(robovmSrcDir, "config.xml");
            if (file.exists()) {
                getLog().debug("Using default config file: " + file.getAbsolutePath());
                builder.iosInfoPList(file);
            }
        }
        File osDir = new File(installDir, os.name());
        File archiveDir = new File(new File(osDir, arch.name()), "");
        builder.home(new Config.Home(unpackRoboVMDist()))
                .logger(getRoboVMLogger())
                .mainClass(mainClass)
                .executableName(executableName)
                .tmpDir(archiveDir)
                .targetType(targetType)
                .skipInstall(true)
                .os(os)
                .arch(arch);
        if (forceLinkClasses != null) {
            for (String pattern : forceLinkClasses) {
                getLog().debug("Including class pattern for linking: " + pattern);
                builder.addForceLinkClass(pattern);
            }
        }
        if (frameworks != null) {
            for (String framework : frameworks) {
                getLog().debug("Including framework: " + framework);
                builder.addFramework(framework);
            }
        }
        if (libs != null) {
            for (String lib : libs) {
                getLog().debug("Including lib: " + lib);
                builder.addLib(lib);
            }
        }
        if (iosSdkVersion != null) {
            getLog().debug("Using explicit iOS SDK version: " + iosSdkVersion);
            builder.iosSdkVersion(iosSdkVersion);
        }
        if (iosSignIdentity != null) {
            getLog().debug("Using explicit iOS Signing identity: " + iosSignIdentity);
            builder.iosSignIdentity(iosSignIdentity);
        }
        if (iosInfoPList != null) {
            if (!iosInfoPList.exists()) {
                throw new MojoExecutionException("Invalid 'iosInfoPList' specified for RoboVM compile: " + iosInfoPList);
            }
            getLog().debug("Using Info.plist input file: " + iosInfoPList.getAbsolutePath());
            builder.iosInfoPList(iosInfoPList);
        } else {
            File file = new File(robovmSrcDir, "Info.plist");
            if (file.exists()) {
                getLog().debug("Using default Info.plist input file: " + file.getAbsolutePath());
                builder.iosInfoPList(file);
            }
        }
        if (iosEntitlementsPList != null) {
            if (!iosEntitlementsPList.exists()) {
                throw new MojoExecutionException("Invalid 'iosEntitlementsPList' specified for RoboVM compile: " + iosEntitlementsPList);
            }
            getLog().debug("Using Entitlements.plist input file: " + iosEntitlementsPList.getAbsolutePath());
            builder.iosEntitlementsPList(iosEntitlementsPList);
        } else {
            File file = new File(robovmSrcDir, "Entitlements.plist");
            if (file.exists()) {
                getLog().debug("Using default Entitlements.plist input file: " + file.getAbsolutePath());
                builder.iosEntitlementsPList(file);
            }
        }
        if (iosResourceRulesPList != null) {
            if (!iosResourceRulesPList.exists()) {
                throw new MojoExecutionException("Invalid 'iosResourceRulesPList' specified for RoboVM compile: " + iosResourceRulesPList);
            }
            getLog().debug("Using ResourceRules.plist input file: " + iosResourceRulesPList.getAbsolutePath());
            builder.iosResourceRulesPList(iosResourceRulesPList);
        } else {
            File file = new File(robovmSrcDir, "ResourceRules.plist");
            if (file.exists()) {
                getLog().debug("Using default ResourceRules.plist input file: " + file.getAbsolutePath());
                builder.iosResourceRulesPList(file);
            }
        }
        if (resources != null) {
            for (File resource : resources) {
                if (!resource.exists()) {
                    throw new MojoExecutionException("Invalid 'resource' directory specified for RoboVM compile: " + resource);
                }
                getLog().debug("Including resource directory: " + resource.getAbsolutePath());
                builder.addResource(resource);
            }
        } else {
            File resource = new File(robovmSrcDir, "resources");
            if (resource.exists()) {
                getLog().debug("Using default resource directory: " + resource.getAbsolutePath());
                builder.addResource(resource);
            }
        }
        builder.clearClasspathEntries();
        if (includeJFX) {
            getLog().info("Including JavaFX Runtime in build");
            File jfxJar = resolveJavaFXRuntimeArtifact();
            getLog().debug("JavaFX runtime JAR found at: " + jfxJar);
            builder.addClasspathEntry(jfxJar);
            File iosNativesBaseDir = unpackJavaFXNativeIOSArtifact();
            builder.addLib(new File(iosNativesBaseDir, "libdecora-sse-armv7.a").getAbsolutePath());
            builder.addLib(new File(iosNativesBaseDir, "libglass-armv7.a").getAbsolutePath());
            builder.addLib(new File(iosNativesBaseDir, "libjavafx-font-armv7.a").getAbsolutePath());
            builder.addLib(new File(iosNativesBaseDir, "libjavafx-iio-armv7.a").getAbsolutePath());
            builder.addLib(new File(iosNativesBaseDir, "libprism-common-armv7.a").getAbsolutePath());
            builder.addLib(new File(iosNativesBaseDir, "libprism-es2-armv7.a").getAbsolutePath());
            builder.addLib(new File(iosNativesBaseDir, "libprism-sw-armv7.a").getAbsolutePath());
            builder.addForceLinkClass("com.sun.javafx.tk.quantum.QuantumToolkit");
            builder.addForceLinkClass("com.sun.prism.es2.ES2Pipeline");
            builder.addForceLinkClass("com.sun.prism.es2.IOSGLFactory");
            builder.addForceLinkClass("com.sun.glass.ui.ios.**.*");
            builder.addForceLinkClass("javafx.scene.CssStyleHelper");
            builder.addForceLinkClass("com.sun.prism.shader.**.*");
            builder.addForceLinkClass("com.sun.scenario.effect.impl.es2.ES2ShaderSource");
            builder.addForceLinkClass("sun.util.logging.PlatformLogger");
            builder.addFramework("UIKit");
            builder.addFramework("OpenGLES");
            builder.addFramework("QuartzCore");
            builder.addFramework("CoreGraphics");
            builder.addFramework("CoreText");
            builder.addFramework("ImageIO");
            builder.addFramework("MobileCoreServices");
        }
        try {
            for (Object object : project.getRuntimeClasspathElements()) {
                String path = (String) object;
                if (getLog().isDebugEnabled()) {
                    getLog().debug("Including classpath element for RoboVM app: " + path);
                }
                builder.addClasspathEntry(new File(path));
            }
        } catch (DependencyResolutionRequiredException e) {
            throw new MojoExecutionException("Error resolving application classpath for RoboVM build", e);
        }
        try {
            Config config = builder.build();
            AppCompiler compiler = new AppCompiler(config);
            compiler.compile();
            return config;
        } catch (IOException e) {
            throw new MojoExecutionException("Error building RoboVM executable for app", e);
        }
    }

Output:
    public Config buildArchive(OS os, Arch arch, TargetType targetType) throws MojoExecutionException, MojoFailureException {
        getLog().info("Building RoboVM app for: " + os + " (" + arch + ")");
        Config.Builder builder = new Config.Builder();
        File robovmSrcDir = new File(project.getBasedir(), "src/main/robovm");
        if (propertiesFile != null) {
            if (!propertiesFile.exists()) {
                throw new MojoExecutionException("Invalid 'propertiesFile' specified for RoboVM compile: " + propertiesFile);
            }
            try {
                getLog().debug("Including properties file in RoboVM compiler config: " + propertiesFile.getAbsolutePath());
                builder.addProperties(propertiesFile);
            } catch (IOException e) {
                throw new MojoExecutionException("Failed to add properties file to RoboVM config: " + propertiesFile);
            }
        } else {
            File file = new File(robovmSrcDir, "Info.plist");
            if (file.exists()) {
                getLog().debug("Using default properties file: " + file.getAbsolutePath());
                builder.iosInfoPList(file);
            }
        }
        if (configFile != null) {
            if (!configFile.exists()) {
                throw new MojoExecutionException("Invalid 'configFile' specified for RoboVM compile: " + configFile);
            }
            try {
                getLog().debug("Loading config file for RoboVM compiler: " + configFile.getAbsolutePath());
                builder.read(configFile);
            } catch (Exception e) {
                throw new MojoExecutionException("Failed to read RoboVM config file: " + configFile);
            }
        } else {
            File file = new File(robovmSrcDir, "config.xml");
            if (file.exists()) {
                getLog().debug("Using default config file: " + file.getAbsolutePath());
                builder.iosInfoPList(file);
            }
        }
        File osDir = new File(installDir, os.name());
        File archiveDir = new File(new File(osDir, arch.name()), "");
        builder.home(new Config.Home(unpackRoboVMDist()))
                .logger(getRoboVMLogger())
                .mainClass(mainClass)
                .executableName(executableName)
                .tmpDir(archiveDir)
                .targetType(targetType)
                .skipInstall(true)
                .os(os)
                .arch(arch);
        if (forceLinkClasses != null) {
            for (String pattern : forceLinkClasses) {
                getLog().debug("Including class pattern for linking: " + pattern);
                builder.addForceLinkClass(pattern);
            }
        }
        if (frameworks != null) {
            for (String framework : frameworks) {
                getLog().debug("Including framework: " + framework);
                builder.addFramework(framework);
            }
        }
        if (libs != null) {
            for (String lib : libs) {
                getLog().debug("Including lib: " + lib);
                builder.addLib(lib);
            }
        }
        if (iosSdkVersion != null) {
            getLog().debug("Using explicit iOS SDK version: " + iosSdkVersion);
            builder.iosSdkVersion(iosSdkVersion);
        }
        if (iosSignIdentity != null) {
            getLog().debug("Using explicit iOS Signing identity: " + iosSignIdentity);
            builder.iosSignIdentity(iosSignIdentity);
        }
        if (iosInfoPList != null) {
            if (!iosInfoPList.exists()) {
                throw new MojoExecutionException("Invalid 'iosInfoPList' specified for RoboVM compile: " + iosInfoPList);
            }
            getLog().debug("Using Info.plist input file: " + iosInfoPList.getAbsolutePath());
            builder.iosInfoPList(iosInfoPList);
        } else {
            File file = new File(robovmSrcDir, "Info.plist");
            if (file.exists()) {
                getLog().debug("Using default Info.plist input file: " + file.getAbsolutePath());
                builder.iosInfoPList(file);
            }
        }
        if (iosEntitlementsPList != null) {
            if (!iosEntitlementsPList.exists()) {
                throw new MojoExecutionException("Invalid 'iosEntitlementsPList' specified for RoboVM compile: " + iosEntitlementsPList);
            }
            getLog().debug("Using Entitlements.plist input file: " + iosEntitlementsPList.getAbsolutePath());
            builder.iosEntitlementsPList(iosEntitlementsPList);
        } else {
            File file = new File(robovmSrcDir, "Entitlements.plist");
            if (file.exists()) {
                getLog().debug("Using default Entitlements.plist input file: " + file.getAbsolutePath());
                builder.iosEntitlementsPList(file);
            }
        }
        if (iosResourceRulesPList != null) {
            if (!iosResourceRulesPList.exists()) {
                throw new MojoExecutionException("Invalid 'iosResourceRulesPList' specified for RoboVM compile: " + iosResourceRulesPList);
            }
            getLog().debug("Using ResourceRules.plist input file: " + iosResourceRulesPList.getAbsolutePath());
            builder.iosResourceRulesPList(iosResourceRulesPList);
        } else {
            File file = new File(robovmSrcDir, "ResourceRules.plist");
            if (file.exists()) {
                getLog().debug("Using default ResourceRules.plist input file: " + file.getAbsolutePath());
                builder.iosResourceRulesPList(file);
            }
        }
        if (resources != null) {
            for (File resource : resources) {
                if (!resource.exists()) {
                    throw new MojoExecutionException("Invalid 'resource' directory specified for RoboVM compile: " + resource);
                }
                getLog().debug("Including resource directory: " + resource.getAbsolutePath());
                builder.addResource(resource);
            }
        } else {
            File resource = new File(robovmSrcDir, "resources");
            if (resource.exists()) {
                getLog().debug("Using default resource directory: " + resource.getAbsolutePath());
                builder.addResource(resource);
            }
        }
        builder.clearClasspathEntries();
        if (includeJFX) {
            getLog().info("Including JavaFX Runtime in build");
            File jfxJar = resolveJavaFXRuntimeArtifact();
            getLog().debug("JavaFX runtime JAR found at: " + jfxJar);
            builder.addClasspathEntry(jfxJar);
            File iosNativesBaseDir = unpackJavaFXNativeIOSArtifact();
            builder.addLib(new File(iosNativesBaseDir, "libglass-" + arch.getClangName() + ".a").getAbsolutePath());
            builder.addLib(new File(iosNativesBaseDir, "libjavafx-font-" + arch.getClangName() + ".a").getAbsolutePath());
            builder.addLib(new File(iosNativesBaseDir, "libjavafx-iio-" + arch.getClangName() + ".a").getAbsolutePath());
            builder.addLib(new File(iosNativesBaseDir, "libprism-common-" + arch.getClangName() + ".a").getAbsolutePath());
            builder.addLib(new File(iosNativesBaseDir, "libprism-es2-" + arch.getClangName() + ".a").getAbsolutePath());
            builder.addForceLinkClass("com.sun.javafx.tk.quantum.QuantumToolkit");
            builder.addForceLinkClass("com.sun.prism.es2.ES2Pipeline");
            builder.addForceLinkClass("com.sun.prism.es2.IOSGLFactory");
            builder.addForceLinkClass("com.sun.glass.ui.ios.**.*");
            builder.addForceLinkClass("javafx.scene.CssStyleHelper");
            builder.addForceLinkClass("com.sun.prism.shader.**.*");
            builder.addForceLinkClass("com.sun.scenario.effect.impl.es2.ES2ShaderSource");
            builder.addForceLinkClass("com.sun.javafx.font.coretext.CTFactory");
            builder.addForceLinkClass("sun.util.logging.PlatformLogger");
            builder.addFramework("UIKit");
            builder.addFramework("OpenGLES");
            builder.addFramework("QuartzCore");
            builder.addFramework("CoreGraphics");
            builder.addFramework("CoreText");
            builder.addFramework("ImageIO");
            builder.addFramework("MobileCoreServices");
        }
        try {
            for (Object object : project.getRuntimeClasspathElements()) {
                String path = (String) object;
                if (getLog().isDebugEnabled()) {
                    getLog().debug("Including classpath element for RoboVM app: " + path);
                }
                builder.addClasspathEntry(new File(path));
            }
        } catch (DependencyResolutionRequiredException e) {
            throw new MojoExecutionException("Error resolving application classpath for RoboVM build", e);
        }
        try {
            Config config = builder.build();
            AppCompiler compiler = new AppCompiler(config);
            compiler.compile();
            return config;
        } catch (IOException e) {
            throw new MojoExecutionException("Error building RoboVM executable for app", e);
        }
    }


Input:
	public void check(ArrayList remarks, StepMeta stepMeta, Row prev, String input[], String output[], Row info)
	{
		CheckResult cr;
		if (useDatabase)
		{
			Database db = new Database(database);
			try
			{
				db.connect();
				Value last = db.checkSequence(sequenceName);
				if (last!=null)
				{
					cr = new CheckResult(CheckResult.TYPE_RESULT_OK, "Sequence is at value "+last, stepMeta);
				}
				else
				{
					cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, "Last value of sequence couldn't be found", stepMeta);
				}
			}
			catch(KettleException e)
			{
				cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, "Unable to connect to database to verify sequence because of an error: "+Const.CR+e.getMessage(), stepMeta);
			}
			finally
			{
				db.disconnect();
			}
			remarks.add(cr);
		}
		if (input.length>0)
		{
			cr = new CheckResult(CheckResult.TYPE_RESULT_OK, "Step is receiving info from other steps.", stepMeta);
			remarks.add(cr);
		}
		else
		{
			cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, "No input received from other steps!", stepMeta);
			remarks.add(cr);
		}
	}

Output:
	public void check(ArrayList remarks, StepMeta stepMeta, Row prev, String input[], String output[], Row info)
	{
		CheckResult cr;
		if (useDatabase)
		{
			Database db = new Database(database);
			try
			{
				db.connect();
				if (db.checkSequenceExists(sequenceName))
				{
					cr = new CheckResult(CheckResult.TYPE_RESULT_OK, "Sequence exits.", stepMeta);
				}
				else
				{
					cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, "The sequence ["+sequenceName+"] couldn't be found", stepMeta);
				}
			}
			catch(KettleException e)
			{
				cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, "Unable to connect to database to verify sequence because of an error: "+Const.CR+e.getMessage(), stepMeta);
			}
			finally
			{
				db.disconnect();
			}
			remarks.add(cr);
		}
		if (input.length>0)
		{
			cr = new CheckResult(CheckResult.TYPE_RESULT_OK, "Step is receiving info from other steps.", stepMeta);
			remarks.add(cr);
		}
		else
		{
			cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, "No input received from other steps!", stepMeta);
			remarks.add(cr);
		}
	}


Input:
	public String onSubmit(HttpServletRequest request, AppointmentBlock appointmentBlock, BindingResult result,
	        @RequestParam(value = "timeSlotLength", required = false) String timeSlotLength,
	        @RequestParam(value = "emptyTypes", required = false) String emptyTypes) throws Exception {
		HttpSession httpSession = request.getSession();
		if (Context.isAuthenticated()) {
			if (emptyTypes.equals("yes")) {
				appointmentBlock.setTypes(null);
			}
			AppointmentService appointmentService = Context.getService(AppointmentService.class);
			if (request.getParameter("save") != null) {
				new AppointmentBlockValidator().validate(appointmentBlock, result);
				if (result.hasErrors()) {
					return null;
				} else {
					if (appointmentBlock.getStartDate().before(Calendar.getInstance().getTime())) {
						result.rejectValue("startDate", "appointment.AppointmentBlock.error.dateCannotBeInThePast");
						return null;
					}
					if (!appointmentBlock.getStartDate().before(appointmentBlock.getEndDate())) {
						result.rejectValue("endDate", "appointment.AppointmentBlock.error.InvalidDateInterval");
						return null;
					}
					if (timeSlotLength.isEmpty() || Integer.parseInt(timeSlotLength) <= 0) {
						httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR,
						    "appointment.AppointmentBlock.error.selectTimeSlot");
						return null;
					}
					long appointmentBlocklengthInMinutes = (appointmentBlock.getEndDate().getTime() - appointmentBlock
					        .getStartDate().getTime()) / 60000;
					if (!timeSlotLength.isEmpty() && (Integer.parseInt(timeSlotLength) > appointmentBlocklengthInMinutes)) {
						httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR,
						    "appointment.AppointmentBlock.error.maximalTimeSlot");
						return null;
					}
					List<TimeSlot> currentTimeSlots = null;
					if (appointmentBlock.getCreator() != null) {
						boolean canBeUpdated = true;
						currentTimeSlots = appointmentService.getTimeSlotsInAppointmentBlock(appointmentBlock);
						for (TimeSlot timeSlot : currentTimeSlots) {
							if (appointmentService.getAppointmentsInTimeSlot(timeSlot).size() > 0) {
								canBeUpdated = false;
								break;
							}
						}
						if (!canBeUpdated) {
							httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR,
							    "appointment.AppointmentBlock.error.appointmentsExist");
							return null;
						}
					}
					if (appointmentService.getOverlappingAppointmentBlocks(appointmentBlock).size() > 0) {
						httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR,
						    "appointment.AppointmentBlock.error.appointmentBlockOverlap");
						return null;
					}
					appointmentService.saveAppointmentBlock(appointmentBlock);
					Integer slotLength = Integer.parseInt(timeSlotLength);
					int howManyTimeSlotsToCreate = (int) (appointmentBlocklengthInMinutes / slotLength);
					if (currentTimeSlots == null) {
						currentTimeSlots = appointmentService.getTimeSlotsInAppointmentBlock(appointmentBlock);
					}
					if (currentTimeSlots.size() != howManyTimeSlotsToCreate) {
						for (TimeSlot timeSlot : currentTimeSlots) {
							appointmentService.purgeTimeSlot(timeSlot);
						}
						Date startDate = appointmentBlock.getStartDate();
						Date endDate = null;
						Calendar cal;
						for (int i = 0; i < howManyTimeSlotsToCreate; i++) {
							cal = Context.getDateTimeFormat().getCalendar();
							cal.setTime(startDate);
							cal.add(Calendar.MINUTE, slotLength);
							endDate = cal.getTime();
							TimeSlot timeSlot = new TimeSlot(appointmentBlock, startDate, endDate);
							startDate = endDate;
							appointmentService.saveTimeSlot(timeSlot);
						}
						if (startDate.before(appointmentBlock.getEndDate())) {
							TimeSlot timeSlot = new TimeSlot(appointmentBlock, startDate, appointmentBlock.getEndDate());
							appointmentService.saveTimeSlot(timeSlot);
						}
					}
					httpSession.setAttribute(WebConstants.OPENMRS_MSG_ATTR, "appointment.AppointmentBlock.saved");
				}
			}
			else if (request.getParameter("unvoid") != null) {
				appointmentService.unvoidAppointmentBlock(appointmentBlock);
				httpSession.setAttribute(WebConstants.OPENMRS_MSG_ATTR, "appointment.AppointmentBlock.unvoidedSuccessfully");
			}
		}
		return "redirect:appointmentBlockList.list";
	}

Output:
	public String onSubmit(HttpServletRequest request, AppointmentBlock appointmentBlock, BindingResult result,
	        @RequestParam(value = "timeSlotLength", required = false) String timeSlotLength,
	        @RequestParam(value = "emptyTypes", required = false) String emptyTypes) throws Exception {
		HttpSession httpSession = request.getSession();
		if (Context.isAuthenticated()) {
			if (emptyTypes.equals("yes")) {
				appointmentBlock.setTypes(null);
			}
			AppointmentService appointmentService = Context.getService(AppointmentService.class);
			if (request.getParameter("save") != null) {
				new AppointmentBlockValidator().validate(appointmentBlock, result);
				if (result.hasErrors()) {
					return null;
				} else {
					if (appointmentBlock.getStartDate().before(Calendar.getInstance().getTime())) {
						result.rejectValue("startDate", "appointment.AppointmentBlock.error.dateCannotBeInThePast");
						return null;
					}
					if (!appointmentBlock.getStartDate().before(appointmentBlock.getEndDate())) {
						result.rejectValue("endDate", "appointment.AppointmentBlock.error.InvalidDateInterval");
						return null;
					}
					if (timeSlotLength.isEmpty() || Integer.parseInt(timeSlotLength) <= 0) {
						httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR,
						    "appointment.AppointmentBlock.error.selectTimeSlot");
						return null;
					}
					long appointmentBlocklengthInMinutes = (appointmentBlock.getEndDate().getTime() - appointmentBlock
					        .getStartDate().getTime()) / 60000;
					if (!timeSlotLength.isEmpty() && (Integer.parseInt(timeSlotLength) > appointmentBlocklengthInMinutes)) {
						httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR,
						    "appointment.AppointmentBlock.error.maximalTimeSlot");
						return null;
					}
					List<TimeSlot> currentTimeSlots = null;
					if (appointmentBlock.getCreator() != null) {
						boolean canBeUpdated = true;
						currentTimeSlots = appointmentService.getTimeSlotsInAppointmentBlock(appointmentBlock);
						for (TimeSlot timeSlot : currentTimeSlots) {
							if (appointmentService.getAppointmentsInTimeSlot(timeSlot).size() > 0) {
								canBeUpdated = false;
								break;
							}
						}
						if (!canBeUpdated) {
							httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR,
							    "appointment.AppointmentBlock.error.appointmentsExist");
							return null;
						}
					}
					if (appointmentService.getOverlappingAppointmentBlocks(appointmentBlock).size() > 0) {
						httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR,
						    "appointment.AppointmentBlock.error.appointmentBlockOverlap");
						return null;
					}
					appointmentService.saveAppointmentBlock(appointmentBlock);
					Integer slotLength = Integer.parseInt(timeSlotLength);
					int howManyTimeSlotsToCreate = (int) (appointmentBlocklengthInMinutes / slotLength);
					if (currentTimeSlots == null) {
						currentTimeSlots = appointmentService.getTimeSlotsInAppointmentBlock(appointmentBlock);
					}
					if (currentTimeSlots.size() != howManyTimeSlotsToCreate) {
						for (TimeSlot timeSlot : currentTimeSlots) {
							appointmentService.purgeTimeSlot(timeSlot);
						}
						Date startDate = appointmentBlock.getStartDate();
						Date endDate = null;
						Calendar cal;
						for (int i = 0; i < howManyTimeSlotsToCreate - 1; i++) {
							cal = Context.getDateTimeFormat().getCalendar();
							cal.setTime(startDate);
							cal.add(Calendar.MINUTE, slotLength);
							endDate = cal.getTime();
							TimeSlot timeSlot = new TimeSlot(appointmentBlock, startDate, endDate);
							startDate = endDate;
							appointmentService.saveTimeSlot(timeSlot);
						}
						TimeSlot timeSlot = new TimeSlot(appointmentBlock, startDate, appointmentBlock.getEndDate());
						appointmentService.saveTimeSlot(timeSlot);
					}
					httpSession.setAttribute(WebConstants.OPENMRS_MSG_ATTR, "appointment.AppointmentBlock.saved");
				}
			}
			else if (request.getParameter("unvoid") != null) {
				appointmentService.unvoidAppointmentBlock(appointmentBlock);
				httpSession.setAttribute(WebConstants.OPENMRS_MSG_ATTR, "appointment.AppointmentBlock.unvoidedSuccessfully");
			}
		}
		return "redirect:appointmentBlockList.list";
	}


Input:
    protected Key createKeyFromXml(Resources res, Row parent, int x, int y,
            XmlResourceParser parser) {
        Key key = super.createKeyFromXml(res, parent, x, y, parser);
        if (key.codes[0] == 10)
        {
            mEnterKey = key;
        }
        else if ((key.codes[0] == Keyboard.KEYCODE_MODE_CHANGE) ||
        		 (key.codes[0] == AnyKeyboard.KEYCODE_LANG_CHANGE))
        {
        	if (SoftKeyboard.mChangeKeysMode.equals("2"))
        	{
        		key.label = "";
        		key.height = 0;
        		key.width = 0;
        	}
        }
        else
        {
        	if (isAlphabetKey(key))
        	{
        		key.label = ""+((char)key.codes[0]);
        	}
        }
        Log.v("AnySoftKeyboard", "Key '"+key.codes[0]+"' will have - width: "+key.width+", height:"+key.height+", text: '"+key.label+"'.");
        return key;
    }

Output:
    protected Key createKeyFromXml(Resources res, Row parent, int x, int y,
            XmlResourceParser parser) {
        Key key = super.createKeyFromXml(res, parent, x, y, parser);
        if (key.codes[0] == 10)
        {
            mEnterKey = key;
        }
        else if ((key.codes[0] == Keyboard.KEYCODE_MODE_CHANGE) ||
        		 (key.codes[0] == AnyKeyboard.KEYCODE_LANG_CHANGE))
        {
        	if (SoftKeyboard.mChangeKeysMode.equals("2"))
        	{
        		key.label = null;
        		key.height = 0;
        		key.width = 0;
        	}
        }
        else
        {
        	if (isAlphabetKey(key))
        	{
        		key.label = ""+((char)key.codes[0]);
        	}
        }
        Log.v("AnySoftKeyboard", "Key '"+key.codes[0]+"' will have - width: "+key.width+", height:"+key.height+", text: '"+key.label+"'.");
        return key;
    }


Input:
	public void testIs() throws Exception {
		DateFilter filter;
		filter = new DateFilter(IFilter.Operator.IS, new GregorianCalendar(2014, 11, 03), null,  attributeDefinition);
		doMatch(filter, true);
		filter = new DateFilter(IFilter.Operator.IS, new GregorianCalendar(2014, 11, 04), null,  attributeDefinition);
		doMatch(filter, false);
		filter = new DateFilter(IFilter.Operator.IS, new GregorianCalendar(2014,11,03,0,0,0), null,  attributeDefinition);
		doMatch(filter, true);
		createFixture(new GregorianCalendar(2014, 11, 03, 13, 14, 15));
		filter = new DateFilter(IFilter.Operator.IS, new GregorianCalendar(2014,11,03), null,  attributeDefinition);
		doMatch(filter, true);
		filter = new DateFilter(IFilter.Operator.IS, new GregorianCalendar(2014,11,03,20,0,0), null,  attributeDefinition);
		doMatch(filter, true);
		GregorianCalendar fixtureDate = new GregorianCalendar(2014, 11, 3, 23, 0, 0);
		fixtureDate.setTimeZone(TimeZone.getTimeZone("GMT"));
		GregorianCalendar filterDate = new GregorianCalendar(TimeZone.getTimeZone("GMT-9"));
		filterDate.set(2014, 11, 4, 8, 0, 0);
		System.out.println((filterDate.getTimeInMillis() - fixtureDate.getTimeInMillis()) / 1000 / 60 / 60);
		createFixture(fixtureDate);
		filter = new DateFilter(IFilter.Operator.IS, filterDate, null,  attributeDefinition);
		doMatch(filter, true);
	}

Output:
	public void testIs() throws Exception {
		DateFilter filter;
		filter = new DateFilter(IFilter.Operator.IS, new GregorianCalendar(2014, 11, 03), null,  attributeDefinition);
		doMatch(filter, true);
		filter = new DateFilter(IFilter.Operator.IS, new GregorianCalendar(2014, 11, 04), null,  attributeDefinition);
		doMatch(filter, false);
		filter = new DateFilter(IFilter.Operator.IS, new GregorianCalendar(2014,11,03,0,0,0), null,  attributeDefinition);
		doMatch(filter, true);
		createFixture(new GregorianCalendar(2014, 11, 03, 13, 14, 15));
		filter = new DateFilter(IFilter.Operator.IS, new GregorianCalendar(2014,11,03), null,  attributeDefinition);
		doMatch(filter, true);
		filter = new DateFilter(IFilter.Operator.IS, new GregorianCalendar(2014,11,03,20,0,0), null,  attributeDefinition);
		doMatch(filter, true);
		GregorianCalendar fixtureDate = new GregorianCalendar(2014, 11, 3, 23, 0, 0);
		fixtureDate.setTimeZone(TimeZone.getTimeZone("GMT"));
		GregorianCalendar filterDate = new GregorianCalendar(TimeZone.getTimeZone("GMT+9"));
		filterDate.set(2014, 11, 4, 8, 0, 0);
		System.out.println((filterDate.getTimeInMillis() - fixtureDate.getTimeInMillis()) / 1000 / 60 / 60);
		createFixture(fixtureDate);
		filter = new DateFilter(IFilter.Operator.IS, filterDate, null,  attributeDefinition);
		doMatch(filter, true);
	}


Input:
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
        id = uidl.getId();
        boolean firstPaint = connection == null;
        connection = client;
        String newTheme = uidl.getStringAttribute("theme");
        if (theme != null && !newTheme.equals(theme)) {
            reloadHostPage();
        } else {
            theme = newTheme;
        }
        if (uidl.hasAttribute("style")) {
            addStyleName(uidl.getStringAttribute("style"));
        }
        if (uidl.hasAttribute("name")) {
            client.setWindowName(uidl.getStringAttribute("name"));
        }
        com.google.gwt.user.client.Window.setTitle(uidl
                .getStringAttribute("caption"));
        int childIndex = 0;
        boolean isClosed = false;
        while (childIndex < uidl.getChildCount()
                && "open".equals(uidl.getChildUIDL(childIndex).getTag())) {
            final UIDL open = uidl.getChildUIDL(childIndex);
            final String url = open.getStringAttribute("src");
            final String target = open.getStringAttribute("name");
            if (target == null) {
                isClosed = true;
                onWindowClosed();
                goTo(url);
            } else {
                Window.open(url, target != null ? target : null, "");
            }
            childIndex++;
        }
        if (isClosed) {
            return;
        }
        UIDL childUidl = uidl.getChildUIDL(childIndex);
        final Paintable lo = client.getPaintable(childUidl);
        if (layout != null) {
            if (layout != lo) {
                client.unregisterPaintable(layout);
                setWidget((Widget) lo);
                layout = lo;
            }
        } else {
            setWidget((Widget) lo);
            layout = lo;
        }
        layout.updateFromUIDL(childUidl, client);
        final HashSet removedSubWindows = new HashSet(subWindows);
        while ((childUidl = uidl.getChildUIDL(childIndex++)) != null) {
            if ("window".equals(childUidl.getTag())) {
                final Paintable w = client.getPaintable(childUidl);
                if (subWindows.contains(w)) {
                    removedSubWindows.remove(w);
                } else {
                    subWindows.add(w);
                }
                w.updateFromUIDL(childUidl, client);
            } else if ("actions".equals(childUidl.getTag())) {
                if (actionHandler == null) {
                    actionHandler = new ShortcutActionHandler(id, client);
                }
                actionHandler.updateActionMap(childUidl);
            } else if (childUidl.getTag().equals("notifications")) {
                for (final Iterator it = childUidl.getChildIterator(); it
                        .hasNext();) {
                    final UIDL notification = (UIDL) it.next();
                    String html = "";
                    if (notification.hasAttribute("icon")) {
                        final String parsedUri = client
                                .translateToolkitUri(notification
                                        .getStringAttribute("icon"));
                        html += "";
                    }
                    if (notification.hasAttribute("caption")) {
                        html += "
"
                                + notification.getStringAttribute("caption")
                                + "
";
                    }
                    if (notification.hasAttribute("message")) {
                        html += "
"
                                + notification.getStringAttribute("message")
                                + "
";
                    }
                    final String style = notification.hasAttribute("style") ? notification
                            .getStringAttribute("style")
                            : null;
                    final int position = notification
                            .getIntAttribute("position");
                    final int delay = notification.getIntAttribute("delay");
                    new INotification(delay).show(html, position, style);
                }
            }
        }
        for (final Iterator rem = removedSubWindows.iterator(); rem.hasNext();) {
            final IWindow w = (IWindow) rem.next();
            client.unregisterPaintable(w);
            subWindows.remove(w);
            w.hide();
        }
        if (uidl.hasAttribute("focused")) {
            final String focusPid = uidl.getStringAttribute("focused");
            DeferredCommand.addCommand(new Command() {
                public void execute() {
                    final Paintable toBeFocused = connection
                            .getPaintable(focusPid);
                    if (toBeFocused instanceof HasFocus) {
                        final HasFocus toBeFocusedWidget = (HasFocus) toBeFocused;
                        toBeFocusedWidget.setFocus(true);
                    } else if (toBeFocused instanceof Focusable) {
                        ((Focusable) toBeFocused).focus();
                    } else {
                        ApplicationConnection.getConsole().log(
                                "Could not focus component");
                    }
                }
            });
        }
        if (firstPaint) {
            Window.addWindowCloseListener(this);
            Window.addWindowResizeListener(this);
        }
        onWindowResized(Window.getClientWidth(), Window.getClientHeight());
    }

Output:
    public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
        id = uidl.getId();
        boolean firstPaint = connection == null;
        connection = client;
        String newTheme = uidl.getStringAttribute("theme");
        if (theme != null && !newTheme.equals(theme)) {
            reloadHostPage();
        } else {
            theme = newTheme;
        }
        if (uidl.hasAttribute("style")) {
            addStyleName(uidl.getStringAttribute("style"));
        }
        if (uidl.hasAttribute("name")) {
            client.setWindowName(uidl.getStringAttribute("name"));
        }
        com.google.gwt.user.client.Window.setTitle(uidl
                .getStringAttribute("caption"));
        int childIndex = 0;
        boolean isClosed = false;
        while (childIndex < uidl.getChildCount()
                && "open".equals(uidl.getChildUIDL(childIndex).getTag())) {
            final UIDL open = uidl.getChildUIDL(childIndex);
            final String url = open.getStringAttribute("src");
            final String target = open.getStringAttribute("name");
            if (target == null) {
                isClosed = true;
                onWindowClosed();
                goTo(url);
            } else {
                Window.open(url, target != null ? target : null, "");
            }
            childIndex++;
        }
        if (isClosed) {
            return;
        }
        UIDL childUidl = uidl.getChildUIDL(childIndex);
        final Paintable lo = client.getPaintable(childUidl);
        if (layout != null) {
            if (layout != lo) {
                client.unregisterPaintable(layout);
                setWidget((Widget) lo);
                layout = lo;
            }
        } else {
            setWidget((Widget) lo);
            layout = lo;
        }
        layout.updateFromUIDL(childUidl, client);
        final HashSet removedSubWindows = new HashSet(subWindows);
        while ((childUidl = uidl.getChildUIDL(childIndex++)) != null) {
            if ("window".equals(childUidl.getTag())) {
                final Paintable w = client.getPaintable(childUidl);
                if (subWindows.contains(w)) {
                    removedSubWindows.remove(w);
                } else {
                    subWindows.add(w);
                }
                w.updateFromUIDL(childUidl, client);
            } else if ("actions".equals(childUidl.getTag())) {
                if (actionHandler == null) {
                    actionHandler = new ShortcutActionHandler(id, client);
                }
                actionHandler.updateActionMap(childUidl);
            } else if (childUidl.getTag().equals("notifications")) {
                for (final Iterator it = childUidl.getChildIterator(); it
                        .hasNext();) {
                    final UIDL notification = (UIDL) it.next();
                    String html = "";
                    if (notification.hasAttribute("icon")) {
                        final String parsedUri = client
                                .translateToolkitUri(notification
                                        .getStringAttribute("icon"));
                        html += "<IMG src=\"" + parsedUri + "\" />";
                    }
                    if (notification.hasAttribute("caption")) {
                        html += "<H1>"
                                + notification.getStringAttribute("caption")
                                + "</H1>";
                    }
                    if (notification.hasAttribute("message")) {
                        html += "<p>"
                                + notification.getStringAttribute("message")
                                + "</p>";
                    }
                    final String style = notification.hasAttribute("style") ? notification
                            .getStringAttribute("style")
                            : null;
                    final int position = notification
                            .getIntAttribute("position");
                    final int delay = notification.getIntAttribute("delay");
                    new INotification(delay).show(html, position, style);
                }
            }
        }
        for (final Iterator rem = removedSubWindows.iterator(); rem.hasNext();) {
            final IWindow w = (IWindow) rem.next();
            client.unregisterPaintable(w);
            subWindows.remove(w);
            w.hide();
        }
        if (uidl.hasAttribute("focused")) {
            final String focusPid = uidl.getStringAttribute("focused");
            DeferredCommand.addCommand(new Command() {
                public void execute() {
                    final Paintable toBeFocused = connection
                            .getPaintable(focusPid);
                    if (toBeFocused instanceof HasFocus) {
                        final HasFocus toBeFocusedWidget = (HasFocus) toBeFocused;
                        toBeFocusedWidget.setFocus(true);
                    } else if (toBeFocused instanceof Focusable) {
                        ((Focusable) toBeFocused).focus();
                    } else {
                        ApplicationConnection.getConsole().log(
                                "Could not focus component");
                    }
                }
            });
        }
        if (firstPaint) {
            Window.addWindowCloseListener(this);
            Window.addWindowResizeListener(this);
        }
        onWindowResized(Window.getClientWidth(), Window.getClientHeight());
        if (BrowserInfo.get().isSafari()) {
            Util.runWebkitOverflowAutoFix(getElement());
        }
    }


Input:
	public void setGLState(GL2 gl, int light) {
		if (enabled) {
			gl.glEnable(GL2.GL_LIGHT0 + light);
		}
		else
			gl.glDisable(GL2.GL_LIGHT0 + light);
		gl.glLightfv(light, GL2.GL_AMBIENT,
				ambientColor.getComponents(null), 0);
		gl.glLightfv(light, GL2.GL_DIFFUSE,
				diffuseColor.getComponents(null), 0);
		gl.glLightfv(light, GL2.GL_SPECULAR,
				specularColor.getComponents(null), 0);
	}

Output:
	public void setGLState(GL2 gl, int light) {
		if (enabled) {
			gl.glEnable(light);
		}
		else
			gl.glDisable(light);
		gl.glLightfv(light, GL2.GL_AMBIENT,
				ambientColor.getComponents(null), 0);
		gl.glLightfv(light, GL2.GL_DIFFUSE,
				diffuseColor.getComponents(null), 0);
		gl.glLightfv(light, GL2.GL_SPECULAR,
				specularColor.getComponents(null), 0);
	}


Input:
	protected TaskManager createTaskManagerImpl(String taskId, Map<String, String> taskArgs, Map<String, String> pipeArgs) {
		String fileName;
		File file;
		EntityReporter task;
		fileName = getStringArgument(taskId, taskArgs, ARG_FILE_NAME, DEFAULT_FILE_NAME);
		file = new File(fileName);
		task = new EntityReporter(file);
		return new SinkManager(taskId, task, pipeArgs);
	}

Output:
	protected TaskManager createTaskManagerImpl(String taskId, Map<String, String> taskArgs, Map<String, String> pipeArgs) {
		String fileName;
		File file;
		IntegrityReporter task;
		fileName = getStringArgument(taskId, taskArgs, ARG_FILE_NAME, DEFAULT_FILE_NAME);
		file = new File(fileName);
		task = new IntegrityReporter(file);
		return new SinkManager(taskId, task, pipeArgs);
	}


Input:
    public void service(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        if (getTarget() != null) {
            ServletCall servletCall = new ServletCall(getLogger(), request
                    .getLocalAddr(), request.getLocalPort(), request, response);
            HttpRequest httpRequest = toRequest(servletCall);
            HttpResponse httpResponse = new HttpResponse(servletCall,
                    httpRequest);
            if (this.baseRef == null) {
                String baseUri = request.getContextPath()
                        + request.getServletPath();
                int baseIndex = request.getRequestURI().indexOf(baseUri);
                if (baseIndex != -1) {
                    this.baseRef = new Reference(request.getRequestURI()
                            .substring(0, baseIndex + baseUri.length()));
                }
            }
            httpRequest.getResourceRef().setBaseRef(this.baseRef);
            getTarget().handle(httpRequest, httpResponse);
            commit(httpResponse);
        } else {
            getLogger().warning("Unable to find the Restlet target");
        }
    }

Output:
    public void service(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        if (getTarget() != null) {
            ServletCall servletCall = new ServletCall(getLogger(), request
                    .getLocalAddr(), request.getLocalPort(), request, response);
            HttpRequest httpRequest = toRequest(servletCall);
            HttpResponse httpResponse = new HttpResponse(servletCall,
                    httpRequest);
            if (this.baseRef == null) {
                String basePath = request.getContextPath()
                        + request.getServletPath();
                String baseUri = request.getRequestURL().toString();
                int baseIndex = baseUri.indexOf(basePath);
                if (baseIndex != -1) {
                    this.baseRef = new Reference(baseUri.substring(0, baseIndex
                            + basePath.length()));
                }
            }
            httpRequest.getResourceRef().setBaseRef(this.baseRef);
            getTarget().handle(httpRequest, httpResponse);
            commit(httpResponse);
        } else {
            getLogger().warning("Unable to find the Restlet target");
        }
    }


Input:
    public boolean onCommand(CommandSender sender, Command cmd, String label, String args[]) {
        String player = sender.getName();
        String target = "";
        try {
            target = args[0];
        } catch (ArrayIndexOutOfBoundsException e) {
        }
        if ((cmd.getName().equalsIgnoreCase("greport")) && (args.length == 1)) {
            if (!sender.hasPermission("ireport.greport") && !sender.isOp()) {
                sender.sendMessage(ChatColor.RED + "You don't have permission to perform this command");
                return true;
            }
            String already = (String) getConfig().get("reports.griefing." + player);
            sender.sendMessage(ChatColor.BLUE + "You successfully reported " + ChatColor.RED + target);
            getConfig().set("reports.griefing." + player, Rlocation.getxyz(this, args[0]) + "; " + target);
            saveConfig();
            for (Player p : sender.getServer().getOnlinePlayers()) {
                if (p.isOp() || p.hasPermission("iReport.seereport")) {
                    p.sendMessage(ChatColor.RED + player + " has reported " + target + " for griefing");
                }
            }
            return true;
        }
        if ((cmd.getName().equalsIgnoreCase("hreport")) && (args.length == 2)) {
            if (!sender.hasPermission("ireport.hreport")) {
                sender.sendMessage(ChatColor.RED + "You don't have permission to perform this command");
                return true;
            }
            String already = (String) getConfig().get("reports.hacking." + player);
            getConfig().set("reports.hacking." + player, new StringBuilder("type: ").append(args[1]).toString() + "; " + target);
            sender.sendMessage(ChatColor.BLUE + "You successfully reported " + ChatColor.RED + target);
            saveConfig();
            for (Player p : sender.getServer().getOnlinePlayers()) {
                if (p.isOp() || p.hasPermission("iReport.seereport")) {
                    p.sendMessage(ChatColor.RED + player + " has reported " + target + " for hacking " + args[1]);
                }
            }
            return true;
        }
        if ((cmd.getName().equalsIgnoreCase("sreport")) && (args.length == 1)) {
            if (!sender.hasPermission("ireport.sreport")) {
                sender.sendMessage(ChatColor.RED + "You don't have permission to perform this command");
                return true;
            }
            String already = (String) getConfig().get("reports.swearing." + player);
            getConfig().set("reports.swearing." + player, "; " + target);
            sender.sendMessage(ChatColor.BLUE + "You don't have permission to perform this command" + ChatColor.RED + target);
            saveConfig();
            for (Player p : sender.getServer().getOnlinePlayers()) {
                if (p.isOp() || p.hasPermission("iReport.seereport")) {
                    p.sendMessage(ChatColor.RED + player + " has reported " + target + " for swearing");
                }
            }
            return true;
        }
        if (cmd.getName().equalsIgnoreCase("ireport")) {
            sender.sendMessage(ChatColor.YELLOW + "==============================");
            sender.sendMessage(ChatColor.GREEN + "/greport - Report a griefer");
            sender.sendMessage(ChatColor.GREEN + "/hreport - Report a hacker");
            sender.sendMessage(ChatColor.GREEN + "/sreport - Report a swearer");
            sender.sendMessage(ChatColor.GREEN + "/ireport - Show this help menu");
            sender.sendMessage(ChatColor.YELLOW + "==============================");
            sender.sendMessage(ChatColor.MAGIC + "Created by tudse145 & heni123321");
            return true;
        }
        if (cmd.getName().equalsIgnoreCase("reports")) {
            try {
                Scanner sc = new Scanner(new File("plugins/iReport/", "config.yml"));
                while (sc.hasNext()) {
                    sender.sendMessage(sc.nextLine());
                }
                sc.close();
            } catch (FileNotFoundException e) {
            }
            return true;
        }
        if (cmd.getName().equalsIgnoreCase("reports")) {
            return true;
        }
        return false;
    }

Output:
    public boolean onCommand(CommandSender sender, Command cmd, String label, String args[]) {
        String player = sender.getName();
        String target = "";
        try {
            target = args[0];
        } catch (ArrayIndexOutOfBoundsException e) {
        }
        if ((cmd.getName().equalsIgnoreCase("greport")) && (args.length == 1)) {
            if (!sender.hasPermission("ireport.greport") && !sender.isOp()) {
                sender.sendMessage(ChatColor.RED + "You don't have permission to perform this command");
                return true;
            }
            String already = (String) getConfig().get("reports.griefing." + player);
            sender.sendMessage(ChatColor.BLUE + "You successfully reported " + ChatColor.RED + target);
            getConfig().set("reports.griefing." + player, Rlocation.getxyz(this, args[0]) + "; " + target);
            saveConfig();
            for (Player p : sender.getServer().getOnlinePlayers()) {
                if (p.isOp() || p.hasPermission("iReport.seereport")) {
                    p.sendMessage(ChatColor.RED + player + " has reported " + target + " for griefing");
                }
            }
            return true;
        }
        if ((cmd.getName().equalsIgnoreCase("hreport")) && (args.length == 2)) {
            if (!sender.hasPermission("ireport.hreport")) {
                sender.sendMessage(ChatColor.RED + "You don't have permission to perform this command");
                return true;
            }
            String already = (String) getConfig().get("reports.hacking." + player);
            getConfig().set("reports.hacking." + player, new StringBuilder("type: ").append(args[1]).toString() + "; " + target);
            sender.sendMessage(ChatColor.BLUE + "You successfully reported " + ChatColor.RED + target);
            saveConfig();
            for (Player p : sender.getServer().getOnlinePlayers()) {
                if (p.isOp() || p.hasPermission("iReport.seereport")) {
                    p.sendMessage(ChatColor.RED + player + " has reported " + target + " for hacking " + args[1]);
                }
            }
            return true;
        }
        if ((cmd.getName().equalsIgnoreCase("sreport")) && (args.length == 1)) {
            if (!sender.hasPermission("ireport.sreport")) {
                sender.sendMessage(ChatColor.RED + "You don't have permission to perform this command");
                return true;
            }
            String already = (String) getConfig().get("reports.swearing." + player);
            getConfig().set("reports.swearing." + player, "; " + target);
            sender.sendMessage(ChatColor.BLUE + "You successfully reported" + ChatColor.RED + target);
            saveConfig();
            for (Player p : sender.getServer().getOnlinePlayers()) {
                if (p.isOp() || p.hasPermission("iReport.seereport")) {
                    p.sendMessage(ChatColor.RED + player + " has reported " + target + " for swearing");
                }
            }
            return true;
        }
        if (cmd.getName().equalsIgnoreCase("ireport")) {
            sender.sendMessage(ChatColor.YELLOW + "==============================");
            sender.sendMessage(ChatColor.GREEN + "/greport - Report a griefer");
            sender.sendMessage(ChatColor.GREEN + "/hreport - Report a hacker");
            sender.sendMessage(ChatColor.GREEN + "/sreport - Report a swearer");
            sender.sendMessage(ChatColor.GREEN + "/ireport - Show this help menu");
            sender.sendMessage(ChatColor.YELLOW + "==============================");
            sender.sendMessage(ChatColor.MAGIC + "Created by tudse145 & heni123321");
            return true;
        }
        if (cmd.getName().equalsIgnoreCase("reports")) {
            try {
                Scanner sc = new Scanner(new File("plugins/iReport/", "config.yml"));
                while (sc.hasNext()) {
                    sender.sendMessage(sc.nextLine());
                }
                sc.close();
            } catch (FileNotFoundException e) {
            }
            return true;
        }
        if (cmd.getName().equalsIgnoreCase("reports")) {
            return true;
        }
        return false;
    }


Input:
	protected IGenPackageFinderResult findGenPackage(ConcreteSyntax syntax, String nsURI, final ResourceSet rs, URI genModelURI) {
		Resource genModelResource = null;
		try {
			genModelResource = rs.getResource(genModelURI, true);
		} catch (Exception e) {}
		EList<EObject> contents = null;
		if (genModelResource != null) {
			contents = genModelResource.getContents();
		}
		if (contents != null && contents.size() > 0) {
			GenModel genModel = (GenModel) contents.get(0);
			File ecoreFile = null;
			if (Platform.isRunning()) {
				boolean reloadEnabled = OptionManager.INSTANCE.getBooleanOptionValue(syntax, ICodeGenOptions.RELOAD_GENERATOR_MODEL);
				if (reloadEnabled) {
					genModel = reloadGeneratorModel(genModel);
				}
				List<GenFeature> allGenFeatures = genModel.getAllGenFeatures();
				for (GenFeature genFeature : allGenFeatures) {
					final Resource resource = genFeature.getEcoreFeature().eResource();
					if (resource == null) {
						continue;
					}
					URI uri = resource.getURI();
					if (uri == null) {
						continue;
					}
					IResource ecoreMember = ResourcesPlugin.getWorkspace().getRoot().findMember(uri.toPlatformString(true));
					ecoreFile = ecoreMember.getLocation().toFile();
					break;
				}
			}
			Map<String, GenPackage> packages =  MetamodelManager.getGenPackages(genModel);
			for (String uri : packages.keySet()) {
				if (uri == null) {
					continue;
				}
				if (uri.equals(nsURI)) {
					return new GenPackageInFileResult(packages.get(nsURI), ecoreFile);
				}
			}
		}
		return null;
	}

Output:
	protected IGenPackageFinderResult findGenPackage(ConcreteSyntax syntax, String nsURI, final ResourceSet rs, URI genModelURI) {
		Resource genModelResource = null;
		try {
			genModelResource = rs.getResource(genModelURI, true);
		} catch (Exception e) {}
		EList<EObject> contents = null;
		if (genModelResource != null) {
			contents = genModelResource.getContents();
		}
		if (contents != null && contents.size() > 0) {
			GenModel genModel = (GenModel) contents.get(0);
			File ecoreFile = null;
			if (Platform.isRunning()) {
				boolean reloadEnabled = OptionManager.INSTANCE.getBooleanOptionValue(syntax, ICodeGenOptions.RELOAD_GENERATOR_MODEL);
				if (reloadEnabled) {
					genModel = reloadGeneratorModel(genModel);
				}
				List<GenFeature> allGenFeatures = genModel.getAllGenFeatures();
				for (GenFeature genFeature : allGenFeatures) {
					final Resource resource = genFeature.getEcoreFeature().eResource();
					if (resource == null) {
						continue;
					}
					URI uri = resource.getURI();
					if (uri == null) {
						continue;
					}
					IResource ecoreMember = ResourcesPlugin.getWorkspace().getRoot().findMember(uri.toPlatformString(true));
					if (ecoreMember != null) {
						ecoreFile = ecoreMember.getLocation().toFile();
					}
					break;
				}
			}
			Map<String, GenPackage> packages =  MetamodelManager.getGenPackages(genModel);
			for (String uri : packages.keySet()) {
				if (uri == null) {
					continue;
				}
				if (uri.equals(nsURI)) {
					return new GenPackageInFileResult(packages.get(nsURI), ecoreFile);
				}
			}
		}
		return null;
	}


Input:
	public ArrayList<Observation> parse(String line)
	{
		ArrayList<Observation> observations = new ArrayList<Observation>();
		String[] obs = line.split(",");
		try
		{
			String date = obs[0];
			String time = obs[1];
			String avgX = (obs[5].equals("") ? "0" : obs[5]);
			String avgY = (obs[8].equals("") ? "0" : obs[8]);
			String avgZ = (obs[11].equals("") ? "0" : obs[11]);
			String hum = (obs[12].equals("") ? "0" : obs[12]);
			String temp = (obs[13].equals("") ? "0" : obs[13]);
			String lat = (obs[14].equals("") ? "0" : obs[14]);
			String lon = (obs[15].equals("") ? "0" : obs[15]);
			String alt = (obs[16].equals("") ? "0" : obs[16]);
			String speed = (obs[17].equals("") ? "0" : obs[17]);
			String sat = (obs[18].equals("") ? "0" : obs[18]);
			String prec = (obs[19].equals("") ? "0" : obs[19]);
			String event = (obs[20].equals("") ? "0" : obs[20]);
			time = date.trim() + " " + time.trim();
			if(!time.equals(" ") && (count == 2) && !time.contains("VALUE"))
			{
				observations.add(new AccelerometerObservation(ObservationType.ACCELERATION, "X", time, avgX, event));
				observations.add(new AccelerometerObservation(ObservationType.ACCELERATION, "Y", time, avgY, event));
				observations.add(new AccelerometerObservation(ObservationType.ACCELERATION, "Z", time, avgZ, event));
				observations.add(new Observation(ObservationType.HUMIDITY, time, hum, event));
				observations.add(new Observation(ObservationType.TEMPERATURE, time, temp, event));
				observations.add(new GPSObservation(ObservationType.GPS, time, lat, lon, sat, prec, event));
				observations.add(new AltitudeObservation(ObservationType.ALTITUDE, time, alt, sat, event));
				observations.add(new SpeedObservation(ObservationType.SPEED, time, speed, event));
				count = 0;
			} else
				count++;
		}
		catch(ArrayIndexOutOfBoundsException aex)
		{
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		}
		return observations;
	}

Output:
	public ArrayList<Observation> parse(String line)
	{
		ArrayList<Observation> observations = new ArrayList<Observation>();
		String[] obs = line.split(",");
		try
		{
			String date = obs[0];
			String time = obs[1];
			String avgX = (obs[5].equals("") ? "0" : obs[5]);
			String avgY = (obs[8].equals("") ? "0" : obs[8]);
			String avgZ = (obs[11].equals("") ? "0" : obs[11]);
			String hum = (obs[12].equals("") ? "0" : obs[12]);
			String temp = (obs[13].equals("") ? "0" : obs[13]);
			String lat = (obs[14].equals("") ? "0" : obs[14]);
			String lon = (obs[15].equals("") ? "0" : obs[15]);
			String alt = (obs[16].equals("") ? "0" : obs[16]);
			String speed = (obs[17].equals("") ? "0" : obs[17]);
			String sat = (obs[18].equals("") ? "0" : obs[18]);
			String prec = (obs[19].equals("") ? "0" : obs[19]);
			String event = (obs[20].equals("") ? "0" : obs[20]);
			time = date.trim() + " " + time.trim();
			if(count == 4)
			{
				if(!time.equals(" ") && !time.contains("#VALUE"))
				{
					observations.add(new AccelerometerObservation(ObservationType.ACCELERATION, "X", time, avgX, event));
					observations.add(new AccelerometerObservation(ObservationType.ACCELERATION, "Y", time, avgY, event));
					observations.add(new AccelerometerObservation(ObservationType.ACCELERATION, "Z", time, avgZ, event));
					observations.add(new Observation(ObservationType.HUMIDITY, time, hum, event));
					observations.add(new Observation(ObservationType.TEMPERATURE, time, temp, event));
					observations.add(new GPSObservation(ObservationType.GPS, time, lat, lon, sat, prec, event));
					observations.add(new AltitudeObservation(ObservationType.ALTITUDE, time, alt, sat, event));
					observations.add(new SpeedObservation(ObservationType.SPEED, time, speed, event));
				}
				count = 0;
			}
			else
				count++;
		}
		catch(ArrayIndexOutOfBoundsException aex)
		{
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		}
		return observations;
	}


Input:
    private void parseCommandLineArguments(String[] args)
    {
	try
	{
	    Options options = new Options();
	    options.addOption(new Option("h","help",false,"Shows this help"));
	    options.addOption(new Option("U","nfsp",true,"Path to directory with UCSC files."));
	    options.addOption(new Option("S","serialize",false,"Serialize"));
	    options.addOption(new Option("D","deserialize",true,"Path to serialized file with UCSC data"));
	    options.addOption(new Option("V","vcf",true,"Path to VCF file"));
	    options.addOption(new Option("J","janno",false,"Output Jannovar format"));
	    options.addOption(new Option(null,"download-ucsc",false,"Download UCSC KnownGene data"));
	    options.addOption(new Option(null,"ftp-proxy",true,"FTP Proxy"));
	    options.addOption(new Option(null,"ftp-proxy-port",true,"FTP Proxy Port"));
	    Parser parser = new GnuParser();
	    CommandLine cmd = parser.parse(options,args);
	    if (cmd.hasOption("h") || cmd.hasOption("H") || args.length==0)
	    {
		HelpFormatter formatter = new HelpFormatter();
		formatter.printHelp("java -jar Jannovar.jar [-options]", options);
		usage();
		System.exit(0);
	    }
	    if (cmd.hasOption("J")) {
		this.jannovarFormat = true;
	    } else {
		this.jannovarFormat = false;
	    }
	    if (cmd.hasOption("download-ucsc")) {
		this.downloadUCSC = true;
		this.performSerialization = true;
	    } else {
		this.downloadUCSC = false;
	    }
	    if (cmd.hasOption('S')) {
		this.performSerialization = true;
	    }
	    if (cmd.hasOption("proxy")) {
		this.proxy = cmd.getOptionValue("proxy");
	    }
	    if (cmd.hasOption("proxy-port")) {
		this.proxyPort = cmd.getOptionValue("proxy-port");
		}
	    if (cmd.hasOption("U")) {
		this.ucscDirPath = getRequiredOptionValue(cmd,'U');
	    }
	    if (cmd.hasOption('D')) {
		this.serializedFile = cmd.getOptionValue('D');
	    }
	    if (cmd.hasOption("V"))
		this.VCFfilePath =  cmd.getOptionValue("V");
	} catch (ParseException pe)
	{
	    System.err.println("Error parsing command line options");
	    System.err.println(pe.getMessage());
	    System.exit(1);
	}
    }

Output:
    private void parseCommandLineArguments(String[] args)
    {
	try
	{
	    Options options = new Options();
	    options.addOption(new Option("h","help",false,"Shows this help"));
	    options.addOption(new Option("U","nfsp",true,"Path to directory with UCSC files."));
	    options.addOption(new Option("S","serialize",false,"Serialize"));
	    options.addOption(new Option("D","deserialize",true,"Path to serialized file with UCSC data"));
	    options.addOption(new Option("V","vcf",true,"Path to VCF file"));
	    options.addOption(new Option("J","janno",false,"Output Jannovar format"));
	    options.addOption(new Option(null,"download-ucsc",false,"Download UCSC KnownGene data"));
	    options.addOption(new Option(null,"proxy",true,"FTP Proxy"));
	    options.addOption(new Option(null,"proxy-port",true,"FTP Proxy Port"));
	    Parser parser = new GnuParser();
	    CommandLine cmd = parser.parse(options,args);
	    if (cmd.hasOption("h") || cmd.hasOption("H") || args.length==0)
	    {
		HelpFormatter formatter = new HelpFormatter();
		formatter.printHelp("java -jar Jannovar.jar [-options]", options);
		usage();
		System.exit(0);
	    }
	    if (cmd.hasOption("J")) {
		this.jannovarFormat = true;
	    } else {
		this.jannovarFormat = false;
	    }
	    if (cmd.hasOption("download-ucsc")) {
		this.downloadUCSC = true;
		this.performSerialization = true;
	    } else {
		this.downloadUCSC = false;
	    }
	    if (cmd.hasOption('S')) {
		this.performSerialization = true;
	    }
	    if (cmd.hasOption("proxy")) {
		this.proxy = cmd.getOptionValue("proxy");
	    }
	    if (cmd.hasOption("proxy-port")) {
		this.proxyPort = cmd.getOptionValue("proxy-port");
		}
	    if (cmd.hasOption("U")) {
		this.ucscDirPath = getRequiredOptionValue(cmd,'U');
	    }
	    if (cmd.hasOption('D')) {
		this.serializedFile = cmd.getOptionValue('D');
	    }
	    if (cmd.hasOption("V"))
		this.VCFfilePath =  cmd.getOptionValue("V");
	} catch (ParseException pe)
	{
	    System.err.println("Error parsing command line options");
	    System.err.println(pe.getMessage());
	    System.exit(1);
	}
    }


Input:
	public void draw(Graphics2D g, int windowWidth, int windowHeight)
	{
		if (map == null)
			return;
		g.setColor(RADAR_BACKGROUND_COLOR);
		g.fill(getFixedBounds(windowWidth, windowHeight));
		g.setColor(RADAR_COLOR);
		final int offsetX = getFixedX(windowWidth), offsetY = getFixedY(windowHeight);
		for (int x=0; x < map.getWidth(); x++)
			for (int y=0; y < map.getHeight(); y++)
			{
				if (map.isWall(x, y))
					g.fillRect(Math.round(scale * x) + offsetX,
					           Math.round(scale * y) + offsetY,
					           Math.round(scale),
					           Math.round(scale));
			}
		final LocalPlayer localPlayer = engine.getLocalPlayer();
		final int localID = localPlayer.getPlayerID();
		float time;
		int px, py;
		for (Player p : engine.playerList)
		{
			if (p.getPlayerID() == localID || p.equals(localPlayer))
			{
				g.setColor(Color.green);
			}
			else if (p.getTeam() != TEAM_A && p.getTeam() != TEAM_B)
			{
				time = p.getTimeSinceLastSound();
				if (time > BLIP_TIME)
					continue;
				g.setColor(GuiUtils.modulateColor(TEAMLESS_COLOR, 1 - (float)time/BLIP_TIME));
			}
			else if (p.getTeam() == localPlayer.getTeam())
			{
				g.setColor(Color.blue);
			}
			else
			{
				time = p.getTimeSinceLastSound();
				if (time > BLIP_TIME)
					continue;
				g.setColor(GuiUtils.modulateColor(Color.red, 1 - (float)time/BLIP_TIME));
			}
			px = Math.round(p.getPosition().getX() * scale) + offsetX;
			py = Math.round(p.getPosition().getY() * scale) + offsetY;
			px = Math.min(x + width, Math.max(x, px));
			py = Math.min(y + height, Math.max(y, py));
			g.fillRect(px - 1, py - 1, 3, 3);
		}
		if (showName)
		{
			String name = map.getName();
			Rectangle2D bounds = g.getFontMetrics().getStringBounds(name, g);
			int xpos = x, ypos = y + height;
			if (x < 0)
				xpos = (int)Math.round(windowWidth - bounds.getWidth() + x - width - bounds.getX());
			if (y < 0)
				ypos = (int)Math.round(windowHeight - bounds.getHeight() + y - height - bounds.getY());
			g.setColor(Color.yellow);
			g.drawString(name, xpos, ypos);
		}
	}

Output:
	public void draw(Graphics2D g, int windowWidth, int windowHeight)
	{
		if (map == null)
			return;
		g.setColor(RADAR_BACKGROUND_COLOR);
		g.fill(getFixedBounds(windowWidth, windowHeight));
		g.setColor(RADAR_COLOR);
		final int offsetX = getFixedX(windowWidth), offsetY = getFixedY(windowHeight);
		for (int x=0; x < map.getWidth(); x++)
			for (int y=0; y < map.getHeight(); y++)
			{
				if (map.isWall(x, y))
					g.fillRect(Math.round(scale * x) + offsetX,
					           Math.round(scale * y) + offsetY,
					           Math.round(scale),
					           Math.round(scale));
			}
		final LocalPlayer localPlayer = engine.getLocalPlayer();
		final int localID = localPlayer.getPlayerID();
		float time;
		int px, py;
		for (Player p : engine.playerList)
		{
			if (p.getPlayerID() == localID || p.equals(localPlayer))
			{
				g.setColor(Color.green);
			}
			else if (p.getTeam() != TEAM_A && p.getTeam() != TEAM_B)
			{
				time = p.getTimeSinceLastSound();
				if (time > BLIP_TIME)
					continue;
				g.setColor(GuiUtils.modulateColor(TEAMLESS_COLOR, 1 - (float)time/BLIP_TIME));
			}
			else if (p.getTeam() == localPlayer.getTeam())
			{
				g.setColor(Color.blue);
			}
			else
			{
				time = p.getTimeSinceLastSound();
				if (time > BLIP_TIME)
					continue;
				g.setColor(GuiUtils.modulateColor(Color.red, 1 - (float)time/BLIP_TIME));
			}
			px = Math.round(p.getPosition().getX() * scale) + offsetX;
			py = Math.round(p.getPosition().getY() * scale) + offsetY;
			px = Math.min(getFixedX(windowWidth) + width, Math.max(getFixedX(windowWidth), px));
			py = Math.min(getFixedY(windowHeight) + height, Math.max(getFixedY(windowHeight), py));
			g.fillRect(px - 1, py - 1, 3, 3);
		}
		if (showName)
		{
			String name = map.getName();
			Rectangle2D bounds = g.getFontMetrics().getStringBounds(name, g);
			int xpos = x, ypos = y + height;
			if (x < 0)
				xpos = (int)Math.round(windowWidth - bounds.getWidth() + x - width - bounds.getX());
			if (y < 0)
				ypos = (int)Math.round(windowHeight - bounds.getHeight() + y - height - bounds.getY());
			g.setColor(Color.yellow);
			g.drawString(name, xpos, ypos);
		}
	}


Input:
    public CompositeSequence(Class<T> clazz, Sequence<? extends T>... sequences) {
        super(clazz);
        this.sequences = sequences.clone();
        this.startPositions = new int[sequences.length];
        int size = 0;
        int depth = 0;
        for (int i = 0, offset = 0; i < sequences.length; i++) {
            if (!sequences[i].getElementType().isAssignableFrom(clazz))
                throw new ClassCastException();
            startPositions[i] = offset;
            size += sequences[i].size();
            offset += sequences[i].size();
            depth = Math.max(depth, sequences[i].getDepth());
        }
        this.size = size;
        this.depth = depth + 1;
    }

Output:
    public CompositeSequence(Class<T> clazz, Sequence<? extends T>... sequences) {
        super(clazz);
        this.sequences = sequences.clone();
        this.startPositions = new int[sequences.length];
        int size = 0;
        int depth = 0;
        for (int i = 0, offset = 0; i < sequences.length; i++) {
            Class eClass = sequences[i].getElementType();
            if (!clazz.isAssignableFrom(eClass))
                throw new ClassCastException("cannot cast "+eClass.getName()
                                             +" segment to "+clazz.getName()+" sequence");
            startPositions[i] = offset;
            size += sequences[i].size();
            offset += sequences[i].size();
            depth = Math.max(depth, sequences[i].getDepth());
        }
        this.size = size;
        this.depth = depth + 1;
    }


Input:
	protected ToolBar createToolBar() {
		if (this.toolBar != null) {
			this.toolBar.clear();
			this.toolBar.destroy(GLContext.getCurrentGL().getGL2());
		}
		ToolBar toolBar = new ToolBar("ToolBarRow", brick);
		toolBar.setPixelSizeY(0);
		ElementLayout spacingLayoutX = new ElementLayout("spacingLayoutX");
		spacingLayoutX.setPixelSizeX(SPACING_PIXELS);
		spacingLayoutX.setRatioSizeY(0);
		toolBar.append(spacingLayoutX);
		for (ElementLayout element : toolBarElements) {
			toolBar.append(element);
		}
		ElementLayout greedyXLayout = new ElementLayout("greedy");
		greedyXLayout.setGrabX(true);
		greedyXLayout.setRatioSizeY(0);
		toolBar.append(greedyXLayout);
		if (showClusterButton) {
			Button clusterButton = new Button(EPickingType.DIMENSION_GROUP_CLUSTER_BUTTON.name(), brick.getID(),
					EIconTextures.CLUSTER_ICON);
			ElementLayout clusterButtonLayout = new ElementLayout("clusterButton");
			clusterButtonLayout.setPixelSizeX(BUTTON_WIDTH_PIXELS);
			clusterButtonLayout.setPixelSizeY(BUTTON_HEIGHT_PIXELS);
			clusterButtonLayout
					.setRenderer(new ButtonRenderer.Builder(brick.getStratomex(), clusterButton)
							.textureManager(brick.getTextureManager()).zCoordinate(DefaultBrickLayoutTemplate.BUTTON_Z)
							.build());
			toolBar.append(clusterButtonLayout);
			toolBar.append(spacingLayoutX);
			brick.getStratomex().removeAllIDPickingListeners(EPickingType.DIMENSION_GROUP_CLUSTER_BUTTON.name(),
					brick.getID());
			brick.getStratomex().addIDPickingListener(new APickingListener() {
				@Override
				public void clicked(Pick pick) {
					Display.getDefault().asyncExec(new Runnable() {
						@Override
						public void run() {
							ClusterConfiguration clusterConfiguration = new ClusterConfiguration();
							TablePerspective oldTablePerspective = brick.getBrickColumn().getTablePerspective();
							clusterConfiguration.setSourceDimensionPerspective(oldTablePerspective
									.getDimensionPerspective());
							clusterConfiguration.setSourceRecordPerspective(oldTablePerspective.getRecordPerspective());
							ATableBasedDataDomain dataDomain = oldTablePerspective.getDataDomain();
							Perspective newRecordPerspective = new Perspective(dataDomain, dataDomain.getRecordIDType());
							newRecordPerspective.setVirtualArray(oldTablePerspective.getRecordPerspective()
									.getVirtualArray());
							clusterConfiguration.setOptionalTargetRecordPerspective(newRecordPerspective);
							ClusterDialog dialog = new ClusterDialog(new Shell(), brick.getDataDomain(),
									clusterConfiguration);
							if (dialog.open() == Window.OK) {
								dataDomain.getTable().registerRecordPerspective(newRecordPerspective);
								TablePerspective newTablePerspective = dataDomain.getTablePerspective(
										newRecordPerspective.getPerspectiveID(), oldTablePerspective
												.getDimensionPerspective().getPerspectiveID());
								ReplaceTablePerspectiveEvent rEvent = new ReplaceTablePerspectiveEvent(brick
										.getBrickColumn().getStratomexView().getID(), newTablePerspective,
										oldTablePerspective);
								GeneralManager.get().getEventPublisher().triggerEvent(rEvent);
							}
						}
					});
				}
			}, EPickingType.DIMENSION_GROUP_CLUSTER_BUTTON.name(), brick.getID());
		}
		brick.getStratomex().addIDPickingTooltipListener("Cluster", EPickingType.DIMENSION_GROUP_CLUSTER_BUTTON.name(),
				brick.getID());
		Button removeColumnButton = new Button(EPickingType.REMOVE_COLUMN_BUTTON.name(), brick.getID(),
				EIconTextures.REMOVE);
		ElementLayout removeColumnButtonLayout = new ElementLayout("removeColumnButton");
		removeColumnButtonLayout.setPixelSizeX(BUTTON_WIDTH_PIXELS);
		removeColumnButtonLayout.setPixelSizeY(BUTTON_HEIGHT_PIXELS);
		removeColumnButtonLayout.setRenderer(new ButtonRenderer.Builder(brick.getStratomex(), removeColumnButton)
				.textureManager(brick.getTextureManager()).zCoordinate(DefaultBrickLayoutTemplate.BUTTON_Z).build());
		toolBar.append(removeColumnButtonLayout);
		toolBar.append(spacingLayoutX);
		brick.getStratomex().removeAllIDPickingListeners(EPickingType.REMOVE_COLUMN_BUTTON.name(), brick.getID());
		brick.getStratomex().addIDPickingListener(new APickingListener() {
			@Override
			public void clicked(Pick pick) {
				Display.getDefault().asyncExec(new Runnable() {
					@Override
					public void run() {
						RemoveTablePerspectiveEvent event = new RemoveTablePerspectiveEvent(brick.getBrickColumn()
								.getTablePerspective(), brick.getStratomex());
						event.setSender(this);
						GeneralManager.get().getEventPublisher().triggerEvent(event);
					}
				});
			}
		}, EPickingType.REMOVE_COLUMN_BUTTON.name(), brick.getID());
		brick.getStratomex().addIDPickingTooltipListener("Remove column", EPickingType.REMOVE_COLUMN_BUTTON.name(),
				brick.getID());
		return toolBar;
	}

Output:
	protected ToolBar createToolBar() {
		if (this.toolBar != null) {
			this.toolBar.clear();
			this.toolBar.destroy(GLContext.getCurrentGL().getGL2());
		}
		ToolBar toolBar = new ToolBar("ToolBarRow", brick);
		toolBar.setPixelSizeY(0);
		ElementLayout spacingLayoutX = new ElementLayout("spacingLayoutX");
		spacingLayoutX.setPixelSizeX(SPACING_PIXELS);
		spacingLayoutX.setRatioSizeY(0);
		toolBar.append(spacingLayoutX);
		for (ElementLayout element : toolBarElements) {
			toolBar.append(element);
		}
		ElementLayout greedyXLayout = new ElementLayout("greedy");
		greedyXLayout.setGrabX(true);
		greedyXLayout.setRatioSizeY(0);
		toolBar.append(greedyXLayout);
		if (showClusterButton) {
			Button clusterButton = new Button(EPickingType.DIMENSION_GROUP_CLUSTER_BUTTON.name(), brick.getID(),
					EIconTextures.CLUSTER_ICON);
			ElementLayout clusterButtonLayout = new ElementLayout("clusterButton");
			clusterButtonLayout.setPixelSizeX(BUTTON_WIDTH_PIXELS);
			clusterButtonLayout.setPixelSizeY(BUTTON_HEIGHT_PIXELS);
			clusterButtonLayout
					.setRenderer(new ButtonRenderer.Builder(brick.getStratomex(), clusterButton)
							.textureManager(brick.getTextureManager()).zCoordinate(DefaultBrickLayoutTemplate.BUTTON_Z)
							.build());
			toolBar.append(clusterButtonLayout);
			toolBar.append(spacingLayoutX);
			brick.getStratomex().removeAllIDPickingListeners(EPickingType.DIMENSION_GROUP_CLUSTER_BUTTON.name(),
					brick.getID());
			brick.getStratomex().addIDPickingListener(new APickingListener() {
				@Override
				public void clicked(Pick pick) {
					Display.getDefault().asyncExec(new Runnable() {
						@Override
						public void run() {
							ClusterConfiguration clusterConfiguration = new ClusterConfiguration();
							TablePerspective oldTablePerspective = brick.getBrickColumn().getTablePerspective();
							clusterConfiguration.setSourceDimensionPerspective(oldTablePerspective
									.getDimensionPerspective());
							clusterConfiguration.setSourceRecordPerspective(oldTablePerspective.getRecordPerspective());
							ATableBasedDataDomain dataDomain = oldTablePerspective.getDataDomain();
							Perspective newRecordPerspective = new Perspective(dataDomain, dataDomain.getRecordIDType());
							newRecordPerspective.setLabel("Currently clustering...", false);
							newRecordPerspective.setVirtualArray(oldTablePerspective.getRecordPerspective()
									.getVirtualArray());
							clusterConfiguration.setOptionalTargetRecordPerspective(newRecordPerspective);
							ClusterDialog dialog = new ClusterDialog(new Shell(), brick.getDataDomain(),
									clusterConfiguration);
							if (dialog.open() == Window.OK) {
								dataDomain.getTable().registerRecordPerspective(newRecordPerspective);
								TablePerspective newTablePerspective = dataDomain.getTablePerspective(
										newRecordPerspective.getPerspectiveID(), oldTablePerspective
												.getDimensionPerspective().getPerspectiveID());
								ReplaceTablePerspectiveEvent rEvent = new ReplaceTablePerspectiveEvent(brick
										.getBrickColumn().getStratomexView().getID(), newTablePerspective,
										oldTablePerspective);
								GeneralManager.get().getEventPublisher().triggerEvent(rEvent);
							}
						}
					});
				}
			}, EPickingType.DIMENSION_GROUP_CLUSTER_BUTTON.name(), brick.getID());
		}
		brick.getStratomex().addIDPickingTooltipListener("Cluster", EPickingType.DIMENSION_GROUP_CLUSTER_BUTTON.name(),
				brick.getID());
		Button removeColumnButton = new Button(EPickingType.REMOVE_COLUMN_BUTTON.name(), brick.getID(),
				EIconTextures.REMOVE);
		ElementLayout removeColumnButtonLayout = new ElementLayout("removeColumnButton");
		removeColumnButtonLayout.setPixelSizeX(BUTTON_WIDTH_PIXELS);
		removeColumnButtonLayout.setPixelSizeY(BUTTON_HEIGHT_PIXELS);
		removeColumnButtonLayout.setRenderer(new ButtonRenderer.Builder(brick.getStratomex(), removeColumnButton)
				.textureManager(brick.getTextureManager()).zCoordinate(DefaultBrickLayoutTemplate.BUTTON_Z).build());
		toolBar.append(removeColumnButtonLayout);
		toolBar.append(spacingLayoutX);
		brick.getStratomex().removeAllIDPickingListeners(EPickingType.REMOVE_COLUMN_BUTTON.name(), brick.getID());
		brick.getStratomex().addIDPickingListener(new APickingListener() {
			@Override
			public void clicked(Pick pick) {
				Display.getDefault().asyncExec(new Runnable() {
					@Override
					public void run() {
						RemoveTablePerspectiveEvent event = new RemoveTablePerspectiveEvent(brick.getBrickColumn()
								.getTablePerspective(), brick.getStratomex());
						event.setSender(this);
						GeneralManager.get().getEventPublisher().triggerEvent(event);
					}
				});
			}
		}, EPickingType.REMOVE_COLUMN_BUTTON.name(), brick.getID());
		brick.getStratomex().addIDPickingTooltipListener("Remove column", EPickingType.REMOVE_COLUMN_BUTTON.name(),
				brick.getID());
		return toolBar;
	}


Input:
	public TreePage(PageParameters params) {
		super(params);
		final String path = WicketUtils.getPath(params);
		Repository r = getRepository();
		RevCommit commit = getCommit();
		List<PathModel> paths = JGitUtils.getFilesInPath(r, path, commit);
		add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class,
				WicketUtils.newPathParameter(repositoryName, objectId, path)));
		add(new BookmarkablePageLink<Void>("headLink", TreePage.class,
				WicketUtils.newPathParameter(repositoryName, Constants.HEAD, path)));
		add(new CompressedDownloadsPanel("compressedLinks", getRequest()
				.getRelativePathPrefixToContextRoot(), repositoryName, objectId, path));
		add(new CommitHeaderPanel("commitHeader", repositoryName, commit));
		add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, path, objectId));
		if (path != null && path.trim().length() > 0) {
			String parentPath = null;
			if (path.lastIndexOf('/') > -1) {
				parentPath = path.substring(0, path.lastIndexOf('/'));
			}
			PathModel model = new PathModel("..", parentPath, 0, FileMode.TREE.getBits(), null, objectId);
			model.isParentPath = true;
			paths.add(0, model);
		}
		final ByteFormat byteFormat = new ByteFormat();
		final String baseUrl = WicketUtils.getGitblitURL(getRequest());
		ListDataProvider<PathModel> pathsDp = new ListDataProvider<PathModel>(paths);
		DataView<PathModel> pathsView = new DataView<PathModel>("changedPath", pathsDp) {
			private static final long serialVersionUID = 1L;
			int counter;
			public void populateItem(final Item<PathModel> item) {
				PathModel entry = item.getModelObject();
				item.add(new Label("pathPermissions", JGitUtils.getPermissionsFromMode(entry.mode)));
				if (entry.isParentPath) {
					item.add(WicketUtils.newBlankImage("pathIcon"));
					item.add(new Label("pathSize", ""));
					item.add(new LinkPanel("pathName", null, entry.name, TreePage.class,
							WicketUtils
									.newPathParameter(repositoryName, entry.commitId, entry.path)));
					item.add(new Label("pathLinks", ""));
				} else {
					if (entry.isTree()) {
						item.add(WicketUtils.newImage("pathIcon", "folder_16x16.png"));
						item.add(new Label("pathSize", ""));
						item.add(new LinkPanel("pathName", "list", entry.name, TreePage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										entry.path)));
						Fragment links = new Fragment("pathLinks", "treeLinks", this);
						links.add(new BookmarkablePageLink<Void>("tree", TreePage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										entry.path)));
						links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										entry.path)));
						links.add(new CompressedDownloadsPanel("compressedLinks", baseUrl,
								repositoryName, objectId, entry.path));
						item.add(links);
					} else if (entry.isSubmodule()) {
						String submoduleId = entry.objectId;
						String submodulePath;
						boolean hasSubmodule = false;
						SubmoduleModel submodule = getSubmodule(entry.path);
						submodulePath = submodule.gitblitPath;
						hasSubmodule = submodule.hasSubmodule;
						item.add(WicketUtils.newImage("pathIcon", "git-orange-16x16.png"));
						item.add(new Label("pathSize", ""));
						item.add(new LinkPanel("pathName", "list", entry.name + " @ " +
								getShortObjectId(submoduleId), TreePage.class,
								WicketUtils.newPathParameter(submodulePath, submoduleId, "")).setEnabled(hasSubmodule));
						Fragment links = new Fragment("pathLinks", "submoduleLinks", this);
						links.add(new BookmarkablePageLink<Void>("view", SummaryPage.class,
								WicketUtils.newRepositoryParameter(submodulePath)).setEnabled(hasSubmodule));
						links.add(new BookmarkablePageLink<Void>("tree", TreePage.class,
								WicketUtils.newPathParameter(submodulePath, submoduleId,
										"")).setEnabled(hasSubmodule));
						links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
								WicketUtils.newPathParameter(submodulePath, submoduleId,
										"")).setEnabled(hasSubmodule));
						links.add(new CompressedDownloadsPanel("compressedLinks", baseUrl,
								submodulePath, submoduleId, "").setEnabled(hasSubmodule));
						item.add(links);
					} else {
						String displayPath = entry.path;
						String path = entry.path;
						if (entry.isSymlink()) {
							path = JGitUtils.getStringContent(getRepository(), getCommit().getTree(), path);
							displayPath = entry.path + " -> " + path;
						}
						item.add(WicketUtils.getFileImage("pathIcon", entry.name));
						item.add(new Label("pathSize", byteFormat.format(entry.size)));
						item.add(new LinkPanel("pathName", "list", displayPath, BlobPage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										path)));
						Fragment links = new Fragment("pathLinks", "blobLinks", this);
						links.add(new BookmarkablePageLink<Void>("view", BlobPage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										path)));
						links.add(new BookmarkablePageLink<Void>("raw", RawPage.class, WicketUtils
								.newPathParameter(repositoryName, entry.commitId, path)));
						links.add(new BookmarkablePageLink<Void>("blame", BlamePage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										path)));
						links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										path)));
						item.add(links);
					}
				}
				WicketUtils.setAlternatingBackground(item, counter);
				counter++;
			}
		};
		add(pathsView);
	}

Output:
	public TreePage(PageParameters params) {
		super(params);
		final String path = WicketUtils.getPath(params);
		Repository r = getRepository();
		RevCommit commit = getCommit();
		List<PathModel> paths = JGitUtils.getFilesInPath(r, path, commit);
		add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class,
				WicketUtils.newPathParameter(repositoryName, objectId, path)));
		add(new BookmarkablePageLink<Void>("headLink", TreePage.class,
				WicketUtils.newPathParameter(repositoryName, Constants.HEAD, path)));
		add(new CompressedDownloadsPanel("compressedLinks", getRequest()
				.getRelativePathPrefixToContextRoot(), repositoryName, objectId, path));
		add(new CommitHeaderPanel("commitHeader", repositoryName, commit));
		add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, path, objectId));
		if (path != null && path.trim().length() > 0) {
			String parentPath = null;
			if (path.lastIndexOf('/') > -1) {
				parentPath = path.substring(0, path.lastIndexOf('/'));
			}
			PathModel model = new PathModel("..", parentPath, 0, FileMode.TREE.getBits(), null, objectId);
			model.isParentPath = true;
			paths.add(0, model);
		}
		final ByteFormat byteFormat = new ByteFormat();
		final String baseUrl = WicketUtils.getGitblitURL(getRequest());
		ListDataProvider<PathModel> pathsDp = new ListDataProvider<PathModel>(paths);
		DataView<PathModel> pathsView = new DataView<PathModel>("changedPath", pathsDp) {
			private static final long serialVersionUID = 1L;
			int counter;
			public void populateItem(final Item<PathModel> item) {
				PathModel entry = item.getModelObject();
				item.add(new Label("pathPermissions", JGitUtils.getPermissionsFromMode(entry.mode)));
				if (entry.isParentPath) {
					item.add(WicketUtils.newBlankImage("pathIcon"));
					item.add(new Label("pathSize", ""));
					item.add(new LinkPanel("pathName", null, entry.name, TreePage.class,
							WicketUtils
									.newPathParameter(repositoryName, entry.commitId, entry.path)));
					item.add(new Label("pathLinks", ""));
				} else {
					if (entry.isTree()) {
						item.add(WicketUtils.newImage("pathIcon", "folder_16x16.png"));
						item.add(new Label("pathSize", ""));
						item.add(new LinkPanel("pathName", "list", entry.name, TreePage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										entry.path)));
						Fragment links = new Fragment("pathLinks", "treeLinks", this);
						links.add(new BookmarkablePageLink<Void>("tree", TreePage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										entry.path)));
						links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										entry.path)));
						links.add(new CompressedDownloadsPanel("compressedLinks", baseUrl,
								repositoryName, objectId, entry.path));
						item.add(links);
					} else if (entry.isSubmodule()) {
						String submoduleId = entry.objectId;
						String submodulePath;
						boolean hasSubmodule = false;
						SubmoduleModel submodule = getSubmodule(entry.path);
						submodulePath = submodule.gitblitPath;
						hasSubmodule = submodule.hasSubmodule;
						item.add(WicketUtils.newImage("pathIcon", "git-orange-16x16.png"));
						item.add(new Label("pathSize", ""));
						item.add(new LinkPanel("pathName", "list", entry.name + " @ " +
								getShortObjectId(submoduleId), TreePage.class,
								WicketUtils.newPathParameter(submodulePath, submoduleId, "")).setEnabled(hasSubmodule));
						Fragment links = new Fragment("pathLinks", "submoduleLinks", this);
						links.add(new BookmarkablePageLink<Void>("view", SummaryPage.class,
								WicketUtils.newRepositoryParameter(submodulePath)).setEnabled(hasSubmodule));
						links.add(new BookmarkablePageLink<Void>("tree", TreePage.class,
								WicketUtils.newPathParameter(submodulePath, submoduleId,
										"")).setEnabled(hasSubmodule));
						links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
								WicketUtils.newPathParameter(submodulePath, submoduleId,
										"")).setEnabled(hasSubmodule));
						links.add(new CompressedDownloadsPanel("compressedLinks", baseUrl,
								submodulePath, submoduleId, "").setEnabled(hasSubmodule));
						item.add(links);
					} else {
						String displayPath = entry.name;
						String path = entry.path;
						if (entry.isSymlink()) {
							path = JGitUtils.getStringContent(getRepository(), getCommit().getTree(), path);
							displayPath = entry.name + " -> " + path;
						}
						item.add(WicketUtils.getFileImage("pathIcon", entry.name));
						item.add(new Label("pathSize", byteFormat.format(entry.size)));
						item.add(new LinkPanel("pathName", "list", displayPath, BlobPage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										path)));
						Fragment links = new Fragment("pathLinks", "blobLinks", this);
						links.add(new BookmarkablePageLink<Void>("view", BlobPage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										path)));
						links.add(new BookmarkablePageLink<Void>("raw", RawPage.class, WicketUtils
								.newPathParameter(repositoryName, entry.commitId, path)));
						links.add(new BookmarkablePageLink<Void>("blame", BlamePage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										path)));
						links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
								WicketUtils.newPathParameter(repositoryName, entry.commitId,
										path)));
						item.add(links);
					}
				}
				WicketUtils.setAlternatingBackground(item, counter);
				counter++;
			}
		};
		add(pathsView);
	}