Use proper resource ordering for multiple type.properties files
This commit is contained in:
parent
f889624d86
commit
3eea4d97af
2 changed files with 11 additions and 3 deletions
|
@ -88,7 +88,7 @@ public final class Prototype {
|
|||
lowerCaseName = name.toLowerCase();
|
||||
|
||||
// Create and register type properties file
|
||||
props = new ResourceProperties();
|
||||
props = new ResourceProperties(app);
|
||||
if (repository != null) {
|
||||
props.addResource(repository.getResource("type.properties"));
|
||||
}
|
||||
|
|
|
@ -65,6 +65,14 @@ public final class ResourceProperties extends Properties {
|
|||
resources = new HashSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an empty ResourceProperties
|
||||
* Resources must be added manually afterwards
|
||||
*/
|
||||
public ResourceProperties(Application app) {
|
||||
resources = new TreeSet(app.getResourceComparator());
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a ResourceProperties retrieving resources from the given
|
||||
* application using the given name to fetch resources
|
||||
|
@ -159,7 +167,7 @@ public final class ResourceProperties extends Properties {
|
|||
|
||||
/* next we try to load properties from the application's
|
||||
repositories, if we blong to any application */
|
||||
if (app != null) {
|
||||
if (resourceName != null) {
|
||||
Iterator iterator = app.getRepositories().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
try {
|
||||
|
@ -266,7 +274,7 @@ public final class ResourceProperties extends Properties {
|
|||
public long getChecksum() {
|
||||
long checksum = 0;
|
||||
|
||||
if (app != null) {
|
||||
if (resourceName != null) {
|
||||
Iterator iterator = app.getRepositories().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
try {
|
||||
|
|
Loading…
Add table
Reference in a new issue