Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public ApplicationContextFactory[] getObject() throws Exception {
factory.setApplicationContext(applicationContext);
applicationContextFactories.add(factory);
}
return applicationContextFactories.toArray(new ApplicationContextFactory[applicationContextFactories.size()]);
return applicationContextFactories.toArray(new ApplicationContextFactory[0]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ public static void main(String[] args) throws Exception {
return;
}

String[] parameters = params.toArray(new String[params.size()]);
String[] parameters = params.toArray(new String[0]);

int result = command.start(jobPath, jobIdentifier, parameters, opts);
command.exit(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ public void write(Chunk<? extends T> chunk) throws Exception {

if (usingNamedParameters) {
if (chunk.getItems().get(0) instanceof Map && this.itemSqlParameterSourceProvider == null) {
updateCounts = namedParameterJdbcTemplate.batchUpdate(sql,
chunk.getItems().toArray(new Map[chunk.size()]));
updateCounts = namedParameterJdbcTemplate.batchUpdate(sql, chunk.getItems().toArray(new Map[0]));
}
else {
SqlParameterSource[] batchArgs = new SqlParameterSource[chunk.size()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public String[] getSupportedIncrementerTypes() {
types.add(type.name());
}

return types.toArray(new String[types.size()]);
return types.toArray(new String[0]);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public ResourcesItemReader() {
* @param resources the resources
*/
public void setResources(Resource[] resources) {
this.resources = Arrays.asList(resources).toArray(new Resource[resources.length]);
this.resources = Arrays.asList(resources).toArray(new Resource[0]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void setMailErrorHandler(MailErrorHandler mailErrorHandler) {
@Override
public void write(Chunk<? extends SimpleMailMessage> chunk) throws MailException {
try {
mailSender.send(chunk.getItems().toArray(new SimpleMailMessage[chunk.size()]));
mailSender.send(chunk.getItems().toArray(new SimpleMailMessage[0]));
}
catch (MailSendException e) {
Map<Object, Exception> failedMessages = e.getFailedMessages();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void setMailErrorHandler(MailErrorHandler mailErrorHandler) {
@Override
public void write(Chunk<? extends MimeMessage> chunk) throws MailException {
try {
mailSender.send(chunk.getItems().toArray(new MimeMessage[chunk.size()]));
mailSender.send(chunk.getItems().toArray(new MimeMessage[0]));
}
catch (MailSendException e) {
Map<Object, Exception> failedMessages = e.getFailedMessages();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class CompositeExceptionHandler implements ExceptionHandler {
private ExceptionHandler[] handlers = new ExceptionHandler[0];

public void setHandlers(ExceptionHandler[] handlers) {
this.handlers = Arrays.asList(handlers).toArray(new ExceptionHandler[handlers.length]);
this.handlers = Arrays.asList(handlers).toArray(new ExceptionHandler[0]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class CompositeCompletionPolicy implements CompletionPolicy {
* {@link #isComplete(RepeatContext)} by consensus.
*/
public void setPolicies(CompletionPolicy[] policies) {
this.policies = Arrays.asList(policies).toArray(new CompletionPolicy[policies.length]);
this.policies = Arrays.asList(policies).toArray(new CompletionPolicy[0]);
}

/**
Expand Down Expand Up @@ -127,7 +127,7 @@ protected class CompositeBatchContext extends RepeatContextSupport {

public CompositeBatchContext(RepeatContext context, List<RepeatContext> contexts) {
super(context);
this.contexts = contexts.toArray(new RepeatContext[contexts.size()]);
this.contexts = contexts.toArray(new RepeatContext[0]);
this.policies = CompositeCompletionPolicy.this.policies;
}

Expand Down
Loading