Skip to content

Commit e42e4ef

Browse files
authored
Merge pull request #70 from topcoder-platform/dev
fix missing delete parameter
2 parents 3eb7129 + efd4cf3 commit e42e4ef

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/main/java/com/topcoder/onlinereview/component/project/phase/PhasePersistence.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -998,14 +998,11 @@ private void updateDependencies(List<Dependency> deps, String operator) {
998998
* @throws SQLException if any database error occurs.
999999
*/
10001000
private void deleteDependencies(List<Long> ids, long dependantId) {
1001-
Long[] idArr = new Long[ids.size() + 1];
1002-
idArr[0] = dependantId;
1003-
for (int i = 0; i < ids.size(); i++) {
1004-
idArr[i + 1] = ids.get(i);
1005-
}
1001+
Long[] idArr = new Long[ids.size()];
1002+
ids.toArray(idArr);
10061003
// execute update
10071004
executeUpdateSql(
1008-
jdbcTemplate, DELETE_PHASE_DEPENDENCY + createQuestionMarks(idArr), newArrayList());
1005+
jdbcTemplate, DELETE_PHASE_DEPENDENCY + createQuestionMarks(idArr), newArrayList(dependantId));
10091006
}
10101007

10111008
/**
@@ -1060,7 +1057,7 @@ jdbcTemplate, SELECT_PHASE_CRITERIA_FOR_PHASE, newArrayList(phase.getId()))
10601057
.collect(Collectors.toList())
10611058
.toArray(new Long[0]);
10621059
executeUpdateSql(
1063-
jdbcTemplate, DELETE_PHASE_CRITERIA + createQuestionMarks(ids), newArrayList());
1060+
jdbcTemplate, DELETE_PHASE_CRITERIA + createQuestionMarks(ids), newArrayList(phase.getId()));
10641061
}
10651062
}
10661063

0 commit comments

Comments
 (0)