Переглянути джерело

AMBARI-5799. Add filter by regex and sort capabilities to API. Fix for ClassCastException. (swagle)

Siddharth Wagle 11 роки тому
батько
коміт
c36bbc5643

+ 2 - 2
ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/FilterPredicate.java

@@ -49,8 +49,8 @@ public class FilterPredicate extends ComparisonPredicate {
 
   @Override
   public boolean evaluate(Resource resource) {
-    String propertyValue  = (String) resource.getPropertyValue(getPropertyId());
-    matcher.reset(propertyValue != null ? propertyValue : emptyString);
+    Object propertyValue =  resource.getPropertyValue(getPropertyId());
+    matcher.reset(propertyValue != null ? propertyValue.toString() : emptyString);
 
     return patternExpr == null ?
       propertyValue == null :