id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
43,401 | if (offset_ == next_offset_) {
empty_element_parsed_guard_(builder_, offset_, "expressionSequenceRequired_1");
break;
}
offset_ = next_offset_;
<BUG>}
if (!result_) {
marker_.rollbackTo();
}
else {
marker_.drop();
}</BUG>
return result_;
| empty_element_parsed_guard_(builder_, offset_, "referenceExpression_2");
|
43,402 | return consumeToken(builder_, INSTANCEOF_KEYWORD);
}
static boolean methodCallParameters(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "methodCallParameters")) return false;
boolean result_ = false;
<BUG>Marker marker_ = builder_.mark();
result_ = methodCallParameters_0(builder_, level_ + 1);
result_ = result_ && methodCallParameters_1(builder_, level_ + 1);
if (!result_) {
marker_.rollbackTo();
}
else {
marker_.drop();
}</BUG>
return result_;
| if (offset_ == next_offset_) {
empty_element_parsed_guard_(builder_, offset_, "referenceExpression_2");
break;
|
43,403 | 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_;
|
43,404 | 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_);
|
43,405 | 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_;
|
43,406 | Log.w(TAG, "订单是否已经被撤销(一般用于线下渠道): " + bcBillOrder.getRevertResult());
Log.w(TAG, "渠道返回的详细信息(需要通过QueryParams发起query请求,并且设置needDetail为true),按需处理: "
+ bcBillOrder.getMessageDetail());
return convertView;
}
<BUG>private class ViewHolder {
public TextView txtBillNum;</BUG>
public TextView txtTradeNum;
public TextView txtTotalFee;
public TextView txtChannel;
| public TextView txtBillId;
public TextView txtBillNum;
|
43,407 | Log.d(TAG, "------getResultMsg------" + billResult.getResultMsg());
Log.d(TAG, "------getErrDetail------" + billResult.getErrDetail());
if (billResult.getResultCode() != 0)
return;
Log.d(TAG, "------- bill info ------");
<BUG>BCBillOrder billOrder = billResult.getBill();
Log.d(TAG, "订单号:" + billOrder.getBillNum());</BUG>
Log.d(TAG, "订单金额, 单位为分:" + billOrder.getTotalFee());
Log.d(TAG, "渠道类型:" + BCReqParams.BCChannelTypes.getTranslatedChannelName(billOrder.getChannel()));
Log.d(TAG, "子渠道类型:" + BCReqParams.BCChannelTypes.getTranslatedChannelName(billOrder.getSubChannel()));
| Log.d(TAG, "订单唯一标识符:" + billOrder.getId());
Log.d(TAG, "订单号:" + billOrder.getBillNum());
|
43,408 | 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;
|
43,409 | 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();
|
43,410 | 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: " +
|
43,411 | 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;
|
43,412 | 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]);
|
43,413 | 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;
|
43,414 | package io.confluent.connect.jdbc.sink.dialect;
import org.apache.kafka.connect.data.Schema;
import java.util.ArrayList;
<BUG>import java.util.Collection;
import java.util.HashMap;</BUG>
import java.util.List;
import java.util.Map;
import io.confluent.connect.jdbc.sink.metadata.SinkRecordField;
| import java.util.Collections;
import java.util.HashMap;
|
43,415 | builder.append(" NULL");
} else {
builder.append(" NOT NULL");
}
}
<BUG>});
return Collections.singletonList(builder.toString());
}
String getSqlType(Schema.Type type) {
</BUG>
final String sqlType = schemaTypeToSqlTypeMap.get(type);
| protected String getSqlType(Schema.Type type) {
|
43,416 | package io.confluent.connect.jdbc.sink.dialect;
import org.apache.kafka.connect.data.Schema;
import java.util.ArrayList;
<BUG>import java.util.Collection;
import java.util.HashMap;</BUG>
import java.util.List;
import java.util.Map;
import io.confluent.connect.jdbc.sink.metadata.SinkRecordField;
| import java.util.Collections;
import java.util.HashMap;
|
43,417 | return size()+offset;
}
public PlaLineInt[] to_array()
{
return a_list.toArray(new PlaLineInt[size()]);
<BUG>}
@Override</BUG>
public Iterator<PlaLineInt> iterator()
{
return a_list.iterator();
| public ArrayList<PlaLineInt>to_alist()
return a_list;
@Override
|
43,418 | while (Math.abs(prev_dist) < c_epsilon)
{
++corners_skipped_before;
int curr_no = p_start_no - corners_skipped_before;
if (curr_no < 0) return null;
<BUG>prev_corner = p_line_arr[curr_no].intersection_approx(p_line_arr[curr_no + 1]);
</BUG>
prev_dist = translate_line.distance_signed(prev_corner);
}
double next_dist = translate_line.distance_signed(next_corner);
| prev_corner = p_line_arr.get(curr_no).intersection_approx(p_line_arr.get(curr_no + 1));
|
43,419 | </BUG>
{
return null;
}
<BUG>next_corner = p_line_arr[curr_no].intersection_approx(p_line_arr[curr_no + 1]);
</BUG>
next_dist = translate_line.distance_signed(next_corner);
}
if (Signum.of(prev_dist) != Signum.of(next_dist))
{
| double next_dist = translate_line.distance_signed(next_corner);
while (Math.abs(next_dist) < c_epsilon)
++corners_skipped_after;
int curr_no = p_start_no + 3 + corners_skipped_after;
if (curr_no >= p_line_arr.size() - 2)
next_corner = p_line_arr.get(curr_no).intersection_approx(p_line_arr.get(curr_no + 1));
|
43,420 | check_ok = r_board.check_trace(shape_to_check, curr_layer, curr_net_no_arr, curr_cl_type, contact_pins);
}
delta_dist /= 2;
if (check_ok)
{
<BUG>result = curr_lines[p_start_no + 2];
</BUG>
if (translate_dist == max_translate_dist) break;
translate_dist += delta_dist;
}
| result = curr_lines.get(p_start_no + 2);
|
43,421 | translate_dist -= shorten_value;
delta_dist -= shorten_value;
}
}
if (result == null) return null;
<BUG>PlaPointFloat new_prev_corner = curr_lines[p_start_no].intersection_approx(curr_lines[p_start_no + 1]);
PlaPointFloat new_next_corner = curr_lines[p_start_no + 3].intersection_approx(curr_lines[p_start_no + 4]);
</BUG>
r_board.changed_area.join(new_prev_corner, curr_layer);
| PlaPointFloat new_prev_corner = curr_lines.get(p_start_no).intersection_approx(curr_lines.get(p_start_no + 1));
PlaPointFloat new_next_corner = curr_lines.get(p_start_no + 3).intersection_approx(curr_lines.get(p_start_no + 4));
|
43,422 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
43,423 | }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_memo);
<BUG>ChinaPhoneHelper.setStatusBar(this,true);
</BUG>
topicId = getIntent().getLongExtra("topicId", -1);
if (topicId == -1) {
finish();
| ChinaPhoneHelper.setStatusBar(this, true);
|
43,424 | MemoEntry.COLUMN_REF_TOPIC__ID + " = ?"
, new String[]{String.valueOf(topicId)});
}
public Cursor selectMemo(long topicId) {
Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null,
<BUG>MemoEntry._ID + " DESC", null);
</BUG>
if (c != null) {
c.moveToFirst();
}
| MemoEntry.COLUMN_ORDER + " ASC", null);
|
43,425 | MemoEntry._ID + " = ?",
new String[]{String.valueOf(memoId)});
}
public long updateMemoContent(long memoId, String memoContent) {
ContentValues values = new ContentValues();
<BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent);
return db.update(</BUG>
MemoEntry.TABLE_NAME,
values,
MemoEntry._ID + " = ?",
| return db.update(
|
43,426 | import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kiminonawa.mydiary.R;
import com.kiminonawa.mydiary.db.DBManager;
import com.kiminonawa.mydiary.shared.EditMode;
<BUG>import com.kiminonawa.mydiary.shared.ThemeManager;
import java.util.List;
public class MemoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements EditMode {
</BUG>
private List<MemoEntity> memoList;
| import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;
public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
|
43,427 | private DBManager dbManager;
private boolean isEditMode = false;
private EditMemoDialogFragment.MemoCallback callback;
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
<BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback) {
this.mActivity = activity;</BUG>
this.topicId = topicId;
this.memoList = memoList;
| public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {
super(recyclerView);
this.mActivity = activity;
|
43,428 | this.memoList = memoList;
this.dbManager = dbManager;
this.callback = callback;
}
@Override
<BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
</BUG>
View view;
if (isEditMode) {
if (viewType == TYPE_HEADER) {
| public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
43,429 | editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment");
}
});
}
}
<BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private View rootView;
private TextView TV_memo_item_content;</BUG>
private ImageView IV_memo_item_delete;
| protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
private ImageView IV_memo_item_dot;
private TextView TV_memo_item_content;
|
43,430 | 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;
|
43,431 | 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;
|
43,432 | 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"),
|
43,433 | 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] |
43,434 | 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) {
|
43,435 | 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;
|
43,436 | import org.mule.runtime.core.internal.metadata.InvalidComponentIdException;
import java.io.IOException;
import java.util.List;
import org.junit.Test;
public class MetadataNegativeTestCase extends MetadataExtensionFunctionalTestCase {
<BUG>private static final String NOT_A_METADATA_PROVIDER = "is not a MetadataProvider or MetadataEntityProvider";
private static final String PROCESSOR_DOES_NOT_EXIST = "Processor doesn't exist in the given index [%s]";
private static final String SOURCE_DOES_NOT_EXIST = "Flow doesn't contain a message source";
private static final String FLOW_DOES_NOT_EXIST = "Flow [%s] doesn't exist";</BUG>
private static final String FAIL_WITH_RESOLVING_EXCEPTION = "failWithResolvingException";
| private static final String NO_OBJECT_FOUND = "No object found with location %s";
|
43,437 | protected String getConfigFile() {
return METADATA_TEST;
}
@Test
public void getOperationMetadataWithResolvingException() throws Exception {
<BUG>location = builder().globalName(FAIL_WITH_RESOLVING_EXCEPTION).addIndexPart(0).build();
</BUG>
MetadataResult<ComponentMetadataDescriptor<OperationModel>> metadata = getComponentDynamicMetadata(PERSON_METADATA_KEY);
assertThat(metadata.isSuccess(), is(false));
assertFailureResult(metadata, 2);
| location = builder().globalName(FAIL_WITH_RESOLVING_EXCEPTION).addProcessorsPart().addIndexPart(0).build();
|
43,438 | assertMetadataFailure(failures.get(0), "", CONNECTION_FAILURE, "", OUTPUT_ATTRIBUTES, "");
assertMetadataFailure(failures.get(1), "", CONNECTION_FAILURE, "", INPUT, "content");
}
@Test
public void getKeysWithRuntimeException() throws Exception {
<BUG>location = builder().globalName(FAIL_WITH_RUNTIME_EXCEPTION).addIndexPart(0).build();
</BUG>
MetadataResult<MetadataKeysContainer> metadata = metadataService.getMetadataKeys(location);
assertFailureResult(metadata, 1);
assertMetadataFailure(metadata.getFailures().get(0), "", UNKNOWN, RuntimeException.class.getName(), KEYS);
| location = builder().globalName(FAIL_WITH_RUNTIME_EXCEPTION).addProcessorsPart().addIndexPart(0).build();
|
43,439 | assertFailureResult(metadata, 1);
assertMetadataFailure(metadata.getFailures().get(0), "", UNKNOWN, RuntimeException.class.getName(), KEYS);
}
@Test
public void getOperationMetadataWithRuntimeException() throws Exception {
<BUG>location = builder().globalName(FAIL_WITH_RUNTIME_EXCEPTION).addIndexPart(0).build();
</BUG>
MetadataResult<ComponentMetadataDescriptor<OperationModel>> metadata = getComponentDynamicMetadata(PERSON_METADATA_KEY);
assertFailureResult(metadata, 2);
assertMetadataFailure(metadata.getFailures().get(0), "", UNKNOWN, "", OUTPUT_ATTRIBUTES);
| location = builder().globalName(FAIL_WITH_RUNTIME_EXCEPTION).addProcessorsPart().addIndexPart(0).build();
|
43,440 | public void failToGetMetadataFromNonExistingSource() throws IOException {
location = builder().globalName(FLOW_WITHOUT_SOURCE).addSourcePart().build();
final MetadataResult<MetadataKeysContainer> result = metadataService.getMetadataKeys(location);
assertFailureResult(result, 1);
assertMetadataFailure(result.getFailures().get(0),
<BUG>SOURCE_DOES_NOT_EXIST,
COMPONENT_NOT_FOUND,</BUG>
InvalidComponentIdException.class.getName(), COMPONENT);
}
@Test
| format(NO_OBJECT_FOUND, location),
COMPONENT_NOT_FOUND,
|
43,441 | location = builder().globalName(NON_EXISTING_CONFIG).build();
final MetadataResult<MetadataKeysContainer> result =
metadataService.getMetadataKeys(location);
assertFailureResult(result, 1);
assertMetadataFailure(result.getFailures().get(0),
<BUG>format("Configuration named [%s] doesn't exist", NON_EXISTING_CONFIG),
COMPONENT_NOT_FOUND,</BUG>
InvalidComponentIdException.class.getName(), COMPONENT);
}
@Test
| format(NO_OBJECT_FOUND, NON_EXISTING_CONFIG),
COMPONENT_NOT_FOUND,
|
43,442 | NO_DYNAMIC_METADATA_AVAILABLE,
InvalidComponentIdException.class.getName(), COMPONENT);
}
@Test
public void processorIsNotMetadataProvider() throws Exception {
<BUG>location = builder().globalName(LOGGER_FLOW).addIndexPart(0).build();
</BUG>
MetadataResult<ComponentMetadataDescriptor<OperationModel>> result = getComponentDynamicMetadata(PERSON_METADATA_KEY);
assertMetadataFailure(result.getFailures().get(0),
NOT_A_METADATA_PROVIDER,
| location = builder().globalName(LOGGER_FLOW).addProcessorsPart().addIndexPart(0).build();
|
43,443 | INPUT,
"content");
}
@Test
public void failWithDynamicConfigurationWhenRetrievingMetadata() throws IOException {
<BUG>location = builder().globalName(RESOLVER_WITH_DYNAMIC_CONFIG).addIndexPart(0).build();
</BUG>
MetadataKey key = newKey(AMERICA, CONTINENT).withChild(newKey(USA, COUNTRY).withChild(newKey(SAN_FRANCISCO, CITY))).build();
MetadataResult<ComponentMetadataDescriptor<OperationModel>> result = getComponentDynamicMetadata(key);
assertFailureResult(result, 1);
| location = builder().globalName(RESOLVER_WITH_DYNAMIC_CONFIG).addProcessorsPart().addIndexPart(0).build();
|
43,444 | COMPONENT);
}
@Test
public void failToGetMetadataWithMissingMetadataKeyLevels() throws Exception {
assumeThat(resolutionType, is(ResolutionType.EXPLICIT_RESOLUTION));
<BUG>location = builder().globalName(INCOMPLETE_MULTILEVEL_KEY_RESOLVER).addIndexPart(0).build();
</BUG>
final MetadataKey metadataKey = newKey(AMERICA, CONTINENT).withChild(newKey(USA, COUNTRY)).build();
final MetadataResult<ComponentMetadataDescriptor<OperationModel>> result = getComponentDynamicMetadata(metadataKey);
assertMetadataFailure(result.getFailures().get(0), "Missing levels: [city]", INVALID_METADATA_KEY, "", COMPONENT);
| location = builder().globalName(INCOMPLETE_MULTILEVEL_KEY_RESOLVER).addProcessorsPart().addIndexPart(0).build();
|
43,445 | package org.mule.runtime.core.internal.metadata;
import static com.google.common.collect.ImmutableMap.copyOf;
import static java.lang.String.format;
<BUG>import static org.mule.runtime.api.i18n.I18nMessageFactory.createStaticMessage;
import static org.mule.runtime.api.metadata.resolving.FailureCode.NO_DYNAMIC_METADATA_AVAILABLE;</BUG>
import static org.mule.runtime.api.metadata.resolving.MetadataFailure.Builder.newFailure;
import static org.mule.runtime.api.metadata.resolving.MetadataResult.failure;
import org.mule.runtime.api.component.location.Location;
| import static org.mule.runtime.api.metadata.resolving.FailureCode.COMPONENT_NOT_FOUND;
import static org.mule.runtime.api.metadata.resolving.FailureCode.NO_DYNAMIC_METADATA_AVAILABLE;
|
43,446 | import static org.mule.runtime.api.metadata.resolving.FailureCode.NO_DYNAMIC_METADATA_AVAILABLE;</BUG>
import static org.mule.runtime.api.metadata.resolving.MetadataFailure.Builder.newFailure;
import static org.mule.runtime.api.metadata.resolving.MetadataResult.failure;
import org.mule.runtime.api.component.location.Location;
import org.mule.runtime.api.exception.MuleRuntimeException;
<BUG>import org.mule.runtime.api.i18n.I18nMessage;
import org.mule.runtime.api.i18n.I18nMessageFactory;</BUG>
import org.mule.runtime.api.lifecycle.Initialisable;
import org.mule.runtime.api.lifecycle.InitialisationException;
import org.mule.runtime.api.meta.model.ComponentModel;
| package org.mule.runtime.core.internal.metadata;
import static com.google.common.collect.ImmutableMap.copyOf;
import static java.lang.String.format;
import static org.mule.runtime.api.i18n.I18nMessageFactory.createStaticMessage;
import static org.mule.runtime.api.metadata.resolving.FailureCode.COMPONENT_NOT_FOUND;
import static org.mule.runtime.api.metadata.resolving.FailureCode.NO_DYNAMIC_METADATA_AVAILABLE;
|
43,447 | NO_DYNAMIC_METADATA_AVAILABLE);
}
}
private Object findComponent(Location location) throws InvalidComponentIdException {
return componentLocator.find(location)
<BUG>.orElseThrow(() -> new InvalidComponentIdException(createStaticMessage("No object found with location " + location)));
}</BUG>
private <T extends ComponentModel<T>> MetadataProvider<T> findMetadataProvider(Location location)
throws InvalidComponentIdException {
| .orElseThrow(() -> new InvalidComponentIdException(createStaticMessage("No object found with location " + location),
COMPONENT_NOT_FOUND));
|
43,448 | package com.intellij.codeInsight.template.postfix.templates;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
<BUG>import com.intellij.psi.*;
import com.intellij.psi.util.PsiTreeUtil;</BUG>
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class NewExpressionPostfixTemplate extends PostfixTemplate {
| import com.intellij.lang.ASTNode;
import com.intellij.psi.impl.source.tree.ChildRole;
import com.intellij.psi.impl.source.tree.CompositeElement;
import com.intellij.psi.util.PsiTreeUtil;
|
43,449 | boolean typeRequiresRefinement = psiClass.isInterface() || psiClass.hasModifierProperty(PsiModifier.ABSTRACT);
String template = "new " + ref.getText() + "()";
if (typeRequiresRefinement) template += "{}";
PsiElementFactory factory = JavaPsiFacade.getInstance(context.getProject()).getElementFactory();
PsiNewExpression newExpression = (PsiNewExpression)factory.createExpressionFromText(template, context);
<BUG>PsiElement replace = ((PsiJavaReference)ref).getElement().replace(newExpression);
replace.getNode().addLeaf(JavaTokenType.SEMICOLON, ";", null);
int offset = calculateOffset((PsiNewExpression)replace, accessibility, typeRequiresRefinement);</BUG>
editor.getCaretModel().moveToOffset(offset);
}
| PsiStatement statement = PsiTreeUtil.getNonStrictParentOfType(replace, PsiStatement.class);
ASTNode existingSemicolon = statement instanceof CompositeElement
? ((CompositeElement)statement).findChildByRole(ChildRole.CLOSING_SEMICOLON)
: null;
if (statement == null || existingSemicolon == null) {
|
43,450 | import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.util.Progressable;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AFileSystem extends FileSystem {</BUG>
private URI uri;
private Path workingDir;
private AmazonS3Client s3;
| import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AFileSystem extends FileSystem {
|
43,451 | public void initialize(URI name, Configuration conf) throws IOException {
super.initialize(name, conf);
uri = URI.create(name.getScheme() + "://" + name.getAuthority());
workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri,
this.getWorkingDirectory());
<BUG>String accessKey = conf.get(ACCESS_KEY, null);
String secretKey = conf.get(SECRET_KEY, null);
</BUG>
String userInfo = name.getUserInfo();
| String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null));
String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
|
43,452 | } else {
accessKey = userInfo;
}
}
AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain(
<BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey),
new InstanceProfileCredentialsProvider(),
new S3AAnonymousAWSCredentialsProvider()
);</BUG>
bucket = name.getHost();
| new BasicAWSCredentialsProvider(accessKey, secretKey),
new AnonymousAWSCredentialsProvider()
|
43,453 |
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT));
</BUG>
s3 = new AmazonS3Client(credentials, awsConf);
<BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS);
partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (partSize < 5 * 1024 * 1024) {
| new InstanceProfileCredentialsProvider(),
new AnonymousAWSCredentialsProvider()
bucket = name.getHost();
ClientConfiguration awsConf = new ClientConfiguration();
awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS)));
awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP);
awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES)));
awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)));
maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS));
partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE));
partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
|
43,454 | cannedACL = null;
}
if (!s3.doesBucketExist(bucket)) {
throw new IOException("Bucket " + bucket + " does not exist");
}
<BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART);
long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE);
</BUG>
if (purgeExistingMultipart) {
| boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART));
long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE));
|
43,455 | import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AOutputStream extends OutputStream {</BUG>
private OutputStream backupStream;
private File backupFile;
private boolean closed;
| import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AOutputStream extends OutputStream {
|
43,456 | this.client = client;
this.progress = progress;
this.fs = fs;
this.cannedACL = cannedACL;
this.statistics = statistics;
<BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (conf.get(BUFFER_DIR, null) != null) {
| partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
|
43,457 | package org.opennms.netmgt.config;
import java.io.Reader;
<BUG>import junit.framework.TestCase;
import org.opennms.netmgt.config.syslogd.HideMatch;</BUG>
import org.opennms.netmgt.config.syslogd.UeiMatch;
import org.opennms.netmgt.mock.MockDatabase;
import org.opennms.netmgt.mock.MockNetwork;
| import java.util.List;
import org.opennms.netmgt.config.syslogd.HideMatch;
|
43,458 | customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString());
customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName);
customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString());
customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName);
customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString());
<BUG>customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName);
}</BUG>
public void init() {
try {
LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
| customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName);
customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName);
}
|
43,459 | for(int i = 1; i <= tags.size(); i++) {
if(tags.counter(i) == 0) continue;
final StatsKey key = tags.stat(tags.id(tags.key(i)));
final Kind kind = key.kind;
if(kind == Kind.DBL || kind == Kind.INT || kind == Kind.CAT &&
<BUG>key.cats.size() <= 20) {
</BUG>
sl.add(Token.string(tags.key(i)));
}
}
| key.cats.size() <= 50) {
|
43,460 | for(int i = 0; i <= data.atts.size(); i++) {
if(data.atts.counter(i) == 0) continue;
final StatsKey key = atts.stat(atts.id(atts.key(i)));
final Kind kind = key.kind;
if(kind == Kind.DBL || kind == Kind.INT || kind == Kind.CAT &&
<BUG>key.cats.size() <= 20) {
</BUG>
sl.add("@" + Token.string(atts.key(i)));
}
}
| key.cats.size() <= 50) {
|
43,461 | import org.basex.gui.view.View;
import org.basex.util.Token;
public class ScatterView extends View implements Runnable {
ScatterData scatterData;
private static final int XMARGIN = 150;
<BUG>private static final int YMARGIN = 150;
</BUG>
private static final int ITEMSIZE = 10;
private static final int ITEMSIZEFOCUSED = 18;
private static final int NOVALUEBORDER = 60;
| private static final int YMARGIN = 200;
|
43,462 | private static final byte[] AT = Token.token("@");
private final ScatterData scatterData;
private byte[] attr;
private boolean isTag;
boolean numeric;
<BUG>private int nrCats;
double[] co;
int nrCaptions;
double min;</BUG>
double max;
| int numType;
static final int TYPEINT = 0;
static final int TYPEDBL = 1;
double captionStep;
double min;
|
43,463 | return;
final Data data = GUI.context.data();
final StatsKey key = isTag ? data.tags.stat(data.tags.id(attr)) :
data.atts.stat(data.atts.id(attr));
numeric = key.kind == Kind.INT || key.kind == Kind.DBL;
<BUG>if(numeric) {
min = key.min;</BUG>
max = key.max;
} else {
cats = key.cats.keys();
| numType = key.kind == Kind.INT ? TYPEINT : TYPEDBL;
min = key.min;
|
43,464 | import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.vcsUtil.VcsUtil;
import git4idea.GitUtil;
import git4idea.commands.GitHandler;
import git4idea.commands.GitHandlerUtil;
<BUG>import git4idea.commands.GitSimpleHandler;
import git4idea.config.GitConfigUtil;</BUG>
import git4idea.config.GitVcsSettings;
import git4idea.i18n.GitBundle;
import org.jetbrains.annotations.NonNls;
| import git4idea.commands.GitFileUtils;
import git4idea.config.GitConfigUtil;
|
43,465 | final Collection<FilePath> removed,
final List<VcsException> exceptions) {
boolean rc = true;
if (!added.isEmpty()) {
try {
<BUG>GitSimpleHandler.addPaths(project, root, added).run();
</BUG>
}
catch (VcsException ex) {
exceptions.add(ex);
| GitFileUtils.addPaths(project, root, added);
|
43,466 | ArrayList<VcsException> rc = new ArrayList<VcsException>();
Map<VirtualFile, List<FilePath>> sortedFiles = GitUtil.sortFilePathsByVcsRoot(myProject, files);
for (Map.Entry<VirtualFile, List<FilePath>> e : sortedFiles.entrySet()) {
try {
final VirtualFile root = e.getKey();
<BUG>GitSimpleHandler.delete(myProject, root, e.getValue()).run();
</BUG>
markRootDirty(root);
}
catch (VcsException ex) {
| GitFileUtils.delete(myProject, root, e.getValue());
|
43,467 | ArrayList<VcsException> rc = new ArrayList<VcsException>();
Map<VirtualFile, List<VirtualFile>> sortedFiles = GitUtil.sortFilesByGitRoot(files);
for (Map.Entry<VirtualFile, List<VirtualFile>> e : sortedFiles.entrySet()) {
try {
final VirtualFile root = e.getKey();
<BUG>GitSimpleHandler.addFiles(myProject, root, e.getValue()).run();
</BUG>
markRootDirty(root);
}
catch (VcsException ex) {
| Map<VirtualFile, List<FilePath>> sortedFiles = GitUtil.sortFilePathsByVcsRoot(myProject, files);
for (Map.Entry<VirtualFile, List<FilePath>> e : sortedFiles.entrySet()) {
GitFileUtils.delete(myProject, root, e.getValue());
|
43,468 | import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
import com.intellij.openapi.vfs.VirtualFile;
import git4idea.GitUtil;
import git4idea.GitVcs;
<BUG>import git4idea.commands.GitSimpleHandler;
</BUG>
import git4idea.i18n.GitBundle;
import org.jetbrains.annotations.NotNull;
import java.util.Arrays;
| import git4idea.commands.GitFileUtils;
|
43,469 | addFiles(project, affectedFiles);
}
public static void addFiles(@NotNull Project project, @NotNull VirtualFile[] files) throws VcsException {
final Map<VirtualFile, List<VirtualFile>> roots = GitUtil.sortFilesByGitRoot(Arrays.asList(files));
for (Map.Entry<VirtualFile, List<VirtualFile>> entry : roots.entrySet()) {
<BUG>GitSimpleHandler h = GitSimpleHandler.addFiles(project, entry.getKey(), entry.getValue());
h.run();</BUG>
}
VcsDirtyScopeManager mgr = VcsDirtyScopeManager.getInstance(project);
| GitFileUtils.addFiles(project, entry.getKey(), entry.getValue());
|
43,470 | public static String relativePath(final File root, FilePath path) {
return relativePath(root, path.getIOFile());
}
public static String relativePath(final File root, VirtualFile file) {
return relativePath(root, VfsUtil.virtualToIoFile(file));
<BUG>}
public static String relativePath(final File root, File path) {</BUG>
String rc = FileUtil.getRelativePath(root, path);
if (rc == null) {
throw new IllegalArgumentException("The file " + path + " cannot be made relative to " + root);
| public static String relativePath(final VirtualFile root, VirtualFile file) {
return relativePath(VfsUtil.virtualToIoFile(root), VfsUtil.virtualToIoFile(file));
public static String relativePath(final File root, File path) {
|
43,471 | public static GitSimpleHandler checkRepository(Project project, final String url) {
GitSimpleHandler handler = new GitSimpleHandler(project, new File("."), LS_REMOTE);
handler.addParameters(url, "master");
return handler;
}
<BUG>public static GitSimpleHandler delete(Project project, VirtualFile root, List<FilePath> files) {
GitSimpleHandler handler = new GitSimpleHandler(project, root, RM);
handler.addRelativePaths(files);
handler.setNoSSH(true);
return handler;</BUG>
}
| [DELETED] |
43,472 | package com.easytoolsoft.easyreport.web.controller.common;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping(value = "/error")
<BUG>public class ErrorController extends AbstractController {
@RequestMapping(value = {"/404"})</BUG>
public String error404() {
return "/error/404";
}
| public class ErrorController {
@RequestMapping(value = {"/404"})
|
43,473 | package net.ttddyy.dsproxy.test.assertj.data;
import net.ttddyy.dsproxy.proxy.ParameterKey;
import java.sql.SQLType;
<BUG>public abstract class ExecutionParameter {
public static class ParamExecution extends ExecutionParameter {</BUG>
private Object value;
public ParamExecution(ParameterKey parameterKey, Object value) {
super(parameterKey);
| public static class ParamKeyOnlyExecution extends ExecutionParameter {
public ParamKeyOnlyExecution(ParameterKey parameterKey) {
}
}
public static class ParamExecution extends ExecutionParameter {
|
43,474 | switch (attribute) {
case NAME:
if (name != null) {
throw unexpectedAttribute(reader, i);
}
<BUG>name = value;
break;</BUG>
case SLOT:
if (slot != null) {
throw unexpectedAttribute(reader, i);
| GlobalModulesDefinition.NAME_AD.parseAndSetParameter(name, module, reader);
break;
|
43,475 | static ModelNode parseGlobalModules(XMLExtendedStreamReader reader) throws XMLStreamException {
ModelNode globalModules = new ModelNode();
requireNoAttributes(reader);
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
switch (Element.forName(reader.getLocalName())) {
<BUG>case MODULE: {
final int count = reader.getAttributeCount();</BUG>
String name = null;
String slot = null;
for (int i = 0; i < count; i++) {
| final ModelNode module = new ModelNode();
final int count = reader.getAttributeCount();
|
43,476 | switch (attribute) {
case NAME:
if (name != null) {
throw unexpectedAttribute(reader, i);
}
<BUG>name = value;
break;</BUG>
case SLOT:
if (slot != null) {
throw unexpectedAttribute(reader, i);
| GlobalModulesDefinition.NAME_AD.parseAndSetParameter(name, module, reader);
break;
|
43,477 | static ModelNode parseGlobalModules(XMLExtendedStreamReader reader) throws XMLStreamException {
ModelNode globalModules = new ModelNode();
requireNoAttributes(reader);
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
switch (Element.forName(reader.getLocalName())) {
<BUG>case MODULE: {
final int count = reader.getAttributeCount();</BUG>
String name = null;
String slot = null;
for (int i = 0; i < count; i++) {
| final ModelNode module = new ModelNode();
final int count = reader.getAttributeCount();
|
43,478 | switch (attribute) {
case NAME:
if (name != null) {
throw unexpectedAttribute(reader, i);
}
<BUG>name = value;
break;</BUG>
case SLOT:
if (slot != null) {
throw unexpectedAttribute(reader, i);
| GlobalModulesDefinition.NAME_AD.parseAndSetParameter(name, module, reader);
break;
|
43,479 | Map<String, Object> _revisions = ClientTestUtils.getRevisionHistory(revision3, revision2, revision1);
doc1.put(CouchConstants._rev, revision3);
doc1.put(CouchConstants._revisions, _revisions);
List<Response> responses = client.bulkCreateDocs(doc1);
Assert.assertEquals(0, responses.size());
<BUG>Map<String, Object> allRevs = client.getDocRevisions(res1.getId(), revision3, JSONUtils.mapStringToObject());
</BUG>
int revisionStart = (Integer) ((Map<String, Object>) allRevs.get(CouchConstants._revisions)).get
(CouchConstants.start);
Assert.assertEquals(3, revisionStart);
| Map<String, Object> allRevs = client.getDocRevisions(res1.getId(), revision3, JSONUtils.STRING_MAP_TYPE_DEF);
|
43,480 | Assert.assertEquals("world", doc.get("hello"));
Assert.assertTrue(doc.containsKey(CouchConstants._id));
Assert.assertEquals(res.getId(), doc.get(CouchConstants._id));
Assert.assertTrue(doc.containsKey(CouchConstants._rev));
Assert.assertEquals(res.getRev(), doc.get(CouchConstants._rev));
<BUG>}
@Test(expected = NoResourceException.class)
public void getDocumentInputStream_idNotExist_exception() {
client.getDocumentStream("id_not_exist", "1-no_such_rev");</BUG>
}
| [DELETED] |
43,481 | import com.cloudant.sync.internal.mazha.DocumentRevs;
import com.cloudant.sync.internal.mazha.Response;
<BUG>import com.cloudant.sync.internal.documentstore.InternalDocumentRevision;
import com.cloudant.sync.internal.documentstore.DocumentRevsList;
import com.cloudant.sync.internal.documentstore.MultipartAttachmentWriter;
import com.cloudant.sync.documentstore.UnsavedStreamAttachment;</BUG>
import com.cloudant.sync.replication.PullFilter;
import java.util.Collection;
import java.util.List;
import java.util.Map;
| [DELETED] |
43,482 | return executeResult;
} finally {
IOUtils.closeQuietly(errorStream);
}
}
<BUG>private InputStream executeToInputStreamWithRetry(final Callable<ExecuteResult> task) throws CouchException {
int attempts = 10;
CouchException lastException= null;
</BUG>
while (attempts-- > 0) {
| private <T> T executeWithRetry(final Callable<ExecuteResult> task,
InputStreamProcessor<T> processor) throws
CouchException lastException = null;
|
43,483 | public boolean contains(String id) {
Misc.checkNotNullOrEmpty(id, "id");
URI doc = this.uriHelper.documentUri(id);
try {
HttpConnection connection = Http.HEAD(doc);
<BUG>this.executeToInputStreamWithRetry(connection);
return true;</BUG>
} catch (Exception e) {
return false;
}
| this.executeWithRetry(connection, new NoOpInputStreamProcessor());
return true;
|
43,484 | final URI doc = this.uriHelper.attachmentUri(id, queries, attachmentName);
HttpConnection connection = Http.GET(doc);
if (acceptGzip) {
connection.requestProperties.put("Accept-Encoding", "gzip");
}
<BUG>return executeToInputStreamWithRetry(connection);
</BUG>
}
public void putAttachmentStream(String id, String rev, String attachmentName, String contentType, byte[] attachmentData) {
Misc.checkNotNullOrEmpty(id, "id");
| return executeWithRetry(connection, processor);
|
43,485 | } else {
options.put("attachments", false);
options.put("att_encoding_info", true);
}
options.put("open_revs", JSONUtils.toJson(revisions));
<BUG>return this.getDocument(id, options, JSONUtils.openRevisionList());
}</BUG>
public Iterable<DocumentRevsList> bulkReadDocsWithOpenRevisions(List<BulkGetRequest> request,
boolean pullAttachmentsInline) {
Map<String, Object> options = new HashMap<String, Object>();
| return this.getDocument(id, options, JSONUtils.OPEN_REVS_LIST_TYPE_DEF);
|
43,486 | Misc.checkNotNull(rev, "Revision ID");
Map<String, Object> queries = new HashMap<String, Object>();
queries.put("revs", "true");
queries.put("rev", rev);
URI findRevs = this.uriHelper.documentUri(id, queries);
<BUG>InputStream is = null;
try {
HttpConnection connection = Http.GET(findRevs);
is = this.executeToInputStreamWithRetry(connection);
return JSONUtils.fromJson(new InputStreamReader(is, Charset.forName("UTF-8")), type);
} finally {
closeQuietly(is);
}</BUG>
}
| return executeToJsonObjectWithRetry(connection, type);
|
43,487 | package com.cloudant.sync.internal.replication;
import com.cloudant.http.HttpConnectionRequestInterceptor;
import com.cloudant.http.HttpConnectionResponseInterceptor;
<BUG>import com.cloudant.sync.internal.mazha.ChangesResult;
import com.cloudant.sync.internal.mazha.CouchClient;
import com.cloudant.sync.internal.mazha.DocumentRevs;</BUG>
import com.cloudant.sync.documentstore.Attachment;
import com.cloudant.sync.documentstore.Database;
| [DELETED] |
43,488 | attachmentName);
if (a != null) {
continue;
}
}
<BUG>UnsavedStreamAttachment usa = this.sourceDb
.getAttachmentStream(documentRevs.getId(),
documentRevs.getRev(), attachmentName,
contentType, encoding);
preparedAtts.put(attachmentName, this.targetDb.prepareAttachment(usa, length,
encodedLength));
}</BUG>
}
| preparedAtts.put(attachmentName, this.sourceDb.pullAttachmentWithRetry
(documentRevs.getId(), documentRevs.getRev(), entry
.getKey(), new AttachmentPullProcessor(this
.targetDb, entry.getKey(), contentType,
encoding, length, encodedLength)));
|
43,489 | 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;
|
43,490 | 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();
|
43,491 | 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: " +
|
43,492 | 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;
|
43,493 | 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]);
|
43,494 | 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;
|
43,495 | private final I18n i18n;
private Filter filter;
ApplicationElement(TodoItemRepository repository, I18n i18n) {
this.repository = repository;
this.i18n = i18n;
<BUG>Elements.Builder builder = new Elements.Builder()
.section().css("todoapp")</BUG>
.header().css("header")
.h(1).innerText(i18n.constants().todos()).end()
.input(text)
| TodoBuilder builder = new TodoBuilder()
.section().css("todoapp")
|
43,496 | import static org.junit.Assert.assertNotNull;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class ElementsBuilderTest {
<BUG>private Elements.Builder builder;
</BUG>
@Before
public void setUp() {
Document document = mock(Document.class);
| private TestableBuilder builder;
|
43,497 | when(document.createParagraphElement()).thenAnswer(invocation -> new StandaloneElement("p"));
when(document.createSelectElement()).thenAnswer(invocation -> new StandaloneInputElement("select"));
when(document.createSpanElement()).thenAnswer(invocation -> new StandaloneElement("span"));
when(document.createTextAreaElement()).thenAnswer(invocation -> new StandaloneInputElement("textarea"));
when(document.createUListElement()).thenAnswer(invocation -> new StandaloneElement("ul"));
<BUG>builder = new Elements.Builder(document);
</BUG>
}
@Test
public void headings() {
| builder = new TestableBuilder(document);
|
43,498 | TodoItemRepository repository = new TodoItemRepository(BEAN_FACTORY);
ApplicationElement application = new ApplicationElement(repository, i18n);
Element body = Browser.getDocument().getBody();
body.appendChild(application.asElement());
body.appendChild(new FooterElement(i18n).asElement());
<BUG>Element e = new MyBuilder().ahref( "http://www.google.com" )
.img( "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" ).end()
.end().build();
body.appendChild( e );</BUG>
History.addValueChangeHandler(event -> application.filter(event.getValue()));
| [DELETED] |
43,499 | @Override
public String toString() {
return (container ? "container" : "simple") + " @ " + level + ": " + element.getTagName();
}
}
<BUG>public static class Builder extends CoreBuilder<Builder>
{
public Builder() {
super(Browser.getDocument());
}
protected Builder(Document document) {
super( document );</BUG>
}
| [DELETED] |
43,500 | return start(document.createElement(tag));
}
public B start(Element element) {
elements.push(new ElementInfo(element, true, level));
level++;
<BUG>return (B) this;
}</BUG>
public B end() {
assertCurrent();
if (level == 0) {
| return that();
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.