Author: rmannibucau
Date: Sun Aug 10 20:49:54 2014
New Revision: 1617157

URL: http://svn.apache.org/r1617157
Log:
unused method

Modified:
    
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java

Modified: 
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
URL: 
http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java?rev=1617157&r1=1617156&r2=1617157&view=diff
==============================================================================
--- 
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
 (original)
+++ 
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
 Sun Aug 10 20:49:54 2014
@@ -477,21 +477,21 @@ public class ReadDescriptors implements 
 
     private void readCmpOrm(final EjbModule ejbModule) throws OpenEJBException 
{
         final Object data = ejbModule.getAltDDs().get("openejb-cmp-orm.xml");
-        if (data == null || data instanceof EntityMappings) {
-            return;
-        } else if (data instanceof URL) {
-            final URL url = (URL) data;
-            try {
-                final EntityMappings entitymappings = (EntityMappings) 
JaxbJavaee.unmarshalJavaee(EntityMappings.class, IO.read(url));
-                ejbModule.getAltDDs().put("openejb-cmp-orm.xml", 
entitymappings);
-            } catch (final SAXException e) {
-                throw new OpenEJBException("Cannot parse the 
openejb-cmp-orm.xml file: " + url.toExternalForm(), e);
-            } catch (final JAXBException e) {
-                throw new OpenEJBException("Cannot unmarshall the 
openejb-cmp-orm.xml file: " + url.toExternalForm(), e);
-            } catch (final IOException e) {
-                throw new OpenEJBException("Cannot read the 
openejb-cmp-orm.xml file: " + url.toExternalForm(), e);
-            } catch (final Exception e) {
-                throw new OpenEJBException("Encountered unknown error parsing 
the openejb-cmp-orm.xml file: " + url.toExternalForm(), e);
+        if (data != null && !(data instanceof EntityMappings)) {
+            if (data instanceof URL) {
+                final URL url = (URL) data;
+                try {
+                    final EntityMappings entitymappings = (EntityMappings) 
JaxbJavaee.unmarshalJavaee(EntityMappings.class, IO.read(url));
+                    ejbModule.getAltDDs().put("openejb-cmp-orm.xml", 
entitymappings);
+                } catch (final SAXException e) {
+                    throw new OpenEJBException("Cannot parse the 
openejb-cmp-orm.xml file: " + url.toExternalForm(), e);
+                } catch (final JAXBException e) {
+                    throw new OpenEJBException("Cannot unmarshall the 
openejb-cmp-orm.xml file: " + url.toExternalForm(), e);
+                } catch (final IOException e) {
+                    throw new OpenEJBException("Cannot read the 
openejb-cmp-orm.xml file: " + url.toExternalForm(), e);
+                } catch (final Exception e) {
+                    throw new OpenEJBException("Encountered unknown error 
parsing the openejb-cmp-orm.xml file: " + url.toExternalForm(), e);
+                }
             }
         }
     }
@@ -608,7 +608,7 @@ public class ReadDescriptors implements 
 
     public static Beans readBeans(final InputStream inputStream) throws 
OpenEJBException {
         try {
-            final String content = IO.slurp(inputStream);
+            final String content = IO.slurp(inputStream).trim();
             if (content.length() == 0) { // otherwise we want to read <beans 
/> attributes
                 final Beans beans = new Beans();
                 beans.setBeanDiscoveryMode("ALL"); // backward compatibility
@@ -631,10 +631,6 @@ public class ReadDescriptors implements 
         return isEmpty(is, "ejb-jar");
     }
 
-    private static boolean isEmptyBeansXml(final InputStream is) throws 
IOException, ParserConfigurationException, SAXException {
-        return isEmpty(is, "beans");
-    }
-
     private static boolean isEmpty(final InputStream is, final String 
rootElement) throws IOException, ParserConfigurationException, SAXException {
         final LengthInputStream in = new LengthInputStream(is);
         final InputSource inputSource = new InputSource(in);


Reply via email to