id
int64
2
70k
bug_ctx
stringlengths
58
37.5k
fixed
stringlengths
1
37k
66,123
<BUG>mIsStopped = true;}</BUG><CONTEXT>public void onClickStop(View v) {if (mMediaPlayer != null) {mMediaPlayer.stop();mMediaPlayer.reset();}<extra_id_0>public void releaseWithoutStop() {if (mMediaPlayer != null) {mMediaPlayer.setDisplay(null);</CONTEXT>
mMediaPlayer = null;
56,934
<BUG>import org.glowroot.agent.embedded.repo.AgentDao;import org.glowroot.agent.embedded.repo.AggregateDao;import org.glowroot.agent.embedded.repo.GaugeValueDao;</BUG><CONTEXT>package org.glowroot.agent.embedded.init;import java.io.File;import java.util.List;import org.glowroot.agent.collector.Collector;<extra_id_0>import org.glowroot.agent.embedded.repo.TraceDao;import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;</CONTEXT>
import org.glowroot.agent.embedded.repo.EnvironmentDao;import org.glowroot.agent.embedded.repo.GaugeValueDao;
22,616
<CONTEXT>if (traceLog) Log.d("TRACE", "--> RxFragment.onDestroyView()");lifecycleSubject.onNext(LifecycleEvent.DESTROY_VIEW);super.onDestroyView();</BUG>}@Override<extra_id_0>}@Override<BUG>public void onDetach() {if (traceLog) Log.d("TRACE", "--> RxFragment.onDetach()");lifecycleSubject.onNext(LifecycleEvent.DETACH);super.onDetach();</BUG>}</CONTEXT>
abstract protected boolean isDebug();protected void enableTraceLog(boolean enable) {traceLog = enable;
12,550
<CONTEXT>{return _resources.findResources(filter);</BUG>}@Override<extra_id_0>}@Override<BUG>public <T extends MuseResource> List<ResourceToken<T>> findResources(ResourceMetadata filter, Class<T> interface_class){filter.setType(getResourceTypes().forImplementationInterface(interface_class));List<ResourceToken<T>> typed_tokens = new ArrayList<>();List<ResourceToken> tokens = _resources.findResources(filter);for (ResourceToken token : tokens)typed_tokens.add((ResourceToken<T>)token);return typed_tokens;</BUG>}</CONTEXT>
_resources = new InMemoryResourceStore();public void open()
49,401
<BUG>event.getEntityLiving().entityDropItem(new ItemStack(InitItems.itemSolidifiedExperience, event.getEntityLiving().world.rand.nextInt(2+event.getLootingLevel())+1), 0);}</BUG><CONTEXT>public void onEntityDropEvent(LivingDropsEvent event){if(ConfigBoolValues.DO_XP_DROPS.isEnabled()){if(event.getEntityLiving().world != null && !event.getEntityLiving().world.isRemote && event.getSource().getEntity() instanceof EntityPlayer){if(event.getEntityLiving() instanceof EntityCreature){if(event.getEntityLiving().world.rand.nextInt(10) <= event.getLootingLevel()*2){<extra_id_0>}}}</CONTEXT>
event.getDrops().add(new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX, event.getEntityLiving().posY, event.getEntityLiving().posZ, new ItemStack(InitItems.itemSolidifiedExperience, event.getEntityLiving().world.rand.nextInt(2+event.getLootingLevel())+1)));
10,259
<BUG>import org.bouncycastle.cert.X509CertificateHolder;import org.bouncycastle.est.ESTServiceBuilder;</BUG><CONTEXT>import org.bouncycastle.asn1.x500.X500NameBuilder;import org.bouncycastle.asn1.x500.style.BCStyle;import org.bouncycastle.asn1.x509.KeyPurposeId;import org.bouncycastle.asn1.x509.KeyUsage;import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;<extra_id_0>import org.bouncycastle.est.http.BasicAuth;import org.bouncycastle.est.http.DigestAuth;import org.bouncycastle.esttst.ESTServerUtils;</CONTEXT>
import org.bouncycastle.est.ESTService;import org.bouncycastle.est.ESTServiceBuilder;
23,869
<BUG>public Duration timeFromLastExecution(DateTime date){return new Interval(lastExecution(date), date).toDuration();}public boolean isMatch(DateTime date){</BUG><CONTEXT>return previousMatch;} catch (NoSuchValueException e) {throw new IllegalArgumentException(e);}}<extra_id_0>return nextExecution(lastExecution(date)).equals(date);</CONTEXT>
[DELETED]
2,218
<BUG>import jetbrains.mps.smodel.action.SNodeFactoryOperations;import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;</BUG><CONTEXT>import jetbrains.mps.lang.editor.menus.transformation.MenuLocations;import jetbrains.mps.lang.editor.menus.SingleItemMenuPart;import org.jetbrains.annotations.Nullable;import jetbrains.mps.openapi.editor.menus.transformation.ActionItemBase;import org.jetbrains.annotations.NotNull;<extra_id_0>import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;import org.jetbrains.mps.openapi.language.SAbstractConcept;</CONTEXT>
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;import org.jetbrains.mps.openapi.model.SNode;import org.jetbrains.mps.openapi.persistence.PersistenceFacade;import jetbrains.mps.smodel.SModelUtil_new;
43,004
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef").process(() -> local + " won't cause an outer reference");</BUG><CONTEXT>serialize(task);}@Testpublic void shouldSerializeWithLocalReference() throws Exception {String local = instanceField;<extra_id_0>serialize(task);Task<String> des = deserialize();context.evaluate(des).consume(val);</CONTEXT>
Task<String> task = Task.named("WithLocalRef").ofType(String.class).process(() -> local + " won't cause an outer reference");
51,641
<BUG>verify(helper).resolveConflictWithProgress(CONFLICT_RENAME.getLocalPath(), ((RenameConflict) CONFLICT_RENAME).getServerPath(), ResolveConflictsCommand.AutoResolveType.TakeTheirs, mockServerContext, mockResolveConflictsModel, true);</BUG><CONTEXT>helper = new ResolveConflictHelper(mockProject, mockUpdatedFiles, updateRoots);}@Testpublic void testMerge_Rename_TakeTheirs() throws Exception {renameTest(((RenameConflict) CONFLICT_RENAME).getServerPath());<extra_id_0>}@Testpublic void testMerge_Rename_KeepYours() throws Exception {</CONTEXT>
verify(helper).resolveConflictWithProgress(Matchers.eq(CONFLICT_RENAME.getLocalPath()), Matchers.eq(((RenameConflict) CONFLICT_RENAME).getServerPath()), Matchers.eq(ResolveConflictsCommand.AutoResolveType.TakeTheirs), Matchers.eq(mockServerContext), Matchers.eq(mockResolveConflictsModel), Matchers.eq(true), any(NameMergerResolution.class));
49,643
<BUG>return Task.ofType(String.class).named("Enums", enm).process(enm::toString);</BUG><CONTEXT>assertThat(parsedEnum, is(CustomEnum.BAR));}@RootTaskpublic static Task<String> enums(CustomEnum enm) {parsedEnum = enm;<extra_id_0>}@Testpublic void shouldParseCustomTypes() throws Exception {</CONTEXT>
return Task.named("Enums", enm).ofType(String.class).process(enm::toString);
46,473
<BUG>r = matchedExpression(b, l + 1, 23);</BUG><CONTEXT>}private static boolean maxExpression_1(PsiBuilder b, int l) {if (!recursion_guard_(b, l, "maxExpression_1")) return false;boolean r;Marker m = enter_section_(b);<extra_id_0>r = r && maxExpression_1_1(b, l + 1);exit_section_(b, m, null, r);return r;</CONTEXT>
static boolean keywordKeyColonEOL(PsiBuilder b, int l) {if (!recursion_guard_(b, l, "keywordKeyColonEOL")) return false;r = keywordKey(b, l + 1);r = r && consumeToken(b, KEYWORD_PAIR_COLON);r = r && keywordKeyColonEOL_2(b, l + 1);
19,828
<BUG>private float getHeight(int x, int z, int width, ByteBuffer buffer) {byte r = buffer.get(x * 4 + 0 + z * 4 * width);</BUG><CONTEXT>normals.add(normal.z);}}return Utils.listToArray(normals);}<extra_id_0>byte g = buffer.get(x * 4 + 1 + z * 4 * width);byte b = buffer.get(x * 4 + 2 + z * 4 * width);byte a = buffer.get(x * 4 + 3 + z * 4 * width);</CONTEXT>
int argb = getRGB(x, z, width, buffer);return this.minY + Math.abs(this.maxY - this.minY) * ((float) argb / (float) MAX_COLOUR);public static int getRGB(int x, int z, int width, ByteBuffer buffer) {byte r = buffer.get(x * 4 + 0 + z * 4 * width);
38,514
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;</BUG><CONTEXT>weight &= (0xffff - (1 << 4 * h + z));}}}if (weight == 0 || tmpROI == 0) {<extra_id_0>} else {for (int h = 0; h < KERNEL_LINE_DIM; h++) {long tempSum = 0;</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
47,801
<BUG>if (caseA) {for (int h = 0; h < dstHeight; h++) {</BUG><CONTEXT>final int pixelStride = dst.getPixelStride();final int[] bandOffsets = dst.getBandOffsets();final int[][] data = dst.getIntDataArrays();final float[] warpData = new float[2 * dstWidth];int lineOffset = 0;<extra_id_0>int pixelOffset = lineOffset;lineOffset += lineStride;warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);</CONTEXT>
if(hasROI && !roiContainsTile && roiIter == null){throw new IllegalArgumentException("Error on creating the ROI iterator");}if (caseA || (caseB && roiContainsTile)) {for (int h = 0; h < dstHeight; h++) {
36,184
<BUG>if (permanent == null && source.getAbilityType().equals(AbilityType.STATIC)) {</BUG><CONTEXT>}@Overridepublic boolean apply(Game game, Ability source) {Player player = game.getPlayer(source.getControllerId());Permanent permanent = game.getPermanent(source.getSourceId());<extra_id_0>permanent = game.getPermanentEntering(source.getSourceId());}if (player != null && permanent != null) {</CONTEXT>
public TapSourceUnlessPaysEffect(final TapSourceUnlessPaysEffect effect) {super(effect);this.cost = effect.cost;if (permanent == null && source.getAbilityType() == AbilityType.STATIC) {
44,017
<CONTEXT>String name = fgObject.getName();Path singleDir = dir.resolve(name.toLowerCase());</BUG>boolean shouldSave = fgObject.shouldSave();if (force || shouldSave) {<extra_id_0>boolean shouldSave = fgObject.shouldSave();if (force || shouldSave) {<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir);</BUG>constructDirectory(singleDir);try {fgObject.save(singleDir);</CONTEXT>
UUID owner = fgObject.getOwner();boolean isOwned = !owner.equals(SERVER_UUID);Optional<User> userOwner = userStorageService.get(owner);String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name;if (fgObject.autoSave()) {Path singleDir = serverDir.resolve(name.toLowerCase());logger.info((shouldSave ? "S" : "Force s") + "aving handler " + logName + " in directory: " + singleDir);
57,874
<BUG>mTitle = getTitle();mNavigationDrawerFragment.setUp(</BUG><CONTEXT>protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);mNavigationDrawerFragment = (NavigationDrawerFragment)getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);<extra_id_0>R.id.navigation_drawer,(DrawerLayout) findViewById(R.id.drawer_layout));databaseHandler = DatabaseHandler.getInstance();</CONTEXT>
getSupportActionBar().setTitle(getString(R.string.simple_news_title));mNavigationDrawerFragment.setUp(
42,226
<BUG>import org.jboss.logging.annotations.MessageBundle;import java.io.IOException;</BUG><CONTEXT>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;<extra_id_0>import java.util.List;@MessageBundle(projectCode = "JBAS")public interface PatchMessages {</CONTEXT>
import org.jboss.logging.annotations.Cause;import java.io.IOException;
8,036
<BUG>return builder.toString();}</BUG><CONTEXT>StringBuilder builder = new StringBuilder();for (Iterator<IHandler> it = handlers.iterator(); it.hasNext(); ) {builder.append(it.next().getName());if (it.hasNext()) builder.append(",");}<extra_id_0>private final class LoadEntry {public final String name;public final Type type;</CONTEXT>
public enum Type {REGION, WREGION, HANDLER
26,862
<BUG>public void returnResource(final RedisAsyncConnection<byte[], byte[]> resource) {</BUG><CONTEXT>internalPool.invalidateObject(resource);} catch (Exception e) {throw new PoolException("Could not invalidate the broken resource", e);}}<extra_id_0>try {internalPool.returnObject(resource);} catch (Exception e) {</CONTEXT>
public void returnResource(final StatefulConnection<byte[], byte[]> resource) {
68,935
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;</BUG><CONTEXT>final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy);final int pos = posx + posy;if (baseIndex > roiDataLength || roiDataArray[baseIndex] == 0) {if (setDestinationNoData) {for (int k2 = 0; k2 < dst_num_bands; k2++) {<extra_id_0>}}} else {</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
31,562
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,XWiki xwikiApi, Boolean withPrettyNames){</BUG><CONTEXT>attachmentLink.setRel(Relations.ATTACHMENT_DATA);attachment.getLinks().add(attachmentLink);return attachment;}public static Attachment createAttachmentAtVersion(ObjectFactory objectFactory, URI baseUri,<extra_id_0>Attachment attachment = new Attachment();</CONTEXT>
com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,{
47,097
<CONTEXT>if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) {mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics);mCameraPoseTimestamp = lastFramePose.timestamp;</BUG>} else {<extra_id_0>} else {<BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread);}</BUG>}}}@Override</CONTEXT>
mRenderer.updateRenderCameraPose(lastFramePose);mCameraPoseTimestamp = lastFramePose.timestamp;Log.w(TAG, "Can't get device pose at time: " +
56,126
<CONTEXT>if (fgObject.autoSave()) {Path singleDir = dir.resolve(name.toLowerCase());</BUG>boolean shouldSave = fgObject.shouldSave();if (force || shouldSave) {<extra_id_0>boolean shouldSave = fgObject.shouldSave();if (force || shouldSave) {<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir);</BUG>constructDirectory(singleDir);try {fgObject.save(singleDir);</CONTEXT>
Path singleDir = serverDir.resolve(name.toLowerCase());logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
37,964
<BUG>public static void setContext(UimaContext uimaContext) {threadLocalContext.set(uimaContext);;}</BUG><CONTEXT>public class UimaContextHolder {private static InheritableThreadLocal<UimaContext> threadLocalContext = new InheritableThreadLocal<UimaContext>();public static UimaContext getContext() {return threadLocalContext.get();}<extra_id_0>public static void clearContext() {</CONTEXT>
public static UimaContext setContext(UimaContext uimaContext) {UimaContext prevContext = threadLocalContext.get();threadLocalContext.set(uimaContext);return prevContext;
20,969
<BUG>this.offset.set(offset);</BUG><CONTEXT>return wrap(buffer, 0, buffer.capacity());}@Overridepublic MessageBuilder wrap(MutableBuffer buffer, int offset, int length) {this.buffer = buffer;<extra_id_0>this.start = offset;this.end = offset + length;return this;</CONTEXT>
this.offset = offset;
45,071
<BUG>verifyTable(SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);</BUG><CONTEXT>} catch (SQLException ex) {if (!isTableExistsError(ex)) {throw ex;} else {LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists.");<extra_id_0>}} finally {stmt.close();</CONTEXT>
verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
54,555
<BUG>helper.oClass(OCLASS_NAME, HistoricEventHandler.OCLASS_NAME)</BUG><CONTEXT>super(schemaClass);}@Overridepublic void applySchema(OSchemaHelper helper) {super.applySchema(helper);<extra_id_0>.oProperty("durationInMillis", OType.LONG, 110).oProperty("startTime", OType.DATETIME, 120).oProperty("endTime", OType.DATETIME, 130);</CONTEXT>
helper.oClass(OCLASS_NAME, HistoricEventHandler.OCLASS_NAME).domain(OClassDomain.SYSTEM)
18,513
<BUG>PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY,PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,</BUG><CONTEXT>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,<extra_id_0>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,</CONTEXT>
PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION,PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,
4,814
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;public class S3AFileSystem extends FileSystem {</BUG><CONTEXT>import org.apache.hadoop.fs.FileSystem;import org.apache.hadoop.fs.LocalFileSystem;import org.apache.hadoop.fs.Path;import org.apache.hadoop.fs.permission.FsPermission;import org.apache.hadoop.util.Progressable;<extra_id_0>private URI uri;private Path workingDir;private AmazonS3Client s3;</CONTEXT>
import static org.apache.hadoop.fs.s3a.Constants.*;public class S3AFileSystem extends FileSystem {
64,485
<BUG>import java.io.IOException;import org.junit.After;</BUG><CONTEXT>package org.neo4j.server.rest;import static org.junit.Assert.assertEquals;<extra_id_0>import org.junit.Before;import org.junit.Test;import org.neo4j.server.NeoServer;</CONTEXT>
import javax.ws.rs.core.MediaType;import org.junit.After;
9,787
<BUG>MemoEntry._ID + " DESC", null);</BUG><CONTEXT>MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)});}public Cursor selectMemo(long topicId) {Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null,<extra_id_0>if (c != null) {c.moveToFirst();}</CONTEXT>
MemoEntry.COLUMN_ORDER + " ASC", null);
8,265
<CONTEXT>import javax.persistence.Temporal;</BUG>import javax.persistence.TemporalType;import javax.validation.constraints.NotNull;import org.literacyapp.model.BaseEntity;import org.literacyapp.model.Contributor;<extra_id_0>import javax.persistence.TemporalType;import javax.validation.constraints.NotNull;import org.literacyapp.model.BaseEntity;import org.literacyapp.model.Contributor;<BUG>@Entitypublic class ContributorEvent extends BaseEntity {</BUG>@NotNull@ManyToOne</CONTEXT>
package org.literacyapp.model.contributor;import java.util.Calendar;import javax.persistence.ManyToOne;import javax.persistence.MappedSuperclass;import javax.persistence.Temporal;@MappedSuperclasspublic abstract class ContributorEvent extends BaseEntity {
29,421
<BUG>public final class FoxGuardMain {public final Cause pluginCause = Cause.builder().named("plugin", this).build();private static FoxGuardMain instanceField;</BUG><CONTEXT>@Dependency(id = "foxcore")},description = "A world protection plugin built for SpongeAPI. Requires FoxCore.",authors = {"gravityfox"},url = "https://github.com/FoxDenStudio/FoxGuard")<extra_id_0>@Injectprivate Logger logger;</CONTEXT>
private static FoxGuardMain instanceField;
7,057
<BUG>myModelProperty = new WritableModelProperty<T>(getCellId() + "_" + node.getNodeId().toString(), getContext().getOperationContext().getProject()) {</BUG><CONTEXT>import jetbrains.jetpad.mapper.Synchronizers;public abstract class PropertyMapperCell<T> extends AbstractJetpadCell {private WritableModelProperty<T> myModelProperty;public PropertyMapperCell(EditorContext editorContext, SNode node) {super(editorContext, node);<extra_id_0>protected T getModelPropertyValue() {return getModelPropertyValueImpl();}</CONTEXT>
myModelProperty = new WritableModelProperty<T>(getCellId() + "_" + node.getNodeId().toString(), getContext().getRepository()) {
57,905
<BUG>if (caseA) {for (int h = 0; h < dstHeight; h++) {</BUG><CONTEXT>final int pixelStride = dst.getPixelStride();final int[] bandOffsets = dst.getBandOffsets();final short[][] data = dst.getShortDataArrays();final float[] warpData = new float[2 * dstWidth];int lineOffset = 0;<extra_id_0>int pixelOffset = lineOffset;lineOffset += lineStride;warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);</CONTEXT>
if(hasROI && !roiContainsTile && roiIter == null){throw new IllegalArgumentException("Error on creating the ROI iterator");}if (caseA || (caseB && roiContainsTile)) {for (int h = 0; h < dstHeight; h++) {
62,148
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataShort;</BUG><CONTEXT>weight &= (0xffff - (1 << 4 * h + z));}}}if (weight == 0 || tmpROI == 0) {<extra_id_0>} else {for (int h = 0; h < KERNEL_LINE_DIM; h++) {long tempSum = 0;</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataShort[k2];
38,515
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;</BUG><CONTEXT>dstPixelOffset += dstPixelStride;}if (setDestinationNoData && clipMinX <= clipMaxX) {for (int x = clipMaxX; x < dst_max_x; x++) {for (int k2 = 0; k2 < dst_num_bands; k2++)<extra_id_0>dstPixelOffset += dstPixelStride;}}</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
54,371
<CONTEXT>}return attachmentUri;}</BUG>public static Attachment createAttachment(ObjectFactory objectFactory, URI baseUri,<extra_id_0>public static Attachment createAttachment(ObjectFactory objectFactory, URI baseUri,<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,XWiki xwikiApi, Boolean withPrettyNames){</BUG>Attachment attachment = objectFactory.createAttachment();fillAttachment(attachment, objectFactory, baseUri, xwikiAttachment, xwikiRelativeUrl, xwikiAbsoluteUrl,</CONTEXT>
com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,{
5,208
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat;</BUG><CONTEXT>w01 = noData.contains(s01) ? 0 : 1;w10 = noData.contains(s10) ? 0 : 1;w11 = noData.contains(s11) ? 0 : 1;if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {if (setDestinationNoData) {<extra_id_0>}} else {double result = computeValue(s00, s01, s10, s11, w00, w01, w10,</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
53,047
<CONTEXT></BUG>@RequestMapping(method = RequestMethod.POST)public ResponseEntity<Void> makeOrder(@RequestBody Product product) {OrderModel orderModel = orderBackend.createOrder();orderModel = orderBackend.addOrderedItem(orderModel.getId(),<extra_id_0>@RequestMapping(method = RequestMethod.POST)public ResponseEntity<Void> makeOrder(@RequestBody Product product) {OrderModel orderModel = orderBackend.createOrder();orderModel = orderBackend.addOrderedItem(orderModel.getId(),<BUG>new ProductModel(product.name, product.getProductID()));</BUG>AffordanceBuilder location = linkTo(methodOn(this.getClass()).getOrder(orderModel.getId()));HttpHeaders headers = new HttpHeaders();headers.setLocation(location.toUri());</CONTEXT>
public class OrderController {@Autowiredprivate OrderBackend orderBackend;@Autowiredprivate OrderAssembler orderAssembler;@ResourceHandler(Cardinality.COLLECTION)new ProductModel(product.name, product.productID));
10,173
<BUG>case APPLIES_TO_VERSION:builder.addAppliesTo(value);break;</BUG><CONTEXT>final int count = reader.getAttributeCount();for (int i = 0; i < count; i++) {final String value = reader.getAttributeValue(i);final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));switch (attribute) {<extra_id_0>case RESULTING_VERSION:if(type == Patch.PatchType.CUMULATIVE) {</CONTEXT>
[DELETED]
46,088
<BUG>protected Void invokeToResult() {runTask();</BUG><CONTEXT>if(structureUpdateTask != null) {structureUpdateTask.structureInfo.awaitUpdatedData();}}@Override<extra_id_0>return null;}protected void runTask() {</CONTEXT>
protected Void invoke() {runTask();
50,682
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;</BUG><CONTEXT>dstPixelOffset += dstPixelStride;}if (setDestinationNoData && clipMinX <= clipMaxX) {for (int x = clipMaxX; x < dst_max_x; x++) {for (int k2 = 0; k2 < dst_num_bands; k2++)<extra_id_0>dstPixelOffset += dstPixelStride;}}</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
69,649
<BUG>}public static void deleteDatabaseFiles() {</BUG><CONTEXT>if (nextReconnectAttempt < System.currentTimeMillis()) {nextReconnectAttempt = System.currentTimeMillis() + reconnectDelay;reconnectDelay = reconnectDelay * useExponentialBackOff;}}<extra_id_0>deleteDatabaseFiles(DEFAULT_DATABASE_NAME, true);}public static void deleteDatabaseFiles(String dbName, boolean now) {</CONTEXT>
public static void deleteDatabaseFiles() {
63,580
<BUG>import java.io.IOException;import java.util.HashMap;import java.util.Map;import org.apache.commons.httpclient.methods.GetMethod;</BUG><CONTEXT>package org.apache.sling.launchpad.webapp.integrationtest;<extra_id_0>import org.apache.sling.commons.testing.integration.HttpTestBase;</CONTEXT>
import java.util.Arrays;import java.util.Collections;import java.util.List;import org.apache.commons.httpclient.NameValuePair;import org.apache.commons.httpclient.methods.GetMethod;
13,799
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;</BUG><CONTEXT>dstPixelOffset += dstPixelStride;}if (setDestinationNoData && clipMinX <= clipMaxX) {for (int x = clipMaxX; x < dst_max_x; x++) {for (int k2 = 0; k2 < dst_num_bands; k2++)<extra_id_0>dstPixelOffset += dstPixelStride;}}</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
64,498
<BUG>Element e = new MyBuilder().ahref( "http://www.google.com" ).img( "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" ).end().end().build();body.appendChild( e );</BUG><CONTEXT>TodoItemRepository repository = new TodoItemRepository(BEAN_FACTORY);ApplicationElement application = new ApplicationElement(repository, i18n);Element body = Browser.getDocument().getBody();body.appendChild(application.asElement());body.appendChild(new FooterElement(i18n).asElement());<extra_id_0>History.addValueChangeHandler(event -> application.filter(event.getValue()));</CONTEXT>
[DELETED]
43,664
<BUG>ChinaPhoneHelper.setStatusBar(this,true);</BUG><CONTEXT>}@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_memo);<extra_id_0>topicId = getIntent().getLongExtra("topicId", -1);if (topicId == -1) {finish();</CONTEXT>
ChinaPhoneHelper.setStatusBar(this, true);
69,786
<BUG>SilverTrace.warn("kmelia", "KmeliaSessionController.copyTopic","Security alert from user " + getUserId() + ", trying to copy topic " + id);throw new ClipboardException("kmelia", SilverTrace.TRACE_LEVEL_INFO,</BUG><CONTEXT>ServiceProvider.getService(NodeAccessController.class);if (nodeAccessController.isUserAuthorized(getUserId(), nodeDetail.getNodePK())) {NodeSelection nodeSelect = new NodeSelection(getNodeHeader(id));addClipboardSelection(nodeSelect);} else {<extra_id_0>"Security purpose : access to node is forbidden");</CONTEXT>
SilverLogger.getLogger(this).warn("Security alert from user {0} trying to copy topic {1}", getUserId(), id);throw new ClipboardException("kmelia", SilverpeasException.WARNING,
15,410
<BUG>ArrayList<Hotel> hotels = getAllHotels();for(Hotel hotel : hotels){if(!hotel.isOwner(uuid))hotels.remove(hotel);}hotels.trimToSize();return hotels;</BUG><CONTEXT>for(World w : worlds)hotels.addAll(getHotelsInWorld(w));return hotels;}public static ArrayList<Hotel> getHotelsOwnedBy(UUID uuid){<extra_id_0>}</CONTEXT>
ArrayList<Hotel> owned = new ArrayList<Hotel>();if(hotel.isOwner(uuid))owned.add(hotel);return owned;
27,393
<BUG>LocusReferenceView referenceView = new LocusReferenceView( dataProvider );</BUG><CONTEXT>logger.debug(String.format("TraverseLoci.traverse Genomic interval is %s", shard.getGenomeLoc()));if ( !(walker instanceof LocusWalker) )throw new IllegalArgumentException("Walker isn't a loci walker!");LocusWalker<M, T> locusWalker = (LocusWalker<M, T>)walker;LocusView locusView = getLocusView( walker, dataProvider );<extra_id_0>ReferenceOrderedView referenceOrderedDataView = new ReferenceOrderedView( dataProvider );while( locusView.hasNext() ) {AlignmentContext locus = locusView.next();</CONTEXT>
LocusReferenceView referenceView = new LocusReferenceView( walker, dataProvider );
26,287
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat;</BUG><CONTEXT>dstPixelOffset += dstPixelStride;}if (setDestinationNoData && clipMinX <= clipMaxX) {for (int x = clipMaxX; x < dst_max_x; x++) {for (int k2 = 0; k2 < dst_num_bands; k2++)<extra_id_0>dstPixelOffset += dstPixelStride;}}</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
46,246
<BUG>cronField.getExpression().asString(), DateTime.now()</BUG><CONTEXT>private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class);public EveryFieldValueGenerator(CronField cronField) {super(cronField);log.trace(String.format("processing \"%s\" at %s",<extra_id_0>));}@Override</CONTEXT>
cronField.getExpression().asString(), ZonedDateTime.now()
66,743
<BUG>String accessKey = conf.get(ACCESS_KEY, null);String secretKey = conf.get(SECRET_KEY, null);</BUG><CONTEXT>public void initialize(URI name, Configuration conf) throws IOException {super.initialize(name, conf);uri = URI.create(name.getScheme() + "://" + name.getAuthority());workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri,this.getWorkingDirectory());<extra_id_0>String userInfo = name.getUserInfo();</CONTEXT>
String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null));String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
19,245
<BUG>stream.newLineAtOffset(textX, textY);stream.showText(text);</BUG><CONTEXT>public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {try {stream.setFont(textConfig.getFont(), textConfig.getFontSize());stream.setNonStrokingColor(textConfig.getColor());stream.beginText();<extra_id_0>} catch (Exception e) {LOG.warn("Could not add text: " + e.getClass() + " - " + e.getMessage());}</CONTEXT>
stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY));stream.showText(text);
20,081
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;</BUG><CONTEXT>dstPixelOffset += dstPixelStride;}if (setDestinationNoData && clipMinX <= clipMaxX) {for (int x = clipMaxX; x < dst_max_x; x++) {for (int k2 = 0; k2 < dst_num_bands; k2++)<extra_id_0>dstPixelOffset += dstPixelStride;}}</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
33,350
<BUG>return ImmutableList.of("region", "handler").stream().filter(new StartsWithPredicate(parse.current.token))</BUG><CONTEXT>.excludeCurrent(true).autoCloseQuotes(true).parse();if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {if (parse.current.index == 0)<extra_id_0>.map(args -> parse.current.prefix + args).collect(GuavaCollectors.toImmutableList());else if (parse.current.index > 0) {</CONTEXT>
return Stream.of("region", "handler").filter(new StartsWithPredicate(parse.current.token))
23,512
<BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;import com.google.atap.tangoservice.TangoConfig;</BUG><CONTEXT>package com.projecttango.examples.java.helloareadescription;import com.google.atap.tangoservice.Tango;<extra_id_0>import com.google.atap.tangoservice.TangoCoordinateFramePair;import com.google.atap.tangoservice.TangoErrorException;import com.google.atap.tangoservice.TangoEvent;</CONTEXT>
import com.google.atap.tangoservice.TangoAreaDescriptionMetaData;import com.google.atap.tangoservice.TangoConfig;
29,656
<BUG>import com.infinityraider.agricraft.api.adapter.IAgriAdapterRegistry;import java.util.concurrent.ConcurrentLinkedDeque;</BUG><CONTEXT>package com.infinityraider.agricraft.apiimpl;import java.util.Deque;import com.infinityraider.agricraft.api.adapter.IAgriAdapter;<extra_id_0>public class AdapterRegistry<T> implements IAgriAdapterRegistry<T> {private final Deque<IAgriAdapter<T>> adapters = new ConcurrentLinkedDeque<>();@Override</CONTEXT>
import java.util.Optional;import java.util.concurrent.ConcurrentLinkedDeque;
30,977
<BUG>return this.bool(ActionChainManager.scheduleScriptRuns(</BUG><CONTEXT>timeout = 120;}ScriptActionDetails script = ActionManager.createScript(uid, gid, (long) timeout,new String(DatatypeConverter.parseBase64Binary(scriptBody)));Date date = new Date();<extra_id_0>c.getUser(), systems,String.format("Remote Script at %s",SimpleDateFormat.getDateInstance(</CONTEXT>
return c.cleanup(this.bool(ActionChainManager.scheduleScriptRuns(
45,542
<BUG>private Vector<String> ddVarNames;private Vector<String> synchs; // list of action names</BUG><CONTEXT>private JDDNode[] varColRangeDDs; // dd giving range for each module variable (in col vars)private JDDNode[] varIdentities; // identity matrix for each module variableprivate JDDNode[] ddSynchVars; // individual dd vars for synchronising actionsprivate JDDNode[] ddSchedVars; // individual dd vars for scheduling non-det.private JDDNode[] ddChoiceVars; // individual dd vars for local non-det.<extra_id_0>private JDDNode transActions; // dd for transition action labels (MDPs)private Vector<JDDNode> transPerAction; // dds for transition action labels (D/CTMCs)private JDDNode[] labelsArray;</CONTEXT>
private ModelVariablesDD modelVariables;private Vector<String> synchs; // list of action names
10,670
<BUG>import com.bc.ceres.core.ProgressMonitor;public class CloudShadowOp extends MerisBasisOp {</BUG><CONTEXT>import org.esa.beam.framework.gpf.annotations.TargetProduct;import org.esa.beam.gpf.operators.meris.MerisBasisOp;import org.esa.beam.util.ProductUtils;import org.esa.beam.util.RectangleExtender;import org.esa.beam.util.math.MathUtils;<extra_id_0>private static final int MEAN_EARTH_RADIUS = 6372000;private static final int MAX_ITER = 5;private static final double DIST_THRESHOLD = 1 / 740.0;</CONTEXT>
import java.awt.Rectangle;public class CloudShadowOp extends MerisBasisOp {
43,583
<BUG>font = resolveStandard14Name(split[1]);color = new Color(Integer.valueOf(split[2].substring(1), 16));</BUG><CONTEXT>public PdfTextStyle(String config) {Assert.hasText(config);String[] split = config.split(",");Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000");fontSize = Integer.parseInt(split[0]);<extra_id_0>}public int getFontSize() {return fontSize;</CONTEXT>
font = getFont(split[1]);color = new Color(Integer.valueOf(split[2].substring(1), 16));
22,195
<BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[1]);if (handler == null)throw new ArgumentParseException(Text.of("No handler exists with that name!"), parse.args[1], 1);if (handler instanceof GlobalHandler)</BUG><CONTEXT>source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region");return CommandResult.success();} else if (isIn(HANDLERS_ALIASES, parse.args[0])) {if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));<extra_id_0>throw new CommandException(Text.of("You may not delete the global handler!"));</CONTEXT>
Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]);if (!handlerOpt.isPresent())IHandler handler = handlerOpt.get();if (handler instanceof GlobalHandler)
57,805
<BUG>putWasTriggeredByEdge(processVertex, parentVertex, "0", null, PROC_FS, getOperation(SYSCALL.UNKNOWN));}Map<String, ArtifactIdentity> fds = getFileDescriptors(currentPID);</BUG><CONTEXT>Process processVertex = createProcessFromProcFS(currentPID); //createaddProcess(currentPID, processVertex);//add to memoryputVertex(processVertex);//add to bufferProcess parentVertex = getProcess(processVertex.getAnnotation("ppid"));if (parentVertex != null) {<extra_id_0>if (fds != null) {</CONTEXT>
WasTriggeredBy childToParent = new WasTriggeredBy(processVertex, parentVertex);putEdge(childToParent, getOperation(SYSCALL.UNKNOWN), "0", null, PROC_FS);Map<String, ArtifactIdentifier> fds = getFileDescriptors(currentPID);
2,100
<BUG>{expression.emitOn(generator,null); //TODO MvG - FIGURE OUT the types.</BUG><CONTEXT>final Label $after = new Label();generator.emit(this, BRANCH, $absent);generator.emit(this, SAVE_PARSE_POSITION);assert sequence.argumentsAreReordered != Boolean.TRUE;for (final Expression expression : sequence.expressions)<extra_id_0>}</CONTEXT>
expression.emitOn(generator, ListNodeTypeDescriptor.empty());
18,593
<BUG>this.categories = new ArrayList<Category>();}</BUG><CONTEXT>private List<Category> categories;public News(List<Category> categories) {this.categories = categories;}public News() {<extra_id_0>public List<Category> getCategories() {return categories;}</CONTEXT>
this.categories = new ArrayList<>();
61,360
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh").in(() -> task1)</BUG><CONTEXT>}@RootTaskstatic Task<Exec.Result> exec(String parameter, int number) {Task<String> task1 = MyTask.create(parameter);Task<Integer> task2 = Adder.create(number, number + 2);<extra_id_0>.in(() -> task2).process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\"")));}</CONTEXT>
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class).in(() -> task1)
56,995
<BUG>rgb = Picture.create(pic.getWidth(), pic.getHeight(), RGB);transform.transform(pic.toPicture(8), rgb);AWTUtil.toBufferedImage(rgb, bi);</BUG><CONTEXT>} elsegopSize++;if (bi == null)bi = new BufferedImage(pic.getWidth(), pic.getHeight(), BufferedImage.TYPE_3BYTE_BGR);if (rgb == null)<extra_id_0>int framePresentationIndex = (pic.getPOC() >> 1) + prevGopsSize;</CONTEXT>
rgb = Picture8Bit.create(pic.getWidth(), pic.getHeight(), RGB);transform.transform(pic, rgb);rgbToBgr.transform(rgb, rgb);AWTUtil.toBufferedImage8Bit(rgb, bi);
39,747
<BUG>}}</BUG><CONTEXT>}@Overridepublic void lazyRegisterMBean(Object object, String name) {lazyPlatformMBeanServer.lazyRegisterMBean(object, name);}<extra_id_0></CONTEXT>
void initEmbeddedServer() throws Exception {if (simpleRepoModule == null) {return;
32,534
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat;</BUG><CONTEXT>s_ix = startPts[0].x;s_iy = startPts[0].y;if (setDestinationNoData) {for (int x = dst_min_x; x < clipMinX; x++) {for (int k2 = 0; k2 < dst_num_bands; k2++)<extra_id_0>dstPixelOffset += dstPixelStride;}} else</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
6,300
<BUG>Element refList = dkEncr.encryptForExternalRef(null, encrParts);this.addDerivedKeyElement(refList);return dkEncr;</BUG><CONTEXT>.getEncryptionDerivedKeyLength() / 8);dkEncr.prepare(saaj.getSOAPPart());Element encrDKTokenElem = null;encrDKTokenElem = dkEncr.getdktElement();addDerivedKeyElement(encrDKTokenElem);<extra_id_0>} catch (Exception e) {policyNotAsserted(recToken, e);</CONTEXT>
if (atEnd) {this.insertBeforeBottomUp(refList);} else {}return dkEncr;
33,744
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);minX = src.getMinX() + 1; // Left paddingmaxX = src.getMaxX() - 2; // Right paddingminY = src.getMinY() + 1; // Top paddingmaxY = src.getMaxY() - 2; // Bottom padding</BUG><CONTEXT>minX = src.getMinX();maxX = src.getMaxX();minY = src.getMinY();maxY = src.getMaxY();} else {<extra_id_0>}</CONTEXT>
iterSource = getRandomIterator(src, null);minX = src.getMinX() + leftPad; // Left paddingmaxX = src.getMaxX() - rightPad; // Right paddingminY = src.getMinY() + topPad; // Top paddingmaxY = src.getMaxY() - bottomPad; // Bottom padding
45,872
<CONTEXT>v.vibrate(pattern, vibrateIndefinitely);return v;</BUG>}catch(Exception e){if(LOG_ENABLE)<extra_id_0>}catch(Exception e){if(LOG_ENABLE)<BUG>Log.w(TAG, "Vibration exception (" + e.getMessage() + "). Remember to set permission android.permission.VIBRATE in your manifest application file.");</BUG>}return null;}@SuppressWarnings("deprecation")</CONTEXT>
}else{Log.i(TAG, "Device can not vibrate.");return v;Log.e(TAG, "Vibration exception (" + e.getMessage() + "). Remember to set permission android.permission.VIBRATE in your manifest application file.");
42,171
<BUG>return Task.ofType(String.class).named("Enums", enm).process(enm::toString);</BUG><CONTEXT>assertThat(parsedEnum, is(CustomEnum.BAR));}@RootTaskpublic static Task<String> enums(CustomEnum enm) {parsedEnum = enm;<extra_id_0>}@Testpublic void shouldParseCustomTypes() throws Exception {</CONTEXT>
return Task.named("Enums", enm).ofType(String.class).process(enm::toString);
10,315
<BUG>Log.w(TAG, "The GCM registration message is missing error information, registration id, and unregistration " +</BUG><CONTEXT>} else if (registrationId != null) {Appboy.getInstance(context).registerAppboyPushMessages(registrationId);} else if (intent.hasExtra(GCM_UNREGISTERED_KEY)) {Appboy.getInstance(context).unregisterAppboyPushMessages();} else {<extra_id_0>"confirmation. Ignoring.");return false;}</CONTEXT>
AppboyLogger.w(TAG, "The GCM registration message is missing error information, registration id, and unregistration " +
61,945
<BUG>import com.kiminonawa.mydiary.shared.ThemeManager;import java.util.List;public class MemoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements EditMode {</BUG><CONTEXT>import android.widget.RelativeLayout;import android.widget.TextView;import com.kiminonawa.mydiary.R;import com.kiminonawa.mydiary.db.DBManager;import com.kiminonawa.mydiary.shared.EditMode;<extra_id_0>private List<MemoEntity> memoList;</CONTEXT>
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
65,610
<BUG>debug(" P for " + subList + ": %.20f\n", thisP);if (phraseCount == 0) {debug(" # zero matches for '%s'\n", subList);} else {</BUG><CONTEXT>for (int i = 2; i <= context.size(); i++) {List<String> subList = context.subList(0, i);long phraseCount = lm.getCount(subList);double thisP = (double) (phraseCount + 1) / (firstWordCount + 1);maxCoverage++;<extra_id_0>coverage++;</CONTEXT>
debug(" P for " + subList + ": %.20f (%d)\n", thisP, phraseCount);if (phraseCount > 0) {
30,300
<BUG>IRegion region = FGManager.getInstance().getRegion(entry.getKey());if (region != null) {logger.info("Loading links for region \"" + region.getName() + "\"");</BUG><CONTEXT>public synchronized void loadRegionLinks() {logger.info("Loading region links");try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) {Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();linksMap.entrySet().forEach(entry -> {<extra_id_0>String handlersString = entry.getValue();</CONTEXT>
Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());if (regionOpt.isPresent()) {IRegion region = regionOpt.get();logger.info("Loading links for region \"" + region.getName() + "\"");
69,604
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat;</BUG><CONTEXT>weight &= (0xffff - (1 << 4 * h + z));}}}if (weight == 0 || tmpROI == 0) {<extra_id_0>} else {for (int h = 0; h < KERNEL_LINE_DIM; h++) {double tempSum = 0;</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
55,881
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef").process(() -> instanceField + " causes an outer reference");</BUG><CONTEXT>assertEquals(des.id().name(), "Baz");assertEquals(val.awaitAndGet(), "[9999] hello 10004");}@Test(expected = NotSerializableException.class)public void shouldNotSerializeWithInstanceFieldReference() throws Exception {<extra_id_0>serialize(task);}@Test</CONTEXT>
Task<String> task = Task.named("WithRef").ofType(String.class).process(() -> instanceField + " causes an outer reference");
18,642
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;</BUG><CONTEXT>dstPixelOffset += dstPixelStride;}if (setDestinationNoData && clipMinX <= clipMaxX) {for (int x = clipMaxX; x < dst_max_x; x++) {for (int k2 = 0; k2 < dst_num_bands; k2++)<extra_id_0>dstPixelOffset += dstPixelStride;}}</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
40,157
<BUG>public void addDefaultImports(@NotNull Collection<JetImportDirective> directives) {directives.add(JetPsiFactory.createImportDirective(project, new ImportPath("js.*")));directives.add(JetPsiFactory.createImportDirective(project, new ImportPath("java.lang.*")));directives.add(JetPsiFactory.createImportDirective(project, new ImportPath(JetStandardClasses.STANDARD_CLASSES_FQNAME, true)));directives.add(JetPsiFactory.createImportDirective(project, new ImportPath("kotlin.*")));</BUG><CONTEXT>private JsConfiguration(@NotNull Project project, @Nullable BindingContext contextToBaseOn) {this.project = project;this.contextToBaseOn = contextToBaseOn;}@Override<extra_id_0>}</CONTEXT>
[DELETED]
4,698
<BUG>private final double[][] input_hidden_weights = new double[][]{</BUG><CONTEXT>+4.332827e-01, +4.453712e-01, -2.355489e-01, +4.329192e-02,-3.259577e-02, +4.245090e-01, -1.132328e-01, +2.511418e-01,-1.995074e-01, +1.797701e-01, -3.817864e-01, +2.854951e-01,},};<extra_id_0>{-5.127986e-01, +5.872741e-01, +4.411426e-01, +1.344507e+00,-7.758738e-01, -7.235078e-01, +2.421909e+00, +1.923607e-02,</CONTEXT>
private static final double[][] input_hidden_weights = new double[][]{
34,478
<BUG>Log.e(TAG, "Failed to create notification.", e);</BUG><CONTEXT>Notification notification = null;IAppboyNotificationFactory appboyNotificationFactory = AppboyNotificationUtils.getActiveNotificationFactory();try {notification = appboyNotificationFactory.createNotification(appConfigurationProvider, context, admExtras, appboyExtras);} catch(Exception e) {<extra_id_0>return false;}if (notification == null) {</CONTEXT>
AppboyLogger.e(TAG, "Failed to create notification.", e);
40,334
<BUG>package com.cronutils.model.time.generator;import com.cronutils.mapper.WeekDay;</BUG><CONTEXT><extra_id_0>import com.cronutils.model.field.CronField;import com.cronutils.model.field.CronFieldName;import com.cronutils.model.field.constraint.FieldConstraintsBuilder;</CONTEXT>
import java.time.LocalDate;import java.util.Collections;import java.util.List;import java.util.Set;import org.apache.commons.lang3.Validate;import com.cronutils.mapper.WeekDay;
68,934
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;</BUG><CONTEXT>s_ix = startPts[0].x;s_iy = startPts[0].y;if (setDestinationNoData) {for (int x = dst_min_x; x < clipMinX; x++) {for (int k2 = 0; k2 < dst_num_bands; k2++)<extra_id_0>dstPixelOffset += dstPixelStride;}} else</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
38,888
<BUG>import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest;import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest;import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest;import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest;import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest;import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;</BUG><CONTEXT>import org.apache.sling.jcr.resource.JcrResourceConstants;import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl;import org.apache.sling.jcr.resource.internal.helper.MapEntries;import org.apache.sling.jcr.resource.internal.helper.Mapping;import org.apache.sling.performance.annotation.PerformanceTestSuite;<extra_id_0>import org.junit.runner.RunWith;</CONTEXT>
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest;import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
17,520
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;</BUG><CONTEXT>s_ix = startPts[0].x;s_iy = startPts[0].y;if (setDestinationNoData) {for (int x = dst_min_x; x < clipMinX; x++) {for (int k2 = 0; k2 < dst_num_bands; k2++)<extra_id_0>dstPixelOffset += dstPixelStride;}} else</CONTEXT>
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
7,048
<BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback) {this.mActivity = activity;</BUG><CONTEXT>private DBManager dbManager;private boolean isEditMode = false;private EditMemoDialogFragment.MemoCallback callback;private static final int TYPE_HEADER = 0;private static final int TYPE_ITEM = 1;<extra_id_0>this.topicId = topicId;this.memoList = memoList;</CONTEXT>
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {super(recyclerView);this.mActivity = activity;
54,648
<BUG>private static DOMSource createFlowXml(Map<String, Object> topLevelYaml) throws IOException, ConfigurationChangeException {</BUG><CONTEXT>writer.flush();writer.close();}}}<extra_id_0>try {final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();docFactory.setNamespaceAware(true);</CONTEXT>
private static DOMSource createFlowXml(ConfigSchema configSchema) throws IOException, ConfigurationChangeException {
25,616
<BUG>parseGeoPoints(parser, geoPoints);</BUG><CONTEXT>String currentName = parser.currentName();while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {if (token == XContentParser.Token.FIELD_NAME) {currentName = parser.currentName();} else if (token == XContentParser.Token.START_ARRAY) {<extra_id_0>fieldName = currentName;} else if (token == XContentParser.Token.START_OBJECT) {if ("nested_filter".equals(currentName) || "nestedFilter".equals(currentName)) {</CONTEXT>
GeoDistanceSortBuilder.parseGeoPoints(parser, geoPoints);
55,968
<BUG>@Test(groups = "Integration", dependsOnMethods = { "testCanStartAndStopAReplicaSet" })public void testWriteToMasterAndReadFromSecondary() {</BUG><CONTEXT>public void testCanStartAndStopAReplicaSet() {final MongoDBReplicaSet replicaSet = makeAndStartReplicaSet(3, "can-start-and-stop");replicaSet.stop();assertFalse(replicaSet.getAttribute(Startable.SERVICE_UP));}<extra_id_0>final MongoDBReplicaSet replicaSet = makeAndStartReplicaSet(3, "master-write-secondary-read");final String documentId = MongoDBTestHelper.insert(replicaSet.getPrimary(), "meaning-of-life", 42);Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT), new Runnable() {</CONTEXT>
@Test(groups = "Integration")public void testWriteToMasterAndReadFromSecondary() {
12,600
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);minX = src.getMinX() + 1; // Left paddingmaxX = src.getMaxX() - 2; // Right paddingminY = src.getMinY() + 1; // Top paddingmaxY = src.getMaxY() - 2; // Bottom padding</BUG><CONTEXT>minX = src.getMinX();maxX = src.getMaxX();minY = src.getMinY();maxY = src.getMaxY();} else {<extra_id_0>}</CONTEXT>
iterSource = getRandomIterator(src, null);minX = src.getMinX() + leftPad; // Left paddingmaxX = src.getMaxX() - rightPad; // Right paddingminY = src.getMinY() + topPad; // Top paddingmaxY = src.getMaxY() - bottomPad; // Bottom padding
14
<CONTEXT>if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) {mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics);mCameraPoseTimestamp = lastFramePose.timestamp;</BUG>} else {<extra_id_0>} else {<BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread);}</BUG>}}}@Override</CONTEXT>
mRenderer.updateRenderCameraPose(lastFramePose);mCameraPoseTimestamp = lastFramePose.timestamp;Log.w(TAG, "Can't get device pose at time: " +
40,263
<BUG>parseGeoPoints(parser, geoPoints);</BUG><CONTEXT>String currentName = parser.currentName();while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {if (token == XContentParser.Token.FIELD_NAME) {currentName = parser.currentName();} else if (token == XContentParser.Token.START_ARRAY) {<extra_id_0>fieldName = currentName;} else if (token == XContentParser.Token.START_OBJECT) {if ("nested_filter".equals(currentName) || "nestedFilter".equals(currentName)) {</CONTEXT>
GeoDistanceSortBuilder.parseGeoPoints(parser, geoPoints);
2,590
<BUG>this.privateKey = keyPair.getPrivate();</BUG><CONTEXT>public void setUp() throws Exception {final KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("EC");final SecureRandom random = SecureRandom.getInstance("SHA1PRNG");keyPairGenerator.initialize(256, random);final KeyPair keyPair = keyPairGenerator.generateKeyPair();<extra_id_0>}@Testpublic void testAuthenticationTokenSupplier() throws Exception {</CONTEXT>
this.privateKey = (ECPrivateKey) keyPair.getPrivate();
5,397
<BUG>return value;</BUG><CONTEXT>this.value = value;return result;}public int setAndGet(final int value) {this.value = value;<extra_id_0>}public void increment() {value++;</CONTEXT>
return this;public int getAndSet(final int value) {final int result = this.value;return this.value;