Skip to content

Commit

Permalink
Chore: expressions with type arguments can be replaced a with <> (JDK…
Browse files Browse the repository at this point in the history
… 9+) (#3789)
  • Loading branch information
dbmalkovsky authored Jan 25, 2024
1 parent 1b0e465 commit 3dd1020
Show file tree
Hide file tree
Showing 67 changed files with 274 additions and 259 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public AppRepositoryServiceImpl(AppEngineConfiguration engineConfiguration) {

@Override
public AppDeploymentBuilder createDeployment() {
return commandExecutor.execute(new Command<AppDeploymentBuilder>() {
return commandExecutor.execute(new Command<>() {

@Override
public AppDeploymentBuilder execute(CommandContext commandContext) {
return new AppDeploymentBuilderImpl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static void main(String[] args) {
AppEngine cmmnEngine = AppEngineConfiguration.createAppEngineConfigurationFromInputStream(inputStream).buildAppEngine();
CommandExecutor commandExecutor = cmmnEngine.getAppEngineConfiguration().getCommandExecutor();
CommandConfig config = new CommandConfig().transactionNotSupported();
commandExecutor.execute(config, new Command<Object>() {
commandExecutor.execute(config, new Command<>() {
@Override
public Object execute(CommandContext commandContext) {
CommandContextUtil.getAppEngineConfiguration(commandContext).getSchemaManager().schemaDrop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public BatchBuilder tenantId(String tenantId) {
public Batch create() {
if (commandExecutor != null) {
BatchBuilder selfBatchBuilder = this;
return commandExecutor.execute(new Command<Batch>() {
return commandExecutor.execute(new Command<>() {

@Override
public Batch execute(CommandContext commandContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void main(String[] args) {
ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();
CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutor();
CommandConfig config = new CommandConfig().transactionNotSupported();
commandExecutor.execute(config, new Command<Object>() {
commandExecutor.execute(config, new Command<>() {
@Override
public Object execute(CommandContext commandContext) {
CommandContextUtil.getProcessEngineConfiguration(commandContext).getSchemaManager().schemaDrop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public CmmnRepositoryServiceImpl(CmmnEngineConfiguration engineConfiguration) {

@Override
public CmmnDeploymentBuilder createDeployment() {
return commandExecutor.execute(new Command<CmmnDeploymentBuilder>() {
return commandExecutor.execute(new Command<>() {

@Override
public CmmnDeploymentBuilder execute(CommandContext commandContext) {
return new CmmnDeploymentBuilderImpl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static void main(String[] args) {
CmmnEngine cmmnEngine = CmmnEngineConfiguration.createCmmnEngineConfigurationFromInputStream(inputStream).buildCmmnEngine();
CommandExecutor commandExecutor = cmmnEngine.getCmmnEngineConfiguration().getCommandExecutor();
CommandConfig config = new CommandConfig().transactionNotSupported();
commandExecutor.execute(config, new Command<Object>() {
commandExecutor.execute(config, new Command<>() {
@Override
public Object execute(CommandContext commandContext) {
CommandContextUtil.getCmmnEngineConfiguration(commandContext).getSchemaManager().schemaDrop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ protected static JsonNode convertToJsonCaseInstanceVariables(CaseInstanceMigrati
}

protected static <T> T convertFromJsonNodeToObject(JsonNode jsonNode, ObjectMapper objectMapper) {
return objectMapper.convertValue(jsonNode, new TypeReference<T>() {
return objectMapper.convertValue(jsonNode, new TypeReference<>() {

});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
public class MybatisHistoricPlanItemInstanceDataManager extends AbstractCmmnDataManager<HistoricPlanItemInstanceEntity> implements HistoricPlanItemInstanceDataManager {

protected CachedEntityMatcherAdapter<HistoricPlanItemInstanceEntity> historicPlanItemInstanceByCaseDefinitionIdMatcher = new CachedEntityMatcherAdapter<HistoricPlanItemInstanceEntity>() {
protected CachedEntityMatcherAdapter<HistoricPlanItemInstanceEntity> historicPlanItemInstanceByCaseDefinitionIdMatcher = new CachedEntityMatcherAdapter<>() {
@Override
public boolean isRetained(HistoricPlanItemInstanceEntity entity, Object param) {
return entity.getCaseDefinitionId().equals(param);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public static void waitForJobExecutorToProcessAllJobs(final CmmnEngine cmmnEngin
public static void waitForJobExecutorToProcessAllJobs(final CmmnEngineConfiguration cmmnEngineConfiguration, final long maxMillisToWait,
final long intervalMillis, final boolean shutdownExecutorWhenFinished) {

waitForExecutorToProcessAllJobs(cmmnEngineConfiguration.getAsyncExecutor(), new Callable<Boolean>() {
waitForExecutorToProcessAllJobs(cmmnEngineConfiguration.getAsyncExecutor(), new Callable<>() {

@Override
public Boolean call() {
return cmmnEngineConfiguration.getCmmnManagementService().createJobQuery().count() > 0
|| cmmnEngineConfiguration.getCmmnManagementService().createTimerJobQuery().count() > 0;
|| cmmnEngineConfiguration.getCmmnManagementService().createTimerJobQuery().count() > 0;
}

}, maxMillisToWait, intervalMillis, shutdownExecutorWhenFinished);
Expand All @@ -54,7 +54,7 @@ public Boolean call() {
public static void waitForJobExecutorToProcessAllAsyncJobs(final CmmnEngineConfiguration cmmnEngineConfiguration, final long maxMillisToWait,
final long intervalMillis, final boolean shutdownExecutorWhenFinished) {

waitForExecutorToProcessAllJobs(cmmnEngineConfiguration.getAsyncExecutor(), new Callable<Boolean>() {
waitForExecutorToProcessAllJobs(cmmnEngineConfiguration.getAsyncExecutor(), new Callable<>() {

@Override
public Boolean call() {
Expand All @@ -71,13 +71,13 @@ public static void waitForJobExecutorOnCondition(CmmnEngineConfiguration cmmnEng
public static void waitForAsyncHistoryExecutorToProcessAllJobs(final CmmnEngineConfiguration cmmnEngineConfiguration, final long maxMillisToWait,
final long intervalMillis, final boolean shutdownExecutorWhenFinished) {

waitForExecutorToProcessAllJobs(cmmnEngineConfiguration.getAsyncHistoryExecutor(), new Callable<Boolean>() {
waitForExecutorToProcessAllJobs(cmmnEngineConfiguration.getAsyncHistoryExecutor(), new Callable<>() {

@Override
public Boolean call() {
return cmmnEngineConfiguration.getCmmnManagementService().createHistoryJobQuery().count() > 0;
}

}, maxMillisToWait, intervalMillis, shutdownExecutorWhenFinished);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ protected void assertDatabaseEmpty(FrameworkMethod method) {
cmmnEngineConfiguration,
TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK,
true,
new Command<Void>() {
new Command<>() {

@Override
public Void execute(CommandContext commandContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ public void oneTaskTestWithVariables() {
HistoricVariableInstanceEntity variableInstance = (HistoricVariableInstanceEntity) cmmnHistoryService.createHistoricVariableInstanceQuery().caseInstanceId(caseInstance.getId()).variableName("serializableVar").singleResult();
assertThat(variableInstance.getByteArrayRef()).isNotNull();

ByteArrayEntity byteArrayEntity = cmmnEngineConfiguration.getCommandExecutor().execute(new Command<ByteArrayEntity>() {
ByteArrayEntity byteArrayEntity = cmmnEngineConfiguration.getCommandExecutor().execute(new Command<>() {

@Override
public ByteArrayEntity execute(CommandContext commandContext) {
return CommandContextUtil.getCmmnEngineConfiguration(commandContext).getByteArrayEntityManager().findById(variableInstance.getByteArrayRef().getId());
return CommandContextUtil.getCmmnEngineConfiguration(commandContext).getByteArrayEntityManager()
.findById(variableInstance.getByteArrayRef().getId());
}
});

Expand Down Expand Up @@ -101,7 +102,7 @@ public ByteArrayEntity execute(CommandContext commandContext) {

validateEmptyHistoricDataForCaseInstance(caseInstance.getId());

ByteArrayEntity byteArrayEntityAfterDelete = cmmnEngineConfiguration.getCommandExecutor().execute(new Command<ByteArrayEntity>() {
ByteArrayEntity byteArrayEntityAfterDelete = cmmnEngineConfiguration.getCommandExecutor().execute(new Command<>() {

@Override
public ByteArrayEntity execute(CommandContext commandContext) {
Expand Down Expand Up @@ -148,11 +149,12 @@ public void subCaseInstanceTest() {
HistoricVariableInstanceEntity variableInstance = (HistoricVariableInstanceEntity) cmmnHistoryService.createHistoricVariableInstanceQuery().caseInstanceId(subCaseInstance.getId()).variableName("localSerializable").singleResult();
assertThat(variableInstance.getByteArrayRef()).isNotNull();

ByteArrayEntity byteArrayEntity = cmmnEngineConfiguration.getCommandExecutor().execute(new Command<ByteArrayEntity>() {
ByteArrayEntity byteArrayEntity = cmmnEngineConfiguration.getCommandExecutor().execute(new Command<>() {

@Override
public ByteArrayEntity execute(CommandContext commandContext) {
return CommandContextUtil.getCmmnEngineConfiguration(commandContext).getByteArrayEntityManager().findById(variableInstance.getByteArrayRef().getId());
return CommandContextUtil.getCmmnEngineConfiguration(commandContext).getByteArrayEntityManager()
.findById(variableInstance.getByteArrayRef().getId());
}
});

Expand Down Expand Up @@ -200,7 +202,7 @@ public ByteArrayEntity execute(CommandContext commandContext) {
validateEmptyHistoricDataForCaseInstance(caseInstance.getId());
validateEmptyHistoricDataForCaseInstance(subCaseInstance.getId());

ByteArrayEntity byteArrayEntityAfterDelete = cmmnEngineConfiguration.getCommandExecutor().execute(new Command<ByteArrayEntity>() {
ByteArrayEntity byteArrayEntityAfterDelete = cmmnEngineConfiguration.getCommandExecutor().execute(new Command<>() {

@Override
public ByteArrayEntity execute(CommandContext commandContext) {
Expand Down Expand Up @@ -250,11 +252,12 @@ public void oneTaskTestWithLocalVariables() {
HistoricVariableInstanceEntity variableInstance = (HistoricVariableInstanceEntity) cmmnHistoryService.createHistoricVariableInstanceQuery().taskId(task.getId()).variableName("testSerializable").singleResult();
assertThat(variableInstance.getByteArrayRef()).isNotNull();

ByteArrayEntity byteArrayEntity = cmmnEngineConfiguration.getCommandExecutor().execute(new Command<ByteArrayEntity>() {
ByteArrayEntity byteArrayEntity = cmmnEngineConfiguration.getCommandExecutor().execute(new Command<>() {

@Override
public ByteArrayEntity execute(CommandContext commandContext) {
return CommandContextUtil.getCmmnEngineConfiguration(commandContext).getByteArrayEntityManager().findById(variableInstance.getByteArrayRef().getId());
return CommandContextUtil.getCmmnEngineConfiguration(commandContext).getByteArrayEntityManager()
.findById(variableInstance.getByteArrayRef().getId());
}
});

Expand Down Expand Up @@ -305,7 +308,7 @@ public ByteArrayEntity execute(CommandContext commandContext) {
validateEmptyHistoricDataForCaseInstance(caseInstance.getId());
validateEmptyHistoricDataForTask(task.getId());

ByteArrayEntity byteArrayEntityAfterDelete = cmmnEngineConfiguration.getCommandExecutor().execute(new Command<ByteArrayEntity>() {
ByteArrayEntity byteArrayEntityAfterDelete = cmmnEngineConfiguration.getCommandExecutor().execute(new Command<>() {

@Override
public ByteArrayEntity execute(CommandContext commandContext) {
Expand Down
Loading

0 comments on commit 3dd1020

Please sign in to comment.