rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
if (validInfo == false) { | if (!validInfo) { | public void validateLogin() throws Exception { String password; String username; if (parseBasicAuthentication()) { username = (String)this.request.getAttribute("username"); password = (String)this.request.getAttribute("password"); } else { username = this.request.getParameter("username"); password = thi... |
CContext ctx = exprContext.getBlockContext(); | CContext ctx = exprContext.getBodyContext(); | public Path getPath() throws UnpositionedError { if(family == null) return ((CReferenceType)plainType).getPath(); // check if we have calculated path already if(path != null) return path; // get path from the family expressi... |
logger.info("Going to index posts from " + latestIndexedPostId + " to " + maxPostId); | if (logger.isInfoEnabled()) { logger.info("Going to index posts from " + latestIndexedPostId + " to " + maxPostId); } | public int index(int step, Connection conn) throws Exception { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); // Get the last post id so far PreparedStatement p = conn.prepareStatement(SystemGlobals.getSql("SearchModel.maxPostIdUntilNow")); p.setTimestamp(1, timestamp); ResultSet rs = p.execut... |
return getName().hashCode(); | int value = 31; if(getName() != null) value = 31 * (getName().hashCode() +5); if(getDescription() != null) value = 31 * (getDescription().hashCode() + 7); if(getAnnotation() != null) value = 31 * (getAnnotation().hashCode() + 11); System.out.println("value = "+ (-91 * value)); return -91 * value; | public int hashCode() { return getName().hashCode(); } |
if(changeSupport == null) { | if(!hasListeners()) { | public void setProperty(Object key, Object value) throws ChangeVetoException { if(changeSupport == null) { getProperties().put(key, value); } else { Map properties = getProperties(); ChangeEvent ce = new ChangeEvent( this, Annotation.PROPERTY, new Object[] { key, value }, ... |
synchronized(changeSupport) { changeSupport.firePreChangeEvent(ce); | ChangeSupport cs = getChangeSupport(Annotation.PROPERTY); synchronized(cs) { cs.firePreChangeEvent(ce); | public void setProperty(Object key, Object value) throws ChangeVetoException { if(changeSupport == null) { getProperties().put(key, value); } else { Map properties = getProperties(); ChangeEvent ce = new ChangeEvent( this, Annotation.PROPERTY, new Object[] { key, value }, ... |
changeSupport.firePostChangeEvent(ce); | cs.firePostChangeEvent(ce); | public void setProperty(Object key, Object value) throws ChangeVetoException { if(changeSupport == null) { getProperties().put(key, value); } else { Map properties = getProperties(); ChangeEvent ce = new ChangeEvent( this, Annotation.PROPERTY, new Object[] { key, value }, ... |
pathTextField.setMaximumSize(pathTextField.getPreferredSize()); | private JTextField getPathTextField() { if (pathTextField == null) { pathTextField = new JTextField("", 80); pathTextField.setMaximumSize(pathTextField.getPreferredSize()); } return pathTextField; } | |
if (shouldPause()) { | if (shouldPause() && !battleManager.shouldStep()) { | public void runRound() { Utils.log("Let the games begin!"); boolean battleOver = false; endTimer = 0; stopTime = 0; RobotPeer r; currentTime = 0; inactiveTurnCount = 0; int turnsThisSec = 0; int framesThisSec = 0; long frameStartTime; int currentFrameMillis = 0; int totalRobotMillisThisSec = 0; int totalF... |
public ANumValOrSid( TNumber _number_) | public ANumValOrSid() | public ANumValOrSid( TNumber _number_) { setNumber(_number_); } |
setNumber(_number_); | public ANumValOrSid( TNumber _number_) { setNumber(_number_); } | |
transactionManager.committed(txns); | ArrayList committedIDs = new ArrayList(); committedIDs.add(tx.getServerTransactionID()); transactionManager.committed(committedIDs); | private void doStages(Set txns) { for (Iterator iter = txns.iterator(); iter.hasNext();) { ServerTransaction tx = (ServerTransaction) iter.next(); // apply stage transactionManager.apply(new GlobalTransactionID(idsequence++), tx, Collections.EMPTY_MAP, new BackReferences(), ... |
underlyingAnnotation = new SmallAnnotation(); | private void initAnnotations() { try { Connection conn = seqDB.getPool().takeConnection(); PreparedStatement get_annotations = conn.prepareStatement("select term.name, seqfeature_qualifier_value.value " + " from term, seqfeature_qualifier_value " + " where seqfeature_qualifier_val... | |
x = (HALF_WIDTH_OFFSET >= x) ? HALF_WIDTH_OFFSET : ((getBattleFieldWidth() - HALF_WIDTH_OFFSET < x) ? getBattleFieldWidth() - HALF_WIDTH_OFFSET : x); y = (HALF_HEIGHT_OFFSET >= y) ? HALF_HEIGHT_OFFSET : ((getBattleFieldHeight() - HALF_HEIGHT_OFFSET < y) ? getBattleFieldHeight() - HALF_HEIGHT_OFFSET : y); | public void checkWallCollision() { boolean hitWall = false; double fixx = 0, fixy = 0; double angle = 0; if (x > getBattleFieldWidth() - HALF_WIDTH_OFFSET) { hitWall = true; fixx = getBattleFieldWidth() - HALF_WIDTH_OFFSET - x; angle = normalRelativeAngle(PI / 2 - heading); } if (x < HALF_WIDTH_OFFSET) { ... | |
int pos; if(src.getDirection()==src.HORIZONTAL) { pos = src.graphicsToSequence(me.getX()); } else { pos = src.graphicsToSequence(me.getY()); } | int pos = src.graphicsToSequence(me.getPoint()); | public SequenceViewerEvent processMouseEvent( SequenceRenderContext src, MouseEvent me, List path, int min, int max ) { path.add(this); int pos; if(src.getDirection()==src.HORIZONTAL) { pos = src.graphicsToSequence(me.getX()); } else { pos = src.graphicsToSequence(me.getY()); } ... |
if(visited.contains(this)) return; | if(visited.contains(n)) return; | public void visitCaesarTypeNode(CaesarTypeNode n) { if(visited.contains(this)) return; visited.add(n); // add implicit relations for(Iterator it = n.parents(); it.hasNext(); ) { CaesarTypeNode superClass = ((SuperSubRelation)it.next()).getSuperNode(); ... |
RolesRepository.clear(); | public void insertSave() throws Exception { Category c = new Category(); c.setName(this.request.getParameter("category_name")); c.setModerated("1".equals(this.request.getParameter("moderated"))); int categoryId = this.cm.addNew(c); c.setId(categoryId); ForumRepository.addCategory(c); String[] groups = this... | |
Message testMessage = messageBuilder.throwsExceptionOnMethodNamed("getBooleanProperty", ex); | Mock mockMessage = new Mock(Message.class); mockMessage.stubs() .method("getStringProperty") .with(eq("testName")) .will(throwException(ex)); Message testMessage = (Message) mockMessage.proxy(); | public void testCanBeEncodedReturnsFalseOnPossibleExceptions() { Exception[] possibleExceptions = new Exception[] { new JMSException("Thrown as a test"), new NumberFormatException("Thrown as a test"), }; for (int i = 0; i < possibleExceptions.length; i++) { ... |
Message testMessage = messageBuilder.returnsExpectedValueFromNamedMethod("getBooleanProperty", "testMessage" + i, "testName", new Boolean(EXPECTED_DECODED_BOOLEANS[i])); | Mock mockMessage = new Mock(MapMessage.class); mockMessage.expects(atLeastOnce()) .method("getStringProperty") .with(eq("testName")) .will(returnValue("" + new Boolean(EXPECTED_DECODED_BOOLEANS[i]))); mockMessage.expects(atLeastOnce()) .method("getBooleanProperty") .with(eq("testName")) .will(returnValue(new Boolean(EX... | public void testCanBeEncodedReturnsTrueForCorrectValues() { BooleanPropertyValueCopier testCopier = new BooleanPropertyValueCopier(); for (int i = 0; i < EXPECTED_DECODED_BOOLEANS.length; i++) { Message testMessage = messageBuilder.returnsExpectedValueFromNamedMethod("getBooleanProperty", ... |
Message testMessage = messageBuilder.returnsExpectedValueFromNamedMethod("getBooleanProperty", "testMessage" + i, "testName", new Boolean(EXPECTED_DECODED_BOOLEANS[i])); | Mock mockMessage = new Mock(MapMessage.class); mockMessage.expects(atLeastOnce()) .method("getStringProperty") .with(eq("testName")) .will(returnValue("" + new Boolean(EXPECTED_DECODED_BOOLEANS[i]))); mockMessage.expects(atLeastOnce()) .method("getBooleanProperty") .with(eq("testName")) .will(returnValue(new Boolean(EX... | public void testGetAsEncodedValueReturnsValuesCorrectlyEncoded() { BooleanPropertyValueCopier testCopier = new BooleanPropertyValueCopier(); for (int i = 0; i < EXPECTED_DECODED_BOOLEANS.length; i++) { Message testMessage = messageBuilder.returnsExpectedValueFromNamedMethod("getBooleanPrope... |
Message testMessage = messageBuilder.throwsExceptionOnMethodNamed("getBooleanProperty", ex); | Mock mockMessage = new Mock(Message.class); mockMessage.stubs() .method("getStringProperty") .with(eq("testName")) .will(throwException(ex)); Message testMessage = (Message) mockMessage.proxy(); | public void testGetAsEncodedValueThrowsHJBExceptionOnPossibleException() { Exception[] possibleExceptions = new Exception[] { new JMSException("Thrown as a test"), new NumberFormatException("Thrown as a test"), }; for (int i = 0; i < possibleExceptions.length; i++)... |
message.getBooleanProperty(name); return true; | String asString = message.getStringProperty(name); return isReallyABoolean(asString); | public boolean canBeEncoded(String name, Message message) throws HJBException { try { message.getBooleanProperty(name); return true; } catch (JMSException e) { return false; } catch (NumberFormatException e) { return false; } } |
return encode(new Boolean(message.getBooleanProperty(name))); | String asString = message.getStringProperty(name); if (isReallyABoolean(asString)) { return encode(new Boolean(message.getBooleanProperty(name))); } else { return handleInvalidBooleanFailure(name, asString); } | public String getAsEncodedValue(String name, Message message) throws HJBException { try { return encode(new Boolean(message.getBooleanProperty(name))); } catch (JMSException e) { return handleValueReadFailure(name, e, message); } catch (NumberFormatException e) ... |
private void buildSystem(String appPath, String defaultConfig) throws IOException | private void buildSystem(String appPath, String defaultConfig) | private void buildSystem(String appPath, String defaultConfig) throws IOException { if (defaultConfig == null) { throw new InvalidParameterException("defaultConfig could not be null"); } this.defaultConfig = defaultConfig; this.defaults = new Properties(); this.defaults.put(ConfigKeys.APPLICATION_PATH, appPath)... |
public static void initGlobals(String appPath, String defaults) throws IOException | public static void initGlobals(String appPath, String defaults) | public static void initGlobals(String appPath, String defaults) throws IOException { globals = new SystemGlobals(); globals.buildSystem(appPath, defaults); } |
public static void loadAdditionalDefaults(String file) throws IOException | public static void loadAdditionalDefaults(String file) | public static void loadAdditionalDefaults(String file) throws IOException { if (!new File(file).exists()) { logger.info("Cannot find file " + file + ". Will ignore it"); return; } FileInputStream input = new FileInputStream(file); globals.installation.load(input); input.close(); if (!additionalDefaultsLi... |
FileInputStream input = new FileInputStream(file); globals.installation.load(input); input.close(); if (!additionalDefaultsList.contains(file)) { | try { FileInputStream input = new FileInputStream(file); globals.installation.load(input); input.close(); } catch (IOException e) { String es = "Erorr loadAdditionalDefaults()"; log.error(es, e); throw new RuntimeException(es, e); } if (!additionalDefaultsList.contains(file)) { | public static void loadAdditionalDefaults(String file) throws IOException { if (!new File(file).exists()) { logger.info("Cannot find file " + file + ". Will ignore it"); return; } FileInputStream input = new FileInputStream(file); globals.installation.load(input); input.close(); if (!additionalDefaultsLi... |
public static void loadDefaults() throws IOException | public static void loadDefaults() | public static void loadDefaults() throws IOException { FileInputStream input = new FileInputStream(globals.defaultConfig); globals.defaults.load(input); input.close(); globals.expander.clearCache(); } |
FileInputStream input = new FileInputStream(globals.defaultConfig); globals.defaults.load(input); input.close(); globals.expander.clearCache(); } | try { FileInputStream input = new FileInputStream(globals.defaultConfig); globals.defaults.load(input); input.close(); globals.expander.clearCache(); } catch (IOException e) { String es = "Erorr loadDefaults()"; log.error(es, e); throw new RuntimeException(es, e); } } | public static void loadDefaults() throws IOException { FileInputStream input = new FileInputStream(globals.defaultConfig); globals.defaults.load(input); input.close(); globals.expander.clearCache(); } |
public static void loadQueries(String queryFile) throws IOException | public static void loadQueries(String queryFile) | public static void loadQueries(String queryFile) throws IOException { queries.load(new FileInputStream(queryFile)); } |
queries.load(new FileInputStream(queryFile)); } | try { queries.load(new FileInputStream(queryFile)); } catch (IOException e) { String es = "Erorr loadQueries()"; log.error(es, e); throw new RuntimeException(es, e); } } | public static void loadQueries(String queryFile) throws IOException { queries.load(new FileInputStream(queryFile)); } |
public static void saveInstallation() throws IOException | public static void saveInstallation() | public static void saveInstallation() throws IOException { // We need this temporary "p" because, when // new FileOutputStream() is called, it will // raise an event to the TimerTask who is listen // for file modifications, which then reloads the // configurations from the filesystem, overwriting // our new key... |
FileOutputStream out = new FileOutputStream(globals.installationConfig); p.store(out, "Installation specific configuration options"); out.close(); ConfigLoader.listenInstallationConfig(); | try { FileOutputStream out = new FileOutputStream(globals.installationConfig); p.store(out, "Installation specific configuration options"); out.close(); } catch (IOException e) { String es = "Erorr add()"; log.error(es, e); throw new RuntimeException(es, e); } ConfigLoader.listenInstallationConfig(); | public static void saveInstallation() throws IOException { // We need this temporary "p" because, when // new FileOutputStream() is called, it will // raise an event to the TimerTask who is listen // for file modifications, which then reloads the // configurations from the filesystem, overwriting // our new key... |
if (services.length == 2 && "localhost".equals(services[0].getServiceContact().getContact()) && "localhost".equals(services[1].getServiceContact().getContact())) { System.err.println("!"); } | void submitUnbound(Task t) throws NoFreeResourceException { try { if (t == null) { return; } checkTaskLoadConditions(t); Service[] services = new Service[t.getRequiredServices()]; Contact[] contacts; Object constraints = getConstraints(t); if (constraints != null) { contacts = (Contact[]) constrai... | |
final ActionManager actionManager = ActionManager.getInstance(); final WindowActionGroup windowActionGroup = (WindowActionGroup) actionManager.getAction("net.intellij.window.WindowActionGroup"); windowActionGroup.removeProjectContainer(project.getName(), projectContainer); | public void projectClosed() { project = null; projectContainer = null; } | |
for (Iterator<WindowAction> iterator = children.iterator(); iterator.hasNext();) { final WindowAction child = iterator.next(); if (name.equals(child.getTemplatePresentation().getText()) && projectContainer.equals(child.getProjectContainer())) { iterator.remove(); } | for (Iterator<AnAction> iterator = children.iterator(); iterator.hasNext();) { final AnAction child = iterator.next(); if (child instanceof WindowAction) { final WindowAction windowAction = (WindowAction)child; if (name.equals(windowAction.getTemplatePresentation().getText()) && projectContainer.equals(windowAction.get... | public void removeProjectContainer(@NotNull String name, @NotNull Container projectContainer) { for (Iterator<WindowAction> iterator = children.iterator(); iterator.hasNext();) { final WindowAction child = iterator.next(); if (name.equals(child.getTemplatePresentation().getText()) && projectContainer.equals(c... |
if (children.isEmpty()) { children.add(Separator.getInstance()); } | public void addProjectContainer(@NotNull String name, @NotNull Container projectContainer) { children.add(new WindowAction(name, projectContainer)); } | |
public static List selectAllByTopicByLimit(int topicId, int start, int count) throws Exception | public static List selectAllByTopicByLimit(int topicId, int start, int count) | public static List selectAllByTopicByLimit(int topicId, int start, int count) throws Exception { String tid = Integer.toString(topicId); List posts = (List)cache.get(FQN, tid); if (posts == null || posts.size() == 0) { PostDAO pm = DataAccessDriver.getInstance().newPostDAO(); posts = pm.selectAllByTopic(topi... |
public boolean readSequence(BufferedReader reader, SymbolTokenization symParser, SeqIOListener siol) throws IllegalSymbolException, IOException, ParseException { String line = reader.readLine(); if (line == null) { throw new IOException("Premature stream end"); } if (!line.startsWith(">")) { throw new IOException("Stre... | public boolean readSequence( BufferedReader reader, SymbolTokenization symParser, SeqIOListener siol ) throws IllegalSymbolException, IOException, ParseException { String line = reader.readLine(); if (line == null) { throw new IOException("Premature stream end"); | public boolean readSequence(BufferedReader reader, SymbolTokenization symParser, SeqIOListener siol) throws IllegalSymbolException, IOException, ParseException { String line = reader.readLine(); if (line == null) { throw new IOException("Premature stream end"); } if (!line.startsWith(">")) { throw ... |
if (!line.startsWith(">")) { throw new IOException("Stream does not appear to contain FASTA formatted data: " + line); } siol.startSequence(); String description = line.substring(1).trim(); siol.addSequenceProperty(PROPERTY_DESCRIPTIONLINE, description); String name = new java.util.StringTokenizer(description).nextT... | public boolean readSequence(BufferedReader reader, SymbolTokenization symParser, SeqIOListener siol) throws IllegalSymbolException, IOException, ParseException { String line = reader.readLine(); if (line == null) { throw new IOException("Premature stream end"); } if (!line.startsWith(">")) { throw ... | |
private boolean readSequenceData(BufferedReader r, SymbolTokenization parser, SeqIOListener listener) throws IOException, IllegalSymbolException { char[] cache = new char[256]; boolean reachedEnd = false, seenEOF = false; StreamParser sparser = parser.parseStream(listener); while (!reachedEnd) { r.mark(cache.length); ... | private boolean readSequenceData( BufferedReader r, SymbolTokenization parser, SeqIOListener listener ) throws IOException, IllegalSymbolException { char[] cache = new char[512]; boolean reachedEnd = false, seenEOF = false; StreamParser sparser = parser.parseStream(listener); while (!reachedEnd) { r.mark(cache.length)... | private boolean readSequenceData(BufferedReader r, SymbolTokenization parser, SeqIOListener listener) throws IOException, IllegalSymbolException { char[] cache = new char[256]; boolean reachedEnd = false, seenEOF = false; StreamParser sparser = parser.parseStream(listener); while (!reached... |
sparser.close(); return seenEOF; } | private boolean readSequenceData(BufferedReader r, SymbolTokenization parser, SeqIOListener listener) throws IOException, IllegalSymbolException { char[] cache = new char[256]; boolean reachedEnd = false, seenEOF = false; StreamParser sparser = parser.parseStream(listener); while (!reached... | |
AuthenticationInfo authInfo = getRepository().getAuthenticationInfo(); | AuthenticationInfo authInfo = getAuthenticationInfo(); | public void openConnection() throws ConnectionException, AuthenticationException { AuthenticationInfo authInfo = getRepository().getAuthenticationInfo(); if ( authInfo == null ) { throw new IllegalArgumentException( "Authentication Credentials cannot be null for FTP protoco... |
if ( ftp.login( username.trim(), password.trim() ) == false ) | if ( !ftp.login( username.trim(), password.trim() ) ) | public void openConnection() throws ConnectionException, AuthenticationException { AuthenticationInfo authInfo = getRepository().getAuthenticationInfo(); if ( authInfo == null ) { throw new IllegalArgumentException( "Authentication Credentials cannot be null for FTP protoco... |
throw new ConnectionException( "Required directories: '" + getRepository().getBasedir() + "' are missing" ); | throw new ConnectionException( "Required directory: '" + getRepository().getBasedir() + "' " + "is missing" ); | public void openConnection() throws ConnectionException, AuthenticationException { AuthenticationInfo authInfo = getRepository().getAuthenticationInfo(); if ( authInfo == null ) { throw new IllegalArgumentException( "Authentication Credentials cannot be null for FTP protoco... |
throw new BioException("Failed to retrieve query sequence from holder using ID '" | throw new BioException("Failed to retrieve query sequence " + "from holder using ID '" | protected Sequence makeQueryViewSequence(String queryID) throws BioException { if (querySeqHolder == null) throw new BioException("Running with null query SequenceDB"); if (queryViewCache.containsKey(queryID)) { return (Sequence) queryViewCache.get(queryID); ... |
throw new BioException("Running with null subject SequenceDB installation"); | throw new BioException("Running with null subject " + "SequenceDB installation"); | protected Sequence makeSubjectViewSequence(String subjectID) throws BioException { if (subjectDBs == null) throw new BioException("Running with null subject SequenceDB installation"); SequenceDBLite subjectDB = subjectDBs.getSequenceDB(databaseID); // It shouldn't happen, b... |
throw new BioException("Failed to retrieve database from installation using ID '" | throw new BioException("Failed to retrieve database " + "from installation using ID '" | protected Sequence makeSubjectViewSequence(String subjectID) throws BioException { if (subjectDBs == null) throw new BioException("Running with null subject SequenceDB installation"); SequenceDBLite subjectDB = subjectDBs.getSequenceDB(databaseID); // It shouldn't happen, b... |
throw new BioException("Failed to retrieve subject sequence from subjectDB using ID '" | throw new BioException("Failed to retrieve subject sequence " + "from subjectDB using ID '" | protected Sequence makeSubjectViewSequence(String subjectID) throws BioException { if (subjectDBs == null) throw new BioException("Running with null subject SequenceDB installation"); SequenceDBLite subjectDB = subjectDBs.getSequenceDB(databaseID); // It shouldn't happen, b... |
return super.selectAllByForumByLimit(forumId, startFrom, startFrom + count); | return super.selectAllByForumByLimit(forumId, startFrom + count, startFrom); | public List selectAllByForumByLimit(int forumId, int startFrom, int count) throws Exception { return super.selectAllByForumByLimit(forumId, startFrom, startFrom + count); } |
Backend.instance().getListMgr().setList(model.listId, model.name, model.description, model.holdSubs); | Backend.instance().getListMgr().setList(model.listId, model.name, model.description, model.url, model.email, model.holdSubs); | public void execute() throws Exception { Model model = (Model)this.getCtx().getModel(); model.validate(); if (model.getErrors().isEmpty()) { Backend.instance().getListMgr().setList(model.listId, model.name, model.description, model.holdSubs); } } |
public void checkInformation() throws Exception | public void checkInformation() | public void checkInformation() throws Exception { this.setTemplateName(TemplateKeys.INSTALL_CHECK_INFO); String language = this.request.getParameter("language"); String database = this.request.getParameter("database"); String dbHost = this.request.getParameter("dbhost"); String dbPort = this.request.getParamete... |
private void checkLanguage() throws IOException | private void checkLanguage() | private void checkLanguage() throws IOException { String lang = this.request.getParameter("l"); if (lang == null || !I18n.languageExists(lang)) { return; } I18n.load(lang); UserSession us = new UserSession(); us.setLang(lang); SessionFacade.add(us); this.addToSessionAndContext("language", lang); } |
private Connection configureDatabase() throws Exception | private Connection configureDatabase() | private Connection configureDatabase() throws Exception { String database = this.getFromSession("database"); String connectionType = this.getFromSession("db_connection_type"); String implementation; boolean isDs = false; if ("JDBC".equals(connectionType)) { implementation = "yes".equals(this.getFromSession(... |
Connection conn = null; | Connection conn; | private Connection configureDatabase() throws Exception { String database = this.getFromSession("database"); String connectionType = this.getFromSession("db_connection_type"); String implementation; boolean isDs = false; if ("JDBC".equals(connectionType)) { implementation = "yes".equals(this.getFromSession(... |
private void configureJDBCConnection() throws Exception | private void configureJDBCConnection() | private void configureJDBCConnection() throws Exception { String username = this.getFromSession("dbUser"); String password = this.getFromSession("dbPassword"); String dbName = this.getFromSession("dbName"); String host = this.getFromSession("dbHost"); String type = this.getFromSession("database"); String encodin... |
p.load(new FileInputStream(dbConfigFilePath)); this.handleDatabasePort(p, port); | try { p.load(new FileInputStream(dbConfigFilePath)); } catch (IOException e) { String es = "Erorr configureJDBCConnection()"; logger.error(es, e); throw new RuntimeException(es, e); } this.handleDatabasePort(p, port); | private void configureJDBCConnection() throws Exception { String username = this.getFromSession("dbUser"); String password = this.getFromSession("dbPassword"); String dbName = this.getFromSession("dbName"); String host = this.getFromSession("dbHost"); String type = this.getFromSession("database"); String encodin... |
fos.close(); } | try { fos.close(); } catch (IOException e) { } } | private void configureJDBCConnection() throws Exception { String username = this.getFromSession("dbUser"); String password = this.getFromSession("dbPassword"); String dbName = this.getFromSession("dbName"); String host = this.getFromSession("dbHost"); String type = this.getFromSession("database"); String encodin... |
private void configureSystemGlobals() throws Exception | private void configureSystemGlobals() | private void configureSystemGlobals() throws Exception { SystemGlobals.setValue(ConfigKeys.USER_HASH_SEQUENCE, MD5.crypt(this.getFromSession("dbPassword") + System.currentTimeMillis())); SystemGlobals.setValue(ConfigKeys.FORUM_LINK, this.getFromSession("forumLink")); SystemGlobals.setValue(ConfigKeys.HOMEPAGE_LI... |
private boolean createTables(Connection conn) throws Exception | private boolean createTables(Connection conn) | private boolean createTables(Connection conn) throws Exception { logger.info("Going to create tables..."); String dbType = this.getFromSession("database"); if ("postgresql".equals(dbType)) { this.dropPostgresqlTables(conn); } else if ("oracle".equals(dbType)) { this.dropOracleTables(conn); } boolean sta... |
Statement s = conn.createStatement(); try { | Statement s=null; try { s = conn.createStatement(); | private boolean createTables(Connection conn) throws Exception { logger.info("Going to create tables..."); String dbType = this.getFromSession("database"); if ("postgresql".equals(dbType)) { this.dropPostgresqlTables(conn); } else if ("oracle".equals(dbType)) { this.dropOracleTables(conn); } boolean sta... |
s.close(); | DbUtils.close(s); | private boolean createTables(Connection conn) throws Exception { logger.info("Going to create tables..."); String dbType = this.getFromSession("database"); if ("postgresql".equals(dbType)) { this.dropPostgresqlTables(conn); } else if ("oracle".equals(dbType)) { this.dropOracleTables(conn); } boolean sta... |
public void doInstall() throws Exception | public void doInstall() | public void doInstall() throws Exception { Connection conn = null; if (!this.checkForWritableDir()) { return; } this.removeUserConfig(); if (!"passed".equals(this.getFromSession("configureDatabase"))) { logger.info("Going to configure the database..."); conn = this.configureDatabase(); if (conn == n... |
} | s=null; } | private void dropOracleTables(Connection conn) { Statement s = null; try { List statements = ParseDBStructFile.parse(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/database/oracle/oracle_db_struct_drop.sql"); for (Iterator iter = statements.iterator(); iter.hasNext(); ) { try { String query = (... |
if (s != null) { try { s.close(); } catch (Exception e) {} } | DbUtils.close(s); | private void dropOracleTables(Connection conn) { Statement s = null; try { List statements = ParseDBStructFile.parse(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/database/oracle/oracle_db_struct_drop.sql"); for (Iterator iter = statements.iterator(); iter.hasNext(); ) { try { String query = (... |
private void dropPostgresqlTables(Connection conn) throws Exception | private void dropPostgresqlTables(Connection conn) | private void dropPostgresqlTables(Connection conn) throws Exception { String[] tables = { "jforum_banlist", "jforum_banlist_seq", "jforum_categories", "jforum_categories_order_seq", "jforum_categories_seq", "jforum_config", "jforum_config_seq", "jforum_forums", "jforum_forums_seq", "jforum_groups", "jforum_... |
Statement s = conn.createStatement(); | private void dropPostgresqlTables(Connection conn) throws Exception { String[] tables = { "jforum_banlist", "jforum_banlist_seq", "jforum_categories", "jforum_categories_order_seq", "jforum_categories_seq", "jforum_config", "jforum_config_seq", "jforum_forums", "jforum_forums_seq", "jforum_groups", "jforum_... | |
s.executeUpdate(query); | s = conn.createStatement(); s.executeUpdate(query); | private void dropPostgresqlTables(Connection conn) throws Exception { String[] tables = { "jforum_banlist", "jforum_banlist_seq", "jforum_categories", "jforum_categories_order_seq", "jforum_categories_seq", "jforum_config", "jforum_config_seq", "jforum_forums", "jforum_forums_seq", "jforum_groups", "jforum_... |
s.close(); } | finally { DbUtils.close(s); } } | private void dropPostgresqlTables(Connection conn) throws Exception { String[] tables = { "jforum_banlist", "jforum_banlist_seq", "jforum_categories", "jforum_categories_order_seq", "jforum_categories_seq", "jforum_config", "jforum_config_seq", "jforum_forums", "jforum_forums_seq", "jforum_groups", "jforum_... |
public void finished() throws Exception | public void finished() | public void finished() throws Exception { this.setTemplateName(TemplateKeys.INSTALL_FINISHED); this.context.put("clickHere", I18n.getMessage("Install.clickHere")); this.context.put("forumLink", this.getFromSession("forumLink")); String lang = this.getFromSession("language"); if (lang == null) { lang = "en_U... |
private boolean importTablesData(Connection conn) throws Exception { boolean status = true; boolean autoCommit = conn.getAutoCommit(); conn.setAutoCommit(false); String dbType = this.getFromSession("database"); List statements = ParseDBDumpFile.parse(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/database/" + dbTy... | private boolean importTablesData(Connection conn) { try { boolean status = true; boolean autoCommit = conn.getAutoCommit(); conn.setAutoCommit(false); | private boolean importTablesData(Connection conn) throws Exception { boolean status = true; boolean autoCommit = conn.getAutoCommit(); conn.setAutoCommit(false); String dbType = this.getFromSession("database"); List statements = ParseDBDumpFile.parse(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/databas... |
for (Iterator iter = statements.iterator(); iter.hasNext();) { String query = (String)iter.next(); if (query == null || "".equals(query.trim())) { continue; } query = query.trim(); Statement s = conn.createStatement(); try { if (query.startsWith("UPDATE") || query.startsWith("INSERT") || query.startsWith("SET")) { ... | String dbType = this.getFromSession("database"); List statements = ParseDBDumpFile.parse(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/database/" + dbType + "/" + dbType + "_data_dump.sql"); for (Iterator iter = statements.iterator(); iter.hasNext();) { String query = (String)iter.next(); if (query == null || ""... | private boolean importTablesData(Connection conn) throws Exception { boolean status = true; boolean autoCommit = conn.getAutoCommit(); conn.setAutoCommit(false); String dbType = this.getFromSession("database"); List statements = ParseDBDumpFile.parse(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/databas... |
public void list() throws Exception | public void list() | public void list() throws Exception { this.welcome(); } |
SimpleHash context) throws Exception | SimpleHash context) | public Template process(ActionServletRequest request, HttpServletResponse response, SimpleHash context) throws Exception { this.setTemplateName("default/empty.htm"); return super.process(request, response, context); } |
private void restartSystemGlobals() throws Exception | private void restartSystemGlobals() | private void restartSystemGlobals() throws Exception { String appPath = SystemGlobals.getApplicationPath(); SystemGlobals.initGlobals(appPath, appPath + "/WEB-INF/config/SystemGlobals.properties"); SystemGlobals.loadAdditionalDefaults(SystemGlobals.getValue(ConfigKeys.DATABASE_DRIVER_CONFIG)); ... |
private boolean updateAdminPassword(Connection conn) throws Exception | private boolean updateAdminPassword(Connection conn) | private boolean updateAdminPassword(Connection conn) throws Exception { logger.info("Going to update the administrator's password"); boolean status = false; try { PreparedStatement p = conn.prepareStatement("UPDATE jforum_users SET user_password = ? WHERE username = 'Admin'"); p.setString(1, MD5.crypt(this.... |
PreparedStatement p = conn.prepareStatement("UPDATE jforum_users SET user_password = ? WHERE username = 'Admin'"); p.setString(1, MD5.crypt(this.getFromSession("adminPassword"))); | p = conn.prepareStatement("UPDATE jforum_users SET user_password = ? WHERE username = 'Admin'"); p.setString(1, MD5.crypt(this.getFromSession("adminPassword"))); | private boolean updateAdminPassword(Connection conn) throws Exception { logger.info("Going to update the administrator's password"); boolean status = false; try { PreparedStatement p = conn.prepareStatement("UPDATE jforum_users SET user_password = ? WHERE username = 'Admin'"); p.setString(1, MD5.crypt(this.... |
p.close(); | private boolean updateAdminPassword(Connection conn) throws Exception { logger.info("Going to update the administrator's password"); boolean status = false; try { PreparedStatement p = conn.prepareStatement("UPDATE jforum_users SET user_password = ? WHERE username = 'Admin'"); p.setString(1, MD5.crypt(this.... | |
return status; | finally { DbUtils.close(p); } return status; | private boolean updateAdminPassword(Connection conn) throws Exception { logger.info("Going to update the administrator's password"); boolean status = false; try { PreparedStatement p = conn.prepareStatement("UPDATE jforum_users SET user_password = ? WHERE username = 'Admin'"); p.setString(1, MD5.crypt(this.... |
public void welcome() throws Exception | public void welcome() | public void welcome() throws Exception { this.checkLanguage(); this.context.put("language", this.getFromSession("language")); this.context.put("database", this.getFromSession("database")); this.context.put("dbhost", this.getFromSession("dbHost")); this.context.put("dbuser", this.getFromSession("dbUser")); this... |
+ " of input"); | + " of input: " + pe.getMessage()); | public Object next() throws NoSuchElementException { if (! moreSearchesAvailable) throw new NoSuchElementException("Attempt to read search result from empty stream"); try { parser.parseSearch(reader, handler); moreSearchesAvailable = handler.getMoreSearches(); return handler.makeSearchResu... |
public void aprovePost(int postId) throws Exception | public void aprovePost(int postId) | public void aprovePost(int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ModerationModel.aprovePost")); p.setTimestamp(1, new Timestamp(System.currentTimeMillis())); p.setInt(2, postId); p.executeUpdate(); p.close(); } |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ModerationModel.aprovePost")); p.setTimestamp(1, new Timestamp(System.currentTimeMillis())); p.setInt(2, postId); p.executeUpdate(); p.close(); } | PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ModerationModel.aprovePost")); p.setTimestamp(1, new Timestamp(System.currentTimeMillis())); p.setInt(2, postId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr selectActiveBannerByPlacem... | public void aprovePost(int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ModerationModel.aprovePost")); p.setTimestamp(1, new Timestamp(System.currentTimeMillis())); p.setInt(2, postId); p.executeUpdate(); p.close(); } |
public List categoryPendingModeration() throws Exception | public List categoryPendingModeration() | public List categoryPendingModeration() throws Exception { List l = new ArrayList(); int lastId = 0; ModerationPendingInfo info = null; Statement s = JForumExecutionContext.getConnection().createStatement(); ResultSet rs = s.executeQuery(SystemGlobals.getSql("ModerationModel.categoryPendingModeration")); while... |
Statement s = JForumExecutionContext.getConnection().createStatement(); ResultSet rs = s.executeQuery(SystemGlobals.getSql("ModerationModel.categoryPendingModeration")); while (rs.next()) { int id = rs.getInt("categories_id"); if (id != lastId) { lastId = id; if (info != null) { l.add(info); } info = new ModerationP... | Statement s=null; ResultSet rs=null; try { s = JForumExecutionContext.getConnection().createStatement(); rs = s.executeQuery(SystemGlobals.getSql("ModerationModel.categoryPendingModeration")); while (rs.next()) { int id = rs.getInt("categories_id"); if (id != lastId) { lastId = id; if (info != null) { l.add(info); } ... | public List categoryPendingModeration() throws Exception { List l = new ArrayList(); int lastId = 0; ModerationPendingInfo info = null; Statement s = JForumExecutionContext.getConnection().createStatement(); ResultSet rs = s.executeQuery(SystemGlobals.getSql("ModerationModel.categoryPendingModeration")); while... |
protected Post getPost(ResultSet rs) throws Exception | protected Post getPost(ResultSet rs) throws SQLException | protected Post getPost(ResultSet rs) throws Exception { Post p = new Post(); p.setPostUsername(rs.getString("username")); p.setId(rs.getInt("post_id")); p.setUserId(rs.getInt("user_id")); p.setBbCodeEnabled(rs.getInt("enable_bbcode") == 1); p.setHtmlEnabled(rs.getInt("enable_html") == 1); p.setSmiliesEnabled(rs... |
public Map topicsByForum(int forumId) throws Exception | public Map topicsByForum(int forumId) | public Map topicsByForum(int forumId) throws Exception { Map m = new HashMap(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ModerationModel.topicsByForum")); p.setInt(1, forumId); int lastId = 0; TopicModerationInfo info = null; ResultSet rs = p.e... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ModerationModel.topicsByForum")); p.setInt(1, forumId); int lastId = 0; TopicModerationInfo info = null; ResultSet rs = p.executeQuery(); while (rs.next()) { int id = rs.getInt("topic_id"); if (id != lastId) { lastId ... | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ModerationModel.topicsByForum")); p.setInt(1, forumId); int lastId = 0; TopicModerationInfo info = null; rs = p.executeQuery(); while (rs.next()) { int id = rs.getInt("topic_id"); if (... | public Map topicsByForum(int forumId) throws Exception { Map m = new HashMap(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ModerationModel.topicsByForum")); p.setInt(1, forumId); int lastId = 0; TopicModerationInfo info = null; ResultSet rs = p.e... |
public void aprovePost(int postId) throws Exception; | public void aprovePost(int postId) ; | public void aprovePost(int postId) throws Exception; |
public List categoryPendingModeration() throws Exception; | public List categoryPendingModeration() ; | public List categoryPendingModeration() throws Exception; |
new EhloCommand(commandDispatcher); | private void initializeCommandDispatcher() { commandDispatcher = new CommandDispatcher(serverContext); new CommandLogger(new HelloCommand(commandDispatcher)); // new EhloCommand(commandDispatcher); new CommandLogger(new MailCommand(commandDispatcher)); new CommandLogger(new ReceiptCommand(commandDispatcher)); ne... | |
if(!isActive()) { return; } Graphics2D g2 = (Graphics2D) g; AffineTransform oldTransform = g2.getTransform(); Rectangle2D currentClip = g2.getClip().getBounds2D(); adjustOffset(sequenceToGraphics(range.getMin())); | if(!isActive()) { return; } | public synchronized void paintComponent(Graphics g) { if(!isActive()) { return; } Graphics2D g2 = (Graphics2D) g; AffineTransform oldTransform = g2.getTransform(); Rectangle2D currentClip = g2.getClip().getBounds2D(); // do a transform to offset drawing to the neighbourhood of zero. adju... |
double minAcross = sequenceToGraphics(range.getMin()) - renderer.getMinimumLeader(this); double maxAcross = sequenceToGraphics(range.getMax()) + 1 + renderer.getMinimumTrailer(this); double alongDim = maxAcross - minAcross; double depth = renderer.getDepth(this); Rectangle2D.Double clip = new Rectangle2D.Double(); if (... | super.paintComponent(g); | public synchronized void paintComponent(Graphics g) { if(!isActive()) { return; } Graphics2D g2 = (Graphics2D) g; AffineTransform oldTransform = g2.getTransform(); Rectangle2D currentClip = g2.getClip().getBounds2D(); // do a transform to offset drawing to the neighbourhood of zero. adju... |
Shape oldClip = g2.getClip(); g2.clip(clip); renderer.paint(g2, this); g2.setClip(oldClip); g2.setTransform(oldTransform); | Graphics2D g2 = (Graphics2D) g; AffineTransform oldTransform = g2.getTransform(); Rectangle2D currentClip = g2.getClip().getBounds2D(); Insets insets = getInsets(); if (isOpaque()) { g2.setPaint(getBackground()); g2.fillRect(0, 0, getWidth(), getHeight()); } adjustOffset(sequenceToGraphics(range.getMin())); double ... | public synchronized void paintComponent(Graphics g) { if(!isActive()) { return; } Graphics2D g2 = (Graphics2D) g; AffineTransform oldTransform = g2.getTransform(); Rectangle2D currentClip = g2.getClip().getBounds2D(); // do a transform to offset drawing to the neighbourhood of zero. adju... |
DefinitionEnvironment env = (DefinitionEnvironment) stack.parentFrame().getVar(DEF_ENV); env.setStack(stack.copy()); | public void pre(VariableStack stack) throws ExecutionException { super.pre(stack); stack.setVar(RemoteNode.REMOTE_FLAG, true); } | |
} catch (IllegalArgumentException iae) {} | } catch (NoSuchElementException iae) {} | public String writeDescription(Sequence seq) { String id = null; try { id = (String) seq.getAnnotation().getProperty("id"); } catch (NoSuchElementException nsee) { id = seq.getName(); if(id == null) id = seq.getURN(); } String desc = null; try { desc = (String) seq.getAnno... |
if (HJBServletConstants.MESSAGE_TO_SEND.equals(parameterName)) { | if (toBeDecoded.contains(parameterName)) { result.put(parameterName, getCodec().decode(value[0])); } else { | public Map decode(Map parameterMap) { Map result = new HashMap(); if (null == parameterMap) return Collections.unmodifiableMap(result); for (Iterator i = parameterMap.keySet().iterator(); i.hasNext();) { Object next = i.next(); try { String parameterName = (... |
} else { result.put(parameterName, getCodec().decode(value[0])); | public Map decode(Map parameterMap) { Map result = new HashMap(); if (null == parameterMap) return Collections.unmodifiableMap(result); for (Iterator i = parameterMap.keySet().iterator(); i.hasNext();) { Object next = i.next(); try { String parameterName = (... | |
Feature f = SimpleFeatureRealizer.DEFAULT.realizeFeature(this, this, template); | Feature f = FeatureImpl.DEFAULT.realizeFeature(this, this, template); | public AceSequence(AceObject seqObj) throws AceException, BioException { this.name = seqObj.getName(); this.fHolder = new SimpleFeatureHolder(); try { // load in relevent ACeDB object & construct annotation wrapper annotation = new AceAnnotation(seqObj); // load in the corresponding ... |
pw.println(); | public void writeAsText(HJBMessage aMessage, Writer aWriter) { if (null == aMessage) return; writeAsText(aMessage.getHeaders(), aWriter); PrintWriter pw = new PrintWriter(aWriter); pw.println(HEADER_BODY_SEPARATOR); pw.println(aMessage.getBody()); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.