< prev index next >

src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/SimpleTypeBuilder.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -138,11 +138,11 @@
      * Never null.
      */
     private XSSimpleType initiatingType;
 
     /** {@link TypeUse}s for the built-in types. Read-only. */
-    public static final Map<String,TypeUse> builtinConversions = new HashMap<String,TypeUse>();
+    public static final Map<String,TypeUse> builtinConversions;
 
 
     /**
      * Entry point from outside. Builds a BGM type expression
      * from a simple type schema component.

@@ -416,11 +416,11 @@
 
     private static Set<XSRestrictionSimpleType> reportedEnumMemberSizeWarnings;
 
     /**
      * Returns true if a type-safe enum should be created from
-     * the given simple type by default without an explicit &lt;jaxb:enum> customization.
+     * the given simple type by default without an explicit {@code <jaxb:enum>} customization.
      */
     private boolean shouldBeMappedToTypeSafeEnumByDefault( XSRestrictionSimpleType type ) {
 
         // if not, there will be a problem wrt the class name of this type safe enum type.
         if( type.isLocal() )    return false;

@@ -874,11 +874,11 @@
     static {
         // list of datatypes which have built-in conversions.
         // note that although xs:token and xs:normalizedString are not
         // specified in the spec, they need to be here because they
         // have different whitespace normalization semantics.
-        Map<String,TypeUse> m = builtinConversions;
+        Map<String,TypeUse> m = new HashMap<String,TypeUse>();
 
         // TODO: this is so dumb
         m.put("string",         CBuiltinLeafInfo.STRING);
         m.put("anyURI",         CBuiltinLeafInfo.STRING);
         m.put("boolean",        CBuiltinLeafInfo.BOOLEAN);

@@ -909,10 +909,12 @@
         m.put("duration",       CBuiltinLeafInfo.DURATION);
         m.put("token",          CBuiltinLeafInfo.TOKEN);
         m.put("normalizedString",CBuiltinLeafInfo.NORMALIZED_STRING);
         m.put("ID",             CBuiltinLeafInfo.ID);
         m.put("IDREF",          CBuiltinLeafInfo.IDREF);
+
+        builtinConversions = Collections.unmodifiableMap(m);
         // TODO: handling dateTime, time, and date type
 //        String[] names = {
 //            "date", "dateTime", "time", "hexBinary" };
     }
 }
< prev index next >