id
int64 2
70k
| bug_ctx
stringlengths 58
37.5k
| fixed
stringlengths 1
37k
|
---|---|---|
68,532 | <CONTEXT>.build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(),xwikiObject.getClassName(),xwikiObject.getNumber()).toString();</BUG>} else {<extra_id_0>} else {<BUG>propertiesUri =UriBuilder.fromUri(baseUri).path(ObjectPropertiesResource.class).build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(),xwikiObject.getNumber()).toString();</BUG>}</CONTEXT> | fillObjectSummary(objectSummary, objectFactory, baseUri, doc, xwikiObject, xwikiApi, withPrettyNames);Link objectLink = getObjectLink(objectFactory, baseUri, doc, xwikiObject, useVersion, Relations.OBJECT);objectSummary.getLinks().add(objectLink);String propertiesUri;if (useVersion) {uri(baseUri, ObjectPropertiesAtPageVersionResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber());uri(baseUri, ObjectPropertiesResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),xwikiObject.getClassName(), xwikiObject.getNumber()); |
8,659 | <BUG>return getWebManager((ServletContext)wapp.getNativeContext());}</BUG><CONTEXT>if (webman == null)throw new UiException("The Web manager not found. Make sure <load-on-startup> is specified for "+DHtmlLayoutServlet.class.getName());return webman;}public static final WebManager getWebManager(WebApp wapp) {<extra_id_0>public static final WebManager getWebManagerIfAny(ServletContext ctx) {return (WebManager)ctx.getAttribute(ATTR_WEB_MANAGER);}</CONTEXT> | return getWebManager(wapp.getServletContext()); |
27,818 | <BUG>sink.tableHeaderCell();sink.text( getI18nString( locale, "stats.dependencies" ) + ":" );sink.tableHeaderCell_();</BUG><CONTEXT>sink.tableCell();sink.text( String.valueOf( reactorProjects.size() ) );sink.tableCell_();sink.tableRow_();sink.tableRow();<extra_id_0>sink.tableCell();sink.text( String.valueOf( depCount ) );</CONTEXT> | sink.tableHeaderCell( headerCellWidth );sink.text( getI18nString( locale, "stats.dependencies" ) );sink.tableHeaderCell_(); |
65,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);twitter.updateProfileBackgroundImage(fileBody, tile);} finally {<extra_id_0>}</CONTEXT> | twitter.updateProfileBannerImage(fileBody);if (deleteImage) {Utils.deleteMedia(context, imageUri); |
54,944 | <BUG>import com.google.common.collect.Sets;import io.druid.query.aggregation.post.PostAggregatorIds;</BUG><CONTEXT>package io.druid.query.aggregation.histogram;import com.fasterxml.jackson.annotation.JsonCreator;import com.fasterxml.jackson.annotation.JsonProperty;import com.fasterxml.jackson.annotation.JsonTypeName;<extra_id_0>import io.druid.query.cache.CacheKeyBuilder;import java.util.Arrays;import java.util.Map;</CONTEXT> | import io.druid.query.aggregation.AggregatorFactory;import io.druid.query.aggregation.PostAggregator;import io.druid.query.aggregation.post.PostAggregatorIds; |
65,905 | <CONTEXT>{return super.getVariableResolver(name);</BUG>}<extra_id_0>}<BUG>else{return null;}}}</BUG></CONTEXT> | addAlias(alias.getKey(), alias.getValue());for (Entry<String, Function> function : functions.entrySet()) |
7,748 | <BUG>contours.add(BoundaryPolyCirculinearCurve2D.create(elements, true));</BUG><CONTEXT>pos2 = nextValue(positions.get(ind), pos1);addElements(elements, curveArray[ind].subCurve(pos1, pos2));pos1 = twinPositions.get(ind).remove(pos2);ind = twinIndices.get(ind).remove(pos2);} while (pos1 != pos0 || ind != ind0);<extra_id_0>}return contours;}</CONTEXT> | contours.add(BoundaryPolyCirculinearCurve2D.create(elements.toArray(new CirculinearElement2D[0]), true)); |
17,311 | <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); |
43,144 | <BUG>{private List reactorProjects;private static final int PERCENTAGE = 100;</BUG><CONTEXT>import java.util.Locale;import java.util.Map;import java.util.TreeMap;public class DependencyConvergenceReportextends AbstractProjectInfoReport<extra_id_0>public String getOutputName(){</CONTEXT> | private static final int PERCENTAGE = 100;private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() ); |
24,111 | <BUG>generateLegend( locale, sink );generateStats( locale, sink, dependencyMap );generateConvergence( locale, sink, dependencyMap );sink.section1_();</BUG><CONTEXT>sink.section1();sink.sectionTitle1();sink.text( getI18nString( locale, "title" ) );sink.sectionTitle1_();Map dependencyMap = getDependencyMap();<extra_id_0>sink.body_();</CONTEXT> | sink.lineBreak();sink.section1_(); |
8,108 | <BUG>public class CustomAnalyzerProvider extends AbstractAnalyzerProvider<CustomAnalyzer> {</BUG><CONTEXT>import org.elasticsearch.util.settings.ImmutableSettings;import org.elasticsearch.util.settings.Settings;import java.util.List;import java.util.Map;import static org.elasticsearch.util.collect.Lists.*;<extra_id_0>private final TokenizerFactory tokenizerFactory;private final TokenFilterFactory[] tokenFilterFactories;private final CustomAnalyzer customAnalyzer;</CONTEXT> | public class CustomAnalyzerProvider extends AbstractIndexAnalyzerProvider<CustomAnalyzer> { |
24,281 | <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() + "\""); |
27,745 | <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; |
20,378 | <BUG>super("tileCamo", Material.rock);</BUG><CONTEXT>import net.minecraft.util.IIcon;public class TileSimpleCamo extends TileEnt implements IPacketReceiver {ItemStack stack = null;boolean locked = false;public TileSimpleCamo() {<extra_id_0>this.itemBlock = ItemBlockCamo.class;this.setTextureName(MilitaryBaseDecor.PREFIX + "camo_simple");}</CONTEXT> | super("camo_simple", Material.rock); |
7,597 | <BUG>return new LinkDescriptorBuilder().page(TitlesPage.class).build();</BUG><CONTEXT>import fr.openwide.core.wicket.more.link.descriptor.IPageLinkDescriptor;import fr.openwide.core.wicket.more.link.descriptor.builder.LinkDescriptorBuilder;public class TitlesPage extends MainTemplate {private static final long serialVersionUID = 182545144170932682L;public static final IPageLinkDescriptor linkDescriptor() {<extra_id_0>}</CONTEXT> | return LinkDescriptorBuilder.start().page(TitlesPage.class); |
46,633 | <BUG>public static void initConfig(String filepath) throws IOException,FileNotFoundException {</BUG><CONTEXT>} catch (IOException ioe) {LoggingManager.debug(BaseService.class, ioe.getMessage(), ioe);throw ioe;}}<extra_id_0>try {File file = new File(filepath);</CONTEXT> | public static void initConfig(String filepath) throws IOException { |
66,484 | <BUG>import org.mariotaku.twidere.util.DataStoreUtils;import org.mariotaku.twidere.util.ImagePreloader;</BUG><CONTEXT>import org.mariotaku.twidere.receiver.NotificationReceiver;import org.mariotaku.twidere.service.LengthyOperationsService;import org.mariotaku.twidere.util.ActivityTracker;import org.mariotaku.twidere.util.AsyncTwitterWrapper;import org.mariotaku.twidere.util.DataStoreFunctionsKt;<extra_id_0>import org.mariotaku.twidere.util.InternalTwitterContentUtils;import org.mariotaku.twidere.util.JsonSerializer;import org.mariotaku.twidere.util.NotificationManagerWrapper;</CONTEXT> | import org.mariotaku.twidere.util.DebugLog;import org.mariotaku.twidere.util.ImagePreloader; |
45,230 | <BUG>public M getMethodOf(N n);public List<N> getSuccsOf(N n);</BUG><CONTEXT>package heros;import java.util.Collection;import java.util.List;import java.util.Set;public interface InterproceduralCFG<N,M> {<extra_id_0>public Collection<M> getCalleesOfCallAt(N n);public Collection<N> getCallersOf(M m);public Set<N> getCallsFromWithin(M m);</CONTEXT> | public List<N> getPredsOf(N u);public List<N> getSuccsOf(N n); |
40,095 | <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); |
66,757 | <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); |
3,158 | <BUG>public Object parse(ParsingEngine parsingEngine,ArgumentSource source, Class type, ArgumentMatches matches) {Class componentType;</BUG><CONTEXT>public boolean supports( Class type ) {return ( Collection.class.isAssignableFrom(type) || type.isArray() );}@Override@SuppressWarnings("unchecked")<extra_id_0>Object result;</CONTEXT> | public Object parse(ParsingEngine parsingEngine,ArgumentSource source, Type fulltype, ArgumentMatches matches) {Class type = makeRawTypeIfNecessary(fulltype);Type componentType; |
60,841 | <BUG>import org.springframework.cloud.cluster.leader.Context;import org.springframework.cloud.cluster.leader.event.LeaderEventPublisher;import org.springframework.context.Lifecycle;import mousio.etcd4j.EtcdClient;</BUG><CONTEXT>import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.beans.factory.DisposableBean;import org.springframework.beans.factory.InitializingBean;import org.springframework.cloud.cluster.leader.Candidate;<extra_id_0>import mousio.etcd4j.responses.EtcdException;</CONTEXT> | import org.springframework.cloud.cluster.leader.event.DefaultLeaderEventPublisher;import org.springframework.util.Assert;import mousio.etcd4j.EtcdClient; |
45,964 | <BUG>record.setSchema(rec.getOriginalSchema());record.setSchemaType(rec.getFormat());</BUG><CONTEXT>rec.setModifiedTime(System.currentTimeMillis() / 1000);if (datasetId == 0) {DatasetRecord record = new DatasetRecord();record.setUrn(urn);record.setSourceCreatedTime("" + rec.getCreateTime() / 1000);<extra_id_0>record.setFields((String) StringUtil.objectToJsonString(rec.getFieldSchema()));</CONTEXT> | record.setSchema(rec.getOriginalSchema().getText());record.setSchemaType(rec.getOriginalSchema().getFormat()); |
1,320 | <BUG>return "MySQLConnection[" + this.dataSource.getUrl() + " : " + this.dataSource.getURL() + "]";}</BUG><CONTEXT>Debug.checkNull("mysql_connection", this.mysql_connection);return this.mysql_connection;}@Overridepublic String toString () {<extra_id_0>@Overrideprotected void finalize () throws Throwable {super.finalize();</CONTEXT> | return "MySQLConnection[" + this.mySQL.getUrl() + "]"; |
13,546 | <BUG>import java.util.stream.Collectors;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.*;<extra_id_0>public class CommandHere extends FCCommandBase {private static final String[] PRIORITY_ALIASES = {"priority", "prio", "p"};private static final FlagMapper MAPPER = map -> key -> value -> {</CONTEXT> | import java.util.stream.Stream;import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*; |
66,488 | <BUG>if (BuildConfig.DEBUG) {Log.d(HotMobiLogger.LOGTAG, "getting cached location");}</BUG><CONTEXT>}public static LatLng getCachedLatLng(@NonNull final Context context) {final Context appContext = context.getApplicationContext();final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences();if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null;<extra_id_0>final Location location = Utils.getCachedLocation(appContext);</CONTEXT> | DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null); |
54,073 | <BUG>else if (StringUtil.startsWithIgnoreCase(trimmed, BEFORE_STR)) myBefore.add(trimmed.substring(BEFORE_STR.length()));else if (StringUtil.startsWithIgnoreCase(trimmed, AFTER_STR)) myAfter.add(trimmed.substring(AFTER_STR.length()));else throw new AssertionError("Invalid specification: " + trimmed + "; should be one of FIRST, LAST, BEFORE <id> or AFTER <id>");</BUG><CONTEXT>final String[] strings = text.split(",");for (final String string : strings) {String trimmed = string.trim();if (trimmed.equalsIgnoreCase(FIRST_STR)) myFirst = true;else if (trimmed.equalsIgnoreCase(LAST_STR)) myLast = true;<extra_id_0>}</CONTEXT> | else if (StringUtil.startsWithIgnoreCase(trimmed, BEFORE_STR)) myBefore.add(trimmed.substring(BEFORE_STR.length()).trim());else if (StringUtil.startsWithIgnoreCase(trimmed, BEFORE_STR_OLD)) myBefore.add(trimmed.substring(BEFORE_STR_OLD.length()).trim());else if (StringUtil.startsWithIgnoreCase(trimmed, AFTER_STR)) myAfter.add(trimmed.substring(AFTER_STR.length()).trim());else if (StringUtil.startsWithIgnoreCase(trimmed, AFTER_STR_OLD)) myAfter.add(trimmed.substring(AFTER_STR_OLD.length()).trim());else throw new AssertionError("Invalid specification: " + trimmed + "; should be one of FIRST, LAST, BEFORE <id> or AFTER <id>"); |
35,098 | <BUG>private final BroadcastReceiver mMessageReceiver = new BroadcastReceiver() {@Overridepublic void onReceive(final Context context, final Intent intent) {if (intent.getIntExtra(C.MESSAGE_TYPE, -1) == C.UPDATE_REQUEST) {Log.i(TAG, "Received update request.");sendAllInfo();}}};</BUG><CONTEXT>public class BufferMonitor extends Thread implements FieldtripBufferMonitor {public static final String TAG = BufferMonitor.class.toString();private final Context context;private final SparseArray<BufferConnectionInfo> clients = new SparseArray<BufferConnectionInfo>();private final BufferInfo info;<extra_id_0>private boolean run = true;</CONTEXT> | [DELETED] |
65,339 | <BUG>Lantern.getLogger().warn("Region \"{}\" not aligned: {} increasing by {}",</BUG><CONTEXT>for (long i = this.file.length(); i < 2 * SECTOR_BYTES; ++i) {this.file.write(0);}}if ((this.file.length() & 0xfff) != 0) {<extra_id_0>path, this.file.length(), SECTOR_BYTES - (this.file.length() & 0xfff));for (long i = this.file.length() & 0xfff; i < SECTOR_BYTES; ++i) {this.file.write(0);</CONTEXT> | Lantern.getLogger().warn(REGION_FILE_MARKER, "Region \"{}\" not aligned: {} increasing by {}", |
68,997 | <BUG>import org.mariotaku.microblog.library.twitter.model.Status;import org.mariotaku.sqliteqb.library.AllColumns;</BUG><CONTEXT>import org.apache.commons.lang3.math.NumberUtils;import org.json.JSONException;import org.mariotaku.microblog.library.MicroBlog;import org.mariotaku.microblog.library.MicroBlogException;import org.mariotaku.microblog.library.twitter.model.RateLimitStatus;<extra_id_0>import org.mariotaku.sqliteqb.library.Columns;import org.mariotaku.sqliteqb.library.Columns.Column;import org.mariotaku.sqliteqb.library.Expression;</CONTEXT> | import org.mariotaku.pickncrop.library.PNCUtils;import org.mariotaku.sqliteqb.library.AllColumns; |
23,249 | <BUG>for (Player onlinePlayer : plugin.getGame().getServer().getOnlinePlayers()) {if (onlinePlayer.equals(receiver) || !onlinePlayer.canSee(receiver)) {continue;}onlinePlayer.offer(Keys.VANISH, true);</BUG><CONTEXT>plugin.sendMessage(invoker, "skin-changed");}}private void sendUpdate() {sendUpdateSelf();<extra_id_0>onlinePlayer.offer(Keys.VANISH, false);</CONTEXT> | plugin.getGame().getServer().getOnlinePlayers().stream().filter(onlinePlayer -> onlinePlayer.equals(receiver)).filter(onlinePlayer -> onlinePlayer.canSee(receiver)).forEach(onlinePlayer -> {onlinePlayer.offer(Keys.VANISH, true); |
66,041 | <BUG>if(currentAnswerOption.getSequence() == answerBean.getSequence()){</BUG><CONTEXT>Set<AnswerIfc> answerOptions = textAnswerOptions.getAnswerSet();Set<AnswerIfc> deleteAnswerOptions = new HashSet<AnswerIfc>(answerOptions);answerOptions.clear();outer: for(AnswerBean answerBean: bean.getEmiAnswerOptionsClean()){for(AnswerIfc currentAnswerOption: deleteAnswerOptions){<extra_id_0>currentAnswerOption.setText(stripPtags(answerBean.getText()));currentAnswerOption.setLabel(answerBean.getLabel());currentAnswerOption.setIsCorrect(Boolean.FALSE);</CONTEXT> | if(currentAnswerOption.getSequence().equals(answerBean.getSequence())){ |
4,372 | <BUG>static VoltProjectBuilder getBuilderForTest() throws IOException {VoltProjectBuilder builder = new VoltProjectBuilder();builder.addLiteralSchema("");return builder;}</BUG><CONTEXT>PipeToFile pf;int rport;public TestHttpPort(String name) {super(name);}<extra_id_0>@Override</CONTEXT> | [DELETED] |
44,262 | <BUG>import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.scf.rev140701.attachment.point.attachment.point.type.Interface;import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.scf.rev140701.service.function.classifiers.service.function.classifier.SclServiceFunctionForwarder;import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarder;import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;</BUG><CONTEXT>package org.opendaylight.sfc.scfofrenderer.utils;import org.opendaylight.sfc.util.openflow.transactional_writer.FlowDetails;<extra_id_0>import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;</CONTEXT> | import org.opendaylight.sfc.provider.api.SfcProviderAclAPI;import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.scf.rev140701.service.function.classifiers.ServiceFunctionClassifier;import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.Acl;import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; |
33,642 | <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;</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]] = destinationNoDataUShort[k2]; |
3,332 | <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] |
39,648 | <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 |
28,365 | <BUG>planManagerOptional.get().getPlan().getStrategy().proceed();return Response.status(Response.Status.OK)</BUG><CONTEXT>@POST@Path("/plans/{planName}/continue")public Response continueCommand(@PathParam("planName") String planName) {final Optional<PlanManager> planManagerOptional = getPlanManager(planName);if (planManagerOptional.isPresent()) {<extra_id_0>.entity(new CommandResultInfo("Received cmd: continue")).build();} else {</CONTEXT> | @Path("/plans/{planName}/stop")public Response stopPlan(@PathParam("planName") String planName) {Plan plan = planManagerOptional.get().getPlan();plan.interrupt();plan.restart();return Response.status(Response.Status.OK).entity(new CommandResultInfo("Received cmd: stop")) |
53,209 | <BUG>.setUuid(getUuid()).setHash(hash)</BUG><CONTEXT>ByteString messageBytes = message.toByteString();byte[] encBytes = AuthUtils.encrypt(messageBytes.toByteArray(), getKey());String hash = AuthUtils.createHash(getKey(), encBytes);messageBytes = ByteString.copyFrom(encBytes);Protocol.AuthenticatedMessage auth = Protocol.AuthenticatedMessage.newBuilder()<extra_id_0>.setPayload(messageBytes).build();if(!auth.isInitialized()) {</CONTEXT> | .setVersion(Bootstrap.getProtocolVersion()).setHash(hash) |
39,592 | <BUG>import org.apache.zookeeper.data.Stat;import org.testng.Assert;</BUG><CONTEXT>import java.util.Set;import java.util.concurrent.CompletableFuture;import org.apache.bookkeeper.mledger.ManagedLedger;import org.apache.commons.collections.CollectionUtils;import org.apache.commons.lang3.tuple.Pair;<extra_id_0>import org.testng.annotations.AfterMethod;import org.testng.annotations.BeforeMethod;import org.testng.annotations.Test;</CONTEXT> | import org.mockito.invocation.InvocationOnMock;import org.mockito.stubbing.Answer;import org.testng.Assert; |
59,885 | <BUG>ListenableFuture<RpcResult<UpdateFlowOutput>> future = flowUpdate.processFlowModInputBuilders(allFlowMods);Futures.addCallback(future, new UpdateFlowCallback(input));</BUG><CONTEXT>ofFlowModInputs = flowUpdate.toFlowModInputs(addFlowInputBuilder.build());} else {ofFlowModInputs = flowUpdate.toFlowModInputs(updated);}allFlowMods.addAll(ofFlowModInputs);<extra_id_0>return future;}@VisibleForTesting</CONTEXT> | Futures.addCallback(future, new UpdateFlowCallback(input)); |
63,036 | <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;</BUG><CONTEXT>final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy);final int pos = posx + posy;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]] = destinationNoDataDouble[k2]; |
5,478 | <CONTEXT></BUG>this.userGroups = singletonList(userGroup);this.tickInterval = DEFAULT_TICK_INTERVAL;}public Builder(JLoadProfileUsers userGroup, JLoadProfileUsers... userGroups) {<extra_id_0>this.userGroups = singletonList(userGroup);this.tickInterval = DEFAULT_TICK_INTERVAL;}public Builder(JLoadProfileUsers userGroup, JLoadProfileUsers... userGroups) {<BUG>Objects.nonNull(userGroup);</BUG>ArrayList<JLoadProfileUsers> groups = new ArrayList<>();groups.add(userGroup);Collections.addAll(groups, userGroups);</CONTEXT> | static final int DEFAULT_TICK_INTERVAL = 1000;private final List<JLoadProfileUsers> userGroups;private int delayBetweenInvocationsInSeconds;private int tickInterval;private Builder(JLoadProfileUsers userGroup) {Objects.requireNonNull(userGroup);Objects.requireNonNull(userGroup); |
36,096 | <CONTEXT>String.valueOf(JWTIssuer.EXPIRATION_TIME.getSeconds()))</BUG>.addParameter(PARAM_SCOPE, ScopeProperties.join(finalScopes)).addParameter(PARAM_STATE, state.orElse(EMPTY_STRING)).build();}<extra_id_0>.addParameter(PARAM_SCOPE, ScopeProperties.join(finalScopes)).addParameter(PARAM_STATE, state.orElse(EMPTY_STRING)).build();}<BUG>private URI generateLoginFormURI(final String realmName, final String responseType, final Optional<String> state,final String clientId, final Set<String> finalScopes, final URI redirectUri) throws URISyntaxException,</BUG>JOSEException {</CONTEXT> | private URI generateTokenResponseURI(final UserRealm userRealm, final Optional<String> state, final String clientId,final Set<String> finalScopes, final Map<String, String> claims, final URI redirectUri)throws URISyntaxException, JOSEException {final String rawJWT = jwtIssuer.issueAccessToken(userRealm, clientId, finalScopes, claims);return new URIBuilder(redirectUri).addParameter(PARAM_ACCESS_TOKEN, rawJWT).addParameter(PARAM_TOKEN_TYPE, PARAM_TOKEN_TYPE_BEARER).addParameter(PARAM_EXPIRES_IN, String.valueOf(JWTIssuer.EXPIRATION_TIME.getSeconds()))private URI generateLoginURIAfterAccessDenied(final Optional<String> realmName, final String responseType, final Optional<String> state,final String clientId, final Optional<String> finalScopes, final URI redirectUri) throws URISyntaxException, |
43,790 | <BUG>import java.util.Arrays;public class FabricaDeObjetosFake {</BUG><CONTEXT>import org.joda.time.DateTime;import org.joda.time.LocalDate;import java.math.BigDecimal;import java.math.BigInteger;import java.util.ArrayList;<extra_id_0>public static NFInformacaoImpostoDevolvido getNFInformacaoImpostoDevolvido() {final NFInformacaoImpostoDevolvido informacaoImpostoDevolvido = new NFInformacaoImpostoDevolvido();informacaoImpostoDevolvido.setValorIPIDevolvido(new BigDecimal("9999999999999.99"));</CONTEXT> | import java.util.Collections;public class FabricaDeObjetosFake { |
23,753 | <BUG>}if (commentText != null) {this.commentText = new Text(Sanitizer.sanitizeForRichText(commentText.getValue()));</BUG><CONTEXT>HashSet<String> sanitizedRecipients = new HashSet<String>();for (String recipientId : recipients) {sanitizedRecipients.add(Sanitizer.sanitizeForHtml(recipientId));}recipients = sanitizedRecipients;<extra_id_0>}if (recipientType != null) {</CONTEXT> | [DELETED] |
65,007 | <BUG>import tachyon.Constants;public final class TachyonFuse {private static final Logger LOG = LoggerFactory.getLogger(Constants.LOGGER_TYPE);private static final String DEFAULT_MOUNT_POINT = "/mnt/tachyon";private static final String DEFAULT_MASTER_ADDR = "tachyon://localhost:19998";private static final String DEFAULT_ROOT = "/";</BUG><CONTEXT>import org.apache.commons.cli.Option;import org.apache.commons.cli.Options;import org.apache.commons.cli.ParseException;import org.slf4j.Logger;import org.slf4j.LoggerFactory;<extra_id_0>public static void main(String[] args) {</CONTEXT> | import tachyon.client.ClientContext;import tachyon.conf.TachyonConf;private static TachyonConf sTachyonConf; |
15,965 | <BUG>import android.view.animation.Animation;import android.view.animation.AnimationUtils;</BUG><CONTEXT>import android.support.v7.widget.DefaultItemAnimator;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;<extra_id_0>import android.widget.TextView;import com.dm.material.dashboard.candybar.R;import com.dm.material.dashboard.candybar.adapters.LauncherAdapter;</CONTEXT> | [DELETED] |
7,920 | <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.*; |
50,040 | <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]; |
47,111 | <BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;import java.io.IOException;</BUG><CONTEXT>package cc.catalysts.boot.report.pdf.elements;import org.apache.pdfbox.pdmodel.PDDocument;<extra_id_0>import java.util.ArrayList;import java.util.Collection;import java.util.LinkedList;</CONTEXT> | import org.apache.pdfbox.pdmodel.PDPageContentStream;import java.io.IOException; |
4,741 | <BUG>@SuppressWarnings("unchecked")Response<Lse> response = (Response<Lse>) this.callGet("public/lses",</BUG><CONTEXT>if(log.isDebugEnabled()) log.debug("getLse completed");return response;}public Response<Lse> getLses(GetLsesRequest request) {if(log.isDebugEnabled()) log.debug("getLses called");<extra_id_0>request.getQueryParams(),new TypeReference<Response<Lse>>() { });</CONTEXT> | Response<Lse> response = this.callGet("public/lses", |
13,784 | <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics);getCurrentCamera().setRotation(cameraPose.getOrientation());getCurrentCamera().setPosition(cameraPose.getPosition());}</BUG><CONTEXT>translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);translationMoon.setTransformable3D(moon);getCurrentScene().registerAnimation(translationMoon);translationMoon.play();}<extra_id_0>public int getTextureId() {</CONTEXT> | public void updateRenderCameraPose(TangoPoseData cameraPose) {float[] rotation = cameraPose.getRotationAsFloats();float[] translation = cameraPose.getTranslationAsFloats();Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);getCurrentCamera().setRotation(quaternion.conjugate());getCurrentCamera().setPosition(translation[0], translation[1], translation[2]); |
45,941 | <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics);getCurrentCamera().setRotation(cameraPose.getOrientation());getCurrentCamera().setPosition(cameraPose.getPosition());}</BUG><CONTEXT>translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);translationMoon.setTransformable3D(moon);getCurrentScene().registerAnimation(translationMoon);translationMoon.play();}<extra_id_0>public int getTextureId() {</CONTEXT> | public void updateRenderCameraPose(TangoPoseData cameraPose) {float[] rotation = cameraPose.getRotationAsFloats();float[] translation = cameraPose.getTranslationAsFloats();Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);getCurrentCamera().setRotation(quaternion.conjugate());getCurrentCamera().setPosition(translation[0], translation[1], translation[2]); |
11,120 | <BUG>import hudson.model.Label;import hudson.plugins.selenium.configuration.ConfigurationDescriptor;</BUG><CONTEXT>import hudson.model.TaskListener;import hudson.model.Api;import hudson.model.Computer;import hudson.model.Descriptor;import hudson.model.Hudson;<extra_id_0>import hudson.plugins.selenium.configuration.SeleniumNodeConfiguration;import hudson.plugins.selenium.configuration.CustomRCConfiguration;import hudson.plugins.selenium.configuration.CustomWDConfiguration;</CONTEXT> | import hudson.plugins.selenium.callables.hub.StopHubCallable;import hudson.plugins.selenium.configuration.ConfigurationDescriptor; |
10,390 | <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; |
52,891 | <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;</BUG><CONTEXT>final int posyROI = (s_iy - srcRectY) * roiScanlineStride;final int baseIndex = (posx / dst_num_bands) + posyROI;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]; |
11,640 | <BUG>table.sort();out.println(table.finish());</BUG><CONTEXT>} catch(final IOException ex) {Util.debug(ex);final String msg = ex.getMessage();return msg.isEmpty() ? error(DB_NOT_OPENED_X, db) : error(msg);}<extra_id_0>return true;}</CONTEXT> | out.println(table.sort().finish()); |
68,114 | <BUG>"Not tracking service " + serviceReference +</BUG><CONTEXT>UpgradeStep upgradeStep = _bundleContext.getService(serviceReference);if (upgradeStep == null) {_logger.log(Logger.LOG_WARNING,<extra_id_0>" because it does not implement UpgradeStep");return null;}</CONTEXT> | "Not tracking service reference " + serviceReference + |
42,316 | <BUG>for (IRegion region : FGManager.getInstance().getRegionsList(world)) {if (region.autoSave()) {</BUG><CONTEXT>dataBaseDir = "jdbc:h2:" + Sponge.getGame().getSavesDirectory().resolve(server.getDefaultWorldName()) + "/" + world.getName() + "/foxguard/";}try (Connection conn = FoxGuardMain.instance().getDataSource(dataBaseDir + "foxguard").getConnection()) {try (Statement statement = conn.createStatement()) {statement.addBatch("DELETE FROM REGIONS; DELETE FROM LINKAGES;");<extra_id_0>statement.addBatch("INSERT INTO REGIONS(NAME, TYPE, ENABLED) VALUES ('" +region.getName() + "', '" +region.getUniqueTypeString() + "', " +</CONTEXT> | for (IRegion region : FGManager.getInstance().getRegionList(world)) {if (region.autoSave()) { |
17,457 | <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataShort;</BUG><CONTEXT>: 0);}}}if (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]; |
63,549 | <BUG>WalkModFacade facade = new WalkModFacade(OptionsBuilder.options());</BUG><CONTEXT>@Overridepublic void execute() throws Exception {if (help) {jcommander.usage("add-module");} else {<extra_id_0>facade.addModules(modules);}}</CONTEXT> | WalkModFacade facade = new WalkModFacade(OptionsBuilder.options().printErrors(printErrors)); |
23,042 | <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++) { |
69,977 | <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"); |
23,613 | <BUG>DEC_BLUE, RESET_COLOR, SAVE, LOAD, NEW, };</BUG><CONTEXT>mappings = new String[] { SWITCH_CTRL_1, SWITCH_CTRL_2, SWITCH_CTRL_3,PRIMARY_ACTION, SECONDARY_ACTION, TOGGLE_PENCIL_SHAPE, TOGGLE_PENCIL_MODE, INC_SELECTOR_RADIUS, DEC_SELECTOR_RADIUS, SET_CLIFF_TOOL, SET_HEIGHT_TOOL,SET_ATLAS_TOOL, SET_RAMP_TOOL, SET_UNIT_TOOL,TOGGLE_GRID, TOGGLE_SOWER, TOGGLE_SET, TOGGLE_OPERATION, INC_AIRBRUSH_FALLOF, DEC_AIRBRUSH_FALLOF,TOGGLE_LIGHT_COMP, INC_DAYTIME, DEC_DAYTIME, COMPASS_EAST, COMPASS_WEST, INC_INTENSITY, DEC_INTENSITY, TOGGLE_SPEED, DEC_RED, DEC_GREEN,<extra_id_0>}@Overrideprotected void registerInputs(InputManager inputManager) {</CONTEXT> | DEC_BLUE, RESET_COLOR, SAVE, LOAD, NEW, REPORT}; |
63,308 | <BUG>if (caseA) {for (int h = 0; h < dstHeight; h++) {</BUG><CONTEXT>final int pixelStride = dst.getPixelStride();final int[] bandOffsets = dst.getBandOffsets();final double[][] data = dst.getDoubleDataArrays();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++) { |
18,288 | <BUG>Log.e(TAG, "Firmware upgrade payload parsing failed." + e);}</BUG><CONTEXT>} else {Preference.putString(context, context.getResources().getString(R.string.firmware_server), server);}}} catch (JSONException e) {<extra_id_0>}if (schedule != null && !schedule.trim().isEmpty()) {Log.i(TAG, "Upgrade scheduled received: " + schedule);</CONTEXT> | return; |
55,447 | <BUG>if (!toBouncyCastleECPoint(ephemeralGenerator, params).isValid()) {</BUG><CONTEXT>final ECFieldFp field = (ECFieldFp)curve.getField();final BigInteger p = field.getP();final BigInteger order = params.getOrder();final int cofactor = params.getCofactor();final ECPoint ephemeralGenerator = add(multiply(nonceS, generator, params), sharedSecretPointH, params);<extra_id_0>LOGGER.warning("Se ha generado un punto invalido"); //$NON-NLS-1$}return new ECParameterSpec(new EllipticCurve(new ECFieldFp(p), a, b), ephemeralGenerator, order, cofactor);</CONTEXT> | if (!toSpongyCastleECPoint(ephemeralGenerator, params).isValid()) { |
22,602 | <BUG>sink.tableCell();iconError( sink );</BUG><CONTEXT>sink.tableCell();sink.text( getI18nString( locale, "legend.shared" ) );sink.tableCell_();sink.tableRow_();sink.tableRow();<extra_id_0>sink.tableCell_();sink.tableCell();sink.text( getI18nString( locale, "legend.different" ) );</CONTEXT> | sink.tableCell( "15px" ); // according /images/icon_error_sml.gificonError( sink ); |
41,843 | <BUG>default MethodSpec buildWhereConstructor(TypeName whereType) {</BUG><CONTEXT>final ClassName abstractEndType = classSignatureParams.abstractEndType.orElse(classSignatureParams.abstractWhereType);signatures.add(ClassSignatureInfo.of(endTypeName, endReturnTypeName, genericType(abstractEndType, endReturnTypeName, signature.entityRawClass),endClassName));return signatures;}<extra_id_0>return MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC).addParameter(whereType, "where")</CONTEXT> | public MethodSpec buildWhereConstructor(TypeName whereType) { |
22,967 | <BUG>if(top < rand.nextInt(128) + 128){return voidEffect;</BUG><CONTEXT>public IEffect getMixEffect(Color col){if(col == null){return effect;}int top = Math.max(col.getBlue(), Math.max(col.getRed(), col.getGreen()));<extra_id_0>}return effect;}</CONTEXT> | if(top != 255){return voidEffect; |
35,724 | <BUG>import android.content.SharedPreferences;import android.os.Bundle;</BUG><CONTEXT>package org.secuso.privacyfriendlytodolist.view;<extra_id_0>import android.preference.EditTextPreference;import android.preference.ListPreference;import android.preference.Preference;</CONTEXT> | import android.graphics.PorterDuff;import android.graphics.drawable.Drawable;import android.os.Bundle; |
31,930 | <BUG>private static byte[] writeDex() {</BUG><CONTEXT>DxConsole.err.println("\ntrouble processing \"" + name + "\":\n\n" +IN_RE_CORE_CLASSES);errors.incrementAndGet();throw new StopProcessing();}<extra_id_0>byte[] outArray = null;try {try {</CONTEXT> | private static byte[] writeDex(DexFile outputDex) { |
21,622 | <BUG>import java.util.Map;import com.intellij.openapi.project.Project;import com.intellij.openapi.actionSystem.CommonDataKeys;import java.awt.Frame;</BUG><CONTEXT>package jetbrains.mps.ide.mpsmigration.migration32;import jetbrains.mps.workbench.action.BaseAction;import javax.swing.Icon;import com.intellij.openapi.actionSystem.AnActionEvent;<extra_id_0>import jetbrains.mps.ide.actions.MPSCommonDataKeys;</CONTEXT> | import jetbrains.mps.project.MPSProject; |
12,366 | <BUG>Map<String, String> updatedProperties = propertiesCapture.getValue();assertTrue(Maps.difference(newPropertiesAmsHbaseSite, updatedProperties).areEqual());</BUG><CONTEXT>expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(),anyObject(Map.class))).andReturn(createNiceMock(Config.class)).anyTimes();replay(controller, injector2);new UpgradeCatalog221(injector2).updateAMSConfigs();easyMockSupport.verifyAll();<extra_id_0>}@Testpublic void testUpdateAmsHbaseSecuritySiteConfigs() throws Exception{</CONTEXT> | String tickTime = updatedProperties.remove("hbase.zookeeper.property.tickTime");assertEquals("6000", tickTime);assertTrue(Maps.difference(newPropertiesAmsHbaseSite, updatedProperties).areEqual()); |
18,407 | <BUG>import org.eclipse.jface.bindings.keys.KeyStroke;import org.eclipse.jface.text.ITextViewerExtension5;</BUG><CONTEXT>import org.eclipse.jface.action.IMenuListener2;import org.eclipse.jface.action.IMenuManager;import org.eclipse.jface.action.MenuManager;import org.eclipse.jface.bindings.keys.IKeyLookup;import org.eclipse.jface.bindings.keys.KeyLookupFactory;<extra_id_0>import org.eclipse.jface.text.IViewportListener;import org.eclipse.jface.text.IWidgetTokenKeeper;import org.eclipse.jface.text.IWidgetTokenKeeperExtension;</CONTEXT> | import org.eclipse.jface.resource.ColorRegistry;import org.eclipse.jface.resource.JFaceResources;import org.eclipse.jface.text.ITextViewerExtension5; |
13,315 | <BUG>try {connectTango();</BUG><CONTEXT>super.onResume();if (!mIsConnected) {mTango = new Tango(AugmentedRealityActivity.this, new Runnable() {@Overridepublic void run() {<extra_id_0>setupRenderer();mIsConnected = true;} catch (TangoOutOfDateException e) {</CONTEXT> | TangoSupport.initialize();connectTango(); |
24,046 | <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); |
57,519 | <BUG>Transform transform = new Yuv422pToYuv420p(0, 0);</BUG><CONTEXT>SeekableByteChannel source = null;try {sink = writableChannel(tildeExpand(cmd.getArg(1)));source = readableChannel(tildeExpand(cmd.getArg(0)));MP4Demuxer demux = new MP4Demuxer(source);<extra_id_0>VP8Encoder encoder = VP8Encoder.createVP8Encoder(10); // qpIVFMuxer muxer = null;AbstractMP4DemuxerTrack inTrack = demux.getVideoTrack();</CONTEXT> | Transform8Bit transform = new Yuv422pToYuv420p8Bit(); |
65,197 | <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; |
57,356 | <BUG>} catch (Throwable t) {if (UnsupportedCompilationException.class.isInstance(t))throw (UnsupportedCompilationException)t;elsethrow new RuntimeException(t);</BUG><CONTEXT>} elseresult += value;context.put("_currentChain", result);}}<extra_id_0>}</CONTEXT> | } catch (Throwable t)throw OgnlOps.castToRuntime(t); |
23,323 | <BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {</BUG><CONTEXT>this.memoList = memoList;this.dbManager = dbManager;this.callback = callback;}@Override<extra_id_0>View view;if (isEditMode) {if (viewType == TYPE_HEADER) {</CONTEXT> | public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
33,293 | <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) -> { |
62,494 | <CONTEXT>boundaryColor = buildColor(r, g, b);</BUG>return this;}public TextPainter setForeground(final int r, final int g, final int b) {<extra_id_0>return this;}public TextPainter setForeground(final int r, final int g, final int b) {<BUG>foregroundColor.dispose();foregroundColor = buildColor(r, g, b);</BUG>return this;}</CONTEXT> | italicFont = buildFont(name, height, SWT.ITALIC);underlineFont = buildFont(name, height, SWT.UNDERLINE_LINK);boldAndItalicFont = buildFont(name, height, SWT.ITALIC|SWT.BOLD);public TextPainter setBoundaryColor(final int r, final int g, final int b) {boundaryColor = ColorFactory.getColor(r, g, b);foregroundColor = ColorFactory.getColor(r, g, b); |
31,836 | <BUG>}else{</BUG><CONTEXT>} else {updateMemo();callback.updateMemo();}dismiss();<extra_id_0>Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();}}</CONTEXT> | [DELETED] |
34,936 | <BUG>import jetbrains.mps.openapi.editor.cells.EditorCell;import jetbrains.mps.nodeEditor.cells.CellFinderUtil;</BUG><CONTEXT>import org.jetbrains.annotations.NotNull;import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;import jetbrains.mps.openapi.editor.EditorContext;import jetbrains.mps.openapi.editor.selection.Selection;import jetbrains.mps.openapi.editor.selection.SingularSelection;<extra_id_0>import org.jetbrains.mps.util.Condition;import jetbrains.mps.editor.runtime.selection.SelectionUtil;import jetbrains.mps.openapi.editor.selection.SelectionManager;</CONTEXT> | import jetbrains.mps.openapi.editor.cells.EditorCell_Label;import jetbrains.mps.nodeEditor.cells.CellFinderUtil; |
2,418 | <BUG>renderedPage = "<content><rendered>" + StringEscapeUtils.escapeXml(renderedPage) //$NON-NLS-1$</BUG><CONTEXT>contentDigest = Messages.getString("XSLTEntityHandler.36"); //$NON-NLS-1$}String cdataEscapedRendered = renderedPage.replaceAll("]]>", "]]>]]><![CDATA["); //$NON-NLS-1$ //$NON-NLS-2$String cdataContentDigest = contentDigest.replaceAll("]]>", "]]>]]><![CDATA["); //$NON-NLS-1$ //$NON-NLS-2$<extra_id_0>+ "</rendered><rendered-cdata><![CDATA[" + cdataEscapedRendered + "]]></rendered-cdata><contentdigest><![CDATA[" + cdataContentDigest //$NON-NLS-1$ //$NON-NLS-2$+ "]]></contentdigest></content>"; //$NON-NLS-1$try</CONTEXT> | renderedPage = "<content><rendered>" + (escapeXML ? StringEscapeUtils.escapeXml(renderedPage) : renderedPage) //$NON-NLS-1$ |
39,177 | <BUG>new Handler(Looper.getMainLooper()).post(()->{</BUG><CONTEXT>if (Picture.hasPicPosfix(picture.url)) {picture.pic = picture.url;loadPicture(picture, task, null, false);} elseif (task.collection.site.hasFlag(Site.FLAG_JS_NEEDED_ALL)) {<extra_id_0>WebView webView = new WebView(HViewerApplication.mContext);WebSettings mWebSettings = webView.getSettings();mWebSettings.setJavaScriptEnabled(true);</CONTEXT> | new Handler(Looper.getMainLooper()).post(() -> { |
54,375 | <CONTEXT>.build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(),xwikiObject.getClassName(),xwikiObject.getNumber()).toString();</BUG>} else {<extra_id_0>} else {<BUG>objectUri =UriBuilder.fromUri(baseUri).path(ObjectResource.class).build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(),xwikiObject.getNumber()).toString();</BUG>}</CONTEXT> | private static Link getObjectLink(ObjectFactory objectFactory, URI baseUri, Document doc, BaseObject xwikiObject,boolean useVersion, String relation)String objectUri;if (useVersion) {uri(baseUri, ObjectAtPageVersionResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber());uri(baseUri, ObjectResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),xwikiObject.getClassName(), xwikiObject.getNumber()); |
1,443 | <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 { |
29,989 | <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); |
3,619 | <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); |
29,684 | <BUG>if (!cgh.isDomainExist(connect.getPoolConnexion(),cgl.getLexicalvalue(),</BUG><CONTEXT>cgl.setLexicalvalue(valueEdit);cgl.setIdgroup(idDomaine);cgl.setIdthesaurus(idTheso);cgl.setLang(langueEdit);GroupHelper cgh = new GroupHelper();<extra_id_0>cgl.getIdthesaurus(), cgl.getLang())) {FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error4")));return;</CONTEXT> | if (cgh.isDomainExist(connect.getPoolConnexion(),cgl.getLexicalvalue(), |
26,032 | <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; |
43,839 | <BUG>TransactionResource outter = Entities.transactionFor(CHAPUserInfo.class);try {</BUG><CONTEXT>LOG.error(e);}checkAndAddUser();}private void checkAndAddUser() {<extra_id_0>CHAPUserInfo userInfo = Entities.uniqueResult(new CHAPUserInfo("eucalyptus"));outter.commit();</CONTEXT> | try (TransactionResource outter = Entities.transactionFor(CHAPUserInfo.class)) { |
30,857 | <BUG>VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).space(3 * GlobalConf.SCALE_FACTOR);</BUG><CONTEXT>focusListScrollPane.setFadeScrollBars(false);focusListScrollPane.setScrollingDisabled(true, false);focusListScrollPane.setHeight(tree ? 200 * GlobalConf.SCALE_FACTOR : 100 * GlobalConf.SCALE_FACTOR);focusListScrollPane.setWidth(160);}<extra_id_0>objectsGroup.addActor(searchBox);if (focusListScrollPane != null) {objectsGroup.addActor(focusListScrollPane);</CONTEXT> | VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR); |
55,223 | <BUG>String pageTranslationUri =UriBuilder.fromUri(baseUri).path(PageTranslationResource.class).build(doc.getWiki(), doc.getSpace(), doc.getName(), language).toString();</BUG><CONTEXT>}}for (String language : languages) {Translation translation = objectFactory.createTranslation();translation.setLanguage(language);<extra_id_0>Link pageTranslationLink = objectFactory.createLink();pageTranslationLink.setHref(pageTranslationUri);</CONTEXT> | uri(baseUri, PageTranslationResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), language); |
6,275 | <CONTEXT>float lasty = tileBox.getPixYFromLatLon(pt.lat, pt.lon);int size = culled.size();</BUG>for (int i = 1; i < size; i++) {<extra_id_0>for (int i = 1; i < size; i++) {<BUG>pt = culled.get(i);float x = tileBox.getPixXFromLatLon(pt.lat, pt.lon);float y = tileBox.getPixYFromLatLon(pt.lat, pt.lon);if (Math.min(x, lastx) < clipR && Math.max(x, lastx) > clipL&& Math.min(y, lasty) < clipT && Math.max(y, lasty) > clipB) {</BUG>paint.setColor(pt.colourARGB);</CONTEXT> | && Math.min(y, lasty) < clipT && Math.max(y, lasty) > clipB) {float segment = intp & 15;if (segment < 5) {paint.setColor(internal ? Algorithms.getRainbowColor(((double) (i)) / ((double) size)) : Color.BLACK);float segpiece = 5 - segment;if (segpiece > 3)segpiece = 3;if (!broken) {float sw = stroke * segpiece * scale;paint.setStrokeWidth(sw); |
42,871 | <BUG>if (writer != null){</BUG><CONTEXT>writer.println("# cluster manager properties (only configure for cluster manager) #");writer.println("nifi.cluster.is.manager=false");} catch (NullPointerException e) {throw new ConfigurationChangeException("Failed to parse the config YAML while creating the nifi.properties", e);} finally {<extra_id_0>writer.flush();writer.close();}</CONTEXT> | if (writer != null) { |
31,018 | <BUG>" split on (?,?,?);\n" +</BUG><CONTEXT>" (inst varchar null,\n" +" host varchar null,\n" +" \"DATE\" date not null,\n" +" val decimal\n" +" CONSTRAINT pk PRIMARY KEY (inst,host,\"DATE\"))\n" +<extra_id_0>"alter table " + ptsdbTableName + " add if not exists val decimal;\n" + // Shouldn't error out b/c of if not exists clause"alter table " + ptsdbTableName + " drop column if exists blah;\n" + // Shouldn't error out b/c of if exists clause"drop table if exists FOO.BAR;\n" + // Shouldn't error out b/c of if exists clause</CONTEXT> | " split on ('a','j','s');\n" + |