id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
16,501 | 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++) {
|
16,502 | 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
|
16,503 | 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++) {
|
16,504 | 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
|
16,505 | 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++) {
|
16,506 | 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
|
16,507 | 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++) {
|
16,508 | 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
|
16,509 | 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++) {
|
16,510 | double[] doubles;
if (length < VALUE_CACHE_SIZE) {
doubles = doublesValuesCache.get().get()[length];
} else {
doubles = new double[length];
<BUG>}
int i = 0;
for (int[] ordinal : ordinals) {
int loc = ordinal[docId];
if (loc != 0) {
doubles[i++] = values[loc];
}</BUG>
}
| for (int i = 0; i < length; i++) {
doubles[i] = values[ordinals[i][docId]];
|
16,511 | }
@Override
public byte[] values(int docId) {
int length = 0;
for (int[] ordinal : ordinals) {
<BUG>if (ordinal[docId] != 0) {
length++;
}</BUG>
}
| [DELETED] |
16,512 | byte[] bytes;
if (length < VALUE_CACHE_SIZE) {
bytes = valuesCache.get().get()[length];
} else {
bytes = new byte[length];
<BUG>}
int i = 0;
for (int[] ordinal : ordinals) {
int loc = ordinal[docId];
if (loc != 0) {
bytes[i++] = values[loc];
}</BUG>
}
| for (int i = 0; i < length; i++) {
bytes[i] = values[ordinals[i][docId]];
|
16,513 | double[] doubles;
if (length < VALUE_CACHE_SIZE) {
doubles = valuesCache.get().get()[length];
} else {
doubles = new double[length];
<BUG>}
int i = 0;
for (int[] ordinal : ordinals) {
int loc = ordinal[docId];
if (loc != 0) {
doubles[i++] = values[loc];
}</BUG>
}
| for (int i = 0; i < length; i++) {
doubles[i] = values[ordinals[i][docId]];
|
16,514 | package com.intellij.diagnostic;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
<BUG>import com.intellij.openapi.ui.Messages;
public class TestMessageBoxAction extends AnAction {
public TestMessageBoxAction() {</BUG>
super("Test message box");
}
| import com.intellij.openapi.util.text.StringUtil;
import java.util.Random;
private final Random myRandom = new Random();
public TestMessageBoxAction() {
|
16,515 | 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
|
16,516 | 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++) {
|
16,517 | 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++) {
|
16,518 | 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
|
16,519 | 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++) {
|
16,520 | 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
|
16,521 | 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++) {
|
16,522 | 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
|
16,523 | 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++) {
|
16,524 | 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
|
16,525 | 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++) {
|
16,526 | 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
|
16,527 | 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++) {
|
16,528 | @Override
public int compare(Object obj1, Object obj2) {
Layout layout1 = (Layout)obj1;
Layout layout2 = (Layout)obj2;
int value = 0;
<BUG>int priority1 = layout1.getPriority();
int priority2 = layout2.getPriority();
</BUG>
if (priority1 > priority2) {
| int priority1 = layout1 == null ? -1 : layout1.getPriority();
int priority2 = layout2 == null ? -1 : layout2.getPriority();
|
16,529 | if (connect(isProducer)) {
break;
}
} catch (InvalidSelectorException e) {
throw new ConnectionException(
<BUG>"Connection to JMS failed. Invalid message selector");
} catch (JMSException | NamingException e) {
logger.log(LogLevel.ERROR, "RECONNECTION_EXCEPTION",
</BUG>
new Object[] { e.toString() });
| Messages.getString("CONNECTION_TO_JMS_FAILED_INVALID_MSG_SELECTOR")); //$NON-NLS-1$
logger.log(LogLevel.ERROR, "RECONNECTION_EXCEPTION", //$NON-NLS-1$
|
16,530 | private synchronized void createConnectionNoRetry() throws ConnectionException {
if (!isConnectValid()) {
try {
connect(isProducer);
} catch (JMSException e) {
<BUG>logger.log(LogLevel.ERROR, "Connection to JMS failed", new Object[] { e.toString() });
throw new ConnectionException(
"Connection to JMS failed. Did not try to reconnect as the policy is reconnection policy does not apply here.");
}</BUG>
}
| logger.log(LogLevel.ERROR, "CONNECTION_TO_JMS_FAILED", new Object[] { e.toString() }); //$NON-NLS-1$
Messages.getString("CONNECTION_TO_JMS_FAILED_NO_RECONNECT_AS_RECONNECT_POLICY_DOES_NOT_APPLY")); //$NON-NLS-1$
|
16,531 | boolean res = false;
int count = 0;
do {
try {
if(count > 0) {
<BUG>logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count });
</BUG>
Thread.sleep(messageRetryDelay);
}
synchronized (getSession()) {
| logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count }); //$NON-NLS-1$
|
16,532 | getProducer().send(message);
res = true;
}
}
catch (JMSException e) {
<BUG>logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() });
logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT");
</BUG>
setConnect(null);
| logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() }); //$NON-NLS-1$
logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT"); //$NON-NLS-1$
|
16,533 | import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import com.ibm.streams.operator.Attribute;
import com.ibm.streams.operator.StreamSchema;
import com.ibm.streams.operator.Type;
<BUG>import com.ibm.streams.operator.Type.MetaType;
class ConnectionDocumentParser {</BUG>
private static final Set<String> supportedSPLTypes = new HashSet<String>(Arrays.asList("int8", "uint8", "int16", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"uint16", "int32", "uint32", "int64", "float32", "float64", "boolean", "blob", "rstring", "uint64", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
"decimal32", "decimal64", "decimal128", "ustring", "timestamp", "xml")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
| import com.ibm.streamsx.messaging.jms.Messages;
class ConnectionDocumentParser {
|
16,534 | return msgClass;
}
private void convertProviderURLPath(File applicationDir) throws ParseConnectionDocumentException {
if(!isAMQ()) {
if(this.providerURL == null || this.providerURL.trim().length() == 0) {
<BUG>throw new ParseConnectionDocumentException("A value must be specified for provider_url attribute in connection document");
}</BUG>
try {
URL url = new URL(providerURL);
if("file".equalsIgnoreCase(url.getProtocol())) { //$NON-NLS-1$
| throw new ParseConnectionDocumentException(Messages.getString("PROVIDER_URL_MUST_BE_SPECIFIED_IN_CONN_DOC")); //$NON-NLS-1$
|
16,535 | URL absProviderURL = new URL(url.getProtocol(), url.getHost(), applicationDir.getAbsolutePath() + File.separator + path);
this.providerURL = absProviderURL.toExternalForm();
}
}
} catch (MalformedURLException e) {
<BUG>throw new ParseConnectionDocumentException("Invalid provider_url value detected: " + e.getMessage());
}</BUG>
}
}
public void parseAndValidateConnectionDocument(String connectionDocument, String connection, String access,
| throw new ParseConnectionDocumentException(Messages.getString("INVALID_PROVIDER_URL", e.getMessage())); //$NON-NLS-1$
|
16,536 | for (int j = 0; j < accessSpecChildNodes.getLength(); j++) {
if (accessSpecChildNodes.item(j).getNodeName().equals("destination")) { //$NON-NLS-1$
destIndex = j;
} else if (accessSpecChildNodes.item(j).getNodeName().equals("uses_connection")) { //$NON-NLS-1$
if (!connection.equals(accessSpecChildNodes.item(j).getAttributes().getNamedItem("connection") //$NON-NLS-1$
<BUG>.getNodeValue())) {
throw new ParseConnectionDocumentException("The value of the connection parameter "
+ connection + " is not the same as the connection used by access element "
+ access + " as mentioned in the uses_connection element in connections document");</BUG>
}
| throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_CONNECTION_PARAM_NOT_THE_SAME_AS_CONN_USED_BY_ACCESS_ELEMENT", connection, access )); //$NON-NLS-1$
|
16,537 | nativeSchema = access_specification.item(i).getChildNodes().item(nativeSchemaIndex);
}
break;
}
}
<BUG>if (!accessFound) {
throw new ParseConnectionDocumentException("The value of the access parameter " + access
+ " is not found in the connections document");</BUG>
}
return nativeSchema;
| throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_ACCESS_PARAM_NOT_FOUND_IN_CONN_DOC", access )); //$NON-NLS-1$
|
16,538 | nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$
.getNodeValue()));
}
if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22)
&& ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema
<BUG>.getAttribute(nativeAttrName).getType().getMetaType() == Type.MetaType.BLOB))) {
throw new ParseConnectionDocumentException(" Blob data type is not supported for message class "
+ msgClass);</BUG>
}
Iterator<NativeSchema> it = nativeSchemaObjects.iterator();
| throw new ParseConnectionDocumentException(Messages.getString("BLOB_NOT_SUPPORTED_FOR_MSG_CLASS", msgClass)); //$NON-NLS-1$
|
16,539 | throw new ParseConnectionDocumentException(" Blob data type is not supported for message class "
+ msgClass);</BUG>
}
Iterator<NativeSchema> it = nativeSchemaObjects.iterator();
while (it.hasNext()) {
<BUG>if (it.next().getName().equals(nativeAttrName)) {
throw new ParseConnectionDocumentException("Parameter name: " + nativeAttrName
+ " is appearing more than once In native schema file");</BUG>
}
}
| nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$
.getNodeValue()));
if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22)
&& ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema
.getAttribute(nativeAttrName).getType().getMetaType() == Type.MetaType.BLOB))) {
throw new ParseConnectionDocumentException(Messages.getString("BLOB_NOT_SUPPORTED_FOR_MSG_CLASS", msgClass)); //$NON-NLS-1$
throw new ParseConnectionDocumentException(Messages.getString("PARAMETER_NOT_UNIQUE_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
|
16,540 | if (msgClass == MessageClass.text) {
typesWithLength = new HashSet<String>(Arrays.asList("Bytes")); //$NON-NLS-1$
}
Set<String> typesWithoutLength = new HashSet<String>(Arrays.asList("Byte", "Short", "Int", "Long", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"Float", "Double", "Boolean")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
<BUG>if (typesWithoutLength.contains(nativeAttrType) && nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) {
throw new ParseConnectionDocumentException("Length attribute should not be present for parameter: "
+ nativeAttrName + " In native schema file");</BUG>
}
if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA)
| throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
|
16,541 | if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA)
&& (msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22 || msgClass == MessageClass.xml)
&& (streamSchema.getAttribute(nativeAttrName) != null)
&& (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.RSTRING)
&& (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.USTRING)
<BUG>&& (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.BLOB)) {
throw new ParseConnectionDocumentException("Length attribute should not be present for parameter: "
+ nativeAttrName + " In native schema file");</BUG>
}
if (streamSchema.getAttribute(nativeAttrName) != null) {
| throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
|
16,542 | if (streamSchema.getAttribute(nativeAttrName) != null) {
MetaType metaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if (metaType == Type.MetaType.DECIMAL32 || metaType == Type.MetaType.DECIMAL64
|| metaType == Type.MetaType.DECIMAL128 || metaType == Type.MetaType.TIMESTAMP) {
if (nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) {
<BUG>throw new ParseConnectionDocumentException(
"Length attribute should not be present for parameter: " + nativeAttrName
+ " with type " + metaType + " in native schema file.");</BUG>
}
if (msgClass == MessageClass.bytes) {
| Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_WITH_TYPE_IN_NATIVE_SCHEMA", nativeAttrName, metaType )); //$NON-NLS-1$
|
16,543 | nativeAttrLength = -4;
}
}
}
if (typesWithLength.contains(nativeAttrType)) {
<BUG>if (nativeAttrLength == LENGTH_ABSENT_IN_NATIVE_SCHEMA && msgClass == MessageClass.bytes) {
throw new ParseConnectionDocumentException("Length attribute should be present for parameter: "
+ nativeAttrName + " In native schema file for message class bytes");</BUG>
}
if ((nativeAttrLength < 0) && nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) {
| throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA_FOR_MSG_CLASS_BYTES", nativeAttrName )); //$NON-NLS-1$
|
16,544 | if (streamSchema.getAttribute(nativeAttrName) != null) {
streamAttrName = streamSchema.getAttribute(nativeAttrName).getName();
streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if ((msgClass == MessageClass.stream || msgClass == MessageClass.map)
&& !mapSPLToNativeSchemaDataTypesForOtherMsgClass.get(streamAttrMetaType.getLanguageType())
<BUG>.equals(nativeAttrType)) {
throw new ParseConnectionDocumentException("Attribute Name: " + nativeAttrName + " with type:"
+ nativeAttrType + " in the native schema cannot be mapped with attribute: "
+ streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG>
}
| throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
|
16,545 | + nativeAttrType + " in the native schema cannot be mapped with attribute: "
+ streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG>
}
else if (msgClass == MessageClass.bytes
&& !mapSPLToNativeSchemaDataTypesForBytes.get(streamAttrMetaType.getLanguageType()).equals(
<BUG>nativeAttrType)) {
throw new ParseConnectionDocumentException("Attribute Name: " + nativeAttrName + " with type:"
+ nativeAttrType + " in the native schema cannot be mapped with attribute: "
+ streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG>
}
| if (streamSchema.getAttribute(nativeAttrName) != null) {
streamAttrName = streamSchema.getAttribute(nativeAttrName).getName();
streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if ((msgClass == MessageClass.stream || msgClass == MessageClass.map)
&& !mapSPLToNativeSchemaDataTypesForOtherMsgClass.get(streamAttrMetaType.getLanguageType())
.equals(nativeAttrType)) {
throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
|
16,546 | package com.ibm.streamsx.messaging.i18n;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
<BUG>private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.mqtt.MQTTMessages"; //$NON-NLS-1$
</BUG>
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
private Messages() {
| private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.i18n.CommonMessages"; //$NON-NLS-1$
|
16,547 | import ml.puredark.hviewer.ui.activities.BaseActivity;
import ml.puredark.hviewer.ui.dataproviders.ListDataProvider;
import ml.puredark.hviewer.ui.fragments.SettingFragment;
import ml.puredark.hviewer.ui.listeners.OnItemLongClickListener;
import ml.puredark.hviewer.utils.SharedPreferencesUtil;
<BUG>import static android.webkit.WebSettings.LOAD_CACHE_ELSE_NETWORK;
public class PictureViewerAdapter extends RecyclerView.Adapter<PictureViewerAdapter.PictureViewerViewHolder> {</BUG>
private BaseActivity activity;
private Site site;
private ListDataProvider mProvider;
| import static ml.puredark.hviewer.R.id.container;
public class PictureViewerAdapter extends RecyclerView.Adapter<PictureViewerAdapter.PictureViewerViewHolder> {
|
16,548 | final PictureViewHolder viewHolder = new PictureViewHolder(view);
if (pictures != null && position < pictures.size()) {
final Picture picture = pictures.get(getPicturePostion(position));
if (picture.pic != null) {
loadImage(container.getContext(), picture, viewHolder);
<BUG>} else if (site.hasFlag(Site.FLAG_SINGLE_PAGE_BIG_PICTURE) && site.extraRule != null && site.extraRule.pictureUrl != null) {
getPictureUrl(container.getContext(), viewHolder, picture, site, site.extraRule.pictureUrl, site.extraRule.pictureHighRes);</BUG>
} else if (site.picUrlSelector != null) {
getPictureUrl(container.getContext(), viewHolder, picture, site, site.picUrlSelector, null);
} else {
| } else if (site.hasFlag(Site.FLAG_SINGLE_PAGE_BIG_PICTURE) && site.extraRule != null) {
if(site.extraRule.pictureRule != null && site.extraRule.pictureRule.url != null)
getPictureUrl(container.getContext(), viewHolder, picture, site, site.extraRule.pictureRule.url, site.extraRule.pictureRule.highRes);
else if(site.extraRule.pictureUrl != null)
getPictureUrl(container.getContext(), viewHolder, picture, site, site.extraRule.pictureUrl, site.extraRule.pictureHighRes);
|
16,549 | import java.util.regex.Pattern;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.puredark.hviewer.R;
import ml.puredark.hviewer.beans.Category;
<BUG>import ml.puredark.hviewer.beans.CommentRule;
import ml.puredark.hviewer.beans.Rule;</BUG>
import ml.puredark.hviewer.beans.Selector;
import ml.puredark.hviewer.beans.Site;
import ml.puredark.hviewer.ui.adapters.CategoryInputAdapter;
| import ml.puredark.hviewer.beans.PictureRule;
import ml.puredark.hviewer.beans.Rule;
|
16,550 | inputGalleryRulePictureUrlReplacement.setText(site.galleryRule.pictureUrl.replacement);
}
if (site.galleryRule.pictureHighRes != null) {
inputGalleryRulePictureHighResSelector.setText(joinSelector(site.galleryRule.pictureHighRes));
inputGalleryRulePictureHighResRegex.setText(site.galleryRule.pictureHighRes.regex);
<BUG>inputGalleryRulePictureHighResReplacement.setText(site.galleryRule.pictureHighRes.replacement);
}</BUG>
if (site.galleryRule.commentRule != null) {
if (site.galleryRule.commentRule.item != null) {
inputGalleryRuleCommentItemSelector.setText(joinSelector(site.galleryRule.commentRule.item));
| [DELETED] |
16,551 | inputExtraRuleCommentDatetimeReplacement.setText(site.extraRule.commentDatetime.replacement);
}
if (site.extraRule.commentContent != null) {
inputExtraRuleCommentContentSelector.setText(joinSelector(site.extraRule.commentContent));
inputExtraRuleCommentContentRegex.setText(site.extraRule.commentContent.regex);
<BUG>inputExtraRuleCommentContentReplacement.setText(site.extraRule.commentContent.replacement);
}</BUG>
}
}
}
| [DELETED] |
16,552 | lastSite.galleryRule.cover = loadSelector(inputGalleryRuleCoverSelector, inputGalleryRuleCoverRegex, inputGalleryRuleCoverReplacement);
lastSite.galleryRule.category = loadSelector(inputGalleryRuleCategorySelector, inputGalleryRuleCategoryRegex, inputGalleryRuleCategoryReplacement);
lastSite.galleryRule.datetime = loadSelector(inputGalleryRuleDatetimeSelector, inputGalleryRuleDatetimeRegex, inputGalleryRuleDatetimeReplacement);
lastSite.galleryRule.rating = loadSelector(inputGalleryRuleRatingSelector, inputGalleryRuleRatingRegex, inputGalleryRuleRatingReplacement);
lastSite.galleryRule.description = loadSelector(inputGalleryRuleDescriptionSelector, inputGalleryRuleDescriptionRegex, inputGalleryRuleDescriptionReplacement);
<BUG>lastSite.galleryRule.tags = loadSelector(inputGalleryRuleTagsSelector, inputGalleryRuleTagsRegex, inputGalleryRuleTagsReplacement);
lastSite.galleryRule.pictureThumbnail = loadSelector(inputGalleryRulePictureThumbnailSelector, inputGalleryRulePictureThumbnailRegex, inputGalleryRulePictureThumbnailReplacement);
lastSite.galleryRule.pictureUrl = loadSelector(inputGalleryRulePictureUrlSelector, inputGalleryRulePictureUrlRegex, inputGalleryRulePictureUrlReplacement);
lastSite.galleryRule.pictureHighRes = loadSelector(inputGalleryRulePictureHighResSelector, inputGalleryRulePictureHighResRegex, inputGalleryRulePictureHighResReplacement);
lastSite.galleryRule.commentRule = new CommentRule();
lastSite.galleryRule.commentRule.item = loadSelector(inputGalleryRuleCommentItemSelector, inputGalleryRuleCommentItemRegex, inputGalleryRuleCommentItemReplacement);</BUG>
lastSite.galleryRule.commentRule.avatar = loadSelector(inputGalleryRuleCommentAvatarSelector, inputGalleryRuleCommentAvatarRegex, inputGalleryRuleCommentAvatarReplacement);
| lastSite.galleryRule.pictureRule = (lastSite.galleryRule.pictureRule == null) ? new PictureRule() : lastSite.galleryRule.pictureRule;
lastSite.galleryRule.pictureRule.thumbnail = loadSelector(inputGalleryRulePictureThumbnailSelector, inputGalleryRulePictureThumbnailRegex, inputGalleryRulePictureThumbnailReplacement);
lastSite.galleryRule.pictureRule.url = loadSelector(inputGalleryRulePictureUrlSelector, inputGalleryRulePictureUrlRegex, inputGalleryRulePictureUrlReplacement);
lastSite.galleryRule.pictureRule.highRes = loadSelector(inputGalleryRulePictureHighResSelector, inputGalleryRulePictureHighResRegex, inputGalleryRulePictureHighResReplacement);
lastSite.galleryRule.commentRule = (lastSite.galleryRule.commentRule == null) ? new CommentRule() : lastSite.galleryRule.commentRule;
lastSite.galleryRule.commentRule.item = loadSelector(inputGalleryRuleCommentItemSelector, inputGalleryRuleCommentItemRegex, inputGalleryRuleCommentItemReplacement);
|
16,553 | lastSite.extraRule.cover = loadSelector(inputExtraRuleCoverSelector, inputExtraRuleCoverRegex, inputExtraRuleCoverReplacement);
lastSite.extraRule.category = loadSelector(inputExtraRuleCategorySelector, inputExtraRuleCategoryRegex, inputExtraRuleCategoryReplacement);
lastSite.extraRule.datetime = loadSelector(inputExtraRuleDatetimeSelector, inputExtraRuleDatetimeRegex, inputExtraRuleDatetimeReplacement);
lastSite.extraRule.rating = loadSelector(inputExtraRuleRatingSelector, inputExtraRuleRatingRegex, inputExtraRuleRatingReplacement);
lastSite.extraRule.description = loadSelector(inputExtraRuleDescriptionSelector, inputExtraRuleDescriptionRegex, inputExtraRuleDescriptionReplacement);
<BUG>lastSite.extraRule.tags = loadSelector(inputExtraRuleTagsSelector, inputExtraRuleTagsRegex, inputExtraRuleTagsReplacement);
lastSite.extraRule.pictureThumbnail = loadSelector(inputExtraRulePictureThumbnailSelector, inputExtraRulePictureThumbnailRegex, inputExtraRulePictureThumbnailReplacement);
lastSite.extraRule.pictureUrl = loadSelector(inputExtraRulePictureUrlSelector, inputExtraRulePictureUrlRegex, inputExtraRulePictureUrlReplacement);
lastSite.extraRule.pictureHighRes = loadSelector(inputExtraRulePictureHighResSelector, inputExtraRulePictureHighResRegex, inputExtraRulePictureHighResReplacement);
lastSite.extraRule.commentRule = new CommentRule();
lastSite.extraRule.commentRule.item = loadSelector(inputExtraRuleCommentItemSelector, inputExtraRuleCommentItemRegex, inputExtraRuleCommentItemReplacement);</BUG>
lastSite.extraRule.commentRule.avatar = loadSelector(inputExtraRuleCommentAvatarSelector, inputExtraRuleCommentAvatarRegex, inputExtraRuleCommentAvatarReplacement);
| lastSite.extraRule.pictureRule = (lastSite.extraRule.pictureRule == null) ? new PictureRule() : lastSite.extraRule.pictureRule;
lastSite.extraRule.pictureRule.thumbnail = loadSelector(inputExtraRulePictureThumbnailSelector, inputExtraRulePictureThumbnailRegex, inputExtraRulePictureThumbnailReplacement);
lastSite.extraRule.pictureRule.url = loadSelector(inputExtraRulePictureUrlSelector, inputExtraRulePictureUrlRegex, inputExtraRulePictureUrlReplacement);
lastSite.extraRule.pictureRule.highRes = loadSelector(inputExtraRulePictureHighResSelector, inputExtraRulePictureHighResRegex, inputExtraRulePictureHighResReplacement);
lastSite.extraRule.commentRule = (lastSite.extraRule.commentRule == null) ? new CommentRule() : lastSite.extraRule.commentRule;
lastSite.extraRule.commentRule.item = loadSelector(inputExtraRuleCommentItemSelector, inputExtraRuleCommentItemRegex, inputExtraRuleCommentItemReplacement);
|
16,554 | notifyItemChanged(position);
if (mItemClickListener != null)
mItemClickListener.onItemClick(v, position);
}
});
<BUG>if (tag.selected)
label.getChildAt(0).setBackgroundResource(R.color.colorPrimary);
else
label.getChildAt(0).setBackgroundResource(R.color.dimgray);</BUG>
}
| [DELETED] |
16,555 | loadPicture(picture, task, null, true);
} else if (!TextUtils.isEmpty(picture.pic) && !highRes) {
picture.retries = 0;
loadPicture(picture, task, null, false);
} else if (task.collection.site.hasFlag(Site.FLAG_SINGLE_PAGE_BIG_PICTURE)
<BUG>&& task.collection.site.extraRule != null
&& task.collection.site.extraRule.pictureUrl != null) {
</BUG>
getPictureUrl(picture, task, task.collection.site.extraRule.pictureUrl, task.collection.site.extraRule.pictureHighRes);
| && task.collection.site.extraRule != null) {
if(task.collection.site.extraRule.pictureRule != null && task.collection.site.extraRule.pictureRule.url != null)
getPictureUrl(picture, task, task.collection.site.extraRule.pictureRule.url, task.collection.site.extraRule.pictureRule.highRes);
else if(task.collection.site.extraRule.pictureUrl != null)
|
16,556 | if (Picture.hasPicPosfix(picture.url)) {
picture.pic = picture.url;
loadPicture(picture, task, null, false);
} else
if (task.collection.site.hasFlag(Site.FLAG_JS_NEEDED_ALL)) {
<BUG>new Handler(Looper.getMainLooper()).post(()->{
</BUG>
WebView webView = new WebView(HViewerApplication.mContext);
WebSettings mWebSettings = webView.getSettings();
mWebSettings.setJavaScriptEnabled(true);
| new Handler(Looper.getMainLooper()).post(() -> {
|
16,557 | final float dx = other.x - x;
final float dy = other.y - y;
return (dx * dx) + (dy * dy);
}
public float distance(final Vector2D other) {
<BUG>return FloatMath.sqrt(distanceSquared(other));
</BUG>
}
public float absdistancex(final Vector2D other) {
return Math.abs(this.x - other.x);
| return (float) Math.sqrt(distanceSquared(other));
|
16,558 | LCTX.d("onLongPress(" + e + ")");
}
}
@Override
public void onTwoFingerPinch(final MotionEvent e, final float oldDistance, final float newDistance) {
<BUG>final float factor = FloatMath.sqrt(newDistance / oldDistance);
</BUG>
if (LCTX.isDebugEnabled()) {
LCTX.d("onTwoFingerPinch(" + oldDistance + ", " + newDistance + "): " + factor);
}
| final float factor = (float) Math.sqrt(newDistance / oldDistance);
|
16,559 | final float cellHeight = 100 / GRID_X;
float left = MathUtils.fmin(startPoint.x, endPoint.x);
float right = MathUtils.fmax(startPoint.x, endPoint.x);
float top = MathUtils.fmin(startPoint.y, endPoint.y);
float bottom = MathUtils.fmax(startPoint.y, endPoint.y);
<BUG>left = cellWidth * FloatMath.floor(left / xStep);
right = cellWidth * FloatMath.floor(right / xStep) + cellWidth;
top = cellHeight * FloatMath.floor(top / yStep);
bottom = cellHeight * FloatMath.floor(bottom / yStep) + cellHeight;
</BUG>
return new Region(MathUtils.rect(left, top, right, bottom));
| left = cellWidth * (float) Math.floor(left / xStep);
right = cellWidth * (float) Math.floor(right / xStep) + cellWidth;
top = cellHeight * (float) Math.floor(top / yStep);
bottom = cellHeight * (float) Math.floor(bottom / yStep) + cellHeight;
|
16,560 | }
public float getAspectRatio() {
return aspectRatio / 128.0f;
}
private boolean setAspectRatio(final float aspectRatio) {
<BUG>final int newAspectRatio = (int) FloatMath.floor(aspectRatio * 128);
if (this.aspectRatio != newAspectRatio) {</BUG>
this.aspectRatio = newAspectRatio;
return true;
}
| public void recycle(final List<GLBitmaps> bitmapsToRecycle) {
recycled = true;
nodes.recycleAll(bitmapsToRecycle, true);
final int newAspectRatio = (int) Math.floor(aspectRatio * 128);
if (this.aspectRatio != newAspectRatio) {
|
16,561 | public SystemConfig(String configFile, boolean mustExist) {
super();
this.config = findAndReadLocalFile(configFile, mustExist);</BUG>
}
<BUG>public static Map<String, Object> findAndReadLocalFile(String name, boolean mustExist) {
File file = new File(name);
if (!file.exists() && mustExist) {
throw new RuntimeException(String.format("Config file %s does not exist", name));
</BUG>
}
| package com.twitter.heron.common.config;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import com.twitter.heron.common.basics.TypeUtils;
public final class SystemConfig {
public static final String HERON_SYSTEM_CONFIG = SystemConfig.class.getName();
private Map<String, Object> config = new HashMap<>();
private SystemConfig(Builder build) {
this.config = new HashMap<>(build.keyValues);
|
16,562 | <BUG>package hudson.model;
import hudson.PluginWrapper;
import hudson.PluginManager;
import hudson.model.UpdateCenter.UpdateCenterJob;
import hudson.lifecycle.Lifecycle;
import hudson.util.IOUtils;</BUG>
import hudson.util.TextFile;
| import com.trilead.ssh2.crypto.Base64;
import hudson.util.FormValidation;
import hudson.util.FormValidation.Kind;
import hudson.util.IOUtils;
|
16,563 | return id;
}
public long getDataTimestamp() {
return dataTimestamp;
}
<BUG>public void doPostBack(StaplerRequest req, StaplerResponse rsp) throws IOException, GeneralSecurityException {
</BUG>
dataTimestamp = System.currentTimeMillis();
String json = IOUtils.toString(req.getInputStream(),"UTF-8");
JSONObject o = JSONObject.fromObject(json);
| public FormValidation doPostBack(StaplerRequest req) throws IOException, GeneralSecurityException {
|
16,564 | import javax.inject.Inject;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import static org.jetbrains.jet.lang.diagnostics.Errors.NOT_A_CLASS;
<BUG>import static org.jetbrains.jet.lang.diagnostics.Errors.NO_CONSTRUCTOR;
import static org.jetbrains.jet.lang.resolve.BindingContext.EXPRESSION_DATA_FLOW_INFO;
import static org.jetbrains.jet.lang.resolve.BindingContext.RESOLUTION_SCOPE;</BUG>
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveArgumentsMode.RESOLVE_FUNCTION_ARGUMENTS;
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveArgumentsMode.SHAPE_FUNCTION_ARGUMENTS;
| import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.recordScopeAndDataFlowInfo;
|
16,565 | deltasTraceForResolve.addAllMyDataTo(traceToResolveCall);
results = (OverloadResolutionResultsImpl<F>) data.getResolutionResults();
}
}
if (results == null) {
<BUG>BasicCallResolutionContext newContext = context.replaceBindingTrace(traceToResolveCall);
results = doResolveCallAndRecordDebugInfo(newContext, prioritizedTasks, callTransformer, tracing);
DelegatingBindingTrace deltasTraceForTypeInference = ((OverloadResolutionResultsImpl) results).getTrace();</BUG>
if (deltasTraceForTypeInference != null) {
deltasTraceForTypeInference.addAllMyDataTo(traceToResolveCall);
| recordScopeAndDataFlowInfo(newContext, newContext.call.getCalleeExpression());
results = doResolveCall(newContext, prioritizedTasks, callTransformer, tracing);
DelegatingBindingTrace deltasTraceForTypeInference = ((OverloadResolutionResultsImpl) results).getTrace();
|
16,566 | @SideOnly(Side.CLIENT)
public class GuiSeedAnalyzer extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation(Reference.MOD_ID, "textures/gui/GuiSeedAnalyzer.png");
public TileEntitySeedAnalyzer seedAnalyzer;
private boolean journalOpen;
<BUG>private GuiJournal guiJournal;
</BUG>
public GuiSeedAnalyzer(InventoryPlayer inventory, TileEntitySeedAnalyzer seedAnalyzer) {
super(new ContainerSeedAnalyzer(inventory, seedAnalyzer));
this.seedAnalyzer = seedAnalyzer;
| private AgriGuiWrapper guiJournal;
|
16,567 | return;
}
ItemStack journal = seedAnalyzer.getStackInSlot(ContainerSeedAnalyzer.journalSlotId);
if(journal != null) {
journalOpen = true;
<BUG>guiJournal = new GuiJournal(journal);
</BUG>
guiJournal.setWorldAndResolution(this.mc, this.width, this.height);
}
}
| guiJournal = new AgriGuiWrapper(new GuiJournal(journal));
|
16,568 | package org.codehaus.groovy.transform;
<BUG>import org.codehaus.groovy.ast.*;
import org.codehaus.groovy.control.*;</BUG>
import org.codehaus.groovy.syntax.SyntaxException;
import org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor;
import java.util.Collections;
| import org.codehaus.groovy.ast.expr.Expression;
import org.codehaus.groovy.ast.stmt.ExpressionStatement;
import org.codehaus.groovy.control.*;
|
16,569 | import org.codehaus.groovy.ast.tools.GenericsUtils;
import org.codehaus.groovy.classgen.ReturnAdder;
import org.codehaus.groovy.classgen.asm.InvocationWriter;
import org.codehaus.groovy.control.SourceUnit;
import org.codehaus.groovy.runtime.MetaClassHelper;
<BUG>import org.codehaus.groovy.transform.StaticTypesTransformation;
import org.objectweb.asm.Opcodes;</BUG>
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import static org.codehaus.groovy.ast.ClassHelper.*;
| import org.codehaus.groovy.util.ListHashMap;
import org.objectweb.asm.Opcodes;
|
16,570 | private List<ClassNode> closureReturnTypes;
private LinkedList<ClassNode> withReceiverList = new LinkedList<ClassNode>();
private ClassNode lastImplicitItType;
private Map<VariableExpression, List<ClassNode>> ifElseForWhileAssignmentTracker = null;
private Stack<Map<Object, List<ClassNode>>> temporaryIfBranchTypeInformation;
<BUG>private Set<MethodNode> alreadyVisitedMethods = new HashSet<MethodNode>();
private final ReturnAdder returnAdder = new ReturnAdder(new ReturnAdder.ReturnStatementListener() {</BUG>
public void returnStatementAdded(final ReturnStatement returnStatement) {
if (returnStatement.getExpression().equals(ConstantExpression.NULL)) return;
ClassNode returnType = checkReturnType(returnStatement);
| private final LinkedHashSet<Expression> secondPassExpressions = new LinkedHashSet<Expression>();
private final Map<VariableExpression, List<ClassNode>> closureSharedVariablesAssignmentTypes = new HashMap<VariableExpression, List<ClassNode>>();
private final ReturnAdder returnAdder = new ReturnAdder(new ReturnAdder.ReturnStatementListener() {
|
16,571 | ClassNode returnType = getType(directMethodCallCandidate);
if (returnType.isUsingGenerics()) {
returnType = inferReturnTypeGenerics(chosenReceiver, directMethodCallCandidate, callArguments);
}
storeType(call, returnType);
<BUG>storeTargetMethod(call, directMethodCallCandidate);
} else {</BUG>
addStaticTypeError("Reference to method is ambiguous. Cannot choose between "+mn, call);
}
}
| [DELETED] |
16,572 | package org.codehaus.groovy.ast.tools;
import static org.codehaus.groovy.ast.ClassHelper.*;
import org.codehaus.groovy.ast.ClassNode;
<BUG>import org.codehaus.groovy.ast.GenericsType;
import java.util.*;</BUG>
public class WideningCategories {
private static final List<ClassNode> EMPTY_CLASSNODE_LIST = Collections.emptyList();
private static final Comparator<ClassNode> INTERFACE_CLASSNODE_COMPARATOR = new Comparator<ClassNode>() {
| import org.codehaus.groovy.ast.MethodNode;
import org.codehaus.groovy.vmplugin.VMPluginFactory;
import java.util.*;
|
16,573 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
16,574 | }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_memo);
<BUG>ChinaPhoneHelper.setStatusBar(this,true);
</BUG>
topicId = getIntent().getLongExtra("topicId", -1);
if (topicId == -1) {
finish();
| ChinaPhoneHelper.setStatusBar(this, true);
|
16,575 | MemoEntry.COLUMN_REF_TOPIC__ID + " = ?"
, new String[]{String.valueOf(topicId)});
}
public Cursor selectMemo(long topicId) {
Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null,
<BUG>MemoEntry._ID + " DESC", null);
</BUG>
if (c != null) {
c.moveToFirst();
}
| MemoEntry.COLUMN_ORDER + " ASC", null);
|
16,576 | MemoEntry._ID + " = ?",
new String[]{String.valueOf(memoId)});
}
public long updateMemoContent(long memoId, String memoContent) {
ContentValues values = new ContentValues();
<BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent);
return db.update(</BUG>
MemoEntry.TABLE_NAME,
values,
MemoEntry._ID + " = ?",
| return db.update(
|
16,577 | import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kiminonawa.mydiary.R;
import com.kiminonawa.mydiary.db.DBManager;
import com.kiminonawa.mydiary.shared.EditMode;
<BUG>import com.kiminonawa.mydiary.shared.ThemeManager;
import java.util.List;
public class MemoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements EditMode {
</BUG>
private List<MemoEntity> memoList;
| import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;
public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
|
16,578 | private DBManager dbManager;
private boolean isEditMode = false;
private EditMemoDialogFragment.MemoCallback callback;
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
<BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback) {
this.mActivity = activity;</BUG>
this.topicId = topicId;
this.memoList = memoList;
| public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {
super(recyclerView);
this.mActivity = activity;
|
16,579 | this.memoList = memoList;
this.dbManager = dbManager;
this.callback = callback;
}
@Override
<BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
</BUG>
View view;
if (isEditMode) {
if (viewType == TYPE_HEADER) {
| public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
16,580 | editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment");
}
});
}
}
<BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private View rootView;
private TextView TV_memo_item_content;</BUG>
private ImageView IV_memo_item_delete;
| protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
private ImageView IV_memo_item_dot;
private TextView TV_memo_item_content;
|
16,581 | import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import com.appboy.configuration.XmlAppConfigurationProvider;
<BUG>import com.appboy.push.AppboyNotificationUtils;
public final class AppboyGcmReceiver extends BroadcastReceiver {</BUG>
private static final String TAG = String.format("%s.%s", Constants.APPBOY_LOG_TAG_PREFIX, AppboyGcmReceiver.class.getName());
private static final String GCM_RECEIVE_INTENT_ACTION = "com.google.android.c2dm.intent.RECEIVE";
private static final String GCM_REGISTRATION_INTENT_ACTION = "com.google.android.c2dm.intent.REGISTRATION";
| import com.appboy.support.AppboyLogger;
public final class AppboyGcmReceiver extends BroadcastReceiver {
|
16,582 | private static final String GCM_DELETED_MESSAGES_KEY = "deleted_messages";
private static final String GCM_NUMBER_OF_MESSAGES_DELETED_KEY = "total_deleted";
public static final String CAMPAIGN_ID_KEY = Constants.APPBOY_PUSH_CAMPAIGN_ID_KEY;
@Override
public void onReceive(Context context, Intent intent) {
<BUG>Log.i(TAG, String.format("Received broadcast message. Message: %s", intent.toString()));
</BUG>
String action = intent.getAction();
if (GCM_REGISTRATION_INTENT_ACTION.equals(action)) {
XmlAppConfigurationProvider appConfigurationProvider = new XmlAppConfigurationProvider(context);
| AppboyLogger.i(TAG, String.format("Received broadcast message. Message: %s", intent.toString()));
|
16,583 | } else if (Constants.APPBOY_CANCEL_NOTIFICATION_ACTION.equals(action) && intent.hasExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG)) {
int notificationId = intent.getIntExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG, Constants.APPBOY_DEFAULT_NOTIFICATION_ID);
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(Constants.APPBOY_PUSH_NOTIFICATION_TAG, notificationId);
} else {
<BUG>Log.w(TAG, String.format("The GCM receiver received a message not sent from Appboy. Ignoring the message."));
</BUG>
}
}
boolean handleRegistrationIntent(Context context, Intent intent) {
| AppboyLogger.w(TAG, String.format("The GCM receiver received a message not sent from Appboy. Ignoring the message."));
|
16,584 | Log.e(TAG, "Device does not support GCM.");
} else if ("INVALID_PARAMETERS".equals(error)) {
Log.e(TAG, "The request sent by the device does not contain the expected parameters. This phone does not " +
"currently support GCM.");
} else {
<BUG>Log.w(TAG, String.format("Received an unrecognised GCM registration error type. Ignoring. Error: %s", error));
</BUG>
}
} else if (registrationId != null) {
Appboy.getInstance(context).registerAppboyPushMessages(registrationId);
| AppboyLogger.w(TAG, String.format("Received an unrecognised GCM registration error type. Ignoring. Error: %s", error));
|
16,585 | } else if (registrationId != null) {
Appboy.getInstance(context).registerAppboyPushMessages(registrationId);
} else if (intent.hasExtra(GCM_UNREGISTERED_KEY)) {
Appboy.getInstance(context).unregisterAppboyPushMessages();
} else {
<BUG>Log.w(TAG, "The GCM registration message is missing error information, registration id, and unregistration " +
</BUG>
"confirmation. Ignoring.");
return false;
}
| AppboyLogger.w(TAG, "The GCM registration message is missing error information, registration id, and unregistration " +
|
16,586 | if (GCM_DELETED_MESSAGES_KEY.equals(messageType)) {
int totalDeleted = intent.getIntExtra(GCM_NUMBER_OF_MESSAGES_DELETED_KEY, -1);
if (totalDeleted == -1) {
Log.e(TAG, String.format("Unable to parse GCM message. Intent: %s", intent.toString()));
} else {
<BUG>Log.i(TAG, String.format("GCM deleted %d messages. Fetch them from Appboy.", totalDeleted));
</BUG>
}
return false;
} else {
| AppboyLogger.i(TAG, String.format("GCM deleted %d messages. Fetch them from Appboy.", totalDeleted));
|
16,587 | package com.appboy;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
<BUG>import android.util.Log;
import android.content.Context;</BUG>
import android.app.Notification;
import android.app.NotificationManager;
import com.appboy.configuration.XmlAppConfigurationProvider;
| import com.appboy.support.AppboyLogger;
import android.content.Context;
|
16,588 | } else if (Constants.APPBOY_CANCEL_NOTIFICATION_ACTION.equals(action) && intent.hasExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG)) {
int notificationId = intent.getIntExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG, Constants.APPBOY_DEFAULT_NOTIFICATION_ID);
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(Constants.APPBOY_PUSH_NOTIFICATION_TAG, notificationId);
} else {
<BUG>Log.w(TAG, String.format("The ADM receiver received a message not sent from Appboy. Ignoring the message."));
</BUG>
}
}
boolean handleRegistrationIntent(Context context, Intent intent) {
| AppboyLogger.w(TAG, String.format("The ADM receiver received a message not sent from Appboy. Ignoring the message."));
|
16,589 | Notification notification = null;
IAppboyNotificationFactory appboyNotificationFactory = AppboyNotificationUtils.getActiveNotificationFactory();
try {
notification = appboyNotificationFactory.createNotification(appConfigurationProvider, context, admExtras, appboyExtras);
} catch(Exception e) {
<BUG>Log.e(TAG, "Failed to create notification.", e);
</BUG>
return false;
}
if (notification == null) {
| AppboyLogger.e(TAG, "Failed to create notification.", e);
|
16,590 | package com.appboy;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
<BUG>import android.util.Log;
import java.io.InputStream;</BUG>
import java.net.MalformedURLException;
import java.net.UnknownHostException;
public class AppboyImageUtils {
| import com.appboy.support.AppboyLogger;
import java.io.InputStream;
|
16,591 | public class AppboyImageUtils {
private static final String TAG = String.format("%s.%s", Constants.APPBOY_LOG_TAG_PREFIX, AppboyImageUtils.class.getName());
public static final int BASELINE_SCREEN_DPI = 160;
public static Bitmap downloadImageBitmap(String imageUrl) {
if (imageUrl == null || imageUrl.length() == 0) {
<BUG>Log.i(TAG, "Null or empty Url string passed to image bitmap download. Not attempting download.");
</BUG>
return null;
}
Bitmap bitmap = null;
| AppboyLogger.i(TAG, "Null or empty Url string passed to image bitmap download. Not attempting download.");
|
16,592 | 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;
|
16,593 | 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;
|
16,594 | 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"),
|
16,595 | 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] |
16,596 | 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) {
|
16,597 | 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;
|
16,598 | package de.avalax.fitbuddy.domain.model.exercise;
<BUG>import android.util.Log;
import de.avalax.fitbuddy.domain.model.set.Set;</BUG>
import de.avalax.fitbuddy.domain.model.set.SetNotAvailableException;
import java.util.ArrayList;
import java.util.List;
| import de.avalax.fitbuddy.domain.model.set.BasicSet;
import de.avalax.fitbuddy.domain.model.set.Set;
|
16,599 | import org.junit.runner.RunWith;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsEqual.equalTo;
<BUG>import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;</BUG>
@RunWith(HierarchicalContextRunner.class)
public class BasicExerciseTest {
private Exercise exercise;
| [DELETED] |
16,600 | @Test
public void countOfSets_shouldReturnZeroOnConstruction() throws Exception {
assertThat(exercise.countOfSets(), equalTo(0));
}
@Test
<BUG>public void addSet_shouldAddSetToExercise() throws Exception {
Set set = mock(Set.class);
exercise.addSet(set);</BUG>
assertThat(exercise.setAtPosition(0), equalTo(set));
}
| public void equalExerciseId_shouldHaveTheSameIdentity() throws Exception {
ExerciseId exerciseId = new ExerciseId("42");
exercise.setExerciseId(exerciseId);
Exercise exercise2 = new BasicExercise();
exercise2.setExerciseId(exerciseId);
assertThat(exercise, equalTo(exercise2));
assertThat(exercise.hashCode(), equalTo(exercise2.hashCode()));
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.