text stringlengths 171 29.4k |
|---|
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected JavaType _fromClass(ClassStack context, Class<?> rawType, TypeBindings bindings)
{
// Very first thing: small set of core types we know well:
Ja... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
x
// Test Case
[/INST]
public void testMapRefinement() throws Exception
{
String ID1 = "3a6383d4-8123-4c43-8b8d-7cedf3e59404";
String ID2 = "81c3d978-90c... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected BeanPropertyWriter buildWriter(SerializerProvider prov,
BeanPropertyDefinition propDef, JavaType declaredType, JsonSerializer<?> ser,
TypeSe... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@SuppressWarnings("unchecked")
public static JsonSerializer<Object> getFallbackKeySerializer(SerializationConfig config,
Class<?> rawKeyType)
{
if... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
protected Object _deserialize(String value, DeserializationContext ctxt) throws IOException
{
switch (_kind) {
case STD_... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public <T> MappingIterator<T> readValues(byte[] src, int offset, int length)
throws IOException, JsonProcessingException
{
if (_dataFormatReaders != null)... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected SettableBeanProperty constructSettableProperty(DeserializationContext ctxt,
BeanDescription beanDesc, BeanPropertyDefinition propDef,
JavaTy... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public JavaType constructSpecializedType(JavaType baseType, Class<?> subclass)
{
// simple optimization to avoid costly introspection if type-erased type does NOT... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
x
// Test Case
[/INST]
public void testMapKeyRefinement1384() throws Exception
{
final String TEST_INSTANCE_SERIALIZED =
"{\"mapProperty\":[\"jav... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
x
// Test Case
[/INST]
public void testMapKeyRefinement1384() throws Exception
{
final String TEST_INSTANCE_SERIALIZED =
"{\"mapProperty\":[\"jav... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
x
// Test Case
[/INST]
public void testMapKeyRefinement1384() throws Exception
{
final String TEST_INSTANCE_SERIALIZED =
"{\"mapProperty\":[\"jav... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected Date parseAsISO8601(String dateStr, ParsePosition pos)
{
/* 21-May-2009, tatu: DateFormat has very strict handling of
* timezone modifiers for... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public void serializeWithType(Object bean, JsonGenerator gen, SerializerProvider provider,
TypeSerializer typeSer0) throws IOException
{
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public TypeSerializer buildTypeSerializer(SerializationConfig config,
JavaType baseType, Collection<NamedType> subtypes)
{
if (_idType =... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public TypeDeserializer buildTypeDeserializer(DeserializationConfig config,
JavaType baseType, Collection<NamedType> subtypes)
{
if (_id... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public boolean useForType(JavaType t)
{
// 03-Oct-2016, tatu: As per [databind#1395], need to skip
// primitive types too, regardless
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public CollectionDeserializer createContextual(DeserializationContext ctxt,
BeanProperty property) throws JsonMappingException
{
// May need to resolv... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public static class Reference implements Serializable
{
private static final long serialVersionUID = 2L; // changes between 2.7 and 2.8
// transient sinc... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected BeanPropertyWriter buildWriter(SerializerProvider prov,
BeanPropertyDefinition propDef, JavaType declaredType, JsonSerializer<?> ser,
TypeSe... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public Object deserializeKey(String key, DeserializationContext ctxt)
throws IOException
{
if (key == null) { // is this even legal call?
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public Method findFactoryMethod(Class<?>... expArgTypes)
{
// So, of all single-arg static methods:
for (AnnotatedMethod am : _classInfo.get... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected boolean isFactoryMethod(AnnotatedMethod am)
{
/* First: return type must be compatible with the introspected class
* (i.e. allowed to be sub-cl... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public final Object deserializeKey(String key, DeserializationContext ctxt)
throws IOException
{
if (key == null) { // is this even legal ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public KeyDeserializer createKeyDeserializer(DeserializationContext ctxt,
JavaType type)
throws JsonMappingException
{
final DeserializationCo... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected Object deserializeFromObjectUsingNonDefault(JsonParser p,
DeserializationContext ctxt) throws IOException
{
if (_delegateDeserializer != nul... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@SuppressWarnings("incomplete-switch")
public Object deserializeFromNumber(JsonParser p, DeserializationContext ctxt)
throws IOException
{
// First th... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Object deserializeFromString(JsonParser p, DeserializationContext ctxt) throws IOException
{
// First things first: id Object Id is used, most likely that'... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Object deserializeFromDouble(JsonParser p, DeserializationContext ctxt) throws IOException
{
NumberType t = p.getNumberType();
// no separate metho... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Object deserializeFromBoolean(JsonParser p, DeserializationContext ctxt) throws IOException
{
if (_delegateDeserializer != null) {
if (!_valueI... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Object deserializeFromArray(JsonParser p, DeserializationContext ctxt) throws IOException
{
// note: can not call `_delegateDeserializer()` since order rev... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public void addDelegatingCreator(AnnotatedWithParams creator, boolean explicit,
SettableBeanProperty[] injectables)
{
if (creator.getParameterType(0).... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public void addPropertyCreator(AnnotatedWithParams creator, boolean explicit,
SettableBeanProperty[] properties)
{
verifyNonDup(creator, C_PROPS, expl... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected void verifyNonDup(AnnotatedWithParams newOne, int typeIndex, boolean explicit)
{
final int mask = (1 << typeIndex);
_hasNonDefaultCreator = true... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public TokenBuffer deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException
{
copyCurrentStructure(jp);
/* 28-Oct-2014, tatu: As per... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public void remove(SettableBeanProperty propToRm)
{
ArrayList<SettableBeanProperty> props = new ArrayList<SettableBeanProperty>(_size);
String key = getPr... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public static StdKeyDeserializer forType(Class<?> raw)
{
int kind;
// first common types:
if (raw == String.class || raw == Object.class) {
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
Object writeReplace() {
// need to construct a fake instance to support serialization
if (_annotated != null) {
return this;
}
ret... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public void removeNonVisible(boolean inferMutators)
{
/* 07-Jun-2015, tatu: With 2.6, we will allow optional definition
* of explicit access type for pr... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected void _removeUnwantedAccessor(Map<String, POJOPropertyBuilder> props)
{
final boolean inferMutators = _config.isEnabled(MapperFeature.INFER_PROPERTY_MUTA... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected Object _deserializeTypedUsingDefaultImpl(JsonParser p, DeserializationContext ctxt,
TokenBuffer tb) throws IOException
{
// As per [JACKSON-... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@SuppressWarnings("unchecked")
public static EnumSerializer construct(Class<?> enumClass, SerializationConfig config,
BeanDescription beanDesc, JsonFormat.Val... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public JsonSerializer<?> createContextual(SerializerProvider serializers,
BeanProperty property) throws JsonMappingException
{
if (prope... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected static Boolean _isShapeWrittenUsingIndex(Class<?> enumClass,
JsonFormat.Value format, boolean fromClass)
{
JsonFormat.Shape shape = (format ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected Object deserializeUsingPropertyBasedWithUnwrapped(JsonParser p,
DeserializationContext ctxt)
throws IOException, JsonProcessingException
{
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public JsonDeserializer<Object> createBeanDeserializer(DeserializationContext ctxt,
JavaType type, BeanDescription beanDesc)
throws JsonMapp... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public JsonDeserializer<Object> createBeanDeserializer(DeserializationContext ctxt,
JavaType type, BeanDescription beanDesc)
throws JsonMapp... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@SuppressWarnings("incomplete-switch")
@Override
public JsonSerializer<?> createContextual(SerializerProvider provider,
BeanProperty property)
thr... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public ObjectIdInfo findObjectReferenceInfo(Annotated ann, ObjectIdInfo objectIdInfo) {
JsonIdentityReference ref = _findAnnotation(ann, JsonIdentityRef... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
x
// Test Case
[/INST]
public void testIssue1607() throws Exception
{
String json = MAPPER.writeValueAsString(new ReallyAlwaysContainer());
assertEquals(... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected void verifyNonDup(AnnotatedWithParams newOne, int typeIndex, boolean explicit)
{
final int mask = (1 << typeIndex);
_hasNonDefaultCreator = true... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public Collection<NamedType> collectAndResolveSubtypesByClass(MapperConfig<?> config,
AnnotatedMember property, JavaType baseType)
{
fi... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public Collection<NamedType> collectAndResolveSubtypesByTypeId(MapperConfig<?> config,
AnnotatedMember property, JavaType baseType)
{
f... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public JavaType refineSerializationType(final MapperConfig<?> config,
final Annotated a, final JavaType baseType) throws JsonMappingException
{
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public JavaType refineDeserializationType(final MapperConfig<?> config,
final Annotated a, final JavaType baseType) throws JsonMappingException
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected void addBeanProps(DeserializationContext ctxt,
BeanDescription beanDesc, BeanDeserializerBuilder builder)
throws JsonMappingException
{
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public T deserialize(JsonParser p, DeserializationContext ctxt) throws IOException
{
// 22-Sep-2012, tatu: For 2.1, use this new method, may force coercion:
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
x
// Test Case
[/INST]
public void testBasePropertiesIncludedWhenSerializingSubWhenSubTypeLoadedAfterBaseType() throws IOException {
TypeFactory tf = TypeFactory.def... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public JsonSerializer<?> createContextual(SerializerProvider serializers,
BeanProperty property) throws JsonMappingException
{
if (property == null) {... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
x
// Test Case
[/INST]
public void testSuperClassWithReferencedJavaType() {
TypeFactory tf = objectMapper().getTypeFactory();
tf.constructType(Base.class); /... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
x
// Test Case
[/INST]
public void testDateUtilISO8601NoTimezoneNonDefault() throws Exception
{
// In first case, no timezone -> SHOULD use configured timezone
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected JavaType _typeFromId(String id, DatabindContext ctxt) throws IOException
{
/* 30-Jan-2010, tatu: Most ids are basic class names; so let's first
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
x
// Test Case
[/INST]
public void testJDKTypes1737() throws Exception
{
_testTypes1737(java.util.logging.FileHandler.class);
_testTypes1737(java.rmi.ser... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public void serialize(Object value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
String str;
if (value instanceof Date) {
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public boolean canInstantiate() {
return canCreateUsingDefault()
|| canCreateUsingDelegate()
|| canCreateFromObjectWith() || canCreat... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
x
// Test Case
[/INST]
public void testDelegatingArray1804() throws Exception {
ObjectMapper mapper = new ObjectMapper();
MyType thing = mapper.readValue("[]... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private boolean _hasCustomHandlers(JavaType t) {
if (t.isContainerType()) {
// First: value types may have both value and type handlers
JavaTy... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
x
// Test Case
[/INST]
public void testJDKTypes1737() throws Exception
{
_testTypes1737(java.util.logging.FileHandler.class);
_testTypes1737(java.rmi.ser... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public void validateSubType(DeserializationContext ctxt, JavaType type) throws JsonMappingException
{
// There are certain nasty classes that could cause problems... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public void validateSubType(DeserializationContext ctxt, JavaType type) throws JsonMappingException
{
// There are certain nasty classes that could cause problems... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected JavaType parseType(MyTokenizer tokens)
throws IllegalArgumentException
{
if (!tokens.hasMoreTokens()) {
throw _problem(tokens, "Unex... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public JavaType constructSpecializedType(JavaType baseType, Class<?> subclass)
{
// simple optimization to avoid costly introspection if type-erased type does NOT... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public JavaType constructParametricType(Class<?> parametrized, Class<?>... parameterClasses) {
int len = parameterClasses.length;
JavaType[] pt = new JavaType... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected void _addExplicitAnyCreator(DeserializationContext ctxt,
BeanDescription beanDesc, CreatorCollector creators,
CreatorCandidate candidate)
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public final void serialize(JsonGenerator gen, SerializerProvider ctxt) throws IOException
{
if (_value == null) {
ctxt.defaultSerializeNull(gen);
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Object complete(JsonParser p, DeserializationContext ctxt,
PropertyValueBuffer buffer, PropertyBasedCreator creator)
throws IOException
{
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected String buildCanonicalName()
{
StringBuilder sb = new StringBuilder();
sb.append(_class.getName());
sb.append('<');
sb.append(_re... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public JsonToken nextToken() throws IOException
{
_binaryValue = null;
if (_nextToken != null) {
JsonToken t = _nextToken;
_currTo... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private final int _next() throws XMLStreamException
{
switch (_currentState) {
case XML_ATTRIBUTE_VALUE:
++_nextAttributeIndex;
//... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public String nextTextValue() throws IOException
{
_binaryValue = null;
if (_nextToken != null) {
JsonToken t = _nextToken;
_currT... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected void _serializeXmlNull(JsonGenerator jgen) throws IOException
{
// 14-Nov-2016, tatu: As per [dataformat-xml#213], we may have explicitly
// ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected XmlSerializerProvider(XmlSerializerProvider src) {
super(src);
// 21-May-2018, tatu: As per [dataformat-xml#282], should NOT really copy
// ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
x
// Test Case
[/INST]
public void testWith0Bytes() throws Exception
{
String xml = MAPPER.writeValueAsString(createPojo());
assertEquals("<TestPojo><fi... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private void normalise(Element element) {
List<Node> toMove = new ArrayList<Node>();
for (Node node: element.childNodes) {
if (node instanceof Tex... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public String absUrl(String attributeKey) {
Validate.notEmpty(attributeKey);
String relUrl = attr(attributeKey);
if (!hasAttr(attributeKey)) {
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private Elements select() {
tq.consumeWhitespace();
if (tq.matchesAny(combinators)) { // if starts with a combinator, use root as elements
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private Elements findElements() {
if (tq.matchChomp("#")) {
return byId();
} else if (tq.matchChomp(".")) {
return byClass();
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void notAll() {
Document doc = Jsoup.parse("<p>Two</p> <p><span>Three</span></p>");
Elements el1 = doc.body().select(":n... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void notAll() {
Document doc = Jsoup.parse("<p>Two</p> <p><span>Three</span></p>");
Elements el1 = doc.body().select(":n... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private Elements select() {
tq.consumeWhitespace();
if (tq.matchesAny(combinators)) { // if starts with a combinator, use root as elements
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public boolean hasAttr(String attributeKey) {
Validate.notNull(attributeKey);
return attributes.hasKey(attributeKey);
}
// Test Case
[/INST]
@Test p... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void parsesUnterminatedTextarea() {
// don't parse right to end, but break on <p>
Document doc = Jsoup.parse("<body><p><t... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
void read(Tokeniser t, CharacterReader r) {
if (r.matches('/')) {
t.createTempBuffer();
t.advanceTransition(RCDATAEndTagOpen);... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
boolean process(Token t, TreeBuilder tb) {
switch (t.type) {
case Character: {
Token.Character c = t.asCharacter();
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public DocumentType(String name, String publicId, String systemId, String baseUri) {
super(baseUri);
attr("name", name);
attr("publicId", publicId);
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
void outerHtmlHead(StringBuilder accum, int depth, Document.OutputSettings out) {
accum.append("<!DOCTYPE html");
if (!StringUtil.isBlank(attr("... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
CharacterReader(String input) {
Validate.notNull(input);
this.input = input;
this.length = input.length();
}
// Test Case
[/INST]
@Test publ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private boolean testValidProtocol(Element el, Attribute attr, Set<Protocol> protocols) {
// try to resolve relative urls to abs, and optionally update the attribute s... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private void parseStartTag() {
tq.consume("<");
String tagName = tq.consumeWord();
if (tagName.length() == 0) { // doesn't look like a start tag afte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.