From 95ce84f806e6c456893c9cc27f3f9333d79a0c86 Mon Sep 17 00:00:00 2001 From: serso Date: Mon, 16 May 2016 00:35:41 +0200 Subject: [PATCH] Fix name validation --- app/src/main/java/org/solovyev/android/calculator/Engine.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/Engine.java b/app/src/main/java/org/solovyev/android/calculator/Engine.java index 2da29d4f..1f6585bc 100644 --- a/app/src/main/java/org/solovyev/android/calculator/Engine.java +++ b/app/src/main/java/org/solovyev/android/calculator/Engine.java @@ -109,8 +109,8 @@ public class Engine implements SharedPreferences.OnSharedPreferenceChangeListene public static boolean isValidName(@Nullable String name) { if (!TextUtils.isEmpty(name)) { try { - Identifier.parser.parse(Parser.Parameters.get(name), null); - return true; + final String parsed = Identifier.parser.parse(Parser.Parameters.get(name), null); + return TextUtils.equals(parsed, name); } catch (jscl.text.ParseException e) { // not valid name; }