id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
7,801 | import carbon.animation.AnimatedView;
import carbon.animation.StateAnimator;
import carbon.drawable.ripple.RippleDrawable;
import carbon.drawable.ripple.RippleView;
import carbon.internal.ElevationComparator;
<BUG>import carbon.internal.MatrixHelper;
import carbon.shadow.Shadow;</BUG>
import carbon.shadow.ShadowGenerator;
import carbon.shadow.ShadowShape;
import carbon.shadow.ShadowView;
| import carbon.internal.Reveal;
import carbon.shadow.Shadow;
|
7,802 | import carbon.shadow.ShadowGenerator;
import carbon.shadow.ShadowShape;
import carbon.shadow.ShadowView;
import static com.nineoldandroids.view.animation.AnimatorProxy.NEEDS_PROXY;
import static com.nineoldandroids.view.animation.AnimatorProxy.wrap;
<BUG>public class ConstraintLayout extends android.support.constraint.ConstraintLayout implements ShadowView, RippleView, TouchMarginView, StateAnimatorView, AnimatedView, InsetView, CornerView, MaxSizeView {
</BUG>
private OnTouchListener onDispatchTouchListener;
public ConstraintLayout(Context context) {
super(context, null, R.attr.carbon_constraintLayoutStyle);
| public class ConstraintLayout extends android.support.constraint.ConstraintLayout implements ShadowView, RippleView, TouchMarginView, StateAnimatorView, AnimatedView, InsetView, CornerView, MaxSizeView, RevealView {
|
7,803 | super.setBackgroundDrawable((Drawable) newRipple);
}
rippleDrawable = newRipple;
}
@Override
<BUG>protected boolean verifyDrawable(Drawable who) {
</BUG>
return super.verifyDrawable(who) || rippleDrawable == who;
}
@Override
| protected boolean verifyDrawable(@NonNull Drawable who) {
|
7,804 | super.setBackgroundDrawable((Drawable) newRipple);
}
rippleDrawable = newRipple;
}
@Override
<BUG>protected boolean verifyDrawable(Drawable who) {
</BUG>
return super.verifyDrawable(who) || rippleDrawable == who;
}
@Override
| protected boolean verifyDrawable(@NonNull Drawable who) {
|
7,805 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
7,806 | final int lineStride = dst.getScanlineStride();
final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final byte[][] data = dst.getByteDataArrays();
final float[] warpData = new float[2 * dstWidth];
<BUG>int lineOffset = 0;
if (ctable == null) { // source does not have IndexColorModel
if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
7,807 | pixelOffset += pixelStride;
} // COLS LOOP
} // ROWS LOOP
}
} else {// source has IndexColorModel
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| } else if (caseB) {
for (int h = 0; h < dstHeight; h++) {
|
7,808 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
7,809 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
7,810 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
7,811 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
7,812 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
7,813 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final int[][] data = dst.getIntDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
7,814 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
7,815 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final float[][] data = dst.getFloatDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
7,816 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
7,817 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final double[][] data = dst.getDoubleDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
7,818 | import net.yacy.kelondro.order.Base64Order;
import net.yacy.kelondro.util.ByteArray;
import net.yacy.kelondro.util.ByteBuffer;
import net.yacy.peers.RemoteSearch;
import net.yacy.repository.LoaderDispatcher;
<BUG>import net.yacy.search.Switchboard;
import de.anomic.crawler.retrieval.Response;</BUG>
public class TextSnippet implements Comparable<TextSnippet>, Comparator<TextSnippet> {
private static final int MAX_CACHE = 1000;
private static final Pattern p1 =
| import de.anomic.crawler.retrieval.Request;
import de.anomic.crawler.retrieval.Response;
|
7,819 | if (treeParser.foundErrors()) {
throw new RuntimeException(treeParser.getErrorMessage());
}
long start = System.currentTimeMillis();
Sequence resultSeq = expr.eval(null, null);
<BUG>if (resultSeq.getItemType() != Type.NODE)
throw new EXistException("select expression should evaluate to a" + "node-set");
LOG.debug("found " + resultSeq.getLength() + " for select: " + selectStmt);
return (NodeList)resultSeq;
</BUG>
} catch (RecognitionException e) {
| if (!Type.subTypeOf(resultSeq.getItemType(), Type.NODE))
throw new EXistException("select expression should evaluate to a node-set; got " +
Type.getTypeName(resultSeq.getItemType()));
return (NodeList)resultSeq.toNodeSet();
|
7,820 | return ql;
} finally {
globalLock.release();
}
}
<BUG>protected void unlockDocuments() {
lockedDocuments.unlock(true);</BUG>
}
public String toString() {
StringBuffer buf = new StringBuffer();
| if(lockedDocuments == null)
return;
lockedDocuments.unlock(true);
|
7,821 | collection = doc.getCollection();
if (prevCollection != null && collection != prevCollection)
doc.getBroker().saveCollection(prevCollection);
doc.setIndexListener(listener);
parent = node.getParentNode();
<BUG>if (parent.getNodeType() != Node.ELEMENT_NODE) {
throw new EXistException(</BUG>
"you cannot remove the document element. Use update "
+ "instead");
} else
| LOG.debug("parent = " + parent.getNodeType() + "; " + parent.getNodeName());
throw new EXistException(
|
7,822 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
7,823 | }
@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);
|
7,824 | 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);
|
7,825 | 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(
|
7,826 | 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 {
|
7,827 | 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;
|
7,828 | 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) {
|
7,829 | 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;
|
7,830 | 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 {
|
7,831 | 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));
|
7,832 | } 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()
|
7,833 |
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));
|
7,834 | 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));
|
7,835 | 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 {
|
7,836 | 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);
|
7,837 | 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);
|
7,838 | 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] |
7,839 | 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] |
7,840 | 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;
|
7,841 | 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;
|
7,842 | 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);
|
7,843 | } 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);
|
7,844 | 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);
|
7,845 | 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] |
7,846 | 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)));
|
7,847 | package com.continuuity.data.operation.executor.remote;
import com.continuuity.metrics2.api.CMetrics;
public class MetricsHelper {
private CMetrics metrics;
private Class<?> scope;
<BUG>private long startTime;
public MetricsHelper(CMetrics metrics,
Class<?> scope, String meter, String counter) {
this.metrics = metrics;</BUG>
this.scope = scope;
| private String histogram;
public MetricsHelper(CMetrics metrics, Class<?> scope,
String meter, String counter, String histogram) {
this.metrics = metrics;
|
7,848 | import org.apache.hadoop.hbase.HStoreKey;
import org.apache.hadoop.hbase.HTable;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.MiniHBaseCluster;
import org.apache.hadoop.hbase.MultiRegionTable;
<BUG>import org.apache.hadoop.hbase.StaticTestEnvironment;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;</BUG>
import org.apache.hadoop.io.MapWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.JobClient;
| import org.apache.hadoop.hbase.io.BatchUpdate;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
|
7,849 | }
public TestTableMapReduce() {
super();
conf.setInt("hbase.hregion.memcache.flush.size", 1024 * 1024);
conf.setInt("hbase.hstore.compactionThreshold", 2);
<BUG>conf.setLong("hbase.hregion.max.filesize", 256 * 1024);
</BUG>
conf.setInt("hbase.master.lease.period", 10 * 1000);
conf.setInt("hbase.master.lease.thread.wakefrequency", 5 * 1000);
conf.setInt("hbase.client.pause", 10 * 1000);
| conf.setLong("hbase.hregion.max.filesize", 1024 * 1024);
|
7,850 | import java.util.TreeMap;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
<BUG>import org.apache.hadoop.dfs.MiniDFSCluster;
import org.apache.hadoop.fs.FileSystem;</BUG>
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseAdmin;
import org.apache.hadoop.hbase.HColumnDescriptor;
| import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
|
7,851 | private MiniHBaseCluster hCluster = null;
@Override
public void setUp() throws Exception {
Logger.getLogger("org.apache.hadoop.mapred").setLevel(Level.DEBUG);
conf.setInt("hbase.hregion.memcache.flush.size", 1024 * 1024);
<BUG>conf.setLong("hbase.hregion.max.filesize", 1024 * 1024);
desc = new HTableDescriptor(TABLE_NAME);</BUG>
desc.addFamily(new HColumnDescriptor(INPUT_COLUMN));
desc.addFamily(new HColumnDescriptor(OUTPUT_COLUMN));
dfsCluster = new MiniDFSCluster(conf, 1, true, (String[]) null);
| conf.setInt("hbase.hstore.compactionThreshold", 2);
desc = new HTableDescriptor(TABLE_NAME);
|
7,852 | Thread.sleep(1000);
} catch (InterruptedException e) {
LOG.warn("Waiting on region to come online", e);
}
}
<BUG>cluster.getRegionThreads().get(0).getRegionServer().getCacheFlushListener().
flushRequested(r);
int oldCount = count;</BUG>
for (int i = 0; i < retries; i++) {
count = count(meta, tableName);
| assertNotNull(r);
server.getCacheFlushListener().flushRequested(r);
int oldCount = count;
|
7,853 | } catch (InterruptedException e) {
}
continue;
}
break;
<BUG>}
LOG.info("Parent split info returned " + data.keySet().toString());
}</BUG>
if (splitB == null) {
LOG.info("splitB was already null. Assuming it was previously compacted.");
| if (data != null) {
|
7,854 | } catch (InterruptedException e) {
}
}
}
}
<BUG>protected static void compact(final MiniHBaseCluster cluster,
final HRegionInfo r)
throws IOException {</BUG>
if (r == null) {
LOG.debug("Passed region is null");
| final HRegionInfo r) throws IOException {
|
7,855 | for (LocalHBaseCluster.RegionServerThread thread:
cluster.getRegionThreads()) {
SortedMap<Text, HRegion> regions = thread.getRegionServer().onlineRegions;
for (int i = 0; i < 10; i++) {
try {
<BUG>for (HRegion online: regions.values()) {
if (online.getRegionName().toString().
equals(r.getRegionName().toString())) {</BUG>
online.compactStores();
}
| if (online.getRegionName().equals(r.getRegionName())) {
|
7,856 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
7,857 | }
@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);
|
7,858 | 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);
|
7,859 | 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(
|
7,860 | 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 {
|
7,861 | 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;
|
7,862 | 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) {
|
7,863 | 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;
|
7,864 | import com.wwidesigner.optimization.Constraint.ConstraintType;
public class BorePositionObjectiveFunction extends BaseObjectiveFunction
{
public static final String CONSTR_CAT = "Bore point positions";
public static final String DISPLAY_NAME = "Bore Position optimizer";
<BUG>protected final int unchangedBorePoints;
public BorePositionObjectiveFunction(InstrumentCalculator calculator,
TuningInterface tuning, EvaluatorInterface evaluator, int unchangedBorePoints)
{</BUG>
super(calculator, tuning, evaluator);
| protected final int unchangedBottomPoint;
TuningInterface tuning, EvaluatorInterface evaluator, int unchangedBorePoints,
boolean bottomPointUnchanged)
|
7,865 | TuningInterface tuning, EvaluatorInterface evaluator, int unchangedBorePoints)
{</BUG>
super(calculator, tuning, evaluator);
<BUG>int nrBorePoints = calculator.getInstrument().getBorePoint().size();
if (unchangedBorePoints >= 1)</BUG>
{
this.unchangedBorePoints = unchangedBorePoints;
}
else
| this(calculator, tuning, evaluator, unchangedBorePoints, false);
public BorePositionObjectiveFunction(InstrumentCalculator calculator,
TuningInterface tuning, EvaluatorInterface evaluator)
|
7,866 | }
<BUG>nrDimensions = nrBorePoints - unchangedBorePoints;
</BUG>
if (nrDimensions > 1)
{
optimizerType = OptimizerType.BOBYQAOptimizer; // MultivariateOptimizer
}
else
{
optimizerType = OptimizerType.BrentOptimizer; // UnivariateOptimizer
| maxEvaluations = 10000;
setConstraints();
public BorePositionObjectiveFunction(InstrumentCalculator calculator,
TuningInterface tuning, EvaluatorInterface evaluator, int unchangedBorePoints)
this(calculator, tuning, evaluator, unchangedBorePoints, false);
public BorePositionObjectiveFunction(InstrumentCalculator calculator,
TuningInterface tuning, EvaluatorInterface evaluator)
this(calculator, tuning, evaluator, 1, false);
|
7,867 | double lastBorePosition = borePoint.getBorePosition();
geometry[0] = borePoint.getBorePosition();
borePoint = (BorePoint) sortedPoints[referencePointNr() - 1];</BUG>
double priorBorePosition = borePoint.getBorePosition();
<BUG>for (dimension = 1; dimension < nrDimensions; ++dimension)
{</BUG>
pointNr = borePointNr(dimension);
borePoint = (BorePoint) sortedPoints[pointNr - 1];
geometry[dimension] = (borePoint.getBorePosition() - priorBorePosition)
/ (lastBorePosition - priorBorePosition);
| if (unchangedBottomPoint == 0)
{
dimension = 1;
}
borePoint = (BorePoint) sortedPoints[referencePointNr() - 1];
for (; dimension < nrDimensions; ++dimension)
{
|
7,868 | borePoint.setBorePosition(point[0]);
double lastBorePosition = borePoint.getBorePosition();</BUG>
borePoint = (BorePoint) sortedPoints[referencePointNr() - 1];
double priorBorePosition = borePoint.getBorePosition();
<BUG>for (dimension = 1; dimension < nrDimensions; ++dimension)
{</BUG>
pointNr = borePointNr(dimension);
borePoint = (BorePoint) sortedPoints[pointNr - 1];
borePoint.setBorePosition(priorBorePosition
+ point[dimension] * (lastBorePosition - priorBorePosition));;
| dimension = 1;
}
double lastBorePosition = borePoint.getBorePosition();
for (; dimension < nrDimensions; ++dimension)
{
|
7,869 | priorBorePosition = borePoint.getBorePosition();
}
calculator.getInstrument().updateComponents();
}
@Override
<BUG>public void setLowerBounds(double[] lowerBounds)
{</BUG>
PositionInterface[] sortedHoles = Instrument.sortList(calculator
.getInstrument().getHole());
double bottomHolePosition;
| {
if (unchangedBottomPoint == 0)
{
|
7,870 | import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.Document;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.event.logical.shared.SelectionEvent;
<BUG>import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.*;</BUG>
import com.google.inject.Inject;
import com.google.inject.Provider;
| import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.*;
|
7,871 | void onActivatePackages() { paneManager_.activateTab(Tab.Packages); }
@Handler
void onActivateHelp()
{
paneManager_.activateTab(Tab.Help);
<BUG>eventBus_.fireEvent(new ActivateHelpEvent());
</BUG>
}
@Handler
void onActivateVcs() { paneManager_.activateTab(Tab.VCS); }
| fireEventDelayed(new ActivateHelpEvent(), 200);
|
7,872 | for (LogicalWindow window : panes_)
window.onWindowStateChange(new WindowStateChangeEvent(WindowState.NORMAL, true));
double rightWidth = panel_.getWidgetSize(right_);
if (rightWidth >= 10)
return;
<BUG>horizontalResizeAnimation(rightWidth, computeAppropriateWidth()).run(300);
}</BUG>
private void restoreSavedLayout()
{
for (LogicalWindow window : panes_)
| resizeHorizontally(rightWidth, computeAppropriateWidth());
}
|
7,873 | private void restoreSavedLayout()
{
for (LogicalWindow window : panes_)
window.onWindowStateChange(new WindowStateChangeEvent(WindowState.NORMAL, true));
maximizedWindow_.onWindowStateChange(new WindowStateChangeEvent(WindowState.NORMAL, true));
<BUG>horizontalResizeAnimation(panel_.getWidgetSize(right_), widgetSizePriorToZoom_).run(300);
</BUG>
maximizedWindow_ = null;
maximizedTab_ = null;
widgetSizePriorToZoom_ = -1;
| resizeHorizontally(panel_.getWidgetSize(right_), widgetSizePriorToZoom_);
|
7,874 | 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;
|
7,875 | 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;
|
7,876 | 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"),
|
7,877 | 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] |
7,878 | 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) {
|
7,879 | 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;
|
7,880 | import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityItem;
<BUG>import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;</BUG>
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.AxisAlignedBB;
| import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.potion.Potion;
|
7,881 | import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import common.legobmw99.allomancy.Allomancy;
import common.legobmw99.allomancy.common.AllomancyCapabilities;
import common.legobmw99.allomancy.common.Registry;
<BUG>import common.legobmw99.allomancy.entity.EntityGoldNugget;
import common.legobmw99.allomancy.network.packets.ChangeEmotionPacket;
import common.legobmw99.allomancy.network.packets.UpdateBurnPacket;</BUG>
import common.legobmw99.allomancy.util.vector3;
public class AllomancyTickHandler {
| import common.legobmw99.allomancy.network.packets.BecomeMistbornPacket;
import common.legobmw99.allomancy.network.packets.GetCapabilitiesPacket;
import common.legobmw99.allomancy.network.packets.UpdateBurnPacket;
|
7,882 | if ((cap.MetalBurning[AllomancyCapabilities.matTin] == false)
&& curPlayer.isPotionActive(Potion.getPotionById(16))) {
if (curPlayer.getActivePotionEffect(Potion.getPotionById(16))
.getDuration() < 201) {
curPlayer.removePotionEffect(Potion.getPotionById(16));
<BUG>}
}
if(cap.MetalBurning[AllomancyCapabilities.matCopper] == false){
if(cap.MetalBurning[AllomancyCapabilities.matIron] || cap.MetalBurning[AllomancyCapabilities.matSteel] || cap.MetalBurning[AllomancyCapabilities.matTin] || cap.MetalBurning[AllomancyCapabilities.matPewter] || cap.MetalBurning[AllomancyCapabilities.matZinc] || cap.MetalBurning[AllomancyCapabilities.matBrass] || cap.MetalBurning[AllomancyCapabilities.matBronze]){</BUG>
}
| [DELETED] |
7,883 | import common.legobmw99.allomancy.items.ItemMistcloak;
import common.legobmw99.allomancy.items.ItemVial;
import common.legobmw99.allomancy.items.NuggetLerasium;
import common.legobmw99.allomancy.network.packets.AllomancyCapabiltiesPacket;
import common.legobmw99.allomancy.network.packets.BecomeMistbornPacket;
<BUG>import common.legobmw99.allomancy.network.packets.ChangeEmotionPacket;
import common.legobmw99.allomancy.network.packets.MoveEntityPacket;</BUG>
import common.legobmw99.allomancy.network.packets.SelectMetalPacket;
import common.legobmw99.allomancy.network.packets.StopFallPacket;
import common.legobmw99.allomancy.network.packets.UpdateBurnPacket;
| import common.legobmw99.allomancy.network.packets.GetCapabilitiesPacket;
import common.legobmw99.allomancy.network.packets.MoveEntityPacket;
|
7,884 | network.registerMessage(BecomeMistbornPacket.Handler.class, BecomeMistbornPacket.class, 1, Side.CLIENT);
network.registerMessage(SelectMetalPacket.Handler.class, SelectMetalPacket.class, 2, Side.SERVER);
network.registerMessage(MoveEntityPacket.Handler.class, MoveEntityPacket.class, 3, Side.SERVER);
network.registerMessage(UpdateBurnPacket.Handler.class, UpdateBurnPacket.class, 4, Side.SERVER);
network.registerMessage(AllomancyCapabiltiesPacket.Handler.class, AllomancyCapabiltiesPacket.class, 5, Side.CLIENT);
<BUG>network.registerMessage(ChangeEmotionPacket.Handler.class, ChangeEmotionPacket.class, 6, Side.SERVER);
}</BUG>
@SideOnly(Side.CLIENT)
public static void registerRenders() {
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
| network.registerMessage(GetCapabilitiesPacket.Handler.class, GetCapabilitiesPacket.class, 7, Side.SERVER);
}
|
7,885 | package common.legobmw99.allomancy.handlers;
<BUG>import java.util.LinkedList;
import java.util.List;</BUG>
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.GuiIngame;
| [DELETED] |
7,886 | import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.entity.Entity;
<BUG>import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityItem;</BUG>
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
| [DELETED] |
7,887 | if (event.player instanceof EntityPlayerMP) {
AllomancyCapabilities cap = AllomancyCapabilities.forPlayer(event.player);
for (int i = 0; i < 7; i++) {
cap.MetalBurning[i] = false;
}
<BUG>Registry.network.sendTo(new AllomancyCapabiltiesPacket(cap),
</BUG>
(EntityPlayerMP) event.player);
if (cap.isMistborn == true) {
Registry.network.sendTo(new BecomeMistbornPacket(),(EntityPlayerMP) event.player);
| Registry.network.sendTo(new AllomancyCapabiltiesPacket(cap, event.player.getEntityId()),
|
7,888 | if ((this.cap.MetalBurning[AllomancyCapabilities.matIron] || this.cap.MetalBurning[AllomancyCapabilities.matSteel]) && (event instanceof RenderGameOverlayEvent.Post)){
for (Entity entity : Allomancy.XPC.particleTargets) {
motionX = ((player.posX - entity.posX) * -1) * .03;
motionY = (((player.posY - entity.posY + 1.2) * -1) * .03) + .021;
motionZ = ((player.posZ - entity.posZ) * -1) * .03;
<BUG>particle = new ParticleMetal(player.worldObj,
player.posX
- (Math.sin(Math.toRadians(player
.getRotationYawHead())) * .7d),
player.posY - .2, player.posZ
+ (Math.cos(Math.toRadians(player
.getRotationYawHead())) * .7d),
motionX, motionY, motionZ);
</BUG>
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
| player.posX - (Math.sin(Math.toRadians(player.getRotationYawHead())) * .7d),
player.posY - .2,
player.posZ + (Math.cos(Math.toRadians(player.getRotationYawHead())) * .7d),
motionX, motionY, motionZ,0);
|
7,889 | 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);
}
|
7,890 | try {
if (msg.startsWith("[")) {
msg = msg.substring(1, msg.indexOf("]"));
}
this.errorCode = Integer.parseInt(msg);
<BUG>}
catch(NumberFormatException e) {
</BUG>
this.errorCode = -1;
}
| return formatMessage(Integer.parseInt(m));
} catch(NumberFormatException e) {
return m;
|
7,891 | catch(NumberFormatException e) {
</BUG>
this.errorCode = -1;
}
}
<BUG>public int getErrorCode() {
return errorCode;
}
public LastErrorException(int code) {
super(formatMessage(code));
this.errorCode = code;</BUG>
}
| try {
return formatMessage(Integer.parseInt(m));
} catch(NumberFormatException e) {
return m;
|
7,892 | package com.sun.jna.platform.win32;
import com.sun.jna.platform.win32.WinNT.HRESULT;
<BUG>public class Win32Exception extends RuntimeException {
</BUG>
private static final long serialVersionUID = 1L;
private HRESULT _hr;
public HRESULT getHR() {
| import com.sun.jna.LastErrorException;
public class Win32Exception extends LastErrorException {
|
7,893 | </BUG>
private static final long serialVersionUID = 1L;
private HRESULT _hr;
public HRESULT getHR() {
return _hr;
<BUG>}
public Win32Exception(HRESULT hr) {
super(Kernel32Util.formatMessage(hr));
_hr = hr;</BUG>
}
| package com.sun.jna.platform.win32;
import com.sun.jna.LastErrorException;
import com.sun.jna.platform.win32.WinNT.HRESULT;
public class Win32Exception extends LastErrorException {
|
7,894 | final WriterHelper wh = new WriterHelper(out);
final Listcell self = (Listcell)comp;
final String uuid = self.getUuid();
wh.write("<td id=\"").write(uuid).write("\"").write(self.getOuterAttrs()).write(self.getInnerAttrs()).write(">");
wh.write(self.getColumnHtmlPrefix()).write(self.getImgTag());
<BUG>new Out(out).setMaxlength(self.getMaxlength()).setValue(self.getLabel()).render();
for (Iterator it = self.getChildren().iterator(); it.hasNext();) {</BUG>
final Component child = (Component)it.next();
child.redraw(out);
}
| new Out(out, self.getLabel()).setMaxlength(self.getMaxlength()).render();
for (Iterator it = self.getChildren().iterator(); it.hasNext();) {
|
7,895 | </BUG>
if (!Strings.isBlank(self.getDescription())
|| !Strings.isBlank(self.getContent())) {
wh.write("<br/><span>");
<BUG>new Out(out).setValue(self.getDescription()).render();
</BUG>
wh.write("</span>").write(self.getContent());
}
wh.write("</td></tr>");
wh.writeln();
| final Comboitem self = (Comboitem) comp;
final String uuid = self.getUuid();
wh.write("<tr id=\"").write(uuid).write("\" z.type=\"Cmit\"");
wh.write(self.getOuterAttrs()).write(self.getInnerAttrs()).write(">");
wh.write("<td>").write(self.getImgTag()).write("</td><td>");
new Out(out, self.getLabel()).render();
new Out(out, self.getDescription()).render();
|
7,896 | final String uuid = self.getUuid();
final Execution exec = Executions.getCurrent();
final String imgTag = self.getImgTag();
if (self.isLegend()) {
wh.write("<legend>").write(imgTag);
<BUG>new Out(out).setValue(self.getLabel()).render();
</BUG>
for (Iterator it = self.getChildren().iterator(); it.hasNext();) {
((Component) it.next()).redraw(out);
}
| new Out(out, self.getLabel()).render();
|
7,897 | wh.write("z.type=\"zul.widget.Capt\"").write(self.getOuterAttrs())
.write(self.getInnerAttrs());
wh.write(" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
wh.write("<tr valign=\"middle\">");
wh.write("<td align=\"left\" class=\"caption\">").write(imgTag);
<BUG>new Out(out).setValue(self.getCompoundLabel()).setNbsp(
true).render();</BUG>
wh.write("</td>");
wh.write("<td align=\"right\" class=\"caption\" id=\"").write(uuid)
| new Out(out, self.getCompoundLabel()).setNbsp(true).render();
|
7,898 | public void render(Component comp, Writer out) throws IOException {
final WriterHelper wh = new WriterHelper(out);
final Listfooter self = (Listfooter)comp;
wh.write("<td id=\"").write(self.getUuid()).write("\" ").write(self.getOuterAttrs()).write(self.getInnerAttrs()).writeln(">");
wh.write(self.getImgTag());
<BUG>new Out(out).setValue(self.getLabel()).render();
</BUG>
for (Iterator it = self.getChildren().iterator(); it.hasNext();) {
final Component child = (Component)it.next();
child.redraw(out);
| new Out(out, self.getLabel()).render();
|
7,899 | final Execution exec = Executions.getCurrent();
if(self.isTopmost()){
wh.write("<td id=\"").write(uuid).write("\" align=\"left\" z.type=\"zul.menu.Menu\"");
wh.write(self.getOuterAttrs()).write(self.getInnerAttrs()).write(">");
wh.write("<a href=\"javascript:;\" id=\"").write(uuid).write("!a\">").write(self.getImgTag());
<BUG>new Out(out).setValue(self.getLabel()).render();
</BUG>
wh.write("</a>")
.write(self.getMenupopup())
.writeln("</td>");
| new Out(out, self.getLabel()).render();
|
7,900 | }else{
wh.write("<tr id=\"").write(uuid).write("\" z.type=\"zul.menu.Menu\"");
wh.write(self.getOuterAttrs()).write(self.getInnerAttrs()).writeln(">");
wh.write("<td><img src=\"").write(exec.encodeURL("~./img/spacer.gif")).writeln("\" width=\"11\"/></td>");
wh.write("<td align=\"left\"><a href=\"javascript:;\" id=\"").write(uuid).write("!a\">").write(self.getImgTag());
<BUG>new Out(out).setValue(self.getLabel()).render();
</BUG>
wh.write("</a>")
.write(self.getMenupopup())
.writeln("</td>")
| new Out(out, self.getLabel()).render();
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.