id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
12,801 | import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.webkit.CookieManager;
<BUG>import android.webkit.SslErrorHandler;
import android.webkit.WebView;</BUG>
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import android.widget.Toast;
| import android.webkit.WebSettings;
import android.webkit.WebView;
|
12,802 | import com.appnexus.opensdk.utils.HTTPResponse;
import com.appnexus.opensdk.utils.Settings;
import com.appnexus.opensdk.utils.StringUtil;
import com.appnexus.opensdk.utils.ViewUtil;
import com.appnexus.opensdk.utils.WebviewUtil;
<BUG>import java.net.MalformedURLException;
import java.net.URL;</BUG>
import java.util.HashMap;
@SuppressLint("ViewConstructor")
class AdWebView extends WebView implements Displayable {
| [DELETED] |
12,803 | this.getSettings().setLoadsImagesAutomatically(true);
this.getSettings().setSupportZoom(false);
this.getSettings().setUseWideViewPort(false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
this.getSettings().setMediaPlaybackRequiresUserGesture(false);
<BUG>}
this.getSettings().setAllowFileAccess(false);</BUG>
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
this.getSettings().setAllowContentAccess(false);
}
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
this.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
this.getSettings().setAllowFileAccess(false);
|
12,804 | rwidth = (int) (ad.getWidth() * scale + 0.5f);
}
AdView.LayoutParams resize = new AdView.LayoutParams(rwidth, rheight,
Gravity.CENTER);
this.setLayoutParams(resize);
<BUG>this.loadDataWithBaseURL(Settings.BASE_URL, html, "text/html", "UTF-8", null);
</BUG>
}
private String preLoadContent(String html) {
if (!StringUtil.isEmpty(html)) {
| this.loadDataWithBaseURL(Settings.getBaseUrl(), html, "text/html", "UTF-8", null);
|
12,805 | protected void onPostExecute(HTTPResponse response) {
if(response.getSucceeded()){
String html = preLoadContent(response.getResponseBody());
html = prependRawResources(html);
html = prependViewPort(html);
<BUG>loadDataWithBaseURL(Settings.BASE_URL, html, "text/html", "UTF-8", null);
</BUG>
fireMRAIDEnabled();
}
}
| loadDataWithBaseURL(Settings.getBaseUrl(), html, "text/html", "UTF-8", null);
|
12,806 | private static final String RESPONSE_KEY_NATIVE = "native";
private static final String RESPONSE_VALUE_ERROR = "error";
private static final String RESPONSE_VALUE_ANDROID = "android";
static final String EXTRAS_KEY_MRAID = "MRAID";
static final String EXTRAS_KEY_ORIENTATION = "ORIENTATION";
<BUG>public ServerResponse(String body, Header[] headers, MediaType mediaType) {
</BUG>
if (StringUtil.isEmpty(body)) {
Clog.clearLastResponse();
return;
| public ServerResponse(String body, Map<String, List<String>> headers, MediaType mediaType) {
|
12,807 | protected ServerResponse(String content, int width, int height) {
this.content = content;
this.width = width;
this.height = height;
}
<BUG>private void printHeaders(Header[] headers) {
if (headers != null) {
for (Header h : headers) {
Clog.v(Clog.httpRespLogTag,
Clog.getString(R.string.response_header, h.getName(),
h.getValue()));
}</BUG>
}
| [DELETED] |
12,808 | package org.jetbrains.jet.lang.resolve.java.resolver;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
<BUG>import org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor;
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
import org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor;
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;</BUG>
import org.jetbrains.jet.lang.resolve.BindingTrace;
| import org.jetbrains.jet.lang.descriptors.*;
|
12,809 | @Inject
public void setTrace(BindingTrace trace) {
this.trace = trace;
}
private abstract static class MemberSignature {
<BUG>private final String signatureError;
protected MemberSignature(@Nullable String signatureError) {
this.signatureError = signatureError;
</BUG>
}
| private final List<String> signatureErrors;
protected MemberSignature(@NotNull List<String> signatureErrors) {
this.signatureErrors = signatureErrors;
|
12,810 | @NotNull ClassDescriptor owner,
@NotNull JetType returnType,
@Nullable JetType receiverType,
@NotNull List<ValueParameterDescriptor> valueParameters,
@NotNull List<TypeParameterDescriptor> typeParameters
<BUG>) {
return new SignaturesPropagationData(owner, returnType, receiverType, valueParameters, typeParameters, method, trace);
}</BUG>
@SuppressWarnings("MethodMayBeStatic")
@NotNull
| SignaturesPropagationData data =
return new PropagatedMethodSignature(data.getModifiedReturnType(), data.getModifiedReceiverType(),
data.getModifiedValueParameters(), data.getModifiedTypeParameters(), data.getSignatureErrors(),
data.getSuperFunctions());
}
|
12,811 | ) {
AlternativeMethodSignatureData data =
new AlternativeMethodSignatureData(method, receiverType, valueParameters, returnType, typeParameters, hasSuperMethods);
if (data.isAnnotated() && !data.hasErrors()) {
return new AlternativeMethodSignature(data.getReturnType(), receiverType, data.getValueParameters(), data.getTypeParameters(),
<BUG>null);
}
String error = data.hasErrors() ? data.getError() : null;
return new AlternativeMethodSignature(returnType, receiverType, valueParameters, typeParameters, error);</BUG>
}
| SignaturesPropagationData data =
new SignaturesPropagationData(owner, returnType, receiverType, valueParameters, typeParameters, method, trace);
return new PropagatedMethodSignature(data.getModifiedReturnType(), data.getModifiedReceiverType(),
data.getModifiedValueParameters(), data.getModifiedTypeParameters(), data.getSignatureErrors(),
data.getSuperFunctions());
|
12,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
|
12,813 | 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++) {
|
12,814 | 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++) {
|
12,815 | 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
|
12,816 | 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++) {
|
12,817 | 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
|
12,818 | 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++) {
|
12,819 | 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
|
12,820 | 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++) {
|
12,821 | 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
|
12,822 | 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++) {
|
12,823 | 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
|
12,824 | 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++) {
|
12,825 | 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
|
12,826 | 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++) {
|
12,827 | 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++) {
|
12,828 | 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
|
12,829 | 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++) {
|
12,830 | 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
|
12,831 | 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++) {
|
12,832 | 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
|
12,833 | 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++) {
|
12,834 | 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
|
12,835 | 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++) {
|
12,836 | 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
|
12,837 | 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++) {
|
12,838 | mScanIcon = UI.find(mView, R.id.sendScanIcon);
final String btcUnit = (String) service.getUserConfig("unit");
final TextView bitcoinScale = UI.find(mView, R.id.sendBitcoinScaleText);
final TextView bitcoinUnitText = UI.find(mView, R.id.sendBitcoinUnitText);
mBitcoinFormat = CurrencyMapper.mapBtcUnitToFormat(btcUnit);
<BUG>bitcoinScale.setText(Html.fromHtml(CurrencyMapper.mapBtcUnitToPrefix(btcUnit)));
if (btcUnit == null || btcUnit.equals("bits"))</BUG>
bitcoinUnitText.setText("bits ");
else
bitcoinUnitText.setText(R.string.fa_btc_space);
| bitcoinScale.setText(CurrencyMapper.mapBtcUnitToPrefix(btcUnit));
if (btcUnit == null || btcUnit.equals("bits"))
|
12,839 | protected void onBalanceUpdated() {
final String btcUnit = (String) getGAService().getUserConfig("unit");
final TextView sendSubAccountBalance = UI.find(mView, R.id.sendSubAccountBalance);
final TextView sendSubAccountBalanceUnit = UI.find(mView, R.id.sendSubAccountBalanceUnit);
final TextView sendSubAccountBitcoinScale = UI.find(mView, R.id.sendSubAccountBitcoinScale);
<BUG>sendSubAccountBitcoinScale.setText(Html.fromHtml(CurrencyMapper.mapBtcUnitToPrefix(btcUnit)));
if (btcUnit == null || btcUnit.equals("bits")) {</BUG>
sendSubAccountBalanceUnit.setText("");
sendSubAccountBitcoinScale.setText("bits ");
} else {
| sendSubAccountBitcoinScale.setText(CurrencyMapper.mapBtcUnitToPrefix(btcUnit));
if (btcUnit == null || btcUnit.equals("bits")) {
|
12,840 | if (bitcoinFormat.code().equals(MonetaryFormat.CODE_BTC))
return "";
if (bitcoinFormat.code().equals(MonetaryFormat.CODE_MBTC))
return "m";
if (bitcoinFormat.code().equals(MonetaryFormat.CODE_UBTC))
<BUG>return "µ";
if (bitcoinFormat.code().equals("bits"))</BUG>
return "";
return null;
}
| return MICRO;
if (bitcoinFormat.code().equals("bits"))
|
12,841 | getPreferenceScreen().removePreference(resetPin);
}
final ListPreference fiatCurrency = find("fiat_key");
final ListPreference bitcoinDenomination = find("denomination_key");
final ArrayList<String> units;
<BUG>units = Lists.newArrayList("BTC", "mBTC", mMicroSymbol + "BTC", "bits");
</BUG>
bitcoinDenomination.setEntries(units.toArray(new String[4]));
bitcoinDenomination.setEntryValues(units.toArray(new String[4]));
bitcoinDenomination.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
| units = Lists.newArrayList("BTC", "mBTC", "\u00B5BTC", "bits");
|
12,842 | final TextView bitcoinScale = UI.find(view, R.id.sendBitcoinScaleText);
final TextView bitcoinUnitText = UI.find(view, R.id.sendBitcoinUnitText);
final FontAwesomeTextView fiatView = UI.find(view, R.id.sendFiatIcon);
final String btcUnit = (String) mGaService.getUserConfig("unit");
mBitcoinFormat = CurrencyMapper.mapBtcUnitToFormat(btcUnit);
<BUG>bitcoinScale.setText(Html.fromHtml(CurrencyMapper.mapBtcUnitToPrefix(btcUnit)));
if (btcUnit == null || btcUnit.equals("bits"))</BUG>
bitcoinUnitText.setText("bits ");
else
bitcoinUnitText.setText(R.string.fa_btc_space);
| bitcoinScale.setText(CurrencyMapper.mapBtcUnitToPrefix(btcUnit));
if (btcUnit == null || btcUnit.equals("bits"))
|
12,843 | public static String getWorkAtURI(long id) {
return BLANK_NODE + "work" + String.format("%020d", id );
}
public static String getKnowsURI(long id) {
return BLANK_NODE + "knows" + String.format("%020d", id);
<BUG>}
public static Long formId(long id) {</BUG>
long lowMask = 0x0FFFFF; // This mask is used to get the lowest 20 bits.
long lowerPart = (lowMask & id);
long machinePart = machineId << 20;
| public static String getTagClassURI(long id) {
return BLANK_NODE + "tagclass" + String.format("%06d", id);
public static Long formId(long id) {
|
12,844 | public static final String id = PREFIX + "id";
public static final String Name = PREFIX + "Name";
public static final String Organisation = PREFIX + "Organisation";
public static final String Tag = PREFIX + "Tag";
public static final String TagClass = PREFIX + "TagClass";
<BUG>public static final String isPartOf = PREFIX + "isPartOf";
public static String prefixed(String string) {</BUG>
return PREFIX + string;
}
public static String getUrl(String string) {
| public static final String url = PREFIX + "url";
public static String prefixed(String string) {
|
12,845 | if (r < 0)
r += (i + 1);
perm[i] = source[r];
permGradIndex3D[i] = (short) ((perm[i] % (gradients3D.length / 3)) * 3);
source[r] = source[i];
<BUG>}
}</BUG>
public double eval(double x, double y) {
double stretchOffset = (x + y) * STRETCH_CONSTANT_2D;
double xs = x + stretchOffset;
| private static int fastFloor(double x) {
int xi = (int) x;
return x < xi ? xi - 1 : xi;
|
12,846 | import java.util.HashSet;
import java.util.PriorityQueue;
public class ChunkPathfinder {
private PathNode2d[][] nodes;
public ChunkPathfinder() {
<BUG>nodes = new PathNode2d[Chunk.xSize][Chunk.ySize];
for (int x = 0; x < Chunk.xSize; x++) {
for (int y = 0; y < Chunk.ySize; y++) {
</BUG>
nodes[x][y] = new PathNode2d(x, y);
| nodes = new PathNode2d[ExampleChunk.xSize][ExampleChunk.ySize];
for (int x = 0; x < ExampleChunk.xSize; x++) {
for (int y = 0; y < ExampleChunk.ySize; y++) {
|
12,847 | continue;
}
}
int xp = x + current.x;
int yp = y + current.y;
<BUG>if (xp < 0 || yp < 0 || xp >= Chunk.xSize || yp >= Chunk.ySize)
</BUG>
continue;
if (mover2d.canTraverse(chunk, sx, sy, xp, yp)) {
float nextStepCost = current.cost + mover2d.getCost(current.x, current.y, xp, yp);
| if (!allowDiag) {
if ((x != 0) && (y != 0)) {
if (xp < 0 || yp < 0 || xp >= ExampleChunk.xSize || yp >= ExampleChunk.ySize)
|
12,848 | </BUG>
}
@Override
public int getYSize() {
<BUG>return regionY * Chunk.ySize;
</BUG>
}
@Override
public boolean isOutsideMap(int tx, int ty) {
return (tx < 0 || ty < 0 || tx >= getXSize() || ty >= getYSize());
| public int getXSize() {
return regionX * ExampleChunk.xSize;
return regionY * ExampleChunk.ySize;
|
12,849 | super.onCreate(savedInstanceState);
this.mTokenType = ((MyAttentionActivity) getActivity()).mTokenType;
this.mTokenAccess = ((MyAttentionActivity) getActivity()).mTokenAccess;
}
@Override
<BUG>protected void getHttpFirst() {
Subscription s = getMyFollowingBoard(mTokenType, mTokenAccess, mIndex, mLimit)
</BUG>
.map(new Func1<FollowingBoardListBean, List<BoardPinsBean>>() {
| [DELETED] |
12,850 | </BUG>
.map(new Func1<FollowingBoardListBean, List<BoardPinsBean>>() {
@Override
public List<BoardPinsBean> call(FollowingBoardListBean followingBoardListBean) {
return followingBoardListBean.getBoards();
<BUG>}
})
.doOnUnsubscribe(new Action0() {
@Override
public void call() {
Logger.d("Unsubscribe");</BUG>
}
| super.onCreate(savedInstanceState);
this.mTokenType = ((MyAttentionActivity) getActivity()).mTokenType;
this.mTokenAccess = ((MyAttentionActivity) getActivity()).mTokenAccess;
protected Subscription getHttpFirst() {
return getMyFollowingBoard(mTokenType, mTokenAccess, mIndex, mLimit)
|
12,851 | if (this.mCompositeSubscription == null) {
this.mCompositeSubscription = new CompositeSubscription();
}
return this.mCompositeSubscription;
}
<BUG>public void addSubscription(Subscription s) {
if (this.mCompositeSubscription == null) {</BUG>
this.mCompositeSubscription = new CompositeSubscription();
}
this.mCompositeSubscription.add(s);
| if (s==null){
return;
|
12,852 | import licola.demo.com.huabandemo.HttpUtils.RetrofitPinsRx;
import licola.demo.com.huabandemo.View.LoadingFooter;
import licola.demo.com.huabandemo.View.recyclerview.HeaderAndFooterRecyclerViewAdapter;
import licola.demo.com.huabandemo.View.recyclerview.RecyclerViewUtils;
import rx.Observable;
<BUG>import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;</BUG>
import rx.functions.Action0;
import rx.functions.Func1;
import rx.schedulers.Schedulers;
| import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
|
12,853 | public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mSwipeRefresh.setColorSchemeResources(R.color.pink_300, R.color.pink_500, R.color.pink_700, R.color.pink_900);
initRecyclerView();
initListener();
<BUG>getHttpFirstAndRefresh(type, limit);//默认的联网,区分于滑动的联网加载
}</BUG>
private void initRecyclerView() {
StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
mAdapter = new RecyclerPinsHeadCardAdapter(mRecyclerView);//正常adapter的初始化
| getHttpFirstAndRefresh();//默认的联网,区分于滑动的联网加载
}
|
12,854 | public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if (RecyclerView.SCROLL_STATE_IDLE == newState) {
int size = (int) (mAdapter.getItemCount() * percentageScroll);
if (mAdapter.getAdapterPosition() >= --size) {
<BUG>getHttpMaxId(type, mMaxId, limit);
}</BUG>
} else if (RecyclerView.SCROLL_STATE_DRAGGING == newState) {
} else {
}
| getHttpMaxId(mMaxId);
|
12,855 | } else if (RecyclerView.SCROLL_STATE_DRAGGING == newState) {
} else {
}
}
});
<BUG>}
private void getHttpMaxId(String type, int max, final int limit) {
Observable<ListPinsBean> observable = RetrofitPinsRx.service.httpTypeMaxLimitRx(type, max, limit);
observable</BUG>
.map(new Func1<ListPinsBean, List<PinsAndUserEntity>>() {
| private void getHttpMaxId(int max) {
Subscription s= getPinsMax(type,max,limit)
|
12,856 | public void onNext(List<PinsAndUserEntity> result) {
Logger.d();
mMaxId = getMaxId(result);
mAdapter.setList(result);
}
<BUG>});
}</BUG>
private void setRecyclerProgressVisibility(boolean isShowRecycler) {
if (mRecyclerView != null) {
mRecyclerView.setVisibility(isShowRecycler ? View.VISIBLE : View.GONE);
| addSubscription(s);
|
12,857 | .setIsCircle(true)
.build();
mTVUserName.setText(username);
}
@Override
<BUG>protected void getHttpFirst() {
getBoardPins(mKey, mLimit)
</BUG>
.subscribeOn(Schedulers.io())
| protected Subscription getHttpFirst() {
return getBoardPins(mKey, mLimit)
|
12,858 | }
private int getMaxId(List<PinsAndUserEntity> result) {
return result.get(result.size() - 1).getPin_id();
}
@Override
<BUG>protected void getHttpScroll() {
getBoardPinsMax(mKey, mMaxId, mLimit)
</BUG>
.subscribeOn(Schedulers.io())
| mTVBoardGather.setText(String.format(mStringGatherNumber, gather));
mTVBoardAttention.setText(String.format(mStringAttentionNumber, attention));
private void setBoardUserInfo(String url_head, String username) {
new ImageLoadFresco.LoadImageFrescoBuilder(getContext(), mImageUser, url_head)
.setIsCircle(true)
.build();
mTVUserName.setText(username);
protected Subscription getHttpFirst() {
return getBoardPins(mKey, mLimit)
|
12,859 | null,
null);
}
}
@Override
<BUG>protected void getHttpOther() {
getPinsDetail(mKey)
</BUG>
.subscribeOn(Schedulers.io())
| protected Subscription getHttpOther() {
return getPinsDetail(mKey)
|
12,860 | setImageInfo(pinsDetailBean);
}
});
}
@Override
<BUG>protected void getHttpFirst() {
getRecommend(mKey, mIndex, mLimit)
</BUG>
.filter(new Func1<List<PinsAndUserEntity>, Boolean>() {
| [DELETED] |
12,861 | mIndex++;//联网成功 +1
}
});
}
@Override
<BUG>protected void getHttpScroll() {
getHttpFirst();
</BUG>
}
| [DELETED] |
12,862 | import butterknife.BindString;
import licola.demo.com.huabandemo.R;
import licola.demo.com.huabandemo.Util.Constant;
import licola.demo.com.huabandemo.View.LoadingFooter;
import licola.demo.com.huabandemo.View.recyclerview.HeaderAndFooterRecyclerViewAdapter;
<BUG>import licola.demo.com.huabandemo.View.recyclerview.RecyclerViewUtils;
import rx.functions.Func1;</BUG>
public abstract class BaseRecyclerHeadFragment
<T extends RecyclerView.Adapter, K extends List> extends BaseFragment {
protected static final String TYPE_KEY = "KEY";//搜索关键字的key值
| import rx.Subscription;
import rx.functions.Func1;
|
12,863 | public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if (RecyclerView.SCROLL_STATE_IDLE == newState) {
int size = (int) (mAdapter.getItemCount() * percentageScroll);
if (getAdapterPosition() >= --size && isScorllLisener) {
<BUG>getHttpScroll();
}</BUG>
} else if (RecyclerView.SCROLL_STATE_DRAGGING == newState) {
} else {
}
| addSubscription(getHttpScroll());
|
12,864 | package licola.demo.com.huabandemo.Main;
<BUG>import android.app.Activity;
import android.content.Intent;</BUG>
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.NavigationView;
| import android.content.Context;
import android.content.Intent;
|
12,865 | import licola.demo.com.huabandemo.Base.BaseActivity;
import licola.demo.com.huabandemo.ImageDetail.ImageDetailActivity;
import licola.demo.com.huabandemo.Login.LoginActivity;
import licola.demo.com.huabandemo.My.MyAttentionActivity;
import licola.demo.com.huabandemo.R;
<BUG>import licola.demo.com.huabandemo.Search.SearchActivity;
import licola.demo.com.huabandemo.Util.Constant;</BUG>
import licola.demo.com.huabandemo.Util.Logger;
import licola.demo.com.huabandemo.Util.SPUtils;
import licola.demo.com.huabandemo.Util.Utils;
| import licola.demo.com.huabandemo.Setting.SettingsActivity;
import licola.demo.com.huabandemo.Util.Constant;
|
12,866 | @SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
if (item.getGroupId()==R.id.menu_group_type){
selectFragment(item.getItemId());
<BUG>}else {
Logger.d(item.getTitle().toString());</BUG>
}
mDrawerLayout.closeDrawer(GravityCompat.START);
return true;
| if (item.getItemId()==R.id.nav_set){
SettingsActivity.launch(this);
Logger.d(item.getTitle().toString());
|
12,867 | package no.cantara.jau;
import no.cantara.jau.coms.CheckForUpdateHelper;
<BUG>import no.cantara.jau.coms.RegisterClientHelper;
import no.cantara.jau.serviceconfig.client.ConfigServiceClient;</BUG>
import no.cantara.jau.serviceconfig.client.ConfigurationStoreUtil;
import no.cantara.jau.serviceconfig.client.DownloadUtil;
import no.cantara.jau.serviceconfig.dto.ClientConfig;
| import no.cantara.jau.processkill.DuplicateProcessHandler;
import no.cantara.jau.processkill.ProcessAdapter;
import no.cantara.jau.serviceconfig.client.ConfigServiceClient;
|
12,868 | private static final Logger log = LoggerFactory.getLogger(JavaAutoUpdater.class);
private static ScheduledFuture<?> processMonitorHandle;
private static ScheduledFuture<?> updaterHandle;
private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
private final ConfigServiceClient configServiceClient;
<BUG>private final ApplicationProcess processHolder;
private final String artifactId;</BUG>
private final String clientName;
public JavaAutoUpdater(ConfigServiceClient configServiceClient, String artifactId, String workingDirectory, String clientName) {
this.configServiceClient = configServiceClient;
| private final DuplicateProcessHandler duplicateProcessHandler;
private final String artifactId;
|
12,869 | <BUG>package no.cantara.jau;
import org.slf4j.Logger;</BUG>
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
| import no.cantara.jau.processkill.DuplicateProcessHandler;
import no.cantara.jau.processkill.ProcessAdapter;
import org.slf4j.Logger;
|
12,870 | package com.streamsets.pipeline.stage.origin.jdbc.table;
import com.streamsets.pipeline.api.ConfigDef;
<BUG>import com.streamsets.pipeline.api.ListBeanModel;
import com.streamsets.pipeline.api.Source;</BUG>
import com.streamsets.pipeline.api.Stage;
import com.streamsets.pipeline.api.ValueChooserModel;
import com.streamsets.pipeline.config.TimeZoneChooserValues;
| import com.streamsets.pipeline.api.PushSource;
import com.streamsets.pipeline.api.Source;
|
12,871 | package com.streamsets.pipeline.stage.origin.jdbc.table;
import com.streamsets.pipeline.api.ConfigDefBean;
import com.streamsets.pipeline.api.ConfigGroups;
import com.streamsets.pipeline.api.ExecutionMode;
<BUG>import com.streamsets.pipeline.api.GenerateResourceBundle;
import com.streamsets.pipeline.api.Source;
import com.streamsets.pipeline.api.StageDef;
import com.streamsets.pipeline.configurablestage.DSource;</BUG>
import com.streamsets.pipeline.lib.jdbc.HikariPoolConfigBean;
| import com.streamsets.pipeline.api.PushSource;
import com.streamsets.pipeline.configurablestage.DPushSource;
import com.streamsets.pipeline.configurablestage.DSource;
|
12,872 | resetOffset = true,
onlineHelpRefUrl = "index.html#Origins/MultiTableJDBCConsumer.html#task_kst_m4w_4y"
)
@ConfigGroups(value = Groups.class)
@GenerateResourceBundle
<BUG>public final class TableJdbcDSource extends DSource {
</BUG>
@ConfigDefBean
public TableJdbcConfigBean tableJdbcConfigBean;
@ConfigDefBean
| public final class TableJdbcDSource extends DPushSource {
|
12,873 | JDBC_68("Tables Referring to each other in cyclic fashion."),
JDBC_69("Unsupported Offset Column Types. {}"),
JDBC_70("Unsupported operation in record header: {}"),
JDBC_71("Invalid State. Mismatch in offset columns for table {}. Stored offset columns: {}, Specified Offset Columns: {}"),
JDBC_72("Invalid Start offset(s) for table '{}'. Invalid Offset Columns With Values '{}'"),
<BUG>JDBC_73("Error Evaluating Expression {}. Reason : {}"),
;</BUG>
private final String msg;
JdbcErrors(String msg) {
this.msg = msg;
| JDBC_74("Max Pool Size '{}' should be at least one more than the Number Of Threads '{}'"),
JDBC_75("Jdbc Runner Failed. Reason {}"),
|
12,874 | public static boolean debugMode = false;
@ModConfigProperty(category = "Debug", name = "debugModeGOTG", comment = "Enable/Disable Debug Mode for the Gift Of The Gods")
public static boolean debugModeGOTG = false;
@ModConfigProperty(category = "Debug", name = "debugModeEnchantments", comment = "Enable/Disable Debug Mode for the Enchantments")
public static boolean debugModeEnchantments = false;
<BUG>@ModConfigProperty(category = "Weapons", name = "enableSwordsRecipes", comment = "Enable/Disable The ArmorPlus Sword's Recipes")
public static boolean enableSwordsRecipes = true;
@ModConfigProperty(category = "Weapons", name = "enableBattleAxesRecipes", comment = "Enable/Disable The ArmorPlus Battle Axes's Recipes")
public static boolean enableBattleAxesRecipes = true;
@ModConfigProperty(category = "Weapons", name = "enableBowsRecipes", comment = "Enable/Disable The ArmorPlus Bows's Recipes")
public static boolean enableBowsRecipes = true;
@ModConfigProperty(category = "Armors.SuperStarArmor.Effects", name = "enableSuperStarHRegen", comment = "Enable/Disable The Super Star Helmet Regeneration")
</BUG>
public static boolean enableSuperStarHRegen = true;
| @ModConfigProperty(category = "Weapons", name = "enableSwordsRecipes", comment = "Enable/Disable ArmorPlus Sword's Recipes")
@ModConfigProperty(category = "Weapons", name = "enableBattleAxesRecipes", comment = "Enable/Disable ArmorPlus Battle Axes's Recipes")
@ModConfigProperty(category = "Weapons", name = "enableBowsRecipes", comment = "Enable/Disable ArmorPlus Bows's Recipes")
|
12,875 | 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;
|
12,876 | 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);
|
12,877 | 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;
|
12,878 | 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;
|
12,879 | 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;
|
12,880 | 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"),
|
12,881 | 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] |
12,882 | 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) {
|
12,883 | 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;
|
12,884 | moduleProps.put(key.substring(prefixLength), entry.getValue());
}
}
return moduleProps;
}
<BUG>private static File locatePropertiesFile(Properties props, String homeKey, String relativePathFromHome, String settingsKey) {
File settingsFile = null;
</BUG>
String runnerHome = props.getProperty(homeKey, "");
| private static Path locatePropertiesFile(Properties props, String homeKey, String relativePathFromHome, String settingsKey) {
Path settingsFile = null;
|
12,885 | public String getThreadNamePattern() {
return threadNamePattern;
}
@Override
public void setThreadNamePattern(String threadNamePattern) {
<BUG>String name = threadNamePattern.replaceFirst("#camelId#", this.camelContext.getName());
this.threadNamePattern = name;</BUG>
}
@Override
| this.threadNamePattern = threadNamePattern.replaceFirst("#camelId#", this.camelContext.getName());
|
12,886 | profile.addDefaults(defaultProfile);
ThreadFactory threadFactory = createThreadFactory(sanitizedName, true);
ExecutorService executorService = threadPoolFactory.newThreadPool(profile, threadFactory);
onThreadPoolCreated(executorService, source, profile.getId());
if (LOG.isDebugEnabled()) {
<BUG>LOG.debug("Created new ThreadPool for source: {} with name: {}. -> {}", new Object[]{source, sanitizedName, executorService});
}</BUG>
return executorService;
}
@Override
| LOG.debug("Created new ThreadPool for source: {} with name: {}. -> {}", source, sanitizedName, executorService);
|
12,887 | public ExecutorService newCachedThreadPool(Object source, String name) {
String sanitizedName = URISupport.sanitizeUri(name);
ExecutorService answer = threadPoolFactory.newCachedThreadPool(createThreadFactory(sanitizedName, true));
onThreadPoolCreated(answer, source, null);
if (LOG.isDebugEnabled()) {
<BUG>LOG.debug("Created new CachedThreadPool for source: {} with name: {}. -> {}", new Object[]{source, sanitizedName, answer});
}</BUG>
return answer;
}
@Override
| LOG.debug("Created new CachedThreadPool for source: {} with name: {}. -> {}", source, sanitizedName, answer);
|
12,888 | LOG.debug("Forcing shutdown of ExecutorService: {}", executorService);
}
answer = executorService.shutdownNow();
if (LOG.isTraceEnabled()) {
LOG.trace("Shutdown of ExecutorService: {} is shutdown: {} and terminated: {}.",
<BUG>new Object[]{executorService, executorService.isShutdown(), executorService.isTerminated()});
}</BUG>
}
ThreadPoolExecutor threadPool = null;
if (executorService instanceof ThreadPoolExecutor) {
| executorService, executorService.isShutdown(), executorService.isTerminated());
|
12,889 | }
}
onNewExecutorService(executorService);
}
private ThreadFactory createThreadFactory(String name, boolean isDaemon) {
<BUG>ThreadFactory threadFactory = new CamelThreadFactory(threadNamePattern, name, isDaemon);
return threadFactory;</BUG>
}
}
| if (!failSafe) {
executorServices.remove(executorService);
|
12,890 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\"")));
}
| return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
12,891 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, sum, fib));
}
| return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
12,892 | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
<BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39)
.process(() -> 9999L);
Task<String> task2 = Task.ofType(String.class).named("Baz", 40)
.in(() -> task1)</BUG>
.ins(() -> singletonList(task1))
| Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
|
12,893 | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef")
.process(() -> instanceField + " causes an outer reference");</BUG>
serialize(task);
}
@Test
| Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
|
12,894 | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef")
.process(() -> local + " won't cause an outer reference");</BUG>
serialize(task);
Task<String> des = deserialize();
context.evaluate(des).consume(val);
| Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
|
12,895 | }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
<BUG>return Task.ofType(String.class).named("StandardArgs", first, second)
.process(() -> second + " " + first * 100);</BUG>
}
@Test
public void shouldParseFlags() throws Exception {
| return Task.named("StandardArgs", first, second).ofType(String.class)
.process(() -> second + " " + first * 100);
|
12,896 | assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
<BUG>return Task.ofType(String.class).named("Enums", enm)
.process(enm::toString);</BUG>
}
@Test
public void shouldParseCustomTypes() throws Exception {
| return Task.named("Enums", enm).ofType(String.class)
.process(enm::toString);
|
12,897 | assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
<BUG>return Task.ofType(String.class).named("Types", myType.content)
.process(() -> myType.content);</BUG>
}
public enum CustomEnum {
BAR
| return Task.named("Types", myType.content).ofType(String.class)
.process(() -> myType.content);
|
12,898 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() -> n);
| TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
12,899 | Schema segmentSchema = schema.toAnonymousSchema();
List<Segment> segments = segmentation.getSegments();
List<MiningModel> models = new ArrayList<>();
List<String> targetCategories = schema.getTargetCategories();
for(int i = 0; i < targetCategories.size(); i++){
<BUG>String targetCategory = targetCategories.get(i);
OutputField xgbValue = createPredictedField(FieldName.create("xgbValue_" + targetCategory));
Expression expression = PMMLUtil.createApply("exp", PMMLUtil.createApply("+", new FieldRef(xgbValue.getName()), PMMLUtil.createConstant(base_score)));
OutputField transformedValue = createTransformedField(FieldName.create("transformedValue_" + targetCategory), expression);</BUG>
List<Segment> valueSegments = getColumn(segments, i, (segments.size() / targetCategories.size()), targetCategories.size());
| Output valueOutput = encodeOutput(targetCategory);
|
12,900 | import org.jpmml.converter.mining.MiningModelUtil;
public class PoissonRegression extends Regression {
@Override
public MiningModel encodeMiningModel(Segmentation segmentation, float base_score, Schema schema){
Schema segmentSchema = schema.toAnonymousSchema();
<BUG>Output output = encodeOutput(base_score);
MiningModel miningModel = new MiningModel(MiningFunction.REGRESSION, ModelUtil.createMiningSchema(segmentSchema))
.setSegmentation(segmentation)
.setOutput(output);</BUG>
return MiningModelUtil.createRegression(schema, miningModel);
| Output output = encodeOutput();
.setTargets(createTargets(base_score, segmentSchema))
.setOutput(output);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.