Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Currently there is some logic in Schema Matcher constructor and some logic in MatcherFactory to set up the correct instance of matcher to use.
These rules should be consolidated in one place in MatcherFactory so its less confusing to infer what values for from and to schema go into the concrete matcher implementations
public class MatcherFactory { public static Matcher getMatcher(Schema fromSchema, Schema toSchema) { if (toSchema.isEmpty() || fromSchema.isEmpty()) { return new LocationMatcher(fromSchema, toSchema); } else { return new NameMatcher(fromSchema, toSchema); } } }
public Matcher(Schema fromSchema, Schema toSchema) {
if (fromSchema.isEmpty() && toSchema.isEmpty())
else if (toSchema.isEmpty())
{ this.fromSchema = fromSchema; this.toSchema = fromSchema; }else if (fromSchema.isEmpty())
{ this.fromSchema = toSchema; this.toSchema = toSchema; }else
{ this.fromSchema = fromSchema; this.toSchema = toSchema; }}