id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
10,501 | fillLayers(map, cboGcLayer);
cboGcLayer.setData(param.key);
cboGcLayer.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
<BUG>GridCoverage2D sfc = getGridCoverage(map, cboGcLayer.getText());
</BUG>
processParams.put(param.key, sfc);
}
});
| GridCoverage2D sfc = MapUtils.getGridCoverage(map, cboGcLayer.getText());
|
10,502 | grpMap.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
grpMap.setLayout(new GridLayout(2, false));
widget.createLabel(grpMap, Messages.MultipleFieldsSelectionDialog_Layer, null, 1);
cboLayer = widget.createCombo(grpMap, 1, true);
for (ILayer layer : map.getMapLayers()) {
<BUG>if (layer.hasResource(FeatureSource.class)) {
</BUG>
cboLayer.add(layer.getName());
}
}
| if (layer.getName() != null && layer.hasResource(FeatureSource.class)) {
|
10,503 | edge.destination().sub(edge.origin(), seg);
return dot(seg, diff) / edge.origin().sqrDistance3D(edge.destination());
}</BUG>
public void compute()
{
<BUG>Skeleton skeleton = new Skeleton(mesh, angle);
main: for(List<Vertex> polyline: skeleton.getPolylinesVertices())</BUG>
{
RemeshPolyline rp = new RemeshPolyline(mesh, polyline, metric);
rp.setBuildBackgroundLink(true);
| if(e.destination() == v1 && !e.sym().hasAttributes(AbstractHalfEdge.OUTER))
return e.sym();
}
throw new NoSuchElementException(v1+" "+v2+" "+v1.getLink()+" "+v2.getLink());
}
EdgesCollapser edgeCollapser = new EdgesCollapser(mesh);
main: for(List<Vertex> polyline: skeleton.getPolylinesVertices())
|
10,504 | AbstractHalfEdge e = getEdge(polyline, i);
if(e.hasAttributes(AbstractHalfEdge.IMMUTABLE))
continue main;
edgeIndex.add(e);
}
<BUG>for(Vertex v:toInsert)
{
int segId = bgLink.get(k++);
AbstractHalfEdge toSplit = edgeIndex.get(segId);</BUG>
double od = v.sqrDistance3D(toSplit.origin());
| for(int k = 0; k < toInsert.size(); k++)
Vertex v = toInsert.get(k);
int segId = bgLink.get(k);
AbstractHalfEdge toSplit = edgeIndex.get(segId);
|
10,505 | 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;
|
10,506 | public static final String DELETE_ACTION_HISTORY_RESULT;
public static final String DELETE_ACTION_PLUGIN;
public static final String DELETE_ALERT;
public static final String DELETE_ALERT_CTIME;
public static final String DELETE_ALERT_LIFECYCLE;
<BUG>public static final String DELETE_ALERT_SEVERITY;
public static final String DELETE_ALERT_STATUS;</BUG>
public static final String DELETE_ALERT_TRIGGER;
public static final String DELETE_CONDITIONS;
public static final String DELETE_CONDITIONS_MODE;
| [DELETED] |
10,507 | public static final String INSERT_ACTION_PLUGIN;
public static final String INSERT_ACTION_PLUGIN_DEFAULT_PROPERTIES;
public static final String INSERT_ALERT;
public static final String INSERT_ALERT_CTIME;
public static final String INSERT_ALERT_LIFECYCLE;
<BUG>public static final String INSERT_ALERT_SEVERITY;
public static final String INSERT_ALERT_STATUS;</BUG>
public static final String INSERT_ALERT_TRIGGER;
public static final String INSERT_CONDITION_AVAILABILITY;
public static final String INSERT_CONDITION_COMPARE;
| [DELETED] |
10,508 | public static final String SELECT_ALERT_CTIME_START;
public static final String SELECT_ALERT_CTIME_START_END;
public static final String SELECT_ALERT_LIFECYCLE_END;
public static final String SELECT_ALERT_LIFECYCLE_START;
public static final String SELECT_ALERT_LIFECYCLE_START_END;
<BUG>public static final String SELECT_ALERT_STATUS;
public static final String SELECT_ALERT_SEVERITY;</BUG>
public static final String SELECT_ALERT_TRIGGER;
public static final String SELECT_ALERTS_BY_TENANT;
public static final String SELECT_CONDITION_ID;
| [DELETED] |
10,509 | DELETE_ALERT = "DELETE FROM " + keyspace + ".alerts " + "WHERE tenantId = ? AND alertId = ? ";
DELETE_ALERT_CTIME = "DELETE FROM " + keyspace + ".alerts_ctimes "
+ "WHERE tenantId = ? AND ctime = ? AND alertId = ? ";
DELETE_ALERT_LIFECYCLE = "DELETE FROM " + keyspace + ".alerts_lifecycle "
+ "WHERE tenantId = ? AND status = ? AND stime = ? AND alertId = ? ";
<BUG>DELETE_ALERT_SEVERITY = "DELETE FROM " + keyspace + ".alerts_severities "
+ "WHERE tenantId = ? AND severity = ? AND alertId = ? ";
DELETE_ALERT_STATUS = "DELETE FROM " + keyspace + ".alerts_statuses "
+ "WHERE tenantId = ? AND status = ? AND alertId = ? ";</BUG>
DELETE_ALERT_TRIGGER = "DELETE FROM " + keyspace + ".alerts_triggers "
| [DELETED] |
10,510 | INSERT_ALERT = "INSERT INTO " + keyspace + ".alerts " + "(tenantId, alertId, payload) VALUES (?, ?, ?) ";
INSERT_ALERT_CTIME = "INSERT INTO " + keyspace + ".alerts_ctimes "
+ "(tenantId, alertId, ctime) VALUES (?, ?, ?) ";
INSERT_ALERT_LIFECYCLE = "INSERT INTO " + keyspace + ".alerts_lifecycle "
+ "(tenantId, alertId, status, stime) VALUES (?, ?, ?, ?) ";
<BUG>INSERT_ALERT_SEVERITY = "INSERT INTO " + keyspace + ".alerts_severities "
+ "(tenantId, alertId, severity) VALUES (?, ?, ?) ";
INSERT_ALERT_STATUS = "INSERT INTO " + keyspace + ".alerts_statuses "
+ "(tenantId, alertId, status) VALUES (?, ?, ?) ";</BUG>
INSERT_ALERT_TRIGGER = "INSERT INTO " + keyspace + ".alerts_triggers "
| [DELETED] |
10,511 | + "WHERE tenantId = ? AND status = ? AND stime <= ? ";
SELECT_ALERT_LIFECYCLE_START = "SELECT alertId FROM " + keyspace + ".alerts_lifecycle "
+ "WHERE tenantId = ? AND status = ? AND stime >= ? ";
SELECT_ALERT_LIFECYCLE_START_END = "SELECT alertId FROM " + keyspace + ".alerts_lifecycle "
+ "WHERE tenantId = ? AND status = ? AND stime >= ? AND stime <= ? ";
<BUG>SELECT_ALERT_SEVERITY = "SELECT alertId FROM " + keyspace + ".alerts_severities "
+ "WHERE tenantId = ? AND severity = ? ";
SELECT_ALERT_STATUS = "SELECT alertId FROM " + keyspace + ".alerts_statuses "
+ "WHERE tenantId = ? AND status = ? ";</BUG>
SELECT_ALERTS_BY_TENANT = "SELECT payload FROM " + keyspace + ".alerts " + "WHERE tenantId = ? ";
| [DELETED] |
10,512 | import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
<BUG>import java.util.stream.Collectors;
import javax.ejb.EJB;</BUG>
import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
| import javax.annotation.PostConstruct;
import javax.ejb.EJB;
|
10,513 | import org.hawkular.alerts.api.model.trigger.Trigger;
import org.hawkular.alerts.api.services.ActionsService;
import org.hawkular.alerts.api.services.AlertsCriteria;
import org.hawkular.alerts.api.services.AlertsService;
import org.hawkular.alerts.api.services.DefinitionsService;
<BUG>import org.hawkular.alerts.api.services.EventsCriteria;
import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingData;</BUG>
import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingEvents;
import org.hawkular.alerts.engine.log.MsgLogger;
import org.hawkular.alerts.engine.service.AlertsEngine;
| import org.hawkular.alerts.api.services.PropertiesService;
import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingData;
|
10,514 | import com.datastax.driver.core.Session;
import com.google.common.util.concurrent.Futures;
@Local(AlertsService.class)
@Stateless
@TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED)
<BUG>public class CassAlertsServiceImpl implements AlertsService {
private final MsgLogger msgLog = MsgLogger.LOGGER;
private final Logger log = Logger.getLogger(CassAlertsServiceImpl.class);
@EJB</BUG>
AlertsEngine alertsEngine;
| private static final String CRITERIA_NO_QUERY_SIZE = "hawkular-alerts.criteria-no-query-size";
private static final String CRITERIA_NO_QUERY_SIZE_ENV = "CRITERIA_NO_QUERY_SIZE";
private static final String CRITERIA_NO_QUERY_SIZE_DEFAULT = "200";
private int criteriaNoQuerySize;
|
10,515 | log.debug("Adding " + alerts.size() + " alerts");
}
PreparedStatement insertAlert = CassStatement.get(session, CassStatement.INSERT_ALERT);
PreparedStatement insertAlertTrigger = CassStatement.get(session, CassStatement.INSERT_ALERT_TRIGGER);
PreparedStatement insertAlertCtime = CassStatement.get(session, CassStatement.INSERT_ALERT_CTIME);
<BUG>PreparedStatement insertAlertStatus = CassStatement.get(session, CassStatement.INSERT_ALERT_STATUS);
PreparedStatement insertAlertSeverity = CassStatement.get(session, CassStatement.INSERT_ALERT_SEVERITY);</BUG>
PreparedStatement insertTag = CassStatement.get(session, CassStatement.INSERT_TAG);
try {
List<ResultSetFuture> futures = new ArrayList<>();
| [DELETED] |
10,516 | futures.add(session.executeAsync(insertAlertTrigger.bind(a.getTenantId(),
a.getAlertId(),
a.getTriggerId())));
futures.add(session.executeAsync(insertAlertCtime.bind(a.getTenantId(),
a.getAlertId(), a.getCtime())));
<BUG>futures.add(session.executeAsync(insertAlertStatus.bind(a.getTenantId(),
a.getAlertId(),
a.getStatus().name())));
futures.add(session.executeAsync(insertAlertSeverity.bind(a.getTenantId(),
a.getAlertId(),
a.getSeverity().name())));</BUG>
a.getTags().entrySet().stream().forEach(tag -> {
| [DELETED] |
10,517 | for (Row row : rsAlerts) {
String payload = row.getString("payload");
Alert alert = JsonUtil.fromJson(payload, Alert.class, thin);
alerts.add(alert);
}
<BUG>}
} catch (Exception e) {
msgLog.errorDatabaseException(e.getMessage());
throw e;
}
return preparePage(alerts, pager);</BUG>
}
| [DELETED] |
10,518 | for (Alert a : alertsToDelete) {
String id = a.getAlertId();
List<ResultSetFuture> futures = new ArrayList<>();
futures.add(session.executeAsync(deleteAlert.bind(tenantId, id)));
futures.add(session.executeAsync(deleteAlertCtime.bind(tenantId, a.getCtime(), id)));
<BUG>futures.add(session.executeAsync(deleteAlertSeverity.bind(tenantId, a.getSeverity().name(), id)));
futures.add(session.executeAsync(deleteAlertStatus.bind(tenantId, a.getStatus().name(), id)));</BUG>
futures.add(session.executeAsync(deleteAlertTrigger.bind(tenantId, a.getTriggerId(), id)));
a.getLifecycle().stream().forEach(l -> {
futures.add(
| [DELETED] |
10,519 | private Alert updateAlertStatus(Alert alert) throws Exception {
if (alert == null || alert.getAlertId() == null || alert.getAlertId().isEmpty()) {
throw new IllegalArgumentException("AlertId must be not null");
}
try {
<BUG>PreparedStatement deleteAlertStatus = CassStatement.get(session,
CassStatement.DELETE_ALERT_STATUS);
PreparedStatement insertAlertStatus = CassStatement.get(session,
CassStatement.INSERT_ALERT_STATUS);</BUG>
PreparedStatement insertAlertLifecycle = CassStatement.get(session,
| [DELETED] |
10,520 | PreparedStatement insertAlertLifecycle = CassStatement.get(session,
CassStatement.INSERT_ALERT_LIFECYCLE);
PreparedStatement updateAlert = CassStatement.get(session,
CassStatement.UPDATE_ALERT);
List<ResultSetFuture> futures = new ArrayList<>();
<BUG>for (Status statusToDelete : EnumSet.complementOf(EnumSet.of(alert.getStatus()))) {
futures.add(session.executeAsync(deleteAlertStatus.bind(alert.getTenantId(), statusToDelete.name(),
alert.getAlertId())));
}
futures.add(session.executeAsync(insertAlertStatus.bind(alert.getTenantId(), alert.getAlertId(), alert
.getStatus().name())));</BUG>
Alert.LifeCycle lifecycle = alert.getCurrentLifecycle();
| [DELETED] |
10,521 | String category = null;
Collection<String> categories = null;
String triggerId = null;
Collection<String> triggerIds = null;
Map<String, String> tags = null;
<BUG>boolean thin = false;
public EventsCriteria() {</BUG>
super();
}
public Long getStartTime() {
| Integer criteriaNoQuerySize = null;
public EventsCriteria() {
|
10,522 | }
@Override
public String toString() {
return "EventsCriteria [startTime=" + startTime + ", endTime=" + endTime + ", eventId=" + eventId
+ ", eventIds=" + eventIds + ", category=" + category + ", categories=" + categories + ", triggerId="
<BUG>+ triggerId + ", triggerIds=" + triggerIds + ", tags=" + tags + ", thin=" + thin + "]";
}</BUG>
}
| public void addTag(String name, String value) {
if (null == tags) {
tags = new HashMap<>();
|
10,523 | import us.ihmc.robotics.robotSide.SideDependentList;
import us.ihmc.wholeBodyController.DRCHandType;
public enum AtlasRobotVersion
{
ATLAS_UNPLUGGED_V5_NO_HANDS,
<BUG>ATLAS_UNPLUGGED_V5_DUAL_ROBOTIQ,
ATLAS_UNPLUGGED_V5_INVISIBLE_CONTACTABLE_PLANE_HANDS,</BUG>
ATLAS_UNPLUGGED_V5_ROBOTIQ_AND_SRI,
ATLAS_UNPLUGGED_V5_TROOPER;
private static String[] resourceDirectories;
| ATLAS_UNPLUGGED_V5_NO_FOREARMS,
ATLAS_UNPLUGGED_V5_INVISIBLE_CONTACTABLE_PLANE_HANDS,
|
10,524 | case ATLAS_UNPLUGGED_V5_DUAL_ROBOTIQ:
case ATLAS_UNPLUGGED_V5_TROOPER:
return DRCHandType.ROBOTIQ;
case ATLAS_UNPLUGGED_V5_ROBOTIQ_AND_SRI:
return DRCHandType.ROBOTIQ_AND_SRI;
<BUG>case ATLAS_UNPLUGGED_V5_NO_HANDS:
case ATLAS_UNPLUGGED_V5_INVISIBLE_CONTACTABLE_PLANE_HANDS:</BUG>
default:
return DRCHandType.NONE;
}
| case ATLAS_UNPLUGGED_V5_NO_FOREARMS:
case ATLAS_UNPLUGGED_V5_INVISIBLE_CONTACTABLE_PLANE_HANDS:
|
10,525 | }
}
public static final String chestName = "utorso";
public static final String pelvisName = "pelvis";
public static final String headName = "head";
<BUG>private final LegJointName[] legJoints = { HIP_YAW, HIP_ROLL, HIP_PITCH, KNEE_PITCH, ANKLE_PITCH, ANKLE_ROLL };
private final ArmJointName[] armJoints = { SHOULDER_YAW, SHOULDER_ROLL, ELBOW_PITCH, ELBOW_ROLL, FIRST_WRIST_PITCH, WRIST_ROLL, SECOND_WRIST_PITCH };
private final SpineJointName[] spineJoints = { SPINE_PITCH, SPINE_ROLL, SPINE_YAW };
private final NeckJointName[] neckJoints = { PROXIMAL_NECK_PITCH };
private final LinkedHashMap<String, JointRole> jointRoles = new LinkedHashMap<String, JointRole>();</BUG>
private final LinkedHashMap<String, ImmutablePair<RobotSide, LimbName>> limbNames = new LinkedHashMap<String, ImmutablePair<RobotSide, LimbName>>();
| private final LegJointName[] legJoints = {HIP_YAW, HIP_ROLL, HIP_PITCH, KNEE_PITCH, ANKLE_PITCH, ANKLE_ROLL};
private final ArmJointName[] armJoints;
private final SpineJointName[] spineJoints = {SPINE_PITCH, SPINE_ROLL, SPINE_YAW};
private final NeckJointName[] neckJoints = {PROXIMAL_NECK_PITCH};
private final LinkedHashMap<String, JointRole> jointRoles = new LinkedHashMap<String, JointRole>();
|
10,526 | jointNamesBeforeFeet[0] = getJointBeforeFootName(RobotSide.LEFT);
jointNamesBeforeFeet[1] = getJointBeforeFootName(RobotSide.RIGHT);
}
@Override
public SideDependentList<String> getNameOfJointBeforeHands()
<BUG>{
return nameOfJointsBeforeHands;
}</BUG>
@Override
public SideDependentList<String> getNameOfJointBeforeThighs()
| if (atlasVersion != AtlasRobotVersion.ATLAS_UNPLUGGED_V5_NO_FOREARMS)
return null;
|
10,527 | }
@Override
public List<ImmutablePair<String, Vector3D>> getJointNameGroundContactPointMap()
{
return contactPointParameters.getJointNameGroundContactPointMap();
<BUG>}
@Override public List<ImmutablePair<String, YoPDGains>> getPassiveJointNameWithGains(YoVariableRegistry registry)
{</BUG>
return null;
}
| jointNamesBeforeFeet[0] = getJointBeforeFootName(RobotSide.LEFT);
jointNamesBeforeFeet[1] = getJointBeforeFootName(RobotSide.RIGHT);
|
10,528 | {
return atlasPhysicalProperties;
}
public String[] getHighInertiaForStableSimulationJoints()
{
<BUG>return new String[] { "hokuyo_joint" };
}</BUG>
}
| return RobotSide.values;
@Override
public Enum<?> getEndEffectorsRobotSegment(String joineNameBeforeEndEffector)
|
10,529 | package net.spy.memcached.protocol.ascii;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
<BUG>import java.util.Collection;
import net.spy.memcached.collection.BTreeGetBulk;</BUG>
import net.spy.memcached.collection.CollectionResponse;
import net.spy.memcached.ops.APIType;
import net.spy.memcached.ops.BTreeGetBulkOperation;
| import net.spy.memcached.KeyUtil;
import net.spy.memcached.collection.BTreeGetBulk;
|
10,530 | package net.spy.memcached.protocol.ascii;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
<BUG>import java.util.Collection;
import net.spy.memcached.collection.BTreeSMGet;</BUG>
import net.spy.memcached.collection.CollectionResponse;
import net.spy.memcached.ops.APIType;
import net.spy.memcached.ops.BTreeSortMergeGetOperationOld;
| import net.spy.memcached.KeyUtil;
import net.spy.memcached.collection.BTreeSMGet;
|
10,531 | package net.spy.memcached.protocol.ascii;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.util.Collection;
<BUG>import java.util.Collections;
import net.spy.memcached.collection.ExtendedBTreeGet;</BUG>
import net.spy.memcached.collection.CollectionGet;
import net.spy.memcached.collection.CollectionResponse;
import net.spy.memcached.ops.APIType;
| import net.spy.memcached.KeyUtil;
import net.spy.memcached.collection.ExtendedBTreeGet;
|
10,532 | package net.spy.memcached.protocol.ascii;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.util.Collection;
<BUG>import java.util.Collections;
import net.spy.memcached.collection.BTreeGet;</BUG>
import net.spy.memcached.collection.CollectionGet;
import net.spy.memcached.collection.CollectionResponse;
import net.spy.memcached.collection.ListGet;
| import net.spy.memcached.KeyUtil;
import net.spy.memcached.collection.BTreeGet;
|
10,533 | package net.spy.memcached.protocol.ascii;
import java.nio.ByteBuffer;
import java.util.Collection;
<BUG>import java.util.Collections;
import net.spy.memcached.collection.BTreeCount;</BUG>
import net.spy.memcached.collection.CollectionCount;
import net.spy.memcached.collection.CollectionResponse;
import net.spy.memcached.ops.APIType;
| import net.spy.memcached.KeyUtil;
import net.spy.memcached.collection.BTreeCount;
|
10,534 | package net.spy.memcached.protocol.ascii;
import java.nio.ByteBuffer;
import java.util.Collection;
<BUG>import java.util.Collections;
import net.spy.memcached.collection.CollectionResponse;</BUG>
import net.spy.memcached.ops.APIType;
import net.spy.memcached.ops.CollectionOperationStatus;
import net.spy.memcached.ops.GetAttrOperation;
| import net.spy.memcached.KeyUtil;
import net.spy.memcached.collection.CollectionResponse;
|
10,535 | transitionState(OperationState.COMPLETE);
}
}
@Override
public void initialize() {
<BUG>int size = CMD.length() + key.length() + 16;
</BUG>
ByteBuffer bb = ByteBuffer.allocate(size);
setArguments(bb, CMD, key);
bb.flip();
| } else {
getLogger().debug(status);
getCallback().receivedStatus(status);
int size = CMD.length() + KeyUtil.getKeyBytes(key).length + 16;
|
10,536 | package net.spy.memcached.protocol.ascii;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
<BUG>import java.util.Collection;
import net.spy.memcached.collection.BTreeSMGet;</BUG>
import net.spy.memcached.collection.BTreeSMGetWithByteTypeBkey;
import net.spy.memcached.collection.BTreeSMGetWithLongTypeBkey;
import net.spy.memcached.collection.CollectionResponse;
| import net.spy.memcached.KeyUtil;
import net.spy.memcached.collection.BTreeSMGet;
|
10,537 | package net.spy.memcached.protocol.ascii;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.util.Collection;
<BUG>import java.util.Collections;
import net.spy.memcached.collection.BTreeGetByPosition;</BUG>
import net.spy.memcached.collection.CollectionResponse;
import net.spy.memcached.ops.APIType;
import net.spy.memcached.ops.BTreeGetByPositionOperation;
| import net.spy.memcached.KeyUtil;
import net.spy.memcached.collection.BTreeGetByPosition;
|
10,538 | package net.spy.memcached.protocol.ascii;
import java.nio.ByteBuffer;
import java.util.Collection;
<BUG>import java.util.Collections;
import net.spy.memcached.collection.BTreeDelete;</BUG>
import net.spy.memcached.collection.CollectionDelete;
import net.spy.memcached.collection.CollectionResponse;
import net.spy.memcached.collection.ListDelete;
| import net.spy.memcached.KeyUtil;
import net.spy.memcached.collection.BTreeDelete;
|
10,539 | package net.spy.memcached.protocol.ascii;
import java.nio.ByteBuffer;
import java.util.Collection;
<BUG>import java.util.Collections;
import net.spy.memcached.collection.BTreeFindPosition;</BUG>
import net.spy.memcached.collection.CollectionResponse;
import net.spy.memcached.ops.APIType;
import net.spy.memcached.ops.BTreeFindPositionOperation;
| import net.spy.memcached.KeyUtil;
import net.spy.memcached.collection.BTreeFindPosition;
|
10,540 | import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
<BUG>import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;</BUG>
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.ContextMenu;
| import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
|
10,541 | import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
<BUG>import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;</BUG>
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.ContextMenu;
| import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
|
10,542 | import android.os.Handler;
import android.os.Looper;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.preference.PreferenceManager;
<BUG>import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.Toolbar;</BUG>
import android.util.Log;
import android.view.ContextMenu;
import android.view.KeyEvent;
| import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.Toolbar;
|
10,543 | mAltitude.setOnCheckedChangeListener(mCheckedChangeListener);
mDistance.setOnCheckedChangeListener(mCheckedChangeListener);
mCompass.setOnCheckedChangeListener(mCheckedChangeListener);
mLocation.setOnCheckedChangeListener(mCheckedChangeListener);
builder.setTitle(R.string.dialog_layer_title).setIcon(android.R.drawable.ic_dialog_map).setPositiveButton
<BUG>(R.string.btn_okay, null).setView(view);
</BUG>
dialog = builder.create();
return dialog;
case DIALOG_NOTRACK:
| (android.R.string.ok, null).setView(view);
|
10,544 | import java.net.NetworkInterface;</BUG>
public class App {
public static void main(String[] args) throws Exception {
Integer serverPort = Integer.parseInt(System.getProperty("port", "8080"));
<BUG>String host = System.getProperty("host", "localhost");
InetAddress address = InetAddress.getByName(host);</BUG>
String scribeHost = System.getProperty("scribeHost");
RatpackServer.start(server -> server
.serverConfig(config -> config.port(serverPort))
.registry(Guice.registry(binding -> binding
| import com.github.kristofa.brave.scribe.ScribeSpanCollector;
import com.google.common.collect.Lists;
import ratpack.guice.Guice;
import ratpack.server.RatpackServer;
import ratpack.zipkin.ServerTracingModule;
|
10,545 | String scribeHost = System.getProperty("scribeHost");
RatpackServer.start(server -> server
.serverConfig(config -> config.port(serverPort))
.registry(Guice.registry(binding -> binding
.module(ServerTracingModule.class, config -> config
<BUG>.port(serverPort)
.address(address)</BUG>
.serviceName("ratpack-demo")
.sampler(Sampler.create(1f))
.spanCollector(scribeHost != null ? new ScribeSpanCollector(scribeHost, 9410) : new LoggingSpanCollector())
| [DELETED] |
10,546 | import ratpack.zipkin.internal.DefaultServerTracingHandler;
import ratpack.zipkin.internal.RatpackServerClientLocalSpanState;
import ratpack.zipkin.internal.ServerRequestAdapterFactory;
import ratpack.zipkin.internal.ServerResponseAdapterFactory;
import java.net.InetAddress;
<BUG>import java.net.UnknownHostException;
import static com.google.inject.Scopes.SINGLETON;</BUG>
public class ServerTracingModule extends ConfigurableModule<ServerTracingModule.Config> {
@Override
protected void configure() {
| import java.nio.ByteBuffer;
import static com.google.inject.Scopes.SINGLETON;
|
10,547 | private SpanCollector spanCollector;
private Sampler sampler;
private SpanNameProvider spanNameProvider = new DefaultSpanNameProvider();
private RequestAnnotationExtractor requestAnnotationFunc = RequestAnnotationExtractor.DEFAULT;
private ResponseAnnotationExtractor responseAnnotationFunc = ResponseAnnotationExtractor.DEFAULT;
<BUG>private int port;
private InetAddress address = InetAddress.getLoopbackAddress();
public Config() {
}</BUG>
public Config serviceName(final String serviceName) {
| [DELETED] |
10,548 | import com.cloudant.client.api.model.Attachment;
import com.cloudant.client.api.model.Document;
import com.cloudant.client.api.model.Params;
import com.cloudant.client.api.model.Response;
import com.cloudant.client.internal.DatabaseURIHelper;
<BUG>import com.cloudant.http.Http;
import com.cloudant.http.HttpConnection;</BUG>
import com.cloudant.test.main.RequiresDB;
import com.cloudant.tests.util.CloudantClientResource;
import com.cloudant.tests.util.DatabaseResource;
| [DELETED] |
10,549 | Bar bar2 = db.find(Bar.class, response.getId(), new Params().attachments());
String base64Data = bar2.getAttachments().get("txt_1.txt").getData();
assertNotNull(base64Data);
}
@Test
<BUG>public void attachmentStandalone() throws IOException, URISyntaxException {
</BUG>
byte[] bytesToDB = "binary data".getBytes();
ByteArrayInputStream bytesIn = new ByteArrayInputStream(bytesToDB);
Response response = db.saveAttachment(bytesIn, "foo.txt", "text/plain");
| public void getAttachmentStandaloneWithoutRev() throws IOException, URISyntaxException {
|
10,550 | byte[] bytesToDB = "binary data".getBytes();
ByteArrayInputStream bytesIn = new ByteArrayInputStream(bytesToDB);
Response response = db.saveAttachment(bytesIn, "foo.txt", "text/plain");
Document doc = db.find(Document.class, response.getId());
assertTrue(doc.getAttachments().containsKey("foo.txt"));
<BUG>HttpConnection conn = Http.GET(new DatabaseURIHelper(db.getDBUri())
.attachmentUri(response.getId(), "foo.txt"));
InputStream in = clientResource.get().executeRequest(conn).responseAsInputStream();
try {</BUG>
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
| InputStream in = db.getAttachment(response.getId(), "foo.txt");
try {
|
10,551 | bytesToDB = "updated binary data".getBytes("UTF-8");
bytesIn = new ByteArrayInputStream(bytesToDB);
response = db.saveAttachment(bytesIn, "foo.txt", "text/plain", response.getId(), response
.getRev());
Document doc = db.find(Document.class, response.getId(), response.getRev());
<BUG>assertTrue(doc.getAttachments().containsKey("foo.txt"));
HttpConnection conn = Http.GET(new DatabaseURIHelper(db.getDBUri())
.attachmentUri(response.getId(), "foo.txt"));
InputStream in = clientResource.get().executeRequest(conn).responseAsInputStream();</BUG>
try {
| InputStream in = db.getAttachment(response.getId(), "foo.txt");
|
10,552 | (), response.getRev());
assertEquals("The document ID should be the same", response.getId(), attResponse.getId());
assertTrue("The response code should be a 20x", attResponse.getStatusCode() / 100 == 2);
assertNull("There should be no error saving the attachment", attResponse.getError());
Document doc = db.find(Document.class, response.getId(), attResponse.getRev());
<BUG>assertTrue(doc.getAttachments().containsKey("foo.txt"));
HttpConnection conn = Http.GET(new DatabaseURIHelper(db.getDBUri())
.attachmentUri(response.getId(), attResponse.getRev(), "foo.txt"));
InputStream in = clientResource.get().executeRequest(conn).responseAsInputStream();</BUG>
try {
| InputStream in = db.getAttachment(response.getId(), "foo.txt");
|
10,553 | public void attachmentStandaloneNullIdNullRev() throws IOException, URISyntaxException {
byte[] bytesToDB = "binary data".getBytes();
ByteArrayInputStream bytesIn = new ByteArrayInputStream(bytesToDB);
Response response = db.saveAttachment(bytesIn, "foo.txt", "text/plain", null, null);
Document doc = db.find(Document.class, response.getId());
<BUG>assertTrue(doc.getAttachments().containsKey("foo.txt"));
HttpConnection conn = Http.GET(new DatabaseURIHelper(db.getDBUri())
.attachmentUri(response.getId(), "foo.txt"));
InputStream in = clientResource.get().executeRequest(conn).responseAsInputStream();</BUG>
try {
| InputStream in = db.getAttachment(response.getId(), "foo.txt");
|
10,554 | public void attachmentStandaloneGivenId() throws IOException, URISyntaxException {
String docId = Utils.generateUUID();
byte[] bytesToDB = "binary data".getBytes();
ByteArrayInputStream bytesIn = new ByteArrayInputStream(bytesToDB);
Response response = db.saveAttachment(bytesIn, "foo.txt", "text/plain", docId, null);
<BUG>assertEquals("The saved document ID should match", docId, response.getId());
Document doc = db.find(Document.class, response.getId());
assertTrue(doc.getAttachments().containsKey("foo.txt"));
HttpConnection conn = Http.GET(new DatabaseURIHelper(db.getDBUri())
.attachmentUri(response.getId(), "foo.txt"));
InputStream in = clientResource.get().executeRequest(conn).responseAsInputStream();</BUG>
try {
| InputStream in = db.getAttachment(docId, "foo.txt");
|
10,555 | <BUG>package org.apache.hadoop.metrics2.sink.timeline.cache;
import org.apache.commons.logging.Log;</BUG>
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
| import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import org.apache.commons.logging.Log;
|
10,556 | import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics;
<BUG>import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;</BUG>
import java.util.List;
import java.util.Map;
| import java.util.Collection;
|
10,557 | import org.junit.Test;
import java.util.Map;
import java.util.TreeMap;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
<BUG>import static org.junit.Assert.assertNotNull;
public class TimelineMetricsCacheTest {</BUG>
private static final long DEFAULT_START_TIME = 1411023766;
private static final String METRIC_NAME = "Test name";
private static final double delta = 0.00001;
| import static org.junit.Assert.assertTrue;
public class TimelineMetricsCacheTest {
|
10,558 | assertEquals(20, cachedMetric.getMetricValues().get(6L), delta);
assertEquals(110, cachedMetric.getMetricValues().get(7L), delta);
assertEquals(70, cachedMetric.getMetricValues().get(8L), delta);
}
@Test
<BUG>public void testMaxRecsPerName() throws Exception {
int maxRecsPerName = 2;
</BUG>
int maxEvictionTime = TimelineMetricsCache.MAX_EVICTION_TIME_MILLIS ;
| public void testMaxRecsPerNameForTimelineMetricWrapperCache() throws Exception {
int maxRecsPerName = 3;
|
10,559 | TimelineMetric timelineMetric2 = metricsIterator.next().getMetrics().get(0);
Assert.assertEquals(2, timelineMetric2.getMetricValues().size());
timestamps = timelineMetric2.getMetricValues().keySet().iterator();
Assert.assertEquals(new Long(now + 200l), timestamps.next());
Assert.assertEquals(new Long(now + 300l), timestamps.next());
<BUG>values = timelineMetric2.getMetricValues().values().iterator();
Assert.assertEquals(new Double(5.0), values.next());
Assert.assertEquals(new Double(6.0), values.next());</BUG>
}
@Test
| Assert.assertEquals(new Double(4.0), values.next());
|
10,560 | chartData.setAllSeries(doc.getSampleNames());
String[] names = doc.getSampleNames().toArray(new String[doc.getSampleNames().size()]);
syncedNodes = mainViewer.getSelectedNodes();
LinkedList<String> taxonNames = new LinkedList<>();
for (Node v : syncedNodes) {
<BUG>String taxonName = TaxonomyData.getName2IdMap().get((Integer) v.getInfo());
</BUG>
taxonNames.add(taxonName);
if (numberOfSamples == 1) {
if (v.getOutDegree() == 0)
| final String taxonName = TaxonomyData.getName2IdMap().get((Integer) v.getInfo());
|
10,561 | viewer.getChartSelection().setSelectedClass(name, true);
}
}
for (String name : list) {
if (name.equalsIgnoreCase("all")) {
<BUG>viewer.getChartSelection().setSelectedAttribute(viewer.getNumericalAttributes(), true);
</BUG>
} else if (name.equalsIgnoreCase("none")) {
viewer.getChartSelection().clearSelectionAttributes();
} else if (name.equals("previous"))
| viewer.getChartSelection().setSelectedAttribute(viewer.getAttributesList().getEnabledLabels(), true);
|
10,562 | } catch (Exception ex) {
Basic.caught(ex);
}
UPGMA.apply(taxa, distances, treeView);
flipCoordinates(treeView, rootSide);
<BUG>labelOrder.addAll(getLabelOrder(treeView));
}</BUG>
private static ArrayList<String> getLabelOrder(PhyloTreeView treeView) {
final ArrayList<String> order = new ArrayList<>();
final PhyloTree tree = treeView.getPhyloTree();
| [DELETED] |
10,563 | select(rect, sgc.getSelectionRectangle(), sgc.getMouseClicks());
} else
doPaint(gc, rect);
}
private void doPaint(Graphics2D gc, Rectangle rect) {
<BUG>if (!(gc instanceof SelectionGraphics) && type != TYPE.ATTRIBUTES)
selectEdgesAbove();</BUG>
if (previousRectangle == null || !rect.equals(previousRectangle)) {
previousRectangle = rect;
fitToRectangle(treeView, rect);
| if (!(gc instanceof SelectionGraphics))
selectEdgesAbove();
|
10,564 | final Stack<Node> stack = new Stack<>();
for (Edge e : hitEdges) {
stack.add(e.getTarget());
}
while (stack.size() > 0) {
<BUG>Node v = stack.pop();
</BUG>
if (v.getOutDegree() == 0) {
if (type == TYPE.SERIES)
chartSelection.setSelectedSeries(treeView.getLabel(v), true);
| final Node v = stack.pop();
|
10,565 | break;
case BOTTOM:
treeView.setLocation(v, loc.getY(), -loc.getX());
break;
case RIGHT:
<BUG>treeView.setLocation(v, -loc.getX(), -loc.getY());
break;</BUG>
default:
case LEFT:
break;
| treeView.setLocation(v, -loc.getX(), loc.getY());
|
10,566 | ConfigStore configStore) {
this.offerRequirementProvider = offerRequirementProvider;
this.configStore = configStore;
}
@Override
<BUG>public List<RecoveryRequirement> getTransientRecoveryOfferRequirements(List<TaskInfo> stoppedTasks) {
List<RecoveryRequirement> transientRecoveryRequirements = new ArrayList<>();</BUG>
for (TaskInfo taskInfo : stoppedTasks) {
try {
transientRecoveryRequirements.add(
| public List<RecoveryRequirement> getTransientRecoveryRequirements(List<TaskInfo> stoppedTasks) {
List<RecoveryRequirement> transientRecoveryRequirements = new ArrayList<>();
|
10,567 | @Override
public boolean canLaunch(RecoveryRequirement recoveryRequirement) {
Set<String> names = recoveryRequirement.getOfferRequirement().getTaskRequirements().stream()
.map(it -> it.getTaskInfo().getName())
.collect(Collectors.toSet());
<BUG>if (names.contains(OfferUtils.idToName(2))) {
</BUG>
return false;
}
return true;
| public void launchHappened(Protos.Offer.Operation launchOperation, RecoveryRequirement.RecoveryType recoveryType) {
if (names.contains(OfferUtils.brokerIdToTaskName(2))) {
|
10,568 | import org.apache.mesos.offer.TaskUtils;
import org.apache.mesos.scheduler.recovery.TaskFailureListener;
import org.apache.mesos.state.StateStore;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
<BUG>import java.util.Arrays;
public class KafkaTaskFailureListener implements TaskFailureListener {</BUG>
private final Log log = LogFactory.getLog(getClass());
private final StateStore stateStore;
public KafkaTaskFailureListener(StateStore stateStore) {
| import java.util.Optional;
public class KafkaTaskFailureListener implements TaskFailureListener {
|
10,569 | return label.getValue();
}
}
return null;
}
<BUG>public static String idToName(Integer brokerId) {
</BUG>
return "broker-" + Integer.toString(brokerId);
}
public static int nameToId(String brokerName) {
| public static String brokerIdToTaskName(Integer brokerId) {
|
10,570 | package com.mesosphere.dcos.kafka.plan;
<BUG>import com.mesosphere.dcos.kafka.offer.KafkaOfferRequirementProvider;
import com.mesosphere.dcos.kafka.scheduler.KafkaScheduler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.mesos.Protos.TaskID;</BUG>
import org.apache.mesos.Protos.TaskInfo;
| import com.mesosphere.dcos.kafka.offer.OfferUtils;
import com.mesosphere.dcos.kafka.state.FrameworkState;
import org.apache.mesos.Protos;
import org.apache.mesos.Protos.TaskID;
|
10,571 | import org.apache.commons.logging.LogFactory;
import org.apache.mesos.Protos.TaskID;</BUG>
import org.apache.mesos.Protos.TaskInfo;
import org.apache.mesos.Protos.TaskState;
import org.apache.mesos.Protos.TaskStatus;
<BUG>import com.mesosphere.dcos.kafka.offer.OfferUtils;
import com.mesosphere.dcos.kafka.state.FrameworkState;</BUG>
import org.apache.mesos.offer.OfferRequirement;
import org.apache.mesos.offer.TaskRequirement;
import org.apache.mesos.offer.TaskUtils;
| import org.apache.mesos.Protos;
import org.apache.mesos.Protos.TaskID;
|
10,572 | import org.apache.mesos.offer.OfferRequirement;
import org.apache.mesos.offer.TaskRequirement;
import org.apache.mesos.offer.TaskUtils;
import org.apache.mesos.scheduler.plan.Block;
import org.apache.mesos.scheduler.plan.Status;
<BUG>import java.util.ArrayList;
import java.util.List;
import java.util.UUID;</BUG>
public class KafkaUpdateBlock implements Block {
| import java.util.*;
|
10,573 | public String getMessage() {
return "Broker-" + getBrokerId() + " is " + Block.getStatus(this);
}
@Override
public String getName() {
<BUG>return OfferUtils.idToName(getBrokerId());
</BUG>
}
public int getBrokerId() {
return brokerId;
| return OfferUtils.brokerIdToTaskName(getBrokerId());
|
10,574 | if (taskInfo != null) {
taskIds.add(taskInfo.getTaskId());
}
return taskIds;
}
<BUG>private static boolean taskIsRunningOrStaging(TaskStatus taskStatus) {
if (null == taskStatus) {
return false;
}
switch (taskStatus.getState()) {
</BUG>
case TASK_RUNNING:
| private static boolean taskIsRunningOrStaging(Optional<TaskStatus> taskStatus) {
if (taskStatus.isPresent()) {
switch (taskStatus.get().getState()) {
|
10,575 | import org.apache.mesos.config.ConfigStoreException;
import org.apache.mesos.offer.InvalidRequirementException;
import org.apache.mesos.offer.OfferRequirement;
import org.apache.mesos.offer.PlacementStrategy;
import org.apache.mesos.offer.ResourceUtils;
<BUG>import org.apache.mesos.protobuf.CommandInfoBuilder;
import org.apache.mesos.protobuf.EnvironmentBuilder;
import org.apache.mesos.protobuf.LabelBuilder;
import org.apache.mesos.protobuf.ValueBuilder;</BUG>
import java.io.IOException;
| [DELETED] |
10,576 | import org.apache.mesos.protobuf.LabelBuilder;
import org.apache.mesos.protobuf.ValueBuilder;</BUG>
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.*;
<BUG>import java.util.concurrent.ThreadLocalRandom;
public class PersistentOfferRequirementProvider implements KafkaOfferRequirementProvider {</BUG>
private final Log log = LogFactory.getLog(PersistentOfferRequirementProvider.class);
public static final String CONFIG_ID_KEY = "CONFIG_ID";
public static final String CONFIG_TARGET_KEY = "config_target";
| import org.apache.mesos.config.ConfigStoreException;
import org.apache.mesos.offer.InvalidRequirementException;
import org.apache.mesos.offer.OfferRequirement;
import org.apache.mesos.offer.PlacementStrategy;
import org.apache.mesos.offer.ResourceUtils;
import java.util.stream.Collectors;
public class PersistentOfferRequirementProvider implements KafkaOfferRequirementProvider {
|
10,577 | replacementExecutor.setExecutorId(ExecutorID.newBuilder().setValue("").build()); // Set later by ExecutorRequirement
TaskInfo replaceTaskInfo = replacementTaskInfo.build();
ExecutorInfo replaceExecutorInfo = replacementExecutor.build();
OfferRequirement offerRequirement = new OfferRequirement(
Arrays.asList(replaceTaskInfo),
<BUG>replaceExecutorInfo,
</BUG>
null,
null);
log.info(String.format("Got replacement OfferRequirement: TaskInfo: '%s' ExecutorInfo: '%s'",
| Optional.of(replaceExecutorInfo),
|
10,578 | } else {
environmentMap.put(portVar, Long.toString(port));
environmentMap.put(dynamicVar, Boolean.toString(false));
}
taskBuilder = updatePort(taskBuilder, brokerConfig);
<BUG>cmdBuilder.clearEnvironment();
final List<Variable> newEnvironmentVariables = EnvironmentBuilder.createEnvironment(environmentMap);
cmdBuilder.setEnvironment(Environment.newBuilder().addAllVariables(newEnvironmentVariables));</BUG>
taskBuilder.setData(cmdBuilder.build().toByteString());
TaskInfo updatedTaskInfo = taskBuilder.build();
| port = Long.parseLong(environmentMap.get(portVar));
environmentMap.put(dynamicVar, Boolean.toString(true));
brokerConfig.setPort(port);
cmdBuilder.setEnvironment(environment(environmentMap));
|
10,579 | TaskInfo updatedTaskInfo = taskBuilder.build();
try {
ExecutorInfo updateExecutorInfo = updatedExecutor.build();
OfferRequirement offerRequirement = new OfferRequirement(
Arrays.asList(updatedTaskInfo),
<BUG>updateExecutorInfo, null, null);
log.info(String.format("Got updated OfferRequirement: TaskInfo: '%s' ExecutorInfo: '%s'",</BUG>
TextFormat.shortDebugString(updatedTaskInfo),
TextFormat.shortDebugString(updateExecutorInfo)));
return offerRequirement;
| Optional.of(updateExecutorInfo),
null,
log.info(String.format("Got updated OfferRequirement: TaskInfo: '%s' ExecutorInfo: '%s'",
|
10,580 | final CommandInfo oldCommand = CommandInfo.parseFrom(taskBuilder.getData());
final Environment oldEnvironment = oldCommand.getEnvironment();
final Map<String, String> newEnvMap = fromEnvironmentToMap(oldEnvironment);
newEnvMap.put("KAFKA_HEAP_OPTS", getKafkaHeapOpts(brokerConfig.getHeap()));
final CommandInfo.Builder newCommandBuilder = CommandInfo.newBuilder(oldCommand);
<BUG>newCommandBuilder.clearEnvironment();
final List<Variable> newEnvironmentVariables = EnvironmentBuilder.createEnvironment(newEnvMap);
newCommandBuilder.setEnvironment(Environment.newBuilder().addAllVariables(newEnvironmentVariables));</BUG>
taskBuilder.clearData();
taskBuilder.setData(newCommandBuilder.build().toByteString());
| newCommandBuilder.setEnvironment(environment(newEnvMap));
|
10,581 | </BUG>
}
}
CommandInfo.Builder cmdBuilder = CommandInfo.newBuilder(existingCommandInfo);
<BUG>cmdBuilder.setEnvironment(envBuilder.build());
</BUG>
taskBuilder.clearData();
taskBuilder.setData(cmdBuilder.build().toByteString());
return taskBuilder;
} catch (InvalidProtocolBufferException e) {
| final CommandInfo existingCommandInfo = CommandInfo.parseFrom(taskBuilder.getData());
for (Variable variable : existingCommandInfo.getEnvironment().getVariablesList()) {
if (variable.getName().equals(CONFIG_ID_KEY)) {
envMap.put(CONFIG_ID_KEY, configName);
} else {
envMap.put(variable.getName(), variable.getValue());
cmdBuilder.setEnvironment(environment(envMap));
|
10,582 | return 9092 + ThreadLocalRandom.current().nextLong(0, 1000);
}
private OfferRequirement getNewOfferRequirementInternal(String configName, int brokerId)
throws InvalidRequirementException, IOException, URISyntaxException {
log.info("Getting new OfferRequirement for: " + configName);
<BUG>String brokerName = OfferUtils.idToName(brokerId);
</BUG>
String containerPath = "kafka-volume-" + UUID.randomUUID();
KafkaSchedulerConfiguration config = configState.fetch(UUID.fromString(configName));
log.warn("KafkaSchedulerConfiguration: " + config);
| String brokerName = OfferUtils.brokerIdToTaskName(brokerId);
|
10,583 | TaskInfo.Builder taskBuilder = TaskInfo.newBuilder();
taskBuilder
.setName(brokerName)
.setTaskId(TaskID.newBuilder().setValue("").build()) // Set later by TaskRequirement
.setSlaveId(SlaveID.newBuilder().setValue("").build()) // Set later
<BUG>.setData(brokerTaskBuilder.build().toByteString())
.addResources(ResourceUtils.getDesiredScalar(role, principal, "cpus", brokerConfig.getCpus()))</BUG>
.addResources(ResourceUtils.getDesiredScalar(role, principal, "mem", brokerConfig.getMem()))
.addResources(ResourceUtils.getDesiredRanges(
role,
| .setData(brokerTask.toByteString())
.addResources(ResourceUtils.getDesiredScalar(role, principal, "cpus", brokerConfig.getCpus()))
|
10,584 | taskBuilder.addResources(ResourceUtils.getDesiredRootVolume(
role,
principal,
brokerConfig.getDisk(),
containerPath));
<BUG>}
taskBuilder
.setLabels(Labels.newBuilder()
.addLabels(Label.newBuilder()
.setKey(CONFIG_TARGET_KEY)
.setValue(configName))
.build());</BUG>
if (clusterState.getCapabilities().supportsNamedVips()) {
| taskBuilder.setLabels(labels(CONFIG_TARGET_KEY, configName));
|
10,585 | .setVisibility(DiscoveryInfo.Visibility.EXTERNAL)
.setName(brokerName)
.setPorts(Ports.newBuilder()
.addPorts(Port.newBuilder()
.setNumber((int) (long)port)
<BUG>.setProtocol("tcp")
.setLabels(Labels.newBuilder()
.addLabels(Label.newBuilder()
.setKey("VIP_" + UUID.randomUUID())
.setValue("broker:9092")
.build())
.build()))</BUG>
.build())
| .setLabels(labels("VIP_" + UUID.randomUUID(), "broker:9092")))
|
10,586 | import org.apache.spark.api.java.JavaPairRDD;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;
import org.apache.spark.api.java.function.Function2;
<BUG>import org.apache.spark.api.java.function.PairFlatMapFunction;
import scala.Tuple2;</BUG>
import Functions.PartitionAssignGridPoint;
import Functions.PartitionAssignGridPolygon;
import Functions.PartitionAssignGridRectangle;
| import org.apache.spark.api.java.function.PairFunction;
import scala.Tuple2;
|
10,587 | {
<BUG>QueryArea=QueryArea+"|"+currentPoint.getX()+","+currentPoint.getY()+"|";
}
}
}
QueryAreaAndPoint.add(new Tuple2<Envelope, String>(currentQueryArea,QueryArea));
}
return QueryAreaAndPoint;
</BUG>
}
| Envelope currentQueryArea=QueryAreaIterator.next();
Iterator<Point> TargetIterator=t._2()._2().iterator();
while(TargetIterator.hasNext())
Point currentTarget=TargetIterator.next();
if(condition==0){
if(currentQueryArea.contains(currentTarget.getCoordinate()))
QueryAreaAndTarget.add(new Tuple2<Envelope,Point>(currentQueryArea,currentTarget));
|
10,588 | {
<BUG>QueryArea=QueryArea+"|"+currentPoint.getX()+","+currentPoint.getY()+"|";
}
}
}
QueryAreaAndPoint.add(new Tuple2<Polygon, String>(currentQueryArea,QueryArea));
}
return QueryAreaAndPoint;
</BUG>
}
| Polygon currentQueryArea=QueryAreaIterator.next();
Iterator<Point> TargetIterator=t._2()._2().iterator();
while(TargetIterator.hasNext())
Point currentTarget=TargetIterator.next();
if(condition==0){
if(currentQueryArea.contains(currentTarget))
QueryAreaAndTarget.add(new Tuple2<Polygon,Point>(currentQueryArea,currentTarget));
|
10,589 | import jetbrains.mps.smodel.DynamicReference;
import jetbrains.mps.baseLanguage.tuples.runtime.MultiTuple;
import org.jetbrains.mps.openapi.model.SModelReference;
import jetbrains.mps.smodel.SModelStereotype;
<BUG>import org.apache.log4j.Level;
import java.util.HashSet;
import jetbrains.mps.util.JavaNameUtil;
import jetbrains.mps.util.InternUtil;</BUG>
import org.apache.log4j.Logger;
import org.apache.log4j.LogManager;
| import jetbrains.mps.textGen.TextGen;
import jetbrains.mps.util.InternUtil;
|
10,590 | BaseLanguageTextGen.registerExtendsRelation(Sequence.fromIterable(Sequence.<SNode>singleton(SLinkOperations.getTarget(SNodeOperations.cast(cls, MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, 0x10f6353296dL, "superclass")))).toListSequence(), topClassifier, textGen);
}
}
public static void methodCall(SNode methodCall, final SNodeTextGen textGen) {
BaseLanguageTextGen.methodTypeArguments(methodCall, textGen);
<BUG>textGen.append(textGen.getReferentPresentation(SNodeOperations.getReference(methodCall, MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301adL, "baseMethodDeclaration")), false));
</BUG>
BaseLanguageTextGen.arguments(methodCall, textGen);
}
public static void methodTypeArguments(SNode methodCall, final SNodeTextGen textGen) {
| BaseLanguageTextGen.referenceToShortName(SNodeOperations.getReference(methodCall, MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301adL, "baseMethodDeclaration")), textGen);
|
10,591 | System.out.println(change);
}
}
};
@Override
<BUG>protected Callback<VChild, Void> copyChildCallback()
</BUG>
{
return (child) ->
{
| protected Callback<VChild, Void> copyIntoCallback()
|
10,592 | 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;
|
10,593 | 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,
|
10,594 | 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,
|
10,595 | 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,
|
10,596 | 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)
|
10,597 | 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()
|
10,598 | 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)
|
10,599 | 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)
|
10,600 | }
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)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.