Skip to content

Commit 62b7515

Browse files
committed
fixed PMD issues
1 parent ad79067 commit 62b7515

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

core/src/main/java/org/sterl/spring/persistent_tasks/task/config/TaskConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ void configureSimpleTasks(GenericApplicationContext context,
2323
for(Entry<String, PersistentTask> t : simpleTasks.entrySet()) {
2424
var id = taskService.register(t.getKey(), t.getValue());
2525

26-
addTaskIdIfMissing(context, id, t.getValue());
26+
addTaskIdIfMissing(context, id);
2727
}
2828
}
2929
private void addTaskIdIfMissing(GenericApplicationContext context,
30-
TaskId<Serializable> id, PersistentTask<?> task) {
30+
TaskId<Serializable> id) {
3131
final var taskIdContextName = id.name() + "Id";
3232
if (!context.containsBean(taskIdContextName)) {
3333
log.info("Adding {} with name={} to spring context", id, taskIdContextName);

core/src/test/java/org/sterl/spring/persistent_tasks/scheduler/SchedulerServiceTransactionTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SchedulerServiceTransactionTest extends AbstractSpringTest {
2929
@Configuration
3030
static class Config {
3131
@Bean
32-
PersistentTask<String> savePersonInTrx(PersonRepository personRepository) {
32+
TransactionalTask<String> savePersonInTrx(PersonRepository personRepository) {
3333
return new TransactionalTask<String>() {
3434
@Override
3535
public void accept(String name) {
@@ -57,6 +57,10 @@ public void accept(String name) {
5757
public RetryStrategy retryStrategy() {
5858
return RetryStrategy.THREE_RETRIES_IMMEDIATELY;
5959
}
60+
@Override
61+
public boolean isTransactional() {
62+
return false;
63+
}
6064
};
6165
}
6266
}

0 commit comments

Comments
 (0)