id
int64 2
70k
| bug_ctx
stringlengths 58
37.5k
| fixed
stringlengths 1
37k
|
---|---|---|
3,578 |
<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);
|
59,362 |
<BUG>ADDED_MODULE("added-module"),BUNDLES("bundles"),</BUG><CONTEXT>private static final String PATH_DELIMITER = "/";public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;enum Element {ADDED_BUNDLE("added-bundle"),ADDED_MISC_CONTENT("added-misc-content"),<extra_id_0>CUMULATIVE("cumulative"),DESCRIPTION("description"),MISC_FILES("misc-files"),</CONTEXT>
|
APPLIES_TO_VERSION("applies-to-version"),BUNDLES("bundles"),
|
28,686 |
<BUG>byte[] fileData = IOUtils.getBytesFromStream(FileUtils.openInputStream(libPath));</BUG><CONTEXT>jos.closeEntry();}}private static boolean checksumValid(File libPath, List<String> checksums) {try {<extra_id_0>boolean valid = (checksums == null) || (checksums.isEmpty()) || (checksums.contains(DigestUtils.sha1Hex(fileData)));if ((!valid) && (libPath.getName().endsWith(".jar")))valid = validateJar(libPath, fileData, checksums);</CONTEXT>
|
byte[] fileData = IOUtils.readFully(FileUtils.openInputStream(libPath)).toByteArray();
|
21,588 |
<BUG>list(make(a(PARAGRAPH, with(CHILDREN, list(runWithText("Knock knock"),make(a(RUN, with(CHILDREN, list(new NoteReference(NoteType.FOOTNOTE, "4")))))))))),</BUG><CONTEXT>deepEquals(list(Html.element("a", map("id", "doc-42-start"), list(Html.FORCE_WRITE)))));}@Testpublic void noteReferencesAreConvertedToLinksToReferenceBodyAfterMainBody() {Document document = new Document(<extra_id_0>new Notes(list(new Note(NoteType.FOOTNOTE, "4", list(paragraphWithText("Who's there?"))))));</CONTEXT>
|
list(paragraph(withChildren(run(withChildren(new NoteReference(NoteType.FOOTNOTE, "4")))))),
|
55,097 |
<BUG>}String version = Versions.getVersion(gaugeConfig);for (GaugeConfig loopConfig : configs) {if (Versions.getVersion(loopConfig.toProto()).equals(version)) {throw new IllegalStateException("This exact gauge already exists");}}configs.add(GaugeConfig.create(gaugeConfig));</BUG><CONTEXT>List<GaugeConfig> configs = Lists.newArrayList(configService.getGaugeConfigs());for (GaugeConfig loopConfig : configs) {if (loopConfig.mbeanObjectName().equals(gaugeConfig.getMbeanObjectName())) {throw new DuplicateMBeanObjectNameException();}<extra_id_0>configService.updateGaugeConfigs(configs);</CONTEXT>
|
[DELETED]
|
27,832 |
<BUG>if (n <= m) {for (int i = 0; i < n; i++) {for (int j = 0; j < m; j++) {</BUG><CONTEXT>}}});}} else {<extra_id_0>a[i][j] = operator.applyAsBoolean(a[i][j]);}</CONTEXT>
|
public boolean[] row(final int rowIndex) {N.checkArgument(rowIndex >= 0 && rowIndex < n, "Invalid row Index: %s", rowIndex);return a[rowIndex];
|
42,770 |
<BUG>final StandaloneEquivalentSyntheticModel equivalentModel =new StandaloneEquivalentSyntheticModel(this.configuration, this.processorTemplateHandler, this.context, this, gatheredSkipBody, gatheredSkipCloseTagByLevel, processorExecutionVars);equivalentModel.gatherOpenElement(openTag);</BUG><CONTEXT>final CloseElementTag closeTag =new CloseElementTag(standaloneElementTag.templateMode, standaloneElementTag.elementDefinition,standaloneElementTag.elementCompleteName, null, standaloneElementTag.synthetic, false,standaloneElementTag.templateName, standaloneElementTag.line, standaloneElementTag.col);<extra_id_0>equivalentModel.gatherCloseElement(closeTag);</CONTEXT>
|
final GatheredSyntheticModel equivalentModel =new GatheredSyntheticModel(this.configuration, this.processorTemplateHandler, this.context,this, this.templateFlowController,equivalentModel.gatherOpenElement(openTag);
|
41,398 |
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataShort;</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]] = destinationNoDataShort[k2];
|
57,609 |
<BUG>import android.support.design.widget.FloatingActionButton;import android.support.v7.widget.Toolbar;</BUG><CONTEXT>import android.os.Handler;import android.os.Looper;import android.os.PowerManager;import android.os.PowerManager.WakeLock;import android.preference.PreferenceManager;<extra_id_0>import android.util.Log;import android.view.ContextMenu;import android.view.KeyEvent;</CONTEXT>
|
import android.support.v4.view.MenuItemCompat;import android.support.v7.widget.Toolbar;
|
55,253 |
<BUG>import com.intellij.psi.*;import com.intellij.psi.tree.IElementType;</BUG><CONTEXT>import com.siyeh.ig.psiutils.VariableAccessUtils;import com.siyeh.ig.psiutils.ParenthesesUtils;import com.siyeh.ig.psiutils.ComparisonUtils;import com.siyeh.InspectionGadgetsBundle;import com.intellij.codeInsight.daemon.GroupNames;<extra_id_0>import org.jetbrains.annotations.Nullable;import org.jetbrains.annotations.NotNull;public class LoopConditionNotUpdatedInsideLoopInspection</CONTEXT>
|
import com.intellij.psi.util.PsiUtil;import com.intellij.psi.tree.IElementType;
|
14,164 |
<BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair;import com.google.atap.tangoservice.TangoEvent;</BUG><CONTEXT>package com.projecttango.examples.java.augmentedreality;import com.google.atap.tangoservice.Tango;import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;import com.google.atap.tangoservice.TangoCameraIntrinsics;import com.google.atap.tangoservice.TangoConfig;<extra_id_0>import com.google.atap.tangoservice.TangoOutOfDateException;import com.google.atap.tangoservice.TangoPoseData;import com.google.atap.tangoservice.TangoXyzIjData;</CONTEXT>
|
import com.google.atap.tangoservice.TangoErrorException;import com.google.atap.tangoservice.TangoEvent;
|
4,300 |
<BUG>public void initializeImages( int width , int height ) {graySrc = new ImageFloat32(width,height);</BUG><CONTEXT>paintWideLine.setColor(Color.RED);paintWideLine.setStrokeWidth(3);textPaint.setColor(Color.BLUE);textPaint.setTextSize(60);}<extra_id_0>grayDst = new ImageFloat32(width,height);bitmapSrc = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);bitmapDst = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);</CONTEXT>
|
if( graySrc != null && graySrc.width == width && graySrc.height == height )return;graySrc = new ImageFloat32(width,height);
|
64,812 |
<BUG>if (BuildConfig.DEBUG) {Log.w(LOGTAG, "Unable to update friendship", result.getException());}</BUG><CONTEXT>@Overridepublic void afterExecute(Bus handler, SingleResponse<Relationship> result) {if (result.hasData()) {handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData()));} else if (result.hasException()) {<extra_id_0>}</CONTEXT>
|
public UserKey[] getAccountKeys() {return DataStoreUtils.getActivatedAccountKeys(context);
|
4,865 |
<BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey),new InstanceProfileCredentialsProvider(),new S3AAnonymousAWSCredentialsProvider());</BUG><CONTEXT>} else {accessKey = userInfo;}}AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain(<extra_id_0>bucket = name.getHost();</CONTEXT>
|
new BasicAWSCredentialsProvider(accessKey, secretKey),new AnonymousAWSCredentialsProvider()
|
43,376 |
<BUG>import java.util.logging.Logger;import org.apache.commons.lang.StringUtils;</BUG><CONTEXT>import java.lang.reflect.Method;import java.util.ArrayList;import java.util.List;import java.util.Map;import java.util.Map.Entry;<extra_id_0>import org.jibx.runtime.BindingDirectory;import org.jibx.runtime.IBindingFactory;import org.jibx.runtime.IMarshallingContext;</CONTEXT>
|
import eu.europeana.corelib.solr.entity.*;import org.apache.commons.lang.StringUtils;
|
38,612 |
<BUG>craftingWindowButton = addButton(GuiImageButton.newRefreshButton(1, guiLeft - 18, guiTop + 5));explosiveWindowButton = addButton(GuiImageButton.newRefreshButton(2, guiLeft - 18, guiTop + 5 + 19));triggerWindowButton = addButton(GuiImageButton.newRefreshButton(3, guiLeft - 18, guiTop + 5 + 19 * 2));otherWindowButton = addButton(GuiImageButton.newRefreshButton(4, guiLeft - 18, guiTop + 5 + 19 * 3));switch (id)</BUG><CONTEXT>}@Overridepublic void initGui(){super.initGui();<extra_id_0>{</CONTEXT>
|
craftingWindowButton = addButton(GuiImageButton.newButton18(1, guiLeft - 18, guiTop + 5, 0, 0).setTexture(Assets.GUI_BUTTONS));explosiveWindowButton = addButton(GuiImageButton.newButton18(2, guiLeft - 18, guiTop + 5 + 19, 1, 0).setTexture(Assets.GUI_BUTTONS));triggerWindowButton = addButton(GuiImageButton.newButton18(3, guiLeft - 18, guiTop + 5 + 19 * 2, 3, 0).setTexture(Assets.GUI_BUTTONS));autocraftingButton = addButton(GuiImageButton.newButton18(4, guiLeft - 18, guiTop + 5 + 19 * 3, 2, 0).setTexture(Assets.GUI_BUTTONS));switch (id)
|
15,725 |
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt;</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]] = destinationNoDataInt[k2];
|
60,783 |
<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];
|
2,944 |
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat;</BUG><CONTEXT>int w11 = w11index < roiDataLength ? roiDataArray[w11index] & 0xff : 0;if (baseIndex > roiDataLength || w00 == 0|| (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0)) {if (setDestinationNoData) {for (int k2 = 0; k2 < dst_num_bands; k2++) {<extra_id_0>}}} else {</CONTEXT>
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
|
41,989 |
<BUG>} catch (Exception e) {skNew();</BUG><CONTEXT>userName = user;skOpen(path, name);} else {skNew();}<extra_id_0>}}public void doPlay() {</CONTEXT>
|
userName = "default";
|
663 |
<BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {private View rootView;private TextView TV_memo_item_content;</BUG><CONTEXT>editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment");}});}}<extra_id_0>private ImageView IV_memo_item_delete;</CONTEXT>
|
protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener {private ImageView IV_memo_item_dot;private TextView TV_memo_item_content;
|
4,929 |
<BUG>if (BuildConfig.DEBUG) {Log.w(LOGTAG, e);}</BUG><CONTEXT>for (Location location : twitter.getAvailableTrends()) {map.put(location);}return map.pack();} catch (final MicroBlogException e) {<extra_id_0>}</CONTEXT>
|
DebugLog.w(LOGTAG, null, e);
|
8,857 |
<BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty;import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG><CONTEXT>package jfxtras.labs.icalendarfx.components;import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment;<extra_id_0>import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates;import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;</CONTEXT>
|
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
|
35,718 |
<CONTEXT>}public Calendar(String id, CalendarType type) {super(id);</BUG>timeZone = TimeZone.getDefault().getID();locale = Locale.getDefault().getISO3Country();<extra_id_0>timeZone = TimeZone.getDefault().getID();locale = Locale.getDefault().getISO3Country();<BUG>if (type != null) {setCalendarType(type);}</BUG>}public String getName() {</CONTEXT>
|
public Calendar(String compositeId) {super(compositeId);
|
1,501 |
<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
|
2,861 |
<BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent);return db.update(</BUG><CONTEXT>MemoEntry._ID + " = ?",new String[]{String.valueOf(memoId)});}public long updateMemoContent(long memoId, String memoContent) {ContentValues values = new ContentValues();<extra_id_0>MemoEntry.TABLE_NAME,values,MemoEntry._ID + " = ?",</CONTEXT>
|
return db.update(
|
52,563 |
<BUG>import net.blay09.mods.excompressum.registry.compressor.CompressedRecipeRegistry;import net.minecraft.entity.item.EntityItem;</BUG><CONTEXT>import cofh.api.energy.IEnergyReceiver;import com.google.common.collect.HashMultiset;import com.google.common.collect.Multiset;import net.blay09.mods.excompressum.config.AutomationConfig;import net.blay09.mods.excompressum.registry.compressor.CompressedRecipe;<extra_id_0>import net.minecraft.item.ItemStack;import net.minecraft.nbt.NBTTagCompound;import net.minecraft.util.EnumFacing;</CONTEXT>
|
import net.blay09.mods.excompressum.utils.DefaultItemHandler;import net.blay09.mods.excompressum.utils.ItemHandlerAutomation;import net.minecraft.entity.item.EntityItem;
|
36,182 |
<BUG>if (card != null && game.getState().getZone(sourceId).equals(Zone.GRAVEYARD)) {</BUG><CONTEXT>@Overridepublic boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {Player controller = game.getPlayer(controllerId);if (controller != null) {Card card = game.getCard(sourceId);<extra_id_0>controller.moveCardToExileWithInfo(card, null, "", sourceId, game, Zone.GRAVEYARD, true);paid = true;}</CONTEXT>
|
if (card != null && game.getState().getZone(sourceId) == Zone.GRAVEYARD) {
|
40,461 |
<BUG>final ICommonsMap <String, Object> ret = new CommonsHashMap <> ();ret.put (PersistenceUnitProperties.CONNECTION_POOL_MAX,</BUG><CONTEXT>@Nonnull@ReturnsMutableCopyprivate static Map <String, Object> _createPropertiesMap (){final ConfigFile aConfigFile = SMPServerConfiguration.getConfigFile ();<extra_id_0>aConfigFile.getAsString (SMPJPAConfiguration.CONFIG_JDBC_READ_CONNECTIONS_MAX));ret.put (PersistenceUnitProperties.DDL_GENERATION, PersistenceUnitProperties.DROP_AND_CREATE);ret.put (PersistenceUnitProperties.DDL_GENERATION_MODE,</CONTEXT>
|
final ICommonsMap <String, Object> ret = new CommonsHashMap<> ();ret.put (PersistenceUnitProperties.CONNECTION_POOL_MAX,
|
31,913 |
<BUG>assertTrue(Arrays.equals(new long[] {9, 8}, ret));ret = Arrays.copyOf(a1, a1.length * 2);</BUG><CONTEXT>long[] a1 = {9, 8, 7, 5, 1, 2, -1037, 3, 4, 0};long[] ret = Arrays.copyOf(a1, a1.length);assertNotSame(a1, ret);assertTrue(Arrays.equals(a1, ret));ret = Arrays.copyOf(a1, 2);<extra_id_0>assertEquals(a1.length * 2, ret.length);int i = 0;for (; i < a1.length; i++) {</CONTEXT>
|
ret = Arrays.copyOf(a1, 0);assertEquals(0, ret.length);ret = Arrays.copyOf(a1, a1.length * 2);
|
31,339 |
<BUG>import org.jboss.weld.environment.se.WeldContainer;import org.junit.Test;</BUG><CONTEXT>package ws.ament.hammock.web.tomcat;import org.apache.commons.io.IOUtils;import org.apache.deltaspike.core.impl.config.ConfigurationExtension;import org.apache.deltaspike.core.impl.config.DefaultConfigPropertyProducer;import org.jboss.weld.environment.se.Weld;<extra_id_0>import ws.ament.hammock.web.spi.FilterDescriptor;import ws.ament.hammock.web.spi.ServletDescriptor;import ws.ament.hammock.web.spi.WebServerConfiguration;</CONTEXT>
|
import org.jboss.weld.manager.BeanManagerImpl;import org.junit.Test;
|
52,184 |
<BUG>import de.vanita5.twittnuker.util.DataStoreUtils;import de.vanita5.twittnuker.util.ImagePreloader;</BUG><CONTEXT>import de.vanita5.twittnuker.receiver.NotificationReceiver;import de.vanita5.twittnuker.service.LengthyOperationsService;import de.vanita5.twittnuker.util.ActivityTracker;import de.vanita5.twittnuker.util.AsyncTwitterWrapper;import de.vanita5.twittnuker.util.DataStoreFunctionsKt;<extra_id_0>import de.vanita5.twittnuker.util.InternalTwitterContentUtils;import de.vanita5.twittnuker.util.JsonSerializer;import de.vanita5.twittnuker.util.NotificationManagerWrapper;</CONTEXT>
|
import de.vanita5.twittnuker.util.DebugLog;import de.vanita5.twittnuker.util.ImagePreloader;
|
54,406 |
<BUG>import java.security.NoSuchAlgorithmException;import java.util.ArrayList;import java.util.Collections;import java.util.List;</BUG><CONTEXT>import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.security.DigestOutputStream;import java.security.MessageDigest;<extra_id_0>public final class PatchUtils {</CONTEXT>
|
import java.text.DateFormat;import java.util.Date;import java.util.List;
|
31,924 |
<BUG>public void intern(CstNat nat) {</BUG><CONTEXT>return already;}strings.put(value, string);return string;}<extra_id_0>intern(nat.getName());intern(nat.getDescriptor());}</CONTEXT>
|
public synchronized void intern(CstNat nat) {
|
14,734 |
<BUG>private List<RepoFileDto> repoFileDtos;public RepositoryDto getRepositoryDto() {</BUG><CONTEXT>import javax.xml.bind.annotation.XmlRootElement;@XmlRootElementpublic class ChangeSetDto {private RepositoryDto repositoryDto;private List<ModificationDto> modificationDtos;<extra_id_0>return repositoryDto;}public void setRepositoryDto(RepositoryDto repositoryDto) {</CONTEXT>
|
private ConfigPropSetDto parentConfigPropSetDto;public RepositoryDto getRepositoryDto() {
|
48,513 |
<BUG>.moveToElement(getItem(beforeValue), -3, 0).perform();</BUG><CONTEXT>labelInput.sendKeys(newLabel + Keys.RETURN);}public void moveBefore(String valueToMove, String beforeValue){new Actions(getDriver().getWrappedDriver()).clickAndHold(getItem(valueToMove))<extra_id_0>}public WebElement getItem(String valueOrLabel){</CONTEXT>
|
.moveToElement(getItem(beforeValue), -3, 0).release().perform();
|
51,927 |
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat;</BUG><CONTEXT>pixelKernel[h][z] = srcDataArrays[k2][pos + (z - 1)tmpROI += roiIter.getSample(x0 + h - 1, y0 + z - 1, 0) & 0xff;}}if (tmpROI == 0) {<extra_id_0>} else {for (int h = 0; h < KERNEL_LINE_DIM; h++) {float tempSum = 0;</CONTEXT>
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
|
59,410 |
<BUG>Logger.getLogger(TextureBrowser.class.getName()).finer("Looking for Texture: " + texture.getName());</BUG><CONTEXT>jTree1.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);jTree1.addTreeSelectionListener(this);}private void setSelectedTexture(Texture texture) {if (texture != null) {<extra_id_0>String[] path = ("/" + texture.getName()).split("/");TreePath parent = new TreePath((TreeNode) jTree1.getModel().getRoot());TreePath selectedTreePath = TreeUtil.buildTreePath(jTree1, parent, path, 0, true);</CONTEXT>
|
Logger.getLogger(TextureBrowser.class.getName()).log(Level.FINER, "Looking for Texture: {0}", texture.getName());
|
69,596 |
<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];
|
58,427 |
<BUG>log("Failed: " + ExceptionsHelper.detailedMessage(e));</BUG><CONTEXT>downloadHelper.download(pluginUrl, pluginFile, progress, this.timeout);downloaded = true;} catch (ElasticsearchTimeoutException e) {throw e;} catch (Exception e) {<extra_id_0>}} else {if (PluginHandle.isOfficialPlugin(pluginHandle.repo, pluginHandle.user, pluginHandle.version)) {</CONTEXT>
|
terminal.println("Failed: %s", ExceptionsHelper.detailedMessage(e));
|
25,764 |
<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);
|
40,173 |
<BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent);return db.update(</BUG><CONTEXT>MemoEntry._ID + " = ?",new String[]{String.valueOf(memoId)});}public long updateMemoContent(long memoId, String memoContent) {ContentValues values = new ContentValues();<extra_id_0>MemoEntry.TABLE_NAME,values,MemoEntry._ID + " = ?",</CONTEXT>
|
return db.update(
|
56,769 |
<BUG>ADDED_MODULE("added-module"),BUNDLES("bundles"),</BUG><CONTEXT>private static final String PATH_DELIMITER = "/";public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;enum Element {ADDED_BUNDLE("added-bundle"),ADDED_MISC_CONTENT("added-misc-content"),<extra_id_0>CUMULATIVE("cumulative"),DESCRIPTION("description"),MISC_FILES("misc-files"),</CONTEXT>
|
APPLIES_TO_VERSION("applies-to-version"),BUNDLES("bundles"),
|
8,040 |
<BUG>ADDED_MODULE("added-module"),BUNDLES("bundles"),</BUG><CONTEXT>private static final String PATH_DELIMITER = "/";public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;enum Element {ADDED_BUNDLE("added-bundle"),ADDED_MISC_CONTENT("added-misc-content"),<extra_id_0>CUMULATIVE("cumulative"),DESCRIPTION("description"),MISC_FILES("misc-files"),</CONTEXT>
|
APPLIES_TO_VERSION("applies-to-version"),BUNDLES("bundles"),
|
29,353 |
<BUG>testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper));testCenter.addTestObject(new ResolveNonExistingWith5000VanityPathTest(helper));testCenter.addTestObject(new ResolveNonExistingWith10000VanityPathTest(helper));testCenter.addTestObject(new ResolveNonExistingWith1000AliasTest(helper));testCenter.addTestObject(new ResolveNonExistingWith5000AliasTest(helper));testCenter.addTestObject(new ResolveNonExistingWith10000AliasTest(helper));</BUG><CONTEXT>@PerformanceTestSuitepublic ParameterizedTestList testPerformance() throws Exception {Helper helper = new Helper();ParameterizedTestList testCenter = new ParameterizedTestList();testCenter.setTestSuiteTitle("jcr.resource-2.2.0");<extra_id_0>return testCenter;</CONTEXT>
|
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper, 100, 10));testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper, 100, 50));testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith10000VanityPathTest",helper, 100, 100));testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith1000AliasTest",helper, 1000));testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith5000AliasTest",helper, 5000));testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith10000AliasTest",helper, 10000));
|
34,206 |
<BUG>sink.tableCell();sink.text( version );</BUG><CONTEXT>Iterator it = artifactMap.keySet().iterator();while ( it.hasNext() ){String version = (String) it.next();sink.tableRow();<extra_id_0>sink.tableCell_();sink.tableCell();generateVersionDetails( sink, artifactMap, version );</CONTEXT>
|
sink.tableCell( String.valueOf( cellWidth ) + "px" );sink.text( version );
|
4,509 |
<BUG>CommonGapicProvider.<Interface>newBuilder().setModel(model).setView(new InterfaceView()).setContext(new RubyGapicContext(model, apiConfig, packageConfig)).setSnippetSetRunner(new RubySnippetSetRunner<Interface>(SnippetSetRunner.SNIPPET_RESOURCE_ROOT)).setSnippetFileNames(Arrays.asList("ruby/main.snip")).setCodePathMapper(rubyPathMapper)</BUG><CONTEXT>.setPrefix("lib").setShouldAppendPackage(true).setPackageFilePathNameFormatter(new RubyNameFormatter()).build();GapicProvider<? extends Object> mainProvider =<extra_id_0>.build();</CONTEXT>
|
ViewModelGapicProvider.newBuilder().setApiConfig(apiConfig).setSnippetSetRunner(new CommonSnippetSetRunner(new CommonRenderingUtil())).setModelToViewTransformer(new RubyGapicSurfaceTransformer(rubyPathMapper, packageConfig))
|
14,436 |
<CONTEXT>private static FGStorageManager instance;private final Logger logger = FoxGuardMain.instance().getLogger();</BUG>private final Set<LoadEntry> loaded = new HashSet<>();private final Path directory = getDirectory();private final Map<String, Path> worldDirectories;<extra_id_0>private final Set<LoadEntry> loaded = new HashSet<>();private final Path directory = getDirectory();private final Map<String, Path> worldDirectories;<BUG>private FGStorageManager() {defaultModifiedMap = new CacheMap<>((k, m) -> {</BUG>if (k instanceof IFGObject) {m.put((IFGObject) k, true);return true;</CONTEXT>
|
public final HashMap<IFGObject, Boolean> defaultModifiedMap;private final UserStorageService userStorageService;private final Logger logger = FoxGuardMain.instance().getLogger();userStorageService = FoxGuardMain.instance().getUserStorage();defaultModifiedMap = new CacheMap<>((k, m) -> {
|
11,775 |
<BUG>EqualsVerifier.forClass(ChangeCommand.class).usingGetClass().withPrefabValues(OsmPrimitive.class,</BUG><CONTEXT>public static void setUpBeforeClass() {JOSMFixture.createUnitTestFixture().init(false);}@Testpublic void equalsContract() {<extra_id_0>new Node(1), new Node(2)).withPrefabValues(OsmDataLayer.class,new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))</CONTEXT>
|
.withPrefabValues(DataSet.class,new DataSet(), new DataSet()).withPrefabValues(User.class,User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar")).withPrefabValues(OsmPrimitive.class,
|
50,039 |
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat;</BUG><CONTEXT>pixelKernel[h][z] = srcDataArrays[k2][pos + (z - 1)tmpROI += roiIter.getSample(x0 + h - 1, y0 + z - 1, 0) & 0xff;}}if (tmpROI == 0) {<extra_id_0>} else {for (int h = 0; h < KERNEL_LINE_DIM; h++) {float tempSum = 0;</CONTEXT>
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
|
38,044 |
<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,{
|
62,406 |
<BUG>query += "(@" + ContentModel.PROP_MODIFIED + ":[\"" + getDateAsString((Date) parameters.get(PARAMETER_DATE), DATE_FORMAT) + "T00:00:00.000Z\" TO MAX]) ";return query;</BUG><CONTEXT>}private static final String getQuery(Map<String, Object> parameters) {String query = "";query += "(TYPE:\"" + parameters.get(PARAMETER_BASETYPE) + "\") ";query += "AND ";<extra_id_0>}private final void getParameters(WebScriptRequest req) throws WrongFormatException {parameters = new HashMap<String, Object>();</CONTEXT>
|
query += "(@" + ContentModel.PROP_MODIFIED + ":[\"" + getDateAsString((Date) parameters.get(PARAMETER_DATE), DATE_FORMAT) + "\" TO MAX]) ";return query;
|
51,625 |
<BUG>import net.minecraft.world.World;public class BlockMaxHealthSetter extends BlockTestMod3 {</BUG><CONTEXT>import net.minecraft.item.ItemStack;import net.minecraft.util.EnumFacing;import net.minecraft.util.EnumHand;import net.minecraft.util.math.BlockPos;import net.minecraft.util.text.TextComponentTranslation;<extra_id_0>public BlockMaxHealthSetter() {super(Material.IRON, "maxHealthSetter");}</CONTEXT>
|
import javax.annotation.Nullable;public class BlockMaxHealthSetter extends BlockTestMod3 {
|
44,003 |
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;public class S3AOutputStream extends OutputStream {</BUG><CONTEXT>import java.io.BufferedOutputStream;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.OutputStream;<extra_id_0>private OutputStream backupStream;private File backupFile;private boolean closed;</CONTEXT>
|
import static org.apache.hadoop.fs.s3a.Constants.*;public class S3AOutputStream extends OutputStream {
|
58,267 |
<BUG>private long[] _classTypeIds = new long[0];private Layout _layout;</BUG><CONTEXT>private long[] _allCategoryIds = new long[0];private long[] _allTagIds = new long[0];private long[] _anyCategoryIds = new long[0];private long[] _anyTagIds = new long[0];private long[] _classNameIds = new long[0];<extra_id_0>private int _end = QueryUtil.ALL_POS;private boolean _excludeZeroViewCount;private Date _expirationDate;</CONTEXT>
|
private boolean _enablePermissions;private Layout _layout;
|
12,276 |
<BUG>GridSqlStatement stmt = new GridSqlQueryParser().parse(prepared);</BUG><CONTEXT>private UpdatePlanBuilder() {}public static UpdatePlan planForStatement(Prepared prepared,@Nullable Integer errKeysPos) throws IgniteCheckedException {assert !prepared.isQuery();<extra_id_0>if (stmt instanceof GridSqlMerge || stmt instanceof GridSqlInsert)return planForInsert(stmt);else</CONTEXT>
|
GridSqlStatement stmt = new GridSqlQueryParser(false).parse(prepared);
|
21,086 |
<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 {
|
46,278 |
<BUG>commands.put("add-group-repo", new AddGroupToRepositoryCliCommand());commands.put("remove-group-repo", new RemoveGroupFromRepositoryCliCommand());commands.put("add-group-org-unit", new AddGroupToOrganizationalUnitCliCommand());commands.put("remove-group-org-unit", new RemoveGroupFromOrganizationalUnitCliCommand());commands.put("add-group-project", new AddGroupToProjectCliCommand());commands.put("remove-group-project", new RemoveGroupFromProjectCliCommand());</BUG><CONTEXT>commands.put("remove-deployment", new RemoveDeploymentConfigCliCommand());commands.put("create-repo", new CreateRepositoryCliCommand());commands.put("remove-repo", new RemoveRepositoryCliCommand());commands.put("add-repo-org-unit", new AddRepositoryToOrganizationalUnitCliCommand());commands.put("remove-repo-org-unit", new RemoveRepositoryFromOrganizationalUnitCliCommand());<extra_id_0>commands.put("push-changes", new PushGitRepositoryCliCommand());</CONTEXT>
|
[DELETED]
|
66,337 |
<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++) {
|
32,632 |
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt;</BUG><CONTEXT>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = result;}}} else if (setDestinationNoData) {for (int k2 = 0; k2 < dst_num_bands; k2++) {<extra_id_0>}}if (fracx < fracdx1) {</CONTEXT>
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt[k2];
|
42,175 |
<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 {
|
9,446 |
<BUG>rsp.setValue((T)response_value);}rsp.setReceived(responseReceived);}if(responseReceived)num_valid++;done=responsesComplete() || (rsp_filter != null && !rsp_filter.needMoreResponses());</BUG><CONTEXT>num_received++;if((responseReceived=(rsp_filter == null) || rsp_filter.isAcceptable(response_value, sender))) {if(is_exception && response_value instanceof Throwable)rsp.setException((Throwable)response_value);else<extra_id_0>if(responseReceived || done)</CONTEXT>
|
rsp.setReceived(true);done=responsesComplete() || (rsp_filter != null && !rsp_filter.needMoreResponses());
|
13,481 |
<BUG>import java.util.Optional;import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG><CONTEXT>import org.spongepowered.api.world.Locatable;import org.spongepowered.api.world.Location;import org.spongepowered.api.world.World;import javax.annotation.Nullable;import java.util.List;<extra_id_0>public class CommandDelete extends FCCommandBase {private static final FlagMapper MAPPER = map -> key -> value -> {map.put(key, value);</CONTEXT>
|
import java.util.stream.Stream;import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
9,889 |
<BUG>DatabaseReference detailsRef = FirebasePaths.appendPathComponent(threadRef, BFirebaseDefines.Path.BDetailsPath);</BUG><CONTEXT>if (DEBUG) Timber.v("threadOn, EntityID: %s",threadId);if (!isListeningToThread(threadId)){threadsIds.add(threadId);final DatabaseReference threadRef = FirebasePaths.threadRef(threadId);<extra_id_0>FirebaseEventCombo combo = getCombo(threadId, detailsRef.toString(), new ThreadUpdateChangeListener(threadId, handlerThread, deferred));detailsRef.addValueEventListener(combo.getListener());}</CONTEXT>
|
DatabaseReference detailsRef = threadRef.child(BFirebaseDefines.Path.BDetailsPath);
|
863 |
<BUG>private static final MethodType INVOKE_METHOD_SIGNATURE = MethodType.methodType(Object.class, String.class, Object[].class);</BUG><CONTEXT>} catch (Exception e) {throw new GroovyBugError(e);}}private static final MethodType GENERAL_INVOKER_SIGNATURE = MethodType.methodType(Object.class, Object.class, Object[].class);<extra_id_0>private static final MethodType O2O = MethodType.methodType(Object.class, Object.class);private static final MethodHandle UNWRAP_METHOD, TO_STRING, TO_BYTE, TO_BIGINT, SAME_MC, IS_NULL, IS_NOT_NULL;static {</CONTEXT>
|
private static final MethodType INVOKE_METHOD_SIGNATURE = MethodType.methodType(Object.class, Class.class, Object.class, String.class, Object[].class, boolean.class, boolean.class);
|
35,717 |
<BUG>public Calendar(String compositeId) {this(compositeId, null);}public Calendar(String id, CalendarType type) {super(id);</BUG><CONTEXT>private boolean hasChildren = false;public static final String CALENDAR_PREF = "calendar";public Calendar() {this(CALENDAR_PREF + IdGenerator.generate());}<extra_id_0>timeZone = TimeZone.getDefault().getID();</CONTEXT>
|
super(compositeId);
|
26,788 |
<BUG>TimeUnit.SECONDS.sleep(2);</BUG><CONTEXT>ExecutorService pool = Executors.newCachedThreadPool();pool.submit(dbClient);pool.submit(dbClient);pool.submit(dbClient);pool.submit(dbClient);<extra_id_0>queryTheDb.set(false);pool.shutdown();}</CONTEXT>
|
TimeUnit.SECONDS.sleep(5);
|
58,356 |
<BUG>import android.os.Bundle;import ch.bailu.aat.description.AverageSpeedDescription;</BUG><CONTEXT>package ch.bailu.aat.activities;<extra_id_0>import ch.bailu.aat.description.CaloriesDescription;import ch.bailu.aat.description.ContentDescription;import ch.bailu.aat.description.DateDescription;</CONTEXT>
|
import android.view.View;import ch.bailu.aat.description.AverageSpeedDescription;
|
33,154 |
<BUG>public class GetUserLimitsRequest{private RequestEnvelope requestEnvelope;</BUG><CONTEXT>import com.paypal.svcs.types.common.AccountIdentifier;import java.util.List;import java.util.ArrayList;import java.io.UnsupportedEncodingException;import com.paypal.core.NVPUtil;<extra_id_0>private AccountIdentifier user;private String country;private String currencyCode;</CONTEXT>
|
private static final String nameSpace="com.paypal.svcs.types.ap";private static final String preferredPrefix="";private RequestEnvelope requestEnvelope;
|
12,533 |
<CONTEXT>}GL11.glDisable(GL11.GL_BLEND);}</BUG>public void renderQuiverBar(ItemStack quiver, float frame, int xOffset, int yOffset) {<extra_id_0>public void renderQuiverBar(ItemStack quiver, float frame, int xOffset, int yOffset) {<BUG>GL11.glEnable(GL11.GL_BLEND);GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);this.mc.renderEngine.bindTexture(resourceLocation);</BUG>int maxSlots = ((IArrowContainer2)quiver.getItem()).getSlotCount(quiver)*10;</CONTEXT>
|
RenderHelper.disableStandardItemLighting();GlStateManager.disableRescaleNormal();GlStateManager.disableBlend();GlStateManager.enableBlend();GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);this.mc.renderEngine.bindTexture(resourceLocation);
|
11,302 |
<BUG>.configRepository(simpleRepoModule.getConfigRepository()).agentRepository(simpleRepoModule.getAgentDao())</BUG><CONTEXT>.baseDir(baseDir).glowrootDir(glowrootDir).ticker(ticker).clock(clock).liveJvmService(null)<extra_id_0>.transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository()).traceAttributeNameRepository(</CONTEXT>
|
.liveJvmService(agentModule.getLiveJvmService()).agentRepository(new AgentRepositoryImpl()).environmentRepository(simpleRepoModule.getEnvironmentDao())
|
16,627 |
<BUG>Statement st = connection.createStatement();try {</BUG><CONTEXT>if (newCols.size() > 0) {if (LOG.isLoggable(Level.FINE)) {LOG.log(Level.FINE, "Table " + tableName + " needs additional columns");}for (String[] newCol : newCols) {<extra_id_0>st.executeUpdate(MessageFormat.format(ALTER_TABLE_STMT_STR,tableName, newCol[0], newCol[1]));if (LOG.isLoggable(Level.FINE)) {</CONTEXT>
|
Statement st = con.createStatement();try {
|
620 |
<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: " +
|
41,654 |
<BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);</BUG><CONTEXT>this.client = client;this.progress = progress;this.fs = fs;this.cannedACL = cannedACL;this.statistics = statistics;<extra_id_0>if (conf.get(BUFFER_DIR, null) != null) {</CONTEXT>
|
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
|
36,329 |
<CONTEXT>import java.util.List;import java.util.Map;</BUG>import static org.dalesbred.internal.utils.Primitives.wrap;import static org.dalesbred.internal.utils.TypeUtils.*;<extra_id_0>import static org.dalesbred.internal.utils.Primitives.wrap;import static org.dalesbred.internal.utils.TypeUtils.*;<BUG>final class ConversionMap {private final Map<Type, List<TypeConversion<?,?>>> mappings = new HashMap<>();</BUG>void register(@NotNull TypeConversion<?, ?> coercion) {Type source = wrap(coercion.getSource());List<TypeConversion<?,?>> items = mappings.get(source);</CONTEXT>
|
package org.dalesbred.instantiation;import org.jetbrains.annotations.NotNull;import java.lang.reflect.Type;import java.util.*;@NotNullprivate final Map<Type, List<TypeConversion<?,?>>> mappings = new HashMap<>();
|
28,918 |
<CONTEXT>import net.semanticmetadata.lire.imageanalysis.correlogram.NaiveAutoCorrelogramExtraction;</BUG>import net.semanticmetadata.lire.utils.ConversionUtils;import java.awt.image.BufferedImage;import java.awt.image.Raster;<extra_id_0>import net.semanticmetadata.lire.utils.ConversionUtils;import java.awt.image.BufferedImage;import java.awt.image.Raster;<BUG>import java.util.StringTokenizer;public class AutoColorCorrelogram implements LireFeature {private static final int DEFAULT_NUMBER_COLORS = 256;</BUG>private float quantH;</CONTEXT>
|
package net.semanticmetadata.lire.imageanalysis.features.global;import net.semanticmetadata.lire.builders.DocumentBuilder;import net.semanticmetadata.lire.imageanalysis.features.GlobalFeature;import net.semanticmetadata.lire.imageanalysis.features.LireFeature;import net.semanticmetadata.lire.imageanalysis.features.global.correlogram.DynamicProgrammingAutoCorrelogramExtraction;import net.semanticmetadata.lire.imageanalysis.features.global.correlogram.IAutoCorrelogramFeatureExtractor;import net.semanticmetadata.lire.imageanalysis.features.global.correlogram.MLuxAutoCorrelogramExtraction;import net.semanticmetadata.lire.imageanalysis.features.global.correlogram.NaiveAutoCorrelogramExtraction;public class AutoColorCorrelogram implements GlobalFeature {private static final int DEFAULT_NUMBER_COLORS = 64;
|
33,749 |
<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
|
2,634 |
<BUG>Group result = new Group (controlGroup, SWT.NONE);result.setLayoutData(new GridData (SWT.FILL, SWT.FILL, false, false));result.setText(ControlExample.getResourceString("Size"));sizeGroup = result;sizeGroup.setLayout (new GridLayout());preferredButton = new Button (sizeGroup, SWT.RADIO);</BUG><CONTEXT>rtlDirectionButton.setText ("SWT.RIGHT_TO_LEFT");autoDirectionButton = new Button (directionGroup, SWT.RADIO);autoDirectionButton.setText ("AUTO direction");}void createSizeGroup () {<extra_id_0>preferredButton.setText (ControlExample.getResourceString("Preferred"));</CONTEXT>
|
sizeGroup = new Group (controlGroup, SWT.NONE);sizeGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, false, false));sizeGroup.setText (ControlExample.getResourceString("Size"));preferredButton = new Button (sizeGroup, SWT.RADIO);
|
3,546 |
<BUG>public static final class AttrDescCite</BUG><CONTEXT>NativeAndStringValuePair verified){return AttributeVerifiers.COLOR.verifyAndConvert(parent, verified);}}<extra_id_0>extendsAttributeDescriptor{</CONTEXT>
|
return AttributeVerifiers.LCR_ALIGN.verifyAndConvert(parent, verified);public static final class AttrDescAlignLcrj
|
12,694 |
<BUG>log.debug("Received START_FLUSH at " + localAddress + " responded with FLUSH_OK");</BUG><CONTEXT>fhr.addDigest(digest);Message msg = new Message(flushStarter);msg.putHeader(getName(), fhr);down_prot.down(new Event(Event.MSG, msg));if(log.isDebugEnabled())<extra_id_0>}else{if(log.isDebugEnabled())</CONTEXT>
|
log.debug("Received START_FLUSH at " + localAddress + " responded with FLUSH_COMPLETED");
|
59,740 |
<BUG>String pagesUri = UriBuilder.fromUri(baseUri).path(PagesResource.class).build(wikiName, spaceName).toString();</BUG><CONTEXT>if (home != null) {space.setHome(home.getPrefixedFullName());space.setXwikiRelativeUrl(home.getURL("view"));space.setXwikiAbsoluteUrl(home.getExternalURL("view"));}<extra_id_0>Link pagesLink = objectFactory.createLink();pagesLink.setHref(pagesUri);pagesLink.setRel(Relations.PAGES);</CONTEXT>
|
String pagesUri = uri(baseUri, PagesResource.class, wikiName, spaceName);
|
31,255 |
<BUG>return Task.ofType(String.class).named("StandardArgs", first, second).process(() -> second + " " + first * 100);</BUG><CONTEXT>}@RootTaskpublic static Task<String> standardArgs(int first, String second) {firstInt = first;secondString = second;<extra_id_0>}@Testpublic void shouldParseFlags() throws Exception {</CONTEXT>
|
return Task.named("StandardArgs", first, second).ofType(String.class).process(() -> second + " " + first * 100);
|
47,727 |
<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 == 1) {</CONTEXT>
|
return Stream.of("region", "handler").filter(new StartsWithPredicate(parse.current.token))
|
8,326 |
<BUG>.build()).build();</BUG><CONTEXT>.workspaceSymbolProvider(true).referencesProvider(true).completionProvider(new CompletionOptionsBuilder().resolveProvider(false).triggerCharacter(".")<extra_id_0>InitializeResult result = new InitializeResultBuilder().capabilities(capabilities).build();</CONTEXT>
|
.definitionProvider(true)
|
21,882 |
<BUG>String ignoreName =_IGNORE_PREFIX + publicRenderParameter.getIdentifier();if (Validator.isNotNull(ParamUtil.getString(actionRequest, ignoreName))) {preferences.setValue(ignoreName, StringPool.TRUE);</BUG><CONTEXT>preferences.reset(name);}}for (PublicRenderParameter publicRenderParameter :portlet.getPublicRenderParameters()) {<extra_id_0>}</CONTEXT>
|
String ignoreKey =_IGNORE_PREFIX + PortletQNameUtil.getPublicRenderParameterName(publicRenderParameter.getQName());boolean ignoreValue = ParamUtil.getBoolean(actionRequest, ignoreKey);if (ignoreValue) {preferences.setValue(ignoreKey, String.valueOf(Boolean.TRUE));
|
23,796 |
<BUG>Utils.closeSilently(fileBody);if (deleteImage && "file".equals(imageUri.getScheme())) {final File file = new File(imageUri.getPath());if (!file.delete()) {Log.w(LOGTAG, String.format("Unable to delete %s", file));}</BUG><CONTEXT>FileBody fileBody = null;try {fileBody = getFileBody(context, imageUri);return twitter.updateProfileImage(fileBody);} finally {<extra_id_0>}</CONTEXT>
|
twitter.updateProfileBannerImage(fileBody);if (deleteImage) {Utils.deleteMedia(context, imageUri);
|
40,321 |
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,XWiki xwikiApi, Boolean withPrettyNames){</BUG><CONTEXT>}return historySummary;}private static void fillAttachment(Attachment attachment, ObjectFactory objectFactory, URI baseUri,<extra_id_0>Document doc = xwikiAttachment.getDocument();attachment.setId(String.format("%s@%s", doc.getPrefixedFullName(), xwikiAttachment.getFilename()));</CONTEXT>
|
com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,{
|
68,305 |
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt;</BUG><CONTEXT>int x0 = src.getX() + posx / srcPixelStride;int y0 = src.getY() + posy / srcScanlineStride;if (!roiBounds.contains(x0, y0)) {if (setDestinationNoData) {for (int k2 = 0; k2 < dst_num_bands; k2++) {<extra_id_0>}}} else {</CONTEXT>
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataInt[k2];
|
18,636 |
<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];
|
67,279 |
<BUG>chkFont.setRect(0, slots.bottom() + GAP_SML, WIDTH, BTN_HEIGHT);</BUG><CONTEXT>Game.scene().add(new WndSettings());}});}};<extra_id_0>chkFont.checked(!ShatteredPixelDungeon.classicFont());add(chkFont);}</CONTEXT>
|
chkFont.setRect(0, chkImmersive.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
42,076 |
<BUG>OperationStatus status;future = (CollectionFuture<Boolean>) mc.asyncBopInsert(key, 0, null,"hello", new CollectionAttributes());</BUG><CONTEXT>super.setUp();mc.asyncBopDelete(key, 0, 100, ElementFlagFilter.DO_NOT_FILTER, 0, true);}public void testAfterSuccess() throws Exception {CollectionFuture<Boolean> future;<extra_id_0>Boolean success = future.get(1000, TimeUnit.MILLISECONDS);status = future.getOperationStatus();</CONTEXT>
|
future = mc.asyncBopInsert(key, 0, null, "hello", new CollectionAttributes());
|
43,699 |
<BUG>public static Command getCommand(String node) {for (Command c : commands.values())if (c.getPermissionNode().equalsIgnoreCase(node))return c;return null;</BUG><CONTEXT>for (Command c : commands.values())if (c.getAliases().contains(name))return c;return null;}<extra_id_0>}</CONTEXT>
|
public static Command loadCommand(String name, String pkg) {try {String header = commands.containsKey(name.toLowerCase()) ? pkg.replace("net.mcthunder.", "").replace(".commands.", "").replace("commands.", "") + ":" : "";commands.put((header + name.toLowerCase()).trim(), (Command) Command.class.getClassLoader().loadClass(pkg + StringUtils.capitalize(name)).newInstance());return commands.get((header + name.toLowerCase()).trim());} catch (Exception ignored) { }
|
18,197 |
<BUG>if (BuildConfig.DEBUG) {Log.w(LOGTAG, e);}</BUG><CONTEXT>MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId);if (!Utils.isOfficialCredentials(context, accountId)) continue;try {microBlog.setActivitiesAboutMeUnread(cursor);} catch (MicroBlogException e) {<extra_id_0>}</CONTEXT>
|
DebugLog.w(LOGTAG, null, e);
|
35,033 |
<BUG>private boolean consumed = false;</BUG><CONTEXT>{private String value;private Payload payload;private CharTermAttribute termAttribute;private PayloadAttribute payloadAttribute;<extra_id_0>public SingletonTokenStream(){termAttribute = addAttribute(CharTermAttribute.class);</CONTEXT>
|
private volatile boolean consumed = false;
|
24,530 |
<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;
|
41,262 |
<BUG>if (tag.selected)label.getChildAt(0).setBackgroundResource(R.color.colorPrimary);elselabel.getChildAt(0).setBackgroundResource(R.color.dimgray);</BUG><CONTEXT>notifyItemChanged(position);if (mItemClickListener != null)mItemClickListener.onItemClick(v, position);}});<extra_id_0>}</CONTEXT>
|
[DELETED]
|
29,557 |
<BUG>public Status(String code) {this.code = code;</BUG><CONTEXT>static {ModuleRegistry.registerModule(Status.class.getName(), config, null);}public Status() {}<extra_id_0>Map<String, Object> map = (Map<String, Object>)config.get(code);if(map != null) {this.statusCode = (Integer)map.get("statusCode");</CONTEXT>
|
public Status(final String code, final Object... args) {this.code = code;
|
8,878 |
<BUG>objects.align(Align.left);mainActors.add(objects);</BUG><CONTEXT>panes.put(visualEffectsComponent.getClass().getSimpleName(), visualEffects);ObjectsComponent objectsComponent = new ObjectsComponent(skin, ui);objectsComponent.setSceneGraph(sg);objectsComponent.initialize();CollapsiblePane objects = new CollapsiblePane(ui, txt("gui.objects"), objectsComponent.getActor(), skin, false);<extra_id_0>panes.put(objectsComponent.getClass().getSimpleName(), objects);GaiaComponent gaiaComponent = new GaiaComponent(skin, ui);gaiaComponent.initialize();</CONTEXT>
|
objects.align(Align.left).columnAlign(Align.left);mainActors.add(objects);
|
18,860 |
<CONTEXT>.toString();</BUG>Link homeLink = objectFactory.createLink();homeLink.setHref(homeUri);homeLink.setRel(Relations.HOME);space.getLinks().add(homeLink);<extra_id_0>Link homeLink = objectFactory.createLink();homeLink.setHref(homeUri);homeLink.setRel(Relations.HOME);space.getLinks().add(homeLink);<BUG>}String searchUri =UriBuilder.fromUri(baseUri).path(SpaceSearchResource.class).build(wikiName, spaceName).toString();</BUG>Link searchLink = objectFactory.createLink();searchLink.setHref(searchUri);</CONTEXT>
|
Link pagesLink = objectFactory.createLink();pagesLink.setHref(pagesUri);pagesLink.setRel(Relations.PAGES);space.getLinks().add(pagesLink);if (home != null) {String homeUri = uri(baseUri, PageResource.class, wikiName, spaceName, home.getName());String searchUri = uri(baseUri, SpaceSearchResource.class, wikiName, spaceName);
|
53,184 |
<BUG>predicates = new ArrayList<>(cores);if (toTest.args().isEmpty()) {predicates = predicates.stream().filter(x -> !x.id().equals(toTest.id())).collect(Collectors.toList());}</BUG><CONTEXT>.findFirst();if (!o.isPresent()) {throw new IllegalArgumentException("No specification for " + name);}toTest = o.get();<extra_id_0>}</CONTEXT>
|
[DELETED]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.