From ec4ddf40c49f9130e969bc37f3bfce8ec7a8a64a Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 5 Jun 2017 15:21:34 +0800 Subject: [PATCH] Fix PropertyBindings bugs --- source/net/filebot/format/MediaBindingBean.java | 2 +- source/net/filebot/similarity/CrossPropertyMetric.java | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/source/net/filebot/format/MediaBindingBean.java b/source/net/filebot/format/MediaBindingBean.java index 1b82d103..bbf076f4 100644 --- a/source/net/filebot/format/MediaBindingBean.java +++ b/source/net/filebot/format/MediaBindingBean.java @@ -1245,7 +1245,7 @@ public class MediaBindingBean { } private AssociativeScriptObject createPropertyBindings(Object object) { - return new AssociativeScriptObject(new PropertyBindings(object, null)) { + return new AssociativeScriptObject(new PropertyBindings(object)) { @Override public Object getProperty(String name) { diff --git a/source/net/filebot/similarity/CrossPropertyMetric.java b/source/net/filebot/similarity/CrossPropertyMetric.java index 1a159c1a..828147e1 100644 --- a/source/net/filebot/similarity/CrossPropertyMetric.java +++ b/source/net/filebot/similarity/CrossPropertyMetric.java @@ -1,29 +1,24 @@ package net.filebot.similarity; - import java.util.Map; import java.util.Set; import java.util.TreeSet; import net.filebot.format.PropertyBindings; - public class CrossPropertyMetric implements SimilarityMetric { private SimilarityMetric metric; - public CrossPropertyMetric(SimilarityMetric metric) { this.metric = metric; } - public CrossPropertyMetric() { this.metric = new StringEqualsMetric(); } - @Override public float getSimilarity(Object o1, Object o2) { Map m1 = getProperties(o1); @@ -53,9 +48,8 @@ public class CrossPropertyMetric implements SimilarityMetric { return feedback / keys.size(); } - protected Map getProperties(Object object) { - return new PropertyBindings(object, null); + return new PropertyBindings(object); } }