ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [2/2] ignite git commit: ignite-3399 - minor improvements
Date Mon, 25 Jul 2016 06:08:13 GMT
ignite-3399 - minor improvements


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

Branch: refs/heads/master
Commit: df1490e18e2271969ef6857d40e77427958e28ac
Parents: df5a842
Author: Sergi Vladykin <sergi.vladykin@gmail.com>
Authored: Mon Jul 25 09:08:00 2016 +0300
Committer: Sergi Vladykin <sergi.vladykin@gmail.com>
Committed: Mon Jul 25 09:08:00 2016 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/util/IgniteUtils.java  | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/df1490e1/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 31128ca..b58e3b3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -1373,17 +1373,19 @@ public abstract class IgniteUtils {
      * @param includePrimitiveTypes Whether class resolution should include primitive types
(i.e. "int" will resolve to int.class if flag is set)
      * @return Class or default given class if it can't be found.
      */
-    @Nullable
-    public static Class<?> classForName(@Nullable String cls, @Nullable Class<?>
dflt, boolean includePrimitiveTypes) {
+    @Nullable public static Class<?> classForName(
+        @Nullable String cls,
+        @Nullable Class<?> dflt,
+        boolean includePrimitiveTypes
+    ) {
         Class<?> clazz;
         if (cls == null)
             clazz = dflt;
-        else if (includePrimitiveTypes && primitiveMap.containsKey(cls))
-            clazz = primitiveMap.get(cls);
-        else {
+        else if (!includePrimitiveTypes || cls.length() > 7 || (clazz = primitiveMap.get(cls))
== null) {
             try {
                 clazz = Class.forName(cls);
-            } catch (ClassNotFoundException ignore) {
+            }
+            catch (ClassNotFoundException ignore) {
                 clazz = dflt;
             }
         }


Mime
View raw message