Input:
    public void layoutContainer(Container parent) {
        JScrollPane scrollPane = (JScrollPane) parent;
        vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
        hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();
        Rectangle availR = scrollPane.getBounds();
        availR.x = availR.y = 0;
        Insets insets = parent.getInsets();
        availR.x = insets.left;
        availR.y = insets.top;
        availR.width -= insets.left + insets.right;
        availR.height -= insets.top + insets.bottom;
        Rectangle colHeadR = new Rectangle(0, availR.y, 0, 0);
        int upperHeight = getUpperHeight();
        if ((colHead != null) && (colHead.isVisible())) {
            int colHeadHeight = Math.min(availR.height, upperHeight);
            colHeadR.height = colHeadHeight;
            availR.y += colHeadHeight;
            availR.height -= colHeadHeight;
        }
        Rectangle subColHeadR = new Rectangle(0, availR.y, 0, 0);
        if (_subColHead != null && _subColHead.isVisible()) {
            int subColHeadHeight = Math.min(availR.height, _subColHead.getPreferredSize().height);
            subColHeadR.height = subColHeadHeight;
            availR.y += subColHeadHeight;
            availR.height -= subColHeadHeight;
        }
        Rectangle rowHeadR = new Rectangle(0, 0, 0, 0);
        if ((rowHead != null) && (rowHead.isVisible())) {
            int rowHeadWidth = rowHead.getPreferredSize().width;
            if (upperLeft != null && upperLeft.isVisible()) {
                rowHeadWidth = Math.max(rowHeadWidth, upperLeft.getPreferredSize().width);
            }
            if (lowerLeft != null && lowerLeft.isVisible()) {
                rowHeadWidth = Math.max(rowHeadWidth, lowerLeft.getPreferredSize().width);
            }
            rowHeadR.width = rowHeadWidth;
            availR.width -= rowHeadWidth;
            rowHeadR.x = availR.x;
            availR.x += rowHeadWidth;
        }
        Border viewportBorder = scrollPane.getViewportBorder();
        Insets vpbInsets;
        if (viewportBorder != null) {
            vpbInsets = viewportBorder.getBorderInsets(parent);
            availR.x += vpbInsets.left;
            availR.y += vpbInsets.top;
            availR.width -= vpbInsets.left + vpbInsets.right;
            availR.height -= vpbInsets.top + vpbInsets.bottom;
        }
        else {
            vpbInsets = new Insets(0, 0, 0, 0);
        }
        Rectangle rowFootR = new Rectangle(0, 0, 0, 0);
        if ((_rowFoot != null) && (_rowFoot.isVisible())) {
            int rowFootWidth = _rowFoot.getPreferredSize().width;
            if (upperRight != null && upperRight.isVisible()) {
                rowFootWidth = Math.max(rowFootWidth, upperRight.getPreferredSize().width);
            }
            if (lowerRight != null && lowerRight.isVisible()) {
                rowFootWidth = Math.max(rowFootWidth, lowerRight.getPreferredSize().width);
            }
            rowFootR.width = rowFootWidth;
            availR.width -= rowFootWidth;
            rowFootR.x = availR.x + availR.width;
        }
        Rectangle colFootR = new Rectangle(0, availR.y, 0, 0);
        int lowerHeight = getLowerHeight();
        if ((_colFoot != null) && (_colFoot.isVisible())) {
            int colFootHeight = Math.min(availR.height, lowerHeight);
            colFootR.height = colFootHeight;
            availR.height -= colFootHeight;
            colFootR.y = availR.y + availR.height;
        }
        Component view = (viewport != null) ? viewport.getView() : null;
        Dimension viewPrefSize = (view != null) ? view.getPreferredSize() : new Dimension(0, 0);
        Dimension extentSize =
                (viewport != null) ? viewport.toViewCoordinates(availR.getSize())
                        : new Dimension(0, 0);
        boolean viewTracksViewportWidth = false;
        boolean viewTracksViewportHeight = false;
        boolean isEmpty = (availR.width < 0 || availR.height < 0);
        Scrollable sv;
        if (!isEmpty && view instanceof Scrollable) {
            sv = (Scrollable) view;
            viewTracksViewportWidth = sv.getScrollableTracksViewportWidth();
            viewTracksViewportHeight = sv.getScrollableTracksViewportHeight();
        }
        else {
            sv = null;
        }
        Rectangle vsbR = new Rectangle(0, isVsbCoversWholeHeight(scrollPane) ? insets.top : availR.y - vpbInsets.top, 0, 0);
        boolean vsbNeeded;
        if (vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) {
            vsbNeeded = true;
        }
        else if (vsbPolicy == VERTICAL_SCROLLBAR_NEVER) {
            vsbNeeded = false;
        }
        else if (isEmpty) {
            vsbNeeded = false;
        }
        else {
            vsbNeeded = !viewTracksViewportHeight && (viewPrefSize.height > extentSize.height || (rowHead != null && rowHead.getView() != null && rowHead.getView().getPreferredSize().height > extentSize.height));
            if (!vsbNeeded && scrollPane instanceof JideScrollPane && ((JideScrollPane) scrollPane).isKeepCornerVisible() && (_vBottom != null || _vTop != null)) {
                vsbNeeded = true;
            }
        }
        if ((vsb != null) && vsbNeeded) {
            adjustForVSB(true, availR, vsbR, vpbInsets, true);
            extentSize = viewport.toViewCoordinates(availR.getSize());
        }
        Rectangle hsbR = new Rectangle(isHsbCoversWholeWidth(scrollPane) ? insets.left : availR.x - vpbInsets.left, 0, 0, 0);
        boolean hsbNeeded;
        if (hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) {
            hsbNeeded = true;
        }
        else if (hsbPolicy == HORIZONTAL_SCROLLBAR_NEVER) {
            hsbNeeded = false;
        }
        else if (isEmpty) {
            hsbNeeded = false;
        }
        else {
            hsbNeeded = !viewTracksViewportWidth && (viewPrefSize.width > extentSize.width || (colHead != null && colHead.getView() != null && colHead.getView().getPreferredSize().width > extentSize.width));
            if (!hsbNeeded && scrollPane instanceof JideScrollPane && ((JideScrollPane) scrollPane).isKeepCornerVisible() && (_hLeft != null || _hRight != null)) {
                hsbNeeded = true;
            }
        }
        if ((hsb != null) && hsbNeeded) {
            adjustForHSB(true, availR, hsbR, vpbInsets);
            if ((vsb != null) && !vsbNeeded &&
                    (vsbPolicy != VERTICAL_SCROLLBAR_NEVER)) {
                extentSize = viewport.toViewCoordinates(availR.getSize());
                vsbNeeded = viewPrefSize.height > extentSize.height;
                if (!vsbNeeded && scrollPane instanceof JideScrollPane && ((JideScrollPane) scrollPane).isKeepCornerVisible() && (_vBottom != null || _vTop != null)) {
                    vsbNeeded = true;
                }
                if (vsbNeeded) {
                    adjustForVSB(true, availR, vsbR, vpbInsets, true);
                }
            }
        }
        boolean ltr = scrollPane.getComponentOrientation().isLeftToRight();
        if (viewport != null) {
            viewport.setBounds(adjustBounds(parent, availR, ltr));
            if (sv != null) {
                extentSize = viewport.toViewCoordinates(availR.getSize());
                boolean oldHSBNeeded = hsbNeeded;
                boolean oldVSBNeeded = vsbNeeded;
                viewTracksViewportWidth = sv.getScrollableTracksViewportWidth();
                viewTracksViewportHeight = sv.getScrollableTracksViewportHeight();
                if (vsb != null && vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED) {
                    boolean newVSBNeeded = !viewTracksViewportHeight && (viewPrefSize.height > extentSize.height || (rowHead != null && rowHead.getView() != null && rowHead.getView().getPreferredSize().height > extentSize.height));
                    if (!newVSBNeeded && scrollPane instanceof JideScrollPane && ((JideScrollPane) scrollPane).isKeepCornerVisible() && (_vBottom != null || _vTop != null)) {
                        newVSBNeeded = true;
                    }
                    if (newVSBNeeded != vsbNeeded) {
                        vsbNeeded = newVSBNeeded;
                        adjustForVSB(vsbNeeded, availR, vsbR, vpbInsets, true);
                        extentSize = viewport.toViewCoordinates
                                (availR.getSize());
                    }
                }
                if (hsb != null && hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED) {
                    boolean newHSBbNeeded = !viewTracksViewportWidth && (viewPrefSize.width > extentSize.width || (colHead != null && colHead.getView() != null && colHead.getView().getPreferredSize().width > extentSize.width));
                    if (!newHSBbNeeded && scrollPane instanceof JideScrollPane && ((JideScrollPane) scrollPane).isKeepCornerVisible() && (_hLeft != null || _hRight != null)) {
                        newHSBbNeeded = true;
                    }
                    if (newHSBbNeeded != hsbNeeded) {
                        hsbNeeded = newHSBbNeeded;
                        adjustForHSB(hsbNeeded, availR, hsbR, vpbInsets);
                        if ((vsb != null) && !vsbNeeded &&
                                (vsbPolicy != VERTICAL_SCROLLBAR_NEVER)) {
                            extentSize = viewport.toViewCoordinates
                                    (availR.getSize());
                            vsbNeeded = viewPrefSize.height >
                                    extentSize.height;
                            if (!vsbNeeded && scrollPane instanceof JideScrollPane && ((JideScrollPane) scrollPane).isKeepCornerVisible() && (_vBottom != null || _vTop != null)) {
                                vsbNeeded = true;
                            }
                            if (vsbNeeded) {
                                adjustForVSB(true, availR, vsbR, vpbInsets, true);
                            }
                        }
                        if (_rowFoot != null && _rowFoot.isVisible()) {
                            vsbR.x += rowFootR.width;
                        }
                    }
                }
                if (oldHSBNeeded != hsbNeeded ||
                        oldVSBNeeded != vsbNeeded) {
                    viewport.setBounds(adjustBounds(parent, availR, ltr));
                }
            }
        }
        vsbR.height = isVsbCoversWholeHeight(scrollPane) ? scrollPane.getHeight() - insets.bottom - insets.top : availR.height + vpbInsets.top + vpbInsets.bottom;
        hsbR.width = isHsbCoversWholeWidth(scrollPane) ? scrollPane.getWidth() - vsbR.width - insets.left - insets.right : availR.width + vpbInsets.left + vpbInsets.right;
        rowHeadR.height = availR.height + vpbInsets.top + vpbInsets.bottom;
        rowHeadR.y = availR.y - vpbInsets.top;
        colHeadR.width = availR.width + vpbInsets.left + vpbInsets.right;
        colHeadR.x = availR.x - vpbInsets.left;
        subColHeadR.width = colHeadR.width;
        subColHeadR.x = colHeadR.x;
        colFootR.x = availR.x;
        colFootR.y = rowHeadR.y + rowHeadR.height;
        colFootR.width = availR.width;
        rowFootR.x = availR.x + availR.width;
        rowFootR.y = availR.y;
        rowFootR.height = availR.height;
        vsbR.x += rowFootR.width;
        hsbR.y += colFootR.height;
        if (rowHead != null) {
            rowHead.setBounds(adjustBounds(parent, rowHeadR, ltr));
        }
        if (_rowFoot != null) {
            _rowFoot.setBounds(adjustBounds(parent, rowFootR, ltr));
        }
        int columnHeaderHeight = isColumnHeadersHeightUnified(scrollPane) ? Math.max(colHeadR.height,
                Math.max(upperLeft == null ? 0 : upperLeft.getPreferredSize().height, upperRight == null ? 0 : upperRight.getPreferredSize().height)) : 0;
        int columnFooterHeight = isColumnFootersHeightUnified(scrollPane) ? Math.max(colFootR.height,
                Math.max(lowerLeft == null ? 0 : lowerLeft.getPreferredSize().height, lowerRight == null ? 0 : lowerRight.getPreferredSize().height)) : 0;
        if (colHead != null) {
            int height = isColumnHeadersHeightUnified(scrollPane) ? columnHeaderHeight : Math.min(colHeadR.height, colHead.getPreferredSize().height);
            colHead.setBounds(adjustBounds(parent, new Rectangle(colHeadR.x, colHeadR.y + colHeadR.height - height, colHeadR.width, height), ltr));
        }
        if (_subColHead != null) {
            _subColHead.setBounds(adjustBounds(parent, subColHeadR, ltr));
        }
        if (_colFoot != null) {
            int height = isColumnFootersHeightUnified(scrollPane) ? columnFooterHeight : Math.min(colFootR.height, _colFoot.getPreferredSize().height);
            _colFoot.setBounds(adjustBounds(parent, new Rectangle(colFootR.x, colFootR.y, colFootR.width, height), ltr));
        }
        else {
            if (isColumnFootersHeightUnified(scrollPane)) {
                columnFooterHeight = hsbR.height;
            }
        }
        if (vsb != null) {
            if (vsbNeeded) {
                vsb.setVisible(true);
                if (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && !isEmpty && !(!viewTracksViewportHeight && (viewPrefSize.height > extentSize.height || (rowHead != null && rowHead.getView() != null && rowHead.getView().getPreferredSize().height > extentSize.height)))) {
                    vsb.setVisible(false);
                }
                if (_vTop == null && _vBottom == null)
                    vsb.setBounds(adjustBounds(parent, vsbR, ltr));
                else {
                    Rectangle rect = new Rectangle(vsbR);
                    if (_vTop != null) {
                        Dimension dim = _vTop.getPreferredSize();
                        rect.y += dim.height;
                        rect.height -= dim.height;
                        _vTop.setVisible(true);
                        _vTop.setBounds(adjustBounds(parent, new Rectangle(vsbR.x, vsbR.y, vsbR.width, dim.height), ltr));
                    }
                    if (_vBottom != null) {
                        Dimension dim = _vBottom.getPreferredSize();
                        rect.height -= dim.height;
                        _vBottom.setVisible(true);
                        _vBottom.setBounds(adjustBounds(parent, new Rectangle(vsbR.x, vsbR.y + vsbR.height - dim.height, vsbR.width, dim.height), ltr));
                    }
                    vsb.setBounds(adjustBounds(parent, rect, ltr));
                }
            }
            else {
                if (viewPrefSize.height > extentSize.height) {
                    vsb.setVisible(true);
                    vsb.setBounds(adjustBounds(parent, new Rectangle(vsbR.x, vsbR.y, 0, vsbR.height), ltr));
                }
                else {
                    vsb.setVisible(false);
                }
                if (_vTop != null)
                    _vTop.setVisible(false);
                if (_vBottom != null)
                    _vBottom.setVisible(false);
            }
        }
        if (hsb != null) {
            if (hsbNeeded) {
                hsb.setVisible(true);
                if (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && !isEmpty && !(!viewTracksViewportWidth && (viewPrefSize.width > extentSize.width || (colHead != null && colHead.getView() != null && colHead.getView().getPreferredSize().width > extentSize.width)))) {
                    hsb.setVisible(false);
                }
                if (_hLeft == null && _hRight == null)
                    hsb.setBounds(adjustBounds(parent, hsbR, ltr));
                else {
                    Rectangle rect = new Rectangle(hsbR);
                    if (_hLeft != null) {
                        Dimension dim = _hLeft.getPreferredSize();
                        rect.x += dim.width;
                        rect.width -= dim.width;
                        _hLeft.setVisible(true);
                        _hLeft.setBounds(adjustBounds(parent, new Rectangle(hsbR.x, hsbR.y, dim.width, hsbR.height), ltr));
                        _hLeft.doLayout();
                    }
                    if (_hRight != null) {
                        Dimension dim = _hRight.getPreferredSize();
                        rect.width -= dim.width;
                        _hRight.setVisible(true);
                        _hRight.setBounds(adjustBounds(parent, new Rectangle(hsbR.x + hsbR.width - dim.width, hsbR.y, dim.width, hsbR.height), ltr));
                    }
                    hsb.setBounds(adjustBounds(parent, rect, ltr));
                }
            }
            else {
                if (viewPrefSize.width > extentSize.width) {
                    hsb.setVisible(true);
                    hsb.setBounds(adjustBounds(parent, new Rectangle(hsbR.x, hsbR.y, hsbR.width, 0), ltr));
                }
                else {
                    hsb.setVisible(false);
                }
                if (_hLeft != null)
                    _hLeft.setVisible(false);
                if (_hRight != null)
                    _hRight.setVisible(false);
            }
        }
        if (lowerLeft != null && lowerLeft.isVisible()) {
            int height = isColumnFootersHeightUnified(scrollPane) ? columnFooterHeight : Math.min(lowerLeft.getPreferredSize().height, colFootR.height);
            lowerLeft.setBounds(adjustBounds(parent, new Rectangle(rowHeadR.x, colFootR.y != 0 ? colFootR.y : hsbR.y, rowHeadR.width, height), ltr));
        }
        if (lowerRight != null && lowerRight.isVisible()) {
            int height = isColumnFootersHeightUnified(scrollPane) ? columnFooterHeight : Math.min(lowerRight.getPreferredSize().height, colFootR.height);
            lowerRight.setBounds(adjustBounds(parent, new Rectangle(rowFootR.x, colFootR.y != 0 ? colFootR.y : hsbR.y, rowFootR.width + (isVsbCoversWholeHeight(scrollPane) ? 0 : vsbR.width), height), ltr));
        }
        if (upperLeft != null && upperLeft.isVisible()) {
            int height = isColumnHeadersHeightUnified(scrollPane) ? columnHeaderHeight : Math.min(upperLeft.getPreferredSize().height, colHeadR.height);
            upperLeft.setBounds(adjustBounds(parent, new Rectangle(rowHeadR.x, colHeadR.y + colHeadR.height - height, rowHeadR.width, height), ltr));
        }
        if (upperRight != null && upperRight.isVisible()) {
            int height = isColumnHeadersHeightUnified(scrollPane) ? columnHeaderHeight : Math.min(upperRight.getPreferredSize().height, colHeadR.height);
            upperRight.setBounds(adjustBounds(parent, new Rectangle(rowFootR.x, colHeadR.y + colHeadR.height - height, rowFootR.width + (isVsbCoversWholeHeight(scrollPane) ? 0 : vsbR.width), height), ltr));
        }
    }

Output:
    public void layoutContainer(Container parent) {
        JScrollPane scrollPane = (JScrollPane) parent;
        vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
        hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();
        Rectangle availR = scrollPane.getBounds();
        availR.x = availR.y = 0;
        Insets insets = parent.getInsets();
        availR.x = insets.left;
        availR.y = insets.top;
        availR.width -= insets.left + insets.right;
        availR.height -= insets.top + insets.bottom;
        Rectangle colHeadR = new Rectangle(0, availR.y, 0, 0);
        int upperHeight = getUpperHeight();
        if ((colHead != null) && (colHead.isVisible())) {
            int colHeadHeight = Math.min(availR.height, upperHeight);
            colHeadR.height = colHeadHeight;
            availR.y += colHeadHeight;
            availR.height -= colHeadHeight;
        }
        Rectangle subColHeadR = new Rectangle(0, availR.y, 0, 0);
        if (_subColHead != null && _subColHead.isVisible()) {
            int subColHeadHeight = Math.min(availR.height, _subColHead.getPreferredSize().height);
            subColHeadR.height = subColHeadHeight;
            availR.y += subColHeadHeight;
            availR.height -= subColHeadHeight;
        }
        Rectangle rowHeadR = new Rectangle(0, 0, 0, 0);
        if ((rowHead != null) && (rowHead.isVisible())) {
            int rowHeadWidth = rowHead.getPreferredSize().width;
            if (upperLeft != null && upperLeft.isVisible()) {
                rowHeadWidth = Math.max(rowHeadWidth, upperLeft.getPreferredSize().width);
            }
            if (lowerLeft != null && lowerLeft.isVisible()) {
                rowHeadWidth = Math.max(rowHeadWidth, lowerLeft.getPreferredSize().width);
            }
            rowHeadR.width = rowHeadWidth;
            availR.width -= rowHeadWidth;
            rowHeadR.x = availR.x;
            availR.x += rowHeadWidth;
        }
        Border viewportBorder = scrollPane.getViewportBorder();
        Insets vpbInsets;
        if (viewportBorder != null) {
            vpbInsets = viewportBorder.getBorderInsets(parent);
            availR.x += vpbInsets.left;
            availR.y += vpbInsets.top;
            availR.width -= vpbInsets.left + vpbInsets.right;
            availR.height -= vpbInsets.top + vpbInsets.bottom;
        }
        else {
            vpbInsets = new Insets(0, 0, 0, 0);
        }
        Rectangle rowFootR = new Rectangle(0, 0, 0, 0);
        if ((_rowFoot != null) && (_rowFoot.isVisible())) {
            int rowFootWidth = _rowFoot.getPreferredSize().width;
            if (upperRight != null && upperRight.isVisible()) {
                rowFootWidth = Math.max(rowFootWidth, upperRight.getPreferredSize().width);
            }
            if (lowerRight != null && lowerRight.isVisible()) {
                rowFootWidth = Math.max(rowFootWidth, lowerRight.getPreferredSize().width);
            }
            rowFootR.width = rowFootWidth;
            availR.width -= rowFootWidth;
            rowFootR.x = availR.x + availR.width;
        }
        Rectangle colFootR = new Rectangle(0, availR.y, 0, 0);
        int lowerHeight = getLowerHeight();
        if ((_colFoot != null) && (_colFoot.isVisible())) {
            int colFootHeight = Math.min(availR.height, lowerHeight);
            colFootR.height = colFootHeight;
            availR.height -= colFootHeight;
            colFootR.y = availR.y + availR.height;
        }
        Component view = (viewport != null) ? viewport.getView() : null;
        Dimension viewPrefSize = (view != null) ? view.getPreferredSize() : new Dimension(0, 0);
        Dimension extentSize =
                (viewport != null) ? viewport.toViewCoordinates(availR.getSize())
                        : new Dimension(0, 0);
        boolean viewTracksViewportWidth = false;
        boolean viewTracksViewportHeight = false;
        boolean isEmpty = (availR.width < 0 || availR.height < 0);
        Scrollable sv;
        if (!isEmpty && view instanceof Scrollable) {
            sv = (Scrollable) view;
            viewTracksViewportWidth = sv.getScrollableTracksViewportWidth();
            viewTracksViewportHeight = sv.getScrollableTracksViewportHeight();
        }
        else {
            sv = null;
        }
        Rectangle vsbR = new Rectangle(0, isVsbCoversWholeHeight(scrollPane) ? insets.top : availR.y - vpbInsets.top, 0, 0);
        boolean vsbNeeded;
        if (vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) {
            vsbNeeded = true;
        }
        else if (vsbPolicy == VERTICAL_SCROLLBAR_NEVER) {
            vsbNeeded = false;
        }
        else if (isEmpty) {
            vsbNeeded = false;
        }
        else {
            vsbNeeded = !viewTracksViewportHeight && (viewPrefSize.height > extentSize.height || (rowHead != null && rowHead.getView() != null && rowHead.getView().getPreferredSize().height > extentSize.height));
            if (!vsbNeeded && scrollPane instanceof JideScrollPane && ((JideScrollPane) scrollPane).isKeepCornerVisible() && (_vBottom != null || _vTop != null)) {
                vsbNeeded = true;
            }
        }
        if ((vsb != null) && vsbNeeded) {
            adjustForVSB(true, availR, vsbR, vpbInsets, true);
            extentSize = viewport.toViewCoordinates(availR.getSize());
        }
        Rectangle hsbR = new Rectangle(isHsbCoversWholeWidth(scrollPane) ? insets.left : availR.x - vpbInsets.left, 0, 0, 0);
        boolean hsbNeeded;
        if (hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) {
            hsbNeeded = true;
        }
        else if (hsbPolicy == HORIZONTAL_SCROLLBAR_NEVER) {
            hsbNeeded = false;
        }
        else if (isEmpty) {
            hsbNeeded = false;
        }
        else {
            hsbNeeded = !viewTracksViewportWidth && (viewPrefSize.width > extentSize.width || (colHead != null && colHead.getView() != null && colHead.getView().getPreferredSize().width > extentSize.width));
            if (!hsbNeeded && scrollPane instanceof JideScrollPane && ((JideScrollPane) scrollPane).isKeepCornerVisible() && (_hLeft != null || _hRight != null)) {
                hsbNeeded = true;
            }
        }
        if ((hsb != null) && hsbNeeded) {
            adjustForHSB(true, availR, hsbR, vpbInsets);
            if ((vsb != null) && !vsbNeeded &&
                    (vsbPolicy != VERTICAL_SCROLLBAR_NEVER)) {
                extentSize = viewport.toViewCoordinates(availR.getSize());
                vsbNeeded = viewPrefSize.height > extentSize.height;
                if (!vsbNeeded && scrollPane instanceof JideScrollPane && ((JideScrollPane) scrollPane).isKeepCornerVisible() && (_vBottom != null || _vTop != null)) {
                    vsbNeeded = true;
                }
                if (vsbNeeded) {
                    adjustForVSB(true, availR, vsbR, vpbInsets, true);
                }
            }
        }
        boolean ltr = scrollPane.getComponentOrientation().isLeftToRight();
        if (viewport != null) {
            viewport.setBounds(adjustBounds(parent, availR, ltr));
            if (sv != null) {
                extentSize = viewport.toViewCoordinates(availR.getSize());
                boolean oldHSBNeeded = hsbNeeded;
                boolean oldVSBNeeded = vsbNeeded;
                viewTracksViewportWidth = sv.getScrollableTracksViewportWidth();
                viewTracksViewportHeight = sv.getScrollableTracksViewportHeight();
                if (vsb != null && vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED) {
                    boolean newVSBNeeded = !viewTracksViewportHeight && (viewPrefSize.height > extentSize.height || (rowHead != null && rowHead.getView() != null && rowHead.getView().getPreferredSize().height > extentSize.height));
                    if (!newVSBNeeded && scrollPane instanceof JideScrollPane && ((JideScrollPane) scrollPane).isKeepCornerVisible() && (_vBottom != null || _vTop != null)) {
                        newVSBNeeded = true;
                    }
                    if (newVSBNeeded != vsbNeeded) {
                        vsbNeeded = newVSBNeeded;
                        adjustForVSB(vsbNeeded, availR, vsbR, vpbInsets, true);
                        extentSize = viewport.toViewCoordinates
                                (availR.getSize());
                    }
                }
                if (hsb != null && hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED) {
                    boolean newHSBbNeeded = !viewTracksViewportWidth && (viewPrefSize.width > extentSize.width || (colHead != null && colHead.getView() != null && colHead.getView().getPreferredSize().width > extentSize.width));
                    if (!newHSBbNeeded && scrollPane instanceof JideScrollPane && ((JideScrollPane) scrollPane).isKeepCornerVisible() && (_hLeft != null || _hRight != null)) {
                        newHSBbNeeded = true;
                    }
                    if (newHSBbNeeded != hsbNeeded) {
                        hsbNeeded = newHSBbNeeded;
                        adjustForHSB(hsbNeeded, availR, hsbR, vpbInsets);
                        if ((vsb != null) && !vsbNeeded &&
                                (vsbPolicy != VERTICAL_SCROLLBAR_NEVER)) {
                            extentSize = viewport.toViewCoordinates
                                    (availR.getSize());
                            vsbNeeded = viewPrefSize.height >
                                    extentSize.height;
                            if (!vsbNeeded && scrollPane instanceof JideScrollPane && ((JideScrollPane) scrollPane).isKeepCornerVisible() && (_vBottom != null || _vTop != null)) {
                                vsbNeeded = true;
                            }
                            if (vsbNeeded) {
                                adjustForVSB(true, availR, vsbR, vpbInsets, true);
                            }
                        }
                        if (_rowFoot != null && _rowFoot.isVisible()) {
                            vsbR.x += rowFootR.width;
                        }
                    }
                }
                if (oldHSBNeeded != hsbNeeded ||
                        oldVSBNeeded != vsbNeeded) {
                    viewport.setBounds(adjustBounds(parent, availR, ltr));
                }
            }
        }
        vsbR.height = isVsbCoversWholeHeight(scrollPane) ? scrollPane.getHeight() - insets.bottom - insets.top : availR.height + vpbInsets.top + vpbInsets.bottom;
        hsbR.width = isHsbCoversWholeWidth(scrollPane) ? scrollPane.getWidth() - vsbR.width - insets.left - insets.right : availR.width + vpbInsets.left + vpbInsets.right;
        rowHeadR.height = availR.height + vpbInsets.top + vpbInsets.bottom;
        rowHeadR.y = availR.y - vpbInsets.top;
        colHeadR.width = availR.width + vpbInsets.left + vpbInsets.right;
        colHeadR.x = availR.x - vpbInsets.left;
        subColHeadR.width = colHeadR.width;
        subColHeadR.x = colHeadR.x;
        colFootR.x = availR.x;
        colFootR.y = rowHeadR.y + rowHeadR.height;
        colFootR.width = availR.width;
        rowFootR.x = availR.x + availR.width;
        rowFootR.y = availR.y;
        rowFootR.height = availR.height;
        vsbR.x += rowFootR.width;
        hsbR.y += colFootR.height;
        if (rowHead != null) {
            rowHead.setBounds(adjustBounds(parent, rowHeadR, ltr));
        }
        if (_rowFoot != null) {
            _rowFoot.setBounds(adjustBounds(parent, rowFootR, ltr));
        }
        int columnHeaderHeight = isColumnHeadersHeightUnified(scrollPane) ? Math.max(colHeadR.height,
                Math.max(upperLeft == null ? 0 : upperLeft.getPreferredSize().height, upperRight == null ? 0 : upperRight.getPreferredSize().height)) : 0;
        int columnFooterHeight = isColumnFootersHeightUnified(scrollPane) ? Math.max(colFootR.height,
                Math.max(lowerLeft == null ? 0 : lowerLeft.getPreferredSize().height, lowerRight == null ? 0 : lowerRight.getPreferredSize().height)) : 0;
        if (colHead != null) {
            int height = isColumnHeadersHeightUnified(scrollPane) ? columnHeaderHeight : Math.min(colHeadR.height, colHead.getPreferredSize().height);
            colHead.setBounds(adjustBounds(parent, new Rectangle(colHeadR.x, colHeadR.y + colHeadR.height - height, colHeadR.width, height), ltr));
        }
        if (_subColHead != null) {
            _subColHead.setBounds(adjustBounds(parent, subColHeadR, ltr));
        }
        if (_colFoot != null) {
            int height = isColumnFootersHeightUnified(scrollPane) ? columnFooterHeight : Math.min(colFootR.height, _colFoot.getPreferredSize().height);
            _colFoot.setBounds(adjustBounds(parent, new Rectangle(colFootR.x, colFootR.y, colFootR.width, height), ltr));
        }
        else {
            if (isColumnFootersHeightUnified(scrollPane)) {
                columnFooterHeight = hsbR.height;
            }
        }
        if (vsb != null) {
            if (vsbNeeded) {
                vsb.setVisible(true);
                if (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && !isEmpty && !(!viewTracksViewportHeight && (viewPrefSize.height > extentSize.height || (rowHead != null && rowHead.getView() != null && rowHead.getView().getPreferredSize().height > extentSize.height)))) {
                    vsb.setVisible(false);
                }
                if (_vTop == null && _vBottom == null)
                    vsb.setBounds(adjustBounds(parent, vsbR, ltr));
                else {
                    Rectangle rect = new Rectangle(vsbR);
                    if (_vTop != null) {
                        Dimension dim = _vTop.getPreferredSize();
                        rect.y += dim.height;
                        rect.height -= dim.height;
                        _vTop.setVisible(true);
                        _vTop.setBounds(adjustBounds(parent, new Rectangle(vsbR.x, vsbR.y, vsbR.width, dim.height), ltr));
                    }
                    if (_vBottom != null) {
                        Dimension dim = _vBottom.getPreferredSize();
                        rect.height -= dim.height;
                        _vBottom.setVisible(true);
                        _vBottom.setBounds(adjustBounds(parent, new Rectangle(vsbR.x, vsbR.y + vsbR.height - dim.height, vsbR.width, dim.height), ltr));
                    }
                    vsb.setBounds(adjustBounds(parent, rect, ltr));
                }
            }
            else {
                if (viewPrefSize.height > extentSize.height) {
                    vsb.setVisible(true);
                    vsb.setBounds(adjustBounds(parent, new Rectangle(vsbR.x, vsbR.y, 0, vsbR.height), ltr));
                }
                else {
                    vsb.setVisible(false);
                }
                if (_vTop != null)
                    _vTop.setVisible(false);
                if (_vBottom != null)
                    _vBottom.setVisible(false);
            }
        }
        if (hsb != null) {
            if (hsbNeeded) {
                hsb.setVisible(true);
                if (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && !isEmpty && !(!viewTracksViewportWidth && (viewPrefSize.width > extentSize.width || (colHead != null && colHead.getView() != null && colHead.getView().getPreferredSize().width > extentSize.width)))) {
                    hsb.setVisible(false);
                }
                if (_hLeft == null && _hRight == null)
                    hsb.setBounds(adjustBounds(parent, hsbR, ltr));
                else {
                    Rectangle rect = new Rectangle(hsbR);
                    if (_hLeft != null) {
                        Dimension dim = _hLeft.getPreferredSize();
                        rect.x += dim.width;
                        rect.width -= dim.width;
                        _hLeft.setVisible(true);
                        _hLeft.setBounds(adjustBounds(parent, new Rectangle(hsbR.x, hsbR.y, dim.width, hsbR.height), ltr));
                        _hLeft.doLayout();
                    }
                    if (_hRight != null) {
                        Dimension dim = _hRight.getPreferredSize();
                        rect.width -= dim.width;
                        _hRight.setVisible(true);
                        _hRight.setBounds(adjustBounds(parent, new Rectangle(hsbR.x + hsbR.width - dim.width, hsbR.y, dim.width, hsbR.height), ltr));
                    }
                    hsb.setBounds(adjustBounds(parent, rect, ltr));
                }
            }
            else {
                if (viewPrefSize.width > extentSize.width) {
                    hsb.setVisible(true);
                    hsb.setBounds(adjustBounds(parent, new Rectangle(hsbR.x, hsbR.y, hsbR.width, 0), ltr));
                }
                else {
                    hsb.setVisible(false);
                }
                if (_hLeft != null)
                    _hLeft.setVisible(false);
                if (_hRight != null)
                    _hRight.setVisible(false);
            }
        }
        if (lowerLeft != null && lowerLeft.isVisible()) {
            int height = isColumnFootersHeightUnified(scrollPane) ? columnFooterHeight : Math.min(lowerLeft.getPreferredSize().height, colFootR.height);
            lowerLeft.setBounds(adjustBounds(parent, new Rectangle(rowHeadR.x, colFootR.y != 0 ? colFootR.y : hsbR.y, rowHeadR.width, height), ltr));
        }
        if (lowerRight != null && lowerRight.isVisible()) {
            int height = isColumnFootersHeightUnified(scrollPane) ? columnFooterHeight : Math.min(lowerRight.getPreferredSize().height, colFootR.height);
            lowerRight.setBounds(adjustBounds(parent, new Rectangle(rowFootR.x, colFootR.y != 0 ? colFootR.y : hsbR.y, rowFootR.width, height), ltr));
        }
        if (upperLeft != null && upperLeft.isVisible()) {
            int height = isColumnHeadersHeightUnified(scrollPane) ? columnHeaderHeight : Math.min(upperLeft.getPreferredSize().height, colHeadR.height);
            upperLeft.setBounds(adjustBounds(parent, new Rectangle(rowHeadR.x, colHeadR.y + colHeadR.height - height, rowHeadR.width, height), ltr));
        }
        if (upperRight != null && upperRight.isVisible()) {
            int height = isColumnHeadersHeightUnified(scrollPane) ? columnHeaderHeight : Math.min(upperRight.getPreferredSize().height, colHeadR.height);
            upperRight.setBounds(adjustBounds(parent, new Rectangle(rowFootR.x, colHeadR.y + colHeadR.height - height, rowFootR.width, height), ltr));
        }
    }


Input:
    public void createIndex(final Request request, final Listener userListener) {
        clusterService.submitStateUpdateTask("create-index [" + request.index + "], cause [" + request.cause + "]", new ClusterStateUpdateTask() {
            @Override public ClusterState execute(ClusterState currentState) {
                final CreateIndexListener listener = new CreateIndexListener(request, userListener);
                try {
                    if (currentState.routingTable().hasIndex(request.index)) {
                        listener.onFailure(new IndexAlreadyExistsException(new Index(request.index)));
                        return currentState;
                    }
                    if (currentState.metaData().hasIndex(request.index)) {
                        listener.onFailure(new IndexAlreadyExistsException(new Index(request.index)));
                        return currentState;
                    }
                    if (request.index.contains(" ")) {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "must not contain whitespace"));
                        return currentState;
                    }
                    if (request.index.contains(",")) {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "must not contain ',"));
                        return currentState;
                    }
                    if (request.index.contains("#")) {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "must not contain '#"));
                        return currentState;
                    }
                    if (request.index.charAt(0) == '_') {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "must not start with '_'"));
                        return currentState;
                    }
                    if (!request.index.toLowerCase().equals(request.index)) {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "must be lowercase"));
                        return currentState;
                    }
                    if (!Strings.validFileName(request.index)) {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "must not contain the following characters " + Strings.INVALID_FILENAME_CHARS));
                        return currentState;
                    }
                    if (currentState.metaData().aliases().contains(request.index)) {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "an alias with the same name already exists"));
                        return currentState;
                    }
                    Map<String, String> mappings = Maps.newHashMap();
                    File mappingsDir = new File(environment.configFile(), "mappings");
                    if (mappingsDir.exists() && mappingsDir.isDirectory()) {
                        File defaultMappingsDir = new File(mappingsDir, "_default");
                        if (mappingsDir.exists() && mappingsDir.isDirectory()) {
                            addMappings(mappings, defaultMappingsDir);
                        }
                        File indexMappingsDir = new File(mappingsDir, request.index);
                        if (mappingsDir.exists() && mappingsDir.isDirectory()) {
                            addMappings(mappings, indexMappingsDir);
                        }
                    }
                    mappings.putAll(request.mappings);
                    ImmutableSettings.Builder indexSettingsBuilder = settingsBuilder().put(request.settings);
                    if (request.settings.get(SETTING_NUMBER_OF_SHARDS) == null) {
                        indexSettingsBuilder.put(SETTING_NUMBER_OF_SHARDS, settings.getAsInt(SETTING_NUMBER_OF_SHARDS, 5));
                    }
                    if (request.settings.get(SETTING_NUMBER_OF_REPLICAS) == null) {
                        indexSettingsBuilder.put(SETTING_NUMBER_OF_REPLICAS, settings.getAsInt(SETTING_NUMBER_OF_REPLICAS, 1));
                    }
                    Settings actualIndexSettings = indexSettingsBuilder.build();
                    IndexMetaData.Builder indexMetaData = newIndexMetaDataBuilder(request.index).settings(actualIndexSettings);
                    for (Map.Entry<String, String> entry : mappings.entrySet()) {
                        indexMetaData.putMapping(entry.getKey(), entry.getValue());
                    }
                    MetaData newMetaData = newMetaDataBuilder()
                            .metaData(currentState.metaData())
                            .put(indexMetaData)
                            .build();
                    logger.info("[{}] creating index, cause [{}], shards [{}]/[{}], mappings {}", request.index, request.cause, indexMetaData.numberOfShards(), indexMetaData.numberOfReplicas(), mappings.keySet());
                    final AtomicInteger counter = new AtomicInteger(currentState.nodes().size());
                    final NodeIndexCreatedAction.Listener nodeIndexCreateListener = new NodeIndexCreatedAction.Listener() {
                        @Override public void onNodeIndexCreated(String index, String nodeId) {
                            if (index.equals(request.index)) {
                                if (counter.decrementAndGet() == 0) {
                                    listener.onResponse(new Response(true));
                                    nodeIndexCreatedAction.remove(this);
                                }
                            }
                        }
                    };
                    nodeIndexCreatedAction.add(nodeIndexCreateListener);
                    Timeout timeoutTask = timerService.newTimeout(new TimerTask() {
                        @Override public void run(Timeout timeout) throws Exception {
                            listener.onResponse(new Response(false));
                            nodeIndexCreatedAction.remove(nodeIndexCreateListener);
                        }
                    }, request.timeout, TimerService.ExecutionType.THREADED);
                    listener.timeout = timeoutTask;
                    return newClusterStateBuilder().state(currentState).metaData(newMetaData).build();
                } catch (Exception e) {
                    listener.onFailure(e);
                    return currentState;
                }
            }
        });
    }

Output:
    public void createIndex(final Request request, final Listener userListener) {
        clusterService.submitStateUpdateTask("create-index [" + request.index + "], cause [" + request.cause + "]", new ClusterStateUpdateTask() {
            @Override public ClusterState execute(ClusterState currentState) {
                final CreateIndexListener listener = new CreateIndexListener(request, userListener);
                try {
                    if (currentState.routingTable().hasIndex(request.index)) {
                        listener.onFailure(new IndexAlreadyExistsException(new Index(request.index)));
                        return currentState;
                    }
                    if (currentState.metaData().hasIndex(request.index)) {
                        listener.onFailure(new IndexAlreadyExistsException(new Index(request.index)));
                        return currentState;
                    }
                    if (request.index.contains(" ")) {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "must not contain whitespace"));
                        return currentState;
                    }
                    if (request.index.contains(",")) {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "must not contain ',"));
                        return currentState;
                    }
                    if (request.index.contains("#")) {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "must not contain '#"));
                        return currentState;
                    }
                    if (request.index.charAt(0) == '_') {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "must not start with '_'"));
                        return currentState;
                    }
                    if (!request.index.toLowerCase().equals(request.index)) {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "must be lowercase"));
                        return currentState;
                    }
                    if (!Strings.validFileName(request.index)) {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "must not contain the following characters " + Strings.INVALID_FILENAME_CHARS));
                        return currentState;
                    }
                    if (currentState.metaData().aliases().contains(request.index)) {
                        listener.onFailure(new InvalidIndexNameException(new Index(request.index), request.index, "an alias with the same name already exists"));
                        return currentState;
                    }
                    Map<String, String> mappings = Maps.newHashMap();
                    File mappingsDir = new File(environment.configFile(), "mappings");
                    if (mappingsDir.exists() && mappingsDir.isDirectory()) {
                        File defaultMappingsDir = new File(mappingsDir, "_default");
                        if (defaultMappingsDir.exists() && defaultMappingsDir.isDirectory()) {
                            addMappings(mappings, defaultMappingsDir);
                        }
                        File indexMappingsDir = new File(mappingsDir, request.index);
                        if (indexMappingsDir.exists() && indexMappingsDir.isDirectory()) {
                            addMappings(mappings, indexMappingsDir);
                        }
                    }
                    mappings.putAll(request.mappings);
                    ImmutableSettings.Builder indexSettingsBuilder = settingsBuilder().put(request.settings);
                    if (request.settings.get(SETTING_NUMBER_OF_SHARDS) == null) {
                        indexSettingsBuilder.put(SETTING_NUMBER_OF_SHARDS, settings.getAsInt(SETTING_NUMBER_OF_SHARDS, 5));
                    }
                    if (request.settings.get(SETTING_NUMBER_OF_REPLICAS) == null) {
                        indexSettingsBuilder.put(SETTING_NUMBER_OF_REPLICAS, settings.getAsInt(SETTING_NUMBER_OF_REPLICAS, 1));
                    }
                    Settings actualIndexSettings = indexSettingsBuilder.build();
                    IndexMetaData.Builder indexMetaData = newIndexMetaDataBuilder(request.index).settings(actualIndexSettings);
                    for (Map.Entry<String, String> entry : mappings.entrySet()) {
                        indexMetaData.putMapping(entry.getKey(), entry.getValue());
                    }
                    MetaData newMetaData = newMetaDataBuilder()
                            .metaData(currentState.metaData())
                            .put(indexMetaData)
                            .build();
                    logger.info("[{}] creating index, cause [{}], shards [{}]/[{}], mappings {}", request.index, request.cause, indexMetaData.numberOfShards(), indexMetaData.numberOfReplicas(), mappings.keySet());
                    final AtomicInteger counter = new AtomicInteger(currentState.nodes().size());
                    final NodeIndexCreatedAction.Listener nodeIndexCreateListener = new NodeIndexCreatedAction.Listener() {
                        @Override public void onNodeIndexCreated(String index, String nodeId) {
                            if (index.equals(request.index)) {
                                if (counter.decrementAndGet() == 0) {
                                    listener.onResponse(new Response(true));
                                    nodeIndexCreatedAction.remove(this);
                                }
                            }
                        }
                    };
                    nodeIndexCreatedAction.add(nodeIndexCreateListener);
                    Timeout timeoutTask = timerService.newTimeout(new TimerTask() {
                        @Override public void run(Timeout timeout) throws Exception {
                            listener.onResponse(new Response(false));
                            nodeIndexCreatedAction.remove(nodeIndexCreateListener);
                        }
                    }, request.timeout, TimerService.ExecutionType.THREADED);
                    listener.timeout = timeoutTask;
                    return newClusterStateBuilder().state(currentState).metaData(newMetaData).build();
                } catch (Exception e) {
                    listener.onFailure(e);
                    return currentState;
                }
            }
        });
    }


Input:
	protected Composite createHeaderControls(Composite composite, FormToolkit toolkit) {
		headerComposite = toolkit.createComposite(composite);
		GridLayout layout = new GridLayout(1, false);
		layout.verticalSpacing = 1;
		layout.marginHeight = 1;
		layout.marginWidth = 0;
		layout.marginBottom = 10;
		headerComposite.setLayout(layout);
		createLabel(headerComposite, toolkit, Messages.TaskPlanningEditor_Status, 0);
		statusCombo = new CCombo(headerComposite, SWT.FLAT | SWT.READ_ONLY);
		toolkit.adapt(statusCombo, true, true);
		statusCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
		statusCombo.add(Messages.TaskPlanningEditor_Complete);
		statusCombo.add(Messages.TaskPlanningEditor_Incomplete);
		if (getTask().isCompleted()) {
			statusCombo.select(0);
		} else {
			statusCombo.select(1);
		}
		statusCombo.setEnabled(getTask() instanceof LocalTask);
		statusCombo.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				markDirty();
			}
		});
		Composite spacer = toolkit.createComposite(headerComposite, SWT.NONE);
		GridDataFactory.fillDefaults().hint(0, 10).grab(true, false).applyTo(spacer);
		createLabel(headerComposite, toolkit, Messages.TaskPlanningEditor_Created, 0);
		creationDateText = toolkit.createText(headerComposite, getDateString(getTask().getCreationDate()), SWT.FLAT
				| SWT.READ_ONLY);
		creationDateText.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
		createLabel(headerComposite, toolkit, Messages.TaskPlanningEditor_Completed, EditorUtil.HEADER_COLUMN_MARGIN);
		completionDateText = toolkit.createText(headerComposite, getDateString(getTask().getCompletionDate()), SWT.FLAT
				| SWT.READ_ONLY);
		completionDateText.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
		layout.numColumns = headerComposite.getChildren().length;
		toolkit.paintBordersFor(headerComposite);
		return headerComposite;
	}

Output:
	protected Composite createHeaderControls(Composite composite, FormToolkit toolkit) {
		headerComposite = toolkit.createComposite(composite);
		GridLayout layout = new GridLayout(1, false);
		layout.verticalSpacing = 1;
		layout.marginHeight = 1;
		layout.marginWidth = 0;
		layout.marginBottom = 10;
		headerComposite.setLayout(layout);
		createLabel(headerComposite, toolkit, Messages.TaskPlanningEditor_Status, 0);
		statusCombo = new CCombo(headerComposite, SWT.FLAT | SWT.READ_ONLY);
		toolkit.adapt(statusCombo, true, true);
		statusCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
		statusCombo.add(Messages.TaskPlanningEditor_Complete);
		statusCombo.add(Messages.TaskPlanningEditor_Incomplete);
		if (getTask().isCompleted()) {
			statusCombo.select(0);
		} else {
			statusCombo.select(1);
		}
		statusCombo.setEnabled(getTask() instanceof LocalTask);
		statusCombo.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				markDirty();
			}
		});
		Composite spacer = toolkit.createComposite(headerComposite, SWT.NONE);
		GridDataFactory.fillDefaults().hint(0, 10).grab(true, false).applyTo(spacer);
		createLabel(headerComposite, toolkit, Messages.TaskPlanningEditor_Created, 0);
		creationDateText = new Text(headerComposite, SWT.FLAT | SWT.READ_ONLY);
		toolkit.adapt(creationDateText, false, false);
		creationDateText.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
		createLabel(headerComposite, toolkit, Messages.TaskPlanningEditor_Completed, EditorUtil.HEADER_COLUMN_MARGIN);
		completionDateText = new Text(headerComposite, SWT.FLAT | SWT.READ_ONLY);
		toolkit.adapt(completionDateText, false, false);
		completionDateText.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
		layout.numColumns = headerComposite.getChildren().length;
		toolkit.paintBordersFor(headerComposite);
		return headerComposite;
	}


Input:
	public void importTag() throws ServiceException {
		try {
			this.session = this.getInfrastructure().getSession();
			TagDataImportRepositoryInterface imp_repo = this
					.getDomainsDirectory().getDataImportDomain()
					.getTagDataImportRepository();
			LedgerRepositoryInterface ledger_repo = this.getDomainsDirectory()
					.getLedgerDomain().getLedgerRepository();
			List<DataImportTag> dataforimp = imp_repo
					.findNotProcessesDataImportTags();
			int imported = 0;
			Transaction imp_tx1 = null;
			for (int i = 0; i < dataforimp.size(); i++) {
				DataImportTag rawdata = dataforimp.get(i);
				try {
					imp_tx1 = null;
					String id = ledger_repo.getNextSeqId("Enumeration");
					Enumeration enumeration = new Enumeration();
					if (rawdata.getSequenceNum() != null) {
						List<EnumerationType> types = ledger_repo.findList(
								EnumerationType.class, ledger_repo.map(
										EnumerationType.Fields.enumTypeId,
										rawdata.getType()));
						List<Enumeration> enums1 = ledger_repo.findList(
								Enumeration.class, ledger_repo.map(
										Enumeration.Fields.sequenceId, rawdata
												.getSequenceNum(),
										Enumeration.Fields.enumTypeId, types
												.get(0).getEnumTypeId()));
						if (enums1.isEmpty()) {
							Debug.log("Registro Nuevo");
							enumeration.setEnumId(id);
						} else {
							enumeration.setEnumId(enums1.get(0).getEnumId());
						}
						enumeration.setEnumTypeId(types.get(0).getEnumTypeId());
						enumeration.setSequenceId(rawdata.getSequenceNum());
						enumeration.setEnumCode(rawdata.getName());
						enumeration.setFechaInicio(rawdata.getFechaInicio());
						enumeration.setFechaFin(rawdata.getFechaFin());
						enumeration.setDescription(rawdata.getDescription());
						enumeration.setNivelId(rawdata.getNivel());
						enumeration.setNode(rawdata.getNode());
						imp_tx1 = this.session.beginTransaction();
						ledger_repo.createOrUpdate(enumeration);
						imp_tx1.commit();
					}
					String message = "Successfully imported Tag ["
							+ rawdata.getId() + "].";
					this.storeImportTagSuccess(rawdata, imp_repo);
					Debug.logInfo(message, MODULE);
					imported = imported + 1;
				} catch (Exception ex) {
					String message = "Failed to import Tag [" + rawdata.getId()
							+ "], Error message : " + ex.getMessage();
					storeImportTagError(rawdata, message, imp_repo);
					if (imp_tx1 != null) {
						imp_tx1.rollback();
					}
					Debug.logError(ex, message, MODULE);
					throw new ServiceException(ex.getMessage());
				}
			}
			getParentEnumeration(ledger_repo, dataforimp);
			this.importedRecords = imported;
		} catch (InfrastructureException ex) {
			Debug.logError(ex, MODULE);
			throw new ServiceException(ex.getMessage());
		} catch (RepositoryException ex) {
			Debug.logError(ex, MODULE);
			throw new ServiceException(ex.getMessage());
		} finally {
			if (session != null) {
				session.close();
			}
		}
	}

Output:
	public void importTag() throws ServiceException {
		try {
			this.session = this.getInfrastructure().getSession();
			TagDataImportRepositoryInterface imp_repo = this
					.getDomainsDirectory().getDataImportDomain()
					.getTagDataImportRepository();
			LedgerRepositoryInterface ledger_repo = this.getDomainsDirectory()
					.getLedgerDomain().getLedgerRepository();
			List<DataImportTag> dataforimp = imp_repo
					.findNotProcessesDataImportTags();
			int imported = 0;
			Transaction imp_tx1 = null;
			for (int i = 0; i < dataforimp.size(); i++) {
				DataImportTag rawdata = dataforimp.get(i);
				try {
					imp_tx1 = null;
					String id = ledger_repo.getNextSeqId("Enumeration");
					Enumeration enumeration = new Enumeration();
					if (rawdata.getSequenceNum() != null) {
						List<EnumerationType> types = ledger_repo.findList(
								EnumerationType.class, ledger_repo.map(
										EnumerationType.Fields.enumTypeId,
										rawdata.getType()));
						List<Enumeration> enums1 = ledger_repo.findList(
								Enumeration.class, ledger_repo.map(
										Enumeration.Fields.sequenceId, rawdata
												.getSequenceNum(),
										Enumeration.Fields.enumTypeId, types
												.get(0).getEnumTypeId()));
						if (enums1.isEmpty()) {
							Debug.log("Registro Nuevo");
							enumeration.setEnumId(id);
						} else {
							enumeration.setEnumId(enums1.get(0).getEnumId());
						}
						enumeration.setEnumTypeId(types.get(0).getEnumTypeId());
						enumeration.setSequenceId(rawdata.getSequenceNum());
						enumeration.setEnumCode(rawdata.getName());
						enumeration.setFechaInicio(rawdata.getFechaInicio());
						enumeration.setFechaFin(rawdata.getFechaFin());
						enumeration.setDescription(rawdata.getDescription());
						enumeration.setNivelId(rawdata.getNivel());
						enumeration.setNode(rawdata.getNode());
						imp_tx1 = this.session.beginTransaction();
						ledger_repo.createOrUpdate(enumeration);
						imp_tx1.commit();
					}
					String message = "Successfully imported Tag ["
							+ rawdata.getId() + "].";
					this.storeImportTagSuccess(rawdata, imp_repo);
					Debug.logInfo(message, MODULE);
					imported = imported + 1;
				} catch (Exception ex) {
					String message = "Failed to import Tag [" + rawdata.getId()
							+ "], Error message : " + ex.getMessage();
					storeImportTagError(rawdata, message, imp_repo);
					if (imp_tx1 != null) {
						imp_tx1.rollback();
					}
					Debug.logError(ex, message, MODULE);
					throw new ServiceException(ex.getMessage());
				}
			}
			getParentEnumeration(ledger_repo, dataforimp, imp_repo);
			this.importedRecords = imported;
		} catch (InfrastructureException ex) {
			Debug.logError(ex, MODULE);
			throw new ServiceException(ex.getMessage());
		} catch (RepositoryException ex) {
			Debug.logError(ex, MODULE);
			throw new ServiceException(ex.getMessage());
		} finally {
			if (session != null) {
				session.close();
			}
		}
	}


Input:
    public Object parse(ParsingEngine parsingEngine, ArgumentSource source, Type type, ArgumentMatches matches) {
        ArgumentDefinition defaultDefinition = createDefaultArgumentDefinition(source);
        String value = getArgumentValue( defaultDefinition, matches );
        Class<? extends Feature> parameterType = JVMUtils.getParameterizedTypeClass(type);
        try {
            String name = defaultDefinition.fullName;
            String tribbleType = null;
            Tags tags = getArgumentTags(matches);
            if ( tags.getPositionalTags().size() > 2 ) {
                throw new UserException.CommandLineException(
                        String.format("Unexpected number of positional tags for argument %s : %s. " +
                                "Rod bindings only suport -X:type and -X:name,type argument styles",
                                value, source.field.getName()));
            } if ( tags.getPositionalTags().size() == 2 ) {
                name = tags.getPositionalTags().get(0);
                tribbleType = tags.getPositionalTags().get(1);
            } else {
                FeatureManager manager = new FeatureManager();
                String tag1 = tags.getPositionalTags().size() == 1 ? tags.getPositionalTags().get(0) : null;
                if ( tag1 != null ) {
                    if ( manager.getByName(tag1) != null )
                        tribbleType = tag1;
                    else
                        name = tag1;
                }
                if ( tribbleType == null ) {
                    File file = new File(value);
                    if ( file.canRead() && file.isFile() ) {
                        FeatureManager.FeatureDescriptor featureDescriptor = manager.getByFiletype(file);
                        if ( featureDescriptor != null ) {
                            tribbleType = featureDescriptor.getName();
                            logger.info("Dynamically determined type of " + file + " to be " + tribbleType);
                        }
                    }
                    if ( tribbleType == null )
                        if ( ! file.canRead() | !! file.isFile() ) {
                            throw new UserException.BadArgumentValue(name, "Couldn't read file to determine type: " + file);
                        } else {
                            throw new UserException.CommandLineException(
                                    String.format("No tribble type was provided on the command line and the type of the file could not be determined dynamically. " +
                                            "Please add an explicit type tag :NAME listing the correct type from among the supported types:%n%s",
                                            manager.userFriendlyListOfAvailableFeatures(parameterType)));
                        }
                }
            }
            Constructor ctor = (makeRawTypeIfNecessary(type)).getConstructor(Class.class, String.class, String.class, String.class, Tags.class);
            RodBinding result = (RodBinding)ctor.newInstance(parameterType, name, value, tribbleType, tags);
            parsingEngine.addTags(result,tags);
            parsingEngine.addRodBinding(result);
            return result;
        } catch (InvocationTargetException e) {
            throw new UserException.CommandLineException(
                    String.format("Failed to parse value %s for argument %s.",
                            value, source.field.getName()));
        } catch (Exception e) {
            throw new UserException.CommandLineException(
                    String.format("Failed to parse value %s for argument %s. Message: %s",
                            value, source.field.getName(), e.getMessage()));
        }
    }

Output:
    public Object parse(ParsingEngine parsingEngine, ArgumentSource source, Type type, ArgumentMatches matches) {
        ArgumentDefinition defaultDefinition = createDefaultArgumentDefinition(source);
        String value = getArgumentValue( defaultDefinition, matches );
        Class<? extends Feature> parameterType = JVMUtils.getParameterizedTypeClass(type);
        try {
            String name = defaultDefinition.fullName;
            String tribbleType = null;
            Tags tags = getArgumentTags(matches);
            if ( tags.getPositionalTags().size() > 2 ) {
                throw new UserException.CommandLineException(
                        String.format("Unexpected number of positional tags for argument %s : %s. " +
                                "Rod bindings only suport -X:type and -X:name,type argument styles",
                                value, source.field.getName()));
            } if ( tags.getPositionalTags().size() == 2 ) {
                name = tags.getPositionalTags().get(0);
                tribbleType = tags.getPositionalTags().get(1);
            } else {
                FeatureManager manager = new FeatureManager();
                String tag1 = tags.getPositionalTags().size() == 1 ? tags.getPositionalTags().get(0) : null;
                if ( tag1 != null ) {
                    if ( manager.getByName(tag1) != null )
                        tribbleType = tag1;
                    else
                        name = tag1;
                }
                if ( tribbleType == null ) {
                    File file = new File(value);
                    if ( file.canRead() && file.isFile() ) {
                        FeatureManager.FeatureDescriptor featureDescriptor = manager.getByFiletype(file);
                        if ( featureDescriptor != null ) {
                            tribbleType = featureDescriptor.getName();
                            logger.info("Dynamically determined type of " + file + " to be " + tribbleType);
                        }
                    }
                    if ( tribbleType == null )
                        if ( ! file.canRead() | ! file.isFile() ) {
                            throw new UserException.BadArgumentValue(name, "Couldn't read file to determine type: " + file);
                        } else {
                            throw new UserException.CommandLineException(
                                    String.format("No tribble type was provided on the command line and the type of the file could not be determined dynamically. " +
                                            "Please add an explicit type tag :NAME listing the correct type from among the supported types:%n%s",
                                            manager.userFriendlyListOfAvailableFeatures(parameterType)));
                        }
                }
            }
            Constructor ctor = (makeRawTypeIfNecessary(type)).getConstructor(Class.class, String.class, String.class, String.class, Tags.class);
            RodBinding result = (RodBinding)ctor.newInstance(parameterType, name, value, tribbleType, tags);
            parsingEngine.addTags(result,tags);
            parsingEngine.addRodBinding(result);
            return result;
        } catch (InvocationTargetException e) {
            throw new UserException.CommandLineException(
                    String.format("Failed to parse value %s for argument %s.",
                            value, source.field.getName()));
        } catch (Exception e) {
            throw new UserException.CommandLineException(
                    String.format("Failed to parse value %s for argument %s. Message: %s",
                            value, source.field.getName(), e.getMessage()));
        }
    }


Input:
    public void handle(final ActionContext actionContext) throws Exception {
	ComponentContainer displayArea = actionContext.getTargetContainer();
	displayArea.removeAllComponents();
	UserActionList ual = (UserActionList) actionContext.getUserAction();
	final OpenGroupsApplication app = actionContext.getApp();
	final Entity entity = actionContext.getEntity();
	final TabSheet actionsTabSheet = new TabSheet();
	actionsTabSheet.addStyleName(Reindeer.TABSHEET_MINIMAL);
	actionsTabSheet.addStyleName(OpenGroupsStyles.USER_ACTIONS_TABSHEET);
	actionsTabSheet.addListener(new SelectedTabChangeListener() {
	    @Override
	    public void selectedTabChange(SelectedTabChangeEvent event) {
		TabSheet tabSheet = event.getTabSheet();
		AbstractComponentContainer selectedTabContent = (AbstractComponentContainer) tabSheet.getSelectedTab();
		UserAction ua = (UserAction) selectedTabContent.getData();
		if (entity != null) {
		    Deque<String> desiredActionsQueue = entity.getState().getDesiredActionTabsQueue();
		    if (desiredActionsQueue.size() != 0) {
			String nextAction = desiredActionsQueue.peek();
			if (nextAction.equals(ua.getActionName())) {
			    desiredActionsQueue.remove();
			} else {
			    return;
			}
		    }
		}
		if (ua instanceof UserActionList) {
		    ua.executeHandler(entity, app, selectedTabContent, false, actionContext);
		} else {
		    if (entity != null) {
			entity.getState().setCurrentTabAction(ua);
			entity.getState().setCurrentTabActionContainer(selectedTabContent);
			entity.getState().setCurrentActionsPath(ua.getFullActionPath());
			actionContext.getWindow().setFragmentToEntity(entity);
		    }
		    ua.executeHandler(entity, app, selectedTabContent, false, actionContext);
		}
	    }
	});
	Map<String, ComponentContainer> actionPathContainers = new HashMap<String, ComponentContainer>();
	List<UserAction> actionsList = new ArrayList<UserAction>(ual.getActions().values());
	for (UserAction cua : actionsList) {
	    if(!cua.isVisible(actionContext)) {
		continue;
	    }
	    CssLayout tabContent = new CssLayout();
	    if (cua instanceof UserActionList) {
	    } else {
		tabContent.setMargin(true);
	    }
	    tabContent.addStyleName(OpenGroupsStyles.USER_ACTION_CONTENT_PANE);
	    actionPathContainers.put(cua.getActionName(), tabContent);
	    tabContent.setData(cua);
	    actionsTabSheet.addTab(tabContent, cua.getDisplayName(), null);
	}
	displayArea.addComponent(actionsTabSheet);
	if (entity != null) {
	    Deque<String> desiredActionsQueue = entity.getState().getDesiredActionTabsQueue();
	    if (desiredActionsQueue.size() != 0) {
		actionsTabSheet.setSelectedTab(actionPathContainers.get(desiredActionsQueue.peek()));
	    }
	}
    }

Output:
    public void handle(final ActionContext actionContext) throws Exception {
	ComponentContainer displayArea = actionContext.getTargetContainer();
	displayArea.removeAllComponents();
	UserActionList ual = (UserActionList) actionContext.getUserAction();
	final OpenGroupsApplication app = actionContext.getApp();
	final Entity entity = actionContext.getEntity();
	final TabSheet actionsTabSheet = new TabSheet();
	actionsTabSheet.addStyleName(Reindeer.TABSHEET_MINIMAL);
	actionsTabSheet.addStyleName(OpenGroupsStyles.USER_ACTIONS_TABSHEET);
	actionsTabSheet.addListener(new SelectedTabChangeListener() {
	    @Override
	    public void selectedTabChange(SelectedTabChangeEvent event) {
		TabSheet tabSheet = event.getTabSheet();
		AbstractComponentContainer selectedTabContent = (AbstractComponentContainer) tabSheet.getSelectedTab();
		UserAction ua = (UserAction) selectedTabContent.getData();
		if (entity != null) {
		    Deque<String> desiredActionsQueue = entity.getState().getDesiredActionTabsQueue();
		    if (desiredActionsQueue.size() != 0) {
			String nextAction = desiredActionsQueue.peek();
			if (nextAction.equals(ua.getActionName())) {
			    desiredActionsQueue.remove();
			} else {
			    return;
			}
		    }
		    else{
			entity.getState().resetPageInfo();
		    }
		}
		if (ua instanceof UserActionList) {
		    ua.executeHandler(entity, app, selectedTabContent, false, actionContext);
		} else {
		    if (entity != null) {
			entity.getState().setCurrentTabAction(ua);
			entity.getState().setCurrentTabActionContainer(selectedTabContent);
			entity.getState().setCurrentActionsPath(ua.getFullActionPath());
			actionContext.getWindow().setFragmentToEntity(entity);
		    }
		    ua.executeHandler(entity, app, selectedTabContent, false, actionContext);
		}
	    }
	});
	Map<String, ComponentContainer> actionPathContainers = new HashMap<String, ComponentContainer>();
	List<UserAction> actionsList = new ArrayList<UserAction>(ual.getActions().values());
	for (UserAction cua : actionsList) {
	    if(!cua.isVisible(actionContext)) {
		continue;
	    }
	    CssLayout tabContent = new CssLayout();
	    if (cua instanceof UserActionList) {
	    } else {
		tabContent.setMargin(true);
	    }
	    tabContent.addStyleName(OpenGroupsStyles.USER_ACTION_CONTENT_PANE);
	    actionPathContainers.put(cua.getActionName(), tabContent);
	    tabContent.setData(cua);
	    actionsTabSheet.addTab(tabContent, cua.getDisplayName(), null);
	}
	displayArea.addComponent(actionsTabSheet);
	if (entity != null) {
	    Deque<String> desiredActionsQueue = entity.getState().getDesiredActionTabsQueue();
	    if (desiredActionsQueue.size() != 0) {
		actionsTabSheet.setSelectedTab(actionPathContainers.get(desiredActionsQueue.peek()));
	    }
	}
    }


Input:
    public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
        final Switchboard sb = (Switchboard) env;
        final serverObjects prop = new serverObjects();
        String table = (post == null) ? null : post.get("table", null);
        if (table != null && !sb.tables.hasHeap(table)) table = null;
        prop.put("showtable", 0);
        if (table == null) return prop;
        boolean showpk = post.containsKey("pk");
        String selectKey = post.containsKey("selectKey") ? post.get("selectKey") : null;
        String selectValue = (selectKey != null && post.containsKey("selectValue")) ? post.get("selectValue") : null;
        ArrayList<String> columns = null;
        try {
            columns = sb.tables.columns(table);
        } catch (IOException e) {
            Log.logException(e);
            columns = new ArrayList<String>();
        }
        String[] row = post.get("row", "").split(",");
        for (int i = 0; i < row.length; i++) {
            if (columns.contains(row[i])) {
                columns.remove(row[i]);
                if (i < columns.size()) columns.add(i, row[i]);
            }
        }
        prop.put("showtable", 1);
        prop.put("showtable_table", table);
        prop.put("showtable_showpk", showpk ? 1 : 0);
        for (int i = 0; i < columns.size(); i++) {
            prop.putHTML("showtable_columns_" + i + "_header", columns.get(i));
        }
        prop.put("showtable_columns", columns.size());
        int maxCount;
        try {
            maxCount = Math.min(1000, sb.tables.size(table));
        } catch (IOException e) {
            Log.logException(e);
            maxCount = 0;
        }
        int count = 0;
        try {
            final Iterator<Tables.Row> plainIterator = sb.tables.iterator(table);
            final Iterator<Tables.Row> mapIterator = sb.tables.orderByPK(plainIterator, maxCount).iterator();
            Tables.Row trow;
            boolean dark = true;
            String cellName, cellValue;
            rowloop: while ((mapIterator.hasNext()) && (count < maxCount)) {
                trow = mapIterator.next();
                if (row == null) continue;
                prop.put("showtable_list_" + count + "_dark", ((dark) ? 1 : 0) ); dark=!dark;
                prop.put("showtable_list_" + count + "_showpk", showpk ? 1 : 0);
                prop.put("showtable_list_" + count + "_showpk_pk", new String(trow.getPK()));
                prop.put("showtable_list_" + count + "_count", count);
                for (int i = 0; i < columns.size(); i++) {
                    cellName = columns.get(i);
                    cellValue = new String(trow.get(cellName));
                    if (selectKey != null && cellName.equals(selectKey) && !cellValue.matches(selectValue)) {
                        continue rowloop;
                    }
                    prop.putHTML("showtable_list_" + count + "_columns_" + i + "_column", cellName);
                    prop.putHTML("showtable_list_" + count + "_columns_" + i + "_cell", cellValue);
                }
                prop.put("showtable_list_" + count + "_columns", columns.size());
                count++;
            }
        } catch (IOException e) {
            Log.logException(e);
        }
        prop.put("showtable_list", count);
        prop.put("showtable_num", count);
        return prop;
    }

Output:
    public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
        final Switchboard sb = (Switchboard) env;
        final serverObjects prop = new serverObjects();
        String table = (post == null) ? null : post.get("table", null);
        if (table != null && !sb.tables.hasHeap(table)) table = null;
        prop.put("showtable", 0);
        if (table == null) return prop;
        boolean showpk = post.containsKey("pk");
        String selectKey = post.containsKey("selectKey") ? post.get("selectKey") : null;
        String selectValue = (selectKey != null && post.containsKey("selectValue")) ? post.get("selectValue") : null;
        ArrayList<String> columns = null;
        try {
            columns = sb.tables.columns(table);
        } catch (IOException e) {
            Log.logException(e);
            columns = new ArrayList<String>();
        }
        String[] row = post.get("row", "").split(",");
        for (int i = 0; i < row.length; i++) {
            if (columns.contains(row[i])) {
                columns.remove(row[i]);
                if (i < columns.size()) columns.add(i, row[i]);
            }
        }
        prop.put("showtable", 1);
        prop.put("showtable_table", table);
        prop.put("showtable_showpk", showpk ? 1 : 0);
        for (int i = 0; i < columns.size(); i++) {
            prop.putHTML("showtable_columns_" + i + "_header", columns.get(i));
        }
        prop.put("showtable_columns", columns.size());
        int maxCount;
        try {
            maxCount = Math.min(1000, sb.tables.size(table));
        } catch (IOException e) {
            Log.logException(e);
            maxCount = 0;
        }
        int count = 0;
        try {
            final Iterator<Tables.Row> plainIterator = sb.tables.iterator(table);
            final Iterator<Tables.Row> mapIterator = sb.tables.orderByPK(plainIterator, maxCount).iterator();
            Tables.Row trow;
            boolean dark = true;
            String cellName, cellValue;
            rowloop: while ((mapIterator.hasNext()) && (count < maxCount)) {
                trow = mapIterator.next();
                if (row == null) continue;
                prop.put("showtable_list_" + count + "_dark", ((dark) ? 1 : 0) ); dark=!dark;
                prop.put("showtable_list_" + count + "_showpk", showpk ? 1 : 0);
                prop.put("showtable_list_" + count + "_showpk_pk", new String(trow.getPK()));
                prop.put("showtable_list_" + count + "_count", count);
                for (int i = 0; i < columns.size(); i++) {
                    cellName = columns.get(i);
                    if (trow.containsKey(cellName)) {
                        cellValue = new String(trow.get(cellName));
                        if (selectKey != null && cellName.equals(selectKey) && !cellValue.matches(selectValue)) continue rowloop;
                    } else {
                        cellValue = "";
                    }
                    prop.putHTML("showtable_list_" + count + "_columns_" + i + "_column", cellName);
                    prop.putHTML("showtable_list_" + count + "_columns_" + i + "_cell", cellValue);
                }
                prop.put("showtable_list_" + count + "_columns", columns.size());
                count++;
            }
        } catch (IOException e) {
            Log.logException(e);
        }
        prop.put("showtable_list", count);
        prop.put("showtable_num", count);
        return prop;
    }


Input:
	public Bitmap doInBackground(Object... params) {
		listener = (KKImageRequestListener) params[0];
		Bitmap bitmap;
		try {
			int readLength;
			cachePath = KKImageManager.getTempImagePath(context, url);
			File cacheFile = new File(cachePath);
			File localFile = null;
			String tempFilePath = context.getCacheDir().getAbsolutePath() + File.separator + "image" + File.separator + hashCode();
			if (localPath != null) {
				localFile = new File(localPath);
			}
			try {
				if (cacheFile.exists()) {
					if (actionType == KKImageManager.ActionType.DOWNLOAD) {
						if (localFile == null || !localFile.exists()) {
							cryptToFile(cachePath, localPath);
						}
						return null;
					} else {
						bitmap = decodeBitmap(cachePath);
						if (bitmap != null) {
							if (localPath != null && saveToLocal && (localFile == null || !localFile.exists())) {
								cryptToFile(cachePath, localPath);
							}
							return bitmap;
						} else {
							removeCacheFile();
						}
					}
				}
				if (localFile != null && localFile.exists()) {
					if (actionType == KKImageManager.ActionType.DOWNLOAD) {
						return null;
					} else {
						cryptToFile(localPath, tempFilePath);
						moveFileTo(tempFilePath, cachePath);
						bitmap = decodeBitmap(cachePath);
						if (bitmap != null) {
							return bitmap;
						} else {
							removeCacheFile();
						}
					}
				}
			} catch (Exception e) {}
			final HttpGet httpget = new HttpGet(url);
			response = httpclient.execute(httpget);
			final InputStream is = response.getEntity().getContent();
			publishProgress(response.getAllHeaders());
			removeCacheFile();
			if (actionType == KKImageManager.ActionType.DOWNLOAD) {
				RandomAccessFile tempFile = new RandomAccessFile(tempFilePath, "rw");
				while ((readLength = is.read(buffer, 0, buffer.length)) != -1) {
					if (cipher != null) {
						buffer = cipher.doFinal(buffer);
					}
					tempFile.write(buffer, 0, readLength);
				}
				tempFile.close();
				moveFileTo(tempFilePath, localPath);
				return null;
			} else {
				RandomAccessFile tempFile;
				try {
					tempFile = new RandomAccessFile(tempFilePath, "rw");
				} catch (IOException e) {
					return BitmapFactory.decodeStream(is);
				}
				try {
					while ((readLength = is.read(buffer, 0, buffer.length)) != -1) {
						tempFile.write(buffer, 0, readLength);
					}
				} catch (IOException e) {
					tempFile.close();
					return null;
				}
				tempFile.close();
				moveFileTo(tempFilePath, cachePath);
				bitmap = decodeBitmap(cachePath);
				if (bitmap != null) {
					if (saveToLocal && localPath != null) {
						cryptToFile(cachePath, localPath);
					}
					return bitmap;
				}
			}
		} catch (final Exception e) {
			isNetworkError = true;
			removeInvalidImageFiles();
		}
		return null;
	}

Output:
	public Bitmap doInBackground(Object... params) {
		listener = (KKImageRequestListener) params[0];
		Bitmap bitmap;
		try {
			int readLength;
			cachePath = KKImageManager.getTempImagePath(context, url);
			File cacheFile = new File(cachePath);
			File localFile = null;
			String tempFilePath = context.getCacheDir().getAbsolutePath() + File.separator + "image" + File.separator + hashCode();
			if (localPath != null) {
				localFile = new File(localPath);
			}
			try {
				if (cacheFile.exists()) {
					if (actionType == KKImageManager.ActionType.DOWNLOAD) {
						if (localFile == null || !localFile.exists()) {
							cryptToFile(cachePath, localPath);
						}
						return null;
					} else {
						bitmap = decodeBitmap(cachePath);
						if (bitmap != null) {
							if (localPath != null && saveToLocal && (localFile == null || !localFile.exists())) {
								cryptToFile(cachePath, localPath);
							}
							return bitmap;
						} else {
							removeCacheFile();
						}
					}
				}
				if (localFile != null && localFile.exists()) {
					if (actionType == KKImageManager.ActionType.DOWNLOAD) {
						return null;
					} else {
						cryptToFile(localPath, tempFilePath);
						moveFileTo(tempFilePath, cachePath);
						bitmap = decodeBitmap(cachePath);
						if (bitmap != null) {
							return bitmap;
						} else {
							removeCacheFile();
						}
					}
				}
			} catch (Exception e) {}
			final HttpGet httpget = new HttpGet(url);
			response = httpclient.execute(httpget);
			final InputStream is = response.getEntity().getContent();
			publishProgress(response.getAllHeaders());
			removeInvalidImageFiles();
			if (actionType == KKImageManager.ActionType.DOWNLOAD) {
				RandomAccessFile tempFile = new RandomAccessFile(tempFilePath, "rw");
				while ((readLength = is.read(buffer, 0, buffer.length)) != -1) {
					if (cipher != null) {
						buffer = cipher.doFinal(buffer);
					}
					tempFile.write(buffer, 0, readLength);
				}
				tempFile.close();
				moveFileTo(tempFilePath, localPath);
				return null;
			} else {
				RandomAccessFile tempFile;
				try {
					tempFile = new RandomAccessFile(tempFilePath, "rw");
				} catch (IOException e) {
					return BitmapFactory.decodeStream(is);
				}
				try {
					while ((readLength = is.read(buffer, 0, buffer.length)) != -1) {
						tempFile.write(buffer, 0, readLength);
					}
				} catch (IOException e) {
					tempFile.close();
					return null;
				}
				tempFile.close();
				moveFileTo(tempFilePath, cachePath);
				bitmap = decodeBitmap(cachePath);
				if (bitmap != null) {
					if (saveToLocal && localPath != null) {
						cryptToFile(cachePath, localPath);
					}
					return bitmap;
				}
			}
		} catch (final Exception e) {
			isNetworkError = true;
			removeInvalidImageFiles();
		}
		return null;
	}


Input:
	public View getView(int position, View convertView, ViewGroup parent) {
	    if (convertView == null) {
	        TextView tv = new TextView(mContext);
            tv.setText(people.get(position));
            tv.setHeight(100);
            tv.setWidth(100);
            tv.setGravity(android.view.Gravity.CENTER);
            return tv;
	    } else {
	        return (TextView) convertView;
	    }
	}

Output:
	public View getView(int position, View convertView, ViewGroup parent) {
	    if (convertView == null) {
	        TextView tv = new TextView(mContext);
	        tv.setText(people.get(position));
	        tv.setHeight(100);
	        tv.setWidth(100);
	        tv.setGravity(android.view.Gravity.CENTER);
	        return tv;
	    } else {
	        return (TextView) convertView;
	    }
	}


Input:
    private void checkAllowance() throws Exception {
		allowanceChecked = true;
		if (mode==null || (!mode.equalsIgnoreCase("add") &&
						   !mode.equalsIgnoreCase("edit") &&
						   !mode.equalsIgnoreCase("delete")) &&
						   !mode.equalsIgnoreCase("edit_positions"))
			throw new Exception("FixedValuesHandler mode unspecified!");
		if (ownerID == null && !mode.equals("delete"))
			throw new Exception("FixedValuesHandler delem_id unspecified!");
		if (ownerType.equals("CH1") || ownerType.equals("CH2"))
			ownerType = "elem";
		if (!ownerType.equals("elem") && !ownerType.equals("attr"))
			throw new Exception("FixedValuesHandler: unknown parent type!");
		if (!ownerType.equals("elem"))
			return;
		DDSearchEngine eng = new DDSearchEngine(conn);
		DataElement elm = eng.getDataElement(ownerID);
		String dtype = elm==null ? "" :
								   elm.getAttributeValueByShortName("Datatype");
		dtype = dtype==null ? "" : dtype.toUpperCase();
		if (prhbDatatypes.contains(dtype.toUpperCase()))
			allowed = false;
    }

Output:
    private void checkAllowance() throws Exception {
		allowanceChecked = true;
		if (mode==null || (!mode.equalsIgnoreCase("add") &&
						   !mode.equalsIgnoreCase("edit") &&
						   !mode.equalsIgnoreCase("delete")) &&
						   !mode.equalsIgnoreCase("edit_positions"))
			throw new Exception("FixedValuesHandler mode unspecified!");
		if (ownerID == null && !mode.equals("delete"))
			throw new Exception("FixedValuesHandler delem_id unspecified!");
		if (ownerType.equals("CH1") || ownerType.equals("CH2"))
			ownerType = "elem";
		if (!ownerType.equals("elem") && !ownerType.equals("attr"))
			throw new Exception("FixedValuesHandler: unknown parent type!");
		if (!ownerType.equals("elem"))
			return;
		DDSearchEngine eng = new DDSearchEngine(conn);
		DataElement elm = eng.getDataElement(ownerID);
		String dtype = elm==null ? "" :
								   elm.getAttributeValueByShortName("Datatype");
		dtype = dtype==null ? "" : dtype.toUpperCase();
		if (prhbDatatypes.contains(dtype.toUpperCase()) && !mode.equalsIgnoreCase("edit"))
			allowed = false;
    }


Input:
    public void dispatch(CommandSender sender, String[] args) {
        if (args.length == 3) {
            String bot = args[1];
            String nick = args[2];
            if (plugin.ircBots.containsKey(bot)) {
                if (plugin.ircBots.containsKey(nick)) {
                    sender.sendMessage(ChatColor.RED + "There is already a bot with that nick!");
                } else {
                    plugin.ircBots.get(bot).changeNick(sender, nick);
                    PurpleBot ircBot = plugin.ircBots.remove(bot);
                    plugin.ircBots.put(nick, ircBot);
                    boolean isConnected = plugin.botConnected.remove(bot);
                    plugin.botConnected.put(nick, isConnected);
                }
            } else {
                sender.sendMessage(plugin.invalidBotName.replace("%BOT%", bot));
            }
        } else {
            sender.sendMessage(ChatColor.WHITE + "Usage: " + ChatColor.GOLD + "/irc nick [bot] [nick]");
        }
    }

Output:
    public void dispatch(CommandSender sender, String[] args) {
        if (args.length == 3) {
            String bot = args[1];
            String nick = args[2];
            if (plugin.ircBots.containsKey(bot)) {
                if (plugin.ircBots.containsKey(nick)) {
                    sender.sendMessage(ChatColor.RED + "There is already a bot with that nick!");
                } else {
                    plugin.ircBots.get(bot).changeNick(sender, nick);
                    PurpleBot ircBot = plugin.ircBots.remove(bot);
                    plugin.ircBots.put(nick, ircBot);
                    boolean isConnected = plugin.botConnected.remove(bot);
                    plugin.botConnected.put(nick, isConnected);
                    plugin.ircBots.get(bot).botNick = nick;
                }
            } else {
                sender.sendMessage(plugin.invalidBotName.replace("%BOT%", bot));
            }
        } else {
            sender.sendMessage(ChatColor.WHITE + "Usage: " + ChatColor.GOLD + "/irc nick [bot] [nick]");
        }
    }


Input:
  public static void main(String[] args) {
    PrintStream out = System.out;
    out.printf("%s%n", "Hello World");
    Calendar today = Calendar.getInstance();
    out.printf("Today's date is: %tm/%td/%tY%n", today, today, today);
    out.printf("The current time is: %tl:%tM %tP%n", today, today, today);
    out.printf("%f/%.2f = %f%n", 2.0, 3.0, (2.0/3.0));
    for (int i = 0; i < 3; i++) {
      out.printf("%5s%5s%5s%n", i, i+1, i+2);
    }
    out.printf("%-10s%s%n", "left", "right");
  }

Output:
  public static void main(String[] args) {
    PrintStream out = System.out;
    out.printf("%s%n", "Hello World");
    Calendar today = Calendar.getInstance();
    out.printf("Today's date is: %tm/%td/%tY%n", today, today, today);
    out.printf("The current time is: %tl:%tM %tp%n", today, today, today);
    out.printf("%f/%.2f = %f%n", 2.0, 3.0, (2.0/3.0));
    for (int i = 0; i < 3; i++) {
      out.printf("%5s%5s%5s%n", i, i+1, i+2);
    }
    out.printf("%-10s%s%n", "left", "right");
  }


Input:
    public LdapContext getLdapContext(String username, String password) throws NamingException {
        if (searchBase == null) {
            throw new IllegalStateException("A search base must be specified.");
        }
        if (url == null) {
            throw new IllegalStateException("An LDAP URL must be specified of the form ldap://<hostname>:<port>");
        }
        if (principalSuffix != null) {
            username += principalSuffix;
        }
        Hashtable<String, String> env = new Hashtable<String, String>();
        env.put(Context.SECURITY_AUTHENTICATION, authentication);
        env.put(Context.SECURITY_PRINCIPAL, username);
        env.put(Context.SECURITY_CREDENTIALS, password);
        env.put(Context.INITIAL_CONTEXT_FACTORY, contextFactoryClassName);
        env.put(Context.PROVIDER_URL, url);
        env.put(Context.REFERRAL, referral);
        if (usePooling && username.equals(systemUsername)) {
            env.put(SUN_CONNECTION_POOLING_PROPERTY, "true");
        }
        if (additionalEnvironment != null) {
            env.putAll(additionalEnvironment);
        }
        if (log.isDebugEnabled()) {
            log.debug("Initializing LDAP context using URL [" + url + "] and username [" + systemUsername + "] " +
                    "with pooling [" + (usePooling ? "enabled" : "disabled") + "]");
        }
        return new InitialLdapContext(env, null);
    }

Output:
    public LdapContext getLdapContext(String username, String password) throws NamingException {
        if (searchBase == null) {
            throw new IllegalStateException("A search base must be specified.");
        }
        if (url == null) {
            throw new IllegalStateException("An LDAP URL must be specified of the form ldap://<hostname>:<port>");
        }
        if (username != null && principalSuffix != null) {
            username += principalSuffix;
        }
        Hashtable<String, String> env = new Hashtable<String, String>();
        env.put(Context.SECURITY_AUTHENTICATION, authentication);
        if (username != null) {
            env.put(Context.SECURITY_PRINCIPAL, username);
        }
        if (password != null) {
            env.put(Context.SECURITY_CREDENTIALS, password);
        }
        env.put(Context.INITIAL_CONTEXT_FACTORY, contextFactoryClassName);
        env.put(Context.PROVIDER_URL, url);
        env.put(Context.REFERRAL, referral);
        if (usePooling && username.equals(systemUsername)) {
            env.put(SUN_CONNECTION_POOLING_PROPERTY, "true");
        }
        if (additionalEnvironment != null) {
            env.putAll(additionalEnvironment);
        }
        if (log.isDebugEnabled()) {
            log.debug("Initializing LDAP context using URL [" + url + "] and username [" + systemUsername + "] " +
                    "with pooling [" + (usePooling ? "enabled" : "disabled") + "]");
        }
        return new InitialLdapContext(env, null);
    }