"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/CompositeDatabasePopulator.java" between
spring-framework-5.3.7.tar.gz and spring-framework-5.3.8.tar.gz

About: Spring Framework is an application framework for the Java platform and .NET Framework. Community edition.

CompositeDatabasePopulator.java  (spring-framework-5.3.7):CompositeDatabasePopulator.java  (spring-framework-5.3.8)
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* https://www.apache.org/licenses/LICENSE-2.0 * https://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
skipping to change at line 26 skipping to change at line 26
package org.springframework.jdbc.datasource.init; package org.springframework.jdbc.datasource.init;
import java.sql.Connection; import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import org.springframework.util.Assert;
/** /**
* Composite {@link DatabasePopulator} that delegates to a list of given * Composite {@link DatabasePopulator} that delegates to a list of given
* {@code DatabasePopulator} implementations, executing all scripts. * {@code DatabasePopulator} implementations, executing all scripts.
* *
* @author Dave Syer * @author Dave Syer
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Sam Brannen * @author Sam Brannen
* @author Kazuki Shimizu * @author Kazuki Shimizu
* @since 3.1 * @since 3.1
*/ */
skipping to change at line 54 skipping to change at line 56
*/ */
public CompositeDatabasePopulator() { public CompositeDatabasePopulator() {
} }
/** /**
* Create a {@code CompositeDatabasePopulator} with the given populators. * Create a {@code CompositeDatabasePopulator} with the given populators.
* @param populators one or more populators to delegate to * @param populators one or more populators to delegate to
* @since 4.3 * @since 4.3
*/ */
public CompositeDatabasePopulator(Collection<DatabasePopulator> populator s) { public CompositeDatabasePopulator(Collection<DatabasePopulator> populator s) {
Assert.notNull(populators, "DatabasePopulators must not be null") ;
this.populators.addAll(populators); this.populators.addAll(populators);
} }
/** /**
* Create a {@code CompositeDatabasePopulator} with the given populators. * Create a {@code CompositeDatabasePopulator} with the given populators.
* @param populators one or more populators to delegate to * @param populators one or more populators to delegate to
* @since 4.3 * @since 4.3
*/ */
public CompositeDatabasePopulator(DatabasePopulator... populators) { public CompositeDatabasePopulator(DatabasePopulator... populators) {
Assert.notNull(populators, "DatabasePopulators must not be null") ;
this.populators.addAll(Arrays.asList(populators)); this.populators.addAll(Arrays.asList(populators));
} }
/** /**
* Specify one or more populators to delegate to. * Specify one or more populators to delegate to.
*/ */
public void setPopulators(DatabasePopulator... populators) { public void setPopulators(DatabasePopulator... populators) {
Assert.notNull(populators, "DatabasePopulators must not be null") ;
this.populators.clear(); this.populators.clear();
this.populators.addAll(Arrays.asList(populators)); this.populators.addAll(Arrays.asList(populators));
} }
/** /**
* Add one or more populators to the list of delegates. * Add one or more populators to the list of delegates.
*/ */
public void addPopulators(DatabasePopulator... populators) { public void addPopulators(DatabasePopulator... populators) {
Assert.notNull(populators, "DatabasePopulators must not be null") ;
this.populators.addAll(Arrays.asList(populators)); this.populators.addAll(Arrays.asList(populators));
} }
@Override @Override
public void populate(Connection connection) throws SQLException, ScriptEx ception { public void populate(Connection connection) throws SQLException, ScriptEx ception {
Assert.notNull(connection, "Connection must not be null");
for (DatabasePopulator populator : this.populators) { for (DatabasePopulator populator : this.populators) {
populator.populate(connection); populator.populate(connection);
} }
} }
} }
 End of changes. 7 change blocks. 
1 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)