geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r924100 - in /geronimo/specs/trunk/geronimo-jaxb_2.2_spec/src/main/java/javax/xml/bind: DatatypeConverter.java JAXBPermission.java
Date Wed, 17 Mar 2010 02:19:06 GMT
Author: genspring
Date: Wed Mar 17 02:19:06 2010
New Revision: 924100

URL: http://svn.apache.org/viewvc?rev=924100&view=rev
Log:
Adding permission checking for DatatypeConverter.setDatatypeConverter() according to the jaxb
2.2 spec javadoc diff.

Added:
    geronimo/specs/trunk/geronimo-jaxb_2.2_spec/src/main/java/javax/xml/bind/JAXBPermission.java
  (with props)
Modified:
    geronimo/specs/trunk/geronimo-jaxb_2.2_spec/src/main/java/javax/xml/bind/DatatypeConverter.java

Modified: geronimo/specs/trunk/geronimo-jaxb_2.2_spec/src/main/java/javax/xml/bind/DatatypeConverter.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxb_2.2_spec/src/main/java/javax/xml/bind/DatatypeConverter.java?rev=924100&r1=924099&r2=924100&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxb_2.2_spec/src/main/java/javax/xml/bind/DatatypeConverter.java
(original)
+++ geronimo/specs/trunk/geronimo-jaxb_2.2_spec/src/main/java/javax/xml/bind/DatatypeConverter.java
Wed Mar 17 02:19:06 2010
@@ -35,6 +35,12 @@ public final class DatatypeConverter {
             throw new IllegalArgumentException("The DatatypeConverterInterface parameter
must not be null");
         }
         if (DatatypeConverter.converter == null) {
+
+            SecurityManager sm = System.getSecurityManager();           
+            if (sm != null) {
+                sm.checkPermission(new JAXBPermission("setDatatypeConverter"));
+            }
+            
             DatatypeConverter.converter = converter;
         }
     }

Added: geronimo/specs/trunk/geronimo-jaxb_2.2_spec/src/main/java/javax/xml/bind/JAXBPermission.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxb_2.2_spec/src/main/java/javax/xml/bind/JAXBPermission.java?rev=924100&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxb_2.2_spec/src/main/java/javax/xml/bind/JAXBPermission.java
(added)
+++ geronimo/specs/trunk/geronimo-jaxb_2.2_spec/src/main/java/javax/xml/bind/JAXBPermission.java
Wed Mar 17 02:19:06 2010
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package javax.xml.bind;
+
+import java.security.BasicPermission;
+
+public class JAXBPermission extends BasicPermission {
+
+    private static final long serialVersionUID = 1L;
+    
+    public JAXBPermission(String name) {
+        super(name);
+    }
+
+}
\ No newline at end of file

Propchange: geronimo/specs/trunk/geronimo-jaxb_2.2_spec/src/main/java/javax/xml/bind/JAXBPermission.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message