id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
301 | expiration = _context.clock().now() + DEFAULT_STREAM_DELAY_MAX;
_numWaiting++;
while (true) {
long remaining = expiration - _context.clock().now();
if (remaining <= 0) {
<BUG>if (_log.shouldLog(Log.WARN))
_log.warn("Refusing to connect since we have exceeded our max of "
</BUG>
+ _maxConcurrentStreams + " connections")... | _log.logAlways(Log.WARN, "Refusing to connect since we have exceeded our max of "
|
302 | _numWaiting--;
return null;
}
if (locked_tooManyStreams()) {
if (_numWaiting > _maxConcurrentStreams) {
<BUG>if (_log.shouldLog(Log.WARN))
_log.warn("Refusing connection since we have exceeded our max of "
</BUG>
+ _maxConcurrentStreams + " and there are " + _numWaiting
+ " waiting already");
| _log.logAlways(Log.WARN, "Refusing connection since we have exceeded our max of "
|
303 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
304 | }
@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);
|
305 | 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);
|
306 | 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(
|
307 | 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 {
|
308 | 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;
|
309 | 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) {
|
310 | 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;
|
311 | package org.opennms.features.vaadin.surveillanceviews.ui;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.Title;
<BUG>import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.UI;</BUG>
import com.vaadin.ui.VerticalLayout;
import org.opennms.features.vaadin.surveillanceviews.config.SurveillanceVie... | import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
|
312 | secondLayout.addComponent(surveillanceViewNodeRtcTable);
surveillanceViewTable.addDetailsTable(surveillanceViewAlarmTable);
surveillanceViewTable.addDetailsTable(surveillanceViewNotificationTable);
surveillanceViewTable.addDetailsTable(surveillanceViewNodeRtcTable);
rootLayout.addComponent(secondLayout);
<BUG>rootLayou... | setContent(rootLayout);
|
313 | import com.codahale.metrics.servlet.InstrumentedFilter;
import com.codahale.metrics.servlets.MetricsServlet;
import com.mycompany.myapp.web.filter.CachingHttpHeadersFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<BUG>import org.springframework.beans.factory.annotation.Autowired;
import org.springframe... | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
|
314 | private String termsOfServiceUrl;
private String contactName;
private String contactUrl;
private String contactEmail;
private String license;
<BUG>private String licenseUrl;
public String getTitle() {</BUG>
return title;
}
public void setTitle(String title) {
| private Boolean enabled;
public String getTitle() {
|
315 | import com.mycompany.myapp.config.Constants;
import com.mycompany.myapp.config.JHipsterProperties;
import java.util.Date;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<BUG>import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
</BUG>
import org.springframework.context.annotation.*;... | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
316 | import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import static springfox.documentation.builders.PathSelectors.regex;
@Configuration
@EnableSwagger2
<BUG>@ConditionalOnExpression("#{!environment.acceptsProfiles('" + Constants.SPRING_PROFILE_NO_... | @Profile("!" + Constants.SPRING_PROFILE_NO_SWAGGER)
@ConditionalOnProperty(prefix="jhipster.swagger", name="enabled")
public class SwaggerConfiguration {
|
317 | package com.mycompany.myapp.config;
import ch.qos.logback.classic.AsyncAppender;
import ch.qos.logback.classic.LoggerContext;
<BUG>import net.logstash.logback.appender.LogstashSocketAppender;
import org.slf4j.Logger;</BUG>
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import... | import net.logstash.logback.stacktrace.ShortenedThrowableConverter;
import org.slf4j.Logger;
|
318 | logstashAppender.setName("LOGSTASH");
logstashAppender.setContext(context);
String customFields = "{\"app_name\":\"" + appName + "\",\"app_port\":\"" + serverPort + "\"}";
logstashAppender.setSyslogHost(jHipsterProperties.getLogging().getLogstash().getHost());
logstashAppender.setPort(jHipsterProperties.getLogging().ge... | ShortenedThrowableConverter throwableConverter = new ShortenedThrowableConverter();
throwableConverter.setMaxLength(7500);
throwableConverter.setRootCauseFirst(true);
logstashAppender.setThrowableConverter(throwableConverter);
logstashAppender.start();
|
319 | @Column(name = "last_name", length = 50)
private String lastName;
@NotNull
@Email
@Size(max = 100)
<BUG>@Column(length = 100, unique = true)
</BUG>
private String email;
@NotNull
@Column(nullable = false)
| @Column(length = 100, unique = true, nullable = false)
|
320 | private String basedir;
private static final String SNAPSHOT = "-SNAPSHOT";
private String projectVersion;
private Model model;
private String userTag;
<BUG>private String currentTag;
protected void executeTask()</BUG>
throws MojoExecutionException
{
model = project.getModel();
| private String currentScmConnection;
private String currentScmDeveloperConnection;
protected void executeTask()
|
321 | }
catch ( Exception e )
{
throw new MojoExecutionException( "An error is occurred in the tag process.", e );
}
<BUG>}
}
</BUG>
| catch ( NumberFormatException e )
projectVersion = "";
|
322 | 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 {
|
323 | 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));
|
324 | } 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()
|
325 |
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... |
326 | 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... |
327 | 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 {
|
328 | 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);
|
329 | @SideOnly(Side.CLIENT)
public class GuiSeedAnalyzer extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation(Reference.MOD_ID, "textures/gui/GuiSeedAnalyzer.png");
public TileEntitySeedAnalyzer seedAnalyzer;
private boolean journalOpen;
<BUG>private GuiJournal guiJournal;
</BUG>
public... | private AgriGuiWrapper guiJournal;
|
330 | return;
}
ItemStack journal = seedAnalyzer.getStackInSlot(ContainerSeedAnalyzer.journalSlotId);
if(journal != null) {
journalOpen = true;
<BUG>guiJournal = new GuiJournal(journal);
</BUG>
guiJournal.setWorldAndResolution(this.mc, this.width, this.height);
}
}
| guiJournal = new AgriGuiWrapper(new GuiJournal(journal));
|
331 | public void terminate() {
if (monitor != null) {
Logger logger = LoggerFactory.getLogger(getClass());
logger.info("Shutting down server");
monitor.interrupt();
<BUG>monitor = null;
elasticsearch.terminate();
server.terminate();
}</BUG>
}
| if (elasticsearch != null) {
if (server != null) {
|
332 | 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;
|
333 | 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());
|
334 | 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
|
335 | <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;
|
336 | 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] |
337 | <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;
|
338 | 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;
|
339 | 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;
|
340 | 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);
|
341 | 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 {
|
342 | 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(),
|
343 | )
);
}else{
return new TimeNode(
generateDayCandidatesQuestionMarkNotSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
344 | }
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);
|
345 | 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] |
346 | <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;
|
347 | 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;
|
348 | 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()
|
349 | package org.jclouds.glacier;
import static com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor;
import static org.jclouds.Constants.PROPERTY_MAX_RETRIES;
import static org.jclouds.Constants.PROPERTY_SO_TIMEOUT;
<BUG>import static org.jclouds.glacier.util.TestUtils.buildPayload;
import static org.testng.A... | import static com.google.common.base.Charsets.UTF_8;
import static org.jclouds.util.Strings2.urlEncode;
import static org.testng.Assert.assertEquals;
|
350 | import org.apache.commons.lang3.math.NumberUtils;
import org.json.JSONException;
import org.mariotaku.microblog.library.MicroBlog;
import org.mariotaku.microblog.library.MicroBlogException;
import org.mariotaku.microblog.library.twitter.model.RateLimitStatus;
<BUG>import org.mariotaku.microblog.library.twitter.model.St... | import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
|
351 | 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());
|
352 | 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);
|
353 | 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);
|
354 | 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);
|
355 | import org.mariotaku.twidere.receiver.NotificationReceiver;
import org.mariotaku.twidere.service.LengthyOperationsService;
import org.mariotaku.twidere.util.ActivityTracker;
import org.mariotaku.twidere.util.AsyncTwitterWrapper;
import org.mariotaku.twidere.util.DataStoreFunctionsKt;
<BUG>import org.mariotaku.twidere.u... | import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.ImagePreloader;
|
356 | 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);
|
357 | 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);
|
358 | import android.content.Context;
import android.content.SharedPreferences;
import android.location.Location;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
<BUG>import android.util.Log;
import org.mariotaku.twidere.BuildConfig;
import org.mariotaku.twidere.Constants;
import org.mariotaku.twidere... | import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.JsonSerializer;
|
359 | }
public static LatLng getCachedLatLng(@NonNull final Context context) {
final Context appContext = context.getApplicationContext();
final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences();
if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null;
<BUG>if (BuildConfig.DEBUG) {
Lo... | DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
|
360 | public int destroySavedSearchAsync(final UserKey accountKey, final long searchId) {
final DestroySavedSearchTask task = new DestroySavedSearchTask(accountKey, searchId);
return asyncTaskManager.add(task, true);
}
public int destroyStatusAsync(final UserKey accountKey, final String statusId) {
<BUG>final DestroyStatusTa... | final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
|
361 | @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);
|
362 | 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);
|
363 | return false;
}
GeoPoint position;
if (mCurrentBestLocation == null) {
mCurrentBestLocation = LocationHelper.determineLastKnownLocation(mLocationManager);
<BUG>}
position = convertToGeoPoint(mCurrentBestLocation);</BUG>
mController.setCenter(position);
updateMyLocationMarker();
String locationInfo;
| if (mCurrentBestLocation != null) {
position = convertToGeoPoint(mCurrentBestLocation);
|
364 | if (locationAgeString == null) {
locationAgeString = mActivity.getString(R.string.toast_message_last_location_age_one_hour);
}
locationInfo = " " + locationAgeString + " | " + mCurrentBestLocation.getProvider();
Toast.makeText(mActivity, mActivity.getString(R.string.toast_message_last_location) + locationInfo, Toast.LE... | } else {
Toast.makeText(mActivity, mActivity.getString(R.string.toast_message_location_services_not_ready), Toast.LENGTH_LONG).show();
return false;
default:
|
365 | final String key = (token.startsWith("${") ? token.substring(2, token.length() - 1) : token);
final String temp = SecurityActions.getProperty(key);
if (temp != null)
token = temp;
for (RepositoryBuilder builder : builders) {
<BUG>CmrRepository repo = builder.buildRepository(token, config);
if (repo != null) {
return ... | CmrRepository[] repos = builder.buildRepository(token, config);
if (repos != null) {
return repos;
|
366 | </BUG>
return buildRepository(token, EMPTY_CONFIG);
}
@Override
<BUG>public CmrRepository buildRepository(String token, RepositoryBuilderConfig config) throws Exception {
</BUG>
if (token.equals("npm:") || token.equals("npm:/#")) {
return createNpmRepository("npm:", config.log, config.offline, config.currentDirectory);... | } else {
return null;
public CmrRepository[] buildRepository(String token) throws Exception {
public CmrRepository[] buildRepository(String token, RepositoryBuilderConfig config) throws Exception {
|
367 | return createNpmRepository(token, config.log, config.offline, config.currentDirectory);
} else {
return null;
}
}
<BUG>private CmrRepository createNpmRepository(String token, Logger log, boolean offline, String currentDirectory) {
</BUG>
File local = new File(currentDirectory, "node_modules");
String nodePath = token.s... | private CmrRepository[] createNpmRepository(String token, Logger log, boolean offline, String currentDirectory) {
|
368 | </BUG>
return buildRepository(token, EMPTY_CONFIG);
}
@Override
<BUG>public CmrRepository buildRepository(String token, RepositoryBuilderConfig config) throws Exception {
</BUG>
if (token.startsWith("assembly:")) {
token = token.substring(9);
String repoFolder = null;
int p = token.indexOf(SEPARATOR);
| } else {
return null;
public CmrRepository[] buildRepository(String token) throws Exception {
public CmrRepository[] buildRepository(String token, RepositoryBuilderConfig config) throws Exception {
|
369 | Manifest manifest = new Manifest(new FileInputStream(manifestFile));
Attributes attrs = manifest.getMainAttributes();
if (repoFolder == null) {
repoFolder = attrs.getValue(Constants.ATTR_ASSEMBLY_REPOSITORY);
}
<BUG>}
if (repoFolder != null && !repoFolder.isEmpty()) {
tmpAssemblyFolder = new File(tmpAssemblyFolder, rep... | [DELETED] |
370 | </BUG>
return buildRepository(token, EMPTY_CONFIG);
}
@Override
<BUG>public CmrRepository buildRepository(String token, RepositoryBuilderConfig config) throws Exception {
</BUG>
final File file = (token.startsWith("file:") ? new File(new URI(token)) : new File(token));
if (file.exists() == false)
throw new IllegalArgum... | File absfile = FileUtil.absoluteFile(FileUtil.applyCwd(cwd, file));
return absfile.getAbsolutePath();
public CmrRepository[] buildRepository(String token) throws Exception {
public CmrRepository[] buildRepository(String token, RepositoryBuilderConfig config) throws Exception {
|
371 | Assert.assertNotNull("Default module not found", def);
}
@Test
public void testGetMultiple() throws Exception {
RepositoryManagerBuilder builder = getRepositoryManagerBuilder(false, 60000, java.net.Proxy.NO_PROXY);
<BUG>CmrRepository externalRepo = builder.repositoryBuilder().buildRepository(Constants.REPO_URL_CEYLON);... | CmrRepository[] externalRepos = builder.repositoryBuilder().buildRepository(Constants.REPO_URL_CEYLON);
for (CmrRepository repo : externalRepos) {
builder.addRepository(repo);
RepositoryManager manager = builder.buildRepository();
|
372 | Assert.assertTrue("Marker file .missing not found", missing.exists());
}
@Test
public void testGetMultipleCached() throws Exception {
RepositoryManagerBuilder builder = getRepositoryManagerBuilder(false, 60000, java.net.Proxy.NO_PROXY);
<BUG>CmrRepository externalRepo = builder.repositoryBuilder().buildRepository(Const... | CmrRepository[] externalRepos = builder.repositoryBuilder().buildRepository(Constants.REPO_URL_CEYLON);
for (CmrRepository repo : externalRepos) {
builder.addRepository(repo);
RepositoryManager manager = builder.buildRepository();
|
373 | </BUG>
return buildRepository(token, EMPTY_CONFIG);
}
@Override
<BUG>public CmrRepository buildRepository(String token, RepositoryBuilderConfig config) throws Exception {
</BUG>
if (token.equals("aether") || token.equals("aether:") || token.equals("aether:/#")
|| token.equals("mvn") || token.equals("mvn:") || token.equ... | File f = FileUtil.absoluteFile(FileUtil.applyCwd(cwd, new File(token)));
token = f.getAbsolutePath();
return prefix + token;
public CmrRepository[] buildRepository(String token) throws Exception {
public CmrRepository[] buildRepository(String token, RepositoryBuilderConfig config) throws Exception {
|
374 | return createMavenRepository(token, "maven:", config);
} else {
return null;
}
}
<BUG>private CmrRepository createMavenRepository(String token, String prefix, RepositoryBuilderConfig config) throws Exception {
</BUG>
String settingsXml = null;
if (prefix != null) {
String settings = token.substring(prefix.length());
| private CmrRepository[] createMavenRepository(String token, String prefix, RepositoryBuilderConfig config) throws Exception {
|
375 | private void addRepo(RepositoryManagerBuilder builder, String repoUrl) {
try {
String path = builder.repositoryBuilder().absolute(cwd, repoUrl);
if(!avoidRepository(path)){
RepositoryBuilderConfig cfg = new RepositoryBuilderConfig(log, isOffline(config), getTimeout(config), getProxy(config), cwd.getAbsolutePath());
<BU... | CmrRepository[] repos = builder.repositoryBuilder().buildRepository(path, cfg);
for (CmrRepository repo : repos) {
}
}
|
376 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class StopAnalyzerProvider extends AbstractAnalyzerProvider<StopAnalyzer> {
</BUG>
pr... | public class StopAnalyzerProvider extends AbstractIndexAnalyzerProvider<StopAnalyzer> {
|
377 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class StandardAnalyzerProvider extends AbstractAnalyzerProvider<StandardAnalyzer> {
<... | public class StandardAnalyzerProvider extends AbstractIndexAnalyzerProvider<StandardAnalyzer> {
|
378 | import org.elasticsearch.index.Index;
import org.elasticsearch.index.settings.IndexSettings;
import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.settings.Settings;
<BUG>public class KeywordAnalyzerProvider extends AbstractAnalyzerProvi... | public class KeywordAnalyzerProvider extends AbstractIndexAnalyzerProvider<KeywordAnalyzer> {
|
379 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class CzechAnalyzerProvider extends AbstractAnalyzerProvider<CzechAnalyzer> {
</BUG>
... | public class CzechAnalyzerProvider extends AbstractIndexAnalyzerProvider<CzechAnalyzer> {
|
380 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class ArabicAnalyzerProvider extends AbstractAnalyzerProvider<ArabicAnalyzer> {
</BUG... | public class ArabicAnalyzerProvider extends AbstractIndexAnalyzerProvider<ArabicAnalyzer> {
|
381 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class CjkAnalyzerProvider extends AbstractAnalyzerProvider<CJKAnalyzer> {
</BUG>
priv... | public class CjkAnalyzerProvider extends AbstractIndexAnalyzerProvider<CJKAnalyzer> {
|
382 | Class<? extends TokenFilterFactory> type = tokenFilterSettings.getAsClass("type", null, "org.elasticsearch.index.analysis.", "TokenFilterFactory");
if (type == null) {
throw new IllegalArgumentException("Token Filter [" + tokenFilterName + "] must have a type associated with it");
}
tokenFilterBinder.addBinding(tokenFi... | AnalysisBinderProcessor.TokenFiltersBindings tokenFiltersBindings = new AnalysisBinderProcessor.TokenFiltersBindings(tokenFilterBinder, tokenFiltersSettings);
processor.processTokenFilters(tokenFiltersBindings);
|
383 | Class<? extends TokenizerFactory> type = tokenizerSettings.getAsClass("type", null, "org.elasticsearch.index.analysis.", "TokenizerFactory");
if (type == null) {
throw new IllegalArgumentException("Tokenizer [" + tokenizerName + "] must have a type associated with it");
}
tokenizerBinder.addBinding(tokenizerName).toPro... | AnalysisBinderProcessor.TokenizersBindings tokenizersBindings = new AnalysisBinderProcessor.TokenizersBindings(tokenizerBinder, tokenizersSettings);
processor.processTokenizers(tokenizersBindings);
|
384 | } else {
throw new IllegalArgumentException("Analyzer [" + analyzerName + "] must have a type associated with it or a tokenizer");
}
}
analyzerBinder.addBinding(analyzerName).toProvider(FactoryProvider.newFactory(AnalyzerProviderFactory.class, type)).in(Scopes.SINGLETON);
<BUG>}
for (AnalysisBinderProcessor processor :... | AnalysisBinderProcessor.AnalyzersBindings analyzersBindings = new AnalysisBinderProcessor.AnalyzersBindings(analyzerBinder, analyzersSettings, indicesAnalysisService);
processor.processAnalyzers(analyzersBindings);
|
385 | import org.elasticsearch.index.settings.IndexSettings;
import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
<BUG>public class ThaiAnalyzerProvider extends AbstractAnalyzerP... | public class ThaiAnalyzerProvider extends AbstractIndexAnalyzerProvider<ThaiAnalyzer> {
|
386 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class PersianAnalyzerProvider extends AbstractAnalyzerProvider<PersianAnalyzer> {
</B... | public class PersianAnalyzerProvider extends AbstractIndexAnalyzerProvider<PersianAnalyzer> {
|
387 | import org.elasticsearch.index.Index;
import org.elasticsearch.index.settings.IndexSettings;
import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.settings.Settings;
<BUG>public class ChineseAnalyzerProvider extends AbstractAnalyzerProvi... | public class ChineseAnalyzerProvider extends AbstractIndexAnalyzerProvider<ChineseAnalyzer> {
|
388 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class BrazilianAnalyzerProvider extends AbstractAnalyzerProvider<BrazilianAnalyzer> {... | public class BrazilianAnalyzerProvider extends AbstractIndexAnalyzerProvider<BrazilianAnalyzer> {
|
389 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class GermanAnalyzerProvider extends AbstractAnalyzerProvider<GermanAnalyzer> {
</BUG... | public class GermanAnalyzerProvider extends AbstractIndexAnalyzerProvider<GermanAnalyzer> {
|
390 | import org.elasticsearch.util.settings.ImmutableSettings;
import org.elasticsearch.util.settings.Settings;
import java.util.List;
import java.util.Map;
import static org.elasticsearch.util.collect.Lists.*;
<BUG>public class CustomAnalyzerProvider extends AbstractAnalyzerProvider<CustomAnalyzer> {
</BUG>
private final T... | public class CustomAnalyzerProvider extends AbstractIndexAnalyzerProvider<CustomAnalyzer> {
|
391 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class DutchAnalyzerProvider extends AbstractAnalyzerProvider<DutchAnalyzer> {
</BUG>
... | public class DutchAnalyzerProvider extends AbstractIndexAnalyzerProvider<DutchAnalyzer> {
|
392 | import org.elasticsearch.index.Index;
import org.elasticsearch.index.settings.IndexSettings;
import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.settings.Settings;
<BUG>public class SimpleAnalyzerProvider extends AbstractAnalyzerProvid... | public class SimpleAnalyzerProvider extends AbstractIndexAnalyzerProvider<SimpleAnalyzer> {
|
393 | import org.elasticsearch.util.collect.Iterators;
import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
<BUG>public class RussianAnalyzerProvider extends AbstractAnalyzerProv... | public class RussianAnalyzerProvider extends AbstractIndexAnalyzerProvider<RussianAnalyzer> {
|
394 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class GreekAnalyzerProvider extends AbstractAnalyzerProvider<GreekAnalyzer> {
</BUG>
... | public class GreekAnalyzerProvider extends AbstractIndexAnalyzerProvider<GreekAnalyzer> {
|
395 | InputSource is = new InputSource(new ByteArrayInputStream(data.getBytes()));
this.store(txn, broker, info, is, privileged);
}
public void removeDocument(Txn transaction, DBBroker broker, String docname) throws PermissionDeniedException, TriggerException, LockException {
collection.removeDocument(transaction, broker, do... | ClusterComunication cluster = ClusterComunication.getInstance();
if(cluster!=null)
cluster.removeDocument(this.getName(), docname);
|
396 | content = bos.toString();
}
} catch (IOException e) {
e.printStackTrace();
}
<BUG>try {
ClusterComunication.getInstance().storeDocument(this.getName(), document.getName().substring(this.getName().length() + 1), content);
</BUG>
} catch (ClusterException e) {
e.printStackTrace();
| [DELETED] |
397 | }
public void addCollection(Collection child) {
try {
collection.addCollection(child);
final int p = child.getName().lastIndexOf('/') + 1;
<BUG>final String childName = child.getName().substring(p);
ClusterComunication.getInstance().addCollection(this.getName(),childName);
</BUG>
} catch (ClusterException e) {
e.printS... | content = buffer.toString();
bos.flush();
bos.close();
if(uri==null){
content = bos.toString();
} catch (IOException e) {
|
398 | 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;
|
399 | 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;
|
400 | 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"),
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.