Refine contribution #4167

The documentation generation change introduced
in #4167 seems to scan more files than previously
WRT checking the code formatting style.

This commit fixes the formatting of the files
that do not conform to the Spring style.
This commit is contained in:
Mahmoud Ben Hassine
2022-08-21 09:52:35 +02:00
parent f89aa20861
commit fe40370f39
12 changed files with 167 additions and 167 deletions

View File

@@ -538,15 +538,15 @@ public class CommandLineJobRunner {
}
else {
switch (count) {
case 0:
jobPath = arg;
break;
case 1:
jobIdentifier = arg;
break;
default:
params.add(arg);
break;
case 0:
jobPath = arg;
break;
case 1:
jobIdentifier = arg;
break;
default:
params.add(arg);
break;
}
count++;
}

View File

@@ -185,22 +185,22 @@ public class Jackson2ExecutionContextStringSerializer implements ExecutionContex
JsonNode value = node.get(VALUE_KEY_NAME);
Object parameterValue;
switch (JobParameter.ParameterType.valueOf(type)) {
case STRING: {
parameterValue = value.asText();
return new JobParameter((String) parameterValue, identifying);
}
case DATE: {
parameterValue = new Date(value.get(1).asLong());
return new JobParameter((Date) parameterValue, identifying);
}
case LONG: {
parameterValue = value.get(1).asLong();
return new JobParameter((Long) parameterValue, identifying);
}
case DOUBLE: {
parameterValue = value.asDouble();
return new JobParameter((Double) parameterValue, identifying);
}
case STRING: {
parameterValue = value.asText();
return new JobParameter((String) parameterValue, identifying);
}
case DATE: {
parameterValue = new Date(value.get(1).asLong());
return new JobParameter((Date) parameterValue, identifying);
}
case LONG: {
parameterValue = value.get(1).asLong();
return new JobParameter((Long) parameterValue, identifying);
}
case DOUBLE: {
parameterValue = value.asDouble();
return new JobParameter((Double) parameterValue, identifying);
}
}
return null;
}

View File

@@ -174,27 +174,27 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
Integer[] parameterTypes = (Integer[]) parameters.get(1);
for (int indx = 0; indx < parameterValues.length; indx++) {
switch (parameterTypes[indx]) {
case Types.INTEGER:
ps.setInt(indx + 1, (Integer) parameterValues[indx]);
break;
case Types.VARCHAR:
ps.setString(indx + 1, (String) parameterValues[indx]);
break;
case Types.TIMESTAMP:
if (parameterValues[indx] != null) {
ps.setTimestamp(indx + 1,
new Timestamp(((java.util.Date) parameterValues[indx]).getTime()));
}
else {
ps.setNull(indx + 1, Types.TIMESTAMP);
}
break;
case Types.BIGINT:
ps.setLong(indx + 1, (Long) parameterValues[indx]);
break;
default:
throw new IllegalArgumentException(
"unsupported SQL parameter type for step execution field index " + i);
case Types.INTEGER:
ps.setInt(indx + 1, (Integer) parameterValues[indx]);
break;
case Types.VARCHAR:
ps.setString(indx + 1, (String) parameterValues[indx]);
break;
case Types.TIMESTAMP:
if (parameterValues[indx] != null) {
ps.setTimestamp(indx + 1,
new Timestamp(((java.util.Date) parameterValues[indx]).getTime()));
}
else {
ps.setNull(indx + 1, Types.TIMESTAMP);
}
break;
case Types.BIGINT:
ps.setLong(indx + 1, (Long) parameterValues[indx]);
break;
default:
throw new IllegalArgumentException(
"unsupported SQL parameter type for step execution field index " + i);
}
}
}

View File

@@ -37,7 +37,7 @@ class ChunkContextTests {
private final ChunkContext context = new ChunkContext(new StepContext(new JobExecution(new JobInstance(0L, "job"),
1L, new JobParameters(Collections.singletonMap("foo", new JobParameter("bar"))))
.createStepExecution("foo")));
.createStepExecution("foo")));
@Test
void testGetStepContext() {