id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
45,901 | Marker marker_ = builder_.mark();
enterErrorRecordingSection(builder_, level_, _SECTION_RECOVER_, null);
result_ = consumeToken(builder_, EXPRESSION_START);</BUG>
pinned_ = result_; // pin = 1
result_ = result_ && report_error_(builder_, rootElement(builder_, level_ + 1));
<BUG>result_ = pinned_ && consumeToken(builder_, EXPRESSION_END) && result_;
if (!result_ && !pinned_) {
marker_.rollbackTo();
}
else {
marker_.drop();
}
result_ = exitErrorRecordingSection(builder_, level_, result_, pinned_, _SECTION_RECOVER_, rootRecover_parser_);</BUG>
return result_ || pinned_;
| boolean result_ = false;
Marker marker_ = enter_section_(builder_);
result_ = consumeToken(builder_, DOT);
result_ = result_ && consumeToken(builder_, IDENTIFIER);
exit_section_(builder_, marker_, null, result_);
return result_;
|
45,902 | return expression(builder_, level_ + 1, -1);
}</BUG>
static boolean rootRecover(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "rootRecover")) return false;
<BUG>boolean result_ = false;
Marker marker_ = builder_.mark();
enterErrorRecordingSection(builder_, level_, _SECTION_NOT_, null);
result_ = !consumeToken(builder_, EXPRESSION_END);
marker_.rollbackTo();
result_ = exitErrorRecordingSection(builder_, level_, result_, false, _SECTION_NOT_, null);</BUG>
return result_;
| Marker marker_ = enter_section_(builder_);
result_ = consumeToken(builder_, DOT);
result_ = result_ && consumeToken(builder_, IDENTIFIER);
exit_section_(builder_, marker_, null, result_);
|
45,903 | enterErrorRecordingSection(builder_, level_, _SECTION_GENERAL_, "<method call expression>");</BUG>
result_ = referenceExpression(builder_, level_ + 1);
result_ = result_ && consumeToken(builder_, LPARENTH);
pinned_ = result_; // pin = 2
result_ = result_ && report_error_(builder_, methodCallParameters(builder_, level_ + 1));
<BUG>result_ = pinned_ && consumeToken(builder_, RPARENTH) && result_;
if (result_ || pinned_) {
marker_.done(METHOD_CALL_EXPRESSION);
}
else {
marker_.rollbackTo();
}
result_ = exitErrorRecordingSection(builder_, level_, result_, pinned_, _SECTION_GENERAL_, null);</BUG>
return result_ || pinned_;
| boolean result_ = false;
Marker marker_ = enter_section_(builder_);
result_ = consumeToken(builder_, DOT);
result_ = result_ && consumeToken(builder_, IDENTIFIER);
exit_section_(builder_, marker_, null, result_);
return result_;
|
45,904 | Assert.assertEquals(msg, result2);
}
@Test
public void testAsciiConverter() {
HttpResponse response = createOkResponse();
<BUG>byte[] payload = parser.marshalToBytes(response);
</BUG>
ConvertAscii converter = new ConvertAscii();
String readableForm = converter.convertToReadableForm(payload);
Assert.assertEquals(
| byte[] payload = unwrap(parser.marshalToByteBuffer(response));
|
45,905 | Assert.assertEquals(response, httpMessage);
}
@Test
public void test2AndHalfHttpMessages() {
HttpResponse response = createOkResponse();
<BUG>byte[] payload = parser.marshalToBytes(response);
</BUG>
byte[] first = new byte[2*payload.length + 20];
byte[] second = new byte[payload.length - 20];
System.arraycopy(payload, 0, first, 0, payload.length);
| byte[] payload = unwrap(parser.marshalToByteBuffer(response));
|
45,906 | DataWrapper payload1 = dataGen.wrapByteArray("0123456789".getBytes());
HttpChunk chunk = new HttpChunk();
chunk.addExtension(new HttpChunkExtension("asdf", "value"));
chunk.addExtension(new HttpChunkExtension("something"));
chunk.setBody(payload1);
<BUG>byte[] payload = parser.marshalToBytes(chunk);
</BUG>
String str = new String(payload);
Assert.assertEquals("a;asdf=value;something\r\n0123456789\r\n", str);
HttpLastChunk lastChunk = new HttpLastChunk();
| byte[] payload = unwrap(parser.marshalToByteBuffer(chunk));
|
45,907 | HttpLastChunk lastChunk = new HttpLastChunk();
lastChunk.addExtension(new HttpChunkExtension("this", "that"));
lastChunk.addHeader(new Header("customer", "value"));
String lastPayload = parser.marshalToString(lastChunk);
Assert.assertEquals("0;this=that\r\ncustomer: value\r\n\r\n", lastPayload);
<BUG>byte[] lastBytes = parser.marshalToBytes(lastChunk);
</BUG>
String lastPayloadFromBytes = new String(lastBytes, HttpParserFactory.iso8859_1);
Assert.assertEquals("0;this=that\r\ncustomer: value\r\n\r\n", lastPayloadFromBytes);
}
| byte[] lastBytes = unwrap(parser.marshalToByteBuffer(lastChunk));
|
45,908 | import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
<BUG>import org.slf4j.Logger;
import org.slf4j.LoggerFactory;</BUG>
import org.webpieces.data.api.BufferPool;
import org.webpieces.data.api.DataWrapper;
import org.webpieces.data.api.DataWrapperGenerator;
| [DELETED] |
45,909 | import java.nio.ByteBuffer;
import org.webpieces.data.api.DataWrapper;
import org.webpieces.httpparser.api.dto.HttpPayload;
public interface HttpParser {
ByteBuffer marshalToByteBuffer(HttpPayload request);
<BUG>byte[] marshalToBytes(HttpPayload request);</BUG>
String marshalToString(HttpPayload request);
Memento prepareToParse();
Memento parse(Memento state, DataWrapper moreData);
HttpPayload unmarshal(byte[] msg);
}
| [DELETED] |
45,910 | HttpRequestLine requestLine = new HttpRequestLine();
requestLine.setMethod(KnownHttpMethod.GET);
requestLine.setUri(new HttpUri("http://www.deano.com"));
HttpRequest req = new HttpRequest();
req.setRequestLine(requestLine);
<BUG>byte[] array = parser.marshalToBytes(req);
</BUG>
ByteBuffer buffer = ByteBuffer.wrap(array);
dataListener.incomingData(mockTcpChannel, ByteBuffer.allocate(0));
dataListener.incomingData(mockTcpChannel, buffer);
| byte[] array = unwrap(parser.marshalToByteBuffer(req));
|
45,911 | Assert.assertEquals(msg, result2);
}
@Test
public void testAsciiConverter() {
HttpRequest request = createPostRequest();
<BUG>byte[] payload = parser.marshalToBytes(request);
</BUG>
ConvertAscii converter = new ConvertAscii();
String readableForm = converter.convertToReadableForm(payload);
String expected = "POST\\s http://myhost.com\\s HTTP/1.1\\r\\n\r\n"
| byte[] payload = unwrap(parser.marshalToByteBuffer(request));
|
45,912 | Assert.assertEquals(request, httpMessage);
}
@Test
public void test2AndHalfHttpMessages() {
HttpRequest request = createPostRequest();
<BUG>byte[] payload = parser.marshalToBytes(request);
</BUG>
byte[] first = new byte[2*payload.length + 20];
byte[] second = new byte[payload.length - 20];
System.arraycopy(payload, 0, first, 0, payload.length);
| byte[] payload = unwrap(parser.marshalToByteBuffer(request));
|
45,913 | if ( falseStepname.length() == 0 ) {
falseStepname = null;
}
List<StreamInterface> targetStreams = input.getStepIOMeta().getTargetStreams();
targetStreams.get( 0 ).setStepMeta( transMeta.findStep( trueStepname ) );
<BUG>targetStreams.get( 1 ).setStepMeta( transMeta.findStep( falseStepname ) );
stepname = wStepname.getText(); // return value</BUG>
input.setCondition( condition );
dispose();
}
| input.setTrueStepname( trueStepname );
input.setFalseStepname( falseStepname );
stepname = wStepname.getText(); // return value
|
45,914 | import org.pentaho.di.core.KettleEnvironment;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.plugins.PluginRegistry;
import org.pentaho.di.trans.steps.loadsave.LoadSaveTester;
import org.pentaho.di.trans.steps.loadsave.validator.ConditionLoadSaveValidator;
<BUG>import org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator;
public class FilterRowsMetaTest {</BUG>
LoadSaveTester loadSaveTester;
Class<FilterRowsMeta> testMetaClass = FilterRowsMeta.class;
@Before
| import org.pentaho.di.trans.steps.loadsave.validator.StringLoadSaveValidator;
public class FilterRowsMetaTest {
|
45,915 | if ( super.init( smi, sdi ) ) {
meta.getCondition().clearFieldPositions();
List<StreamInterface> targetStreams = meta.getStepIOMeta().getTargetStreams();
data.trueStepname = targetStreams.get( 0 ).getStepname();
data.falseStepname = targetStreams.get( 1 ).getStepname();
<BUG>meta.setTrueStepname( data.trueStepname );
meta.setFalseStepname( data.falseStepname );</BUG>
data.chosesTargetSteps =
targetStreams.get( 0 ).getStepMeta() != null || targetStreams.get( 1 ).getStepMeta() != null;
return true;
| [DELETED] |
45,916 | return retval.toString();
}
private void readData( Node stepnode ) throws KettleXMLException {
try {
List<StreamInterface> targetStreams = getStepIOMeta().getTargetStreams();
<BUG>targetStreams.get( 0 ).setSubject( XMLHandler.getTagValue( stepnode, "send_true_to" ) );
targetStreams.get( 1 ).setSubject( XMLHandler.getTagValue( stepnode, "send_false_to" ) );
this.trueStepname = targetStreams.get( 0 ).getStepname();
this.falseStepname = targetStreams.get( 1 ).getStepname();
Node compare = XMLHandler.getSubNode( stepnode, "compare" );</BUG>
Node condnode = XMLHandler.getSubNode( compare, "condition" );
| String trueStepName = XMLHandler.getTagValue( stepnode, "send_true_to" );
String falseStepName = XMLHandler.getTagValue( stepnode, "send_false_to" );
targetStreams.get( 0 ).setSubject( trueStepName );
targetStreams.get( 1 ).setSubject( falseStepName );
this.trueStepname = trueStepName;
this.falseStepname = falseStepName;
Node compare = XMLHandler.getSubNode( stepnode, "compare" );
|
45,917 | if (connect(isProducer)) {
break;
}
} catch (InvalidSelectorException e) {
throw new ConnectionException(
<BUG>"Connection to JMS failed. Invalid message selector");
} catch (JMSException | NamingException e) {
logger.log(LogLevel.ERROR, "RECONNECTION_EXCEPTION",
</BUG>
new Object[] { e.toString() });
| Messages.getString("CONNECTION_TO_JMS_FAILED_INVALID_MSG_SELECTOR")); //$NON-NLS-1$
logger.log(LogLevel.ERROR, "RECONNECTION_EXCEPTION", //$NON-NLS-1$
|
45,918 | private synchronized void createConnectionNoRetry() throws ConnectionException {
if (!isConnectValid()) {
try {
connect(isProducer);
} catch (JMSException e) {
<BUG>logger.log(LogLevel.ERROR, "Connection to JMS failed", new Object[] { e.toString() });
throw new ConnectionException(
"Connection to JMS failed. Did not try to reconnect as the policy is reconnection policy does not apply here.");
}</BUG>
}
| logger.log(LogLevel.ERROR, "CONNECTION_TO_JMS_FAILED", new Object[] { e.toString() }); //$NON-NLS-1$
Messages.getString("CONNECTION_TO_JMS_FAILED_NO_RECONNECT_AS_RECONNECT_POLICY_DOES_NOT_APPLY")); //$NON-NLS-1$
|
45,919 | boolean res = false;
int count = 0;
do {
try {
if(count > 0) {
<BUG>logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count });
</BUG>
Thread.sleep(messageRetryDelay);
}
synchronized (getSession()) {
| logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count }); //$NON-NLS-1$
|
45,920 | getProducer().send(message);
res = true;
}
}
catch (JMSException e) {
<BUG>logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() });
logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT");
</BUG>
setConnect(null);
| logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() }); //$NON-NLS-1$
logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT"); //$NON-NLS-1$
|
45,921 | import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import com.ibm.streams.operator.Attribute;
import com.ibm.streams.operator.StreamSchema;
import com.ibm.streams.operator.Type;
<BUG>import com.ibm.streams.operator.Type.MetaType;
class ConnectionDocumentParser {</BUG>
private static final Set<String> supportedSPLTypes = new HashSet<String>(Arrays.asList("int8", "uint8", "int16", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"uint16", "int32", "uint32", "int64", "float32", "float64", "boolean", "blob", "rstring", "uint64", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
"decimal32", "decimal64", "decimal128", "ustring", "timestamp", "xml")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
| import com.ibm.streamsx.messaging.jms.Messages;
class ConnectionDocumentParser {
|
45,922 | return msgClass;
}
private void convertProviderURLPath(File applicationDir) throws ParseConnectionDocumentException {
if(!isAMQ()) {
if(this.providerURL == null || this.providerURL.trim().length() == 0) {
<BUG>throw new ParseConnectionDocumentException("A value must be specified for provider_url attribute in connection document");
}</BUG>
try {
URL url = new URL(providerURL);
if("file".equalsIgnoreCase(url.getProtocol())) { //$NON-NLS-1$
| throw new ParseConnectionDocumentException(Messages.getString("PROVIDER_URL_MUST_BE_SPECIFIED_IN_CONN_DOC")); //$NON-NLS-1$
|
45,923 | URL absProviderURL = new URL(url.getProtocol(), url.getHost(), applicationDir.getAbsolutePath() + File.separator + path);
this.providerURL = absProviderURL.toExternalForm();
}
}
} catch (MalformedURLException e) {
<BUG>throw new ParseConnectionDocumentException("Invalid provider_url value detected: " + e.getMessage());
}</BUG>
}
}
public void parseAndValidateConnectionDocument(String connectionDocument, String connection, String access,
| throw new ParseConnectionDocumentException(Messages.getString("INVALID_PROVIDER_URL", e.getMessage())); //$NON-NLS-1$
|
45,924 | for (int j = 0; j < accessSpecChildNodes.getLength(); j++) {
if (accessSpecChildNodes.item(j).getNodeName().equals("destination")) { //$NON-NLS-1$
destIndex = j;
} else if (accessSpecChildNodes.item(j).getNodeName().equals("uses_connection")) { //$NON-NLS-1$
if (!connection.equals(accessSpecChildNodes.item(j).getAttributes().getNamedItem("connection") //$NON-NLS-1$
<BUG>.getNodeValue())) {
throw new ParseConnectionDocumentException("The value of the connection parameter "
+ connection + " is not the same as the connection used by access element "
+ access + " as mentioned in the uses_connection element in connections document");</BUG>
}
| throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_CONNECTION_PARAM_NOT_THE_SAME_AS_CONN_USED_BY_ACCESS_ELEMENT", connection, access )); //$NON-NLS-1$
|
45,925 | nativeSchema = access_specification.item(i).getChildNodes().item(nativeSchemaIndex);
}
break;
}
}
<BUG>if (!accessFound) {
throw new ParseConnectionDocumentException("The value of the access parameter " + access
+ " is not found in the connections document");</BUG>
}
return nativeSchema;
| throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_ACCESS_PARAM_NOT_FOUND_IN_CONN_DOC", access )); //$NON-NLS-1$
|
45,926 | nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$
.getNodeValue()));
}
if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22)
&& ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema
<BUG>.getAttribute(nativeAttrName).getType().getMetaType() == Type.MetaType.BLOB))) {
throw new ParseConnectionDocumentException(" Blob data type is not supported for message class "
+ msgClass);</BUG>
}
Iterator<NativeSchema> it = nativeSchemaObjects.iterator();
| throw new ParseConnectionDocumentException(Messages.getString("BLOB_NOT_SUPPORTED_FOR_MSG_CLASS", msgClass)); //$NON-NLS-1$
|
45,927 | throw new ParseConnectionDocumentException(" Blob data type is not supported for message class "
+ msgClass);</BUG>
}
Iterator<NativeSchema> it = nativeSchemaObjects.iterator();
while (it.hasNext()) {
<BUG>if (it.next().getName().equals(nativeAttrName)) {
throw new ParseConnectionDocumentException("Parameter name: " + nativeAttrName
+ " is appearing more than once In native schema file");</BUG>
}
}
| nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$
.getNodeValue()));
if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22)
&& ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema
.getAttribute(nativeAttrName).getType().getMetaType() == Type.MetaType.BLOB))) {
throw new ParseConnectionDocumentException(Messages.getString("BLOB_NOT_SUPPORTED_FOR_MSG_CLASS", msgClass)); //$NON-NLS-1$
throw new ParseConnectionDocumentException(Messages.getString("PARAMETER_NOT_UNIQUE_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
|
45,928 | if (msgClass == MessageClass.text) {
typesWithLength = new HashSet<String>(Arrays.asList("Bytes")); //$NON-NLS-1$
}
Set<String> typesWithoutLength = new HashSet<String>(Arrays.asList("Byte", "Short", "Int", "Long", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"Float", "Double", "Boolean")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
<BUG>if (typesWithoutLength.contains(nativeAttrType) && nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) {
throw new ParseConnectionDocumentException("Length attribute should not be present for parameter: "
+ nativeAttrName + " In native schema file");</BUG>
}
if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA)
| throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
|
45,929 | if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA)
&& (msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22 || msgClass == MessageClass.xml)
&& (streamSchema.getAttribute(nativeAttrName) != null)
&& (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.RSTRING)
&& (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.USTRING)
<BUG>&& (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.BLOB)) {
throw new ParseConnectionDocumentException("Length attribute should not be present for parameter: "
+ nativeAttrName + " In native schema file");</BUG>
}
if (streamSchema.getAttribute(nativeAttrName) != null) {
| throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
|
45,930 | if (streamSchema.getAttribute(nativeAttrName) != null) {
MetaType metaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if (metaType == Type.MetaType.DECIMAL32 || metaType == Type.MetaType.DECIMAL64
|| metaType == Type.MetaType.DECIMAL128 || metaType == Type.MetaType.TIMESTAMP) {
if (nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) {
<BUG>throw new ParseConnectionDocumentException(
"Length attribute should not be present for parameter: " + nativeAttrName
+ " with type " + metaType + " in native schema file.");</BUG>
}
if (msgClass == MessageClass.bytes) {
| Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_WITH_TYPE_IN_NATIVE_SCHEMA", nativeAttrName, metaType )); //$NON-NLS-1$
|
45,931 | nativeAttrLength = -4;
}
}
}
if (typesWithLength.contains(nativeAttrType)) {
<BUG>if (nativeAttrLength == LENGTH_ABSENT_IN_NATIVE_SCHEMA && msgClass == MessageClass.bytes) {
throw new ParseConnectionDocumentException("Length attribute should be present for parameter: "
+ nativeAttrName + " In native schema file for message class bytes");</BUG>
}
if ((nativeAttrLength < 0) && nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) {
| throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA_FOR_MSG_CLASS_BYTES", nativeAttrName )); //$NON-NLS-1$
|
45,932 | if (streamSchema.getAttribute(nativeAttrName) != null) {
streamAttrName = streamSchema.getAttribute(nativeAttrName).getName();
streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if ((msgClass == MessageClass.stream || msgClass == MessageClass.map)
&& !mapSPLToNativeSchemaDataTypesForOtherMsgClass.get(streamAttrMetaType.getLanguageType())
<BUG>.equals(nativeAttrType)) {
throw new ParseConnectionDocumentException("Attribute Name: " + nativeAttrName + " with type:"
+ nativeAttrType + " in the native schema cannot be mapped with attribute: "
+ streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG>
}
| throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
|
45,933 | + nativeAttrType + " in the native schema cannot be mapped with attribute: "
+ streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG>
}
else if (msgClass == MessageClass.bytes
&& !mapSPLToNativeSchemaDataTypesForBytes.get(streamAttrMetaType.getLanguageType()).equals(
<BUG>nativeAttrType)) {
throw new ParseConnectionDocumentException("Attribute Name: " + nativeAttrName + " with type:"
+ nativeAttrType + " in the native schema cannot be mapped with attribute: "
+ streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG>
}
| if (streamSchema.getAttribute(nativeAttrName) != null) {
streamAttrName = streamSchema.getAttribute(nativeAttrName).getName();
streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if ((msgClass == MessageClass.stream || msgClass == MessageClass.map)
&& !mapSPLToNativeSchemaDataTypesForOtherMsgClass.get(streamAttrMetaType.getLanguageType())
.equals(nativeAttrType)) {
throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
|
45,934 | package com.ibm.streamsx.messaging.i18n;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
<BUG>private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.mqtt.MQTTMessages"; //$NON-NLS-1$
</BUG>
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
private Messages() {
| private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.i18n.CommonMessages"; //$NON-NLS-1$
|
45,935 | context.setAuthCache(authCache);
ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine(httpclient, context);
ResteasyClient client = new ResteasyClientBuilder().httpEngine(engine).build();
client.register(JacksonJaxbJsonProvider.class);
client.register(JacksonObjectMapperProvider.class);
<BUG>client.register(RequestLogger.class);
client.register(ResponseLogger.class);
</BUG>
ProxyBuilder<T> proxyBuilder = client.target(uri).proxyBuilder(apiClassType);
| client.register(RestRequestFilter.class);
client.register(RestResponseFilter.class);
|
45,936 | import org.hawkular.alerts.api.model.condition.Condition;
import org.hawkular.inventory.api.model.CanonicalPath;
import org.hawkular.inventory.api.model.Tenant;
import org.hawkular.inventory.json.DetypedPathDeserializer;
import org.hawkular.inventory.json.InventoryJacksonConfig;
<BUG>import org.hawkular.inventory.json.mixins.CanonicalPathMixin;
</BUG>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.core.JsonParseException;
| import org.hawkular.inventory.json.mixins.model.CanonicalPathMixin;
|
45,937 | package com.projecttango.examples.java.augmentedreality;
import com.google.atap.tangoservice.Tango;
import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoCameraIntrinsics;
import com.google.atap.tangoservice.TangoConfig;
<BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoEvent;</BUG>
import com.google.atap.tangoservice.TangoOutOfDateException;
import com.google.atap.tangoservice.TangoPoseData;
import com.google.atap.tangoservice.TangoXyzIjData;
| import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
|
45,938 | super.onResume();
if (!mIsConnected) {
mTango = new Tango(AugmentedRealityActivity.this, new Runnable() {
@Override
public void run() {
<BUG>try {
connectTango();</BUG>
setupRenderer();
mIsConnected = true;
} catch (TangoOutOfDateException e) {
| TangoSupport.initialize();
connectTango();
|
45,939 | if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) {
mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics);
mCameraPoseTimestamp = lastFramePose.timestamp;</BUG>
} else {
<BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread);
}</BUG>
}
}
}
@Override
| mRenderer.updateRenderCameraPose(lastFramePose);
mCameraPoseTimestamp = lastFramePose.timestamp;
Log.w(TAG, "Can't get device pose at time: " +
|
45,940 | import org.rajawali3d.materials.Material;
import org.rajawali3d.materials.methods.DiffuseMethod;
import org.rajawali3d.materials.textures.ATexture;
import org.rajawali3d.materials.textures.StreamingTexture;
import org.rajawali3d.materials.textures.Texture;
<BUG>import org.rajawali3d.math.Matrix4;
import org.rajawali3d.math.vector.Vector3;</BUG>
import org.rajawali3d.primitives.ScreenQuad;
import org.rajawali3d.primitives.Sphere;
import org.rajawali3d.renderer.RajawaliRenderer;
| import org.rajawali3d.math.Quaternion;
import org.rajawali3d.math.vector.Vector3;
|
45,941 | translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);
translationMoon.setTransformable3D(moon);
getCurrentScene().registerAnimation(translationMoon);
translationMoon.play();
}
<BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {
Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics);
getCurrentCamera().setRotation(cameraPose.getOrientation());
getCurrentCamera().setPosition(cameraPose.getPosition());
}</BUG>
public int getTextureId() {
| public void updateRenderCameraPose(TangoPoseData cameraPose) {
float[] rotation = cameraPose.getRotationAsFloats();
float[] translation = cameraPose.getTranslationAsFloats();
Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);
getCurrentCamera().setRotation(quaternion.conjugate());
getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
|
45,942 | package com.projecttango.examples.java.helloareadescription;
import com.google.atap.tangoservice.Tango;
<BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoConfig;</BUG>
import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
| import com.google.atap.tangoservice.TangoAreaDescriptionMetaData;
import com.google.atap.tangoservice.TangoConfig;
|
45,943 | package com.infinityraider.agricraft.compat.computer.methods;
import com.infinityraider.agricraft.api.util.BlockWithMeta;
import net.minecraft.item.ItemStack;
<BUG>import com.infinityraider.agricraft.api.plant.IAgriPlant;
public class MethodGetBaseBlock extends MethodBaseGrowthReq {</BUG>
public MethodGetBaseBlock() {
super("getBaseBlock");
}
| import java.util.Optional;
public class MethodGetBaseBlock extends MethodBaseGrowthReq {
|
45,944 | @Override
protected Object[] onMethodCalled(IAgriPlant plant) {
if(plant==null) {
return null;
}
<BUG>BlockWithMeta block = plant.getGrowthRequirement().getRequiredBlock();
String msg = block==null?"null":(new ItemStack(block.getBlock(), 1, block.getMeta())).getDisplayName();
return new Object[] {msg};</BUG>
}
| [DELETED] |
45,945 | package com.infinityraider.agricraft.farming;
import com.infinityraider.agricraft.api.render.RenderMethod;
<BUG>import com.infinityraider.agricraft.api.requirment.IGrowthRequirement;
</BUG>
import com.infinityraider.agricraft.api.crop.IAdditionalCropData;
import com.google.common.base.Function;
import com.infinityraider.agricraft.farming.growthrequirement.GrowthRequirementHandler;
| import com.infinityraider.agricraft.api.requirement.IGrowthRequirement;
|
45,946 | if (recipe.getGrowthRequirement().getSoil() != null) {
builder.add(recipe.getGrowthRequirement().getSoil().toStack());
} else {
builder.add(new ItemStack(Blocks.DIRT));
}
<BUG>if (recipe.getGrowthRequirement().getRequiredBlock() != null) {
builder.add(recipe.getGrowthRequirement().getRequiredBlock().toStack());
</BUG>
}
| [DELETED] |
45,947 | package com.infinityraider.agricraft.api.util;
<BUG>import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
public class BlockWithMeta {</BUG>
private final Block block;
private final int meta;
| import net.minecraft.block.state.IBlockState;
import net.minecraftforge.oredict.OreDictionary;
public class BlockWithMeta {
|
45,948 | import net.minecraft.item.ItemStack;
public class BlockWithMeta {</BUG>
private final Block block;
private final int meta;
private final boolean ignoreMeta;
<BUG>private final boolean useOreDict;
public BlockWithMeta(Block block) {</BUG>
this(block, 0, true, false);
}
public BlockWithMeta(Block block, int meta) {
| import net.minecraftforge.oredict.OreDictionary;
public class BlockWithMeta {
public BlockWithMeta(IBlockState state) {
this(state.getBlock(), state.getBlock().getMetaFromState(state));
public BlockWithMeta(Block block) {
|
45,949 | public ItemStack toStack() {
return new ItemStack(this.block, 1, this.meta);
}
@Override
public String toString() {
<BUG>return Block.REGISTRY.getNameForObject(this.block)+":"+this.meta;
</BUG>
}
@Override
public boolean equals(Object obj) {
| return Block.REGISTRY.getNameForObject(this.block) + ":" + this.meta;
|
45,950 | package com.infinityraider.agricraft.compat.computer.methods;
<BUG>import com.infinityraider.agricraft.api.requirment.RequirementType;
</BUG>
import com.infinityraider.agricraft.api.plant.IAgriPlant;
public class MethodNeedsBaseBlock extends MethodBaseGrowthReq {
public MethodNeedsBaseBlock() {
| import com.infinityraider.agricraft.api.requirement.RequirementType;
|
45,951 | package com.infinityraider.agricraft.compat.computer.methods;
<BUG>import com.infinityraider.agricraft.api.plant.IAgriPlant;
public class MethodGetBaseBlockType extends MethodBaseGrowthReq {</BUG>
public MethodGetBaseBlockType() {
super("getBaseBlockType");
}
| import com.infinityraider.agricraft.api.requirement.RequirementType;
public class MethodGetBaseBlockType extends MethodBaseGrowthReq {
|
45,952 | this.plant.getRequirement().getBases().forEach((b) -> {
if (b instanceof ItemStack) {
ItemStack stack = (ItemStack) b;
if (stack.getItem() instanceof ItemBlock) {
ItemBlock ib = (ItemBlock) stack.getItem();
<BUG>builder.addRequiredBlock(new BlockWithMeta(ib.block, ib.getMetadata(stack)), RequirementType.BELOW);
}</BUG>
}
});
| builder.setRequiredBlock(new BlockWithMeta(ib.block, ib.getMetadata(stack)));
builder.setRequiredType(RequirementType.BELOW);
|
45,953 | this.plant.getRequirement().getNearby().forEach((obj, dist) -> {
if (obj instanceof ItemStack) {
ItemStack stack = (ItemStack) obj;
if (stack.getItem() instanceof ItemBlock) {
ItemBlock ib = (ItemBlock) stack.getItem();
<BUG>builder.addRequiredBlock(new BlockWithMeta(ib.block, ib.getMetadata(stack)), RequirementType.BELOW);
}</BUG>
}
});
| builder.setRequiredBlock(new BlockWithMeta(ib.block, ib.getMetadata(stack)));
builder.setRequiredType(RequirementType.NEARBY);
|
45,954 | package com.infinityraider.agricraft.api.plant;
import com.google.common.base.Function;
import com.infinityraider.agricraft.api.crop.IAgriCrop;
import com.infinityraider.agricraft.api.crop.IAdditionalCropData;
<BUG>import com.infinityraider.agricraft.api.requirment.IGrowthRequirement;
</BUG>
import com.infinityraider.agricraft.api.render.RenderMethod;
import java.util.Collection;
import net.minecraft.block.Block;
| import com.infinityraider.agricraft.api.requirement.IGrowthRequirement;
|
45,955 | import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
<BUG>import com.infinityraider.agricraft.api.requirment.IGrowthRequirement;
</BUG>
import com.infinityraider.agricraft.api.plant.IAgriPlant;
import com.infinityraider.agricraft.api.mutation.IAgriMutation;
public class MutationRecipeWrapper implements IRecipeWrapper {
| import com.infinityraider.agricraft.api.requirement.IGrowthRequirement;
|
45,956 | if (rec.getSoil() != null) {
builder.add(rec.getSoil().toStack());
} else {
builder.add(new ItemStack(Blocks.DIRT));
}
<BUG>if (rec.getRequiredBlock() != null) {
builder.add(rec.getRequiredBlock().toStack());
</BUG>
}
| [DELETED] |
45,957 | import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
<BUG>import org.jasig.portal.services.SequenceGenerator;
import org.xml.sax.Attributes;</BUG>
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
class DataHandler extends DefaultHandler
| import org.jasig.portal.utils.XML;
import org.xml.sax.Attributes;
|
45,958 | else if (action.equals("modify"))
executeSQL(table, row, "modify");
else if (action.equals("add"))
executeSQL(table, row, "insert");
}
<BUG>else if (config.getPopulateTables())
executeSQL(table, row, "insert");
}</BUG>
}
| else if (config.getPopulateTables()) {
} else if (config.getCreateScript()) {
dumpSQL(table, row, "insert");
|
45,959 | sb.append(sql.substring(startPos));
return sb.toString();
}
}
}
<BUG>private void executeSQL (Table table, Row row, String action)
</BUG>
{
if (config.getScriptWriter() != null)
{
| private void dumpSQL(Table table, Row row, String action)
|
45,960 | config.getScriptWriter().println(prepareDeleteStatement(row, false) + config.getStatementTerminator());
else if (action.equals("modify"))
config.getScriptWriter().println(prepareUpdateStatement(row) + config.getStatementTerminator());
else if (action.equals("insert"))
config.getScriptWriter().println(prepareInsertStatement(row, false) + config.getStatementTerminator());
<BUG>}
if (supportsPreparedStatements)</BUG>
{
String preparedStatement = "";
PreparedStatement pstmt = null;
| private void executeSQL (Table table, Row row, String action)
dumpSQL(table, row, action);
if (supportsPreparedStatements)
|
45,961 | import org.jasig.portal.utils.XSLT;
import org.springframework.dao.DataAccessException;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
<BUG>import org.xml.sax.XMLReader;
public class DbLoader</BUG>
{
private Configuration config = null;
public DbLoader(Configuration c)
| import org.xml.sax.helpers.DefaultHandler;
public class DbLoader
|
45,962 | private static final String DATASET_CAPACITY_TABLE = "dataset_capacity";
private static final String DATASET_TAG_TABLE = "dataset_tag";
private static final String DATASET_CASE_SENSITIVE_TABLE = "dataset_case_sensitivity";
private static final String DATASET_REFERENCE_TABLE = "dataset_reference";
private static final String DATASET_PARTITION_TABLE = "dataset_partition";
<BUG>private static final String DATASET_SECURITY_TABLE = "dataset_security";
</BUG>
private static final String DATASET_OWNER_TABLE = "dataset_owner";
private static final String DATASET_OWNER_UNMATCHED_TABLE = "stg_dataset_owner_unmatched";
private static final String DATASET_CONSTRAINT_TABLE = "dataset_constraint";
| private static final String DATASET_SECURITY_TABLE = "dataset_security_info";
|
45,963 | throw new IllegalArgumentException(
"Dataset deployment info update fail, " + "Json missing necessary fields: " + root.toString());
</BUG>
}
<BUG>final Object[] idUrn = findIdAndUrn(idNode, urnNode);
final Integer datasetId = (Integer) idUrn[0];</BUG>
final String urn = (String) idUrn[1];
ObjectMapper om = new ObjectMapper();
for (final JsonNode deploymentInfo : deployment) {
DatasetDeploymentRecord record = om.convertValue(deploymentInfo, DatasetDeploymentRecord.class);
| "Dataset deployment info update error, missing necessary fields: " + root.toString());
final Object[] idUrn = findDataset(root);
if (idUrn[0] == null || idUrn[1] == null) {
throw new IllegalArgumentException("Cannot identify dataset from id/uri/urn: " + root.toString());
final Integer datasetId = (Integer) idUrn[0];
|
45,964 | rec.setModifiedTime(System.currentTimeMillis() / 1000);
if (datasetId == 0) {
DatasetRecord record = new DatasetRecord();
record.setUrn(urn);
record.setSourceCreatedTime("" + rec.getCreateTime() / 1000);
<BUG>record.setSchema(rec.getOriginalSchema());
record.setSchemaType(rec.getFormat());
</BUG>
record.setFields((String) StringUtil.objectToJsonString(rec.getFieldSchema()));
| record.setSchema(rec.getOriginalSchema().getText());
record.setSchemaType(rec.getOriginalSchema().getFormat());
|
45,965 | datasetId = Integer.valueOf(DatasetDao.getDatasetByUrn(urn).get("id").toString());
rec.setDatasetId(datasetId);
}
else {
DICT_DATASET_WRITER.execute(UPDATE_DICT_DATASET_WITH_SCHEMA_CHANGE,
<BUG>new Object[]{rec.getOriginalSchema(), rec.getFormat(), StringUtil.objectToJsonString(rec.getFieldSchema()),
"API", System.currentTimeMillis() / 1000, datasetId});
}</BUG>
List<Map<String, Object>> oldInfo;
try {
| new Object[]{rec.getOriginalSchema().getText(), rec.getOriginalSchema().getFormat(),
StringUtil.objectToJsonString(rec.getFieldSchema()), "API", System.currentTimeMillis() / 1000, datasetId});
|
45,966 | case "deploymentInfo":
try {
DatasetInfoDao.updateDatasetDeployment(rootNode);
} catch (Exception ex) {
Logger.debug("Metadata change exception: deployment ", ex);
<BUG>}
break;
case "caseSensitivity":
try {
DatasetInfoDao.updateDatasetCaseSensitivity(rootNode);
} catch (Exception ex) {
Logger.debug("Metadata change exception: case sensitivity ", ex);</BUG>
}
| [DELETED] |
45,967 | tableItem = createBeanTable();
contentLayout.with(buildControlsLayout(), tableItem).expand(tableItem);
tableItem.setHeightUndefined();
}
private ComponentContainer buildControlsLayout() {
<BUG>MHorizontalLayout viewControlsLayout = new MHorizontalLayout().withFullWidth();
viewControlsLayout.addStyleName(WebUIConstants.TABLE_ACTION_CONTROLS);</BUG>
selectOptionButton = new SelectionOptionButton(tableItem);
selectOptionButton.setSizeUndefined();
| MHorizontalLayout viewControlsLayout = new MHorizontalLayout().withStyleName(WebUIConstants.TABLE_ACTION_CONTROLS).withFullWidth();
|
45,968 | new RpFieldsBuilder(pagedBeanTable.getDisplayColumns()), exportType, presenter.getSelectedItems(),
getReportModelClassType());
}
return new StreamResource(new ReportStreamSource(reportTemplateExecutor) {
@Override
<BUG>protected void initReportParameters(Map<String, Object> parameters) {
}</BUG>
}, exportType.getDefaultFileName());
}
protected abstract void onSelectExtra(String id);
| parameters.putAll(addtionalParamters);
|
45,969 | super(viewClass);
}
@Override
protected void viewAttached() {
if (view.getSearchHandlers() != null) {
<BUG>view.getSearchHandlers().addSearchHandler(criteria -> doSearch(criteria));
</BUG>
}
if (view.getPagedBeanTable() != null) {
view.getPagedBeanTable().addPageableHandler(new PageableHandler() {
| view.getSearchHandlers().addSearchHandler(this::doSearch);
|
45,970 | url("link:classpath:META-INF/links/org.ops4j.pax.swissbox.extender.link").startLevel(START_LEVEL_SYSTEM_BUNDLES),
url("link:classpath:META-INF/links/org.ops4j.pax.swissbox.lifecycle.link").startLevel(START_LEVEL_SYSTEM_BUNDLES),
url("link:classpath:META-INF/links/org.ops4j.pax.swissbox.framework.link").startLevel(START_LEVEL_SYSTEM_BUNDLES),
url("link:classpath:META-INF/links/org.apache.geronimo.specs.atinject.link").startLevel(START_LEVEL_SYSTEM_BUNDLES),
mavenBundle("org.apache.felix", ORG_APACHE_FELIX_USERADMIN).versionAsInProject().startLevel(START_LEVEL_SYSTEM_BUNDLES),
<BUG>mavenBundle("org.apache.felix", ORG_APACHE_FELIX_USERADMIN_FILESTORE).versionAsInProject().startLevel(START_LEVEL_SYSTEM_BUNDLES),
junitBundles(),
frameworkStartLevel(START_LEVEL_TEST_BUNDLE),
felix());</BUG>
}
| mavenBundle("org.apache.felix", ORG_APACHE_FELIX_USERADMIN_FILESTORE).versionAsInProject().noStart(),
mavenBundle("org.apache.felix", ORG_APACHE_FELIX_USERADMIN_MONGODBSTORE).versionAsInProject().noStart(), mavenBundle("org.mongodb", "mongo-java-driver").versionAsInProject().noStart(),
junitBundles(), frameworkStartLevel(START_LEVEL_TEST_BUNDLE), felix());
|
45,971 | assertNotNull(user);
Group group = (Group) ua.createRole("group1", Role.GROUP);
assertNotNull(group);
group.addMember(user);
group.addRequiredMember(ua.getRole(Role.USER_ANYONE));
<BUG>Bundle fileStoreBundle = findBundle(ORG_APACHE_FELIX_USERADMIN_FILESTORE);
assertNotNull(fileStoreBundle);</BUG>
fileStoreBundle.stop();
Thread.sleep(100); // Wait a little until the bundle is really stopped...
user = (User) ua.getRole("user1");
| [DELETED] |
45,972 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
<BUG>import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;</BUG>
public final class PatchUtils {
| import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
45,973 | package org.jboss.as.patching.runner;
<BUG>import org.jboss.as.boot.DirectoryStructure;
import org.jboss.as.patching.LocalPatchInfo;</BUG>
import org.jboss.as.patching.PatchInfo;
import org.jboss.as.patching.PatchLogger;
import org.jboss.as.patching.PatchMessages;
| import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp;
import org.jboss.as.patching.CommonAttributes;
import org.jboss.as.patching.LocalPatchInfo;
|
45,974 | private static final String PATH_DELIMITER = "/";
public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;
enum Element {
ADDED_BUNDLE("added-bundle"),
ADDED_MISC_CONTENT("added-misc-content"),
<BUG>ADDED_MODULE("added-module"),
BUNDLES("bundles"),</BUG>
CUMULATIVE("cumulative"),
DESCRIPTION("description"),
MISC_FILES("misc-files"),
| APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
45,975 | final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
<BUG>case APPLIES_TO_VERSION:
builder.addAppliesTo(value);
break;</BUG>
case RESULTING_VERSION:
if(type == Patch.PatchType.CUMULATIVE) {
| [DELETED] |
45,976 | final StringBuilder path = new StringBuilder();
for(final String p : item.getPath()) {
path.append(p).append(PATH_DELIMITER);
}
path.append(item.getName());
<BUG>writer.writeAttribute(Attribute.PATH.name, path.toString());
if(type != ModificationType.REMOVE) {</BUG>
writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash()));
}
if(type != ModificationType.ADD) {
| if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
45,977 | package org.jboss.as.patching;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.patching.runner.PatchingException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
<BUG>import org.jboss.logging.annotations.MessageBundle;
import java.io.IOException;</BUG>
import java.util.List;
@MessageBundle(projectCode = "JBAS")
public interface PatchMessages {
| import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
45,978 | @Override
public String toString() {
return "desc";
}
};
<BUG>public static final SortOrder DEFAULT = DESC;
private static final SortOrder PROTOTYPE = DEFAULT;
</BUG>
@Override
public SortOrder readFrom(StreamInput in) throws IOException {
| return "asc";
},
DESC {
private static final SortOrder PROTOTYPE = ASC;
|
45,979 | GeoDistance geoDistance = GeoDistance.DEFAULT;
boolean reverse = false;
MultiValueMode sortMode = null;
NestedInnerQueryParseSupport nestedHelper = null;
final boolean indexCreatedBeforeV2_0 = context.indexShard().getIndexSettings().getIndexVersionCreated().before(Version.V_2_0_0);
<BUG>boolean coerce = false;
boolean ignoreMalformed = false;
XContentParser.Token token;</BUG>
String currentName = parser.currentName();
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
| boolean coerce = GeoDistanceSortBuilder.DEFAULT_COERCE;
boolean ignoreMalformed = GeoDistanceSortBuilder.DEFAULT_IGNORE_MALFORMED;
XContentParser.Token token;
|
45,980 | String currentName = parser.currentName();
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
if (token == XContentParser.Token.FIELD_NAME) {
currentName = parser.currentName();
} else if (token == XContentParser.Token.START_ARRAY) {
<BUG>parseGeoPoints(parser, geoPoints);
</BUG>
fieldName = currentName;
} else if (token == XContentParser.Token.START_OBJECT) {
if ("nested_filter".equals(currentName) || "nestedFilter".equals(currentName)) {
| GeoDistanceSortBuilder.parseGeoPoints(parser, geoPoints);
|
45,981 | package org.elasticsearch.search.sort;
<BUG>import org.elasticsearch.script.Script;
public class SortBuilders {</BUG>
public static ScoreSortBuilder scoreSort() {
return new ScoreSortBuilder();
}
| import org.elasticsearch.common.geo.GeoPoint;
import java.util.Arrays;
public class SortBuilders {
|
45,982 | public GeoDistanceSortBuilder ignoreMalformed(boolean ignoreMalformed) {
this.ignoreMalformed = ignoreMalformed;
return this;
}</BUG>
@Override
<BUG>public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject("_geo_distance");
if (geohashes.size() == 0 && points.size() == 0) {
throw new ElasticsearchParseException("No points provided for _geo_distance sort.");
}</BUG>
builder.startArray(fieldName);
| if (coerce == false) {
}
}
public boolean ignoreMalformed() {
return this.ignoreMalformed;
}
builder.startObject(NAME);
|
45,983 | import java.net.URI;
import java.util.Calendar;
import java.util.Date;
import java.util.Formatter;
import java.util.List;
<BUG>import javax.ws.rs.core.UriBuilder;
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.util.URIUtil;</BUG>
import org.suigeneris.jrcs.rcs.Version;
import org.xwiki.rest.Relations;
| [DELETED] |
45,984 | if (home != null) {
space.setHome(home.getPrefixedFullName());
space.setXwikiRelativeUrl(home.getURL("view"));
space.setXwikiAbsoluteUrl(home.getExternalURL("view"));
}
<BUG>String pagesUri = UriBuilder.fromUri(baseUri).path(PagesResource.class).build(wikiName, spaceName).toString();
</BUG>
Link pagesLink = objectFactory.createLink();
pagesLink.setHref(pagesUri);
pagesLink.setRel(Relations.PAGES);
| String pagesUri = uri(baseUri, PagesResource.class, wikiName, spaceName);
|
45,985 | Link pagesLink = objectFactory.createLink();
pagesLink.setHref(pagesUri);
pagesLink.setRel(Relations.PAGES);
space.getLinks().add(pagesLink);
if (home != null) {
<BUG>String homeUri =
UriBuilder.fromUri(baseUri).path(PageResource.class).build(wikiName, spaceName, home.getName())
.toString();</BUG>
Link homeLink = objectFactory.createLink();
| String homeUri = uri(baseUri, PageResource.class, wikiName, spaceName, home.getName());
|
45,986 | .toString();</BUG>
Link homeLink = objectFactory.createLink();
homeLink.setHref(homeUri);
homeLink.setRel(Relations.HOME);
space.getLinks().add(homeLink);
<BUG>}
String searchUri =
UriBuilder.fromUri(baseUri).path(SpaceSearchResource.class).build(wikiName, spaceName).toString();</BUG>
Link searchLink = objectFactory.createLink();
searchLink.setHref(searchUri);
| Link pagesLink = objectFactory.createLink();
pagesLink.setHref(pagesUri);
pagesLink.setRel(Relations.PAGES);
space.getLinks().add(pagesLink);
if (home != null) {
String homeUri = uri(baseUri, PageResource.class, wikiName, spaceName, home.getName());
String searchUri = uri(baseUri, SpaceSearchResource.class, wikiName, spaceName);
|
45,987 | if (!languages.isEmpty()) {
if (!doc.getDefaultLanguage().equals("")) {
translations.setDefault(doc.getDefaultLanguage());
Translation translation = objectFactory.createTranslation();
translation.setLanguage(doc.getDefaultLanguage());
<BUG>String pageTranslationUri =
UriBuilder.fromUri(baseUri).path(PageResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName()).toString();</BUG>
Link pageTranslationLink = objectFactory.createLink();
pageTranslationLink.setHref(pageTranslationUri);
| uri(baseUri, PageResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
45,988 | }
}
for (String language : languages) {
Translation translation = objectFactory.createTranslation();
translation.setLanguage(language);
<BUG>String pageTranslationUri =
UriBuilder.fromUri(baseUri).path(PageTranslationResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), language).toString();</BUG>
Link pageTranslationLink = objectFactory.createLink();
pageTranslationLink.setHref(pageTranslationUri);
| uri(baseUri, PageTranslationResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), language);
|
45,989 | Link pageTranslationLink = objectFactory.createLink();
pageTranslationLink.setHref(pageTranslationUri);
pageTranslationLink.setRel(Relations.PAGE);
translation.getLinks().add(pageTranslationLink);
String historyUri =
<BUG>UriBuilder.fromUri(baseUri).path(PageTranslationHistoryResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), language).toString();
Link historyLink = objectFactory.createLink();</BUG>
historyLink.setHref(historyUri);
historyLink.setRel(Relations.HISTORY);
| uri(baseUri, PageTranslationHistoryResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
language);
Link historyLink = objectFactory.createLink();
|
45,990 | pageSummary.setParent(doc.getParent());
if (parent != null && !parent.isNew()) {
pageSummary.setParentId(parent.getPrefixedFullName());
} else {
pageSummary.setParentId("");
<BUG>}
String spaceUri =
UriBuilder.fromUri(baseUri).path(SpaceResource.class).build(doc.getWiki(), doc.getSpace()).toString();</BUG>
Link spaceLink = objectFactory.createLink();
spaceLink.setHref(spaceUri);
| String spaceUri = uri(baseUri, SpaceResource.class, doc.getWiki(), doc.getSpace());
|
45,991 | UriBuilder.fromUri(baseUri).path(SpaceResource.class).build(doc.getWiki(), doc.getSpace()).toString();</BUG>
Link spaceLink = objectFactory.createLink();
spaceLink.setHref(spaceUri);
spaceLink.setRel(Relations.SPACE);
pageSummary.getLinks().add(spaceLink);
<BUG>if (parent != null) {
String parentUri =
UriBuilder.fromUri(baseUri).path(PageResource.class)
.build(parent.getWiki(), parent.getSpace(), parent.getName()).toString();</BUG>
Link parentLink = objectFactory.createLink();
| pageSummary.setParent(doc.getParent());
if (parent != null && !parent.isNew()) {
pageSummary.setParentId(parent.getPrefixedFullName());
} else {
pageSummary.setParentId("");
}
String spaceUri = uri(baseUri, SpaceResource.class, doc.getWiki(), doc.getSpace());
String parentUri = uri(baseUri, PageResource.class, parent.getWiki(), parent.getSpace(), parent.getName());
|
45,992 | Link historyLink = objectFactory.createLink();
historyLink.setHref(historyUri);
historyLink.setRel(Relations.HISTORY);
pageSummary.getLinks().add(historyLink);
if (!doc.getChildren().isEmpty()) {
<BUG>String pageChildrenUri =
UriBuilder.fromUri(baseUri).path(PageChildrenResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName()).toString();</BUG>
Link pageChildrenLink = objectFactory.createLink();
pageChildrenLink.setHref(pageChildrenUri);
| uri(baseUri, PageChildrenResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
45,993 | objectsLink.setRel(Relations.OBJECTS);
pageSummary.getLinks().add(objectsLink);
}
com.xpn.xwiki.api.Object tagsObject = doc.getObject("XWiki.TagClass", 0);
if (tagsObject != null) {
<BUG>if (tagsObject.getProperty("tags") != null) {
String tagsUri =
UriBuilder.fromUri(baseUri).path(PageTagsResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName()).toString();</BUG>
Link tagsLink = objectFactory.createLink();
| String tagsUri = uri(baseUri, PageTagsResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
45,994 | tagsLink.setHref(tagsUri);
tagsLink.setRel(Relations.TAGS);
pageSummary.getLinks().add(tagsLink);
}
}
<BUG>String syntaxesUri = UriBuilder.fromUri(baseUri).path(SyntaxesResource.class).build().toString();
Link syntaxesLink = objectFactory.createLink();</BUG>
syntaxesLink.setHref(syntaxesUri);
syntaxesLink.setRel(Relations.SYNTAXES);
pageSummary.getLinks().add(syntaxesLink);
| String syntaxesUri = uri(baseUri, SyntaxesResource.class);
Link syntaxesLink = objectFactory.createLink();
|
45,995 | }
return historySummary;
}
private static void fillAttachment(Attachment attachment, ObjectFactory objectFactory, URI baseUri,
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,
XWiki xwikiApi, Boolean withPrettyNames)
{</BUG>
Document doc = xwikiAttachment.getDocument();
attachment.setId(String.format("%s@%s", doc.getPrefixedFullName(), xwikiAttachment.getFilename()));
| com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,
{
|
45,996 | Calendar calendar = Calendar.getInstance();
calendar.setTime(xwikiAttachment.getDate());
attachment.setDate(calendar);
attachment.setXwikiRelativeUrl(xwikiRelativeUrl);
attachment.setXwikiAbsoluteUrl(xwikiAbsoluteUrl);
<BUG>String pageUri =
UriBuilder.fromUri(baseUri).path(PageResource.class).build(doc.getWiki(), doc.getSpace(), doc.getName())
.toString();</BUG>
Link pageLink = objectFactory.createLink();
| String pageUri = uri(baseUri, PageResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
45,997 | }
return attachmentUri;
}</BUG>
public static Attachment createAttachment(ObjectFactory objectFactory, URI baseUri,
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,
XWiki xwikiApi, Boolean withPrettyNames)
{</BUG>
Attachment attachment = objectFactory.createAttachment();
fillAttachment(attachment, objectFactory, baseUri, xwikiAttachment, xwikiRelativeUrl, xwikiAbsoluteUrl,
| com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,
{
|
45,998 | attachmentLink.setRel(Relations.ATTACHMENT_DATA);
attachment.getLinks().add(attachmentLink);
return attachment;
}
public static Attachment createAttachmentAtVersion(ObjectFactory objectFactory, URI baseUri,
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,
XWiki xwikiApi, Boolean withPrettyNames)
{</BUG>
Attachment attachment = new Attachment();
| com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,
{
|
45,999 | .build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(),
xwikiObject.getClassName(),
xwikiObject.getNumber()).toString();</BUG>
} else {
<BUG>propertiesUri =
UriBuilder
.fromUri(baseUri)
.path(ObjectPropertiesResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(),
xwikiObject.getNumber()).toString();</BUG>
}
| fillObjectSummary(objectSummary, objectFactory, baseUri, doc, xwikiObject, xwikiApi, withPrettyNames);
Link objectLink = getObjectLink(objectFactory, baseUri, doc, xwikiObject, useVersion, Relations.OBJECT);
objectSummary.getLinks().add(objectLink);
String propertiesUri;
if (useVersion) {
uri(baseUri, ObjectPropertiesAtPageVersionResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber());
uri(baseUri, ObjectPropertiesResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
xwikiObject.getClassName(), xwikiObject.getNumber());
|
46,000 | .build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(),
xwikiObject.getClassName(), xwikiObject.getNumber(), propertyClass.getName())
.toString();</BUG>
} else {
<BUG>propertyUri =
UriBuilder
.fromUri(baseUri)
.path(ObjectPropertyResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(),
xwikiObject.getNumber(), propertyClass.getName()).toString();</BUG>
}
| propertiesUri =
uri(baseUri, ObjectPropertiesResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
xwikiObject.getClassName(), xwikiObject.getNumber());
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.