From 2a6a5c4fe274866e52620877dd8f2017368119d4 Mon Sep 17 00:00:00 2001 From: Matthieu Bacconnier Date: Wed, 15 Feb 2017 17:42:18 -0800 Subject: [PATCH] @saveman71 comments --- app/src/main/java/fr/neamar/kiss/pojo/AppPojo.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/fr/neamar/kiss/pojo/AppPojo.java b/app/src/main/java/fr/neamar/kiss/pojo/AppPojo.java index 250784807..55223192d 100644 --- a/app/src/main/java/fr/neamar/kiss/pojo/AppPojo.java +++ b/app/src/main/java/fr/neamar/kiss/pojo/AppPojo.java @@ -20,10 +20,10 @@ public class AppPojo extends Pojo { public void setTags(String tags) { -// Set the actual user-friendly name + // Set the actual user-friendly name this.tags = tags; - if (tags != null) { + if (this.tags != null) { this.tags = this.tags.replaceAll("<", "<"); // Normalize name for faster searching Pair normalized = StringNormalizer.normalizeWithMap(this.tags); @@ -37,11 +37,9 @@ public void setTagHighlight(int positionStart, int positionEnd) { int posEnd = this.mapTagsPosition(positionEnd); this.displayTags = this.tags.substring(0, posStart) - + '{' + this.tags.substring(posStart, posEnd) + '}'+this.tags.substring(posEnd, this.tags.length()); + + '{' + this.tags.substring(posStart, posEnd) + '}' + this.tags.substring(posEnd, this.tags.length()); } - - /** * Map a position in the normalized name to a position in the standard name string * @@ -52,16 +50,14 @@ public int mapTagsPosition(int position) { if (this.tagsPositionMap != null) { if (position < this.tagsPositionMap.length) { return this.tagsPositionMap[position]; - } else { - return this.tags.length(); } + return this.tags.length(); } else { // No mapping defined if (position < this.tags.length()) { return position; - } else { - return this.tags.length(); } + return this.tags.length(); } }