Input:
    private StringBuffer printSymbolTree(int linebreakpos, boolean preserveAllSemiColons)
            throws IOException {
        offset = 0;
        braceNesting = 0;
        scopes.clear();
        String symbol;
        JavaScriptToken token;
        JavaScriptToken lastToken = getToken(0);
        ScriptOrFnScope currentScope;
        JavaScriptIdentifier identifier;
        int length = tokens.size();
        StringBuffer result = new StringBuffer();
        int linestartpos = 0;
        enterScope(globalScope);
        while (offset < length) {
            token = consumeToken();
            symbol = token.getValue();
            currentScope = getCurrentScope();
            switch (token.getType()) {
                case Token.GET:
                case Token.SET:
                    lastToken = token;
                case Token.NAME:
                    if (offset >= 2 && getToken(-2).getType() == Token.DOT ||
                            getToken(0).getType() == Token.OBJECTLIT) {
                        result.append(symbol);
                    } else {
                        identifier = getIdentifier(symbol, currentScope);
                        if (identifier != null) {
                            if (identifier.getMungedValue() != null) {
                                result.append(identifier.getMungedValue());
                            } else {
                                result.append(symbol);
                            }
                            if (currentScope != globalScope && identifier.getRefcount() == 0) {
                                warn("The symbol " + symbol + " is declared but is apparently never used.\nThis code can probably be written in a more compact way.", true);
                            }
                        } else {
                            result.append(symbol);
                        }
                    }
                    break;
                case Token.REGEXP:
                case Token.NUMBER:
                case Token.STRING:
                    result.append(symbol);
                    break;
                case Token.ADD:
                case Token.SUB:
                    result.append((String) literals.get(new Integer(token.getType())));
                    if (offset < length) {
                        token = getToken(0);
                        if (token.getType() == Token.INC ||
                                token.getType() == Token.DEC ||
                                token.getType() == Token.ADD ||
                                token.getType() == Token.DEC) {
                            result.append(' ');
                        } else if (token.getType() == Token.POS && getToken(-1).getType() == Token.ADD ||
                                token.getType() == Token.NEG && getToken(-1).getType() == Token.SUB) {
                            result.append(' ');
                        }
                    }
                    break;
                case Token.FUNCTION:
                    if (lastToken.getType() != Token.GET && lastToken.getType() != Token.SET) {
                        result.append("function");
                    }
                    token = consumeToken();
                    if (token.getType() == Token.NAME) {
                        result.append(' ');
                        symbol = token.getValue();
                        identifier = getIdentifier(symbol, currentScope);
                        assert identifier != null;
                        if (identifier.getMungedValue() != null) {
                            result.append(identifier.getMungedValue());
                        } else {
                            result.append(symbol);
                        }
                        if (currentScope != globalScope && identifier.getRefcount() == 0) {
                            warn("The symbol " + symbol + " is declared but is apparently never used.\nThis code can probably be written in a more compact way.", true);
                        }
                        token = consumeToken();
                    }
                    assert token.getType() == Token.LP;
                    result.append('(');
                    currentScope = (ScriptOrFnScope) indexedScopes.get(new Integer(offset));
                    enterScope(currentScope);
                    while ((token = consumeToken()).getType() != Token.RP) {
                        assert token.getType() == Token.NAME || token.getType() == Token.COMMA;
                        if (token.getType() == Token.NAME) {
                            symbol = token.getValue();
                            identifier = getIdentifier(symbol, currentScope);
                            assert identifier != null;
                            if (identifier.getMungedValue() != null) {
                                result.append(identifier.getMungedValue());
                            } else {
                                result.append(symbol);
                            }
                        } else if (token.getType() == Token.COMMA) {
                            result.append(',');
                        }
                    }
                    result.append(')');
                    token = consumeToken();
                    assert token.getType() == Token.LC;
                    result.append('{');
                    braceNesting++;
                    token = getToken(0);
                    if (token.getType() == Token.STRING &&
                            getToken(1).getType() == Token.SEMI) {
                        consumeToken();
                        consumeToken();
                    }
                    break;
                case Token.RETURN:
                case Token.TYPEOF:
                    result.append(literals.get(new Integer(token.getType())));
                    if (offset < length) {
                        token = getToken(0);
                        if (token.getType() != Token.LP &&
                                token.getType() != Token.LB &&
                                token.getType() != Token.LC &&
                                token.getType() != Token.STRING &&
                                token.getType() != Token.REGEXP &&
                                token.getType() != Token.SEMI) {
                            result.append(' ');
                        }
                    }
                    break;
                case Token.CASE:
                case Token.THROW:
                    result.append(literals.get(new Integer(token.getType())));
                    if (offset < length && getToken(0).getType() != Token.STRING) {
                        result.append(' ');
                    }
                    break;
                case Token.BREAK:
                case Token.CONTINUE:
                    result.append(literals.get(new Integer(token.getType())));
                    if (offset < length && getToken(0).getType() != Token.SEMI) {
                        result.append(' ');
                    }
                    break;
                case Token.LC:
                    result.append('{');
                    braceNesting++;
                    break;
                case Token.RC:
                    result.append('}');
                    braceNesting--;
                    assert braceNesting >= currentScope.getBraceNesting();
                    if (braceNesting == currentScope.getBraceNesting()) {
                        leaveCurrentScope();
                    }
                    break;
                case Token.SEMI:
                    if (preserveAllSemiColons || offset < length && getToken(0).getType() != Token.RC) {
                        result.append(';');
                    }
                    if (linebreakpos >= 0 && result.length() - linestartpos > linebreakpos) {
                        result.append('\n');
                        linestartpos = result.length();
                    }
                    break;
                case Token.CONDCOMMENT:
                case Token.KEEPCOMMENT:
                    if (result.length() > 0 && result.charAt(result.length() - 1) != '\n') {
                        result.append("\n");
                    }
                    result.append("/*");
                    result.append(symbol);
                    result.append("*/\n");
                    break;
                default:
                    String literal = (String) literals.get(new Integer(token.getType()));
                    if (literal != null) {
                        result.append(literal);
                    } else {
                        warn("This symbol cannot be printed: " + symbol, true);
                    }
                    break;
            }
        }
        if (!preserveAllSemiColons &&
                result.length() > 0 &&
                getToken(-1).getType() != Token.CONDCOMMENT &&
                getToken(-1).getType() != Token.KEEPCOMMENT) {
            if (result.charAt(result.length() - 1) == '\n') {
                result.setCharAt(result.length() - 1, ';');
            } else {
                result.append(';');
            }
        }
        return result;
    }

Output:
    private StringBuffer printSymbolTree(int linebreakpos, boolean preserveAllSemiColons)
            throws IOException {
        offset = 0;
        braceNesting = 0;
        scopes.clear();
        String symbol;
        JavaScriptToken token;
        JavaScriptToken lastToken = getToken(0);
        ScriptOrFnScope currentScope;
        JavaScriptIdentifier identifier;
        int length = tokens.size();
        StringBuffer result = new StringBuffer();
        int linestartpos = 0;
        enterScope(globalScope);
        while (offset < length) {
            token = consumeToken();
            symbol = token.getValue();
            currentScope = getCurrentScope();
            switch (token.getType()) {
                case Token.GET:
                case Token.SET:
                    lastToken = token;
                case Token.NAME:
                    if (offset >= 2 && getToken(-2).getType() == Token.DOT ||
                            getToken(0).getType() == Token.OBJECTLIT) {
                        result.append(symbol);
                    } else {
                        identifier = getIdentifier(symbol, currentScope);
                        if (identifier != null) {
                            if (identifier.getMungedValue() != null) {
                                result.append(identifier.getMungedValue());
                            } else {
                                result.append(symbol);
                            }
                            if (currentScope != globalScope && identifier.getRefcount() == 0) {
                                warn("The symbol " + symbol + " is declared but is apparently never used.\nThis code can probably be written in a more compact way.", true);
                            }
                        } else {
                            result.append(symbol);
                        }
                    }
                    break;
                case Token.REGEXP:
                case Token.NUMBER:
                case Token.STRING:
                    result.append(symbol);
                    break;
                case Token.ADD:
                case Token.SUB:
                    result.append((String) literals.get(new Integer(token.getType())));
                    if (offset < length) {
                        token = getToken(0);
                        if (token.getType() == Token.INC ||
                                token.getType() == Token.DEC ||
                                token.getType() == Token.ADD ||
                                token.getType() == Token.DEC) {
                            result.append(' ');
                        } else if (token.getType() == Token.POS && getToken(-1).getType() == Token.ADD ||
                                token.getType() == Token.NEG && getToken(-1).getType() == Token.SUB) {
                            result.append(' ');
                        }
                    }
                    break;
                case Token.FUNCTION:
                    if (lastToken.getType() != Token.GET && lastToken.getType() != Token.SET) {
                        result.append("function");
                    }
                    lastToken = token;
                    token = consumeToken();
                    if (token.getType() == Token.NAME) {
                        result.append(' ');
                        symbol = token.getValue();
                        identifier = getIdentifier(symbol, currentScope);
                        assert identifier != null;
                        if (identifier.getMungedValue() != null) {
                            result.append(identifier.getMungedValue());
                        } else {
                            result.append(symbol);
                        }
                        if (currentScope != globalScope && identifier.getRefcount() == 0) {
                            warn("The symbol " + symbol + " is declared but is apparently never used.\nThis code can probably be written in a more compact way.", true);
                        }
                        token = consumeToken();
                    }
                    assert token.getType() == Token.LP;
                    result.append('(');
                    currentScope = (ScriptOrFnScope) indexedScopes.get(new Integer(offset));
                    enterScope(currentScope);
                    while ((token = consumeToken()).getType() != Token.RP) {
                        assert token.getType() == Token.NAME || token.getType() == Token.COMMA;
                        if (token.getType() == Token.NAME) {
                            symbol = token.getValue();
                            identifier = getIdentifier(symbol, currentScope);
                            assert identifier != null;
                            if (identifier.getMungedValue() != null) {
                                result.append(identifier.getMungedValue());
                            } else {
                                result.append(symbol);
                            }
                        } else if (token.getType() == Token.COMMA) {
                            result.append(',');
                        }
                    }
                    result.append(')');
                    token = consumeToken();
                    assert token.getType() == Token.LC;
                    result.append('{');
                    braceNesting++;
                    token = getToken(0);
                    if (token.getType() == Token.STRING &&
                            getToken(1).getType() == Token.SEMI) {
                        consumeToken();
                        consumeToken();
                    }
                    break;
                case Token.RETURN:
                case Token.TYPEOF:
                    result.append(literals.get(new Integer(token.getType())));
                    if (offset < length) {
                        token = getToken(0);
                        if (token.getType() != Token.LP &&
                                token.getType() != Token.LB &&
                                token.getType() != Token.LC &&
                                token.getType() != Token.STRING &&
                                token.getType() != Token.REGEXP &&
                                token.getType() != Token.SEMI) {
                            result.append(' ');
                        }
                    }
                    break;
                case Token.CASE:
                case Token.THROW:
                    result.append(literals.get(new Integer(token.getType())));
                    if (offset < length && getToken(0).getType() != Token.STRING) {
                        result.append(' ');
                    }
                    break;
                case Token.BREAK:
                case Token.CONTINUE:
                    result.append(literals.get(new Integer(token.getType())));
                    if (offset < length && getToken(0).getType() != Token.SEMI) {
                        result.append(' ');
                    }
                    break;
                case Token.LC:
                    result.append('{');
                    braceNesting++;
                    break;
                case Token.RC:
                    result.append('}');
                    braceNesting--;
                    assert braceNesting >= currentScope.getBraceNesting();
                    if (braceNesting == currentScope.getBraceNesting()) {
                        leaveCurrentScope();
                    }
                    break;
                case Token.SEMI:
                    if (preserveAllSemiColons || offset < length && getToken(0).getType() != Token.RC) {
                        result.append(';');
                    }
                    if (linebreakpos >= 0 && result.length() - linestartpos > linebreakpos) {
                        result.append('\n');
                        linestartpos = result.length();
                    }
                    break;
                case Token.CONDCOMMENT:
                case Token.KEEPCOMMENT:
                    if (result.length() > 0 && result.charAt(result.length() - 1) != '\n') {
                        result.append("\n");
                    }
                    result.append("/*");
                    result.append(symbol);
                    result.append("*/\n");
                    break;
                default:
                    String literal = (String) literals.get(new Integer(token.getType()));
                    if (literal != null) {
                        result.append(literal);
                    } else {
                        warn("This symbol cannot be printed: " + symbol, true);
                    }
                    break;
            }
        }
        if (!preserveAllSemiColons &&
                result.length() > 0 &&
                getToken(-1).getType() != Token.CONDCOMMENT &&
                getToken(-1).getType() != Token.KEEPCOMMENT) {
            if (result.charAt(result.length() - 1) == '\n') {
                result.setCharAt(result.length() - 1, ';');
            } else {
                result.append(';');
            }
        }
        return result;
    }


Input:
    public static void handle(final LoginEvent event) {
        Main.instance.getProxy().getScheduler().schedule(Main.instance, new Runnable() {
            @Override
            public void run() {
                final ProxiedPlayer target = Main.instance.getProxy().getPlayer(event.getConnection().getName());
                boolean registered = AuthProvider.isRegistered(target.getName());
                target.sendMessage(ChatColor.GREEN + "Welkom " + ((registered) ? "terug " : "") + "in de Banjoserver, " + target.getName() + "!");
                target.sendMessage(ChatColor.GRAY + "Gebruik " + ((registered) ? ChatColor.WHITE + "/login [wachtwoord]" + ChatColor.GRAY + " om in te loggen." : ChatColor.WHITE + "/register [wachtwoord]" + ChatColor.GRAY + " om te registreren."));
                target.sendMessage(" ");
                Main.instance.getProxy().getScheduler().schedule(Main.instance, new Runnable() {
                    @Override
                    public void run() {
                        if(!AuthProvider.isAuthenticated(target)) {
                            target.disconnect("Om overbelasting van onze servers te voorkomen moet je binnen 30 seconden inloggen.");
                        }
                    }
                }, 29, TimeUnit.SECONDS);
            }
        }, 1, TimeUnit.SECONDS);
    }

Output:
    public static void handle(final LoginEvent event) {
        Main.instance.getProxy().getScheduler().schedule(Main.instance, new Runnable() {
            @Override
            public void run() {
                final ProxiedPlayer target = Main.instance.getProxy().getPlayer(event.getConnection().getName());
                boolean registered = AuthProvider.isRegistered(target.getName());
                target.sendMessage(ChatColor.GREEN + "Welkom " + ((registered) ? "terug " : "") + "in de Banjoserver, " + target.getName() + "!");
                target.sendMessage(ChatColor.GRAY + "Gebruik " + ((registered) ? ChatColor.WHITE + "/login [wachtwoord]" + ChatColor.GRAY + " om in te loggen." : ChatColor.WHITE + "/register [wachtwoord]" + ChatColor.GRAY + " om te registreren."));
                target.sendMessage(" ");
                Main.instance.getProxy().getScheduler().schedule(Main.instance, new Runnable() {
                    @Override
                    public void run() {
                        if(target == null) return;
                        if(!AuthProvider.isAuthenticated(target)) {
                            target.disconnect("Om overbelasting van onze servers te voorkomen moet je binnen 30 seconden inloggen.");
                        }
                    }
                }, 29, TimeUnit.SECONDS);
            }
        }, 1, TimeUnit.SECONDS);
    }


Input:
    protected void onOK() {
        final boolean checkInvalids = (Boolean) _paramWarnOnErrors.getValue();
        final boolean noDataValueUsed = (Boolean) _paramNoDataValueUsed.getValue();
        final float noDataValue = (Float) _paramNoDataValue.getValue();
        _targetBand.setImageInfo(null);
        _targetBand.setGeophysicalNoDataValue(noDataValue);
        _targetBand.setNoDataValueUsed(noDataValueUsed);
        if (getCreateVirtualBand()) {
            final VirtualBand virtualBand = (VirtualBand) _targetBand;
            virtualBand.setExpression(_paramExpression.getValueAsText());
            virtualBand.setCheckInvalids(checkInvalids);
        } else {
            if (!_targetBand.hasRasterData()) {
                final int rasterSize = _targetBand.getRasterWidth() * _targetBand.getRasterHeight();
                final int type = _targetBand.getDataType();
                final int requiredMemory = rasterSize * ProductData.getElemSize(type);
                final long freeMemory = Runtime.getRuntime().freeMemory();
                final float megabyte = 1024.0f * 1024.0f;
                if (freeMemory <= requiredMemory) {
                    String message = "Can not create the new band.\n" +
                                     String.format("\tFree memory    : %f.1 MB\n", freeMemory / megabyte) +
                                     String.format("\tRequired memory: %f.1 MB\n\n", requiredMemory / megabyte) +
                                     "The amount of required memory is equal or greater than the available memory.";
                    _visatApp.showErrorDialog(message);
                    BandArithmetikDialog.super.onOK();
                    return;
                } else if (requiredMemory * 2 > freeMemory) {
                    String message = "Creating the new band will cause the system to reach the memory limit.\n" +
                                     "Ths can cause the system to slow down.\n" +
                                     String.format("\tFree memory    : %f MB\n", freeMemory / megabyte) +
                                     String.format("\tRequired memory: %f MB\n\n", requiredMemory / megabyte) +
                                     "Do you want to create the image anyhow?";
                    final int answer = _visatApp.showQuestionDialog(message, null);
                    if (answer != JOptionPane.YES_OPTION) {
                        BandArithmetikDialog.super.onOK();
                        return;
                    }
                }
            }
        }
        if (!_targetProduct.containsBand(_targetBand.getName())) {
            _targetProduct.addBand(_targetBand);
        }
        final String expression = _paramExpression.getValueAsText();
        _targetBand.setSynthetic(true);
        SwingWorker swingWorker = new SwingWorker() {
            final ProgressMonitor pm = new DialogProgressMonitor(getJDialog(), "Band Arithmetic",
                                                                 Dialog.ModalityType.APPLICATION_MODAL);
            String _errorMessage;
            int _numInvalids;
            @Override
            protected Object doInBackground() throws Exception {
                _errorMessage = null;
                try {
                    if (!getCreateVirtualBand()) {
                        _numInvalids = _targetBand.computeBand(expression,
                                                               getCompatibleProducts(),
                                                               checkInvalids,
                                                               noDataValueUsed,
                                                               noDataValue,
                                                               pm);
                        _targetBand.fireProductNodeDataChanged();
                    }
                } catch (IOException e) {
                    Debug.trace(e);
                    _errorMessage = "The band could not be created.\nAn I/O error occurred:\n" + e.getMessage();
                } catch (ParseException e) {
                    Debug.trace(e);
                    _errorMessage = "The band could not be created.\nAn expression parse error occurred:\n" + e.getMessage();
                } catch (EvalException e) {
                    Debug.trace(e);
                    _errorMessage = "The band could not be created.\nAn expression evaluation error occured:\n" + e.getMessage();
                } finally {
                }
                return null;
            }
            @Override
            public void done() {
                boolean ok = true;
                if (_errorMessage != null) {
                    showErrorDialog(_errorMessage);
                    ok = false;
                } else if (pm.isCanceled()) {
                    showErrorDialog("Band arithmetic has been canceled.");
                    ok = false;
                } else if (_numInvalids > 0 && checkInvalids) {
                    int numPixelsTotal = _targetBand.getRasterWidth() * _targetBand.getRasterHeight();
                    int percentage = MathUtils.floorInt(100.0 * _numInvalids / numPixelsTotal);
                    if (percentage == 0) {
                        percentage = 1;
                    }
                    String message = _numInvalids + " of " + numPixelsTotal + " pixels (< " + percentage + "%) are invalid due to arithmetic exceptions.\n";
                    if (noDataValueUsed) {
                        message += "These pixels have been set to " + noDataValue + ".\n\n";
                    } else {
                        message += "These pixels have been set to NaN (IEEE 754).\n\n";
                    }
                    message += "Do you still want to use the suspicious computed data?\n"
                            + "If you select \"No\", all computed data will be lost.";
                    int status = showQuestionDialog("Invalid Pixel Warning", message);
                    if (status != JOptionPane.YES_OPTION) {
                        ok = false;
                    }
                }
                finalOnOk(ok);
            }
        };
        swingWorker.execute();
    }

Output:
    protected void onOK() {
        final boolean checkInvalids = (Boolean) _paramWarnOnErrors.getValue();
        final boolean noDataValueUsed = (Boolean) _paramNoDataValueUsed.getValue();
        final float noDataValue = (Float) _paramNoDataValue.getValue();
        _targetBand.setImageInfo(null);
        _targetBand.setGeophysicalNoDataValue(noDataValue);
        _targetBand.setNoDataValueUsed(noDataValueUsed);
        if (getCreateVirtualBand()) {
            final VirtualBand virtualBand = (VirtualBand) _targetBand;
            virtualBand.setExpression(_paramExpression.getValueAsText());
            virtualBand.setCheckInvalids(checkInvalids);
        } else {
            if (!_targetBand.hasRasterData()) {
                final int rasterSize = _targetBand.getRasterWidth() * _targetBand.getRasterHeight();
                final int type = _targetBand.getDataType();
                final int requiredMemory = rasterSize * ProductData.getElemSize(type);
                final long freeMemory = Runtime.getRuntime().freeMemory();
                final float megabyte = 1024.0f * 1024.0f;
                if (freeMemory <= requiredMemory) {
                    String message = "Can not create the new band.\n" +
                                     "The amount of required memory is equal or greater than the available memory.\n\n" +
                                     String.format("\tFree memory    : %f.1 MB\n", freeMemory / megabyte) +
                                     String.format("\tRequired memory: %f.1 MB", requiredMemory / megabyte);
                    _visatApp.showErrorDialog(message);
                    BandArithmetikDialog.super.onOK();
                    return;
                } else if (requiredMemory * 2 > freeMemory) {
                    String message = "Creating the new band will cause the system to reach its memory limit.\n" +
                                     "This can cause the system to slow down.\n" +
                                     String.format("\tFree memory    : %f MB\n", freeMemory / megabyte) +
                                     String.format("\tRequired memory: %f MB\n\n", requiredMemory / megabyte) +
                                     "Do you really want to create the image?";
                    final int answer = _visatApp.showQuestionDialog(message, null);
                    if (answer != JOptionPane.YES_OPTION) {
                        BandArithmetikDialog.super.onOK();
                        return;
                    }
                }
            }
        }
        if (!_targetProduct.containsBand(_targetBand.getName())) {
            _targetProduct.addBand(_targetBand);
        }
        final String expression = _paramExpression.getValueAsText();
        _targetBand.setSynthetic(true);
        SwingWorker swingWorker = new SwingWorker() {
            final ProgressMonitor pm = new DialogProgressMonitor(getJDialog(), "Band Arithmetic",
                                                                 Dialog.ModalityType.APPLICATION_MODAL);
            String _errorMessage;
            int _numInvalids;
            @Override
            protected Object doInBackground() throws Exception {
                _errorMessage = null;
                try {
                    if (!getCreateVirtualBand()) {
                        _numInvalids = _targetBand.computeBand(expression,
                                                               getCompatibleProducts(),
                                                               checkInvalids,
                                                               noDataValueUsed,
                                                               noDataValue,
                                                               pm);
                        _targetBand.fireProductNodeDataChanged();
                    }
                } catch (IOException e) {
                    Debug.trace(e);
                    _errorMessage = "The band could not be created.\nAn I/O error occurred:\n" + e.getMessage();
                } catch (ParseException e) {
                    Debug.trace(e);
                    _errorMessage = "The band could not be created.\nAn expression parse error occurred:\n" + e.getMessage();
                } catch (EvalException e) {
                    Debug.trace(e);
                    _errorMessage = "The band could not be created.\nAn expression evaluation error occured:\n" + e.getMessage();
                } finally {
                }
                return null;
            }
            @Override
            public void done() {
                boolean ok = true;
                if (_errorMessage != null) {
                    showErrorDialog(_errorMessage);
                    ok = false;
                } else if (pm.isCanceled()) {
                    showErrorDialog("Band arithmetic has been canceled.");
                    ok = false;
                } else if (_numInvalids > 0 && checkInvalids) {
                    int numPixelsTotal = _targetBand.getRasterWidth() * _targetBand.getRasterHeight();
                    int percentage = MathUtils.floorInt(100.0 * _numInvalids / numPixelsTotal);
                    if (percentage == 0) {
                        percentage = 1;
                    }
                    String message = _numInvalids + " of " + numPixelsTotal + " pixels (< " + percentage + "%) are invalid due to arithmetic exceptions.\n";
                    if (noDataValueUsed) {
                        message += "These pixels have been set to " + noDataValue + ".\n\n";
                    } else {
                        message += "These pixels have been set to NaN (IEEE 754).\n\n";
                    }
                    message += "Do you still want to use the suspicious computed data?\n"
                            + "If you select \"No\", all computed data will be lost.";
                    int status = showQuestionDialog("Invalid Pixel Warning", message);
                    if (status != JOptionPane.YES_OPTION) {
                        ok = false;
                    }
                }
                finalOnOk(ok);
            }
        };
        swingWorker.execute();
    }


Input:
	public DocEdit(PrintWriter outputStream, String documentName, String user, String content, String collaboratorNames, int versionID){
		super(documentName);
		this.version = versionID;
		this.cursorPosition = 0;
		out = outputStream;
		this.docName = documentName;
		this.userName = user;
		this.docContent = content;
		this.collaboratorNames = collaboratorNames;
		welcomeLabel = new JLabel("Welcome " + userName + "!");
		exitButton = new JButton("Exit Doc");
		collabLabel = new JLabel("Collaborators: ");
		collaborators = new JLabel(collaboratorNames);
		messageLabel = new JLabel("Messages will appear here.");
		latexButton = new JButton("Latex View");
		latexDisplay = new MyPanel();
		closeLatexButton = new JButton("<");
		closeLatexButton.setVisible(false);
		latexDisplay.setVisible(false);
		textArea = new JTextArea();
		scrollText = new JScrollPane(textArea);
		scrollText.setMinimumSize(new Dimension(700, 700));
		textArea.setText(docContent);
		textArea.setCaretPosition(cursorPosition);
		textDocument = textArea.getDocument();
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		GroupLayout layout = new GroupLayout(getContentPane());
		getContentPane().setLayout(layout);
		layout.setAutoCreateGaps(true);
		layout.setAutoCreateContainerGaps(true);
		GroupLayout.ParallelGroup hGroup = layout.createParallelGroup();
		hGroup.addGroup(
				layout.createParallelGroup()
					.addGroup(layout.createSequentialGroup()
							.addComponent(collabLabel)
							.addComponent(collaborators)
							)
					.addComponent(welcomeLabel)
					.addComponent(messageLabel)
					);
		hGroup.addGroup(
				layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
					.addComponent(exitButton)
					.addGroup(layout.createSequentialGroup()
							.addComponent(scrollText)
							.addComponent(latexDisplay)
							)
					.addGroup(layout.createSequentialGroup()
							.addComponent(closeLatexButton)
							.addComponent(latexButton)
							)
					);
		layout.setHorizontalGroup(hGroup);
		GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();
		vGroup.addGroup(
					layout.createParallelGroup(GroupLayout.Alignment.CENTER)
						.addComponent(welcomeLabel)
						.addComponent(exitButton)
					);
		vGroup.addGroup(
					layout.createParallelGroup()
						.addComponent(collabLabel)
						.addComponent(collaborators)
					);
		vGroup.addGroup(
					layout.createParallelGroup()
						.addComponent(scrollText)
						.addComponent(latexDisplay)
					);
		vGroup.addGroup(
					layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
						.addComponent(messageLabel)
						.addComponent(closeLatexButton)
						.addComponent(latexButton)
					);
		layout.setVerticalGroup(vGroup);
		latexButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e){
				if (latexDisplay.isVisible()){
					String content = textArea.getText();
					if (Latex.isLatex(content)){
						TeXIcon icon = Latex.getLatex(content);
						BufferedImage b = new BufferedImage(icon.getIconWidth(),
								icon.getIconHeight(), BufferedImage.TYPE_4BYTE_ABGR);
						icon.paintIcon(new JLabel(), b.getGraphics(), 0, 0);
						b.getGraphics().drawImage(b, 0, 0, null);
						latexDisplay.updateImage(b);
						latexDisplay.repaint();
					}
				}
				else{
					latexDisplay.setVisible(true);
					int height = scrollText.getHeight();
					int width = scrollText.getWidth();
					latexDisplay.setMinimumSize(new Dimension(width/2, height));
					scrollText.setMinimumSize(new Dimension(width/2, height));
					latexButton.setText("Render");
					closeLatexButton.setVisible(true);
					packFrame();
				}
			}
		});
		closeLatexButton.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e){
				latexDisplay.setVisible(false);
				closeLatexButton.setVisible(false);
				latexButton.setText("Latex View");
			}
		});
		exitButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e){
				exitDocument();
			}
		});
		documentListener = new DocumentListener() {
			@Override
			public void changedUpdate(DocumentEvent e) {
				System.out.println("CHANGED!");
			}
			@Override
			public void insertUpdate(DocumentEvent e) {
				try {
					int position = e.getOffset();
					int length = e.getLength();
					String change = textDocument.getText(position, length);
					if (change.equals("\n")) {
						out.println("CHANGE|" + userName + "|" + docName + "|" + position + "|" + "\t" + "|" + length + "|" + version);
					}  else if (! change.equals("")){
						out.println("CHANGE|" + userName + "|" + docName + "|" + position + "|" + change + "|" + length + "|" + version);
					}
				} catch (BadLocationException e1) {
					throw new UnsupportedOperationException();
				}
			}
			@Override
			public void removeUpdate(DocumentEvent e) {
				int position = e.getOffset();
				int length = e.getLength();
				out.println("CHANGE|" + userName + "|" + docName + "|" + position + "|" + length + "|" + version);
			}
		};
		this.addListener();
		this.pack();
	}

Output:
	public DocEdit(PrintWriter outputStream, String documentName, String user, String content, String collaboratorNames, int versionID){
		super(documentName);
		this.version = versionID;
		this.cursorPosition = 0;
		out = outputStream;
		this.docName = documentName;
		this.userName = user;
		this.docContent = content;
		this.collaboratorNames = collaboratorNames;
		welcomeLabel = new JLabel("Welcome " + userName + "!");
		exitButton = new JButton("Exit Doc");
		collabLabel = new JLabel("Collaborators: ");
		collaborators = new JLabel(collaboratorNames);
		messageLabel = new JLabel("Messages will appear here.");
		latexButton = new JButton("Latex View");
		latexDisplay = new MyPanel();
		closeLatexButton = new JButton("<");
		closeLatexButton.setVisible(false);
		latexDisplay.setVisible(false);
		textArea = new JTextArea();
		scrollText = new JScrollPane(textArea);
		scrollText.setMinimumSize(new Dimension(700, 700));
		textArea.setText(docContent);
		textArea.setCaretPosition(cursorPosition);
		textDocument = textArea.getDocument();
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		GroupLayout layout = new GroupLayout(getContentPane());
		getContentPane().setLayout(layout);
		layout.setAutoCreateGaps(true);
		layout.setAutoCreateContainerGaps(true);
		GroupLayout.ParallelGroup hGroup = layout.createParallelGroup();
		hGroup.addGroup(
				layout.createParallelGroup()
					.addGroup(layout.createSequentialGroup()
							.addComponent(collabLabel)
							.addComponent(collaborators)
							)
					.addComponent(welcomeLabel)
					.addComponent(messageLabel)
					);
		hGroup.addGroup(
				layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
					.addComponent(exitButton)
					.addGroup(layout.createSequentialGroup()
							.addComponent(scrollText)
							.addComponent(latexDisplay)
							)
					.addGroup(layout.createSequentialGroup()
							.addComponent(closeLatexButton)
							.addComponent(latexButton)
							)
					);
		layout.setHorizontalGroup(hGroup);
		GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();
		vGroup.addGroup(
					layout.createParallelGroup(GroupLayout.Alignment.CENTER)
						.addComponent(welcomeLabel)
						.addComponent(exitButton)
					);
		vGroup.addGroup(
					layout.createParallelGroup()
						.addComponent(collabLabel)
						.addComponent(collaborators)
					);
		vGroup.addGroup(
					layout.createParallelGroup()
						.addComponent(scrollText)
						.addComponent(latexDisplay)
					);
		vGroup.addGroup(
					layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
						.addComponent(messageLabel)
						.addComponent(closeLatexButton)
						.addComponent(latexButton)
					);
		layout.setVerticalGroup(vGroup);
		latexButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e){
				if (latexDisplay.isVisible()){
					String content = textArea.getText();
					if (Latex.isLatex(content)){
						TeXIcon icon = Latex.getLatex(content);
						BufferedImage b = new BufferedImage(icon.getIconWidth(),
								icon.getIconHeight(), BufferedImage.TYPE_4BYTE_ABGR);
						icon.paintIcon(new JLabel(), b.getGraphics(), 0, 0);
						b.getGraphics().drawImage(b, 0, 0, null);
						latexDisplay.updateImage(b);
						latexDisplay.repaint();
					}
				}
				else{
					latexDisplay.setVisible(true);
					int height = scrollText.getHeight();
					int width = scrollText.getWidth();
					latexDisplay.setMinimumSize(new Dimension(width/2, height));
					scrollText.setMinimumSize(new Dimension(width/2, height));
					latexButton.setText("Render");
					closeLatexButton.setVisible(true);
					packFrame();
				}
			}
		});
		closeLatexButton.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e){
				latexDisplay.setVisible(false);
				closeLatexButton.setVisible(false);
				latexButton.setText("Latex View");
			}
		});
		exitButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e){
				exitDocument();
			}
		});
		documentListener = new DocumentListener() {
			@Override
			public void changedUpdate(DocumentEvent e) {
				System.out.println("CHANGED!");
			}
			@Override
			public void insertUpdate(DocumentEvent e) {
				try {
					int position = e.getOffset();
					int length = e.getLength();
					cursorPosition = position + length;
					String change = textDocument.getText(position, length);
					if (change.equals("\n")) {
						out.println("CHANGE|" + userName + "|" + docName + "|" + position + "|" + "\t" + "|" + length + "|" + version);
					}  else if (! change.equals("")){
						out.println("CHANGE|" + userName + "|" + docName + "|" + position + "|" + change + "|" + length + "|" + version);
					}
				} catch (BadLocationException e1) {
					throw new UnsupportedOperationException();
				}
			}
			@Override
			public void removeUpdate(DocumentEvent e) {
				int position = e.getOffset();
				int length = e.getLength();
				cursorPosition = length;
				out.println("CHANGE|" + userName + "|" + docName + "|" + position + "|" + length + "|" + version);
			}
		};
		this.addListener();
		this.pack();
	}


Input:
    public void pickSuggestionManually(int index, CharSequence suggestion) {
        SuggestedWords suggestions = mCandidateView.getSuggestions();
        mVoiceProxy.flushAndLogAllTextModificationCounters(index, suggestion,
                mSettingsValues.mWordSeparators);
        final boolean recorrecting = TextEntryState.isRecorrecting();
        InputConnection ic = getCurrentInputConnection();
        if (ic != null) {
            ic.beginBatchEdit();
        }
        if (mApplicationSpecifiedCompletionOn && mApplicationSpecifiedCompletions != null
                && index >= 0 && index < mApplicationSpecifiedCompletions.length) {
            CompletionInfo ci = mApplicationSpecifiedCompletions[index];
            if (ic != null) {
                ic.commitCompletion(ci);
            }
            mCommittedLength = suggestion.length();
            if (mCandidateView != null) {
                mCandidateView.clear();
            }
            mKeyboardSwitcher.updateShiftState();
            if (ic != null) {
                ic.endBatchEdit();
            }
            return;
        }
        if (suggestion.length() == 1 && (mSettingsValues.isWordSeparator(suggestion.charAt(0))
                || mSettingsValues.isSuggestedPunctuation(suggestion.charAt(0)))) {
            LatinImeLogger.logOnManualSuggestion(
                    "", suggestion.toString(), index, suggestions.mWords);
            final char primaryCode = suggestion.charAt(0);
            final int toLeft = (ic == null) ? 0 : ic.getTextBeforeCursor(1, 0).charAt(0);
            final boolean oldMagicSpace = mJustAddedMagicSpace;
            if (Keyboard.CODE_SPACE == toLeft) mJustAddedMagicSpace = true;
            onCodeInput(primaryCode, new int[] { primaryCode },
                    KeyboardActionListener.NOT_A_TOUCH_COORDINATE,
                    KeyboardActionListener.NOT_A_TOUCH_COORDINATE);
            mJustAddedMagicSpace = oldMagicSpace;
            if (ic != null) {
                ic.endBatchEdit();
            }
            return;
        }
        if (!mHasUncommittedTypedChars) {
            mWord.reset();
        }
        mJustAccepted = true;
        pickSuggestion(suggestion);
        if (index == 0) {
            addToAutoAndUserBigramDictionaries(suggestion, AutoDictionary.FREQUENCY_FOR_PICKED);
        } else {
            addToOnlyBigramDictionary(suggestion, 1);
        }
        LatinImeLogger.logOnManualSuggestion(mComposing.toString(), suggestion.toString(),
                index, suggestions.mWords);
        TextEntryState.acceptedSuggestion(mComposing.toString(), suggestion);
        if (mShouldInsertMagicSpace && !recorrecting) {
            sendMagicSpace();
        }
        final boolean showingAddToDictionaryHint = index == 0 && mSuggest != null
                && (!mHasDictionary
                        || !AutoCorrection.isValidWord(
                                mSuggest.getUnigramDictionaries(), suggestion, true));
        if (!recorrecting) {
            TextEntryState.typedCharacter((char) Keyboard.CODE_SPACE, true,
                    WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE);
            mHandler.postUpdateSuggestions();
        } else if (!showingAddToDictionaryHint) {
            clearSuggestions();
            mHandler.postUpdateOldSuggestions();
        }
        if (showingAddToDictionaryHint) {
            mCandidateView.showAddToDictionaryHint(suggestion);
        }
        if (ic != null) {
            ic.endBatchEdit();
        }
    }

Output:
    public void pickSuggestionManually(int index, CharSequence suggestion) {
        SuggestedWords suggestions = mCandidateView.getSuggestions();
        mVoiceProxy.flushAndLogAllTextModificationCounters(index, suggestion,
                mSettingsValues.mWordSeparators);
        final boolean recorrecting = TextEntryState.isRecorrecting();
        InputConnection ic = getCurrentInputConnection();
        if (ic != null) {
            ic.beginBatchEdit();
        }
        if (mApplicationSpecifiedCompletionOn && mApplicationSpecifiedCompletions != null
                && index >= 0 && index < mApplicationSpecifiedCompletions.length) {
            CompletionInfo ci = mApplicationSpecifiedCompletions[index];
            if (ic != null) {
                ic.commitCompletion(ci);
            }
            mCommittedLength = suggestion.length();
            if (mCandidateView != null) {
                mCandidateView.clear();
            }
            mKeyboardSwitcher.updateShiftState();
            if (ic != null) {
                ic.endBatchEdit();
            }
            return;
        }
        if (suggestion.length() == 1 && (mSettingsValues.isWordSeparator(suggestion.charAt(0))
                || mSettingsValues.isSuggestedPunctuation(suggestion.charAt(0)))) {
            LatinImeLogger.logOnManualSuggestion(
                    "", suggestion.toString(), index, suggestions.mWords);
            final char primaryCode = suggestion.charAt(0);
            final int toLeft = (ic == null) ? 0 : ic.getTextBeforeCursor(1, 0).charAt(0);
            final boolean oldMagicSpace = mJustAddedMagicSpace;
            if (Keyboard.CODE_SPACE == toLeft) mJustAddedMagicSpace = true;
            onCodeInput(primaryCode, new int[] { primaryCode },
                    KeyboardActionListener.NOT_A_TOUCH_COORDINATE,
                    KeyboardActionListener.NOT_A_TOUCH_COORDINATE);
            mJustAddedMagicSpace = oldMagicSpace;
            if (ic != null) {
                ic.endBatchEdit();
            }
            return;
        }
        if (!mHasUncommittedTypedChars) {
            mWord.reset();
        }
        mJustAccepted = true;
        pickSuggestion(suggestion);
        if (index == 0) {
            addToAutoAndUserBigramDictionaries(suggestion, AutoDictionary.FREQUENCY_FOR_PICKED);
        } else {
            addToOnlyBigramDictionary(suggestion, 1);
        }
        LatinImeLogger.logOnManualSuggestion(mComposing.toString(), suggestion.toString(),
                index, suggestions.mWords);
        TextEntryState.acceptedSuggestion(mComposing.toString(), suggestion);
        if (mShouldInsertMagicSpace && !recorrecting) {
            sendMagicSpace();
        }
        final boolean showingAddToDictionaryHint = index == 0 && mSuggest != null
                && (!mHasDictionary
                        || !AutoCorrection.isValidWord(
                                mSuggest.getUnigramDictionaries(), suggestion, true));
        if (!recorrecting) {
            TextEntryState.typedCharacter((char) Keyboard.CODE_SPACE, true,
                    WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE);
        }
        if (!showingAddToDictionaryHint) {
            clearSuggestions();
            mHandler.postUpdateOldSuggestions();
        }
        if (showingAddToDictionaryHint) {
            mCandidateView.showAddToDictionaryHint(suggestion);
        }
        if (ic != null) {
            ic.endBatchEdit();
        }
    }


Input:
    public static void main(String[] args) {
	System.out.print("afck Copyright (C) 2013 Chandler Paul\n" +
			 "This program comes with ABSOLUTELY NO WARRANTY and is distributed under the terms"	+
			 "of the LGPL license. For more information, please see the file LICENSE at the root" 	+
			 "of the source code, or go to http://www.gnu.org/licenses.lgpl.html\n");
        if (args.length > 0) {
            File brokenAliceWorld = new File(args[0]);
            File tmpDir;
            String worldName;
            Random generator = new Random();
            if (!brokenAliceWorld.exists()) {
                System.err.printf("Path specified is not valid! Exiting...\n");
                System.exit(-1);
            }
            worldName = brokenAliceWorld.getPath();
            tmpDir = new File(System.getProperty("java.io.tmpdir") + "/afck-" +
                              Integer.toString(Math.abs(generator.nextInt())));
            tmpDir.mkdirs();
            try {
                ZipFile brokenAliceWorldZip = new ZipFile(brokenAliceWorld);
                Enumeration aliceZipEntries = brokenAliceWorldZip.entries();
                System.out.print("Extracting world...");
                while (aliceZipEntries.hasMoreElements()) {
                    ZipEntry entry = (ZipEntry) aliceZipEntries.nextElement();
                    String currentEntry = entry.getName();
                    File destFile = new File(tmpDir, currentEntry);
                    File destinationParent = destFile.getParentFile();
                    destinationParent.mkdirs();
                    if (!entry.isDirectory()) {
                        BufferedInputStream inputStream = new BufferedInputStream(brokenAliceWorldZip.getInputStream(entry));
                        int currentByte;
                        byte data[] = new byte[BUFFER_SIZE];
                        FileOutputStream outputStream = new FileOutputStream(destFile);
                        BufferedOutputStream dest = new BufferedOutputStream(outputStream, BUFFER_SIZE);
                        while ((currentByte = inputStream.read(data, 0, BUFFER_SIZE)) != -1)
                            dest.write(data, 0, currentByte);
                        dest.flush();
                        dest.close();
                        outputStream.close();
                        inputStream.close();
                    }
                }
            }
            catch (ZipException e) {
                System.err.printf("Fatal zip file exception! %s\n" +
                                  "Exiting...\n",
                                  e.getMessage());
                System.exit(-1);
            }
            catch (IOException e) {
                System.err.printf("Fatal I/O Exception: %s\n" +
                                  "Exiting...\n",
                                  e.getMessage());
                System.exit(-1);
            }
            System.out.print(" done!\n");
            try {
                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                for (File file : getAllElementData(tmpDir)) {
                    Document elementData = docBuilder.parse(file);
                    Element rootElement = elementData.getDocumentElement();
                    NodeList propertyList;
                    NodeList itemList;
                    int componentResponsesIndex = 0;
                    boolean indexVariableMarkedCorrectly = false;
                    if (!rootElement.getAttribute("class").equals(
                        "edu.cmu.cs.stage3.alice.core.response.LoopNInOrder"))
                        continue;
                    propertyList = rootElement.getElementsByTagName("property");
                    for (int i = 0; i < propertyList.getLength(); i++) {
                        if (((Element) propertyList.item(i)).getAttribute("name").equals(
                            "componentResponses")) {
                            componentResponsesIndex = i;
                            break;
                        }
                    }
                    itemList = ((Element) propertyList.item(componentResponsesIndex)).getElementsByTagName("item");
                    for (int i = 0; i < itemList.getLength(); i++) {
                         Node item = itemList.item(i);
                        if (((Element) item).getAttribute("criterionClass").equals(
                                "edu.cmu.cs.stage3.alice.core.criterion.InternalReferenceKeyedCriterion") &&
				((Element) item).getTextContext().equals(file.getAbsolutePath().replaceFirst(tmpDir.getAbsolutePath() + "(/|\\\\)(.*(/|\\\\))elementData\\.xml", "$2").replaceAll("/|\\\\", ".") + "index")) {
                            indexVariableMarkedCorrectly = true;
                            break;
                        }
                    }
                    if (indexVariableMarkedCorrectly)
                        continue;
                    System.out.println("Found one!");
                }
            }
            catch (ParserConfigurationException e) {
                System.err.println(e.getMessage());
                System.exit(-1);
            }
            catch (SAXException e) {
                System.err.println(e.getMessage());
                System.exit(-1);
            }
            catch (IOException e) {
                System.err.println(e.getMessage());
                System.exit(-1);
            }
            tmpDir.delete();
        }
    }

Output:
    public static void main(String[] args) {
    System.out.print("afck Copyright (C) 2013 Chandler Paul\n" +
             "This program comes with ABSOLUTELY NO WARRANTY and is distributed under the terms"    +
             "of the LGPL license. For more information, please see the file LICENSE at the root"   +
             "of the source code, or go to http://www.gnu.org/licenses.lgpl.html\n");
        if (args.length > 0) {
            File brokenAliceWorld = new File(args[0]);
            File tmpDir;
            String worldName;
            Random generator = new Random();
            if (!brokenAliceWorld.exists()) {
                System.err.printf("Path specified is not valid! Exiting...\n");
                System.exit(-1);
            }
            worldName = brokenAliceWorld.getPath();
            tmpDir = new File(System.getProperty("java.io.tmpdir") + "/afck-" +
                              Integer.toString(Math.abs(generator.nextInt())));
            tmpDir.mkdirs();
            try {
                ZipFile brokenAliceWorldZip = new ZipFile(brokenAliceWorld);
                Enumeration aliceZipEntries = brokenAliceWorldZip.entries();
                System.out.print("Extracting world...");
                while (aliceZipEntries.hasMoreElements()) {
                    ZipEntry entry = (ZipEntry) aliceZipEntries.nextElement();
                    String currentEntry = entry.getName();
                    File destFile = new File(tmpDir, currentEntry);
                    File destinationParent = destFile.getParentFile();
                    destinationParent.mkdirs();
                    if (!entry.isDirectory()) {
                        BufferedInputStream inputStream = new BufferedInputStream(brokenAliceWorldZip.getInputStream(entry));
                        int currentByte;
                        byte data[] = new byte[BUFFER_SIZE];
                        FileOutputStream outputStream = new FileOutputStream(destFile);
                        BufferedOutputStream dest = new BufferedOutputStream(outputStream, BUFFER_SIZE);
                        while ((currentByte = inputStream.read(data, 0, BUFFER_SIZE)) != -1)
                            dest.write(data, 0, currentByte);
                        dest.flush();
                        dest.close();
                        outputStream.close();
                        inputStream.close();
                    }
                }
            }
            catch (ZipException e) {
                System.err.printf("Fatal zip file exception! %s\n" +
                                  "Exiting...\n",
                                  e.getMessage());
                System.exit(-1);
            }
            catch (IOException e) {
                System.err.printf("Fatal I/O Exception: %s\n" +
                                  "Exiting...\n",
                                  e.getMessage());
                System.exit(-1);
            }
            System.out.print(" done!\n");
            try {
                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                for (File file : getAllElementData(tmpDir)) {
                    Document elementData = docBuilder.parse(file);
                    Element rootElement = elementData.getDocumentElement();
                    NodeList propertyList;
                    NodeList itemList;
                    int componentResponsesIndex = 0;
                    boolean indexVariableMarkedCorrectly = false;
                    if (!rootElement.getAttribute("class").equals(
                        "edu.cmu.cs.stage3.alice.core.response.LoopNInOrder"))
                        continue;
                    propertyList = rootElement.getElementsByTagName("property");
                    for (int i = 0; i < propertyList.getLength(); i++) {
                        if (((Element) propertyList.item(i)).getAttribute("name").equals(
                            "componentResponses")) {
                            componentResponsesIndex = i;
                            break;
                        }
                    }
                    itemList = ((Element) propertyList.item(componentResponsesIndex)).getElementsByTagName("item");
                    for (int i = 0; i < itemList.getLength(); i++) {
                        Node item = itemList.item(i);
                        String indexString = file.getAbsolutePath().replaceFirst(
                            tmpDir.getAbsolutePath() + "(/|\\\\)(.*(/|\\\\))elementData\\.xml", "$2").
                            replaceAll("/|\\\\", ".") + "index";
                        if (((Element) item).getAttribute("criterionClass").equals(
                                "edu.cmu.cs.stage3.alice.core.criterion.InternalReferenceKeyedCriterion") &&
                            item.getFirstChild().getNodeValue().equals(indexString)) {
                            indexVariableMarkedCorrectly = true;
                            break;
                        }
                    }
                    if (indexVariableMarkedCorrectly)
                        continue;
                    System.out.println("Found one!");
                }
            }
            catch (ParserConfigurationException e) {
                System.err.println(e.getMessage());
                System.exit(-1);
            }
            catch (SAXException e) {
                System.err.println(e.getMessage());
                System.exit(-1);
            }
            catch (IOException e) {
                System.err.println(e.getMessage());
                System.exit(-1);
            }
            tmpDir.delete();
        }
    }


Input:
    public void execute(EObject element, TransactionType request, Map featureStores,
        TransactionResponseType response, TransactionListener listener)
        throws WFSTransactionException {
        LOGGER.finer("Transasction Insert:" + element);
        InsertElementType insert = (InsertElementType) element;
        long inserted = response.getTransactionSummary().getTotalInserted().longValue();
        try {
            HashMap  schema2features = new HashMap();
            for (Iterator f = insert.getFeature().iterator(); f.hasNext();) {
                SimpleFeature feature = (SimpleFeature) f.next();
                SimpleFeatureType schema = feature.getFeatureType();
                FeatureCollection collection = (FeatureCollection) schema2features.get(schema);
                if (collection == null) {
                    collection = new DefaultFeatureCollection(null, schema);
                    schema2features.put(schema, collection);
                }
                collection.add(feature);
            }
            HashMap schema2fids = new HashMap();
            for (Iterator c = schema2features.values().iterator(); c.hasNext();) {
                FeatureCollection collection = (FeatureCollection) c.next();
                SimpleFeatureType schema = collection.getSchema();
                final QName elementName = new QName(schema.getName().getNamespaceURI(), schema.getTypeName());
                FeatureStore store = (FeatureStore) featureStores.get(elementName);
                if (store == null) {
                    throw new WFSException("Could not locate FeatureStore for '" + elementName
                        + "'");
                }
                if (collection != null) {
                    if(wfs.getCiteConformanceHacks()) {
                        checkFeatureCoordinatesRange(collection);
                    }
                    final GeometryDescriptor defaultGeometry = store.getSchema().getDefaultGeometry();
                    if(defaultGeometry != null) {
                        CoordinateReferenceSystem target = defaultGeometry.getCRS();
                        if (target != null) {
                            collection = new ReprojectingFeatureCollection(collection, target);
                        }
                    }
                    LOGGER.finer("Use featureValidation to check contents of insert");
                    List fids = (List) schema2fids.get(schema.getTypeName());
                    if (fids == null) {
                        fids = new LinkedList();
                        schema2fids.put(schema.getTypeName(), fids);
                    }
                    listener.dataStoreChange(new TransactionEvent(TransactionEventType.PRE_INSERT,
                            elementName, collection));
                    fids.addAll(store.addFeatures(collection));
                }
            }
            InsertedFeatureType insertedFeature = null;
            for (Iterator f = insert.getFeature().iterator(); f.hasNext();) {
                SimpleFeature feature = (SimpleFeature) f.next();
                SimpleFeatureType schema = feature.getFeatureType();
                LinkedList fids = (LinkedList) schema2fids.get(schema.getTypeName());
                String fid = (String) fids.removeFirst();
                insertedFeature = WfsFactory.eINSTANCE.createInsertedFeatureType();
                insertedFeature.setHandle(insert.getHandle());
                insertedFeature.getFeatureId().add(filterFactory.featureId(fid));
                response.getInsertResults().getFeature().add(insertedFeature);
            }
            inserted += insert.getFeature().size();
        } catch (Exception e) {
            String msg = "Error perfomring insert";
            throw new WFSTransactionException(msg, e, insert.getHandle());
        }
        response.getTransactionSummary().setTotalInserted(BigInteger.valueOf(inserted));
    }

Output:
    public void execute(EObject element, TransactionType request, Map featureStores,
        TransactionResponseType response, TransactionListener listener)
        throws WFSTransactionException {
        LOGGER.finer("Transasction Insert:" + element);
        InsertElementType insert = (InsertElementType) element;
        long inserted = response.getTransactionSummary().getTotalInserted().longValue();
        try {
            HashMap  schema2features = new HashMap();
            for (Iterator f = insert.getFeature().iterator(); f.hasNext();) {
                SimpleFeature feature = (SimpleFeature) f.next();
                SimpleFeatureType schema = feature.getFeatureType();
                FeatureCollection collection = (FeatureCollection) schema2features.get(schema);
                if (collection == null) {
                    collection = new DefaultFeatureCollection(null, schema);
                    schema2features.put(schema, collection);
                }
                collection.add(feature);
            }
            HashMap schema2fids = new HashMap();
            for (Iterator c = schema2features.values().iterator(); c.hasNext();) {
                FeatureCollection collection = (FeatureCollection) c.next();
                SimpleFeatureType schema = collection.getSchema();
                final QName elementName = new QName(schema.getName().getNamespaceURI(), schema.getTypeName());
                FeatureStore store = (FeatureStore) featureStores.get(elementName);
                if (store == null) {
                    throw new WFSException("Could not locate FeatureStore for '" + elementName
                        + "'");
                }
                if (collection != null) {
                    if(wfs.getCiteConformanceHacks()) {
                        checkFeatureCoordinatesRange(collection);
                    }
                    final GeometryDescriptor defaultGeometry = store.getSchema().getDefaultGeometry();
                    if(defaultGeometry != null) {
                        CoordinateReferenceSystem target = defaultGeometry.getCRS();
                        if (target != null) {
                            collection = new ReprojectingFeatureCollection(collection, target);
                        }
                    }
                    LOGGER.finer("Use featureValidation to check contents of insert");
                    List fids = (List) schema2fids.get(schema.getTypeName());
                    if (fids == null) {
                        fids = new LinkedList();
                        schema2fids.put(schema.getTypeName(), fids);
                    }
                    listener.dataStoreChange(new TransactionEvent(TransactionEventType.PRE_INSERT,
                            elementName, collection));
                    fids.addAll(store.addFeatures(collection));
                }
            }
            InsertedFeatureType insertedFeature = null;
            for (Iterator f = insert.getFeature().iterator(); f.hasNext();) {
                SimpleFeature feature = (SimpleFeature) f.next();
                SimpleFeatureType schema = feature.getFeatureType();
                LinkedList fids = (LinkedList) schema2fids.get(schema.getTypeName());
                String fid = (String) fids.removeFirst();
                insertedFeature = WfsFactory.eINSTANCE.createInsertedFeatureType();
                insertedFeature.setHandle(insert.getHandle());
                insertedFeature.getFeatureId().add(filterFactory.featureId(fid));
                response.getInsertResults().getFeature().add(insertedFeature);
            }
            inserted += insert.getFeature().size();
        } catch (Exception e) {
            String msg = "Error performing insert";
            throw new WFSTransactionException(msg, e, insert.getHandle());
        }
        response.getTransactionSummary().setTotalInserted(BigInteger.valueOf(inserted));
    }


Input:
    public void init(FMLInitializationEvent event) {
        mopBukket = new BlockMopBukket(900, Material.grass, mopBukket_Tex).setUnlocalizedName("mopBukket_UN");
        mopBukket.setStepSound(Block.soundMetalFootstep);
        mop = (new ItemMop(901, mop_Tex)).setUnlocalizedName("Mop").setCreativeTab(hygienicTab);
        food = (new ItemModFood(902, 18, true, modFood_Tex)).setUnlocalizedName("My Food");
        apple = (new ItemModApple(903, 18, false, modFood_Tex)).setUnlocalizedName("My Apple").setPotionEffect("potion.blindness");
        glassBow = (new GlassBow(904, modBow_Tex)).setUnlocalizedName("Glass Bow");
        GameRegistry.registerBlock(mopBukket, "mopBukket_UN");
        LanguageRegistry.addName(mopBukket, "Mop Bukket");
        LanguageRegistry.addName(mop, "Mop");
        LanguageRegistry.addName(food, "My Food");
        LanguageRegistry.addName(apple, "My Apple");
        LanguageRegistry.addName(glassBow, "Glass Bow");
        GameRegistry.addRecipe(new ItemStack(mopBukket, 1), new Object[] {"   "," X ","X X", Character.valueOf('X'), Item.ingotIron});
        GameRegistry.addRecipe(new ItemStack(mop, 4), new Object[] {"XXX","XXX","XXX", Character.valueOf('X'), mopBukket});
        GameRegistry.addRecipe(new ItemStack(food, 4), new Object[] {"   "," X "," X ", Character.valueOf('X'), Item.ingotIron});
        GameRegistry.addRecipe(new ItemStack(apple, 4), new Object[] {" X "," X "," X ", Character.valueOf('X'), Item.ingotIron});
        GameRegistry.addRecipe(new ItemStack(glassBow, 1), new Object[] {" XS","X S"," XS", Character.valueOf('X'), Block.glass, Character.valueOf('S'), Item.silk});
    }

Output:
    public void init(FMLInitializationEvent event) {
        mopBukket = new BlockMopBukket(900, Material.grass, mopBukket_Tex).setUnlocalizedName("mopBukket_UN");
        mopBukket.setStepSound(Block.soundMetalFootstep);
        mop = (new ItemMop(901, mop_Tex)).setUnlocalizedName("Mop").setCreativeTab(hygienicTab);
        food = (new ItemModFood(902, 18, true, modFood_Tex)).setUnlocalizedName("My Food");
        apple = (new ItemModApple(903, 18, false, modFood_Tex)).setUnlocalizedName("My Apple").setPotionEffect("potion.blindness");
        glassBow = (new GlassBow(904, modBow_Tex)).setUnlocalizedName("Glass Bow");
        GameRegistry.registerBlock(mopBukket, "mopBukket_UN");
        LanguageRegistry.addName(mopBukket, "Mop Bukket");
        LanguageRegistry.addName(mop, "Mop");
        LanguageRegistry.addName(food, "My Food");
        LanguageRegistry.addName(apple, "My Apple");
        LanguageRegistry.addName(glassBow, "Glass Bow");
        LanguageRegistry.instance().addStringLocalization("itemGroup.Hygienic", "en_US", "Hygienic");
        GameRegistry.addRecipe(new ItemStack(mopBukket, 1), new Object[] {"   "," X ","X X", Character.valueOf('X'), Item.ingotIron});
        GameRegistry.addRecipe(new ItemStack(mop, 4), new Object[] {"XXX","XXX","XXX", Character.valueOf('X'), mopBukket});
        GameRegistry.addRecipe(new ItemStack(food, 4), new Object[] {"   "," X "," X ", Character.valueOf('X'), Item.ingotIron});
        GameRegistry.addRecipe(new ItemStack(apple, 4), new Object[] {" X "," X "," X ", Character.valueOf('X'), Item.ingotIron});
        GameRegistry.addRecipe(new ItemStack(glassBow, 1), new Object[] {" XS","X S"," XS", Character.valueOf('X'), Block.glass, Character.valueOf('S'), Item.silk});
    }


Input:
    public ImportStatementInfo resolve(final TargetClassInfo usingClass,
            final CallableUnitInfo usingMethod, final ClassInfoManager classInfoManager,
            final FieldInfoManager fieldInfoManager, final MethodInfoManager methodInfoManager) {
        MetricsToolSecurityManager.getInstance().checkAccess();
        if (null == classInfoManager) {
            throw new NullPointerException();
        }
        if (this.alreadyResolved()) {
            return this.getResolved();
        }
        final int fromLine = this.getFromLine();
        final int fromColumn = this.getFromColumn();
        final int toLine = this.getToLine();
        final int toColumn = this.getToColumn();
        final SortedSet<ClassInfo> accessibleClasses = new TreeSet<ClassInfo>();
        if (this.isAllClasses()) {
            final String[] namespace = this.getNamespace();
            final Collection<ClassInfo> specifiedClasses = classInfoManager
                    .getClassInfos(namespace);
            accessibleClasses.addAll(specifiedClasses);
        } else {
            final String[] importName = this.getImportName();
            ClassInfo specifiedClass = classInfoManager.getClassInfo(importName);
            if (null == specifiedClass) {
                specifiedClass = new ExternalClassInfo(importName);
            }
        }
        this.resolvedInfo = new ImportStatementInfo(fromLine, fromColumn, toLine, toColumn,
                accessibleClasses);
        return this.resolvedInfo;
    }

Output:
    public ImportStatementInfo resolve(final TargetClassInfo usingClass,
            final CallableUnitInfo usingMethod, final ClassInfoManager classInfoManager,
            final FieldInfoManager fieldInfoManager, final MethodInfoManager methodInfoManager) {
        MetricsToolSecurityManager.getInstance().checkAccess();
        if (null == classInfoManager) {
            throw new NullPointerException();
        }
        if (this.alreadyResolved()) {
            return this.getResolved();
        }
        final int fromLine = this.getFromLine();
        final int fromColumn = this.getFromColumn();
        final int toLine = this.getToLine();
        final int toColumn = this.getToColumn();
        final SortedSet<ClassInfo> accessibleClasses = new TreeSet<ClassInfo>();
        if (this.isAllClasses()) {
            final String[] namespace = this.getNamespace();
            final Collection<ClassInfo> specifiedClasses = classInfoManager
                    .getClassInfos(namespace);
            accessibleClasses.addAll(specifiedClasses);
        } else {
            final String[] importName = this.getImportName();
            ClassInfo specifiedClass = classInfoManager.getClassInfo(importName);
            if (null == specifiedClass) {
                specifiedClass = new ExternalClassInfo(importName);
                accessibleClasses.add(specifiedClass);
            }
        }
        this.resolvedInfo = new ImportStatementInfo(fromLine, fromColumn, toLine, toColumn,
                accessibleClasses);
        return this.resolvedInfo;
    }


Input:
	public static IResultMetaData retrieveResultMetaData(
			DataSetHandle dataSetHandle ) throws BirtException
	{
		List resultSetList = null;
		if ( dataSetHandle instanceof OdaDataSetHandle )
		{
			PropertyHandle handle = dataSetHandle.getPropertyHandle( OdaDataSetHandle.RESULT_SET_PROP );
			if ( handle.isLocal( ) )
				resultSetList = handle.getListValue( );
		}
		else if ( dataSetHandle instanceof ScriptDataSetHandle )
		{
			PropertyHandle handle = dataSetHandle.getPropertyHandle( DataSetHandle.RESULT_SET_HINTS_PROP );
			if ( handle.isLocal( ) )
				resultSetList = handle.getListValue( );
		}
		else
		{
			return null;
		}
		List computedList = (List) dataSetHandle.getProperty( OdaDataSetHandle.COMPUTED_COLUMNS_PROP );
		List columnMeta = new ArrayList( );
		ResultSetColumnDefinition columnDef;
		int count = 0;
		if ( resultSetList != null && !resultSetList.isEmpty( ) )
		{
			ResultSetColumn resultSetColumn;
			HashSet orgColumnNameSet = new HashSet( );
			HashSet uniqueColumnNameSet = new HashSet( );
			for ( int n = 0; n < resultSetList.size( ); n++ )
			{
				orgColumnNameSet.add( ( (ResultSetColumn) resultSetList.get( n ) ).getColumnName( ) );
			}
			for ( int i = 0; i < resultSetList.size( ); i++ )
			{
				resultSetColumn = (ResultSetColumn) resultSetList.get( i );
				String columnName = resultSetColumn.getColumnName( );
				String uniqueColumnName = getUniqueName( orgColumnNameSet,
						uniqueColumnNameSet,
						columnName,
						i );
				uniqueColumnNameSet.add( uniqueColumnName );
				if ( !uniqueColumnName.equals( columnName ) )
				{
					updateModelColumn( dataSetHandle, uniqueColumnName, i + 1 );
				}
				columnDef = new ResultSetColumnDefinition( uniqueColumnName );
				columnDef.setDataTypeName( resultSetColumn.getDataType( ) );
				columnDef.setDataType( DataAdapterUtil.adaptModelDataType( resultSetColumn.getDataType( ) ) );
				if ( resultSetColumn.getPosition( ) != null )
					columnDef.setColumnPosition( resultSetColumn.getPosition( )
							.intValue( ) );
				if ( resultSetColumn.getNativeDataType( ) != null )
					columnDef.setNativeDataType( resultSetColumn.getNativeDataType( )
							.intValue( ) );
				if ( findColumnHint( dataSetHandle, uniqueColumnName ) != null )
				{
					ColumnHintHandle columnHint = findColumnHint( dataSetHandle,
							uniqueColumnName );
					columnDef.setAlias( columnHint.getAlias( ) );
					columnDef.setLableName( columnHint.getDisplayName( ) );
				}
				columnDef.setComputedColumn( false );
				columnMeta.add( columnDef );
			}
			count += resultSetList.size( );
			if ( computedList != null )
			{
				for ( int n = 0; n < computedList.size( ); n++ )
				{
					orgColumnNameSet.add( ( (ComputedColumn) computedList.get( n ) ).getName( ) );
				}
				ComputedColumn computedColumn;
				for ( int i = 0; i < computedList.size( ); i++ )
				{
					computedColumn = (ComputedColumn) computedList.get( i );
					String columnName = computedColumn.getName( );
					String uniqueColumnName = getUniqueName( orgColumnNameSet,
							uniqueColumnNameSet,
							columnName,
							i + count );
					uniqueColumnNameSet.add( uniqueColumnName );
					if ( !uniqueColumnName.equals( columnName ) )
					{
						updateComputedColumn( dataSetHandle, uniqueColumnName, columnName );
					}
					columnDef = new ResultSetColumnDefinition( uniqueColumnName );
					columnDef.setDataTypeName( computedColumn.getDataType( ) );
					columnDef.setDataType( org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType( computedColumn.getDataType( ) ) );
					if ( findColumnHint( dataSetHandle, uniqueColumnName ) != null )
					{
						ColumnHintHandle columnHint = findColumnHint( dataSetHandle,
								uniqueColumnName );
						columnDef.setAlias( columnHint.getAlias( ) );
						columnDef.setLableName( columnHint.getDisplayName( ) );
					}
					columnDef.setComputedColumn( true );
					columnMeta.add( columnDef );
				}
			}
			return new ResultMetaData2( columnMeta );
		}
		return null;
	}

Output:
	public static IResultMetaData retrieveResultMetaData(
			DataSetHandle dataSetHandle ) throws BirtException
	{
		List resultSetList = null;
		if ( dataSetHandle instanceof OdaDataSetHandle )
		{
			PropertyHandle handle = dataSetHandle.getPropertyHandle( OdaDataSetHandle.RESULT_SET_PROP );
			resultSetList = handle.getListValue( );
		}
		else if ( dataSetHandle instanceof ScriptDataSetHandle )
		{
			PropertyHandle handle = dataSetHandle.getPropertyHandle( DataSetHandle.RESULT_SET_HINTS_PROP );
			resultSetList = handle.getListValue( );
		}
		else
		{
			return null;
		}
		List computedList = (List) dataSetHandle.getProperty( OdaDataSetHandle.COMPUTED_COLUMNS_PROP );
		List columnMeta = new ArrayList( );
		ResultSetColumnDefinition columnDef;
		int count = 0;
		if ( resultSetList != null && !resultSetList.isEmpty( ) )
		{
			ResultSetColumn resultSetColumn;
			HashSet orgColumnNameSet = new HashSet( );
			HashSet uniqueColumnNameSet = new HashSet( );
			for ( int n = 0; n < resultSetList.size( ); n++ )
			{
				orgColumnNameSet.add( ( (ResultSetColumn) resultSetList.get( n ) ).getColumnName( ) );
			}
			for ( int i = 0; i < resultSetList.size( ); i++ )
			{
				resultSetColumn = (ResultSetColumn) resultSetList.get( i );
				String columnName = resultSetColumn.getColumnName( );
				String uniqueColumnName = getUniqueName( orgColumnNameSet,
						uniqueColumnNameSet,
						columnName,
						i );
				uniqueColumnNameSet.add( uniqueColumnName );
				if ( !uniqueColumnName.equals( columnName ) )
				{
					updateModelColumn( dataSetHandle, uniqueColumnName, i + 1 );
				}
				columnDef = new ResultSetColumnDefinition( uniqueColumnName );
				columnDef.setDataTypeName( resultSetColumn.getDataType( ) );
				columnDef.setDataType( DataAdapterUtil.adaptModelDataType( resultSetColumn.getDataType( ) ) );
				if ( resultSetColumn.getPosition( ) != null )
					columnDef.setColumnPosition( resultSetColumn.getPosition( )
							.intValue( ) );
				if ( resultSetColumn.getNativeDataType( ) != null )
					columnDef.setNativeDataType( resultSetColumn.getNativeDataType( )
							.intValue( ) );
				if ( findColumnHint( dataSetHandle, uniqueColumnName ) != null )
				{
					ColumnHintHandle columnHint = findColumnHint( dataSetHandle,
							uniqueColumnName );
					columnDef.setAlias( columnHint.getAlias( ) );
					columnDef.setLableName( columnHint.getDisplayName( ) );
				}
				columnDef.setComputedColumn( false );
				columnMeta.add( columnDef );
			}
			count += resultSetList.size( );
			if ( computedList != null )
			{
				for ( int n = 0; n < computedList.size( ); n++ )
				{
					orgColumnNameSet.add( ( (ComputedColumn) computedList.get( n ) ).getName( ) );
				}
				ComputedColumn computedColumn;
				for ( int i = 0; i < computedList.size( ); i++ )
				{
					computedColumn = (ComputedColumn) computedList.get( i );
					String columnName = computedColumn.getName( );
					String uniqueColumnName = getUniqueName( orgColumnNameSet,
							uniqueColumnNameSet,
							columnName,
							i + count );
					uniqueColumnNameSet.add( uniqueColumnName );
					if ( !uniqueColumnName.equals( columnName ) )
					{
						updateComputedColumn( dataSetHandle, uniqueColumnName, columnName );
					}
					columnDef = new ResultSetColumnDefinition( uniqueColumnName );
					columnDef.setDataTypeName( computedColumn.getDataType( ) );
					columnDef.setDataType( org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType( computedColumn.getDataType( ) ) );
					if ( findColumnHint( dataSetHandle, uniqueColumnName ) != null )
					{
						ColumnHintHandle columnHint = findColumnHint( dataSetHandle,
								uniqueColumnName );
						columnDef.setAlias( columnHint.getAlias( ) );
						columnDef.setLableName( columnHint.getDisplayName( ) );
					}
					columnDef.setComputedColumn( true );
					columnMeta.add( columnDef );
				}
			}
			return new ResultMetaData2( columnMeta );
		}
		return null;
	}


Input:
    public void doFilter(final ServletRequest request, final ServletResponse response,
                         final FilterChain chain) throws IOException, ServletException {
        if ( interval < 0 ) {
            return;
        }
        final HttpServletRequest httpServletRequest = (HttpServletRequest)request;
        final HttpServletResponse httpServletResponse = (HttpServletResponse)response;
        Long lastUpdate = (Long)httpServletRequest.getSession(false).getAttribute(SESSION_KEEP_ALIVE_ATTRIBUTE_KEY);
        if(lastUpdate != null)
        {
            long delta = System.currentTimeMillis() - lastUpdate.longValue();
            if(delta >= interval) {
                final CrossContextRestApiInvoker rest = new SimpleCrossContextRestApiInvoker();
                HttpServletGetRequestWrapper wrap = new HttpServletGetRequestWrapper(httpServletRequest);
                final Map<String, String[]> params = new HashMap<String, String[]>();
                final RestResponse rr = rest.invoke(wrap, httpServletResponse, "/ssp-platform/api/session.json", params);
                httpServletRequest.getSession(false).setAttribute(SESSION_KEEP_ALIVE_ATTRIBUTE_KEY,System.currentTimeMillis());
            }
        } else {
            httpServletRequest.getSession(false).setAttribute(SESSION_KEEP_ALIVE_ATTRIBUTE_KEY,System.currentTimeMillis());
        }
        chain.doFilter(request, response);
    }

Output:
    public void doFilter(final ServletRequest request, final ServletResponse response,
                         final FilterChain chain) throws IOException, ServletException {
        if ( interval < 0 ) {
            chain.doFilter(request, response);
            return;
        }
        final HttpServletRequest httpServletRequest = (HttpServletRequest)request;
        final HttpServletResponse httpServletResponse = (HttpServletResponse)response;
        Long lastUpdate = (Long)httpServletRequest.getSession(false).getAttribute(SESSION_KEEP_ALIVE_ATTRIBUTE_KEY);
        if(lastUpdate != null)
        {
            long delta = System.currentTimeMillis() - lastUpdate.longValue();
            if(delta >= interval) {
                final CrossContextRestApiInvoker rest = new SimpleCrossContextRestApiInvoker();
                HttpServletGetRequestWrapper wrap = new HttpServletGetRequestWrapper(httpServletRequest);
                final Map<String, String[]> params = new HashMap<String, String[]>();
                final RestResponse rr = rest.invoke(wrap, httpServletResponse, "/ssp-platform/api/session.json", params);
                httpServletRequest.getSession(false).setAttribute(SESSION_KEEP_ALIVE_ATTRIBUTE_KEY,System.currentTimeMillis());
            }
        } else {
            httpServletRequest.getSession(false).setAttribute(SESSION_KEEP_ALIVE_ATTRIBUTE_KEY,System.currentTimeMillis());
        }
        chain.doFilter(request, response);
    }


Input:
	private Message prepareForSending(BrokerMessage brkMessage, String messageSource)
	{
		try
		{
			final Message message = new Message();
			if (StringUtils.isNotBlank(brkMessage.messageId))
				message.setMessageId(brkMessage.messageId);
			if (StringUtils.isNotBlank(brkMessage.correlationId))
				message.setCorrelationId(brkMessage.correlationId);
			if (StringUtils.isNotBlank(brkMessage.destinationName))
				message.setDestination(brkMessage.destinationName);
			if (StringUtils.isNotBlank(brkMessage.timestamp))
			{
				message.setTimestamp(DateUtil.parseISODate(brkMessage.timestamp).getTime());
			}
			if (StringUtils.isNotBlank(brkMessage.expiration))
			{
				message.setExpiration(DateUtil.parseISODate(brkMessage.expiration).getTime());
			}
			message.setContent(brkMessage.textPayload);
			message.setSourceApp(messageSource);
			if (log.isDebugEnabled())
			{
				log.debug("Received message: {}", message.getMessageId());
			}
			return message;
		}
		catch (Throwable e)
		{
			throw new RuntimeException(e);
		}
	}

Output:
	private Message prepareForSending(BrokerMessage brkMessage, String messageSource)
	{
		try
		{
			final Message message = new Message();
			if (StringUtils.isNotBlank(brkMessage.messageId))
				message.setMessageId(brkMessage.messageId);
			if (StringUtils.isNotBlank(brkMessage.correlationId))
				message.setCorrelationId(brkMessage.correlationId);
			if (StringUtils.isNotBlank(brkMessage.destinationName))
				message.setDestination(brkMessage.destinationName);
			if (StringUtils.isNotBlank(brkMessage.timestamp))
			{
				message.setTimestamp(DateUtil.parseISODate(brkMessage.timestamp).getTime());
			}
			if (StringUtils.isNotBlank(brkMessage.expiration))
			{
				message.setExpiration(DateUtil.parseISODate(brkMessage.expiration).getTime());
			}
			message.setContent(brkMessage.textPayload);
			message.setSourceApp(messageSource);
			message.setPriority(brkMessage.priority);
			if (log.isDebugEnabled())
			{
				log.debug("Received message: {}", message.getMessageId());
			}
			return message;
		}
		catch (Throwable e)
		{
			throw new RuntimeException(e);
		}
	}


Input:
    public Rating(Surfer surfer, UserInfo userInfo){
      this.surfer = surfer;
      this.userInfos.add(userInfo);
      this.rating = 0;
      this.ratingCount = 0;
    }

Output:
    public Rating(Surfer surfer, UserInfo userInfo){
      this.surfer = surfer;
      this.rating = 0;
      this.ratingCount = 0;
    }


Input:
	private static Point getPointerLocation(final Component component) {
		try {
			final Class MouseInfo_class = Class.forName("java.awt.MouseInfo");
			final Method getPointerInfo_method = MouseInfo_class.getMethod("getPointerInfo", null);
			final Class PointerInfo_class = Class.forName("java.awt.PointerInfo");
			final Method getDevice_method = PointerInfo_class.getMethod("getDevice", null);
			final Method getLocation_method = PointerInfo_class.getMethod("getLocation", null);
			return (Point)AccessController.doPrivileged(new PrivilegedExceptionAction() {
				public final Object run() throws Exception {
					Object pointer_info = getPointerInfo_method.invoke(null, null);
					GraphicsDevice device = (GraphicsDevice)getDevice_method.invoke(pointer_info, null);
					if (device == component.getGraphicsConfiguration().getDevice()) {
						return (Point)getLocation_method.invoke(pointer_info, null);
					} else
						return null;
				}
			});
		} catch (PrivilegedActionException e) {
			LWJGLUtil.log("Failed to query pointer location: " + e.getCause());
		} catch (NoSuchMethodException e) {
			LWJGLUtil.log("Failed to query pointer location: " + e);
		} catch (IllegalAccessException e) {
			LWJGLUtil.log("Failed to query pointer location: " + e);
		} catch (ClassNotFoundException e) {
			LWJGLUtil.log("Failed to query pointer location: " + e);
		}
		return null;
	}

Output:
	private static Point getPointerLocation(final Component component) {
		try {
			final Class MouseInfo_class = Class.forName("java.awt.MouseInfo");
			final Method getPointerInfo_method = MouseInfo_class.getMethod("getPointerInfo", null);
			final Class PointerInfo_class = Class.forName("java.awt.PointerInfo");
			final Method getDevice_method = PointerInfo_class.getMethod("getDevice", null);
			final Method getLocation_method = PointerInfo_class.getMethod("getLocation", null);
			return (Point)AccessController.doPrivileged(new PrivilegedExceptionAction() {
				public final Object run() throws Exception {
					Object pointer_info = getPointerInfo_method.invoke(null, null);
					GraphicsDevice device = (GraphicsDevice)getDevice_method.invoke(pointer_info, null);
					if (device == component.getGraphicsConfiguration().getDevice()) {
						return (Point)getLocation_method.invoke(pointer_info, null);
					} else
						return null;
				}
			});
		} catch (PrivilegedActionException e) {
			LWJGLUtil.log("Failed to query pointer location: " + e.getCause());
		} catch (NoSuchMethodException e) {
			LWJGLUtil.log("Failed to query pointer location: " + e);
		} catch (ClassNotFoundException e) {
			LWJGLUtil.log("Failed to query pointer location: " + e);
		}
		return null;
	}


Input:
	public void updateMissingPlacements() {
		System.out.println("[ContractSchoolPlacementUpdate]: Beginning updating applications...");
		System.out.println("-------------------------------------------------------------------");
		try {
			Collection applications = getChildCareApplicationHome().findApplicationsWithoutPlacing();
			int size = applications.size();
			int counter = 1;
			Iterator iter = applications.iterator();
			while (iter.hasNext()) {
				ChildCareApplication application = (ChildCareApplication) iter.next();
				System.out.println("[ContractSchoolPlacementUpdate]: Updating application " + counter + " of " + size + " (ID=" + application.getPrimaryKey() + ")");
				IWTimestamp fromDate = new IWTimestamp(application.getFromDate());
				Timestamp endDate = null;
				if (application.getRejectionDate() != null)
					endDate = new IWTimestamp(application.getRejectionDate()).getTimestamp();
				try {
					Collection contracts = getChildCareContractHome().findByApplication(((Integer)application.getPrimaryKey()).intValue());
					SchoolClass group = null;
					try {
						group = getSchoolBusiness().getSchoolClassHome().findOneBySchool(application.getProviderId());
					}
					catch (FinderException fe) {
						System.out.println("Found no group for provider = " + application.getProviderId());
						group = null;
					}
					if (group != null) {
						SchoolClassMember member = getSchoolBusiness().storeSchoolClassMember(application.getChildId(), ((Integer) group.getPrimaryKey()).intValue(), fromDate.getTimestamp(), endDate, -1, null);
						Iterator iterator = contracts.iterator();
						while (iterator.hasNext()) {
							ChildCareContract contract = (ChildCareContract) iterator.next();
							contract.setSchoolClassMember(member);
							contract.store();
						}
					}
				}
				catch (FinderException fe) {
					fe.printStackTrace();
				}
			}
		}
		catch (RemoteException e) {
			e.printStackTrace();
		}
		catch (FinderException e) {
			System.out.println("[ContractSchoolPlacementUpdate]: No applications found with missing placements.");
		}
		System.out.println("-------------------------------------------------------------------");
		System.out.println("[ContractSchoolPlacementUpdate]: Done updating applications........");
	}

Output:
	public void updateMissingPlacements() {
		System.out.println("[ContractSchoolPlacementUpdate]: Beginning updating applications...");
		System.out.println("-------------------------------------------------------------------");
		try {
			Collection applications = getChildCareApplicationHome().findApplicationsWithoutPlacing();
			int size = applications.size();
			int counter = 1;
			Iterator iter = applications.iterator();
			while (iter.hasNext()) {
				ChildCareApplication application = (ChildCareApplication) iter.next();
				System.out.println("[ContractSchoolPlacementUpdate]: Updating application " + counter + " of " + size + " (ID=" + application.getPrimaryKey() + ")");
				IWTimestamp fromDate = new IWTimestamp(application.getFromDate());
				Timestamp endDate = null;
				if (application.getRejectionDate() != null)
					endDate = new IWTimestamp(application.getRejectionDate()).getTimestamp();
				try {
					Collection contracts = getChildCareContractHome().findByApplication(((Integer)application.getPrimaryKey()).intValue());
					SchoolClass group = null;
					try {
						group = getSchoolBusiness().getSchoolClassHome().findOneBySchool(application.getProviderId());
					}
					catch (FinderException fe) {
						System.out.println("Found no group for provider = " + application.getProviderId());
						group = null;
					}
					if (group != null) {
						SchoolClassMember member = getSchoolBusiness().storeSchoolClassMember(application.getChildId(), ((Integer) group.getPrimaryKey()).intValue(), -1, group.getSchoolTypeId(), fromDate.getTimestamp(), endDate, -1, null);
						Iterator iterator = contracts.iterator();
						while (iterator.hasNext()) {
							ChildCareContract contract = (ChildCareContract) iterator.next();
							contract.setSchoolClassMember(member);
							contract.store();
						}
					}
				}
				catch (FinderException fe) {
					fe.printStackTrace();
				}
			}
		}
		catch (RemoteException e) {
			e.printStackTrace();
		}
		catch (FinderException e) {
			System.out.println("[ContractSchoolPlacementUpdate]: No applications found with missing placements.");
		}
		System.out.println("-------------------------------------------------------------------");
		System.out.println("[ContractSchoolPlacementUpdate]: Done updating applications........");
	}