id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
34,401
} @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_memo); <BUG>ChinaPhoneHelper.setStatusBar(this,true); </BUG> topicId = getIntent().getLongExtra("topicId", -1); if (topicId == -1) { finish();
ChinaPhoneHelper.setStatusBar(this, true);
34,402
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, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != nu...
MemoEntry.COLUMN_ORDER + " ASC", null);
34,403
MemoEntry._ID + " = ?", new String[]{String.valueOf(memoId)}); } public long updateMemoContent(long memoId, String memoContent) { ContentValues values = new ContentValues(); <BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent); return db.update(</BUG> MemoEntry.TABLE_NAME, values, MemoEntry._ID + " = ?",
return db.update(
34,404
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; <BUG>import com.kiminonawa.mydiary.shared.ThemeManager; import java.util.List; public class MemoAdapter extends RecyclerView.A...
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
34,405
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; <BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMe...
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
34,406
this.memoList = memoList; this.dbManager = dbManager; this.callback = callback; } @Override <BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { </BUG> View view; if (isEditMode) { if (viewType == TYPE_HEADER) {
public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
34,407
editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment"); } }); } } <BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private View rootView; private TextView TV_memo_item_content;</BUG> private ImageView IV_memo_item_delete;
protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener { private ImageView IV_memo_item_dot; private TextView TV_memo_item_content;
34,408
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> a[i][j] = operator.applyAsBoolean(a[i][j]); }
public boolean[] row(final int rowIndex) { N.checkArgument(rowIndex >= 0 && rowIndex < n, "Invalid row Index: %s", rowIndex); return a[rowIndex];
34,409
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> result[i][j] = zipFunction.apply(a[i][j], b[i][j]); }
public boolean get(final int i, final int j) { return a[i][j];
34,410
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> result[i][j] = zipFunction.apply(a[i][j], b[i][j], c[i][j]); }
return new BooleanMatrix(c);
34,411
} public AsyncExecutor(int maxConcurrentThreadNumber, long keepAliveTime, TimeUnit unit) { this.maxConcurrentThreadNumber = maxConcurrentThreadNumber; this.keepAliveTime = keepAliveTime; this.unit = unit; <BUG>} public AsyncExecutor(final ExecutorService executorService) { this(8, 300, TimeUnit.SECONDS); this.executorS...
[DELETED]
34,412
results.add(execute(cmd)); } return results; } public <T> CompletableFuture<T> execute(final Callable<T> command) { <BUG>final CompletableFuture<T> future = new CompletableFuture<T>(this, command); getExecutorService().execute(future);</BUG> return future; } public <T> List<CompletableFuture<T>> execute(final Callable<...
final CompletableFuture<T> future = new CompletableFuture<>(this, command); getExecutorService().execute(future);
34,413
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AFileSystem extends FileSyste...
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AFileSystem extends FileSystem {
34,414
public void initialize(URI name, Configuration conf) throws IOException { super.initialize(name, conf); uri = URI.create(name.getScheme() + "://" + name.getAuthority()); workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri, this.getWorkingDirectory()); <BUG>String accessKey = conf.get(...
String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null)); String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
34,415
} else { accessKey = userInfo; } } AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain( <BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey), new InstanceProfileCredentialsProvider(), new S3AAnonymousAWSCredentialsProvider() );</BUG> bucket = name.getHost();
new BasicAWSCredentialsProvider(accessKey, secretKey), new AnonymousAWSCredentialsProvider()
34,416
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)); </BUG> s3 = new AmazonS3Client(credentials, awsConf); <BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS); partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THR...
new InstanceProfileCredentialsProvider(), new AnonymousAWSCredentialsProvider() bucket = name.getHost(); ClientConfiguration awsConf = new ClientConfiguration(); awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS))); awsConf.setProtocol(conf.g...
34,417
cannedACL = null; } if (!s3.doesBucketExist(bucket)) { throw new IOException("Bucket " + bucket + " does not exist"); } <BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART); long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_...
boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART)); long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART...
34,418
import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AOutputStream extends OutputStream {</BUG> private OutputStream backupStream; private File backup...
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AOutputStream extends OutputStream {
34,419
this.client = client; this.progress = progress; this.fs = fs; this.cannedACL = cannedACL; this.statistics = statistics; <BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (conf.get(BUFFER_DIR, null) ...
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
34,420
setUpFrameworkPrincipalClass(requirement); } } catch (NoSuchFieldException e) { } catch (IllegalAccessException e) { NSLog.err.appendln("Can't read field REQUIRES from " + c.getName() + ", check if it is 'public static Class[] REQUIRES= new Class[] {...}' in this class"); <BUG>NSForwardException._runtimeExceptionForThr...
throw NSForwardException._runtimeExceptionForThrowable(e);
34,421
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
34,422
} @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_memo); <BUG>ChinaPhoneHelper.setStatusBar(this,true); </BUG> topicId = getIntent().getLongExtra("topicId", -1); if (topicId == -1) { finish();
ChinaPhoneHelper.setStatusBar(this, true);
34,423
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, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != nu...
MemoEntry.COLUMN_ORDER + " ASC", null);
34,424
MemoEntry._ID + " = ?", new String[]{String.valueOf(memoId)}); } public long updateMemoContent(long memoId, String memoContent) { ContentValues values = new ContentValues(); <BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent); return db.update(</BUG> MemoEntry.TABLE_NAME, values, MemoEntry._ID + " = ?",
return db.update(
34,425
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; <BUG>import com.kiminonawa.mydiary.shared.ThemeManager; import java.util.List; public class MemoAdapter extends RecyclerView.A...
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
34,426
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; <BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMe...
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
34,427
this.memoList = memoList; this.dbManager = dbManager; this.callback = callback; } @Override <BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { </BUG> View view; if (isEditMode) { if (viewType == TYPE_HEADER) {
public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
34,428
editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment"); } }); } } <BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private View rootView; private TextView TV_memo_item_content;</BUG> private ImageView IV_memo_item_delete;
protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener { private ImageView IV_memo_item_dot; private TextView TV_memo_item_content;
34,429
StringWriter xml = new StringWriter(); exporter.exportProfile(profile, xml); assertXmlAreSimilar(xml.toString(), "test_xml_complete.xml"); } @Test <BUG>public void shouldBuildOnlyOneModuleWhenNoActiveRules() { FindBugsFilter filter = FindbugsProfileExporter.buildFindbugsFilter(Collections.<ActiveRule> emptyList()); as...
assertXmlAreSimilar(xml.toString(), "test_header.xml");
34,430
assertThat(filter.getMatchs()).hasSize(0); } @Test public void shouldBuildModuleWithProperties() { ActiveRule activeRule = anActiveRule(DLS_DEAD_LOCAL_STORE); <BUG>FindBugsFilter filter = FindbugsProfileExporter.buildFindbugsFilter(Arrays.asList(activeRule)); assertThat(filter.getMatchs()).hasSize(1);</BUG> assertThat(...
FindBugsFilter filter = new FindBugsFilter(); FindbugsProfileExporter.addRules(filter, Arrays.asList(activeRule)); assertThat(filter.getMatchs()).hasSize(1);
34,431
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.Performan...
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
34,432
@PerformanceTestSuite public ParameterizedTestList testPerformance() throws Exception { Helper helper = new Helper(); ParameterizedTestList testCenter = new ParameterizedTestList(); testCenter.setTestSuiteTitle("jcr.resource-2.0.10"); <BUG>testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper)); ...
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper, 100, 10)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper, 100, 50)); testCenter.addTestObject(new ResolveNonExistingWithManyV...
34,433
package org.apache.sling.performance; <BUG>import static org.mockito.Mockito.*; import javax.jcr.NamespaceRegistry;</BUG> import javax.jcr.Session; import junitx.util.PrivateAccessor;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.mock; import javax.jcr.NamespaceRegistry;
34,434
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.Performan...
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
34,435
import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.jcr.api.SlingRepository; import org.apache.sling.jcr.resource.JcrResourceConstants; import org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProviderFactory; import org.apache.sling.performance.annotation.PerformanceTestSuite; <BU...
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
34,436
@PerformanceTestSuite public ParameterizedTestList testPerformance() throws Exception { Helper helper = new Helper(); ParameterizedTestList testCenter = new ParameterizedTestList(); testCenter.setTestSuiteTitle("jcr.resource-2.2.0"); <BUG>testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper)); t...
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper, 100, 10)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper, 100, 50)); testCenter.addTestObject(new ResolveNonExistingWithManyV...
34,437
private long acceptanceTime; private String user; @XmlElement(name = "resource-allocations") private List<ResourceAllocationInfo> resourceAllocations = new ArrayList<>(); @XmlElement(name = "reservation-id") <BUG>private ReservationIdInfo reservationId; </BUG> @XmlElement(name = "reservation-definition") private Reserv...
private String reservationId;
34,438
return acceptanceTime; } public List<ResourceAllocationInfo> getResourceAllocations() { return resourceAllocations; } <BUG>public ReservationIdInfo getReservationId() { </BUG> return reservationId; } public ReservationDefinitionInfo getReservationDefinition() {
public String getReservationId() {
34,439
if (!this.isAuthenticationEnabled() && json == null) { return; } JSONObject reservations = json.getJSONObject("reservations"); testRDLHelper(reservations); <BUG>long reservationId = reservations.getJSONObject("reservation-id") .getLong("reservation-id"); assertEquals(id1.getId(), reservationId); </BUG> rm.stop();
String reservationName = reservations.getJSONObject ("reservation-definition").getString("reservation-name"); assertEquals(reservationName, "res_1");
34,440
this.notificationManager = notificationManager; this.userFinder = userFinder; } public boolean shouldExecuteOnProject(Project project) { return project.isLatestAnalysis(); <BUG>} public void decorate(Resource resource, DecoratorContext context) {</BUG> Snapshot currentSnapshot = resourcePersister.getSnapshot(resource);...
@SuppressWarnings("rawtypes") public void decorate(Resource resource, DecoratorContext context) {
34,441
if (ResourceUtils.isRootProject(resource)) { closeReviewsForDeletedResources(resourceId, currentSnapshot.getId()); } databaseSession.commit(); } <BUG>} protected int closeReviewsOnResolvedViolations(Resource resource, int resourceId, int snapshotId) { String conditions = " WHERE resource_id=" + resourceId + " AND " </...
@SuppressWarnings({"unchecked"}) protected int closeReviewsOnResolvedViolations(Resource<?> resource, int resourceId, int snapshotId) { String conditions = " WHERE resource_id=:" + RESOURCE_ID + " AND "
34,442
this.queryLogger = Loggers.getLogger(logger, ".query"); this.fetchLogger = Loggers.getLogger(logger, ".fetch"); queryLogger.setLevel(level); fetchLogger.setLevel(level); indexSettingsService.addListener(new ApplySettings()); <BUG>} private long parseTimeSetting(String name, long defaultNanos) { try { return componentSe...
[DELETED]
34,443
.permission(pluginContainer.getName() + ".admin") .build(), "force-register", "forceregister"); commandDispatcher.register(this, CommandSpec.builder()</BUG> .executor(new ResetPasswordCommand()) .arguments( <BUG>GenericArguments.onlyOne(GenericArguments.string(Text.of("account"))) , GenericArguments.string(Text.of("pas...
.build(), pluginContainer.getName()); game.getEventManager().registerListeners(this, new ConnectionListener());
34,444
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;
34,445
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());
34,446
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
34,447
<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;
34,448
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]
34,449
<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;
34,450
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;
34,451
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;
34,452
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);
34,453
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 {
34,454
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(),
34,455
) ); }else{ return new TimeNode( generateDayCandidatesQuestionMarkNotSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
34,456
} 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);
34,457
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]
34,458
<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;
34,459
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;
34,460
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()
34,461
boolean _contains = superClasses.contains(cl); boolean _not = (!_contains); if (!_not) { sneakyThrowRuleFailedException("!superClasses.contains(cl)"); } <BUG>it.xsemantics.example.fj.fj.Class _superclass_1 = cl.getSuperclass(); List<Field> inheritedFields = this.fjAux.getFields(_superclass_1); </BUG> final Consumer<Fie...
List<Field> inheritedFields = this.fjAux.getFields(cl.getSuperclass());
34,462
if (!_notEquals) { sneakyThrowRuleFailedException("field.name != inheritedField.name"); } } catch (Exception e) { previousFailure = extractRuleFailedException(e); <BUG>EObject _eContainer = inheritedField.eContainer(); String _stringRep = FjAltTypeSystem.this.stringRep(_eContainer); </BUG> String _plus = ("field alread...
String _stringRep = FjAltTypeSystem.this.stringRep(inheritedField.eContainer());
34,463
final Consumer<EStructuralFeature> _function = new Consumer<EStructuralFeature>() { public void accept(final EStructuralFeature it) { type1Internal(G, _trace_, it); } }; <BUG>_eStructuralFeatures.forEach(_function); </BUG> return new Result<Boolean>(true); } protected Result<Boolean> type1Impl(final RuleEnvironment G, ...
obj.eClass().getEStructuralFeatures().forEach(_function);
34,464
} catch (Exception e) { previousFailure = extractRuleFailedException(e); String error = "this is an error"; EClass _eClass = o2.eClass(); EObject source = _eClass; <BUG>EClass _eClass_1 = o2.eClass(); EStructuralFeature _eContainingFeature = _eClass_1.eContainingFeature(); </BUG> EStructuralFeature feature = _eContaini...
EStructuralFeature _eContainingFeature = o2.eClass().eContainingFeature();
34,465
if (!_equals) { sneakyThrowRuleFailedException("eClass.name == \'foo\'"); } } catch (Exception e) { previousFailure = extractRuleFailedException(e); <BUG>EClass _eClass = object.eClass(); String _name_1 = _eClass.getName(); </BUG> boolean _equals_1 = Objects.equal(_name_1, "bar"); if (!_equals_1) {
String _name_1 = object.eClass().getName();
34,466
} } catch (Exception e) { previousFailure = extractRuleFailedException(e); { try { <BUG>EClass _eClass = object.eClass(); String _name_1 = _eClass.getName(); </BUG> boolean _equals_1 = Objects.equal(_name_1, "bar"); if (!_equals_1) {
String _name_1 = object.eClass().getName();
34,467
@Override protected void doStart() throws MuleException { try { <BUG>if (deployer != null) { deployer.start(); }</BUG> httpServer.start();
protected void doDispose() holders.clear(); }
34,468
servletContext.addEventListener(new MuleServletContextListener(muleContext, getName())); ServletHolder holder = new ServletHolder();</BUG> holder.setServlet(servlet); servletContext.addServlet(holder, "/*"); servletContext.addServlet(JarResourceServlet.class, JarResourceServlet.DEFAULT_PATH_SPEC); <BUG>handlerCollectio...
servletContext.setConnectorNames(new String[] {connector.getName()}); ServletHolder holder = new ServletHolder();
34,469
{ public DummyJndiConfiguration() throws ClassNotFoundException {</BUG> } <BUG>} }</BUG>
path = ROOT; if (resourceBase != null)
34,470
import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import com.appboy.configuration.XmlAppConfigurationProvider; <BUG>import com.appboy.push.AppboyNotificationUtils; public final class AppboyGcmReceiver extends BroadcastReceiver {</BUG> private static final Str...
import com.appboy.support.AppboyLogger; public final class AppboyGcmReceiver extends BroadcastReceiver {
34,471
private static final String GCM_DELETED_MESSAGES_KEY = "deleted_messages"; private static final String GCM_NUMBER_OF_MESSAGES_DELETED_KEY = "total_deleted"; public static final String CAMPAIGN_ID_KEY = Constants.APPBOY_PUSH_CAMPAIGN_ID_KEY; @Override public void onReceive(Context context, Intent intent) { <BUG>Log.i(TA...
AppboyLogger.i(TAG, String.format("Received broadcast message. Message: %s", intent.toString()));
34,472
} else if (Constants.APPBOY_CANCEL_NOTIFICATION_ACTION.equals(action) && intent.hasExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG)) { int notificationId = intent.getIntExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG, Constants.APPBOY_DEFAULT_NOTIFICATION_ID); NotificationManager notificationManager = (NotificationManage...
AppboyLogger.w(TAG, String.format("The GCM receiver received a message not sent from Appboy. Ignoring the message."));
34,473
Log.e(TAG, "Device does not support GCM."); } else if ("INVALID_PARAMETERS".equals(error)) { Log.e(TAG, "The request sent by the device does not contain the expected parameters. This phone does not " + "currently support GCM."); } else { <BUG>Log.w(TAG, String.format("Received an unrecognised GCM registration error typ...
AppboyLogger.w(TAG, String.format("Received an unrecognised GCM registration error type. Ignoring. Error: %s", error));
34,474
} else if (registrationId != null) { Appboy.getInstance(context).registerAppboyPushMessages(registrationId); } else if (intent.hasExtra(GCM_UNREGISTERED_KEY)) { Appboy.getInstance(context).unregisterAppboyPushMessages(); } else { <BUG>Log.w(TAG, "The GCM registration message is missing error information, registration i...
AppboyLogger.w(TAG, "The GCM registration message is missing error information, registration id, and unregistration " +
34,475
if (GCM_DELETED_MESSAGES_KEY.equals(messageType)) { int totalDeleted = intent.getIntExtra(GCM_NUMBER_OF_MESSAGES_DELETED_KEY, -1); if (totalDeleted == -1) { Log.e(TAG, String.format("Unable to parse GCM message. Intent: %s", intent.toString())); } else { <BUG>Log.i(TAG, String.format("GCM deleted %d messages. Fetch the...
AppboyLogger.i(TAG, String.format("GCM deleted %d messages. Fetch them from Appboy.", totalDeleted));
34,476
package com.appboy; import android.content.BroadcastReceiver; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; <BUG>import android.util.Log; import android.content.Context;</BUG> import android.app.Notification; import android.app.NotificationManager; import com.appboy.configuration...
import com.appboy.support.AppboyLogger; import android.content.Context;
34,477
} else if (Constants.APPBOY_CANCEL_NOTIFICATION_ACTION.equals(action) && intent.hasExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG)) { int notificationId = intent.getIntExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG, Constants.APPBOY_DEFAULT_NOTIFICATION_ID); NotificationManager notificationManager = (NotificationManage...
AppboyLogger.w(TAG, String.format("The ADM receiver received a message not sent from Appboy. Ignoring the message."));
34,478
Notification notification = null; IAppboyNotificationFactory appboyNotificationFactory = AppboyNotificationUtils.getActiveNotificationFactory(); try { notification = appboyNotificationFactory.createNotification(appConfigurationProvider, context, admExtras, appboyExtras); } catch(Exception e) { <BUG>Log.e(TAG, "Failed t...
AppboyLogger.e(TAG, "Failed to create notification.", e);
34,479
package com.appboy; import android.graphics.Bitmap; import android.graphics.BitmapFactory; <BUG>import android.util.Log; import java.io.InputStream;</BUG> import java.net.MalformedURLException; import java.net.UnknownHostException; public class AppboyImageUtils {
import com.appboy.support.AppboyLogger; import java.io.InputStream;
34,480
public class AppboyImageUtils { private static final String TAG = String.format("%s.%s", Constants.APPBOY_LOG_TAG_PREFIX, AppboyImageUtils.class.getName()); public static final int BASELINE_SCREEN_DPI = 160; public static Bitmap downloadImageBitmap(String imageUrl) { if (imageUrl == null || imageUrl.length() == 0) { <B...
AppboyLogger.i(TAG, "Null or empty Url string passed to image bitmap download. Not attempting download.");
34,481
Log.d(TAG_BENCHMARK, "10: " + (System.currentTimeMillis() - startTime)); startTime = System.currentTimeMillis(); } final String md5String = mContact.getMD5EncryptedString(); final Painter painter = new Painter(canvas, context); <BUG>final int style = md5String.charAt(3) % 3; switch (md5String.charAt(3) % 3) { </BUG> de...
switch (md5String.charAt(3) % 4) {
34,482
@Override public void configure() { setName(NAME); setDescription("MapReduce Driver for ETL Batch Applications"); PipelineRegisterer pipelineRegisterer = new PipelineRegisterer(getConfigurer(), "batch"); <BUG>Pipeline pipelineIds = pipelineRegisterer.registerPlugins(</BUG> config, TimePartitionedFileSet.class, FileSetP...
Pipeline pipeline = pipelineRegisterer.registerPlugins(
34,483
.build(), true); if (config.getResources() != null) { setMapperResources(config.getResources()); } Map<String, String> properties = new HashMap<>(); <BUG>properties.put(Constants.Source.PLUGINID, pipelineIds.getSource()); properties.put(Constants.Sink.PLUGINIDS, GSON.toJson(pipelineIds.getSinks())); properties.put(Con...
properties.put(Constants.PIPELINEID, GSON.toJson(pipeline));
34,484
for (TransformInfo transformInfo : transformInfos) { if (transformInfo.getErrorDatasetName() != null) { addPropertiesToErrorDataset(transformInfo.getErrorDatasetName(), context); } } <BUG>List<SinkOutput> sinkOutputs = new ArrayList<>(); String sinkPluginIdsStr = properties.get(Constants.Sink.PLUGINIDS); Preconditions....
List<SinkInfo> sinkInfos = pipeline.getSinks();
34,485
} catch (Throwable t) { LOG.warn("Exception when calling onRunFinish on {}", batchSource, t); } } private void onRunFinishSinks(MapReduceContext context, boolean succeeded) { <BUG>String sinkPluginIdsStr = context.getSpecification().getProperty(Constants.Sink.PLUGINIDS); Preconditions.checkNotNull(sinkPluginIdsStr, "S...
String pipelineStr = context.getSpecification().getProperty(Constants.PIPELINEID); Preconditions.checkNotNull(pipelineStr, "pipeline could not be found in program properties."); List<SinkInfo> sinkInfos = GSON.fromJson(pipelineStr, Pipeline.class).getSinks(); for (SinkInfo sinkInfo : sinkInfos) {
34,486
} else { sinks.put(sinkPluginId, new MultiOutputSink<>(sink, context, runtimeContext.getMetrics(), sinkOutputNames)); } transformations.put(sinkPluginId, sink); } <BUG>TransformDetail transformDetail = new TransformDetail(transformations, mapperMetrics); transformExecutor = new TransformExecutor(transformDetail, connec...
transformExecutor = new TransformExecutor(transformations, mapperMetrics, connectionsMap, sourcePluginId);
34,487
import de.vanita5.twittnuker.receiver.NotificationReceiver; import de.vanita5.twittnuker.service.LengthyOperationsService; import de.vanita5.twittnuker.util.ActivityTracker; import de.vanita5.twittnuker.util.AsyncTwitterWrapper; import de.vanita5.twittnuker.util.DataStoreFunctionsKt; <BUG>import de.vanita5.twittnuker.u...
import de.vanita5.twittnuker.util.DebugLog; import de.vanita5.twittnuker.util.ImagePreloader;
34,488
final List<InetAddress> addresses = mDns.lookup(host); for (InetAddress address : addresses) { c.addRow(new String[]{host, address.getHostAddress()}); } } catch (final IOException ignore) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, ignore); }</BUG> }
DebugLog.w(LOGTAG, null, ignore);
34,489
@Override public void afterExecute(Bus handler, SingleResponse<Relationship> result) { if (result.hasData()) { handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData())); } else if (result.hasException()) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, "Unable to update friendship", result.getExcepti...
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
34,490
MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId); if (!Utils.isOfficialCredentials(context, accountId)) continue; try { microBlog.setActivitiesAboutMeUnread(cursor); } catch (MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
34,491
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBannerImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.form...
if (deleteImage) { Utils.deleteMedia(context, imageUri);
34,492
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBackgroundImage(fileBody, tile); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, S...
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
34,493
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); return twitter.updateProfileImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.for...
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
34,494
import de.vanita5.twittnuker.annotation.CustomTabType; import de.vanita5.twittnuker.library.MicroBlog; import de.vanita5.twittnuker.library.MicroBlogException; import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus; import de.vanita5.twittnuker.library.twitter.model.Status; <BUG>import de.vanita5.twittnuker...
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
34,495
context.getApplicationContext().sendBroadcast(intent); } } @Nullable public static Location getCachedLocation(Context context) { <BUG>if (BuildConfig.DEBUG) { Log.v(LOGTAG, "Fetching cached location", new Exception()); }</BUG> Location location = null;
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
34,496
import java.util.List; import java.util.Map.Entry; import javax.inject.Singleton; import okhttp3.Dns; @Singleton <BUG>public class TwidereDns implements Constants, Dns { </BUG> private static final String RESOLVER_LOGTAG = "TwittnukerDns"; private final SharedPreferences mHostMapping; private final SharedPreferencesWra...
public class TwidereDns implements Dns, Constants {
34,497
for (Location location : twitter.getAvailableTrends()) { map.put(location); } return map.pack(); } catch (final MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
34,498
import javax.enterprise.context.Dependent; import javax.enterprise.event.Observes; import javax.enterprise.inject.spi.AfterBeanDiscovery; import javax.enterprise.inject.spi.BeanManager; import javax.enterprise.inject.spi.Extension; <BUG>import org.wildfly.swarm.container.runtime.xmlconfig.XMLConfig; public class XMLCon...
import org.wildfly.swarm.spi.api.cdi.CommonBean; import org.wildfly.swarm.spi.api.cdi.CommonBeanBuilder; public class XMLConfigProducingExtension implements Extension {
34,499
import javax.enterprise.context.Dependent; import javax.enterprise.event.Observes; import javax.enterprise.inject.spi.AfterBeanDiscovery; import javax.enterprise.inject.spi.BeanManager; import javax.enterprise.inject.spi.Extension; <BUG>import org.jboss.weld.literal.DefaultLiteral; import org.wildfly.swarm.spi.api.conf...
import org.wildfly.swarm.spi.api.cdi.CommonBean; import org.wildfly.swarm.spi.api.cdi.CommonBeanBuilder; import org.wildfly.swarm.spi.api.config.ConfigView;
34,500
package org.wildfly.swarm.container.runtime.cdi; import java.util.List; <BUG>import java.util.Set; import javax.enterprise.context.spi.CreationalContext;</BUG> import javax.enterprise.event.Observes; import javax.enterprise.inject.spi.AfterBeanDiscovery; import javax.enterprise.inject.spi.Bean;
import java.util.function.Supplier; import javax.enterprise.context.spi.CreationalContext;