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();
|
lowerCaseName = name.toLowerCase();
|
||||||
|
|
||||||
// Create and register type properties file
|
// Create and register type properties file
|
||||||
props = new ResourceProperties();
|
props = new ResourceProperties(app);
|
||||||
if (repository != null) {
|
if (repository != null) {
|
||||||
props.addResource(repository.getResource("type.properties"));
|
props.addResource(repository.getResource("type.properties"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,14 @@ public final class ResourceProperties extends Properties {
|
||||||
resources = new HashSet();
|
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
|
* Constructs a ResourceProperties retrieving resources from the given
|
||||||
* application using the given name to fetch resources
|
* 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
|
/* next we try to load properties from the application's
|
||||||
repositories, if we blong to any application */
|
repositories, if we blong to any application */
|
||||||
if (app != null) {
|
if (resourceName != null) {
|
||||||
Iterator iterator = app.getRepositories().iterator();
|
Iterator iterator = app.getRepositories().iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
try {
|
try {
|
||||||
|
@ -266,7 +274,7 @@ public final class ResourceProperties extends Properties {
|
||||||
public long getChecksum() {
|
public long getChecksum() {
|
||||||
long checksum = 0;
|
long checksum = 0;
|
||||||
|
|
||||||
if (app != null) {
|
if (resourceName != null) {
|
||||||
Iterator iterator = app.getRepositories().iterator();
|
Iterator iterator = app.getRepositories().iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue