Fixed typos made in PR #2641

This commit is contained in:
darecoder1999 2020-06-10 09:36:08 +05:30
parent 515d701973
commit 4983dbc0f7
5 changed files with 21 additions and 14 deletions

View File

@ -144,7 +144,6 @@ public interface ConstraintFetcher {
boolean usableOnItems(PropertyIdValue pid); boolean usableOnItems(PropertyIdValue pid);
/** /**
<<<<<<< HEAD
* Retrieves the lower bound of the range * Retrieves the lower bound of the range
* required in difference-within-range constraint * required in difference-within-range constraint
* *

View File

@ -28,7 +28,11 @@ import org.wikidata.wdtk.datamodel.helpers.Datamodel;
import org.wikidata.wdtk.datamodel.implementation.QuantityValueImpl; import org.wikidata.wdtk.datamodel.implementation.QuantityValueImpl;
import org.wikidata.wdtk.datamodel.interfaces.*; import org.wikidata.wdtk.datamodel.interfaces.*;
import java.util.*; import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.HashMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;

View File

@ -6,7 +6,11 @@ import org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue;
import org.wikidata.wdtk.datamodel.interfaces.Statement; import org.wikidata.wdtk.datamodel.interfaces.Statement;
import org.wikidata.wdtk.datamodel.interfaces.Value; import org.wikidata.wdtk.datamodel.interfaces.Value;
import java.util.*; import java.util.Set;
import java.util.Map;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
public class ConflictsWithScrutinizer extends EditScrutinizer { public class ConflictsWithScrutinizer extends EditScrutinizer {

View File

@ -33,9 +33,9 @@ import java.math.BigDecimal;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import org.wikidata.wdtk.datamodel.interfaces.*; import java.util.Map;
import java.util.HashMap;
import java.util.*; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class MockConstraintFetcher implements ConstraintFetcher { public class MockConstraintFetcher implements ConstraintFetcher {
@ -70,9 +70,9 @@ public class MockConstraintFetcher implements ConstraintFetcher {
public static QuantityValue maxValuePid = Datamodel.makeQuantityValue(new BigDecimal(150)); public static QuantityValue maxValuePid = Datamodel.makeQuantityValue(new BigDecimal(150));
public static PropertyIdValue conflictsWithPid = Datamodel.makeWikidataPropertyIdValue("P50"); public static PropertyIdValue conflictsWithPid = Datamodel.makeWikidataPropertyIdValue("P50");
public static PropertyIdValue pidConflictingStatement = Datamodel.makeWikidataPropertyIdValue("P31"); public static Value conflictsWithStatementValue = Datamodel.makeWikidataItemIdValue("Q36322");
public static PropertyIdValue conflictingStatementPid = Datamodel.makeWikidataPropertyIdValue("P31");
public static Value conflictingStatementValue = Datamodel.makeWikidataItemIdValue("Q5"); public static Value conflictingStatementValue = Datamodel.makeWikidataItemIdValue("Q5");
public static Value conflictsWithValue = Datamodel.makeWikidataItemIdValue("Q36322");
@Override @Override
public String getFormatRegex(PropertyIdValue pid) { public String getFormatRegex(PropertyIdValue pid) {
@ -214,7 +214,7 @@ public class MockConstraintFetcher implements ConstraintFetcher {
public Map<PropertyIdValue, List<Value>> getParamConflictsWith(PropertyIdValue pid) { public Map<PropertyIdValue, List<Value>> getParamConflictsWith(PropertyIdValue pid) {
Map<PropertyIdValue, List<Value>> propertyIdValueListMap = new HashMap<>(); Map<PropertyIdValue, List<Value>> propertyIdValueListMap = new HashMap<>();
List<Value> items = Arrays.asList(conflictingStatementValue, null); List<Value> items = Arrays.asList(conflictingStatementValue, null);
propertyIdValueListMap.put(pidConflictingStatement, items); propertyIdValueListMap.put(conflictingStatementPid, items);
return propertyIdValueListMap; return propertyIdValueListMap;
} }
} }

View File

@ -20,9 +20,9 @@ public class ConflictsWithScrutinizerTest extends ScrutinizerTest {
ItemIdValue idA = TestingData.existingId; ItemIdValue idA = TestingData.existingId;
PropertyIdValue conflictsWithPid = MockConstraintFetcher.conflictsWithPid; PropertyIdValue conflictsWithPid = MockConstraintFetcher.conflictsWithPid;
Value conflictsWithValue = MockConstraintFetcher.conflictsWithValue; Value conflictsWithValue = MockConstraintFetcher.conflictsWithStatementValue;
PropertyIdValue propertyWithConflictsPid = MockConstraintFetcher.pidConflictingStatement; PropertyIdValue propertyWithConflictsPid = MockConstraintFetcher.conflictingStatementPid;
Value conflictingValue = MockConstraintFetcher.conflictingStatementValue; Value conflictingValue = MockConstraintFetcher.conflictingStatementValue;
ValueSnak value1 = Datamodel.makeValueSnak(conflictsWithPid, conflictsWithValue); ValueSnak value1 = Datamodel.makeValueSnak(conflictsWithPid, conflictsWithValue);
@ -42,7 +42,7 @@ public class ConflictsWithScrutinizerTest extends ScrutinizerTest {
ItemIdValue idA = TestingData.existingId; ItemIdValue idA = TestingData.existingId;
PropertyIdValue conflictsWithPid = MockConstraintFetcher.conflictsWithPid; PropertyIdValue conflictsWithPid = MockConstraintFetcher.conflictsWithPid;
Value conflictsWithValue = MockConstraintFetcher.conflictsWithValue; Value conflictsWithValue = MockConstraintFetcher.conflictsWithStatementValue;
ValueSnak value1 = Datamodel.makeValueSnak(conflictsWithPid, conflictsWithValue); ValueSnak value1 = Datamodel.makeValueSnak(conflictsWithPid, conflictsWithValue);
@ -58,9 +58,9 @@ public class ConflictsWithScrutinizerTest extends ScrutinizerTest {
ItemIdValue idA = TestingData.existingId; ItemIdValue idA = TestingData.existingId;
PropertyIdValue conflictsWithPid = MockConstraintFetcher.conflictsWithPid; PropertyIdValue conflictsWithPid = MockConstraintFetcher.conflictsWithPid;
Value conflictsWithValue = MockConstraintFetcher.conflictsWithValue; Value conflictsWithValue = MockConstraintFetcher.conflictsWithStatementValue;
PropertyIdValue propertyWithConflictsPid = MockConstraintFetcher.pidConflictingStatement; PropertyIdValue propertyWithConflictsPid = MockConstraintFetcher.conflictingStatementPid;
ValueSnak value1 = Datamodel.makeValueSnak(conflictsWithPid, conflictsWithValue); ValueSnak value1 = Datamodel.makeValueSnak(conflictsWithPid, conflictsWithValue);
NoValueSnak value2 = Datamodel.makeNoValueSnak(propertyWithConflictsPid); NoValueSnak value2 = Datamodel.makeNoValueSnak(propertyWithConflictsPid);