rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
System.err.println("Trying to calculate union"); | System.err.println(depth + ":" + "Trying to calculate union"); | public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println("Optimizing " + filter); if(filter instanceof FeatureFilter.And) { System.err.println("is AND"); List filters = new ArrayList(); expandAnd(filter, filters); System.err.println("as list: " + filter... |
System.err.println("Got union: " + union); | System.err.println(depth + ":" + "Got union: " + union); | public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println("Optimizing " + filter); if(filter instanceof FeatureFilter.And) { System.err.println("is AND"); List filters = new ArrayList(); expandAnd(filter, filters); System.err.println("as list: " + filter... |
FeatureFilter ors = or((FeatureFilter[]) filters.toArray(new FeatureFilter[] {})); if(ands.isEmpty()) { System.err.println("no ands, returning ors: " + ors); return ors; | System.err.println(depth + ":" + "Reduced to: " + filters); if(filters.isEmpty()) { if(ands.isEmpty()) { return none(); } else { return optimize(and((FeatureFilter[]) ands.toArray(new FeatureFilter[] {}))); } | public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println("Optimizing " + filter); if(filter instanceof FeatureFilter.And) { System.err.println("is AND"); List filters = new ArrayList(); expandAnd(filter, filters); System.err.println("as list: " + filter... |
System.err.println("Mixing in ands: " + ands); System.err.println("to: " + ors); List combs = new ArrayList(); combs.add(ors); for(int i = 0; i < ands.size(); i++) { List newCombs = new ArrayList(); FeatureFilter.And and = (FeatureFilter.And) ands.get(i); for(int j = 0; j < combs.size(); j++) { FeatureFilter f = (Featu... | FeatureFilter ors = or((FeatureFilter[]) filters.toArray(new FeatureFilter[] {})); if(ands.isEmpty()) { System.err.println(depth + ":" + "no ands, returning ors: " + ors); return ors; } else { System.err.println(depth + ":" + "Mixing in ands: " + ands); System.err.println(depth + ":" + "to: " + ors); List combs = new A... | public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println("Optimizing " + filter); if(filter instanceof FeatureFilter.And) { System.err.println("is AND"); List filters = new ArrayList(); expandAnd(filter, filters); System.err.println("as list: " + filter... |
return optimize(and((FeatureFilter[]) combs.toArray(new FeatureFilter[] {}))); | public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println("Optimizing " + filter); if(filter instanceof FeatureFilter.And) { System.err.println("is AND"); List filters = new ArrayList(); expandAnd(filter, filters); System.err.println("as list: " + filter... | |
} finally { depth--; } | public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println("Optimizing " + filter); if(filter instanceof FeatureFilter.And) { System.err.println("is AND"); List filters = new ArrayList(); expandAnd(filter, filters); System.err.println("as list: " + filter... | |
public List getPosts(int start, int count, int minPostId, int maxPostId, Connection conn) throws Exception | public List getPosts(int start, int count, int minPostId, int maxPostId, Connection conn) | public List getPosts(int start, int count, int minPostId, int maxPostId, Connection conn) throws Exception { return super.getPosts(count, start, minPostId, maxPostId, conn); } |
this(contact, 1.0); | this(contact, 0.0); | public WeightedHost(BoundContact contact) { this(contact, 1.0); } |
return host.toString(); | return host.toString() + ":" + D4.format(score) + "(" + D4.format(tscore) + "):"+load; | public String toString() { return host.toString(); } |
this.ensureDaoClassIsCorrect("net.jforum.dao.mysql.MySQL323DataAccessDriver"); | this.ensureDaoClassIsCorrect(MY_SQL323_DATA_ACCESS_DRIVER); | private void handleMySql323() throws Exception { this.ensureDaoClassIsCorrect("net.jforum.dao.mysql.MySQL323DataAccessDriver"); Properties p = this.loadSqlQueries(); if (p != null) { if (p.size() == 0 || p.getProperty("PermissionControl.deleteRoleValuesByRoleId") == null) { String path = this.buildPath("my... |
this.ensureDaoClassIsCorrect("net.jforum.dao.mysql.MysqlDataAccessDriver"); | this.ensureDaoClassIsCorrect(MYSQL_DATA_ACCESS_DRIVER); | private void handleMySql40x() throws Exception { this.ensureDaoClassIsCorrect("net.jforum.dao.mysql.MysqlDataAccessDriver"); Properties p = this.loadSqlQueries(); if (p != null) { if (p.size() == 0 || p.getProperty("PermissionControl.deleteAllRoleValues") == null) { String path = this.buildPath("mysql_40.s... |
this.ensureDaoClassIsCorrect("net.jforum.dao.mysql.MysqlDataAccessDriver"); | this.ensureDaoClassIsCorrect(MYSQL_DATA_ACCESS_DRIVER); | private void handleMySql41xPlus() throws Exception { this.ensureDaoClassIsCorrect("net.jforum.dao.mysql.MysqlDataAccessDriver"); Properties p = this.loadSqlQueries(); if (p != null && p.size() > 0) { this.saveSqlQueries(new Properties()); } this.fixEncoding(); } |
public static void loadDaoImplementation() throws Exception | public static void loadDaoImplementation() | public static void loadDaoImplementation() throws Exception { // Start the dao.driver implementation String driver = SystemGlobals.getValue(ConfigKeys.DAO_DRIVER); logger.info("Loading JDBC driver " + driver); Class c = Class.forName(driver); DataAccessDriver d = (Dat... |
Class c = Class.forName(driver); DataAccessDriver d = (DataAccessDriver)c.newInstance(); DataAccessDriver.init(d); } | try { Class c = Class.forName(driver); DataAccessDriver d = (DataAccessDriver)c.newInstance(); DataAccessDriver.init(d); } catch (Exception e) { String es = "Erorr loadDaoImplementation()"; logger.error(es, e); throw new RuntimeException(es, e); } } | public static void loadDaoImplementation() throws Exception { // Start the dao.driver implementation String driver = SystemGlobals.getValue(ConfigKeys.DAO_DRIVER); logger.info("Loading JDBC driver " + driver); Class c = Class.forName(driver); DataAccessDriver d = (Dat... |
System.exit(0); | private static void alignToFile(int fileType, OutputStream os, Alignment align) throws Exception{ switch(fileType) { case MSFDNA: (new MSFAlignmentFormat()).writeDna(os, align); break; case MSFPROTEIN: (new MSFAlignmentFormat()).writeProtein(... | |
System.exit(0); | public static void biojavaToFile(int fileType, OutputStream os, Object biojava) throws Exception { switch (fileType) { case MSFDNA: case MSFPROTEIN: case FASTAALIGNDNA: case FASTAALIGNPROTEIN: alignToFile(fileType, os, (Alignment) biojava); ... | |
System.exit(0); | private static Alignment fileToAlign(int fileType, BufferedReader br) throws Exception{ switch(fileType) { case MSFDNA: case MSFPROTEIN: return (new MSFAlignmentFormat()).read(br); case FASTAALIGNDNA: case FASTAALIGNPROTEIN: return (ne... | |
System.exit(0); return null; | return null; | public static Object fileToBiojava(int fileType, BufferedReader br) throws Exception { switch (fileType) { case MSFDNA: case MSFPROTEIN: case FASTAALIGNDNA: case FASTAALIGNPROTEIN: return fileToAlign(fileType, br); case FASTADNA: ... |
System.exit(0); | private static SequenceIterator fileToSeq(int fileType, BufferedReader br) { switch (fileType) { case FASTADNA: return SeqIOTools.readFastaDNA(br); case FASTAPROTEIN: return SeqIOTools.readFastaProtein(br); case EMBL: return SeqIOT... | |
br.close(); | private static int guessFastaType(String fileName) throws Exception { BufferedReader br = new BufferedReader(new FileReader(fileName)); String line = br.readLine(); line = br.readLine(); for (int i = 0; i < line.length(); i++) { if (Character.toUpperCase(line.charAt(i)) == 'F'... | |
return 0; | return UNKNOWN; | public static int guessFileType(String fileName) throws Exception { //First tries by matching an extension if ((new RE(".*\\u002eem.*")).match(fileName)) { return EMBL; } else if ((new RE(".*\\u002egb.*")).match(fileName)) { return GENBANK; } else if (... |
br.close(); | private static int guessGenType(String fileName) throws Exception { BufferedReader br = new BufferedReader(new FileReader(fileName)); String line = br.readLine(); while (line.indexOf("LOCUS") == -1) { line = br.readLine(); } for (int i = 0; i < line.length(); i++) { ... | |
if (line.startsWith("N")) { | if (line.substring(typeIndex).startsWith("N")) { | private static int guessMsfType(String fileName) throws Exception { BufferedReader br = new BufferedReader(new FileReader(fileName)); String line = br.readLine(); if (line.startsWith("!!NA_MULTIPLE_ALIGNMENT")) { return MSFDNA; } else if (line.startsWith("!!AA_MULTIPLE_... |
else if (line.startsWith("P")) { | else if (line.substring(typeIndex).startsWith("P")) { | private static int guessMsfType(String fileName) throws Exception { BufferedReader br = new BufferedReader(new FileReader(fileName)); String line = br.readLine(); if (line.startsWith("!!NA_MULTIPLE_ALIGNMENT")) { return MSFDNA; } else if (line.startsWith("!!AA_MULTIPLE_... |
return 0; | return UNKNOWN; | private static int guessMsfType(String fileName) throws Exception { BufferedReader br = new BufferedReader(new FileReader(fileName)); String line = br.readLine(); if (line.startsWith("!!NA_MULTIPLE_ALIGNMENT")) { return MSFDNA; } else if (line.startsWith("!!AA_MULTIPLE_... |
System.exit(0); | private static void seqToFile(int fileType, OutputStream os, SequenceIterator seq) throws IOException, BioException { switch (fileType) { case FASTADNA: case FASTAPROTEIN: case FASTA: SeqIOTools.writeFasta(os, seq); break; case EMBL: ... | |
String sequenceData[] = null; | StringBuffer sequenceData[] = null; | public Alignment read (BufferedReader reader) { Vector sequenceNames = new Vector(); String sequenceName = null; String sequenceData[] = null; int startOfData = 0; //the start of the sequence data in the line int currSeqCount = 0; //which seque... |
sequenceData = new String[sequenceNames.size()]; | sequenceData = new StringBuffer[sequenceNames.size()]; | public Alignment read (BufferedReader reader) { Vector sequenceNames = new Vector(); String sequenceName = null; String sequenceData[] = null; int startOfData = 0; //the start of the sequence data in the line int currSeqCount = 0; //which seque... |
sequenceData[it] = new String(); | sequenceData[it] = new StringBuffer(); | public Alignment read (BufferedReader reader) { Vector sequenceNames = new Vector(); String sequenceName = null; String sequenceData[] = null; int startOfData = 0; //the start of the sequence data in the line int currSeqCount = 0; //which seque... |
sequenceData[currSeqCount] = sequenceData[currSeqCount].concat(line); | sequenceData[currSeqCount].append(line); | public Alignment read (BufferedReader reader) { Vector sequenceNames = new Vector(); String sequenceName = null; String sequenceData[] = null; int startOfData = 0; //the start of the sequence data in the line int currSeqCount = 0; //which seque... |
StringTokenizer st = null; st = new StringTokenizer(testString.toString().toLowerCase(), "a"); agct += st.countTokens(); st = new StringTokenizer(testString.toString().toLowerCase(), "g"); agct += st.countTokens(); st = new StringTokenizer(testString.toString().toLowerCase(), "c"); agct += st.countTokens(); st = new St... | String testStringUpper=testString.toString().toUpperCase(); | public Alignment read (BufferedReader reader) { Vector sequenceNames = new Vector(); String sequenceName = null; String sequenceData[] = null; int startOfData = 0; //the start of the sequence data in the line int currSeqCount = 0; //which seque... |
for (int i = 0; i < testString.toString().length(); i++) { if (Character.toUpperCase(testString.toString().charAt(i)) == 'F' || Character.toUpperCase(testString.toString().charAt(i)) == 'L' || Character.toUpperCase(testString.toString().charAt(i)) == 'I' || Character.toUpperCase(testString.toString().charAt(i)) == 'P' ... | for (int i = 0; i < testStringUpper.length(); i++) { char c=testStringUpper.charAt(i); if (c == 'F' || c == 'L' || c == 'I' || c == 'P' || c == 'Q' || c == 'E') { | public Alignment read (BufferedReader reader) { Vector sequenceNames = new Vector(); String sequenceName = null; String sequenceData[] = null; int startOfData = 0; //the start of the sequence data in the line int currSeqCount = 0; //which seque... |
String sd = null; | String sd = sequenceData[currSeqCount].toString(); | public Alignment read (BufferedReader reader) { Vector sequenceNames = new Vector(); String sequenceName = null; String sequenceData[] = null; int startOfData = 0; //the start of the sequence data in the line int currSeqCount = 0; //which seque... |
sd = sequenceData[currSeqCount].replace('~', '-'); sd = sequenceData[currSeqCount].replace('.', '-'); StringBuffer sb = new StringBuffer(); SymbolList sl = null; | sd = sd.replace('~', '-'); sd = sd.replace('.', '-'); | public Alignment read (BufferedReader reader) { Vector sequenceNames = new Vector(); String sequenceName = null; String sequenceData[] = null; int startOfData = 0; //the start of the sequence data in the line int currSeqCount = 0; //which seque... |
String[] lineDelimiters = mEditor.getDocument().getLegalLineDelimiters(); String newline = lineDelimiters.length == 0 ? "\n" : lineDelimiters[0]; | String newline = TextUtilities.getDefaultLineDelimiter(mEditor.getDocument()); | public void run() { int point = mEditor.getPoint(); String[] lineDelimiters = mEditor.getDocument().getLegalLineDelimiters(); String newline = lineDelimiters.length == 0 ? "\n" : lineDelimiters[0]; if (mSubsection) { mEditor.insertText(point, Comments.createSectionComment(newl... |
public void parse(LatexLexer lexer, | public void parse(LatexLexer lex, | public void parse(LatexLexer lexer, ReferenceContainer definedLabels, ReferenceContainer definedBibs, OutlineNode preamble) throws LexerException, IOException { initializeDatastructs(); StackUnsynch blocks = new StackUnsynch(); boolean expectArg = fal... |
ReferenceContainer definedBibs, OutlineNode preamble) | ReferenceContainer definedBibs) | public void parse(LatexLexer lexer, ReferenceContainer definedLabels, ReferenceContainer definedBibs, OutlineNode preamble) throws LexerException, IOException { initializeDatastructs(); StackUnsynch blocks = new StackUnsynch(); boolean expectArg = fal... |
initializeDatastructs(); StackUnsynch blocks = new StackUnsynch(); boolean expectArg = false; boolean expectArg2 = false; Token prevToken = null; TexCommandEntry currentCommand = null; int argCount = 0; Integer nodeType; HashMap sectioning = new HashMap(); if (preamble != null) { outlineTree.add(preamble); blocks.p... | parse(lex, definedLabels, definedBibs, null); | public void parse(LatexLexer lexer, ReferenceContainer definedLabels, ReferenceContainer definedBibs, OutlineNode preamble) throws LexerException, IOException { initializeDatastructs(); StackUnsynch blocks = new StackUnsynch(); boolean expectArg = fal... |
try { handler.setSubjectDB(parseDB(line)); } catch (BioException bex) { throw new BioException(bex, "Unable to retrieve the subject database from line:\n" + line); } | handler.setSubjectDB(parseDB(line)); | public boolean parseSearch(BufferedReader reader, SearchContentHandler scHandler) throws IOException, BioException, ParserException { boolean foundQuerySeqID = false; lineNumber = 0; FastaSearchBuilder handler = (FastaSearchBuilder) scHandler; LINE: while ((line = reader.readLine()) != null) { ... |
hitData.put("querySeqTokens", querySeqTokens.toString()); querySeqTokens.setLength(0); | hitData.put("querySeqTokens", querySeqTokens.toString()); | public boolean parseSearch(BufferedReader reader, SearchContentHandler scHandler) throws IOException, BioException, ParserException { boolean foundQuerySeqID = false; lineNumber = 0; FastaSearchBuilder handler = (FastaSearchBuilder) scHandler; LINE: while ((line = reader.readLine()) != null) { ... |
subjectSeqTokens.setLength(0); | public boolean parseSearch(BufferedReader reader, SearchContentHandler scHandler) throws IOException, BioException, ParserException { boolean foundQuerySeqID = false; lineNumber = 0; FastaSearchBuilder handler = (FastaSearchBuilder) scHandler; LINE: while ((line = reader.readLine()) != null) { ... | |
} else if (line.startsWith(">>><<<")) { searchStatus = NODATA; hitData.put("querySeqTokens", querySeqTokens.toString()); hitData.put("subjectSeqTokens", subjectSeqTokens.toString()); handler.endSubHit(); handler.endSearch(); searchParsed = true; moreSearchesAvailable = false; continue LINE; | public boolean parseSearch(BufferedReader reader, SearchContentHandler scHandler) throws IOException, BioException, ParserException { boolean foundQuerySeqID = false; lineNumber = 0; FastaSearchBuilder handler = (FastaSearchBuilder) scHandler; LINE: while ((line = reader.readLine()) != null) { ... | |
public ParserException(String detail, String locator, int lineNumber, String line) { | public ParserException(String detail) { | public ParserException(String detail, String locator, int lineNumber, String line) { super(detail); this.locator = locator; this.lineNumber = lineNumber; this.line = line; } |
this.locator = locator; this.lineNumber = lineNumber; this.line = line; | public ParserException(String detail, String locator, int lineNumber, String line) { super(detail); this.locator = locator; this.lineNumber = lineNumber; this.line = line; } | |
public BioException(Throwable ex, String message) { super(message); this.subThrowable = ex; | public BioException(String message) { super(message); | public BioException(Throwable ex, String message) { super(message); this.subThrowable = ex; } |
protected void addNewPostText(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PostModel.addNewPostText")); p.setInt(1, post.getId()); p.setString(2, post.getSubject()); p.executeUpdate(); p.close(); OracleUtils.writeBlobUTF16BinaryStream... | protected void addNewPostText(Post post) throws SQLException { PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PostModel.addNewPostText")); p.setInt(1, post.getId()); p.setString(2, post.getSubject()); p.executeUpdate(); p.close(); OracleUtils.writeBlob... | protected void addNewPostText(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PostModel.addNewPostText")); p.setInt(1, post.getId()); p.setString(2, post.getSubject()); p.executeUpdate(); p.close(); OracleUtils.writeBlobUTF16Bina... |
); } | ); } finally { DbUtils.close(p); } } | protected void addNewPostText(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PostModel.addNewPostText")); p.setInt(1, post.getId()); p.setString(2, post.getSubject()); p.executeUpdate(); p.close(); OracleUtils.writeBlobUTF16Bina... |
protected String getPostTextFromResultSet(ResultSet rs) throws Exception | protected String getPostTextFromResultSet(ResultSet rs) throws SQLException | protected String getPostTextFromResultSet(ResultSet rs) throws Exception { return OracleUtils.readBlobUTF16BinaryStream(rs, "post_text"); } |
public List selectAllByTopicByLimit(int topicId, int startFrom, int count) throws Exception | public List selectAllByTopicByLimit(int topicId, int startFrom, int count) | public List selectAllByTopicByLimit(int topicId, int startFrom, int count) throws Exception { return super.selectAllByTopicByLimit(topicId, startFrom, startFrom + count); } |
public List selectByUserByLimit(int userId,int startFrom, int count) throws Exception | public List selectByUserByLimit(int userId,int startFrom, int count) | public List selectByUserByLimit(int userId,int startFrom, int count) throws Exception { return super.selectByUserByLimit(userId, startFrom, startFrom + count); } |
protected void updatePostsTextTable(Post post) throws Exception | protected void updatePostsTextTable(Post post) throws SQLException | protected void updatePostsTextTable(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PostModel.updatePostText")); p.setString(1, post.getSubject()); p.setInt(2, post.getId()); p.executeUpdate(); p.close(); OracleUtils.writeBlobU... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PostModel.updatePostText")); p.setString(1, post.getSubject()); p.setInt(2, post.getId()); p.executeUpdate(); p.close(); OracleUtils.writeBlobUTF16BinaryStream( | PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PostModel.updatePostText")); p.setString(1, post.getSubject()); p.setInt(2, post.getId()); p.executeUpdate(); OracleUtils.writeBlobUTF16BinaryStream( | protected void updatePostsTextTable(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PostModel.updatePostText")); p.setString(1, post.getSubject()); p.setInt(2, post.getId()); p.executeUpdate(); p.close(); OracleUtils.writeBlobU... |
); } | ); } finally { DbUtils.close(p); } } | protected void updatePostsTextTable(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PostModel.updatePostText")); p.setString(1, post.getSubject()); p.setInt(2, post.getId()); p.executeUpdate(); p.close(); OracleUtils.writeBlobU... |
protected void addNewPostText(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.addNewPostText")); p.setInt(1, post.getId()); p.setString(2, post.getText()); p.setString(3, post.getSubject()); p.executeUpdate(); p.close(); } | protected void addNewPostText(Post post) throws SQLException { PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.addNewPostText")); p.setInt(1, post.getId()); p.setString(2, post.getText()); p.setString(3, post.getSubject()); p.executeUpdate(); ... | protected void addNewPostText(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.addNewPostText")); p.setInt(1, post.getId()); p.setString(2, post.getText()); p.setString(3, post.getSubject()); p.executeUpdate(); p.close... |
OutputStream blobWriter = ((oracle.sql.BLOB) postText).getBinaryOutputStream(); | OutputStream blobWriter = postText.setBinaryStream(0); | public static void writeBlobUTF16BinaryStream(String query, int idForQuery, String value) throws IOException, SQLException { PreparedStatement p = JForum.getConnection().prepareStatement(query); p.setInt(1, idForQuery); ResultSet rs = p.executeQuery(); rs.next(); Blob postText = rs.getBlob(1); OutputStream blo... |
protected String getPostTextFromResultSet(ResultSet rs) throws Exception | protected String getPostTextFromResultSet(ResultSet rs) throws SQLException | protected String getPostTextFromResultSet(ResultSet rs) throws Exception { return rs.getString("post_text"); } |
public List selectAllByTopicByLimit(int topicId, int startFrom, int count) throws Exception | public List selectAllByTopicByLimit(int topicId, int startFrom, int count) | public List selectAllByTopicByLimit(int topicId, int startFrom, int count) throws Exception { List l = new ArrayList(); String sql = SystemGlobals.getSql("PostModel.selectAllByTopicByLimit"); sql = sql.replaceAll(":fids:", ForumRepository.getListAllowedForums()); PreparedStatement p = JForumExecutionContext.getCon... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(sql); p.setInt(1, topicId); p.setInt(2, startFrom); p.setInt(3, count); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(sql); p.setInt(1, topicId); p.setInt(2, startFrom); p.setInt(3, count); | public List selectAllByTopicByLimit(int topicId, int startFrom, int count) throws Exception { List l = new ArrayList(); String sql = SystemGlobals.getSql("PostModel.selectAllByTopicByLimit"); sql = sql.replaceAll(":fids:", ForumRepository.getListAllowedForums()); PreparedStatement p = JForumExecutionContext.getCon... |
ResultSet rs = p.executeQuery(); | rs = p.executeQuery(); | public List selectAllByTopicByLimit(int topicId, int startFrom, int count) throws Exception { List l = new ArrayList(); String sql = SystemGlobals.getSql("PostModel.selectAllByTopicByLimit"); sql = sql.replaceAll(":fids:", ForumRepository.getListAllowedForums()); PreparedStatement p = JForumExecutionContext.getCon... |
rs.close(); p.close(); return l; } | return l; } catch (SQLException e) { String es = "Erorr selectAllByTopicByLimit()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } } | public List selectAllByTopicByLimit(int topicId, int startFrom, int count) throws Exception { List l = new ArrayList(); String sql = SystemGlobals.getSql("PostModel.selectAllByTopicByLimit"); sql = sql.replaceAll(":fids:", ForumRepository.getListAllowedForums()); PreparedStatement p = JForumExecutionContext.getCon... |
public List selectByUserByLimit(int userId, int startFrom, int count) throws Exception | public List selectByUserByLimit(int userId, int startFrom, int count) | public List selectByUserByLimit(int userId, int startFrom, int count) throws Exception { String sql = SystemGlobals.getSql("PostModel.selectByUserByLimit"); sql = sql.replaceAll(":fids:", ForumRepository.getListAllowedForums()); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(sql); p.... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(sql); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(sql); | public List selectByUserByLimit(int userId, int startFrom, int count) throws Exception { String sql = SystemGlobals.getSql("PostModel.selectByUserByLimit"); sql = sql.replaceAll(":fids:", ForumRepository.getListAllowedForums()); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(sql); p.... |
ResultSet rs = p.executeQuery(); List l = new ArrayList(); | rs = p.executeQuery(); List l = new ArrayList(); | public List selectByUserByLimit(int userId, int startFrom, int count) throws Exception { String sql = SystemGlobals.getSql("PostModel.selectByUserByLimit"); sql = sql.replaceAll(":fids:", ForumRepository.getListAllowedForums()); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(sql); p.... |
rs.close(); p.close(); return l; } | return l; } catch (SQLException e) { String es = "Erorr selectByUserByLimit()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } } | public List selectByUserByLimit(int userId, int startFrom, int count) throws Exception { String sql = SystemGlobals.getSql("PostModel.selectByUserByLimit"); sql = sql.replaceAll(":fids:", ForumRepository.getListAllowedForums()); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(sql); p.... |
protected void updatePostsTextTable(Post post) throws Exception | protected void updatePostsTextTable(Post post) throws SQLException | protected void updatePostsTextTable(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.updatePostText")); p.setString(1, post.getText()); p.setString(2, post.getSubject()); p.setInt(3, post.getId()); p.executeUpdate(); p... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.updatePostText")); p.setString(1, post.getText()); p.setString(2, post.getSubject()); p.setInt(3, post.getId()); | PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.updatePostText")); p.setString(1, post.getText()); p.setString(2, post.getSubject()); p.setInt(3, post.getId()); | protected void updatePostsTextTable(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.updatePostText")); p.setString(1, post.getText()); p.setString(2, post.getSubject()); p.setInt(3, post.getId()); p.executeUpdate(); p... |
p.executeUpdate(); p.close(); } | p.executeUpdate(); } catch (SQLException e) { String es = "Erorr updatePostsTextTable()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(p); } } | protected void updatePostsTextTable(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.updatePostText")); p.setString(1, post.getText()); p.setString(2, post.getSubject()); p.setInt(3, post.getId()); p.executeUpdate(); p... |
this.setupTemplateContext(); | if (!isDatabaseUp) { this.startDatabase(); } | public void service(HttpServletRequest req, HttpServletResponse response) throws IOException, ServletException { BufferedWriter out = null; try { // Initializes thread local data DataHolder dataHolder = new DataHolder(); localData.set(dataHolder); String encoding = SystemGlobals.getValue(ConfigKeys.ENCODIN... |
if (!isDatabaseUp) { this.startDatabase(); } | this.setupTemplateContext(); | public void service(HttpServletRequest req, HttpServletResponse response) throws IOException, ServletException { BufferedWriter out = null; try { // Initializes thread local data DataHolder dataHolder = new DataHolder(); localData.set(dataHolder); String encoding = SystemGlobals.getValue(ConfigKeys.ENCODIN... |
JForum.getContext().put("forumTitle", SystemGlobals.getValue(ConfigKeys.FORUM_PAGE_TITLE)); | protected void setupTemplateContext() { JForum.getContext().put("contextPath", JForum.getRequest().getContextPath()); JForum.getContext().put("serverName", JForum.getRequest().getServerName()); JForum.getContext().put("templateName", SystemGlobals.getValue(ConfigKeys.TEMPLATE_NAME)); JForum.getContext().put("exten... | |
public static void load(String localeName) throws IOException | public static synchronized void load() throws IOException | public static void load(String localeName) throws IOException { Properties p = new Properties(); p.load(new FileInputStream(baseDir + localeNames.getProperty(localeName))); messagesMap.put(localeName, p); } |
Properties p = new Properties(); p.load(new FileInputStream(baseDir + localeNames.getProperty(localeName))); messagesMap.put(localeName, p); | baseDir = SystemGlobals.getApplicationResourceDir() +"config/languages/"; localeNames.load(new FileInputStream(baseDir +"locales.properties")); defaultName = (String)SystemGlobals.getValue("i18n.default"); load(defaultName); | public static void load(String localeName) throws IOException { Properties p = new Properties(); p.load(new FileInputStream(baseDir + localeNames.getProperty(localeName))); messagesMap.put(localeName, p); } |
superRequest.setCharacterEncoding(SystemGlobals.getValue(ConfigKeys.ENCODING)); | superRequest.setCharacterEncoding(encoding); | public ActionServletRequest(HttpServletRequest superRequest) throws IOException { super(superRequest); this.query = new HashMap(); boolean isMultipart = false; String requestType = (superRequest.getMethod()).toUpperCase(); String requestUri = superRequest.getRequestURI(); // Remove the "jsessionid" (or simil... |
upload.setHeaderEncoding(encoding); | public ActionServletRequest(HttpServletRequest superRequest) throws IOException { super(superRequest); this.query = new HashMap(); boolean isMultipart = false; String requestType = (superRequest.getMethod()).toUpperCase(); String requestUri = superRequest.getRequestURI(); // Remove the "jsessionid" (or simil... | |
public static void load(int userId) throws Exception | public static void load(int userId, boolean force) throws Exception | public static void load(int userId) throws Exception { SecurityRepository.load(userId, false); } |
SecurityRepository.load(userId, false); | if (force || SecurityRepository.securityInfoMap.containsKey(new Integer(userId)) == false) { UserModel um = DataAccessDriver.getInstance().newUserModel(); SecurityRepository.load(um.selectById(userId), force); } | public static void load(int userId) throws Exception { SecurityRepository.load(userId, false); } |
return source.getID() + dest.getID() + alfaIdx.indexForSymbol(sym); | return (source.getID() << 20) + (dest.getID() << 10) + ((sym == null)?999:alfaIdx.indexForSymbol(sym)); | public int hashCode() { try { return source.getID() + dest.getID() + alfaIdx.indexForSymbol(sym); } catch (IllegalSymbolException ise) { throw new BioError("Fatal error: Unexpected IllegalSymbolException on computing indexForSymbol."); ... |
public static AlphabetIndex getAlphabetIndex( FiniteAlphabet alpha ) { final int generateIndexSize = 160; AlphabetIndex ai = (AlphabetIndex) alphabetToIndex.get(alpha); if(ai == null) { int size = alpha.size(); if(size <= generateIndexSize) { ai = new LinearAlphabetIndex(alpha); } else { ai = new HashedAlphabetIndex(al... | public static AlphabetIndex getAlphabetIndex(FiniteAlphabet alpha) { final int generateIndexSize = 10; AlphabetIndex ai = (AlphabetIndex) alphabetToIndex.get(alpha); if(ai == null) { int size = alpha.size(); if(size <= generateIndexSize) { ai = new LinearAlphabetIndex(alpha); } else { if (alpha.getAlphabets().size() > ... | public static AlphabetIndex getAlphabetIndex( FiniteAlphabet alpha ) { final int generateIndexSize = 160; AlphabetIndex ai = (AlphabetIndex) alphabetToIndex.get(alpha); if(ai == null) { int size = alpha.size(); if(size <= generateIndexSize) { ai = new LinearAlphabetIndex(alpha); } e... |
return ai; } | public static AlphabetIndex getAlphabetIndex( FiniteAlphabet alpha ) { final int generateIndexSize = 160; AlphabetIndex ai = (AlphabetIndex) alphabetToIndex.get(alpha); if(ai == null) { int size = alpha.size(); if(size <= generateIndexSize) { ai = new LinearAlphabetIndex(alpha); } e... | |
public TexCellListener(TableViewer viewer, TexRowList texRowList, int column) { this.viewer = viewer; this.texRowList = texRowList; this.column = column; | private TexCellListener() { | public TexCellListener(TableViewer viewer, TexRowList texRowList, int column) { this.viewer = viewer; this.texRowList = texRowList; this.column = column; } |
"Failed to trasfer file: " + url + ". Return code is: " + statusCode ); | "Failed to transfer file: " + url + ". Return code is: " + statusCode ); | public List getFileList( String destinationDirectory ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { if ( !destinationDirectory.endsWith( "/" ) ) { destinationDirectory += "/"; } String url = getRepository().getUrl() + "/" +... |
throw new AuthorizationException( "Access denided to: " + url ); | throw new AuthorizationException( "Access denied to: " + url ); | public boolean resourceExists( String resourceName ) throws TransferFailedException, AuthorizationException { String url = getRepository().getUrl() + "/" + resourceName; HeadMethod headMethod = new HeadMethod( url ); int statusCode = SC_NULL; int attempt = 0; ... |
throw new TransferFailedException( "Failed to trasfer file: " + url + ". Return code is: " | throw new TransferFailedException( "Failed to transfer file: " + url + ". Return code is: " | public boolean resourceExists( String resourceName ) throws TransferFailedException, AuthorizationException { String url = getRepository().getUrl() + "/" + resourceName; HeadMethod headMethod = new HeadMethod( url ); int statusCode = SC_NULL; int attempt = 0; ... |
SymbolParser sParser = alpha.getParser("token"); | SymbolTokenization sParser = alpha.getTokenization("token"); | public static void main(String[] args) { try { if(args.length != 3) { throw new Exception("Use: indexName format alphabet"); } String indexName = args[0]; File indexFile = new File(indexName); File indexList = new File(indexName + ".list"); String formatName = args[1]; Str... |
this.storeFile = storeFile; this.indexFile = indexFile; | this.storeFile = storeFile.getAbsoluteFile(); this.indexFile = indexFile.getAbsoluteFile(); | public TabIndexStore( File storeFile, File indexFile, String name, SequenceFormat format, SequenceBuilderFactory sbFactory, SymbolTokenization symbolParser ) throws IOException, BioException { if(storeFile.exists() || indexFile.exists()) { throw new BioException("Files already exist"); ... |
java.util.Iterator iter = subLocations.iterator(); while (iter.hasNext()) { Location loc = (Location)(iter.next()); subRegions.add(new RemoteFeature.Region(loc, null)); } | void parseLocation(String location, Feature.Template theTemplate) throws BioException { this.location = location; if ((countChar(location, '(')) != (countChar(location, ')'))) throw new BioException("Unbalanced parentheses in location: " + location); nextCharIndex = 0; ... | |
subRegions.add(new RemoteFeature.Region(createdLocation, null)); | private void processCoords() throws BioException { int outerMin, innerMin, innerMax, outerMax; Location createdLocation = null; // This is expected where two calls to processCoords() are // made sequentially e.g. where two levels of parens are // closed. The second call will have no data to process. if (startCoo... | |
Backend.instance().getAccountMgr().subscribe(this.listId, this.deliverTo); | Backend.instance().getListMgr().subscribeMe(this.listId, this.deliverTo); | public void authExecute() throws Exception { if (this.deliverTo.length() == 0) this.deliverTo = null; Backend.instance().getAccountMgr().subscribe(this.listId, this.deliverTo); } |
System.arraycopy(attributes, i + 1, temp, i, attributes.length - i); | System.arraycopy(attributes, i + 1, temp, i, attributes.length - i - 1); | /*package*/ final boolean remove(int tag) { for (int i = 0; i < attributes.length; i++) { if (attributes[i].getTag() == tag) { Attribute[] temp = new Attribute[attributes.length - 1]; System.arraycopy(attributes, 0, temp, 0, i); System.arraycopy(attributes, i + 1, temp, i, attributes.length - i); attributes =... |
throws IOException, ClassFileFormatException { AsciiConstant name = (AsciiConstant)cp.getEntryAt(in.readUnsignedShort()); String tag = name.getValue(); switch (tag.charAt(0)) { case 'C': if (tag.equals("Code")) { return new CodeInfo(in, cp); } else if (tag.equals("ConstantValue")) { return new ConstantValueAttribute... | throws IOException, ClassFileFormatException { AsciiConstant name = (AsciiConstant) cp.getEntryAt(in .readUnsignedShort()); String tag = name.getValue(); switch (tag.charAt(0)) { case 'C' : if (tag.equals("Code")) { return new CodeInfo(in, cp); } else if (tag.equals("ConstantValue")) { return new ConstantValueAttribute... | public static Attribute read(DataInput in, ConstantPool cp) throws IOException, ClassFileFormatException { AsciiConstant name = (AsciiConstant)cp.getEntryAt(in.readUnsignedShort()); String tag = name.getValue(); switch (tag.charAt(0)) { case 'C': if (tag.equals("Code")) { return new CodeInfo(in,... |
public SimpleFieldSet(String content, boolean multiLevel) throws IOException { | public SimpleFieldSet(BufferedReader br, boolean multiLevel) throws IOException { | public SimpleFieldSet(String content, boolean multiLevel) throws IOException { map = new HashMap(); this.multiLevel = multiLevel; StringReader sr = new StringReader(content); BufferedReader br = new BufferedReader(sr); read(br); } |
StringReader sr = new StringReader(content); BufferedReader br = new BufferedReader(sr); read(br); | read(br); | public SimpleFieldSet(String content, boolean multiLevel) throws IOException { map = new HashMap(); this.multiLevel = multiLevel; StringReader sr = new StringReader(content); BufferedReader br = new BufferedReader(sr); read(br); } |
return 2.0 * zigDepth + blockDepth + 1.0; | return blockDepth + 1.0; | public double getDepth(SequenceRenderContext src, RangeLocation pos) { return 2.0 * zigDepth + blockDepth + 1.0; } |
startP = new Point2D.Double(start, zigDepth + blockDepth); midP = new Point2D.Double(mid, zigDepth + blockDepth + zigDepth); endP = new Point2D.Double(end, zigDepth + blockDepth); | startP = new Point2D.Double(start, half); midP = new Point2D.Double(mid, blockDepth); endP = new Point2D.Double(end, half); | private void renderLink( Graphics2D g, Feature f, Location source, Location dest, SequenceRenderContext context ) { Line2D line = new Line2D.Double(); Point2D startP; Point2D midP; Point2D endP; if(context.getDirection() == context.HORIZONTAL) { if( (f instanceof StrandedFeature) && ... |
startP = new Point2D.Double(start, zigDepth); | startP = new Point2D.Double(start, half); | private void renderLink( Graphics2D g, Feature f, Location source, Location dest, SequenceRenderContext context ) { Line2D line = new Line2D.Double(); Point2D startP; Point2D midP; Point2D endP; if(context.getDirection() == context.HORIZONTAL) { if( (f instanceof StrandedFeature) && ... |
endP = new Point2D.Double(end, zigDepth); | endP = new Point2D.Double(end, half); | private void renderLink( Graphics2D g, Feature f, Location source, Location dest, SequenceRenderContext context ) { Line2D line = new Line2D.Double(); Point2D startP; Point2D midP; Point2D endP; if(context.getDirection() == context.HORIZONTAL) { if( (f instanceof StrandedFeature) && ... |
startP = new Point2D.Double(zigDepth + blockDepth, start); midP = new Point2D.Double(zigDepth + blockDepth + zigDepth, mid); endP = new Point2D.Double(zigDepth + blockDepth, end); | startP = new Point2D.Double(half, start); midP = new Point2D.Double(blockDepth, mid); endP = new Point2D.Double(half, end); | private void renderLink( Graphics2D g, Feature f, Location source, Location dest, SequenceRenderContext context ) { Line2D line = new Line2D.Double(); Point2D startP; Point2D midP; Point2D endP; if(context.getDirection() == context.HORIZONTAL) { if( (f instanceof StrandedFeature) && ... |
startP = new Point2D.Double(zigDepth, start); midP = new Point2D.Double(0.0, mid); endP = new Point2D.Double(zigDepth, end); | startP = new Point2D.Double(half, start); midP = new Point2D.Double(0.0, mid); endP = new Point2D.Double(half, end); | private void renderLink( Graphics2D g, Feature f, Location source, Location dest, SequenceRenderContext context ) { Line2D line = new Line2D.Double(); Point2D startP; Point2D midP; Point2D endP; if(context.getDirection() == context.HORIZONTAL) { if( (f instanceof StrandedFeature) && ... |
g.setPaint(getOutline()); | private void renderLink( Graphics2D g, Feature f, Location source, Location dest, SequenceRenderContext context ) { Line2D line = new Line2D.Double(); Point2D startP; Point2D midP; Point2D endP; if(context.getDirection() == context.HORIZONTAL) { if( (f instanceof StrandedFeature) && ... | |
min, zigDepth, | min, 0.0, | private void renderLocation( Graphics2D g, Location loc, SequenceRenderContext context ) { Rectangle2D.Double block = new Rectangle2D.Double(); double min = context.sequenceToGraphics(loc.getMin()); double max = context.sequenceToGraphics(loc.getMax()+1); if(context.getDirection() == context.HORIZONTA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.