id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
20,601 | import hudson.scm.PollingResult;
public abstract class ChangeComparator implements ExtensionPoint {
public static ExtensionList<ChangeComparator> all() {
return Hudson.getInstance().getExtensionList(ChangeComparator.class);
}
<BUG>abstract public PollingResult.Change compare(MercurialSCM scm, Launcher launcher,
TaskLis... | [DELETED] |
20,602 | package hudson.plugins.mercurial;
import hudson.scm.ChangeLogSet;
<BUG>import hudson.model.AbstractBuild;
import java.util.List;</BUG>
import java.util.Collections;
import java.util.Iterator;
| import hudson.model.Run;
import hudson.scm.RepositoryBrowser;
import java.util.List;
|
20,603 | package hudson.plugins.mercurial;
import hudson.Util;
<BUG>import hudson.model.AbstractBuild;
import hudson.scm.ChangeLogParser;
import hudson.util.Digester2;</BUG>
import hudson.util.IOException2;
| import hudson.model.Run;
import hudson.scm.RepositoryBrowser;
import hudson.util.Digester2;
|
20,604 | public class MercurialChangeLogParser extends ChangeLogParser {
private final Set<String> modules;
public MercurialChangeLogParser(Set<String> modules) {
this.modules = modules;
}
<BUG>public MercurialChangeSetList parse(AbstractBuild build, File changelogFile)
throws IOException, SAXException {</BUG>
Digester digester... | @Override public MercurialChangeSetList parse(Run build, RepositoryBrowser<?> browser, File changelogFile)
throws IOException, SAXException {
|
20,605 | package org.sleuthkit.autopsy.modules.stix;
<BUG>import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.List;</BUG>
import java.util.logging.Level;
| import java.io.BufferedWriter;
import java.io.FileWriter;
import java.util.Arrays;
import java.util.List;
|
20,606 | import java.util.Map;
import java.util.List;</BUG>
import java.util.logging.Level;
<BUG>import java.io.BufferedWriter;
import java.io.FileWriter;
import java.util.Arrays;</BUG>
import javax.swing.JPanel;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
| [DELETED] |
20,607 | stixFiles[0] = stixFile;
} else {
stixFiles = stixFile.listFiles();
}
progressPanel.setMaximumProgress(stixFiles.length * 2 + 1);
<BUG>for (File file : stixFiles) {
try {</BUG>
processFile(file.getAbsolutePath(), progressPanel);
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, String.format("Unable to process S... | if (progressPanel.getStatus() == ReportStatus.CANCELED) {
return;
try {
|
20,608 | + mAuthRequest.getLogInfo() + getCorrelationInfo();
throw new AuthenticationException(
ADALError.AUTHORIZATION_CODE_NOT_EXCHANGED_FOR_TOKEN,
msg, exc);
}
<BUG>if (result != null) {
if (!StringExtensions.IsNullOrBlank(result.getErrorCode())) {</BUG>
Logger.e(TAG, result.getErrorLogInfo(), null, ADALError.AUTH_FAILED);
... | if (result == null) {
Logger.e(TAG, "Returned result with exchanging auth code for token is null", getCorrelationInfo(),
ADALError.AUTHORIZATION_CODE_NOT_EXCHANGED_FOR_TOKEN);
ADALError.AUTHORIZATION_CODE_NOT_EXCHANGED_FOR_TOKEN, getCorrelationInfo());
if (!StringExtensions.IsNullOrBlank(result.getErrorCode())) {
|
20,609 | mAuthRequest.getClientId(), result);
<BUG>}
}
} else {
throw new AuthenticationException(
ADALError.AUTHORIZATION_CODE_NOT_EXCHANGED_FOR_TOKEN, getCorrelationInfo());</BUG>
}
return result;
}
private boolean startAuthenticationActivity(final IWindowComponent activity) {
| [DELETED] |
20,610 | package com.microsoft.aad.adal;
<BUG>import junit.framework.Assert;
import org.mockito.Mockito;</BUG>
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
| import org.json.JSONException;
import org.mockito.Mockito;
|
20,611 | HttpUrlConnectionFactory.mockedConnection = null;
assertTrue(discovery.isValidAuthority(testingURL));
}</BUG>
public void testIsValidAuthorityPositiveInList() throws MalformedURLException {
final Discovery discovery = new Discovery();
<BUG>final URL endpointFull = new URL("https://login.windows.net/common/oauth2/author... | }
}
|
20,612 | HttpUrlConnectionFactory.mockedConnection = mockedConnection;
Util.prepareMockedUrlConnection(mockedConnection);
final String response = "{invalidJson}";
Mockito.when(mockedConnection.getInputStream()).thenReturn(Util.createInputStream(response));
Mockito.when(mockedConnection.getResponseCode()).thenReturn(200);
<BUG>T... | final String response = "{\"error_codes\":\"errors\"}";
Mockito.when(mockedConnection.getResponseCode()).thenReturn(400);
try {
discovery.isValidAuthority(endpointFull);
fail();
} catch (AuthenticationException e) {
assertNotNull(e);
assertTrue(e.getCode().equals(ADALError.DEVELOPER_AUTHORITY_IS_NOT_VALID_INSTANCE));
}... |
20,613 | authContext.acquireTokenSilentAsync("resource", "clientid", TEST_USERID, callback);
final CountDownLatch signal = new CountDownLatch(1);
signal.await(ACTIVITY_TIME_OUT, TimeUnit.MILLISECONDS);
assertNull(callback.callbackException);
assertNotNull(callback.callbackResult);
<BUG>assertTrue(callback.callbackResult.getAcce... | assertTrue(authContext.getCache() instanceof DefaultTokenCacheStore);
cacheStore.removeAll();
|
20,614 | verify(mockedAccountManager, times(0)).getAuthToken(Mockito.any(Account.class), Matchers.anyString(),
Matchers.any(Bundle.class), Matchers.eq(false), (AccountManagerCallback<Bundle>) Matchers.eq(null),
Matchers.any(Handler.class));
assertNull(callback.callbackException);
assertNotNull(callback.callbackResult);
<BUG>ass... | assertTrue(authContext.getCache() instanceof DefaultTokenCacheStore);
cacheStore.removeAll();
|
20,615 | final Calendar expiredTime = new GregorianCalendar();
expiredTime.add(Calendar.MINUTE, -MINUS_MINUITE);
final ITokenCacheStore cacheStore = getTokenCache(expiredTime.getTime());
final AccountManager mockedAccountManager = getMockedAccountManager();
mockAccountManagerGetAccountBehavior(mockedAccountManager);
<BUG>mockGe... | mockGetAuthTokenCallWithThrow(mockedAccountManager);
|
20,616 | mismatches * Math.log10(probMismatch) +
matches * Math.log10(1-probMismatch);
}
return model;
}
<BUG>private int getNumberOfMismatches(byte[] data, Collection<Byte> refBase) {
</BUG>
int mismatches = 0;
for (byte seqBase : data) {
if (!refBase.contains(seqBase))
| private int getNumberOfMismatches (byte[] data, Collection<Byte> refBase) {
|
20,617 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args... | return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
20,618 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, s... | return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
20,619 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() ... | TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
20,620 | import co.cask.cdap.templates.etl.batch.sinks.KVTableSink;
import co.cask.cdap.templates.etl.batch.sources.KVTableSource;
import co.cask.cdap.templates.etl.common.Constants;
import co.cask.cdap.templates.etl.common.DefaultStageConfigurer;
import co.cask.cdap.templates.etl.common.config.ETLStage;
<BUG>import co.cask.cda... | import co.cask.cdap.templates.etl.transforms.StructuredRecordToGenericRecordTransform;
import com.google.common.base.Preconditions;
|
20,621 | private final Map<String, String> transformClassMap;
public ETLBatchTemplate() throws Exception {
sourceClassMap = Maps.newHashMap();
sinkClassMap = Maps.newHashMap();
transformClassMap = Maps.newHashMap();
<BUG>initTable(Lists.<Class>newArrayList(KVTableSource.class, KVTableSink.class, IdentityTransform.class));
}</B... | initTable(Lists.<Class>newArrayList(KVTableSource.class, KVTableSink.class, IdentityTransform.class,
StructuredRecordToGenericRecordTransform.class));
}
|
20,622 | String sinkName = sink.getName();
String sourceClassName = sourceClassMap.get(sourceName);
String sinkClassName = sinkClassMap.get(sinkName);
BatchSource batchSource = (BatchSource) Class.forName(sourceClassName).newInstance();
BatchSink batchSink = (BatchSink) Class.forName(sinkClassName).newInstance();
<BUG>if (trans... | Preconditions.checkArgument(batchSink.getKeyType().equals(batchSource.getKeyType()));
Preconditions.checkArgument(batchSink.getValueType().equals(batchSource.getValueType()));
|
20,623 | private void validateTransforms(List<ETLStage> transform) throws Exception {
for (int i = 0; i < transform.size() - 1; i++) {
String transform1 = transformClassMap.get(transform.get(i).getName());
String transform2 = transformClassMap.get(transform.get(i + 1).getName());
Transform firstTransform = (Transform) Class.for... | Preconditions.checkArgument(secondTransform.getKeyInType().equals(firstTransform.getKeyInType()));
Preconditions.checkArgument(secondTransform.getValueInType().equals(firstTransform.getValueInType()));
Preconditions.checkArgument(secondTransform.getKeyOutType().equals(firstTransform.getKeyOutType()));
Preconditions.che... |
20,624 | private static final DoubleArrays INSTANCE = new DoubleArrays();
public static DoubleArrays instance() {
return INSTANCE;
}
private Arrays arrays = Arrays.instance();
<BUG>@VisibleForTesting
Failures failures = Failures.instance();
@VisibleForTesting
DoubleArrays() {
</BUG>
this(StandardComparisonStrategy.instance());... | [DELETED] |
20,625 | protected void preStop() {
super.preStop();
serverPoolMemberTrackerPolicy.reset();
}
protected abstract boolean reconfigureService();
<BUG>public void update() {
</BUG>
if (!isActive()) updateNeeded = true;
else {
updateNeeded = false;
| public synchronized void update() {
|
20,626 | LOG.info("Adding to {}, new member {} with address {}", new Object[] {this, member, address});
update();
serverPoolTargets.add(member);
}
protected synchronized void removeServerPoolMember(Entity member) {
<BUG>if (LOG.isTraceEnabled()) LOG.trace("Considering to remove from {}, member {} in locations {} - "+
"waiting f... | if (!serverPoolTargets.contains(member)) {
if (LOG.isTraceEnabled()) LOG.trace("For {}, not removing as don't have member {}", new Object[] {this, member});
String address = getAddressOfEntity(member);
|
20,627 | package com.orientechnologies.orient.core.index;
import com.orientechnologies.orient.core.db.ODatabase;
<BUG>import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.record.impl.ODocument;</BUG>
import com.orientechnologies.orient.core.storage.impl.local.OAbstractPagina... | import com.orientechnologies.orient.core.exception.OInvalidIndexEngineIdException;
import com.orientechnologies.orient.core.record.impl.ODocument;
|
20,628 | import com.orientechnologies.orient.core.db.ODatabaseDocumentInternal;
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.db.record.ridbag.sbtree.OIndexRIDContainer;
import com.orientechnologi... | import com.orientechnologies.orient.core.exception.OInvalidIndexEngineIdException;
import com.orientechnologies.orient.core.exception.OTooBigIndexKeyException;
|
20,629 | private final String name;
private final OReadersWriterSpinLock rwLock = new OReadersWriterSpinLock();
private final AtomicLong rebuildVersion = new AtomicLong();
private final int version;
protected String valueContainerAlgorithm;
<BUG>protected int indexId = -1;
</BUG>
privat... | protected volatile int indexId = -1;
|
20,630 | if (!txIsActive)
keyLockManager.acquireSharedLock(key);
try {
acquireSharedLock();
try {
<BUG>assert indexId >= 0;
return storage.indexContainsKey(indexId, key);
} finally {</BUG>
releaseSharedLock();
}
| while (true)
} catch (OInvalidIndexEngineIdException e) {
doReloadIndexEngine();
|
20,631 | }
}
@Override
public Object getLastKey() {
acquireSharedLock();
<BUG>try {
return storage.getIndexLastKey(indexId);
} finally {</BUG>
releaseSharedLock();
}
| public void setRebuildingFlag() {
rebuilding = true;
|
20,632 | final boolean txIsActive = database.getTransaction().isActive();
if (!txIsActive)
keyLockManager.acquireExclusiveLock(key);
try {
acquireSharedLock();
<BUG>try {
return storage.removeKeyFromIndex(indexId, key);
} finally {</BUG>
releaseSharedLock();
}
| while (true)
} catch (OInvalidIndexEngineIdException e) {
doReloadIndexEngine();
|
20,633 | final boolean txIsActive = database.getTransaction().isActive();
if (!txIsActive)
keyLockManager.lockAllExclusive();
try {
acquireSharedLock();
<BUG>try {
storage.clearIndex(indexId);
return this;</BUG>
} finally {
releaseSharedLock();
| keyLockManager.acquireExclusiveLock(key);
while (true)
return storage.removeKeyFromIndex(indexId, key);
} catch (OInvalidIndexEngineIdException e) {
doReloadIndexEngine();
}
|
20,634 | }
}
@Override
public OIndexKeyCursor keyCursor() {
acquireSharedLock();
<BUG>try {
return storage.getIndexKeyCursor(indexId);
} finally {</BUG>
releaseSharedLock();
}
| return this;
} finally {
|
20,635 | @Override
public Object callEngine(OIndexEngine engine) {
engine.init(getName(), getType(), getDefinition(), isAutomatic(), getMetadata());
return null;
}
<BUG>});
}</BUG>
protected static final class IndexTxSnapshot {
public Map<Object, Object> indexSnapshot = new HashMap<Object, Object>();
public boolean ... | break;
} catch (OInvalidIndexEngineIdException e) {
doReloadIndexEngine();
|
20,636 | values.put(AlumContract.ArticleEntry.COL_USER_ID, user.getLong("id"));
values.put(AlumContract.ArticleEntry.COL_USER_NAME, user.getString("name"));
if (user.get("avatar") != null) values.put(AlumContract.ArticleEntry.COL_USER_AVATAR, user.getString("avatar"));
values.put(AlumContract.ArticleEntry.COL_CREATED_AT, Utilit... | [DELETED] |
20,637 | import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
class AlumDbHelper extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "alum.db";
<BUG>private static final int DATABASE_VERSION = 1;
</BUG>
private static final String TEXT... | private static final int DATABASE_VERSION = 4;
|
20,638 | AlumContract.ArticleEntry.COL_USER_ID + INT_NOT_NULL + ", " +
AlumContract.ArticleEntry.COL_USER_NAME + TEXT_NOT_NULL + ", " +
AlumContract.ArticleEntry.COL_USER_AVATAR + " TEXT, " +
AlumContract.ArticleEntry.COL_CREATED_AT + INT_NOT_NULL + ", " +
AlumContract.ArticleEntry.COL_UPDATED_AT + INT_NOT_NULL + ", " +
<BUG>Al... | AlumContract.ArticleEntry.COL_RANDOM_TAG_ID + " INTEGER, " +
AlumContract.ArticleEntry.COL_RANDOM_TAG + " TEXT, " +
|
20,639 | public static final String COL_CREATED_AT = "created_at";
public static final String COL_UPDATED_AT = "updated_at";
public static final String COL_RANDOM_TAG_ID = "tag_id";
public static final String COL_RANDOM_TAG = "tag";
public static final String COL_BOOKMARKED = "bookmarked";
<BUG>public static final String COL_FO... | public static final String COL_FOLLOWING_AUTHOR = "userName";
|
20,640 | } catch (ParseException e) {
e.printStackTrace();
return null;
}
}
<BUG>private static String formatTimeAgo(Context context, long date) {
</BUG>
long timeDiffMillis = Calendar.getInstance().getTimeInMillis() - date;
if (timeDiffMillis < TimeUnit.MINUTES.toMillis(1))
return context.getString(R.string.seconds_ago, TimeUn... | public static String formatTimeAgo(Context context, long date) {
|
20,641 | switch (item.getItemId()){
case R.id.post:
addPost();
startActivity(new Intent(this, MainActivity.class));
break;
<BUG>case R.id.post_photo_menu:
break;</BUG>
}
return super.onOptionsItemSelected(item);
}
| case R.id.item_post_image:
|
20,642 | User user = dataSnapshot.getValue(User.class);
if (user == null){
Log.e(LOG_TAG, "USER IS NULL");
Toast.makeText(NewPostActivity.this, getString(R.string.user_null), Toast.LENGTH_LONG).show();
} else{
<BUG>submitPost(uId, user.name, text, image);
</BUG>
}
}
@Override
| submitPost(uId, user.name, user.photoUrl, text, image);
|
20,643 | void onBookmarkClick(long articleId, boolean wasBookmarkedBeforeClick, ImageView icon);
}
@Override
public ArticleViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (parent instanceof RecyclerView) {
<BUG>View view = LayoutInflater.from(mContext).inflate(R.layout.item, parent, false);
</BUG>
view.setFoc... | View view = LayoutInflater.from(mContext).inflate(R.layout.item_article, parent, false);
|
20,644 | import com.google.android.gms.tasks.Task;
import com.google.developer.udacityalumni.R;
import com.google.developer.udacityalumni.adapter.PageAdapter;
import com.google.developer.udacityalumni.data.AlumContract;
import com.google.developer.udacityalumni.fragment.ArticleFragment;
<BUG>import com.google.developer.udacitya... | import com.google.developer.udacityalumni.fragment.PostFragment;
import com.google.developer.udacityalumni.service.AlumIntentService;
import com.google.developer.udacityalumni.utility.Utility;
|
20,645 | if (auth.getCurrentUser() == null) {
startActivity(new Intent(this, LoginActivity.class));
finish();
} else {
setContentView(R.layout.activity_main);
<BUG>ButterKnife.bind(this);
FirebaseUser user = auth.getCurrentUser();</BUG>
TextView tv = (TextView) mNavView.getHeaderView(0).findViewById(R.id.nav_header_name_tv);
tv... | startService(new Intent(this, AlumIntentService.class));
Utility.scheduleArticleSync(this);
FirebaseUser user = auth.getCurrentUser();
|
20,646 | Picasso.with(this).load(user.getPhotoUrl()).placeholder(R.drawable.placeholder)
.error(R.drawable.ic_person).into(cv);
} else {
cv.setImageResource(R.drawable.ic_person);
}
<BUG>if (mToolbar != null && savedInstanceState != null)
mToolbar.setTitle(mTitle);</BUG>
if (mToolbar != null) {
Drawable overflowIcon = mToolbar.... | [DELETED] |
20,647 | }
@Exclude
public Map<String, Object> toMap() {
HashMap<String, Object> result = new HashMap<>();
result.put("uid", uid);
<BUG>result.put("user", user);
result.put("text", text);</BUG>
result.put("photoUrl", photoUrl);
result.put("numLikes", numLikes);
| result.put("userName", userName);
result.put("userProfPic", userProfPic);
result.put("text", text);
|
20,648 | import org.apache.commons.logging.LogFactory;
import java.util.HashMap;
import java.util.Map;</BUG>
public class AttachmentData extends IndexData
{
<BUG>static final Map MIMETYPES = new HashMap();
static {</BUG>
MIMETYPES.put("pdf", "application/pdf");
MIMETYPES.put("doc", "application/msword");
MIMETYPES.put("sxw", "a... | import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import com.xpn.xwiki.XWikiContext;
import com.xpn.xwiki.doc.XWikiAttachment;
import com.xpn.xwiki.doc.XWikiDocument;
static final Map<String, String> MIMETYPES = new HashMap<String, String>();
static {
|
20,649 | public static final String DOCUMENT_CREATOR = "creator";
public static final String DOCUMENT_DATE = "date";
public static final String DOCUMENT_CREATIONDATE = "creationdate";
public static final String FULLTEXT = "ft";
public static final String KEYWORDS = "kw";
<BUG>public static final String DATE_FORMAT = "yyyyMMddHH... | private static final FastDateFormat df = FastDateFormat.getInstance(IndexFields.DATE_FORMAT);
|
20,650 | import org.apache.lucene.document.Field;</BUG>
import org.apache.lucene.index.Term;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
<BUG>import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;</BUG>
import com.xpn.xwiki.XWikiContext;
import com.xpn.xwiki.do... | package com.xpn.xwiki.plugin.lucene;
import java.util.Date;
import org.apache.commons.logging.LogFactory;
import org.apache.lucene.document.Field;
|
20,651 | retval.append(documentName).append(".");
retval.append(language);
return retval.toString();
}
public String getFullText(XWikiDocument doc, XWikiContext context)
<BUG>{
StringBuffer sb = new StringBuffer(documentName).append(" ").append(documentWeb).append(" ")
.append(author).append(creator);
return sb.toString();</BU... | StringBuffer sb =
new StringBuffer(documentName).append(" ").append(documentWeb).append(" ").append(
return sb.toString();
|
20,652 | 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;
|
20,653 | 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());
|
20,654 | 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
|
20,655 | <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;
|
20,656 | 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] |
20,657 | <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;
|
20,658 | 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;
|
20,659 | 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;
|
20,660 | 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);
|
20,661 | 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 {
|
20,662 | 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(),
|
20,663 | )
);
}else{
return new TimeNode(
generateDayCandidatesQuestionMarkNotSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
20,664 | }
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);
|
20,665 | 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] |
20,666 | <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;
|
20,667 | 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;
|
20,668 | 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()
|
20,669 | initFactory(addresses);
}
}
public TestHazelcastInstanceFactory() {
this.count = 0;
<BUG>this.registry = new TestNodeRegistry(addressMap.values());
</BUG>
}
public TestHazelcastInstanceFactory(int initialPort, String... addresses) {
this.count = addresses.length;
| this.registry = new TestNodeRegistry(Collections.unmodifiableCollection(addressMap.values()));
|
20,670 | private void initFactory(Collection<Address> addresses) {
int ix = 0;
for (Address address : addresses) {
addressMap.put(ix++, address);
}
<BUG>this.registry = new TestNodeRegistry(addressMap.values());
</BUG>
}
public HazelcastInstance newHazelcastInstance() {
return newHazelcastInstance((Config) null);
| this.registry = new TestNodeRegistry(Collections.unmodifiableCollection(addressMap.values()));
|
20,671 | ClusterJoinManager clusterJoinManager = node.clusterService.getClusterJoinManager();
long joinStartTime = Clock.currentTimeMillis();
long maxJoinMillis = getMaxJoinMillis();
while (node.isRunning() && !node.joined()
&& (Clock.currentTimeMillis() - joinStartTime < maxJoinMillis)) {
<BUG>try {
lookupMasterAddress();
if (... | if (masterAddress == null) {
}
logger.fine("This node is found as master, no need to join.");
node.setJoined();
|
20,672 | return true;
}
@Override
public void addConnectionListener(ConnectionListener connectionListener) {
connectionListeners.add(connectionListener);
<BUG>}
public void destroyConnection(final Connection connection) {</BUG>
final Address endPoint = connection.getEndPoint();
final boolean removed = mapConnections.remove(endP... | public void destroyConnection(final Connection connection) {
|
20,673 | import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.openapi.roots.ModuleRootModel;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
<BUG>import org.jetbrains.annotations.NotNull;
import java.io.IOException;<... | import org.jetbrains.annotations.Nullable;
import java.io.IOException;
|
20,674 | String getDescription();
void assertCompatible(final ModuleRootModel model) throws ConfigurationException;
void detach(@NotNull Module module);
void moduleRenamed(@NotNull Module module, @NotNull String oldName, @NotNull String newName);
@NotNull
<BUG>ClasspathConverter createConverter(@NotNull Module module);
String g... | @Nullable
String getContentRoot(@NotNull ModuleRootModel model);
|
20,675 | if (storageType == null) {
throw new IllegalStateException("Classpath storage requires non-default storage type");
}
ClasspathStorageProvider provider = getProvider(storageType);
if (provider == null) {
<BUG>throw new IllegalStateException("Classpath storage provider not found, please ensure that Eclipse plugin is inst... | throw new IllegalStateException("Classpath storage provider " + storageType + " not found, please make sure the plugin is installed");
|
20,676 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args... | return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
20,677 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, s... | return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
20,678 | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
<BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39)
.process(() -> 9999L);
Task... | Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
|
20,679 | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef")
.process(() -> instanceField +... | Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
|
20,680 | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef")
.process(() -> local + " won't cause an outer reference");</BUG>
serialize(task);
Task<String> des = deserialize();
context.e... | Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
|
20,681 | }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
<BUG>return Task.ofType(String.class).named("StandardArgs", first, second)
.process(() -> second + " " + first * 100);</BUG>
}
@Test
public void shouldParseFlags() throws Exception {
| return Task.named("StandardArgs", first, second).ofType(String.class)
.process(() -> second + " " + first * 100);
|
20,682 | assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
<BUG>return Task.ofType(String.class).named("Enums", enm)
.process(enm::toString);</BUG>
}
@Test
public void shouldParseCustomTypes() throws Exception {
| return Task.named("Enums", enm).ofType(String.class)
.process(enm::toString);
|
20,683 | assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
<BUG>return Task.ofType(String.class).named("Types", myType.content)
.process(() -> myType.content);</BUG>
}
public enum CustomEnum {
BAR
| return Task.named("Types", myType.content).ofType(String.class)
.process(() -> myType.content);
|
20,684 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() ... | TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
20,685 | 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() );
|
20,686 | 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_();
|
20,687 | 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 );
|
20,688 | sink.tableCell();
sink.text( getI18nString( locale, "legend.shared" ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableCell();
iconError( sink );</BUG>
sink.tableCell_();
sink.tableCell();
sink.text( getI18nString( locale, "legend.different" ) );
| sink.tableCell( "15px" ); // according /images/icon_error_sml.gif
iconError( sink );
|
20,689 | sink.tableCaption();
sink.text( getI18nString( locale, "stats.caption" ) );
sink.tableCaption_();</BUG>
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.subprojects" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
s... | sink.bold();
sink.bold_();
sink.tableCaption_();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.subprojects" ) );
sink.tableHeaderCell_();
|
20,690 | sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.dependencies" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( depCount ) );
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.dependencies" ) );
sink.tableHeaderCell_();
|
20,691 | sink.text( String.valueOf( convergence ) + "%" );
sink.bold_();
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.readyrelease" ) );
sink.tableHeaderCell_();
|
20,692 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| iconError( sink );
|
20,693 | public ReportElement getBase() {
return base;
}
@Override
public float print(PDDocument document, PDPageContentStream stream, int pageNumber, float startX, float startY, float allowedWidth) throws IOException {
<BUG>PDPage currPage = (PDPage) document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pag... | PDPage currPage = document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, PDPageContentStream.AppendMode.APPEND, false);
|
20,694 | public PdfTextStyle(String config) {
Assert.hasText(config);
String[] split = config.split(",");
Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000");
fontSize = Integer.parseInt(split[0]);
<BUG>font = resolveStandard14Name(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1),... | font = getFont(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));
|
20,695 | 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;
|
20,696 | 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);
|
20,697 | 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);
|
20,698 | 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);
|
20,699 | 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) {
|
20,700 | 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;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.