Use proper resource ordering for multiple type.properties files

This commit is contained in:
hns 2005-04-13 10:42:12 +00:00
parent f889624d86
commit 3eea4d97af
2 changed files with 11 additions and 3 deletions

View file

@ -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"));
}

View file

@ -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 {