Skip to content
Snippets Groups Projects
Commit e9d2f605 authored by Raphael GIRARDOT's avatar Raphael GIRARDOT
Browse files

some code refactoring

parent e343213b
No related branches found
No related tags found
No related merge requests found
......@@ -248,9 +248,13 @@ public class CometeTrendController {
}
}
public static String parseAttributeCompleteName(String value) {
return value == null ? null : value.trim().replace(TrendFile.SINGLE_QUOT, ObjectUtils.EMPTY_STRING);
}
public static String parseKey(String value) {
return value == null ? null
: value.trim().replace(TrendFile.SINGLE_QUOT, ObjectUtils.EMPTY_STRING).toLowerCase();
String key = parseAttributeCompleteName(value);
return key == null ? null : key.toLowerCase();
}
private void preparePlotProperties(String key, String attributeName) {
......@@ -275,9 +279,8 @@ public class CometeTrendController {
}
public void rememberAttribute(String attributeFullName) {
if (attributeFullName != null) {
String name = attributeFullName.trim().replace(TrendFile.SINGLE_QUOT, ObjectUtils.EMPTY_STRING);
if (!name.isEmpty()) {
String name = parseAttributeCompleteName(attributeFullName);
if (name != null && !name.isEmpty()) {
boolean found = false;
for (String attribute : attributeList) {
if ((attribute != null) && attribute.equalsIgnoreCase(name)) {
......@@ -290,7 +293,6 @@ public class CometeTrendController {
}
}
}
}
public void addAttribute(String attributeFullName) {
boolean addAttribute = attributeList.add(attributeFullName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment