id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
16,101 | subplot.setRangePannable(pannable);
}
}
@Override
public void setOrientation(PlotOrientation orientation) {
<BUG>super.setOrientation(orientation);
Iterator iterator = this.subplots.iterator();
while (iterator.hasNext()) {
XYPlot plot = (XYPlot) iterator.next();
plot.setOrientation(orientation);
}</BUG>
}
| [DELETED] |
16,102 | public void zoomRangeAxes(double factor, PlotRenderingInfo state,
Point2D source, boolean useAnchor) {
XYPlot subplot = findSubplot(state, source);
if (subplot != null) {
subplot.zoomRangeAxes(factor, state, source, useAnchor);
<BUG>}
else {
Iterator iterator = getSubplots().iterator();
while (iterator.hasNext()) {
subplot = (XYPlot) iterator.next();
subplot.zoomRangeAxes(factor, state, source, useAnchor);
}</BUG>
}
| } else {
for (XYPlot p : this.subplots) {
p.zoomRangeAxes(factor, state, source, useAnchor);
|
16,103 | public void zoomRangeAxes(double lowerPercent, double upperPercent,
PlotRenderingInfo info, Point2D source) {
XYPlot subplot = findSubplot(info, source);
if (subplot != null) {
subplot.zoomRangeAxes(lowerPercent, upperPercent, info, source);
<BUG>}
else {
Iterator iterator = getSubplots().iterator();
while (iterator.hasNext()) {
subplot = (XYPlot) iterator.next();
subplot.zoomRangeAxes(lowerPercent, upperPercent, info, source);
}</BUG>
}
| } else {
for (XYPlot p : this.subplots) {
p.zoomRangeAxes(lowerPercent, upperPercent, info, source);
|
16,104 | }
return result;
}
@Override
public void setRenderer(XYItemRenderer renderer) {
<BUG>super.setRenderer(renderer); // not strictly necessary, since the
Iterator iterator = this.subplots.iterator();
while (iterator.hasNext()) {
XYPlot plot = (XYPlot) iterator.next();
plot.setRenderer(renderer);
}</BUG>
}
| [DELETED] |
16,105 | public void setFixedRangeAxisSpace(AxisSpace space) {
super.setFixedRangeAxisSpace(space);
setFixedRangeAxisSpaceForSubplots(space);
fireChangeEvent();
}
<BUG>protected void setFixedRangeAxisSpaceForSubplots(AxisSpace space) {
Iterator iterator = this.subplots.iterator();
while (iterator.hasNext()) {
XYPlot plot = (XYPlot) iterator.next();
plot.setFixedRangeAxisSpace(space, false);
}</BUG>
}
| for (XYPlot p : this.subplots) {
p.setFixedRangeAxisSpace(space, false);
|
16,106 | package com.liferay.weather.util;
import com.liferay.portal.kernel.util.GetterUtil;
<BUG>import com.liferay.portal.kernel.util.HttpUtil;
import com.liferay.portal.kernel.util.Time;</BUG>
import com.liferay.portal.kernel.webcache.WebCacheException;
import com.liferay.portal.kernel.webcache.WebCacheItem;
import com.liferay.portal.kernel.xml.Document;
| import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.Time;
|
16,107 | package org.gradle.language.base.plugins;
<BUG>import org.gradle.api.*;
import org.gradle.api.internal.project.ProjectInternal;</BUG>
import org.gradle.api.tasks.Delete;
import org.gradle.language.base.internal.plugins.CleanRule;
import org.gradle.language.base.internal.tasks.AssembleBinariesTask;
| import org.gradle.api.internal.TaskInternal;
import org.gradle.api.internal.project.ProjectInternal;
|
16,108 | Task assembleTask = project.getTasks().create(ASSEMBLE_TASK_NAME, AssembleBinariesTask.class);
assembleTask.setDescription("Assembles the outputs of this project.");
assembleTask.setGroup(BUILD_GROUP);
}
private void addCheck(final ProjectInternal project) {
<BUG>project.getTasks().addPlaceholderAction(CHECK_TASK_NAME, new Runnable() {
@Override
public void run() {
DeprecationLogger.whileDisabled(new Runnable() {
@Override
public void run() {
Task checkTask = project.getTasks().maybeCreate(CHECK_TASK_NAME);</BUG>
checkTask.setDescription("Runs all checks.");
| project.getTasks().addPlaceholderAction(CHECK_TASK_NAME, DefaultTask.class, new Action<TaskInternal>() {
public void execute(TaskInternal checkTask) {
|
16,109 | import org.gradle.internal.Transformers;
import org.gradle.internal.graph.CachingDirectedGraphWalker;
import org.gradle.internal.graph.DirectedGraph;
import org.gradle.internal.reflect.Instantiator;
import org.gradle.model.internal.core.NamedEntityInstantiator;
<BUG>import org.gradle.util.ConfigureUtil;
import org.gradle.util.GUtil;</BUG>
import java.util.*;
public class DefaultTaskContainer extends DefaultTaskCollection<Task> implements TaskContainerInternal {
private final ITaskFactory taskFactory;
| import org.gradle.util.DeprecationLogger;
import org.gradle.util.GUtil;
|
16,110 | return super.findByName(name);
}
private void maybeMaterializePlaceholder(String name) {
if (placeholders.containsKey(name)) {
if (super.findByName(name) == null) {
<BUG>final Runnable placeholderAction = placeholders.remove(name);
placeholderAction.run();
}</BUG>
}
}
| DeprecationLogger.whileDisabled(placeholderAction);
|
16,111 | @Override
public void run() {
create(placeholderName, type, configure);
}
});
<BUG>}
@Override
public void addPlaceholderAction(String placeholderName, Runnable runnable) {
placeholders.put(placeholderName, runnable);</BUG>
}
| public <T extends TaskInternal> void addPlaceholderAction(final String placeholderName, final Class<T> type, final Action<? super T> configure) {
placeholders.put(placeholderName, new Runnable() {
|
16,112 | import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.fusesource.jansi.Ansi.ansi;
public class AbstractCorfuTest {
public Set<Callable<Object>> scheduledThreads;
<BUG>public String testStatus = "";
public static final CorfuTestParameters PARAMETERS =</BUG>
new CorfuTestParameters();
public static final CorfuTestServers SERVERS =
new CorfuTestServers();
| public Map<Integer, TestThread> threadsMap = new ConcurrentHashMap<>();
public ArrayList<IntConsumer> testSM = null;
public static final CorfuTestParameters PARAMETERS =
|
16,113 | onState[nextt] = 0;
}
}
if (onTask[nextt] != NOTASK) {
t(nextt, () -> {
<BUG>stateMachine.get(onState[nextt]).accept(nextt, onTask[nextt]); // invoke the next state-machine step of thread 'nextt'
</BUG>
if (++onState[nextt] >= numStates) {
onTask[nextt] = NOTASK;
nDone.getAndIncrement();
| testSM.get(onState[nextt]).accept(onTask[nextt]); // invoke the next state-machine step of thread 'nextt'
|
16,114 | package org.orekit.estimation.measurements;
import org.hipparchus.Field;
<BUG>import org.hipparchus.RealFieldElement;
import org.hipparchus.analysis.differentiation.DerivativeStructure;</BUG>
import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.euclidean.twod.Vector2D;
| import org.hipparchus.analysis.differentiation.DSFactory;
import org.hipparchus.analysis.differentiation.DerivativeStructure;
|
16,115 | delay = receiverPosition.distance(transitP).multiply(cReciprocal);
delta = FastMath.abs(delay.getReal() - previous);
} while (count++ < 10 && delta >= 2 * FastMath.ulp(delay.getReal()));
return delay;
}
<BUG>public OffsetDerivatives getOffsetDerivatives(final int parameters,
</BUG>
final int eastOffsetIndex,
final int northOffsetIndex,
final int zenithOffsetIndex)
| public OffsetDerivatives getOffsetDerivatives(final DSFactory factory,
|
16,116 | final FieldVector3D<DerivativeStructure> meridianCenterToOffset =
zeroNorth.add(offsetOrigin).subtract(meridianCenter);
final FieldVector3D<DerivativeStructure> meridianZ = meridianCenterToOffset.normalize();
FieldVector3D<DerivativeStructure> meridianE = FieldVector3D.crossProduct(Vector3D.PLUS_K, meridianZ);
if (meridianE.getNormSq().getValue() < Precision.SAFE_MIN) {
<BUG>meridianE = new FieldVector3D<DerivativeStructure>(new DerivativeStructure(parameters, 1, 0.0),
new DerivativeStructure(parameters, 1, 1.0),
new DerivativeStructure(parameters, 1, 0.0));
} else {</BUG>
meridianE = meridianE.normalize();
| meridianE = new FieldVector3D<>(factory.getDerivativeField().getZero(),
factory.getDerivativeField().getOne(),
factory.getDerivativeField().getZero());
} else {
|
16,117 | final FieldVector3D<DerivativeStructure> transverseCenterToOffset =
zeroEast.add(offsetOrigin).subtract(transverseCenter);
final FieldVector3D<DerivativeStructure> transverseZ = transverseCenterToOffset.normalize();
FieldVector3D<DerivativeStructure> transverseE = FieldVector3D.crossProduct(Vector3D.PLUS_K, transverseZ);
if (transverseE.getNormSq().getValue() < Precision.SAFE_MIN) {
<BUG>transverseE = new FieldVector3D<DerivativeStructure>(new DerivativeStructure(parameters, 1, 0.0),
new DerivativeStructure(parameters, 1, 1.0),
new DerivativeStructure(parameters, 1, 0.0));
} else {</BUG>
transverseE = transverseE.normalize();
| transverseE = new FieldVector3D<>(factory.getDerivativeField().getZero(),
factory.getDerivativeField().getOne(),
factory.getDerivativeField().getZero());
} else {
|
16,118 | final double[] x = d1.getX().add(d2.getX()).getAllDerivatives();
x[0] = v.getX();
final double[] y = d1.getY().add(d2.getY()).getAllDerivatives();
y[0] = v.getY();
final double[] z = d1.getZ().add(d2.getZ()).getAllDerivatives();
<BUG>z[0] = v.getZ();
final int parameters = d1.getX().getFreeParameters();
final int order = d1.getX().getOrder();
return new FieldVector3D<DerivativeStructure>(new DerivativeStructure(parameters, order, x),
new DerivativeStructure(parameters, order, y),
new DerivativeStructure(parameters, order, z));</BUG>
}
| return new FieldVector3D<>(d1.getX().getFactory().build(x),
d1.getX().getFactory().build(y),
d1.getX().getFactory().build(z));
|
16,119 | package org.orekit.forces;
import java.util.ArrayList;
import java.util.List;
<BUG>import org.hipparchus.RealFieldElement;
import org.hipparchus.analysis.differentiation.DerivativeStructure;</BUG>
import org.hipparchus.geometry.euclidean.threed.FieldRotation;
import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
import org.hipparchus.geometry.euclidean.threed.Rotation;
| import org.hipparchus.analysis.differentiation.DSFactory;
import org.hipparchus.analysis.differentiation.DerivativeStructure;
|
16,120 | private final Vector3D saZ;
private double dragCoeff;
private double absorptionCoeff;
private double specularReflectionCoeff;
private double diffuseReflectionCoeff;
<BUG>private final PVCoordinatesProvider sun;
public BoxAndSolarArraySpacecraft(final double xLength, final double yLength,</BUG>
final double zLength,
final PVCoordinatesProvider sun, final double solarArrayArea,
final Vector3D solarArrayAxis,
| private final DSFactory factory;
public BoxAndSolarArraySpacecraft(final double xLength, final double yLength,
|
16,121 | final String paramName)
throws OrekitException {
if (!DRAG_COEFFICIENT.equals(paramName)) {
throw new OrekitException(OrekitMessages.UNSUPPORTED_PARAMETER_NAME, paramName, DRAG_COEFFICIENT);
}
<BUG>final DerivativeStructure dragCoeffDS = new DerivativeStructure(1, 1, 0, dragCoeff);
</BUG>
final Vector3D v = rotation.applyTo(relativeVelocity);
final Vector3D solarArrayFacet = new Vector3D(solarArrayArea, getNormal(date, frame, position, rotation));
double sv = FastMath.abs(Vector3D.dotProduct(solarArrayFacet, v));
| final DerivativeStructure dragCoeffDS = factory.variable(0, dragCoeff);
|
16,122 | import org.orekit.propagation.SpacecraftState;
import org.orekit.time.AbsoluteDate;
import org.orekit.utils.Constants;
import org.orekit.utils.TimeStampedFieldPVCoordinates;
public class Range extends AbstractMeasurement<Range> {
<BUG>private final GroundStation station;
public Range(final GroundStation station, final AbsoluteDate date,</BUG>
final double range, final double sigma, final double baseWeight)
throws OrekitException {
super(date, range, sigma, baseWeight,
| private final DSFactory factory;
public Range(final GroundStation station, final AbsoluteDate date,
|
16,123 | throws OrekitException {
super(date, range, sigma, baseWeight,
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver());
<BUG>this.station = station;
}</BUG>
public GroundStation getStation() {
return station;
}
| this.factory = new DSFactory(9, 1);
|
16,124 | import org.orekit.frames.Transform;
import org.orekit.propagation.SpacecraftState;
import org.orekit.time.AbsoluteDate;
import org.orekit.utils.AngularCoordinates;
public class Angular extends AbstractMeasurement<Angular> {
<BUG>private final GroundStation station;
public Angular(final GroundStation station, final AbsoluteDate date,</BUG>
final double[] angular, final double[] sigma, final double[] baseWeight)
throws OrekitException {
super(date, angular, sigma, baseWeight,
| private final DSFactory factory;
public Angular(final GroundStation station, final AbsoluteDate date,
|
16,125 | throws OrekitException {
super(date, angular, sigma, baseWeight,
station.getEastOffsetDriver(),
station.getNorthOffsetDriver(),
station.getZenithOffsetDriver());
<BUG>this.station = station;
}</BUG>
public GroundStation getStation() {
return station;
}
| this.factory = new DSFactory(6, 1);
|
16,126 | final double delta = getDate().durationFrom(state.getDate());
final double dt = delta - tauD;
final SpacecraftState transitState = state.shiftedBy(dt);
final Frame bodyFrame = station.getOffsetFrame().getParentShape().getBodyFrame();
final Transform iner2Body = state.getFrame().getTransformTo(bodyFrame, getDate());
<BUG>final OffsetDerivatives od = station.getOffsetDerivatives(6, 3, 4, 5);
</BUG>
final FieldVector3D<DerivativeStructure> east = od.getEast();
final FieldVector3D<DerivativeStructure> north = od.getNorth();
final FieldVector3D<DerivativeStructure> zenith = od.getZenith();
| final OffsetDerivatives od = station.getOffsetDerivatives(factory, 3, 4, 5);
|
16,127 | final FieldVector3D<DerivativeStructure> east = od.getEast();
final FieldVector3D<DerivativeStructure> north = od.getNorth();
final FieldVector3D<DerivativeStructure> zenith = od.getZenith();
final FieldVector3D<DerivativeStructure> qP = od.getOrigin();
final Vector3D transitp = iner2Body.transformPosition(transitState.getPVCoordinates().getPosition());
<BUG>final FieldVector3D<DerivativeStructure> pP = new FieldVector3D<DerivativeStructure>(new DerivativeStructure(6, 1, 0, transitp.getX()),
new DerivativeStructure(6, 1, 1, transitp.getY()),
new DerivativeStructure(6, 1, 2, transitp.getZ()));
final FieldVector3D<DerivativeStructure> staSat = pP.subtract(qP);</BUG>
final DerivativeStructure baseAzimuth = DerivativeStructure.atan2(staSat.dotProduct(east), staSat.dotProduct(north));
| final FieldVector3D<DerivativeStructure> pP = new FieldVector3D<>(factory.variable(0, transitp.getX()),
factory.variable(1, transitp.getY()),
factory.variable(2, transitp.getZ()));
final FieldVector3D<DerivativeStructure> staSat = pP.subtract(qP);
|
16,128 | final double twoPiWrap = MathUtils.normalizeAngle(baseAzimuth.getReal(), getObservedValue()[0]) -
baseAzimuth.getReal();
final DerivativeStructure azimuth = baseAzimuth.add(twoPiWrap);
final DerivativeStructure elevation = staSat.dotProduct(zenith).divide(staSat.getNorm()).asin();
final EstimatedMeasurement<Angular> estimated =
<BUG>new EstimatedMeasurement<Angular>(this, iteration, evaluation, transitState);
estimated.setEstimatedValue(azimuth.getValue(), elevation.getValue());</BUG>
final AngularCoordinates ac = iner2Body.getInverse().getAngular();
final Vector3D tto = new Vector3D(azimuth.getPartialDerivative(1, 0, 0, 0, 0, 0),
azimuth.getPartialDerivative(0, 1, 0, 0, 0, 0),
| new EstimatedMeasurement<>(this, iteration, evaluation, transitState);
estimated.setEstimatedValue(azimuth.getValue(), elevation.getValue());
|
16,129 | package org.orekit.estimation;
import org.hipparchus.analysis.UnivariateFunction;
<BUG>import org.hipparchus.analysis.UnivariateVectorFunction;
import org.hipparchus.analysis.differentiation.DerivativeStructure;</BUG>
import org.hipparchus.analysis.differentiation.FiniteDifferencesDifferentiator;
import org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction;
import org.hipparchus.analysis.differentiation.UnivariateDifferentiableVectorFunction;
| import org.hipparchus.analysis.differentiation.DSFactory;
import org.hipparchus.analysis.differentiation.DerivativeStructure;
|
16,130 | import org.orekit.orbits.OrbitType;
import org.orekit.orbits.PositionAngle;
import org.orekit.propagation.SpacecraftState;
import org.orekit.propagation.numerical.NumericalPropagator;
import org.orekit.utils.ParameterDriver;
<BUG>public class EstimationUtils {
private EstimationUtils() {</BUG>
}
public static ParameterFunction differentiate(final ParameterFunction function,
final ParameterDriver driver,
| private static final DSFactory FACTORY = new DSFactory(1, 1);
private EstimationUtils() {
|
16,131 | if (!parameterDriver.getName().equals(driver.getName())) {
throw new OrekitException(OrekitMessages.UNSUPPORTED_PARAMETER_NAME,
parameterDriver.getName(), driver.getName());
}
try {
<BUG>final DerivativeStructure dsParam = new DerivativeStructure(1, 1, 0, parameterDriver.getNormalizedValue());
</BUG>
final DerivativeStructure dsValue = differentiated.value(dsParam);
return dsValue.getPartialDerivative(1);
} catch (OrekitExceptionWrapper oew) {
| final DerivativeStructure dsParam = FACTORY.variable(0, parameterDriver.getNormalizedValue());
|
16,132 | final UnivariateVectorFunction componentJ =
new StateComponentFunction(j, function, state, orbitType, positionAngle);
final FiniteDifferencesDifferentiator differentiator =
new FiniteDifferencesDifferentiator(nbPoints, tolerances[j]);
final UnivariateDifferentiableVectorFunction differentiatedJ =
<BUG>differentiator.differentiate(componentJ);
final DerivativeStructure[] c =
differentiatedJ.value(new DerivativeStructure(1, 1, 0, 0.0));</BUG>
for (int i = 0; i < dimension; ++i) {
jacobian[i][j] = c[i].getPartialDerivative(1);
| final DerivativeStructure[] c = differentiatedJ.value(FACTORY.variable(0, 0.0));
|
16,133 | package com.xpn.xwiki.wysiwyg.client.plugin.macro;
<BUG>import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.CloseEvent;</BUG>
import com.google.gwt.event.logical.shared.CloseHandler;
import com.xpn.xwiki.wysiwyg.client.Wysiwyg;
import com.xpn.xwiki.wysiwyg.client.plugin.internal.AbstractPlugin;
| import com.google.gwt.event.dom.client.DoubleClickEvent;
import com.google.gwt.event.dom.client.DoubleClickHandler;
import com.google.gwt.event.logical.shared.CloseEvent;
|
16,134 | import com.xpn.xwiki.wysiwyg.client.plugin.macro.ui.SelectMacroDialog;
import com.xpn.xwiki.wysiwyg.client.util.Config;
import com.xpn.xwiki.wysiwyg.client.widget.CompositeDialogBox;
import com.xpn.xwiki.wysiwyg.client.widget.rta.RichTextArea;
import com.xpn.xwiki.wysiwyg.client.widget.rta.cmd.Command;
<BUG>public class MacroPlugin extends AbstractPlugin implements CloseHandler<CompositeDialogBox>
</BUG>
{
public static final Command REFRESH = new Command("macroRefresh");
public static final Command COLLAPSE = new Command("macroCollapseAll");
| public class MacroPlugin extends AbstractPlugin implements CloseHandler<CompositeDialogBox>, DoubleClickHandler
|
16,135 | selector = new MacroSelector(displayer);
getTextArea().getCommandManager().registerCommand(REFRESH,
new RefreshExecutable(getConfig().getParameter("syntax", "xhtml/1.0")));
getTextArea().getCommandManager().registerCommand(COLLAPSE, new CollapseExecutable(selector, true));
getTextArea().getCommandManager().registerCommand(EXPAND, new CollapseExecutable(selector, false));
<BUG>getTextArea().getCommandManager().registerCommand(INSERT, new InsertExecutable(selector));
menuExtension = new MacroMenuExtension(this);</BUG>
getUIExtensionList().add(menuExtension.getExtension());
}
public void destroy()
| saveRegistration(getTextArea().addDoubleClickHandler(this));
menuExtension = new MacroMenuExtension(this);
|
16,136 | package com.xpn.xwiki.wysiwyg.client.plugin.macro.ui;
import java.util.ArrayList;
import java.util.List;
import com.google.gwt.event.dom.client.ClickEvent;
<BUG>import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.SelectionEvent;</BUG>
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
| import com.google.gwt.event.dom.client.DoubleClickEvent;
import com.google.gwt.event.dom.client.DoubleClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.event.logical.shared.SelectionEvent;
|
16,137 | super(false, true);
this.config = config;
getDialog().setIcon(Images.INSTANCE.macroInsert().createImage());
getDialog().setCaption(Strings.INSTANCE.macroInsertDialogCaption());
getHeader().add(new Label(Strings.INSTANCE.macroInsertDialogTitle()));
<BUG>macroList = new ListBox();
macroList.addSelectionHandler(this);
select = new Button(Strings.INSTANCE.select());</BUG>
select.addClickHandler(this);
| macroList = new ListBox<String>();
macroList.addDoubleClickHandler(this);
macroList.addKeyUpHandler(this);
select = new Button(Strings.INSTANCE.select());
|
16,138 | apply.addClickHandler(this);
getFooter().add(apply);
}
private void fill(MacroDescriptor macroDescriptor)
{
<BUG>setLoading(false);
Label macroDescription = new Label(macroDescriptor.getDescription());</BUG>
macroDescription.addStyleName("xMacroDescription");
getBody().add(macroDescription);
for (Map.Entry<String, ParameterDescriptor> entry : macroDescriptor.getParameterDescriptorMap().entrySet()) {
| title.setText(TITLE_PREFIX + macroDescriptor.getName());
Label macroDescription = new Label(macroDescriptor.getDescription());
|
16,139 | myModules.put(id.getModuleName(), moduleNode);
((GradleProjectStructureNode<?>)root).add(moduleNode);
}
return moduleNode;
}
<BUG>public void update(@NotNull Collection<GradleProjectStructureChange> changes) {
</BUG>
for (GradleProjectStructureChange change : changes) {
change.invite(myNewChangesDispatcher);
}
| public void processCurrentChanges(@NotNull Collection<GradleProjectStructureChange> changes) {
|
16,140 | import org.jetbrains.plugins.gradle.model.gradle.GradleEntity;
public abstract class GradleAbstractDependencyStructureChangesCalculator<G extends GradleEntity, I>
implements GradleStructureChangesCalculator<G, I>
{
@Override
<BUG>public void calculate(@NotNull G gradleEntity, @NotNull I intellijEntity, @NotNull GradleChangesCalculationContext context)
{</BUG>
doCalculate(gradleEntity, intellijEntity, context);
}
| public void calculate(@NotNull G gradleEntity, @NotNull I intellijEntity, @NotNull GradleChangesCalculationContext context) {
|
16,141 | GradleProjectStructureNode<?> node = getChildAt(i);
if (node == child) {
currentPosition = i;
continue;
}
<BUG>if (NODE_COMPARATOR.compare(child, node) <= 0) {
</BUG>
desiredPosition = i;
if (currentPosition >= 0) {
break;
| if (desiredPosition < 0 && NODE_COMPARATOR.compare(child, node) <= 0) {
|
16,142 | break;
}
}
}
if (currentPosition < 0) {
<BUG>return;
}</BUG>
if (currentPosition < desiredPosition) {
desiredPosition--;
}
| return false;
if (desiredPosition < 0) {
desiredPosition = getChildCount();
|
16,143 | @NotNull final Collection<GradleProjectStructureChange> currentChanges)
{
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
<BUG>myTreeModel.update(currentChanges);
myTreeModel.processObsoleteChanges(ContainerUtil.subtract(oldChanges, currentChanges));
}</BUG>
});
}
| myTreeModel.processCurrentChanges(currentChanges);
|
16,144 | public class AnchoredBubble extends Popup {
protected AnchoredBubble(JSObject element) {
super(element);
}
public AnchoredBubble(String id, LonLat lonlat, Size size, String html, OpenLayersObjectWrapper anchor, boolean closeBox) {
<BUG>this(AnchoredBubbleImpl.create(id,
lonlat.getJSObject(),
size.getJSObject(),
html,
anchor.getJSObject(),
closeBox));</BUG>
}
| [DELETED] |
16,145 | public void onClickStop(View v) {
if (mMediaPlayer != null) {
mMediaPlayer.stop();
mMediaPlayer.reset();
}
<BUG>mIsStopped = true;
}</BUG>
public void releaseWithoutStop() {
if (mMediaPlayer != null) {
mMediaPlayer.setDisplay(null);
| mMediaPlayer = null;
|
16,146 | package com.pili.pldroid.playerdemo;
import android.app.Activity;
<BUG>import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;</BUG>
import android.content.Intent;
import android.os.Bundle;
| [DELETED] |
16,147 | mEditText.setText(DEFAULT_TEST_URL);
mActivitySpinner = (Spinner) findViewById(R.id.TestSpinner);</BUG>
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, TEST_ACTIVITY_ARRAY);
mActivitySpinner.setAdapter(adapter);
}
<BUG>public void onClickPlaySetting(View v) {
showPlaySettingDialog();
}</BUG>
public void onClickLocalFile(View v) {
Intent intent = new Intent(this, VideoFileActivity.class);
| mStreamingTypeRadioGroup = (RadioGroup) findViewById(R.id.StreamingTypeRadioGroup);
mDecodeTypeRadioGroup = (RadioGroup) findViewById(R.id.DecodeTypeRadioGroup);
mActivitySpinner = (Spinner) findViewById(R.id.TestSpinner);
@Override
protected void onDestroy() {
super.onDestroy();
PLNetworkManager.getInstance().stopDnsCacheService(this);
|
16,148 | mVideoView.setOnBufferingUpdateListener(mOnBufferingUpdateListener);
mVideoView.setOnCompletionListener(mOnCompletionListener);
mVideoView.setOnSeekCompleteListener(mOnSeekCompleteListener);
mVideoView.setOnErrorListener(mOnErrorListener);
mVideoView.setVideoPath(mVideoPath);
<BUG>mMediaController = new MediaController(this, false, isLiveStreaming(mVideoPath));
</BUG>
mVideoView.setMediaController(mMediaController);
}
@Override
| mMediaController = new MediaController(this, false, isLiveStreaming==1);
|
16,149 | import no.digipost.api.client.representations.sender.SenderInformation;
import no.digipost.api.client.util.MultipartNoLengthCheckHttpEntity;
import no.digipost.cache.inmemory.Cache;
import no.digipost.cache.inmemory.SingleCached;
import org.apache.commons.io.IOUtils;
<BUG>import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.http.*;
import org.apache.http.client.config.RequestConfig;</BUG>
import org.apache.http.client.methods.CloseableHttpResponse;
| import org.apache.http.HttpEntity;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpHost;
import org.apache.http.HttpRequestInterceptor;
import org.apache.http.HttpResponseInterceptor;
import org.apache.http.HttpStatus;
import org.apache.http.client.config.RequestConfig;
|
16,150 | Map<String, String> queryParams = new HashMap<>();
queryParams.put("org_id", orgnr);
if (avsenderenhet != null) {
queryParams.put("part_id", avsenderenhet);
}
<BUG>return senderInformation.get(orgnr + optional(avsenderenhet).map(prepend("-")).orElse(""),
</BUG>
getResource(getEntryPoint().getSenderInformationUri().getPath(), queryParams, SenderInformation.class));
}
@Override
| return senderInformation.get(orgnr + ofNullable(avsenderenhet).map(enhet -> "-" + enhet).orElse(""),
|
16,151 | this.documentsPreparer = new DocumentsPreparer(pdfValidator);
this.digipostClientConfig = digipostClientConfig;
}
public MessageDelivery sendMultipartMessage(Message message, Map<String, DocumentContent> documentsAndContent) {
EncryptionKeyAndDocsWithInputstream encryptionAndInputStream = fetchEncryptionKeyForRecipientIfNecessaryAndMapContentToInputstream(message, documentsAndContent);
<BUG>Encrypter encrypter = encryptionAndInputStream.digipostPublicKeys.map(keyToEncrypter).orElse(FAIL_IF_TRYING_TO_ENCRYPT);
</BUG>
Map<Document, InputStream> documentInputStream = encryptionAndInputStream.documentsAndInputstream;
Message singleChannelMessage = encryptionAndInputStream.getSingleChannelMessage();
try {
| Encrypter encrypter = encryptionAndInputStream.digipostPublicKeys.map(Encrypter::using).orElse(FAIL_IF_TRYING_TO_ENCRYPT);
|
16,152 | public InputStream fetchKeyAndEncrypt(Document document, InputStream content) {
checkThatMessageCanBePreEncrypted(document);
try(CloseableHttpResponse encryptionKeyResponse = apiService.getEncryptionKey(document.getEncryptionKeyLink().getUri())){
checkResponse(encryptionKeyResponse);
EncryptionKey key = unmarshal(encryptionKeyContext, encryptionKeyResponse.getEntity().getContent(), EncryptionKey.class);
<BUG>return the(new DigipostPublicKey(key)).map(keyToEncrypter).orElse(FAIL_IF_TRYING_TO_ENCRYPT).encrypt(content);
} catch (IOException e) {</BUG>
throw new RuntimeException(e.getMessage(), e);
}
}
| return Encrypter.using(new DigipostPublicKey(key)).encrypt(content);
} catch (IOException e) {
|
16,153 | Message singleChannelMessage;
if (message.isDirectPrint()) {
singleChannelMessage = setMapAndMessageToPrint(message, documentsAndContent, documentsAndInputstream);
if (singleChannelMessage.hasAnyDocumentRequiringEncryption()) {
eventLogger.log("Direkte print. Bruker krypteringsnøkkel for print.");
<BUG>publicKeys = optional(getEncryptionKeyForPrint());
</BUG>
}
} else if (!message.recipient.hasPrintDetails() && !message.hasAnyDocumentRequiringEncryption()) {
singleChannelMessage = setMapAndMessageToDigipost(message, documentsAndContent, documentsAndInputstream);
| publicKeys = Optional.ofNullable(getEncryptionKeyForPrint());
|
16,154 | IdentificationResultWithEncryptionKey result = identifyAndGetEncryptionKey(message.recipient.toIdentification());
if (result.getResultCode() == IdentificationResultCode.DIGIPOST) {
singleChannelMessage = setMapAndMessageToDigipost(message, documentsAndContent, documentsAndInputstream);
if (singleChannelMessage.hasAnyDocumentRequiringEncryption()) {
eventLogger.log("Mottaker er Digipost-bruker. Bruker brukers krypteringsnøkkel.");
<BUG>publicKeys = optional(new DigipostPublicKey(result.getEncryptionKey()));
</BUG>
}
} else if (message.recipient.hasPrintDetails()) {
singleChannelMessage = setMapAndMessageToPrint(message, documentsAndContent, documentsAndInputstream);
| publicKeys = Optional.of(new DigipostPublicKey(result.getEncryptionKey()));
|
16,155 | Map<Document, InputStream> documentsAndInputStream){
Message singleChannelMessage = Message.copyMessageWithOnlyPrintDetails(messageToCopy);
setPrintContentToUUID(documentsAndContent, documentsAndInputStream, singleChannelMessage.getAllDocuments());
return singleChannelMessage;
}
<BUG>static void setDigipostContentToUUID(Map<String, DocumentContent> documentsAndContent, Map<Document, InputStream> documentsAndInputstream, List<Document> allDocuments) {
for(Document doc : allDocuments) {
documentsAndInputstream.put(doc, documentsAndContent.get(doc.uuid).getDigipostContent());
</BUG>
}
| Message singleChannelMessage = Message.copyMessageWithOnlyDigipostDetails(messageToCopy);
setDigipostContentToUUID(documentsAndContent, documentsAndInputStream, singleChannelMessage.getAllDocuments());
|
16,156 | import no.digipost.api.client.representations.Message;
import no.digipost.api.client.util.Encrypter;
import no.digipost.print.validate.PdfValidationResult;
import no.digipost.print.validate.PdfValidationSettings;
import no.digipost.print.validate.PdfValidator;
<BUG>import no.motif.f.Fn0;
import no.motif.single.Elem;
import no.motif.single.Optional;</BUG>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
| [DELETED] |
16,157 | </BUG>
final Map<Document, InputStream> prepared = new LinkedHashMap<>();
if(message.recipient.hasPrintDetails() && message.recipient.hasDigipostIdentification()){
throw new IllegalStateException("Forventet message med enkelt kanal");
<BUG>}
for (Elem<Document> i : on(on(documentsAndContent.keySet()).sorted(message.documentOrder())).indexed()) {
Document document = i.value;</BUG>
if (document.willBeEncrypted()) {
byte[] byteContent = toByteArray(documentsAndContent.get(document));
LOG.debug("Validerer dokument med uuid '{}' før kryptering", document.uuid);
| DocumentsPreparer(PdfValidator pdfValidator) {
this.pdfValidator = pdfValidator;
Map<Document, InputStream> prepare(
Map<Document, InputStream> documentsAndContent, Message message,
Encrypter encrypter, Supplier<PdfValidationSettings> pdfValidationSettings) throws IOException {
for (Document document : (Iterable<Document>) documentsAndContent.keySet().stream().sorted(message.documentOrder())::iterator) {
|
16,158 | prepared.put(document, documentsAndContent.get(document));
}
}
return prepared;
}
<BUG>Optional<PdfInfo> validateAndSetNrOfPages(Channel channel, Document document, byte[] content, Fn0<PdfValidationSettings> pdfValidationSettings) {
</BUG>
if (channel == PRINT && !document.is(PDF)) {
throw new DigipostClientException(ErrorCode.INVALID_PDF_CONTENT,
"PDF is required for direct-to-print messages. Document with uuid " + document.uuid + " had filetype " + document.getDigipostFileType());
| Optional<PdfInfo> validateAndSetNrOfPages(Channel channel, Document document, byte[] content, Supplier<PdfValidationSettings> pdfValidationSettings) {
|
16,159 | HTextFlowTarget hTextFlowTarget = hTextFlow.getTargets().get(hLocale.getId());
Map<Integer,HTextFlowTargetHistory> history = Maps.newHashMap();
TransHistoryItem latest = null;
SimpleDateFormat dateFormat = new SimpleDateFormat();
if (hTextFlowTarget != null)
<BUG>{
latest = new TransHistoryItem(hTextFlowTarget.getVersionNum().toString(), hTextFlowTarget.getContents(),
hTextFlowTarget.getState(), hTextFlowTarget.getLastModifiedBy().getName(),
dateFormat.format(hTextFlowTarget.getLastChanged()));</BUG>
history = hTextFlowTarget.getHistory();
| String lastModifiedBy = "unknown";
String lastModifiedDate = "unknown";
if (hTextFlowTarget.getLastModifiedBy() != null)
lastModifiedBy = hTextFlowTarget.getLastModifiedBy().getName();
lastModifiedDate = dateFormat.format(hTextFlowTarget.getLastChanged());
|
16,160 | import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class DependencyConvergenceReport
extends AbstractProjectInfoReport
<BUG>{
private List reactorProjects;
private static final int PERCENTAGE = 100;</BUG>
public String getOutputName()
{
| private static final int PERCENTAGE = 100;
private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment
.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
|
16,161 | sink.section1();
sink.sectionTitle1();
sink.text( getI18nString( locale, "title" ) );
sink.sectionTitle1_();
Map dependencyMap = getDependencyMap();
<BUG>generateLegend( locale, sink );
generateStats( locale, sink, dependencyMap );
generateConvergence( locale, sink, dependencyMap );
sink.section1_();</BUG>
sink.body_();
| sink.lineBreak();
sink.section1_();
|
16,162 | Iterator it = artifactMap.keySet().iterator();
while ( it.hasNext() )
{
String version = (String) it.next();
sink.tableRow();
<BUG>sink.tableCell();
sink.text( version );</BUG>
sink.tableCell_();
sink.tableCell();
generateVersionDetails( sink, artifactMap, version );
| sink.tableCell( String.valueOf( cellWidth ) + "px" );
sink.text( version );
|
16,163 | sink.tableCell();
sink.text( getI18nString( locale, "legend.shared" ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableCell();
iconError( sink );</BUG>
sink.tableCell_();
sink.tableCell();
sink.text( getI18nString( locale, "legend.different" ) );
| sink.tableCell( "15px" ); // according /images/icon_error_sml.gif
iconError( sink );
|
16,164 | sink.tableCaption();
sink.text( getI18nString( locale, "stats.caption" ) );
sink.tableCaption_();</BUG>
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.subprojects" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
| sink.bold();
sink.bold_();
sink.tableCaption_();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.subprojects" ) );
sink.tableHeaderCell_();
|
16,165 | sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.dependencies" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( depCount ) );
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.dependencies" ) );
sink.tableHeaderCell_();
|
16,166 | sink.text( String.valueOf( convergence ) + "%" );
sink.bold_();
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.readyrelease" ) );
sink.tableHeaderCell_();
|
16,167 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| iconError( sink );
|
16,168 | Assert.assertEquals(msg, result2);
}
@Test
public void testAsciiConverter() {
HttpResponse response = createOkResponse();
<BUG>byte[] payload = parser.marshalToBytes(response);
</BUG>
ConvertAscii converter = new ConvertAscii();
String readableForm = converter.convertToReadableForm(payload);
Assert.assertEquals(
| byte[] payload = unwrap(parser.marshalToByteBuffer(response));
|
16,169 | Assert.assertEquals(response, httpMessage);
}
@Test
public void test2AndHalfHttpMessages() {
HttpResponse response = createOkResponse();
<BUG>byte[] payload = parser.marshalToBytes(response);
</BUG>
byte[] first = new byte[2*payload.length + 20];
byte[] second = new byte[payload.length - 20];
System.arraycopy(payload, 0, first, 0, payload.length);
| byte[] payload = unwrap(parser.marshalToByteBuffer(response));
|
16,170 | DataWrapper payload1 = dataGen.wrapByteArray("0123456789".getBytes());
HttpChunk chunk = new HttpChunk();
chunk.addExtension(new HttpChunkExtension("asdf", "value"));
chunk.addExtension(new HttpChunkExtension("something"));
chunk.setBody(payload1);
<BUG>byte[] payload = parser.marshalToBytes(chunk);
</BUG>
String str = new String(payload);
Assert.assertEquals("a;asdf=value;something\r\n0123456789\r\n", str);
HttpLastChunk lastChunk = new HttpLastChunk();
| byte[] payload = unwrap(parser.marshalToByteBuffer(chunk));
|
16,171 | HttpLastChunk lastChunk = new HttpLastChunk();
lastChunk.addExtension(new HttpChunkExtension("this", "that"));
lastChunk.addHeader(new Header("customer", "value"));
String lastPayload = parser.marshalToString(lastChunk);
Assert.assertEquals("0;this=that\r\ncustomer: value\r\n\r\n", lastPayload);
<BUG>byte[] lastBytes = parser.marshalToBytes(lastChunk);
</BUG>
String lastPayloadFromBytes = new String(lastBytes, HttpParserFactory.iso8859_1);
Assert.assertEquals("0;this=that\r\ncustomer: value\r\n\r\n", lastPayloadFromBytes);
}
| byte[] lastBytes = unwrap(parser.marshalToByteBuffer(lastChunk));
|
16,172 | import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
<BUG>import org.slf4j.Logger;
import org.slf4j.LoggerFactory;</BUG>
import org.webpieces.data.api.BufferPool;
import org.webpieces.data.api.DataWrapper;
import org.webpieces.data.api.DataWrapperGenerator;
| [DELETED] |
16,173 | import java.nio.ByteBuffer;
import org.webpieces.data.api.DataWrapper;
import org.webpieces.httpparser.api.dto.HttpPayload;
public interface HttpParser {
ByteBuffer marshalToByteBuffer(HttpPayload request);
<BUG>byte[] marshalToBytes(HttpPayload request);</BUG>
String marshalToString(HttpPayload request);
Memento prepareToParse();
Memento parse(Memento state, DataWrapper moreData);
HttpPayload unmarshal(byte[] msg);
}
| [DELETED] |
16,174 | HttpRequestLine requestLine = new HttpRequestLine();
requestLine.setMethod(KnownHttpMethod.GET);
requestLine.setUri(new HttpUri("http://www.deano.com"));
HttpRequest req = new HttpRequest();
req.setRequestLine(requestLine);
<BUG>byte[] array = parser.marshalToBytes(req);
</BUG>
ByteBuffer buffer = ByteBuffer.wrap(array);
dataListener.incomingData(mockTcpChannel, ByteBuffer.allocate(0));
dataListener.incomingData(mockTcpChannel, buffer);
| byte[] array = unwrap(parser.marshalToByteBuffer(req));
|
16,175 | Assert.assertEquals(msg, result2);
}
@Test
public void testAsciiConverter() {
HttpRequest request = createPostRequest();
<BUG>byte[] payload = parser.marshalToBytes(request);
</BUG>
ConvertAscii converter = new ConvertAscii();
String readableForm = converter.convertToReadableForm(payload);
String expected = "POST\\s http://myhost.com\\s HTTP/1.1\\r\\n\r\n"
| byte[] payload = unwrap(parser.marshalToByteBuffer(request));
|
16,176 | Assert.assertEquals(request, httpMessage);
}
@Test
public void test2AndHalfHttpMessages() {
HttpRequest request = createPostRequest();
<BUG>byte[] payload = parser.marshalToBytes(request);
</BUG>
byte[] first = new byte[2*payload.length + 20];
byte[] second = new byte[payload.length - 20];
System.arraycopy(payload, 0, first, 0, payload.length);
| byte[] payload = unwrap(parser.marshalToByteBuffer(request));
|
16,177 | import android.database.Cursor;
import android.net.Uri;
import android.os.AsyncTask;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
<BUG>import android.support.v4.os.AsyncTaskCompat;
import android.text.TextUtils;</BUG>
import android.widget.Toast;
import com.battlelancer.seriesguide.R;
import com.battlelancer.seriesguide.SgApp;
| import android.support.v4.util.SparseArrayCompat;
import android.text.TextUtils;
|
16,178 | List<Episode> episodes;
boolean hasMoreEpisodes = true;
String cursor = null;
long currentTime = System.currentTimeMillis();
DateTime lastSyncTime = new DateTime(HexagonSettings.getLastEpisodesSyncTime(context));
<BUG>Timber.d("flagsFromHexagon: downloading changed episode flags since %s", lastSyncTime);
while (hasMoreEpisodes) {</BUG>
try {
Episodes episodesService = HexagonTools.getEpisodesService(context);
if (episodesService == null) {
| SparseArrayCompat<Long> showsLastWatchedMs = new SparseArrayCompat<>();
while (hasMoreEpisodes) {
|
16,179 | episode.getIsInCollection());
}
ContentProviderOperation op = ContentProviderOperation
.newUpdate(SeriesGuideContract.Episodes.CONTENT_URI)
.withSelection(SeriesGuideContract.Shows.REF_SHOW_ID + "="
<BUG>+ episode.getShowTvdbId() + " AND "
+ SeriesGuideContract.Episodes.SEASON + "="</BUG>
+ episode.getSeasonNumber() + " AND "
+ SeriesGuideContract.Episodes.NUMBER + "="
+ episode.getEpisodeNumber(), null)
| + showTvdbId + " AND "
+ SeriesGuideContract.Episodes.SEASON + "="
|
16,180 | package com.battlelancer.seriesguide.util;
import android.content.ContentProviderOperation;
import android.content.ContentValues;
import android.content.Context;
import android.content.OperationApplicationException;
<BUG>import android.database.Cursor;
import android.os.AsyncTask;</BUG>
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
| import android.net.Uri;
import android.os.AsyncTask;
|
16,181 | import static org.neo4j.helpers.collection.MapUtil.map;
import static org.neo4j.bolt.v1.messaging.PackStreamMessageFormatV1.Writer.NO_OP;
import static org.neo4j.bolt.v1.messaging.example.Paths.ALL_PATHS;
import static org.neo4j.bolt.v1.runtime.spi.Records.record;
public class MessageFormatTest
<BUG>{
@Test</BUG>
public void shouldHandleCommonMessages() throws Throwable
{
assertSerializes( new RunMessage( "CREATE (n) RETURN åäö" ) );
| @Rule
public ExpectedException exception = ExpectedException.none();
@Test
|
16,182 | assertSerializesNeoValue( asList( "one", "", "three" ) );
assertSerializesNeoValue( asList( 12.4d, 0.0d ) );
assertSerializesNeoValue( map( "k", null ) );
assertSerializesNeoValue( map( "k", true ) );
assertSerializesNeoValue( map( "k", false ) );
<BUG>assertSerializesNeoValue( map( "k", 1337l ) );
</BUG>
assertSerializesNeoValue( map( "k", 133.7d ) );
assertSerializesNeoValue( map( "k", "Hello" ) );
assertSerializesNeoValue( map( "k", asList( "one", "", "three" ) ) );
| assertSerializesNeoValue( map( "k", 1337L ) );
|
16,183 | assertSerializesNeoValue( map( "k", asList( "one", "", "three" ) ) );
}
@Test
public void shouldSerializeNode() throws Throwable
{
<BUG>assertSerializesNeoValue( new ValueNode( 12l, asList( label( "User" ), label( "Banana" ) ),
map( "name", "Bob", "age", 14 ) ) );
}</BUG>
@Test
| ValueNode valueNode = new ValueNode( 12L, asList( label( "User" ), label( "Banana" ) ),
map( "name", "Bob", "age", 14 ) );
assertThat( serialized( valueNode ),
equalTo( "B1 71 91 B3 4E 0C 92 84 55 73 65 72 86 42 61 6E\n" +
"61 6E 61 A2 84 6E 61 6D 65 83 42 6F 62 83 61 67\n" +
"65 0E" ) );
|
16,184 | for ( DocStruct.Field field : struct )
{
packValueOf( field, packer );
}
packer.flush();
<BUG>byte[] bytes = output.bytes();
PackedInputArray input = new PackedInputArray( bytes );
Neo4jPack.Unpacker unpacker = new Neo4jPack.Unpacker( input );
Object unpacked = unpacker.unpack();
assertEquals( expectedClass.get( struct.name() ), unpacked.getClass() );
</BUG>
}
| String hex = HexPrinter.hex( bytes, 4, "\n" );
assertEquals( expectedSerialization.get( struct.name() ), hex );
|
16,185 | switch (proto) {
case PROTO_HTTP:
return new CachingHttpURLConnection(cacheFile,
(HttpURLConnection) defaultUrlConnection);
case PROTO_HTTPS:
<BUG>return new CachingHttpsURLConnection(cacheFile,
(HttpsURLConnection) defaultUrlConnection);
}</BUG>
throw new IOException("no matching handler");
}
| [DELETED] |
16,186 | return delegate.getHeaderFieldKey(n);
}
public long getHeaderFieldLong(String name, long Default) {
return delegate.getHeaderFieldLong(name, Default);
}
<BUG>public Map<String, List<String>> getHeaderFields() {
return delegate.getHeaderFields();
</BUG>
}
public HostnameVerifier getHostnameVerifier() {
| if (!readFromCache) {
cachedDataInfo.setHeaderFields(delegate.getHeaderFields());
return cachedDataInfo.getHeaderFields();
|
16,187 | package com.sothawo.mapjfx.offline;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
<BUG>import java.io.InputStream;
import java.io.OutputStream;</BUG>
import java.net.ContentHandlerFactory;
import java.net.FileNameMap;
import java.net.HttpURLConnection;
| import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
|
16,188 | import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.Files;
<BUG>import java.nio.file.Path;
import java.security.Permission;</BUG>
import java.text.MessageFormat;
import java.util.List;
import java.util.Map;
| import java.nio.file.Paths;
import java.security.Permission;
|
16,189 | import java.util.Map;
import java.util.logging.Logger;
public class CachingHttpURLConnection extends HttpURLConnection {
private static final Logger logger = Logger.getLogger(CachingHttpURLConnection.class.getCanonicalName());
private final HttpURLConnection delegate;
<BUG>private final Path cacheFile;
private boolean readFromCache = false;
private InputStream inputStream;
public static void setDefaultAllowUserInteraction(boolean defaultallowuserinteraction) {</BUG>
URLConnection.setDefaultAllowUserInteraction(defaultallowuserinteraction);
| private final Path cacheDataFile;
private CachedDataInfo cachedDataInfo;
public static void setDefaultAllowUserInteraction(boolean defaultallowuserinteraction) {
|
16,190 | if (!readFromCache) {
logger.finer("connect to " + delegate.getURL().toExternalForm());
delegate.connect();
}
}
<BUG>public void disconnect() {
delegate.disconnect();
}</BUG>
public boolean getAllowUserInteraction() {
return delegate.getAllowUserInteraction();
| [DELETED] |
16,191 | return delegate.getHeaderFieldKey(n);
}
public long getHeaderFieldLong(String name, long Default) {
return delegate.getHeaderFieldLong(name, Default);
}
<BUG>public Map<String, List<String>> getHeaderFields() {
return delegate.getHeaderFields();
</BUG>
}
public long getIfModifiedSince() {
| if (!readFromCache) {
cachedDataInfo.setHeaderFields(delegate.getHeaderFields());
return cachedDataInfo.getHeaderFields();
|
16,192 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\"")));
}
| return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
16,193 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, sum, fib));
}
| return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
16,194 | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
<BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39)
.process(() -> 9999L);
Task<String> task2 = Task.ofType(String.class).named("Baz", 40)
.in(() -> task1)</BUG>
.ins(() -> singletonList(task1))
| Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
|
16,195 | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef")
.process(() -> instanceField + " causes an outer reference");</BUG>
serialize(task);
}
@Test
| Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
|
16,196 | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef")
.process(() -> local + " won't cause an outer reference");</BUG>
serialize(task);
Task<String> des = deserialize();
context.evaluate(des).consume(val);
| Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
|
16,197 | }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
<BUG>return Task.ofType(String.class).named("StandardArgs", first, second)
.process(() -> second + " " + first * 100);</BUG>
}
@Test
public void shouldParseFlags() throws Exception {
| return Task.named("StandardArgs", first, second).ofType(String.class)
.process(() -> second + " " + first * 100);
|
16,198 | assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
<BUG>return Task.ofType(String.class).named("Enums", enm)
.process(enm::toString);</BUG>
}
@Test
public void shouldParseCustomTypes() throws Exception {
| return Task.named("Enums", enm).ofType(String.class)
.process(enm::toString);
|
16,199 | assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
<BUG>return Task.ofType(String.class).named("Types", myType.content)
.process(() -> myType.content);</BUG>
}
public enum CustomEnum {
BAR
| return Task.named("Types", myType.content).ofType(String.class)
.process(() -> myType.content);
|
16,200 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() -> n);
| TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.