src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java

changeset 786
a14efa699f0f
parent 721
06807f9a6835
child 760
e530533619ec
     1.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java	Mon Oct 20 23:05:00 2014 -0700
     1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java	Fri Oct 24 15:02:28 2014 +0200
     1.3 @@ -43,6 +43,8 @@
     1.4  import java.net.URI;
     1.5  import java.net.URISyntaxException;
     1.6  import java.net.URL;
     1.7 +import java.security.AccessController;
     1.8 +import java.security.PrivilegedAction;
     1.9  import java.util.ArrayList;
    1.10  import java.util.Calendar;
    1.11  import java.util.Collections;
    1.12 @@ -197,7 +199,15 @@
    1.13  
    1.14      static {
    1.15  
    1.16 -        QName[] qnames = (System.getProperty(MAP_ANYURI_TO_URI) == null) ? new QName[] {
    1.17 +        String MAP_ANYURI_TO_URI_VALUE = AccessController.doPrivileged(
    1.18 +                new PrivilegedAction<String>() {
    1.19 +                    @Override
    1.20 +                    public String run() {
    1.21 +                        return System.getProperty(MAP_ANYURI_TO_URI);
    1.22 +                    }
    1.23 +                }
    1.24 +        );
    1.25 +        QName[] qnames = (MAP_ANYURI_TO_URI_VALUE == null) ? new QName[] {
    1.26                                  createXS("string"),
    1.27                                  createXS("anySimpleType"),
    1.28                                  createXS("normalizedString"),
    1.29 @@ -310,7 +320,7 @@
    1.30                      return v.toExternalForm();
    1.31                  }
    1.32              });
    1.33 -        if (System.getProperty(MAP_ANYURI_TO_URI) == null) {
    1.34 +        if (MAP_ANYURI_TO_URI_VALUE == null) {
    1.35              secondaryList.add(
    1.36                  new StringImpl<URI>(URI.class, createXS("string")) {
    1.37                      public URI parse(CharSequence text) throws SAXException {
    1.38 @@ -774,17 +784,18 @@
    1.39                  }
    1.40              });
    1.41          primaryList.add(
    1.42 -            new StringImpl<BigDecimal>(BigDecimal.class,
    1.43 -                createXS("decimal")
    1.44 +                new StringImpl<BigDecimal>(BigDecimal.class,
    1.45 +                        createXS("decimal")
    1.46                  ) {
    1.47 -                public BigDecimal parse(CharSequence text) {
    1.48 -                    return DatatypeConverterImpl._parseDecimal(text.toString());
    1.49 +                    public BigDecimal parse(CharSequence text) {
    1.50 +                        return DatatypeConverterImpl._parseDecimal(text.toString());
    1.51 +                    }
    1.52 +
    1.53 +                    public String print(BigDecimal v) {
    1.54 +                        return DatatypeConverterImpl._printDecimal(v);
    1.55 +                    }
    1.56                  }
    1.57 -
    1.58 -                public String print(BigDecimal v) {
    1.59 -                    return DatatypeConverterImpl._printDecimal(v);
    1.60 -                }
    1.61 -            });
    1.62 +        );
    1.63          primaryList.add(
    1.64              new StringImpl<QName>(QName.class,
    1.65                  createXS("QName")
    1.66 @@ -812,7 +823,7 @@
    1.67                      w.getNamespaceContext().declareNamespace(v.getNamespaceURI(),v.getPrefix(),false);
    1.68                  }
    1.69              });
    1.70 -        if (System.getProperty(MAP_ANYURI_TO_URI) != null) {
    1.71 +        if (MAP_ANYURI_TO_URI_VALUE != null) {
    1.72              primaryList.add(
    1.73                  new StringImpl<URI>(URI.class, createXS("anyURI")) {
    1.74                      public URI parse(CharSequence text) throws SAXException {
    1.75 @@ -830,16 +841,17 @@
    1.76                  });
    1.77          }
    1.78          primaryList.add(
    1.79 -            new StringImpl<Duration>(Duration.class,  createXS("duration")) {
    1.80 -                public String print(Duration duration) {
    1.81 -                    return duration.toString();
    1.82 +                new StringImpl<Duration>(Duration.class, createXS("duration")) {
    1.83 +                    public String print(Duration duration) {
    1.84 +                        return duration.toString();
    1.85 +                    }
    1.86 +
    1.87 +                    public Duration parse(CharSequence lexical) {
    1.88 +                        TODO.checkSpec("JSR222 Issue #42");
    1.89 +                        return DatatypeConverterImpl.getDatatypeFactory().newDuration(lexical.toString());
    1.90 +                    }
    1.91                  }
    1.92 -
    1.93 -                public Duration parse(CharSequence lexical) {
    1.94 -                    TODO.checkSpec("JSR222 Issue #42");
    1.95 -                    return DatatypeConverterImpl.getDatatypeFactory().newDuration(lexical.toString());
    1.96 -                }
    1.97 -            });
    1.98 +        );
    1.99          primaryList.add(
   1.100              new StringImpl<Void>(Void.class) {
   1.101                  // 'void' binding isn't defined by the spec, but when the JAX-RPC processes user-defined

mercurial