You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Shawn Jiang <ge...@gmail.com> on 2011/09/15 10:48:02 UTC

Fwd: svn commit: r1167431 - in /openejb/branches/openejb-3.0.x/container/openejb-jee/src/main/java/org/apache/openejb/jee: BooleanAdapter.java EntityBean.java

Hello devs,

I ported a patch from openejb trunk to openejb 3.0.4-SNAPSHOT to fix a issue
after upgrading jaxb.   Do we want to push openejb community do another
openejb 3.0.x release just to pick up this fix ?

Because openejb 3.0.x is not under actively development anymore.  Maybe, to
use geornimo internal repo[1] to host the patched openejb 3.0.3 is plausible
?    thoughts ?

[1]
https://svn.apache.org/repos/asf/geronimo/server/branches/2.1/repository/org/apache/activemq/



---------- Forwarded message ----------
From: <ge...@apache.org>
Date: Sat, Sep 10, 2011 at 9:33 AM
Subject: svn commit: r1167431 - in
/openejb/branches/openejb-3.0.x/container/openejb-jee/src/main/java/org/apache/openejb/jee:
BooleanAdapter.java EntityBean.java
To: commits@openejb.apache.org


Author: genspring
Date: Sat Sep 10 01:33:09 2011
New Revision: 1167431

URL: http://svn.apache.org/viewvc?rev=1167431&view=rev
Log:
OPENEJB-1258 Boolean conversion problem in ejb-jar.xml

Added:

 openejb/branches/openejb-3.0.x/container/openejb-jee/src/main/java/org/apache/openejb/jee/BooleanAdapter.java
Modified:

 openejb/branches/openejb-3.0.x/container/openejb-jee/src/main/java/org/apache/openejb/jee/EntityBean.java

Added:
openejb/branches/openejb-3.0.x/container/openejb-jee/src/main/java/org/apache/openejb/jee/BooleanAdapter.java
URL:
http://svn.apache.org/viewvc/openejb/branches/openejb-3.0.x/container/openejb-jee/src/main/java/org/apache/openejb/jee/BooleanAdapter.java?rev=1167431&view=auto
==============================================================================
---
openejb/branches/openejb-3.0.x/container/openejb-jee/src/main/java/org/apache/openejb/jee/BooleanAdapter.java
(added)
+++
openejb/branches/openejb-3.0.x/container/openejb-jee/src/main/java/org/apache/openejb/jee/BooleanAdapter.java
Sat Sep 10 01:33:09 2011
@@ -0,0 +1,43 @@
+/**
+ * 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 org.apache.openejb.jee;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class BooleanAdapter extends XmlAdapter<String, Boolean> {
+
+    public Boolean unmarshal(String value) throws Exception {
+        value = value.trim();
+        if (value.equals("1") || value.equalsIgnoreCase("true")) {
+            return Boolean.TRUE;
+        } else if (value.equals("0") || value.equalsIgnoreCase("false")) {
+            return Boolean.FALSE;
+        } else {
+            throw new IllegalArgumentException("String \"" + value + "\" is
not a valid boolean value");
+        }
+    }
+
+    public String marshal(Boolean value) throws Exception {
+        if (value == null) {
+            return null;
+        }
+        return (value.booleanValue()) ? "true" : "false";
+    }
+}

Modified:
openejb/branches/openejb-3.0.x/container/openejb-jee/src/main/java/org/apache/openejb/jee/EntityBean.java
URL:
http://svn.apache.org/viewvc/openejb/branches/openejb-3.0.x/container/openejb-jee/src/main/java/org/apache/openejb/jee/EntityBean.java?rev=1167431&r1=1167430&r2=1167431&view=diff
==============================================================================
---
openejb/branches/openejb-3.0.x/container/openejb-jee/src/main/java/org/apache/openejb/jee/EntityBean.java
(original)
+++
openejb/branches/openejb-3.0.x/container/openejb-jee/src/main/java/org/apache/openejb/jee/EntityBean.java
Sat Sep 10 01:33:09 2011
@@ -184,6 +184,7 @@ public class EntityBean implements Enter
    protected PersistenceType persistenceType;
    @XmlElement(name = "prim-key-class", required = true)
    protected String primKeyClass;
+    @XmlJavaTypeAdapter(type = boolean.class, value = BooleanAdapter.class)
    @XmlElement(required = true)
    protected boolean reentrant;
    @XmlElement(name = "cmp-version", defaultValue = "2.x")





-- 
Shawn

Re: svn commit: r1167431 - in /openejb/branches/openejb-3.0.x/container/openejb-jee/src/main/java/org/apache/openejb/jee: BooleanAdapter.java EntityBean.java

Posted by Kevan Miller <ke...@gmail.com>.
On Sep 15, 2011, at 4:48 AM, Shawn Jiang wrote:

> Hello devs,
> 
> I ported a patch from openejb trunk to openejb 3.0.4-SNAPSHOT to fix a issue after upgrading jaxb.   Do we want to push openejb community do another openejb 3.0.x release just to pick up this fix ?
> 
> Because openejb 3.0.x is not under actively development anymore.  Maybe, to use geornimo internal repo[1] to host the patched openejb 3.0.3 is plausible ?    thoughts ?

I'd hope that we could release from the openejb community, not geronimo...

--kevan