id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
18,501 | 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"),
|
18,502 | 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] |
18,503 | 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) {
|
18,504 | 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;
|
18,505 | return modifiers;
}
@Override
public void mouseClicked(MouseEvent e) {
if (checkModifiers(e)) {
<BUG>GUINode guiNode = (GUINode) canvas.getVertex(e);
Node node = guiNode == null? null : guiNode.getAssociatedNode();</BUG>
if (node != null) {
callback.getVisualizationState().pickNode(node);
callback.updateVisualizationAfterPick();
| GUINode guiNode = canvas.getVertex(e);
Node node = guiNode == null? null : guiNode.getAssociatedNode();
|
18,506 | if (node != null) {
callback.getVisualizationState().pickNode(node);
callback.updateVisualizationAfterPick();
e.consume();
} else {
<BUG>GUILink link = (GUILink) canvas.getEdge(e);
if (link != null)</BUG>
{
if (!link.isIntraNodeLink())
{
| GUILink link = canvas.getEdge(e);
if (link != null)
|
18,507 | if (startVertex != null)
{
final VisualizationViewer<GUINode, GUILink> vv = (VisualizationViewer<GUINode, GUILink>) e.getSource();
vv.removePostRenderPaintable(edgePaintable);
vv.removePostRenderPaintable(arrowPaintable);
<BUG>final GUINode guiNode = (GUINode) canvas.getVertex(e);
final Node node = guiNode == null? null : guiNode.getAssociatedNode();</BUG>
if (node != null && startVertex.getAssociatedNode() != node)
{
if (guiNode.getLayer() == startVertex.getLayer ())
| final GUINode guiNode = canvas.getVertex(e);
final Node node = guiNode == null? null : guiNode.getAssociatedNode();
|
18,508 | osmStateManager.updateNodesXYPosition();
}
@Override
public void moveVertexToXYPosition(GUINode npNode, Point2D point)
{
<BUG>l.setLocation((GUINode) npNode, point);
}</BUG>
@Override
public Point2D getCanvasPointFromMovement(final Point2D point)
{
| l.setLocation(npNode, point);
|
18,509 | @Override
public void updateNodesXYPosition()
{
for (GUINode vertex : canvas.getAllVertices())
{
<BUG>GUINode guiNode = (GUINode) vertex;
canvas.getLayout().setLocation(guiNode, canvas.getTransformer().transform(guiNode));
</BUG>
}
}
| public void panTo(Point2D initialPoint, Point2D currentPoint)
final Point2D q = canvas.getCanvasPointFromScreenPoint(initialPoint);
final Point2D lvc = canvas.getCanvasPointFromScreenPoint(currentPoint);
final double dxJungCoord = (lvc.getX() - q.getX());
final double dyJungCoord = (lvc.getY() - q.getY());
canvas.moveCanvasTo(new Point2D.Double(dxJungCoord, dyJungCoord));
|
18,510 | System.out.println(change);
}
}
};
@Override
<BUG>protected Callback<VChild, Void> copyChildCallback()
</BUG>
{
return (child) ->
{
| protected Callback<VChild, Void> copyIntoCallback()
|
18,511 | package jfxtras.labs.icalendarfx.components;
import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment;
<BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty;
import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG>
import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates;
import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
| import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
|
18,512 | VEVENT ("VEVENT",
Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES,
PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_CREATED,
PropertyType.DATE_TIME_END, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TIME_START,
PropertyType.DESCRIPTION, PropertyType.DURATION, PropertyType.EXCEPTION_DATE_TIMES,
<BUG>PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY, PropertyType.LAST_MODIFIED,
PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,</BUG>
PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO,
PropertyType.RECURRENCE_RULE, PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE,
PropertyType.STATUS, PropertyType.SUMMARY, PropertyType.TIME_TRANSPARENCY, PropertyType.UNIQUE_IDENTIFIER,
| PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED,
PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,
|
18,513 | VTODO ("VTODO",
Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES,
PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_COMPLETED,
PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_DUE, PropertyType.DATE_TIME_STAMP,
PropertyType.DATE_TIME_START, PropertyType.DESCRIPTION, PropertyType.DURATION,
<BUG>PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY,
PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,</BUG>
PropertyType.PERCENT_COMPLETE, PropertyType.PRIORITY, PropertyType.RECURRENCE_DATE_TIMES,
PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO, PropertyType.RECURRENCE_RULE,
PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE, PropertyType.STATUS,
| PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION,
PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,
|
18,514 | throw new RuntimeException("not implemented");
}
},
DAYLIGHT_SAVING_TIME ("DAYLIGHT",
Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START,
<BUG>PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES,
PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,</BUG>
PropertyType.TIME_ZONE_OFFSET_TO),
DaylightSavingTime.class)
{
| PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,
|
18,515 | throw new RuntimeException("not implemented");
}
},
VALARM ("VALARM",
Arrays.asList(PropertyType.ACTION, PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.DESCRIPTION,
<BUG>PropertyType.DURATION, PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.REPEAT_COUNT,
PropertyType.SUMMARY, PropertyType.TRIGGER),</BUG>
VAlarm.class)
{
@Override
| DAYLIGHT_SAVING_TIME ("DAYLIGHT",
Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START,
PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES,
PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,
PropertyType.TIME_ZONE_OFFSET_TO),
DaylightSavingTime.class)
|
18,516 | private ContentLineStrategy contentLineGenerator;
protected void setContentLineGenerator(ContentLineStrategy contentLineGenerator)
{
this.contentLineGenerator = contentLineGenerator;
}
<BUG>protected Callback<VChild, Void> copyChildCallback()
</BUG>
{
throw new RuntimeException("Can't copy children. copyChildCallback isn't overridden in subclass." + this.getClass());
};
| protected Callback<VChild, Void> copyIntoCallback()
|
18,517 | import jfxtras.labs.icalendarfx.properties.calendar.Version;
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
public enum CalendarProperty
{
CALENDAR_SCALE ("CALSCALE",
<BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER),
CalendarScale.class)</BUG>
{
@Override
public VChild parse(VCalendar vCalendar, String contentLine)
| Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD),
CalendarScale.class)
|
18,518 | CalendarScale calendarScale = (CalendarScale) child;
destination.setCalendarScale(calendarScale);
}
},
METHOD ("METHOD",
<BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER),
Method.class)</BUG>
{
@Override
public VChild parse(VCalendar vCalendar, String contentLine)
| Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD),
Method.class)
|
18,519 | }
list.add(new NonStandardProperty((NonStandardProperty) child));
}
},
PRODUCT_IDENTIFIER ("PRODID",
<BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER),
ProductIdentifier.class)</BUG>
{
@Override
public VChild parse(VCalendar vCalendar, String contentLine)
| public void copyChild(VChild child, VCalendar destination)
CalendarScale calendarScale = (CalendarScale) child;
destination.setCalendarScale(calendarScale);
METHOD ("METHOD",
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD),
Method.class)
|
18,520 | ProductIdentifier productIdentifier = (ProductIdentifier) child;
destination.setProductIdentifier(productIdentifier);
}
},
VERSION ("VERSION",
<BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER),
Version.class)</BUG>
{
@Override
public VChild parse(VCalendar vCalendar, String contentLine)
| Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD),
Version.class)
|
18,521 | package jfxtras.labs.icalendarfx.components;
import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment;
<BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty;
import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG>
import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates;
import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
| import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
|
18,522 | 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;
|
18,523 | 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;
|
18,524 | 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"),
|
18,525 | 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] |
18,526 | 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) {
|
18,527 | 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;
|
18,528 | package org.seleniumhq.selenium.fluent;
<BUG>import org.openqa.selenium.Dimension;
import org.openqa.selenium.Point;</BUG>
import org.openqa.selenium.WebDriver;
import java.util.List;
public abstract class BaseFluentWebElement extends BaseFluentWebDriver {
| [DELETED] |
18,529 | }
public FluentSelects selects(By by) {
MultipleResult multiple = multiple(by, "select");
return newFluentSelects(multiple.getResult(), multiple.getCtx());
}
<BUG>public FluentWebElement h1() {
</BUG>
SingleResult single = single(tagName("h1"), "h1");
return newFluentWebElement(delegate, single.getResult(), single.getCtx());
}
| protected BaseFluentWebElements spans() {
return newFluentWebElements(multiple(tagName("span"), "span"));
|
18,530 | import net.yacy.server.serverSwitch;
public class Load_PHPBB3 {
public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, @SuppressWarnings("unused") final serverObjects post, final serverSwitch env) {
final Switchboard sb = (Switchboard) env;
final serverObjects prop = new serverObjects();
<BUG>String a = sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIP());
</BUG>
if (a == null) a = "localhost:" + sb.getLocalPort();
final boolean intranet = sb.getConfig(SwitchboardConstants.NETWORK_NAME, "").equals("intranet");
final String repository = "http://" + a + "/repository/";
| String a = sb.peers.mySeed().getIP() == null ? null : sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIP());
|
18,531 | sb.append(':');
sb.append(port);
return sb.toString();
}
public final String getPublicAddress(final String ip) {
<BUG>if (ip == null) throw new RuntimeException("ip == NULL"); // that should not happen
</BUG>
final String port = this.dna.get(Seed.PORT); // we do not use getPort() here to avoid String->Integer->toString() conversion
final StringBuilder sb = new StringBuilder(ip.length() + 8); // / = surplus for port
if (ip.indexOf(':') >= 0) {
| if (ip == null) throw new RuntimeException("ip == NULL"); // that should not happen in Peer-to-Peer mode (but can in Intranet mode)
|
18,532 | import net.yacy.server.serverSwitch;
public class ConfigSearchBox {
public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, @SuppressWarnings("unused") final serverObjects post, final serverSwitch env) {
final serverObjects prop = new serverObjects();
final Switchboard sb = (Switchboard) env;
<BUG>String myaddress = sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIP());
</BUG>
if (myaddress == null) myaddress = "localhost:" + sb.getLocalPort();
prop.put("myaddress", myaddress);
return prop;
| String myaddress = sb.peers.mySeed().getIP() == null ? null : sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIP());
|
18,533 | package org.apache.cassandra.stress.operations;
import java.io.IOException;
import java.nio.ByteBuffer;
<BUG>import java.util.Collections;
import org.apache.cassandra.utils.ByteBufferUtil;</BUG>
import org.apache.cassandra.db.ColumnFamilyType;
import org.apache.cassandra.stress.Session;
import org.apache.cassandra.stress.util.CassandraClient;
| import com.yammer.metrics.core.TimerContext;
import org.apache.cassandra.utils.ByteBufferUtil;
|
18,534 | query.append(" USING CONSISTENCY ").append(session.getConsistencyLevel().toString());
cqlQuery = query.append(" WHERE KEY > ?").toString();
}
String key = String.format("%0" + session.getTotalKeysLength() + "d", index);
String formattedQuery = null;
<BUG>long startTime = System.currentTimeMillis();
boolean success = false;</BUG>
String exceptionMessage = null;
int rowCount = 0;
for (int t = 0; t < session.getRetryTimes(); t++)
| TimerContext context = session.latency.time();
boolean success = false;
|
18,535 | package org.apache.cassandra.stress.operations;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
<BUG>import java.util.List;
import org.apache.cassandra.db.ColumnFamilyType;</BUG>
import org.apache.cassandra.stress.Session;
import org.apache.cassandra.stress.util.CassandraClient;
import org.apache.cassandra.stress.util.Operation;
| import com.yammer.metrics.core.TimerContext;
import org.apache.cassandra.db.ColumnFamilyType;
|
18,536 | package org.apache.cassandra.stress.operations;
import java.io.IOException;
import java.nio.ByteBuffer;
<BUG>import java.util.Collections;
import org.apache.cassandra.db.ColumnFamilyType;</BUG>
import org.apache.cassandra.stress.Session;
import org.apache.cassandra.stress.util.CassandraClient;
import org.apache.cassandra.stress.util.Operation;
| import com.yammer.metrics.core.TimerContext;
import org.apache.cassandra.db.ColumnFamilyType;
|
18,537 | query.append(" WHERE KEY=?");
cqlQuery = query.toString();
}
String key = String.format("%0" + session.getTotalKeysLength() + "d", index);
String formattedQuery = null;
<BUG>long start = System.currentTimeMillis();
boolean success = false;</BUG>
String exceptionMessage = null;
for (int t = 0; t < session.getRetryTimes(); t++)
{
| TimerContext context = session.latency.time();
boolean success = false;
|
18,538 | package org.apache.cassandra.stress;
import java.io.PrintStream;
import java.util.concurrent.BlockingQueue;
<BUG>import java.util.concurrent.SynchronousQueue;
import org.apache.cassandra.stress.operations.*;</BUG>
import org.apache.cassandra.stress.util.CassandraClient;
import org.apache.cassandra.stress.util.Operation;
public class StressAction extends Thread
| import com.yammer.metrics.stats.Snapshot;
import org.apache.cassandra.stress.operations.*;
|
18,539 | ByteBuffer key = ByteBuffer.wrap(rawKey);
for (int j = 0; j < session.getSuperColumns(); j++)
{
String superColumn = 'S' + Integer.toString(j);
ColumnParent parent = new ColumnParent("SuperCounter1").setSuper_column(superColumn.getBytes());
<BUG>long start = System.currentTimeMillis();
boolean success = false;</BUG>
String exceptionMessage = null;
for (int t = 0; t < session.getRetryTimes(); t++)
{
| TimerContext context = session.latency.time();
boolean success = false;
|
18,540 | new String(rawKey),
(exceptionMessage == null) ? "" : "(" + exceptionMessage + ")"));
}
session.operations.getAndIncrement();
session.keys.getAndIncrement();
<BUG>session.latency.getAndAdd(System.currentTimeMillis() - start);
}</BUG>
}
private void runCounterGetter(SlicePredicate predicate, Cassandra.Client client) throws IOException
{
| context.stop();
|
18,541 | private void runCounterGetter(SlicePredicate predicate, Cassandra.Client client) throws IOException
{
ColumnParent parent = new ColumnParent("Counter1");
byte[] key = generateKey();
ByteBuffer keyBuffer = ByteBuffer.wrap(key);
<BUG>long start = System.currentTimeMillis();
boolean success = false;</BUG>
String exceptionMessage = null;
for (int t = 0; t < session.getRetryTimes(); t++)
{
| TimerContext context = session.latency.time();
boolean success = false;
|
18,542 | String rawKey = String.format(format, index);
Map<String, List<Mutation>> row = session.getColumnFamilyType() == ColumnFamilyType.Super
? getSuperColumnsMutationMap(superColumns)
: getColumnsMutationMap(columns);
Map<ByteBuffer, Map<String, List<Mutation>>> record = Collections.singletonMap(ByteBufferUtil.bytes(rawKey), row);
<BUG>long start = System.currentTimeMillis();
boolean success = false;</BUG>
String exceptionMessage = null;
for (int t = 0; t < session.getRetryTimes(); t++)
{
| TimerContext context = session.latency.time();
boolean success = false;
|
18,543 | rawKey,
(exceptionMessage == null) ? "" : "(" + exceptionMessage + ")"));
}
session.operations.getAndIncrement();
session.keys.getAndIncrement();
<BUG>session.latency.getAndAdd(System.currentTimeMillis() - start);
}</BUG>
private Map<String, List<Mutation>> getSuperColumnsMutationMap(List<SuperColumn> superColumns)
{
List<Mutation> mutations = new ArrayList<Mutation>(superColumns.size());
| context.stop();
|
18,544 | String rawKey = String.format(format, index);
Map<ByteBuffer, Map<String, List<Mutation>>> record = new HashMap<ByteBuffer, Map<String, List<Mutation>>>();
record.put(ByteBufferUtil.bytes(rawKey), session.getColumnFamilyType() == ColumnFamilyType.Super
? getSuperColumnsMutationMap(superColumns)
: getColumnsMutationMap(columns));
<BUG>long start = System.currentTimeMillis();
boolean success = false;</BUG>
String exceptionMessage = null;
for (int t = 0; t < session.getRetryTimes(); t++)
{
| TimerContext context = session.latency.time();
boolean success = false;
|
18,545 | rawKey,
(exceptionMessage == null) ? "" : "(" + exceptionMessage + ")"));
}
session.operations.getAndIncrement();
session.keys.getAndIncrement();
<BUG>session.latency.getAndAdd(System.currentTimeMillis() - start);
}</BUG>
private Map<String, List<Mutation>> getSuperColumnsMutationMap(List<CounterSuperColumn> superColumns)
{
List<Mutation> mutations = new ArrayList<Mutation>();
| context.stop();
|
18,546 | package org.apache.cassandra.stress.operations;
import java.io.IOException;
import java.nio.ByteBuffer;
<BUG>import java.util.Collections;
import org.apache.cassandra.db.ColumnFamilyType;</BUG>
import org.apache.cassandra.stress.Session;
import org.apache.cassandra.stress.util.CassandraClient;
import org.apache.cassandra.stress.util.Operation;
| import com.yammer.metrics.core.TimerContext;
import org.apache.cassandra.db.ColumnFamilyType;
|
18,547 | query.append(" USING CONSISTENCY ").append(session.getConsistencyLevel().toString());
cqlQuery = query.append(" WHERE KEY=?").toString();
}
byte[] key = generateKey();
String formattedQuery = null;
<BUG>long start = System.currentTimeMillis();
boolean success = false;</BUG>
String exceptionMessage = null;
for (int t = 0; t < session.getRetryTimes(); t++)
{
| TimerContext context = session.latency.time();
boolean success = false;
|
18,548 | package org.apache.cassandra.stress.operations;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
<BUG>import java.util.List;
import org.apache.cassandra.db.ColumnFamilyType;</BUG>
import org.apache.cassandra.stress.Session;
import org.apache.cassandra.stress.util.CassandraClient;
import org.apache.cassandra.stress.util.Operation;
| import com.yammer.metrics.core.TimerContext;
import org.apache.cassandra.db.ColumnFamilyType;
|
18,549 | queryParms.add(getUnQuotedCqlBlob(values.get(i % values.size()).array()));
}
String key = String.format("%0" + session.getTotalKeysLength() + "d", index);
queryParms.add(getUnQuotedCqlBlob(key));
String formattedQuery = null;
<BUG>long start = System.currentTimeMillis();
boolean success = false;</BUG>
String exceptionMessage = null;
for (int t = 0; t < session.getRetryTimes(); t++)
{
| TimerContext context = session.latency.time();
boolean success = false;
|
18,550 | package org.apache.cassandra.stress.operations;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Collections;
<BUG>import java.util.List;
import org.apache.cassandra.db.ColumnFamilyType;</BUG>
import org.apache.cassandra.stress.Session;
import org.apache.cassandra.stress.util.CassandraClient;
import org.apache.cassandra.stress.util.Operation;
| import com.yammer.metrics.core.TimerContext;
import org.apache.cassandra.db.ColumnFamilyType;
|
18,551 | String format = "%0" + session.getTotalKeysLength() + "d";
String startOffset = String.format(format, 0);
int expectedPerValue = session.getNumKeys() / values.size(), received = 0;
while (received < expectedPerValue)
{
<BUG>long start = System.currentTimeMillis();
boolean success = false;</BUG>
String exceptionMessage = null;
CqlResult results = null;
String formattedQuery = null;
| TimerContext context = session.latency.time();
boolean success = false;
|
18,552 | import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
<BUG>import java.util.concurrent.atomic.AtomicLong;
import org.apache.cassandra.cli.transport.FramedTransportFactory;</BUG>
import org.apache.cassandra.config.CFMetaData;
import org.apache.cassandra.config.EncryptionOptions;
import org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions;
| import com.yammer.metrics.Metrics;
import com.yammer.metrics.core.Histogram;
import org.apache.cassandra.cli.transport.FramedTransportFactory;
|
18,553 | public static final Options availableOptions = new Options();
public static final String KEYSPACE_NAME = "Keyspace1";
public static final String DEFAULT_COMPARATOR = "AsciiType";
public static final String DEFAULT_VALIDATOR = "BytesType";
private static InetAddress localInetAddress;
<BUG>public final AtomicInteger operations;
public final AtomicInteger keys;
public final AtomicLong latency;
private static final String SSL_TRUSTSTORE = "truststore";</BUG>
private static final String SSL_TRUSTSTORE_PW = "truststore-password";
| public final AtomicInteger operations = new AtomicInteger();
public final AtomicInteger keys = new AtomicInteger();
public final com.yammer.metrics.core.Timer latency = Metrics.newTimer(Session.class, "latency");
private static final String SSL_TRUSTSTORE = "truststore";
|
18,554 | package org.gradle.api.tasks.diagnostics.internal;
<BUG>import org.gradle.api.Project;
import org.gradle.api.tasks.diagnostics.internal.text.DefaultTextReportBuilder;</BUG>
import org.gradle.api.tasks.diagnostics.internal.text.TextReportBuilder;
import org.gradle.initialization.BuildClientMetaData;
import org.gradle.internal.concurrent.CompositeStoppable;
| import org.gradle.api.internal.file.FileResolver;
import org.gradle.api.tasks.diagnostics.internal.text.DefaultTextReportBuilder;
|
18,555 | public void complete() {
cleanupWriter();
}
private void setWriter(StyledTextOutput styledTextOutput, boolean close) {
this.textOutput = styledTextOutput;
<BUG>this.builder = new DefaultTextReportBuilder(textOutput);
</BUG>
this.close = close;
}
private void cleanupWriter() {
| this.builder = new DefaultTextReportBuilder(textOutput, fileResolver);
|
18,556 | private final SourceSetRenderer sourceSetRenderer;
private final BinaryRenderer binaryRenderer;
private final Set<LanguageSourceSet> componentSourceSets = new HashSet<LanguageSourceSet>();
private final Set<BinarySpec> componentBinaries = new HashSet<BinarySpec>();
public ComponentReportRenderer(FileResolver fileResolver) {
<BUG>componentRenderer = new ComponentRenderer(fileResolver);
sourceSetRenderer = new SourceSetRenderer(fileResolver);
binaryRenderer = new BinaryRenderer(fileResolver);
}</BUG>
@Override
| setFileResolver(fileResolver);
sourceSetRenderer = new SourceSetRenderer();
binaryRenderer = new BinaryRenderer();
componentRenderer = new ComponentRenderer(sourceSetRenderer, binaryRenderer);
}
|
18,557 | import javax.servlet.ServletException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;
<BUG>import java.util.logging.Level;
final class HazelcastInstanceLoader {</BUG>
private final static ILogger logger = Logger.getLogger(HazelcastInstanceLoader.class);
public static final String INSTANCE_NAME = "instance-name";
public static final String CONFIG_LOCATION = "config-location";
| import static java.lang.String.format;
final class HazelcastInstanceLoader {
|
18,558 | configUrl = getConfigURL(filterConfig, clientConfigLocation);
} else if(!isEmpty(configLocation)) {
configUrl = getConfigURL(filterConfig, configLocation);
}
if(useClient) {
<BUG>logger.warning(
"Creating HazelcastClient, make sure this node has access to an already running cluster...");
</BUG>
ClientConfig clientConfig ;
| logger.info(
"Creating HazelcastClient for session replication, make sure this client has access to an already running cluster...");
|
18,559 | import java.util.concurrent.ConcurrentMap;
import java.util.logging.Level;
import static com.hazelcast.web.HazelcastInstanceLoader.*;
@SuppressWarnings("deprecation")
public class WebFilter implements Filter {
<BUG>private static final ILogger LOGGER = Logger.getLogger(WebFilter.class);
</BUG>
private static final LocalCacheEntry NULL_ENTRY = new LocalCacheEntry();
private static final String HAZELCAST_REQUEST = "*hazelcast-request";
private static final String HAZELCAST_SESSION_COOKIE_NAME = "hazelcast.sessionId";
| private static final ILogger logger = Logger.getLogger(WebFilter.class);
|
18,560 | public void entryAdded(EntryEvent<String, Object> entryEvent) {
}
public void entryRemoved(EntryEvent<String, Object> entryEvent) {
if (entryEvent.getMember() == null || // client events has no owner member
!entryEvent.getMember().localMember()) {
<BUG>removeSessionLocally((String) entryEvent.getKey());
}</BUG>
}
public void entryUpdated(EntryEvent<String, Object> entryEvent) {
}
| removeSessionLocally(entryEvent.getKey());
|
18,561 | }
}
private void removeSessionLocally(String sessionId) {
HazelcastHttpSession hazelSession = mapSessions.remove(sessionId);
if (hazelSession != null) {
<BUG>mapOriginalSessions.remove(hazelSession.originalSession.getId());
log("Destroying session locally " + hazelSession);
hazelSession.destroy();</BUG>
}
| String stickySessionParam = getParam("sticky-session");
if (stickySessionParam != null) {
stickySession = Boolean.valueOf(stickySessionParam);
|
18,562 | return key.substring(key.indexOf(HAZELCAST_SESSION_ATTRIBUTE_SEPARATOR) + HAZELCAST_SESSION_ATTRIBUTE_SEPARATOR.length());
}
private HazelcastHttpSession createNewSession(RequestWrapper requestWrapper, String existingSessionId) {
String id = existingSessionId != null ? existingSessionId : generateSessionId();
if (requestWrapper.getOriginalSession(false) != null) {
<BUG>log("Original session exists!!!");
</BUG>
}
HttpSession originalSession = requestWrapper.getOriginalSession(true);
HazelcastHttpSession hazelcastSession = new HazelcastHttpSession(WebFilter.this, id, originalSession, deferredWrite);
| logger.finest("Original session exists!!!");
|
18,563 | String attributeKey = extractAttributeKey(entry.getKey());
LocalCacheEntry cacheEntry = cache.get(attributeKey);
if (cacheEntry == null) {
cacheEntry = new LocalCacheEntry();
cache.put(attributeKey, cacheEntry);
<BUG>}
log("Storing " + attributeKey + " on session " + hazelcastSession.getId());
cacheEntry.value = entry.getValue();</BUG>
cacheEntry.dirty = false;
| [DELETED] |
18,564 | for (LocalCacheEntry cacheEntry : cache.values()) {
cacheEntry.reload = true;
}
}
}
<BUG>private void destroySession(HazelcastHttpSession session, boolean removeGlobalSession) {
log("Destroying local session: " + session.getId());
mapSessions.remove(session.getId());</BUG>
mapOriginalSessions.remove(session.originalSession.getId());
| if(logger.isFinestEnabled()){
logger.finest("Destroying local session: " + session.getId());
mapSessions.remove(session.getId());
|
18,565 | return getSession(true);
}
@Override
public HazelcastHttpSession getSession(final boolean create) {
if (hazelcastSession != null && !hazelcastSession.isValid()) {
<BUG>log("Session is invalid!");
</BUG>
destroySession(hazelcastSession, true);
hazelcastSession = null;
}
| logger.finest("Session is invalid!");
|
18,566 | throws IOException, ServletException {
if (!(req instanceof HttpServletRequest)) {
chain.doFilter(req, res);
} else {
if (req instanceof RequestWrapper) {
<BUG>log("Request is instance of RequestWrapper! Continue...");
</BUG>
chain.doFilter(req, res);
return;
}
| logger.finest("Request is instance of RequestWrapper! Continue...");
|
18,567 | package org.apache.felix.webconsole.internal.compendium;
import java.io.IOException;
import java.io.PrintWriter;
<BUG>import java.util.Arrays;
import java.util.Collections;
import java.util.Dictionary;
import java.util.Iterator;
import java.util.TreeMap;
import java.util.TreeSet;</BUG>
import javax.servlet.http.HttpServletRequest;
| import java.util.*;
import javax.servlet.ServletException;
|
18,568 | import java.util.Iterator;
import java.util.TreeMap;
import java.util.TreeSet;</BUG>
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
<BUG>import org.apache.felix.scr.Component;
import org.apache.felix.scr.Reference;
import org.apache.felix.scr.ScrService;</BUG>
import org.apache.felix.webconsole.internal.BaseWebConsolePlugin;
| package org.apache.felix.webconsole.internal.compendium;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
import javax.servlet.ServletException;
import org.apache.felix.scr.*;
|
18,569 | import org.apache.felix.scr.Reference;
import org.apache.felix.scr.ScrService;</BUG>
import org.apache.felix.webconsole.internal.BaseWebConsolePlugin;
import org.apache.felix.webconsole.internal.Util;
import org.apache.felix.webconsole.internal.servlet.OsgiManager;
<BUG>import org.json.JSONException;
import org.json.JSONWriter;
</BUG>
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
| package org.apache.felix.webconsole.internal.compendium;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.felix.scr.*;
import org.json.*;
|
18,570 | public static final String NAME = "components";
public static final String LABEL = "Components";
public static final String COMPONENT_ID = "componentId";
public static final String OPERATION = "action";
public static final String OPERATION_ENABLE = "enable";
<BUG>public static final String OPERATION_DISABLE = "disable";
private static final String SCR_SERVICE = ScrService.class.getName();</BUG>
public String getTitle()
{
return LABEL;
| public static final String OPERATION_EDIT = "edit";
private static final String SCR_SERVICE = ScrService.class.getName();
|
18,571 | jw.endObject();
jw.endArray();</BUG>
if ( details )
{
gatherComponentDetails( jw, component );
<BUG>}
jw.endObject();</BUG>
}
private void gatherComponentDetails( JSONWriter jw, Component component ) throws JSONException
{
| private void action( JSONWriter jw, boolean enabled, String op, String opLabel, String image ) throws JSONException
jw.object();
jw.key( "enabled" ).value( enabled );
jw.key( "name" ).value( opLabel );
jw.key( "link" ).value( op );
jw.key( "image" ).value( image );
|
18,572 | name = ( String ) boundRefs[j].getProperty( Constants.SERVICE_DESCRIPTION );
}
}
if ( name != null )
{
<BUG>buf.append( " (" );
buf.append( name );
buf.append( ")" );
}
}</BUG>
}
| b.append( " (" );
b.append( name );
b.append( ")" );
buf.put(b.toString());
|
18,573 | public static void transformConfigFile(InputStream sourceStream, String destPath) throws Exception {
try {
Yaml yaml = new Yaml();
final Object loadedObject = yaml.load(sourceStream);
if (loadedObject instanceof Map) {
<BUG>final Map<String, Object> result = (Map<String, Object>) loadedObject;
ByteArrayOutputStream nifiPropertiesOutputStream = new ByteArrayOutputStream();
writeNiFiProperties(result, nifiPropertiesOutputStream);
DOMSource flowXml = createFlowXml(result);
</BUG>
writeNiFiPropertiesFile(nifiPropertiesOutputStream, destPath);
| final Map<String, Object> loadedMap = (Map<String, Object>) loadedObject;
ConfigSchema configSchema = new ConfigSchema(loadedMap);
if (!configSchema.isValid()) {
throw new InvalidConfigurationException("Failed to transform config file due to:" + configSchema.getValidationIssuesAsString());
}
writeNiFiProperties(configSchema, nifiPropertiesOutputStream);
DOMSource flowXml = createFlowXml(configSchema);
|
18,574 | writer.println("nifi.h2.url.append=;LOCK_TIMEOUT=25000;WRITE_DELAY=0;AUTO_SERVER=FALSE");
writer.println();
writer.println("# FlowFile Repository");
writer.println("nifi.flowfile.repository.implementation=org.apache.nifi.controller.repository.WriteAheadFlowFileRepository");
writer.println("nifi.flowfile.repository.directory=./flowfile_repository");
<BUG>writer.println("nifi.flowfile.repository.partitions=" + getValueString(flowfileRepo, PARTITIONS_KEY));
writer.println("nifi.flowfile.repository.checkpoint.interval=" + getValueString(flowfileRepo,CHECKPOINT_INTERVAL_KEY));
writer.println("nifi.flowfile.repository.always.sync=" + getValueString(flowfileRepo,ALWAYS_SYNC_KEY));
</BUG>
writer.println();
| writer.println("nifi.flowfile.repository.partitions=" + flowfileRepoSchema.getPartitions());
writer.println("nifi.flowfile.repository.checkpoint.interval=" + flowfileRepoSchema.getCheckpointInterval());
writer.println("nifi.flowfile.repository.always.sync=" + flowfileRepoSchema.getAlwaysSync());
|
18,575 | writer.println("# cluster manager properties (only configure for cluster manager) #");
writer.println("nifi.cluster.is.manager=false");
} catch (NullPointerException e) {
throw new ConfigurationChangeException("Failed to parse the config YAML while creating the nifi.properties", e);
} finally {
<BUG>if (writer != null){
</BUG>
writer.flush();
writer.close();
}
| if (writer != null) {
|
18,576 | writer.flush();
writer.close();
}
}
}
<BUG>private static DOMSource createFlowXml(Map<String, Object> topLevelYaml) throws IOException, ConfigurationChangeException {
</BUG>
try {
final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
docFactory.setNamespaceAware(true);
| private static DOMSource createFlowXml(ConfigSchema configSchema) throws IOException, ConfigurationChangeException {
|
18,577 | docFactory.setNamespaceAware(true);
final DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
final Document doc = docBuilder.newDocument();
final Element rootNode = doc.createElement("flowController");
doc.appendChild(rootNode);
<BUG>Map<String, Object> processorConfig = (Map<String, Object>) topLevelYaml.get(PROCESSOR_CONFIG_KEY);
addTextElement(rootNode, "maxTimerDrivenThreadCount", getValueString(processorConfig, MAX_CONCURRENT_TASKS_KEY, "1"));
addTextElement(rootNode, "maxEventDrivenThreadCount", getValueString(processorConfig, MAX_CONCURRENT_TASKS_KEY, "1"));
addProcessGroup(rootNode, topLevelYaml, "rootGroup");
Map<String, Object> securityProps = (Map<String, Object>) topLevelYaml.get(SECURITY_PROPS_KEY);
if (securityProps != null) {
String sslAlgorithm = (String) securityProps.get(SSL_PROTOCOL_KEY);
if (sslAlgorithm != null && !(sslAlgorithm.isEmpty())) {</BUG>
final Element controllerServicesNode = doc.createElement("controllerServices");
| CorePropertiesSchema coreProperties = configSchema.getCoreProperties();
addTextElement(rootNode, "maxTimerDrivenThreadCount", String.valueOf(coreProperties.getMaxConcurrentThreads()));
addTextElement(rootNode, "maxEventDrivenThreadCount", String.valueOf(coreProperties.getMaxConcurrentThreads()));
addProcessGroup(rootNode, configSchema, "rootGroup");
SecurityPropertiesSchema securityProperties = configSchema.getSecurityProperties();
if (securityProperties.useSSL()) {
|
18,578 | throw new ConfigurationChangeException("Failed to parse the config YAML while trying to add the Provenance Reporting Task", e);
}
}
private static void addConfiguration(final Element element, Map<String, Object> elementConfig) {
final Document doc = element.getOwnerDocument();
<BUG>if (elementConfig == null){
</BUG>
return;
}
for (final Map.Entry<String, Object> entry : elementConfig.entrySet()) {
| if (elementConfig == null) {
|
18,579 | customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString());
customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName);
customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString());
customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName);
customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString());
<BUG>customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName);
}</BUG>
public void init() {
try {
LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
| customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName);
customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName);
}
|
18,580 | 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;
|
18,581 | 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;
|
18,582 | 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"),
|
18,583 | 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] |
18,584 | 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) {
|
18,585 | 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;
|
18,586 | import de.dala.simplenews.common.Feed;
public interface IDatabaseHandler {
List<Category> getCategories(Boolean excludeFeeds, Boolean excludeEntries, Boolean onlyVisible);
Category getCategory(Long categoryId, Boolean excludeFeeds, Boolean excludeEntries);
long[] addCategories(List<Category> categories, Boolean excludeFeeds, Boolean excludeEntries);
<BUG>long addCategory(Category category, Boolean excludeFeeds, Boolean excludeEntries);
int removeCategory(long categoryId, Boolean excludeFeeds, Boolean excludeEntries);
int updateCategory(Category category);
</BUG>
void removeAllCategories();
| void addCategory(Category category, Boolean excludeFeeds, Boolean excludeEntries);
void removeCategory(long categoryId, Boolean excludeFeeds, Boolean excludeEntries);
void updateCategory(Category category);
|
18,587 | void removeAllCategories();
List<Feed> getFeeds(Long categoryId, Boolean excludeEntries);
Feed getFeed(long feedId, Boolean excludeEntries);
long addFeed(long categoryId, Feed feed, Boolean excludeEntries);
long[] addFeeds(long categoryId, List<Feed> feeds, Boolean excludeEntries);
<BUG>int removeFeeds(Long categoryId, Long feedId, Boolean excludeEntries);
int updateFeed(Feed feed);
</BUG>
List<Entry> getEntries(Long categoryId, Long feedId, Boolean onlyVisible);
| void removeFeeds(Long categoryId, Long feedId, Boolean excludeEntries);
void updateFeed(Feed feed);
|
18,588 | }
@Override
public Cursor getCursor() {
String query = null;
if (mCategoryId != null){
<BUG>query = concatenateQueries(query, CATEGORY_ID + " = " + mCategoryId);
</BUG>
}
if (mOnlyVisible != null){
query = concatenateQueries(query, CATEGORY_VISIBLE + "=" + (mOnlyVisible ? "1" : "0"));
| query = concatenateQueries(null, CATEGORY_ID + " = " + mCategoryId);
|
18,589 | if (mExcludeFeeds == null || !mExcludeFeeds) {
PersistableFeeds mPersistableFeeds = getPersistableFeeds(category.getId());
Cursor feedCursor = mPersistableFeeds.getCursor();
try {
if (feedCursor.moveToFirst()){
<BUG>List<Feed> cached = new ArrayList<Feed>();
do {</BUG>
cached.add(mPersistableFeeds.loadFrom(feedCursor));
}
while (feedCursor.moveToNext());
| List<Feed> cached = new ArrayList<>();
do {
|
18,590 | }
@Override
public Cursor getCursor() {
String query = null;
if (mCategoryId != null){
<BUG>query = concatenateQueries(query, FEED_CATEGORY_ID + " = " + mCategoryId);
</BUG>
}
if (mFeedId != null){
query = concatenateQueries(query, FEED_ID + " = " + mFeedId);
| query = concatenateQueries(null, FEED_CATEGORY_ID + " = " + mCategoryId);
|
18,591 | if (mExcludeEntries != null && !mExcludeEntries) {
PersistableEntries mPersistableEntries = getPersistableEntries(feed.getCategoryId(), feed.getId());
Cursor entryCursor = mPersistableEntries.getCursor();
try {
if (entryCursor.moveToFirst()){
<BUG>List<Entry> cached = new ArrayList<Entry>();
do {</BUG>
cached.add(mPersistableEntries.loadFrom(entryCursor));
}
while (entryCursor.moveToNext());
| List<Entry> cached = new ArrayList<>();
do {
|
18,592 | private Integer order;
private transient List<Feed> feeds;
private boolean isVisible = true;
private Long lastUpdateTime;
public Category() {
<BUG>feeds = new ArrayList<Feed>();
}
public Category(Parcel in) {
</BUG>
this.name = in.readString();
| feeds = new ArrayList<>();
private Category(Parcel in) {
|
18,593 | private List<Category> categories;
public News(List<Category> categories) {
this.categories = categories;
}
public News() {
<BUG>this.categories = new ArrayList<Category>();
}</BUG>
public List<Category> getCategories() {
return categories;
}
| this.categories = new ArrayList<>();
|
18,594 | package com.easytoolsoft.easyreport.web.controller.common;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping(value = "/error")
<BUG>public class ErrorController extends AbstractController {
@RequestMapping(value = {"/404"})</BUG>
public String error404() {
return "/error/404";
}
| public class ErrorController {
@RequestMapping(value = {"/404"})
|
18,595 | 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 {
|
18,596 | 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()));
|
18,597 | } 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."));
|
18,598 | 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));
|
18,599 | } 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 " +
|
18,600 | 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));
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.