Input:
	public void characters(char ch[], int start, int length) throws SAXException {
		if (!parsingLoansOrRequests) {
			if (circulationStatusReached) {
				currentAlephItem.setCirculationStatus(new String(ch, start, length));
				circulationStatusReached = false;
			} else if (holdQueueLengthReached) {
				currentAlephItem.setHoldQueueLength(Integer.parseInt(new String(ch, start, length)));
				holdQueueLengthReached = false;
			} else if (itemDesrciptionReached) {
				currentAlephItem.setDescription(new String(ch, start, length));
				itemDesrciptionReached = false;
			} else if (docNoReached) {
				currentAlephItem.setDocNumber(new String(ch, start, length));
				docNoReached = false;
			} else if (itemSequenceReached) {
				currentAlephItem.setItemSeqNumber(new String(ch, start, length));
				itemSequenceReached = false;
			} else if (locationReached) {
				currentAlephItem.setLocation(new String(ch, start, length));
				locationReached = false;
			} else if (openDateReached) {
				currentAlephItem.setPublicationDate(new String(ch, start, length));
				openDateReached = false;
			} else if (callNoReached) {
				currentAlephItem.setCallNumber(new String(ch, start, length));
				callNoReached = false;
			} else if (secondCallNoTypeReached) {
				secondCallNoType = new String(ch, start, length);
				secondCallNoTypeReached = false;
			} else if (secondCallNoReached) {
				if (secondCallNoType != null && !secondCallNoType.equalsIgnoreCase("9"))
					currentAlephItem.setCallNumber(new String(ch, start, length));
				else if (secondCallNoType == null)
					currentAlephItem.setCallNumber(new String(ch, start, length));
				secondCallNoReached = false;
			} else if (copyNoReached) {
				currentAlephItem.setCopyNumber(new String(ch, start, length));
				copyNoReached = false;
			} else if (barcodeReached) {
				currentAlephItem.setBarcode(new String(ch, start, length));
				barcodeReached = false;
			} else if (materialReached) {
				currentAlephItem.setMediumType(new String(ch, start, length));
				materialReached = false;
			} else if (agencyReached) {
				currentAlephItem.setAgency(new String(ch, start, length));
				agencyReached = false;
			} else if (collectionReached) {
				currentAlephItem.setCollection(new String(ch, start, length));
				collectionReached = false;
			} else if (bibDescriptionDesired) {
				if (authorReached) {
					currentAlephItem.setAuthor(new String(ch, start, length));
					authorReached = false;
				} else if (isbnReached) {
					currentAlephItem.setIsbn(new String(ch, start, length));
					isbnReached = false;
				} else if (titleReached) {
					currentAlephItem.setTitle(new String(ch, start, length));
					titleReached = false;
				} else if (publisherReached) {
					currentAlephItem.setPublisher(new String(ch, start, length));
					publisherReached = false;
				} else if (bibIdReached) {
					currentAlephItem.setBibId(new String(ch, start, length));
					bibIdReached = false;
				}
			}
		} else {
			if (materialReached) {
				String mediumTypeParsed = new String(ch, start, length);
				MediumType mediumType = AlephUtil.detectMediumType(mediumTypeParsed);
				bibliographicDescription.setMediumType(mediumType);
				materialReached = false;
			} else if (authorReached) {
				bibliographicDescription.setAuthor(new String(ch, start, length));
				authorReached = false;
			} else if (isbnReached) {
				bibliographicDescription.setBibliographicLevel(null);
				isbnReached = false;
			} else if (titleReached) {
				bibliographicDescription.setTitle(new String(ch, start, length));
				titleReached = false;
			} else if (publisherReached) {
				bibliographicDescription.setPublisher(new String(ch, start, length));
				publisherReached = false;
			} else if (bibIdReached) {
				String parsedBibId = new String(ch, start, length);
				docNumber = parsedBibId;
				List<BibliographicItemId> bibliographicItemIds = new ArrayList<BibliographicItemId>();
				BibliographicItemId bibId = new BibliographicItemId();
				bibId.setBibliographicItemIdentifier(parsedBibId);
				bibId.setBibliographicItemIdentifierCode(Version1BibliographicItemIdentifierCode.URI);
				bibliographicItemIds.add(bibId);
				bibliographicDescription.setBibliographicItemIds(bibliographicItemIds);
				bibIdReached = false;
			} else if (itemSequenceReached) {
				itemSequence = new String(ch, start, length);
				itemSequenceReached = false;
			} else if (loansHandling) {
				if (dueDateReached) {
					String dateDueParsed = new String(ch, start, length);
					GregorianCalendar dateDue = AlephUtil.parseGregorianCalendarFromAlephDate(dateDueParsed);
					currentLoanedItem.setDateDue(dateDue);
					dueDateReached = false;
				} else if (loanDateReached) {
					String loanDateParsed = new String(ch, start, length);
					GregorianCalendar loanDate = AlephUtil.parseGregorianCalendarFromAlephDate(loanDateParsed);
					currentLoanedItem.setDateCheckedOut(loanDate);
					loanDateReached = false;
				}
			} else if (holdRequestsHandling) {
				if (datePlacedReached) {
					String datePlacedParsed = new String(ch, start, length);
					GregorianCalendar datePlaced = AlephUtil.parseGregorianCalendarFromAlephDate(datePlacedParsed);
					currentLoanedItem.setDateCheckedOut(datePlaced);
					datePlacedReached = false;
				} else if (hourPlacedReached) {
					String hourPlacedParsed = new String(ch, start, length);
					if (!hourPlacedParsed.equalsIgnoreCase("00000000")) {
						GregorianCalendar datePlaced = currentRequestedItem.getDatePlaced();
						GregorianCalendar hourPlaced = new GregorianCalendar(localTimeZone);
						try {
							hourPlaced.setTime(AlephConstants.ALEPH_HOUR_FORMATTER.parse(hourPlacedParsed));
						} catch (ParseException e) {
							e.printStackTrace();
						}
						datePlaced.add(Calendar.HOUR_OF_DAY, hourPlaced.get(Calendar.HOUR_OF_DAY) - 1);
						datePlaced.add(Calendar.MINUTE, hourPlaced.get(Calendar.MINUTE));
						currentRequestedItem.setDatePlaced(datePlaced);
					}
					hourPlacedReached = false;
				} else if (earliestDateNeededReached) {
					String earliestDateNeededParsed = new String(ch, start, length);
					GregorianCalendar earliestDateNeeded = AlephUtil.parseGregorianCalendarFromAlephDate(earliestDateNeededParsed);
					currentLoanedItem.setDateCheckedOut(earliestDateNeeded);
					earliestDateNeededReached = false;
				} else if (needBeforeDateReached) {
					String needBeforeDateParsed = new String(ch, start, length);
					GregorianCalendar needBeforeDate = AlephUtil.parseGregorianCalendarFromAlephDate(needBeforeDateParsed);
					currentLoanedItem.setDateCheckedOut(needBeforeDate);
					needBeforeDateReached = false;
				} else if (holdQueueLengthReached) {
					currentRequestedItem.setHoldQueueLength(new BigDecimal(new String(ch, start, length)));
					holdQueueLengthReached = false;
				} else if (pickupLocationReached) {
					PickupLocation pickupLocation = new PickupLocation(new String(ch, start, length));
					currentRequestedItem.setPickupLocation(pickupLocation);
					pickupLocationReached = false;
				} else if (pickupExpiryDateReached) {
					String pickupExpiryDateParsed = new String(ch, start, length);
					GregorianCalendar pickupExpiryDate = AlephUtil.parseGregorianCalendarFromAlephDate(pickupExpiryDateParsed);
					currentLoanedItem.setDateCheckedOut(pickupExpiryDate);
					pickupExpiryDateReached = false;
				} else if (reminderLevelReached) {
					currentRequestedItem.setReminderLevel(new BigDecimal(new String(ch, start, length)));
					reminderLevelReached = false;
				} else if (requestIdReached) {
					RequestId requestId = new RequestId();
					requestId.setRequestIdentifierValue(new String(ch, start, length));
					currentRequestedItem.setRequestId(requestId);
					requestIdReached = false;
				} else if (requestTypeReached) {
					RequestType requestType = null;
					String parsedValue = new String(ch, start, length);
					if (parsedValue == "30")
						requestType = Version1RequestType.LOAN;
					else
						requestType = Version1RequestType.ESTIMATE;
					currentRequestedItem.setRequestType(requestType);
					requestTypeReached = false;
				} else if (pickupDateReached) {
					String pickupDateParsed = new String(ch, start, length);
					GregorianCalendar pickupDate = AlephUtil.parseGregorianCalendarFromAlephDate(pickupDateParsed);
					currentLoanedItem.setDateCheckedOut(pickupDate);
					pickupDateReached = false;
				} else if (statusReached) {
					String parsedStatus = new String(ch, start, length);
					RequestStatusType requestStatusType;
					if (parsedStatus == "S")
						requestStatusType = Version1RequestStatusType.AVAILABLE_FOR_PICKUP;
					else
						requestStatusType = Version1RequestStatusType.IN_PROCESS;
					currentRequestedItem.setRequestStatusType(requestStatusType);
					statusReached = false;
				}
			}
		}
	}

Output:
	public void characters(char ch[], int start, int length) throws SAXException {
		if (!parsingLoansOrRequests) {
			if (circulationStatusReached) {
				currentAlephItem.setCirculationStatus(new String(ch, start, length));
				circulationStatusReached = false;
			} else if (holdQueueLengthReached) {
				currentAlephItem.setHoldQueueLength(Integer.parseInt(new String(ch, start, length)));
				holdQueueLengthReached = false;
			} else if (itemDesrciptionReached) {
				currentAlephItem.setDescription(new String(ch, start, length));
				itemDesrciptionReached = false;
			} else if (docNoReached) {
				currentAlephItem.setDocNumber(new String(ch, start, length));
				docNoReached = false;
			} else if (itemSequenceReached) {
				currentAlephItem.setItemSeqNumber(new String(ch, start, length));
				itemSequenceReached = false;
			} else if (locationReached) {
				currentAlephItem.setLocation(new String(ch, start, length));
				locationReached = false;
			} else if (openDateReached) {
				currentAlephItem.setPublicationDate(new String(ch, start, length));
				openDateReached = false;
			} else if (callNoReached) {
				currentAlephItem.setCallNumber(new String(ch, start, length));
				callNoReached = false;
			} else if (secondCallNoTypeReached) {
				secondCallNoType = new String(ch, start, length);
				secondCallNoTypeReached = false;
			} else if (secondCallNoReached) {
				if (secondCallNoType != null && !secondCallNoType.equalsIgnoreCase("9"))
					currentAlephItem.setCallNumber(new String(ch, start, length));
				else if (secondCallNoType == null)
					currentAlephItem.setCallNumber(new String(ch, start, length));
				secondCallNoReached = false;
			} else if (copyNoReached) {
				currentAlephItem.setCopyNumber(new String(ch, start, length));
				copyNoReached = false;
			} else if (barcodeReached) {
				currentAlephItem.setBarcode(new String(ch, start, length));
				barcodeReached = false;
			} else if (materialReached) {
				currentAlephItem.setMediumType(new String(ch, start, length));
				materialReached = false;
			} else if (agencyReached) {
				currentAlephItem.setAgency(new String(ch, start, length));
				agencyReached = false;
			} else if (collectionReached) {
				currentAlephItem.setCollection(new String(ch, start, length));
				collectionReached = false;
			} else if (bibDescriptionDesired) {
				if (authorReached) {
					currentAlephItem.setAuthor(new String(ch, start, length));
					authorReached = false;
				} else if (isbnReached) {
					currentAlephItem.setIsbn(new String(ch, start, length));
					isbnReached = false;
				} else if (titleReached) {
					currentAlephItem.setTitle(new String(ch, start, length));
					titleReached = false;
				} else if (publisherReached) {
					currentAlephItem.setPublisher(new String(ch, start, length));
					publisherReached = false;
				} else if (bibIdReached) {
					currentAlephItem.setBibId(new String(ch, start, length));
					bibIdReached = false;
				}
			}
		} else {
			if (materialReached) {
				String mediumTypeParsed = new String(ch, start, length);
				MediumType mediumType = AlephUtil.detectMediumType(mediumTypeParsed);
				bibliographicDescription.setMediumType(mediumType);
				materialReached = false;
			} else if (authorReached) {
				bibliographicDescription.setAuthor(new String(ch, start, length));
				authorReached = false;
			} else if (isbnReached) {
				bibliographicDescription.setBibliographicLevel(null);
				isbnReached = false;
			} else if (titleReached) {
				bibliographicDescription.setTitle(new String(ch, start, length));
				titleReached = false;
			} else if (publisherReached) {
				bibliographicDescription.setPublisher(new String(ch, start, length));
				publisherReached = false;
			} else if (bibIdReached) {
				String parsedBibId = new String(ch, start, length);
				docNumber = parsedBibId;
				List<BibliographicItemId> bibliographicItemIds = new ArrayList<BibliographicItemId>();
				BibliographicItemId bibId = new BibliographicItemId();
				bibId.setBibliographicItemIdentifier(parsedBibId);
				bibId.setBibliographicItemIdentifierCode(Version1BibliographicItemIdentifierCode.URI);
				bibliographicItemIds.add(bibId);
				bibliographicDescription.setBibliographicItemIds(bibliographicItemIds);
				bibIdReached = false;
			} else if (itemSequenceReached) {
				itemSequence = new String(ch, start, length);
				itemSequenceReached = false;
			} else if (loansHandling) {
				if (dueDateReached) {
					String dateDueParsed = new String(ch, start, length);
					GregorianCalendar dateDue = AlephUtil.parseGregorianCalendarFromAlephDate(dateDueParsed);
					currentLoanedItem.setDateDue(dateDue);
					dueDateReached = false;
				} else if (loanDateReached) {
					String loanDateParsed = new String(ch, start, length);
					GregorianCalendar loanDate = AlephUtil.parseGregorianCalendarFromAlephDate(loanDateParsed);
					currentLoanedItem.setDateCheckedOut(loanDate);
					loanDateReached = false;
				}
			} else if (holdRequestsHandling) {
				if (datePlacedReached) {
					String datePlacedParsed = new String(ch, start, length);
					GregorianCalendar datePlaced = AlephUtil.parseGregorianCalendarFromAlephDate(datePlacedParsed);
					currentRequestedItem.setDatePlaced(datePlaced);
					datePlacedReached = false;
				} else if (hourPlacedReached) {
					String hourPlacedParsed = new String(ch, start, length);
					if (!hourPlacedParsed.equalsIgnoreCase("00000000")) {
						GregorianCalendar datePlaced = currentRequestedItem.getDatePlaced();
						GregorianCalendar hourPlaced = new GregorianCalendar(localTimeZone);
						try {
							hourPlaced.setTime(AlephConstants.ALEPH_HOUR_FORMATTER.parse(hourPlacedParsed));
						} catch (ParseException e) {
							e.printStackTrace();
						}
						datePlaced.add(Calendar.HOUR_OF_DAY, hourPlaced.get(Calendar.HOUR_OF_DAY) - 1);
						datePlaced.add(Calendar.MINUTE, hourPlaced.get(Calendar.MINUTE));
						currentRequestedItem.setDatePlaced(datePlaced);
					}
					hourPlacedReached = false;
				} else if (earliestDateNeededReached) {
					String earliestDateNeededParsed = new String(ch, start, length);
					GregorianCalendar earliestDateNeeded = AlephUtil.parseGregorianCalendarFromAlephDate(earliestDateNeededParsed);
					currentRequestedItem.setEarliestDateNeeded(earliestDateNeeded);
					earliestDateNeededReached = false;
				} else if (needBeforeDateReached) {
					String needBeforeDateParsed = new String(ch, start, length);
					GregorianCalendar needBeforeDate = AlephUtil.parseGregorianCalendarFromAlephDate(needBeforeDateParsed);
					currentRequestedItem.setNeedBeforeDate(needBeforeDate);
					needBeforeDateReached = false;
				} else if (holdQueueLengthReached) {
					currentRequestedItem.setHoldQueueLength(new BigDecimal(new String(ch, start, length)));
					holdQueueLengthReached = false;
				} else if (pickupLocationReached) {
					PickupLocation pickupLocation = new PickupLocation(new String(ch, start, length));
					currentRequestedItem.setPickupLocation(pickupLocation);
					pickupLocationReached = false;
				} else if (pickupExpiryDateReached) {
					String pickupExpiryDateParsed = new String(ch, start, length);
					GregorianCalendar pickupExpiryDate = AlephUtil.parseGregorianCalendarFromAlephDate(pickupExpiryDateParsed);
					currentRequestedItem.setPickupExpiryDate(pickupExpiryDate);
					pickupExpiryDateReached = false;
				} else if (reminderLevelReached) {
					currentRequestedItem.setReminderLevel(new BigDecimal(new String(ch, start, length)));
					reminderLevelReached = false;
				} else if (requestIdReached) {
					RequestId requestId = new RequestId();
					requestId.setRequestIdentifierValue(new String(ch, start, length));
					currentRequestedItem.setRequestId(requestId);
					requestIdReached = false;
				} else if (requestTypeReached) {
					RequestType requestType = null;
					String parsedValue = new String(ch, start, length);
					if (parsedValue == "30")
						requestType = Version1RequestType.LOAN;
					else
						requestType = Version1RequestType.ESTIMATE;
					currentRequestedItem.setRequestType(requestType);
					requestTypeReached = false;
				} else if (pickupDateReached) {
					String pickupDateParsed = new String(ch, start, length);
					GregorianCalendar pickupDate = AlephUtil.parseGregorianCalendarFromAlephDate(pickupDateParsed);
					currentRequestedItem.setPickupDate(pickupDate);
					pickupDateReached = false;
				} else if (statusReached) {
					String parsedStatus = new String(ch, start, length);
					RequestStatusType requestStatusType;
					if (parsedStatus == "S")
						requestStatusType = Version1RequestStatusType.AVAILABLE_FOR_PICKUP;
					else
						requestStatusType = Version1RequestStatusType.IN_PROCESS;
					currentRequestedItem.setRequestStatusType(requestStatusType);
					statusReached = false;
				}
			}
		}
	}


Input:
	public synchronized void executeMojo() throws MojoExecutionException {
		if ("pom".equalsIgnoreCase(this.mavenProject.getPackaging())) {
			String key = ArtifactUtils.key(this.mavenProject.getGroupId(), this.mavenProject.getArtifactId(), this.mavenProject.getVersion());
			info("Ignoring project ",
					key, " because it is a source-less project.");
			return;
		}
		File classesDirectory = new File(getOutputDirectory(), CLASSES_DIR);
		File metainfDirectory = new File(classesDirectory, METAINF_DIR);
		File licenseDirectory = new File(metainfDirectory, LICENSE_DIR);
		licenseDirectory.mkdirs();
		Set<License> coreInstalled = new HashSet<License>();
		License lic;
		URL resource;
		String filename;
		File licFile;
		Map<String, License> includedLicenses = new HashMap<String,License>();
		Pattern re1 = Pattern.compile("^([^:]+):(.+):(.+)$");
		Pattern re2 = Pattern.compile("^([^:]+):(.+)$");
		if (this.thirdPartyLicenses != null) {
			for (String tpl : this.thirdPartyLicenses) {
				Matcher matcher = re1.matcher(tpl);
				if (matcher.matches()) {
					String l = matcher.group(1);
					String f = matcher.group(2);
					lic = License.parse(l, null);
					if (lic != null) {
						StringBuilder sb = new StringBuilder();
						sb.append(this.name);
						sb.append("_");
						String b = f.replaceAll("[/\\:]", ".");
						b = b.replaceAll("^\\.", "");
						sb.append(b);
						includedLicenses.put(sb.toString(), lic);
					}
				}
				else {
					matcher = re2.matcher(tpl);
					if (matcher.matches()) {
						String l = matcher.group(1);
						String g = matcher.group(2);
						String a = matcher.group(3);
						lic = License.parse(l, null);
						if (lic != null) {
							String depName = "mvndep_"+g+"_"+a;
							includedLicenses.put(depName, lic);
						}
					}
				}
			}
		}
		try {
			for (String license : this.licenses) {
				lic = License.parse(license, License.GPLv3);
				if (!coreInstalled.contains(lic)) {
					resource = lic.getFullTextResource();
					if (resource != null) {
						filename = LICENSE_FILENAME_PATTERN.replaceAll("%s", this.name);
						filename = filename.replaceAll("%l", lic.name());
						info("Installing license: ",
								lic.getLicenseName(), ", into ",
								filename);
						licFile = new File(licenseDirectory, filename);
						fileCopy(resource, licFile);
						coreInstalled.add(lic);
					} else {
						throw new MojoExecutionException("Unable to find the full text of the license: " + lic.getLicenseName());
					}
				}
			}
			for (Entry<String, License> licenseMap : includedLicenses.entrySet()) {
				lic = licenseMap.getValue();
				resource = lic.getFullTextResource();
				if (resource != null) {
					filename = LICENSE_FILENAME_PATTERN.replaceAll("%s", licenseMap.getKey());
					filename = filename.replaceAll("%l", lic.name());
					info("Installing included source code license: ",
							lic.getLicenseName(), ", into ",
							filename);
					licFile = new File(licenseDirectory, filename);
					fileCopy(resource, licFile);
				} else {
					throw new MojoExecutionException("Unable to find the full text of the license: " + lic.getLicenseName());
				}
			}
			filename = NOTICE_FILENAME_PATTERN.replaceAll("%s", this.name);
			info("Installing license notice: ",
					filename);
			StringBuilder addParts = new StringBuilder();
			for (Entry<String, License> licenseMap : includedLicenses.entrySet()) {
				lic = licenseMap.getValue();
				if (lic != null) {
					String s = getLString(InstallLicenseMojo.class, "NOTICE_SENTENCE",
							lic.getLicenseName(), licenseMap.getKey());
					addParts.append(s);
				}
			}
			StringBuilder fullLicenseText = new StringBuilder();
			int n = 0;
			for (License l : coreInstalled) {
				if (n > 0) {
					if (n == coreInstalled.size() - 1) {
						fullLicenseText.append(getLString(InstallLicenseMojo.class, "AND"));
					} else {
						fullLicenseText.append(getLString(InstallLicenseMojo.class, "COMMA"));
					}
				}
				fullLicenseText.append(l.getLicenseName());
				++n;
			}
			String noticeText = getLString(InstallLicenseMojo.class, "NOTICE_TEXT",
					this.name, this.copyrightDates, this.copyrighters, fullLicenseText.toString(), addParts.toString());
			File noticeFile = new File(metainfDirectory, filename);
			FileWriter fileWriter = new FileWriter(noticeFile);
			try {
				fileWriter.write(noticeText);
			}
			finally {
				fileWriter.close();
			}
			filename = AUTHOR_FILENAME_PATTERN.replaceAll("%s", this.name);
			info("Installing authors: ",
					filename);
			StringBuilder authorsText = new StringBuilder();
			if (this.projectURL != null) {
				authorsText.append(getLString(InstallLicenseMojo.class, "AUTHOR_INTRO", this.projectURL.toExternalForm()));
			} else {
				authorsText.append(getLString(InstallLicenseMojo.class, "AUTHOR_INTRO", ""));
			}
			authorsText.append("\n\n");
			authorsText.append(getLString(InstallLicenseMojo.class, "DEVELOPER_TITLE", this.name));
			authorsText.append("\n\n");
			for (Developer developer : this.mavenProject.getDevelopers()) {
				authorsText.append(getLString(InstallLicenseMojo.class, "DEVELOPER",
						developer.getName(), developer.getEmail()));
				authorsText.append("\n");
			}
			authorsText.append("\n\n\n");
			authorsText.append(getLString(InstallLicenseMojo.class, "CONTRIBUTOR_TITLE", this.name));
			authorsText.append("\n\n");
			for (Contributor contributor : this.mavenProject.getContributors()) {
				authorsText.append(getLString(InstallLicenseMojo.class, "DEVELOPER",
						contributor.getName(), contributor.getEmail()));
				authorsText.append("\n");
			}
			File authorFile = new File(metainfDirectory, filename);
			fileWriter = new FileWriter(authorFile);
			try {
				fileWriter.write(authorsText.toString());
			}
			finally {
				fileWriter.close();
			}
		}
		catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

Output:
	public synchronized void executeMojo() throws MojoExecutionException {
		if ("pom".equalsIgnoreCase(this.mavenProject.getPackaging())) {
			String key = ArtifactUtils.key(this.mavenProject.getGroupId(), this.mavenProject.getArtifactId(), this.mavenProject.getVersion());
			info("Ignoring project ",
					key, " because it is a source-less project.");
			return;
		}
		File classesDirectory = new File(getOutputDirectory(), CLASSES_DIR);
		File metainfDirectory = new File(classesDirectory, METAINF_DIR);
		File licenseDirectory = new File(metainfDirectory, LICENSE_DIR);
		licenseDirectory.mkdirs();
		Set<License> coreInstalled = new HashSet<License>();
		License lic;
		URL resource;
		String filename;
		File licFile;
		Map<String, License> includedLicenses = new HashMap<String,License>();
		Pattern re1 = Pattern.compile("^([^:]+):(.+):(.+)$");
		Pattern re2 = Pattern.compile("^([^:]+):(.+)$");
		if (this.thirdPartyLicenses != null) {
			for (String tpl : this.thirdPartyLicenses) {
				Matcher matcher = re1.matcher(tpl);
				if (matcher.matches()) {
					String l = matcher.group(1);
					String g = matcher.group(2);
					String a = matcher.group(3);
					lic = License.parse(l, null);
					if (lic != null) {
						String depName = "mvndep_"+g+"_"+a;
						includedLicenses.put(depName, lic);
					}
				}
				else {
					matcher = re2.matcher(tpl);
					if (matcher.matches()) {
						String l = matcher.group(1);
						String f = matcher.group(2);
						lic = License.parse(l, null);
						if (lic != null) {
							StringBuilder sb = new StringBuilder();
							sb.append(this.name);
							sb.append("_");
							String b = f.replaceAll("[/\\:]", ".");
							b = b.replaceAll("^\\.", "");
							sb.append(b);
							includedLicenses.put(sb.toString(), lic);
						}
					}
				}
			}
		}
		try {
			for (String license : this.licenses) {
				lic = License.parse(license, License.GPLv3);
				if (!coreInstalled.contains(lic)) {
					resource = lic.getFullTextResource();
					if (resource != null) {
						filename = LICENSE_FILENAME_PATTERN.replaceAll("%s", this.name);
						filename = filename.replaceAll("%l", lic.name());
						info("Installing license: ",
								lic.getLicenseName(), ", into ",
								filename);
						licFile = new File(licenseDirectory, filename);
						fileCopy(resource, licFile);
						coreInstalled.add(lic);
					} else {
						throw new MojoExecutionException("Unable to find the full text of the license: " + lic.getLicenseName());
					}
				}
			}
			for (Entry<String, License> licenseMap : includedLicenses.entrySet()) {
				lic = licenseMap.getValue();
				resource = lic.getFullTextResource();
				if (resource != null) {
					filename = LICENSE_FILENAME_PATTERN.replaceAll("%s", licenseMap.getKey());
					filename = filename.replaceAll("%l", lic.name());
					info("Installing included source code license: ",
							lic.getLicenseName(), ", into ",
							filename);
					licFile = new File(licenseDirectory, filename);
					fileCopy(resource, licFile);
				} else {
					throw new MojoExecutionException("Unable to find the full text of the license: " + lic.getLicenseName());
				}
			}
			filename = NOTICE_FILENAME_PATTERN.replaceAll("%s", this.name);
			info("Installing license notice: ",
					filename);
			StringBuilder addParts = new StringBuilder();
			for (Entry<String, License> licenseMap : includedLicenses.entrySet()) {
				lic = licenseMap.getValue();
				if (lic != null) {
					String s = getLString(InstallLicenseMojo.class, "NOTICE_SENTENCE",
							lic.getLicenseName(), licenseMap.getKey());
					addParts.append(s);
				}
			}
			StringBuilder fullLicenseText = new StringBuilder();
			int n = 0;
			for (License l : coreInstalled) {
				if (n > 0) {
					if (n == coreInstalled.size() - 1) {
						fullLicenseText.append(getLString(InstallLicenseMojo.class, "AND"));
					} else {
						fullLicenseText.append(getLString(InstallLicenseMojo.class, "COMMA"));
					}
				}
				fullLicenseText.append(l.getLicenseName());
				++n;
			}
			String noticeText = getLString(InstallLicenseMojo.class, "NOTICE_TEXT",
					this.name, this.copyrightDates, this.copyrighters, fullLicenseText.toString(), addParts.toString());
			File noticeFile = new File(metainfDirectory, filename);
			FileWriter fileWriter = new FileWriter(noticeFile);
			try {
				fileWriter.write(noticeText);
			}
			finally {
				fileWriter.close();
			}
			filename = AUTHOR_FILENAME_PATTERN.replaceAll("%s", this.name);
			info("Installing authors: ",
					filename);
			StringBuilder authorsText = new StringBuilder();
			if (this.projectURL != null) {
				authorsText.append(getLString(InstallLicenseMojo.class, "AUTHOR_INTRO", this.projectURL.toExternalForm()));
			} else {
				authorsText.append(getLString(InstallLicenseMojo.class, "AUTHOR_INTRO", ""));
			}
			authorsText.append("\n\n");
			authorsText.append(getLString(InstallLicenseMojo.class, "DEVELOPER_TITLE", this.name));
			authorsText.append("\n\n");
			for (Developer developer : this.mavenProject.getDevelopers()) {
				authorsText.append(getLString(InstallLicenseMojo.class, "DEVELOPER",
						developer.getName(), developer.getEmail()));
				authorsText.append("\n");
			}
			authorsText.append("\n\n\n");
			authorsText.append(getLString(InstallLicenseMojo.class, "CONTRIBUTOR_TITLE", this.name));
			authorsText.append("\n\n");
			for (Contributor contributor : this.mavenProject.getContributors()) {
				authorsText.append(getLString(InstallLicenseMojo.class, "DEVELOPER",
						contributor.getName(), contributor.getEmail()));
				authorsText.append("\n");
			}
			File authorFile = new File(metainfDirectory, filename);
			fileWriter = new FileWriter(authorFile);
			try {
				fileWriter.write(authorsText.toString());
			}
			finally {
				fileWriter.close();
			}
		}
		catch (IOException e) {
			throw new RuntimeException(e);
		}
	}


Input:
    public boolean readRichSequence(BufferedReader reader,
            SymbolTokenization symParser,
            RichSeqIOListener rlistener,
            Namespace ns)
            throws IllegalSymbolException, IOException, ParseException {
        tax = null;
        organism = null;
        accession = null;
        boolean hasAnotherSequence = true;
        rlistener.startSequence();
        if (ns==null) ns=RichObjectFactory.getDefaultNamespace();
        rlistener.setNamespace(ns);
        String sectionKey = null;
        int xrefCount = 0;
        do {
            List section = this.readSection(reader);
            sectionKey = ((String[])section.get(0))[0];
            if(sectionKey == null){
                String message = ParseException.newMessage(this.getClass(), accession, "No section key", "Not set", sectionToString(section));
                throw new ParseException(message);
            }
            if (sectionKey.equals(LOCUS_TAG)) {
                String loc = ((String[])section.get(0))[1];
                Matcher m = lp.matcher(loc);
                Matcher mPre87 = lpPre87.matcher(loc);
                if (m.matches()) {
                    rlistener.setName(m.group(1));
                    rlistener.setAccession(m.group(1));
                    rlistener.setVersion(Integer.parseInt(m.group(2)));
                    rlistener.setCircular(m.group(3).equals("circular"));
                    rlistener.addSequenceProperty(Terms.getMolTypeTerm(),m.group(4));
                    rlistener.addSequenceProperty(Terms.getDataClassTerm(),m.group(5));
                    rlistener.setDivision(m.group(6));
                } else if (mPre87.matches()) {
                    rlistener.setName(mPre87.group(1));
                    if (mPre87.group(3)!=null) {
                        rlistener.addSequenceProperty(Terms.getGenomicTerm(),null);
                    }
                    rlistener.addSequenceProperty(Terms.getMolTypeTerm(),mPre87.group(4));
                    rlistener.setDivision(mPre87.group(5));
                    String circular = mPre87.group(2);
                    if (circular!=null) rlistener.setCircular(true);
                } else {
                    String message = ParseException.newMessage(this.getClass(),accession,"Not Set","Bad ID line found", sectionToString(section));
                    throw new ParseException(message);
                }
            } else if (sectionKey.equals(DEFINITION_TAG)) {
                rlistener.setDescription(((String[])section.get(0))[1]);
            } else if (sectionKey.equals(SOURCE_TAG)) {
                for (int i = 1; i < section.size(); i++) {
                    sectionKey = ((String[])section.get(i))[0];
                    if (sectionKey.equals(ORGANELLE_TAG)) {
                        rlistener.addSequenceProperty(Terms.getOrganelleTerm(), ((String[])section.get(i))[1].trim());
                        break;
                    }
                }
            } else if (sectionKey.equals(DATE_TAG)) {
                String chunk = ((String[])section.get(0))[1].trim();
                Matcher dm = dp.matcher(chunk);
                if (dm.matches()) {
                    String date = dm.group(1);
                    String rel = dm.group(3);
                    String type = dm.group(4);
                    if (type.equals("Created")) {
                        rlistener.addSequenceProperty(Terms.getDateCreatedTerm(), date);
                        rlistener.addSequenceProperty(Terms.getRelCreatedTerm(), rel);
                    } else if (type.equals("Last updated, Version ")) {
                        rlistener.addSequenceProperty(Terms.getDateUpdatedTerm(), date);
                        rlistener.addSequenceProperty(Terms.getRelUpdatedTerm(), rel);
                    } else {
                        String message = ParseException.newMessage(this.getClass(),accession,"not set", "Bad date type found",sectionToString(section));
                        throw new ParseException(message);
                    }
                } else {
                    String message = ParseException.newMessage(this.getClass(),accession,"not set", "Bad date line found",sectionToString(section));
                    throw new ParseException(message);
                }
            } else if (sectionKey.equals(ACCESSION_TAG)) {
                String[] accs = ((String[])section.get(0))[1].split(";");
                accession = accs[0].trim();
                rlistener.setAccession(accession);
                for (int i = 1; i < accs.length; i++) {
                    rlistener.addSequenceProperty(Terms.getAdditionalAccessionTerm(),accs[i].trim());
                }
            } else if (sectionKey.equals(VERSION_TAG)) {
                String ver = ((String[])section.get(0))[1];
                Matcher m = vp.matcher(ver);
                if (m.matches()) {
                    String verAcc = m.group(1);
                    if (!accession.equals(verAcc)) {
                        rlistener.addSequenceProperty(Terms.getAdditionalAccessionTerm(),accession);
                        accession = verAcc;
                        rlistener.setAccession(accession);
                    }
                    rlistener.setVersion(Integer.parseInt(m.group(2)));
                } else {
                    rlistener.addSequenceProperty(Terms.getVersionLineTerm(),ver);
                }
            } else if (sectionKey.equals(KEYWORDS_TAG)) {
                String val = ((String[])section.get(0))[1];
                val = val.substring(0,val.length()-1);
                String[] kws = val.split(";");
                for (int i = 0; i < kws.length; i++) {
                    rlistener.addSequenceProperty(Terms.getKeywordTerm(), kws[i].trim());
                }
            } else if (sectionKey.equals(DATABASE_XREF_TAG)) {
                String val = ((String[])section.get(0))[1];
                val = val.substring(0,val.length()-1);
                String[] parts = val.split(";");
                CrossRef crossRef = (CrossRef)RichObjectFactory.getObject(SimpleCrossRef.class,new Object[]{parts[0].trim(),parts[1].trim(), new Integer(0)});
                for (int j = 2; j < parts.length; j++) {
                    Note note = new SimpleNote(Terms.getAdditionalAccessionTerm(),parts[j].trim(),j-1);
                    try {
                        ((RichAnnotation)crossRef.getAnnotation()).addNote(note);
                    } catch (ChangeVetoException ce) {
                        String message = ParseException.newMessage(this.getClass(),accession,"not set", "Could not annotate identifier terms",sectionToString(section));
                        ParseException pe = new ParseException(message);
                        pe.initCause(ce);
                        throw pe;
                    }
                }
                RankedCrossRef rcrossRef = new SimpleRankedCrossRef(crossRef, ++xrefCount);
                rlistener.setRankedCrossRef(rcrossRef);
            } else if (sectionKey.equals(REFERENCE_TAG) && !this.getElideReferences()) {
                String refrank = ((String[])section.get(0))[1];
                int ref_rank = Integer.parseInt(refrank.substring(1,refrank.length()-1));
                int ref_start = -999;
                int ref_end = -999;
                String consortium = null;
                String authors = null;
                String title = null;
                String locator = null;
                String pubmed = null;
                String medline = null;
                String doi = null;
                String remark = null;
                for (int i = 1; i < section.size(); i++) {
                    String key = ((String[])section.get(i))[0];
                    String val = ((String[])section.get(i))[1];
                    if (key.equals(AUTHORS_TAG)) {
                        if (val.endsWith(";")) val = val.substring(0,val.length()-1);
                        authors = val;
                    }
                    if (key.equals(CONSORTIUM_TAG)) {
                        if (val.endsWith(";")) val = val.substring(0,val.length()-1);
                        consortium = val;
                    }
                    if (key.equals(TITLE_TAG)) {
                        if (val.length()>1) {
                            if (val.endsWith(";")) val = val.substring(0,val.length()-1);
                            if (val.endsWith("\"")) val = val.substring(1,val.length()-1);
                            title = val.replace('\n',' ');
                        } else title=null;
                    }
                    if (key.equals(LOCATOR_TAG)) {
                        if (val.endsWith(".")) val = val.substring(0,val.length()-1);
                        locator = val;
                    }
                    if (key.equals(REFERENCE_XREF_TAG)) {
                        String[] refs = val.split("\\.(\\s+|$)");
                        for (int j = 0 ; j < refs.length; j++) {
                            if (refs[j].trim().length()==0) continue;
                            String[] parts = refs[j].split(";");
                            String db = parts[0];
                            String ref = parts[1];
                            if (db.equalsIgnoreCase(Terms.PUBMED_KEY)) pubmed = ref;
                            else if (db.equalsIgnoreCase(Terms.MEDLINE_KEY)) medline = ref;
                            else if (db.equalsIgnoreCase(Terms.DOI_KEY)) doi = ref;
                        }
                    }
                    if (key.equals(REMARK_TAG)) remark = val.replace('\n',' ');
                    if (key.equals(REFERENCE_POSITION_TAG)) {
                        Matcher m = rpp.matcher(val);
                        if (m.matches()) {
                            ref_start = Integer.parseInt(m.group(1));
                            if(m.group(2) != null)
                                ref_end = Integer.parseInt(m.group(3));
                        } else {
                            String message = ParseException.newMessage(this.getClass(),accession,"not set", "Bad reference line found",sectionToString(section));
                            throw new ParseException(message);
                        }
                    }
                }
                try {
                    List authSet = DocRefAuthor.Tools.parseAuthorString(authors);
                    if (consortium!=null) authSet.add(new SimpleDocRefAuthor(consortium, true, false));
                    DocRef dr = (DocRef)RichObjectFactory.getObject(SimpleDocRef.class,new Object[]{authSet,locator,title});
                    if (medline!=null) dr.setCrossref((CrossRef)RichObjectFactory.getObject(SimpleCrossRef.class,new Object[]{Terms.MEDLINE_KEY, medline, new Integer(0)}));
                    else if (pubmed!=null) dr.setCrossref((CrossRef)RichObjectFactory.getObject(SimpleCrossRef.class,new Object[]{Terms.PUBMED_KEY, pubmed, new Integer(0)}));
                    else if (doi!=null) dr.setCrossref((CrossRef)RichObjectFactory.getObject(SimpleCrossRef.class,new Object[]{Terms.DOI_KEY, doi, new Integer(0)}));
                    if (!this.getElideComments()) dr.setRemark(remark);
                    RankedDocRef rdr = new SimpleRankedDocRef(dr,
                            (ref_start != -999 ? new Integer(ref_start) : null),
                            (ref_end != -999 ? new Integer(ref_end) : null),
                            ref_rank);
                    rlistener.setRankedDocRef(rdr);
                } catch (ChangeVetoException e) {
                    String message = ParseException.newMessage(this.getClass(),accession,"not set", "",sectionToString(section));
                    throw new ParseException(e, message);
                }
            } else if (sectionKey.equals(COMMENT_TAG) && !this.getElideComments()) {
                rlistener.setComment(((String[])section.get(0))[1]);
            } else if (sectionKey.equals(FEATURE_TAG) && !this.getElideFeatures()) {
                boolean seenAFeature = false;
                for (int i = 1 ; i < section.size(); i++) {
                    String key = ((String[])section.get(i))[0];
                    String val = ((String[])section.get(i))[1];
                    if (key.startsWith("/")) {
                        key = key.substring(1);
                        val = val.replaceAll("\\s*[\\n\\r]+\\s*"," ").trim();
                        if (val.startsWith("\"")) val = val.substring(1,val.length()-1);
                        if (key.equalsIgnoreCase("db_xref")) {
                            Matcher m = dbxp.matcher(val);
                            if (m.matches()) {
                                String dbname = m.group(1);
                                String raccession = m.group(2);
                                if (dbname.equalsIgnoreCase("taxon")) {
                                    tax = (NCBITaxon)RichObjectFactory.getObject(SimpleNCBITaxon.class, new Object[]{Integer.valueOf(raccession)});
                                    rlistener.setTaxon(tax);
                                    try {
                                        if (organism!=null) tax.addName(NCBITaxon.SCIENTIFIC,organism);
                                    } catch (ChangeVetoException e) {
                                        String message = ParseException.newMessage(this.getClass(),accession,"not set", "",sectionToString(section));
                                        throw new ParseException(e, message);
                                    }
                                } else {
                                    try {
                                        CrossRef cr = (CrossRef)RichObjectFactory.getObject(SimpleCrossRef.class,new Object[]{dbname, raccession, new Integer(0)});
                                        RankedCrossRef rcr = new SimpleRankedCrossRef(cr, 0);
                                        rlistener.getCurrentFeature().addRankedCrossRef(rcr);
                                    } catch (ChangeVetoException e) {
                                        String message = ParseException.newMessage(this.getClass(),accession,"not set", "",sectionToString(section));
                                        throw new ParseException(e, message);
                                    }
                                }
                            } else {
                                String message = ParseException.newMessage(this.getClass(),accession,"not set", "Bad dbxref found",sectionToString(section));
                                throw new ParseException(message);
                            }
                        } else if (key.equalsIgnoreCase("organism")) {
                            try {
                                organism = val;
                                if (tax!=null) tax.addName(NCBITaxon.SCIENTIFIC,organism);
                            } catch (ChangeVetoException e) {
                                String message = ParseException.newMessage(this.getClass(),accession,"not set", "",sectionToString(section));
                                throw new ParseException(message);
                            }
                        } else {
                            if (key.equalsIgnoreCase("translation")) {
                                val = val.replaceAll("\\s+","");
                            }
                            rlistener.addFeatureProperty(RichObjectFactory.getDefaultOntology().getOrCreateTerm(key),val);
                        }
                    } else {
                        if (seenAFeature) rlistener.endFeature();
                        RichFeature.Template templ = new RichFeature.Template();
                        templ.annotation = new SimpleRichAnnotation();
                        templ.sourceTerm = Terms.getEMBLTerm();
                        templ.typeTerm = RichObjectFactory.getDefaultOntology().getOrCreateTerm(key);
                        templ.featureRelationshipSet = new TreeSet();
                        templ.rankedCrossRefs = new TreeSet();
                        String tidyLocStr = val.replaceAll("\\s+","");
                        templ.location = GenbankLocationParser.parseLocation(ns, accession, tidyLocStr);
                        rlistener.startFeature(templ);
                        seenAFeature = true;
                    }
                }
                if (seenAFeature) rlistener.endFeature();
            } else if (sectionKey.equals(START_SEQUENCE_TAG) && !this.getElideSymbols()) {
                StringBuffer seq = new StringBuffer();
                for (int i = 0 ; i < section.size(); i++) seq.append(((String[])section.get(i))[1]);
                try {
                    SymbolList sl = new SimpleSymbolList(symParser,
                            seq.toString().replaceAll("\\s+","").replaceAll("[\\.|~]","-"));
                    rlistener.addSymbols(symParser.getAlphabet(),
                            (Symbol[])(sl.toList().toArray(new Symbol[0])),
                            0, sl.length());
                } catch (Exception e) {
                    String message = ParseException.newMessage(this.getClass(),accession,"not set", "Bad sequence",sectionToString(section));
                    throw new ParseException(e, message);
                }
            }
        } while (!sectionKey.equals(END_SEQUENCE_TAG));
        while (true) {
            reader.mark(1);
            int c = reader.read();
            if (c == -1) {
                hasAnotherSequence = false;
                break;
            }
            if (Character.isWhitespace((char) c)) {
                continue;
            }
            reader.reset();
            break;
        }
        rlistener.endSequence();
        return hasAnotherSequence;
    }

Output:
    public boolean readRichSequence(BufferedReader reader,
            SymbolTokenization symParser,
            RichSeqIOListener rlistener,
            Namespace ns)
            throws IllegalSymbolException, IOException, ParseException {
        tax = null;
        organism = null;
        accession = null;
        boolean hasAnotherSequence = true;
        rlistener.startSequence();
        if (ns==null) ns=RichObjectFactory.getDefaultNamespace();
        rlistener.setNamespace(ns);
        String sectionKey = null;
        int xrefCount = 0;
        do {
            List section = this.readSection(reader);
            sectionKey = ((String[])section.get(0))[0];
            if(sectionKey == null){
                String message = ParseException.newMessage(this.getClass(), accession, "No section key", "Not set", sectionToString(section));
                throw new ParseException(message);
            }
            if (sectionKey.equals(LOCUS_TAG)) {
                String loc = ((String[])section.get(0))[1];
                Matcher m = lp.matcher(loc);
                Matcher mPre87 = lpPre87.matcher(loc);
                if (m.matches()) {
                    rlistener.setName(m.group(1));
                    rlistener.setAccession(m.group(1));
                    rlistener.setVersion(Integer.parseInt(m.group(2)));
                    rlistener.setCircular(m.group(3).equals("circular"));
                    rlistener.addSequenceProperty(Terms.getMolTypeTerm(),m.group(4));
                    rlistener.addSequenceProperty(Terms.getDataClassTerm(),m.group(5));
                    rlistener.setDivision(m.group(6));
                } else if (mPre87.matches()) {
                    rlistener.setName(mPre87.group(1));
                    if (mPre87.group(3)!=null) {
                        rlistener.addSequenceProperty(Terms.getGenomicTerm(),null);
                    }
                    rlistener.addSequenceProperty(Terms.getMolTypeTerm(),mPre87.group(4));
                    rlistener.setDivision(mPre87.group(5));
                    String circular = mPre87.group(2);
                    if (circular!=null) rlistener.setCircular(true);
                } else {
                    String message = ParseException.newMessage(this.getClass(),accession,"Not Set","Bad ID line found", sectionToString(section));
                    throw new ParseException(message);
                }
            } else if (sectionKey.equals(DEFINITION_TAG)) {
                rlistener.setDescription(((String[])section.get(0))[1]);
            } else if (sectionKey.equals(SOURCE_TAG)) {
                for (int i = 1; i < section.size(); i++) {
                    sectionKey = ((String[])section.get(i))[0];
                    if (sectionKey.equals(ORGANELLE_TAG)) {
                        rlistener.addSequenceProperty(Terms.getOrganelleTerm(), ((String[])section.get(i))[1].trim());
                        break;
                    }
                }
            } else if (sectionKey.equals(DATE_TAG)) {
                String chunk = ((String[])section.get(0))[1].trim();
                Matcher dm = dp.matcher(chunk);
                if (dm.matches()) {
                    String date = dm.group(1);
                    String rel = dm.group(3);
                    String type = dm.group(4);
                    if (type.equals("Created")) {
                        rlistener.addSequenceProperty(Terms.getDateCreatedTerm(), date);
                        rlistener.addSequenceProperty(Terms.getRelCreatedTerm(), rel);
                    } else if (type.equals("Last updated, Version ")) {
                        rlistener.addSequenceProperty(Terms.getDateUpdatedTerm(), date);
                        rlistener.addSequenceProperty(Terms.getRelUpdatedTerm(), rel);
                    } else {
                        String message = ParseException.newMessage(this.getClass(),accession,"not set", "Bad date type found",sectionToString(section));
                        throw new ParseException(message);
                    }
                } else {
                    String message = ParseException.newMessage(this.getClass(),accession,"not set", "Bad date line found",sectionToString(section));
                    throw new ParseException(message);
                }
            } else if (sectionKey.equals(ACCESSION_TAG)) {
                String[] accs = ((String[])section.get(0))[1].split(";");
                accession = accs[0].trim();
                rlistener.setAccession(accession);
                for (int i = 1; i < accs.length; i++) {
                    rlistener.addSequenceProperty(Terms.getAdditionalAccessionTerm(),accs[i].trim());
                }
            } else if (sectionKey.equals(VERSION_TAG)) {
                String ver = ((String[])section.get(0))[1];
                Matcher m = vp.matcher(ver);
                if (m.matches()) {
                    String verAcc = m.group(1);
                    if (!accession.equals(verAcc)) {
                        rlistener.addSequenceProperty(Terms.getAdditionalAccessionTerm(),accession);
                        accession = verAcc;
                        rlistener.setAccession(accession);
                    }
                    rlistener.setVersion(Integer.parseInt(m.group(2)));
                } else {
                    rlistener.addSequenceProperty(Terms.getVersionLineTerm(),ver);
                }
            } else if (sectionKey.equals(KEYWORDS_TAG)) {
                String val = ((String[])section.get(0))[1];
                val = val.substring(0,val.length()-1);
                String[] kws = val.split(";");
                for (int i = 0; i < kws.length; i++) {
                    rlistener.addSequenceProperty(Terms.getKeywordTerm(), kws[i].trim());
                }
            } else if (sectionKey.equals(DATABASE_XREF_TAG)) {
                String val = ((String[])section.get(0))[1];
                val = val.substring(0,val.length()-1);
                String[] parts = val.split(";");
                CrossRef crossRef = (CrossRef)RichObjectFactory.getObject(SimpleCrossRef.class,new Object[]{parts[0].trim(),parts[1].trim(), new Integer(0)});
                for (int j = 2; j < parts.length; j++) {
                    Note note = new SimpleNote(Terms.getAdditionalAccessionTerm(),parts[j].trim(),j-1);
                    try {
                        ((RichAnnotation)crossRef.getAnnotation()).addNote(note);
                    } catch (ChangeVetoException ce) {
                        String message = ParseException.newMessage(this.getClass(),accession,"not set", "Could not annotate identifier terms",sectionToString(section));
                        ParseException pe = new ParseException(message);
                        pe.initCause(ce);
                        throw pe;
                    }
                }
                RankedCrossRef rcrossRef = new SimpleRankedCrossRef(crossRef, ++xrefCount);
                rlistener.setRankedCrossRef(rcrossRef);
            } else if (sectionKey.equals(REFERENCE_TAG) && !this.getElideReferences()) {
                String refrank = ((String[])section.get(0))[1];
                int ref_rank = Integer.parseInt(refrank.substring(1,refrank.length()-1));
                int ref_start = -999;
                int ref_end = -999;
                String consortium = null;
                String authors = null;
                String title = null;
                String locator = null;
                String pubmed = null;
                String medline = null;
                String doi = null;
                String remark = null;
                for (int i = 1; i < section.size(); i++) {
                    String key = ((String[])section.get(i))[0];
                    String val = ((String[])section.get(i))[1];
                    if (key.equals(AUTHORS_TAG)) {
                        if (val.endsWith(";")) val = val.substring(0,val.length()-1);
                        authors = val;
                    }
                    if (key.equals(CONSORTIUM_TAG)) {
                        if (val.endsWith(";")) val = val.substring(0,val.length()-1);
                        consortium = val;
                    }
                    if (key.equals(TITLE_TAG)) {
                        if (val.length()>1) {
                            if (val.endsWith(";")) val = val.substring(0,val.length()-1);
                            if (val.endsWith("\"")) val = val.substring(1,val.length()-1);
                            title = val.replace('\n',' ');
                        } else title=null;
                    }
                    if (key.equals(LOCATOR_TAG)) {
                        if (val.endsWith(".")) val = val.substring(0,val.length()-1);
                        locator = val;
                    }
                    if (key.equals(REFERENCE_XREF_TAG)) {
                        String[] refs = val.split("\\.(\\s+|$)");
                        for (int j = 0 ; j < refs.length; j++) {
                            if (refs[j].trim().length()==0) continue;
                            String[] parts = refs[j].split(";");
                            String db = parts[0];
                            String ref = parts[1].trim();
                            if (db.equalsIgnoreCase(Terms.PUBMED_KEY)) pubmed = ref;
                            else if (db.equalsIgnoreCase(Terms.MEDLINE_KEY)) medline = ref;
                            else if (db.equalsIgnoreCase(Terms.DOI_KEY)) doi = ref;
                        }
                    }
                    if (key.equals(REMARK_TAG)) remark = val.replace('\n',' ');
                    if (key.equals(REFERENCE_POSITION_TAG)) {
                        Matcher m = rpp.matcher(val);
                        if (m.matches()) {
                            ref_start = Integer.parseInt(m.group(1));
                            if(m.group(2) != null)
                                ref_end = Integer.parseInt(m.group(3));
                        } else {
                            String message = ParseException.newMessage(this.getClass(),accession,"not set", "Bad reference line found",sectionToString(section));
                            throw new ParseException(message);
                        }
                    }
                }
                try {
                    List authSet = DocRefAuthor.Tools.parseAuthorString(authors);
                    if (consortium!=null) authSet.add(new SimpleDocRefAuthor(consortium, true, false));
                    DocRef dr = (DocRef)RichObjectFactory.getObject(SimpleDocRef.class,new Object[]{authSet,locator,title});
                    if (medline!=null) dr.setCrossref((CrossRef)RichObjectFactory.getObject(SimpleCrossRef.class,new Object[]{Terms.MEDLINE_KEY, medline, new Integer(0)}));
                    else if (pubmed!=null) dr.setCrossref((CrossRef)RichObjectFactory.getObject(SimpleCrossRef.class,new Object[]{Terms.PUBMED_KEY, pubmed, new Integer(0)}));
                    else if (doi!=null) dr.setCrossref((CrossRef)RichObjectFactory.getObject(SimpleCrossRef.class,new Object[]{Terms.DOI_KEY, doi, new Integer(0)}));
                    if (!this.getElideComments()) dr.setRemark(remark);
                    RankedDocRef rdr = new SimpleRankedDocRef(dr,
                            (ref_start != -999 ? new Integer(ref_start) : null),
                            (ref_end != -999 ? new Integer(ref_end) : null),
                            ref_rank);
                    rlistener.setRankedDocRef(rdr);
                } catch (ChangeVetoException e) {
                    String message = ParseException.newMessage(this.getClass(),accession,"not set", "",sectionToString(section));
                    throw new ParseException(e, message);
                }
            } else if (sectionKey.equals(COMMENT_TAG) && !this.getElideComments()) {
                rlistener.setComment(((String[])section.get(0))[1]);
            } else if (sectionKey.equals(FEATURE_TAG) && !this.getElideFeatures()) {
                boolean seenAFeature = false;
                for (int i = 1 ; i < section.size(); i++) {
                    String key = ((String[])section.get(i))[0];
                    String val = ((String[])section.get(i))[1];
                    if (key.startsWith("/")) {
                        key = key.substring(1);
                        val = val.replaceAll("\\s*[\\n\\r]+\\s*"," ").trim();
                        if (val.startsWith("\"")) val = val.substring(1,val.length()-1);
                        if (key.equalsIgnoreCase("db_xref")) {
                            Matcher m = dbxp.matcher(val);
                            if (m.matches()) {
                                String dbname = m.group(1);
                                String raccession = m.group(2);
                                if (dbname.equalsIgnoreCase("taxon")) {
                                    tax = (NCBITaxon)RichObjectFactory.getObject(SimpleNCBITaxon.class, new Object[]{Integer.valueOf(raccession)});
                                    rlistener.setTaxon(tax);
                                    try {
                                        if (organism!=null) tax.addName(NCBITaxon.SCIENTIFIC,organism);
                                    } catch (ChangeVetoException e) {
                                        String message = ParseException.newMessage(this.getClass(),accession,"not set", "",sectionToString(section));
                                        throw new ParseException(e, message);
                                    }
                                } else {
                                    try {
                                        CrossRef cr = (CrossRef)RichObjectFactory.getObject(SimpleCrossRef.class,new Object[]{dbname, raccession, new Integer(0)});
                                        RankedCrossRef rcr = new SimpleRankedCrossRef(cr, 0);
                                        rlistener.getCurrentFeature().addRankedCrossRef(rcr);
                                    } catch (ChangeVetoException e) {
                                        String message = ParseException.newMessage(this.getClass(),accession,"not set", "",sectionToString(section));
                                        throw new ParseException(e, message);
                                    }
                                }
                            } else {
                                String message = ParseException.newMessage(this.getClass(),accession,"not set", "Bad dbxref found",sectionToString(section));
                                throw new ParseException(message);
                            }
                        } else if (key.equalsIgnoreCase("organism")) {
                            try {
                                organism = val;
                                if (tax!=null) tax.addName(NCBITaxon.SCIENTIFIC,organism);
                            } catch (ChangeVetoException e) {
                                String message = ParseException.newMessage(this.getClass(),accession,"not set", "",sectionToString(section));
                                throw new ParseException(message);
                            }
                        } else {
                            if (key.equalsIgnoreCase("translation")) {
                                val = val.replaceAll("\\s+","");
                            }
                            rlistener.addFeatureProperty(RichObjectFactory.getDefaultOntology().getOrCreateTerm(key),val);
                        }
                    } else {
                        if (seenAFeature) rlistener.endFeature();
                        RichFeature.Template templ = new RichFeature.Template();
                        templ.annotation = new SimpleRichAnnotation();
                        templ.sourceTerm = Terms.getEMBLTerm();
                        templ.typeTerm = RichObjectFactory.getDefaultOntology().getOrCreateTerm(key);
                        templ.featureRelationshipSet = new TreeSet();
                        templ.rankedCrossRefs = new TreeSet();
                        String tidyLocStr = val.replaceAll("\\s+","");
                        templ.location = GenbankLocationParser.parseLocation(ns, accession, tidyLocStr);
                        rlistener.startFeature(templ);
                        seenAFeature = true;
                    }
                }
                if (seenAFeature) rlistener.endFeature();
            } else if (sectionKey.equals(START_SEQUENCE_TAG) && !this.getElideSymbols()) {
                StringBuffer seq = new StringBuffer();
                for (int i = 0 ; i < section.size(); i++) seq.append(((String[])section.get(i))[1]);
                try {
                    SymbolList sl = new SimpleSymbolList(symParser,
                            seq.toString().replaceAll("\\s+","").replaceAll("[\\.|~]","-"));
                    rlistener.addSymbols(symParser.getAlphabet(),
                            (Symbol[])(sl.toList().toArray(new Symbol[0])),
                            0, sl.length());
                } catch (Exception e) {
                    String message = ParseException.newMessage(this.getClass(),accession,"not set", "Bad sequence",sectionToString(section));
                    throw new ParseException(e, message);
                }
            }
        } while (!sectionKey.equals(END_SEQUENCE_TAG));
        while (true) {
            reader.mark(1);
            int c = reader.read();
            if (c == -1) {
                hasAnotherSequence = false;
                break;
            }
            if (Character.isWhitespace((char) c)) {
                continue;
            }
            reader.reset();
            break;
        }
        rlistener.endSequence();
        return hasAnotherSequence;
    }


Input:
    public void init() {
		try {
			RFX_FOLDER = new File(getRfxFolderPath());
			BIN_FOLDER = new File(getBinFolderPath());
			DESKTOP_FOLDER = new File(getDesktopFolderPath());
			DOCUMENT_BASE = getDocumentBase();
			CODE_BASE = getCodeBase();
			POST_URL = getParameter("post_url");
			API_KEY = getParameter("api_key");
			HEADLESS = !getParameter("headless").isEmpty() && getParameter("headless").equals("true");
			GRAPHICS_CONFIG = getGraphicsConfiguration();
			GraphicsDevice myScreen = GRAPHICS_CONFIG.getDevice();
			GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
			GraphicsDevice[] allScreens = env.getScreenDevices();
			int myScreenIndex = -1;
			for (int i = 0; i < allScreens.length; i++) {
			    if (allScreens[i].equals(myScreen))
			    {
			        myScreenIndex = i;
			        break;
			    }
			}
			System.out.println("Applet window is on screen" + myScreenIndex);
			System.out.println(getAppletInfo());
			if( RFX_FOLDER.exists() && !RFX_FOLDER.isDirectory() && !RFX_FOLDER.delete() )
		        throw new IOException("Could not delete file for folder: " + RFX_FOLDER.getAbsolutePath());
			if( !RFX_FOLDER.exists() && !RFX_FOLDER.mkdir() )
		        throw new IOException("Could not create folder: " + RFX_FOLDER.getAbsolutePath());
			System.out.println("Have access to folder: "+RFX_FOLDER.getAbsolutePath()+File.separator);
            SwingUtilities.invokeAndWait(new Runnable() {
                public void run() {
                	if(IS_MAC)
                		controller = new MacController();
                	else if(IS_LINUX)
                		controller = new LinuxController();
                	else if(IS_WINDOWS)
                		controller = new WindowsController();
                	else
                		System.err.println("Want to launch controller but don't which operating system this is.");
                }
            });
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                	if(controller != null)
                		controller.setupExtensions();
                }
            });
		} catch (IOException e1) {
			System.err.println("Could not create temporary folder!");
			e1.printStackTrace();
		}	catch (Exception e) {
            System.err.println("Could not create GUI!");
            e.printStackTrace();
        }
    }

Output:
    public void init() {
		try {
			RFX_FOLDER = new File(getRfxFolderPath());
			BIN_FOLDER = new File(getBinFolderPath());
			DESKTOP_FOLDER = new File(getDesktopFolderPath());
			DOCUMENT_BASE = getDocumentBase();
			CODE_BASE = getCodeBase();
			POST_URL = getParameter("post_url");
			API_KEY = getParameter("api_key");
			if(getParameter("headless") != null)
				HEADLESS = !getParameter("headless").isEmpty() && getParameter("headless").equals("true");
			GRAPHICS_CONFIG = getGraphicsConfiguration();
			GraphicsDevice myScreen = GRAPHICS_CONFIG.getDevice();
			GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
			GraphicsDevice[] allScreens = env.getScreenDevices();
			int myScreenIndex = -1;
			for (int i = 0; i < allScreens.length; i++) {
			    if (allScreens[i].equals(myScreen))
			    {
			        myScreenIndex = i;
			        break;
			    }
			}
			System.out.println("Applet window is on screen" + myScreenIndex);
			System.out.println(getAppletInfo());
			if( RFX_FOLDER.exists() && !RFX_FOLDER.isDirectory() && !RFX_FOLDER.delete() )
		        throw new IOException("Could not delete file for folder: " + RFX_FOLDER.getAbsolutePath());
			if( !RFX_FOLDER.exists() && !RFX_FOLDER.mkdir() )
		        throw new IOException("Could not create folder: " + RFX_FOLDER.getAbsolutePath());
			System.out.println("Have access to folder: "+RFX_FOLDER.getAbsolutePath()+File.separator);
            SwingUtilities.invokeAndWait(new Runnable() {
                public void run() {
                	if(IS_MAC)
                		controller = new MacController();
                	else if(IS_LINUX)
                		controller = new LinuxController();
                	else if(IS_WINDOWS)
                		controller = new WindowsController();
                	else
                		System.err.println("Want to launch controller but don't which operating system this is.");
                }
            });
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                	if(controller != null)
                		controller.setupExtensions();
                }
            });
		} catch (IOException e1) {
			System.err.println("Could not create temporary folder!");
			e1.printStackTrace();
		}	catch (Exception e) {
            System.err.println("Could not create GUI!");
            e.printStackTrace();
        }
    }


Input:
    public int run(String[] args) throws Exception {
        Options options = new Options();
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("output path").create(OUTPUT));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("input").create(INPUT));
        options.addOption(OptionBuilder.withArgName("string")
                .hasArg().withDescription("e language").create(eLangOption));
        options.addOption(OptionBuilder.withArgName("string")
                .hasArg().withDescription("f language").create(fLangOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("e stop words").create(eStopWordsOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("f stop words").create(fStopWordsOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("e tokens").create(eTokensOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("f tokens").create(fTokensOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("e vocab src").create(eVocabSrcOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("f vocab src").create(fVocabSrcOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("e vocab tgt").create(eVocabTgtOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("f vocab tgt").create(fVocabTgtOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("e2f prob table").create(e2fProbsOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("f2e prob table").create(f2eProbsOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("output path").create(OUTPUT));
        options.addOption(OptionBuilder.withArgName("integer")
                .hasArg().withDescription("n samples").create(nSamplesOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("sampled documents").create(sampleDocsOption));
        CommandLine cmdline;
        CommandLineParser parser = new GnuParser();
        try {
            cmdline = parser.parse(options, args);
        } catch (ParseException exp) {
            System.err.println("Error parsing command line: " + exp.getMessage());
            return -1;
        }
        if (!cmdline.hasOption(OUTPUT) || !cmdline.hasOption(INPUT)
                || !cmdline.hasOption(nSamplesOption)
                || !cmdline.hasOption(eVocabSrcOption) || !cmdline.hasOption(fVocabSrcOption)
                || !cmdline.hasOption(eVocabTgtOption) || !cmdline.hasOption(fVocabTgtOption)
                || !cmdline.hasOption(e2fProbsOption) || !cmdline.hasOption(f2eProbsOption)
                || !cmdline.hasOption(eLangOption) || !cmdline.hasOption(fLangOption)
                || !cmdline.hasOption(eStopWordsOption) || !cmdline.hasOption(fStopWordsOption)
                || !cmdline.hasOption(eTokensOption) || !cmdline.hasOption(fTokensOption)
                || !cmdline.hasOption(nSamplesOption) || !cmdline.hasOption(sampleDocsOption)
                ) {
            HelpFormatter formatter = new HelpFormatter();
            formatter.setWidth(120);
            formatter.printHelp(this.getClass().getName(), options);
            ToolRunner.printGenericCommandUsage(System.out);
            return -1;
        }
        String inputPath = cmdline.getOptionValue(INPUT);
        String outputPath = cmdline.getOptionValue(OUTPUT);
        String eLang = cmdline.getOptionValue(eLangOption);
        String fLang = cmdline.getOptionValue(fLangOption);
        String eTokensPath = cmdline.getOptionValue(eTokensOption);
        String fTokensPath = cmdline.getOptionValue(fTokensOption);
        String eStopWordsPath = cmdline.getOptionValue(eStopWordsOption);
        String fStopWordsPath = cmdline.getOptionValue(fStopWordsOption);
        String eVocabSrcPath = cmdline.getOptionValue(eVocabSrcOption);
        String fVocabSrcPath = cmdline.getOptionValue(fVocabSrcOption);
        String eVocabTgtPath = cmdline.getOptionValue(eVocabTgtOption);
        String fVocabTgtPath = cmdline.getOptionValue(fVocabTgtOption);
        String e2fProbsPath = cmdline.getOptionValue(e2fProbsOption);
        String f2eProbsPath = cmdline.getOptionValue(f2eProbsOption);
        int nSamples = Integer.parseInt(cmdline.getOptionValue(nSamplesOption));
        String sampleDocsFile = cmdline.getOptionValue(sampleDocsOption);
        LOG.info("Tool name: " + this.getClass().getName());
        LOG.info(" - nput file: " + inputPath);
        LOG.info(" - output file: " + outputPath);
        JobConf conf = new JobConf(getConf(), BruteForcePwsim.class);
        conf.setJobName(String.format("BruteForcePwsim[%s: %s]", OUTPUT, outputPath));
        conf.setLong("rseed", 1123456);
        conf.setInt("nSamples", nSamples);
        conf.set("eLang", eLang);
        conf.set("fLang", fLang);
        conf.set("eTokensFile", eTokensPath);
        conf.set("fTokensFile", fTokensPath);
        conf.set("eStopWordsFile", eStopWordsPath);
        conf.set("fStopWordsFile", fStopWordsPath);
        conf.set("eVocabSrcFile", eVocabSrcPath);
        conf.set("eVocabTgtFile", eVocabTgtPath);
        conf.set("fVocabSrcFile", fVocabSrcPath);
        conf.set("fVocabTgtFile", fVocabTgtPath);
        conf.set("probTablef2eFile", f2eProbsPath);
        conf.set("probTablee2fFile", e2fProbsPath);
        conf.set("sampleDocs", sampleDocsFile);
        conf.setNumMapTasks(20);
        conf.setNumReduceTasks(0);
        FileInputFormat.setInputPaths(conf, new Path(inputPath));
        FileOutputFormat.setOutputPath(conf, new Path(outputPath));
        conf.setMapperClass(SignatureMapper.class);
        conf.setInputFormat(SequenceFileInputFormat.class);
        conf.setOutputFormat(SequenceFileOutputFormat.class);
        conf.set("mapred.job.map.memory.mb", "2048");
        conf.set("mapred.map.child.java.opts", "-Xmx2048m");
        conf.set("mapred.job.reduce.memory.mb", "8000");
        conf.set("mapred.reduce.child.java.opts", "-Xmx8000m");
        conf.setMapOutputKeyClass(PairOfLongInt.class);
        conf.setMapOutputValueClass(ArrayListOfDoubles.class);
        Path outputDir = new Path(outputPath);
        FileSystem.get(conf).delete(outputDir, true);
        JobClient.runJob(conf);
        return 0;
    }

Output:
    public int run(String[] args) throws Exception {
        Options options = new Options();
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("output path").create(OUTPUT));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("input").create(INPUT));
        options.addOption(OptionBuilder.withArgName("string")
                .hasArg().withDescription("e language").create(eLangOption));
        options.addOption(OptionBuilder.withArgName("string")
                .hasArg().withDescription("f language").create(fLangOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("e stop words").create(eStopWordsOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("f stop words").create(fStopWordsOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("e tokens").create(eTokensOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("f tokens").create(fTokensOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("e vocab src").create(eVocabSrcOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("f vocab src").create(fVocabSrcOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("e vocab tgt").create(eVocabTgtOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("f vocab tgt").create(fVocabTgtOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("e2f prob table").create(e2fProbsOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("f2e prob table").create(f2eProbsOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("output path").create(OUTPUT));
        options.addOption(OptionBuilder.withArgName("integer")
                .hasArg().withDescription("n samples").create(nSamplesOption));
        options.addOption(OptionBuilder.withArgName("path")
                .hasArg().withDescription("sampled documents").create(sampleDocsOption));
        CommandLine cmdline;
        CommandLineParser parser = new GnuParser();
        try {
            cmdline = parser.parse(options, args);
        } catch (ParseException exp) {
            System.err.println("Error parsing command line: " + exp.getMessage());
            return -1;
        }
        if (!cmdline.hasOption(OUTPUT) || !cmdline.hasOption(INPUT)
                || !cmdline.hasOption(nSamplesOption)
                || !cmdline.hasOption(eVocabSrcOption) || !cmdline.hasOption(fVocabSrcOption)
                || !cmdline.hasOption(eVocabTgtOption) || !cmdline.hasOption(fVocabTgtOption)
                || !cmdline.hasOption(e2fProbsOption) || !cmdline.hasOption(f2eProbsOption)
                || !cmdline.hasOption(eLangOption) || !cmdline.hasOption(fLangOption)
                || !cmdline.hasOption(eStopWordsOption) || !cmdline.hasOption(fStopWordsOption)
                || !cmdline.hasOption(eTokensOption) || !cmdline.hasOption(fTokensOption)
                || !cmdline.hasOption(nSamplesOption) || !cmdline.hasOption(sampleDocsOption)
                ) {
            HelpFormatter formatter = new HelpFormatter();
            formatter.setWidth(120);
            formatter.printHelp(this.getClass().getName(), options);
            ToolRunner.printGenericCommandUsage(System.out);
            return -1;
        }
        String inputPath = cmdline.getOptionValue(INPUT);
        String outputPath = cmdline.getOptionValue(OUTPUT);
        String eLang = cmdline.getOptionValue(eLangOption);
        String fLang = cmdline.getOptionValue(fLangOption);
        String eTokensPath = cmdline.getOptionValue(eTokensOption);
        String fTokensPath = cmdline.getOptionValue(fTokensOption);
        String eStopWordsPath = cmdline.getOptionValue(eStopWordsOption);
        String fStopWordsPath = cmdline.getOptionValue(fStopWordsOption);
        String eVocabSrcPath = cmdline.getOptionValue(eVocabSrcOption);
        String fVocabSrcPath = cmdline.getOptionValue(fVocabSrcOption);
        String eVocabTgtPath = cmdline.getOptionValue(eVocabTgtOption);
        String fVocabTgtPath = cmdline.getOptionValue(fVocabTgtOption);
        String e2fProbsPath = cmdline.getOptionValue(e2fProbsOption);
        String f2eProbsPath = cmdline.getOptionValue(f2eProbsOption);
        int nSamples = Integer.parseInt(cmdline.getOptionValue(nSamplesOption));
        String sampleDocsFile = cmdline.getOptionValue(sampleDocsOption);
        LOG.info("Tool name: " + this.getClass().getName());
        LOG.info(" - nput file: " + inputPath);
        LOG.info(" - output file: " + outputPath);
        JobConf conf = new JobConf(getConf(), BruteForcePwsim.class);
        conf.setJobName(String.format("BruteForcePwsim[%s: %s]", OUTPUT, outputPath));
        conf.setLong("rseed", 1123456);
        conf.setInt("nSamples", nSamples);
        conf.set("eLang", eLang);
        conf.set("fLang", fLang);
        conf.set("eTokensFile", eTokensPath);
        conf.set("fTokensFile", fTokensPath);
        conf.set("eStopWordsFile", eStopWordsPath);
        conf.set("fStopWordsFile", fStopWordsPath);
        conf.set("eVocabSrcFile", eVocabSrcPath);
        conf.set("eVocabTgtFile", eVocabTgtPath);
        conf.set("fVocabSrcFile", fVocabSrcPath);
        conf.set("fVocabTgtFile", fVocabTgtPath);
        conf.set("probTablef2eFile", f2eProbsPath);
        conf.set("probTablee2fFile", e2fProbsPath);
        conf.set("sampleDocs", sampleDocsFile);
        conf.setNumMapTasks(20);
        conf.setNumReduceTasks(0);
        FileInputFormat.setInputPaths(conf, new Path(inputPath));
        FileOutputFormat.setOutputPath(conf, new Path(outputPath));
        conf.setMapperClass(SignatureMapper.class);
        conf.setInputFormat(SequenceFileInputFormat.class);
        conf.setOutputFormat(SequenceFileOutputFormat.class);
        conf.set("mapred.job.map.memory.mb", "2048");
        conf.set("mapred.map.child.java.opts", "-Xmx2048m");
        conf.set("mapred.job.reduce.memory.mb", "8000");
        conf.set("mapred.reduce.child.java.opts", "-Xmx8000m");
        conf.setOutputKeyClass(PairOfLongInt.class);
        conf.setOutputValueClass(ArrayListOfDoubles.class);
        Path outputDir = new Path(outputPath);
        FileSystem.get(conf).delete(outputDir, true);
        JobClient.runJob(conf);
        return 0;
    }


Input:
	public void initializeContent() {
		Boolean useUserHomeFolder = (Boolean) this.getAttributes().get("useUserHomeFolder");
		if (useUserHomeFolder != null && useUserHomeFolder.booleanValue()) {
			rootFolder = super.getIWSlideSession().getUserHomeFolder();
		}
		String startFolder = (String) this.getAttributes().get("startFolder");
		if (rootFolder == null) {
			rootFolder = (String) this.getAttributes().get("rootFolder");
		}
		WFBlock listBlock = new WFBlock();
		WFTitlebar tb = new WFTitlebar();
		tb.setValueRefTitle(true);
		tb.setTitleText("WebDAVListBean.webDAVPath");
		listBlock.setToolbarEmbeddedInTitlebar(true);
		listBlock.setTitlebar(tb);
		listBlock.setToolbar(getToolbar());
		WebDAVList list = new WebDAVList();
		list.setId(getId()+"_list");
		list.setRendered(renderWebDAVList);
		list.setStartFolder(startFolder);
		listBlock.add(list);
		WFBlock detailsBlock = new WFBlock();
		WFTitlebar detailsBar = new WFTitlebar();
		detailsBar.setTitleText(getBundle().getLocalizedText("document_details"));
		detailsBlock.setTitlebar(detailsBar);
		detailsBlock.setToolbar(getToolbar());
		WebDAVFileDetails details = new WebDAVFileDetails();
		details.setRendered(renderWebDAVFileDetails);
		details.setId(getId()+"_details");
		detailsBlock.add(details);
		WFBlock previewBlock = new WFBlock();
		WFTitlebar previewBar = new WFTitlebar();
		previewBar.setTitleText(getBundle().getLocalizedText("document_details"));
		previewBlock.setTitlebar(previewBar);
		previewBlock.setToolbar(getToolbar());
		WebDAVFileDetails details2 = new WebDAVFileDetails();
		details2.setRendered(renderWebDAVFilePreview);
		details2.setId(getId()+"_details");
		details2.setDetailed(false);
		WebDAVFilePreview preview = new WebDAVFilePreview();
		preview.setRendered(renderWebDAVFilePreview);
		preview.setId(getId()+"_preview");
		previewBlock.add(details2);
		WFBlock folderBlock = new WFBlock();
		WFTitlebar folderBar = new WFTitlebar();
		folderBar.setTitleText(getBundle().getLocalizedText("create_a_folder"));
		folderBlock.setTitlebar(folderBar);
		folderBlock.setToolbar(new WFToolbar());
		WebDAVFolderCreation folder = new WebDAVFolderCreation();
		folder.setRendered(renderWebDAVNewFolder);
		folder.setId(getId()+"_folder");
		folderBlock.add(folder);
		WFBlock uploadBlock = new WFBlock();
		WFTitlebar uploadBar = new WFTitlebar();
		uploadBar.setTitleText(getBundle().getLocalizedText("upload"));
		uploadBlock.setTitlebar(uploadBar);
		uploadBlock.setToolbar(new WFToolbar());
		WebDAVUpload upload = new WebDAVUpload();
		upload.setId(getId()+"_upload");
		uploadBlock.add(upload);
		WFBlock deleteBlock = new WFBlock();
		WFTitlebar deleteBar = new WFTitlebar();
		deleteBar.setTitleText(getBundle().getLocalizedText("delete"));
		deleteBlock.setTitlebar(deleteBar);
		deleteBlock.setToolbar(new WFToolbar());
		WebDAVDocumentDeleter deleter = new WebDAVDocumentDeleter();
		deleter.setRendered(renderWebDAVDeleter);
		deleter.setId(getId()+"_deleter");
		deleteBlock.add(deleter);
		getFacets().put(LIST, listBlock);
		getFacets().put(FILE_DETAILS, detailsBlock);
		getFacets().put(FILE_DETAILS_LESS, previewBlock);
		getFacets().put(PREVIEW, preview);
		getFacets().put(NEW_FOLDER, folderBlock);
		getFacets().put(UPLOAD, uploadBlock);
		getFacets().put(DELETE, deleteBlock);
	}

Output:
	public void initializeContent() {
		Boolean useUserHomeFolder = (Boolean) this.getAttributes().get("useUserHomeFolder");
		if (useUserHomeFolder != null && useUserHomeFolder.booleanValue()) {
			rootFolder = super.getIWSlideSession().getUserHomeFolder();
		}
		String startFolder = (String) this.getAttributes().get("startFolder");
		if (rootFolder == null) {
			rootFolder = (String) this.getAttributes().get("rootFolder");
		}
		WFBlock listBlock = new WFBlock();
		WFTitlebar tb = new WFTitlebar();
		tb.setValueRefTitle(true);
		tb.setTitleText("WebDAVListBean.webDAVPath");
		listBlock.setToolbarEmbeddedInTitlebar(true);
		listBlock.setTitlebar(tb);
		listBlock.setToolbar(getToolbar());
		WebDAVList list = new WebDAVList();
		list.setId(getId()+"_list");
		list.setRendered(renderWebDAVList);
		list.setStartFolder(startFolder);
		list.setRootFolder(rootFolder);
		listBlock.add(list);
		WFBlock detailsBlock = new WFBlock();
		WFTitlebar detailsBar = new WFTitlebar();
		detailsBar.setTitleText(getBundle().getLocalizedText("document_details"));
		detailsBlock.setTitlebar(detailsBar);
		detailsBlock.setToolbar(getToolbar());
		WebDAVFileDetails details = new WebDAVFileDetails();
		details.setRendered(renderWebDAVFileDetails);
		details.setId(getId()+"_details");
		detailsBlock.add(details);
		WFBlock previewBlock = new WFBlock();
		WFTitlebar previewBar = new WFTitlebar();
		previewBar.setTitleText(getBundle().getLocalizedText("document_details"));
		previewBlock.setTitlebar(previewBar);
		previewBlock.setToolbar(getToolbar());
		WebDAVFileDetails details2 = new WebDAVFileDetails();
		details2.setRendered(renderWebDAVFilePreview);
		details2.setId(getId()+"_details");
		details2.setDetailed(false);
		WebDAVFilePreview preview = new WebDAVFilePreview();
		preview.setRendered(renderWebDAVFilePreview);
		preview.setId(getId()+"_preview");
		previewBlock.add(details2);
		WFBlock folderBlock = new WFBlock();
		WFTitlebar folderBar = new WFTitlebar();
		folderBar.setTitleText(getBundle().getLocalizedText("create_a_folder"));
		folderBlock.setTitlebar(folderBar);
		folderBlock.setToolbar(new WFToolbar());
		WebDAVFolderCreation folder = new WebDAVFolderCreation();
		folder.setRendered(renderWebDAVNewFolder);
		folder.setId(getId()+"_folder");
		folderBlock.add(folder);
		WFBlock uploadBlock = new WFBlock();
		WFTitlebar uploadBar = new WFTitlebar();
		uploadBar.setTitleText(getBundle().getLocalizedText("upload"));
		uploadBlock.setTitlebar(uploadBar);
		uploadBlock.setToolbar(new WFToolbar());
		WebDAVUpload upload = new WebDAVUpload();
		upload.setId(getId()+"_upload");
		uploadBlock.add(upload);
		WFBlock deleteBlock = new WFBlock();
		WFTitlebar deleteBar = new WFTitlebar();
		deleteBar.setTitleText(getBundle().getLocalizedText("delete"));
		deleteBlock.setTitlebar(deleteBar);
		deleteBlock.setToolbar(new WFToolbar());
		WebDAVDocumentDeleter deleter = new WebDAVDocumentDeleter();
		deleter.setRendered(renderWebDAVDeleter);
		deleter.setId(getId()+"_deleter");
		deleteBlock.add(deleter);
		getFacets().put(LIST, listBlock);
		getFacets().put(FILE_DETAILS, detailsBlock);
		getFacets().put(FILE_DETAILS_LESS, previewBlock);
		getFacets().put(PREVIEW, preview);
		getFacets().put(NEW_FOLDER, folderBlock);
		getFacets().put(UPLOAD, uploadBlock);
		getFacets().put(DELETE, deleteBlock);
	}