From bf42d1171997afad9c5b7fb596f6afb7132b016b Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Tue, 28 Feb 2017 19:53:08 +0100 Subject: [PATCH] trimming too long phone numbers added --- .../java/smash/appointment/parse/Subject.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/appointment-import/src/main/java/smash/appointment/parse/Subject.java b/appointment-import/src/main/java/smash/appointment/parse/Subject.java index 06f4df1b..a619a885 100644 --- a/appointment-import/src/main/java/smash/appointment/parse/Subject.java +++ b/appointment-import/src/main/java/smash/appointment/parse/Subject.java @@ -271,7 +271,11 @@ public class Subject { * @see #phone1 */ public void setPhone1(String phone1) { - this.phone1 = phone1; + if (phone1.length() > 20) { + logger.warn("Invalid phone. Ignoring: " + phone1); + } else { + this.phone1 = phone1; + } } /** @@ -288,7 +292,11 @@ public class Subject { * @see #phone2 */ public void setPhone2(String phone2) { - this.phone2 = phone2; + if (phone2.length() > 20) { + logger.warn("Invalid phone. Ignoring: " + phone2); + } else { + this.phone2 = phone2; + } } /** @@ -305,7 +313,11 @@ public class Subject { * @see #phone3 */ public void setPhone3(String phone3) { - this.phone3 = phone3; + if (phone3.length() > 20) { + logger.warn("Invalid phone. Ignoring: " + phone3); + } else { + this.phone3 = phone3; + } } /** -- GitLab