[ 
https://issues.apache.org/jira/browse/TAMAYA-181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15573004#comment-15573004
 ] 

Philipp Ottlinger commented on TAMAYA-181:
------------------------------------------

I tried the following patch:
{code}
diff --git 
a/code/core/src/main/java/org/apache/tamaya/core/propertysource/SimplePropertySource.java
 
b/code/core/src/main/java/org/apache/tamaya/core/propertysource/SimplePropertySource.java
index e875d8c..0ecba4f 100644
--- 
a/code/core/src/main/java/org/apache/tamaya/core/propertysource/SimplePropertySource.java
+++ 
b/code/core/src/main/java/org/apache/tamaya/core/propertysource/SimplePropertySource.java
@@ -70,8 +70,8 @@ public class SimplePropertySource extends BasePropertySource {
      */
     public SimplePropertySource(URL propertiesLocation) {
         super(0);
-        this.properties = load(propertiesLocation);
         this.name = propertiesLocation.toString();
+        this.properties = load(propertiesLocation);
     }
 
     /**
{code}
resulting in many test failures.

Not sure if that's what you mean, but it's not without side effects :-(

> Warning-"Flood" from SimplePropertySource
> -----------------------------------------
>
>                 Key: TAMAYA-181
>                 URL: https://issues.apache.org/jira/browse/TAMAYA-181
>             Project: Tamaya
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.2-incubating
>         Environment: any
>            Reporter: Jürg Spiess
>            Priority: Minor
>             Fix For: 0.3-incubating
>
>
> If the constructor
> {code}public SimplePropertySource(URL propertiesLocation){code} is used, 
> STDOUT is flooded with warnings about "missing name".
> Solution:
> {code}
>     public SimplePropertySource(URL propertiesLocation) {
>         super(0);
>         // switch the next 2 lines: name should be set BEFORE load(...)!
>         this.properties = load(propertiesLocation);
>         this.name = propertiesLocation.toString();
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to