rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
private void callSuperClassToo(JMethodDeclaration method,String methodName, String superClassName) { if(method.getIdent()!=methodName){ System.out.println(methodName+" Statement not found"); return; | private void callSuperClassToo(JMethodDeclaration methods[],String methodName, String superClassName) { JMethodDeclaration method = null; for (int i = 0; i<methods.length; i++) { method = methods[i]; if (method.getIdent() == methodName) break; | private void callSuperClassToo(JMethodDeclaration method,String methodName, String superClassName) { if(method.getIdent()!=methodName){ System.out.println(methodName+" Statement not found"); return; } JStatement[] deployStatements=method.getBlockBody().getBody(); JStatement[] newStatements = new JStatement[de... |
if (method == null) throw new InconsistencyException("Method " + methodName + "not found"); | private void callSuperClassToo(JMethodDeclaration method,String methodName, String superClassName) { if(method.getIdent()!=methodName){ System.out.println(methodName+" Statement not found"); return; } JStatement[] deployStatements=method.getBlockBody().getBody(); JStatement[] newStatements = new JStatement[de... | |
callSuperClassToo(methods[0],"$deploy",superClassName); callSuperClassToo(methods[1],"$undeploy",superClassName); | callSuperClassToo(methods,"$deploy",superClassName); callSuperClassToo(methods,"$undeploy",superClassName); | public void checkInterface(CContext context) throws PositionedError { //Add the superClass only to those classes, whose crosscuttingClass //has a crosscutting superClass if (crosscuttingClass.getSuperClass() != null && (CModifier.contains( crosscuttingClass.getSuperClass().getCClass().getModifiers(), ACC_... |
System.out.println("weaved in: "+dprefix+methodName+"("+argString+")"); | private void callSuperClassToo(JMethodDeclaration method,String methodName, String superClassName) { if(method.getIdent()!=methodName){ System.out.println(methodName+" Statement not found"); return; } JStatement[] deployStatements=method.getBlockBody().getBody(); JStatement[] newStatements = new JStatement[de... | |
boolean isRegistry=false; for (int i=0; i<interfaces.length&&!isRegistry;i++){ if(interfaces[i].getIdent().equals("AspectRegistry")) isRegistry=true; } | public void checkInterface(CContext context) throws PositionedError { //Add the superClass only to those classes, whose crosscuttingClass //has a crosscutting superClass if (crosscuttingClass.getSuperClass() != null && (CModifier.contains( crosscuttingClass.getSuperClass().getCClass().getModifiers(), ACC_... | |
System.out.println(ident+" mypc: "+pointcuts.length); System.out.println(crosscuttingClass.getIdent()+" ccpc: "+crosscuttingClass.getPointcuts().length); if(isRegistry&&(!CModifier.contains(crosscuttingClass.getSuperClass().getCClass().getModifiers(),ACC_ABSTRACT))){ | if(isRegistry()&&(!CModifier.contains(crosscuttingClass.getSuperClass().getCClass().getModifiers(),ACC_ABSTRACT))){ | public void checkInterface(CContext context) throws PositionedError { //Add the superClass only to those classes, whose crosscuttingClass //has a crosscutting superClass if (crosscuttingClass.getSuperClass() != null && (CModifier.contains( crosscuttingClass.getSuperClass().getCClass().getModifiers(), ACC_... |
if(isRegistry&& | if(isRegistry()&& | public void checkInterface(CContext context) throws PositionedError { //Add the superClass only to those classes, whose crosscuttingClass //has a crosscutting superClass if (crosscuttingClass.getSuperClass() != null && (CModifier.contains( crosscuttingClass.getSuperClass().getCClass().getModifiers(), ACC_... |
} super.checkInterface(context); | if(isRegistry()&&CModifier.contains( wouldBeSuperClass.getCClass().getModifiers(), ACC_ABSTRACT)) pointcuts=crosscuttingClass.getPointcuts(); } super.checkInterface(context); | public void checkInterface(CContext context) throws PositionedError { //Add the superClass only to those classes, whose crosscuttingClass //has a crosscutting superClass if (crosscuttingClass.getSuperClass() != null && (CModifier.contains( crosscuttingClass.getSuperClass().getCClass().getModifiers(), ACC_... |
symRefToInt = new HashMap(); | private IntegerAlphabet() { intToSymRef = new HashMap(); symRefToInt = new HashMap(); queue = new ReferenceQueue(); } | |
Reference qref; while ((qref = queue.poll()) != null) { Integer qi = (Integer) symRefToInt.get(qref); if (qi != null) { intToSymRef.remove(qi); symRefToInt.remove(qref); } | KeyedWeakReference qref; while ((qref = (KeyedWeakReference) queue.poll()) != null) { intToSymRef.remove(qref.getKey()); | public synchronized IntegerSymbol getSymbol(int val) { Reference qref; while ((qref = queue.poll()) != null) { // System.out.println("Clearing queue"); Integer qi = (Integer) symRefToInt.get(qref); if (qi != null) { intToSymRef.remove(qi); symRefToInt.remove(qref); } qref.clear(); ... |
ref = new WeakReference(sym, queue); | ref = new KeyedWeakReference(i, sym, queue); | public synchronized IntegerSymbol getSymbol(int val) { Reference qref; while ((qref = queue.poll()) != null) { // System.out.println("Clearing queue"); Integer qi = (Integer) symRefToInt.get(qref); if (qi != null) { intToSymRef.remove(qi); symRefToInt.remove(qref); } qref.clear(); ... |
symRefToInt.put(ref, i); | public synchronized IntegerSymbol getSymbol(int val) { Reference qref; while ((qref = queue.poll()) != null) { // System.out.println("Clearing queue"); Integer qi = (Integer) symRefToInt.get(qref); if (qi != null) { intToSymRef.remove(qi); symRefToInt.remove(qref); } qref.clear(); ... | |
public void addKarma(Karma karma) throws Exception | public void addKarma(Karma karma) | public void addKarma(Karma karma) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.add")); p.setInt(1, karma.getPostId()); p.setInt(2, karma.getPostUserId()); p.setInt(3, karma.getFromUserId()); p.setInt(4, karma.getPoints()); p.set... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.add")); p.setInt(1, karma.getPostId()); p.setInt(2, karma.getPostUserId()); p.setInt(3, karma.getFromUserId()); p.setInt(4, karma.getPoints()); p.setInt(5, karma.getTopicId()); p.setTimestamp(6, new Timestamp(... | PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.add")); p.setInt(1, karma.getPostId()); p.setInt(2, karma.getPostUserId()); p.setInt(3, karma.getFromUserId()); p.setInt(4, karma.getPoints()); p.setInt(5, karma.getTopicId()); p.setTimestamp(6, ... | public void addKarma(Karma karma) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.add")); p.setInt(1, karma.getPostId()); p.setInt(2, karma.getPostUserId()); p.setInt(3, karma.getFromUserId()); p.setInt(4, karma.getPoints()); p.set... |
this.updateUserKarma(karma.getPostUserId()); } | this.updateUserKarma(karma.getPostUserId()); } catch (SQLException e) { String es = "Erorr addKarma()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(p); } } | public void addKarma(Karma karma) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.add")); p.setInt(1, karma.getPostId()); p.setInt(2, karma.getPostUserId()); p.setInt(3, karma.getFromUserId()); p.setInt(4, karma.getPoints()); p.set... |
User user = null; | protected List fillUser(ResultSet rs) throws SQLException { List usersAndPoints = new ArrayList(); User user = null; KarmaStatus karma = null; while (rs.next()) { user = new User(); karma = new KarmaStatus(); karma.setTotalPoints(rs.getInt("total")); karma.setVotesReceived(rs.getInt("votes_received")); k... | |
user = new User(); | User user = new User(); | protected List fillUser(ResultSet rs) throws SQLException { List usersAndPoints = new ArrayList(); User user = null; KarmaStatus karma = null; while (rs.next()) { user = new User(); karma = new KarmaStatus(); karma.setTotalPoints(rs.getInt("total")); karma.setVotesReceived(rs.getInt("votes_received")); k... |
throws Exception | public List getMostRatedUserByPeriod(int start, Date firstPeriod, Date lastPeriod, String orderField) throws Exception { String sql = SystemGlobals.getSql("KarmaModel.getMostRatedUserByPeriod"); String orderby = " ORDER BY " + orderField + " DESC"; sql += orderby; return this.getMostRatedUserByPeriod(sql, star... | |
String orderby = " ORDER BY " + orderField + " DESC"; sql += orderby; | sql += " ORDER BY " + orderField + " DESC"; | public List getMostRatedUserByPeriod(int start, Date firstPeriod, Date lastPeriod, String orderField) throws Exception { String sql = SystemGlobals.getSql("KarmaModel.getMostRatedUserByPeriod"); String orderby = " ORDER BY " + orderField + " DESC"; sql += orderby; return this.getMostRatedUserByPeriod(sql, star... |
public KarmaStatus getPostKarma(int postId) throws Exception | public KarmaStatus getPostKarma(int postId) | public KarmaStatus getPostKarma(int postId) throws Exception { KarmaStatus karma = new KarmaStatus(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getPostKarma")); p.setInt(1, postId); ResultSet rs = p.executeQuery(); if (rs.next()) { karma.setKa... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getPostKarma")); p.setInt(1, postId); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getPostKarma")); p.setInt(1, postId); | public KarmaStatus getPostKarma(int postId) throws Exception { KarmaStatus karma = new KarmaStatus(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getPostKarma")); p.setInt(1, postId); ResultSet rs = p.executeQuery(); if (rs.next()) { karma.setKa... |
ResultSet rs = p.executeQuery(); if (rs.next()) { karma.setKarmaPoints(Math.round(rs.getDouble(1))); } | rs = p.executeQuery(); if (rs.next()) { karma.setKarmaPoints(Math.round(rs.getDouble(1))); } | public KarmaStatus getPostKarma(int postId) throws Exception { KarmaStatus karma = new KarmaStatus(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getPostKarma")); p.setInt(1, postId); ResultSet rs = p.executeQuery(); if (rs.next()) { karma.setKa... |
rs.close(); p.close(); return karma; } | return karma; } catch (SQLException e) { String es = "Erorr getPostKarma()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } } | public KarmaStatus getPostKarma(int postId) throws Exception { KarmaStatus karma = new KarmaStatus(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getPostKarma")); p.setInt(1, postId); ResultSet rs = p.executeQuery(); if (rs.next()) { karma.setKa... |
public KarmaStatus getUserKarma(int userId) throws Exception | public KarmaStatus getUserKarma(int userId) | public KarmaStatus getUserKarma(int userId) throws Exception { KarmaStatus status = new KarmaStatus(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getUserKarma")); p.setInt(1, userId); ResultSet rs = p.executeQuery(); if (rs.next()) { status.set... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getUserKarma")); p.setInt(1, userId); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getUserKarma")); p.setInt(1, userId); | public KarmaStatus getUserKarma(int userId) throws Exception { KarmaStatus status = new KarmaStatus(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getUserKarma")); p.setInt(1, userId); ResultSet rs = p.executeQuery(); if (rs.next()) { status.set... |
ResultSet rs = p.executeQuery(); if (rs.next()) { status.setKarmaPoints(Math.round(rs.getDouble("user_karma"))); } | rs = p.executeQuery(); if (rs.next()) { status.setKarmaPoints(Math.round(rs.getDouble("user_karma"))); } | public KarmaStatus getUserKarma(int userId) throws Exception { KarmaStatus status = new KarmaStatus(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getUserKarma")); p.setInt(1, userId); ResultSet rs = p.executeQuery(); if (rs.next()) { status.set... |
rs.close(); p.close(); return status; } | return status; } catch (SQLException e) { String es = "Erorr getUserKarma()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } } | public KarmaStatus getUserKarma(int userId) throws Exception { KarmaStatus status = new KarmaStatus(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getUserKarma")); p.setInt(1, userId); ResultSet rs = p.executeQuery(); if (rs.next()) { status.set... |
public void getUserTotalKarma(User user) throws SQLException | public void getUserTotalKarma(User user) | public void getUserTotalKarma(User user) throws SQLException { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserTotalVotes")); p.setInt(1, user.getId()); ResultSet rs = p.executeQuery(); user.setKarma(new KarmaStatus()); if (rs.next()) { u... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserTotalVotes")); p.setInt(1, user.getId()); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserTotalVotes")); p.setInt(1, user.getId()); | public void getUserTotalKarma(User user) throws SQLException { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserTotalVotes")); p.setInt(1, user.getId()); ResultSet rs = p.executeQuery(); user.setKarma(new KarmaStatus()); if (rs.next()) { u... |
ResultSet rs = p.executeQuery(); | rs = p.executeQuery(); | public void getUserTotalKarma(User user) throws SQLException { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserTotalVotes")); p.setInt(1, user.getId()); ResultSet rs = p.executeQuery(); user.setKarma(new KarmaStatus()); if (rs.next()) { u... |
this.getVotesGiven(user); rs.close(); p.close(); | this.getVotesGiven(user); } catch (SQLException e) { String es = "Erorr getUserTotalKarma()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } | public void getUserTotalKarma(User user) throws SQLException { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserTotalVotes")); p.setInt(1, user.getId()); ResultSet rs = p.executeQuery(); user.setKarma(new KarmaStatus()); if (rs.next()) { u... |
public Map getUserVotes(int topicId, int userId) throws Exception | public Map getUserVotes(int topicId, int userId) | public Map getUserVotes(int topicId, int userId) throws Exception { Map m = new HashMap(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getUserVotes")); p.setInt(1, topicId); p.setInt(2, userId); ResultSet rs = p.executeQuery(); while (rs.next()) ... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getUserVotes")); p.setInt(1, topicId); p.setInt(2, userId); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getUserVotes")); p.setInt(1, topicId); p.setInt(2, userId); | public Map getUserVotes(int topicId, int userId) throws Exception { Map m = new HashMap(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getUserVotes")); p.setInt(1, topicId); p.setInt(2, userId); ResultSet rs = p.executeQuery(); while (rs.next()) ... |
ResultSet rs = p.executeQuery(); while (rs.next()) { m.put(new Integer(rs.getInt("post_id")), new Integer(rs.getInt("points"))); } | rs = p.executeQuery(); while (rs.next()) { m.put(new Integer(rs.getInt("post_id")), new Integer(rs.getInt("points"))); } | public Map getUserVotes(int topicId, int userId) throws Exception { Map m = new HashMap(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getUserVotes")); p.setInt(1, topicId); p.setInt(2, userId); ResultSet rs = p.executeQuery(); while (rs.next()) ... |
rs.close(); p.close(); return m; } | return m; } catch (SQLException e) { String es = "Erorr getUserVotes()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } } | public Map getUserVotes(int topicId, int userId) throws Exception { Map m = new HashMap(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.getUserVotes")); p.setInt(1, topicId); p.setInt(2, userId); ResultSet rs = p.executeQuery(); while (rs.next()) ... |
private void getVotesGiven(User user) throws SQLException | private void getVotesGiven(User user) | private void getVotesGiven(User user) throws SQLException { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserGivenVotes")); p.setInt(1, user.getId()); ResultSet rs = p.executeQuery(); if (rs.next()) { user.getKarma().setVotesGiven(rs.getInt... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserGivenVotes")); p.setInt(1, user.getId()); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserGivenVotes")); p.setInt(1, user.getId()); | private void getVotesGiven(User user) throws SQLException { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserGivenVotes")); p.setInt(1, user.getId()); ResultSet rs = p.executeQuery(); if (rs.next()) { user.getKarma().setVotesGiven(rs.getInt... |
ResultSet rs = p.executeQuery(); | rs = p.executeQuery(); | private void getVotesGiven(User user) throws SQLException { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserGivenVotes")); p.setInt(1, user.getId()); ResultSet rs = p.executeQuery(); if (rs.next()) { user.getKarma().setVotesGiven(rs.getInt... |
if (rs.next()) { user.getKarma().setVotesGiven(rs.getInt("votes")); } rs.close(); p.close(); } | if (rs.next()) { user.getKarma().setVotesGiven(rs.getInt("votes")); } } catch (SQLException e) { String es = "Erorr getVotesGiven()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } } | private void getVotesGiven(User user) throws SQLException { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserGivenVotes")); p.setInt(1, user.getId()); ResultSet rs = p.executeQuery(); if (rs.next()) { user.getKarma().setVotesGiven(rs.getInt... |
public void update(Karma karma) throws Exception | public void update(Karma karma) | public void update(Karma karma) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.update")); p.setInt(1, karma.getPoints()); p.setInt(2, karma.getId()); p.executeUpdate(); p.close(); } |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.update")); p.setInt(1, karma.getPoints()); p.setInt(2, karma.getId()); p.executeUpdate(); p.close(); } | PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.update")); p.setInt(1, karma.getPoints()); p.setInt(2, karma.getId()); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr update()"; log.error(es, e); throw new RuntimeException(es,... | public void update(Karma karma) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.update")); p.setInt(1, karma.getPoints()); p.setInt(2, karma.getId()); p.executeUpdate(); p.close(); } |
public void updateUserKarma(int userId) throws Exception | public void updateUserKarma(int userId) | public void updateUserKarma(int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserKarmaPoints")); p.setInt(1, userId); int totalRecords = 0; double totalPoints = 0; ResultSet rs = p.executeQuery(); while (rs.next... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserKarmaPoints")); p.setInt(1, userId); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserKarmaPoints")); p.setInt(1, userId); | public void updateUserKarma(int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserKarmaPoints")); p.setInt(1, userId); int totalRecords = 0; double totalPoints = 0; ResultSet rs = p.executeQuery(); while (rs.next... |
int totalRecords = 0; double totalPoints = 0; ResultSet rs = p.executeQuery(); while (rs.next()) { int points = rs.getInt("points"); int votes = rs.getInt("votes"); | int totalRecords = 0; double totalPoints = 0; rs = p.executeQuery(); | public void updateUserKarma(int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserKarmaPoints")); p.setInt(1, userId); int totalRecords = 0; double totalPoints = 0; ResultSet rs = p.executeQuery(); while (rs.next... |
totalPoints += ((double) points / votes); totalRecords++; } | while (rs.next()) { int points = rs.getInt("points"); int votes = rs.getInt("votes"); | public void updateUserKarma(int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserKarmaPoints")); p.setInt(1, userId); int totalRecords = 0; double totalPoints = 0; ResultSet rs = p.executeQuery(); while (rs.next... |
rs.close(); p.close(); | totalPoints += ((double) points / votes); totalRecords++; } | public void updateUserKarma(int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserKarmaPoints")); p.setInt(1, userId); int totalRecords = 0; double totalPoints = 0; ResultSet rs = p.executeQuery(); while (rs.next... |
p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.updateUserKarma")); double karmaPoints = totalPoints / totalRecords; if (Double.isNaN(karmaPoints)) { karmaPoints = 0; } p.setDouble(1, karmaPoints); p.setInt(2, userId); p.executeUpdate(); p.close(); } | rs.close(); rs=null; p.close(); p=null; p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("KarmaModel.updateUserKarma")); double karmaPoints = totalPoints / totalRecords; if (Double.isNaN(karmaPoints)) { karmaPoints = 0; } p.setDouble(1, karmaPoints); p.setInt(2, userId); p.executeUpd... | public void updateUserKarma(int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.getUserKarmaPoints")); p.setInt(1, userId); int totalRecords = 0; double totalPoints = 0; ResultSet rs = p.executeQuery(); while (rs.next... |
public boolean userCanAddKarma(int userId, int postId) throws Exception | public boolean userCanAddKarma(int userId, int postId) | public boolean userCanAddKarma(int userId, int postId) throws Exception { boolean status = true; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.userCanAddKarma")); p.setInt(1, postId); p.setInt(2, userId); ResultSet rs = p.executeQuery(); if (rs... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.userCanAddKarma")); p.setInt(1, postId); p.setInt(2, userId); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.userCanAddKarma")); p.setInt(1, postId); p.setInt(2, userId); | public boolean userCanAddKarma(int userId, int postId) throws Exception { boolean status = true; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.userCanAddKarma")); p.setInt(1, postId); p.setInt(2, userId); ResultSet rs = p.executeQuery(); if (rs... |
ResultSet rs = p.executeQuery(); if (rs.next()) { status = rs.getInt(1) < 1; } | rs = p.executeQuery(); if (rs.next()) { status = rs.getInt(1) < 1; } | public boolean userCanAddKarma(int userId, int postId) throws Exception { boolean status = true; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.userCanAddKarma")); p.setInt(1, postId); p.setInt(2, userId); ResultSet rs = p.executeQuery(); if (rs... |
rs.close(); p.close(); return status; } | return status; } catch (SQLException e) { String es = "Erorr selectActiveBannerByPlacement()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } } | public boolean userCanAddKarma(int userId, int postId) throws Exception { boolean status = true; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("KarmaModel.userCanAddKarma")); p.setInt(1, postId); p.setInt(2, userId); ResultSet rs = p.executeQuery(); if (rs... |
counts = new IndexedCount(indexer); | counts = new IndexedCount(getIndexer()); | public Trainer() { counts = new IndexedCount(indexer); } |
AtomicSymbol s = (AtomicSymbol) indexer.symbolForIndex(i); | AtomicSymbol s = (AtomicSymbol) getIndexer().symbolForIndex(i); | protected void trainImpl(DistributionTrainerContext dtc, double weight) { try { Distribution nullModel = getNullModel(); double[] weights = getWeights(); double []total = new double[weights.length]; double sum = 0.0; for(int i = 0; i < total.length; i++) { AtomicSymbol s =... |
this.indexer = AlphabetManager.getAlphabetIndex(alphabet); indexer.addChangeListener( new ChangeAdapter() { public void preChange(ChangeEvent ce) throws ChangeVetoException { if(hasWeights()) { throw new ChangeVetoException( ce, "Can't allow the index to change as we have probabilities." ); } } }, AlphabetIndex.INDEX )... | this.alphabet = alphabet; | public SimpleDistribution(FiniteAlphabet alphabet) { this.indexer = AlphabetManager.getAlphabetIndex(alphabet); indexer.addChangeListener( new ChangeAdapter() { public void preChange(ChangeEvent ce) throws ChangeVetoException { if(hasWeights()) { throw new ChangeVetoException( ... |
return indexer.getAlphabet(); } | return alphabet; } | public Alphabet getAlphabet() { return indexer.getAlphabet(); } |
return weights[indexer.indexForSymbol(s)]; | return weights[getIndexer().indexForSymbol(s)]; | public double getWeightImpl(AtomicSymbol s) throws IllegalSymbolException { if(!hasWeights()) { return Double.NaN; } else { return weights[indexer.indexForSymbol(s)]; } } |
weights = new double[indexer.getAlphabet().size()]; | weights = new double[getIndexer().getAlphabet().size()]; | protected double[] getWeights() { if(weights == null) { weights = new double[indexer.getAlphabet().size()]; for(int i = 0; i < weights.length; i++) { weights[i] = Double.NaN; } } return weights; } |
weights[indexer.indexForSymbol(s)] = w; | weights[getIndexer().indexForSymbol(s)] = w; | protected void setWeightImpl(AtomicSymbol s, double w) throws IllegalSymbolException, ChangeVetoException { double[] weights = getWeights(); if(w < 0.0) { throw new IllegalArgumentException( "Can't set weight to negative score: " + s.getName() + " -> " + w ); } weights[indexer.ind... |
throws Exception { | { | public List getMostRatedUserByPeriod(int start, Date firstPeriod, Date lastPeriod, String orderField) throws Exception { String sql = SystemGlobals.getSql("GenericModel.selectByLimit") + " " + start + " " + SystemGlobals.getSql("KarmaModel.getMostRatedUserByPeriod"); String orderby = " ORDER BY " + orderField +... |
String orderby = " ORDER BY " + orderField + " DESC"; sql += orderby; | sql += " ORDER BY " + orderField + " DESC"; | public List getMostRatedUserByPeriod(int start, Date firstPeriod, Date lastPeriod, String orderField) throws Exception { String sql = SystemGlobals.getSql("GenericModel.selectByLimit") + " " + start + " " + SystemGlobals.getSql("KarmaModel.getMostRatedUserByPeriod"); String orderby = " ORDER BY " + orderField +... |
public CClass generateCClass(Set visited, JavaTypeNode node, CContext context) { | public CClass generateCClass(JavaTypeNode node, CContext context) { | public CClass generateCClass(Set visited, JavaTypeNode node, CContext context) { // CTODO we need binary/source flag for CaesarTypeNode // for now consider everything as non-binary try { if(node.getParent() == null) { return cont... |
if(visited.contains(node)) { | if(context.getClassReader().hasClassFile(node.getQualifiedName().toString())) { | public CClass generateCClass(Set visited, JavaTypeNode node, CContext context) { // CTODO we need binary/source flag for CaesarTypeNode // for now consider everything as non-binary try { if(node.getParent() == null) { return cont... |
visited.add(node); | public CClass generateCClass(Set visited, JavaTypeNode node, CContext context) { // CTODO we need binary/source flag for CaesarTypeNode // for now consider everything as non-binary try { if(node.getParent() == null) { return cont... | |
owner = generateCClass(visited, outer, context); | owner = generateCClass(outer, context); | public CClass generateCClass(Set visited, JavaTypeNode node, CContext context) { // CTODO we need binary/source flag for CaesarTypeNode // for now consider everything as non-binary try { if(node.getParent() == null) { return cont... |
generateCClass(visited, itemParent, context).getAbstractType(); | generateCClass(itemParent, context).getAbstractType(); | public CClass generateCClass(Set visited, JavaTypeNode node, CContext context) { // CTODO we need binary/source flag for CaesarTypeNode // for now consider everything as non-binary try { if(node.getParent() == null) { return cont... |
HashSet visited = new HashSet(); | public void generateMissingMixinChainParts( CompilerBase compilerBase, KjcEnvironment environment, JCompilationUnit cu ) { CaesarTypeSystem caesarTypeSystem = environment.getCaesarTypeSystem(); TypeFactory typeFactory = environment.getTypeFactory(); ClassReader classRe... | |
CClass clazz = generateCClass(visited, item, context); item.setCClass(clazz); | CClass clazz = generateCClass(item, context); item.setCClass(clazz); | public void generateMissingMixinChainParts( CompilerBase compilerBase, KjcEnvironment environment, JCompilationUnit cu ) { CaesarTypeSystem caesarTypeSystem = environment.getCaesarTypeSystem(); TypeFactory typeFactory = environment.getTypeFactory(); ClassReader classRe... |
setFault(e); | recordFault(e); | public void execute() { assertNotCompleted(); try { getTheConnection().getSession(getSessionIndex()).commit(); } catch (RuntimeException e) { setFault(e); } catch (JMSException e) { LOG.error(e); setFault(new HJBException(e)); } c... |
LOG.error(e); setFault(new HJBException(e)); | recordFault(new HJBException(e)); | public void execute() { assertNotCompleted(); try { getTheConnection().getSession(getSessionIndex()).commit(); } catch (RuntimeException e) { setFault(e); } catch (JMSException e) { LOG.error(e); setFault(new HJBException(e)); } c... |
findPrefix(local, new CExpressionContext(context, context.getEnvironment(), false, false)); | { if (prefix != null) { prefix = prefix.analyse(context); check( context, prefix.getType(factory).isClassType(), KjcMessages.FIELD_BADACCESS, prefix.getType(factory)); constantPrefix = prefix instanceof JTypeNameExpression; } else { constantPrefix = true; try { field = context.lookupField( local, null , ident); if (fi... | public JExpression analyse(CExpressionContext context) throws PositionedError { TypeFactory factory = context.getTypeFactory(); if (analysed) { return this; } JExpression origPrefix = prefix; CClass local = context.getClassContext().getCClass(); findPrefix(local, new CExpressionContext(... |
if (this.server != null) | if (this.acceptor != null) | public void setHostName(String hostname) { if (this.server != null) throw new IllegalStateException("TcpTable already running"); this.hostName = hostname; } |
if (this.server != null) | if (this.acceptor != null) | public void setPort(int port) { if (this.server != null) throw new IllegalStateException("TcpTable already running"); this.port = port; } |
if (this.server != null) throw new IllegalStateException("TcpTableServer already running"); | if (this.acceptor != null) throw new IllegalStateException("TcpTableService already running"); | public void start() throws IOException { if (this.server != null) throw new IllegalStateException("TcpTableServer already running"); InetAddress binding = null; String bindAddress = System.getProperty("jboss.bind.address"); if (bindAddress != null && !"0.0.0.0".equals(bindAddress)) binding = InetAddress.ge... |
log.info("Starting TcpTable service: " + (binding==null ? "*" : binding) + ":" + port); | log.info("Starting TcpTableService: " + (binding==null ? "*" : binding) + ":" + port); | public void start() throws IOException { if (this.server != null) throw new IllegalStateException("TcpTableServer already running"); InetAddress binding = null; String bindAddress = System.getProperty("jboss.bind.address"); if (bindAddress != null && !"0.0.0.0".equals(bindAddress)) binding = InetAddress.ge... |
this.server = new TcpTableServer(this); this.server.setBindAddress(binding); this.server.setPort(this.port); | this.acceptor = new SocketAcceptor(); this.acceptor.getFilterChain().addLast( "codec", new ProtocolCodecFilter( new TextLineCodecFactory(Charset.forName("UTF-8"))) ); | public void start() throws IOException { if (this.server != null) throw new IllegalStateException("TcpTableServer already running"); InetAddress binding = null; String bindAddress = System.getProperty("jboss.bind.address"); if (bindAddress != null && !"0.0.0.0".equals(bindAddress)) binding = InetAddress.ge... |
if (this.hostName != null) this.server.setHostName(this.hostName); this.server.start(); | this.acceptor.bind(new InetSocketAddress(binding, this.port), new Handler()); | public void start() throws IOException { if (this.server != null) throw new IllegalStateException("TcpTableServer already running"); InetAddress binding = null; String bindAddress = System.getProperty("jboss.bind.address"); if (bindAddress != null && !"0.0.0.0".equals(bindAddress)) binding = InetAddress.ge... |
this.server.stop(); this.server = null; | this.acceptor.unbindAll(); this.acceptor = null; | public void stop() { log.info("Stopping TcpTable service"); this.server.stop(); this.server = null; } |
if (!stack.isDefined("#imports")) { return fe; } | private FlowElement addImports(FlowElement fe, VariableStack stack, ChannelContext sc) throws ExecutionException { if (!stack.isDefined("#imports")) { return fe; } RemoteContainer seq = new RemoteContainer(); seq.setElementType("sequential"); Collection imports = (Collection) stack.getVar("#imports"); Iterat... | |
Collection imports = (Collection) stack.getVar("#imports"); Iterator i = imports.iterator(); while (i.hasNext()) { String imp = (String) i.next(); seq.addElement(getImport(sc, imp)); | if (stack.isDefined("#imports")) { Collection imports = (Collection) stack.getVar("#imports"); Iterator i = imports.iterator(); while (i.hasNext()) { String imp = (String) i.next(); seq.addElement(getImport(sc, imp)); } | private FlowElement addImports(FlowElement fe, VariableStack stack, ChannelContext sc) throws ExecutionException { if (!stack.isDefined("#imports")) { return fe; } RemoteContainer seq = new RemoteContainer(); seq.setElementType("sequential"); Collection imports = (Collection) stack.getVar("#imports"); Iterat... |
if (!(value instanceof UserDefinedElement)) { | if (value instanceof JavaElement) { | protected VariableStack prepareStack(VariableStack stack) throws ExecutionException { Set names = new HashSet(); Integer caller = (Integer) stack.getVar("#calleruid"); KarajanProperties properties; if (ic.getChannelContext().getService().isRestricted()) { properties = KarajanProperties.getRestricted(); } else ... |
} else if (value instanceof UDEDefinition) { UDEDefinition uded = (UDEDefinition) value; m.put(prefix, new UDEDefinition(uded.getUdeNR(), env)); | protected VariableStack prepareStack(VariableStack stack) throws ExecutionException { Set names = new HashSet(); Integer caller = (Integer) stack.getVar("#calleruid"); KarajanProperties properties; if (ic.getChannelContext().getService().isRestricted()) { properties = KarajanProperties.getRestricted(); } else ... | |
logger.debug("Destination UID: " + eid); | if (logger.isDebugEnabled()) { logger.debug("Destination UID: " + eid); } | public void requestComplete() throws ProtocolException { List data = this.getInDataChuncks(); String id = new String((byte[]) data.get(0)); ic = getChannel().getUserContext().getInstanceContext(id); if (ic == null) { sendError("Invalid workflow id: " + id); } else { Integer eid = Integer.valueOf(new String((... |
sendError("Exception caught: " + e.toString()); | sendError(e.getMessage(), e); | public void requestComplete() throws ProtocolException { List data = this.getInDataChuncks(); String id = new String((byte[]) data.get(0)); ic = getChannel().getUserContext().getInstanceContext(id); if (ic == null) { sendError("Invalid workflow id: " + id); } else { Integer eid = Integer.valueOf(new String((... |
public MessageIndexerTask(Post post) throws Exception | public MessageIndexerTask(Post post) | public MessageIndexerTask(Post post) throws Exception { this.post = post; this.conn = DBConnection.getImplementation().getConnection(); } |
this.conn = DBConnection.getImplementation().getConnection(); | public MessageIndexerTask(Post post) throws Exception { this.post = post; this.conn = DBConnection.getImplementation().getConnection(); } | |
public Object execute() throws Exception | public Object execute() | public Object execute() throws Exception { try { SearchIndexerDAO indexer = DataAccessDriver.getInstance().newSearchIndexerDAO(); indexer.setConnection(this.conn); indexer.insertSearchWords(this.post); } catch (Exception e) { logger.warn("Error while indexing a post: " + e); e.printStackTrace(); } final... |
indexer.setConnection(this.conn); | indexer.setConnection(conn); | public Object execute() throws Exception { try { SearchIndexerDAO indexer = DataAccessDriver.getInstance().newSearchIndexerDAO(); indexer.setConnection(this.conn); indexer.insertSearchWords(this.post); } catch (Exception e) { logger.warn("Error while indexing a post: " + e); e.printStackTrace(); } final... |
if (this.conn != null) { try { DBConnection.getImplementation().releaseConnection(this.conn); } catch (Exception e) {} } | DBConnection.getImplementation().releaseConnection(conn); | public Object execute() throws Exception { try { SearchIndexerDAO indexer = DataAccessDriver.getInstance().newSearchIndexerDAO(); indexer.setConnection(this.conn); indexer.insertSearchWords(this.post); } catch (Exception e) { logger.warn("Error while indexing a post: " + e); e.printStackTrace(); } final... |
public static void clearCache(int forumId) throws Exception | public static void clearCache(int forumId) | public static void clearCache(int forumId) throws Exception { synchronized (FQN_FORUM) { cache.add(FQN_FORUM, Integer.toString(forumId), new LinkedList()); cache.remove(FQN, RELATION); } } |
public static List getRecentTopics() throws Exception | public static List getRecentTopics() | public static List getRecentTopics() throws Exception { List l = (List)cache.get(FQN, RECENT); if (l == null || l.size() == 0 || !SystemGlobals.getBoolValue(ConfigKeys.TOPIC_CACHE_ENABLED)) { l = loadMostRecentTopics(); } return new ArrayList(l); } |
public static List loadMostRecentTopics() throws Exception | public static List loadMostRecentTopics() | public static List loadMostRecentTopics() throws Exception { TopicDAO tm = DataAccessDriver.getInstance().newTopicDAO(); int limit = SystemGlobals.getIntValue(ConfigKeys.RECENT_TOPICS); List l = tm.selectRecentTopics(limit); cache.add(FQN, RECENT, new LinkedList(l)); return l; } |
public synchronized static void pushTopic(Topic topic) throws Exception | public synchronized static void pushTopic(Topic topic) | public synchronized static void pushTopic(Topic topic) throws Exception { if (SystemGlobals.getBoolValue(ConfigKeys.TOPIC_CACHE_ENABLED)) { int limit = SystemGlobals.getIntValue(ConfigKeys.RECENT_TOPICS); LinkedList l = (LinkedList)cache.get(FQN, RECENT); if (l == null || l.size() == 0) { l = new LinkedLi... |
public List selectGroups(int parentId) throws Exception | public List selectGroups(int parentId) | public List selectGroups(int parentId) throws Exception { List list = new ArrayList(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TreeGroup.selectGroup")); p.setInt(1, parentId); ResultSet rs = p.executeQuery(); while (rs.next()) { GroupNode n = ne... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TreeGroup.selectGroup")); p.setInt(1, parentId); ResultSet rs = p.executeQuery(); while (rs.next()) { GroupNode n = new GroupNode(); n.setName(rs.getString("group_name")); n.setId(rs.getInt("group_id")); list.add(n); ... | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TreeGroup.selectGroup")); p.setInt(1, parentId); rs = p.executeQuery(); while (rs.next()) { GroupNode n = new GroupNode(); n.setName(rs.getString("group_name")); n.setId(rs.getInt("grou... | public List selectGroups(int parentId) throws Exception { List list = new ArrayList(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TreeGroup.selectGroup")); p.setInt(1, parentId); ResultSet rs = p.executeQuery(); while (rs.next()) { GroupNode n = ne... |
String qualifier = SeqFormatTools.formatQualifier(key, vi.next()); stream.println(SeqFormatTools.formatQualifierBlock(qualifier, | stream.println(SeqFormatTools.formatQualifierBlock(SeqFormatTools.formatQualifier(key, vi.next()), | public void addFeatureProperty(final Object key, final Object value) throws ParseException { // There are 19 spaces in the leader String leader = "FT "; // Don't print internal data structures if (key.equals(Feature.PROPERTY_DATA_KEY)) return; // The value may ... |
String qualifier = SeqFormatTools.formatQualifier(key, value); stream.println(SeqFormatTools.formatQualifierBlock(qualifier, | stream.println(SeqFormatTools.formatQualifierBlock(SeqFormatTools.formatQualifier(key, value), | public void addFeatureProperty(final Object key, final Object value) throws ParseException { // There are 19 spaces in the leader String leader = "FT "; // Don't print internal data structures if (key.equals(Feature.PROPERTY_DATA_KEY)) return; // The value may ... |
msgs = this.admin.getListMgr().getHeldMessages(this.ml.getId(), -1, -1); assertEquals(0, msgs.size()); | public void testDiscard() throws Exception { this.injector.inject(this.pers2.getAddress().getAddress(), this.ml.getEmail(), rawMsg); Thread.sleep(1000); assertEquals(1, this.smtp.count(MailType.YOUR_MAIL_HELD)); Collection<MailHold> msgs = this.admin.getListMgr().getHeldMessages(this.ml.getId(), -1, -1); assert... | |
public SymbolList subList(int from, int to) { | public SymbolList subList(int start, int end) { if (start < 1 || end > length()) { throw new IndexOutOfBoundsException( "Sublist index out of bounds " + length() + ":" + start + "," + end ); } | public SymbolList subList(int from, int to) { // // Mildly optimized for case where from and to are within // the same chunk. // int afrom = from - 1; int ato = to - 1; int cfrom = afrom / chunkSize; if (ato / chunkSize == cfrom) { return new SubArraySymbolList(chunks[cfrom], to - from + 1, afrom %... |
int afrom = from - 1; int ato = to - 1; int cfrom = afrom / chunkSize; if (ato / chunkSize == cfrom) { return new SubArraySymbolList(chunks[cfrom], to - from + 1, afrom % chunkSize, getAlphabet()); } else { return super.subList(from, to); } | if (end < start) { throw new IllegalArgumentException( "end must not be lower than start: start=" + start + ", end=" + end ); } int afrom = start - 1; int ato = end - 1; int cfrom = afrom / chunkSize; if (ato / chunkSize == cfrom) { return new SubArraySymbolList(chunks[cfrom], end - start + 1, afrom % chunkSize, ... | public SymbolList subList(int from, int to) { // // Mildly optimized for case where from and to are within // the same chunk. // int afrom = from - 1; int ato = to - 1; int cfrom = afrom / chunkSize; if (ato / chunkSize == cfrom) { return new SubArraySymbolList(chunks[cfrom], to - from + 1, afrom %... |
public void add(UserSession us, Connection conn) throws Exception; | public void add(UserSession us, Connection conn) ; | public void add(UserSession us, Connection conn) throws Exception; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.