id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
11,701
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;
11,702
} 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);
11,703
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);
11,704
@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);
11,705
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);
11,706
import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.pentaho.di.core.Const; <BUG>import org.pentaho.di.trans.TransMeta; import org.pentaho.di.ui.trans.step.BaseStepDialog;</BUG> import org.pentaho.di.trans.step.BaseStepMeta; import org.pentaho.di.trans.step.StepDialogInterface; import org.pentaho.di.trans.steps.addsequence.AddSequenceMeta;
import org.pentaho.di.ui.core.widget.TextVar; import org.pentaho.di.ui.trans.step.BaseStepDialog;
11,707
FormData fdlSchema = new FormData(); fdlSchema.left = new FormAttachment(0, 0); fdlSchema.right= new FormAttachment(middle, -margin); fdlSchema.top = new FormAttachment(wConnection, margin); wlSchema.setLayoutData(fdlSchema); <BUG>wSchema=new Text(gDatabase, SWT.SINGLE | SWT.LEFT | SWT.BORDER); </BUG> props.setLook(wSchema); wSchema.addModifyListener(lsMod); FormData fdSchema = new FormData();
wSchema=new TextVar(transMeta, gDatabase, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
11,708
FormData fdlSeqname = new FormData(); fdlSeqname.left = new FormAttachment(0, 0); fdlSeqname.right= new FormAttachment(middle, -margin); fdlSeqname.top = new FormAttachment(wSchema, margin); wlSeqname.setLayoutData(fdlSeqname); <BUG>wSeqname=new Text(gDatabase, SWT.SINGLE | SWT.LEFT | SWT.BORDER); </BUG> wSeqname.setText(""); //$NON-NLS-1$ props.setLook(wSeqname); wSeqname.addModifyListener(lsMod);
wSeqname=new TextVar(transMeta, gDatabase, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
11,709
data.counter.setCounter(nval); next = prev; } } else if (meta.isDatabaseUsed()) { try { <BUG>next = data.getDb().getNextSequenceValue(meta.getSchemaName(), meta.getSequenceName(), meta.getValuename()); } catch (KettleDatabaseException dbe) {</BUG> throw new KettleStepException(Messages.getString( "AddSequence.Exception.ErrorReadingSequence", meta.getSequenceName()), dbe); //$NON-NLS-1$ //$NON-NLS-2$ }
next = data.getDb().getNextSequenceValue(environmentSubstitute(meta.getSchemaName()), environmentSubstitute(meta.getSequenceName()), } catch (KettleDatabaseException dbe) {
11,710
if (orderEntry instanceof ModuleOrderEntry) { ModuleOrderEntry moduleOrderEntry = (ModuleOrderEntry)orderEntry; final Module depModule = moduleOrderEntry.getModule(); if (depModule != null) { Node node = graph.myNodes.get(depModule); <BUG>OrderEnumerator en = OrderEnumerator.orderEntries(depModule).exportedOnly().recursively(); if (node == null) {</BUG> node = new Node(); node.myKey = depModule; graph.myNodes.put(depModule, node);
OrderEnumerator en = OrderEnumerator.orderEntries(depModule).exportedOnly(); if (node == null) {
11,711
VirtualFile[] importedSourceRoots = en.sources().usingCache().getRoots(); for (VirtualFile sourceRoot : importedSourceRoots) { roots.putValue(sourceRoot, node); } } <BUG>boolean shouldRecurse = en.shouldRecurse(moduleOrderEntry, handlers); </BUG> node.myEdges.add(new Edge(module, moduleOrderEntry, shouldRecurse)); } }
[DELETED]
11,712
import javax.xml.bind.annotation.XmlRootElement; import se.bjurr.prnfb.settings.USER_LEVEL; @XmlRootElement @XmlAccessorType(FIELD) public class ButtonDTO { <BUG>private String title; private USER_LEVEL userLevel;</BUG> private UUID uuid; @Override
private String name; private String projectKey; private String repositorySlug; private USER_LEVEL userLevel;
11,713
} else if (!this.uuid.equals(other.uuid)) { return false; } return true; } <BUG>public String getTitle() { return this.title; }</BUG> public USER_LEVEL getUserLevel() {
public String getName() { return this.name; public String getProjectKey() { return this.projectKey; public String getRepositorySlug() { return this.repositorySlug;
11,714
return this.uuid; } @Override public int hashCode() { final int prime = 31; <BUG>int result = 1; result = prime * result + ((this.title == null) ? 0 : this.title.hashCode()); </BUG> result = prime * result + ((this.userLevel == null) ? 0 : this.userLevel.hashCode()); result = prime * result + ((this.uuid == null) ? 0 : this.uuid.hashCode());
public UUID getUUID() { result = prime * result + ((this.projectKey == null) ? 0 : this.projectKey.hashCode()); result = prime * result + ((this.repositorySlug == null) ? 0 : this.repositorySlug.hashCode()); result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
11,715
return false; } } else if (!this.name.equals(other.name)) { return false; } <BUG>if (this.uuid == null) { if (other.uuid != null) { return false; } } else if (!this.uuid.equals(other.uuid)) { return false; }</BUG> if (this.value == null) {
if (getClass() != obj.getClass()) { HeaderDTO other = (HeaderDTO) obj; if (this.name == null) { if (other.name != null) {
11,716
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) setOutlineProvider(ViewOutlineProvider.BOUNDS); } } @Override <BUG>public void draw(@NonNull Canvas canvas) { if (cornerRadius > 0 && getWidth() > 0 && getHeight() > 0 && Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT_WATCH) {</BUG> int saveCount = canvas.saveLayer(0, 0, getWidth(), getHeight(), null, Canvas.ALL_SAVE_FLAG); super.draw(canvas); paint.setXfermode(pdMode);
drawCalled = true; if (cornerRadius > 0 && getWidth() > 0 && getHeight() > 0 && Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT_WATCH) {
11,717
package org.springframework.integration.support.management; <BUG>import java.util.Arrays; import java.util.Map; import java.util.Map.Entry; import org.springframework.beans.BeansException;</BUG> import org.springframework.beans.factory.BeanNameAware;
import java.util.HashMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.BeansException;
11,718
import org.springframework.context.ApplicationContextAware; import org.springframework.util.Assert; import org.springframework.util.PatternMatchUtils; import org.springframework.util.StringUtils; public class IntegrationManagementConfigurer implements SmartInitializingSingleton, ApplicationContextAware, <BUG>BeanNameAware { public static final String MANAGEMENT_CONFIGURER_NAME = "integrationManagementConfigurer"; private ApplicationContext applicationContext;</BUG> private String beanName; private boolean defaultLoggingEnabled = true;
private static final Log logger = LogFactory.getLog(IntegrationManagementConfigurer.class); private final Map<String, MessageChannelMetrics> channelsByName = new HashMap<String, MessageChannelMetrics>(); private final Map<String, MessageHandlerMetrics> handlersByName = new HashMap<String, MessageHandlerMetrics>(); private final Map<String, MessageSourceMetrics> sourcesByName = new HashMap<String, MessageSourceMetrics>(); private ApplicationContext applicationContext;
11,719
bean.setStatsEnabled(this.defaultStatsEnabled); metrics.setFullStatsEnabled(this.defaultStatsEnabled); } if (bean instanceof ConfigurableMetricsAware) { ((ConfigurableMetricsAware<AbstractMessageChannelMetrics>) bean).configureMetrics(metrics); <BUG>} }</BUG> @SuppressWarnings("unchecked") private void configureHandlerMetrics(String name, MessageHandlerMetrics bean) { AbstractMessageHandlerMetrics metrics = this.metricsFactory.createHandlerMetrics(name);
this.channelsByName.put(name, bean);
11,720
bean.setStatsEnabled(this.defaultStatsEnabled); metrics.setFullStatsEnabled(this.defaultStatsEnabled); } if (bean instanceof ConfigurableMetricsAware) { ((ConfigurableMetricsAware<AbstractMessageHandlerMetrics>) bean).configureMetrics(metrics); <BUG>} }</BUG> private void configureSourceMetrics(String name, MessageSourceMetrics bean) { Boolean enabled = smartMatch(this.enabledCountsPatterns, name); if (enabled != null) {
((ConfigurableMetricsAware<AbstractMessageChannelMetrics>) bean).configureMetrics(metrics); this.channelsByName.put(name, bean); @SuppressWarnings("unchecked") private void configureHandlerMetrics(String name, MessageHandlerMetrics bean) { AbstractMessageHandlerMetrics metrics = this.metricsFactory.createHandlerMetrics(name); Assert.state(metrics != null, "'metrics' must not be null");
11,721
assertNotNull(error); assertThat(error, instanceOf(ErrorMessage.class)); assertThat(error.getPayload(), instanceOf(MessagingException.class)); assertThat(((MessagingException) error.getPayload()).getCause(), instanceOf(JmsTimeoutException.class)); assertEquals("foo", ((MessagingException) error.getPayload()).getFailedMessage().getPayload()); <BUG>this.gateway1.stop(); </BUG> } @Test @DirtiesContext
this.gateway2.stop();
11,722
@EnableIntegration public static class Config { @Bean public CachingConnectionFactory ccf() { return new CachingConnectionFactory( <BUG>new ActiveMQConnectionFactory("vm://localhosti?broker.persistent=false")); }</BUG> @Bean public JmsOutboundGateway gateway1() { JmsOutboundGateway gateway = new JmsOutboundGateway();
new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false")); }
11,723
private LocalBroadcastManager mLocalBroadcastManager; private String mActiveDownloadUrlString; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <BUG>setContentView(R.layout.activity_app_details2); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);</BUG> toolbar.setTitle(""); // Nice and clean toolbar setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.app_details2); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
11,724
.inflate(R.layout.app_details2_screenshots, parent, false); return new ScreenShotsViewHolder(view); } else if (viewType == VIEWTYPE_WHATS_NEW) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.app_details2_whatsnew, parent, false); <BUG>return new WhatsNewViewHolder(view); } else if (viewType == VIEWTYPE_LINKS) {</BUG> View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.app_details2_links, parent, false); return new ExpandableLinearLayoutViewHolder(view);
} else if (viewType == VIEWTYPE_DONATE) { .inflate(R.layout.app_details2_donate, parent, false); return new DonateViewHolder(view); } else if (viewType == VIEWTYPE_LINKS) {
11,725
import org.jboss.msc.service.Service; import org.jboss.msc.service.ServiceActivator; import org.jboss.msc.service.ServiceActivatorContext; import org.jboss.msc.service.ServiceContainer; import org.jboss.msc.service.ServiceController; <BUG>import org.jboss.msc.service.ServiceName; import org.jboss.msc.service.ServiceRegistryException; import org.jboss.msc.service.StartException;</BUG> public final class ServerStartTask implements ServerTask, Serializable, ObjectInputValidation { public static final ServiceName AS_SERVER_SERVICE_NAME = ServiceName.JBOSS.append("as", "server");
import org.jboss.msc.service.ServiceRegistry; import org.jboss.msc.service.ServiceTarget; import org.jboss.msc.service.StartException;
11,726
List<ValueData> vals = pData.getValues(); assertTrue(vals != null); assertFalse(vals.isEmpty()); assertTrue(vals.get(0) instanceof StreamPersistedValueData); StreamPersistedValueData fpvd = (StreamPersistedValueData)vals.get(0); <BUG>assertNotNull(fpvd.getFile()); assertTrue(cwdm.getItemData(id) == pData); fpvd.setPersistedFile(null); assertFalse(cwdm.getItemData(id) == pData);</BUG> assertTrue(cwdm.getItemData(id) == cwdm.getCachedItemData(id));
assertTrue(fpvd.getFile() != null || fpvd.getUrl() != null); if (fpvd.getFile() != null) else fpvd.setPersistedURL(null); assertFalse(cwdm.getItemData(id) == pData);
11,727
List<ValueData> vals = pData.getValues(); assertTrue(vals != null); assertFalse(vals.isEmpty()); assertTrue(vals.get(0) instanceof StreamPersistedValueData); StreamPersistedValueData fpvd = (StreamPersistedValueData)vals.get(0); <BUG>assertNotNull(fpvd.getFile()); PropertyData pData2 = null;</BUG> for (PropertyData pd : cwdm.getChildPropertiesData(data.parentData(), itemDataFilters)) { if (pd.getIdentifier().equals(data.getInternalIdentifier()))
assertTrue(fpvd.getFile() != null || fpvd.getUrl() != null); PropertyData pData2 = null; for (PropertyData pd : cwdm.getChildPropertiesData(data.parentData()))
11,728
List<ValueData> vals = pData.getValues(); assertTrue(vals != null); assertFalse(vals.isEmpty()); assertTrue(vals.get(0) instanceof StreamPersistedValueData); StreamPersistedValueData fpvd = (StreamPersistedValueData)vals.get(0); <BUG>assertNotNull(fpvd.getFile()); PropertyData pData2 = null;</BUG> for (PropertyData pd : cwdm.getChildPropertiesData(data.parentData(), itemDataFilters)) { if (pd.getIdentifier().equals(data.getInternalIdentifier()))
assertTrue(fpvd.getFile() != null || fpvd.getUrl() != null); PropertyData pData2 = null; List<QPathEntryFilter> itemDataFilters = Collections.singletonList((QPathEntryFilter)new PatternQPathEntryFilter(new QPathEntry("*", "*", 0)));
11,729
import org.codehaus.groovy.control.CompilationUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public final class GroovyTreeParser implements TreeParser { private static final Logger logger = LoggerFactory.getLogger(GroovyTreeParser.class); <BUG>private static final String GROOVY_DEFAULT_INTERFACE = "groovy.lang.GroovyObject"; private static final String JAVA_DEFAULT_OBJECT = "java.lang.Object"; private Map<URI, Set<SymbolInformation>> fileSymbols = Maps.newHashMap(); private Map<String, Set<SymbolInformation>> typeReferences = Maps.newHashMap();</BUG> private final Supplier<CompilationUnit> unitSupplier;
private Indexer indexer = new Indexer();
11,730
if (scriptClass != null) { sourceUnit.getAST().getStatementBlock().getVariableScope().getDeclaredVariables().values().forEach( variable -> { SymbolInformation symbol = getVariableSymbolInformation(scriptClass.getName(), sourceUri, variable); <BUG>addToValueSet(newTypeReferences, variable.getType().getName(), symbol); symbols.add(symbol); }); } newFileSymbols.put(workspaceUriSupplier.get(sourceUri), symbols);</BUG> });
newIndexer.addSymbol(sourceUnit.getSource().getURI(), symbol); if (classes.containsKey(variable.getType().getName())) { newIndexer.addReference(classes.get(variable.getType().getName()), GroovyLocations.createLocation(sourceUri, variable.getType()));
11,731
} if (typeReferences.containsKey(foundSymbol.getName())) { foundReferences.addAll(typeReferences.get(foundSymbol.getName()));</BUG> } <BUG>return foundReferences; }</BUG> @Override public Set<SymbolInformation> getFilteredSymbols(String query) { checkNotNull(query, "query must not be null"); Pattern pattern = getQueryPattern(query);
}); sourceUnit.getAST().getStatementBlock() .visit(new MethodVisitor(newIndexer, sourceUri, sourceUnit.getAST().getScriptClassDummy(), classes, Maps.newHashMap(), Optional.absent(), workspaceUriSupplier));
11,732
<BUG>package com.palantir.ls.server.api; import io.typefox.lsapi.ReferenceParams;</BUG> import io.typefox.lsapi.SymbolInformation; import java.net.URI; import java.util.Map;
import com.google.common.base.Optional; import io.typefox.lsapi.Location; import io.typefox.lsapi.Position; import io.typefox.lsapi.ReferenceParams;
11,733
import java.util.Map; import java.util.Set; public interface TreeParser { void parseAllSymbols(); Map<URI, Set<SymbolInformation>> getFileSymbols(); <BUG>Map<String, Set<SymbolInformation>> getTypeReferences(); Set<SymbolInformation> findReferences(ReferenceParams params); Set<SymbolInformation> getFilteredSymbols(String query);</BUG> }
Map<Location, Set<Location>> getReferences(); Set<Location> findReferences(ReferenceParams params); Optional<Location> gotoDefinition(URI uri, Position position); Set<SymbolInformation> getFilteredSymbols(String query);
11,734
.workspaceSymbolProvider(true) .referencesProvider(true) .completionProvider(new CompletionOptionsBuilder() .resolveProvider(false) .triggerCharacter(".") <BUG>.build()) .build();</BUG> InitializeResult result = new InitializeResultBuilder() .capabilities(capabilities) .build();
.definitionProvider(true)
11,735
package com.palantir.ls.server; import com.palantir.ls.server.api.CompilerWrapper; import com.palantir.ls.server.api.TreeParser; import com.palantir.ls.server.api.WorkspaceCompiler; <BUG>import io.typefox.lsapi.FileEvent; import io.typefox.lsapi.PublishDiagnosticsParams;</BUG> import io.typefox.lsapi.ReferenceParams; import io.typefox.lsapi.SymbolInformation; import io.typefox.lsapi.TextDocumentContentChangeEvent;
import com.google.common.base.Optional; import io.typefox.lsapi.Location; import io.typefox.lsapi.Position; import io.typefox.lsapi.PublishDiagnosticsParams;
11,736
} @RootTask static Task<Exec.Result> exec(String parameter, int number) { Task<String> task1 = MyTask.create(parameter); Task<Integer> task2 = Adder.create(number, number + 2); <BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh") .in(() -> task1)</BUG> .in(() -> task2) .process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\""))); }
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
11,737
return args; } static class MyTask { static final int PLUS = 10; static Task<String> create(String parameter) { <BUG>return Task.ofType(String.class).named("MyTask", parameter) .in(() -> Adder.create(parameter.length(), PLUS))</BUG> .in(() -> Fib.create(parameter.length())) .process((sum, fib) -> something(parameter, sum, fib)); }
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
11,738
final String instanceField = "from instance"; final TaskContext context = TaskContext.inmem(); final AwaitingConsumer<String> val = new AwaitingConsumer<>(); @Test public void shouldJavaUtilSerialize() throws Exception { <BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39) .process(() -> 9999L); Task<String> task2 = Task.ofType(String.class).named("Baz", 40) .in(() -> task1)</BUG> .ins(() -> singletonList(task1))
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
11,739
assertEquals(des.id().name(), "Baz"); assertEquals(val.awaitAndGet(), "[9999] hello 10004"); } @Test(expected = NotSerializableException.class) public void shouldNotSerializeWithInstanceFieldReference() throws Exception { <BUG>Task<String> task = Task.ofType(String.class).named("WithRef") .process(() -> instanceField + " causes an outer reference");</BUG> serialize(task); } @Test
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
11,740
serialize(task); } @Test public void shouldSerializeWithLocalReference() throws Exception { String local = instanceField; <BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef") .process(() -> local + " won't cause an outer reference");</BUG> serialize(task); Task<String> des = deserialize(); context.evaluate(des).consume(val);
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
11,741
} @RootTask public static Task<String> standardArgs(int first, String second) { firstInt = first; secondString = second; <BUG>return Task.ofType(String.class).named("StandardArgs", first, second) .process(() -> second + " " + first * 100);</BUG> } @Test public void shouldParseFlags() throws Exception {
return Task.named("StandardArgs", first, second).ofType(String.class) .process(() -> second + " " + first * 100);
11,742
assertThat(parsedEnum, is(CustomEnum.BAR)); } @RootTask public static Task<String> enums(CustomEnum enm) { parsedEnum = enm; <BUG>return Task.ofType(String.class).named("Enums", enm) .process(enm::toString);</BUG> } @Test public void shouldParseCustomTypes() throws Exception {
return Task.named("Enums", enm).ofType(String.class) .process(enm::toString);
11,743
assertThat(parsedType.content, is("blarg parsed for you!")); } @RootTask public static Task<String> customType(CustomType myType) { parsedType = myType; <BUG>return Task.ofType(String.class).named("Types", myType.content) .process(() -> myType.content);</BUG> } public enum CustomEnum { BAR
return Task.named("Types", myType.content).ofType(String.class) .process(() -> myType.content);
11,744
TaskContext taskContext = TaskContext.inmem(); TaskContext.Value<Long> value = taskContext.evaluate(fib92); value.consume(f92 -> System.out.println("fib(92) = " + f92)); } static Task<Long> create(long n) { <BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n); </BUG> if (n < 2) { return fib .process(() -> n);
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
11,745
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
11,746
} @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);
11,747
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 != null) { c.moveToFirst(); }
MemoEntry.COLUMN_ORDER + " ASC", null);
11,748
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(
11,749
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.Adapter<RecyclerView.ViewHolder> implements EditMode { </BUG> private List<MemoEntity> memoList;
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
11,750
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, EditMemoDialogFragment.MemoCallback callback) { this.mActivity = activity;</BUG> this.topicId = topicId; this.memoList = memoList;
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
11,751
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) {
11,752
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;
11,753
import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; import org.eclipse.xtend.lib.annotations.Accessors; import org.eclipse.xtext.common.types.JvmDeclaredType; import org.eclipse.xtext.common.types.JvmType; <BUG>import org.eclipse.xtext.common.types.access.IMirror; import org.eclipse.xtext.common.types.access.impl.AbstractJvmTypeProvider;</BUG> import org.eclipse.xtext.common.types.access.impl.AbstractRuntimeJvmTypeProvider; import org.eclipse.xtext.common.types.access.impl.ITypeFactory; import org.eclipse.xtext.common.types.access.impl.IndexedJvmTypeAccess;
import org.eclipse.xtext.common.types.access.TypeResource; import org.eclipse.xtext.common.types.access.impl.AbstractJvmTypeProvider;
11,754
return _xifexpression; } catch (Throwable _e) { throw Exceptions.sneakyThrow(_e); } } <BUG>public JvmType findType(final URI resourceURI, final String fragment, final boolean traverseNestedTypes) { JvmType _xblockexpression = null; {</BUG> final IndexedJvmTypeAccess indexedJvmTypeAccess = this.getIndexedJvmTypeAccess(); if ((indexedJvmTypeAccess != null)) {
try {
11,755
throw e.getWrapped(); } else { throw Exceptions.sneakyThrow(_t); } } <BUG>_xblockexpression = _xtrycatchfinallyexpression; } return _xblockexpression;</BUG> } protected JvmType findType(final Resource resource, final String fragment, final boolean traverseNestedTypes) {
} catch (Throwable _e) { throw Exceptions.sneakyThrow(_e);
11,756
import org.highj.util.ArrayUtils; import org.highj.util.Iterators; import java.util.HashSet; import java.util.Iterator; import java.util.NoSuchElementException; <BUG>import java.util.function.Function; public class Set<A> implements _<Set.µ, A>, Iterable<A>, Function<A, Boolean> { public static class µ { }</BUG> @SuppressWarnings("unchecked")
import java.util.function.Predicate; public class Set<A> implements _<Set.µ, A>, Iterable<A>, Predicate<A> { public interface µ { }
11,757
return left; } else { T2<Set<A>, Set<A>> pair = right.removeMin(); return new Set<>(pair._1().hc, pair._1().bucket, left, pair._2()); } <BUG>case LT: Set<A> newLeft = left.minus(a); return left == newLeft ? this : new Set<>(hc, bucket, newLeft, right); case GT: Set<A> newRight = right.minus(a); return right == newRight ? this : new Set<>(hc, bucket, left, newRight);</BUG> default:
return withLeft(left.minus(a)); return withRight(right.minus(a));
11,758
private T2<Set<A>, Set<A>> removeMin() { if (left.isEmpty()) { return T2.of(this, right); } else { T2<Set<A>, Set<A>> pair = left.removeMin(); <BUG>return T2.of(pair._1(), new Set<>(hc, bucket, pair._2(), right)); }</BUG> } public boolean isEmpty() { return this == EMPTY;
return T2.of(pair._1(), withLeft(pair._2()));
11,759
list = list.tail(); return result;</BUG> } <BUG>private void addIfNotEmpty(Set<A> set) { if (!set.isEmpty()) { todo = todo.plus(Either.newLeft(set)); } }</BUG> };
@Override public boolean hasNext() { return !bucket.isEmpty() || !todo.isEmpty();
11,760
package org.highj.data.collection.set; <BUG>import org.highj._; import org.highj.data.collection.Set; import org.highj.typeclass1.monad.MonadPlus; import java.util.function.Function; public class SetMonadPlus extends SetFunctor implements MonadPlus<Set.µ> { @Override public <A> Set<A> pure(A a) { </BUG> return Set.of(a);
import org.highj.data.collection.Either; import org.highj.typeclass1.monad.MonadRec; import org.highj.util.Mutable; public interface SetMonadPlus extends SetFunctor, MonadPlus<Set.µ>, MonadRec<Set.µ> { default <A> Set<A> pure(A a) {
11,761
public <A> Set<A> pure(A a) { </BUG> return Set.of(a); } @Override <BUG>public <A, B> Set<B> ap(_<Set.µ, Function<A, B>> fn, _<Set.µ, A> nestedA) { Set<B> result = Set.empty(); for (Function<A, B> f : Set.narrow(fn)) { for (A a : Set.narrow(nestedA)) { result = result.plus(f.apply(a)); } } return result;</BUG> }
package org.highj.data.collection.set; import org.highj._; import org.highj.data.collection.Either; import org.highj.data.collection.Set; import org.highj.typeclass1.monad.MonadPlus; import org.highj.typeclass1.monad.MonadRec; import org.highj.util.Mutable; import java.util.function.Function; public interface SetMonadPlus extends SetFunctor, MonadPlus<Set.µ>, MonadRec<Set.µ> { default <A> Set<A> pure(A a) {
11,762
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; <BUG>import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; public class ChangePropertyCommandTest {
import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,763
public static void setUpBeforeClass() { JOSMFixture.createUnitTestFixture().init(false); } @Test public void equalsContract() { <BUG>EqualsVerifier.forClass(ChangePropertyCommand.class).usingGetClass() .withPrefabValues(OsmDataLayer.class,</BUG> new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null)) .suppress(Warning.NONFINAL_FIELDS) .verify();
.withPrefabValues(DataSet.class, new DataSet(), new DataSet()) .withPrefabValues(User.class, User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar")) .withPrefabValues(OsmDataLayer.class,
11,764
import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; import org.openstreetmap.josm.Main; import org.openstreetmap.josm.data.conflict.Conflict; import org.openstreetmap.josm.data.osm.DataSet; <BUG>import org.openstreetmap.josm.data.osm.Node; import org.openstreetmap.josm.data.osm.Way;</BUG> import org.openstreetmap.josm.gui.layer.OsmDataLayer; import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning;
import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.data.osm.Way;
11,765
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; import org.openstreetmap.josm.data.osm.DataSet; <BUG>import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; public class ChangeRelationMemberRoleCommandTest {
import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,766
} @Test public void equalsContract() { EqualsVerifier.forClass(ChangeRelationMemberRoleCommand.class).usingGetClass() .withPrefabValues(Relation.class, <BUG>new Relation(1), new Relation(2)) .withPrefabValues(OsmDataLayer.class,</BUG> new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null)) .suppress(Warning.NONFINAL_FIELDS) .verify();
.withPrefabValues(DataSet.class, new DataSet(), new DataSet()) .withPrefabValues(User.class, User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar")) .withPrefabValues(OsmDataLayer.class,
11,767
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; <BUG>import org.openstreetmap.josm.JOSMFixture; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning;
import org.openstreetmap.josm.data.coor.LatLon; import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,768
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; <BUG>import org.openstreetmap.josm.JOSMFixture; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning;
import org.openstreetmap.josm.data.coor.LatLon; import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,769
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; <BUG>import org.openstreetmap.josm.JOSMFixture; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.data.osm.Hash; import org.openstreetmap.josm.data.osm.OsmPrimitive; import org.openstreetmap.josm.data.osm.Storage; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier;
import org.openstreetmap.josm.data.conflict.Conflict; import org.openstreetmap.josm.data.osm.Node; import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,770
import org.junit.BeforeClass; import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.data.osm.Node; <BUG>import org.openstreetmap.josm.data.osm.OsmPrimitive; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; public class AddCommandTest {
import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,771
} @Test public void equalsContract() { EqualsVerifier.forClass(AddCommand.class).usingGetClass() .withPrefabValues(OsmPrimitive.class, <BUG>new Node(1), new Node(2)) .withPrefabValues(OsmDataLayer.class,</BUG> new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null)) .suppress(Warning.NONFINAL_FIELDS) .verify();
.withPrefabValues(DataSet.class, new DataSet(), new DataSet()) .withPrefabValues(User.class, User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar")) .withPrefabValues(OsmDataLayer.class,
11,772
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; <BUG>import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.data.osm.Way;</BUG> import org.openstreetmap.josm.gui.layer.OsmDataLayer; import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning;
import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.data.osm.Way;
11,773
} @Test public void equalsContract() { EqualsVerifier.forClass(ChangeNodesCommand.class).usingGetClass() .withPrefabValues(Way.class, <BUG>new Way(1), new Way(2)) .withPrefabValues(OsmDataLayer.class,</BUG> new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null)) .suppress(Warning.NONFINAL_FIELDS) .verify();
.withPrefabValues(DataSet.class, new DataSet(), new DataSet()) .withPrefabValues(User.class, User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar")) .withPrefabValues(OsmDataLayer.class,
11,774
import org.junit.BeforeClass; import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.data.osm.Node; <BUG>import org.openstreetmap.josm.data.osm.OsmPrimitive; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; public class ChangeCommandTest {
import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,775
public static void setUpBeforeClass() { JOSMFixture.createUnitTestFixture().init(false); } @Test public void equalsContract() { <BUG>EqualsVerifier.forClass(ChangeCommand.class).usingGetClass() .withPrefabValues(OsmPrimitive.class,</BUG> new Node(1), new Node(2)) .withPrefabValues(OsmDataLayer.class, new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
.withPrefabValues(DataSet.class, new DataSet(), new DataSet()) .withPrefabValues(User.class, User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar")) .withPrefabValues(OsmPrimitive.class,
11,776
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; <BUG>import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; public class SelectCommandTest {
import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,777
public static void setUpBeforeClass() { JOSMFixture.createUnitTestFixture().init(false); } @Test public void equalsContract() { <BUG>EqualsVerifier.forClass(SelectCommand.class).usingGetClass() .withPrefabValues(OsmDataLayer.class,</BUG> new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null)) .suppress(Warning.NONFINAL_FIELDS) .verify();
.withPrefabValues(DataSet.class, new DataSet(), new DataSet()) .withPrefabValues(User.class, User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar")) .withPrefabValues(OsmDataLayer.class,
11,778
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; <BUG>import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; public class DeleteCommandTest {
import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,779
public static void setUpBeforeClass() { JOSMFixture.createUnitTestFixture().init(false); } @Test public void equalsContract() { <BUG>EqualsVerifier.forClass(DeleteCommand.class).usingGetClass() .withPrefabValues(OsmDataLayer.class,</BUG> new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null)) .suppress(Warning.NONFINAL_FIELDS) .verify();
.withPrefabValues(DataSet.class, new DataSet(), new DataSet()) .withPrefabValues(User.class, User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar")) .withPrefabValues(OsmDataLayer.class,
11,780
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; <BUG>import org.openstreetmap.josm.JOSMFixture; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning;
import org.openstreetmap.josm.data.coor.LatLon; import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,781
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; <BUG>import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; public class AddPrimitivesCommandTest {
import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,782
public static void setUpBeforeClass() { JOSMFixture.createUnitTestFixture().init(false); } @Test public void equalsContract() { <BUG>EqualsVerifier.forClass(AddPrimitivesCommand.class).usingGetClass() .withPrefabValues(OsmDataLayer.class,</BUG> new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null)) .suppress(Warning.NONFINAL_FIELDS) .verify();
.withPrefabValues(DataSet.class, new DataSet(), new DataSet()) .withPrefabValues(User.class, User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar")) .withPrefabValues(OsmDataLayer.class,
11,783
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; <BUG>import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; public class ChangePropertyKeyCommandTest {
import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,784
public static void setUpBeforeClass() { JOSMFixture.createUnitTestFixture().init(false); } @Test public void equalsContract() { <BUG>EqualsVerifier.forClass(ChangePropertyKeyCommand.class).usingGetClass() .withPrefabValues(OsmDataLayer.class,</BUG> new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null)) .suppress(Warning.NONFINAL_FIELDS) .verify();
.withPrefabValues(DataSet.class, new DataSet(), new DataSet()) .withPrefabValues(User.class, User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar")) .withPrefabValues(OsmDataLayer.class,
11,785
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; <BUG>import org.openstreetmap.josm.JOSMFixture; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning;
import org.openstreetmap.josm.data.coor.LatLon; import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,786
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; <BUG>import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.data.osm.Way;</BUG> import org.openstreetmap.josm.gui.layer.OsmDataLayer; import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning;
import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.data.osm.Way;
11,787
} @Test public void equalsContract() { EqualsVerifier.forClass(RemoveNodesCommand.class).usingGetClass() .withPrefabValues(Way.class, <BUG>new Way(1), new Way(2)) .withPrefabValues(OsmDataLayer.class,</BUG> new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null)) .suppress(Warning.NONFINAL_FIELDS) .verify();
.withPrefabValues(DataSet.class, new DataSet(), new DataSet()) .withPrefabValues(User.class, User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar")) .withPrefabValues(OsmDataLayer.class,
11,788
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; <BUG>import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; public class CommandTest {
import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,789
public static void setUpBeforeClass() { JOSMFixture.createUnitTestFixture().init(false); } @Test public void equalsContract() { <BUG>EqualsVerifier.forClass(Command.class).usingGetClass() .withPrefabValues(OsmDataLayer.class,</BUG> new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null)) .suppress(Warning.NONFINAL_FIELDS) .verify();
.withPrefabValues(DataSet.class, new DataSet(), new DataSet()) .withPrefabValues(User.class, User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar")) .withPrefabValues(OsmDataLayer.class,
11,790
package org.openstreetmap.josm.command; import org.junit.BeforeClass; import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; import org.openstreetmap.josm.data.osm.DataSet; <BUG>import org.openstreetmap.josm.data.osm.Node; import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG> import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; public class SequenceCommandTest {
import org.openstreetmap.josm.data.osm.User; import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11,791
} @Test public void equalsContract() { EqualsVerifier.forClass(SequenceCommand.class).usingGetClass() .withPrefabValues(Command.class, <BUG>new AddCommand(new Node(1)), new AddCommand(new Node(2))) .withPrefabValues(OsmDataLayer.class,</BUG> new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null)) .suppress(Warning.NONFINAL_FIELDS) .verify();
.withPrefabValues(DataSet.class, new DataSet(), new DataSet()) .withPrefabValues(User.class, User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar")) .withPrefabValues(OsmDataLayer.class,
11,792
import gnu.trove.THashMap; import gnu.trove.THashSet; import org.jetbrains.annotations.NotNull; import javax.swing.*; import java.util.Map; <BUG>public class NodeClassInfo { public final boolean isDynamic; </BUG> public final Map<String, Icon> myOwnStaticFields; public final Map<String, Icon> myOwnStaticProperties;
public final String myFqn; public final boolean myIsDynamic;
11,793
public final Map<String, Icon> myOwnProperties; public final Map<String, Icon> myInheritedStaticFields; public final Map<String, Icon> myInheritedStaticProperties; public final Map<String, Icon> myInheritedFields; public final Map<String, Icon> myInheritedProperties; <BUG>public NodeClassInfo(final boolean dynamic, final Map<String, Icon> ownStaticFields,</BUG> final Map<String, Icon> ownStaticProperties, final Map<String, Icon> ownFields,
public NodeClassInfo(final String fqn, final Map<String, Icon> ownStaticFields,
11,794
final Map<String, Icon> inheritedFields = new THashMap<String, Icon>(); final Map<String, Icon> inheritedProperties = new THashMap<String, Icon>(); fillMapsForClass(jsClass, ownStaticFields, ownStaticProperties, ownFields, ownProperties); fillMapsForSupersRecursively(jsClass, new THashSet<JSClass>(), inheritedStaticFields, inheritedStaticProperties, inheritedFields, inheritedProperties); <BUG>return new NodeClassInfo(dynamic, ownStaticFields, ownStaticProperties, ownFields, ownProperties, inheritedStaticFields, inheritedStaticProperties, inheritedFields, inheritedProperties); }</BUG> private static void fillMapsForSupersRecursively(final JSClass jsClass,
return new NodeClassInfo(normalizeIfVector(jsClass.getQualifiedName()), dynamic, ownStaticFields, ownStaticProperties, ownFields, ownProperties, inheritedStaticFields, inheritedStaticProperties, inheritedFields, inheritedProperties); } private static String normalizeIfVector(final String qName) { return qName.startsWith("Vector$") ? "Vector" : qName; }
11,795
else { scheduleCollectionSizePresentation(node, type, ""); } } val = setFullValueEvaluatorIfNeeded(node, val, false); <BUG>node.setPresentation(getIcon(), type, val, isObject); }</BUG> private static boolean isCollection(final String fqn) { return fqn != null && ArrayUtil.contains(fqn, COLLECTION_CLASSES); }
private static boolean isCollectionWithDirectContent(final String fqn) { return fqn != null && ArrayUtil.contains(fqn, COLLECTIONS_WITH_DIRECT_CONTENT);
11,796
node.addChildren(inheritedNodeSingletonList, false); }</BUG> node.addChildren(ownStaticFields, false); node.addChildren(ownStaticProperties, false); node.addChildren(ownFields, false); <BUG>node.addChildren(ownProperties, false); final XValueChildrenList elementsOfCollectionList = new XValueChildrenList();</BUG> for (final FlexValue flexValue : elementsOfCollection) { elementsOfCollectionList.add(flexValue.myName, flexValue); }
final XValueChildrenList elementsOfCollectionList = new XValueChildrenList();
11,797
for (final FlexValue flexValue : elementsOfCollection) { elementsOfCollectionList.add(flexValue.myName, flexValue); } node.addChildren(elementsOfCollectionList, false); node.addChildren(XValueChildrenList.EMPTY, true); <BUG>} private static XValueChildrenList getInheritedNodeSingletonList(final XValueChildrenList inheritedStaticFields, final XValueChildrenList inheritedStaticProperties, final XValueChildrenList inheritedFields, final XValueChildrenList inheritedProperties) {</BUG> final XValue inheritedNode = new XValue() {
private static XValueChildrenList getWrappingSingletonList(final String nodeName, final XValueChildrenList... listsToWrap) {
11,798
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
11,799
} @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);
11,800
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 != null) { c.moveToFirst(); }
MemoEntry.COLUMN_ORDER + " ASC", null);