id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
22,401 | package cc.catalysts.boot.report.pdf.elements;
import cc.catalysts.boot.report.pdf.config.PdfTextStyle;
import cc.catalysts.boot.report.pdf.utils.ReportAlignType;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
<BUG>import org.apache.pdfbox.pdmodel.font.PDFont;
import org.slf4j.Logger;</BUG>
import org.slf4j.Logg... | import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.apache.pdfbox.util.Matrix;
import org.slf4j.Logger;
|
22,402 | addTextSimple(stream, textConfig, textX, nextLineY, "");
return nextLineY;
}
try {
<BUG>String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, fixedText);
</BUG>
float x = calculateAlignPosition(textX, align, textConfig, allowedWidth, split[0]);
if (!underline) {
addTextSimple(stream, ... | String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, text);
|
22,403 | public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
try {
stream.setFont(textConfig.getFont(), textConfig.getFontSize());
stream.setNonStrokingColor(textConfig.getColor());
stream.beginText();
<BUG>stream.newLineAtOffset(textX, textY);
stream.sh... | stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY));
stream.showText(text);
|
22,404 | public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
addTextSimple(stream, textConfig, textX, textY, text);
try {
float lineOffset = textConfig.getFontSize() / 8F;
stream.setStrokingColor(textConfig.getColor());
<BUG>stream.setLineWidth... | stream.moveTo(textX, textY - lineOffset);
stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
|
22,405 | list.add(text.length());
return list;
}
public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) {
String endPart = "";
<BUG>String shortenedText = text;
List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
... | List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {
|
22,406 | package cc.catalysts.boot.report.pdf.elements;
import org.apache.pdfbox.pdmodel.PDDocument;
<BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
import java.io.IOException;</BUG>
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
| import org.apache.pdfbox.pdmodel.PDPageContentStream;
import java.io.IOException;
|
22,407 | }
out = null;
fileOutputActive = false;
} else {
FileChooser fileChooser = new FileChooser();
<BUG>File f = fileChooser.showSaveDialog(null);
if (f == null) {</BUG>
return;
}
try {
| File f = fileChooser.showSaveDialog(null);
if (f == null) {
|
22,408 | computer.mixer.returnLine(this);
return result;
}
@Override
public void resume() {
<BUG>if (sdl != null && isRunning()) return;
System.out.println("Resuming speaker sound");
try {</BUG>
if (sdl == null || !sdl.isOpen()) {
| if (sdl != null && isRunning()) {
try {
|
22,409 | public void run() {
playCurrentBuffer();
}
}, 10, 30);
} catch (LineUnavailableException ex) {
<BUG>System.out.println("ERROR: Could not output sound: " + ex.getMessage());
}</BUG>
}
public void playCurrentBuffer() {
byte[] buffer;
| Logger.getLogger(getClass().getName()).log(Level.SEVERE, "ERROR: Could not output sound", ex);
|
22,410 | package jace.apple2e;
import jace.core.Computer;
import jace.core.Font;
import jace.core.Palette;
import jace.core.RAMEvent;
<BUG>import jace.core.RAMListener;
import jace.core.Video;
import jace.core.VideoWriter;</BUG>
import java.util.logging.Logger;
import javafx.scene.image.PixelWriter;
| import static jace.core.Video.hiresOffset;
import static jace.core.Video.hiresRowLookup;
import static jace.core.Video.textRowLookup;
import jace.core.VideoWriter;
|
22,411 | animationSchedule.cancel(false);
animAddr = 0;
}
};
private void enableHints() {
<BUG>if (hints.isEmpty()) {
hints.add(new RAMListener(RAMEvent.TYPE.EXECUTE, RAMEvent.SCOPE.ADDRESS, RAMEvent.VALUE.ANY) {
@Override
protected void doConfig() {
setScopeStart(0x0FB63);
}
@Override
protected void doEvent(RAMEvent e) {</BUG>... | hints.add(getMemory().observe(RAMEvent.TYPE.EXECUTE, 0x0FB63, (e)->{
|
22,412 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
<BUG>import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;</BUG>
public final class ... | import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
22,413 | package org.jboss.as.patching.runner;
<BUG>import org.jboss.as.boot.DirectoryStructure;
import org.jboss.as.patching.LocalPatchInfo;</BUG>
import org.jboss.as.patching.PatchInfo;
import org.jboss.as.patching.PatchLogger;
import org.jboss.as.patching.PatchMessages;
| import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp;
import org.jboss.as.patching.CommonAttributes;
import org.jboss.as.patching.LocalPatchInfo;
|
22,414 | 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"),
<BUG>ADDED_MODULE("added-module"),
BUNDLES("bundles"),</BUG>
CUMULATIVE("cumulative"),
DESCRIPTION("description"),
MIS... | APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
22,415 | final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
<BUG>case APPLIES_TO_VERSION:
builder.addAppliesTo(value);
break;</BUG>
case RESULTING_VE... | [DELETED] |
22,416 | final StringBuilder path = new StringBuilder();
for(final String p : item.getPath()) {
path.append(p).append(PATH_DELIMITER);
}
path.append(item.getName());
<BUG>writer.writeAttribute(Attribute.PATH.name, path.toString());
if(type != ModificationType.REMOVE) {</BUG>
writer.writeAttribute(Attribute.HASH.name, bytesToHex... | if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
22,417 | package org.jboss.as.patching;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.patching.runner.PatchingException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
<BUG>import org.jboss.logging.annotations.MessageBundle;
import java.io.IOException;</BUG>
impor... | import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
22,418 | @Override public void error(ErrorModel errorModel) {
showErrorModel(errorModel);
}
private void showErrorModel(ErrorModel errorModel) {
if (showMessage() && errorModel != null) {
<BUG>Snackbar.make(getWindow().getDecorView(),
errorModel.getMessage(), Snackbar.LENGTH_SHORT).show();</BUG>
}
}
private void showException(T... | Snackbar.make(getWindow().getDecorView().findViewById(android.R.id.content),
errorModel.getMessage(), Snackbar.LENGTH_SHORT).show();
|
22,419 | mPagePaginator.refresh();
} else if (isNotNull(mSwipeRefreshLayout)) {
mSwipeRefreshLayout.setRefreshing(false);
}
}
<BUG>@Override public void onEmptyClick(View view) {
onRefresh();</BUG>
}
public E getItem(int position) {
| @Override public void onEmptyViewClick(View view) {
onRefresh();
@Override public void onErrorViewClick(View view) {
onRefresh();
|
22,420 | setContentView(R.layout.activity_content_test);
contentPresenter = factory.createContentPresenter();
contentPresenter.onCreate(this);
contentPresenter.attachContainer(container);
contentPresenter.attachContentView(textView);
<BUG>contentPresenter.setOnEmptyClickListener(this);
}</BUG>
@Override protected void onDestro... | contentPresenter.setOnEmptyViewClickListener(this);
contentPresenter.setOnErrorViewClickListener(this);
}
|
22,421 | switch (view.getId()) {
case R.id.btn_load:
contentPresenter.displayLoadView();
break;
case R.id.btn_empty:
<BUG>contentPresenter.buildImageView(R.drawable.support_ui_empty)
</BUG>
.buildEmptyTitle(R.string.support_ui_empty_title_placeholder)
.buildEmptySubtitle(R.string.support_ui_empty_subtitle_placeholder)
.displayE... | contentPresenter.buildEmptyImageView(R.drawable.support_ui_empty)
|
22,422 | package com.smartydroid.android.starter.kit.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown = true) public class ErrorModel {
@JsonProperty("status_code") public int mStatusCode;
<BUG>@JsonProperty("message") ... | public String mTitle;
}
public ErrorModel(int statusCode, String title, String msg) {
this.mTitle = title;
|
22,423 | ReflectionContentPresenterFactory.fromViewClass(getClass());
ContentPresenter contentPresenter;
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
contentPresenter = factory.createContentPresenter();
<BUG>contentPresenter.setOnEmptyClickListener(this);
contentPres... | contentPresenter.setOnEmptyViewClickListener(this);
contentPresenter.setOnErrorViewClickListener(this);
contentPresenter.onCreate(getContext());
|
22,424 | processPage(data);
handDataArray(data);
delegate.respondSuccess(data);
} else {
mHasMore = false;
<BUG>mHasError = true;
delegate.errorNotFound(new ErrorModel(404, "no more"));
</BUG>
}
| mHasError = false;
delegate.errorNotFound(new ErrorModel(404, "暂时没有数据", "点进屏幕刷新数据"));
|
22,425 | import android.os.Handler;</BUG>
import android.util.Log;
import com.smartydroid.android.starter.kit.StarterKit;
import com.smartydroid.android.starter.kit.account.Account;
import com.smartydroid.android.starter.kit.utilities.AppInfo;
<BUG>import com.smartydroid.android.starter.kit.utilities.FakeCrashLibrary;
import ti... | package com.smartydroid.android.starter.kit.app;
import support.ui.app.SupportApp;
public abstract class StarterKitApp extends SupportApp {
|
22,426 | if (StarterKit.isDebug()) {
Timber.plant(new Timber.DebugTree());
} else {
Timber.plant(new CrashReportingTree());
}
<BUG>initialize();
}
private void initialize() {
mInstance = this;
sAppContext = getApplicationContext();
sAppHandler = new Handler(sAppContext.getMainLooper());</BUG>
}
| [DELETED] |
22,427 | public static StarterKitApp getInstance() {
return mInstance;
}</BUG>
@Override public void onTerminate() {
super.onTerminate();
<BUG>sAppContext = null;
mInstance = null;
sAppHandler = null;</BUG>
mAppInfo = null;
}
| if (mAppInfo == null) {
mAppInfo = new AppInfo(appContext());
return mAppInfo;
|
22,428 | package com.cronutils.model.time.generator;
import java.util.Collections;
<BUG>import java.util.List;
import org.apache.commons.lang3.Validate;</BUG>
import com.cronutils.model.field.CronField;
import com.cronutils.model.field.expression.FieldExpression;
public abstract class FieldValueGenerator {
| import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.Validate;
|
22,429 | import java.util.ResourceBundle;
import java.util.function.Function;</BUG>
class DescriptionStrategyFactory {
private DescriptionStrategyFactory() {}
public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression) {
<BUG>final Function<Integer, String> nominal = integ... | import java.util.function.Function;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
final Function<Integer, String> nominal = integer -> DayOfWeek.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale());
|
22,430 | return dom;
}
public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) {
return new NominalDescriptionStrategy(
bundle,
<BUG>integer -> new DateTime().withMonthOfYear(integer).monthOfYear().getAsText(bundle.getLocale()),
expression</BUG>
);
}
public static Descript... | integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()),
expression
|
22,431 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.mapper.WeekDay;</BUG>
import com.cronutils.model.field.CronField;
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.constraint.FieldConstraintsBuilder;
| import java.time.LocalDate;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.Validate;
import com.cronutils.mapper.WeekDay;
|
22,432 | import com.cronutils.model.field.expression.Between;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.parser.CronParserField;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
<BUG>import org.apache.commons.lang3.Validate;
import org.joda.time.DateTime;
impo... | [DELETED] |
22,433 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
| import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.List;
import org.apache.commons.lang3.Validate;
import com.cronutils.model.field.CronField;
|
22,434 | import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
import com.google.common.collect.Lists;
<BUG>import org.apache.commons.lang3.Validate;
import org.joda.time.DateT... | package com.cronutils.model.time.generator;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.List;
import com.cronutils.model.field.CronField;
|
22,435 | class OnDayOfMonthValueGenerator extends FieldValueGenerator {
private int year;
private int month;
public OnDayOfMonthValueGenerator(CronField cronField, int year, int month) {
super(cronField);
<BUG>Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of month");
... | Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" +
" month");
this.year = year;
|
22,436 | package com.cronutils.mapper;
public class ConstantsMapper {
private ConstantsMapper() {}
public static final WeekDay QUARTZ_WEEK_DAY = new WeekDay(2, false);
<BUG>public static final WeekDay JODATIME_WEEK_DAY = new WeekDay(1, false);
</BUG>
public static final WeekDay CRONTAB_WEEK_DAY = new WeekDay(1, true);
public st... | public static final WeekDay JAVA8 = new WeekDay(1, false);
|
22,437 | return nextMatch;
} catch (NoSuchValueException e) {
throw new IllegalArgumentException(e);
}
}
<BUG>DateTime nextClosestMatch(DateTime date) throws NoSuchValueException {
</BUG>
List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear());
TimeNode days = null;
int lowestMonth = months.g... | ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException {
|
22,438 | boolean questionMarkSupported =
cronDefinition.getFieldDefinition(DAY_OF_WEEK).getConstraints().getSpecialChars().contains(QUESTION_MARK);
if(questionMarkSupported){
return new TimeNode(
generateDayCandidatesQuestionMarkSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefini... | date.getYear(), date.getMonthValue(),
|
22,439 | )
);
}else{
return new TimeNode(
generateDayCandidatesQuestionMarkNotSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
22,440 | }
public DateTime lastExecution(DateTime date){
</BUG>
Validate.notNull(date);
try {
<BUG>DateTime previousMatch = previousClosestMatch(date);
</BUG>
if(previousMatch.equals(date)){
previousMatch = previousClosestMatch(date.minusSeconds(1));
}
| public java.time.Duration timeToNextExecution(ZonedDateTime date){
return java.time.Duration.between(date, nextExecution(date));
public ZonedDateTime lastExecution(ZonedDateTime date){
ZonedDateTime previousMatch = previousClosestMatch(date);
|
22,441 | return previousMatch;
} catch (NoSuchValueException e) {
throw new IllegalArgumentException(e);
}
}
<BUG>public Duration timeFromLastExecution(DateTime date){
return new Interval(lastExecution(date), date).toDuration();
}
public boolean isMatch(DateTime date){
</BUG>
return nextExecution(lastExecution(date)).equals(da... | [DELETED] |
22,442 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.google.common.annotations.VisibleForTesting;
| import java.time.ZonedDateTime;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cronutils.model.field.CronField;
|
22,443 | import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
<BUG>import org.joda.time.DateTime;
import org.slf4j.Logger;
i... | package com.cronutils.model.time.generator;
import java.time.ZonedDateTime;
import java.util.List;
import com.cronutils.model.field.CronField;
|
22,444 | private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class);
public EveryFieldValueGenerator(CronField cronField) {
super(cronField);
log.trace(String.format(
"processing \"%s\" at %s",
<BUG>cronField.getExpression().asString(), DateTime.now()
</BUG>
));
}
@Override
| cronField.getExpression().asString(), ZonedDateTime.now()
|
22,445 | package unfoldingword;
public class ModelNames {
<BUG>static public final int DB_VERSION_ID = 102;
</BUG>
static public final String PROJECT = "Project";
static public final String[] PROJECT_STRING_ATTRIBUTES = { "uniqueSlug", "slug", "title" };
static public final String PROJECT_LANGUAGES_ATTRIBUTE = "languages";
| static public final int DB_VERSION_ID = 103;
|
22,446 | return language;
}
private static Entity createVersion(Schema schema, Entity language) {
DaoHelperMethods.EntityInformation versionInfo =
new DaoHelperMethods.EntityInformation(ModelNames.VERSION, ModelNames.VERSION_STRING_ATTRIBUTES,
<BUG>ModelNames.VERSION_DATE_ATTRIBUTES, ModelNames.VERSION_INT_ATTRIBUTES);
Entity v... | ModelNames.VERSION_DATE_ATTRIBUTES);
Entity version = DaoHelperMethods.createEntity(schema, versionInfo);
|
22,447 | return version;
}
private static Entity createBook(Schema schema, Entity version) {
DaoHelperMethods.EntityInformation bookInfo =
new DaoHelperMethods.EntityInformation(ModelNames.BOOK, ModelNames.BOOK_STRING_ATTRIBUTES,
<BUG>ModelNames.BOOK_DATE_ATTRIBUTES, ModelNames.BOOK_INT_ATTRIBUTES);
Entity book = DaoHelperMetho... | ModelNames.BOOK_DATE_ATTRIBUTES);
Entity book = DaoHelperMethods.createEntity(schema, bookInfo);
|
22,448 | testResumeCrossSegment(CHKBlock.DATA_LENGTH*128*21);
}
public void testEncodeAfterShutdownCrossSegment() throws InsertException, IOException, MissingKeyException, StorageFormatException, ChecksumFailedException, ResumeFailedException, MetadataUnresolvedException {
testEncodeAfterShutdownCrossSegment(CHKBlock.DATA_LENGT... | public void testRepeatedEncodeAfterShutdown() throws InsertException, IOException, MissingKeyException, StorageFormatException, ChecksumFailedException, ResumeFailedException, MetadataUnresolvedException {
testRepeatedEncodeAfterShutdownCrossSegment(CHKBlock.DATA_LENGTH*128*5); // Not cross-segment.
testRepeatedEncodeA... |
22,449 | import com.couchbase.client.core.ClusterFacade;
import com.couchbase.client.core.CouchbaseException;
import com.couchbase.client.core.RequestCancelledException;
import com.couchbase.client.core.annotations.InterfaceAudience;
import com.couchbase.client.core.annotations.InterfaceStability;
<BUG>import com.couchbase.clie... | [DELETED] |
22,450 | import com.couchbase.client.java.document.Document;
import com.couchbase.client.java.document.JsonDocument;
import com.couchbase.client.java.document.JsonLongDocument;
import com.couchbase.client.java.document.LegacyDocument;
import com.couchbase.client.java.document.StringDocument;
<BUG>import com.couchbase.client.jav... | [DELETED] |
22,451 | import com.couchbase.client.java.query.N1qlQuery;
import com.couchbase.client.java.query.Statement;
import com.couchbase.client.java.repository.AsyncRepository;
import com.couchbase.client.java.repository.Repository;
import com.couchbase.client.java.search.SearchQueryResult;
<BUG>import com.couchbase.client.java.search... | import com.couchbase.client.java.subdoc.AsyncLookupInBuilder;
import com.couchbase.client.java.subdoc.AsyncMutateInBuilder;
import com.couchbase.client.java.transcoder.subdoc.FragmentTranscoder;
import com.couchbase.client.java.view.AsyncSpatialViewResult;
|
22,452 | import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
<BUG>import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.Collections;
import java.util.List;
i... | import static org.junit.Assert.assertThat;
import java.util.concurrent.TimeUnit;
import com.couchbase.client.core.logging.CouchbaseLogger;
import com.couchbase.client.core.logging.CouchbaseLoggerFactory;
import com.couchbase.client.core.message.kv.subdoc.multi.Lookup;
import com.couchbase.client.core.message.kv.subdoc.... |
22,453 | assertEquals(4, storedArray.size());
assertEquals("arrayInsert", storedArray.getString(0));
}
@Test
public void testArrayInsertAtSize() {
<BUG>DocumentFragment<String> fragment = DocumentFragment.create(key, "array[3]", "arrayInsert");
DocumentFragment<String> result = ctx.bucket().arrayInsertIn(fragment, PersistTo.NON... | DocumentFragment<Mutation> result = ctx.bucket()
.mutateIn(key)
.arrayInsert("array[3]", "arrayInsert")
.doMutate();
assertNotEquals(0L, result.cas());
|
22,454 | assertEquals(1, storedArray.size());
assertEquals("arrayInsert", storedArray.getString(0));
}
@Test
public void testArrayInsertAtExistingIndex() {
<BUG>DocumentFragment<String> fragment = DocumentFragment.create(key, "array[1]", "arrayInsert");
DocumentFragment<String> result = ctx.bucket().arrayInsertIn(fragment, Pers... | DocumentFragment<Mutation> result = ctx.bucket()
.mutateIn(key)
.arrayInsert("array[1]", "arrayInsert")
.doMutate();
assertNotEquals(0L, result.cas());
|
22,455 | import com.liferay.portlet.documentlibrary.util.comparator.RepositoryModelModifiedDateComparator;
import com.liferay.portlet.documentlibrary.util.comparator.RepositoryModelNameComparator;
import com.liferay.portlet.documentlibrary.util.comparator.RepositoryModelSizeComparator;
import java.io.InputStream;
import java.ma... | import java.util.Collections;
import java.util.HashMap;
|
22,456 | import org.apache.chemistry.opencmis.commons.data.RepositoryCapabilities;
import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
import org.apache.chemistry.opencmis.commons.enums.Action;
import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
import org.apache.chemistry.opencmis.commons.enums.Capabil... | import org.apache.chemistry.opencmis.commons.enums.VersioningState;
import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException;
|
22,457 | return session;
}
SessionImpl sessionImpl =
(SessionImpl)_cmisRepositoryHandler.getSession();
session = sessionImpl.getSession();
<BUG>setCachedSession(session);
return session;</BUG>
}
@Override
public void getSubfolderIds(List<Long> folderIds, long folderId)
| _initRepositoryDetector();
|
22,458 | String productVersion = repositoryInfo.getProductVersion();
queryConfig.setAttribute("repositoryProductName", productName);
queryConfig.setAttribute("repositoryProductVersion", productVersion);
String queryString = CMISSearchQueryBuilderUtil.buildQuery(
searchContext, query);
<BUG>if (productName.contains("Nuxeo") && p... | if (_repositoryDetector.isNuxeo5_4()) {
queryString +=
|
22,459 | " AND (" + PropertyIds.IS_LATEST_VERSION + " = true)";
}
if (_log.isDebugEnabled()) {
_log.debug("CMIS search query: " + queryString);
}
<BUG>ItemIterable<QueryResult> queryResults = session.query(
queryString, false);
int start = searchContext.getStart();</BUG>
int end = searchContext.getEnd();
| ItemIterable<QueryResult> queryResults;
if (_repositoryDetector.isNuxeo5_5OrHigher()) {
queryResults = session.query(queryString, true);
else {
queryResults = session.query(queryString, false);
int start = searchContext.getStart();
|
22,460 | timeWarp = new OwnLabel(getFormattedTimeWrap(), skin, "warp");
timeWarp.setName("time warp");
Container wrapWrapper = new Container(timeWarp);
wrapWrapper.width(60f * GlobalConf.SCALE_FACTOR);
wrapWrapper.align(Align.center);
<BUG>VerticalGroup timeGroup = new VerticalGroup().align(Align.left).space(3 * GlobalConf.SCAL... | VerticalGroup timeGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR);
|
22,461 | focusListScrollPane.setFadeScrollBars(false);
focusListScrollPane.setScrollingDisabled(true, false);
focusListScrollPane.setHeight(tree ? 200 * GlobalConf.SCALE_FACTOR : 100 * GlobalConf.SCALE_FACTOR);
focusListScrollPane.setWidth(160);
}
<BUG>VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).space(3 *... | VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR);
|
22,462 | headerGroup.addActor(expandIcon);
headerGroup.addActor(detachIcon);
addActor(headerGroup);
expandIcon.setChecked(expanded);
}
<BUG>public void expand() {
</BUG>
if (!expandIcon.isChecked()) {
expandIcon.setChecked(true);
}
| public void expandPane() {
|
22,463 | </BUG>
if (!expandIcon.isChecked()) {
expandIcon.setChecked(true);
}
}
<BUG>public void collapse() {
</BUG>
if (expandIcon.isChecked()) {
expandIcon.setChecked(false);
}
| headerGroup.addActor(expandIcon);
headerGroup.addActor(detachIcon);
addActor(headerGroup);
expandIcon.setChecked(expanded);
public void expandPane() {
public void collapsePane() {
|
22,464 | });
playstop.addListener(new TextTooltip(txt("gui.tooltip.playstop"), skin));
TimeComponent timeComponent = new TimeComponent(skin, ui);
timeComponent.initialize();
CollapsiblePane time = new CollapsiblePane(ui, txt("gui.time"), timeComponent.getActor(), skin, true, playstop);
<BUG>time.align(Align.left);
mainActors.ad... | time.align(Align.left).columnAlign(Align.left);
mainActors.add(time);
|
22,465 | 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, fal... | objects.align(Align.left).columnAlign(Align.left);
mainActors.add(objects);
|
22,466 | if (Constants.desktop) {
MusicComponent musicComponent = new MusicComponent(skin, ui);
musicComponent.initialize();
Actor[] musicActors = MusicActorsManager.getMusicActors() != null ? MusicActorsManager.getMusicActors().getActors(skin) : null;
CollapsiblePane music = new CollapsiblePane(ui, txt("gui.music"), musicCompo... | music.align(Align.left).columnAlign(Align.left);
mainActors.add(music);
|
22,467 | PropsKeys.LDAP_ATTRS_TRANSFORMER_IMPL);
AttributesTransformer attributesTransformer =
(AttributesTransformer)newInstance(
portletClassLoader, AttributesTransformer.class,
attributesTransformerClassName);
<BUG>ServiceRegistration<AttributesTransformer> serviceRegistration =
registry.registerService(
AttributesTransforme... | servletContextName, attributesTransformerClassName,
|
22,468 | PropsKeys.USERS_EMAIL_ADDRESS_GENERATOR);
EmailAddressGenerator emailAddressGenerator =
(EmailAddressGenerator)newInstance(
portletClassLoader, EmailAddressGenerator.class,
emailAddressGeneratorClassName);
<BUG>ServiceRegistration<EmailAddressGenerator> serviceRegistration =
registry.registerService(
EmailAddressGenera... | servletContextName, emailAddressGeneratorClassName,
|
22,469 | PropsKeys.USERS_EMAIL_ADDRESS_VALIDATOR);
EmailAddressValidator emailAddressValidator =
(EmailAddressValidator)newInstance(
portletClassLoader, EmailAddressValidator.class,
emailAddressValidatorClassName);
<BUG>ServiceRegistration<EmailAddressValidator> serviceRegistration =
registry.registerService(
EmailAddressValida... | servletContextName, emailAddressValidatorClassName,
|
22,470 | PropsKeys.USERS_FULL_NAME_GENERATOR);
FullNameGenerator fullNameGenerator =
(FullNameGenerator)newInstance(
portletClassLoader, FullNameGenerator.class,
fullNameGeneratorClassName);
<BUG>ServiceRegistration<FullNameGenerator> serviceRegistration =
registry.registerService(
FullNameGenerator.class, fullNameGenerator);
s... | servletContextName, fullNameGeneratorClassName,
|
22,471 | PropsKeys.USERS_FULL_NAME_VALIDATOR);
FullNameValidator fullNameValidator =
(FullNameValidator)newInstance(
portletClassLoader, FullNameValidator.class,
fullNameValidatorClassName);
<BUG>ServiceRegistration<FullNameValidator> serviceRegistration =
registry.registerService(
FullNameValidator.class, fullNameValidator);
s... | servletContextName, fullNameValidatorClassName,
|
22,472 | PropsKeys.USERS_SCREEN_NAME_GENERATOR);
ScreenNameGenerator screenNameGenerator =
(ScreenNameGenerator)newInstance(
portletClassLoader, ScreenNameGenerator.class,
screenNameGeneratorClassName);
<BUG>ServiceRegistration<ScreenNameGenerator> serviceRegistration =
registry.registerService(
ScreenNameGenerator.class, scree... | servletContextName, screenNameGeneratorClassName,
|
22,473 | PropsKeys.USERS_SCREEN_NAME_VALIDATOR);
ScreenNameValidator screenNameValidator =
(ScreenNameValidator)newInstance(
portletClassLoader, ScreenNameValidator.class,
screenNameValidatorClassName);
<BUG>ServiceRegistration<ScreenNameValidator> serviceRegistration =
registry.registerService(
ScreenNameValidator.class, scree... | servletContextName, screenNameValidatorClassName,
|
22,474 | StrutsAction strutsAction =
(StrutsAction)ProxyUtil.newProxyInstance(
portletClassLoader, new Class[] {StrutsAction.class},
new ClassLoaderBeanHandler(
strutsActionObject, portletClassLoader));
<BUG>serviceRegistration = registry.registerService(
StrutsAction.class, strutsAction, properties);
}</BUG>
else {
StrutsPortl... | servletContextName, strutsActionClassName, StrutsAction.class,
strutsAction, "path", strutsActionPath);
}
|
22,475 | StrutsPortletAction strutsPortletAction =
(StrutsPortletAction)ProxyUtil.newProxyInstance(
portletClassLoader, new Class[] {StrutsPortletAction.class},
new ClassLoaderBeanHandler(
strutsActionObject, portletClassLoader));
<BUG>serviceRegistration = registry.registerService(
StrutsPortletAction.class, strutsPortletActio... | servletContextName, strutsActionClassName,
StrutsPortletAction.class, strutsPortletAction,
"path", strutsActionPath);
|
22,476 | 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;
<BUG>import com.google.atap.tangoservice.TangoC... | import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
|
22,477 | super.onResume();
if (!mIsConnected) {
mTango = new Tango(AugmentedRealityActivity.this, new Runnable() {
@Override
public void run() {
<BUG>try {
connectTango();</BUG>
setupRenderer();
mIsConnected = true;
} catch (TangoOutOfDateException e) {
| TangoSupport.initialize();
connectTango();
|
22,478 | if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) {
mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics);
mCameraPoseTimestamp = lastFramePose.timestamp;</BUG>
} else {
<BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread);
}</BUG>
}
}
}
@Override
| mRenderer.updateRenderCameraPose(lastFramePose);
mCameraPoseTimestamp = lastFramePose.timestamp;
Log.w(TAG, "Can't get device pose at time: " +
|
22,479 | import org.rajawali3d.materials.Material;
import org.rajawali3d.materials.methods.DiffuseMethod;
import org.rajawali3d.materials.textures.ATexture;
import org.rajawali3d.materials.textures.StreamingTexture;
import org.rajawali3d.materials.textures.Texture;
<BUG>import org.rajawali3d.math.Matrix4;
import org.rajawali3d.... | import org.rajawali3d.math.Quaternion;
import org.rajawali3d.math.vector.Vector3;
|
22,480 | translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);
translationMoon.setTransformable3D(moon);
getCurrentScene().registerAnimation(translationMoon);
translationMoon.play();
}
<BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {
Pose cameraPose = ScenePoseCalculator.t... | 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()... |
22,481 | package com.projecttango.examples.java.helloareadescription;
import com.google.atap.tangoservice.Tango;
<BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoConfig;</BUG>
import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangos... | import com.google.atap.tangoservice.TangoAreaDescriptionMetaData;
import com.google.atap.tangoservice.TangoConfig;
|
22,482 | package org.elasticsearch.script.python;
import org.elasticsearch.action.search.SearchResponse;
<BUG>import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.search.sort.SortOrder;</BUG>
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.hamcrest.CoreMatchers;
import org.junit.Aft... | import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders;
import org.elasticsearch.search.sort.SortOrder;
|
22,483 | assertThat(response.getHits().getAt(0).id(), equalTo("2"));
assertThat(response.getHits().getAt(1).id(), equalTo("1"));
logger.info(" --> running -doc['num1'].value");
response = client().search(searchRequest()
.searchType(SearchType.QUERY_THEN_FETCH)
<BUG>.source(searchSource().explain(true).query(customScoreQuery(ter... | .source(searchSource().explain(true).query(functionScoreQuery(termQuery("test", "value"))
.add(ScoreFunctionBuilders.scriptFunction("-doc['num1'].value").lang("python"))))
).actionGet();
|
22,484 | assertThat(response.getHits().getAt(0).id(), equalTo("1"));
assertThat(response.getHits().getAt(1).id(), equalTo("2"));
logger.info(" --> running doc['num1'].value * _score");
response = client().search(searchRequest()
.searchType(SearchType.QUERY_THEN_FETCH)
<BUG>.source(searchSource().explain(true).query(customScoreQ... | .source(searchSource().explain(true).query(functionScoreQuery(termQuery("test", "value"))
.add(ScoreFunctionBuilders.scriptFunction("doc['num1'].value * _score").lang("python"))))
).actionGet();
|
22,485 | assertThat(response.getHits().getAt(0).id(), equalTo("2"));
assertThat(response.getHits().getAt(1).id(), equalTo("1"));
logger.info(" --> running param1 * param2 * _score");
response = client().search(searchRequest()
.searchType(SearchType.QUERY_THEN_FETCH)
<BUG>.source(searchSource().explain(true).query(customScoreQue... | .source(searchSource().explain(true).query(functionScoreQuery(termQuery("test", "value"))
.add(ScoreFunctionBuilders.scriptFunction("param1 * param2 * _score").param("param1", 2).param("param2", 2).lang("python"))))
).actionGet();
|
22,486 | package de.danielnaber.languagetool.rules.patterns;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
<BUG>import de.danielnaber.languagetool.AnalyzedToken;
import de.danielnaber.languagetool.JLanguageTool;
public class Element {</BUG>
private String stringToken;
private String... | import de.danielnaber.languagetool.AnalyzedTokenReadings;
import de.danielnaber.languagetool.synthesis.Synthesizer;
public class Element {
|
22,487 | if (andGroupSet) {
andGroupCheck[0] |= matched;
}
return matched;
}
<BUG>public final boolean exceptionMatch(final AnalyzedToken token) {
</BUG>
boolean exceptionMatched = false;
if (exceptionSet) {
for (final Element testException : exceptionList) {
| public final boolean isExceptionMatched(final AnalyzedToken token) {
|
22,488 | </BUG>
boolean exceptionMatched = false;
if (exceptionSet) {
for (final Element testException : exceptionList) {
if (!testException.exceptionValidNext) {
<BUG>exceptionMatched |= testException.match(token);
</BUG>
}
if (exceptionMatched) {
break;
| if (andGroupSet) {
andGroupCheck[0] |= matched;
return matched;
public final boolean isExceptionMatched(final AnalyzedToken token) {
exceptionMatched |= testException.isMatched(token);
|
22,489 | boolean andGroupMatched = false;
if (andGroupSet) {
for (int i = 0; i < andGroupList.size(); i++) {
if (!andGroupCheck[i + 1]) {
final Element testAndGroup = andGroupList.get(i);
<BUG>if (testAndGroup.match(token)) {
</BUG>
andGroupMatched = true;
andGroupCheck[i + 1] = true;
}
| if (testAndGroup.isMatched(token)) {
|
22,490 | return andGroupSet;
}
public final ArrayList<Element> getAndGroup() {
return andGroupList;
}
<BUG>public final boolean scopeNextExceptionMatch(final AnalyzedToken token) {
</BUG>
boolean exceptionMatched = false;
if (exceptionSet) {
for (final Element testException : exceptionList) {
| public final boolean isMatchedByScopeNextException(final AnalyzedToken token) {
|
22,491 | </BUG>
boolean exceptionMatched = false;
if (exceptionSet) {
for (final Element testException : exceptionList) {
if (testException.exceptionValidNext) {
<BUG>exceptionMatched |= testException.match(token);
</BUG>
}
if (exceptionMatched) {
break;
| return andGroupSet;
public final ArrayList<Element> getAndGroup() {
return andGroupList;
public final boolean isMatchedByScopeNextException(final AnalyzedToken token) {
exceptionMatched |= testException.isMatched(token);
|
22,492 | this.negation = negation;
}
public final boolean getNegation() {
return this.negation;
}
<BUG>public final boolean referenceElement() {
</BUG>
return containsMatches;
}
public final void setMatch(final Match match) {
| public final boolean isReferenceElement() {
|
22,493 | containsMatches = true;
}
public final Match getMatch() {
return tokenReference;
}
<BUG>public final void compile() {
if ("".equals(referenceString)) {</BUG>
referenceString = stringToken;
}
if (tokenReference.setsPos()) {
| public final void compile(final AnalyzedTokenReadings token,
final Synthesizer synth) {
tokenReference.setToken(token);
tokenReference.setSynthesizer(synth);
if ("".equals(referenceString)) {
|
22,494 | package net.java.sip.communicator.plugin.otr;
<BUG>import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;</BUG>
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
| [DELETED] |
22,495 | {
e.printStackTrace();
return null;
}
}
<BUG>private String getSessionNS(SessionID sessionID, String function)
{
try
{
return "net.java.sip.comunicator.plugin.otr."
+ URLEncoder.encode(sessionID.toString(), "UTF-8") + "."
+ function;</BUG>
}
| private List<ScOtrEngineListener> listeners =
new Vector<ScOtrEngineListener>();
public void addListener(ScOtrEngineListener l)
|
22,496 | OtrActivator.bundleContext.getService(ref);
service.openURL(OtrActivator.resourceService
.getI18NString("plugin.otr.authbuddydialog.HELP_URI"));
}
public OtrPolicy getContactPolicy(Contact contact)
<BUG>{
String id = getSessionNS(getSessionID(contact), "policy");
if (id == null || id.length() < 1)
return getGlobalPolic... | int policy = this.configurator.getPropertyInt(getSessionID(contact) + "policy", -1);
|
22,497 | return null;
}
Object b64PubKey = OtrActivator.configService.getProperty(idPubKey);</BUG>
if (b64PubKey == null)
<BUG>return null;
X509EncodedKeySpec publicKeySpec =
new X509EncodedKeySpec(Base64.decode((String) b64PubKey));</BUG>
PublicKey publicKey;
PrivateKey privateKey;
KeyFactory keyFactory;
| PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(b64PrivKey);
byte[] b64PubKey = this.configurator.getPropertyBytes(accountID + ".publicKey");
X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(b64PubKey);
|
22,498 | import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class DependencyConvergenceReport
extends AbstractProjectInfoReport
<BUG>{
private List reactorProjects;
private static final int PERCENTAGE = 100;</BUG>
public String getOutputName()
{
| private static final int PERCENTAGE = 100;
private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment
.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
|
22,499 | sink.section1();
sink.sectionTitle1();
sink.text( getI18nString( locale, "title" ) );
sink.sectionTitle1_();
Map dependencyMap = getDependencyMap();
<BUG>generateLegend( locale, sink );
generateStats( locale, sink, dependencyMap );
generateConvergence( locale, sink, dependencyMap );
sink.section1_();</BUG>
sink.body_()... | sink.lineBreak();
sink.section1_();
|
22,500 | Iterator it = artifactMap.keySet().iterator();
while ( it.hasNext() )
{
String version = (String) it.next();
sink.tableRow();
<BUG>sink.tableCell();
sink.text( version );</BUG>
sink.tableCell_();
sink.tableCell();
generateVersionDetails( sink, artifactMap, version );
| sink.tableCell( String.valueOf( cellWidth ) + "px" );
sink.text( version );
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.