You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/07/28 11:06:45 UTC
[20/50] [abbrv] ignite git commit: ignite-3399 - minor improvements
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/ignite-3553
Commit: df1490e18e2271969ef6857d40e77427958e28ac
Parents: df5a842
Author: Sergi Vladykin <se...@gmail.com>
Authored: Mon Jul 25 09:08:00 2016 +0300
Committer: Sergi Vladykin <se...@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;
}
}