Input:
    private JTabbedPane initJTPRequest(){
        JTabbedPane jtp = new JTabbedPane();
        ButtonGroup bg = new ButtonGroup();
        bg.add(jrb_req_get);
        bg.add(jrb_req_post);
        bg.add(jrb_req_put);
        bg.add(jrb_req_delete);
        bg.add(jrb_req_head);
        bg.add(jrb_req_options);
        bg.add(jrb_req_trace);
        jrb_req_get.setSelected(true);
        jrb_req_get.setMnemonic('g');
        jrb_req_post.setMnemonic('p');
        jrb_req_put.setMnemonic('t');
        jrb_req_delete.setMnemonic('d');
        ActionListener jrbAL = new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                if(jrb_req_post.isSelected() || jrb_req_put.isSelected()){
                    setUIReqBodyEnabled(true);
                }
                else{
                    setUIReqBodyEnabled(false);
                }
            }
        };
        jrb_req_get.addActionListener(jrbAL);
        jrb_req_post.addActionListener(jrbAL);
        jrb_req_put.addActionListener(jrbAL);
        jrb_req_delete.addActionListener(jrbAL);
        jrb_req_head.addActionListener(jrbAL);
        jrb_req_options.addActionListener(jrbAL);
        jrb_req_trace.addActionListener(jrbAL);
        JPanel jp_method_encp = new JPanel();
        jp_method_encp.setLayout(new FlowLayout(FlowLayout.LEFT));
        JPanel jp_method = new JPanel();
        jp_method.setBorder(BorderFactory.createTitledBorder("HTTP Method"));
        jp_method.setLayout(new GridLayout(4, 2));
        jp_method.add(jrb_req_get);
        jp_method.add(jrb_req_post);
        jp_method.add(jrb_req_put);
        jp_method.add(jrb_req_delete);
        jp_method.add(jrb_req_head);
        jp_method.add(jrb_req_options);
        jp_method.add(jrb_req_trace);
        jp_method_encp.add(jp_method);
        jtp.addTab("Method", jp_method_encp);
        jp_2col_req_headers = new TwoColumnTablePanel(new String[]{"Header", "Value"}, rest_ui);
        jtp.addTab("Headers", jp_2col_req_headers);
        setUIReqBodyEnabled(false);
        JPanel jp_body = new JPanel();
        jp_body.setLayout(new BorderLayout());
        JPanel jp_body_north = new JPanel();
        jp_body_north.setLayout(new FlowLayout(FlowLayout.LEFT));
        jtf_body_content_type.setEditable(false);
        jtf_body_content_type.setColumns(24);
        jtf_body_content_type.setToolTipText("Selected Content-type & Charset");
        jtf_body_content_type.setText(Util.getFormattedContentType(
                jd_body_content_type.getContentType(),
                jd_body_content_type.getCharSet()));
        jp_body_north.add(jtf_body_content_type);
        jb_body_content_type.setToolTipText("Edit Content-type & Charset");
        jb_body_content_type.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                jd_body_content_type.setVisible(true);
            }
        });
        jp_body_north.add(jb_body_content_type);
        JSeparator js = new JSeparator(SwingConstants.VERTICAL);
        jp_body_north.add(js);
        jb_body_file.setToolTipText("Load from file");
        jb_body_file.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent event) {
                jb_body_fileActionPerformed(event);
            }
        });
        jp_body_north.add(jb_body_file);
        jb_body_params.setToolTipText("Insert parameters");
        jb_body_params.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent event) {
                jb_body_paramActionPerformed(event);
            }
        });
        jp_body_north.add(jb_body_params);
        final JPopupMenu jpm_req_body = new JPopupMenu();
        JMenu jm_syntax = new JMenu("Syntax Color");
        JMenuItem jmi_syntax_none = new JMenuItem("None");
        jmi_syntax_none.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                actionTextEditorSyntaxChange(se_req_body, TextEditorSyntax.DEFAULT);
            }
        });
        jm_syntax.add(jmi_syntax_none);
        JMenuItem jmi_syntax_xml = new JMenuItem("XML");
        jmi_syntax_xml.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                actionTextEditorSyntaxChange(se_req_body, TextEditorSyntax.XML);
            }
        });
        jm_syntax.add(jmi_syntax_xml);
        JMenuItem jmi_syntax_json = new JMenuItem("JSON");
        jmi_syntax_json.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                actionTextEditorSyntaxChange(se_req_body, TextEditorSyntax.JSON);
            }
        });
        jm_syntax.add(jmi_syntax_json);
        jpm_req_body.add(jm_syntax);
        if (se_req_body.getEditorComponent() instanceof JEditorPane) {
            se_req_body.getEditorComponent().addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(MouseEvent e) {
                    showPopup(e);
                }
                @Override
                public void mouseReleased(MouseEvent e) {
                    showPopup(e);
                }
                private void showPopup(final MouseEvent e) {
                    if(!se_req_body.getEditorComponent().isEnabled()){
                        return;
                    }
                    if (e.isPopupTrigger()) {
                        jpm_req_body.show(e.getComponent(), e.getX(), e.getY());
                    }
                }
            });
        }
        jp_body.add(jp_body_north, BorderLayout.NORTH);
        JPanel jp_body_center = new JPanel();
        jp_body_center.setLayout(new GridLayout(1, 1));
        jp_body_center.add(se_req_body.getEditorView());
        jp_body.add(jp_body_center, BorderLayout.CENTER);
        jtp.addTab("Body", jp_body);
        JPanel jp_auth = new JPanel();
        jp_auth.setLayout(new BorderLayout());
        JPanel jp_auth_west = new JPanel();
        jp_auth_west.setLayout(new BorderLayout());
        JPanel jp_auth_west_center = new JPanel();
        jp_auth_west_center.setBorder(BorderFactory.createTitledBorder("Auth Type"));
        jp_auth_west_center.setLayout(new GridLayout(2,1));
        jcb_auth_basic.setSelected(false);
        ActionListener action = new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent event) {
                auth_enableActionPerformed(event);
            }
        };
        jcb_auth_basic.addActionListener(action);
        jcb_auth_digest.addActionListener(action);
        jp_auth_west_center.add(jcb_auth_basic);
        jp_auth_west_center.add(jcb_auth_digest);
        jp_auth_west.add(jp_auth_west_center, BorderLayout.CENTER);
        JPanel jp_auth_west_south = new JPanel();
        jp_auth_west_south.setBorder(BorderFactory.createTitledBorder("Preemptive?"));
        jp_auth_west_south.setLayout(new GridLayout(1, 1));
        jcb_auth_preemptive.setToolTipText("Send authentication credentials before challenge");
        jcb_auth_preemptive.setSelected(true);
        jcb_auth_preemptive.setEnabled(false);
        jp_auth_west_south.add(jcb_auth_preemptive);
        jp_auth_west.add(jp_auth_west_south, BorderLayout.SOUTH);
        jp_auth.add(jp_auth_west, BorderLayout.WEST);
        JPanel jp_auth_center = new JPanel();
        jp_auth_center.setBorder(BorderFactory.createTitledBorder("Details"));
        jp_auth_center.setLayout(new BorderLayout());
        JPanel jp_auth_center_west = new JPanel();
        jp_auth_center_west.setLayout(new GridLayout(4, 1, BORDER_WIDTH, BORDER_WIDTH));
        jl_auth_host.setEnabled(false);
        jl_auth_realm.setEnabled(false);
        jl_auth_username.setEnabled(false);
        jl_auth_password.setEnabled(false);
        jp_auth_center_west.add(jl_auth_host);
        jp_auth_center_west.add(jl_auth_realm);
        jp_auth_center_west.add(jl_auth_username);
        jp_auth_center_west.add(jl_auth_password);
        jp_auth_center.add(jp_auth_center_west, BorderLayout.WEST);
        JPanel jp_auth_center_center = new JPanel();
        jp_auth_center_center.setLayout(new GridLayout(4, 1, BORDER_WIDTH, BORDER_WIDTH));
        jtf_auth_host.setEnabled(false);
        jtf_auth_realm.setEnabled(false);
        jtf_auth_username.setEnabled(false);
        jpf_auth_password.setEnabled(false);
        jp_auth_center_center.add(jtf_auth_host);
        jp_auth_center_center.add(jtf_auth_realm);
        jp_auth_center_center.add(jtf_auth_username);
        jp_auth_center_center.add(jpf_auth_password);
        jp_auth_center.add(jp_auth_center_center, BorderLayout.CENTER);
        jp_auth.add(jp_auth_center, BorderLayout.CENTER);
        JPanel jp_auth_encp = new JPanel();
        jp_auth_encp.setLayout(new FlowLayout(FlowLayout.LEFT));
        jp_auth_encp.add(jp_auth);
        jtp.addTab("Auth", jp_auth_encp);
        JPanel jp_ssl = new JPanel();
        jp_ssl.setLayout(new BorderLayout(BORDER_WIDTH, 2));
        JPanel jp_ssl_west = new JPanel();
        jp_ssl_west.setLayout(new GridLayout(3, 1));
        jp_ssl_west.add(UIUtil.getFlowLayoutPanelLeftAligned(new JLabel("Trust store file:")));
        jp_ssl_west.add(UIUtil.getFlowLayoutPanelLeftAligned(new JLabel("Trust store password:")));
        jp_ssl_west.add(UIUtil.getFlowLayoutPanelLeftAligned(new JLabel("Hostname verifier:")));
        jp_ssl.add(jp_ssl_west, BorderLayout.WEST);
        JPanel jp_ssl_center = new JPanel();
        jp_ssl_center.setLayout(new GridLayout(3, 1));
        JPanel jp_ssl_center_flow = UIUtil.getFlowLayoutPanelLeftAligned(jtf_ssl_truststore_file);
        jb_ssl_browse.setToolTipText("Open truststore file.");
        jb_ssl_browse.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                File f = rest_ui.getOpenFile(FileChooserType.OPEN_GENERIC);
                if(f == null){
                }
                else if(f.canRead()){
                    jtf_ssl_truststore_file.setText(f.getAbsolutePath());
                }
                else{
                    setStatusMessage("Truststore file cannot be read.");
                }
            }
        });
        jp_ssl_center_flow.add(jb_ssl_browse);
        jp_ssl_center.add(jp_ssl_center_flow);
        jp_ssl_center.add(UIUtil.getFlowLayoutPanelLeftAligned(jpf_ssl_truststore_pwd));
        jp_ssl_center.add(UIUtil.getFlowLayoutPanelLeftAligned(jcb_ssl_hostname_verifier));
        jp_ssl.add(jp_ssl_center, BorderLayout.CENTER);
        jtp.addTab("SSL", UIUtil.getFlowLayoutPanelLeftAligned("SSL Trust Store Configuration", jp_ssl));
        JPanel jp_etc = new JPanel();
        jp_etc.setLayout(new GridLayout(2, 1));
        {
            JPanel jp = new JPanel(new FlowLayout(FlowLayout.LEFT));
            jp.add(new JLabel("HTTP Version: "));
            jp.add(jcb_http_version);
            jp_etc.add(jp);
        }
        {
            JPanel jp = new JPanel(new FlowLayout(FlowLayout.LEFT));
            jp.add(jcb_followRedirects);
            jp_etc.add(jp);
        }
        {
            JPanel jp = new JPanel(new FlowLayout(FlowLayout.LEFT));
            jp.add(jp_etc);
            jtp.add("Etc.", jp);
        }
        JPanel jp_test = new JPanel();
        jp_test.setLayout(new BorderLayout());
        JPanel jp_test_north = new JPanel();
        jp_test_north.setLayout(new FlowLayout(FlowLayout.LEFT));
        jb_req_test_template.setToolTipText("Insert Template");
        jb_req_test_template.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                String t = se_test_script.getText();
                if(!StringUtil.isStrEmpty(t)){
                    JOptionPane.showMessageDialog(rest_ui.getFrame(),
                            "Script text already present! Please clear existing script!",
                            "Error", JOptionPane.ERROR_MESSAGE);
                    return;
                }
                se_test_script.setText(templateTestScript);
                se_test_script.setCaretPosition(0);
            }
        });
        jp_test_north.add(jb_req_test_template);
        jb_req_test_open.setToolTipText("Open Test Script From File");
        jb_req_test_open.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                String str = se_test_script.getText();
                if(!StringUtil.isStrEmpty(str)){
                    int ret = JOptionPane.showConfirmDialog(rest_ui.getFrame(), "Script already exists. Erase?", "Erase existing script?", JOptionPane.YES_NO_OPTION);
                    if(ret == JOptionPane.NO_OPTION){
                        return;
                    }
                }
                File f = rest_ui.getOpenFile(FileChooserType.OPEN_TEST_SCRIPT);
                if(f == null){
                    return;
                }
                if(!f.canRead()){
                    JOptionPane.showMessageDialog(rest_ui.getFrame(),
                            "IO Error (Read permission denied): " + f.getAbsolutePath(),
                            "IO Error", JOptionPane.ERROR_MESSAGE);
                    return;
                }
                try{
                    String testScript = FileUtil.getContentAsString(f, Charsets.UTF_8);
                    se_test_script.setText(testScript);
                    se_test_script.setCaretPosition(0);
                }
                catch(IOException ex){
                    showError(Util.getStackTrace(ex));
                }
            }
        });
        jp_test_north.add(jb_req_test_open);
        jp_test_north.add(new JSeparator(JSeparator.VERTICAL));
        jb_req_test_run.setToolTipText("Run Test");
        jb_req_test_run.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if(StringUtil.isStrEmpty(se_test_script.getText())){
                    JOptionPane.showMessageDialog(rest_ui.getFrame(),
                            "No script!", "Error", JOptionPane.ERROR_MESSAGE);
                    return;
                }
                if(jd_runTestDialog == null){
                    jd_runTestDialog = new RunTestDialog(rest_ui);
                }
                jd_runTestDialog.setVisible(true);
            }
        });
        jp_test_north.add(jb_req_test_run);
        jb_req_test_quick.setToolTipText("Quick Run Test-Using last request & response");
        jb_req_test_quick.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if(lastRequest == null || lastResponse == null){
                    JOptionPane.showMessageDialog(rest_ui.getFrame(), "No Last Request/Response", "Error", JOptionPane.ERROR_MESSAGE);
                    return;
                }
                String testScript = se_test_script.getText();
                if(StringUtil.isStrEmpty(testScript)){
                    JOptionPane.showMessageDialog(rest_ui.getFrame(), "No Script", "Error", JOptionPane.ERROR_MESSAGE);
                    return;
                }
                runClonedRequestTest(lastRequest, lastResponse);
            }
        });
        jp_test_north.add(jb_req_test_quick);
        jp_test.add(jp_test_north, BorderLayout.NORTH);
        jp_test.add(se_test_script.getEditorView(), BorderLayout.CENTER);
        jtp.addTab("Test Script", jp_test);
        return jtp;
    }

Output:
    private JTabbedPane initJTPRequest(){
        JTabbedPane jtp = new JTabbedPane();
        ButtonGroup bg = new ButtonGroup();
        bg.add(jrb_req_get);
        bg.add(jrb_req_post);
        bg.add(jrb_req_put);
        bg.add(jrb_req_delete);
        bg.add(jrb_req_head);
        bg.add(jrb_req_options);
        bg.add(jrb_req_trace);
        jrb_req_get.setSelected(true);
        jrb_req_get.setMnemonic('g');
        jrb_req_post.setMnemonic('p');
        jrb_req_put.setMnemonic('t');
        jrb_req_delete.setMnemonic('d');
        ActionListener jrbAL = new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                if(jrb_req_post.isSelected() || jrb_req_put.isSelected()){
                    setUIReqBodyEnabled(true);
                }
                else{
                    setUIReqBodyEnabled(false);
                }
            }
        };
        jrb_req_get.addActionListener(jrbAL);
        jrb_req_post.addActionListener(jrbAL);
        jrb_req_put.addActionListener(jrbAL);
        jrb_req_delete.addActionListener(jrbAL);
        jrb_req_head.addActionListener(jrbAL);
        jrb_req_options.addActionListener(jrbAL);
        jrb_req_trace.addActionListener(jrbAL);
        JPanel jp_method_encp = new JPanel();
        jp_method_encp.setLayout(new FlowLayout(FlowLayout.LEFT));
        JPanel jp_method = new JPanel();
        jp_method.setBorder(BorderFactory.createTitledBorder("HTTP Method"));
        jp_method.setLayout(new GridLayout(4, 2));
        jp_method.add(jrb_req_get);
        jp_method.add(jrb_req_post);
        jp_method.add(jrb_req_put);
        jp_method.add(jrb_req_delete);
        jp_method.add(jrb_req_head);
        jp_method.add(jrb_req_options);
        jp_method.add(jrb_req_trace);
        jp_method_encp.add(jp_method);
        jtp.addTab("Method", jp_method_encp);
        jp_2col_req_headers = new TwoColumnTablePanel(new String[]{"Header", "Value"}, rest_ui);
        jtp.addTab("Headers", jp_2col_req_headers);
        setUIReqBodyEnabled(false);
        JPanel jp_body = new JPanel();
        jp_body.setLayout(new BorderLayout());
        JPanel jp_body_north = new JPanel();
        jp_body_north.setLayout(new FlowLayout(FlowLayout.LEFT));
        jtf_body_content_type.setEditable(false);
        jtf_body_content_type.setColumns(24);
        jtf_body_content_type.setToolTipText("Selected Content-type & Charset");
        jtf_body_content_type.setText(Util.getFormattedContentType(
                jd_body_content_type.getContentType(),
                jd_body_content_type.getCharSet()));
        jp_body_north.add(jtf_body_content_type);
        jb_body_content_type.setToolTipText("Edit Content-type & Charset");
        jb_body_content_type.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                jd_body_content_type.setVisible(true);
            }
        });
        jp_body_north.add(jb_body_content_type);
        JSeparator js = new JSeparator(SwingConstants.VERTICAL);
        jp_body_north.add(js);
        jb_body_file.setToolTipText("Load from file");
        jb_body_file.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent event) {
                jb_body_fileActionPerformed(event);
            }
        });
        jp_body_north.add(jb_body_file);
        jb_body_params.setToolTipText("Insert parameters");
        jb_body_params.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent event) {
                jb_body_paramActionPerformed(event);
            }
        });
        jp_body_north.add(jb_body_params);
        final JPopupMenu jpm_req_body = new JPopupMenu();
        JMenu jm_syntax = new JMenu("Syntax Color");
        JMenuItem jmi_syntax_none = new JMenuItem("None");
        jmi_syntax_none.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                actionTextEditorSyntaxChange(se_req_body, TextEditorSyntax.DEFAULT);
            }
        });
        jm_syntax.add(jmi_syntax_none);
        JMenuItem jmi_syntax_xml = new JMenuItem("XML");
        jmi_syntax_xml.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                actionTextEditorSyntaxChange(se_req_body, TextEditorSyntax.XML);
            }
        });
        jm_syntax.add(jmi_syntax_xml);
        JMenuItem jmi_syntax_json = new JMenuItem("JSON");
        jmi_syntax_json.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                actionTextEditorSyntaxChange(se_req_body, TextEditorSyntax.JSON);
            }
        });
        jm_syntax.add(jmi_syntax_json);
        jpm_req_body.add(jm_syntax);
        if (se_req_body.getEditorComponent() instanceof JEditorPane) {
            se_req_body.getEditorComponent().addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(MouseEvent e) {
                    showPopup(e);
                }
                @Override
                public void mouseReleased(MouseEvent e) {
                    showPopup(e);
                }
                private void showPopup(final MouseEvent e) {
                    if(!se_req_body.getEditorComponent().isEnabled()){
                        return;
                    }
                    if (e.isPopupTrigger()) {
                        jpm_req_body.show(e.getComponent(), e.getX(), e.getY());
                    }
                }
            });
        }
        jp_body.add(jp_body_north, BorderLayout.NORTH);
        JPanel jp_body_center = new JPanel();
        jp_body_center.setLayout(new GridLayout(1, 1));
        jp_body_center.add(se_req_body.getEditorView());
        jp_body.add(jp_body_center, BorderLayout.CENTER);
        jtp.addTab("Body", jp_body);
        JPanel jp_auth = new JPanel();
        jp_auth.setLayout(new BorderLayout());
        JPanel jp_auth_west = new JPanel();
        jp_auth_west.setLayout(new BorderLayout());
        JPanel jp_auth_west_center = new JPanel();
        jp_auth_west_center.setBorder(BorderFactory.createTitledBorder("Auth Type"));
        jp_auth_west_center.setLayout(new GridLayout(2,1));
        jcb_auth_basic.setSelected(false);
        ActionListener action = new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent event) {
                auth_enableActionPerformed(event);
            }
        };
        jcb_auth_basic.addActionListener(action);
        jcb_auth_digest.addActionListener(action);
        jp_auth_west_center.add(jcb_auth_basic);
        jp_auth_west_center.add(jcb_auth_digest);
        jp_auth_west.add(jp_auth_west_center, BorderLayout.CENTER);
        JPanel jp_auth_west_south = new JPanel();
        jp_auth_west_south.setBorder(BorderFactory.createTitledBorder("Preemptive?"));
        jp_auth_west_south.setLayout(new GridLayout(1, 1));
        jcb_auth_preemptive.setToolTipText("Send authentication credentials before challenge");
        jcb_auth_preemptive.setSelected(true);
        jcb_auth_preemptive.setEnabled(false);
        jp_auth_west_south.add(jcb_auth_preemptive);
        jp_auth_west.add(jp_auth_west_south, BorderLayout.SOUTH);
        jp_auth.add(jp_auth_west, BorderLayout.WEST);
        JPanel jp_auth_center = new JPanel();
        jp_auth_center.setBorder(BorderFactory.createTitledBorder("Details"));
        jp_auth_center.setLayout(new BorderLayout());
        JPanel jp_auth_center_west = new JPanel();
        jp_auth_center_west.setLayout(new GridLayout(4, 1, BORDER_WIDTH, BORDER_WIDTH));
        jl_auth_host.setEnabled(false);
        jl_auth_realm.setEnabled(false);
        jl_auth_username.setEnabled(false);
        jl_auth_password.setEnabled(false);
        jp_auth_center_west.add(jl_auth_host);
        jp_auth_center_west.add(jl_auth_realm);
        jp_auth_center_west.add(jl_auth_username);
        jp_auth_center_west.add(jl_auth_password);
        jp_auth_center.add(jp_auth_center_west, BorderLayout.WEST);
        JPanel jp_auth_center_center = new JPanel();
        jp_auth_center_center.setLayout(new GridLayout(4, 1, BORDER_WIDTH, BORDER_WIDTH));
        jtf_auth_host.setEnabled(false);
        jtf_auth_realm.setEnabled(false);
        jtf_auth_username.setEnabled(false);
        jpf_auth_password.setEnabled(false);
        jp_auth_center_center.add(jtf_auth_host);
        jp_auth_center_center.add(jtf_auth_realm);
        jp_auth_center_center.add(jtf_auth_username);
        jp_auth_center_center.add(jpf_auth_password);
        jp_auth_center.add(jp_auth_center_center, BorderLayout.CENTER);
        jp_auth.add(jp_auth_center, BorderLayout.CENTER);
        JPanel jp_auth_encp = new JPanel();
        jp_auth_encp.setLayout(new FlowLayout(FlowLayout.LEFT));
        jp_auth_encp.add(jp_auth);
        jtp.addTab("Auth", jp_auth_encp);
        JPanel jp_ssl = new JPanel();
        jp_ssl.setLayout(new BorderLayout(BORDER_WIDTH, 2));
        JPanel jp_ssl_west = new JPanel();
        jp_ssl_west.setLayout(new GridLayout(3, 1));
        jp_ssl_west.add(UIUtil.getFlowLayoutPanelLeftAligned(new JLabel("Trust store file:")));
        jp_ssl_west.add(UIUtil.getFlowLayoutPanelLeftAligned(new JLabel("Trust store password:")));
        jp_ssl_west.add(UIUtil.getFlowLayoutPanelLeftAligned(new JLabel("Hostname verifier:")));
        jp_ssl.add(jp_ssl_west, BorderLayout.WEST);
        JPanel jp_ssl_center = new JPanel();
        jp_ssl_center.setLayout(new GridLayout(3, 1));
        JPanel jp_ssl_center_flow = UIUtil.getFlowLayoutPanelLeftAligned(jtf_ssl_truststore_file);
        jb_ssl_browse.setToolTipText("Open truststore file.");
        jb_ssl_browse.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                File f = rest_ui.getOpenFile(FileChooserType.OPEN_GENERIC);
                if(f == null){
                }
                else if(f.canRead()){
                    jtf_ssl_truststore_file.setText(f.getAbsolutePath());
                }
                else{
                    setStatusMessage("Truststore file cannot be read.");
                }
            }
        });
        jp_ssl_center_flow.add(jb_ssl_browse);
        jp_ssl_center.add(jp_ssl_center_flow);
        jp_ssl_center.add(UIUtil.getFlowLayoutPanelLeftAligned(jpf_ssl_truststore_pwd));
        jp_ssl_center.add(UIUtil.getFlowLayoutPanelLeftAligned(jcb_ssl_hostname_verifier));
        jp_ssl.add(jp_ssl_center, BorderLayout.CENTER);
        jtp.addTab("SSL", UIUtil.getFlowLayoutPanelLeftAligned("SSL Trust Store Configuration", jp_ssl));
        JPanel jp_etc = new JPanel();
        jp_etc.setLayout(new GridLayout(2, 1));
        {
            JPanel jp = new JPanel(new FlowLayout(FlowLayout.LEFT));
            jp.add(new JLabel("HTTP Version: "));
            jp.add(jcb_http_version);
            jp_etc.add(jp);
        }
        {
            JPanel jp = new JPanel(new FlowLayout(FlowLayout.LEFT));
            jcb_followRedirects.setSelected(true);
            jp.add(jcb_followRedirects);
            jp_etc.add(jp);
        }
        {
            JPanel jp = new JPanel(new FlowLayout(FlowLayout.LEFT));
            jp.add(jp_etc);
            jtp.add("Etc.", jp);
        }
        JPanel jp_test = new JPanel();
        jp_test.setLayout(new BorderLayout());
        JPanel jp_test_north = new JPanel();
        jp_test_north.setLayout(new FlowLayout(FlowLayout.LEFT));
        jb_req_test_template.setToolTipText("Insert Template");
        jb_req_test_template.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                String t = se_test_script.getText();
                if(!StringUtil.isStrEmpty(t)){
                    JOptionPane.showMessageDialog(rest_ui.getFrame(),
                            "Script text already present! Please clear existing script!",
                            "Error", JOptionPane.ERROR_MESSAGE);
                    return;
                }
                se_test_script.setText(templateTestScript);
                se_test_script.setCaretPosition(0);
            }
        });
        jp_test_north.add(jb_req_test_template);
        jb_req_test_open.setToolTipText("Open Test Script From File");
        jb_req_test_open.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                String str = se_test_script.getText();
                if(!StringUtil.isStrEmpty(str)){
                    int ret = JOptionPane.showConfirmDialog(rest_ui.getFrame(), "Script already exists. Erase?", "Erase existing script?", JOptionPane.YES_NO_OPTION);
                    if(ret == JOptionPane.NO_OPTION){
                        return;
                    }
                }
                File f = rest_ui.getOpenFile(FileChooserType.OPEN_TEST_SCRIPT);
                if(f == null){
                    return;
                }
                if(!f.canRead()){
                    JOptionPane.showMessageDialog(rest_ui.getFrame(),
                            "IO Error (Read permission denied): " + f.getAbsolutePath(),
                            "IO Error", JOptionPane.ERROR_MESSAGE);
                    return;
                }
                try{
                    String testScript = FileUtil.getContentAsString(f, Charsets.UTF_8);
                    se_test_script.setText(testScript);
                    se_test_script.setCaretPosition(0);
                }
                catch(IOException ex){
                    showError(Util.getStackTrace(ex));
                }
            }
        });
        jp_test_north.add(jb_req_test_open);
        jp_test_north.add(new JSeparator(JSeparator.VERTICAL));
        jb_req_test_run.setToolTipText("Run Test");
        jb_req_test_run.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if(StringUtil.isStrEmpty(se_test_script.getText())){
                    JOptionPane.showMessageDialog(rest_ui.getFrame(),
                            "No script!", "Error", JOptionPane.ERROR_MESSAGE);
                    return;
                }
                if(jd_runTestDialog == null){
                    jd_runTestDialog = new RunTestDialog(rest_ui);
                }
                jd_runTestDialog.setVisible(true);
            }
        });
        jp_test_north.add(jb_req_test_run);
        jb_req_test_quick.setToolTipText("Quick Run Test-Using last request & response");
        jb_req_test_quick.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if(lastRequest == null || lastResponse == null){
                    JOptionPane.showMessageDialog(rest_ui.getFrame(), "No Last Request/Response", "Error", JOptionPane.ERROR_MESSAGE);
                    return;
                }
                String testScript = se_test_script.getText();
                if(StringUtil.isStrEmpty(testScript)){
                    JOptionPane.showMessageDialog(rest_ui.getFrame(), "No Script", "Error", JOptionPane.ERROR_MESSAGE);
                    return;
                }
                runClonedRequestTest(lastRequest, lastResponse);
            }
        });
        jp_test_north.add(jb_req_test_quick);
        jp_test.add(jp_test_north, BorderLayout.NORTH);
        jp_test.add(se_test_script.getEditorView(), BorderLayout.CENTER);
        jtp.addTab("Test Script", jp_test);
        return jtp;
    }


Input:
    public Resolution save() {
        layer.getDetails().clear();
        for(Map.Entry<String,String> e: details.entrySet()) {
            layer.getDetails().put(e.getKey(), new ClobElement(e.getValue()));
        }
        layer.getReaders().clear();
        for (String groupName : groupsRead) {
            layer.getReaders().add(groupName);
        }
        layer.getWriters().clear();
        for (String groupName : groupsWrite) {
            layer.getWriters().add(groupName);
        }
        layer.setFeatureType(simpleFeatureType);
        Stripersist.getEntityManager().persist(layer);
        layer.getService().authorizationsModified();
        Stripersist.getEntityManager().getTransaction().commit();
        getContext().getMessages().add(new SimpleMessage("De kaartlaag is opgeslagen"));
        return new ForwardResolution(JSP);
    }

Output:
    public Resolution save() {
        layer.getDetails().keySet().removeAll(Arrays.asList(
                Layer.EXTRA_KEY_METADATA_STYLESHEET_URL,
                Layer.EXTRA_KEY_DOWNLOAD_URL,
                Layer.EXTRA_KEY_FILTERABLE
        ));
        for(Map.Entry<String,String> e: details.entrySet()) {
            if(e.getValue() != null) {
                layer.getDetails().put(e.getKey(), new ClobElement(e.getValue()));
            }
        }
        layer.getReaders().clear();
        for (String groupName : groupsRead) {
            layer.getReaders().add(groupName);
        }
        layer.getWriters().clear();
        for (String groupName : groupsWrite) {
            layer.getWriters().add(groupName);
        }
        layer.setFeatureType(simpleFeatureType);
        Stripersist.getEntityManager().persist(layer);
        layer.getService().authorizationsModified();
        Stripersist.getEntityManager().getTransaction().commit();
        getContext().getMessages().add(new SimpleMessage("De kaartlaag is opgeslagen"));
        return new ForwardResolution(JSP);
    }


Input:
    public void onBlockIgnite(BlockIgniteEvent event) {
        IgniteCause cause = event.getCause();
        Block block = event.getBlock();
        Player player = event.getPlayer();
        World world = block.getWorld();
        boolean isFireSpread = cause == IgniteCause.SLOW_SPREAD
                || cause == IgniteCause.SPREAD;
        if (plugin.preventLavaFire && cause == IgniteCause.LAVA) {
            event.setCancelled(true);
            return;
        }
        if (plugin.disableFireSpread) {
            event.setCancelled(true);
            return;
        }
        if (plugin.blockLighter && cause == IgniteCause.FLINT_AND_STEEL) {
            event.setCancelled(true);
            return;
        }
        if (plugin.fireSpreadDisableToggle && isFireSpread) {
            event.setCancelled(true);
            return;
        }
        if (plugin.disableFireSpreadBlocks.size() > 0 && isFireSpread) {
            int x = block.getX();
            int y = block.getY();
            int z = block.getZ();
            if (plugin.disableFireSpreadBlocks.contains(world.getBlockTypeIdAt(x, y - 1, z))
                    || plugin.disableFireSpreadBlocks.contains(world.getBlockTypeIdAt(x + 1, y, z))
                    || plugin.disableFireSpreadBlocks.contains(world.getBlockTypeIdAt(x - 1, y, z))
                    || plugin.disableFireSpreadBlocks.contains(world.getBlockTypeIdAt(x, y, z - 1))
                    || plugin.disableFireSpreadBlocks.contains(world.getBlockTypeIdAt(x, y, z + 1))) {
                event.setCancelled(true);
                return;
            }
        }
        if (plugin.useRegions && player != null && !plugin.hasPermission(player, "/regionbypass")) {
            Vector pt = toVector(block);
            LocalPlayer localPlayer = plugin.wrapPlayer(player);
            if (cause == IgniteCause.FLINT_AND_STEEL
                    && !plugin.regionManager.getApplicableRegions(pt).canBuild(localPlayer)) {
                event.setCancelled(true);
                return;
            }
            if (cause == IgniteCause.FLINT_AND_STEEL
                    && !plugin.regionManager.getApplicableRegions(pt).allowsLighter()) {
                event.setCancelled(true);
                return;
            }
        }
    }

Output:
    public void onBlockIgnite(BlockIgniteEvent event) {
        IgniteCause cause = event.getCause();
        Block block = event.getBlock();
        Player player = event.getPlayer();
        World world = block.getWorld();
        boolean isFireSpread = cause == IgniteCause.SLOW_SPREAD
                || cause == IgniteCause.SPREAD;
        if (plugin.preventLavaFire && cause == IgniteCause.LAVA) {
            event.setCancelled(true);
            return;
        }
        if (plugin.disableFireSpread && isFireSpread) {
            event.setCancelled(true);
            return;
        }
        if (plugin.blockLighter && cause == IgniteCause.FLINT_AND_STEEL) {
            event.setCancelled(true);
            return;
        }
        if (plugin.fireSpreadDisableToggle && isFireSpread) {
            event.setCancelled(true);
            return;
        }
        if (plugin.disableFireSpreadBlocks.size() > 0 && isFireSpread) {
            int x = block.getX();
            int y = block.getY();
            int z = block.getZ();
            if (plugin.disableFireSpreadBlocks.contains(world.getBlockTypeIdAt(x, y - 1, z))
                    || plugin.disableFireSpreadBlocks.contains(world.getBlockTypeIdAt(x + 1, y, z))
                    || plugin.disableFireSpreadBlocks.contains(world.getBlockTypeIdAt(x - 1, y, z))
                    || plugin.disableFireSpreadBlocks.contains(world.getBlockTypeIdAt(x, y, z - 1))
                    || plugin.disableFireSpreadBlocks.contains(world.getBlockTypeIdAt(x, y, z + 1))) {
                event.setCancelled(true);
                return;
            }
        }
        if (plugin.useRegions && player != null && !plugin.hasPermission(player, "/regionbypass")) {
            Vector pt = toVector(block);
            LocalPlayer localPlayer = plugin.wrapPlayer(player);
            if (cause == IgniteCause.FLINT_AND_STEEL
                    && !plugin.regionManager.getApplicableRegions(pt).canBuild(localPlayer)) {
                event.setCancelled(true);
                return;
            }
            if (cause == IgniteCause.FLINT_AND_STEEL
                    && !plugin.regionManager.getApplicableRegions(pt).allowsLighter()) {
                event.setCancelled(true);
                return;
            }
        }
    }


Input:
    public void act(WEATHER Weather) {
        boolean walked = false;
        if (diseased) {
            int temp = sight;
            sight = 4;
            findNearbyLife();
            for (Lifeform l : nearbyLife) {
                l.disease();
            }
            sight = temp;
            hunger = hunger + 20;
            thirst = thirst + 20;
        } else {
            if (Math.random() < 0.01) {
                disease();
            }
        }
        findNearbyLife();
        findWater();
        findFood(nearbyLife);
        findMate(nearbyLife);
        hunger = hunger + 1;
        thirst = thirst + 1;
        if (hunger > 70 || thirst > 70) {
            setDestination();
        }
        if (Weather == WEATHER.NIGHT && !nocturnal) {
        } else {
            final Point location = summative.getLocation(this);
            if (destination == null || getDirection(destination) == DIRECTION.SOUTH) {
                Point temp = new Point(location.x, location.y + 1);
                if (canWalk(temp)) {
                    walked = true;
                    summative.move(temp, this);
                }
            } else if (getDirection(destination) == DIRECTION.NORTH) {
                Point temp = new Point(location.x, location.y - 1);
                if (canWalk(temp)) {
                    walked = true;
                    summative.move(temp, this);
                }
            } else if (getDirection(destination) == DIRECTION.WEST) {
                Point temp = new Point(location.x - 1, location.y);
                if (canWalk(temp)) {
                    walked = true;
                    summative.move(temp, this);
                }
            } else if (getDirection(destination) == DIRECTION.EAST) {
                Point temp = new Point(location.x + 1, location.y);
                if (canWalk(temp)) {
                    walked = true;
                    summative.move(temp, this);
                }
            }
            if (walked == false) {
                Point tempS = new Point(location.x, location.y + 1);
                Point tempN = new Point(location.x, location.y - 1);
                Point tempW = new Point(location.x - 1, location.y);
                Point tempE = new Point(location.x + 1, location.y);
                boolean S = true;
                boolean W = true;
                boolean N = true;
                boolean E = true;
                int counter = 0;
                while (!walked) {
                    double x = Math.random();
                    if (x < 0.25 && canWalk(tempS)) {
                        summative.move(tempS, this);
                        walked = true;
                    } else if (S && !canWalk(tempS)) {
                        S = false;
                        counter = counter + 1;
                    } else if (x < 0.5 && canWalk(tempN)) {
                        summative.move(tempN, this);
                        walked = true;
                    } else if (N && !canWalk(tempN)) {
                        S = false;
                        counter = counter + 1;
                    } else if (x < 0.75 && canWalk(tempW)) {
                        summative.move(tempW, this);
                        walked = true;
                    } else if (W && !canWalk(tempW)) {
                        W = false;
                        counter = counter + 1;
                    } else if (canWalk(tempE)) {
                        summative.move(tempE, this);
                        walked = true;
                    } else if (E && !canWalk(tempE)) {
                        E = false;
                        counter = counter + 1;
                    }
                    if (counter == 4) {
                        walked = true;
                    }
                }
            }
            if (destination != null
                    && Math.abs(destination.x - location.x) <= 1 && Math.abs(destination.y - location.y) <= 1
                    && Math.abs(destination.x - location.x) + Math.abs(destination.y - location.y) < 2) {
                {
                    if (destination == water) {
                        thirst = 0;
                        setDestination();
                    } else if (destination == food) {
                        hunger = hunger - 30;
                        setDestination();
                        if (summative.lifeGet(destination) instanceof Tree) {
                            Tree temp = (Tree) (summative.lifeGet(destination));
                            if (temp.getCurrent() <= 0) {
                                temp.changeHealth(-50);
                            } else {
                                temp.changeCurrent(-1);
                            }
                        } else if (isPrey(summative.grassGet(destination))) {
                            Grass tempg = summative.grassGet(destination);
                            if (tempg.getCurrent() <= 0) {
                                tempg.changeHealth(-50);
                            } else {
                                tempg.changeCurrent(-1);
                            }
                        } else {
                            summative.kill(destination);
                        }
                    } else if (destination == mate) {
                        hunger = hunger + 30;
                        reproduce();
                        setDestination();
                    } else if (destination == murder) {
                        summative.lifeGet(destination).suicide();
                        setDestination();
                    }
                }
            }
        }
        if (hunger > 100 || thirst > 100) {
            suicide();
        } else if (drowning()) {
            suicide();
        }
    }

Output:
    public void act(WEATHER Weather) {
        boolean walked = false;
        if (diseased) {
            int temp = sight;
            sight = 4;
            findNearbyLife();
            for (Lifeform l : nearbyLife) {
                l.disease();
            }
            sight = temp;
            hunger = hunger + 20;
            thirst = thirst + 20;
        } else {
            if (Math.random() < 0.01) {
                disease();
            }
        }
        findNearbyLife();
        findWater();
        findFood(nearbyLife);
        findMate(nearbyLife);
        hunger = hunger + 1;
        thirst = thirst + 1;
        if (hunger > 70 || thirst > 70) {
            setDestination();
        }
        if (Weather == WEATHER.NIGHT && !nocturnal) {
        } else {
            final Point location = summative.getLocation(this);
            if (destination == null || getDirection(destination) == DIRECTION.SOUTH) {
                Point temp = new Point(location.x, location.y + 1);
                if (canWalk(temp)) {
                    walked = true;
                    summative.move(temp, this);
                }
            } else if (getDirection(destination) == DIRECTION.NORTH) {
                Point temp = new Point(location.x, location.y - 1);
                if (canWalk(temp)) {
                    walked = true;
                    summative.move(temp, this);
                }
            } else if (getDirection(destination) == DIRECTION.WEST) {
                Point temp = new Point(location.x - 1, location.y);
                if (canWalk(temp)) {
                    walked = true;
                    summative.move(temp, this);
                }
            } else if (getDirection(destination) == DIRECTION.EAST) {
                Point temp = new Point(location.x + 1, location.y);
                if (canWalk(temp)) {
                    walked = true;
                    summative.move(temp, this);
                }
            }
            if (walked == false) {
                Point tempS = new Point(location.x, location.y + 1);
                Point tempN = new Point(location.x, location.y - 1);
                Point tempW = new Point(location.x - 1, location.y);
                Point tempE = new Point(location.x + 1, location.y);
                boolean S = true;
                boolean W = true;
                boolean N = true;
                boolean E = true;
                int counter = 0;
                while (!walked) {
                    double x = Math.random();
                    if (x < 0.25 && canWalk(tempS)) {
                        summative.move(tempS, this);
                        walked = true;
                    } else if (S && !canWalk(tempS)) {
                        S = false;
                        counter = counter + 1;
                    } else if (x < 0.5 && canWalk(tempN)) {
                        summative.move(tempN, this);
                        walked = true;
                    } else if (N && !canWalk(tempN)) {
                        S = false;
                        counter = counter + 1;
                    } else if (x < 0.75 && canWalk(tempW)) {
                        summative.move(tempW, this);
                        walked = true;
                    } else if (W && !canWalk(tempW)) {
                        W = false;
                        counter = counter + 1;
                    } else if (canWalk(tempE)) {
                        summative.move(tempE, this);
                        walked = true;
                    } else if (E && !canWalk(tempE)) {
                        E = false;
                        counter = counter + 1;
                    }
                    if (counter == 4) {
                        walked = true;
                    }
                }
            }
            if (destination != null
                    && Math.abs(destination.x - location.x) <= 1 && Math.abs(destination.y - location.y) <= 1
                    && Math.abs(destination.x - location.x) + Math.abs(destination.y - location.y) < 2) {
                {
                    if (destination == water) {
                        thirst = 0;
                        setDestination();
                    } else if (destination == food) {
                        hunger = hunger - 30;
                        setDestination();
                        if (summative.lifeGet(destination) instanceof Tree) {
                            Tree temp = (Tree) (summative.lifeGet(destination));
                            if (temp.getCurrent() <= 0) {
                                temp.changeHealth(-50);
                            } else {
                                temp.changeCurrent(-1);
                            }
                        } else if (preyList.contains(Grass.class) && summative.lifeGet(destination) instanceof Grass) {
                            Grass tempg = summative.grassGet(destination);
                            if (tempg.getCurrent() <= 0) {
                                tempg.changeHealth(-50);
                            } else {
                                tempg.changeCurrent(-1);
                            }
                        } else {
                            summative.kill(destination);
                        }
                    } else if (destination == mate) {
                        hunger = hunger + 30;
                        reproduce();
                        setDestination();
                    } else if (destination == murder) {
                        summative.lifeGet(destination).suicide();
                        setDestination();
                    }
                }
            }
        }
        if (hunger > 100 || thirst > 100) {
            suicide();
        } else if (drowning()) {
            suicide();
        }
    }


Input:
        private Record convertLineToRecord(String line) {
            String tokens[] = splitFields(line);
            if (tokens.length != format.getFields().size() && !autoID) {
                throw new SessionInternalError("Mismatch of number of fields between " +
                        "the format and the file for line " + line + " Expected " +
                        format.getFields().size() + " found " + tokens.length);
            }
            if (removeQuote) {
                for (int f = 0; f < tokens.length; f++) {
                    if (tokens[f].length() < 2) {
                        continue;
                    }
                    if ((tokens[f].charAt(0) == '\"' || tokens[f].charAt(0) == '\'') &&
                            (tokens[f].charAt(tokens[f].length() - 1) == '\"' || tokens[f].charAt(tokens[f].length() - 1) == '\'')) {
                        tokens[f] = tokens[f].substring(1, tokens[f].length() - 1);
                    }
                }
            }
            Record record = new Record();
            int tkIdx = 0;
            for (FormatField field:format.getFields()) {
                if (autoID && field.getIsKey()) {
                    record.addField(new PricingField(field.getName(),
                                files[fileIndex].getName() + "-" + counter ), field.getIsKey());
                    continue;
                }
                switch (PricingField.mapType(field.getType())) {
                    case STRING:
                        record.addField(new PricingField(field.getName(),
                                tokens[tkIdx++]), field.getIsKey());
                        break;
                    case INTEGER:
                        String intStr = tokens[tkIdx++].trim();
                        if (field.getDurationFormat() != null && field.getDurationFormat().length() > 0) {
                            record.addField(new PricingField(field.getName(), intStr.length() > 0 ?
                                    convertDuration(intStr, field.getDurationFormat()) : null),
                                        field.getIsKey());
                        } else {
                            try {
                                record.addField(new PricingField(field.getName(), intStr.length() > 0 ?
                                        Integer.valueOf(intStr.trim()) : null), field.getIsKey());
                            } catch (NumberFormatException e) {
                                throw new SessionInternalError("Converting to integer " + field +
                                        " line " + line, AbstractFileReader.class, e);
                            }
                        }
                        break;
                    case DATE:
                        try {
                            String dateStr = tokens[tkIdx++];
                            record.addField(new PricingField(field.getName(), dateStr.length() > 0 ?
                                    dateFormat.parse(dateStr) : null), field.getIsKey());
                        } catch (ParseException e) {
                            throw new SessionInternalError("Using format: " + dateFormat + "[" +
                                    parameters.get("date_format") + "]",
                                    AbstractFileReader.class,e);
                        }
                        break;
                    case DECIMAL:
                        String floatStr = tokens[tkIdx++].trim();
                        record.addField(new PricingField(field.getName(), floatStr.length() > 0 ?
                                new BigDecimal(floatStr) : null), field.getIsKey());
                        break;
                    case BOOLEAN:
                        boolean value = "true".equalsIgnoreCase(tokens[tkIdx++].trim());
                        record.addField(new PricingField(field.getName(), value), field.getIsKey());
                        break;
                }
            }
            record.setPosition(counter);
            return record;
        }

Output:
        private Record convertLineToRecord(String line) {
            String tokens[] = splitFields(line);
            if (tokens.length != format.getFields().size() && !autoID) {
                throw new SessionInternalError("Mismatch of number of fields between " +
                        "the format and the file for line " + line + " Expected " +
                        format.getFields().size() + " found " + tokens.length);
            }
            if (removeQuote) {
                for (int f = 0; f < tokens.length; f++) {
                    if (tokens[f].length() < 2) {
                        continue;
                    }
                    if ((tokens[f].charAt(0) == '\"' || tokens[f].charAt(0) == '\'') &&
                            (tokens[f].charAt(tokens[f].length() - 1) == '\"' || tokens[f].charAt(tokens[f].length() - 1) == '\'')) {
                        tokens[f] = tokens[f].substring(1, tokens[f].length() - 1);
                    }
                }
            }
            Record record = new Record();
            int tkIdx = 0;
            for (FormatField field:format.getFields()) {
                if (autoID && field.getIsKey()) {
                    record.addField(new PricingField(field.getName(),
                                files[fileIndex].getName() + "-" + counter ), field.getIsKey());
                    tkIdx++;
                    continue;
                }
                switch (PricingField.mapType(field.getType())) {
                    case STRING:
                        record.addField(new PricingField(field.getName(),
                                tokens[tkIdx++]), field.getIsKey());
                        break;
                    case INTEGER:
                        String intStr = tokens[tkIdx++].trim();
                        if (field.getDurationFormat() != null && field.getDurationFormat().length() > 0) {
                            record.addField(new PricingField(field.getName(), intStr.length() > 0 ?
                                    convertDuration(intStr, field.getDurationFormat()) : null),
                                        field.getIsKey());
                        } else {
                            try {
                                record.addField(new PricingField(field.getName(), intStr.length() > 0 ?
                                        Integer.valueOf(intStr.trim()) : null), field.getIsKey());
                            } catch (NumberFormatException e) {
                                throw new SessionInternalError("Converting to integer " + field +
                                        " line " + line, AbstractFileReader.class, e);
                            }
                        }
                        break;
                    case DATE:
                        try {
                            String dateStr = tokens[tkIdx++];
                            record.addField(new PricingField(field.getName(), dateStr.length() > 0 ?
                                    dateFormat.parse(dateStr) : null), field.getIsKey());
                        } catch (ParseException e) {
                            throw new SessionInternalError("Using format: " + dateFormat + "[" +
                                    parameters.get("date_format") + "]",
                                    AbstractFileReader.class,e);
                        }
                        break;
                    case DECIMAL:
                        String floatStr = tokens[tkIdx++].trim();
                        record.addField(new PricingField(field.getName(), floatStr.length() > 0 ?
                                new BigDecimal(floatStr) : null), field.getIsKey());
                        break;
                    case BOOLEAN:
                        boolean value = "true".equalsIgnoreCase(tokens[tkIdx++].trim());
                        record.addField(new PricingField(field.getName(), value), field.getIsKey());
                        break;
                }
            }
            record.setPosition(counter);
            return record;
        }


Input:
    public final Long findRecordId(RouterSummaryTraffic record) {
        if (connection == null) {
            openConnection();
        }
        Long result = null;
        try {
            PreparedStatement pst = connection.prepareStatement("select a_id from aggreg where cisco = ? and" +
                    " iface = ? and date = ?");
            pst.setString(1, record.getRouter());
            pst.setString(2, record.getIface());
            pst.setDate(3, new java.sql.Date(record.getDate().getTime()));
            ResultSet rs = pst.executeQuery();
            if (rs.next()) {
                result = rs.getLong(1);
            }
            rs.close();
            pst.close();
        } catch (SQLException e) {
            log.error(e);
        }
        return result;
    }

Output:
    public final Long findRecordId(RouterSummaryTraffic record) {
        if (connection == null) {
            openConnection();
        }
        Long result = null;
        try {
            PreparedStatement pst = connection.prepareStatement("select a_id from aggreg where cisco = ? and" +
                    " iface = ? and dat = ?");
            pst.setString(1, record.getRouter());
            pst.setString(2, record.getIface());
            pst.setDate(3, new java.sql.Date(record.getDate().getTime()));
            ResultSet rs = pst.executeQuery();
            if (rs.next()) {
                result = rs.getLong(1);
            }
            rs.close();
            pst.close();
        } catch (SQLException e) {
            log.error(e);
        }
        return result;
    }


Input:
    public String getEnchantName(int enchant,int level){
        String result = WebPortal.materials.getConfig().getString("Enchant." + enchant );
        result += " ";
        switch (level) {
            case 1: result += "I"; break;
            case 2: result += "II"; break;
            case 3: result += "III"; break;
            case 4: result += "IV"; break;
            case 5: result += "V"; break;
            case 6: result += "VI"; break;
            case 7: result += "VII"; break;
            case 8: result += "VIII"; break;
            case 9: result += "IX"; break;
            case 10: result += "X"; break;
            case 40: result += "XL"; break;
            case 50: result += "L"; break;
            case 90: result += "XC"; break;
            case 100: result += "C"; break;
            case 400: result += "CD"; break;
            case 500: result += "D"; break;
            case 900: result += "CM"; break;
            case 1000: result += "M"; break;
            default:
                break;
        }
        return result;
    }

Output:
    public String getEnchantName(int enchant,int level){
        String result = WebPortal.materials.getConfig().getString("Enchant." + enchant );
        result += " ";
        switch (level) {
            case 1: result += "I"; break;
            case 2: result += "II"; break;
            case 3: result += "III"; break;
            case 4: result += "IV"; break;
            case 5: result += "V"; break;
            case 6: result += "VI"; break;
            case 7: result += "VII"; break;
            case 8: result += "VIII"; break;
            case 9: result += "IX"; break;
            case 10: result += "X"; break;
            case 40: result += "XL"; break;
            case 50: result += "L"; break;
            case 90: result += "XC"; break;
            case 100: result += "C"; break;
            case 400: result += "CD"; break;
            case 500: result += "D"; break;
            case 900: result += "CM"; break;
            case 1000: result += "M"; break;
            default: result += level; break;
        }
        return result;
    }


Input:
    public void paginate(ActionEvent action) {
        PaginatorActionEvent pEvent = (PaginatorActionEvent) action;
        DataverseGrouping grouping = (DataverseGrouping) itemBeans.get(0);
        grouping.setIsPopulated(false);
        if (DataPaginator.FACET_FIRST.equals(pEvent.getScrollerfacet())) {
            grouping.setFirstRow(0);
            grouping.setPageAction(true);
            grouping.getManagedDataModel();
        } else if (DataPaginator.FACET_PREVIOUS.equals(pEvent.getScrollerfacet())) {
            grouping.setFirstRow(Math.max( grouping.getFirstRow() - 10, 0 ) );
            grouping.setPageAction(true);
            grouping.getManagedDataModel();
        } else if (DataPaginator.FACET_NEXT.equals(pEvent.getScrollerfacet())) {
            checkForwardPaging(grouping,10);
        } else if (DataPaginator.FACET_FAST_REWIND.equals(pEvent.getScrollerfacet())) {
            grouping.setFirstRow(Math.max( grouping.getFirstRow() - 30, 0 ) );
            grouping.setPageAction(true);
            grouping.getManagedDataModel();
        } else if (DataPaginator.FACET_FAST_FORWARD.equals(pEvent.getScrollerfacet())) {
            checkForwardPaging(grouping,30);
        } else if (DataPaginator.FACET_LAST.equals(pEvent.getScrollerfacet())) {
            grouping.setFirstRow(grouping.getDataModelRowCount() - (grouping.getDataModelRowCount() % 10));
            grouping.setPageAction(true);
            grouping.getManagedDataModel();
        } else {
            System.out.println("The page event is " + pEvent.getPageIndex());
            int page = pEvent.getPageIndex();
            grouping.setFirstRow((page - 1) * 10);
            grouping.setPageAction(true);
            grouping.getManagedDataModel();
        }
    }

Output:
    public void paginate(ActionEvent action) {
        PaginatorActionEvent pEvent = (PaginatorActionEvent) action;
        DataverseGrouping grouping = (DataverseGrouping) itemBeans.get(0);
        grouping.setIsPopulated(false);
        if (DataPaginator.FACET_FIRST.equals(pEvent.getScrollerfacet())) {
            grouping.setFirstRow(0);
            grouping.setPageAction(true);
            grouping.getManagedDataModel();
        } else if (DataPaginator.FACET_PREVIOUS.equals(pEvent.getScrollerfacet())) {
            grouping.setFirstRow(Math.max( grouping.getFirstRow() - 10, 0 ) );
            grouping.setPageAction(true);
            grouping.getManagedDataModel();
        } else if (DataPaginator.FACET_NEXT.equals(pEvent.getScrollerfacet())) {
            checkForwardPaging(grouping,10);
        } else if (DataPaginator.FACET_FAST_REWIND.equals(pEvent.getScrollerfacet())) {
            grouping.setFirstRow(Math.max( grouping.getFirstRow() - 30, 0 ) );
            grouping.setPageAction(true);
            grouping.getManagedDataModel();
        } else if (DataPaginator.FACET_FAST_FORWARD.equals(pEvent.getScrollerfacet())) {
            checkForwardPaging(grouping,30);
        } else if (DataPaginator.FACET_LAST.equals(pEvent.getScrollerfacet())) {
            int dvRemainder = grouping.getDataModelRowCount() % 10;
            grouping.setFirstRow( grouping.getDataModelRowCount() - (dvRemainder != 0 ? dvRemainder : 10) );
            grouping.setPageAction(true);
            grouping.getManagedDataModel();
        } else {
            System.out.println("The page event is " + pEvent.getPageIndex());
            int page = pEvent.getPageIndex();
            grouping.setFirstRow((page - 1) * 10);
            grouping.setPageAction(true);
            grouping.getManagedDataModel();
        }
    }


Input:
    public void actionPerformed(ActionEvent ae) {
      String kommando = ((JMenuItem)ae.getSource()).getText();
      if(kommando.equals(res.getString("file.exit"))) {
        Rectangle rv = new Rectangle();
        frame.getBounds(rv);
        try {
          InputStream in = new FileInputStream(System.getProperty("user.home") + "/.yamm/.config");
          props.load(in);
          in.close();
        } catch (IOException propsioe) { System.err.println(propsioe); }
        props.setProperty("mainx", new Integer(rv.x).toString());
        props.setProperty("mainy", new Integer(rv.y).toString());
        props.setProperty("mainw", new Integer(rv.width).toString());
        props.setProperty("mainh", new Integer(rv.height).toString());
        try {
          OutputStream out = new FileOutputStream(System.getProperty("user.home") + "/.yamm/.config");
          props.store(out, "YAMM configuration file");
          out.close();
        } catch(IOException propsioe) { System.err.println(propsioe); }
        frame.dispose();
        System.exit(0);
      }
      else if(kommando.equals(res.getString("help.about_you"))) {
        String host = null, ipaddress = null;
        try {
          InetAddress myInetaddr = InetAddress.getLocalHost();
          ipaddress = myInetaddr.getHostAddress();
          host = myInetaddr.getHostName();
        }
        catch (UnknownHostException uhe) {};
        if (ipaddress == null) ipaddress = "unknown";
        if (host == null) host = "unknown";
        new MsgDialog(null, res.getString("help.about_you"),
                      res.getString("info.os") + " : " + System.getProperty("os.name") + " " + System.getProperty("os.version") + "\n"
                    + res.getString("info.cpu") + " : " + System.getProperty("os.arch") + "\n"
                    + res.getString("info.ipaddress") + " : " + ipaddress + "\n"
                    + res.getString("info.host") + " : " + host + "\n"
                    + res.getString("info.java.version") + " : " + System.getProperty("java.version") + "\n"
                    + res.getString("info.java.vendor") + " : " + System.getProperty("java.vendor") + "\n"
                    + res.getString("info.java.vendor.url") + " : " + System.getProperty("java.vendor.url") + "\n"
                    + res.getString("info.username") + " : " + System.getProperty("user.name") + "\n"
                    + res.getString("info.user.home") + " : " + System.getProperty("user.home"));
      }
      else if(kommando.equals(res.getString("help.about"))) {
        new MsgDialog(null, res.getString("help.about"),
                      "Copyright (C) 1999 Fredrik Ehnbom\n"
                    + "YAMM-version: " + YAMM.yammVersion + "\n"
                    + "Compiledate: " + YAMM.compDate + "\n"
                    + "Homepage: http://www.gjt.org/�fredde/\n"
                    + "E-mail: <fredde@gjt.org>\n"
                    + "\n"
                    + "Most icons are made or based on icons made\n"
                    + "by Tuomas Kuosmanen <tigert@gimp.org>");
      }
      else if(kommando.equals(res.getString("help.bug_report"))) {
        YAMMWrite yw = new YAMMWrite("fredde@gjt.org", "Bug report");
         JTextArea jt = yw.myTextArea;
         jt.append("What is the problem?\n\n");
         jt.append("How did you make it happen?\n\n");
         jt.append("Can you make it happen again?\n\n");
         jt.append("\nAnd now some info about your system:\n");
         p("java.version", jt);
         p("java.vendor", jt);
         p("java.vendor.url", jt);
         p("java.home", jt);
         p("java.vm.specification.version", jt);
         p("java.vm.specification.vendor", jt);
         p("java.vm.specification.name", jt);
         p("java.vm.version", jt);
         p("java.vm.vendor", jt);
         p("java.vm.name", jt);
         p("java.specification.version", jt);
         p("java.specification.vendor", jt);
         p("java.specification.name", jt);
         p("java.class.version", jt);
         p("java.class.path", jt);
         p("os.name", jt);
         p("os.arch", jt);
         p("os.version", jt);
      }
      else if(kommando.equals(res.getString("help.license"))) {
        new MsgDialog(null, res.getString("help.license"),
                      "Yet Another Mail Manager " + YAMM.yammVersion + " E-Mail Client\nCopyright (C) 1999 Fredrik Ehnbom\n" +
                      "\n" +
                      "This program is free software; you can redistribute it and/or modify\n" +
                      "it under the terms of the GNU General Public License as published by\n" +
                      "the Free Software Foundation; either version 2 of the License, or\n" +
                      "(at your option) any later version.\n" +
                      "\n" +
                      "This program is distributed in the hope that it will be useful,\n" +
                      "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +
                      "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n" +
                      "GNU General Public License for more details.\n" +
                      "\n" +
                      "You should have received a copy of the GNU General Public License\n" +
                      "along with this program; if not, write to the Free Software\n" +
                      "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA", MsgDialog.OK, JLabel.LEFT);
      }
      else if(kommando.equals(res.getString("edit.settings"))) {
        new Options(frame);
      }
      else if(kommando.equals(res.getString("file.new"))) {
        new YAMMWrite();
      }
      else if(kommando.equals(res.getString("edit.view_source"))) {
        int test = ((JTable)frame.mailList).getSelectedRow();
        if(test >= 0 && test < frame.listOfMails.size()) {
          int i = 0;
          while(i<4) {
            if(((JTable)frame.mailList).getColumnName(i).equals("#")) { break; }
            i++;
          }
          int msg = Integer.parseInt(((JTable)frame.mailList).getValueAt(((JTable)frame.mailList).getSelectedRow(), i).toString());
          if(msg != -1) Mailbox.viewSource(frame.selectedbox, msg, new sourceViewer().jtarea);
        }
      }
      else if(kommando.equals(res.getString("file.save_as"))) {
        int test = ((JTable)frame.mailList).getSelectedRow();
        if(test != -1 && test <= frame.listOfMails.size()) {
          JFileChooser jfs = new JFileChooser();
          jfs.setFileSelectionMode(JFileChooser.FILES_ONLY);
          jfs.setMultiSelectionEnabled(false);
          jfs.setFileFilter(new filter());
          jfs.setSelectedFile(new File("mail.html"));
          int ret = jfs.showSaveDialog(frame);
          if(ret == JFileChooser.APPROVE_OPTION) {
              new File(System.getProperty("user.home") + "/.yamm/tmp/" + frame.mailName + ".html").renameTo(jfs.getSelectedFile());
          }
        }
      }
    }

Output:
    public void actionPerformed(ActionEvent ae) {
      String kommando = ((JMenuItem)ae.getSource()).getText();
      if(kommando.equals(res.getString("file.exit"))) {
        Rectangle rv = new Rectangle();
        frame.getBounds(rv);
        try {
          InputStream in = new FileInputStream(System.getProperty("user.home") + "/.yamm/.config");
          props.load(in);
          in.close();
        } catch (IOException propsioe) { System.err.println(propsioe); }
        props.setProperty("mainx", new Integer(rv.x).toString());
        props.setProperty("mainy", new Integer(rv.y).toString());
        props.setProperty("mainw", new Integer(rv.width).toString());
        props.setProperty("mainh", new Integer(rv.height).toString());
        try {
          OutputStream out = new FileOutputStream(System.getProperty("user.home") + "/.yamm/.config");
          props.store(out, "YAMM configuration file");
          out.close();
        } catch(IOException propsioe) { System.err.println(propsioe); }
        frame.dispose();
        System.exit(0);
      }
      else if(kommando.equals(res.getString("help.about_you"))) {
        String host = null, ipaddress = null;
        try {
          InetAddress myInetaddr = InetAddress.getLocalHost();
          ipaddress = myInetaddr.getHostAddress();
          host = myInetaddr.getHostName();
        }
        catch (UnknownHostException uhe) {};
        if (ipaddress == null) ipaddress = "unknown";
        if (host == null) host = "unknown";
        new MsgDialog(null, res.getString("help.about_you"),
                      res.getString("info.os") + " : " + System.getProperty("os.name") + " " + System.getProperty("os.version") + "\n"
                    + res.getString("info.cpu") + " : " + System.getProperty("os.arch") + "\n"
                    + res.getString("info.ipaddress") + " : " + ipaddress + "\n"
                    + res.getString("info.host") + " : " + host + "\n"
                    + res.getString("info.java.version") + " : " + System.getProperty("java.version") + "\n"
                    + res.getString("info.java.vendor") + " : " + System.getProperty("java.vendor") + "\n"
                    + res.getString("info.java.vendor.url") + " : " + System.getProperty("java.vendor.url") + "\n"
                    + res.getString("info.username") + " : " + System.getProperty("user.name") + "\n"
                    + res.getString("info.user.home") + " : " + System.getProperty("user.home"));
      }
      else if(kommando.equals(res.getString("help.about"))) {
        new MsgDialog(null, res.getString("help.about"),
                      "Copyright (C) 1999 Fredrik Ehnbom\n"
                    + "YAMM-version: " + YAMM.yammVersion + "\n"
                    + "Compiledate: " + YAMM.compDate + "\n"
                    + "Homepage: http://www.gjt.org/~fredde/\n"
                    + "E-mail: <fredde@gjt.org>\n"
                    + "\n"
                    + "Most icons are made or based on icons made\n"
                    + "by Tuomas Kuosmanen <tigert@gimp.org>");
      }
      else if(kommando.equals(res.getString("help.bug_report"))) {
        YAMMWrite yw = new YAMMWrite("fredde@gjt.org", "Bug report");
         JTextArea jt = yw.myTextArea;
         jt.append("What is the problem?\n\n");
         jt.append("How did you make it happen?\n\n");
         jt.append("Can you make it happen again?\n\n");
         jt.append("\nAnd now some info about your system:\n");
         p("java.version", jt);
         p("java.vendor", jt);
         p("java.vendor.url", jt);
         p("java.home", jt);
         p("java.vm.specification.version", jt);
         p("java.vm.specification.vendor", jt);
         p("java.vm.specification.name", jt);
         p("java.vm.version", jt);
         p("java.vm.vendor", jt);
         p("java.vm.name", jt);
         p("java.specification.version", jt);
         p("java.specification.vendor", jt);
         p("java.specification.name", jt);
         p("java.class.version", jt);
         p("java.class.path", jt);
         p("os.name", jt);
         p("os.arch", jt);
         p("os.version", jt);
      }
      else if(kommando.equals(res.getString("help.license"))) {
        new MsgDialog(null, res.getString("help.license"),
                      "Yet Another Mail Manager " + YAMM.yammVersion + " E-Mail Client\nCopyright (C) 1999 Fredrik Ehnbom\n" +
                      "\n" +
                      "This program is free software; you can redistribute it and/or modify\n" +
                      "it under the terms of the GNU General Public License as published by\n" +
                      "the Free Software Foundation; either version 2 of the License, or\n" +
                      "(at your option) any later version.\n" +
                      "\n" +
                      "This program is distributed in the hope that it will be useful,\n" +
                      "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +
                      "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n" +
                      "GNU General Public License for more details.\n" +
                      "\n" +
                      "You should have received a copy of the GNU General Public License\n" +
                      "along with this program; if not, write to the Free Software\n" +
                      "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA", MsgDialog.OK, JLabel.LEFT);
      }
      else if(kommando.equals(res.getString("edit.settings"))) {
        new Options(frame);
      }
      else if(kommando.equals(res.getString("file.new"))) {
        new YAMMWrite();
      }
      else if(kommando.equals(res.getString("edit.view_source"))) {
        int test = ((JTable)frame.mailList).getSelectedRow();
        if(test >= 0 && test < frame.listOfMails.size()) {
          int i = 0;
          while(i<4) {
            if(((JTable)frame.mailList).getColumnName(i).equals("#")) { break; }
            i++;
          }
          int msg = Integer.parseInt(((JTable)frame.mailList).getValueAt(((JTable)frame.mailList).getSelectedRow(), i).toString());
          if(msg != -1) Mailbox.viewSource(frame.selectedbox, msg, new sourceViewer().jtarea);
        }
      }
      else if(kommando.equals(res.getString("file.save_as"))) {
        int test = ((JTable)frame.mailList).getSelectedRow();
        if(test != -1 && test <= frame.listOfMails.size()) {
          JFileChooser jfs = new JFileChooser();
          jfs.setFileSelectionMode(JFileChooser.FILES_ONLY);
          jfs.setMultiSelectionEnabled(false);
          jfs.setFileFilter(new filter());
          jfs.setSelectedFile(new File("mail.html"));
          int ret = jfs.showSaveDialog(frame);
          if(ret == JFileChooser.APPROVE_OPTION) {
              new File(System.getProperty("user.home") + "/.yamm/tmp/" + frame.mailName + ".html").renameTo(jfs.getSelectedFile());
          }
        }
      }
    }


Input:
  public void setGroup(Player player, groupType group) {
    if (!player.isOnline())
            return;
        switch(group) {
            case UNREGISTERED: {
                String currentGroup = AuthMe.permission.getPrimaryGroup(player);
                AuthMe.permission.playerRemoveGroup(player, currentGroup);
                AuthMe.permission.playerAddGroup(player, Settings.unRegisteredGroup);
                break;
            }
            case REGISTERED: {
                String currentGroup = AuthMe.permission.getPrimaryGroup(player);
                AuthMe.permission.playerRemoveGroup(player, currentGroup);
                AuthMe.permission.playerAddGroup(player, Settings.getRegisteredGroup);
                break;
            }
        }
        return;
    }

Output:
  public void setGroup(Player player, groupType group) {
    if (!player.isOnline())
            return;
        switch(group) {
            case UNREGISTERED: {
                currentGroup = AuthMe.permission.getPrimaryGroup(player);
                AuthMe.permission.playerRemoveGroup(player, currentGroup);
                AuthMe.permission.playerAddGroup(player, Settings.unRegisteredGroup);
                break;
            }
            case REGISTERED: {
                currentGroup = AuthMe.permission.getPrimaryGroup(player);
                AuthMe.permission.playerRemoveGroup(player, currentGroup);
                AuthMe.permission.playerAddGroup(player, Settings.getRegisteredGroup);
                break;
            }
        }
        return;
    }


Input:
	public ModelAndView saveflow(final HttpServletRequest req, HttpServletResponse res) throws MeandreServerException{
		String token=System.currentTimeMillis()+"-token";
		HashMap<String,String> paramMap = new HashMap<String,String>();
		boolean isMultipart = ServletFileUpload.isMultipartContent(req);
		if(!isMultipart){
			LOGGER.severe("Error -this should be multipart");
		}
		DiskFileItemFactory factory = new DiskFileItemFactory();
		ServletFileUpload upload = new ServletFileUpload(factory);
		String uploadDir = getServletContext().getRealPath(getUploadDirectory()) + "/" + req.getRemoteUser() + "/"+ token+"/";
	     File dirPath = new File(uploadDir);
	      if (!dirPath.exists()) {
	         dirPath.mkdirs();
	      }
	      String flowId =  null;
		  String flowUri= null;
		try {
			List<FileItem> items = upload.parseRequest(req);
			Iterator<FileItem> iter = items.iterator();
			while (iter.hasNext()) {
			    FileItem item = iter.next();
			    if (item.isFormField()) {
			    	String name = item.getFieldName();
			        String value = item.getString();
			        paramMap.put(name, value);
			        if("flowTemplateId".equals(name)){
			        	flowId = value;
			        }else if("flowTemplateUri".equals(name)){
			        	 flowUri = value;
			        }
			    } else {
			    	String fieldName = item.getFieldName();
			        String fileName = item.getName();
			        String contentType = item.getContentType();
			        boolean isInMemory = item.isInMemory();
			        long sizeInBytes = item.getSize();
			        if(fileName!=null && sizeInBytes>0 && fileName.length()>0){
			        	File uploadedFile = new File(uploadDir+File.separator + fileName);
			        	item.write(uploadedFile);
			        	System.out.println("file uploaded: "+ fileName + uploadedFile.getAbsolutePath());
			        	String webDir = uploadDir.substring(getServletContext().getRealPath("/").length());
			        	paramMap.put(fieldName,"http://"+ req.getServerName()+":"+req.getServerPort()+ req.getContextPath()+webDir+fileName);
			        }
			    }
			}
		} catch (FileUploadException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
		if(flowId==null || flowUri==null){
			LOGGER.severe("flowId or flowUri is null -some severe error happened...");
		}
		String newFlowUri=flowService.createNewFlow(paramMap,flowUri);
		Long longFlowId  =Long.parseLong(flowId);
		Flow templateFlow = this.getFlowService().getFlow(longFlowId );
		String name = paramMap.get("name");
		String description = paramMap.get("description");
		if(name ==null){
			name =templateFlow.getName()+File.separator+token;
		}
		if(description==null){
			description = templateFlow.getDescription()+" for flow: "+token;
		}
		User user = userManager.getCurrentUser();
		logger.debug("USER IS ====> " + user);
		if (user == null) {
			user = userManager.getUserByUsername("admin");
		}
		long userId = user.getId();
		Flow instance = new Flow();
		instance.setCreatorId(userId);
		instance.setDateCreated(new Date());
		instance.setInstanceOf(templateFlow);
		instance.setKeyWords(templateFlow.getKeyWords());
		instance.setName(name);
		instance.setTemplate(false);
		instance.setUrl(newFlowUri);
		instance.setDescription(description);
		instance.setType(FlowTypeUtils.DEFAULT_FLOW);
		System.out.println("The new flow uri is: " + newFlowUri);
		long instanceId=this.getFlowService().storeFlowInstance(instance);
		Job job=this.getFlowService().executeJob(token, name,description, instanceId, user.getId(), user.getEmail());
		ModelAndView mav= new ModelAndView(new RedirectView("JobManager.jobDetail",true));
		mav.addObject("id", job.getId());
		return mav;
	}

Output:
	public ModelAndView saveflow(final HttpServletRequest req, HttpServletResponse res) throws MeandreServerException{
		String token=System.currentTimeMillis()+"-token";
		HashMap<String,String> paramMap = new HashMap<String,String>();
		boolean isMultipart = ServletFileUpload.isMultipartContent(req);
		if(!isMultipart){
			LOGGER.severe("Error -this should be multipart");
		}
		DiskFileItemFactory factory = new DiskFileItemFactory();
		ServletFileUpload upload = new ServletFileUpload(factory);
		String uploadDir = getServletContext().getRealPath(getUploadDirectory()) + "/" + req.getRemoteUser() + "/"+ token+"/";
	     File dirPath = new File(uploadDir);
	      if (!dirPath.exists()) {
	         dirPath.mkdirs();
	      }
	      String flowId =  null;
		  String flowUri= null;
		try {
			List<FileItem> items = upload.parseRequest(req);
			Iterator<FileItem> iter = items.iterator();
			while (iter.hasNext()) {
			    FileItem item = iter.next();
			    if (item.isFormField()) {
			    	String name = item.getFieldName();
			        String value = item.getString();
			        paramMap.put(name, value);
			        if("flowTemplateId".equals(name)){
			        	flowId = value;
			        }else if("flowTemplateUri".equals(name)){
			        	 flowUri = value;
			        }
			    } else {
			    	String fieldName = item.getFieldName();
			        String fileName = item.getName();
			        String contentType = item.getContentType();
			        boolean isInMemory = item.isInMemory();
			        long sizeInBytes = item.getSize();
			        if(fileName!=null && sizeInBytes>0 && fileName.length()>0){
			        	File uploadedFile = new File(uploadDir+File.separator + fileName);
			        	item.write(uploadedFile);
			        	System.out.println("file uploaded: "+ fileName + uploadedFile.getAbsolutePath());
			        	String webDir = uploadDir.substring(getServletContext().getRealPath("/").length());
			        	paramMap.put(fieldName,"http://"+ req.getServerName()+":"+req.getServerPort()+ req.getContextPath()+webDir+fileName);
			        }
			    }
			}
		} catch (FileUploadException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
		if(flowId==null || flowUri==null){
			LOGGER.severe("flowId or flowUri is null -some severe error happened...");
		}
		String newFlowUri=flowService.createNewFlow(paramMap,flowUri);
		Long longFlowId  =Long.parseLong(flowId);
		Flow templateFlow = this.getFlowService().getFlow(longFlowId );
		String name = paramMap.get("name");
		String description = paramMap.get("description");
		if(name ==null){
			name =templateFlow.getName()+File.separator+token;
		}
		if(description==null){
			description = templateFlow.getDescription()+" for flow: "+token;
		}
		User user = userManager.getCurrentUser();
		logger.debug("USER IS ====> " + user);
		if (user == null) {
			user = userManager.getUserByUsername("admin");
		}
		long userId = user.getId();
		Flow instance = new Flow();
		instance.setCreatorId(userId);
		instance.setDateCreated(new Date());
		instance.setInstanceOf(templateFlow);
		instance.setKeyWords(templateFlow.getKeyWords());
		instance.setName(name);
		instance.setTemplate(false);
		instance.setUrl(newFlowUri);
		instance.setDescription(description);
		instance.setType(Flow.FlowType.INHERITS);
		instance.setTypeName(Flow.FlowType.INHERITS.getName());
		System.out.println("The new flow uri is: " + newFlowUri);
		long instanceId=this.getFlowService().storeFlowInstance(instance);
		Job job=this.getFlowService().executeJob(token, name,description, instanceId, user.getId(), user.getEmail());
		ModelAndView mav= new ModelAndView(new RedirectView("JobManager.jobDetail",true));
		mav.addObject("id", job.getId());
		return mav;
	}


Input:
    public boolean a(OItemStack paramOItemStack, OEntityPlayer paramOEntityPlayer, OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
        int clicked = paramOWorld.a(paramInt1, paramInt2, paramInt3);
        Block blockClicked = new Block(clicked, paramInt1, paramInt2, paramInt3);
        if (clicked == OBlock.aS.bk) {
            paramInt4 = 0;
        } else {
            if (paramInt4 == 0) {
                paramInt2--;
            }
            if (paramInt4 == 1) {
                paramInt2++;
            }
            if (paramInt4 == 2) {
                paramInt3--;
            }
            if (paramInt4 == 3) {
                paramInt3++;
            }
            if (paramInt4 == 4) {
                paramInt1--;
            }
            if (paramInt4 == 5) {
                paramInt1++;
            }
        }
        if (paramOItemStack.a == 0) {
            return false;
        }
        if (paramOWorld.a(a, paramInt1, paramInt2, paramInt3, false)) {
            Block blockPlaced = new Block(paramOWorld.a(paramInt1, paramInt2, paramInt3), paramInt1, paramInt2, paramInt3);
            blockClicked.setFaceClicked(Block.Face.fromId(paramInt4));
            Player player = ((OEntityPlayerMP) paramOEntityPlayer).getPlayer();
            if ((Boolean) etc.getLoader().callHook(PluginLoader.Hook.ITEM_USE, player, blockPlaced, blockClicked, new Item(paramOItemStack)))
                return false;
            OBlock localOBlock = OBlock.m[a];
            if (paramOWorld.e(paramInt1, paramInt2, paramInt3, a)) {
                OBlock.m[a].d(paramOWorld, paramInt1, paramInt2, paramInt3, paramInt4);
                OBlock.m[a].a(paramOWorld, paramInt1, paramInt2, paramInt3, paramOEntityPlayer);
                paramOWorld.a(paramInt1 + 0.5F, paramInt2 + 0.5F, paramInt3 + 0.5F, localOBlock.bt.c(), (localOBlock.bt.a() + 1.0F) / 2.0F, localOBlock.bt.b() * 0.8F);
                paramOItemStack.a -= 1;
            }
        }
        return true;
    }

Output:
    public boolean a(OItemStack paramOItemStack, OEntityPlayer paramOEntityPlayer, OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
        int clicked = paramOWorld.a(paramInt1, paramInt2, paramInt3);
        Block blockClicked = new Block(clicked, paramInt1, paramInt2, paramInt3);
        if (clicked == OBlock.aS.bk) {
            paramInt4 = 0;
        } else {
            if (paramInt4 == 0) {
                paramInt2--;
            }
            if (paramInt4 == 1) {
                paramInt2++;
            }
            if (paramInt4 == 2) {
                paramInt3--;
            }
            if (paramInt4 == 3) {
                paramInt3++;
            }
            if (paramInt4 == 4) {
                paramInt1--;
            }
            if (paramInt4 == 5) {
                paramInt1++;
            }
        }
        if (paramOItemStack.a == 0) {
            return false;
        }
        if (paramOWorld.a(a, paramInt1, paramInt2, paramInt3, false)) {
            Block blockPlaced = new Block(paramOWorld.a(paramInt1, paramInt2, paramInt3), paramInt1, paramInt2, paramInt3);
            blockClicked.setFaceClicked(Block.Face.fromId(paramInt4));
            Player player = ((OEntityPlayerMP) paramOEntityPlayer).getPlayer();
            if ((Boolean) etc.getLoader().callHook(PluginLoader.Hook.ITEM_USE, player, blockPlaced, blockClicked, new Item(paramOItemStack)))
                return false;
            OBlock localOBlock = OBlock.m[a];
            if (paramOWorld.e(paramInt1, paramInt2, paramInt3, a)) {
                OBlock.m[a].d(paramOWorld, paramInt1, paramInt2, paramInt3, paramInt4);
                OBlock.m[a].a(paramOWorld, paramInt1, paramInt2, paramInt3, (OEntityLiving) paramOEntityPlayer);
                paramOWorld.a(paramInt1 + 0.5F, paramInt2 + 0.5F, paramInt3 + 0.5F, localOBlock.bt.c(), (localOBlock.bt.a() + 1.0F) / 2.0F, localOBlock.bt.b() * 0.8F);
                paramOItemStack.a -= 1;
            }
        }
        return true;
    }


Input:
	public synchronized void addJaxbPackages(List<String> packageList) {
		if (packagesContextPath.length()==0) {
		}
		StringBuilder contextPath = new StringBuilder(packagesContextPath);
		for (String pack : packageList)
			contextPath.append(":" + pack);
		try {
			for (int i=0; i<packageList.size(); i++) {
				String packageStr = packageList.get(i);
				String nsStr = getNSfromPackage(packageStr);
				nsToPackage.put(nsStr, packageStr);
			}
		}
		catch (Exception ex) {
			LOG.error("Error in JAXBMapping adding: " + ex.getMessage());
		}
		packagesContextPath = contextPath.toString();
	}
	private String getNSfromPackage(String packageString) {
		String ns = "";
		String[] packArr = packageString.split("\\.");
		ns = "http://" + packArr[1] + "." + packArr[0];
		for(int i=2; i<packArr.length; i++)
			ns+="/" + packArr[i];
		return ns;
	}
	@Override
	public void addSimpleClasses(List<String> classList) throws ClassNotFoundException {
		for (String c : classList) {
			Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(c);
			Root rootAnnotation = clazz.getAnnotation(Root.class);
			Namespace namespaceAnnotation = clazz.getAnnotation(Namespace.class);
			if (rootAnnotation!=null && namespaceAnnotation!=null) {
				elementToClass.put("{"+namespaceAnnotation.reference()+"}"+rootAnnotation.name(),clazz);
			}
		}
	}
}

Output:
	public synchronized void addJaxbPackages(List<String> packageList) {
		if (packagesContextPath.length()==0) {
		}
		StringBuilder contextPath = new StringBuilder(packagesContextPath);
		for (String pack : packageList)
			contextPath.append(":" + pack);
		try {
			for (int i=0; i<packageList.size(); i++) {
				String packageStr = packageList.get(i);
				String nsStr = getNSfromPackage(packageStr);
				nsToPackage.put(nsStr, packageStr);
			}
		}
		catch (Exception ex) {
			LOG.error("Error in JAXBMapping adding: " + ex.getMessage());
		}
		packagesContextPath = contextPath.toString();
	}
	private String getNSfromPackage(String packageString) {
		String ns = "";
		String[] packArr = packageString.split("\\.");
		ns = "http://" + packArr[1] + "." + packArr[0];
		for(int i=2; i<packArr.length; i++)
			ns+="/" + packArr[i];
		return ns;
	}
	@Override
	public void addSimpleClasses(List<String> classList) throws ClassNotFoundException {
		ClassLoader cl = Thread.currentThread().getContextClassLoader();
		try {
			for (String c : classList) {
				Class<?> clazz = cl.loadClass(c);
				Root rootAnnotation = clazz.getAnnotation(Root.class);
				Namespace namespaceAnnotation = clazz.getAnnotation(Namespace.class);
				if (rootAnnotation!=null && namespaceAnnotation!=null) {
					elementToClass.put("{"+namespaceAnnotation.reference()+"}"+rootAnnotation.name(),clazz);
				}
			}
		} catch (ClassNotFoundException e) {
			throw new ClassNotFoundException("Unable to load class using classloader "+cl.toString(), e);
		}
	}
}


Input:
	public void testDelayerManagement() throws IOException {
		Message<String> testMessage = MessageBuilder.withPayload("test").build();
		this.delayerInput.send(testMessage);
		this.delayerInput.send(testMessage);
		this.scheduler.destroy();
		assertNull(this.output.receive(100));
		this.scheduler.afterPropertiesSet();
		Resource scriptResource = new ClassPathResource("GroovyControlBusDelayerManagementTest.groovy", this.getClass());
		ScriptSource scriptSource = new ResourceScriptSource(scriptResource);
		Message<?> message = MessageBuilder.withPayload(scriptSource.getScriptAsString()).build();
		this.controlBus.send(message);
		assertNotNull(this.output.receive(100));
		assertNotNull(this.output.receive(100));
	}

Output:
	public void testDelayerManagement() throws IOException {
		Message<String> testMessage = MessageBuilder.withPayload("test").build();
		this.delayerInput.send(testMessage);
		this.delayerInput.send(testMessage);
		this.scheduler.destroy();
		assertNull(this.output.receive(500));
		this.scheduler.afterPropertiesSet();
		Resource scriptResource = new ClassPathResource("GroovyControlBusDelayerManagementTest.groovy", this.getClass());
		ScriptSource scriptSource = new ResourceScriptSource(scriptResource);
		Message<?> message = MessageBuilder.withPayload(scriptSource.getScriptAsString()).build();
		this.controlBus.send(message);
		assertNotNull(this.output.receive(1000));
		assertNotNull(this.output.receive(1000));
	}