/////////////////////////////////////////////////////////////////////////
510953
public String getStringAscii(final int index)
    {
        boundsCheck0(index, SIZE_OF_INT);

        final int length = UNSAFE.getInt(null, address + index);

        return getStringAscii(index, length);
    }
1191323
function (columns) {
        var i, j, k,
            totalCol = 0,
            flag = [];

        for (i = 0; i < columns[0].length; i++) {
            totalCol += columns[0][i].colspan || 1;
        }

        for (i = 0; i < columns.length; i++) {
            flag[i] = [];
            for (j = 0; j < totalCol; j++) {
                flag[i][j] = false;
            }
        }

        for (i = 0; i < columns.length; i++) {
            for (j = 0; j < columns[i].length; j++) {
                var r = columns[i][j],
                    rowspan = r.rowspan || 1,
                    colspan = r.colspan || 1,
                    index = $.inArray(false, flag[i]);

                if (colspan === 1) {
                    r.fieldIndex = index;
                    // when field is undefined, use index instead
                    if (typeof r.field === 'undefined') {
                        r.field = index;
                    }
                }

                for (k = 0; k < rowspan; k++) {
                    flag[i + k][index] = true;
                }
                for (k = 0; k < colspan; k++) {
                    flag[i][index + k] = true;
                }
            }
        }
    }
1288686
function(session) {
    this.session = session;
    this.doc = session.getDocument();

    this.clearSelection();
    this.selectionLead = this.doc.createAnchor(0, 0);
    this.selectionAnchor = this.doc.createAnchor(0, 0);

    var _self = this;
    this.selectionLead.on("change", function(e) {
        _self._emit("changeCursor");
        if (!_self.$isEmpty)
            _self._emit("changeSelection");
        if (!_self.$preventUpdateDesiredColumnOnChange && e.old.column != e.value.column)
            _self.$updateDesiredColumn();
    });

    this.selectionAnchor.on("change", function() {
        if (!_self.$isEmpty)
            _self._emit("changeSelection");
    });
}
1094970
LinkedHashMap/*< String, SharedFlowController >*/ getDefaultSharedFlows( RequestContext context )
            throws ClassNotFoundException, InstantiationException, IllegalAccessException
    {
        SharedFlowRefConfig[] defaultRefs = ConfigUtil.getConfig().getSharedFlowRefs();

        if ( defaultRefs != null )
        {
            if ( defaultRefs.length > 0 )
            {
                LinkedHashMap/*< String, SharedFlowController >*/ sharedFlows = new LinkedHashMap();

                for ( int i = 0; i < defaultRefs.length; i++ )
                {
                    SharedFlowRefConfig ref = defaultRefs[i];
                    if ( LOG.isInfoEnabled() )
                    {
                        LOG.info( "Shared flow of type " + ref.getType() + " is a default shared flow reference "
                                    + "with name " + ref.getName() );
                    }
                    addSharedFlow( context, ref.getName(), ref.getType(), sharedFlows );
                }

                return sharedFlows;
            }
        }

        return null;
    }
1122932
@Override
    public void run() {
        switch (type) {
          case OPEN_FILE:
            try {
                debugGui.dim.compileScript(fileName, text);
            } catch (RuntimeException ex) {
                MessageDialogWrapper.showMessageDialog(
                    debugGui, ex.getMessage(), "Error Compiling "+fileName,
                    JOptionPane.ERROR_MESSAGE);
            }
            break;

          case LOAD_FILE:
            try {
                debugGui.dim.evalScript(fileName, text);
            } catch (RuntimeException ex) {
                MessageDialogWrapper.showMessageDialog(
                    debugGui, ex.getMessage(), "Run error for "+fileName,
                    JOptionPane.ERROR_MESSAGE);
            }
            break;

          case UPDATE_SOURCE_TEXT:
            {
                String fileName = sourceInfo.url();
                if (!debugGui.updateFileWindow(sourceInfo) &&
                        !fileName.equals("<stdin>")) {
                    debugGui.createFileWindow(sourceInfo, -1);
                }
            }
            break;

          case ENTER_INTERRUPT:
            debugGui.enterInterruptImpl(lastFrame, threadTitle, alertMessage);
            break;

          default:
            throw new IllegalArgumentException(String.valueOf(type));

        }
    }
609083
private void createProject() {

        CmsObject cms = A_CmsUI.getCmsObject();
        try {
            String name = "/";
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_fieldOU.getValue())) {
                name = CmsStringUtil.joinPaths(name, m_fieldOU.getValue());
            }
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_fieldName.getValue())) {
                name = CmsStringUtil.joinPaths(name, m_fieldName.getValue());
            } else {
                name = CmsStringUtil.joinPaths(name, "/");
            }

            m_project = cms.createProject(
                name,
                m_fieldDescription.getValue(),
                m_fieldUser.getValue(),
                m_fieldManager.getValue(),
                m_fieldDeleteAfterPublish.getValue().booleanValue()
                ? CmsProject.PROJECT_TYPE_TEMPORARY
                : CmsProject.PROJECT_TYPE_NORMAL);
            updateProjectResources();

        } catch (Throwable t) {
            CmsErrorDialog.showErrorDialog(t);
        }
    }
182999
protected void assertArrayHasMinLengthAndAllElementsNotNull(final Object[] array, final Integer minLength) throws ArgumentCountException, ArgumentNullException  {

		if (array.length < minLength) {
			throw ArgumentCountException.tooFew(array.length, minLength);
		}

		for (final Object element : array) {

			if (element == null) {
				throw new ArgumentNullException();
			}
		}
	}
1191621
void submit() {

        List<CmsUUID> selectedIds = getSelectedIds();
        List<CmsUUID> updated = Lists.newArrayList();
        CmsObject cms = m_dialogContext.getCms();
        try {
            for (CmsUUID selectedId : selectedIds) {
                cms.restoreDeletedResource(selectedId);
                updated.add(selectedId);
            }
            m_dialogContext.finish(updated);
        } catch (CmsException e) {
            m_dialogContext.error(e);
        }
    }
795193
@Override
	public void actionPerformed(ActionEvent event) {

		Object mysource = event.getSource();

		if ( ! (mysource instanceof JComboBox )) {
			super.actionPerformed(event);
			return;
		}

		@SuppressWarnings("unchecked")
		JComboBox<String> source = (JComboBox<String>) event.getSource();
		String value = source.getSelectedItem().toString();
		evalString("save selection; ");

		String selectLigand = "select ligand;wireframe 0.16;spacefill 0.5; color cpk ;";

		if ( value.equals("Cartoon")){
			String script = "hide null; select all;  spacefill off; wireframe off; backbone off;" +
					" cartoon on; " +
					" select ligand; wireframe 0.16;spacefill 0.5; color cpk; " +
					" select *.FE; spacefill 0.7; color cpk ; " +
					" select *.CU; spacefill 0.7; color cpk ; " +
					" select *.ZN; spacefill 0.7; color cpk ; " +
					" select all; ";
			this.executeCmd(script);
		} else if (value.equals("Backbone")){
			String script = "hide null; select all; spacefill off; wireframe off; backbone 0.4;" +
					" cartoon off; " +
					" select ligand; wireframe 0.16;spacefill 0.5; color cpk; " +
					" select *.FE; spacefill 0.7; color cpk ; " +
					" select *.CU; spacefill 0.7; color cpk ; " +
					" select *.ZN; spacefill 0.7; color cpk ; " +
					" select all; ";
			this.executeCmd(script);
		} else if (value.equals("CPK")){
			String script = "hide null; select all; spacefill off; wireframe off; backbone off;" +
					" cartoon off; cpk on;" +
					" select ligand; wireframe 0.16;spacefill 0.5; color cpk; " +
					" select *.FE; spacefill 0.7; color cpk ; " +
					" select *.CU; spacefill 0.7; color cpk ; " +
					" select *.ZN; spacefill 0.7; color cpk ; " +
					" select all; ";
			this.executeCmd(script);

		} else if (value.equals("Ligands")){
			this.executeCmd("restrict ligand; cartoon off; wireframe on;  display selected;");
		} else if (value.equals("Ligands and Pocket")){
			this.executeCmd(" select within (6.0,ligand); cartoon off; wireframe on; backbone off; display selected; ");
		} else if ( value.equals("Ball and Stick")){
			String script = "hide null; restrict not water;  wireframe 0.2; spacefill 25%;" +
					" cartoon off; backbone off; " +
					" select ligand; wireframe 0.16; spacefill 0.5; color cpk; " +
					" select *.FE; spacefill 0.7; color cpk ; " +
					" select *.CU; spacefill 0.7; color cpk ; " +
					" select *.ZN; spacefill 0.7; color cpk ; " +
					" select all; ";
			this.executeCmd(script);
		} else if ( value.equals("By Chain")){
			jmolColorByChain();
			String script = "hide null; select all;set defaultColors Jmol; color_by_chain(\"cartoon\"); color_by_chain(\"\"); " + selectLigand + "; select all; ";
			this.executeCmd(script);
		} else if ( value.equals("Rainbow")) {
			this.executeCmd("hide null; select all; set defaultColors Jmol; color group; color cartoon group; " + selectLigand + "; select all; " );
		} else if ( value.equals("Secondary Structure")){
			this.executeCmd("hide null; select all; set defaultColors Jmol; color structure; color cartoon structure;" + selectLigand + "; select all; " );

		} else if ( value.equals("By Element")){
			this.executeCmd("hide null; select all; set defaultColors Jmol; color cpk; color cartoon cpk; " + selectLigand + "; select all; ");
		} else if ( value.equals("By Amino Acid")){
			this.executeCmd("hide null; select all; set defaultColors Jmol; color amino; color cartoon amino; " + selectLigand + "; select all; " );
		} else if ( value.equals("Hydrophobicity") ){
			this.executeCmd("hide null; set defaultColors Jmol; select hydrophobic; color red; color cartoon red; select not hydrophobic ; color blue ; color cartoon blue; "+ selectLigand+"; select all; ");
		} else if ( value.equals("Suggest Domains")){
			colorByPDP();
		} else if ( value.equals("Show SCOP Domains")){
			colorBySCOP();
		}
		evalString("restore selection; ");
	}
9636
function ElementDataSource(config) {
	var newData = [],
		newColumns = [];

	var headings = config.data.all('tr th');

	headings.each(function(th){
		newColumns.push(th.getHtml());
	});

	config.data.all('tr').each(function(tr){
		var newRow = {},
			populated = false;

		for (var i = 0, numCols = headings.size(); i < numCols; i++) {

			if (!tr.all('td').item(i)) { continue; }

			newRow[headings.item(i).getHtml()] = tr.all('td').item(i).getHtml();
			populated = true;
		}

		if (populated) {
			newData.push(newRow);
		}
	});

	config.columns = newColumns;
	config.data = newData;

	return new JSONDataSource(config);
}
243748
public static void html(StringBuilder sb, String html) {
        for (int i = 0; i < html.length(); i++) {
            char c = html.charAt(i);
            switch (c) {
            case '&':
                sb.append("&amp;");
                break;
            case '"':
                sb.append("&quot;");
                break;
            case '\'':
                sb.append("&apos;");
                break;
            case '<':
                sb.append("&lt;");
                break;
            case '>':
                sb.append("&gt;");
                break;
            default:
                sb.append(c);
            }
        }
    }
109584
function(conf, params, debug, wiring_collection, cb) {
	simpleflow.run(conf, params, debug, function(name, cb) {
		wiring_collection.findOne({
			//_id: ObjectID.createFromHexString(req.param('id')) 
			name: name
		}, function(error, wiring) {
			if(error) { throw error; }
			
			if(!wiring) {
				throw "Wiring '"+name+"' was not found !";
			}
			/*console.log("error");
			console.log(error);
			console.log("wiring");
			console.log(wiring);*/
			
			cb(wiring.config);
		});
	}, cb);
}
421120
public void actionUpdateElements() throws JspException {

        try {
            List<CmsDialogElement> elementList = computeElements();
            CmsFile file = getCms().readFile(getParamTempfile(), CmsResourceFilter.IGNORE_EXPIRATION);
            CmsXmlPage page = CmsXmlPageFactory.unmarshal(getCms(), file);
            boolean foundMandatory = false;
            m_changeElement = "";
            Iterator<CmsDialogElement> i = elementList.iterator();
            while (i.hasNext()) {
                // get the current list element
                CmsDialogElement element = i.next();
                if (element.isMandantory()
                    || element.getName().equals(getParamElementname())
                    || Boolean.valueOf(
                        getJsp().getRequest().getParameter(PREFIX_PARAM_BODY + element.getName())).booleanValue()) {
                    if (!element.isExisting()) {
                        // create element in order to enable it properly
                        page.addValue(element.getName(), getElementLocale());
                    }
                    page.setEnabled(element.getName(), getElementLocale(), true);
                    if (element.isMandantory() && !foundMandatory) {
                        m_changeElement = element.getName();
                        foundMandatory = true;
                    }
                } else {
                    if (element.isExisting()) {
                        // remove element if it is already existing
                        page.removeValue(element.getName(), getElementLocale());
                    }
                }
            }
            // write the temporary file
            file.setContents(page.marshal());
            getCms().writeFile(file);
            // set the javascript functions which should be executed
            if (page.isEnabled(getParamElementname(), getElementLocale())) {
                m_changeElement = getParamElementname();
            } else if (!foundMandatory) {
                if (elementList.size() > 0) {
                    m_changeElement = elementList.get(0).getName();
                }
            }
        } catch (Throwable e) {
            // show error dialog
            setParamMessage(Messages.get().getBundle(getLocale()).key(Messages.ERR_UPDATE_ELEMENTS_0));
            includeErrorpage(this, e);
        }
    }
1323653
private void checkIndices(int row, int col) {
        if (row < 0 || col < 0 || row >= rows || col >= cols) {
            throw new IndexOutOfBoundsException();
        }
    }
709085
@Override
    public void selectionChanged(IAction action, ISelection selection) {
        bugInstance = null;
        // TODO learn to deal with ALL elements
        IMarker marker = MarkerUtil.getMarkerFromSingleSelection(selection);
        if (marker == null) {
            return;
        }
        bugInstance = MarkerUtil.findBugInstanceForMarker(marker);
    }
1315518
function(time) {
			var t = this;
			var children = this.factory.$el.find('ul');
			var offset = 0;

			time = time ? time : this.factory.time.getDayCounter(this.showSeconds);

			if(time.length > children.length) {
				$.each(time, function(i, digit) {
					t.createList(digit);
				});
			}

			if(this.showSeconds) {
				$(this.createDivider('Seconds')).insertBefore(this.lists[this.lists.length - 2].$el);
			}
			else
			{
				offset = 2;
			}

			$(this.createDivider('Minutes')).insertBefore(this.lists[this.lists.length - 4 + offset].$el);
			$(this.createDivider('Hours')).insertBefore(this.lists[this.lists.length - 6 + offset].$el);
			$(this.createDivider('Days', true)).insertBefore(this.lists[0].$el);

			this.base();
		}
495432
@Override
    protected void defineWidgets() {

        // initialize the user object to use for the dialog
        initUserObject();
        boolean webuserOu = false;
        try {
            webuserOu = OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), getParamOufqn()).hasFlagWebuser();
        } catch (CmsException e) {
            webuserOu = m_user.isWebuser();
        }
        setKeyPrefix(KEY_PREFIX);

        // widgets to display
        if (isNewUser() && isEditable(m_user)) {
            addWidget(new CmsWidgetDialogParameter(this, "name", PAGES[0], new CmsInputWidget()));
        } else {
            addWidget(new CmsWidgetDialogParameter(this, "name", PAGES[0], new CmsDisplayWidget()));
        }
        if (isEditable(m_user)) {
            addWidget(new CmsWidgetDialogParameter(this, "description", "", PAGES[0], new CmsTextareaWidget(), 0, 1));
            addWidget(new CmsWidgetDialogParameter(m_user, "lastname", PAGES[0], new CmsInputWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "firstname", PAGES[0], new CmsInputWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "email", PAGES[0], new CmsInputWidget()));
            addWidget(new CmsWidgetDialogParameter(this, "assignedOu", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "institution", "", PAGES[0], new CmsInputWidget(), 0, 1));
            addWidget(new CmsWidgetDialogParameter(m_user, "address", "", PAGES[0], new CmsInputWidget(), 0, 1));
            addWidget(new CmsWidgetDialogParameter(m_user, "zipcode", "", PAGES[0], new CmsInputWidget(), 0, 1));
            addWidget(new CmsWidgetDialogParameter(m_user, "city", "", PAGES[0], new CmsInputWidget(), 0, 1));
            addWidget(new CmsWidgetDialogParameter(m_user, "country", "", PAGES[0], new CmsInputWidget(), 0, 1));
            if (!webuserOu) {
                addWidget(
                    new CmsWidgetDialogParameter(this, "language", PAGES[0], new CmsSelectWidget(getLanguages())));
                if (!getSites().isEmpty()) {
                    addWidget(new CmsWidgetDialogParameter(this, "site", PAGES[0], new CmsSelectWidget(getSites())));
                }
                addWidget(
                    new CmsWidgetDialogParameter(this, "startProject", PAGES[0], new CmsSelectWidget(getProjects())));
                addWidget(
                    new CmsWidgetDialogParameter(
                        this,
                        "startFolder",
                        PAGES[0],
                        new CmsVfsFileWidget(true, null, false)));
                addWidget(new CmsWidgetDialogParameter(this, "startView", PAGES[0], new CmsSelectWidget(getViews())));
                if (isNewUser()) {
                    addWidget(
                        new CmsWidgetDialogParameter(
                            this,
                            "group",
                            PAGES[0],
                            new CmsGroupWidget(null, null, getParamOufqn())));
                    addWidget(new CmsWidgetDialogParameter(this, "role", PAGES[0], new CmsSelectWidget(getRoles())));
                }
            }
        } else {
            addWidget(new CmsWidgetDialogParameter(this, "description", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "lastname", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "firstname", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "email", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(this, "assignedOu", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "institution", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "address", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "zipcode", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "city", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "country", PAGES[0], new CmsDisplayWidget()));
            if (!webuserOu) {
                addWidget(new CmsWidgetDialogParameter(this, "language", PAGES[0], new CmsDisplayWidget()));
                if (!getSites().isEmpty()) {
                    addWidget(new CmsWidgetDialogParameter(this, "site", PAGES[0], new CmsDisplayWidget()));
                }
                addWidget(new CmsWidgetDialogParameter(this, "startProject", PAGES[0], new CmsDisplayWidget()));
                addWidget(new CmsWidgetDialogParameter(this, "startFolder", PAGES[0], new CmsDisplayWidget()));
                addWidget(new CmsWidgetDialogParameter(this, "startView", PAGES[0], new CmsDisplayWidget()));
            }
        }
        addWidget(new CmsWidgetDialogParameter(m_user, "enabled", PAGES[0], new CmsCheckboxWidget()));
        addWidget(new CmsWidgetDialogParameter(this, "selfManagement", PAGES[0], new CmsCheckboxWidget()));
        if (isPwdChangeAllowed(m_user)) {
            addWidget(new CmsWidgetDialogParameter(m_pwdInfo, "newPwd", PAGES[0], new CmsPasswordWidget()));
            addWidget(new CmsWidgetDialogParameter(m_pwdInfo, "confirmation", PAGES[0], new CmsPasswordWidget()));
        }
    }