tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlmonte...@apache.org
Subject [2/3] tomee git commit: removes unnecesary unboxing
Date Wed, 12 Dec 2018 15:59:52 GMT
removes unnecesary unboxing


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/d5c0b2b5
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/d5c0b2b5
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/d5c0b2b5

Branch: refs/heads/master
Commit: d5c0b2b5373674a7414c6539b7e394d030e68ed0
Parents: a10f56f
Author: Otavio Santana <otaviopolianasantana@gmail.com>
Authored: Tue Dec 11 15:04:54 2018 -0200
Committer: Otavio Santana <otaviopolianasantana@gmail.com>
Committed: Tue Dec 11 15:04:54 2018 -0200

----------------------------------------------------------------------
 .../org/apache/openejb/core/cmp/cmp2/EjbSelect.java |  4 ++--
 .../org/apache/openejb/util/PojoSerialization.java  | 16 ++++++++--------
 .../openejb/test/entity/cmp2/model/StorageBean.java |  4 ++--
 .../java/org/apache/openejb/jee/BooleanAdapter.java |  2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/d5c0b2b5/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/cmp2/EjbSelect.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/cmp2/EjbSelect.java
b/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/cmp2/EjbSelect.java
index e0d5a5e..6ef70f2 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/cmp2/EjbSelect.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/cmp2/EjbSelect.java
@@ -140,7 +140,7 @@ public class EjbSelect {
         final CmpContainer cmpContainer = (CmpContainer) container;
 
         final Character result = (Character) cmpContainer.select(beanContext, methodSignature,
"char", args);
-        return result.charValue();
+        return result;
     }
 
 
@@ -166,7 +166,7 @@ public class EjbSelect {
         final CmpContainer cmpContainer = (CmpContainer) container;
 
         final Boolean result = (Boolean) cmpContainer.select(beanContext, methodSignature,
"byte", args);
-        return result.booleanValue();
+        return result;
     }
 
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/d5c0b2b5/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java
b/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java
index c08d18c..40ffba0 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java
@@ -314,21 +314,21 @@ public class PojoSerialization implements Serializable {
         try {
             if (type.isPrimitive()) {
                 if (type.equals(Integer.TYPE)) {
-                    putInt.invoke(unsafe, object, offset, ((Integer) value).intValue());
+                    putInt.invoke(unsafe, object, offset, (Integer) value);
                 } else if (type.equals(Long.TYPE)) {
-                    putLong.invoke(unsafe, object, offset, ((Long) value).longValue());
+                    putLong.invoke(unsafe, object, offset, (Long) value);
                 } else if (type.equals(Short.TYPE)) {
-                    putShort.invoke(unsafe, object, offset, ((Short) value).shortValue());
+                    putShort.invoke(unsafe, object, offset, (Short) value);
                 } else if (type.equals(Character.TYPE)) {
-                    putChar.invoke(unsafe, object, offset, ((Character) value).charValue());
+                    putChar.invoke(unsafe, object, offset, (Character) value);
                 } else if (type.equals(Byte.TYPE)) {
-                    putByte.invoke(unsafe, object, offset, ((Byte) value).byteValue());
+                    putByte.invoke(unsafe, object, offset, (Byte) value);
                 } else if (type.equals(Float.TYPE)) {
-                    putFloat.invoke(unsafe, object, offset, ((Float) value).floatValue());
+                    putFloat.invoke(unsafe, object, offset, (Float) value);
                 } else if (type.equals(Double.TYPE)) {
-                    putDouble.invoke(unsafe, object, offset, ((Double) value).doubleValue());
+                    putDouble.invoke(unsafe, object, offset, (Double) value);
                 } else if (type.equals(Boolean.TYPE)) {
-                    putBoolean.invoke(unsafe, object, offset, ((Boolean) value).booleanValue());
+                    putBoolean.invoke(unsafe, object, offset, (Boolean) value);
                 } else {
                     throw new IllegalStateException("Unknown primitive type: " + type.getName());
                 }

http://git-wip-us.apache.org/repos/asf/tomee/blob/d5c0b2b5/container/openejb-core/src/test/java/org/apache/openejb/test/entity/cmp2/model/StorageBean.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/test/java/org/apache/openejb/test/entity/cmp2/model/StorageBean.java
b/container/openejb-core/src/test/java/org/apache/openejb/test/entity/cmp2/model/StorageBean.java
index f6af87f..37861e8 100644
--- a/container/openejb-core/src/test/java/org/apache/openejb/test/entity/cmp2/model/StorageBean.java
+++ b/container/openejb-core/src/test/java/org/apache/openejb/test/entity/cmp2/model/StorageBean.java
@@ -51,7 +51,7 @@ public abstract class StorageBean implements EntityBean {
             final Connection c = ds.getConnection();
             final PreparedStatement ps = c.prepareStatement("UPDATE storage SET blob_column
= ? WHERE id = ?");
             ps.setBinaryStream(1, new ByteArrayInputStream(bytes), bytes.length);
-            ps.setInt(2, ((Integer) ctx.getPrimaryKey()).intValue());
+            ps.setInt(2, (Integer) ctx.getPrimaryKey());
             ps.executeUpdate();
             ps.close();
             c.close();
@@ -65,7 +65,7 @@ public abstract class StorageBean implements EntityBean {
             final DataSource ds = (DataSource) new InitialContext().lookup("java:comp/env/jdbc/DefaultDatabase");
             final Connection c = ds.getConnection();
             final PreparedStatement ps = c.prepareStatement("SELECT blob_column FROM storage
WHERE id = ?");
-            ps.setInt(1, ((Integer) ctx.getPrimaryKey()).intValue());
+            ps.setInt(1, (Integer) ctx.getPrimaryKey());
             final ResultSet rs = ps.executeQuery();
             rs.next();
             final InputStream is = rs.getBinaryStream(1);

http://git-wip-us.apache.org/repos/asf/tomee/blob/d5c0b2b5/container/openejb-jee/src/main/java/org/apache/openejb/jee/BooleanAdapter.java
----------------------------------------------------------------------
diff --git a/container/openejb-jee/src/main/java/org/apache/openejb/jee/BooleanAdapter.java
b/container/openejb-jee/src/main/java/org/apache/openejb/jee/BooleanAdapter.java
index 852ff96..843955e 100644
--- a/container/openejb-jee/src/main/java/org/apache/openejb/jee/BooleanAdapter.java
+++ b/container/openejb-jee/src/main/java/org/apache/openejb/jee/BooleanAdapter.java
@@ -38,6 +38,6 @@ public class BooleanAdapter extends XmlAdapter<String, Boolean> {
         if (value == null) {
             return null;
         }
-        return (value.booleanValue()) ? "true" : "false";
+        return (value) ? "true" : "false";
     }
 }


Mime
View raw message