Skip to content

Commit efca868

Browse files
committed
wontfix #251, wontfix #224, wontfix #245, wontfix #246
1 parent 191c77f commit efca868

File tree

11 files changed

+12
-52
lines changed

11 files changed

+12
-52
lines changed

etc/TODO.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,7 @@
7373
* Issue #234 Taskstate: Task Edit Form -> change Project via DropDown
7474
* Issue #235 Project/Root: Task Edit Form -> change Project via DropDown
7575
* Issue #236 Project/id: Task Edit Form -> change Project via DropDown
76+
77+
78+
79+
wontfix #251, wontfix #224, wontfix #245, wontfix #246

src/main/java/org/woehlke/simpleworklist/domain/context/ContextRepository.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@
1111
/**
1212
* Created by tw on 13.03.16.
1313
*/
14-
@SuppressWarnings("Deprecation")
1514
@Repository
1615
public interface ContextRepository extends JpaRepository<Context, Long> {
1716

18-
//TODO: #251 change List<Context> to Page<Context>
19-
@Deprecated
2017
List<Context> findByUserAccount(UserAccount user);
2118
Page<Context> findByUserAccount(UserAccount user, Pageable pageRequest);
2219

src/main/java/org/woehlke/simpleworklist/domain/context/ContextService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
*/
1212
public interface ContextService {
1313

14-
//TODO: #251 change List<Context> to Page<Context>
1514
//TODO: rename to findByUser
1615
List<Context> getAllForUser(UserAccount user);
1716

src/main/java/org/woehlke/simpleworklist/domain/context/ContextServiceImpl.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public ContextServiceImpl(ContextRepository contextRepository, TaskRepository ta
3636
@Override
3737
public List<Context> getAllForUser(UserAccount user) {
3838
log.info("getAllForUser");
39-
//noinspection deprecation
4039
return contextRepository.findByUserAccount(user);
4140
}
4241

@@ -79,9 +78,7 @@ public boolean delete(Context context) {
7978
@Override
8079
public boolean contextHasItems(Context context) {
8180
log.info("contextHasItems");
82-
//noinspection deprecation
8381
long numberOfTasks = taskRepository.findByContext(context).size();
84-
//noinspection deprecation
8582
int numberOfProjects = projectRepository.findByContext(context).size();
8683
return ((numberOfTasks + numberOfProjects) > 0);
8784
}

src/main/java/org/woehlke/simpleworklist/domain/project/ProjectRepository.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,13 @@
77
import org.springframework.data.jpa.repository.JpaRepository;
88
import org.springframework.stereotype.Repository;
99
import org.woehlke.simpleworklist.domain.context.Context;
10-
@SuppressWarnings("Deprecation")
10+
1111
@Repository
1212
public interface ProjectRepository extends JpaRepository<Project, Long> {
1313

14-
//TODO: #245 change List<Project> to Page<Project>
15-
@Deprecated
1614
List<Project> findByContext(Context context);
1715
Page<Project> findByContext(Context context, Pageable pageRequest);
1816

19-
//TODO: #245 change List<Project> to Page<Project>
20-
@Deprecated
2117
List<Project> findByParentIsNullAndContext(Context context);
2218
Page<Project> findByParentIsNullAndContext(Context context, Pageable pageRequest);
2319

src/main/java/org/woehlke/simpleworklist/domain/project/ProjectService.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@
99

1010
public interface ProjectService {
1111

12-
//TODO: #245 change List<Project> to Page<Project>
13-
@Deprecated
1412
List<Project> findRootProjectsByContext(Context context);
1513
Page<Project> findRootProjectsByContext(Context context, Pageable pageRequest);
1614

17-
//TODO: #245 change List<Project> to Page<Project>
18-
@Deprecated
1915
List<Project> findAllProjectsByContext(Context context);
2016
Page<Project> findAllProjectsByContext(Context context, Pageable pageRequest);
2117

src/main/java/org/woehlke/simpleworklist/domain/project/ProjectServiceImpl.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ public ProjectServiceImpl(
3636
this.taskRepository = taskRepository;
3737
}
3838

39-
//TODO: #245 change List<Project> to Page<Project>
40-
@Deprecated
41-
//@Override
39+
@Override
4240
public List<Project> findRootProjectsByContext(@NotNull Context context) {
4341
log.info("findRootProjectsByContext");
4442
//TODO: #245 change List<Project> to Page<Project>
@@ -51,9 +49,7 @@ public Page<Project> findRootProjectsByContext(@NotNull Context context, Pageabl
5149
return projectRepository.findByParentIsNullAndContext(context,pageRequest);
5250
}
5351

54-
//TODO: #245 change List<Project> to Page<Project>
55-
@Deprecated
56-
//@Override
52+
@Override
5753
public List<Project> findAllProjectsByContext(@NotNull Context context) {
5854
log.info("findAllProjectsByContext");
5955
//TODO: #245 change List<Project> to Page<Project>
@@ -117,7 +113,6 @@ public Project moveProjectToAnotherContext(@NotNull Project thisProject, @NotNul
117113
//TODO: remove Recursion, remove unbounded Recursion and List instead of Page.
118114
List<Project> listProject = getAllChildrenOfProject(thisProject);
119115
for(Project childProject : listProject){
120-
//noinspection deprecation
121116
List<Task> tasksOfChildProject = taskRepository.findByProject(childProject);
122117
for(Task task:tasksOfChildProject){
123118
task.setContext(newContext);

src/main/java/org/woehlke/simpleworklist/domain/task/Task.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import lombok.Getter;
1111
import lombok.Setter;
1212
import lombok.ToString;
13-
//simport org.hibernate.annotations.*;
13+
//import org.hibernate.annotations.*;
1414
//import org.hibernate.annotations.CascadeType;
1515
//import org.hibernate.annotations.NamedQueries;
1616
//import org.hibernate.annotations.NamedQuery;

src/main/java/org/woehlke/simpleworklist/domain/task/TaskRepository.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,29 @@
1515
@Repository
1616
public interface TaskRepository extends JpaRepository<Task, Long> {
1717

18-
//TODO: #244 change List<Task> to Page<Task>
19-
@Deprecated
2018
List<Task> findByProject(Project thisProject);
2119
Page<Task> findByProject(Project thisProject, Pageable pageable);
2220
Page<Task> findByFocusAndContext(boolean focus, Context context, Pageable request);
2321
Page<Task> findByProjectIsNullAndContext(Context context, Pageable request);
2422

25-
//TODO: #244 change List<Task> to Page<Task>
26-
@Deprecated
2723
List<Task> findByContext(Context context);
2824
Page<Task> findByContext(Context context, Pageable pageable);
2925

3026
Task findTopByTaskStateAndContextOrderByOrderIdTaskStateDesc(TaskState taskState, Context context);
3127
Task findTopByProjectIsNullAndContextOrderByOrderIdProjectDesc(Context context);
3228
Task findTopByProjectAndContextOrderByOrderIdProjectDesc(Project project, Context context);
3329

34-
//TODO: #244 change List<Task> to Page<Task>>
35-
@Deprecated
3630
List<Task> findByTaskStateAndContext(TaskState taskState, Context context);
3731
Page<Task> findByTaskStateAndContext(TaskState taskState, Context context, Pageable request);
3832

39-
//TODO: #244 change List<Task> to Page<Task>
40-
@Deprecated
4133
List<Task> findByTaskStateAndContextOrderByOrderIdTaskStateAsc(
4234
TaskState taskState, Context context
4335
);
4436
Page<Task> findByTaskStateAndContextOrderByOrderIdTaskStateAsc(
4537
TaskState taskState, Context context, Pageable request
4638
);
4739

48-
//TODO: #244 change List<Task> to Page<Task>
4940
//TODO: #249 move the JQL Query-String to Entity as Prepared Statement
50-
@Deprecated
5141
//@Query("select t from Task t"
5242
// + " where t.orderIdTaskState > :lowerOrderIdTaskState and t.orderIdTaskState < :higherOrderIdTaskState"
5343
// + " and t.taskState = :taskState and t.context = :context")
@@ -69,15 +59,14 @@ Page<Task> getTasksByOrderIdTaskStateBetweenLowerTaskAndHigherTask(
6959
Pageable request
7060
);
7161

72-
//TODO: #244 change List<Task> to Page<Task>
7362
//TODO: #249 move the JQL Query-String to Entity as Prepared Statement
74-
@Deprecated
7563
@Query(name="queryGetTasksByOrderIdProjectBetweenLowerTaskAndHigherTask")
7664
List<Task> getTasksByOrderIdProjectBetweenLowerTaskAndHigherTask(
7765
@Param("lowerOrderIdProject") long lowerOrderIdProject,
7866
@Param("higherOrderIdProject") long higherOrderIdProject,
7967
@Param("project") Project project
8068
);
69+
8170
//TODO: #249 move the JQL Query-String to Entity as Prepared Statement
8271
//@Query("select t from Task t"
8372
// + " where t.orderIdProject > :lowerOrderIdProject and t.orderIdProject < :higherOrderIdProject"
@@ -90,9 +79,7 @@ Page<Task> getTasksByOrderIdProjectBetweenLowerTaskAndHigherTask(
9079
Pageable request
9180
);
9281

93-
//TODO: #244 move from List<Task> to Page<Task>
9482
//TODO: #249 move the JQL Query-String to Entity as Prepared Statement
95-
@Deprecated
9683
//@Query("select t from Task t"
9784
// + " where t.orderIdProject > :lowerOrderIdProject and t.orderIdProject < :higherOrderIdProject"
9885
// + " and t.project is null and t.context = :context ")
@@ -102,6 +89,7 @@ List<Task> getTasksByOrderIdProjectRootBetweenLowerTaskAndHigherTask(
10289
@Param("higherOrderIdProject") long higherOrderIdProject,
10390
@Param("context") Context context
10491
);
92+
10593
//TODO: #249 move the JQL Query-String to Entity as Prepared Statement
10694
//@Query("select t from Task t"
10795
// + " where t.orderIdProject > :lowerOrderIdProject and t.orderIdProject < :higherOrderIdProject"

src/main/java/org/woehlke/simpleworklist/domain/task/TaskServiceImpl.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,6 @@ public void moveAllCompletedToTrash(@NotNull Context context) {
199199
context
200200
);
201201
long newOrderIdTaskState = maxOrderIdTaskState;
202-
//TODO: #244 change List<Task> to Page<Task>
203-
//noinspection deprecation
204202
List<Task> taskListCompleted = taskRepository.findByTaskStateAndContextOrderByOrderIdTaskStateAsc(
205203
TaskState.COMPLETED,
206204
context
@@ -216,12 +214,10 @@ public void moveAllCompletedToTrash(@NotNull Context context) {
216214
@Override
217215
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
218216
public void emptyTrash(@NotNull Context context) {
219-
//TODO: #244 change List<Task> to Page<Task>
220217
List<Task> taskList = taskRepository.findByTaskStateAndContext(
221218
TaskState.TRASH,
222219
context
223220
);
224-
//TODO: #244 change List<Task> to Page<Task>
225221
List<Task> taskListChanged = new ArrayList<>(taskList.size());
226222
for(Task task: taskList){
227223
task.emptyTrash();
@@ -266,15 +262,12 @@ public void moveTasksUpByTaskState(@NotNull Task sourceTask, @NotNull Task desti
266262
Context context = sourceTask.getContext();
267263
final long lowerOrderIdTaskState = destinationTask.getOrderIdTaskState();
268264
final long higherOrderIdTaskState = sourceTask.getOrderIdTaskState();
269-
//TODO: #244 change List<Task> to Page<Task>
270-
//noinspection deprecation
271265
List<Task> tasks = taskRepository.getTasksByOrderIdTaskStateBetweenLowerTaskAndHigherTask(
272266
lowerOrderIdTaskState,
273267
higherOrderIdTaskState,
274268
taskState,
275269
context
276270
);
277-
//TODO: #244 change List<Task> to Page<Task>
278271
List<Task> tasksMoved = new ArrayList<>(tasks.size()+2);
279272
for(Task task:tasks){
280273
task.moveUpByTaskState();
@@ -301,15 +294,12 @@ public void moveTasksDownByTaskState(@NotNull Task sourceTask, @NotNull Task des
301294
Context context = sourceTask.getContext();
302295
long lowerOrderIdTaskState = sourceTask.getOrderIdTaskState();
303296
long higherOrderIdTaskState = destinationTask.getOrderIdTaskState();
304-
//TODO: #244 change List<Task> to Page<Task>
305-
//noinspection deprecation
306297
List<Task> tasks = taskRepository.getTasksByOrderIdTaskStateBetweenLowerTaskAndHigherTask(
307298
lowerOrderIdTaskState,
308299
higherOrderIdTaskState,
309300
taskState,
310301
context
311302
);
312-
//TODO: #244 change List<Task> to Page<Task>
313303
List<Task> tasksMoved = new ArrayList<>(tasks.size()+2);
314304
for(Task task:tasks){
315305
task.moveDownByTaskState();

0 commit comments

Comments
 (0)