Jelajahi Sumber

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

Siddharth Wagle 11 tahun lalu
induk
melakukan
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
   @Override
   public boolean evaluate(Resource resource) {
   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 ?
     return patternExpr == null ?
       propertyValue == null :
       propertyValue == null :