id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
47,401
EditorCell_Collection result = jetbrains.mps.nodeEditor.cells.EditorCell_Collection.createIndent2(editorContext, node); result.setBig(true); result.getStyle().putAll(StyleRegistry.getInstance().getStyle("LINE_COMMENT"), 1); result.addEditorCell(createCommentConstantCell(editorContext, node, true)); result.addEditorCell(mainCell); <BUG>result.addEditorCell(createCommentConstantCell(editorContext, node, false)); return result;</BUG> } private EditorCell_Constant createCommentConstantCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node, boolean left) { EditorCell_Constant cell = new EditorCell_Constant(editorContext, node, left ? "/*" : "*/", false);
result.setCellId("main_comment_collection"); return result;
47,402
} private EditorCell_Constant createCommentConstantCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node, boolean left) { EditorCell_Constant cell = new EditorCell_Constant(editorContext, node, left ? "/*" : "*/", false); StyleImpl style = new StyleImpl(); style.set(left ? StyleAttributes.PUNCTUATION_RIGHT : StyleAttributes.PUNCTUATION_LEFT, 0, true); <BUG>cell.getStyle().putAll(style, 0); return cell;</BUG> } @Override public EditorCell createInspectedCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node) {
cell.setCellId(left ? "left_comment_constant" : "right_comment_constant"); return cell;
47,403
import org.jetbrains.annotations.NotNull; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import jetbrains.mps.openapi.editor.EditorContext; import jetbrains.mps.openapi.editor.selection.Selection; import jetbrains.mps.openapi.editor.selection.SingularSelection; <BUG>import jetbrains.mps.openapi.editor.cells.EditorCell; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;</BUG> import org.jetbrains.mps.util.Condition; import jetbrains.mps.editor.runtime.selection.SelectionUtil; import jetbrains.mps.openapi.editor.selection.SelectionManager;
import jetbrains.mps.openapi.editor.cells.EditorCell_Label; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;
47,404
import jetbrains.mps.editor.runtime.cells.AbstractCellAction; import org.jetbrains.mps.openapi.model.SNode; import org.jetbrains.annotations.NotNull; import jetbrains.mps.openapi.editor.EditorContext; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; <BUG>import jetbrains.mps.openapi.editor.cells.EditorCell; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;</BUG> import org.jetbrains.mps.util.Condition; import jetbrains.mps.editor.runtime.selection.SelectionUtil; import jetbrains.mps.openapi.editor.selection.SelectionManager;
import jetbrains.mps.openapi.editor.cells.EditorCell_Label; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;
47,405
package edu.uci.ics.textdb.dataflow.regexmatch; <BUG>import java.util.ArrayList; import java.util.List; import org.junit.Assert; import org.junit.Test;</BUG> import edu.uci.ics.textdb.api.common.IField;
import java.util.Arrays; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test;
47,406
import java.util.List; import org.junit.Assert; import org.junit.Test;</BUG> import edu.uci.ics.textdb.api.common.IField; import edu.uci.ics.textdb.api.common.ITuple; <BUG>import edu.uci.ics.textdb.api.common.Schema; import edu.uci.ics.textdb.common.constants.SchemaConstants;</BUG> import edu.uci.ics.textdb.common.constants.TestConstants; import edu.uci.ics.textdb.common.field.DataTuple; import edu.uci.ics.textdb.common.field.ListField;
import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import edu.uci.ics.textdb.api.exception.TextDBException; import edu.uci.ics.textdb.common.constants.SchemaConstants;
47,407
IField spanField = new ListField<Span>(new ArrayList<Span>(spans)); List<IField> fields = new ArrayList<IField>(data.get(2).getFields()); fields.add(spanField); expectedResults.add(new DataTuple(spanSchema, fields.toArray(new IField[fields.size()]))); spans.clear(); <BUG>spans.add(new Span(TestConstants.FIRST_NAME, 0, 6, "g[^\\s]*", "george")); </BUG> spanField = new ListField<Span>(new ArrayList<Span>(spans)); fields = new ArrayList<IField>(data.get(3).getFields()); fields.add(spanField);
spans.add(new Span(TestConstants.FIRST_NAME, 0, 6, query, "george"));
47,408
IField spanField = new ListField<Span>(new ArrayList<Span>(spans)); List<IField> fields = new ArrayList<IField>(data.get(0).getFields()); fields.add(spanField); expectedResults.add(new DataTuple(spanSchema, fields.toArray(new IField[fields.size()]))); spans.clear(); <BUG>spans.add(new Span(RegexTestConstantsText.CONTENT, 87, 92, regex, "tests")); </BUG> spanField = new ListField<Span>(new ArrayList<Span>(spans)); fields = new ArrayList<IField>(data.get(2).getFields()); fields.add(spanField);
List<IField> fields = new ArrayList<IField>(data.get(1).getFields()); spans.add(new Span(RegexTestConstantsCorp.URL, 0, 32, query, "https://www.microsoft.com/en-us/"));
47,409
List<IField> fields = new ArrayList<IField>(data.get(4).getFields()); fields.add(spanField); expectedResults.add(new DataTuple(spanSchema, fields.toArray(new IField[fields.size()]))); spans.clear(); fields.clear(); <BUG>spans.add(new Span(RegexTestConstantsText.CONTENT, 4, 11, regex, "patient")); spans.add(new Span(RegexTestConstantsText.CONTENT, 65, 72, regex, "patient")); </BUG> spanField = new ListField<Span>(new ArrayList<Span>(spans));
spans.add(new Span(RegexTestConstantsText.CONTENT, 18, 27, query, "follow up")); spans.add(new Span(RegexTestConstantsText.CONTENT, 51, 60, query, "follow up"));
47,410
fields = new ArrayList<IField>(data.get(5).getFields()); fields.add(spanField); expectedResults.add(new DataTuple(spanSchema, fields.toArray(new IField[fields.size()]))); spans.clear(); fields.clear(); <BUG>spans.add(new Span(RegexTestConstantsText.CONTENT, 4, 11, regex, "patient")); </BUG> spanField = new ListField<Span>(new ArrayList<Span>(spans)); fields = new ArrayList<IField>(data.get(6).getFields()); fields.add(spanField);
spans.add(new Span(RegexTestConstantsText.CONTENT, 24, 33, query, "follow-up")); spans.add(new Span(RegexTestConstantsText.CONTENT, 38, 46, query, "followup"));
47,411
List<IField> fields = new ArrayList<IField>(data.get(4).getFields()); fields.add(spanField); expectedResults.add(new DataTuple(spanSchema, fields.toArray(new IField[fields.size()]))); spans.clear(); fields.clear(); <BUG>spans.add(new Span(RegexTestConstantsText.CONTENT, 4, 11, regex, "patient")); spans.add(new Span(RegexTestConstantsText.CONTENT, 65, 72, regex, "patient")); </BUG> spanField = new ListField<Span>(new ArrayList<Span>(spans));
spans.add(new Span(RegexTestConstantsText.CONTENT, 4, 11, query, "patient")); spans.add(new Span(RegexTestConstantsText.CONTENT, 65, 72, query, "patient"));
47,412
fields = new ArrayList<IField>(data.get(5).getFields()); fields.add(spanField); expectedResults.add(new DataTuple(spanSchema, fields.toArray(new IField[fields.size()]))); spans.clear(); fields.clear(); <BUG>spans.add(new Span(RegexTestConstantsText.CONTENT, 4, 11, regex, "patient")); </BUG> spanField = new ListField<Span>(new ArrayList<Span>(spans)); fields = new ArrayList<IField>(data.get(6).getFields()); fields.add(spanField);
spans.add(new Span(RegexTestConstantsText.CONTENT, 4, 11, query, "patient"));
47,413
private static ITuple getTextTuple(String content) { IField field = new TextField(content); ITuple tuple = new DataTuple(SCHEMA_TEXT, field); return tuple; } <BUG>public static List<ITuple> getSampleTextTuples() throws ParseException { List<ITuple> textTuples = new ArrayList<>();</BUG> textTuples.add(getTextTuple("This testcase is for testing regex that can be translated by the translator")); textTuples.add(getTextTuple( "Translator is effective for specific regex, but has less effects on general regular expressions"));
public static List<ITuple> getSampleTextTuples() { List<ITuple> textTuples = new ArrayList<>();
47,414
List<String> attributeNames = Arrays.asList(MedlineIndexWriter.ABSTRACT); for(String regex: regexes){ Analyzer luceneAnalyzer = LuceneAnalyzerConstants.getNGramAnalyzer(3); RegexPredicate regexPredicate = new RegexPredicate(regex, attributeNames, luceneAnalyzer); IndexBasedSourceOperator indexInputOperator = new IndexBasedSourceOperator( <BUG>regexPredicate.generateDataReaderPredicate(dataStore)); RegexMatcher regexMatcher = new RegexMatcher(regexPredicate);</BUG> regexMatcher.setInputOperator(indexInputOperator); long startMatchTime = System.currentTimeMillis(); regexMatcher.open();
new DataReaderPredicate(RegexMatcherSourceOperator.createLuceneQuery(regexPredicate), dataStore)); RegexMatcher regexMatcher = new RegexMatcher(regexPredicate);
47,415
public static final Attribute CORP_NAME_ATTR = new Attribute(CORP_NAME, FieldType.STRING); public static final Attribute URL_ATTR = new Attribute(URL, FieldType.STRING); public static final Attribute IP_ADDRESS_ATTR = new Attribute(IP_ADDRESS, FieldType.STRING); public static final Attribute[] ATTRIBUTES_CORP = { CORP_NAME_ATTR, URL_ATTR, IP_ADDRESS_ATTR }; public static final Schema SCHEMA_CORP = new Schema(ATTRIBUTES_CORP); <BUG>public static List<ITuple> getSampleCorpTuples() throws ParseException { IField[] fields1 = { new StringField("Facebook"), new StringField("404 Not Found"),</BUG> new StringField("66.220.144.0") }; IField[] fields2 = { new StringField("Weibo"), new StringField("http://weibo.com"), new StringField("180.149.134.141") };
public static List<ITuple> getSampleCorpTuples() { IField[] fields1 = { new StringField("Facebook"), new StringField("404 Not Found"),
47,416
public static final Attribute LAST_NAME_ATTR = new Attribute(LAST_NAME, FieldType.STRING); public static final Attribute EMAIL_ATTR = new Attribute(EMAIL, FieldType.STRING); public static final Attribute PHONE_ATTR = new Attribute(PHONE, FieldType.STRING); public static final Attribute[] ATTRIBUTES_STAFF = { FIRST_NAME_ATTR, LAST_NAME_ATTR, EMAIL_ATTR, PHONE_ATTR }; public static final Schema SCHEMA_STAFF = new Schema(ATTRIBUTES_STAFF); <BUG>public static List<ITuple> getSampleStaffTuples() throws ParseException { IField[] fields1 = { new StringField("Melody"), new StringField("Bocanegra"),</BUG> new StringField("[email protected]"), new StringField("(945) 734-5156") }; IField[] fields2 = { new StringField("Kanon"), new StringField("Hwang"), new StringField("[email protected]"), new StringField("(494) 352-8098") };
public static List<ITuple> getSampleStaffTuples() { IField[] fields1 = { new StringField("Melody"), new StringField("Bocanegra"),
47,417
package com.hotbitmapgg.ohmybilibili.entity.video; import android.os.Parcel; <BUG>import android.os.Parcelable; public class VideoDetails implements Parcelable</BUG> { private int tid; private String typename;
import com.google.gson.annotations.SerializedName; public class VideoDetails implements Parcelable
47,418
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();
47,419
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()));
47,420
} 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));
47,421
<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;
47,422
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);
47,423
.workspaceSymbolProvider(true) .referencesProvider(true) .completionProvider(new CompletionOptionsBuilder() .resolveProvider(false) .triggerCharacter(".") <BUG>.build()) .build();</BUG> InitializeResult result = new InitializeResultBuilder() .capabilities(capabilities) .build();
.definitionProvider(true)
47,424
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;
47,425
import java.util.concurrent.FutureTask; import org.apache.zookeeper_voltpatches.CreateMode; import org.apache.zookeeper_voltpatches.KeeperException; import org.apache.zookeeper_voltpatches.KeeperException.Code; import org.apache.zookeeper_voltpatches.ZooDefs.Ids; <BUG>import org.apache.zookeeper_voltpatches.ZooKeeper; import org.voltdb.SystemProcedureCatalog.Config;</BUG> import org.voltdb.VoltDB.START_ACTION; import org.voltdb.catalog.CommandLog; import org.voltdb.catalog.Partition;
import org.json_voltpatches.JSONException; import org.json_voltpatches.JSONObject; import org.voltdb.SystemProcedureCatalog.Config;
47,426
continue; } SnapshotInfo info = new SnapshotInfo(e.getKey(), digest.getParent(), parseDigestFilename(digest.getName()), <BUG>partitionCount); for (Entry<String, TableFiles> te : s.m_tableFiles.entrySet()) {</BUG> TableFiles tableFile = te.getValue(); HashSet<Integer> ids = new HashSet<Integer>(); for (Set<Integer> idSet : tableFile.m_validPartitionIds) {
partitionCount, catalog_crc); for (Entry<String, TableFiles> te : s.m_tableFiles.entrySet()) {
47,427
long txnId = buf.getLong(); Set<SnapshotInfo> fragments = snapshotFragments.get(txnId); if (fragments == null) { fragments = new HashSet<SnapshotInfo>(); snapshotFragments.put(txnId, fragments); <BUG>} int len = buf.getInt();</BUG> byte[] nonceBytes = new byte[len]; buf.get(nonceBytes); len = buf.getInt();
long catalogCrc = buf.getLong(); int len = buf.getInt();
47,428
byte[] pathBytes = new byte[len]; buf.get(pathBytes); int totalPartitionCount = buf.getInt(); SnapshotInfo info = new SnapshotInfo(txnId, new String(pathBytes), new String(nonceBytes), <BUG>totalPartitionCount); fragments.add(info);</BUG> int tableCount = buf.getInt(); for (int j = 0; j < tableCount; j++) {
totalPartitionCount, catalogCrc); fragments.add(info);
47,429
buf.putLong(min); } buf.put(m_action != START_ACTION.CREATE ? (byte) 1 : 0); buf.putInt(snapshots.size()); for (SnapshotInfo snapshot : snapshots) { <BUG>buf.putLong(snapshot.txnId); buf.putInt(snapshot.nonce.length());</BUG> buf.put(snapshot.nonce.getBytes()); buf.putInt(snapshot.path.length()); buf.put(snapshot.path.getBytes());
buf.putLong(snapshot.catalogCrc); buf.putInt(snapshot.nonce.length());
47,430
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
47,431
} @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);
47,432
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);
47,433
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(
47,434
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 {
47,435
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;
47,436
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) {
47,437
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;
47,438
String script = null; ScriptService.ScriptType scriptType = null; String lang = null; Map<String, Object> params = null; ValueType valueType = null; <BUG>boolean assumeUnique = false; boolean assumeSorted = false;</BUG> String format = null; } private final String aggName;
[DELETED]
47,439
public AbstractPercentilesParser() { super(); } @Override public AggregatorFactory parse(String aggregationName, XContentParser parser, SearchContext context) throws IOException { <BUG>ValuesSourceParser<ValuesSource.Numeric> vsParser = ValuesSourceParser.numeric(aggregationName, InternalPercentiles.TYPE, context) .requiresSortedValues(true) .build();</BUG> double[] keys = null;
ValuesSourceParser<ValuesSource.Numeric> vsParser = ValuesSourceParser.numeric(aggregationName, InternalPercentiles.TYPE, context).build();
47,440
sb.append(Double.isInfinite(to) ? "*" : to); return sb.toString(); } @Override public AggregatorFactory parse(String aggregationName, XContentParser parser, SearchContext context) throws IOException { <BUG>ValuesSourceParser<ValuesSource.GeoPoint> vsParser = ValuesSourceParser.geoPoint(aggregationName, InternalGeoDistance.TYPE, context) .requiresSortedValues(true) .build();</BUG> GeoPointParser geoPointParser = new GeoPointParser(aggregationName, InternalGeoDistance.TYPE, context, ORIGIN_FIELD);
ValuesSourceParser<ValuesSource.GeoPoint> vsParser = ValuesSourceParser.geoPoint(aggregationName, InternalGeoDistance.TYPE, context).build();
47,441
return StringTerms.TYPE.name(); } @Override public AggregatorFactory parse(String aggregationName, XContentParser parser, SearchContext context) throws IOException { TermsParametersParser aggParser = new TermsParametersParser(); <BUG>ValuesSourceParser vsParser = ValuesSourceParser.any(aggregationName, StringTerms.TYPE, context).scriptable(true).formattable(true) .requiresSortedValues(true).requiresUniqueValues(true).build();</BUG> IncludeExclude.Parser incExcParser = new IncludeExclude.Parser(aggregationName, StringTerms.TYPE, context); aggParser.parse(aggregationName, parser, context, vsParser, incExcParser);
ValuesSourceParser vsParser = ValuesSourceParser.any(aggregationName, StringTerms.TYPE, context).scriptable(true).formattable(true).build();
47,442
public AggregatorFactory parse(String aggregationName, XContentParser parser, SearchContext context) throws IOException { SignificantTermsParametersParser aggParser = new SignificantTermsParametersParser(significanceHeuristicParserMapper); ValuesSourceParser vsParser = ValuesSourceParser.any(aggregationName, SignificantStringTerms.TYPE, context) .scriptable(false) .formattable(true) <BUG>.requiresSortedValues(true) .requiresUniqueValues(true)</BUG> .build(); IncludeExclude.Parser incExcParser = new IncludeExclude.Parser(aggregationName, SignificantStringTerms.TYPE, context); aggParser.parse(aggregationName, parser, context, vsParser, incExcParser);
[DELETED]
47,443
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
47,444
} @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);
47,445
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);
47,446
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(
47,447
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 {
47,448
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;
47,449
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) {
47,450
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;
47,451
String UNIT_OF_WORK_PROCESS_SYNC = "CamelUnitOfWorkProcessSync"; String XSLT_FILE_NAME = "CamelXsltFileName"; String XSLT_ERROR = "CamelXsltError"; String XSLT_FATAL_ERROR = "CamelXsltFatalError"; String XSLT_WARNING = "CamelXsltWarning"; <BUG>String INPUT_TYPE = "CamelInputType"; String OUTPUT_TYPE = "CamelOutputType";</BUG> ExchangePattern getPattern(); void setPattern(ExchangePattern pattern); Object getProperty(String name);
[DELETED]
47,452
import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Documented <BUG>@Target( {ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR}) public @interface DynamicRouter {</BUG> String context() default ""; String delimiter() default ","; boolean ignoreInvalidEndpoints() default false;
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR}) public @interface DynamicRouter {
47,453
import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.ValidationException; import org.apache.camel.spi.Contract; <BUG>import org.apache.camel.spi.DataType; import org.apache.camel.spi.Transformer;</BUG> import org.apache.camel.spi.Validator; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
import org.apache.camel.spi.DataTypeAware; import org.apache.camel.spi.Transformer;
47,454
public ContractAdvice(Contract contract) { this.contract = contract; } @Override public Object before(Exchange exchange) throws Exception { <BUG>DataType from = getCurrentType(exchange, Exchange.INPUT_TYPE); DataType to = contract.getInputType();</BUG> if (to != null) { if (!to.equals(from)) { LOG.debug("Looking for transformer for INPUT: from='{}', to='{}'", from, to);
if (!(exchange.getIn() instanceof DataTypeAware)) { return null; DataTypeAware target = (DataTypeAware)exchange.getIn(); DataType from = target.getDataType(); DataType to = contract.getInputType();
47,455
public void after(Exchange exchange, Object data) throws Exception { if (exchange.isFailed()) { return; } Message target = exchange.hasOut() ? exchange.getOut() : exchange.getIn(); <BUG>if (!exchange.hasOut() && exchange.getProperty(Exchange.OUTPUT_TYPE) == null) { exchange.setProperty(Exchange.OUTPUT_TYPE, exchange.getProperty(Exchange.INPUT_TYPE)); } DataType from = getCurrentType(exchange, Exchange.OUTPUT_TYPE); DataType to = contract.getOutputType();</BUG> if (to != null) {
if (!(target instanceof DataTypeAware)) { DataTypeAware typeAwareTarget = (DataTypeAware)target; DataType from = typeAwareTarget.getDataType(); DataType to = contract.getOutputType();
47,456
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
47,457
} @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);
47,458
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);
47,459
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(
47,460
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 {
47,461
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;
47,462
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) {
47,463
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;
47,464
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; <BUG>import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.List;</BUG> public final class PatchUtils {
import java.text.DateFormat; import java.util.Date; import java.util.List;
47,465
package org.jboss.as.patching.runner; <BUG>import org.jboss.as.boot.DirectoryStructure; import org.jboss.as.patching.LocalPatchInfo;</BUG> import org.jboss.as.patching.PatchInfo; import org.jboss.as.patching.PatchLogger; import org.jboss.as.patching.PatchMessages;
import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp; import org.jboss.as.patching.CommonAttributes; import org.jboss.as.patching.LocalPatchInfo;
47,466
private static final String PATH_DELIMITER = "/"; public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT; enum Element { ADDED_BUNDLE("added-bundle"), ADDED_MISC_CONTENT("added-misc-content"), <BUG>ADDED_MODULE("added-module"), BUNDLES("bundles"),</BUG> CUMULATIVE("cumulative"), DESCRIPTION("description"), MISC_FILES("misc-files"),
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
47,467
final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { <BUG>case APPLIES_TO_VERSION: builder.addAppliesTo(value); break;</BUG> case RESULTING_VERSION: if(type == Patch.PatchType.CUMULATIVE) {
[DELETED]
47,468
final StringBuilder path = new StringBuilder(); for(final String p : item.getPath()) { path.append(p).append(PATH_DELIMITER); } path.append(item.getName()); <BUG>writer.writeAttribute(Attribute.PATH.name, path.toString()); if(type != ModificationType.REMOVE) {</BUG> writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash())); } if(type != ModificationType.ADD) {
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
47,469
package org.jboss.as.patching; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.patching.runner.PatchingException; import org.jboss.logging.Messages; import org.jboss.logging.annotations.Message; <BUG>import org.jboss.logging.annotations.MessageBundle; import java.io.IOException;</BUG> import java.util.List; @MessageBundle(projectCode = "JBAS") public interface PatchMessages {
import org.jboss.logging.annotations.Cause; import java.io.IOException;
47,470
throw new IncorrectOperationException("Manipulator for this element is not defined"); } public PsiElement bindToElement(PsiElement element) throws IncorrectOperationException{ if (!(element instanceof PsiFileSystemItem)) throw new IncorrectOperationException("Cannot bind to element"); final String newName = JspUtil.getDeploymentPath((PsiFileSystemItem)element); <BUG>final TextRange range = new TextRange(myFileReferenceSet.getStartInElement(), getRangeInElement().getEndOffset()); return getManipulator(getElement()).handleContentChange(getElement(), range, newName); </BUG> } private static ElementManipulator<PsiElement> getManipulator(PsiElement currentElement){
final ElementManipulator<PsiElement> manipulator = getManipulator(getElement()); if (manipulator == null) { throw new IncorrectOperationException("Manipulator not defined for: " + getElement()); return manipulator.handleContentChange(getElement(), range, newName);
47,471
public static final CommandMarker SERVICE_NAME_COMPONENT_MARKER = CommandMarker.commandMarker(CommandMarker.MARKER_NAMESPACE, "SVC"); public static final String CCND_SERVICE_NAME = "ccnd";</BUG> public static final String REPOSITORY_SERVICE_NAME = "repository"; public static ContentName localServiceName(String service) { <BUG>return new ContentName(ContextualNamesProfile.LOCALHOST_SCOPE, SERVICE_NAME_COMPONENT_MARKER.getBytes(), ContentName.componentParseNative(service)); </BUG> } public static String getLocalServiceName(ContentName nameWithServicePrefix) {
public static final int SCOPE_COMPONENT = 0; public static final int SERVICE_MARKER_COMPONENT = 1; public static final int SERVICE_NAME_COMPONENT = 3; public static final String CCND_SERVICE_NAME = "ccnd"; return new ContentName( new byte [][]{ServiceDiscoveryProfile.LOCALHOST_SCOPE.getBytes(), ContentName.componentParseNative(service)});
47,472
public String getNamespace() { int occurcount = DataUtils.occurcount(_byteCommandMarker, COMMAND_PREFIX.length, COMMAND_SEPARATOR_BYTE); if (occurcount == 0) { return new String(_byteCommandMarker, COMMAND_PREFIX.length, _byteCommandMarker.length-COMMAND_PREFIX.length); } <BUG>int lastDot = DataUtils.byterindex(_byteCommandMarker, COMMAND_PREFIX.length, COMMAND_SEPARATOR_BYTE); </BUG> return new String(_byteCommandMarker, COMMAND_PREFIX.length, lastDot-1-COMMAND_PREFIX.length); } public String getOperation() {
int lastDot = DataUtils.byterindex(_byteCommandMarker, _byteCommandMarker.length-1, COMMAND_SEPARATOR_BYTE);
47,473
&& context.getTransition().getSource().getId() != getSubmachine().getState().getId()) { getSubmachine().stop(); } else if (context.getTransition() != null && !StateMachineUtils.isSubstate(context.getTransition().getTarget(), context.getTransition() .getSource())) { getSubmachine().stop(); <BUG>} Collection<? extends Action<S, E>> actions = getExitActions(); if (actions != null && !isLocal(context)) { for (Action<S, E> action : actions) { </BUG> executeAction(action, context);
if (!isLocal(context)) { for (Action<S, E> action : getExitActions()) {
47,474
@Override public boolean shouldDefer(Message<E> event) { StateMachine<S, E> machine = getSubmachine(); if (machine != null) { State<S, E> state = machine.getState(); <BUG>if (state != null) { Collection<E> deferredEvents = state.getDeferredEvents(); if (deferredEvents != null && deferredEvents.contains(event.getPayload())) {</BUG> return true; }
public void exit(StateContext<S, E> context) { super.exit(context); if (getSubmachine().getState() != null && context.getTransition() != null && context.getTransition().getSource().getId() != getSubmachine().getState().getId()) { getSubmachine().stop(); } else if (context.getTransition() != null && !StateMachineUtils.isSubstate(context.getTransition().getTarget(), context.getTransition() .getSource())) { getSubmachine().stop();
47,475
super(id, deferred, entryActions, exitActions, stateActions, pseudoState, regions, submachine); } @Override public void exit(StateContext<S, E> context) { super.exit(context); <BUG>Collection<? extends Action<S, E>> actions = getExitActions(); if (actions != null) { for (Action<S, E> action : actions) { </BUG> try {
for (Action<S, E> action : getExitActions()) {
47,476
public boolean shouldDefer(Message<E> event) { boolean defer = true; if (getRegions() != null) { for (Region<S, E> r : getRegions()) { State<S, E> state = r.getState(); <BUG>if (state != null) { Collection<E> deferredEvents = state.getDeferredEvents(); if (deferredEvents != null && deferredEvents.contains(event.getPayload())) {</BUG> defer = defer & true; } else {
if (state.getDeferredEvents().contains(event.getPayload())) {
47,477
} } @Override public void entry(StateContext<S, E> context) { super.entry(context); <BUG>Collection<? extends Action<S, E>> actions = getEntryActions(); if (actions != null) { for (Action<S, E> action : actions) { </BUG> executeAction(action, context);
return defer;
47,478
package org.springframework.statemachine.state; import java.util.ArrayList; <BUG>import java.util.Collection; import java.util.Date;</BUG> import java.util.List; import java.util.concurrent.ScheduledFuture; import org.apache.commons.logging.Log;
import java.util.Collections; import java.util.Date;
47,479
public boolean sendEvent(Message<E> event) { return false; } @Override public boolean shouldDefer(Message<E> event) { <BUG>return deferred != null && deferred.contains(event.getPayload()); }</BUG> @Override public void exit(StateContext<S, E> context) { cancelStateActions();
return deferred.contains(event.getPayload());
47,480
return submachine; } public Collection<Region<S, E>> getRegions() { return regions; } <BUG>public void setTriggers(List<Trigger<S, E>> triggers) { this.triggers = triggers; }</BUG> public List<Trigger<S, E>> getTriggers() { return triggers;
if (triggers != null) { } else { this.triggers.clear();
47,481
future.cancel(true); } cancellableActions.clear(); } protected void scheduleStateActions(StateContext<S, E> context) { <BUG>if (stateActions == null) { return; }</BUG> for (Action<S, E> action : stateActions) { ScheduledFuture<?> future = scheduleAction(action, context);
[DELETED]
47,482
Logger.error(this, "reqs["+i+"] = null"); remove(blockNo, i, container); changedMe = true; continue; } <BUG>if(excluding.excludeSummarily(ret, this, container, persistent, now)) { </BUG> excluded++; if(excluded > MAX_EXCLUDED) { if(persistent && changedMe)
if(excluding.excludeSummarily(ret, this, container, persistent, now) > 0) {
47,483
item = reqsReading[offset]; if(item == null) continue; boolean excludeItem = false; boolean activated = false; <BUG>if(excluding.excludeSummarily(item, this, container, persistent, now)) { excludeItem = true; } else {</BUG> if(persistent)
long excludeTime = excluding.excludeSummarily(item, this, container, persistent, now); if(excludeTime > 0) { if(wakeupTime > excludeTime) wakeupTime = excludeTime; } else {
47,484
int x = context.fastWeakRandom.nextInt(grabArrays.length); for(int i=0;i<grabArrays.length;i++) { x++; if(x >= grabArrays.length) x = 0; RemoveRandomWithObject rga = grabArrays[x]; <BUG>if(excluding.excludeSummarily(rga, this, container, persistent, now)) continue; if(persistent)</BUG> container.activate(rga, 1);
long excludeTime = excluding.excludeSummarily(rga, this, container, persistent, now); if(excludeTime > 0) { if(wakeupTime > excludeTime) wakeupTime = excludeTime; } if(persistent)
47,485
RandomGrabArrayItem item = null; RemoveRandomReturn val = rga.removeRandom(excluding, container, context, now); if(val != null) { if(val.item != null) item = val.item; <BUG>else { if(wakeupTime > val.wakeupTime) wakeupTime = val.wakeupTime; }</BUG> } if(logMINOR)
[DELETED]
47,486
package mage.sets.eventide; import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; <BUG>import mage.Mana; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.mana.BasicManaAbility; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; public class CascadeBluffs extends CardImpl<CascadeBluffs> {</BUG> public CascadeBluffs(UUID ownerId) {
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.mana.SimpleManaAbility; import mage.constants.Zone; public class CascadeBluffs extends CardImpl<CascadeBluffs> {
47,487
public void setBindingvifType(String bindingvifType) { this.bindingvifType = bindingvifType; } public Boolean getPortSecurityEnabled() { if (portSecurityEnabled == null || portSecurityEnabled) { <BUG>if (deviceOwner != null && deviceOwner.startsWith("network:")) { return false; } return true;</BUG> }
return !(deviceOwner != null && deviceOwner.startsWith("network:"));
47,488
securityServicesManager.syncFixedSecurityGroup(neutronPort, neutronPort.getPortSecurityEnabled()); } private boolean isPortSecurityEnableUpdated(NeutronPort neutronPort) { LOG.trace("isPortSecuirtyEnableUpdated:" + neutronPort); <BUG>if (neutronPort != null </BUG> && neutronPort.getOriginalPort() != null && neutronPort.getOriginalPort().getPortSecurityEnabled() != null && neutronPort.getPortSecurityEnabled() != null
return neutronPort != null
47,489
</BUG> && neutronPort.getOriginalPort() != null && neutronPort.getOriginalPort().getPortSecurityEnabled() != null && neutronPort.getPortSecurityEnabled() != null && neutronPort.getOriginalPort().getPortSecurityEnabled() != neutronPort <BUG>.getPortSecurityEnabled()) { return true; } return false;</BUG> }
securityServicesManager.syncFixedSecurityGroup(neutronPort, neutronPort.getPortSecurityEnabled()); private boolean isPortSecurityEnableUpdated(NeutronPort neutronPort) { LOG.trace("isPortSecuirtyEnableUpdated:" + neutronPort); return neutronPort != null .getPortSecurityEnabled();
47,490
return dpnId; } return BigInteger.ZERO; } private boolean isVpnPresentInDpn(String rd, BigInteger dpnId) { <BUG>InstanceIdentifier<VpnToDpnList> id = FibUtil.getVpnToDpnListIdentifier(rd, dpnId); Optional<VpnToDpnList> dpnInVpn = FibUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, id); if (dpnInVpn.isPresent()) { return true; } return false;</BUG> }
return FibUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, id).isPresent();
47,491
boolean chkExtRtrAndSnatEnbl(Uuid routerUuid) { InstanceIdentifier<Routers> routerInstanceIndentifier = InstanceIdentifier.builder(ExtRouters.class) .child(Routers.class, new RoutersKey(routerUuid.getValue())).build(); Optional<Routers> routerData = read(dataBroker, LogicalDatastoreType.CONFIGURATION, routerInstanceIndentifier); <BUG>if (routerData.isPresent() && routerData.get().isEnableSnat()) { return true; } return false;</BUG> }
return routerData.isPresent() && routerData.get().isEnableSnat();
47,492
updated.getRemoteLocatorRef().getValue(); InstanceIdentifier<TerminationPoint> remoteLocatorRefOriginal = (InstanceIdentifier<TerminationPoint>) orig.getRemoteLocatorRef().getValue(); TpId tpId1 = remoteLocatorRefUpdated.firstKeyOf(TerminationPoint.class).getTpId(); TpId tpId2 = remoteLocatorRefOriginal.firstKeyOf(TerminationPoint.class).getTpId(); <BUG>if (tpId1.equals(tpId2)) { return true; } return false;</BUG> }
return tpId1.equals(tpId2);
47,493
NeutronSecurityGroupInterface(final DataBroker dataBroker) { super(dataBroker); } @Override public boolean neutronSecurityGroupExists(String uuid) { <BUG>SecurityGroup group = readMd(createInstanceIdentifier(toMd(uuid))); if (group == null) { return false; } return true;</BUG> }
[DELETED]
47,494
|| !Objects.equals(obj1.getNxmOfEthDst(), obj2.getNxmOfEthDst()) || !Objects.equals(obj1.getNxmOfUdpSrc(), obj2.getNxmOfUdpSrc()) || !Objects.equals(obj1.getNxmNxCtState(), obj2.getNxmNxCtState()) || !Objects.equals(obj1.getNxmNxTunIpv4Src(), obj2.getNxmNxTunIpv4Src()) || !Objects.equals(obj1.getNxmOfIpDst(), obj2.getNxmOfIpDst()) <BUG>|| !Objects.equals(obj1.getNxmNxNsp(), obj2.getNxmNxNsp())) { return false; } return true;</BUG> }
|| !Objects.equals(obj1.getNxmNxNsp(), obj2.getNxmNxNsp()));
47,495
NeutronSubnetInterface(final DataBroker dataBroker) { super(dataBroker); } @Override public boolean subnetExists(String uuid) { <BUG>Subnet subnet = readMd(createInstanceIdentifier(toMd(uuid))); if (subnet == null) { return false; } return true;</BUG> }
[DELETED]
47,496
return operationalVpnInterface.get(); } return null; } static boolean isVpnInterfaceConfigured(DataBroker broker, String interfaceName) { <BUG>InstanceIdentifier<VpnInterface> interfaceId = getVpnInterfaceIdentifier(interfaceName); Optional<VpnInterface> configuredVpnInterface = read(broker, LogicalDatastoreType.CONFIGURATION, interfaceId); if (configuredVpnInterface.isPresent()) { return true; } return false;</BUG> }
return read(broker, LogicalDatastoreType.CONFIGURATION, interfaceId).isPresent();
47,497
if (vpnInstanceOpData != null) { List<VpnToDpnList> dpnToVpns = vpnInstanceOpData.getVpnToDpnList(); if (dpnToVpns != null) { for (VpnToDpnList dpn : dpnToVpns) { if (dpn.getDpnId().equals(dpnId)) { <BUG>if (dpn.getVpnInterfaces().contains(vpnInterface.getName())) { return true; } else { return false; }</BUG> }
return dpn.getVpnInterfaces().contains(vpnInterface.getName());
47,498
@Override public String getDescription() { return "LogicalSwitches"; } @Override <BUG>public boolean areEqual(LogicalSwitches updated, LogicalSwitches orig) { if (updated.getHwvtepNodeName().getValue().equals( orig.getHwvtepNodeName().getValue())) { return true; } return false;</BUG> }
public List<LogicalSwitches> getData(HwvtepGlobalAugmentation node) { if (node != null) { return node.getLogicalSwitches();
47,499
nodePath.child(TerminationPoint.class, new TerminationPointKey(tpId)); HwvtepPhysicalLocatorRef physicalLocatorRef = new HwvtepPhysicalLocatorRef(tpPath); return physicalLocatorRef; } public static boolean isEmptyList(List list) { <BUG>if (list == null || list.size() == 0) { return true; } return false;</BUG> }
return list == null || list.size() == 0;
47,500
InstanceIdentifier<?> updatedMacRefIdentifier = updated.getLogicalSwitchRef().getValue(); HwvtepNodeName updatedMacNodeName = updatedMacRefIdentifier.firstKeyOf(LogicalSwitches.class) .getHwvtepNodeName(); InstanceIdentifier<?> origMacRefIdentifier = orig.getLogicalSwitchRef().getValue(); HwvtepNodeName origMacNodeName = origMacRefIdentifier.firstKeyOf(LogicalSwitches.class).getHwvtepNodeName(); <BUG>if (updated.getMacEntryKey().equals(orig.getMacEntryKey()) && updatedMacNodeName.equals(origMacNodeName)) { return true; } return false;</BUG> }
return updated.getMacEntryKey().equals(orig.getMacEntryKey()) && updatedMacNodeName.equals(origMacNodeName);