id int64 1 194k | buggy stringlengths 23 37.5k | fixed stringlengths 6 37.4k |
|---|---|---|
1,001 | SNode method = _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.cast(SNodeOperations.getParent(_context.getNode()), "jetbrains.mps.lang.quotation.structure.Quotation"), "quotationStaticMethod");
SNode varDeclStmt = SNodeOperations.cast(ListSequence.fromList(SLinkOperations.getTargets(SLinkOperations.get... | SNode method = _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.cast(SNodeOperations.getParent(_context.getNode()), "jetbrains.mps.lang.quotation.structure.Quotation"), "quotationStaticMethod");
SNode varDeclStmt = SNodeOperations.cast(ListSequence.fromList(SLinkOperations.getTargets(SLinkOperations.get... |
1,002 | return null;
}
return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(antiquotation, "expression", true), "parametersFromExpressions");
}
public static Object referenceMacro_GetReferent_1196351887466(final IOperationContext operationContext, final ReferenceMacroContext _context) {
<BUG>return... | return null;
}
return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(antiquotation, "expression", true), "parametersFromExpressions");
}
public static Object referenceMacro_GetReferent_1196351887466(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _con... |
1,003 | public static Object referenceMacro_GetReferent_1025590056396681336(final IOperationContext operationContext, final ReferenceMacroContext _context) {
<BUG>return SNodeOperations.cast(_context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode().getReferenceTarget("sourceNode"), "nodeVariable"), "jetbrains.mps.bas... | public static Object referenceMacro_GetReferent_1025590056396681336(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode().getReferenceTarget("sourceNode"), "nodeVariable");
}
public static Object referenceMacro_GetRef... |
1,004 | if (SNodeOperations.isInstanceOf(child, "jetbrains.mps.lang.quotation.structure.ListAntiquotation")) {
return true;
}
}
return false;
<BUG>}
public static boolean ifMacro_Condition_1025590056396681218(final IOperationContext operationContext, final IfMacroContext _context) {
return true;
}
public static boolean ifMacro... | if (SNodeOperations.isInstanceOf(child, "jetbrains.mps.lang.quotation.structure.ListAntiquotation")) {
return true;
}
}
return false;
}
|
1,005 | } catch (Exception e) {
AppLog.e(this,e);
}
setContentView(createContentView());
addSource(new CustomFileSource(getServiceContext(),osmApi.getResultFile().toString()));
<BUG>addTarget(list);
setQueryTextFromIntent();</BUG>
}
private void setQueryTextFromIntent() {
String query = queryFromIntent(getIntent());
| } catch (Exception e) {
AppLog.e(this,e);
}
setContentView(createContentView());
addSource(new CustomFileSource(getServiceContext(),osmApi.getResultFile().toString()));
addTarget(list, InfoID.FILEVIEW);
setQueryTextFromIntent();
}
private void setQueryTextFromIntent() {
String query = queryFromIntent(getIntent());
|
1,006 | view.addView(tagEditor, layout);
TextView postLabel = new TextView(this);
postLabel.setText(osmApi.getUrlEnd());
view.addView(postLabel, layout);
AppTheme.themify(postLabel);
<BUG>list = new NodeListView(getServiceContext(),SOLID_KEY,
InfoID.FILEVIEW);</BUG>
view.addView(list,layout);
return view;
| view.addView(tagEditor, layout);
TextView postLabel = new TextView(this);
postLabel.setText(osmApi.getUrlEnd());
view.addView(postLabel, layout);
AppTheme.themify(postLabel);
list = new NodeListView(getServiceContext());
view.addView(list,layout);
return view;
|
1,007 | import ch.bailu.aat.helpers.AppLayout;
import ch.bailu.aat.views.ContentView;
import ch.bailu.aat.views.ControlBar;
import ch.bailu.aat.views.HtmlScrollTextView;
import ch.bailu.aat.views.MainControlBar;
<BUG>import ch.bailu.aat.views.description.VerticalView;
import ch.bailu.aat.views.map.OsmInteractiveView;
import ch... | import ch.bailu.aat.helpers.AppLayout;
import ch.bailu.aat.views.ContentView;
import ch.bailu.aat.views.ControlBar;
import ch.bailu.aat.views.HtmlScrollTextView;
import ch.bailu.aat.views.MainControlBar;
import ch.bailu.aat.views.description.VerticalView;
import ch.bailu.aat.views.map.MapFactory;
import ch.bailu.aat.vi... |
1,008 | import ch.bailu.aat.views.BusyButton;
import ch.bailu.aat.views.ContentView;
import ch.bailu.aat.views.ControlBar;
import ch.bailu.aat.views.MainControlBar;
import ch.bailu.aat.views.description.MultiView;
<BUG>import ch.bailu.aat.views.description.TrackDescriptionView;
import ch.bailu.aat.views.description.VerticalVie... | import ch.bailu.aat.views.BusyButton;
import ch.bailu.aat.views.ContentView;
import ch.bailu.aat.views.ControlBar;
import ch.bailu.aat.views.MainControlBar;
import ch.bailu.aat.views.description.MultiView;
|
1,009 | package ch.bailu.aat.activities;
<BUG>import android.os.Bundle;
import ch.bailu.aat.description.AverageSpeedDescription;</BUG>
import ch.bailu.aat.description.CaloriesDescription;
import ch.bailu.aat.description.ContentDescription;
import ch.bailu.aat.description.DateDescription;
| package ch.bailu.aat.activities;
import android.os.Bundle;
import android.view.View;
import ch.bailu.aat.description.AverageSpeedDescription;
import ch.bailu.aat.description.CaloriesDescription;
import ch.bailu.aat.description.ContentDescription;
import ch.bailu.aat.description.DateDescription;
|
1,010 | import ch.bailu.aat.dispatcher.OnContentUpdatedInterface;
import ch.bailu.aat.dispatcher.OverlaySource;
import ch.bailu.aat.dispatcher.TrackerSource;
import ch.bailu.aat.gpx.GpxInformation;
import ch.bailu.aat.gpx.InfoID;
<BUG>import ch.bailu.aat.helpers.AppLayout;
import ch.bailu.aat.helpers.file.FileAction;
import ch... | import ch.bailu.aat.dispatcher.OnContentUpdatedInterface;
import ch.bailu.aat.dispatcher.OverlaySource;
import ch.bailu.aat.dispatcher.TrackerSource;
import ch.bailu.aat.gpx.GpxInformation;
import ch.bailu.aat.gpx.InfoID;
import ch.bailu.aat.helpers.AppLayout;
import ch.bailu.aat.helpers.ToolTip;
import ch.bailu.aat.he... |
1,011 | import ch.bailu.aat.views.BusyButton;
import ch.bailu.aat.views.ContentView;
import ch.bailu.aat.views.ControlBar;
import ch.bailu.aat.views.MainControlBar;
import ch.bailu.aat.views.description.MultiView;
<BUG>import ch.bailu.aat.views.description.TrackDescriptionView;</BUG>
import ch.bailu.aat.views.description.Verti... | import ch.bailu.aat.views.BusyButton;
import ch.bailu.aat.views.ContentView;
import ch.bailu.aat.views.ControlBar;
import ch.bailu.aat.views.MainControlBar;
import ch.bailu.aat.views.description.MultiView;
import ch.bailu.aat.views.description.VerticalView;
import ch.bailu.aat.views.graph.DistanceAltitudeGraphView;
imp... |
1,012 | new NameDescription(this),
new PathDescription(this),
new DistanceDescription(this),
new TrackSizeDescription(this),
};
<BUG>NodeListView wayList = new NodeListView(getServiceContext(),
SOLID_KEY,
InfoID.EDITOR_OVERLAY
);</BUG>
VerticalScrollView summary = new VerticalScrollView(this);
| new NameDescription(this),
new PathDescription(this),
new DistanceDescription(this),
new TrackSizeDescription(this),
};
NodeListView nodeList = new NodeListView(getServiceContext());
addTarget(nodeList, InfoID.EDITOR_OVERLAY);
|
1,013 | public Iterable<JvmFeature> getFeaturesByName(String name, JvmTypeReference declarator,
Iterable<JvmTypeReference> hierarchy) {
if(extensionProvidingType == null)
return emptyList();
List<JvmFeature> result = Lists.newArrayList();
<BUG>JvmType rawType = getTypeReferences().getRawType(extensionProvidingType);
if (rawTyp... | public Iterable<JvmFeature> getFeaturesByName(String name, JvmTypeReference declarator,
Iterable<JvmTypeReference> hierarchy) {
if(extensionProvidingType == null)
return emptyList();
List<JvmFeature> result = Lists.newArrayList();
List<JvmType> rawTypes = getRawTypeHelper().getAllRawTypes(extensionProvidingType, null);... |
1,014 | public Iterable<JvmFeature> getAllFeatures(JvmTypeReference typeReference,
Iterable<JvmTypeReference> hierarchy) {
if(extensionProvidingType == null)
return emptyList();
List<JvmFeature> result = newArrayList();
<BUG>JvmType rawType = getTypeReferences().getRawType(extensionProvidingType);
if (rawType instanceof JvmDec... | public Iterable<JvmFeature> getAllFeatures(JvmTypeReference typeReference,
Iterable<JvmTypeReference> hierarchy) {
if(extensionProvidingType == null)
return emptyList();
List<JvmFeature> result = newArrayList();
List<JvmType> rawTypes = getRawTypeHelper().getAllRawTypes(extensionProvidingType, null);
for(JvmType rawTyp... |
1,015 | package org.eclipse.xtext.xbase.scoping.featurecalls;
import org.eclipse.xtext.common.types.JvmTypeConstraint;
import org.eclipse.xtext.common.types.JvmTypeParameter;
import org.eclipse.xtext.common.types.JvmTypeReference;
<BUG>import org.eclipse.xtext.common.types.JvmUpperBound;
import org.eclipse.xtext.common.types.u... | package org.eclipse.xtext.xbase.scoping.featurecalls;
import org.eclipse.xtext.common.types.JvmTypeConstraint;
import org.eclipse.xtext.common.types.JvmTypeParameter;
import org.eclipse.xtext.common.types.JvmTypeReference;
import org.eclipse.xtext.common.types.JvmUpperBound;
import org.eclipse.xtext.common.types.util.I... |
1,016 | import org.eclipse.xtext.common.types.util.TypeReferences;
import org.eclipse.xtext.xbase.typing.XbaseTypeConformanceComputer;</BUG>
import com.google.inject.Inject;
public abstract class AbstractFeaturesForTypeProvider implements IFeaturesForTypeProvider {
@Inject
<BUG>private XbaseTypeConformanceComputer typeConforma... | import org.eclipse.xtext.common.types.util.TypeReferences;
import com.google.inject.Inject;
public abstract class AbstractFeaturesForTypeProvider implements IFeaturesForTypeProvider {
@Inject
private TypeConformanceComputer typeConformanceComputer;
@Inject
private TypeReferences typeReferences;
@Inject
private IRawType... |
1,017 | package org.eclipse.xtext.xbase.scoping.featurecalls;
<BUG>import java.util.Collection;
import java.util.Map;</BUG>
import java.util.Set;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtext.common.types.JvmDeclaredType;
| package org.eclipse.xtext.xbase.scoping.featurecalls;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtext.common.types.JvmDeclaredType;
|
1,018 | public JvmTypeReference get() {
return getTypeReferences().getTypeForName(staticTypeName, context);
}
}) ;
if (staticType != null) {
<BUG>JvmType rawType = getTypeReferences().getRawType(staticType);
if (rawType instanceof JvmDeclaredType) {</BUG>
Iterable<JvmFeature> features = name != null ? ((JvmDeclaredType) rawTyp... | public JvmTypeReference get() {
return getTypeReferences().getTypeForName(staticTypeName, context);
}
}) ;
if (staticType != null) {
List<JvmType> rawTypes = getRawTypeHelper().getAllRawTypes(staticType, context);
for(JvmType rawType: rawTypes) {
if (rawType instanceof JvmDeclaredType) {
Iterable<JvmFeature> features =... |
1,019 | if (rawType instanceof JvmDeclaredType) {</BUG>
Iterable<JvmFeature> features = name != null ? ((JvmDeclaredType) rawType).findAllFeaturesByName(name) : ((JvmDeclaredType) rawType).getAllFeatures();
for(JvmFeature feature: features) {
if (feature instanceof JvmOperation) {
if (isMatchingExtension(e.getKey(), (JvmOperat... | public JvmTypeReference get() {
return getTypeReferences().getTypeForName(staticTypeName, context);
}
}) ;
if (staticType != null) {
List<JvmType> rawTypes = getRawTypeHelper().getAllRawTypes(staticType, context);
for(JvmType rawType: rawTypes) {
if (rawType instanceof JvmDeclaredType) {
Iterable<JvmFeature> features =... |
1,020 | package org.eclipse.xtext.xbase.scoping.featurecalls;
<BUG>import java.util.Collections;
import java.util.List;</BUG>
import org.eclipse.xtext.common.types.JvmDeclaredType;
import org.eclipse.xtext.common.types.JvmFeature;
import org.eclipse.xtext.common.types.JvmType;
| package org.eclipse.xtext.xbase.scoping.featurecalls;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.eclipse.xtext.common.types.JvmDeclaredType;
import org.eclipse.xtext.common.types.JvmFeature;
import org.eclipse.xtext.common.types.JvmType;
|
1,021 | import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.xtext.EcoreUtil2;
import org.eclipse.xtext.common.types.JvmAnyTypeReference;
import org.eclipse.xtext.common.types.JvmArrayType;
<BUG>import org.eclipse.xtext.common.types.JvmComponentType;</BUG>
import org.eclip... | import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.xtext.EcoreUtil2;
import org.eclipse.xtext.common.types.JvmAnyTypeReference;
import org.eclipse.xtext.common.types.JvmArrayType;
import org.eclipse.xtext.common.types.JvmGenericArrayTypeReference;
import org.ecli... |
1,022 | package com.redhat.ceylon.compiler.java.codegen;
import com.redhat.ceylon.compiler.Util;
<BUG>import com.redhat.ceylon.compiler.typechecker.analyzer.AnalysisWarning;
import com.redhat.ceylon.compiler.typechecker.tree.Message;</BUG>
import com.redhat.ceylon.compiler.typechecker.tree.NaturalVisitor;
import com.redhat.cey... | package com.redhat.ceylon.compiler.java.codegen;
import com.redhat.ceylon.compiler.Util;
import com.redhat.ceylon.compiler.typechecker.analyzer.AnalysisWarning;
import com.redhat.ceylon.compiler.typechecker.analyzer.UsageWarning;
import com.redhat.ceylon.compiler.typechecker.tree.Message;
import com.redhat.ceylon.compi... |
1,023 | }
}
final PsiExpression[] operands = polyadicExpression.getOperands();
if (operands.length != 2) {
return null;
<BUG>}
if (PsiType.NULL.equals(operands[0].getType())) {
return getVariable(operands[1]);
}</BUG>
else if (PsiType.NULL.equals(operands[1].getType())) {
| }
public static boolean isNegative(@NotNull PsiExpression expression) {
final PsiElement parent = expression.getParent();
if (!(parent instanceof PsiPrefixExpression)) {
return false;
}
|
1,024 | import com.siyeh.ig.BaseInspectionVisitor;
import com.siyeh.ig.InspectionGadgetsFix;
import com.siyeh.ig.PsiReplacementUtil;
import com.siyeh.ig.psiutils.ExpressionUtils;
import com.siyeh.ig.psiutils.ParenthesesUtils;
<BUG>import com.siyeh.ig.psiutils.VariableAccessUtils;
import org.jetbrains.annotations.Nls;</BUG>
imp... | import com.siyeh.ig.BaseInspectionVisitor;
import com.siyeh.ig.InspectionGadgetsFix;
import com.siyeh.ig.PsiReplacementUtil;
import com.siyeh.ig.psiutils.ExpressionUtils;
import com.siyeh.ig.psiutils.ParenthesesUtils;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.Nls;
import org.jetbrains.... |
1,025 | protected void doFix(Project project, ProblemDescriptor descriptor) {
final PsiElement element = descriptor.getPsiElement();
if (!(element instanceof PsiBinaryExpression || element instanceof PsiMethodCallExpression)) {
return;
}
<BUG>final PsiExpression expression = (PsiExpression)element;
if (myEquals) {
PsiReplaceme... | protected void doFix(Project project, ProblemDescriptor descriptor) {
final PsiElement element = descriptor.getPsiElement();
if (!(element instanceof PsiBinaryExpression || element instanceof PsiMethodCallExpression)) {
return;
|
1,026 | public BaseInspectionVisitor buildVisitor() {
return new EqualsReplaceableByObjectsCallVisitor();
}
private class EqualsReplaceableByObjectsCallVisitor extends BaseInspectionVisitor {
@Override
<BUG>public void visitMethodCallExpression(PsiMethodCallExpression expression) {
final PsiElement maybeBinary = PsiTreeUtil.sk... | public BaseInspectionVisitor buildVisitor() {
return new EqualsReplaceableByObjectsCallVisitor();
}
private class EqualsReplaceableByObjectsCallVisitor extends BaseInspectionVisitor {
@Override
public void visitMethodCallExpression(PsiMethodCallExpression expression) {
final String methodName = expression.getMethodExpr... |
1,027 | }
checkEqualityBefore(expression, false, variable, otherVariable);</BUG>
}
return true;
}
<BUG>private void checkEqualityBefore(PsiExpression expression, boolean equals, PsiVariable variable1, PsiVariable variable2) {
final PsiElement parent = PsiTreeUtil.skipParentsOfType(expression, PsiParenthesizedExpression.class);... | }
}
}
return false;
}
@Nullable
private PsiExpression checkEqualityBefore(PsiExpression expression, boolean equal, String qualifiedName1, String qualifiedName2) {
final PsiElement parent = PsiTreeUtil.skipParentsOfType(expression, PsiParenthesizedExpression.class);
if (parent instanceof PsiBinaryExpression) {
final Psi... |
1,028 | if (parent instanceof PsiBinaryExpression) {
<BUG>final PsiBinaryExpression binaryExpression = (PsiBinaryExpression)parent;
if (PsiTreeUtil.isAncestor(binaryExpression.getROperand(), expression, false)) {</BUG>
final PsiExpression lhs = binaryExpression.getLOperand();
<BUG>if (isEquality(lhs, equals, variable1, variabl... | if (parent instanceof PsiBinaryExpression) {
final PsiBinaryExpression binaryExpression = (PsiBinaryExpression)parent;
final IElementType tokenType = binaryExpression.getOperationTokenType();
if (equal && JavaTokenType.OROR.equals(tokenType) || !equal && JavaTokenType.ANDAND.equals(tokenType)) {
if (PsiTreeUtil.isAnces... |
1,029 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| } else {
updateMemo();
callback.updateMemo();
}
dismiss();
} else {
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
|
1,030 | }
@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();
| }
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_memo);
ChinaPhoneHelper.setStatusBar(this, true);
topicId = getIntent().getLongExtra("topicId", -1);
if (topicId == -1) {
finish();
|
1,031 | import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kiminonawa.mydiary.R;
import com.kiminonawa.mydiary.db.DBManager;
import com.kiminonawa.mydiary.shared.EditMode;
<BUG>import com.kiminonawa.mydiary.shared.ThemeManager;
import java.util.List;
public class MemoAdapter extends RecyclerView.A... | import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kiminonawa.mydiary.R;
import com.kiminonawa.mydiary.db.DBManager;
import com.kiminonawa.mydiary.shared.EditMode;
import com.kiminonawa.mydiary.shared.ThemeManager;
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter... |
1,032 | private DBManager dbManager;
private boolean isEditMode = false;
private EditMemoDialogFragment.MemoCallback callback;
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
<BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMe... | 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;
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDia... |
1,033 | 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) {
| this.memoList = memoList;
this.dbManager = dbManager;
this.callback = callback;
}
@Override
public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view;
if (isEditMode) {
if (viewType == TYPE_HEADER) {
|
1,034 | 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;
| editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment");
}
});
}
}
protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
private View rootView;
private ImageView IV_memo_item_dot;
private TextView TV_memo_item_c... |
1,035 | MemoEntry.COLUMN_REF_TOPIC__ID + " = ?"
, new String[]{String.valueOf(topicId)});
}
public Cursor selectMemo(long topicId) {
Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null,
<BUG>MemoEntry._ID + " DESC", null);
</BUG>
if (c != nu... | MemoEntry.COLUMN_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,
MemoEntry.COLUMN_ORDER + " ASC", null);
if (c != null) ... |
1,036 | 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 + " = ?",
| MemoEntry._ID + " = ?",
new String[]{String.valueOf(memoId)});
}
public long updateMemoContent(long memoId, String memoContent) {
ContentValues values = new ContentValues();
values.put(MemoEntry.COLUMN_CONTENT, memoContent);
return db.update(
MemoEntry.TABLE_NAME,
values,
MemoEntry._ID + " = ?",
|
1,037 | import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class DependencyConvergenceReport
extends AbstractProjectInfoReport
<BUG>{
private List reactorProjects;
private static final int PERCENTAGE = 100;</BUG>
public String getOutputName()
{
| import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class DependencyConvergenceReport
extends AbstractProjectInfoReport
{
private static final int PERCENTAGE = 100;
private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment
.getLocalGraphicsEnvironment().getAv... |
1,038 | sink.section1();
sink.sectionTitle1();
sink.text( getI18nString( locale, "title" ) );
sink.sectionTitle1_();
Map dependencyMap = getDependencyMap();
<BUG>generateLegend( locale, sink );
generateStats( locale, sink, dependencyMap );
generateConvergence( locale, sink, dependencyMap );
sink.section1_();</BUG>
sink.body_()... | sink.section1();
sink.sectionTitle1();
sink.text( getI18nString( locale, "title" ) );
sink.sectionTitle1_();
Map dependencyMap = getDependencyMap();
generateLegend( locale, sink );
sink.lineBreak();
generateStats( locale, sink, dependencyMap );
sink.section1_();
generateConvergence( locale, sink, dependencyMap );
sink.... |
1,039 | Iterator it = artifactMap.keySet().iterator();
while ( it.hasNext() )
{
String version = (String) it.next();
sink.tableRow();
<BUG>sink.tableCell();
sink.text( version );</BUG>
sink.tableCell_();
sink.tableCell();
generateVersionDetails( sink, artifactMap, version );
| Iterator it = artifactMap.keySet().iterator();
while ( it.hasNext() )
{
String version = (String) it.next();
sink.tableRow();
sink.tableCell( String.valueOf( cellWidth ) + "px" );
sink.text( version );
sink.tableCell_();
sink.tableCell();
generateVersionDetails( sink, artifactMap, version );
|
1,040 | return uniqueArtifactMap;
}
private void generateLegend( Locale locale, Sink sink )
{
sink.table();
<BUG>sink.tableCaption();
sink.text( getI18nString( locale, "legend" ) + ":" );
sink.tableCaption_();</BUG>
sink.tableRow();
<BUG>sink.tableCell();
iconSuccess( sink );</BUG>
sink.tableCell_();
| return uniqueArtifactMap;
}
private void generateLegend( Locale locale, Sink sink )
{
sink.table();
sink.tableCaption();
sink.bold();
sink.text( getI18nString( locale, "legend" ) );
sink.bold_();
sink.tableCaption_();
sink.tableRow();
sink.tableCell( "15px" ); // according /images/icon_success_sml.gif
iconSuccess( sink... |
1,041 | sink.tableCell();
sink.text( getI18nString( locale, "legend.shared" ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableCell();
iconError( sink );</BUG>
sink.tableCell_();
sink.tableCell();
sink.text( getI18nString( locale, "legend.different" ) );
| sink.tableCell();
sink.text( getI18nString( locale, "legend.shared" ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
sink.tableCell( "15px" ); // according /images/icon_error_sml.gif
iconError( sink );
sink.tableCell_();
sink.tableCell();
sink.text( getI18nString( locale, "legend.different" ) );
|
1,042 | sink.tableCaption();
sink.text( getI18nString( locale, "stats.caption" ) );
sink.tableCaption_();</BUG>
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.subprojects" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
s... | sink.tableCaption();
sink.bold();
sink.text( getI18nString( locale, "stats.caption" ) );
sink.bold_();
sink.tableCaption_();
sink.tableRow();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.subprojects" ) );
sink.tableHeaderCell_();
sink.tableCell();
sink.text( String.valueOf( reactorP... |
1,043 | sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.dependencies" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( depCount ) );
| sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.dependencies" ) );
sink.tableHeaderCell_();
sink.tableCell();
sink.text( String.valueOf( depCount ) );
|
1,044 | sink.text( String.valueOf( convergence ) + "%" );
sink.bold_();
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
| sink.text( String.valueOf( convergence ) + "%" );
sink.bold_();
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.readyrelease" ) );
sink.tableHeaderCell_();
sink.tableCell();
if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
|
1,045 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| {
iconError( sink );
}
else
{
|
1,046 | public static void main(String[] args) throws IOException {
Configuration conf = HBaseConfiguration.create();
HBaseHelper helper = HBaseHelper.getHelper(conf);
helper.dropTable("testtable");
helper.createTable("testtable", "colfam1", "colfam2");
<BUG>Connection connection = ConnectionFactory.createConnection(conf);
Tab... | public static void main(String[] args) throws IOException {
Configuration conf = HBaseConfiguration.create();
HBaseHelper helper = HBaseHelper.getHelper(conf);
helper.dropTable("testtable");
helper.createTable("testtable", "colfam1", "colfam2");
helper.put("testtable",
new String[] { "row1" },
new String[] { "colfam1",... |
1,047 | Put put1 = new Put(Bytes.toBytes("row1"));
put1.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual1"),
Bytes.toBytes("val1")); // co CheckAndPutExample-1-Put1 Create a new Put instance.
boolean res1 = table.checkAndPut(Bytes.toBytes("row1"),
Bytes.toBytes("colfam1"), Bytes.toBytes("qual1"), null, put1); // co CheckAndPu... | Put put1 = new Put(Bytes.toBytes("row1"));
put1.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual1"),
Bytes.toBytes("val1")); // co CheckAndPutExample-1-Put1 Create a new Put instance.
boolean res1 = table.checkAndPut(Bytes.toBytes("row1"),
Bytes.toBytes("colfam1"), Bytes.toBytes("qual1"), null, put1); // co CheckAndPu... |
1,048 | put2.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual2"),
Bytes.toBytes("val2")); // co CheckAndPutExample-6-Put2 Create another Put instance, but using a different column qualifier.
boolean res3 = table.checkAndPut(Bytes.toBytes("row1"),
Bytes.toBytes("colfam1"), Bytes.toBytes("qual1"), // co CheckAndPutExample-7-CAS... | put2.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual2"),
Bytes.toBytes("val2")); // co CheckAndPutExample-6-Put2 Create another Put instance, but using a different column qualifier.
boolean res3 = table.checkAndPut(Bytes.toBytes("row1"),
Bytes.toBytes("colfam1"), Bytes.toBytes("qual1"), // co CheckAndPutExample-7-CAS... |
1,049 | batch.add(put);
Get get1 = new Get(ROW1);
get1.addColumn(COLFAM1, QUAL1); // co BatchExample-4-AddGet Add a Get instance for a different row.
batch.add(get1);
Delete delete = new Delete(ROW1);
<BUG>delete.deleteColumns(COLFAM1, QUAL2); // co BatchExample-5-AddDelete Add a Delete instance.
</BUG>
batch.add(delete);
Get ... | batch.add(put);
Get get1 = new Get(ROW1);
get1.addColumn(COLFAM1, QUAL1); // co BatchExample-4-AddGet Add a Get instance for a different row.
batch.add(get1);
Delete delete = new Delete(ROW1);
delete.addColumns(COLFAM1, QUAL2); // co BatchExample-5-AddDelete Add a Delete instance.
batch.add(delete);
Get get2 = new Get(... |
1,050 | table.batch(batch, results);
} catch (Exception e) {
System.err.println("Error: " + e); // co BatchExample-8-Print Print error that was caught.
}
for (int i = 0; i < results.length; i++) {
<BUG>System.out.println("Result[" + i + "]: " + results[i]); // co BatchExample-9-Dump Print all results.
}
table.close();
System.... | table.batch(batch, results);
} catch (Exception e) {
System.err.println("Error: " + e); // co BatchExample-8-Print Print error that was caught.
}
for (int i = 0; i < results.length; i++) {
System.out.println("Result[" + i + "]: type = " + // co BatchExample-9-Dump Print all results and class types.
results[i].getClass(... |
1,051 | helper.dropTable("testtable");
helper.createTable("testtable", "colfam1", "colfam2");
helper.put("testtable",
new String[] { "row1" },
new String[] { "colfam1", "colfam2" },
<BUG>new String[] { "qual1", "qual1", "qual2", "qual2", "qual3", "qual3" },
new long[] { 1, 2, 3, 4, 5, 6 },
new String[] { "val1", "val2", "val... | helper.dropTable("testtable");
helper.createTable("testtable", "colfam1", "colfam2");
helper.put("testtable",
new String[] { "row1" },
new String[] { "colfam1", "colfam2" },
new String[] { "qual1", "qual2", "qual3" },
new long[] { 1, 2, 3 },
new String[] { "val1", "val2", "val3" });
System.out.println("Before delete ... |
1,052 | Table table = connection.getTable(TableName.valueOf("testtable"));
Delete delete1 = new Delete(Bytes.toBytes("row1"));
delete1.addColumns(Bytes.toBytes("colfam1"), Bytes.toBytes("qual3")); // co CheckAndDeleteExample-1-Delete1 Create a new Delete instance.
boolean res1 = table.checkAndDelete(Bytes.toBytes("row1"),
Byte... | Table table = connection.getTable(TableName.valueOf("testtable"));
Delete delete1 = new Delete(Bytes.toBytes("row1"));
delete1.addColumns(Bytes.toBytes("colfam1"), Bytes.toBytes("qual3")); // co CheckAndDeleteExample-1-Delete1 Create a new Delete instance.
boolean res1 = table.checkAndDelete(Bytes.toBytes("row1"),
Byte... |
1,053 | Delete delete2 = new Delete(Bytes.toBytes("row1"));
delete2.addColumns(Bytes.toBytes("colfam2"), Bytes.toBytes("qual3")); // co CheckAndDeleteExample-4-Delete2 Delete checked column manually.
table.delete(delete2);
boolean res2 = table.checkAndDelete(Bytes.toBytes("row1"),
Bytes.toBytes("colfam2"), Bytes.toBytes("qual3... | Delete delete2 = new Delete(Bytes.toBytes("row1"));
delete2.addColumns(Bytes.toBytes("colfam2"), Bytes.toBytes("qual3")); // co CheckAndDeleteExample-4-Delete2 Delete checked column manually.
table.delete(delete2);
boolean res2 = table.checkAndDelete(Bytes.toBytes("row1"),
Bytes.toBytes("colfam2"), Bytes.toBytes("qual3... |
1,054 | public static void main(String[] args) throws IOException {
Configuration conf = HBaseConfiguration.create();
HBaseHelper helper = HBaseHelper.getHelper(conf);
helper.dropTable("testtable");
helper.createTable("testtable", "colfam1", "colfam2");
<BUG>Connection connection = ConnectionFactory.createConnection(conf);
Tab... | public static void main(String[] args) throws IOException {
Configuration conf = HBaseConfiguration.create();
HBaseHelper helper = HBaseHelper.getHelper(conf);
helper.dropTable("testtable");
helper.createTable("testtable", "colfam1", "colfam2");
helper.put("testtable",
new String[] { "row1" },
new String[] { "colfam1",... |
1,055 | new String[] { "colfam1", "colfam2" },
new String[] { "qual1", "qual1", "qual2", "qual2", "qual3", "qual3" },
new long[] { 1, 2, 3, 4, 5, 6 },
new String[] { "val1", "val2", "val3", "val4", "val5", "val6" });
System.out.println("Before delete call...");
<BUG>helper.dump("testtable", new String[]{ "row1" }, null, null... | new String[] { "colfam1", "colfam2" },
new String[] { "qual1", "qual1", "qual2", "qual2", "qual3", "qual3" },
new long[] { 1, 2, 3, 4, 5, 6 },
new String[] { "val1", "val2", "val3", "val4", "val5", "val6" });
System.out.println("Before delete call...");
helper.dump("testtable", new String[]{ "row1" }, null, null);
Co... |
1,056 | public static void main(String[] args) throws IOException {
Configuration conf = HBaseConfiguration.create();
HBaseHelper helper = HBaseHelper.getHelper(conf);
helper.dropTable("testtable");
helper.createTable("testtable", "colfam1", "colfam2");
<BUG>Connection connection = ConnectionFactory.createConnection(conf);
Tab... | public static void main(String[] args) throws IOException {
Configuration conf = HBaseConfiguration.create();
HBaseHelper helper = HBaseHelper.getHelper(conf);
helper.dropTable("testtable");
helper.createTable("testtable", "colfam1", "colfam2");
helper.put("testtable",
new String[] { "row1" },
new String[] { "colfam1",... |
1,057 | table.batch(batch, results);
} catch (Exception e) {
System.err.println("Error: " + e);
}
for (int i = 0; i < results.length; i++) {
<BUG>System.out.println("Result[" + i + "]: " + results[i]);
}
table.close();
System.out.println("After batch call...");
helper.dump("testtable", new String[]{"row1"}, null, null);
}</BU... | table.batch(batch, results);
} catch (Exception e) {
System.err.println("Error: " + e);
}
for (int i = 0; i < results.length; i++) {
System.out.println("Result[" + i + "]: type = " +
results[i].getClass().getSimpleName() + "; " + results[i]);
}
table.close();
connection.close();
System.out.println("After batch call..."... |
1,058 | package co.cask.cdap.internal.format;
<BUG>public class UnexpectedFormatException extends Exception {
</BUG>
public UnexpectedFormatException(String message) {
super(message);
}
| package co.cask.cdap.internal.format;
public class UnexpectedFormatException extends RuntimeException {
public UnexpectedFormatException(String message) {
super(message);
}
|
1,059 | import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
public class SingleStringRecordFormat extends ByteBufferRecordFormat<StructuredRecord> {
public static final String CHARSET = "charset";
<BUG>private Charset charset = Charsets.UTF_8;
@Override</BUG>
public StructuredRecord read(ByteBuffer in... | import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
public class SingleStringRecordFormat extends ByteBufferRecordFormat<StructuredRecord> {
public static final String CHARSET = "charset";
private Charset charset = Charsets.UTF_8;
private String fieldName = "body";
@Override
public StructuredR... |
1,060 | package co.cask.cdap.internal.format;
import co.cask.cdap.internal.io.Schema;
import co.cask.cdap.internal.io.UnsupportedTypeException;
<BUG>import co.cask.cdap.internal.specification.FormatSpecification;
import java.util.Map;</BUG>
public abstract class RecordFormat<FROM, TO> {
protected Schema schema;
protected Recor... | package co.cask.cdap.internal.format;
import co.cask.cdap.internal.io.Schema;
import co.cask.cdap.internal.io.UnsupportedTypeException;
import co.cask.cdap.internal.specification.FormatSpecification;
import java.util.Collections;
import java.util.Map;
public abstract class RecordFormat<FROM, TO> {
protected Schema sche... |
1,061 | }
public abstract TO read(FROM input) throws UnexpectedFormatException;
protected abstract Schema getDefaultSchema();
protected abstract void validateDesiredSchema(Schema desiredSchema) throws UnsupportedTypeException;
protected abstract void configure(Map<String, String> settings);
<BUG>public void initialize(FormatSp... | }
public abstract TO read(FROM input) throws UnexpectedFormatException;
protected abstract Schema getDefaultSchema();
protected abstract void validateDesiredSchema(Schema desiredSchema) throws UnsupportedTypeException;
protected abstract void configure(Map<String, String> settings);
public void initialize(FormatSpecifi... |
1,062 | package co.cask.cdap.internal.format;
<BUG>import co.cask.cdap.internal.io.Schema;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import java.util.Map;</BUG>
public class StructuredRecord {
| package co.cask.cdap.internal.format;
import co.cask.cdap.api.common.Bytes;
import co.cask.cdap.internal.io.Schema;
import co.cask.cdap.internal.io.UnsupportedTypeException;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.Itera... |
1,063 | return schema;
}
public <T> T get(String fieldName) {
return (T) fields.get(fieldName);
}
<BUG>public static Builder builder(Schema schema) {
return new Builder(schema);</BUG>
}
public static class Builder {
private final Schema schema;
| return schema;
}
public <T> T get(String fieldName) {
return (T) fields.get(fieldName);
}
public static Builder builder(Schema schema) throws UnexpectedFormatException {
if (schema == null || schema.getType() != Schema.Type.RECORD || schema.getFields().size() < 1) {
throw new UnexpectedFormatException("Schema must be a... |
1,064 | package mage.abilities.effects.common.counter;
import java.util.List;
<BUG>import java.util.UUID;
import mage.constants.Outcome;</BUG>
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.counters.Counter;
| package mage.abilities.effects.common.counter;
import java.util.List;
import java.util.UUID;
import mage.MageObject;
import mage.constants.Outcome;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.counters.Counter;
|
1,065 | import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.counters.Counter;
import mage.filter.FilterPermanent;
import mage.game.Game;
<BUG>import mage.game.permanent.Permanent;
public class AddCountersAllEffect extends OneShotEffect<AddCountersAllEffect> {
private Counter counter;
privat... | import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.counters.Counter;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
public class AddCountersAllEffect extends OneShotEffect<AddCountersAllEffect> {
private f... |
1,066 | this.counter = effect.counter.copy();
this.filter = effect.filter.copy();
}
@Override
public boolean apply(Game game, Ability source) {
<BUG>boolean applied = false;
if (counter != null) {</BUG>
UUID controllerId = source.getControllerId();
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents();
fo... | this.counter = effect.counter.copy();
this.filter = effect.filter.copy();
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
if (coun... |
1,067 | import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import mage.game.draft.DraftCube;
public class LimitedOptions implements Serializable {
<BUG>protected List<String> sets = new ArrayList<String>();
protected int constructionTime;</BUG>
protected String draftCubeName;
protected DraftCube dr... | import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import mage.game.draft.DraftCube;
public class LimitedOptions implements Serializable {
protected List<String> sets = new ArrayList<>();
protected int constructionTime;
protected String draftCubeName;
protected DraftCube draftCube;
protecte... |
1,068 | import mage.abilities.effects.OneShotEffect;
import mage.counters.Counter;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
<BUG>import java.util.UUID;
import mage.abilities.Mode;</BUG>
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.Sta... | import mage.abilities.effects.OneShotEffect;
import mage.counters.Counter;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Mode;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicval... |
1,069 | this.counter = effect.counter.copy();
}
this.amount = effect.amount;
}
@Override
<BUG>public boolean apply(Game game, Ability source) {
int affectedTargets = 0;</BUG>
for (UUID uuid : targetPointer.getTargets(game, source)) {
Permanent permanent = game.getPermanent(uuid);
if (permanent != null) {
| this.counter = effect.counter.copy();
}
this.amount = effect.amount;
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
int affectedT... |
1,070 | if (permanent != null) {
if (counter != null) {
Counter newCounter = counter.copy();
newCounter.add(amount.calculate(game, source));
permanent.addCounters(newCounter, game);
<BUG>affectedTargets ++;
}</BUG>
} else {
Player player = game.getPlayer(uuid);
if (player != null) {
| if (permanent != null) {
if (counter != null) {
Counter newCounter = counter.copy();
newCounter.add(amount.calculate(game, source));
permanent.addCounters(newCounter, game);
affectedTargets ++;
game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ")
.append(controller.getName()).append(" puts ")
.appe... |
1,071 | this.enchantedEquipped = enchantedEquipped;
setText();
}
public AddCountersControllerEffect(final AddCountersControllerEffect effect) {
super(effect);
<BUG>if (effect.counter != null)
this.counter = effect.counter.copy();
this.enchantedEquipped = effect.enchantedEquipped;</BUG>
}
| this.enchantedEquipped = enchantedEquipped;
setText();
}
public AddCountersControllerEffect(final AddCountersControllerEffect effect) {
super(effect);
if (effect.counter != null) {
this.counter = effect.counter.copy();
}
this.enchantedEquipped = effect.enchantedEquipped;
}
|
1,072 | Permanent enchantment = game.getPermanent(source.getSourceId());
if (enchantment != null && enchantment.getAttachedTo() != null) {
UUID eUuid = enchantment.getAttachedTo();
Permanent permanent = game.getPermanent(eUuid);
if (permanent != null) {
<BUG>uuid = permanent.getControllerId();
} else return false;
} else retur... | Permanent enchantment = game.getPermanent(source.getSourceId());
if (enchantment != null && enchantment.getAttachedTo() != null) {
UUID eUuid = enchantment.getAttachedTo();
Permanent permanent = game.getPermanent(eUuid);
if (permanent != null) {
uuid = permanent.getControllerId();
} else {
return false;
}
} else {
retu... |
1,073 | private void setText() {
if (counter.getCount() > 1) {
StringBuilder sb = new StringBuilder();
sb.append("its controller gets ").append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters");
staticText = sb.toString();
<BUG>} else
staticText = "its controller gets a " + counte... | private void setText() {
if (counter.getCount() > 1) {
StringBuilder sb = new StringBuilder();
sb.append("its controller gets ").append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters");
staticText = sb.toString();
} else {
staticText = "its controller gets a " + counter.ge... |
1,074 | import android.content.Context;
import android.content.SharedPreferences;
import android.location.Location;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
<BUG>import android.util.Log;
import org.mariotaku.twidere.BuildConfig;
import org.mariotaku.twidere.Constants;
import org.mariotaku.twidere... | import android.content.Context;
import android.content.SharedPreferences;
import android.location.Location;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
import org.mariotaku.twidere.Constants;
import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.JsonSerializer;
import... |
1,075 | }
public static LatLng getCachedLatLng(@NonNull final Context context) {
final Context appContext = context.getApplicationContext();
final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences();
if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null;
<BUG>if (BuildConfig.DEBUG) {
Lo... | }
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;
DebugLog.d(HotMobiLogger.LOGTAG,... |
1,076 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.form... | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
Utils.closeSilently(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
1,077 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBackgroundImage(fileBody, tile);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, S... | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
Utils.closeSilently(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
1,078 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
return twitter.updateProfileImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.for... | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
Utils.closeSilently(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
1,079 | import org.mariotaku.twidere.receiver.NotificationReceiver;
import org.mariotaku.twidere.service.LengthyOperationsService;
import org.mariotaku.twidere.util.ActivityTracker;
import org.mariotaku.twidere.util.AsyncTwitterWrapper;
import org.mariotaku.twidere.util.DataStoreFunctionsKt;
<BUG>import org.mariotaku.twidere.u... | import org.mariotaku.twidere.receiver.NotificationReceiver;
import org.mariotaku.twidere.service.LengthyOperationsService;
import org.mariotaku.twidere.util.ActivityTracker;
import org.mariotaku.twidere.util.AsyncTwitterWrapper;
import org.mariotaku.twidere.util.DataStoreFunctionsKt;
import org.mariotaku.twidere.util.D... |
1,080 | final List<InetAddress> addresses = mDns.lookup(host);
for (InetAddress address : addresses) {
c.addRow(new String[]{host, address.getHostAddress()});
}
} catch (final IOException ignore) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, ignore);
}</BUG>
}
| final List<InetAddress> addresses = mDns.lookup(host);
for (InetAddress address : addresses) {
c.addRow(new String[]{host, address.getHostAddress()});
}
} catch (final IOException ignore) {
DebugLog.w(LOGTAG, null, ignore);
}
|
1,081 | public int destroySavedSearchAsync(final UserKey accountKey, final long searchId) {
final DestroySavedSearchTask task = new DestroySavedSearchTask(accountKey, searchId);
return asyncTaskManager.add(task, true);
}
public int destroyStatusAsync(final UserKey accountKey, final String statusId) {
<BUG>final DestroyStatusTa... | 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) {
final DestroyStatusTask ta... |
1,082 | @Override
public void afterExecute(Bus handler, SingleResponse<Relationship> result) {
if (result.hasData()) {
handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData()));
} else if (result.hasException()) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, "Unable to update friendship", result.getExcepti... | @Override
public UserKey[] getAccountKeys() {
return DataStoreUtils.getActivatedAccountKeys(context);
|
1,083 | 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>
}
| MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId);
if (!Utils.isOfficialCredentials(context, accountId)) continue;
try {
microBlog.setActivitiesAboutMeUnread(cursor);
} catch (MicroBlogException e) {
DebugLog.w(LOGTAG, null, e);
|
1,084 | for (Location location : twitter.getAvailableTrends()) {
map.put(location);
}
return map.pack();
} catch (final MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| for (Location location : twitter.getAvailableTrends()) {
map.put(location);
}
return map.pack();
} catch (final MicroBlogException e) {
DebugLog.w(LOGTAG, null, e);
}
|
1,085 | import org.apache.commons.lang3.math.NumberUtils;
import org.json.JSONException;
import org.mariotaku.microblog.library.MicroBlog;
import org.mariotaku.microblog.library.MicroBlogException;
import org.mariotaku.microblog.library.twitter.model.RateLimitStatus;
<BUG>import org.mariotaku.microblog.library.twitter.model.St... | import org.apache.commons.lang3.math.NumberUtils;
import org.json.JSONException;
import org.mariotaku.microblog.library.MicroBlog;
import org.mariotaku.microblog.library.MicroBlogException;
import org.mariotaku.microblog.library.twitter.model.RateLimitStatus;
import org.mariotaku.microblog.library.twitter.model.Status;... |
1,086 | context.getApplicationContext().sendBroadcast(intent);
}
}
@Nullable
public static Location getCachedLocation(Context context) {
<BUG>if (BuildConfig.DEBUG) {
Log.v(LOGTAG, "Fetching cached location", new Exception());
}</BUG>
Location location = null;
| context.getApplicationContext().sendBroadcast(intent);
}
}
@Nullable
public static Location getCachedLocation(Context context) {
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
Location location = null;
|
1,087 | package de.nedelosk.modularmachines.api.modular.assembler;
<BUG>import de.nedelosk.modularmachines.api.gui.IContainerBase;
import de.nedelosk.modularmachines.api.modular.handlers.IModularHandler;</BUG>
import de.nedelosk.modularmachines.api.modules.IModule;
import de.nedelosk.modularmachines.api.modules.ModuleManager;
... | package de.nedelosk.modularmachines.api.modular.assembler;
import de.nedelosk.modularmachines.api.modules.IModule;
import de.nedelosk.modularmachines.api.modules.ModuleManager;
import de.nedelosk.modularmachines.api.modules.items.IModuleContainer;
|
1,088 | package de.nedelosk.modularmachines.api.modules.models;
<BUG>import java.util.Locale;
import com.google.common.base.Function;
import de.nedelosk.modularmachines.api.modules.EnumModuleSizes;</BUG>
import de.nedelosk.modularmachines.api.modules.IModule;
<BUG>import de.nedelosk.modularmachines.api.modules.items.IModuleCon... | package de.nedelosk.modularmachines.api.modules.models;
import de.nedelosk.modularmachines.api.modules.IModule;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraftforge.fml.relauncher.Side;
|
1,089 | import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public abstract class ModelHandler<M extends IModule> implements IModelHandler<M> {
public IBakedModel bakedModel;
public boolean needReload;
<BUG>public String modelFolder;
public IModuleContainer container;
public ModelHandler(String modelFolde... | import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public abstract class ModelHandler<M extends IModule> implements IModelHandler<M> {
public IBakedModel bakedModel;
public boolean needReload;
@Override
|
1,090 | package de.nedelosk.modularmachines.api.modules;
<BUG>import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
</BUG>
import com.google.common.collect.Lists;
| package de.nedelosk.modularmachines.api.modules;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import com.google.common.collect.Lists;
|
1,091 | package de.nedelosk.modularmachines.api.modules;
<BUG>import java.util.List;
import javax.annotation.Nonnull;</BUG>
import javax.annotation.Nullable;
import de.nedelosk.modularmachines.api.modular.AssemblerException;
import de.nedelosk.modularmachines.api.modular.IModular;
| package de.nedelosk.modularmachines.api.modules;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import de.nedelosk.modularmachines.api.modular.AssemblerException;
import de.nedelosk.modularmachines.api.modular.IModular;
|
1,092 | public void reload(IModuleState state, IStorage storage, IModelState modelState, VertexFormat format, Function bakedTextureGetter) {
List<IBakedModel> models = new ArrayList<>();
if(state.getModular() != null){
Set<IStoragePosition> positions = state.getModular().getStorages().keySet();
if(!positions.contains(EnumStora... | public void reload(IModuleState state, IStorage storage, IModelState modelState, VertexFormat format, Function bakedTextureGetter) {
List<IBakedModel> models = new ArrayList<>();
if(state.getModular() != null){
Set<IStoragePosition> positions = state.getModular().getStorages().keySet();
if(!positions.contains(EnumStora... |
1,093 | if(!positions.contains(EnumStoragePositions.RIGHT)){
<BUG>models.add(getBakedModel(casing_right, modelState, format, bakedTextureGetter));
}</BUG>
}
<BUG>models.add(getBakedModel(casing, modelState, format, bakedTextureGetter));
for(IModuleState moduleState : ((IModuleStorage)storage).getModules()){</BUG>
IModule modul... | if(!positions.contains(EnumStoragePositions.RIGHT)){
models.add(ModuleModelLoader.getModel(casing_right, format));
}
}
models.add(ModuleModelLoader.getModel(casing, format));
for(IModuleState moduleState : ((IModuleStorage)storage).getModules()){
IModule module = moduleState.getModule();
if(((IModuleStateClient)moduleS... |
1,094 | @Option(desc = "Number of transactions to perform for benchmark.")
int txn = 10000000;
@Option(desc = "Number of transactions to perform during warmup.")
int warmup = 100000;
@Option(desc = "Number of groupings for materialized view (0 for 1:1 group to id ratio).")
<BUG>int group = 0;
</BUG>
@Option(desc = "Maximum TPS... | @Option(desc = "Number of transactions to perform for benchmark.")
int txn = 10000000;
@Option(desc = "Number of transactions to perform during warmup.")
int warmup = 100000;
@Option(desc = "Number of groupings for materialized view (0 for 1:1 group to id ratio).")
int group = 5000;
@Option(desc = "Maximum TPS rate for... |
1,095 | newExecute) * 100);
fw.append(String.format("%s,%d,-1,%.2f,0,0,0,%.2f,0,0,0,0,0,0\n",
name,
stats.getStartTimestamp(),
savedThroughput,
<BUG>savedExecute));
} else {</BUG>
savedThroughput = newThroughput;
savedExecute = newExecute;
}
| newExecute) * 100);
fw.append(String.format("%s,%d,-1,%.2f,0,0,0,%.2f,0,0,0,0,0,0\n",
name,
stats.getStartTimestamp(),
savedThroughput,
savedExecute));
savedThroughput = savedExecute = 0;
} else {
savedThroughput = newThroughput;
savedExecute = newExecute;
}
|
1,096 | System.out.println("\nRunning benchmark...\n");
<BUG>runHalf(true, fw);
</BUG>
System.out.print(HORIZONTAL_RULE);
<BUG>runHalf(false, fw);
benchmarkActive = false;</BUG>
if ((config.statsfile != null) && (config.statsfile.length() != 0)) {
fw.close();
}
client.close();
| System.out.println("\nRunning benchmark...\n");
runHalf("matView", fw);
System.out.print(HORIZONTAL_RULE);
runHalf("noMatView", fw);
System.out.print(HORIZONTAL_RULE);
runHalf("minMatView", fw);
benchmarkActive = false;
if ((config.statsfile != null) && (config.statsfile.length() != 0)) {
fw.close();
}
client.close();
|
1,097 | }
public TaskId getTaskId()
{
return taskStateMachine.getTaskId();
}
<BUG>public PipelineContext addPipelineContext(boolean inputPipeline, boolean outputPipeline)
</BUG>
{
<BUG>PipelineContext pipelineContext = new PipelineContext(this, executor, inputPipeline, outputPipeline);
</BUG>
pipelineContexts.add(pipelineConte... | }
}
});
this.verboseStats = verboseStats;
this.cpuTimerEnabled = cpuTimerEnabled;
}
public TaskId getTaskId()
{
return taskStateMachine.getTaskId();
}
public PipelineContext addPipelineContext(int pipelineId, boolean inputPipeline, boolean outputPipeline)
{
PipelineContext pipelineContext = new PipelineContext(pipeline... |
1,098 | protected abstract List<? extends OperatorFactory> createOperatorFactories();
protected DriverFactory createDriverFactory()
{
List<OperatorFactory> operatorFactories = new ArrayList<>(createOperatorFactories());
operatorFactories.add(new NullOutputOperatorFactory(999, new PlanNodeId("test"), Iterables.getLast(operatorF... | protected abstract List<? extends OperatorFactory> createOperatorFactories();
protected DriverFactory createDriverFactory()
{
List<OperatorFactory> operatorFactories = new ArrayList<>(createOperatorFactories());
operatorFactories.add(new NullOutputOperatorFactory(999, new PlanNodeId("test"), Iterables.getLast(operatorF... |
1,099 | import static io.airlift.units.DataSize.succinctBytes;
import static java.util.Objects.requireNonNull;
import static java.util.concurrent.TimeUnit.NANOSECONDS;
@Immutable
public class OperatorStats
<BUG>{
private final int operatorId;</BUG>
private final PlanNodeId planNodeId;
private final String operatorType;
private... | import static io.airlift.units.DataSize.succinctBytes;
import static java.util.Objects.requireNonNull;
import static java.util.concurrent.TimeUnit.NANOSECONDS;
@Immutable
public class OperatorStats
{
private final int pipelineId;
private final int operatorId;
private final PlanNodeId planNodeId;
private final String op... |
1,100 | private final DataSize memoryReservation;
private final DataSize systemMemoryReservation;
private final Optional<BlockedReason> blockedReason;
private final OperatorInfo info;
@JsonCreator
<BUG>public OperatorStats(
@JsonProperty("operatorId") int operatorId,</BUG>
@JsonProperty("planNodeId") PlanNodeId planNodeId,
@Js... | private final DataSize memoryReservation;
private final DataSize systemMemoryReservation;
private final Optional<BlockedReason> blockedReason;
private final OperatorInfo info;
@JsonCreator
public OperatorStats(
@JsonProperty("pipelineId") int pipelineId,
@JsonProperty("operatorId") int operatorId,
@JsonProperty("planNo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.