-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Closed
Copy link
Labels
in: dataIssues in data modules (jdbc, orm, oxm, tx)Issues in data modules (jdbc, orm, oxm, tx)type: enhancementA general enhancementA general enhancement
Milestone
Description
Sam Brannen opened SPR-11691 and commented
Status Quo
The setScripts()
method in ResourceDatabasePopulator
replaces the internal scripts
array with a value returned from Arrays.asList()
which is an unmodifiable List. Consequently, it is impossible to add additional scripts to a ResourceDatabasePopulator
after setScripts()
has been invoked.
For example, the following test fails with an UnsupportedOperationException
.
public class ResourceDatabasePopulatorTests {
private Resource script1 = resource("script1");
private Resource script2 = resource("script2");
private Resource script3 = resource("script3");
@Test
public void setScriptsAndThenAddScript() {
ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
databasePopulator.setScripts(script1, script2);
// Throws UnsupportedOperationException
databasePopulator.addScript(script3);
}
private Resource resource(String path) {
return new ClassPathResource(path);
}
}
Deliverables
- Ensure that scripts can be added to a
ResourceDatabasePopulator
after thesetScripts()
method has been invoked.
Affects: 3.2 GA
Referenced from: commits b4995f7
Metadata
Metadata
Assignees
Labels
in: dataIssues in data modules (jdbc, orm, oxm, tx)Issues in data modules (jdbc, orm, oxm, tx)type: enhancementA general enhancementA general enhancement