rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
public void setActive(int userId, boolean active) throws Exception
public void setActive(int userId, boolean active)
public void setActive(int userId, boolean active) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.activeStatus")); p.setInt(1, active ? 1 : 0); p.setInt(2, userId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.activeStatus")); p.setInt(1, active ? 1 : 0); p.setInt(2, userId); p.executeUpdate(); p.close();
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.activeStatus")); p.setInt(1, active ? 1 : 0); p.setInt(2, userId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr setActive()"; log.error(es, e); throw new RuntimeException(es, ...
public void setActive(int userId, boolean active) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.activeStatus")); p.setInt(1, active ? 1 : 0); p.setInt(2, userId); p.executeUpdate(); p.close(); }
public void setRanking(int userId, int rankingId) throws Exception
public void setRanking(int userId, int rankingId)
public void setRanking(int userId, int rankingId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.rankingId")); p.setInt(1, rankingId); p.setInt(2, userId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.rankingId")); p.setInt(1, rankingId); p.setInt(2, userId); p.executeUpdate(); p.close(); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.rankingId")); p.setInt(1, rankingId); p.setInt(2, userId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr setRanking()"; log.error(es, e); throw new RuntimeException(es, e); } f...
public void setRanking(int userId, int rankingId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.rankingId")); p.setInt(1, rankingId); p.setInt(2, userId); p.executeUpdate(); p.close(); }
public void undelete(int userId) throws Exception
public void undelete(int userId)
public void undelete(int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.deletedStatus")); p.setInt(1, 0); p.setInt(2, userId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.deletedStatus")); p.setInt(1, 0); p.setInt(2, userId); p.executeUpdate(); p.close(); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.deletedStatus")); p.setInt(1, 0); p.setInt(2, userId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr undelete()"; log.error(es, e); throw new RuntimeException(es, e); } finally...
public void undelete(int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.deletedStatus")); p.setInt(1, 0); p.setInt(2, userId); p.executeUpdate(); p.close(); }
public void update(User user) throws Exception
public void update(User user)
public void update(User user) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.update")); p.setString(1, user.getAim()); p.setString(2, user.getAvatar()); p.setString(3, user.getGender()); p.setInt(4, user.getThemeId()); p.setInt(...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.update")); p.setString(1, user.getAim()); p.setString(2, user.getAvatar()); p.setString(3, user.getGender()); p.setInt(4, user.getThemeId()); p.setInt(5, user.isPrivateMessagesEnabled() ? 1 : 0); p.setInt(6, u...
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.update")); p.setString(1, user.getAim()); p.setString(2, user.getAvatar()); p.setString(3, user.getGender()); p.setInt(4, user.getThemeId()); p.setInt(5, user.isPrivateMessagesEnabled() ? 1 : 0);...
public void update(User user) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.update")); p.setString(1, user.getAim()); p.setString(2, user.getAvatar()); p.setString(3, user.getGender()); p.setInt(4, user.getThemeId()); p.setInt(...
public void updateUsername(int userId, String username) throws Exception
public void updateUsername(int userId, String username)
public void updateUsername(int userId, String username) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.updateUsername")); p.setString(1, username); p.setInt(2, userId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.updateUsername")); p.setString(1, username); p.setInt(2, userId); p.executeUpdate(); p.close();
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.updateUsername")); p.setString(1, username); p.setInt(2, userId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr updateUsername()"; log.error(es, e); throw new RuntimeException(e...
public void updateUsername(int userId, String username) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.updateUsername")); p.setString(1, username); p.setInt(2, userId); p.executeUpdate(); p.close(); }
public boolean validateActivationKeyHash(int userId , String hash) throws Exception
public boolean validateActivationKeyHash(int userId , String hash)
public boolean validateActivationKeyHash(int userId , String hash) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.validateActivationKeyHash")); p.setString(1, hash); p.setInt(2, userId); boolean status = false; ResultSet rs = p.exec...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.validateActivationKeyHash")); p.setString(1, hash); p.setInt(2, userId);
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.validateActivationKeyHash")); p.setString(1, hash); p.setInt(2, userId);
public boolean validateActivationKeyHash(int userId , String hash) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.validateActivationKeyHash")); p.setString(1, hash); p.setInt(2, userId); boolean status = false; ResultSet rs = p.exec...
ResultSet rs = p.executeQuery(); if (rs.next() && rs.getInt("valid") == 1) { status = true; }
rs = p.executeQuery(); if (rs.next() && rs.getInt("valid") == 1) { status = true; }
public boolean validateActivationKeyHash(int userId , String hash) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.validateActivationKeyHash")); p.setString(1, hash); p.setInt(2, userId); boolean status = false; ResultSet rs = p.exec...
rs.close(); p.close(); return status; }
return status; } catch (SQLException e) { String es = "Erorr validateActivationKeyHash()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } }
public boolean validateActivationKeyHash(int userId , String hash) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.validateActivationKeyHash")); p.setString(1, hash); p.setInt(2, userId); boolean status = false; ResultSet rs = p.exec...
public User validateLogin(String username, String password) throws NoSuchAlgorithmException, Exception
public User validateLogin(String username, String password)
public User validateLogin(String username, String password) throws NoSuchAlgorithmException, Exception { return loginAuthenticator.validateLogin(username, password, null); }
public boolean validateLostPasswordHash(String email, String hash) throws Exception
public boolean validateLostPasswordHash(String email, String hash)
public boolean validateLostPasswordHash(String email, String hash) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("UserModel.validateLostPasswordHash")); p.setString(1, hash); p.setString(2, email); boolean status = false; ResultSet rs...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("UserModel.validateLostPasswordHash")); p.setString(1, hash); p.setString(2, email); boolean status = false; ResultSet rs = p.executeQuery(); if (rs.next() && rs.getInt("valid") > 0) { status = true; this.writeLostPas...
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("UserModel.validateLostPasswordHash")); p.setString(1, hash); p.setString(2, email); boolean status = false; rs = p.executeQuery(); if (rs.next() && rs.getInt("valid") > 0) { status = t...
public boolean validateLostPasswordHash(String email, String hash) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("UserModel.validateLostPasswordHash")); p.setString(1, hash); p.setString(2, email); boolean status = false; ResultSet rs...
public void writeLostPasswordHash(String email, String hash) throws Exception
public void writeLostPasswordHash(String email, String hash)
public void writeLostPasswordHash(String email, String hash) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.writeLostPasswordHash")); p.setString(1, hash); p.setString(2, email); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.writeLostPasswordHash")); p.setString(1, hash); p.setString(2, email); p.executeUpdate(); p.close(); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.writeLostPasswordHash")); p.setString(1, hash); p.setString(2, email); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr writeLostPasswordHash()"; log.error(es, e); throw new Runtim...
public void writeLostPasswordHash(String email, String hash) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.writeLostPasswordHash")); p.setString(1, hash); p.setString(2, email); p.executeUpdate(); p.close(); }
public void writeUserActive(int userId) throws Exception
public void writeUserActive(int userId)
public void writeUserActive(int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.writeUserActive")); p.setInt(1, userId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.writeUserActive")); p.setInt(1, userId); p.executeUpdate(); p.close(); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.writeUserActive")); p.setInt(1, userId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr writeUserActive()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUti...
public void writeUserActive(int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.writeUserActive")); p.setInt(1, userId); p.executeUpdate(); p.close(); }
protected PreparedStatement getStatementForAutoKeys(String queryName) throws SQLException
protected PreparedStatement getStatementForAutoKeys(String queryName, Connection conn) throws SQLException
protected PreparedStatement getStatementForAutoKeys(String queryName) throws SQLException { return this.getStatementForAutoKeys(queryName, JForumExecutionContext.getConnection()); }
return this.getStatementForAutoKeys(queryName, JForumExecutionContext.getConnection());
PreparedStatement p = null; if (this.supportAutoGeneratedKeys()) { p = conn.prepareStatement(SystemGlobals.getSql(queryName), Statement.RETURN_GENERATED_KEYS); } else { p = conn.prepareStatement(SystemGlobals.getSql(queryName)); } return p;
protected PreparedStatement getStatementForAutoKeys(String queryName) throws SQLException { return this.getStatementForAutoKeys(queryName, JForumExecutionContext.getConnection()); }
public void getUserTotalKarma(User user) throws Exception;
public void getUserTotalKarma(User user) ;
public void getUserTotalKarma(User user) throws Exception;
public User validateLogin(String username, String password, Map extraParams) throws Exception;
public User validateLogin(String username, String password, Map extraParams) ;
public User validateLogin(String username, String password, Map extraParams) throws Exception;
SequenceFormat ff = new EmblLikeFormat();
public static void main(String [] args) { try { if(args.length != 1) { throw new Exception("Use: TestEmbl2 emblFile"); } File emblFile = new File(args[0]); BufferedReader eReader = new BufferedReader( new InputStreamReader(new FileInputStream(emblFile))); SequenceIterat...
ff.writeSequence(seq, "embl", System.out);
System.out.println(seq.getName() + " has " + seq.countFeatures() + " features"); printFeatures(seq, FeatureFilter.all, System.out, "");
public static void main(String [] args) { try { if(args.length != 1) { throw new Exception("Use: TestEmbl2 emblFile"); } File emblFile = new File(args[0]); BufferedReader eReader = new BufferedReader( new InputStreamReader(new FileInputStream(emblFile))); SequenceIterat...
private void addRole(PermissionControl pc, String roleName, int forumId, String[] groups, boolean allow) throws Exception
private void addRole(PermissionControl pc, String roleName, int forumId, String[] groups, boolean allow)
private void addRole(PermissionControl pc, String roleName, int forumId, String[] groups, boolean allow) throws Exception { Role role = new Role(); role.setName(roleName); for (int i = 0; i < groups.length; i++) { int groupId = Integer.parseInt(groups[i]); RoleValueCollection roleValues = new RoleValueCollect...
public void delete() throws Exception
public void delete()
public void delete() throws Exception { String ids[] = this.request.getParameterValues("forum_id"); ForumDAO fm = DataAccessDriver.getInstance().newForumDAO(); TopicDAO tm = DataAccessDriver.getInstance().newTopicDAO(); if (ids != null) { for (int i = 0; i < ids.length; i++) { int forumId = Integer.parseI...
public void down() throws Exception
public void down()
public void down() throws Exception { this.processOrdering(false); }
public void edit() throws Exception
public void edit()
public void edit() throws Exception { CategoryDAO cm = DataAccessDriver.getInstance().newCategoryDAO(); this.context.put("forum", DataAccessDriver.getInstance().newForumDAO().selectById( this.request.getIntParameter("forum_id"))); this.context.put("categories", cm.selectAll()); this.setTemplateName(TemplateKe...
public void editSave() throws Exception
public void editSave()
public void editSave() throws Exception { Forum f = new Forum(ForumRepository.getForum(this.request.getIntParameter("forum_id"))); boolean moderated = f.isModerated(); int categoryId = f.getCategoryId(); f.setDescription(this.request.getParameter("description")); f.setIdCategories(this.request.getIntParameter("...
public void insert() throws Exception
public void insert()
public void insert() throws Exception { CategoryDAO cm = DataAccessDriver.getInstance().newCategoryDAO(); this.context.put("groups", new TreeGroup().getNodes()); this.context.put("selectedList", new ArrayList()); this.setTemplateName(TemplateKeys.FORUM_ADMIN_INSERT); this.context.put("categories",cm.selectAll()...
public void insertSave() throws Exception
public void insertSave()
public void insertSave() throws Exception { Forum f = new Forum(); f.setDescription(this.request.getParameter("description")); f.setIdCategories(this.request.getIntParameter("categories_id")); f.setName(this.request.getParameter("forum_name")); f.setModerated("1".equals(this.request.getParameter("moderate"))); ...
public void list() throws Exception
public void list()
public void list() throws Exception { this.context.put("categories", DataAccessDriver.getInstance().newCategoryDAO().selectAll()); this.context.put("repository", new ForumRepository()); this.setTemplateName(TemplateKeys.FORUM_ADMIN_LIST); }
private void processOrdering(boolean up) throws Exception
private void processOrdering(boolean up)
private void processOrdering(boolean up) throws Exception { Forum toChange = new Forum(ForumRepository.getForum(Integer.parseInt( this.request.getParameter("forum_id")))); Category category = ForumRepository.getCategory(toChange.getCategoryId()); List forums = new ArrayList(category.getForums()); int index = ...
public void up() throws Exception
public void up()
public void up() throws Exception { this.processOrdering(true); }
public void deleteByForum(int forumId) throws Exception;
public void deleteByForum(int forumId) ;
public void deleteByForum(int forumId) throws Exception;
public Forum(Forum f) { this.description = f.getDescription(); this.id = f.getId(); this.idCategories = f.getCategoryId(); this.lastPostId = f.getLastPostId(); this.moderated = f.isModerated(); this.name = f.getName(); this.order = f.getOrder(); this.totalPosts = f.getTotalPosts(); this.totalTopics = f.getTotalTopics()...
public Forum() { }
public Forum(Forum f) { this.description = f.getDescription(); this.id = f.getId(); this.idCategories = f.getCategoryId(); this.lastPostId = f.getLastPostId(); this.moderated = f.isModerated(); this.name = f.getName(); this.order = f.getOrder(); this.totalPosts = f.getTotalPosts(); this.totalTopics = f.getTot...
public void setTopicModerationStatus(int forumId, boolean status) throws Exception
public void setTopicModerationStatus(int forumId, boolean status)
public void setTopicModerationStatus(int forumId, boolean status) throws Exception { DataAccessDriver.getInstance().newTopicDAO().setModerationStatus(forumId, status); }
return super.getPosts(start, start + count, minPostId, maxPostId, conn);
return super.getPosts(start + count, start, minPostId, maxPostId, conn);
protected List getPosts(int start, int count, int minPostId, int maxPostId, Connection conn) throws Exception { return super.getPosts(start, start + count, minPostId, maxPostId, conn); }
shadowKind = Shadow.MethodCall;
cclassShadowKind = Shadow.MethodCall;
private CaesarPointcutWrapper parseKindedPointcut() { String kind = parseIdentifier(); eat("("); SignaturePattern sig; Shadow.Kind shadowKind = null; if (kind.equals("execution")) { sig = parseMethodOrConstructorSignaturePattern(); if (sig.getKind() == Member.METHOD) { shadowKind = Shadow.MethodExecution...
shadowKind = Shadow.MethodExecution;
cclassShadowKind = Shadow.MethodExecution;
private CaesarPointcutWrapper parseKindedPointcut() { String kind = parseIdentifier(); eat("("); SignaturePattern sig; Shadow.Kind shadowKind = null; if (kind.equals("execution")) { sig = parseMethodOrConstructorSignaturePattern(); if (sig.getKind() == Member.METHOD) { shadowKind = Shadow.MethodExecution...
sig = new SignaturePattern(Member.METHOD, sig.getModifiers(), createCaesarObjectPattern(), sig.getDeclaringType(), new NamePattern("$constructor"), sig.getParameterTypes(), sig.getThrowsPattern());
CaesarCloner c = CaesarCloner.instance();
private CaesarPointcutWrapper parseKindedPointcut() { String kind = parseIdentifier(); eat("("); SignaturePattern sig; Shadow.Kind shadowKind = null; if (kind.equals("execution")) { sig = parseMethodOrConstructorSignaturePattern(); if (sig.getKind() == Member.METHOD) { shadowKind = Shadow.MethodExecution...
CaesarKindedPointcut p = new CaesarKindedPointcut(
SignaturePattern cclassSig = new SignaturePattern(Member.METHOD, sig.getModifiers(), createCaesarObjectPattern(), c.clone(sig.getDeclaringType()), new NamePattern("$constructor"), c.clone(sig.getParameterTypes()), c.clone(sig.getThrowsPattern())); CaesarKindedPointcut regular = new CaesarKindedPointcut(
private CaesarPointcutWrapper parseKindedPointcut() { String kind = parseIdentifier(); eat("("); SignaturePattern sig; Shadow.Kind shadowKind = null; if (kind.equals("execution")) { sig = parseMethodOrConstructorSignaturePattern(); if (sig.getKind() == Member.METHOD) { shadowKind = Shadow.MethodExecution...
return new CaesarPointcutWrapper(p);
CaesarKindedPointcut cclass = new CaesarKindedPointcut( cclassShadowKind, cclassSig); registerPointcut(new CaesarPointcutWrapper(regular)); registerPointcut(new CaesarPointcutWrapper(cclass)); Pointcut orPointcut = new OrPointcut( regular, cclass); return new CaesarPointcutWrapper(orPointcut);
private CaesarPointcutWrapper parseKindedPointcut() { String kind = parseIdentifier(); eat("("); SignaturePattern sig; Shadow.Kind shadowKind = null; if (kind.equals("execution")) { sig = parseMethodOrConstructorSignaturePattern(); if (sig.getKind() == Member.METHOD) { shadowKind = Shadow.MethodExecution...
CaesarKindedPointcut regular = new CaesarKindedPointcut( Shadow.Initialization, sig); return new CaesarPointcutWrapper(regular); /*
public CaesarPointcutWrapper parsePointcutWrapper() { int start = tokenSource.getIndex(); IToken t = tokenSource.peek(); Pointcut p = t.maybeGetParsedPointcut(); if (p != null) { tokenSource.next(); return new CaesarPointcutWrapper(p); } String kind = parseIdentifier(); tokenSource.setIndex(start); if ...
sig = new SignaturePattern(Member.CONSTRUCTOR, sig.getModifiers(), sig.getReturnType(), sig.getDeclaringType(), sig.getName(), createObjectTypeList(), sig.getThrowsPattern());
public CaesarPointcutWrapper parsePointcutWrapper() { int start = tokenSource.getIndex(); IToken t = tokenSource.peek(); Pointcut p = t.maybeGetParsedPointcut(); if (p != null) { tokenSource.next(); return new CaesarPointcutWrapper(p); } String kind = parseIdentifier(); tokenSource.setIndex(start); if ...
CaesarKindedPointcut pointcut = new CaesarKindedPointcut(Shadow.Initialization, sig); return new CaesarPointcutWrapper(pointcut);
CaesarCloner c = CaesarCloner.instance(); SignaturePattern cclassSig = new SignaturePattern(Member.CONSTRUCTOR, sig.getModifiers(), c.clone(sig.getReturnType()), c.clone(sig.getDeclaringType()), c.clone(sig.getName()), createObjectTypeList(), c.clone(sig.getThrowsPattern())); CaesarKindedPointcut regular = new Caesa...
public CaesarPointcutWrapper parsePointcutWrapper() { int start = tokenSource.getIndex(); IToken t = tokenSource.peek(); Pointcut p = t.maybeGetParsedPointcut(); if (p != null) { tokenSource.next(); return new CaesarPointcutWrapper(p); } String kind = parseIdentifier(); tokenSource.setIndex(start); if ...
CaesarCloner c = CaesarCloner.instance(); SignaturePattern cclassSig = new SignaturePattern(Member.CONSTRUCTOR, sig.getModifiers(), c.clone(sig.getReturnType()), c.clone(sig.getDeclaringType()), c.clone(sig.getName()), createObjectTypeList(), c.clone(sig.getThrowsPattern())); CaesarKindedPointcut regular = new Caesa...
public CaesarPointcutWrapper parsePointcutWrapper() { int start = tokenSource.getIndex(); IToken t = tokenSource.peek(); Pointcut p = t.maybeGetParsedPointcut(); if (p != null) { tokenSource.next(); return new CaesarPointcutWrapper(p); } String kind = parseIdentifier(); tokenSource.setIndex(start); if ...
*/
public CaesarPointcutWrapper parsePointcutWrapper() { int start = tokenSource.getIndex(); IToken t = tokenSource.peek(); Pointcut p = t.maybeGetParsedPointcut(); if (p != null) { tokenSource.next(); return new CaesarPointcutWrapper(p); } String kind = parseIdentifier(); tokenSource.setIndex(start); if ...
List names = parseDottedNamePattern();
List<NamePattern> names = parseDottedNamePattern();
public TypePattern parseSingleTypePattern() { List names = parseDottedNamePattern(); // new ArrayList();// NamePattern p1 = parseNamePattern();// names.add(p1);// while (maybeEat(".")) {// if (maybeEat(".")) {// names.add(NamePattern.ELLIPSIS);// }// NamePattern p2 = parseNamePattern();// names.add(p2)...
if (Member.CONSTRUCTOR.equals(sig.getKind())) { sig = new SignaturePattern(Member.METHOD, sig.getModifiers(), createCaesarObjectPattern(), sig.getDeclaringType(), new NamePattern("$constructor"), sig.getParameterTypes(), sig.getThrowsPattern()); }
private CaesarPointcutWrapper parseWithinCodePointcut() { // Parses the signature pattern parseIdentifier(); eat("("); SignaturePattern sig = parseMethodOrConstructorSignaturePattern(); eat(")"); if (Member.CONSTRUCTOR.equals(sig.getKind())) { // Transform the constructor withincode to a method withincode...
WithincodePointcut p = new WithincodePointcut(sig);
Pointcut p = new WithincodePointcut(sig);
private CaesarPointcutWrapper parseWithinCodePointcut() { // Parses the signature pattern parseIdentifier(); eat("("); SignaturePattern sig = parseMethodOrConstructorSignaturePattern(); eat(")"); if (Member.CONSTRUCTOR.equals(sig.getKind())) { // Transform the constructor withincode to a method withincode...
wrapper = new CaesarPointcutWrapper(mixin, sig.getDeclaringType());
wrapper = new CaesarPointcutWrapper(mixin, type);
private CaesarPointcutWrapper parseWithinCodePointcut() { // Parses the signature pattern parseIdentifier(); eat("("); SignaturePattern sig = parseMethodOrConstructorSignaturePattern(); eat(")"); if (Member.CONSTRUCTOR.equals(sig.getKind())) { // Transform the constructor withincode to a method withincode...
public CaesarWildTypePattern(List<NamePattern> names, boolean includeSubtypes, int dim) { this((NamePattern[]) names.toArray(new NamePattern[names.size()]), names, includeSubtypes, dim);
CaesarWildTypePattern(NamePattern[] namePatterns, List names, boolean includeSubtypes, int dim) { super(names, includeSubtypes, dim); this.namePatterns = namePatterns; this.dim = dim; ellipsisCount = 0; for (int i=0; i<namePatterns.length; i++) { if (namePatterns[i] == NamePattern.ELLIPSIS) ellipsisCount++; } setLocati...
public CaesarWildTypePattern(List<NamePattern> names, boolean includeSubtypes, int dim) { this((NamePattern[]) names.toArray(new NamePattern[names.size()]), names, includeSubtypes, dim); }
new JBlock( methods[i].getTokenReference(), ((JConstructorBlock)methods[i].getBlockBody()).getBody(), null )
(JConstructorBlock)methods[i].getBlockBody()
public void transformConstructors(CjVirtualClassDeclaration cd) { // add outer variable CType outerType = null; CjMixinInterfaceDeclaration mixinIfc = cd.getMixinIfcDeclaration(); // create a type reference representing the class declaration CReferenceType selfType = new CClassNameT...
CReferenceType.EMPTY, new JBlock( cd.getTokenReference(), JBlock.EMPTY, null
CReferenceType.EMPTY
public void transformConstructors(CjVirtualClassDeclaration cd) { // add outer variable CType outerType = null; CjMixinInterfaceDeclaration mixinIfc = cd.getMixinIfcDeclaration(); // create a type reference representing the class declaration CReferenceType selfType = new CClassNameT...
));
);
public void transformConstructors(CjVirtualClassDeclaration cd) { // add outer variable CType outerType = null; CjMixinInterfaceDeclaration mixinIfc = cd.getMixinIfcDeclaration(); // create a type reference representing the class declaration CReferenceType selfType = new CClassNameT...
ex.printStackTrace();
public boolean start(JPhylum node) { if(node == null) throw new InconsistencyException("can not visit null node"); StackEntry e = selectNode(node); s.push(e); try { if (e.visitMethod != null) { Object res = e.visitMethod.invoke(visitor...
JBlock body)
JConstructorBlock body)
public CjInitMethodDeclaration(TokenReference where, int modifiers, CReferenceType ownerType, String ident, JFormalParameter[] parameters, CReferenceType[] exceptions, JBlock body) { super(where, modifiers, new CClassNameType(CAESAR_OBJECT), ident, parameters, ex...
if (block.size() > 0 && block.get(0) instanceof JExpressionStatement) { JExpression expr = ((JExpressionStatement)block.get(0)).getExpression(); if (expr instanceof JConstructorCall) { JExpression target = null; if (((JConstructorCall)expr).isFunctorThis()) { target = new JThisExpression(where); } else { target = new ...
JConstructorCall constrCall = body.getConstructorCall(); if (constrCall != null) { JExpression target = null; if (constrCall.isFunctorThis()) { target = new JThisExpression(where); } else { target = new JSuperExpression(where); } superInit = new CjMethodCallExpression(where, target, CONSTR_METH_NAME, constrCall.getArg...
public CjInitMethodDeclaration(TokenReference where, int modifiers, CReferenceType ownerType, String ident, JFormalParameter[] parameters, CReferenceType[] exceptions, JBlock body) { super(where, modifiers, new CClassNameType(CAESAR_OBJECT), ident, parameters, ex...
public static String arrayToString(double[] a) {
public static String arrayToString(Object[] a) {
public static String arrayToString(double[] a) { if (a == null) return "null"; if (a.length == 0) return ""; StringBuffer sb = new StringBuffer(); sb.append(a[0]); for (int i=1; i<a.length; i++) { sb.append(","); sb.append(a[i]); } return sb.toString(); }
sb.append(a[0]);
sb.append(a[0].toString());
public static String arrayToString(double[] a) { if (a == null) return "null"; if (a.length == 0) return ""; StringBuffer sb = new StringBuffer(); sb.append(a[0]); for (int i=1; i<a.length; i++) { sb.append(","); sb.append(a[i]); } return sb.toString(); }
sb.append(a[i]);
sb.append(a[i].toString());
public static String arrayToString(double[] a) { if (a == null) return "null"; if (a.length == 0) return ""; StringBuffer sb = new StringBuffer(); sb.append(a[0]); for (int i=1; i<a.length; i++) { sb.append(","); sb.append(a[i]); } return sb.toString(); }
section.add(line.split("\\s+"));
String[] parts = line.split("\\s+"); currentTag = parts[0]; currentVal = new StringBuffer(); currentVal.append(parts[1]);
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; // while not done try { ...
String[] parts = line.split("="); currentTag = parts[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; // while not done try { ...
if (parts.length>1) currentVal.append(parts[1]);
int equalIndex = line.indexOf('='); if (equalIndex>=0) { currentTag = line.substring(0, equalIndex); currentVal.append(line.substring(equalIndex+1)); } else { currentTag = line; }
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; // while not done try { ...
if (currentTag!=null) section.add(new String[]{currentTag,currentVal.toString()});
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; // while not done try { ...
if (template.location.getMin() < 1 || template.location.getMax() > sourceSeq.length()) { throw new IllegalArgumentException("Location " + template.location.toString() + " is outside 1.." + sourceSeq.length()); }
public SimpleFeature(Sequence sourceSeq, FeatureHolder parent, Feature.Template template) throws IllegalArgumentException { if(template.location == null) { throw new IllegalArgumentException( "Location can not be null. Did you mean Location.EMPTY_LOCATION?" ); } if(!(parent inst...
lblTitle.setText("Output Options"); lblTitle.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(3, 3, 3, 3)));
lblTitle.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("OUTPUT_OPTIONS1")); lblTitle.setBorder(javax.swing.BorderFactory.createEmptyBorder(3, 3, 3, 3));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
tpInstructions.setText("Now, choose from the following options for your generated pages:");
tpInstructions.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("OUTPUT_OPTIONS_PANEL_DESCRIPTION"));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
lblColumns.setText("Number of columns of photos in album table:");
lblColumns.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("NUMBER_OF_COLUMS"));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
lblThumbnailsPerPage.setText("Maximum number of thumbnails per page:");
lblThumbnailsPerPage.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("MAX_THUMBNAILS"));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
cbSaveCaptions.setText("Remember my captions");
cbSaveCaptions.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("REMEMBER_CAPTIONS"));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
cbResizeAll.setText("Resize all output photos to");
cbResizeAll.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("RESIZE_PHOTOS"));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
lblBy.setText("by");
lblBy.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("BY"));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
cbResizePortraits.setText("Resize Portrait Photos to");
cbResizePortraits.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("RESIZE_PORTRAIT"));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
lblBy2.setText("by");
lblBy2.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("BY"));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
cbFullSize.setText("Publish and link to full-size photos as well");
cbFullSize.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("LINK_FULL_SIZE"));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
cbShowExif.setText("Print EXIF pictures informatio");
cbShowExif.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("PRINT_EXIF"));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
pnlDetailPages.setBorder(new javax.swing.border.TitledBorder(null, "Detail Pages", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("SansSerif", 0, 12)));
pnlDetailPages.setBorder(javax.swing.BorderFactory.createTitledBorder(null, java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("DETAIL_PAGE"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("SansSerif", 0, 12)...
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
lblCaptionPosition.setText("Caption Position:");
lblCaptionPosition.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("CAPTION_POSITION"));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
lblCaptionAlign.setText("Caption Align:");
lblCaptionAlign.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("CAPTION_ALIGN"));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
lblPhotoPosition.setText("Photo Position:");
lblPhotoPosition.setText(java.util.ResourceBundle.getBundle("com/javaimagealbum/resources/Resource").getString("PHOTO_POSITION"));
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lblTitle = new javax.swing.JLabel(); pnlContents = new javax.swing.JPanel(); tpInstructions = new javax.swing.JTextPane(); pnlOutputColumnsOption = new javax.swing.JPanel(); lblColumns = new jav...
assembly.putComponent(loc, cf);
assembly.putComponent( cf);
public Feature createFeature(Feature.Template temp) throws BioException, ChangeVetoException { if (temp.location.getMin() < 1) throw new BioException("Coordinates out of range"); if (temp instanceof ComponentFeature.Template) { for (Iterator i = assembly.getComponentLocationSet().iterator(); i.ha...
else if (tmp instanceof JOwnerExpression) {
else if (tmp instanceof JThisExpression) {
public static Path createFrom(CContext context, JExpression expr){ List l1 = new LinkedList(); // stores the field access identifiers (Strings) List l2 = new LinkedList(); // stores the field access identifiers (Strings) int k =0; JExpression tmp = expr; boolean do...
CClass owner = ((JOwnerExpression)tmp).getSelf();
CClass owner = ((JThisExpression)tmp).getSelf();
public static Path createFrom(CContext context, JExpression expr){ List l1 = new LinkedList(); // stores the field access identifiers (Strings) List l2 = new LinkedList(); // stores the field access identifiers (Strings) int k =0; JExpression tmp = expr; boolean do...
else if (tmp instanceof JThisExpression ){ done = true; }
public static Path createFrom(CContext context, JExpression expr){ List l1 = new LinkedList(); // stores the field access identifiers (Strings) List l2 = new LinkedList(); // stores the field access identifiers (Strings) int k =0; JExpression tmp = expr; boolean do...
gc.drawRectangle(left.x, left.y, right.x - left.x - 1, gc.getFontMetrics().getHeight() - 1);
int x = left.x; int y = left.y; int w = right.x - left.x - 1; int h = gc.getFontMetrics().getHeight(); gc.drawRectangle(x, y, w, h);
private final void draw(final GC gc, final int offset, final int length) { if (gc != null) { Point left = mTextWidget.getLocationAtOffset(offset); Point right = mTextWidget.getLocationAtOffset(offset + length); Color color = mMismatch ? mMismatchColor : mColor; if ...
stack.setVar("exception", new ExecutionException(fne.getStack().copy(), fne.getMessage(), fne.getException()));
stack.setVar("exception", fne.getException());
protected void notificationEvent(NotificationEvent e) throws ExecutionException { if (NotificationEventType.EXECUTION_FAILED.equals(e.getType())) { VariableStack stack = e.getStack(); FailureNotificationEvent fne = (FailureNotificationEvent) e; stack.setVar(LAST_FAILURE, e); stack.setVar("exception", new Exec...
public Throwable getException() {
public ExecutionException getException() {
public Throwable getException() { return exception; }
return (loc instanceof CircularLocation);
boolean toReturn = false; try { if(loc.getDecorator(Class.forName("org.biojava.bio.symbol.CircularLocation")) != null) { toReturn = true; } } catch(Exception e) { throw new org.biojava.bio.BioError("class org.biojava.bio.symbol.BetweenLocation could not be loaded"); } return toReturn;
protected static boolean isCircular(Location loc){ return (loc instanceof CircularLocation); }
bioJavaDigest.setProtese(Protease.getProteaseByName(Protease.TRYPSIN));
bioJavaDigest.setProtease(Protease.getProteaseByName(Protease.TRYPSIN));
public TestDigestIO(String fileName, String mode) throws BioException, ChangeVetoException, IOException { nf.setMaximumFractionDigits(2); nf.setMinimumFractionDigits(2); //Initiate Digest Digest bioJavaDigest = new Digest(); bioJavaDigest.setMaxMissedCleavages(0); ...
bioJavaDigest.setProtese(Protease.getProteaseByName(Protease.CNBr));
bioJavaDigest.setProtease(Protease.getProteaseByName(Protease.CNBr));
public TestDigestIO(String fileName, String mode) throws BioException, ChangeVetoException, IOException { nf.setMaximumFractionDigits(2); nf.setMinimumFractionDigits(2); //Initiate Digest Digest bioJavaDigest = new Digest(); bioJavaDigest.setMaxMissedCleavages(0); ...
public MassCalc(String isotopicType) {
public MassCalc(String isotopicType, boolean MH_PLUS) {
public MassCalc(String isotopicType) { //Calculate hydroxyl mass hydroxMass = 0.0; if(isotopicType.equals(SymbolPropertyTable.AVG_MASS)){ hydroxMass = Havg + Oavg; } else if(isotopicType.equals(SymbolPropertyTable.MONO_MASS)){ hydroxMass = Hmono + Omono; ...
hydroxMass = 0.0; if(isotopicType.equals(SymbolPropertyTable.AVG_MASS)){ hydroxMass = Havg + Oavg; } else if(isotopicType.equals(SymbolPropertyTable.MONO_MASS)){ hydroxMass = Hmono + Omono; }
termMass = calcTermMass(isotopicType,MH_PLUS);
public MassCalc(String isotopicType) { //Calculate hydroxyl mass hydroxMass = 0.0; if(isotopicType.equals(SymbolPropertyTable.AVG_MASS)){ hydroxMass = Havg + Oavg; } else if(isotopicType.equals(SymbolPropertyTable.MONO_MASS)){ hydroxMass = Hmono + Omono; ...
if (countChar(line, '"') % 2 == 0)
int eq = line.indexOf("="); if (line.charAt(eq + 1) != '"' || line.charAt(line.length() - 1) == '"' ) {
public void featureData(String line) throws BioException { switch (featureStatus) { case LOCATION: featureBuf.append(line); if (countChar(featureBuf, '(') == countChar(featureBuf, ')')) { featureTemplate = locParser.parseLocation(featureBuf.substrin...
else {
} else {
public void featureData(String line) throws BioException { switch (featureStatus) { case LOCATION: featureBuf.append(line); if (countChar(featureBuf, '(') == countChar(featureBuf, ')')) { featureTemplate = locParser.parseLocation(featureBuf.substrin...
if ((countChar(featureBuf, ' ') > 0) &&
if ((featureBuf.indexOf(" ") >= 0) &&
public void featureData(String line) throws BioException { switch (featureStatus) { case LOCATION: featureBuf.append(line); if (countChar(featureBuf, '(') == countChar(featureBuf, ')')) { featureTemplate = locParser.parseLocation(featureBuf.substrin...