matthiasblaesing opened a new pull request, #619:
URL: https://github.com/apache/felix-dev/pull/619

   This problem was raised against NetBeans, which uses Apache Felix as its 
OSGI container. The user reported, that NetBeans launched in a degraded mode on 
arabic locales (ar-SA) because several OSGI runtime modules failed to start.
   
   The offending stack trace showed:
   
   ```
   ERROR: Error parsing system bundle statement.
   java.lang.IllegalArgumentException: invalid version "0.0.0.JavaSE_٠٢٥": 
invalid qualifier "JavaSE_٠٢٥"
           at org.osgi.framework.Version.validate(Version.java:203)
           at org.osgi.framework.Version.<init>(Version.java:155)
           at org.osgi.framework.Version.valueOf(Version.java:255)
           at org.osgi.framework.Version.parseVersion(Version.java:226)
           at 
org.apache.felix.framework.util.manifestparser.ManifestParser.normalizeExportClauses(ManifestParser.java:934)
           at 
org.apache.felix.framework.util.manifestparser.ManifestParser.<init>(ManifestParser.java:252)
           at 
org.apache.felix.framework.ExtensionManager$ExtensionManagerRevision.update(ExtensionManager.java:997)
           at 
org.apache.felix.framework.ExtensionManager.updateRevision(ExtensionManager.java:384)
           at org.apache.felix.framework.Felix.init(Felix.java:739)
           at org.apache.felix.framework.Felix.init(Felix.java:646)
   ```
   
   This can be reproduced stand alone by creating a class 
NonLatinLocaleTest.java like this:
   
   ```
       import org.osgi.framework.launch.FrameworkFactory;
       import java.util.ServiceLoader;
   
       public class NonLatinLocaleTest {
           public static void main(String[] argv) throws Exception {
               
ServiceLoader.load(FrameworkFactory.class).findFirst().get().newFramework(null).init();
               System.exit(0);
           }
       }
   ```
   
   And running it as:
   
       java -cp target/org.apache.felix.framework-8.0.1-SNAPSHOT.jar 
-Duser.language=ar -Duser.country=SA NonLatinLocaleTest.java 
   
   The problem can be tracked down into `Util.java` with uses `String#format` 
to create a version string based on the JVMs version information. On the arabic 
locale arabic script is used to format the numbers as the String#format variant 
without the locale parameter is used. To this fix, the variant with locale 
parameter is used together with Locale.ROOT to get consistent behavior accross 
locales.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to