| Chunk |
|---|
| Conflicting content |
|---|
public final static String AND = "$and"; public final static String REGEX = "$regex"; public final static String REGEX_OPTIONS = "$options"; <<<<<<< HEAD public final static String TYPE = "$type"; ======= >>>>>>> 12027f6b63a54486dca494dc73bfb86ea86c73af public final static String NEAR = "$near"; public final static String NEARSPHERE = "$nearSphere"; public final static String MAXDISTANCE = "$maxDistance"; |
| Solution content |
|---|
public final static String AND = "$and"; public final static String REGEX = "$regex"; public final static String REGEX_OPTIONS = "$options"; public final static String TYPE = "$type"; public final static String NEAR = "$near"; public final static String NEARSPHERE = "$nearSphere"; public final static String MAXDISTANCE = "$maxDistance"; |
| File |
|---|
| ExpressionParser.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Chunk |
|---|
| Conflicting content |
|---|
// TODO : http://docs.mongodb.org/manual/reference/operator/query-geospatial/
// TODO : http://docs.mongodb.org/manual/reference/operator/geoWithin/#op._S_geoWithin
// TODO : http://docs.mongodb.org/manual/reference/operator/geoIntersects/
<<<<<<< HEAD
private static class Null {
}
private static final Map |
| Solution content |
|---|
// TODO : http://docs.mongodb.org/manual/reference/operator/query-geospatial/
// TODO : http://docs.mongodb.org/manual/reference/operator/geoWithin/#op._S_geoWithin
// TODO : http://docs.mongodb.org/manual/reference/operator/geoIntersects/
private static class Null {
}
private static final Map |
| File |
|---|
| ExpressionParser.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Class declaration |
| Static initializer |
| Chunk |
|---|
| Conflicting content |
|---|
List |
| Solution content |
|---|
List |
| File |
|---|
| ExpressionParser.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
},
new ConditionalOperatorFilterFactory(LTE) {
boolean singleCompare(Object queryValue, Object storedValue) {
<<<<<<< HEAD
Integer result = compareObjects(queryValue, storedValue, true);
=======
Integer result = compareObjects(queryValue, storedValue);
>>>>>>> 12027f6b63a54486dca494dc73bfb86ea86c73af
return result != null && result.intValue() >= 0;
}
}, |
| Solution content |
|---|
},
new ConditionalOperatorFilterFactory(LTE) {
boolean singleCompare(Object queryValue, Object storedValue) {
Integer result = compareObjects(queryValue, storedValue, true);
return result != null && result.intValue() >= 0;
}
}, |
| File |
|---|
| ExpressionParser.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
},
new ConditionalOperatorFilterFactory(GT) {
boolean singleCompare(Object queryValue, Object storedValue) {
<<<<<<< HEAD
Integer result = compareObjects(queryValue, storedValue, true);
=======
Integer result = compareObjects(queryValue, storedValue);
>>>>>>> 12027f6b63a54486dca494dc73bfb86ea86c73af
return result != null && result.intValue() < 0;
}
}, |
| Solution content |
|---|
},
new ConditionalOperatorFilterFactory(GT) {
boolean singleCompare(Object queryValue, Object storedValue) {
Integer result = compareObjects(queryValue, storedValue, true);
return result != null && result.intValue() < 0;
}
}, |
| File |
|---|
| ExpressionParser.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
},
new ConditionalOperatorFilterFactory(LT) {
boolean singleCompare(Object queryValue, Object storedValue) {
<<<<<<< HEAD
Integer result = compareObjects(queryValue, storedValue, true);
=======
Integer result = compareObjects(queryValue, storedValue);
>>>>>>> 12027f6b63a54486dca494dc73bfb86ea86c73af
return result != null && result.intValue() > 0;
}
}, |
| Solution content |
|---|
},
new ConditionalOperatorFilterFactory(LT) {
boolean singleCompare(Object queryValue, Object storedValue) {
Integer result = compareObjects(queryValue, storedValue, true);
return result != null && result.intValue() > 0;
}
}, |
| File |
|---|
| ExpressionParser.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
return createPatternFilter(path, pattern);
}
},
<<<<<<< HEAD
=======
new NearCommandFilterFactory(NEARSPHERE, true),
new NearCommandFilterFactory(NEAR, false),
>>>>>>> 12027f6b63a54486dca494dc73bfb86ea86c73af
new BasicCommandFilterFactory(TYPE) {
@Override
public Filter createFilter(final List |
| Solution content |
|---|
return createPatternFilter(path, pattern);
}
},
new NearCommandFilterFactory(NEARSPHERE, true),
new NearCommandFilterFactory(NEAR, false),
new BasicCommandFilterFactory(TYPE) {
@Override
public Filter createFilter(final List |
| File |
|---|
| ExpressionParser.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
}
return createTypeFilter(path, type.intValue());
<<<<<<< HEAD
},
new NearCommandFilterFactory(NEARSPHERE, true),
new NearCommandFilterFactory(NEAR, false)
=======
}
>>>>>>> 12027f6b63a54486dca494dc73bfb86ea86c73af
);
boolean objectMatchesPattern(Object obj, Pattern pattern) { |
| Solution content |
|---|
return createTypeFilter(path, type.intValue());
}
}
);
boolean objectMatchesPattern(Object obj, Pattern pattern) { |
| File |
|---|
| ExpressionParser.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
* @return
*/
@SuppressWarnings("all")
<<<<<<< HEAD
public Integer compareObjects(Object queryValue, Object storedValue, boolean comparableFilter) {
=======
public Integer compareObjects(Object queryValue, Object storedValue) {
>>>>>>> 12027f6b63a54486dca494dc73bfb86ea86c73af
LOG.debug("comparing {} and {}", queryValue, storedValue);
if (queryValue instanceof DBObject && storedValue instanceof DBObject) { |
| Solution content |
|---|
* @return
*/
@SuppressWarnings("all")
public Integer compareObjects(Object queryValue, Object storedValue, boolean comparableFilter) {
LOG.debug("comparing {} and {}", queryValue, storedValue);
if (queryValue instanceof DBObject && storedValue instanceof DBObject) { |
| File |
|---|
| ExpressionParser.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
if (storedComp == null) {
List storedList = (List) storedValue;
return compareLists(queryList, storedList);
} else {
<<<<<<< HEAD
Object queryComp = typecast("query value", queryValue, Object.class);
if (comparableFilter && !(storedValue instanceof Comparable)) {
return null;
}
Object storedComp = typecast("stored value", storedValue, Object.class);
return compareTo(queryComp, storedComp);
}
}
//@VisibleForTesting
protected int compareTo(Object c1, Object c2) { // Object to handle MinKey/MaxKey
Object cc1 = c1;
Object cc2 = c2;
Class> clazz1 = c1 == null ? Null.class : c1.getClass();
Class> clazz2 = c2 == null ? Null.class : c2.getClass();
// Not comparable for MinKey/MaxKey
if (!clazz1.equals(clazz2) || !(cc1 instanceof Comparable)) {
boolean checkTypes = true;
if (cc1 instanceof Number) {
if (cc2 instanceof Number) {
cc1 = new BigDecimal(cc1.toString());
cc2 = new BigDecimal(cc2.toString());
checkTypes = false;
}
}
if(checkTypes) {
Integer type1 = CLASS_TO_WEIGHT.get(clazz1);
Integer type2 = CLASS_TO_WEIGHT.get(clazz2);
if (type1 != null && type2 != null) {
cc1 = type1;
cc2 = type2;
} else {
throw new FongoException("Don't know how to compare " + cc1.getClass() + " and " + cc2.getClass() + " values are : " + c1 + " vs " + c2);
}
=======
Comparable queryComp = typecast("query value", queryValue, Comparable.class);
if(!(storedValue instanceof Comparable) && storedValue != null) {
return null;
}
Comparable storedComp = typecast("stored value", storedValue, Comparable.class);
return 1;
>>>>>>> 12027f6b63a54486dca494dc73bfb86ea86c73af
}
}
|
| Solution content |
|---|
List storedList = (List) storedValue;
return compareLists(queryList, storedList);
} else {
Object queryComp = typecast("query value", queryValue, Object.class);
if (comparableFilter && !(storedValue instanceof Comparable)) {
return null;
}
Object storedComp = typecast("stored value", storedValue, Object.class);
return compareTo(queryComp, storedComp);
}
}
//@VisibleForTesting
protected int compareTo(Object c1, Object c2) { // Object to handle MinKey/MaxKey
Object cc1 = c1;
Object cc2 = c2;
Class> clazz1 = c1 == null ? Null.class : c1.getClass();
Class> clazz2 = c2 == null ? Null.class : c2.getClass();
// Not comparable for MinKey/MaxKey
if (!clazz1.equals(clazz2) || !(cc1 instanceof Comparable)) {
boolean checkTypes = true;
if (cc1 instanceof Number) {
if (cc2 instanceof Number) {
cc1 = new BigDecimal(cc1.toString());
cc2 = new BigDecimal(cc2.toString());
checkTypes = false;
}
}
if(checkTypes) {
Integer type1 = CLASS_TO_WEIGHT.get(clazz1);
Integer type2 = CLASS_TO_WEIGHT.get(clazz2);
if (type1 != null && type2 != null) {
cc1 = type1;
cc2 = type2;
} else {
throw new FongoException("Don't know how to compare " + cc1.getClass() + " and " + cc2.getClass() + " values are : " + c1 + " vs " + c2);
}
}
}
|
| File |
|---|
| ExpressionParser.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Comment |
| If statement |
| Method invocation |
| Method signature |
| Return statement |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
}; } <<<<<<< HEAD public Filter createTypeFilter(final List |
| Solution content |
|---|
}; } public Filter createTypeFilter(final List |
| File |
|---|
| ExpressionParser.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method declaration |
| Chunk |
|---|
| Conflicting content |
|---|
limit--;
}
return result;
<<<<<<< HEAD
=======
}
};
}
public Filter createTypeFilter(final List |
| Solution content |
|---|
limit--;
}
return result;
}
};
} |
| File |
|---|
| ExpressionParser.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method invocation |
| Method signature |
| Return statement |