rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
public void update(Category category) throws Exception
public void update(Category category)
public void update(Category category) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.update")); p.setString(1, category.getName()); p.setInt(2, category.isModerated() ? 1 : 0); p.setInt(3, category.getId()); p.executeUpdate()...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.update")); p.setString(1, category.getName()); p.setInt(2, category.isModerated() ? 1 : 0); p.setInt(3, category.getId()); p.executeUpdate(); p.close(); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.update")); p.setString(1, category.getName()); p.setInt(2, category.isModerated() ? 1 : 0); p.setInt(3, category.getId()); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr upda...
public void update(Category category) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("CategoryModel.update")); p.setString(1, category.getName()); p.setInt(2, category.isModerated() ? 1 : 0); p.setInt(3, category.getId()); p.executeUpdate()...
if(result == null) { StringBuffer classes = new StringBuffer(); Iterator ni = subSets.keySet().iterator(); if(ni.hasNext()) { Object obj = ni.next(); classes.append("\t'" + obj.toString() + "'=>'" + subSets.get(obj) + "'"); if(obj == name) { classes.append(" == "); } if(obj.equals(name)) { classes.append(" equals "); }...
public AceSet retrieve(String name) throws AceException { AceSet result = null; if (subSets != null) { result = (AceSet) subSets.get(name); if(result == null) { StringBuffer classes = new StringBuffer(); Iterator ni = subSets.keySet().iterator(); if(ni.hasNext...
throw new BioRuntimeException("Sequence " + name + " has gone missing!");
if (! (length >= 0)) { throw new BioRuntimeException("Length not available from database"); } symbols = new DummySymbolList((FiniteAlphabet) alphabet, length);
protected synchronized SymbolList getSymbols() throws BioRuntimeException { if (symbols == null) { if (biosequence_id < 0) { throw new BioError("Assertion failed: can only lazy-fetch sequence if from a biosequence entry"); } try { Connection conn = seqDB.getPool().takeConnection(); Prepar...
return getSymbols().length();
if (length >= 0) { return length; } else { return getSymbols().length(); }
public int length() { return getSymbols().length(); }
public void addChangeListener(ChangeListener cl, ChangeType ct) { if (changeSupport == null) { initChangeSupport(); } changeSupport.addChangeListener(cl, ct);
public void addChangeListener(ChangeListener cl) { addChangeListener(cl, ChangeType.UNKNOWN);
public void addChangeListener(ChangeListener cl, ChangeType ct) { if (changeSupport == null) { initChangeSupport(); } changeSupport.addChangeListener(cl, ct); }
public void removeChangeListener(ChangeListener cl, ChangeType ct) { if (changeSupport != null) { changeSupport.removeChangeListener(cl, ct); }
public void removeChangeListener(ChangeListener cl) { removeChangeListener(cl, ChangeType.UNKNOWN);
public void removeChangeListener(ChangeListener cl, ChangeType ct) { if (changeSupport != null) { changeSupport.removeChangeListener(cl, ct); } }
throw new ChangeVetoException("Don't (yet) support feature removal");
FeatureHolder fh = getFeatures(); if (!fh.containsFeature(f)) { throw new ChangeVetoException("Feature doesn't come from this sequence"); } if (!(f instanceof BioSQLFeatureI)) { throw new ChangeVetoException("This isn't a normal BioSQL feature"); } if (changeSupport == null) { seqDB.removeFeature((BioSQLFeatureI) f); ...
public void removeFeature(Feature f) throws ChangeVetoException { throw new ChangeVetoException("Don't (yet) support feature removal"); }
cleanup();
try { Context ctx = new InitialContext(); CleanupManagement cleaner = (CleanupManagement)ctx.lookup(CleanupManagement.JNDI_NAME); cleaner.cleanup(); } catch (NamingException ex) { throw new RuntimeException(ex); }
public void run() { cleanup(); }
/*
protected void initialize(KjcEnvironment environment) { super.initialize(environment); messageHandler = new CaesarMessageHandler(this); // create static instance of bcel world CaesarBcelWorld.createInstance(options.classpath); CaesarBcelWorld world = CaesarBcelWorl...
/*
protected void initialize(KjcEnvironment environment) { super.initialize(environment); messageHandler = new CaesarMessageHandler(this); // create static instance of bcel world CaesarBcelWorld.createInstance(options.classpath); CaesarBcelWorld world = CaesarBcelWorl...
System.out.println("before AsmBuilder.build"); CaesarAsmBuilder.build(cu[i], model); System.out.println("after AsmBuilder.build");
protected void preWeaveProcessing(JCompilationUnit[] cu) { // redefine in subclass if(Main.buildAsm){ for (int i = 0; i < cu.length; i++) { // note: AsmBuilder.build() starts the Visitor-part of AsmBuilder // iterating over the compilationunits and adding appropriate Nodes to ...
public boolean run(String[] args) { /* if (model == null) { model = new StructureModel();
public boolean run(String[] args) { if(Main.buildAsm){ if (model == null) { model = CaesarAsmBuilder.createHierarchy(); } CaesarAsmBuilder.preBuild(model);
public boolean run(String[] args) { /* // Make sure we have an instance of the structure model if (model == null) { model = new StructureModel(); } if(Main.buildAsm){ // starting to build CaesarAsm........ CaesarAsmBuilder.preBuild(model); //System.out.println("afte...
if(Main.buildAsm){ CaesarAsmBuilder.preBuild(model); } */
public boolean run(String[] args) { /* // Make sure we have an instance of the structure model if (model == null) { model = new StructureModel(); } if(Main.buildAsm){ // starting to build CaesarAsm........ CaesarAsmBuilder.preBuild(model); //System.out.println("afte...
/*
public boolean run(String[] args) { /* // Make sure we have an instance of the structure model if (model == null) { model = new StructureModel(); } if(Main.buildAsm){ // starting to build CaesarAsm........ CaesarAsmBuilder.preBuild(model); //System.out.println("afte...
*/
public boolean run(String[] args) { /* // Make sure we have an instance of the structure model if (model == null) { model = new StructureModel(); } if(Main.buildAsm){ // starting to build CaesarAsm........ CaesarAsmBuilder.preBuild(model); //System.out.println("afte...
if (element instanceof Throwable) return true; if (element instanceof StackTraceElement) { StackTraceElement stElement = (StackTraceElement) element; return (stElement.getFileName().endsWith(".scm")) && (stElement.getLineNumber() >= 0); } return false; }
if (element instanceof Throwable) return true; if (element instanceof StackTraceElement) { StackTraceElement stElement = (StackTraceElement) element; String filename = stElement.getFileName(); return filename != null && filename.endsWith(".scm") && stElement.getLineNumber() >= 0; } return false; }
public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof Throwable) return true; if (element instanceof StackTraceElement) { StackTraceElement stElement = (StackTraceElement) element; return (stElement....
if (element instanceof Throwable) return mStackElementImage; else { StackTraceElement stElement = (StackTraceElement) element; if (stElement.getFileName().endsWith(".scm")) return mSchemeStackElementImage; else if (stElement.getFileName().endsWith(".java")) return mJavaStackElementImage; else return mUnknownStackElemen...
if (element instanceof Throwable) return mStackElementImage; else { StackTraceElement stElement = (StackTraceElement) element; String fileName = stElement.getFileName(); if (fileName != null && fileName.endsWith(".scm")) return mSchemeStackElementImage; else if (fileName != null && fileName.endsWith(".java")) return m...
public Image getImage(Object element) { if (element instanceof Throwable) return mStackElementImage; else { StackTraceElement stElement = (StackTraceElement) element; if (stElement.getFileName().endsWith(".scm")) return mSchem...
if (element instanceof Throwable) { String message = ((Throwable) element).getMessage(); if (message == null) message = element.getClass().toString(); return message; } else { StackTraceElement stackElement = (StackTraceElement) element; File file = new File(stackElement.getFileName()); return stackElement.getMethodNam...
if (element instanceof Throwable) { String message = ((Throwable) element).getMessage(); if (message == null) message = element.getClass().toString(); return message; } else { StackTraceElement stackElement = (StackTraceElement) element; String fileName = stackElement.getFileName(); if (fileName != null) { File file =...
public String getText(Object element) { if (element instanceof Throwable) { String message = ((Throwable) element).getMessage(); if (message == null) message = element.getClass().toString(); return message; } else {...
recipients.add(rs.getString("username"));
recipients.add(rs.getString("user_email"));
public List listRecipients() throws Exception { String query = SystemGlobals.getSql("SummaryDAO.selectAllRecipients"); PreparedStatement p = JForum.getConnection().prepareStatement(query); List recipients = new ArrayList(); ResultSet rs = p.executeQuery(); while (rs.next()) { recipients.add(rs.getSt...
if ( permissions.getFileMode().matches( "/[0-9]{3}/" ) )
if ( permissions.getFileMode().matches( "[0-9]{3}" ) )
public void put( File source, String resourceName ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { String basedir = getRepository().getBasedir(); resourceName = StringUtils.replace( resourceName, "\\", "/" ); String dir = PathUtils.dirname( res...
public int addNew(Post post) throws Exception
public int addNew(Post post)
public int addNew(Post post) throws Exception { this.addNewPost(post); this.addNewPostText(post); // Search SearchFacade.index(post); return post.getId(); }
this.addNewPost(post); this.addNewPostText(post);
try { this.addNewPost(post); this.addNewPostText(post);
public int addNew(Post post) throws Exception { this.addNewPost(post); this.addNewPostText(post); // Search SearchFacade.index(post); return post.getId(); }
return post.getId(); }
return post.getId(); } catch (SQLException e) { String es = "Erorr addNew()"; log.error(es, e); throw new RuntimeException(es, e); } }
public int addNew(Post post) throws Exception { this.addNewPost(post); this.addNewPostText(post); // Search SearchFacade.index(post); return post.getId(); }
protected void addNewPost(Post post) throws Exception
protected void addNewPost(Post post)
protected void addNewPost(Post post) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("PostModel.addNewPost"); p.setInt(1, post.getTopicId()); p.setInt(2, post.getForumId()); p.setLong(3, post.getUserId()); p.setTimestamp(4, new Timestamp(post.getTime().getTime())); p.setString(5, post.getUs...
PreparedStatement p = this.getStatementForAutoKeys("PostModel.addNewPost");
PreparedStatement p=null; try { p = this.getStatementForAutoKeys("PostModel.addNewPost");
protected void addNewPost(Post post) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("PostModel.addNewPost"); p.setInt(1, post.getTopicId()); p.setInt(2, post.getForumId()); p.setLong(3, post.getUserId()); p.setTimestamp(4, new Timestamp(post.getTime().getTime())); p.setString(5, post.getUs...
this.setAutoGeneratedKeysQuery(SystemGlobals.getSql("PostModel.lastGeneratedPostId")); int postId = this.executeAutoKeysQuery(p); post.setId(postId); p.close(); }
this.setAutoGeneratedKeysQuery(SystemGlobals.getSql("PostModel.lastGeneratedPostId")); int postId = this.executeAutoKeysQuery(p); post.setId(postId); } catch (SQLException e) { String es = "Erorr addNewPost()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close( p); } }
protected void addNewPost(Post post) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("PostModel.addNewPost"); p.setInt(1, post.getTopicId()); p.setInt(2, post.getForumId()); p.setLong(3, post.getUserId()); p.setTimestamp(4, new Timestamp(post.getTime().getTime())); p.setString(5, post.getUs...
public int countPreviousPosts(int postId) throws Exception
public int countPreviousPosts(int postId)
public int countPreviousPosts(int postId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.countPreviousPosts")); p.setInt(1, postId); p.setInt(2, postId); ResultSet rs = p.executeQuery(); if (rs.next()) { total ...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.countPreviousPosts")); p.setInt(1, postId); p.setInt(2, postId);
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.countPreviousPosts")); p.setInt(1, postId); p.setInt(2, postId);
public int countPreviousPosts(int postId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.countPreviousPosts")); p.setInt(1, postId); p.setInt(2, postId); ResultSet rs = p.executeQuery(); if (rs.next()) { total ...
ResultSet rs = p.executeQuery();
rs = p.executeQuery();
public int countPreviousPosts(int postId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.countPreviousPosts")); p.setInt(1, postId); p.setInt(2, postId); ResultSet rs = p.executeQuery(); if (rs.next()) { total ...
rs.close(); p.close(); return total; }
return total; } catch (SQLException e) { String es = "Erorr countPreviousPosts()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } }
public int countPreviousPosts(int postId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.countPreviousPosts")); p.setInt(1, postId); p.setInt(2, postId); ResultSet rs = p.executeQuery(); if (rs.next()) { total ...
public int countUserPosts(int userId) throws Exception
public int countUserPosts(int userId)
public int countUserPosts(int userId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.countUserPosts").replaceAll(":fids:", ForumRepository.getListAllowedForums())); p.setInt(1, userId); ResultSet rs = p.execut...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.countUserPosts").replaceAll(":fids:", ForumRepository.getListAllowedForums())); p.setInt(1, userId);
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.countUserPosts").replaceAll(":fids:", ForumRepository.getListAllowedForums())); p.setInt(1, userId);
public int countUserPosts(int userId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.countUserPosts").replaceAll(":fids:", ForumRepository.getListAllowedForums())); p.setInt(1, userId); ResultSet rs = p.execut...
ResultSet rs = p.executeQuery();
rs = p.executeQuery();
public int countUserPosts(int userId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.countUserPosts").replaceAll(":fids:", ForumRepository.getListAllowedForums())); p.setInt(1, userId); ResultSet rs = p.execut...
rs.close(); p.close(); return total; }
return total; } catch (SQLException e) { String es = "Erorr countUserPosts()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } }
public int countUserPosts(int userId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.countUserPosts").replaceAll(":fids:", ForumRepository.getListAllowedForums())); p.setInt(1, userId); ResultSet rs = p.execut...
public void delete(Post post) throws Exception
public void delete(Post post)
public void delete(Post post) throws Exception { List l = new ArrayList(); l.add(post); this.removePosts(l); }
public void deleteByTopic(int topicId) throws Exception
public void deleteByTopic(int topicId)
public void deleteByTopic(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deleteByTopic")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); List posts = new ArrayList(); while (rs.next()) { Post post = new P...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deleteByTopic")); p.setInt(1, topicId); ResultSet rs = p.executeQuery();
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deleteByTopic")); p.setInt(1, topicId); rs = p.executeQuery();
public void deleteByTopic(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deleteByTopic")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); List posts = new ArrayList(); while (rs.next()) { Post post = new P...
rs.close(); p.close(); this.removePosts(posts); }
this.removePosts(posts); } catch (SQLException e) { String es = "Erorr deleteByTopic()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } }
public void deleteByTopic(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deleteByTopic")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); List posts = new ArrayList(); while (rs.next()) { Post post = new P...
protected Post makePost(ResultSet rs) throws Exception
protected Post makePost(ResultSet rs) throws SQLException
protected Post makePost(ResultSet rs) throws Exception { Post post = new Post(); post.setId(rs.getInt("post_id")); post.setTopicId(rs.getInt("topic_id")); post.setForumId(rs.getInt("forum_id")); post.setUserId(rs.getInt("user_id")); Timestamp postTime = rs.getTimestamp("post_time"); post.setTime(new Date(postTi...
private void removePosts(List posts) throws Exception
private void removePosts(List posts)
private void removePosts(List posts) throws Exception { PreparedStatement post = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePost")); PreparedStatement text = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePostTe...
PreparedStatement post = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePost")); PreparedStatement text = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePostText")); PreparedStatement search = JForumExecutionContext.getConne...
PreparedStatement post=null; PreparedStatement text=null; PreparedStatement search=null;
private void removePosts(List posts) throws Exception { PreparedStatement post = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePost")); PreparedStatement text = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePostTe...
for (Iterator iter = posts.iterator(); iter.hasNext();) { Post p = (Post) iter.next();
try { post = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePost"));
private void removePosts(List posts) throws Exception { PreparedStatement post = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePost")); PreparedStatement text = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePostTe...
post.setInt(1, p.getId()); text.setInt(1, p.getId()); search.setInt(1, p.getId());
text = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePostText"));
private void removePosts(List posts) throws Exception { PreparedStatement post = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePost")); PreparedStatement text = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePostTe...
text.executeUpdate(); search.executeUpdate(); post.executeUpdate(); }
search = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deleteWordMatch"));
private void removePosts(List posts) throws Exception { PreparedStatement post = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePost")); PreparedStatement text = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePostTe...
search.close(); post.close(); text.close(); }
for (Iterator iter = posts.iterator(); iter.hasNext();) { Post p = (Post) iter.next(); post.setInt(1, p.getId()); text.setInt(1, p.getId()); search.setInt(1, p.getId()); text.executeUpdate(); search.executeUpdate(); post.executeUpdate(); } } catch (SQLException e) { String es = "Erorr removePosts()"; log.error(es, e)...
private void removePosts(List posts) throws Exception { PreparedStatement post = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePost")); PreparedStatement text = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.deletePostTe...
public List selectAllByTopic(int topicId) throws Exception
public List selectAllByTopic(int topicId)
public List selectAllByTopic(int topicId) throws Exception { return this.selectAllByTopicByLimit(topicId, 0, Integer.MAX_VALUE - 1); }
public Post selectById(int postId) throws Exception
public Post selectById(int postId)
public Post selectById(int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.selectById")); p.setInt(1, postId); ResultSet rs = p.executeQuery(); Post post = new Post(); if (rs.next()) { post = this.makePost(rs); } rs.c...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.selectById")); p.setInt(1, postId);
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.selectById")); p.setInt(1, postId);
public Post selectById(int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.selectById")); p.setInt(1, postId); ResultSet rs = p.executeQuery(); Post post = new Post(); if (rs.next()) { post = this.makePost(rs); } rs.c...
ResultSet rs = p.executeQuery();
rs = p.executeQuery();
public Post selectById(int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.selectById")); p.setInt(1, postId); ResultSet rs = p.executeQuery(); Post post = new Post(); if (rs.next()) { post = this.makePost(rs); } rs.c...
rs.close(); p.close(); return post; }
return post; } catch (SQLException e) { String es = "Erorr selectById()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } }
public Post selectById(int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.selectById")); p.setInt(1, postId); ResultSet rs = p.executeQuery(); Post post = new Post(); if (rs.next()) { post = this.makePost(rs); } rs.c...
public void update(Post post) throws Exception
public void update(Post post)
public void update(Post post) throws Exception { this.updatePostsTable(post); this.updatePostsTextTable(post); SearchFacade.index(post); }
this.updatePostsTable(post); this.updatePostsTextTable(post);
try { this.updatePostsTable(post); this.updatePostsTextTable(post);
public void update(Post post) throws Exception { this.updatePostsTable(post); this.updatePostsTextTable(post); SearchFacade.index(post); }
SearchFacade.index(post); }
SearchFacade.index(post); } catch (SQLException e) { String es = "Erorr update()"; log.error(es, e); throw new RuntimeException(es, e); } }
public void update(Post post) throws Exception { this.updatePostsTable(post); this.updatePostsTextTable(post); SearchFacade.index(post); }
protected void updatePostsTable(Post post) throws Exception
protected void updatePostsTable(Post post)
protected void updatePostsTable(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.updatePost")); p.setInt(1, post.getTopicId()); p.setInt(2, post.getForumId()); p.setInt(3, post.isBbCodeEnabled() ? 1 : 0); p.setInt(4, po...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.updatePost")); p.setInt(1, post.getTopicId()); p.setInt(2, post.getForumId()); p.setInt(3, post.isBbCodeEnabled() ? 1 : 0); p.setInt(4, post.isHtmlEnabled() ? 1 : 0); p.setInt(5, post.isSmiliesEnabled() ? 1 : ...
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.updatePost")); p.setInt(1, post.getTopicId()); p.setInt(2, post.getForumId()); p.setInt(3, post.isBbCodeEnabled() ? 1 : 0); p.setInt(4, post.isHtmlEnabled() ? 1 : 0); p.setInt(5, post.isSmiliesEn...
protected void updatePostsTable(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.updatePost")); p.setInt(1, post.getTopicId()); p.setInt(2, post.getForumId()); p.setInt(3, post.isBbCodeEnabled() ? 1 : 0); p.setInt(4, po...
p.executeUpdate(); p.close(); }
p.executeUpdate(); } catch (SQLException e) { String es = "Erorr updatePostsTable()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close( p); } }
protected void updatePostsTable(Post post) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PostModel.updatePost")); p.setInt(1, post.getTopicId()); p.setInt(2, post.getForumId()); p.setInt(3, post.isBbCodeEnabled() ? 1 : 0); p.setInt(4, po...
modifyMethodRefs(newClass);
modifyMethodAndFieldRefs(newClass);
protected JavaClass transform(JavaClass clazz) throws MixerException { // empty collection of anonymous inner classes anonymousInners = new Vector<String>(); oldOuterClassName = Tools.getOuterClass(clazz,oldClassName); oldSuperclassName = clazz.getSuperclassName(); // create a copy as work bas...
if (method.getName().startsWith("access$")){ if (!method.isStatic() ) return;
if (method.isStatic() && method.getName().startsWith("access$")){
public void visitMethod(Method method) { // we search for outer-class-access functions, which // are static, have exactly one argument of this class' type and // return an instance of the outer class' type if (method.getName().startsWith("access$")){ if (!method.isStatic() ) return; String returnType = Type...
method.getConstantPool().setConstant(index, new ConstantUtf8(newSignature));
cp.setConstant(index, new ConstantUtf8(newSignature));
public void visitMethod(Method method) { // we search for outer-class-access functions, which // are static, have exactly one argument of this class' type and // return an instance of the outer class' type if (method.getName().startsWith("access$")){ if (!method.isStatic() ) return; String returnType = Type...
if (argTypes.length != 1) return; if (Tools.sameClass(argTypes[0].toString(),oldOuterClassName)){ String newSignature = "(L"+newOuterClassName+";)V"; int index = method.getSignatureIndex(); method.getConstantPool().setConstant(index, new ConstantUtf8(newSignature)); }
for(int argIdx=0; argIdx<argTypes.length; argIdx++){ if (Tools.sameClass(argTypes[argIdx].toString(),oldOuterClassName)){ argTypes[argIdx] = Type.getType( "L" + newOuterClassName + ";"); } } String signature = Type.getMethodSignature( method.getReturnType(), argTypes ); int signatureIndex = method.getSignatureIndex(...
public void visitMethod(Method method) { // we search for outer-class-access functions, which // are static, have exactly one argument of this class' type and // return an instance of the outer class' type if (method.getName().startsWith("access$")){ if (!method.isStatic() ) return; String returnType = Type...
session.setDataMode(true);
public void execute(String commandString, ConnectionContext context) throws IOException { Session session = context.getSession(); if (session.getSender() == null) { context.sendResponse("503 Error: need MAIL command"); } else if (session.getDeliveries().size() == 0) { context.sendResponse("503 Error: need RC...
private void mkdirs( ChannelSftp channel, String resourceName )
private void mkdirs( ChannelSftp channel, String resourceName, int mode )
private void mkdirs( ChannelSftp channel, String resourceName ) throws TransferFailedException, SftpException { String[] dirs = PathUtils.dirnames( resourceName ); for ( int i = 0; i < dirs.length; i++ ) { try { SftpATTRS attrs = channel.stat( dirs...
if ( mode != -1 ) { try { channel.chmod( mode, dirs[i] ); } catch ( final SftpException e1 ) { } }
private void mkdirs( ChannelSftp channel, String resourceName ) throws TransferFailedException, SftpException { String[] dirs = PathUtils.dirnames( resourceName ); for ( int i = 0; i < dirs.length; i++ ) { try { SftpATTRS attrs = channel.stat( dirs...
ChannelSftp channel = null;
ChannelSftp channel;
public void put( File source, String resourceName ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { String basedir = getRepository().getBasedir(); resourceName = StringUtils.replace( resourceName, "\\", "/" ); String dir = PathUtils.dirname( res...
mkdirs( channel, resourceName );
RepositoryPermissions permissions = getRepository().getPermissions(); mkdirs( channel, resourceName, getDirectoryMode(permissions));
public void put( File source, String resourceName ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { String basedir = getRepository().getBasedir(); resourceName = StringUtils.replace( resourceName, "\\", "/" ); String dir = PathUtils.dirname( res...
RepositoryPermissions permissions = getRepository().getPermissions();
public void put( File source, String resourceName ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { String basedir = getRepository().getBasedir(); resourceName = StringUtils.replace( resourceName, "\\", "/" ); String dir = PathUtils.dirname( res...
String msg = "Error occured while deploying '" + resourceName + "' to remote repository: " + getRepository().getUrl();
String msg = "Error occured while deploying '" + resourceName + "' " + "to remote repository: " + getRepository().getUrl();
public void put( File source, String resourceName ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { String basedir = getRepository().getBasedir(); resourceName = StringUtils.replace( resourceName, "\\", "/" ); String dir = PathUtils.dirname( res...
public String createRSS() throws Exception
public String createRSS()
public String createRSS() throws Exception { Template t = JForumExecutionContext.templateConfig().getTemplate(SystemGlobals.getValue(ConfigKeys.TEMPLATE_DIR) + "/rss_template.htm"); StringWriter sw = new StringWriter(); SimpleHash templateContext = JForumExecutionContext.getTemplateContext(); templateConte...
Template t = JForumExecutionContext.templateConfig().getTemplate(SystemGlobals.getValue(ConfigKeys.TEMPLATE_DIR) + "/rss_template.htm"); StringWriter sw = new StringWriter(); SimpleHash templateContext = JForumExecutionContext.getTemplateContext(); templateContext.put("encoding", SystemGlobals.getValue(ConfigKeys.ENC...
try { Template t = JForumExecutionContext.templateConfig().getTemplate(SystemGlobals.getValue(ConfigKeys.TEMPLATE_DIR) + "/rss_template.htm"); StringWriter sw = new StringWriter(); SimpleHash templateContext = JForumExecutionContext.getTemplateContext(); templateContext.put("encoding", SystemGlobals.getValue(ConfigKe...
public String createRSS() throws Exception { Template t = JForumExecutionContext.templateConfig().getTemplate(SystemGlobals.getValue(ConfigKeys.TEMPLATE_DIR) + "/rss_template.htm"); StringWriter sw = new StringWriter(); SimpleHash templateContext = JForumExecutionContext.getTemplateContext(); templateConte...
List lst = (List)_objectAspects.get(key);
DynArray lst = (DynArray)_objectAspects.get(key);
public void deployObject(Object obj, Object key) { /* include the object to the list of deployed objects of the thread */ List lst = (List)_objectAspects.get(key); if (lst == null) { lst = new LinkedList(); _objectAspects.put(key, lst); } lst.add(obj); }
lst = new LinkedList();
lst = new DynArray();
public void deployObject(Object obj, Object key) { /* include the object to the list of deployed objects of the thread */ List lst = (List)_objectAspects.get(key); if (lst == null) { lst = new LinkedList(); _objectAspects.put(key, lst); } lst.add(obj); }
List lst = (List)_objectAspects.get(key);
DynArray lst = (DynArray)_objectAspects.get(key);
public void undeployObject(Object obj, Object key) { /* remove the object from the list of deployed objects of the thread */ List lst = (List)_objectAspects.get(key); if (lst != null) { lst.remove(obj); if (lst.isEmpty()) { _objectAspects.remove(key); } } }
code.closeScope();
public void genCode(GenerationContext context) { CodeSequence code = context.getCodeSequence(); setLineNumber(code); code.plantLabel(pos); for (int i = 0; i < stmts.length; i++) { stmts[i].genCode(context); } }
if ( salt1 != null) cons.put("salt2",salt2);
if ( salt2 != null) cons.put("salt2",salt2);
private void pdb_CONECT_Handler(String line) { //System.out.println(line); // this try .. catch is e.g. to catch 1gte which has wrongly formatted lines... try { int atomserial = Integer.parseInt (line.substring(6 ,11).trim()); Integer bond1 = conect_helper(line,11,16)...
JLocalVariable.DES_GENERATED,
private CjClassDeclaration createAroundClosure(CjAdviceDeclaration advice) { CReferenceType superClass = new CClassNameType(AROUND_CLOSURE_CLASS); /* create field for every advice parameter */ List fields = new ArrayList(); JFormalParameter[] params = advice.getParameters(); for (int i = 0; i < params.length;...
String regex = "^(\\d+)\\s+\\(bases\\s+(\\d+)\\s+to\\s+(\\d+)\\)$";
String regex = "^(\\d+)\\s*(\\(bases\\s+(\\d+)\\s+to\\s+(\\d+)\\))?$";
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; boolean hasInternalWhitespace = fals...
ref_start = Integer.parseInt(m.group(2)); ref_end = Integer.parseInt(m.group(3));
if(m.group(2) != null){ ref_start = Integer.parseInt(m.group(3)); ref_end = Integer.parseInt(m.group(4)); }else{ ref_start = ref_end = -1; }
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; boolean hasInternalWhitespace = fals...
RankedDocRef rdr = new SimpleRankedDocRef(dr, new Integer(ref_start), new Integer(ref_end), ref_rank);
RankedDocRef rdr = new SimpleRankedDocRef(dr, (ref_start != -1 ? new Integer(ref_start) : null), (ref_end != -1 ? new Integer(ref_end) : null), ref_rank);
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; boolean hasInternalWhitespace = fals...
if (line==null || (line.charAt(0)!=' ' && linecount++>0)) {
if (line==null || line.equals("") || (line.charAt(0)!=' ' && linecount++>0)) {
private List readSection(BufferedReader br) throws ParseException { List section = new ArrayList(); String line; String currKey = null; StringBuffer currVal = new StringBuffer(); boolean done = false; int linecount = 0; //s0-8 word s1-7 value //s21 wor...
this.injector.inject(this.person1.getAddress().getAddress(), this.ml.getEmail(), rawMsg);
this.injector.inject(this.person1.getAddress().getAddress(), this.ml.getEmail(), new ByteArrayInputStream(rawMsg));
public void testHasVERP() throws Exception { this.admin.getAdmin().log("############### Starting testHasVERP()"); // Two "you are subscribed" msg assertEquals(1, this.smtp.size()); byte[] rawMsg = this.createMessage(this.person1.getAddress(), this.ml.getAddress()); this.injector.inject(this.person1.getAddre...
this.injector.inject(this.person1.getAddress().getAddress(), this.ml.getEmail(), rawMsg);
this.injector.inject(this.person1.getAddress().getAddress(), this.ml.getEmail(), new ByteArrayInputStream(rawMsg));
public void testTrivialInjection() throws Exception { // Create a second subscriber to make it more interesting PersonMixin person2 = new PersonMixin(this.admin); person2.getAccountMgr().subscribeMe(this.ml.getId(), person2.getEmail()); this.admin.getAdmin().log("############### Starting testTrivialInjection()")...
new CCompilationUnitContext(compiler, environment, export, classes);
new CCompilationUnitContext(compiler, environment, this, classes);
public void checkBody(CompilerBase compiler, Vector classes) throws PositionedError { CCompilationUnitContext context = new CCompilationUnitContext(compiler, environment, export, classes); for (int i = 0; i < typeDeclarations.length; i++) { typeDeclarations[i].checkTypeBody(context); } // Check for unused cla...
new CCompilationUnitContext(compiler, environment, export, classes);
new CCompilationUnitContext(compiler, environment, this, classes);
public void checkInitializers(CompilerBase compiler, Vector classes) throws PositionedError { CCompilationUnitContext context = new CCompilationUnitContext(compiler, environment, export, classes); for (int i = 0; i < typeDeclarations.length; i++) { typeDeclarations[i].checkInitializers(context); } }
context = new CCompilationUnitContext(compiler, environment, export);
context = new CCompilationUnitContext(compiler, environment, this);
public void checkInterface(CompilerBase compiler) throws PositionedError { CCompilationUnitContext context; context = new CCompilationUnitContext(compiler, environment, export); for (int i = 0; i < typeDeclarations.length; i++) { typeDeclarations[i].checkInterface(context); } ...
return new CCompilationUnitContext(compiler, environment, export);
return new CCompilationUnitContext(compiler, environment, this);
public CCompilationUnitContext createContext(CompilerBase compiler) { return new CCompilationUnitContext(compiler, environment, export); }
context = new CCompilationUnitContext(compiler, environment, export);
context = new CCompilationUnitContext(compiler, environment, this);
public void joinInner(CompilerBase compiler) throws PositionedError { CCompilationUnitContext context; context = new CCompilationUnitContext(compiler, environment, export); for (int i = 0; i < typeDeclarations.length; i++) { typeDeclarations[i].join(context, true); } }
context = new CCompilationUnitContext(compiler, environment, export);
context = new CCompilationUnitContext(compiler, environment, this);
public void joinOuter(CompilerBase compiler) throws PositionedError { CCompilationUnitContext context; if (packageName == JPackageName.UNNAMED) { throw new PositionedError( getTokenReference(), KjcMessages.PACKAGE_IS_MISSING); } export = new CCompilationUnit( environment, packageName.getName(),...
public int addNew(Topic topic) throws Exception
public int addNew(Topic topic)
public int addNew(Topic topic) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("TopicModel.addNew"); p.setInt(1, topic.getForumId()); p.setString(2, topic.getTitle()); p.setInt(3, topic.getPostedBy().getId()); p.setTimestamp(4, new Timestamp(topic.getTime().getTime())); p.setInt(5, topic...
PreparedStatement p = this.getStatementForAutoKeys("TopicModel.addNew"); p.setInt(1, topic.getForumId()); p.setString(2, topic.getTitle()); p.setInt(3, topic.getPostedBy().getId()); p.setTimestamp(4, new Timestamp(topic.getTime().getTime())); p.setInt(5, topic.getFirstPostId()); p.setInt(6, topic.getLastPostId()); p.s...
PreparedStatement p=null; try { p = this.getStatementForAutoKeys("TopicModel.addNew"); p.setInt(1, topic.getForumId()); p.setString(2, topic.getTitle()); p.setInt(3, topic.getPostedBy().getId()); p.setTimestamp(4, new Timestamp(topic.getTime().getTime())); p.setInt(5, topic.getFirstPostId()); p.setInt(6, topic.getLast...
public int addNew(Topic topic) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("TopicModel.addNew"); p.setInt(1, topic.getForumId()); p.setString(2, topic.getTitle()); p.setInt(3, topic.getPostedBy().getId()); p.setTimestamp(4, new Timestamp(topic.getTime().getTime())); p.setInt(5, topic...
public int countUserTopics(int userId) throws Exception
public int countUserTopics(int userId)
public int countUserTopics(int userId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.countUserTopics").replaceAll(":fids:",ForumRepository.getListAllowedForums())); p.setInt(1, userId); ResultSet rs = p.execu...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.countUserTopics").replaceAll(":fids:",ForumRepository.getListAllowedForums())); p.setInt(1, userId); ResultSet rs = p.executeQuery(); if (rs.next()) { total = rs.getInt(1); } rs.close(); p.close(); return...
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.countUserTopics").replaceAll(":fids:", ForumRepository.getListAllowedForums())); p.setInt(1, userId); rs = p.executeQuery(); if (rs.next()) { total = rs.getInt(1); } return...
public int countUserTopics(int userId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.countUserTopics").replaceAll(":fids:",ForumRepository.getListAllowedForums())); p.setInt(1, userId); ResultSet rs = p.execu...
public void decrementTotalReplies(int topicId) throws Exception
public void decrementTotalReplies(int topicId)
public void decrementTotalReplies(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.decrementTotalReplies")); p.setInt(1, topicId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.decrementTotalReplies")); p.setInt(1, topicId); p.executeUpdate(); p.close(); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.decrementTotalReplies")); p.setInt(1, topicId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr decrementTotalReplies()"; log.error(es, e); throw new RuntimeException(es, e); } f...
public void decrementTotalReplies(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.decrementTotalReplies")); p.setInt(1, topicId); p.executeUpdate(); p.close(); }
public void delete(final Topic topic) throws Exception
public void delete(final Topic topic)
public void delete(final Topic topic) throws Exception { this.deleteTopics(new ArrayList() {{ add(topic); }}); }
public void deleteByForum(int forumId) throws Exception
public void deleteByForum(int forumId)
public void deleteByForum(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.deleteByForum")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); List topics = new ArrayList(); while (rs.next()) { Topic t = new To...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.deleteByForum")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); List topics = new ArrayList(); while (rs.next()) { Topic t = new Topic(); t.setId(rs.getInt("topic_id")); topics.add(t); } rs.close()...
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.deleteByForum")); p.setInt(1, forumId); rs = p.executeQuery(); List topics = new ArrayList(); while (rs.next()) { Topic t = new Topic(); t.setId(rs.getInt("topic_id")); topi...
public void deleteByForum(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.deleteByForum")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); List topics = new ArrayList(); while (rs.next()) { Topic t = new To...
public void deleteTopics(List topics) throws Exception
public void deleteTopics(List topics)
public void deleteTopics(List topics) throws Exception { // Topic PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.delete")); ForumDAO forumDao = DataAccessDriver.getInstance().newForumDAO(); PostDAO postDao = DataAccessDriver.getInstance().newPos...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.delete")); ForumDAO forumDao = DataAccessDriver.getInstance().newForumDAO(); PostDAO postDao = DataAccessDriver.getInstance().newPostDAO(); PollDAO pollDao = DataAccessDriver.getInstance().newPollDAO(); for...
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.delete"));
public void deleteTopics(List topics) throws Exception { // Topic PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.delete")); ForumDAO forumDao = DataAccessDriver.getInstance().newForumDAO(); PostDAO postDao = DataAccessDriver.getInstance().newPos...
this.removeSubscriptionByTopic(topic.getId());
ForumDAO forumDao = DataAccessDriver.getInstance().newForumDAO();
public void deleteTopics(List topics) throws Exception { // Topic PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.delete")); ForumDAO forumDao = DataAccessDriver.getInstance().newForumDAO(); PostDAO postDao = DataAccessDriver.getInstance().newPos...