From c339266556c41c9c9cadfc4e63a62e34f4221088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=B6sel?= Date: Wed, 24 Aug 2016 12:07:17 +0200 Subject: [PATCH] [UserDefault-android] Return defaultValue parameter instead of some default value (#16416) * Return defaultValue parameter instead of some default value * Remove unnecessary semicolon --- .../android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java index 7689e62418..c00203532c 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java @@ -532,7 +532,7 @@ public class Cocos2dxHelper { } } - return false; + return defaultValue; } public static int getIntegerForKey(String key, int defaultValue) { @@ -560,7 +560,7 @@ public class Cocos2dxHelper { } } - return 0; + return defaultValue; } public static float getFloatForKey(String key, float defaultValue) { @@ -569,7 +569,7 @@ public class Cocos2dxHelper { return settings.getFloat(key, defaultValue); } catch (Exception ex) { - ex.printStackTrace();; + ex.printStackTrace(); Map allValues = settings.getAll(); Object value = allValues.get(key); @@ -588,7 +588,7 @@ public class Cocos2dxHelper { } } - return 0.0f; + return defaultValue; } public static double getDoubleForKey(String key, double defaultValue) {