id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
5,301
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = result; } } } else if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt; </BUG> } } if (fracx < fracdx1) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt[k2];
5,302
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt[k2];
5,303
final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy); final int pos = posx + posy; if (baseIndex > roiDataLength || roiDataArray[baseIndex] == 0) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt[k2];
5,304
weight &= (0xffff - (1 << 4 * h + z)); } } } if (weight == 0 || tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { long tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt[k2];
5,305
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt[k2];
5,306
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt[k2];
5,307
final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy); final int pos = posx + posy; if (!roiBounds.contains(x0, y0)) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt[k2];
5,308
weight &= (0xffff - (1 << 4 * h + z)); } } } if (weight == 0 || tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { long tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt[k2];
5,309
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt[k2];
5,310
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,311
final int posyROI = (s_iy - srcRectY) * roiScanlineStride; final int baseIndex = (posx / dst_num_bands) + posyROI; if (baseIndex > roiDataLength || roiDataArray[baseIndex] == 0) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,312
: 0); } } } if (tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { float tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,313
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,314
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,315
int x0 = src.getX() + posx / srcPixelStride; int y0 = src.getY() + posy / srcScanlineStride; if (!roiBounds.contains(x0, y0)) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,316
pixelKernel[h][z] = srcDataArrays[k2][pos + (z - 1) tmpROI += roiIter.getSample(x0 + h - 1, y0 + z - 1, 0) & 0xff; } } if (tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { float tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,317
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,318
weightVert &= (0x0F - (1 << h)); } sumArray[h] = tempSum; } if (weight == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } else { double[] tempData = bicubicInpaintingDouble(sumArray, weightVert, emptyArray);
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,319
sum = 0; } } } else if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } } if (fracx < fracdx1) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,320
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,321
final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy); final int pos = posx + posy; if (baseIndex > roiDataLength || roiDataArray[baseIndex] == 0) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,322
weight &= (0xffff - (1 << 4 * h + z)); } } } if (weight == 0 || tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { double tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,323
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,324
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,325
final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy); final int pos = posx + posy; if (!roiBounds.contains(x0, y0)) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,326
weight &= (0xffff - (1 << 4 * h + z)); } } } if (weight == 0 || tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { double tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,327
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
5,328
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,329
final int posyROI = (s_iy - srcRectY) * roiScanlineStride; final int baseIndex = (posx / dst_num_bands) + posyROI; if (baseIndex > roiDataLength || roiDataArray[baseIndex] == 0) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,330
: 0); } } } if (tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { double tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,331
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,332
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,333
int x0 = src.getX() + posx / srcPixelStride; int y0 = src.getY() + posy / srcScanlineStride; if (!roiBounds.contains(x0, y0)) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,334
pixelKernel[h][z] = srcDataArrays[k2][pos + (z - 1) tmpROI += roiIter.getSample(x0 + h - 1, y0 + z - 1, 0) & 0xff; } } if (tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { double tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,335
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,336
weightVert &= (0x0F - (1 << h)); } sumArray[h] = tempSum; } if (weight == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } else { double[] tempData = bicubicInpaintingDouble(sumArray, weightVert, emptyArray);
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,337
sum = 0; } } } else if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } } if (fracx < fracdx1) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,338
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,339
final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy); final int pos = posx + posy; if (baseIndex > roiDataLength || roiDataArray[baseIndex] == 0) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,340
weight &= (0xffff - (1 << 4 * h + z)); } } } if (weight == 0 || tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { double tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,341
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,342
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,343
final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy); final int pos = posx + posy; if (!roiBounds.contains(x0, y0)) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,344
weight &= (0xffff - (1 << 4 * h + z)); } } } if (weight == 0 || tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { double tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,345
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
5,346
updatePost(); } else { insertPost(); <BUG>if(++FbCollector.postsCount % 10 == 0) { System.out.println(Util.getDbDateTimeEst() + " Fetched " + FbCollector.postsCount + " posts"); }</BUG> }
[DELETED]
5,347
import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class FbCollector { <BUG>public static long loopIndex = 0; public static long tempSince = -1; public static final long dayInMillis = 86400000; public static final long hourInMillis = 3600000; public static int scrapeCount = 0; public static long postsCount = 0; public static long commentsCount = 0;</BUG> public static boolean collectStats;
public static long sincePointer = 0; public static long untilPointer = System.currentTimeMillis(); public static final long timeSlice = (hourInMillis * 24)/Config.pages.size();
5,348
public static String until; public static String dbUrl; public static String dbUser; public static String dbPass; public static boolean collectComments; <BUG>public static boolean crawlHistory; static</BUG> { init(); }
public static int waitTime; static
5,349
until = properties.getProperty("until"); dbUrl = properties.getProperty("dbUrl"); dbUser = properties.getProperty("dbUser"); dbPass = properties.getProperty("dbPass"); collectComments = properties.getProperty("collectComments").toLowerCase().equals("true"); <BUG>crawlHistory = properties.getProperty("crawlHistory").toLowerCase().equals("true"); }</BUG> catch (IOException e) { e.printStackTrace();
String tempWaitTime = properties.getProperty("waitTime"); waitTime = (null != tempWaitTime) && tempWaitTime.matches("\\d+") ? Integer.parseInt(tempWaitTime) : 20 * pages.size(); }
5,350
this.page = page; this.postId = postId; } public void collect() { <BUG>if(FbCollector.commentsCount - tempCount > 10000) { Util.sleep(300); tempCount = FbCollector.commentsCount; }</BUG> String url = Config.baseUrl + "/" + postId + "/comments";
[DELETED]
5,351
Bundle savedInstanceState) { final View rootView = inflater.inflate(R.layout.tab_qibla, container, false); final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass); qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north), ((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla)); <BUG>sOrientationListener = new SensorListener() { </BUG> public void onSensorChanged(int s, float v[]) { float northDirection = v[SensorManager.DATA_X]; qiblaCompassView.setDirections(northDirection, sQiblaDirection);
sOrientationListener = new android.hardware.SensorListener() {
5,352
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;
5,353
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();
5,354
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: " +
5,355
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;
5,356
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]);
5,357
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;
5,358
public boolean checkEventType(GameEvent event, Game game) { return event.getType() == EventType.DISCARDED_CARD; } @Override public boolean checkTrigger(GameEvent event, Game game) { <BUG>return game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) && StackObject.class.isInstance(game.getObject(event.getSourceId())) && getSourceId().equals(event.getTargetId()); }</BUG> @Override
if (getSourceId().equals(event.getTargetId())) { StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); if (stackObject != null) { return game.getOpponents(this.getControllerId()).contains(stackObject.getControllerId()); return false;
5,359
public boolean checkEventType(GameEvent event, Game game) { return event.getType() == EventType.DISCARDED_CARD; } @Override public boolean checkTrigger(GameEvent event, Game game) { <BUG>return game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) && StackObject.class.isInstance(game.getObject(event.getSourceId())) && getSourceId().equals(event.getTargetId()); }</BUG> @Override
if (getSourceId().equals(event.getTargetId())) { StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); if (stackObject != null) { return game.getOpponents(this.getControllerId()).contains(stackObject.getControllerId()); return false;
5,360
package com.vainolo.phd.opp.interpreter.builtin; import static org.junit.Assert.*; import java.math.BigDecimal; import org.junit.Test; import com.eclipsesource.json.JsonObject; <BUG>import com.vainolo.phd.opp.interpreter.builtin.io.OPPWriteOPMObjectInstanceToJSON; import com.vainolo.phd.opp.interpreter.types.OPPObjectInstance;</BUG> public class OPPWriteOPMObjectInstanceToJSONProcessInstanceTest { private OPPObjectInstance writeJson(OPPObjectInstance opmObject) throws Exception { OPPWriteOPMObjectInstanceToJSON instance = new OPPWriteOPMObjectInstanceToJSON();
import com.vainolo.phd.opp.interpreter.types.OPPComplexObjectInstance; import com.vainolo.phd.opp.interpreter.types.OPPObjectInstance;
5,361
instance.call(); return instance.getArgument("json"); } @Test public void test_execute_intElement() throws Exception { <BUG>OPPObjectInstance opmObject = OPPObjectInstance.createCompositeInstance(); </BUG> opmObject.addPart("int", OPPObjectInstance.createFromValue(new BigDecimal(3))); OPPObjectInstance result = writeJson(opmObject); JsonObject jsonObject = JsonObject.readFrom(result.getStringValue());
OPPComplexObjectInstance opmObject = OPPObjectInstance.createCompositeInstance();
5,362
JsonObject jsonObject = JsonObject.readFrom(result.getStringValue()); assertEquals(3, jsonObject.get("int").asInt()); } @Test public void test_execute_doubleElement() throws Exception { <BUG>OPPObjectInstance opmObject = OPPObjectInstance.createCompositeInstance(); </BUG> opmObject.addPart("double", OPPObjectInstance.createFromValue(new BigDecimal(5.47))); OPPObjectInstance result = writeJson(opmObject); JsonObject jsonObject = JsonObject.readFrom(result.getStringValue());
OPPComplexObjectInstance opmObject = OPPObjectInstance.createCompositeInstance();
5,363
package com.vainolo.phd.opp.interpreter.builtin; import static org.junit.Assert.*; import org.junit.Test; <BUG>import com.vainolo.phd.opp.interpreter.builtin.io.OPPTransformJSONStringToObjectProcessInstance; import com.vainolo.phd.opp.interpreter.types.OPPObjectInstance;</BUG> public class OPPReadJSONObjectProcessInstanceTest { private OPPObjectInstance readJson(String json) throws Exception { OPPTransformJSONStringToObjectProcessInstance instance = new OPPTransformJSONStringToObjectProcessInstance();
import com.vainolo.phd.opp.interpreter.types.OPPComplexObjectInstance; import com.vainolo.phd.opp.interpreter.types.OPPObjectInstance;
5,364
instance.call(); return instance.getArgument("object"); } @Test public void test_execute_intElement() throws Exception { <BUG>OPPObjectInstance instance = readJson("{\"a\":0}"); </BUG> assertEquals(0, instance.getPart("a").getNumericalValue().intValue()); } @Test
OPPComplexObjectInstance instance = (OPPComplexObjectInstance) readJson("{\"a\":0}");
5,365
</BUG> assertEquals(0, instance.getPart("a").getNumericalValue().intValue()); } @Test public void test_execute_doubleElement() throws Exception { <BUG>OPPObjectInstance instance = readJson("{\"a\":5.43}"); </BUG> assertEquals(5.43, instance.getPart("a").getNumericalValue().doubleValue(), 0.0001); } @Test
instance.call(); return instance.getArgument("object"); public void test_execute_intElement() throws Exception { OPPComplexObjectInstance instance = (OPPComplexObjectInstance) readJson("{\"a\":0}"); OPPComplexObjectInstance instance = (OPPComplexObjectInstance) readJson("{\"a\":5.43}");
5,366
import java.util.List; import java.util.Random; import org.junit.Before; import org.junit.Test; import com.google.common.collect.Lists; <BUG>import com.vainolo.phd.opp.interpreter.OPPObjectInstanceValueAnalyzer; import com.vainolo.phd.opp.interpreter.types.OPPObjectInstance;</BUG> public class OPPObjectInstanceValueAnalyzerTests { private OPPObjectInstanceValueAnalyzer valueAnalyzer; private OPPObjectInstance instance;
import com.vainolo.phd.opp.interpreter.types.OPPComplexObjectInstance; import com.vainolo.phd.opp.interpreter.types.OPPObjectInstance;
5,367
import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.util.ArrayList; import java.util.List; <BUG>import org.apache.commons.lang.RandomStringUtils; import org.junit.After;</BUG> import org.junit.Assert; import org.apache.sling.launchpad.api.StartupHandler; import org.junit.Before;
import org.apache.sling.settings.SlingSettingsService; import org.junit.After;
5,368
if(worldIn.getTileEntity(pos) != null){ TileEntity te = worldIn.getTileEntity(pos); if(te.hasCapability(Capabilities.HEAT_HANDLER_CAPABILITY, null) && te.getCapability(Capabilities.HEAT_HANDLER_CAPABILITY, null).getTemp() >= -273D + mult){ te.getCapability(Capabilities.HEAT_HANDLER_CAPABILITY, null).addHeat(-mult); } <BUG>for(EnumFacing dir : EnumFacing.values()){ if(te.hasCapability(Capabilities.ROTARY_HANDLER_CAPABILITY, dir)){ te.getCapability(Capabilities.ROTARY_HANDLER_CAPABILITY, dir).addEnergy(-mult, false, false); break;</BUG> }
if(te.hasCapability(Capabilities.HEAT_HANDLER_CAPABILITY, null)){ te.getCapability(Capabilities.HEAT_HANDLER_CAPABILITY, null).addHeat(mult);
5,369
public static double betterRound(double numIn, int decPlac){ double opOn = Math.round(numIn * Math.pow(10, decPlac)) / Math.pow(10D, decPlac); return opOn; } public static double centerCeil(double numIn, int tiers){ <BUG>return ((numIn > 0) ? Math.ceil(numIn * tiers) : Math.floor(numIn * tiers)) / tiers; </BUG> } public static double findEfficiency(double speedIn, double lowerLimit, double upperLimit){ speedIn = Math.abs(speedIn);
return ((numIn > 0) ? Math.ceil(numIn * (double) tiers) : Math.floor(numIn * (double) tiers)) / (double) tiers;
5,370
package com.Da_Technomancer.crossroads.API; import com.Da_Technomancer.crossroads.API.DefaultStorageHelper.DefaultStorage; import com.Da_Technomancer.crossroads.API.heat.DefaultHeatHandler; import com.Da_Technomancer.crossroads.API.heat.IHeatHandler; import com.Da_Technomancer.crossroads.API.magic.DefaultMagicHandler; <BUG>import com.Da_Technomancer.crossroads.API.magic.IMagicHandler; import com.Da_Technomancer.crossroads.API.rotary.DefaultRotaryHandler; import com.Da_Technomancer.crossroads.API.rotary.IRotaryHandler; </BUG> import net.minecraftforge.common.capabilities.Capability;
import com.Da_Technomancer.crossroads.API.rotary.DefaultAxleHandler; import com.Da_Technomancer.crossroads.API.rotary.DefaultCogHandler; import com.Da_Technomancer.crossroads.API.rotary.IAxleHandler; import com.Da_Technomancer.crossroads.API.rotary.ICogHandler;
5,371
import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.common.capabilities.CapabilityManager; public class Capabilities{ @CapabilityInject(IHeatHandler.class) <BUG>public static Capability<IHeatHandler> HEAT_HANDLER_CAPABILITY = null; @CapabilityInject(IRotaryHandler.class) public static Capability<IRotaryHandler> ROTARY_HANDLER_CAPABILITY = null; </BUG> @CapabilityInject(IMagicHandler.class)
@CapabilityInject(IAxleHandler.class) public static Capability<IAxleHandler> AXLE_HANDLER_CAPABILITY = null; @CapabilityInject(ICogHandler.class) public static Capability<ICogHandler> COG_HANDLER_CAPABILITY = null;
5,372
public IEffect getMixEffect(Color col){ if(col == null){ return effect; } int top = Math.max(col.getBlue(), Math.max(col.getRed(), col.getGreen())); <BUG>if(top < rand.nextInt(128) + 128){ return voidEffect;</BUG> } return effect; }
if(top != 255){ return voidEffect;
5,373
import liquibase.integration.spring.SpringLiquibase; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; <BUG>import org.springframework.boot.bind.RelaxedPropertyResolver; import org.springframework.context.ApplicationContextException; import org.springframework.context.EnvironmentAware;</BUG> import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties;
5,374
import org.springframework.context.annotation.Profile; import org.springframework.core.env.Environment; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.transaction.annotation.EnableTransactionManagement; <BUG>import org.springframework.util.StringUtils; import javax.sql.DataSource;</BUG> import java.util.Arrays; @Configuration @EnableJpaRepositories("com.mycompany.myapp.repository")
import javax.inject.Inject; import javax.sql.DataSource;
5,375
import java.util.Arrays; @Configuration @EnableJpaRepositories("com.mycompany.myapp.repository") @EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware") @EnableTransactionManagement <BUG>public class DatabaseConfiguration implements EnvironmentAware { private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class); private RelaxedPropertyResolver dataSourcePropertyResolver; private RelaxedPropertyResolver liquiBasePropertyResolver; private RelaxedPropertyResolver jhipsterPropertyResolver;</BUG> private Environment env;
public class DatabaseConfiguration { @Inject
5,376
private RelaxedPropertyResolver liquiBasePropertyResolver; private RelaxedPropertyResolver jhipsterPropertyResolver;</BUG> private Environment env; @Autowired(required = false) private MetricRegistry metricRegistry; <BUG>@Override public void setEnvironment(Environment env) { this.env = env; this.dataSourcePropertyResolver = new RelaxedPropertyResolver(env, "spring.datasource."); this.liquiBasePropertyResolver = new RelaxedPropertyResolver(env, "liquiBase."); this.jhipsterPropertyResolver = new RelaxedPropertyResolver(env, "jhipster.datasource."); }</BUG> @Bean(destroyMethod = "close")
import java.util.Arrays; @Configuration @EnableJpaRepositories("com.mycompany.myapp.repository") @EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware") @EnableTransactionManagement public class DatabaseConfiguration { private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class); @Inject
5,377
name = entity.getJavaType().getName(); } Assert.notNull(name, "entity cannot exist without a identifier"); net.sf.ehcache.Cache cache = cacheManager.getCache(name); if (cache != null) { <BUG>cache.getCacheConfiguration().setTimeToLiveSeconds(env.getProperty("jhipster.cache.timeToLiveSeconds", Long.class, 3600L)); </BUG> net.sf.ehcache.Ehcache decoratedCache = InstrumentedEhcache.instrument(metricRegistry, cache); cacheManager.replaceCacheWithDecoratedCache(cache, decoratedCache); }
cache.getCacheConfiguration().setTimeToLiveSeconds(jHipsterProperties.getCache().getTimeToLiveSeconds());
5,378
package com.mycompany.myapp; <BUG>import com.mycompany.myapp.config.Constants; import org.slf4j.Logger;</BUG> import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.actuate.autoconfigure.MetricFilterAutoConfiguration;
import com.mycompany.myapp.config.JHipsterProperties; import org.slf4j.Logger;
5,379
import java.net.InetAddress; import java.net.UnknownHostException; import java.util.Arrays; import java.util.Collection; @ComponentScan <BUG>@EnableAutoConfiguration(exclude = {MetricFilterAutoConfiguration.class, MetricRepositoryAutoConfiguration.class}) public class Application {</BUG> private static final Logger log = LoggerFactory.getLogger(Application.class); @Inject private Environment env;
@EnableConfigurationProperties({JHipsterProperties.class, LiquibaseProperties.class}) public class Application {
5,380
@Override @Bean(name = "taskExecutor") public Executor getAsyncExecutor() { log.debug("Creating Async Task Executor"); ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); <BUG>executor.setCorePoolSize(propertyResolver.getProperty("corePoolSize", Integer.class, 2)); executor.setMaxPoolSize(propertyResolver.getProperty("maxPoolSize", Integer.class, 50)); executor.setQueueCapacity(propertyResolver.getProperty("queueCapacity", Integer.class, 10000)); executor.setThreadNamePrefix("sampletoken-Executor-");</BUG> return new ExceptionHandlingAsyncTaskExecutor(executor);
executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize()); executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize()); executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity()); executor.setThreadNamePrefix("sampletoken-Executor-");
5,381
</BUG> R result = seed; for (Map.Entry<E, MutableLong> entry : valueMap.entrySet()) { result = accumulator.apply(result, entry.getKey(), entry.getValue().value()); <BUG>if (predicate.test(entry.getKey(), entry.getValue().value(), result) == false) { </BUG> break; } } return result;
public void forEach(BiConsumer<? super E, Long> action) { action.accept(entry.getKey(), entry.getValue().value()); public <R> R forEach(final R seed, TriFunction<R, ? super E, Long, R> accumulator, final TriPredicate<? super E, Long, ? super R> conditionToBreak) { if (conditionToBreak.test(entry.getKey(), entry.getValue().value(), result)) {
5,382
public MutableDouble setValue(final double value) { this.value = value; return this; } public double getAndSet(final double value) { <BUG>double result = value; </BUG> this.value = value; return result; }
final double result = this.value;
5,383
this.value = value; return result; } public double setAndGet(final double value) { this.value = value; <BUG>return value; </BUG> } public boolean isNaN() { return Double.isNaN(value);
return this; public double getAndSet(final double value) { final double result = this.value; return this.value;
5,384
<R> R forEach(Collection<String> columnNames, int fromRowIndex, int toRowIndex, R seed, BiFunction<R, ? super Object[], R> accumulator, BiPredicate<? super Object[], ? super R> predicate); </BUG> <R> R forEach(Collection<String> columnNames, int fromRowIndex, int toRowIndex, R seed, BiFunction<R, ? super Object[], R> accumulator, <BUG>BiPredicate<? super Object[], ? super R> predicate, boolean shareRowArray); </BUG> Object[][] toArray(); Object[][] toArray(int fromRowIndex, int toRowIndex); <T> T[] toArray(Class<? extends T> rowClass); <T> T[] toArray(Class<? extends T> rowClass, int fromRowIndex, int toRowIndex);
BiPredicate<? super Object[], ? super R> conditionToBreak); BiPredicate<? super Object[], ? super R> conditionToBreak, boolean shareRowArray);
5,385
public MutableChar setValue(final char value) { this.value = value; return this; } public char getAndSet(final char value) { <BUG>char result = value; </BUG> this.value = value; return result; }
final char result = this.value;
5,386
this.value = value; return result; } public char setAndGet(final char value) { this.value = value; <BUG>return value; </BUG> } public void increment() { value++;
return this; public char getAndSet(final char value) { final char result = this.value; return this.value;
5,387
</BUG> R result = seed; for (Map.Entry<E, MutableInt> entry : valueMap.entrySet()) { result = accumulator.apply(result, entry.getKey(), entry.getValue().value()); <BUG>if (predicate.test(entry.getKey(), entry.getValue().value(), result) == false) { </BUG> break; } } return result;
public void forEach(BiConsumer<? super E, Integer> action) { action.accept(entry.getKey(), entry.getValue().value()); public <R> R forEach(final R seed, TriFunction<R, ? super E, Integer, R> accumulator, final TriPredicate<? super E, Integer, ? super R> conditionToBreak) { if (conditionToBreak.test(entry.getKey(), entry.getValue().value(), result)) {
5,388
public MutableBoolean setValue(final boolean value) { this.value = value; return this; } public boolean getAndSet(final boolean value) { <BUG>boolean result = value; </BUG> this.value = value; return result; }
final boolean result = this.value;
5,389
this.value = value; return result; } public boolean setAndGet(final boolean value) { this.value = value; <BUG>return value; </BUG> } public void setFalse() { this.value = false;
return this; public boolean getAndSet(final boolean value) { final boolean result = this.value; return this.value;
5,390
public MutableFloat setValue(final float value) { this.value = value; return this; } public float getAndSet(final float value) { <BUG>float result = value; </BUG> this.value = value; return result; }
final float result = this.value;
5,391
this.value = value; return result; } public float setAndGet(final float value) { this.value = value; <BUG>return value; </BUG> } public boolean isNaN() { return Float.isNaN(value);
return this; public float getAndSet(final float value) { final float result = this.value; return this.value;
5,392
public MutableByte setValue(final byte value) { this.value = value; return this; } public byte getAndSet(final byte value) { <BUG>byte result = value; </BUG> this.value = value; return result; }
final byte result = this.value;
5,393
this.value = value; return result; } public byte setAndGet(final byte value) { this.value = value; <BUG>return value; </BUG> } public void increment() { value++;
return this; public byte getAndSet(final byte value) { final byte result = this.value; return this.value;
5,394
public MutableLong setValue(final long value) { this.value = value; return this; } public long getAndSet(final long value) { <BUG>long result = value; </BUG> this.value = value; return result; }
final long result = this.value;
5,395
this.value = value; return result; } public long setAndGet(final long value) { this.value = value; <BUG>return value; </BUG> } public void increment() { value++;
return this; public long getAndSet(final long value) { final long result = this.value; return this.value;
5,396
public MutableInt setValue(final int value) { this.value = value; return this; } public int getAndSet(final int value) { <BUG>int result = value; </BUG> this.value = value; return result; }
final int result = this.value;
5,397
this.value = value; return result; } public int setAndGet(final int value) { this.value = value; <BUG>return value; </BUG> } public void increment() { value++;
return this; public int getAndSet(final int value) { final int result = this.value; return this.value;
5,398
package org.neo4j.server.rest; import static org.junit.Assert.assertEquals; <BUG>import java.io.IOException; import org.junit.After;</BUG> import org.junit.Before; import org.junit.Test; import org.neo4j.server.NeoServer;
import javax.ws.rs.core.MediaType; import org.junit.After;
5,399
package org.neo4j.server.rest; <BUG>import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import org.junit.After;</BUG> import org.junit.Before; import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.assertEquals; import java.io.IOException; import javax.ws.rs.core.MediaType; import org.junit.After;
5,400
server = null; } @Test public void shouldRespondWithTheWebAdminClientSettings() throws Exception { String url = functionalTestHelper.mangementUri() + "properties/neo4j-servers"; <BUG>ClientResponse response = Client.create().resource(url).get(ClientResponse.class); String json = response.getEntity(String.class);</BUG> assertEquals(200, response.getStatus()); assertThat(json, containsString("\"url\" : \"" + server.baseUri() + "db/data/\""));
ClientResponse response = Client.create().resource( url ).accept( MediaType.APPLICATION_JSON_TYPE ).get( ClientResponse.class ); String json = response.getEntity(String.class);