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

Richard S. Hall commented on FELIX-2921:
----------------------------------------

I still don't think it is a framework bug !!! If anything it is a build bug !!! 
But I'm not sure it is a bug there either !!! ;-)

If you look at the default.properties file in the resulting JAR file when you 
build the framework subproject, you can see it has correctly substituted a $ in 
for the ${dollar}. Your test above is clearly using the file at a different 
phase in the Maven build lifecycle, so it is seeing the wrong value.

I don't know enough about Maven to say if there is a better way to do this, but 
if you look in the framework's pom.xml file you can see that this is where we 
set the dollar property to be $.

> Util.getDefaultProperty return bad values
> -----------------------------------------
>
>                 Key: FELIX-2921
>                 URL: https://issues.apache.org/jira/browse/FELIX-2921
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.2.0
>         Environment: apple
>            Reporter: Stephane Chomat
>             Fix For: framework-4.0.0
>
>         Attachments: BadPropertiesTest.java
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The properties like FRAMEWORK_SYSTEMPACKAGES are bad substituted by the 
> method Util.getDefaultProperty.
> The properties dollar is missing and the value is '' returned by 
> System.getProperty.
> The bad default value for FRAMEWORK_SYSTEMPACKAGES  is 
> org.osgi.framework; version=1.5.0, org.osgi.framework.launch; version=1.0.0, 
> org.osgi.framework.hooks.service; version=1.0.0, 
> org.osgi.service.packageadmin; version=1.2.0, org.osgi.service.startlevel; 
> version=1.1.0, org.osgi.service.url; version=1.0.0, org.osgi.util.tracker; 
> version=1.4.0 {jre-{java.specification.version}}
> You can add this test :
>     public void testDefaultProperty() {
>        Logger logger = new Logger();
>        
>        String jsv = System.getProperty("java.specification.version");
>        String jre = Util.getDefaultProperty(logger, "jre-"+jsv);
>         
>        String actual = Util.getDefaultProperty(logger, 
> Constants.FRAMEWORK_SYSTEMPACKAGES);
>        
>        assertEquals("org.osgi.framework; version=1.5.0, 
> org.osgi.framework.launch; version=1.0.0, org.osgi.framework.hooks.service; 
> version=1.0.0, org.osgi.service.packageadmin; version=1.2.0, 
> org.osgi.service.startlevel; version=1.1.0, org.osgi.service.url; 
> version=1.0.0, org.osgi.util.tracker; version=1.4.0 "+jre, actual);
>     }
> If you add this line before test, the test works
>      System.setProperty("dollar","$");

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to