Input:
	private Container getUI() {
		userCertificatePanel = new UserCertificatePanel(this) {
			private static final long serialVersionUID = 1L;
			@Override
			public Insets getInsets() {
				return Utils.INSETS;
			}
			@Override
			public boolean isAllowEmail() {
				return mail.isReady();
			}
			@Override
			public Date getDefaultExpiration() {
				Calendar c = Calendar.getInstance();
				c.add(Calendar.DATE, defaultDuration);
				c.set(Calendar.HOUR_OF_DAY, 0);
				c.set(Calendar.MINUTE, 0);
				c.set(Calendar.SECOND, 0);
				c.set(Calendar.MILLISECOND, 0);
				return c.getTime();
			}
			@Override
			public boolean saveUser(String username, UserCertificateModel ucm) {
				return userService.updateUserModel(username, ucm.user);
			}
			@Override
			public boolean newCertificate(UserCertificateModel ucm, X509Metadata metadata, boolean sendEmail) {
				if (!prepareX509Infrastructure()) {
					return false;
				}
				Date notAfter = metadata.notAfter;
				setMetadataDefaults(metadata);
				metadata.notAfter = notAfter;
				UserModel user = ucm.user;
				if (!StringUtils.isEmpty(user.organizationalUnit)) {
					metadata.oids.put("OU", user.organizationalUnit);
				}
				if (!StringUtils.isEmpty(user.organization)) {
					metadata.oids.put("O", user.organization);
				}
				if (!StringUtils.isEmpty(user.locality)) {
					metadata.oids.put("L", user.locality);
				}
				if (!StringUtils.isEmpty(user.stateProvince)) {
					metadata.oids.put("ST", user.stateProvince);
				}
				if (!StringUtils.isEmpty(user.countryCode)) {
					metadata.oids.put("C", user.countryCode);
				}
				File caKeystoreFile = new File(folder, X509Utils.CA_KEY_STORE);
				File zip = X509Utils.newClientBundle(metadata, caKeystoreFile, caKeystorePassword, GitblitAuthority.this);
				if (ucm.expires == null || metadata.notAfter.before(ucm.expires)) {
					ucm.expires = metadata.notAfter;
				}
				updateAuthorityConfig(ucm);
				ucm.certs = null;
				int modelIndex = table.convertRowIndexToModel(table.getSelectedRow());
				tableModel.fireTableDataChanged();
				table.getSelectionModel().setSelectionInterval(modelIndex, modelIndex);
				if (sendEmail) {
					sendEmail(user, metadata, zip);
				}
				return true;
			}
			@Override
			public boolean revoke(UserCertificateModel ucm, X509Certificate cert, RevocationReason reason) {
				if (!prepareX509Infrastructure()) {
					return false;
				}
				File caRevocationList = new File(folder, X509Utils.CA_REVOCATION_LIST);
				File caKeystoreFile = new File(folder, X509Utils.CA_KEY_STORE);
				if (X509Utils.revoke(cert, reason, caRevocationList, caKeystoreFile, caKeystorePassword, GitblitAuthority.this)) {
					File certificatesConfigFile = new File(folder, X509Utils.CA_CONFIG);
					FileBasedConfig config = new FileBasedConfig(certificatesConfigFile, FS.detect());
					if (certificatesConfigFile.exists()) {
						try {
							config.load();
						} catch (Exception e) {
							Utils.showException(GitblitAuthority.this, e);
						}
					}
					ucm.revoke(cert.getSerialNumber(), reason);
					ucm.update(config);
					try {
						config.save();
					} catch (Exception e) {
						Utils.showException(GitblitAuthority.this, e);
					}
					ucm.certs = null;
					int modelIndex = table.convertRowIndexToModel(table.getSelectedRow());
					tableModel.fireTableDataChanged();
					table.getSelectionModel().setSelectionInterval(modelIndex, modelIndex);
					return true;
				}
				return false;
			}
		};
		table = Utils.newTable(tableModel, Utils.DATE_FORMAT);
		table.setRowSorter(defaultSorter);
		table.setDefaultRenderer(CertificateStatus.class, new CertificateStatusRenderer());
		table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
			@Override
			public void valueChanged(ListSelectionEvent e) {
				if (e.getValueIsAdjusting()) {
					return;
				}
				int row = table.getSelectedRow();
				if (row < 0) {
					return;
				}
				int modelIndex = table.convertRowIndexToModel(row);
				UserCertificateModel ucm = tableModel.get(modelIndex);
				if (ucm.certs == null) {
					ucm.certs = findCerts(folder, ucm.user.username);
				}
				userCertificatePanel.setUserCertificateModel(ucm);
			}
		});
		JPanel usersPanel = new JPanel(new BorderLayout()) {
			private static final long serialVersionUID = 1L;
			@Override
			public Insets getInsets() {
				return Utils.INSETS;
			}
		};
		usersPanel.add(new HeaderPanel(Translation.get("gb.users"), "users_16x16.png"), BorderLayout.NORTH);
		usersPanel.add(new JScrollPane(table), BorderLayout.CENTER);
		usersPanel.setMinimumSize(new Dimension(400, 10));
		certificateDefaultsButton = new JButton(new ImageIcon(getClass().getResource("/settings_16x16.png")));
		certificateDefaultsButton.setFocusable(false);
		certificateDefaultsButton.setToolTipText(Translation.get("gb.newCertificateDefaults"));
		certificateDefaultsButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				X509Metadata metadata = new X509Metadata("whocares", "whocares");
				File certificatesConfigFile = new File(folder, X509Utils.CA_CONFIG);
				FileBasedConfig config = new FileBasedConfig(certificatesConfigFile, FS.detect());
				NewCertificateConfig certificateConfig = null;
				if (certificatesConfigFile.exists()) {
					try {
						config.load();
					} catch (Exception x) {
						Utils.showException(GitblitAuthority.this, x);
					}
					certificateConfig = NewCertificateConfig.KEY.parse(config);
					certificateConfig.update(metadata);
				}
				InputVerifier verifier = new InputVerifier() {
					public boolean verify(JComponent comp) {
						boolean returnValue;
						JTextField textField = (JTextField) comp;
						try {
							Integer.parseInt(textField.getText());
							returnValue = true;
						} catch (NumberFormatException e) {
							returnValue = false;
						}
						return returnValue;
					}
				};
				JTextField siteNameTF = new JTextField(20);
				siteNameTF.setText(gitblitSettings.getString(Keys.web.siteName, "Gitblit"));
				JPanel siteNamePanel = Utils.newFieldPanel(Translation.get("gb.siteName"),
						siteNameTF, Translation.get("gb.siteNameDescription"));
				JTextField validityTF = new JTextField(4);
				validityTF.setInputVerifier(verifier);
				validityTF.setVerifyInputWhenFocusTarget(true);
				validityTF.setText("" + certificateConfig.duration);
				JPanel validityPanel = Utils.newFieldPanel(Translation.get("gb.validity"),
						validityTF, Translation.get("gb.duration.days").replace("{0}",  "").trim());
				JPanel p1 = new JPanel(new GridLayout(0, 1, 5, 2));
				p1.add(siteNamePanel);
				p1.add(validityPanel);
				DefaultOidsPanel oids = new DefaultOidsPanel(metadata);
				JPanel panel = new JPanel(new BorderLayout());
				panel.add(p1, BorderLayout.NORTH);
				panel.add(oids, BorderLayout.CENTER);
				int result = JOptionPane.showConfirmDialog(GitblitAuthority.this,
						panel, Translation.get("gb.newCertificateDefaults"), JOptionPane.OK_CANCEL_OPTION,
						JOptionPane.QUESTION_MESSAGE, new ImageIcon(getClass().getResource("/settings_32x32.png")));
				if (result == JOptionPane.OK_OPTION) {
					try {
						oids.update(metadata);
						certificateConfig.duration = Integer.parseInt(validityTF.getText());
						certificateConfig.store(config, metadata);
						config.save();
						Map<String, String> updates = new HashMap<String, String>();
						updates.put(Keys.web.siteName, siteNameTF.getText());
						gitblitSettings.saveSettings(updates);
					} catch (Exception e1) {
						Utils.showException(GitblitAuthority.this, e1);
					}
				}
			}
		});
		newSSLCertificate = new JButton(new ImageIcon(getClass().getResource("/rosette_16x16.png")));
		newSSLCertificate.setFocusable(false);
		newSSLCertificate.setToolTipText(Translation.get("gb.newSSLCertificate"));
		newSSLCertificate.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				Date defaultExpiration = new Date(System.currentTimeMillis() + 10*TimeUtils.ONEYEAR);
				NewSSLCertificateDialog dialog = new NewSSLCertificateDialog(GitblitAuthority.this, defaultExpiration);
				dialog.setModal(true);
				dialog.setVisible(true);
				if (dialog.isCanceled()) {
					return;
				}
				final Date expires = dialog.getExpiration();
				final String hostname = dialog.getHostname();
				final boolean serveCertificate = dialog.isServeCertificate();
				AuthorityWorker worker = new AuthorityWorker(GitblitAuthority.this) {
					@Override
					protected Boolean doRequest() throws IOException {
						if (!prepareX509Infrastructure()) {
							return false;
						}
						File caKeystoreFile = new File(folder, X509Utils.CA_KEY_STORE);
						PrivateKey caPrivateKey = X509Utils.getPrivateKey(X509Utils.CA_ALIAS, caKeystoreFile, caKeystorePassword);
						X509Certificate caCert = X509Utils.getCertificate(X509Utils.CA_ALIAS, caKeystoreFile, caKeystorePassword);
						X509Metadata metadata = new X509Metadata(hostname, caKeystorePassword);
						setMetadataDefaults(metadata);
						metadata.notAfter = expires;
						File serverKeystoreFile = new File(folder, X509Utils.SERVER_KEY_STORE);
						X509Certificate cert = X509Utils.newSSLCertificate(metadata, caPrivateKey, caCert, serverKeystoreFile, GitblitAuthority.this);
						boolean hasCert = cert != null;
						if (hasCert && serveCertificate) {
							Map<String, String> updates = new HashMap<String, String>();
							updates.put(Keys.server.certificateAlias, metadata.commonName);
							gitblitSettings.saveSettings(updates);
						}
						return hasCert;
					}
					@Override
					protected void onSuccess() {
						if (serveCertificate) {
							JOptionPane.showMessageDialog(GitblitAuthority.this,
									MessageFormat.format(Translation.get("gb.sslCertificateGeneratedRestart"), hostname),
									Translation.get("gb.newSSLCertificate"), JOptionPane.INFORMATION_MESSAGE);
						} else {
							JOptionPane.showMessageDialog(GitblitAuthority.this,
								MessageFormat.format(Translation.get("gb.sslCertificateGenerated"), hostname),
								Translation.get("gb.newSSLCertificate"), JOptionPane.INFORMATION_MESSAGE);
						}
					}
				};
				worker.execute();
			}
		});
		JButton emailBundle = new JButton(new ImageIcon(getClass().getResource("/mail_16x16.png")));
		emailBundle.setFocusable(false);
		emailBundle.setToolTipText(Translation.get("gb.emailCertificateBundle"));
		emailBundle.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				int row = table.getSelectedRow();
				if (row < 0) {
					return;
				}
				int modelIndex = table.convertRowIndexToModel(row);
				final UserCertificateModel ucm = tableModel.get(modelIndex);
				if (ArrayUtils.isEmpty(ucm.certs)) {
					JOptionPane.showMessageDialog(GitblitAuthority.this, MessageFormat.format(Translation.get("gb.pleaseGenerateClientCertificate"), ucm.user.getDisplayName()));
				}
				final File zip = new File(folder, X509Utils.CERTS + File.separator + ucm.user.username + File.separator + ucm.user.username + ".zip");
				if (!zip.exists()) {
					return;
				}
				AuthorityWorker worker = new AuthorityWorker(GitblitAuthority.this) {
					@Override
					protected Boolean doRequest() throws IOException {
						X509Metadata metadata = new X509Metadata(ucm.user.username, "whocares");
						metadata.serverHostname = gitblitSettings.getString(Keys.web.siteName, Constants.NAME);
						if (StringUtils.isEmpty(metadata.serverHostname)) {
							metadata.serverHostname = Constants.NAME;
						}
						metadata.userDisplayname = ucm.user.getDisplayName();
						return sendEmail(ucm.user, metadata, zip);
					}
					@Override
					protected void onSuccess() {
						JOptionPane.showMessageDialog(GitblitAuthority.this, MessageFormat.format(Translation.get("gb.clientCertificateBundleSent"),
								ucm.user.getDisplayName()));
					}
				};
				worker.execute();
			}
		});
		JButton logButton = new JButton(new ImageIcon(getClass().getResource("/script_16x16.png")));
		logButton.setFocusable(false);
		logButton.setToolTipText(Translation.get("gb.log"));
		logButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				File log = new File(folder, X509Utils.CERTS + File.separator + "log.txt");
				if (log.exists()) {
					String content = FileUtils.readContent(log,  "\n");
					JTextArea textarea = new JTextArea(content);
					JScrollPane scrollPane = new JScrollPane(textarea);
					scrollPane.setPreferredSize(new Dimension(700, 400));
					JOptionPane.showMessageDialog(GitblitAuthority.this, scrollPane, log.getAbsolutePath(), JOptionPane.INFORMATION_MESSAGE);
				}
			}
		});
		final JTextField filterTextfield = new JTextField(15);
		filterTextfield.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				filterUsers(filterTextfield.getText());
			}
		});
		filterTextfield.addKeyListener(new KeyAdapter() {
			public void keyReleased(KeyEvent e) {
				filterUsers(filterTextfield.getText());
			}
		});
		JToolBar buttonControls = new JToolBar(JToolBar.HORIZONTAL);
		buttonControls.setFloatable(false);
		buttonControls.add(certificateDefaultsButton);
		buttonControls.add(newSSLCertificate);
		buttonControls.add(emailBundle);
		buttonControls.add(logButton);
		JPanel userControls = new JPanel(new FlowLayout(FlowLayout.RIGHT, Utils.MARGIN, Utils.MARGIN));
		userControls.add(new JLabel(Translation.get("gb.filter")));
		userControls.add(filterTextfield);
		JPanel topPanel = new JPanel(new BorderLayout(0, 0));
		topPanel.add(buttonControls, BorderLayout.WEST);
		topPanel.add(userControls, BorderLayout.EAST);
		JPanel leftPanel = new JPanel(new BorderLayout());
		leftPanel.add(topPanel, BorderLayout.NORTH);
		leftPanel.add(usersPanel, BorderLayout.CENTER);
		userCertificatePanel.setMinimumSize(new Dimension(375, 10));
		JLabel statusLabel = new JLabel();
		statusLabel.setHorizontalAlignment(SwingConstants.RIGHT);
		if (X509Utils.unlimitedStrength) {
			statusLabel.setText("JCE Unlimited Strength Jurisdiction Policy");
		} else {
			statusLabel.setText("JCE Standard Encryption Policy");
		}
		JPanel root = new JPanel(new BorderLayout()) {
			private static final long serialVersionUID = 1L;
			public Insets getInsets() {
				return Utils.INSETS;
			}
		};
		JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, userCertificatePanel);
		splitPane.setDividerLocation(1d);
		root.add(splitPane, BorderLayout.CENTER);
		root.add(statusLabel, BorderLayout.SOUTH);
		return root;
	}

Output:
	private Container getUI() {
		userCertificatePanel = new UserCertificatePanel(this) {
			private static final long serialVersionUID = 1L;
			@Override
			public Insets getInsets() {
				return Utils.INSETS;
			}
			@Override
			public boolean isAllowEmail() {
				return mail.isReady();
			}
			@Override
			public Date getDefaultExpiration() {
				Calendar c = Calendar.getInstance();
				c.add(Calendar.DATE, defaultDuration);
				c.set(Calendar.HOUR_OF_DAY, 0);
				c.set(Calendar.MINUTE, 0);
				c.set(Calendar.SECOND, 0);
				c.set(Calendar.MILLISECOND, 0);
				return c.getTime();
			}
			@Override
			public boolean saveUser(String username, UserCertificateModel ucm) {
				return userService.updateUserModel(username, ucm.user);
			}
			@Override
			public boolean newCertificate(UserCertificateModel ucm, X509Metadata metadata, boolean sendEmail) {
				if (!prepareX509Infrastructure()) {
					return false;
				}
				Date notAfter = metadata.notAfter;
				setMetadataDefaults(metadata);
				metadata.notAfter = notAfter;
				UserModel user = ucm.user;
				if (!StringUtils.isEmpty(user.organizationalUnit)) {
					metadata.oids.put("OU", user.organizationalUnit);
				}
				if (!StringUtils.isEmpty(user.organization)) {
					metadata.oids.put("O", user.organization);
				}
				if (!StringUtils.isEmpty(user.locality)) {
					metadata.oids.put("L", user.locality);
				}
				if (!StringUtils.isEmpty(user.stateProvince)) {
					metadata.oids.put("ST", user.stateProvince);
				}
				if (!StringUtils.isEmpty(user.countryCode)) {
					metadata.oids.put("C", user.countryCode);
				}
				File caKeystoreFile = new File(folder, X509Utils.CA_KEY_STORE);
				File zip = X509Utils.newClientBundle(metadata, caKeystoreFile, caKeystorePassword, GitblitAuthority.this);
				if (ucm.expires == null || metadata.notAfter.before(ucm.expires)) {
					ucm.expires = metadata.notAfter;
				}
				updateAuthorityConfig(ucm);
				ucm.certs = null;
				int selectedIndex = table.getSelectedRow();
				tableModel.fireTableDataChanged();
				table.getSelectionModel().setSelectionInterval(selectedIndex, selectedIndex);
				if (sendEmail) {
					sendEmail(user, metadata, zip);
				}
				return true;
			}
			@Override
			public boolean revoke(UserCertificateModel ucm, X509Certificate cert, RevocationReason reason) {
				if (!prepareX509Infrastructure()) {
					return false;
				}
				File caRevocationList = new File(folder, X509Utils.CA_REVOCATION_LIST);
				File caKeystoreFile = new File(folder, X509Utils.CA_KEY_STORE);
				if (X509Utils.revoke(cert, reason, caRevocationList, caKeystoreFile, caKeystorePassword, GitblitAuthority.this)) {
					File certificatesConfigFile = new File(folder, X509Utils.CA_CONFIG);
					FileBasedConfig config = new FileBasedConfig(certificatesConfigFile, FS.detect());
					if (certificatesConfigFile.exists()) {
						try {
							config.load();
						} catch (Exception e) {
							Utils.showException(GitblitAuthority.this, e);
						}
					}
					ucm.revoke(cert.getSerialNumber(), reason);
					ucm.update(config);
					try {
						config.save();
					} catch (Exception e) {
						Utils.showException(GitblitAuthority.this, e);
					}
					ucm.certs = null;
					int modelIndex = table.convertRowIndexToModel(table.getSelectedRow());
					tableModel.fireTableDataChanged();
					table.getSelectionModel().setSelectionInterval(modelIndex, modelIndex);
					return true;
				}
				return false;
			}
		};
		table = Utils.newTable(tableModel, Utils.DATE_FORMAT);
		table.setRowSorter(defaultSorter);
		table.setDefaultRenderer(CertificateStatus.class, new CertificateStatusRenderer());
		table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
			@Override
			public void valueChanged(ListSelectionEvent e) {
				if (e.getValueIsAdjusting()) {
					return;
				}
				int row = table.getSelectedRow();
				if (row < 0) {
					return;
				}
				int modelIndex = table.convertRowIndexToModel(row);
				UserCertificateModel ucm = tableModel.get(modelIndex);
				if (ucm.certs == null) {
					ucm.certs = findCerts(folder, ucm.user.username);
				}
				userCertificatePanel.setUserCertificateModel(ucm);
			}
		});
		JPanel usersPanel = new JPanel(new BorderLayout()) {
			private static final long serialVersionUID = 1L;
			@Override
			public Insets getInsets() {
				return Utils.INSETS;
			}
		};
		usersPanel.add(new HeaderPanel(Translation.get("gb.users"), "users_16x16.png"), BorderLayout.NORTH);
		usersPanel.add(new JScrollPane(table), BorderLayout.CENTER);
		usersPanel.setMinimumSize(new Dimension(400, 10));
		certificateDefaultsButton = new JButton(new ImageIcon(getClass().getResource("/settings_16x16.png")));
		certificateDefaultsButton.setFocusable(false);
		certificateDefaultsButton.setToolTipText(Translation.get("gb.newCertificateDefaults"));
		certificateDefaultsButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				X509Metadata metadata = new X509Metadata("whocares", "whocares");
				File certificatesConfigFile = new File(folder, X509Utils.CA_CONFIG);
				FileBasedConfig config = new FileBasedConfig(certificatesConfigFile, FS.detect());
				NewCertificateConfig certificateConfig = null;
				if (certificatesConfigFile.exists()) {
					try {
						config.load();
					} catch (Exception x) {
						Utils.showException(GitblitAuthority.this, x);
					}
					certificateConfig = NewCertificateConfig.KEY.parse(config);
					certificateConfig.update(metadata);
				}
				InputVerifier verifier = new InputVerifier() {
					public boolean verify(JComponent comp) {
						boolean returnValue;
						JTextField textField = (JTextField) comp;
						try {
							Integer.parseInt(textField.getText());
							returnValue = true;
						} catch (NumberFormatException e) {
							returnValue = false;
						}
						return returnValue;
					}
				};
				JTextField siteNameTF = new JTextField(20);
				siteNameTF.setText(gitblitSettings.getString(Keys.web.siteName, "Gitblit"));
				JPanel siteNamePanel = Utils.newFieldPanel(Translation.get("gb.siteName"),
						siteNameTF, Translation.get("gb.siteNameDescription"));
				JTextField validityTF = new JTextField(4);
				validityTF.setInputVerifier(verifier);
				validityTF.setVerifyInputWhenFocusTarget(true);
				validityTF.setText("" + certificateConfig.duration);
				JPanel validityPanel = Utils.newFieldPanel(Translation.get("gb.validity"),
						validityTF, Translation.get("gb.duration.days").replace("{0}",  "").trim());
				JPanel p1 = new JPanel(new GridLayout(0, 1, 5, 2));
				p1.add(siteNamePanel);
				p1.add(validityPanel);
				DefaultOidsPanel oids = new DefaultOidsPanel(metadata);
				JPanel panel = new JPanel(new BorderLayout());
				panel.add(p1, BorderLayout.NORTH);
				panel.add(oids, BorderLayout.CENTER);
				int result = JOptionPane.showConfirmDialog(GitblitAuthority.this,
						panel, Translation.get("gb.newCertificateDefaults"), JOptionPane.OK_CANCEL_OPTION,
						JOptionPane.QUESTION_MESSAGE, new ImageIcon(getClass().getResource("/settings_32x32.png")));
				if (result == JOptionPane.OK_OPTION) {
					try {
						oids.update(metadata);
						certificateConfig.duration = Integer.parseInt(validityTF.getText());
						certificateConfig.store(config, metadata);
						config.save();
						Map<String, String> updates = new HashMap<String, String>();
						updates.put(Keys.web.siteName, siteNameTF.getText());
						gitblitSettings.saveSettings(updates);
					} catch (Exception e1) {
						Utils.showException(GitblitAuthority.this, e1);
					}
				}
			}
		});
		newSSLCertificate = new JButton(new ImageIcon(getClass().getResource("/rosette_16x16.png")));
		newSSLCertificate.setFocusable(false);
		newSSLCertificate.setToolTipText(Translation.get("gb.newSSLCertificate"));
		newSSLCertificate.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				Date defaultExpiration = new Date(System.currentTimeMillis() + 10*TimeUtils.ONEYEAR);
				NewSSLCertificateDialog dialog = new NewSSLCertificateDialog(GitblitAuthority.this, defaultExpiration);
				dialog.setModal(true);
				dialog.setVisible(true);
				if (dialog.isCanceled()) {
					return;
				}
				final Date expires = dialog.getExpiration();
				final String hostname = dialog.getHostname();
				final boolean serveCertificate = dialog.isServeCertificate();
				AuthorityWorker worker = new AuthorityWorker(GitblitAuthority.this) {
					@Override
					protected Boolean doRequest() throws IOException {
						if (!prepareX509Infrastructure()) {
							return false;
						}
						File caKeystoreFile = new File(folder, X509Utils.CA_KEY_STORE);
						PrivateKey caPrivateKey = X509Utils.getPrivateKey(X509Utils.CA_ALIAS, caKeystoreFile, caKeystorePassword);
						X509Certificate caCert = X509Utils.getCertificate(X509Utils.CA_ALIAS, caKeystoreFile, caKeystorePassword);
						X509Metadata metadata = new X509Metadata(hostname, caKeystorePassword);
						setMetadataDefaults(metadata);
						metadata.notAfter = expires;
						File serverKeystoreFile = new File(folder, X509Utils.SERVER_KEY_STORE);
						X509Certificate cert = X509Utils.newSSLCertificate(metadata, caPrivateKey, caCert, serverKeystoreFile, GitblitAuthority.this);
						boolean hasCert = cert != null;
						if (hasCert && serveCertificate) {
							Map<String, String> updates = new HashMap<String, String>();
							updates.put(Keys.server.certificateAlias, metadata.commonName);
							gitblitSettings.saveSettings(updates);
						}
						return hasCert;
					}
					@Override
					protected void onSuccess() {
						if (serveCertificate) {
							JOptionPane.showMessageDialog(GitblitAuthority.this,
									MessageFormat.format(Translation.get("gb.sslCertificateGeneratedRestart"), hostname),
									Translation.get("gb.newSSLCertificate"), JOptionPane.INFORMATION_MESSAGE);
						} else {
							JOptionPane.showMessageDialog(GitblitAuthority.this,
								MessageFormat.format(Translation.get("gb.sslCertificateGenerated"), hostname),
								Translation.get("gb.newSSLCertificate"), JOptionPane.INFORMATION_MESSAGE);
						}
					}
				};
				worker.execute();
			}
		});
		JButton emailBundle = new JButton(new ImageIcon(getClass().getResource("/mail_16x16.png")));
		emailBundle.setFocusable(false);
		emailBundle.setToolTipText(Translation.get("gb.emailCertificateBundle"));
		emailBundle.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				int row = table.getSelectedRow();
				if (row < 0) {
					return;
				}
				int modelIndex = table.convertRowIndexToModel(row);
				final UserCertificateModel ucm = tableModel.get(modelIndex);
				if (ArrayUtils.isEmpty(ucm.certs)) {
					JOptionPane.showMessageDialog(GitblitAuthority.this, MessageFormat.format(Translation.get("gb.pleaseGenerateClientCertificate"), ucm.user.getDisplayName()));
				}
				final File zip = new File(folder, X509Utils.CERTS + File.separator + ucm.user.username + File.separator + ucm.user.username + ".zip");
				if (!zip.exists()) {
					return;
				}
				AuthorityWorker worker = new AuthorityWorker(GitblitAuthority.this) {
					@Override
					protected Boolean doRequest() throws IOException {
						X509Metadata metadata = new X509Metadata(ucm.user.username, "whocares");
						metadata.serverHostname = gitblitSettings.getString(Keys.web.siteName, Constants.NAME);
						if (StringUtils.isEmpty(metadata.serverHostname)) {
							metadata.serverHostname = Constants.NAME;
						}
						metadata.userDisplayname = ucm.user.getDisplayName();
						return sendEmail(ucm.user, metadata, zip);
					}
					@Override
					protected void onSuccess() {
						JOptionPane.showMessageDialog(GitblitAuthority.this, MessageFormat.format(Translation.get("gb.clientCertificateBundleSent"),
								ucm.user.getDisplayName()));
					}
				};
				worker.execute();
			}
		});
		JButton logButton = new JButton(new ImageIcon(getClass().getResource("/script_16x16.png")));
		logButton.setFocusable(false);
		logButton.setToolTipText(Translation.get("gb.log"));
		logButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				File log = new File(folder, X509Utils.CERTS + File.separator + "log.txt");
				if (log.exists()) {
					String content = FileUtils.readContent(log,  "\n");
					JTextArea textarea = new JTextArea(content);
					JScrollPane scrollPane = new JScrollPane(textarea);
					scrollPane.setPreferredSize(new Dimension(700, 400));
					JOptionPane.showMessageDialog(GitblitAuthority.this, scrollPane, log.getAbsolutePath(), JOptionPane.INFORMATION_MESSAGE);
				}
			}
		});
		final JTextField filterTextfield = new JTextField(15);
		filterTextfield.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				filterUsers(filterTextfield.getText());
			}
		});
		filterTextfield.addKeyListener(new KeyAdapter() {
			public void keyReleased(KeyEvent e) {
				filterUsers(filterTextfield.getText());
			}
		});
		JToolBar buttonControls = new JToolBar(JToolBar.HORIZONTAL);
		buttonControls.setFloatable(false);
		buttonControls.add(certificateDefaultsButton);
		buttonControls.add(newSSLCertificate);
		buttonControls.add(emailBundle);
		buttonControls.add(logButton);
		JPanel userControls = new JPanel(new FlowLayout(FlowLayout.RIGHT, Utils.MARGIN, Utils.MARGIN));
		userControls.add(new JLabel(Translation.get("gb.filter")));
		userControls.add(filterTextfield);
		JPanel topPanel = new JPanel(new BorderLayout(0, 0));
		topPanel.add(buttonControls, BorderLayout.WEST);
		topPanel.add(userControls, BorderLayout.EAST);
		JPanel leftPanel = new JPanel(new BorderLayout());
		leftPanel.add(topPanel, BorderLayout.NORTH);
		leftPanel.add(usersPanel, BorderLayout.CENTER);
		userCertificatePanel.setMinimumSize(new Dimension(375, 10));
		JLabel statusLabel = new JLabel();
		statusLabel.setHorizontalAlignment(SwingConstants.RIGHT);
		if (X509Utils.unlimitedStrength) {
			statusLabel.setText("JCE Unlimited Strength Jurisdiction Policy");
		} else {
			statusLabel.setText("JCE Standard Encryption Policy");
		}
		JPanel root = new JPanel(new BorderLayout()) {
			private static final long serialVersionUID = 1L;
			public Insets getInsets() {
				return Utils.INSETS;
			}
		};
		JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, userCertificatePanel);
		splitPane.setDividerLocation(1d);
		root.add(splitPane, BorderLayout.CENTER);
		root.add(statusLabel, BorderLayout.SOUTH);
		return root;
	}


Input:
    private void hookupKeybindings() {
        input = new SimpleInputMethod();
        input.connect(new InputMethod.Commit() {
            public void onCommit(InputMethod source, String text) {
                insertText(text);
            }
        });
        view.connect(new Widget.KeyPressEvent() {
            public boolean onKeyPressEvent(Widget source, EventKey event) {
                final Keyval key;
                final ModifierType mod;
                if (input.filterKeypress(event)) {
                    return true;
                }
                key = event.getKeyval();
                if ((key == Keyval.Up) || (key == Keyval.Right)) {
                    if (insertOffset == 0) {
                        return false;
                    }
                }
                if ((key == Keyval.Down) || (key == Keyval.Left)) {
                    if (insertOffset == chain.length()) {
                        return false;
                    }
                }
                if ((key == Keyval.Home) || (key == Keyval.End) || (key == Keyval.PageUp)
                        || (key == Keyval.PageDown) || (key == Keyval.Compose)) {
                    return false;
                }
                if ((key == Keyval.F1) || (key == Keyval.F2) || (key == Keyval.F3) || (key == Keyval.F4)
                        || (key == Keyval.F5) || (key == Keyval.F6) || (key == Keyval.F7)
                        || (key == Keyval.F8) || (key == Keyval.F9) || (key == Keyval.F10)
                        || ((key == Keyval.F11) || (key == Keyval.F12))) {
                    return false;
                }
                if (key == Keyval.Escape) {
                    return true;
                }
                if (key == Keyval.Insert) {
                    popupInsertMenu();
                    return true;
                }
                if (key == Keyval.Return) {
                    insertMarkup = null;
                    return false;
                } else if (key == Keyval.Delete) {
                    deleteAt();
                    return true;
                } else if (key == Keyval.BackSpace) {
                    deleteBack();
                    return true;
                }
                if (key == Keyval.Menu) {
                    return false;
                }
                if ((key == Keyval.ShiftLeft) || (key == Keyval.ShiftRight) || (key == Keyval.AltLeft)
                        || (key == Keyval.AltRight) || (key == Keyval.ControlLeft)
                        || (key == Keyval.ControlRight) || (key == Keyval.SuperLeft)
                        || (key == Keyval.SuperRight)) {
                    return false;
                }
                if (key == Keyval.Tab) {
                    if (isCodeBlock()) {
                        return false;
                    } else {
                        return true;
                    }
                }
                mod = event.getState();
                if ((mod == ModifierType.NONE) || (mod == ModifierType.SHIFT_MASK)) {
                    return false;
                }
                if (mod == ModifierType.CONTROL_MASK) {
                    if (key == Keyval.a) {
                        return false;
                    } else if (key == Keyval.b) {
                        toggleMarkup(Common.BOLD);
                        return true;
                    } else if (key == Keyval.c) {
                        copyText();
                        return true;
                    } else if (key == Keyval.g) {
                        insertImage();
                        return true;
                    } else if (key == Keyval.i) {
                        toggleMarkup(Common.ITALICS);
                        return true;
                    } else if (key == Keyval.v) {
                        pasteText();
                        return true;
                    } else if (key == Keyval.x) {
                        cutText();
                        return true;
                    } else {
                        return false;
                    }
                } else if (mod.contains(ModifierType.CONTROL_MASK)
                        && mod.contains(ModifierType.SHIFT_MASK)) {
                    if (key == Keyval.Space) {
                        clearFormat();
                        return true;
                    } else if (key == Keyval.A) {
                        toggleMarkup(Common.APPLICATION);
                        return true;
                    } else if (key == Keyval.L) {
                        toggleMarkup(Common.LITERAL);
                        return true;
                    } else if (key == Keyval.F) {
                        toggleMarkup(Common.FILENAME);
                        return true;
                    } else if (key == Keyval.M) {
                        toggleMarkup(Common.FUNCTION);
                        return true;
                    } else if (key == Keyval.O) {
                        toggleMarkup(Common.COMMAND);
                        return true;
                    } else if (key == Keyval.T) {
                        toggleMarkup(Common.TYPE);
                        return true;
                    } else if (key == Keyval.U) {
                        return false;
                    } else {
                        return false;
                    }
                } else if (mod == ModifierType.LOCK_MASK) {
                    return false;
                }
                throw new IllegalStateException("\n" + "Unhandled " + key + " with " + mod);
            }
        });
        view.connect(new Widget.KeyReleaseEvent() {
            public boolean onKeyReleaseEvent(Widget source, EventKey event) {
                if (input.filterKeypress(event)) {
                    return true;
                }
                return false;
            }
        });
    }

Output:
    private void hookupKeybindings() {
        input = new SimpleInputMethod();
        input.connect(new InputMethod.Commit() {
            public void onCommit(InputMethod source, String text) {
                insertText(text);
            }
        });
        view.connect(new Widget.KeyPressEvent() {
            public boolean onKeyPressEvent(Widget source, EventKey event) {
                final Keyval key;
                final ModifierType mod;
                if (input.filterKeypress(event)) {
                    return true;
                }
                key = event.getKeyval();
                if ((key == Keyval.Up) || (key == Keyval.Right)) {
                    if (insertOffset == 0) {
                        return false;
                    }
                }
                if ((key == Keyval.Down) || (key == Keyval.Left)) {
                    if (insertOffset == chain.length()) {
                        return false;
                    }
                }
                if ((key == Keyval.Home) || (key == Keyval.End) || (key == Keyval.PageUp)
                        || (key == Keyval.PageDown) || (key == Keyval.Compose)) {
                    return false;
                }
                if ((key == Keyval.F1) || (key == Keyval.F2) || (key == Keyval.F3) || (key == Keyval.F4)
                        || (key == Keyval.F5) || (key == Keyval.F6) || (key == Keyval.F7)
                        || (key == Keyval.F8) || (key == Keyval.F9) || (key == Keyval.F10)
                        || ((key == Keyval.F11) || (key == Keyval.F12))) {
                    return false;
                }
                if (key == Keyval.Escape) {
                    return true;
                }
                if (key == Keyval.Insert) {
                    popupInsertMenu();
                    return true;
                }
                if (key == Keyval.Return) {
                    insertMarkup = null;
                    insertText("\n");
                    return true;
                } else if (key == Keyval.Delete) {
                    deleteAt();
                    return true;
                } else if (key == Keyval.BackSpace) {
                    deleteBack();
                    return true;
                }
                if (key == Keyval.Menu) {
                    return false;
                }
                if ((key == Keyval.ShiftLeft) || (key == Keyval.ShiftRight) || (key == Keyval.AltLeft)
                        || (key == Keyval.AltRight) || (key == Keyval.ControlLeft)
                        || (key == Keyval.ControlRight) || (key == Keyval.SuperLeft)
                        || (key == Keyval.SuperRight)) {
                    return false;
                }
                if (key == Keyval.Tab) {
                    if (isCodeBlock()) {
                        return false;
                    } else {
                        return true;
                    }
                }
                mod = event.getState();
                if ((mod == ModifierType.NONE) || (mod == ModifierType.SHIFT_MASK)) {
                    return false;
                }
                if (mod == ModifierType.CONTROL_MASK) {
                    if (key == Keyval.a) {
                        return false;
                    } else if (key == Keyval.b) {
                        toggleMarkup(Common.BOLD);
                        return true;
                    } else if (key == Keyval.c) {
                        copyText();
                        return true;
                    } else if (key == Keyval.g) {
                        insertImage();
                        return true;
                    } else if (key == Keyval.i) {
                        toggleMarkup(Common.ITALICS);
                        return true;
                    } else if (key == Keyval.v) {
                        pasteText();
                        return true;
                    } else if (key == Keyval.x) {
                        cutText();
                        return true;
                    } else {
                        return false;
                    }
                } else if (mod.contains(ModifierType.CONTROL_MASK)
                        && mod.contains(ModifierType.SHIFT_MASK)) {
                    if (key == Keyval.Space) {
                        clearFormat();
                        return true;
                    } else if (key == Keyval.A) {
                        toggleMarkup(Common.APPLICATION);
                        return true;
                    } else if (key == Keyval.L) {
                        toggleMarkup(Common.LITERAL);
                        return true;
                    } else if (key == Keyval.F) {
                        toggleMarkup(Common.FILENAME);
                        return true;
                    } else if (key == Keyval.M) {
                        toggleMarkup(Common.FUNCTION);
                        return true;
                    } else if (key == Keyval.O) {
                        toggleMarkup(Common.COMMAND);
                        return true;
                    } else if (key == Keyval.T) {
                        toggleMarkup(Common.TYPE);
                        return true;
                    } else if (key == Keyval.U) {
                        return false;
                    } else {
                        return false;
                    }
                } else if (mod == ModifierType.LOCK_MASK) {
                    return false;
                }
                throw new IllegalStateException("\n" + "Unhandled " + key + " with " + mod);
            }
        });
        view.connect(new Widget.KeyReleaseEvent() {
            public boolean onKeyReleaseEvent(Widget source, EventKey event) {
                if (input.filterKeypress(event)) {
                    return true;
                }
                return false;
            }
        });
    }


Input:
    public static void main(String[] args) throws Exception{
    	LOG = LoggerFactory.getLogger(Main.class);
    	AppProperties.loadProperties();
        String webappDirLocation = "src/main/webapp/";
        boolean heroku = false;
        String basedir = (String)System.getProperty("basedir");
        if (basedir != null && basedir.endsWith("/app/target")) {
            heroku = true;
        }
        System.setProperty("java.naming.factory.url","org.eclipse.jetty.jndi");
		System.setProperty("java.naming.factory.initial","org.eclipse.jetty.jndi.InitialContextFactory");
        String webPort = System.getenv("PORT");
        if(webPort == null || webPort.isEmpty()) {
            webPort = "8080";
        }
        Server server = new Server(Integer.valueOf(webPort));
        if(!heroku) {
        	LOG.info("Seems to be running locally, setup some SSL stuff");
	        String sslPort = System.getenv("SSLPORT");
	        if(sslPort == null || sslPort.isEmpty()) {
	            sslPort = System.getenv("SSL_PORT");
	            if(sslPort == null || sslPort.isEmpty()) {
	                sslPort = "8443";
	            }
	        }
	        SocketConnector connector = new SocketConnector();
	        connector.setPort(Integer.valueOf(webPort));
	        SslSocketConnector sslConnector = new SslSocketConnector();
	        sslConnector.setPort(Integer.valueOf(sslPort));
	        sslConnector.setKeyPassword("123456");
	        sslConnector.setKeystore("keystore");
	        server.setConnectors(new Connector[] { sslConnector, connector });
        } else {
            LOG.info("Looks like we are running on heroku.");
        }
        WebAppContext root = new WebAppContext();
        root.setConfigurationClasses(configClasses);
        root.setContextPath("/");
        root.setDescriptor(webappDirLocation+"/WEB-INF/web.xml");
        root.setResourceBase(webappDirLocation);
        root.setAttribute("mainDS", getJNDIResource());
        root.setParentLoaderPriority(true);
        server.setHandler(root);
        server.start();
        server.join();
    }

Output:
    public static void main(String[] args) throws Exception{
    	LOG = LoggerFactory.getLogger(Main.class);
    	AppProperties.loadProperties();
        String webappDirLocation = "src/main/webapp/";
        boolean heroku = false;
        String basedir = (String)System.getProperty("DATABASE_URL");
        if (basedir != null) {
            heroku = true;
        }
        System.setProperty("java.naming.factory.url","org.eclipse.jetty.jndi");
		System.setProperty("java.naming.factory.initial","org.eclipse.jetty.jndi.InitialContextFactory");
        String webPort = System.getenv("PORT");
        if(webPort == null || webPort.isEmpty()) {
            webPort = "8080";
        }
        Server server = new Server(Integer.valueOf(webPort));
        if(!heroku) {
        	LOG.info("Seems to be running locally, setup some SSL stuff");
	        String sslPort = System.getenv("SSLPORT");
	        if(sslPort == null || sslPort.isEmpty()) {
	            sslPort = System.getenv("SSL_PORT");
	            if(sslPort == null || sslPort.isEmpty()) {
	                sslPort = "8443";
	            }
	        }
	        SocketConnector connector = new SocketConnector();
	        connector.setPort(Integer.valueOf(webPort));
	        SslSocketConnector sslConnector = new SslSocketConnector();
	        sslConnector.setPort(Integer.valueOf(sslPort));
	        sslConnector.setKeyPassword("123456");
	        sslConnector.setKeystore("keystore");
	        server.setConnectors(new Connector[] { sslConnector, connector });
        } else {
            LOG.info("Looks like we are running on heroku.");
        }
        WebAppContext root = new WebAppContext();
        root.setConfigurationClasses(configClasses);
        root.setContextPath("/");
        root.setDescriptor(webappDirLocation+"/WEB-INF/web.xml");
        root.setResourceBase(webappDirLocation);
        root.setAttribute("mainDS", getJNDIResource());
        root.setParentLoaderPriority(true);
        server.setHandler(root);
        server.start();
        server.join();
    }


Input:
    private ReferencePoint getGripPoint (Drawing drawing) {
        ReferencePoint position = null;
        Collection<ReferencePoint> closePoints = new ArrayList<ReferencePoint>();
        Workspace workspace = br.org.archimedes.Utils.getWorkspace();
        Rectangle modelDrawingArea = workspace.getCurrentViewportArea();
        Rectangle mouseArea = getMouseArea(workspace);
        try {
            Set<Element> closeElements = getViewableElements(drawing,
                    modelDrawingArea);
            for (Element element : closeElements) {
                Collection<ReferencePoint> basicReferences = getBasicReferences(
                        modelDrawingArea, mouseArea, element);
                Collection<XPoint> intersectionReferences = getIntersectionReferences(
                        mouseArea, closeElements, element);
                closePoints.addAll(basicReferences);
                closePoints.addAll(intersectionReferences);
                OrthogonalPoint ortho = getOrthogonalPoint(mouseArea, element);
                if (ortho != null) {
                    closePoints.add(ortho);
                }
            }
            position = getClosestPoint(closePoints, mousePosition);
        }
        catch (NullArgumentException e) {
        }
        return position;
    }

Output:
    private ReferencePoint getGripPoint (Drawing drawing) {
        ReferencePoint position = null;
        Collection<ReferencePoint> closePoints = new ArrayList<ReferencePoint>();
        Workspace workspace = br.org.archimedes.Utils.getWorkspace();
        Rectangle modelDrawingArea = workspace.getCurrentViewportArea();
        Rectangle mouseArea = getMouseArea(workspace);
        try {
            Set<Element> closeElements = getViewableElements(drawing,
                    modelDrawingArea);
            for (Element element : closeElements) {
                Collection<ReferencePoint> basicReferences = getBasicReferences(
                        modelDrawingArea, mouseArea, element);
                Collection<XPoint> intersectionReferences = getIntersectionReferences(
                        mouseArea, closeElements, element);
                closePoints.addAll(basicReferences);
                closePoints.addAll(intersectionReferences);
                OrthogonalPoint ortho = getOrthogonalPoint(mouseArea, element);
                if (ortho != null) {
                    closePoints.add(ortho);
                }
            }
            position = getClosestPoint(closePoints, mousePosition);
        }
        catch (NullArgumentException e) {
            e.printStackTrace();
        }
        return position;
    }


Input:
    public static int Run(String args[]) {
        boolean rename = args.length > 1 && (args[1].equals(RenameCmd));
        boolean find = args.length > 1 && (args[1].equals(FindCmd));
        if (args.length < 4 || !CheckArgs(args) || (!rename && !find)) {
            PrintUsage();
            return -1;
        }
        boolean verbose = false;
        String outfile = null;
        List<String> params = new LinkedList<String>();
        for (int ii=2; ii<args.length; ++ii) {
            if (args[ii].equals("-o") && (ii+1)<args.length) {
                outfile = args[++ii];
                if (!rename) {
                    System.err.print("Warning: invalid argument -o for "+args[1]+" command, ignoring: -o "+outfile);
                    outfile = null;
                }
            }
            else if (args[ii].equals("-v"))
                verbose = true;
            else params.add(args[ii]);
        }
        int requiredArgs = rename ? 3 : 2;
        if (params.size() < requiredArgs) {
            PrintUsage();
            return 1;
        }
        if (params.size() > requiredArgs) {
            System.err.print("Warning: too many parameters, ignoring:");
            for (int ii=requiredArgs; ii<params.size(); ++ii)
                System.err.print(" "+params.get(ii));
            System.err.println();
        }
        String infile = params.get(0);
        String functionSig = params.get(1);
        String newName = rename ? params.get(2) : null;
        File in = new File(infile);
        File out = outfile!=null ? new File(outfile) : in;
        File temp = null;
        if (rename) {
            int tempCount = 0;
            while (temp == null) {
                temp = new File(out.getParentFile(),out.getName()+String.format(".temp%04d",tempCount++));
                if (temp.exists())
                    temp = null;
            }
        }
        int status = 0;
        try {
            if (verbose)
                System.out.println(CommandName+" processing file "+in.getPath()+"...");
            if (rename) {
                copyFile(in,temp);
                JNIRenamer renamer = new JNIRenamer(temp,in.getPath(),false);
                int count = renamer.findRenameFunc(functionSig, newName, System.out,
                                                   verbose ? System.out : null, System.err);
                renamer.close();
                if (count == 0)
                    System.err.println("ERROR: Found no matches.");
                if (count > 1)
                    System.err.println(String.format("Warning: Found and replaced %d matches?!",count));
                if (count >= 0) {
                    if (out.exists() && !out.delete()) {
                        System.err.println("Error clearing previous output file "+out.getPath());
                        status = -3;
                    }
                    else if ( !temp.renameTo(out) ) {
                        System.err.println("Error moving temporary file "+temp.getPath()+" to "+out.getPath());
                        status = -3;
                    }
                    System.out.println("Result written to "+out.getPath());
                } else status = -5;
            }
            else {
                JNIRenamer renamer = new JNIRenamer(in,in.getPath(),true);
                int count = renamer.findRenameFunc(functionSig, newName, System.out,
                                                   verbose ? System.out : null, System.err);
                if (verbose && count == 0)
                    System.out.println("Found no matches.");
                if (verbose && count > 1)
                    System.out.println(String.format("Warning: Found more than one match (%d matches)",count));
                if (count > 0)
                    status = 0;
                else if (count == 0)
                    status = 1;
                else
                    status = -5;
            }
        } catch (Exception e) {
            System.err.println("Error: "+e.getMessage());
            status = -3;
        } finally {
            if (temp!=null && temp.exists())
                temp.delete();
        }
        return status;
    }

Output:
    public static int Run(String args[]) {
        boolean rename = args.length > 1 && (args[1].equals(RenameCmd));
        boolean find = args.length > 1 && (args[1].equals(FindCmd));
        if (args.length < 4 || !CheckArgs(args) || (!rename && !find)) {
            PrintUsage();
            return -1;
        }
        boolean verbose = false;
        String outfile = null;
        List<String> params = new LinkedList<String>();
        for (int ii=2; ii<args.length; ++ii) {
            if (args[ii].equals("-o") && (ii+1)<args.length) {
                outfile = args[++ii];
                if (!rename) {
                    System.err.println("Warning: invalid argument -o for "+args[1]+" command, ignoring: -o "+outfile);
                    outfile = null;
                }
            }
            else if (args[ii].equals("-v"))
                verbose = true;
            else params.add(args[ii]);
        }
        int requiredArgs = rename ? 3 : 2;
        if (params.size() < requiredArgs) {
            PrintUsage();
            return 1;
        }
        if (params.size() > requiredArgs) {
            System.err.print("Warning: too many parameters, ignoring:");
            for (int ii=requiredArgs; ii<params.size(); ++ii)
                System.err.print(" "+params.get(ii));
            System.err.println();
        }
        String infile = params.get(0);
        String functionSig = params.get(1);
        String newName = rename ? params.get(2) : null;
        File in = new File(infile);
        File out = outfile!=null ? new File(outfile) : in;
        File temp = null;
        if (rename) {
            int tempCount = 0;
            while (temp == null) {
                temp = new File(out.getParentFile(),out.getName()+String.format(".temp%04d",tempCount++));
                if (temp.exists())
                    temp = null;
            }
        }
        int status = 0;
        try {
            if (verbose)
                System.out.println(CommandName+" processing file "+in.getPath()+"...");
            if (rename) {
                copyFile(in,temp);
                JNIRenamer renamer = new JNIRenamer(temp,in.getPath(),false);
                int count = renamer.findRenameFunc(functionSig, newName, System.out,
                                                   verbose ? System.out : null, System.err);
                renamer.close();
                if (count == 0)
                    System.err.println("ERROR: Found no matches.");
                if (count > 1)
                    System.err.println(String.format("Warning: Found and replaced %d matches?!",count));
                if (count >= 0) {
                    if (out.exists() && !out.delete()) {
                        System.err.println("Error clearing previous output file "+out.getPath());
                        status = -3;
                    }
                    else if ( !temp.renameTo(out) ) {
                        System.err.println("Error moving temporary file "+temp.getPath()+" to "+out.getPath());
                        status = -3;
                    }
                    System.out.println("Result written to "+out.getPath());
                } else status = -5;
            }
            else {
                JNIRenamer renamer = new JNIRenamer(in,in.getPath(),true);
                int count = renamer.findRenameFunc(functionSig, newName, System.out,
                                                   verbose ? System.out : null, System.err);
                if (verbose && count == 0)
                    System.out.println("Found no matches.");
                if (verbose && count > 1)
                    System.out.println(String.format("Warning: Found more than one match (%d matches)",count));
                if (count > 0)
                    status = 0;
                else if (count == 0)
                    status = 1;
                else
                    status = -5;
            }
        } catch (Exception e) {
            System.err.println("Error: "+e.getMessage());
            status = -3;
        } finally {
            if (temp!=null && temp.exists())
                temp.delete();
        }
        return status;
    }


Input:
  public void testContainerLaunch() throws IOException {
    String appSubmitter = "nobody";
    String cmd = String.valueOf(
        LinuxContainerExecutor.Commands.LAUNCH_CONTAINER.getValue());
    String appId = "APP_ID";
    String containerId = "CONTAINER_ID";
    Container container = mock(Container.class);
    ContainerId cId = mock(ContainerId.class);
    ContainerLaunchContext context = mock(ContainerLaunchContext.class);
    HashMap<String, String> env = new HashMap<String,String>();
    when(container.getContainerID()).thenReturn(cId);
    when(container.getLaunchContext()).thenReturn(context);
    when(cId.toString()).thenReturn(containerId);
    when(context.getEnvironment()).thenReturn(env);
    Path scriptPath = new Path("file:///bin/echo");
    Path tokensPath = new Path("file:///dev/null");
    Path workDir = new Path("/tmp");
    Path pidFile = new Path(workDir, "pid.txt");
    mockExec.activateContainer(cId, pidFile);
    int ret = mockExec.launchContainer(container, scriptPath, tokensPath,
        appSubmitter, appId, workDir);
    assertEquals(0, ret);
    assertEquals(Arrays.asList(appSubmitter, cmd, appId, containerId,
        workDir.toString(), "/bin/echo", "/dev/null", pidFile),
        readMockParams());
  }

Output:
  public void testContainerLaunch() throws IOException {
    String appSubmitter = "nobody";
    String cmd = String.valueOf(
        LinuxContainerExecutor.Commands.LAUNCH_CONTAINER.getValue());
    String appId = "APP_ID";
    String containerId = "CONTAINER_ID";
    Container container = mock(Container.class);
    ContainerId cId = mock(ContainerId.class);
    ContainerLaunchContext context = mock(ContainerLaunchContext.class);
    HashMap<String, String> env = new HashMap<String,String>();
    when(container.getContainerID()).thenReturn(cId);
    when(container.getLaunchContext()).thenReturn(context);
    when(cId.toString()).thenReturn(containerId);
    when(context.getEnvironment()).thenReturn(env);
    Path scriptPath = new Path("file:///bin/echo");
    Path tokensPath = new Path("file:///dev/null");
    Path workDir = new Path("/tmp");
    Path pidFile = new Path(workDir, "pid.txt");
    mockExec.activateContainer(cId, pidFile);
    int ret = mockExec.launchContainer(container, scriptPath, tokensPath,
        appSubmitter, appId, workDir);
    assertEquals(0, ret);
    assertEquals(Arrays.asList(appSubmitter, cmd, appId, containerId,
        workDir.toString(), "/bin/echo", "/dev/null", pidFile.toString()),
        readMockParams());
  }


Input:
    public void contextInitialized(ServletContextEvent event) {
        HarvesterServiceLocal harvesterService = null;
        HarvestingDataverseServiceLocal harvestingDataverseService = null;
        try {
            harvesterService=(HarvesterServiceLocal)new InitialContext().lookup("java:comp/env/harvesterService");
            harvestingDataverseService=(HarvestingDataverseServiceLocal)new InitialContext().lookup("java:comp/env/harvestingDataverseService");
        } catch(Exception e) {
            e.printStackTrace();
        }
        try {
            harvestingDataverseService.resetHarvestingStatus();
            harvesterService.createScheduledHarvestTimers();
        } catch (Exception e) {
            e.printStackTrace();
        }
        VDCNetworkServiceLocal vdcNetworkService=null;
        try {
            System.out.println("VDContextListener, scheduling export now....");
            vdcNetworkService = (VDCNetworkServiceLocal)new InitialContext().lookup("java:comp/env/vdcNetworkService");
            vdcNetworkService.createExportTimer();
        } catch(Exception e) {
            e.printStackTrace();
        }
    }

Output:
    public void contextInitialized(ServletContextEvent event) {
        HarvesterServiceLocal harvesterService = null;
        HarvestingDataverseServiceLocal harvestingDataverseService = null;
        try {
            harvesterService=(HarvesterServiceLocal)new InitialContext().lookup("java:comp/env/harvesterService");
            harvestingDataverseService=(HarvestingDataverseServiceLocal)new InitialContext().lookup("java:comp/env/harvestingDataverseService");
        } catch(Exception e) {
            e.printStackTrace();
        }
        try {
            harvestingDataverseService.resetHarvestingStatus();
            harvesterService.createScheduledHarvestTimers();
        } catch (Exception e) {
            e.printStackTrace();
        }
        VDCNetworkServiceLocal vdcNetworkService=null;
        try {
            System.out.println("VDContextListener, scheduling export now....");
            vdcNetworkService = (VDCNetworkServiceLocal)new InitialContext().lookup("java:comp/env/vdcNetworkService");
            vdcNetworkService.updateExportTimer();
        } catch(Exception e) {
            e.printStackTrace();
        }
    }


Input:
		public void bindView(View view, Context context, Cursor cursor) {
			final TextView titleView = (TextView) view.findViewById(R.id.title_album);
			final TextView subtitleView = (TextView) view.findViewById(R.id.title_artist);
			final ImageView imageView = (ImageView) view.findViewById(R.id.list_album_cover);
			try {
				final String url = hostUri + "/image/" + URLEncoder.encode(cursor.getString(AlbumsQuery.THUMBNAIL), "UTF-8");
				Glide.load(url)
					.centerCrop()
					.animate(android.R.anim.fade_in)
					.into(imageView);
			} catch (UnsupportedEncodingException e) {
				Log.e(TAG, "Cannot encode " + cursor.getString(AlbumsQuery.THUMBNAIL) + " from UTF-8.");
			}
			titleView.setText(cursor.getString(AlbumsQuery.TITLE));
			subtitleView.setText(cursor.getString(AlbumsQuery.ARTIST));
		}

Output:
		public void bindView(View view, Context context, Cursor cursor) {
			final TextView titleView = (TextView) view.findViewById(R.id.album);
			final TextView subtitleView = (TextView) view.findViewById(R.id.artist);
			final ImageView imageView = (ImageView) view.findViewById(R.id.list_album_cover);
			try {
				final String url = hostUri + "/image/" + URLEncoder.encode(cursor.getString(AlbumsQuery.THUMBNAIL), "UTF-8");
				Glide.load(url)
					.centerCrop()
					.animate(android.R.anim.fade_in)
					.into(imageView);
			} catch (UnsupportedEncodingException e) {
				Log.e(TAG, "Cannot encode " + cursor.getString(AlbumsQuery.THUMBNAIL) + " from UTF-8.");
			}
			titleView.setText(cursor.getString(AlbumsQuery.TITLE));
			subtitleView.setText(cursor.getString(AlbumsQuery.ARTIST));
		}


Input:
	private AnimData blend(AnimData a, AnimData b) {
		int overlap = 50;
		float[] blendWeights = new float[overlap];
		for (int i=overlap; i>0; i--) {
			blendWeights[overlap - i] = ((float)i) / overlap;
		}
		int numBones = a.getNumBones();
		AnimData blendedData = new AnimData(numBones);
		Vector3f[] boneTrans1 = a.getBoneTransData();
		Vector3f[] boneTrans2 = b.getBoneTransData();
		int numFrames = boneTrans1.length + boneTrans2.length - overlap;
		blendedData.setNumFrames(numFrames);
		Vector3f[] blendedTrans = new Vector3f[numFrames];
		Vector3f end = new Vector3f(boneTrans1[boneTrans1.length-1]);
		Vector3f start = boneTrans2[0];
		end.sub(start);
		Vector3f shift = new Vector3f(end);
		for (int i=0; i<boneTrans1.length; i++) {
			blendedTrans[i] = boneTrans1[i];
		}
		int k = 0;
		for (int i=boneTrans1.length-overlap; i<boneTrans1.length; i++) {
			Vector3f vec1 = boneTrans1[i];
			Vector3f vec2 = new Vector3f(boneTrans2[k]);
			vec2.add(shift);
			Vector3f blend = new Vector3f();
			blend.x = vec1.x * blendWeights[k] + vec2.x *
				blendWeights[overlap - k - 1];
			blend.y = vec1.y * blendWeights[k] + vec2.y *
				blendWeights[overlap - k - 1];
			blend.z = vec1.z * blendWeights[k] + vec2.z *
				blendWeights[overlap - k - 1];
			blendedTrans[i] = blend;
			k++;
		}
		for (int i=k; i<boneTrans2.length; i++) {
			Vector3f curr = new Vector3f(boneTrans2[i]);
			curr.add(shift);
			blendedTrans[i + boneTrans1.length - overlap] = curr;
		}
		blendedData.putBoneTransData(blendedTrans);
		for (int i=0; i<numBones; i++) {
			Quat4f[] boneRot1 = a.getBoneRotData(i);
			Quat4f[] boneRot2 = b.getBoneRotData(i);
			Quat4f[] boneBlend = new Quat4f[numFrames];
			for (int j=0; j<boneRot1.length-overlap; j++) {
				boneBlend[j] = boneRot1[j];
			}
			k=0;
			for (int j=boneRot1.length-overlap; j<boneRot1.length; j++) {
				Quat4f q1 = new Quat4f(boneRot1[j]);
				Quat4f q2 = new Quat4f(boneRot2[k]);
				q1.interpolate(q2, 1-blendWeights[k]);
				boneBlend[j] = q1;
				k++;
			}
			for (int j=k; j<boneRot2.length; j++) {
				Quat4f q = new Quat4f(boneRot2[j]);
				boneBlend[boneRot1.length-overlap + j] = q;
			}
			blendedData.putBoneRotData(i, boneBlend);
		}
		return blendedData;
	}

Output:
	private AnimData blend(AnimData a, AnimData b) {
		int overlap = 50;
		float[] blendWeights = new float[overlap];
		for (int i=overlap; i>0; i--) {
			blendWeights[overlap - i] = ((float)i) / overlap;
		}
		int numBones = a.getNumBones();
		AnimData blendedData = new AnimData(numBones);
		Vector3f[] boneTrans1 = a.getBoneTransData();
		Vector3f[] boneTrans2 = b.getBoneTransData();
		int numFrames = boneTrans1.length + boneTrans2.length - overlap;
		blendedData.setNumFrames(numFrames);
		Vector3f[] blendedTrans = new Vector3f[numFrames];
		Vector3f end = new Vector3f(boneTrans1[boneTrans1.length-overlap-1]);
		Vector3f start = boneTrans2[0];
		end.sub(start);
		Vector3f shift = new Vector3f(end);
		for (int i=0; i<boneTrans1.length; i++) {
			blendedTrans[i] = boneTrans1[i];
		}
		int k = 0;
		for (int i=boneTrans1.length-overlap; i<boneTrans1.length; i++) {
			Vector3f vec1 = boneTrans1[i];
			Vector3f vec2 = new Vector3f(boneTrans2[k]);
			vec2.add(shift);
			Vector3f blend = new Vector3f();
			blend.x = vec1.x * blendWeights[k] + vec2.x *
				blendWeights[overlap - k - 1];
			blend.y = vec1.y * blendWeights[k] + vec2.y *
				blendWeights[overlap - k - 1];
			blend.z = vec1.z * blendWeights[k] + vec2.z *
				blendWeights[overlap - k - 1];
			blendedTrans[i] = blend;
			k++;
		}
		for (int i=k; i<boneTrans2.length; i++) {
			Vector3f curr = new Vector3f(boneTrans2[i]);
			curr.add(shift);
			blendedTrans[i + boneTrans1.length - overlap] = curr;
		}
		blendedData.putBoneTransData(blendedTrans);
		Quat4f qShift = null;
		Quat4f first = new Quat4f(a.getBoneRotData(0)[a.getNumFrames()-overlap-1]);
		Quat4f sec = new Quat4f(b.getBoneRotData(0)[0]);
		qShift = new Quat4f(sec);
		qShift.inverse();
		qShift.mul(first);
		for (int i=0; i<numBones; i++) {
			Quat4f[] boneRot1 = a.getBoneRotData(i);
			Quat4f[] boneRot2 = b.getBoneRotData(i);
			Quat4f[] boneBlend = new Quat4f[numFrames];
			for (int j=0; j<boneRot1.length-overlap; j++) {
				boneBlend[j] = boneRot1[j];
			}
			k=0;
			for (int j=boneRot1.length-overlap; j<boneRot1.length; j++) {
				Quat4f q1 = new Quat4f(boneRot1[j]);
				Quat4f q2 = new Quat4f(boneRot2[k]);
				if (i==0) q2.mul(qShift);
				q1.interpolate(q2, 1-blendWeights[k]);
				boneBlend[j] = q1;
				k++;
			}
			for (int j=k; j<boneRot2.length; j++) {
				Quat4f q = new Quat4f(boneRot2[j]);
				if (i==0) q.mul(qShift);
				boneBlend[boneRot1.length-overlap + j] = q;
			}
			blendedData.putBoneRotData(i, boneBlend);
		}
		return blendedData;
	}


Input:
	public void testWithTwoTypes() {
		PoiQuery pq = new PoiQuery("/101.123245/-56.12/10?t=1,2");
		assertEquals(101.123245, pq.getLatitude(), 0);
		assertEquals(-56.12, pq.getLongitude(), 0);
		assertEquals(10, pq.getRadius());
		assertEquals(2, pq.getTypes().size());
		assertEquals(1, ((Integer) pq.getTypes().get(0)).intValue());
		assertEquals(2, ((Integer) pq.getTypes().get(1)).intValue());
		fail("test fail to check jenkins");
	}

Output:
	public void testWithTwoTypes() {
		PoiQuery pq = new PoiQuery("/101.123245/-56.12/10?t=1,2");
		assertEquals(101.123245, pq.getLatitude(), 0);
		assertEquals(-56.12, pq.getLongitude(), 0);
		assertEquals(10, pq.getRadius());
		assertEquals(2, pq.getTypes().size());
		assertEquals(1, ((Integer) pq.getTypes().get(0)).intValue());
		assertEquals(2, ((Integer) pq.getTypes().get(1)).intValue());
	}


Input:
    public final static String For(ActionEvent evt){
        String label = evt.getActionCommand();
        if (null == Label.For(label)){
            Object source = evt.getSource();
            if (source instanceof AbstractButton){
                return ((ImageIcon)((AbstractButton)source).getIcon()).getDescription();
            }
        }
        return label;
    }

Output:
    public final static String For(ActionEvent evt){
        String label = evt.getActionCommand();
        if (Label.UNKNOWN == Label.For(label)){
            Object source = evt.getSource();
            if (source instanceof AbstractButton){
                return ((ImageIcon)((AbstractButton)source).getIcon()).getDescription();
            }
        }
        return label;
    }


Input:
    public static JScrollPane getScrollingMenu(
                        final MyMenu menu,
                        final DefaultListModel dlm,
                        final MyList list,
                        final Map<MyMenuItem, ButtonCallback> callbackHash) {
        prevScrollingMenuIndex = -1;
        list.setFixedCellHeight(25);
        final int maxSize = dlm.getSize();
        if (maxSize <= 0) {
            return null;
        }
        if (maxSize > 20) {
            list.setVisibleRowCount(20);
        } else {
            list.setVisibleRowCount(maxSize);
        }
        list.addMouseListener(new MouseAdapter() {
            @Override public void mouseExited(final MouseEvent evt) {
                prevScrollingMenuIndex = -1;
                if (callbackHash != null) {
                    for (final MyMenuItem item : callbackHash.keySet()) {
                        callbackHash.get(item).mouseOut();
                        list.clearSelection();
                    }
                }
            }
            @Override public void mouseEntered(final MouseEvent evt) {
                list.requestFocus();
            }
            @Override public void mousePressed(final MouseEvent evt) {
                prevScrollingMenuIndex = -1;
                if (callbackHash != null) {
                    for (final MyMenuItem item : callbackHash.keySet()) {
                        callbackHash.get(item).mouseOut();
                    }
                }
                final Thread thread = new Thread(new Runnable() {
                    @Override public void run() {
                        final int index = list.locationToIndex(evt.getPoint());
                        SwingUtilities.invokeLater(new Runnable() {
                            @Override public void run() {
                                list.setSelectedIndex(index);
                                menu.setSelected(false);
                            }
                        });
                        final MyMenuItem item =
                                            (MyMenuItem) dlm.elementAt(index);
                        item.action();
                    }
                });
                thread.start();
            }
        });
        list.addMouseMotionListener(new MouseMotionAdapter() {
            @Override public void mouseMoved(final MouseEvent evt) {
                final Thread thread = new Thread(new Runnable() {
                    @Override public void run() {
                        int pIndex = list.locationToIndex(evt.getPoint());
                        if (!list.getCellBounds(pIndex, pIndex).contains(
                                                         evt.getPoint())) {
                            pIndex = -1;
                        }
                        final int index = pIndex;
                        final int lastIndex = prevScrollingMenuIndex;
                        if (index == lastIndex) {
                            return;
                        }
                        prevScrollingMenuIndex = index;
                        SwingUtilities.invokeLater(new Runnable() {
                            @Override public void run() {
                                list.setSelectedIndex(index);
                            }
                        });
                        if (callbackHash != null) {
                            if (lastIndex >= 0) {
                                final MyMenuItem lastItem =
                                        (MyMenuItem) dlm.elementAt(lastIndex);
                                callbackHash.get(lastItem).mouseOut();
                            }
                            if (index >= 0) {
                                final MyMenuItem item =
                                            (MyMenuItem) dlm.elementAt(index);
                                callbackHash.get(item).mouseOver();
                            }
                        }
                    }
                });
                thread.start();
            }
        });
        final JScrollPane sp = new JScrollPane(list);
        sp.setViewportBorder(null);
        sp.setBorder(null);
        list.addKeyListener(new KeyAdapter() {
            @Override public void keyTyped(final KeyEvent e) {
                final char ch = e.getKeyChar();
                if (ch == ' ' || ch == '\n') {
                    final MyMenuItem item =
                                       (MyMenuItem) list.getSelectedValue();
                    if (item != null) {
                        item.action();
                    }
                } else {
                    if (Character.isLetterOrDigit(ch)) {
                        final Thread t = new Thread(new Runnable() {
                            @Override public void run() {
                                getGUIData().getMainGlassPane().start("" + ch,
                                                                      null,
                                                                      true);
                                stopProgressIndicator("" + ch);
                            }
                        });
                        t.start();
                    }
                }
            }
        });
        return sp;
    }

Output:
    public static JScrollPane getScrollingMenu(
                        final MyMenu menu,
                        final DefaultListModel dlm,
                        final MyList list,
                        final Map<MyMenuItem, ButtonCallback> callbackHash) {
        prevScrollingMenuIndex = -1;
        list.setFixedCellHeight(25);
        final int maxSize = dlm.getSize();
        if (maxSize <= 0) {
            return null;
        }
        if (maxSize > 20) {
            list.setVisibleRowCount(20);
        } else {
            list.setVisibleRowCount(maxSize);
        }
        list.addMouseListener(new MouseAdapter() {
            @Override public void mouseExited(final MouseEvent evt) {
                prevScrollingMenuIndex = -1;
                if (callbackHash != null) {
                    for (final MyMenuItem item : callbackHash.keySet()) {
                        callbackHash.get(item).mouseOut();
                        list.clearSelection();
                    }
                }
            }
            @Override public void mouseEntered(final MouseEvent evt) {
            }
            @Override public void mousePressed(final MouseEvent evt) {
                prevScrollingMenuIndex = -1;
                if (callbackHash != null) {
                    for (final MyMenuItem item : callbackHash.keySet()) {
                        callbackHash.get(item).mouseOut();
                    }
                }
                final Thread thread = new Thread(new Runnable() {
                    @Override public void run() {
                        final int index = list.locationToIndex(evt.getPoint());
                        SwingUtilities.invokeLater(new Runnable() {
                            @Override public void run() {
                                list.setSelectedIndex(index);
                                menu.setSelected(false);
                            }
                        });
                        final MyMenuItem item =
                                            (MyMenuItem) dlm.elementAt(index);
                        item.action();
                    }
                });
                thread.start();
            }
        });
        list.addMouseMotionListener(new MouseMotionAdapter() {
            @Override public void mouseMoved(final MouseEvent evt) {
                final Thread thread = new Thread(new Runnable() {
                    @Override public void run() {
                        int pIndex = list.locationToIndex(evt.getPoint());
                        if (!list.getCellBounds(pIndex, pIndex).contains(
                                                         evt.getPoint())) {
                            pIndex = -1;
                        }
                        final int index = pIndex;
                        final int lastIndex = prevScrollingMenuIndex;
                        if (index == lastIndex) {
                            return;
                        }
                        prevScrollingMenuIndex = index;
                        SwingUtilities.invokeLater(new Runnable() {
                            @Override public void run() {
                                list.setSelectedIndex(index);
                            }
                        });
                        if (callbackHash != null) {
                            if (lastIndex >= 0) {
                                final MyMenuItem lastItem =
                                        (MyMenuItem) dlm.elementAt(lastIndex);
                                callbackHash.get(lastItem).mouseOut();
                            }
                            if (index >= 0) {
                                final MyMenuItem item =
                                            (MyMenuItem) dlm.elementAt(index);
                                callbackHash.get(item).mouseOver();
                            }
                        }
                    }
                });
                thread.start();
            }
        });
        final JScrollPane sp = new JScrollPane(list);
        sp.setViewportBorder(null);
        sp.setBorder(null);
        list.addKeyListener(new KeyAdapter() {
            @Override public void keyTyped(final KeyEvent e) {
                final char ch = e.getKeyChar();
                if (ch == ' ' || ch == '\n') {
                    final MyMenuItem item =
                                       (MyMenuItem) list.getSelectedValue();
                    if (item != null) {
                        item.action();
                    }
                } else {
                    if (Character.isLetterOrDigit(ch)) {
                        final Thread t = new Thread(new Runnable() {
                            @Override public void run() {
                                getGUIData().getMainGlassPane().start("" + ch,
                                                                      null,
                                                                      true);
                                stopProgressIndicator("" + ch);
                            }
                        });
                        t.start();
                    }
                }
            }
        });
        return sp;
    }


Input:
  private final void find ( ArrayList < String > pBounded ,
      Expression pExpression )
  {
    for ( Method method : this.getClass ( ).getDeclaredMethods ( ) )
    {
      if ( method.getName ( ).equals (
          FIND + pExpression.getClass ( ).getSimpleName ( ) ) )
      {
        try
        {
          Object [ ] argument = new Object [ 2 ] ;
          argument [ 0 ] = pBounded ;
          argument [ 1 ] = pExpression ;
          method.invoke ( this , argument ) ;
        }
        catch ( IllegalArgumentException e )
        {
        }
        catch ( IllegalAccessException e )
        {
        }
        catch ( InvocationTargetException e )
        {
        }
        return ;
      }
    }
    Enumeration < Expression > children = pExpression.children ( ) ;
    while ( children.hasMoreElements ( ) )
    {
      find ( pBounded , children.nextElement ( ) ) ;
    }
  }

Output:
  private final void find ( ArrayList < String > pBounded ,
      Expression pExpression )
  {
    for ( Method method : this.getClass ( ).getDeclaredMethods ( ) )
    {
      if ( method.getName ( ).equals (
          FIND + pExpression.getClass ( ).getSimpleName ( ) ) )
      {
        try
        {
          Object [ ] argument = new Object [ 2 ] ;
          argument [ 0 ] = pBounded ;
          argument [ 1 ] = pExpression ;
          method.invoke ( this , argument ) ;
        }
        catch ( IllegalArgumentException e )
        {
          System.err.println ( "IllegalArgumentException: "
              + this.getClass ( ).getCanonicalName ( ) + "." + FIND
              + pExpression.getClass ( ).getSimpleName ( ) ) ;
        }
        catch ( IllegalAccessException e )
        {
          System.err.println ( "IllegalAccessException: "
              + this.getClass ( ).getCanonicalName ( ) + "." + FIND
              + pExpression.getClass ( ).getSimpleName ( ) ) ;
        }
        catch ( InvocationTargetException e )
        {
          System.err.println ( "InvocationTargetException: "
              + this.getClass ( ).getCanonicalName ( ) + "." + FIND
              + pExpression.getClass ( ).getSimpleName ( ) ) ;
        }
        return ;
      }
    }
    Enumeration < Expression > children = pExpression.children ( ) ;
    while ( children.hasMoreElements ( ) )
    {
      find ( pBounded , children.nextElement ( ) ) ;
    }
  }


Input:
    public Construct execute(List<Construct> args, Env env){
        env.SetVarList(new IVariableList());
        CArray array = new CArray(0, null);
        for(String key : originals.keySet()){
            Construct c = originals.get(key);
            env.GetVarList().set(new IVariable(key, c, 0, null));
            array.push(c);
        }
        GenericTree<Construct> root = new GenericTree<Construct>();
        root.setRoot(tree);
        Script fakeScript = new Script(null, null);
        for(int i = 0; i < args.size(); i++){
            Construct c = args.get(i);
            array.set(i, c);
            if(varIndex.size() > i){
                String varname = varIndex.get(i).getName();
                env.GetVarList().set(new IVariable(varname, c, c.getLineNum(), c.getFile()));
            }
        }
        env.GetVarList().set(new IVariable("@arguments", array, 0, null));
        try{
            fakeScript.eval(tree, env);
        } catch(FunctionReturnException e){
            return e.getReturn();
        }
        return new CVoid(0, null);
    }

Output:
    public Construct execute(List<Construct> args, Env env){
        env.SetVarList(new IVariableList());
        CArray array = new CArray(0, null);
        for(String key : originals.keySet()){
            Construct c = originals.get(key);
            env.GetVarList().set(new IVariable(key, c, 0, null));
            array.push(c);
        }
        GenericTree<Construct> root = new GenericTree<Construct>();
        root.setRoot(tree);
        Script fakeScript = Script.GenerateScript(tree, env.GetLabel());
        for(int i = 0; i < args.size(); i++){
            Construct c = args.get(i);
            array.set(i, c);
            if(varIndex.size() > i){
                String varname = varIndex.get(i).getName();
                env.GetVarList().set(new IVariable(varname, c, c.getLineNum(), c.getFile()));
            }
        }
        env.GetVarList().set(new IVariable("@arguments", array, 0, null));
        try{
            fakeScript.eval(tree, env);
        } catch(FunctionReturnException e){
            return e.getReturn();
        }
        return new CVoid(0, null);
    }


Input:
	public HypotrochoidParticle(PApplet p, int a, int b, int h, float timeScale, int color, float weight, int fadeLifetime, int lingerLifetime) {
		super(p, new PVector(0,0), new PVector(0,0), 1, 0, 0,
				1, color, weight, fadeLifetime, lingerLifetime);
		path.remove(0);
		this.a = a;
		this.b = b;
		this.h = h;
		this.adjustedTStepSize = adjustedTStepSize / timeScale;
		this.t_limit = b / GCD(a-b,b) * PApplet.TWO_PI;
		PApplet.println(b / GCD(a-b,b));
		move();
		startingPos = new PVector(pos.x,pos.y);
	}

Output:
	public HypotrochoidParticle(PApplet p, int a, int b, int h, float timeScale, int color, float weight, int fadeLifetime, int lingerLifetime) {
		super(p, new PVector(0,0), new PVector(0,0), 1, 0, 0,
				1, color, weight, fadeLifetime, lingerLifetime);
		path.remove(0);
		this.a = a;
		this.b = b;
		this.h = h;
		this.adjustedTStepSize = adjustedTStepSize * timeScale;
		this.t_limit = b / GCD(a-b,b) * PApplet.TWO_PI;
		PApplet.println(b / GCD(a-b,b));
		move();
		startingPos = new PVector(pos.x,pos.y);
	}


Input:
	private CompositeImageDescriptor getImageDescriptor(Object object, boolean showActivation) {
		CompositeImageDescriptor compositeDescriptor = new CompositeImageDescriptor();
		if (object instanceof TaskArchive) {
			compositeDescriptor.icon = TasksUiImages.CATEGORY_ARCHIVE;
			return compositeDescriptor;
		} else if (object instanceof TaskCategory) {
			compositeDescriptor.icon = TasksUiImages.CATEGORY;
			return compositeDescriptor;
		} else if (object instanceof ITaskListElement) {
			ITaskListElement element = (ITaskListElement) object;
			AbstractRepositoryConnectorUi connectorUi = null;
			if (element instanceof AbstractRepositoryTask) {
				AbstractRepositoryTask repositoryTask = (AbstractRepositoryTask) element;
				connectorUi = TasksUiPlugin.getRepositoryUi(((AbstractRepositoryTask) element).getRepositoryKind());
				compositeDescriptor.overlayKind = connectorUi.getTaskKindOverlay(repositoryTask);
				if (showActivation) {
					compositeDescriptor.contextToggle = getContextActivationImage(element);
				}
			} else if (element instanceof AbstractQueryHit) {
				AbstractRepositoryTask repositoryTask = ((AbstractQueryHit) element).getCorrespondingTask();
				if (repositoryTask != null) {
					return getImageDescriptor(repositoryTask, showActivation);
				}
			} else if (element instanceof AbstractTaskContainer) {
				connectorUi = TasksUiPlugin.getRepositoryUi(((AbstractRepositoryQuery) element).getRepositoryKind());
			}
			if (connectorUi != null) {
				compositeDescriptor.icon = connectorUi.getTaskListElementIcon(element);
				return compositeDescriptor;
			} else {
				if (element instanceof ITask) {
					if (showActivation) {
						compositeDescriptor.contextToggle = getContextActivationImage(element);
					}
				} else if (element instanceof AbstractQueryHit) {
					if (showActivation) {
						compositeDescriptor.contextToggle = getContextActivationImage(element);
					}
				}
				if (element instanceof ITask || element instanceof AbstractQueryHit) {
				}
				if (element instanceof AbstractRepositoryQuery) {
					compositeDescriptor.icon = TasksUiImages.QUERY;
				} else if (element instanceof AbstractQueryHit) {
					compositeDescriptor.icon = TasksUiImages.TASK;
				} else if (element instanceof ITask) {
					compositeDescriptor.icon = TasksUiImages.TASK;
				}
				return compositeDescriptor;
			}
		}
		return null;
	}

Output:
	private CompositeImageDescriptor getImageDescriptor(Object object, boolean showActivation) {
		CompositeImageDescriptor compositeDescriptor = new CompositeImageDescriptor();
		if (object instanceof TaskArchive) {
			compositeDescriptor.icon = TasksUiImages.CATEGORY_ARCHIVE;
			return compositeDescriptor;
		} else if (object instanceof TaskCategory) {
			compositeDescriptor.icon = TasksUiImages.CATEGORY;
			return compositeDescriptor;
		} else if (object instanceof ITaskListElement) {
			ITaskListElement element = (ITaskListElement) object;
			AbstractRepositoryConnectorUi connectorUi = null;
			if (element instanceof AbstractRepositoryTask) {
				AbstractRepositoryTask repositoryTask = (AbstractRepositoryTask) element;
				connectorUi = TasksUiPlugin.getRepositoryUi(((AbstractRepositoryTask) element).getRepositoryKind());
				if (connectorUi != null) {
					compositeDescriptor.overlayKind = connectorUi.getTaskKindOverlay(repositoryTask);
				}
				if (showActivation) {
					compositeDescriptor.contextToggle = getContextActivationImage(element);
				}
			} else if (element instanceof AbstractQueryHit) {
				AbstractRepositoryTask repositoryTask = ((AbstractQueryHit) element).getCorrespondingTask();
				if (repositoryTask != null) {
					return getImageDescriptor(repositoryTask, showActivation);
				}
			} else if (element instanceof AbstractTaskContainer) {
				connectorUi = TasksUiPlugin.getRepositoryUi(((AbstractRepositoryQuery) element).getRepositoryKind());
			}
			if (connectorUi != null) {
				compositeDescriptor.icon = connectorUi.getTaskListElementIcon(element);
				return compositeDescriptor;
			} else {
				if (element instanceof ITask) {
					if (showActivation) {
						compositeDescriptor.contextToggle = getContextActivationImage(element);
					}
				} else if (element instanceof AbstractQueryHit) {
					if (showActivation) {
						compositeDescriptor.contextToggle = getContextActivationImage(element);
					}
				}
				if (element instanceof ITask || element instanceof AbstractQueryHit) {
				}
				if (element instanceof AbstractRepositoryQuery) {
					compositeDescriptor.icon = TasksUiImages.QUERY;
				} else if (element instanceof AbstractQueryHit) {
					compositeDescriptor.icon = TasksUiImages.TASK;
				} else if (element instanceof ITask) {
					compositeDescriptor.icon = TasksUiImages.TASK;
				}
				return compositeDescriptor;
			}
		}
		return null;
	}


Input:
    public Component getListCellRendererComponent(JList list,
                                                  Object value,
                                                  int index,
                                                  boolean isSelected,
                                                  boolean cellHasFocus) {
        _checkBox.setPreferredSize(new Dimension(_checkBox.getPreferredSize().width, 0));
        applyComponentOrientation(list.getComponentOrientation());
        Object actualValue;
        if (list instanceof CheckBoxList) {
            CheckBoxListSelectionModel selectionModel = ((CheckBoxList) list).getCheckBoxListSelectionModel();
            if (selectionModel != null) {
                boolean enabled = list.isEnabled()
                        && ((CheckBoxList) list).isCheckBoxEnabled()
                        && ((CheckBoxList) list).isCheckBoxEnabled(index);
                if (!enabled && !isSelected) {
                    if (getBackground() != null) {
                        setForeground(getBackground().darker());
                    }
                }
                _checkBox.setEnabled(enabled);
                _checkBox.setSelected(selectionModel.isSelectedIndex(index));
            }
            actualValue = value;
        }
        else if (list instanceof CheckBoxListWithSelectable) {
            if (value instanceof Selectable) {
                _checkBox.setSelected(((Selectable) value).isSelected());
                boolean enabled = list.isEnabled() && ((Selectable) value).isEnabled() && ((CheckBoxListWithSelectable) list).isCheckBoxEnabled();
                if (!enabled && !isSelected) {
                    setForeground(getBackground().darker());
                }
                _checkBox.setEnabled(enabled);
            }
            else {
                boolean enabled = list.isEnabled();
                if (!enabled && !isSelected) {
                    setForeground(getBackground().darker());
                }
                _checkBox.setEnabled(enabled);
            }
            if (value instanceof DefaultSelectable) {
                actualValue = ((DefaultSelectable) value).getObject();
            }
            else {
                actualValue = value;
            }
        }
        else {
            throw new IllegalArgumentException("CheckBoxListCellRenderer should only be used for CheckBoxList.");
        }
        if (_actualListRenderer != null) {
            JComponent listCellRendererComponent = (JComponent) _actualListRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
            if (list instanceof CheckBoxList) {
                if (!((CheckBoxList) list).isCheckBoxVisible(index)) {
                    return listCellRendererComponent;
                }
            }
            else if (list instanceof CheckBoxListWithSelectable) {
                if (!((CheckBoxListWithSelectable) list).isCheckBoxVisible(index)) {
                    return listCellRendererComponent;
                }
            }
            Border border = listCellRendererComponent.getBorder();
            setBorder(border);
            listCellRendererComponent.setBorder(BorderFactory.createEmptyBorder());
            if (getComponentCount() == 2) {
                remove(1);
            }
            add(listCellRendererComponent);
            setBackground(listCellRendererComponent.getBackground());
            setForeground(listCellRendererComponent.getForeground());
        }
        else {
            if (isSelected) {
                setBackground(list.getSelectionBackground());
                setForeground(list.getSelectionForeground());
            }
            else {
                setBackground(list.getBackground());
                setForeground(list.getForeground());
            }
            if (getComponentCount() == 2) {
                remove(1);
            }
            add(_label);
            customizeDefaultCellRenderer(actualValue);
            setFont(list.getFont());
        }
        return this;
    }

Output:
    public Component getListCellRendererComponent(JList list,
                                                  Object value,
                                                  int index,
                                                  boolean isSelected,
                                                  boolean cellHasFocus) {
        _checkBox.setPreferredSize(new Dimension(_checkBox.getPreferredSize().width, 0));
        applyComponentOrientation(list.getComponentOrientation());
        Object actualValue;
        if (list instanceof CheckBoxList) {
            CheckBoxListSelectionModel selectionModel = ((CheckBoxList) list).getCheckBoxListSelectionModel();
            if (selectionModel != null) {
                boolean enabled = list.isEnabled()
                        && ((CheckBoxList) list).isCheckBoxEnabled()
                        && ((CheckBoxList) list).isCheckBoxEnabled(index);
                if (!enabled && !isSelected) {
                    if (getBackground() != null) {
                        setForeground(getBackground().darker());
                    }
                }
                _checkBox.setEnabled(enabled);
                _checkBox.setSelected(selectionModel.isSelectedIndex(index));
            }
            actualValue = value;
        }
        else if (list instanceof CheckBoxListWithSelectable) {
            if (value instanceof Selectable) {
                _checkBox.setSelected(((Selectable) value).isSelected());
                boolean enabled = list.isEnabled() && ((Selectable) value).isEnabled() && ((CheckBoxListWithSelectable) list).isCheckBoxEnabled();
                if (!enabled && !isSelected) {
                    setForeground(getBackground().darker());
                }
                _checkBox.setEnabled(enabled);
            }
            else {
                boolean enabled = list.isEnabled();
                if (!enabled && !isSelected) {
                    setForeground(getBackground().darker());
                }
                _checkBox.setEnabled(enabled);
            }
            if (value instanceof DefaultSelectable) {
                actualValue = ((DefaultSelectable) value).getObject();
            }
            else {
                actualValue = value;
            }
        }
        else {
            throw new IllegalArgumentException("CheckBoxListCellRenderer should only be used for CheckBoxList.");
        }
        if (_actualListRenderer != null) {
            JComponent listCellRendererComponent = (JComponent) _actualListRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
            if (!cellHasFocus) listCellRendererComponent.setBorder(noFocusBorder);
            if (list instanceof CheckBoxList) {
                if (!((CheckBoxList) list).isCheckBoxVisible(index)) {
                    return listCellRendererComponent;
                }
            }
            else if (list instanceof CheckBoxListWithSelectable) {
                if (!((CheckBoxListWithSelectable) list).isCheckBoxVisible(index)) {
                    return listCellRendererComponent;
                }
            }
            Border border = listCellRendererComponent.getBorder();
            setBorder(border);
            listCellRendererComponent.setBorder(BorderFactory.createEmptyBorder());
            if (getComponentCount() == 2) {
                remove(1);
            }
            add(listCellRendererComponent);
            setBackground(listCellRendererComponent.getBackground());
            setForeground(listCellRendererComponent.getForeground());
        }
        else {
            if (isSelected) {
                setBackground(list.getSelectionBackground());
                setForeground(list.getSelectionForeground());
            }
            else {
                setBackground(list.getBackground());
                setForeground(list.getForeground());
            }
            if (getComponentCount() == 2) {
                remove(1);
            }
            add(_label);
            customizeDefaultCellRenderer(actualValue);
            setFont(list.getFont());
        }
        return this;
    }