id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
18,101
public Option[] configure() { return new Option[] // { composite(super.configure("activemq", "activemq-blueprint")), replaceConfigurationFile("deploy/activemq-blueprint.xml", <BUG>new File(basedir + "/src/test/resources/org/apache/activemq/karaf/itest/activemq-blueprint.xml")) };</BUG> } @Test public void test() throws Throwable {
new File("src/test/resources/org/apache/activemq/karaf/itest/activemq-blueprint.xml")) };
18,102
package org.apache.activemq.karaf.itest; <BUG>import static org.junit.Assert.assertTrue; import java.util.concurrent.Callable;</BUG> import javax.jms.Connection; import org.apache.qpid.jms.JmsConnectionFactory; import org.junit.Ignore;
[DELETED]
18,103
@RunWith(PaxExam.class) public class ActiveMQAMQPBrokerFeatureTest extends ActiveMQBrokerFeatureTest {</BUG> private static final Integer AMQP_PORT = 61636; @Configuration <BUG>public static Option[] configure() { Option[] configure = configure("activemq", "activemq-amqp-client"); Option[] configuredOptions = configureBrokerStart(configure); return configuredOptions; }</BUG> @Override
@ExamReactorStrategy(PerClass.class) public class ActiveMQAMQPBrokerFeatureTest extends ActiveMQBrokerFeatureTest { return new Option[] // configure("activemq", "activemq-amqp-client"), // configureBrokerStart() }; }
18,104
if (src == null) { return false; } if (src instanceof Port) { Port p = (Port) src; <BUG>return p.canAcceptNewRelation() || p.canAcceptNewInsideRelation(); </BUG> } return (src instanceof Vertex); }
return p.canAcceptNewOutsideRelation() || p.canAcceptNewInsideRelation();
18,105
package org.eclipse.triquetrum.workflow.editor; import org.eclipse.graphiti.dt.IDiagramTypeProvider; <BUG>import org.eclipse.graphiti.features.ICreateConnectionFeature; import org.eclipse.graphiti.features.context.IDoubleClickContext;</BUG> import org.eclipse.graphiti.features.context.IPictogramElementContext; import org.eclipse.graphiti.features.context.impl.CreateConnectionContext; import org.eclipse.graphiti.features.context.impl.CustomContext;
import org.eclipse.emf.common.util.EList; import org.eclipse.graphiti.features.IFeatureProvider; import org.eclipse.graphiti.features.context.IDoubleClickContext;
18,106
import org.eclipse.graphiti.features.context.impl.CreateConnectionContext; import org.eclipse.graphiti.features.context.impl.CustomContext; import org.eclipse.graphiti.features.custom.ICustomFeature; import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm; import org.eclipse.graphiti.mm.pictograms.Anchor; <BUG>import org.eclipse.graphiti.mm.pictograms.AnchorContainer; import org.eclipse.graphiti.mm.pictograms.PictogramElement;</BUG> import org.eclipse.graphiti.services.Graphiti; import org.eclipse.graphiti.tb.ContextButtonEntry; import org.eclipse.graphiti.tb.DefaultToolBehaviorProvider;
import org.eclipse.graphiti.mm.pictograms.ContainerShape; import org.eclipse.graphiti.mm.pictograms.PictogramElement;
18,107
import org.eclipse.graphiti.tb.IContextButtonPadData; import org.eclipse.triquetrum.workflow.editor.features.ModelElementConfigureFeature; import org.eclipse.triquetrum.workflow.editor.features.PauseFeature; import org.eclipse.triquetrum.workflow.editor.features.ResumeFeature; import org.eclipse.triquetrum.workflow.editor.features.RunFeature; <BUG>import org.eclipse.triquetrum.workflow.editor.features.StopFeature; import org.eclipse.triquetrum.workflow.model.NamedObj;</BUG> import org.eclipse.triquetrum.workflow.model.Vertex; public class TriqToolBehaviorProvider extends DefaultToolBehaviorProvider { public TriqToolBehaviorProvider(IDiagramTypeProvider diagramTypeProvider) {
import org.eclipse.triquetrum.workflow.model.Entity; import org.eclipse.triquetrum.workflow.model.NamedObj;
18,108
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;
18,109
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 = integer -> new DateTime().withDayOfWeek(integer).dayOfWeek().getAsText(bundle.getLocale()); </BUG> NominalDescriptionStrategy dow = new NominalDescriptionStrategy(bundle, nominal, expression); dow.addDescription(fieldExpression -> { if (fieldExpression instanceof On) {
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());
18,110
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 DescriptionStrategy plainInstance(ResourceBundle bundle, final FieldExpression expression) {
integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()), expression
18,111
<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;
18,112
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; import java.util.Collections; import java.util.List; import java.util.Set;</BUG> class BetweenDayOfWeekValueGenerator extends FieldValueGenerator {
[DELETED]
18,113
<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;
18,114
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.DateTime; import java.util.List;</BUG> class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year;
package com.cronutils.model.time.generator; import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import com.cronutils.model.field.CronField;
18,115
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"); this.year = year;</BUG> this.month = month; }
Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" + " month"); this.year = year;
18,116
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 static int weekDayMapping(WeekDay source, WeekDay target, int weekday){ return source.mapTo(weekday, target);
public static final WeekDay JAVA8 = new WeekDay(1, false);
18,117
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.getValues().get(0);
ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException {
18,118
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) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
18,119
) ); }else{ return new TimeNode( generateDayCandidatesQuestionMarkNotSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
18,120
} 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);
18,121
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(date);
[DELETED]
18,122
<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;
18,123
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; import org.slf4j.LoggerFactory; import java.util.List;</BUG> class EveryFieldValueGenerator extends FieldValueGenerator {
package com.cronutils.model.time.generator; import java.time.ZonedDateTime; import java.util.List; import com.cronutils.model.field.CronField;
18,124
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()
18,125
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.Status; import org.mariotaku.sqliteqb.library.AllColumns;</BUG> import org.mariotaku.sqliteqb.library.Columns; import org.mariotaku.sqliteqb.library.Columns.Column; import org.mariotaku.sqliteqb.library.Expression;
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
18,126
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());
18,127
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.format("Unable to delete %s", file)); }</BUG> }
if (deleteImage) { Utils.deleteMedia(context, imageUri);
18,128
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, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
18,129
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.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
18,130
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.util.DataStoreUtils; import org.mariotaku.twidere.util.ImagePreloader;</BUG> import org.mariotaku.twidere.util.InternalTwitterContentUtils; import org.mariotaku.twidere.util.JsonSerializer; import org.mariotaku.twidere.util.NotificationManagerWrapper;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.ImagePreloader;
18,131
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);
18,132
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);
18,133
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.util.JsonSerializer;</BUG> import org.mariotaku.twidere.util.Utils;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.JsonSerializer;
18,134
} 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) { Log.d(HotMobiLogger.LOGTAG, "getting cached location"); }</BUG> final Location location = Utils.getCachedLocation(appContext);
DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
18,135
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 DestroyStatusTask task = new DestroyStatusTask(context,accountKey, statusId); </BUG> return asyncTaskManager.add(task, true); } public int destroyUserListAsync(final UserKey accountKey, final String listId) {
final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
18,136
@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.getException()); }</BUG> }
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
18,137
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);
18,138
private OgnlExpression findExpression(final int index) { final OgnlExpression[] expression = findChildrenByClass(OgnlExpression.class); assert index <= expression.length : "no expression at " + index + " '" + getText() + "'"; return expression[index]; } <BUG>private OgnlElement findElement(final int index) { final OgnlElement[] elements = findChildrenByClass(OgnlElement.class); assert index <= elements.length : "no element at " + index + " '" + getText() + "'"; return elements[index]; }</BUG> @NotNull
[DELETED]
18,139
return findElement(1); </BUG> } @NotNull <BUG>public OgnlElement getElse() { return findElement(2); </BUG> }
private OgnlExpression findExpression(final int index) { final OgnlExpression[] expression = findChildrenByClass(OgnlExpression.class); assert index <= expression.length : "no expression at " + index + " '" + getText() + "'"; return expression[index];
18,140
import com.intellij.psi.PsiType; import java.math.BigDecimal; import java.math.BigInteger; public class OgnlElementTypes { public static final OgnlElementType EXPRESSION_HOLDER = new OgnlElementType("EXPRESSION_HOLDER"); <BUG>public static final OgnlElementType PARENTHESIZED_EXPRESSION = new OgnlElementType("ParenthesizedExpression"); public static final OgnlElementType INDEXED_EXPRESSION = new OgnlElementType("IndexedExpression");</BUG> public static final OgnlElementType BINARY_EXPRESSION = new OgnlElementType("BinaryExpression") { @Override
public static final OgnlElementType PARENTHESIZED_EXPRESSION = new OgnlElementType("ParenthesizedExpression") {
18,141
List list = MailUtil.getEnvelopes(userId); JSONArray meArray = new JSONArray(); for (int i = 0; i < list.size(); i++) { MailEnvelope me = (MailEnvelope)list.get(i); JSONObject jMe = new JSONObject(); <BUG>jMe.put("id", me.getUID()); </BUG> jMe.put("email", me.getEmail()); jMe.put("subject", me.getSubject()); jMe.put("date", me.getDate().toString());
jMe.put("id", me.getMsgNum());
18,142
return _date; } public void setDate(Date date) { _date = date; } <BUG>public long getUID() { return _UID; } public void setUID(long UID) { _UID = UID; }</BUG> public boolean isRecent() {
public long getMsgNum() { return _msgNum; public void setMsgNum(long msgNum) { _msgNum = msgNum;
18,143
_answered = answered; } private String _email; private String _subject; private Date _date; <BUG>private long _UID; </BUG> private boolean _recent; private boolean _flagged; private boolean _answered;
private long _msgNum;
18,144
continue; } MailEnvelope me = new MailEnvelope(); if (MAIL_SENT_NAME.equals(_getCurrentFolder(userId).getName()) || MAIL_DRAFTS_NAME.equals(_getCurrentFolder(userId).getName())) { <BUG>Address [] recipients = msgs[i].getAllRecipients(); </BUG> StringBuffer email = new StringBuffer(); for (int j = 0; j < recipients.length; j++) { InternetAddress ia = (InternetAddress)recipients[j];
Address [] recipients = msgs[ii].getAllRecipients();
18,145
envelopes.add(me); } return envelopes; } public static MailMessage getMessage(String userId, int messageUID) <BUG>throws Exception { Message message = _getCurrentFolder(userId).getMessage(messageUID); MailMessage mm = new MailMessage(); mm.setSubject(message.getSubject());</BUG> mm.setFrom(message.getFrom()[0]);
MailMessage mm = null; try { mm.setSubject(message.getSubject());
18,146
public static void setCurrentFolder( String userId, String password, String folderName) throws Exception { _getFolder(userId, password, folderName); } <BUG>private static void _closeFolder(String userId) throws Exception { Folder folder = (Folder)_folder.get(userId); if (folder != null && folder.isOpen()) { folder.close(false); _folder.remove(userId);</BUG> }
[DELETED]
18,147
DatabaseHandler.getInstance().removeFeeds(null, feed.getId(), false); category.getFeeds().remove(feed); } private class MyFormatCountDownCallback implements ContextualUndoAdapter.CountDownFormatter { @Override <BUG>public String getCountDownString(long millisUntilFinished) { int seconds = (int) Math.ceil((millisUntilFinished / 1000.0));</BUG> if (seconds > 0) { return getResources().getQuantityString(R.plurals.countdown_seconds, seconds, seconds); }
if (getActivity() == null) return ""; int seconds = (int) Math.ceil((millisUntilFinished / 1000.0));
18,148
package org.sonar.core.graph; <BUG>import com.google.common.collect.Lists; </BUG> import com.tinkerpop.blueprints.Direction; import com.tinkerpop.blueprints.Edge; import com.tinkerpop.blueprints.Graph;
import com.google.common.collect.Sets;
18,149
Long snapshotId = (Long) component.element().getProperty("sid"); if (snapshotId != null) { for (PerspectiveBuilder builder : builders) { Perspective perspective = builder.load(component); if (perspective != null) { <BUG>Graph subGraph = SubGraph.extract(component.element(), builder.path()); </BUG> String data = writer.write(subGraph); mapper.insert(new GraphDto() .setData(data)
Graph subGraph = SubGraph.extract(component.element(), builder.storagePath());
18,150
<BUG>package org.sonar.core.test; import com.google.common.collect.Iterables;</BUG> import com.tinkerpop.blueprints.Direction; import com.tinkerpop.blueprints.Edge; import com.tinkerpop.blueprints.Vertex;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSortedSet; import com.google.common.collect.Iterables;
18,151
Vertex testable = edge.getVertex(Direction.OUT); testCases.add(beanGraph().wrap(testable, DefaultTestCase.class)); } return testCases; } <BUG>public Collection<TestCase> testCasesCoveringLine(int line) { List<TestCase> testCases = newArrayList(); for (Edge edge : getCovers()){ if (Iterables.contains(getCoveredLines(edge), Long.valueOf(line))){ </BUG> Vertex vertexTestable = edge.getVertex(Direction.OUT);
public Collection<TestCase> testCasesOfLine(int line) { ImmutableList.Builder<TestCase> cases = ImmutableList.builder(); for (Edge edge : getCovers()) { if (Iterables.contains(testedLines(edge), Long.valueOf(line))) {
18,152
package org.sonar.core.component; <BUG>import com.tinkerpop.blueprints.Graph; import com.tinkerpop.blueprints.Vertex;</BUG> import org.sonar.api.BatchComponent; import org.sonar.api.ServerComponent; import org.sonar.api.component.Perspective;
[DELETED]
18,153
package com.example.mapdemo; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; <BUG>import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Polygon;</BUG> import com.google.android.gms.maps.model.PolygonOptions; import android.graphics.Color;
import com.google.android.gms.maps.model.Dash; import com.google.android.gms.maps.model.Dot; import com.google.android.gms.maps.model.Gap; import com.google.android.gms.maps.model.JointType; import com.google.android.gms.maps.model.PatternItem; import com.google.android.gms.maps.model.Polygon;
18,154
sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).commit(); } @Override protected WatchFaceStyle getWatchFaceStyle(){ return new WatchFaceStyle.Builder(this) <BUG>.setAcceptsTapEvents(true) .setStatusBarGravity(Gravity.END | -20)</BUG> .build(); } @Override
.setHotwordIndicatorGravity(Gravity.TOP | Gravity.CENTER) .setStatusBarGravity(Gravity.END | -20)
18,155
return false; } @Override protected WatchFaceStyle getWatchFaceStyle(){ return new WatchFaceStyle.Builder(this) <BUG>.setAcceptsTapEvents(true) .setStatusBarGravity(Gravity.END | -20)</BUG> .build(); } @Override
.setHotwordIndicatorGravity(Gravity.TOP | Gravity.END) .setStatusBarGravity(Gravity.END | -20)
18,156
return (watchMode == WatchMode.LOW_BIT) || (watchMode == WatchMode.LOW_BIT_BURN_IN) || (watchMode == WatchMode.LOW_BIT_BURN_IN); } @Override protected WatchFaceStyle getWatchFaceStyle(){ return new WatchFaceStyle.Builder(this) <BUG>.setAcceptsTapEvents(true) .setStatusBarGravity(Gravity.END | -20)</BUG> .build(); } public int ageLevel() {
.setHotwordIndicatorGravity(Gravity.TOP | Gravity.CENTER) .setStatusBarGravity(Gravity.END | -20)
18,157
import android.os.AsyncTask; import android.os.Bundle; import android.os.PowerManager; import android.preference.PreferenceManager; import android.support.v4.content.LocalBroadcastManager; <BUG>import android.util.Log; import com.eveningoutpost.dexdrip.Home;</BUG> import com.eveningoutpost.dexdrip.Models.ActiveBluetoothDevice; import com.eveningoutpost.dexdrip.Models.AlertType; import com.eveningoutpost.dexdrip.Models.BgReading;
import android.widget.Toast; import com.eveningoutpost.dexdrip.Home;
18,158
private static final String WEARABLE_FIELD_PAYLOAD = "field_xdrip_plus_payload"; public static final String WEARABLE_VOICE_PAYLOAD = "/xdrip_plus_voice_payload"; public static final String WEARABLE_APPROVE_TREATMENT = "/xdrip_plus_approve_treatment"; public static final String WEARABLE_CANCEL_TREATMENT = "/xdrip_plus_cancel_treatment"; private static final String WEARABLE_TREATMENT_PAYLOAD = "/xdrip_plus_treatment_payload"; <BUG>private static final String WEARABLE_TOAST_NOTIFICATON = "/xdrip_plus_toast"; private static final String OPEN_SETTINGS_PATH = "/openwearsettings";</BUG> private static final String NEW_STATUS_PATH = "/sendstatustowear";//KS private static final String CAPABILITY_WEAR_APP = "wear_app_sync_bgs"; private String mWearNodeId = null;
private static final String WEARABLE_TOAST_LOCAL_NOTIFICATON = "/xdrip_plus_local_toast"; private static final String OPEN_SETTINGS_PATH = "/openwearsettings";
18,159
private static final int NOTIFICATION_ITEM = 541; private static int last_level = -1; private static boolean notification_showing = false; private static int threshold = 20; private static final int repeat_seconds = 1200; <BUG>public static void checkBridgeBattery() { if (!Home.getPreferencesBooleanDefaultFalse("bridge_battery_alerts")) return; </BUG> try {
public static boolean checkBridgeBattery() { boolean lowbattery = false; if (!Home.getPreferencesBooleanDefaultFalse("bridge_battery_alerts")) return false;
18,160
} final int this_level = Home.getPreferencesInt("bridge_battery", -1); if ((this_level > 0) && (threshold > 0)) { if ((this_level < threshold) && (this_level < last_level)) { if (JoH.pratelimit("bridge-battery-warning", repeat_seconds)) { <BUG>notification_showing = true; final PendingIntent pendingIntent = android.app.PendingIntent.getActivity(xdrip.getAppContext(), 0, new Intent(xdrip.getAppContext(), Home.class), android.app.PendingIntent.FLAG_UPDATE_CURRENT);</BUG> showNotification("Low bridge battery", "Bridge battery dropped to: " + this_level + "%", pendingIntent, NOTIFICATION_ITEM, true, true, false); } } else {
lowbattery = true; final PendingIntent pendingIntent = android.app.PendingIntent.getActivity(xdrip.getAppContext(), 0, new Intent(xdrip.getAppContext(), Home.class), android.app.PendingIntent.FLAG_UPDATE_CURRENT);
18,161
cancelNotification(NOTIFICATION_ITEM); notification_showing = false; } } last_level = this_level; <BUG>} }</BUG> public static void testHarness() { if (Home.getPreferencesInt(PREFS_ITEM, -1) < 1) Home.setPreferencesInt(PREFS_ITEM, 60);
return lowbattery;
18,162
myLayout.draw(canvas); } @Override protected WatchFaceStyle getWatchFaceStyle(){ return new WatchFaceStyle.Builder(this) <BUG>.setAcceptsTapEvents(true) .setStatusBarGravity(Gravity.END | -20)</BUG> .build(); } @Override
.setHotwordIndicatorGravity(Gravity.TOP | Gravity.CENTER) .setStatusBarGravity(Gravity.END | -20)
18,163
Debug.checkNull("mysql_connection", this.mysql_connection); return this.mysql_connection; } @Override public String toString () { <BUG>return "MySQLConnection[" + this.dataSource.getUrl() + " : " + this.dataSource.getURL() + "]"; }</BUG> @Override protected void finalize () throws Throwable { super.finalize();
return "MySQLConnection[" + this.mySQL.getUrl() + "]";
18,164
package com.jfixby.cmns.adopted.gdx.log; import com.badlogic.gdx.Application; import com.badlogic.gdx.Gdx; import com.jfixby.cmns.api.collections.EditableCollection; <BUG>import com.jfixby.cmns.api.collections.Map; import com.jfixby.cmns.api.log.LoggerComponent;</BUG> import com.jfixby.cmns.api.util.JUtils; public class GdxLogger implements LoggerComponent { public GdxLogger () {
import com.jfixby.cmns.api.err.Err; import com.jfixby.cmns.api.log.LoggerComponent;
18,165
package com.jfixby.red.collections; <BUG>import com.jfixby.cmns.api.java.IntValue; import com.jfixby.cmns.api.math.FloatMath;</BUG> public class RedHistogrammValue { private RedHistogramm master; public RedHistogrammValue (RedHistogramm redHistogramm) {
import com.jfixby.cmns.api.java.Int; import com.jfixby.cmns.api.math.FloatMath;
18,166
public static final String PackageName = "app.version.package_name"; } public static final String VERSION_FILE_NAME = "version.json"; private static final long serialVersionUID = 6662721574596241247L; public String packageName; <BUG>public int major = -1; public int minor = -1; public VERSION_STAGE stage = null; public int build = -1; </BUG> public int versionCode = -1;
public String major = ""; public String minor = ""; public String build = "";
18,167
<BUG>package com.jfixby.cmns.db.mysql; import com.jfixby.cmns.api.debug.Debug;</BUG> import com.jfixby.cmns.api.log.L; import com.jfixby.cmns.db.api.DBComponent; import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
import java.sql.Connection; import java.sql.SQLException; import com.jfixby.cmns.api.debug.Debug;
18,168
} public MySQLTable getTable (final String name) { return new MySQLTable(this, name); } public MySQLConnection obtainConnection () { <BUG>final MySQLConnection connection = new MySQLConnection(this.dataSource); connection.open();</BUG> return connection; } public void releaseConnection (final MySQLConnection connection) {
public String getDBName () { return this.dbName; final MySQLConnection connection = new MySQLConnection(this); connection.open();
18,169
import org.jboss.as.controller.registry.ManagementResourceRegistration; import org.jboss.dmr.ModelNode; import org.jboss.dmr.ModelType; import org.jboss.msc.service.ServiceController; import org.jboss.msc.service.ServiceName; <BUG>public class BackupSiteResourceDefinition extends SimpleResourceDefinition { static final SimpleAttributeDefinition FAILURE_POLICY = new SimpleAttributeDefinitionBuilder(ModelKeys.BACKUP_FAILURE_POLICY, ModelType.STRING, true)</BUG> .setXmlName(Attribute.BACKUP_FAILURE_POLICY.getLocalName()) .setAllowExpression(true) .setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)
public static final PathElement BACKUP_PATH = PathElement.pathElement(ModelKeys.BACKUP); static final SimpleAttributeDefinition FAILURE_POLICY = new SimpleAttributeDefinitionBuilder(ModelKeys.BACKUP_FAILURE_POLICY, ModelType.STRING, true)
18,170
.setReadOnly() .build() ; private final boolean runtimeRegistration; BackupSiteResourceDefinition(final boolean runtimeRegistration) { <BUG>super(PathElement.pathElement(ModelKeys.BACKUP), InfinispanExtension.getResourceDescriptionResolver(ModelKeys.BACKUP), new CacheConfigAdd(ATTRIBUTES), ReloadRequiredRemoveStepHandler.INSTANCE); </BUG> this.runtimeRegistration = runtimeRegistration; } @Override
super(BACKUP_PATH, InfinispanExtension.getResourceDescriptionResolver(ModelKeys.BACKUP), new CacheConfigAdd(ATTRIBUTES), ReloadRequiredRemoveStepHandler.INSTANCE);
18,171
package org.jboss.as.clustering.infinispan.subsystem; import java.util.HashMap; <BUG>import java.util.Map; import org.jboss.as.controller.AttributeDefinition;</BUG> import org.jboss.as.controller.ModelVersion; import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.SubsystemRegistration;
import org.jboss.as.clustering.infinispan.InfinispanMessages; import org.jboss.as.controller.AttributeDefinition;
18,172
.addRejectCheck( RejectAttributeChecker.SIMPLE_EXPRESSIONS, StoreWriteBehindResourceDefinition.FLUSH_LOCK_TIMEOUT, StoreWriteBehindResourceDefinition.MODIFICATION_QUEUE_SIZE, StoreWriteBehindResourceDefinition.SHUTDOWN_TIMEOUT, StoreWriteBehindResourceDefinition.THREAD_POOL_SIZE) .end(); } <BUG>static void setMapValues(Map<String, RejectAttributeChecker> map, RejectAttributeChecker checker, AttributeDefinition...defs) { </BUG> for (AttributeDefinition def : defs) { map.put(def.getName(), checker); }
static void setMapValues(Map<String, RejectAttributeChecker> map, RejectAttributeChecker checker, AttributeDefinition... defs) {
18,173
.setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, false, new ModelNode(true)), CacheResourceDefinition.STATISTICS) .addRejectCheck(RejectAttributeChecker.UNDEFINED, CacheResourceDefinition.STATISTICS) .addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, CacheResourceDefinition.STATISTICS) .addRejectCheck(new RejectAttributeChecker.SimpleRejectAttributeChecker(new ModelNode(false)), CacheResourceDefinition.STATISTICS) .end(); <BUG>cacheContainerBuilder.addChildResource(ReplicatedCacheResourceDefinition.REPLICATED_CACHE_PATH).getAttributeBuilder() .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, false, new ModelNode(true)), CacheResourceDefinition.STATISTICS) .addRejectCheck(RejectAttributeChecker.UNDEFINED, CacheResourceDefinition.STATISTICS) .addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, CacheResourceDefinition.STATISTICS) .addRejectCheck(new RejectAttributeChecker.SimpleRejectAttributeChecker(new ModelNode(false)), CacheResourceDefinition.STATISTICS) .end(); cacheContainerBuilder.addChildResource(InvalidationCacheResourceDefinition.INVALIDATION_CACHE_PATH).getAttributeBuilder()</BUG> .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, false, new ModelNode(true)), CacheResourceDefinition.STATISTICS)
[DELETED]
18,174
cacheContainerBuilder.addChildResource(LocalCacheResourceDefinition.LOCAL_CACHE_PATH).getAttributeBuilder() .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, false, new ModelNode(true)), CacheResourceDefinition.STATISTICS) .addRejectCheck(RejectAttributeChecker.UNDEFINED, CacheResourceDefinition.STATISTICS) .addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, CacheResourceDefinition.STATISTICS) .addRejectCheck(new RejectAttributeChecker.SimpleRejectAttributeChecker(new ModelNode(false)), CacheResourceDefinition.STATISTICS) <BUG>.end(); TransformationDescription.Tools.register(subsystemBuilder.build(), subsystem, version); }</BUG> private static void registerTransformers141(final SubsystemRegistration subsystem) { ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
TransformationDescription sub = subsystemBuilder.build(); TransformationDescription.Tools.register(sub, subsystem, version); }
18,175
import org.apache.sling.jcr.resource.JcrResourceConstants; import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl; import org.apache.sling.jcr.resource.internal.helper.MapEntries; import org.apache.sling.jcr.resource.internal.helper.Mapping; import org.apache.sling.performance.annotation.PerformanceTestSuite; <BUG>import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;</BUG> import org.junit.runner.RunWith;
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
18,176
@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 ResolveNonExistingWith5000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith10000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith1000AliasTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith5000AliasTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith10000AliasTest(helper)); </BUG> return testCenter;
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper, 100, 10)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper, 100, 50)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith10000VanityPathTest",helper, 100, 100)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWithManyAliasTest",helper, 1000)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith5000AliasTest",helper, 5000)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith10000AliasTest",helper, 10000));
18,177
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;
18,178
import org.apache.sling.jcr.resource.JcrResourceConstants; import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl; import org.apache.sling.jcr.resource.internal.helper.MapEntries; import org.apache.sling.jcr.resource.internal.helper.Mapping; import org.apache.sling.performance.annotation.PerformanceTestSuite; <BUG>import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;</BUG> import org.junit.runner.RunWith;
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
18,179
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; <BUG>import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;</BUG> import org.apache.sling.resourceresolver.impl.ResourceResolverFactoryActivator;
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
18,180
@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)); testCenter.addTestObject(new ResolveNonExistingWith5000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith10000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith1000AliasTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith5000AliasTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith10000AliasTest(helper)); </BUG> return testCenter;
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper, 100, 10)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper, 100, 50)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith10000VanityPathTest",helper, 100, 100)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith1000AliasTest",helper, 1000)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith5000AliasTest",helper, 5000)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith10000AliasTest",helper, 10000));
18,181
public static LookupElement convert(XQueryFunctionDecl functionDeclaration, String key) { return LookupElementBuilder.create(functionDeclaration.getFunctionName(), key) .withIcon(XQueryIcons.FUNCTION_ICON) .withTailText(getTailText(functionDeclaration), true) .withTypeText(getTypeText(functionDeclaration)) <BUG>.withInsertHandler(new XQueryFunctionInsertHandler()); }</BUG> private static String getTypeText(XQueryFunctionDecl functionDeclaration) { return functionDeclaration.getSequenceType() != null ? functionDeclaration.getSequenceType() .getText() : "item()*";
.withInsertHandler(new XQueryFunctionInsertHandler()) .withLookupString(functionDeclaration.getFunctionName().getLocalNameText()) }
18,182
XQueryTypes.K_PER_MILLE, XQueryTypes.K_PI, XQueryTypes.K_PRECEDING, XQueryTypes.K_PRECEDING_SIBLING, XQueryTypes.K_PRESERVE, <BUG>XQueryTypes.K_PREVIOUS, XQueryTypes.K_RETURN, XQueryTypes.K_SATISFIES,</BUG> XQueryTypes.K_SCHEMA, XQueryTypes.K_SCHEMA_ATTRIBUTE,
XQueryTypes.K_RENAME, XQueryTypes.K_REPLACE, XQueryTypes.K_REVALIDATION, XQueryTypes.K_SATISFIES,
18,183
import org.intellij.xquery.psi.XQueryModuleImport; import org.intellij.xquery.psi.XQueryParam; import org.intellij.xquery.psi.XQueryVarDecl; import org.intellij.xquery.psi.XQueryVarName; import org.intellij.xquery.psi.impl.XQueryPsiImplUtil; <BUG>import javax.swing.Icon; </BUG> import java.util.ArrayList; import java.util.LinkedList; import java.util.List;
import javax.swing.*;
18,184
public static LookupElement convert(BuiltInFunctionSignature functionSignature, String key) { return LookupElementBuilder.create(functionSignature, key) .withIcon(XQueryIcons.FUNCTION_ICON) .withTailText(getTailText(functionSignature), true) .withTypeText(getTypeText(functionSignature)) <BUG>.withInsertHandler(new XQueryFunctionInsertHandler()); }</BUG> private static String getTypeText(BuiltInFunctionSignature functionSignature) { return functionSignature.getReturnType(); }
.withInsertHandler(new XQueryFunctionInsertHandler()) .withLookupString(functionSignature.getName())
18,185
private final NoSqlAdapter adapter; private final EventAdmin eventAdmin; private final Map<String, NoSqlData> changedResources = new HashMap<String, NoSqlData>(); private final Set<String> deletedResources = new HashSet<String>(); public NoSqlResourceProvider(NoSqlAdapter adapter, EventAdmin eventAdmin) { <BUG>this.adapter = adapter; this.eventAdmin = eventAdmin;</BUG> } public Resource getResource(ResourceResolver resourceResolver, String path) { if (ROOT_PATH.equals(path)) {
this.adapter = new ValueMapConvertingNoSqlAdapter(adapter); this.eventAdmin = eventAdmin;
18,186
value = convertForWrite(IOUtils.toByteArray((InputStream)value)); } catch (IOException ex) { throw new RuntimeException("Unable to convert input stream to byte array."); } } <BUG>else if (value instanceof byte[]) { value = DatatypeConverter.printBase64Binary((byte[])value); } else if (value != null && !isValidPrimitveType(value.getClass())) { throw new IllegalArgumentException("Data type not supported for NoSqlValueMap: " + value.getClass());</BUG> }
else if (value != null && !isValidType(value.getClass())) { throw new IllegalArgumentException("Data type not supported for NoSqlValueMap: " + value.getClass());
18,187
else { return clazz == String.class || clazz == Integer.class || clazz == Long.class || clazz == Double.class <BUG>|| clazz == Boolean.class; }</BUG> } public static Map<String, Object> convertForWriteAll(Map<String, Object> map) { for (Map.Entry<String, Object> entry : map.entrySet()) {
|| clazz == Boolean.class || Calendar.class.isAssignableFrom(clazz);
18,188
public void setFeedbackFinishedListener(FeedbackFinishedListener feedbackFinishedListener) { mFeedbackFinishedListener = feedbackFinishedListener; } private boolean validatedMessage() { boolean validMessage = mMessageEditText.getText() != null && !StringUtils.isNullOrBlank(mMessageEditText.getText().toString()); <BUG>if (validMessage){ </BUG> mMessageEditText.setError(null); } else { mMessageEditText.setError(getResources().getString(R.string.com_appboy_feedback_form_invalid_message));
if (validMessage) {
18,189
langSettings.importOldIndentOptions(this); } } } } <BUG>private void importOldIndentOptions(@NonNls Element element) { final List options = element.getChildren("option"); for (Object option1 : options) {</BUG> @NonNls Element option = (Element)option1;
private boolean importOldIndentOptions(@NonNls Element element) { boolean optionsImported = false; for (Object option1 : options) {
18,190
if ("TAB_SIZE".equals(name)) { final int value = Integer.valueOf(option.getAttributeValue("value")).intValue(); JAVA_INDENT_OPTIONS.TAB_SIZE = value; JSP_INDENT_OPTIONS.TAB_SIZE = value; XML_INDENT_OPTIONS.TAB_SIZE = value; <BUG>OTHER_INDENT_OPTIONS.TAB_SIZE = value; }</BUG> else if ("INDENT_SIZE".equals(name)) { final int value = Integer.valueOf(option.getAttributeValue("value")).intValue(); JAVA_INDENT_OPTIONS.INDENT_SIZE = value;
optionsImported = true; }
18,191
else if ("INDENT_SIZE".equals(name)) { final int value = Integer.valueOf(option.getAttributeValue("value")).intValue(); JAVA_INDENT_OPTIONS.INDENT_SIZE = value; JSP_INDENT_OPTIONS.INDENT_SIZE = value; XML_INDENT_OPTIONS.INDENT_SIZE = value; <BUG>OTHER_INDENT_OPTIONS.INDENT_SIZE = value; }</BUG> else if ("CONTINUATION_INDENT_SIZE".equals(name)) { final int value = Integer.valueOf(option.getAttributeValue("value")).intValue(); JAVA_INDENT_OPTIONS.CONTINUATION_INDENT_SIZE = value;
optionsImported = true; }
18,192
else if ("CONTINUATION_INDENT_SIZE".equals(name)) { final int value = Integer.valueOf(option.getAttributeValue("value")).intValue(); JAVA_INDENT_OPTIONS.CONTINUATION_INDENT_SIZE = value; JSP_INDENT_OPTIONS.CONTINUATION_INDENT_SIZE = value; XML_INDENT_OPTIONS.CONTINUATION_INDENT_SIZE = value; <BUG>OTHER_INDENT_OPTIONS.CONTINUATION_INDENT_SIZE = value; }</BUG> else if ("USE_TAB_CHARACTER".equals(name)) { final boolean value = Boolean.valueOf(option.getAttributeValue("value")).booleanValue(); JAVA_INDENT_OPTIONS.USE_TAB_CHARACTER = value;
optionsImported = true; }
18,193
else if ("USE_TAB_CHARACTER".equals(name)) { final boolean value = Boolean.valueOf(option.getAttributeValue("value")).booleanValue(); JAVA_INDENT_OPTIONS.USE_TAB_CHARACTER = value; JSP_INDENT_OPTIONS.USE_TAB_CHARACTER = value; XML_INDENT_OPTIONS.USE_TAB_CHARACTER = value; <BUG>OTHER_INDENT_OPTIONS.USE_TAB_CHARACTER = value; }</BUG> else if ("SMART_TABS".equals(name)) { final boolean value = Boolean.valueOf(option.getAttributeValue("value")).booleanValue(); JAVA_INDENT_OPTIONS.SMART_TABS = value;
optionsImported = true; }
18,194
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.util.DataStoreUtils; import de.vanita5.twittnuker.util.ImagePreloader;</BUG> import de.vanita5.twittnuker.util.InternalTwitterContentUtils; import de.vanita5.twittnuker.util.JsonSerializer; import de.vanita5.twittnuker.util.NotificationManagerWrapper;
import de.vanita5.twittnuker.util.DebugLog; import de.vanita5.twittnuker.util.ImagePreloader;
18,195
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);
18,196
@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.getException()); }</BUG> }
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
18,197
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);
18,198
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.format("Unable to delete %s", file)); }</BUG> }
if (deleteImage) { Utils.deleteMedia(context, imageUri);
18,199
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, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
18,200
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.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);