id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
46,801 | protected void execute(final @NotNull SingleItemActionContext actionContext) {
try {
final ServerContext serverContext = actionContext.getServerContext();
final Project project = actionContext.getProject();
final String sourceServerPath = actionContext.getItem().getServerItem();
<BUG>final boolean isFolder = actionContext.getItem().isFolder();
CreateBranchDialog d = new CreateBranchDialog(</BUG>
project,
serverContext,
sourceServerPath,
| final String workingFolder = isFolder ?
actionContext.getItem().getLocalItem() :
Path.getDirectoryName(actionContext.getItem().getLocalItem());
CreateBranchDialog d = new CreateBranchDialog(
|
46,802 | isFolder);
if (!d.showAndGet()) {
return;
}
final Workspace workspace = CommandUtils.getWorkspace(serverContext, actionContext.getProject());
<BUG>final String targetServerPath = d.getTargetPath();
if (d.isCreateWorkingCopies()) {
String targetLocalPath = CommandUtils.tryGetLocalPath(serverContext, targetServerPath, workspace.getName());
if (targetLocalPath == null) {</BUG>
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
| String targetLocalPath = null;
if (targetLocalPath == null) {
|
46,803 | CommandUtils.addWorkspaceMapping(serverContext, workspace.getName(),
targetServerPath, targetLocalPath);
}
}
final String comment = MessageFormat.format("Branched from {0}", sourceServerPath);
<BUG>CommandUtils.createBranch(serverContext, true, comment, null, sourceServerPath, targetServerPath);
if (d.isCreateWorkingCopies()) {
final List<VcsException> errors = new ArrayList<VcsException>();</BUG>
ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
| CommandUtils.createBranch(serverContext, workingFolder, true, comment, null, sourceServerPath, targetServerPath);
final String localPath = targetLocalPath;
final List<VcsException> errors = new ArrayList<VcsException>();
|
46,804 | }, "Syncing target branch location", false, project);
if (!errors.isEmpty()) {
AbstractVcsHelper.getInstance(project).showErrors(errors, "Create Branch");
}
}
<BUG>final String targetLocalPath = CommandUtils.tryGetLocalPath(serverContext, targetServerPath, workspace.getName());
if (targetLocalPath != null) {</BUG>
TfsFileUtil.markDirtyRecursively(project, new LocalFilePath(targetLocalPath, isFolder));
}
final String message = MessageFormat.format("''{0}'' branched successfully to ''{1}''.", sourceServerPath, targetServerPath);
| if (targetLocalPath != null) {
|
46,805 | return getLocalPathCommand.runSynchronously();
}
public static String tryGetLocalPath(final ServerContext context, final String serverPath, final String workspace) {
final Command<String> getLocalPathCommand = new GetLocalPathCommand(context, serverPath, workspace);
try {
<BUG>return getLocalPathCommand.runSynchronously();
} catch (Throwable t) {</BUG>
logger.warn("Failed to find local path for server path " + serverPath, t);
return null;
| final String result = getLocalPathCommand.runSynchronously();
if (StringUtils.startsWithIgnoreCase(result, "ERROR [main] Application - Unexpected exception:")) {
|
46,806 | protected static final String FIELD_STRATEGY = "strategy";
protected static final String FIELD_PARAMS = "params";
protected final MongoClient mongoClient;
protected final String dbname;
protected final String collection;
<BUG>protected final String username;
protected final char[] password;
protected final WriteConcern writeConcert;
</BUG>
private MongoStateRepository(Builder builder) {
| protected final WriteConcern writeConcern;
|
46,807 | </BUG>
private MongoStateRepository(Builder builder) {
this.mongoClient = builder.client;
this.dbname = builder.dbname;
this.collection = builder.collection;
<BUG>this.username = builder.username;
this.password = builder.password;
this.writeConcert = builder.writeConcern;
</BUG>
}
| protected static final String FIELD_STRATEGY = "strategy";
protected static final String FIELD_PARAMS = "params";
protected final MongoClient mongoClient;
protected final String dbname;
protected final String collection;
protected final WriteConcern writeConcern;
this.writeConcern = builder.writeConcern;
|
46,808 | package com.redhat.ceylon.compiler.codegen;
import static com.sun.tools.javac.code.Flags.FINAL;
<BUG>import com.redhat.ceylon.compiler.typechecker.model.ProducedType;
import com.redhat.ceylon.compiler.typechecker.tree.Tree;</BUG>
import com.redhat.ceylon.compiler.typechecker.tree.Tree.AttributeDeclaration;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.CatchClause;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.Expression;
| import com.redhat.ceylon.compiler.typechecker.model.TypedDeclaration;
import com.redhat.ceylon.compiler.typechecker.tree.Tree;
|
46,809 | package com.redhat.ceylon.compiler.codegen;
<BUG>import com.redhat.ceylon.compiler.typechecker.model.Declaration;
import com.redhat.ceylon.compiler.typechecker.tree.Node;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.AnyAttribute;</BUG>
import com.redhat.ceylon.compiler.typechecker.tree.Tree.CharLiteral;
| import com.redhat.ceylon.compiler.typechecker.model.TypedDeclaration;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.BaseMemberExpression;
|
46,810 | import com.redhat.ceylon.compiler.typechecker.tree.Tree.QualifiedMemberExpression;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.StringLiteral;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.StringTemplate;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.Term;
import com.redhat.ceylon.compiler.typechecker.tree.Visitor;
<BUG>import com.redhat.ceylon.compiler.typechecker.tree.Tree.BaseMemberExpression;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.NaturalLiteral;</BUG>
import com.redhat.ceylon.compiler.util.Util;
public class BoxingVisitor extends Visitor {
private AbstractTransformer transformer;
| [DELETED] |
46,811 | this.transformer = transformer;
}
@Override
public void visit(BaseMemberExpression that) {
super.visit(that);
<BUG>if(Util.isUnBoxed(that.getDeclaration()) || transformer.isCeylonBoolean(that.getTypeModel()))
</BUG>
Util.markUnBoxed(that);
}
@Override
| if(Util.isUnBoxed((TypedDeclaration)that.getDeclaration()) || transformer.isCeylonBoolean(that.getTypeModel()))
|
46,812 | Util.markUnBoxed(that);
}
@Override
public void visit(QualifiedMemberExpression that) {
super.visit(that);
<BUG>propagateFromDeclaration(that, that.getDeclaration());
</BUG>
}
@Override
public void visit(Expression that) {
| propagateFromDeclaration(that, (TypedDeclaration)that.getDeclaration());
|
46,813 | import com.redhat.ceylon.compiler.typechecker.model.Method;
import com.redhat.ceylon.compiler.typechecker.model.Parameter;
import com.redhat.ceylon.compiler.typechecker.model.Setter;
import com.redhat.ceylon.compiler.typechecker.model.TypedDeclaration;
import com.redhat.ceylon.compiler.typechecker.model.Value;
<BUG>import com.redhat.ceylon.compiler.typechecker.tree.Node;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.NotOp;</BUG>
import com.redhat.ceylon.compiler.typechecker.tree.Tree.Term;
import com.sun.tools.javac.parser.Token;
public class Util {
| [DELETED] |
46,814 | public JCExpression transform(Tree.AssignOp op) {
return transformAssignment(op, op.getLeftTerm(), op.getRightTerm());
}
JCExpression transformAssignment(Node op, Term leftTerm, Term rightTerm) {
JCExpression result = null;
<BUG>Declaration decl = ((Tree.Primary)leftTerm).getDeclaration();
</BUG>
JCExpression rhs = transformExpression(rightTerm, Util.getBoxingStrategy(decl));
JCExpression expr = null;
CeylonVisitor v = new CeylonVisitor(gen());
| TypedDeclaration decl = (TypedDeclaration) ((Tree.Primary)leftTerm).getDeclaration();
|
46,815 | expr = v.getSingleResult();
}
boolean variable = false;
if (decl instanceof Value) {
variable = ((Value)decl).isVariable();
<BUG>} else if (decl instanceof TypedDeclaration) {
variable = ((TypedDeclaration)decl).isVariable();
}</BUG>
if(decl.isToplevel()){
result = globalGen().setGlobalValue(
| } else {
variable = decl.isVariable();
|
46,816 | if (!renamed) {
return false;
}
return mMetaManager.commitTempBlockMeta(tempBlock);
}
<BUG>@Override
public boolean abortBlock(long userId, long blockId) throws IOException {
mEvictionLock.writeLock().lock();
boolean result = abortBlockNoLock(userId, blockId);
mEvictionLock.writeLock().unlock();
return result;
}</BUG>
private boolean abortBlockNoLock(long userId, long blockId) throws IOException {
| [DELETED] |
46,817 | if (!deleted) {
return false;
}
return mMetaManager.abortTempBlockMeta(tempBlock);
}
<BUG>@Override
public boolean requestSpace(long userId, long blockId, long size) throws IOException {
mEvictionLock.writeLock().lock();
boolean result = requestSpaceNoLock(userId, blockId, size);
mEvictionLock.writeLock().unlock();
return result;
}</BUG>
private boolean requestSpaceNoLock(long userId, long blockId, long size) throws IOException {
| [DELETED] |
46,818 | return result;
}</BUG>
private boolean freeSpaceNoLock(long userId, long size, BlockStoreLocation location)
throws IOException {
EvictionPlan plan = mEvictor.freeSpace(size, location);
<BUG>for (long blockId : plan.toEvict()) {
if (!removeBlockNoLock(userId, blockId)) {
return false;</BUG>
}
| if (!mMetaManager.removeBlockMeta(blockId)) {
return false;
return new File(optBlock.get().getPath()).delete();
long lockId = mLockManager.lockBlock(userId, blockId, BlockLock.BlockLockType.WRITE).get();
boolean result = removeBlockNoLock(userId, blockId);
mLockManager.unlockBlock(lockId);
if (!result) {
return false;
|
46,819 | public class AboutActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
<BUG>getFragmentManager().beginTransaction().replace(R.id.ll_fragment_container, new AboutFragment()).commit();
}</BUG>
public static class AboutFragment extends PreferenceFragment implements Preference.OnPreferenceClickListener {
private Preference mVersion;
private Preference mUpdate;
| }
protected void setListener() {
}
|
46,820 | LASER_PADDING = dp2px(16);
LASER_OFFSET_INCREASE = dp2px(1);
mFinderMaskPaint = new Paint();
mBorderPaint = new Paint();
mLaserPaint = new Paint();
<BUG>mLaserDrawable = getResources().getDrawable(R.drawable.ic_scan_line);
mMaskColor = getResources().getColor(R.color.viewfinder_mask);</BUG>
mFrameColor = getResources().getColor(R.color.viewfinder_frame);
mLaserColor = getResources().getColor(R.color.viewfinder_laser);
mFinderMaskPaint.setColor(mMaskColor);
| mLaserDrawable = getResources().getDrawable(R.drawable.scan_line);
mMaskColor = getResources().getColor(R.color.viewfinder_mask);
|
46,821 | package me.wcy.express.activity;
import android.os.Build;
<BUG>import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;</BUG>
import android.util.TypedValue;
import android.view.MenuItem;
import android.view.View;
| import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
|
46,822 | e.printStackTrace();
}
filePlayback=null;
}
@Override
<BUG>public void stop() { if ( filePlayback!=null ) filePlayback.stop(); }
void initFiles() throws FileNotFoundException {</BUG>
if ((dataDir.length() != 0) && !dataDir.endsWith("/")) { dataDir = dataDir + "/"; } // guard path if needed
String samples_str = dataDir + "samples";
String events_str = dataDir + "events";
| @Override public boolean isrunning(){ if ( filePlayback!=null ) return filePlayback.isrunning(); return false; }
void initFiles() throws FileNotFoundException {
|
46,823 | public class BufferMonitor extends Thread implements FieldtripBufferMonitor {
public static final String TAG = BufferMonitor.class.toString();
private final Context context;
private final SparseArray<BufferConnectionInfo> clients = new SparseArray<BufferConnectionInfo>();
private final BufferInfo info;
<BUG>private final BroadcastReceiver mMessageReceiver = new BroadcastReceiver() {
@Override
public void onReceive(final Context context, final Intent intent) {
if (intent.getIntExtra(C.MESSAGE_TYPE, -1) == C.UPDATE_REQUEST) {
Log.i(TAG, "Received update request.");
sendAllInfo();
}
}
};</BUG>
private boolean run = true;
| [DELETED] |
46,824 | public static final String CLIENT_INFO_TIME = "c_time";
public static final String CLIENT_INFO_WAITTIMEOUT = "c_waitTimeout";
public static final String CLIENT_INFO_CONNECTED = "c_connected";
public static final String CLIENT_INFO_CHANGED = "c_changed";
public static final String CLIENT_INFO_DIFF = "c_diff";
<BUG>public static final int UPDATE_REQUEST = 0;
</BUG>
public static final int UPDATE = 1;
public static final int REQUEST_PUT_HEADER = 2;
public static final int REQUEST_FLUSH_HEADER = 3;
| public static final int THREAD_INFO_TYPE = 0;
|
46,825 | package nl.dcc.buffer_bci.bufferclientsservice;
import android.os.Parcel;
import android.os.Parcelable;
<BUG>import nl.dcc.buffer_bci.bufferservicecontroller.C;
public class ThreadInfo implements Parcelable {</BUG>
public static final Creator<ThreadInfo> CREATOR = new Creator<ThreadInfo>() {
@Override
public ThreadInfo createFromParcel(final Parcel in) {
| import nl.dcc.buffer_bci.C;
public class ThreadInfo implements Parcelable {
|
46,826 | Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.tab_qibla, container, false);
final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass);
qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north),
((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla));
<BUG>sOrientationListener = new SensorListener() {
</BUG>
public void onSensorChanged(int s, float v[]) {
float northDirection = v[SensorManager.DATA_X];
qiblaCompassView.setDirections(northDirection, sQiblaDirection);
| sOrientationListener = new android.hardware.SensorListener() {
|
46,827 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\"")));
}
| return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
46,828 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, sum, fib));
}
| return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
46,829 | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
<BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39)
.process(() -> 9999L);
Task<String> task2 = Task.ofType(String.class).named("Baz", 40)
.in(() -> task1)</BUG>
.ins(() -> singletonList(task1))
| Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
|
46,830 | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef")
.process(() -> instanceField + " causes an outer reference");</BUG>
serialize(task);
}
@Test
| Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
|
46,831 | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef")
.process(() -> local + " won't cause an outer reference");</BUG>
serialize(task);
Task<String> des = deserialize();
context.evaluate(des).consume(val);
| Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
|
46,832 | }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
<BUG>return Task.ofType(String.class).named("StandardArgs", first, second)
.process(() -> second + " " + first * 100);</BUG>
}
@Test
public void shouldParseFlags() throws Exception {
| return Task.named("StandardArgs", first, second).ofType(String.class)
.process(() -> second + " " + first * 100);
|
46,833 | assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
<BUG>return Task.ofType(String.class).named("Enums", enm)
.process(enm::toString);</BUG>
}
@Test
public void shouldParseCustomTypes() throws Exception {
| return Task.named("Enums", enm).ofType(String.class)
.process(enm::toString);
|
46,834 | assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
<BUG>return Task.ofType(String.class).named("Types", myType.content)
.process(() -> myType.content);</BUG>
}
public enum CustomEnum {
BAR
| return Task.named("Types", myType.content).ofType(String.class)
.process(() -> myType.content);
|
46,835 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() -> n);
| TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
46,836 | @Override
public String toString() {
return "desc";
}
};
<BUG>public static final SortOrder DEFAULT = DESC;
private static final SortOrder PROTOTYPE = DEFAULT;
</BUG>
@Override
public SortOrder readFrom(StreamInput in) throws IOException {
| return "asc";
},
DESC {
private static final SortOrder PROTOTYPE = ASC;
|
46,837 | GeoDistance geoDistance = GeoDistance.DEFAULT;
boolean reverse = false;
MultiValueMode sortMode = null;
NestedInnerQueryParseSupport nestedHelper = null;
final boolean indexCreatedBeforeV2_0 = context.indexShard().getIndexSettings().getIndexVersionCreated().before(Version.V_2_0_0);
<BUG>boolean coerce = false;
boolean ignoreMalformed = false;
XContentParser.Token token;</BUG>
String currentName = parser.currentName();
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
| boolean coerce = GeoDistanceSortBuilder.DEFAULT_COERCE;
boolean ignoreMalformed = GeoDistanceSortBuilder.DEFAULT_IGNORE_MALFORMED;
XContentParser.Token token;
|
46,838 | String currentName = parser.currentName();
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
if (token == XContentParser.Token.FIELD_NAME) {
currentName = parser.currentName();
} else if (token == XContentParser.Token.START_ARRAY) {
<BUG>parseGeoPoints(parser, geoPoints);
</BUG>
fieldName = currentName;
} else if (token == XContentParser.Token.START_OBJECT) {
if ("nested_filter".equals(currentName) || "nestedFilter".equals(currentName)) {
| GeoDistanceSortBuilder.parseGeoPoints(parser, geoPoints);
|
46,839 | package org.elasticsearch.search.sort;
<BUG>import org.elasticsearch.script.Script;
public class SortBuilders {</BUG>
public static ScoreSortBuilder scoreSort() {
return new ScoreSortBuilder();
}
| import org.elasticsearch.common.geo.GeoPoint;
import java.util.Arrays;
public class SortBuilders {
|
46,840 | public GeoDistanceSortBuilder ignoreMalformed(boolean ignoreMalformed) {
this.ignoreMalformed = ignoreMalformed;
return this;
}</BUG>
@Override
<BUG>public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject("_geo_distance");
if (geohashes.size() == 0 && points.size() == 0) {
throw new ElasticsearchParseException("No points provided for _geo_distance sort.");
}</BUG>
builder.startArray(fieldName);
| if (coerce == false) {
}
}
public boolean ignoreMalformed() {
return this.ignoreMalformed;
}
builder.startObject(NAME);
|
46,841 | import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
<BUG>import org.jboss.dmr.ModelNode;
import org.jboss.tools.project.examples.model.ProjectExample;</BUG>
import org.jboss.tools.project.examples.model.ProjectExampleWorkingCopy;
@SuppressWarnings("nls")
public class ProjectExampleJsonParser implements IProjectExampleParser {
| import org.jboss.dmr.ModelType;
import org.jboss.tools.project.examples.model.ProjectExample;
|
46,842 | String id = hit.get("_id").asString();
ModelNode fields = hit.get("fields");
if (!fields.isDefined() || !fields.get("quickstart_id").isDefined() || !fields.get("git_download").isDefined()) {
return null;
}
<BUG>String name = fields.get("quickstart_id").asString();
try {
String downloadUrl = fields.get("git_download").asString();
String title = fields.get("sys_title").asString();
String description = fields.get("sys_description").asString();
</BUG>
ProjectExampleWorkingCopy example = new ProjectExampleWorkingCopy();
| String name = getAsString(fields, "quickstart_id");
String downloadUrl = getAsString(fields, "git_download");
String title = getAsString(fields, "sys_title");
String description = getAsString(fields, "sys_description");
|
46,843 | String skinName = null;
String skinRepo = null;
String iconBase = null;
Placement placement = ToolManager.getCurrentPlacement();
String toolId = placement.getToolId();
<BUG>boolean inline = false;
if (httpServletRequest.getRequestURI().startsWith("/portal/site/")) {
inline = true;</BUG>
if (reseturl == null)
reseturl = "/portal/site/" + simplePageBean.getCurrentSiteId() + "/tool-reset/" + ((ToolConfiguration)placement).getPageId() + "?panel=Main";
| String portalTemplates = ServerConfigurationService.getString("portal.templates", "");
if ("morpheus".equals(portalTemplates))
inline = true;
|
46,844 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
46,845 | }
@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);
|
46,846 | 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);
|
46,847 | 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(
|
46,848 | 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 {
|
46,849 | 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;
|
46,850 | 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) {
|
46,851 | 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;
|
46,852 | import java.util.List;
import jetbrains.mps.smodel.action.INodeSubstituteAction;
import jetbrains.mps.smodel.IOperationContext;
import jetbrains.mps.smodel.action.RTActionsBuilderContext;
import java.util.ArrayList;
<BUG>import jetbrains.mps.bootstrap.structureLanguage.structure.ConceptDeclaration;
</BUG>
import jetbrains.mps.smodel.SModelUtil_new;
import jetbrains.mps.smodel.action.AbstractRTransformHintSubstituteAction;
import jetbrains.mps.smodel.BaseAdapter;
| import jetbrains.mps.bootstrap.structureLanguage.structure.AbstractConceptDeclaration;
|
46,853 | import jetbrains.mps.helgins.inference.TypeChecker;
import java.util.List;
import jetbrains.mps.smodel.action.INodeSubstituteAction;
import jetbrains.mps.smodel.action.NodeSubstituteActionsFactoryContext;
import java.util.ArrayList;
<BUG>import jetbrains.mps.bootstrap.structureLanguage.structure.ConceptDeclaration;
</BUG>
import jetbrains.mps.smodel.SModelUtil_new;
import jetbrains.mps.bootstrap.smodelLanguage.generator.smodelAdapter.SConceptOperations;
import jetbrains.mps.util.NameUtil;
| import jetbrains.mps.bootstrap.structureLanguage.structure.AbstractConceptDeclaration;
|
46,854 | import jetbrains.mps.smodel.BaseAdapter;
import jetbrains.mps.util.Calculable;
import jetbrains.mps.bootstrap.smodelLanguage.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.smodel.action.DefaultChildNodeSubstituteAction;
import jetbrains.mps.smodel.SModel;
<BUG>import jetbrains.mps.bootstrap.smodelLanguage.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.smodel.action.ChildSubstituteActionsHelper;</BUG>
import jetbrains.mps.smodel.action.RTActionsBuilderContext;
import jetbrains.mps.smodel.action.AbstractRTransformHintSubstituteAction;
public class QueriesGenerated {
| import jetbrains.mps.bootstrap.structureLanguage.structure.ConceptDeclaration;
import jetbrains.mps.smodel.action.ChildSubstituteActionsHelper;
|
46,855 | return result;
}
public static List<INodeSubstituteAction> nodeSubstituteActionsBuilder_ActionsFactory_ThisExpression_1199651306154(final IOperationContext operationContext, final NodeSubstituteActionsFactoryContext _context) {
List<INodeSubstituteAction> result = new ArrayList<INodeSubstituteAction>();
{
<BUG>ConceptDeclaration conceptToAdd = SModelUtil_new.findConceptDeclaration("jetbrains.mps.baseLanguage.structure.ThisExpression", operationContext.getScope());
</BUG>
List<INodeSubstituteAction> defaultActions = ChildSubstituteActionsHelper.createDefaultActions(conceptToAdd, _context.getParentNode(), _context.getCurrentTargetNode(), _context.getChildSetter(), operationContext);
result.addAll(defaultActions);
}
| ConceptDeclaration conceptToAdd = ((ConceptDeclaration)SModelUtil_new.findAbstractConceptDeclaration("jetbrains.mps.baseLanguage.structure.ThisExpression", operationContext.getScope()));
|
46,856 | return result;
}
public static List<INodeSubstituteAction> nodeSubstituteActionsBuilder_ActionsFactory_Expression_1199711415359(final IOperationContext operationContext, final NodeSubstituteActionsFactoryContext _context) {
List<INodeSubstituteAction> result = new ArrayList<INodeSubstituteAction>();
{
<BUG>ConceptDeclaration conceptToAdd = SModelUtil_new.findConceptDeclaration("jetbrains.mps.closures.structure.InvokeExpression", operationContext.getScope());
</BUG>
List<INodeSubstituteAction> defaultActions = ChildSubstituteActionsHelper.createDefaultActions(conceptToAdd, _context.getParentNode(), _context.getCurrentTargetNode(), _context.getChildSetter(), operationContext);
result.addAll(defaultActions);
}
| public static List<INodeSubstituteAction> nodeSubstituteActionsBuilder_ActionsFactory_ThisExpression_1199651306154(final IOperationContext operationContext, final NodeSubstituteActionsFactoryContext _context) {
ConceptDeclaration conceptToAdd = ((ConceptDeclaration)SModelUtil_new.findAbstractConceptDeclaration("jetbrains.mps.baseLanguage.structure.ThisExpression", operationContext.getScope()));
|
46,857 | dequeueStrategy = new FifoDequeueStrategy();
} else {
throw new IllegalStateException(
String.format("Cannot figure out the dequeue strategy to use for partitioner %s", queuePartitioner.getClass()));
}
<BUG>QueueState queueState = consumer.getQueueState();
</BUG>
if(queueState == null) {
queueState = dequeueStrategy.constructQueueState(consumer, config, readPointer);
consumer.setQueueState(queueState);
| QueueStateImpl queueState = getQueueStateImpl(consumer.getQueueState());
|
46,858 | @Override
public void ack(QueueEntryPointer entryPointer, QueueConsumer consumer, ReadPointer readPointer)
throws OperationException {
ackInternal(entryPointer, consumer, readPointer);
if(consumer.isStateful()) {
<BUG>consumer.getQueueState().setActiveEntryId(INVALID_ENTRY_ID);
</BUG>
}
}
public void ackInternal(QueueEntryPointer entryPointer, QueueConsumer consumer, ReadPointer readPointer)
| getQueueStateImpl(consumer.getQueueState()).setActiveEntryId(INVALID_ENTRY_ID);
|
46,859 | this.cachedEntries = cachedEntries;
}
@Override
public String toString() {
return Objects.toStringHelper(this)
<BUG>.add("activeEntryId", activeEntryId)
.add("consumerReadPointer", consumerReadPointer)</BUG>
.add("queueWritePointer", queueWrtiePointer)
.add("cachedEntries", cachedEntries.toString())
.toString();
| .add("activeEntryTries", activeEntryTries)
.add("consumerReadPointer", consumerReadPointer)
|
46,860 | LOG.debug(String.format("Constructed new QueueState - %s", queueState));
}
return queueState;
}
@Override
<BUG>public void saveDequeueState(QueueConsumer consumer, QueueConfig config, QueueState queueState, ReadPointer readPointer) throws OperationException {
</BUG>
long entryId = queueState.getActiveEntryId();
table.put(makeRowKey(CONSUMER_META_PREFIX, consumer.getGroupId(), consumer.getInstanceId()),
new byte[][]{
| public void saveDequeueState(QueueConsumer consumer, QueueConfig config, QueueStateImpl queueState, ReadPointer readPointer) throws OperationException {
|
46,861 | return newEntryIds;
}
}
class RoundRobinDequeueStrategy extends AbstractDisjointDequeueStrategy implements DequeueStrategy {
@Override
<BUG>public List<Long> fetchNextEntries(QueueConsumer consumer, QueueConfig config, QueueState queueState, ReadPointer readPointer) throws OperationException {
</BUG>
long entryId = queueState.getConsumerReadPointer();
QueuePartitioner partitioner=config.getPartitionerType().getPartitioner();
List<Long> newEntryIds = new ArrayList<Long>();
| public List<Long> fetchNextEntries(QueueConsumer consumer, QueueConfig config, QueueStateImpl queueState, ReadPointer readPointer) throws OperationException {
|
46,862 | return newEntryIds;
}
}
class FifoDequeueStrategy extends AbstractDisjointDequeueStrategy implements DequeueStrategy {
@Override
<BUG>public List<Long> fetchNextEntries(QueueConsumer consumer, QueueConfig config, QueueState queueState, ReadPointer readPointer) throws OperationException {
</BUG>
long entryId = queueState.getConsumerReadPointer();
QueuePartitioner partitioner=config.getPartitionerType().getPartitioner();
List<Long> newEntryIds = new ArrayList<Long>();
| class RoundRobinDequeueStrategy extends AbstractDisjointDequeueStrategy implements DequeueStrategy {
public List<Long> fetchNextEntries(QueueConsumer consumer, QueueConfig config, QueueStateImpl queueState, ReadPointer readPointer) throws OperationException {
|
46,863 | import ml.puredark.hviewer.ui.activities.BaseActivity;
import ml.puredark.hviewer.ui.dataproviders.ListDataProvider;
import ml.puredark.hviewer.ui.fragments.SettingFragment;
import ml.puredark.hviewer.ui.listeners.OnItemLongClickListener;
import ml.puredark.hviewer.utils.SharedPreferencesUtil;
<BUG>import static android.webkit.WebSettings.LOAD_CACHE_ELSE_NETWORK;
public class PictureViewerAdapter extends RecyclerView.Adapter<PictureViewerAdapter.PictureViewerViewHolder> {</BUG>
private BaseActivity activity;
private Site site;
private ListDataProvider mProvider;
| import static ml.puredark.hviewer.R.id.container;
public class PictureViewerAdapter extends RecyclerView.Adapter<PictureViewerAdapter.PictureViewerViewHolder> {
|
46,864 | final PictureViewHolder viewHolder = new PictureViewHolder(view);
if (pictures != null && position < pictures.size()) {
final Picture picture = pictures.get(getPicturePostion(position));
if (picture.pic != null) {
loadImage(container.getContext(), picture, viewHolder);
<BUG>} else if (site.hasFlag(Site.FLAG_SINGLE_PAGE_BIG_PICTURE) && site.extraRule != null && site.extraRule.pictureUrl != null) {
getPictureUrl(container.getContext(), viewHolder, picture, site, site.extraRule.pictureUrl, site.extraRule.pictureHighRes);</BUG>
} else if (site.picUrlSelector != null) {
getPictureUrl(container.getContext(), viewHolder, picture, site, site.picUrlSelector, null);
} else {
| } else if (site.hasFlag(Site.FLAG_SINGLE_PAGE_BIG_PICTURE) && site.extraRule != null) {
if(site.extraRule.pictureRule != null && site.extraRule.pictureRule.url != null)
getPictureUrl(container.getContext(), viewHolder, picture, site, site.extraRule.pictureRule.url, site.extraRule.pictureRule.highRes);
else if(site.extraRule.pictureUrl != null)
getPictureUrl(container.getContext(), viewHolder, picture, site, site.extraRule.pictureUrl, site.extraRule.pictureHighRes);
|
46,865 | import java.util.regex.Pattern;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.puredark.hviewer.R;
import ml.puredark.hviewer.beans.Category;
<BUG>import ml.puredark.hviewer.beans.CommentRule;
import ml.puredark.hviewer.beans.Rule;</BUG>
import ml.puredark.hviewer.beans.Selector;
import ml.puredark.hviewer.beans.Site;
import ml.puredark.hviewer.ui.adapters.CategoryInputAdapter;
| import ml.puredark.hviewer.beans.PictureRule;
import ml.puredark.hviewer.beans.Rule;
|
46,866 | inputGalleryRulePictureUrlReplacement.setText(site.galleryRule.pictureUrl.replacement);
}
if (site.galleryRule.pictureHighRes != null) {
inputGalleryRulePictureHighResSelector.setText(joinSelector(site.galleryRule.pictureHighRes));
inputGalleryRulePictureHighResRegex.setText(site.galleryRule.pictureHighRes.regex);
<BUG>inputGalleryRulePictureHighResReplacement.setText(site.galleryRule.pictureHighRes.replacement);
}</BUG>
if (site.galleryRule.commentRule != null) {
if (site.galleryRule.commentRule.item != null) {
inputGalleryRuleCommentItemSelector.setText(joinSelector(site.galleryRule.commentRule.item));
| [DELETED] |
46,867 | inputExtraRuleCommentDatetimeReplacement.setText(site.extraRule.commentDatetime.replacement);
}
if (site.extraRule.commentContent != null) {
inputExtraRuleCommentContentSelector.setText(joinSelector(site.extraRule.commentContent));
inputExtraRuleCommentContentRegex.setText(site.extraRule.commentContent.regex);
<BUG>inputExtraRuleCommentContentReplacement.setText(site.extraRule.commentContent.replacement);
}</BUG>
}
}
}
| [DELETED] |
46,868 | lastSite.galleryRule.cover = loadSelector(inputGalleryRuleCoverSelector, inputGalleryRuleCoverRegex, inputGalleryRuleCoverReplacement);
lastSite.galleryRule.category = loadSelector(inputGalleryRuleCategorySelector, inputGalleryRuleCategoryRegex, inputGalleryRuleCategoryReplacement);
lastSite.galleryRule.datetime = loadSelector(inputGalleryRuleDatetimeSelector, inputGalleryRuleDatetimeRegex, inputGalleryRuleDatetimeReplacement);
lastSite.galleryRule.rating = loadSelector(inputGalleryRuleRatingSelector, inputGalleryRuleRatingRegex, inputGalleryRuleRatingReplacement);
lastSite.galleryRule.description = loadSelector(inputGalleryRuleDescriptionSelector, inputGalleryRuleDescriptionRegex, inputGalleryRuleDescriptionReplacement);
<BUG>lastSite.galleryRule.tags = loadSelector(inputGalleryRuleTagsSelector, inputGalleryRuleTagsRegex, inputGalleryRuleTagsReplacement);
lastSite.galleryRule.pictureThumbnail = loadSelector(inputGalleryRulePictureThumbnailSelector, inputGalleryRulePictureThumbnailRegex, inputGalleryRulePictureThumbnailReplacement);
lastSite.galleryRule.pictureUrl = loadSelector(inputGalleryRulePictureUrlSelector, inputGalleryRulePictureUrlRegex, inputGalleryRulePictureUrlReplacement);
lastSite.galleryRule.pictureHighRes = loadSelector(inputGalleryRulePictureHighResSelector, inputGalleryRulePictureHighResRegex, inputGalleryRulePictureHighResReplacement);
lastSite.galleryRule.commentRule = new CommentRule();
lastSite.galleryRule.commentRule.item = loadSelector(inputGalleryRuleCommentItemSelector, inputGalleryRuleCommentItemRegex, inputGalleryRuleCommentItemReplacement);</BUG>
lastSite.galleryRule.commentRule.avatar = loadSelector(inputGalleryRuleCommentAvatarSelector, inputGalleryRuleCommentAvatarRegex, inputGalleryRuleCommentAvatarReplacement);
| lastSite.galleryRule.pictureRule = (lastSite.galleryRule.pictureRule == null) ? new PictureRule() : lastSite.galleryRule.pictureRule;
lastSite.galleryRule.pictureRule.thumbnail = loadSelector(inputGalleryRulePictureThumbnailSelector, inputGalleryRulePictureThumbnailRegex, inputGalleryRulePictureThumbnailReplacement);
lastSite.galleryRule.pictureRule.url = loadSelector(inputGalleryRulePictureUrlSelector, inputGalleryRulePictureUrlRegex, inputGalleryRulePictureUrlReplacement);
lastSite.galleryRule.pictureRule.highRes = loadSelector(inputGalleryRulePictureHighResSelector, inputGalleryRulePictureHighResRegex, inputGalleryRulePictureHighResReplacement);
lastSite.galleryRule.commentRule = (lastSite.galleryRule.commentRule == null) ? new CommentRule() : lastSite.galleryRule.commentRule;
lastSite.galleryRule.commentRule.item = loadSelector(inputGalleryRuleCommentItemSelector, inputGalleryRuleCommentItemRegex, inputGalleryRuleCommentItemReplacement);
|
46,869 | lastSite.extraRule.cover = loadSelector(inputExtraRuleCoverSelector, inputExtraRuleCoverRegex, inputExtraRuleCoverReplacement);
lastSite.extraRule.category = loadSelector(inputExtraRuleCategorySelector, inputExtraRuleCategoryRegex, inputExtraRuleCategoryReplacement);
lastSite.extraRule.datetime = loadSelector(inputExtraRuleDatetimeSelector, inputExtraRuleDatetimeRegex, inputExtraRuleDatetimeReplacement);
lastSite.extraRule.rating = loadSelector(inputExtraRuleRatingSelector, inputExtraRuleRatingRegex, inputExtraRuleRatingReplacement);
lastSite.extraRule.description = loadSelector(inputExtraRuleDescriptionSelector, inputExtraRuleDescriptionRegex, inputExtraRuleDescriptionReplacement);
<BUG>lastSite.extraRule.tags = loadSelector(inputExtraRuleTagsSelector, inputExtraRuleTagsRegex, inputExtraRuleTagsReplacement);
lastSite.extraRule.pictureThumbnail = loadSelector(inputExtraRulePictureThumbnailSelector, inputExtraRulePictureThumbnailRegex, inputExtraRulePictureThumbnailReplacement);
lastSite.extraRule.pictureUrl = loadSelector(inputExtraRulePictureUrlSelector, inputExtraRulePictureUrlRegex, inputExtraRulePictureUrlReplacement);
lastSite.extraRule.pictureHighRes = loadSelector(inputExtraRulePictureHighResSelector, inputExtraRulePictureHighResRegex, inputExtraRulePictureHighResReplacement);
lastSite.extraRule.commentRule = new CommentRule();
lastSite.extraRule.commentRule.item = loadSelector(inputExtraRuleCommentItemSelector, inputExtraRuleCommentItemRegex, inputExtraRuleCommentItemReplacement);</BUG>
lastSite.extraRule.commentRule.avatar = loadSelector(inputExtraRuleCommentAvatarSelector, inputExtraRuleCommentAvatarRegex, inputExtraRuleCommentAvatarReplacement);
| lastSite.extraRule.pictureRule = (lastSite.extraRule.pictureRule == null) ? new PictureRule() : lastSite.extraRule.pictureRule;
lastSite.extraRule.pictureRule.thumbnail = loadSelector(inputExtraRulePictureThumbnailSelector, inputExtraRulePictureThumbnailRegex, inputExtraRulePictureThumbnailReplacement);
lastSite.extraRule.pictureRule.url = loadSelector(inputExtraRulePictureUrlSelector, inputExtraRulePictureUrlRegex, inputExtraRulePictureUrlReplacement);
lastSite.extraRule.pictureRule.highRes = loadSelector(inputExtraRulePictureHighResSelector, inputExtraRulePictureHighResRegex, inputExtraRulePictureHighResReplacement);
lastSite.extraRule.commentRule = (lastSite.extraRule.commentRule == null) ? new CommentRule() : lastSite.extraRule.commentRule;
lastSite.extraRule.commentRule.item = loadSelector(inputExtraRuleCommentItemSelector, inputExtraRuleCommentItemRegex, inputExtraRuleCommentItemReplacement);
|
46,870 | notifyItemChanged(position);
if (mItemClickListener != null)
mItemClickListener.onItemClick(v, position);
}
});
<BUG>if (tag.selected)
label.getChildAt(0).setBackgroundResource(R.color.colorPrimary);
else
label.getChildAt(0).setBackgroundResource(R.color.dimgray);</BUG>
}
| [DELETED] |
46,871 | loadPicture(picture, task, null, true);
} else if (!TextUtils.isEmpty(picture.pic) && !highRes) {
picture.retries = 0;
loadPicture(picture, task, null, false);
} else if (task.collection.site.hasFlag(Site.FLAG_SINGLE_PAGE_BIG_PICTURE)
<BUG>&& task.collection.site.extraRule != null
&& task.collection.site.extraRule.pictureUrl != null) {
</BUG>
getPictureUrl(picture, task, task.collection.site.extraRule.pictureUrl, task.collection.site.extraRule.pictureHighRes);
| && task.collection.site.extraRule != null) {
if(task.collection.site.extraRule.pictureRule != null && task.collection.site.extraRule.pictureRule.url != null)
getPictureUrl(picture, task, task.collection.site.extraRule.pictureRule.url, task.collection.site.extraRule.pictureRule.highRes);
else if(task.collection.site.extraRule.pictureUrl != null)
|
46,872 | if (Picture.hasPicPosfix(picture.url)) {
picture.pic = picture.url;
loadPicture(picture, task, null, false);
} else
if (task.collection.site.hasFlag(Site.FLAG_JS_NEEDED_ALL)) {
<BUG>new Handler(Looper.getMainLooper()).post(()->{
</BUG>
WebView webView = new WebView(HViewerApplication.mContext);
WebSettings mWebSettings = webView.getSettings();
mWebSettings.setJavaScriptEnabled(true);
| new Handler(Looper.getMainLooper()).post(() -> {
|
46,873 | private static final String TEST_KEY = "key1";
interface Runner
{
public void run() throws Exception;
}
<BUG>private void reTest(Runner setup, ColumnFamilyStore cfs, Runner verify) throws Exception
{
setup.run();</BUG>
verify.run();
cfs.forceBlockingFlush();
| private void reTest(ColumnFamilyStore cfs, Runner verify) throws Exception
|
46,874 | assertColumns(cf);
cf = cfStore.getColumnFamily(new SliceQueryFilter(TEST_KEY, new QueryPath("Standard3"), ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY, true, 0));
assertColumns(cf);
}
};
<BUG>reTest(setup, table.getColumnFamilyStore("Standard3"), verify);
}</BUG>
@Test
public void testGetRowSingleColumn() throws Throwable
{
| reTest(table.getColumnFamilyStore("Standard3"), verify);
|
46,875 | @Test
public void testGetRowSingleColumn() throws Throwable
{
final Table table = Table.open("Keyspace1");
final ColumnFamilyStore cfStore = table.getColumnFamilyStore("Standard1");
<BUG>Runner setup = new Runner()
{
public void run() throws Exception
{
RowMutation rm = makeSimpleRowMutation();
rm.apply();
}
};</BUG>
Runner verify = new Runner()
| RowMutation rm = new RowMutation("Keyspace1", TEST_KEY);
ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("col1","val1", 1L));
cf.addColumn(column("col2","val2", 1L));
cf.addColumn(column("col3","val3", 1L));
rm.add(cf);
|
46,876 | assertColumns(cf, "col1");
cf = cfStore.getColumnFamily(new NamesQueryFilter(TEST_KEY, new QueryPath("Standard1"), "col3".getBytes()));
assertColumns(cf, "col3");
}
};
<BUG>reTest(setup, table.getColumnFamilyStore("Standard1"), verify);
}</BUG>
@Test
public void testGetRowSliceByRange() throws Throwable
{
| reTest(table.getColumnFamilyStore("Standard1"), verify);
|
46,877 | public void testGetSliceFromBasic() throws Throwable
{
final Table table = Table.open("Keyspace1");
final ColumnFamilyStore cfStore = table.getColumnFamilyStore("Standard1");
final String ROW = "row1";
<BUG>Runner setup = new Runner()
{
public void run() throws Exception
{</BUG>
RowMutation rm = new RowMutation("Keyspace1", ROW);
| [DELETED] |
46,878 | rm.add(cf);
rm.apply();
rm = new RowMutation("Keyspace1", ROW);
rm.delete(new QueryPath("Standard1", null, "col4".getBytes()), 2L);
rm.apply();
<BUG>}
};</BUG>
Runner verify = new Runner()
{
public void run() throws Exception
| [DELETED] |
46,879 | assertColumns(cf);
cf = cfStore.getColumnFamily(ROW, new QueryPath("Standard1"), "col0".getBytes(), ArrayUtils.EMPTY_BYTE_ARRAY, false, 2);
assertColumns(cf);
}
};
<BUG>reTest(setup, table.getColumnFamilyStore("Standard1"), verify);
}</BUG>
@Test
public void testGetSliceFromAdvanced() throws Throwable
{
| reTest(table.getColumnFamilyStore("Standard1"), verify);
|
46,880 | public void testGetSliceFromAdvanced() throws Throwable
{
final Table table = Table.open("Keyspace1");
final ColumnFamilyStore cfStore = table.getColumnFamilyStore("Standard1");
final String ROW = "row2";
<BUG>Runner setup = new Runner()
{
public void run() throws Exception
{</BUG>
RowMutation rm = new RowMutation("Keyspace1", ROW);
| [DELETED] |
46,881 | cf.addColumn(column("col1", "valx", 2L));
cf.addColumn(column("col2", "valx", 2L));
cf.addColumn(column("col3", "valx", 2L));
rm.add(cf);
rm.apply();
<BUG>}
};</BUG>
Runner verify = new Runner()
{
public void run() throws Exception
| [DELETED] |
46,882 | assertEquals(new String(cf.getColumn("col2".getBytes()).value()), "valx");
assertEquals(new String(cf.getColumn("col3".getBytes()).value()), "valx");
assertEquals(new String(cf.getColumn("col4".getBytes()).value()), "val4");
}
};
<BUG>reTest(setup, table.getColumnFamilyStore("Standard1"), verify);
}</BUG>
@Test
public void testGetSliceFromLarge() throws Throwable
{
| reTest(table.getColumnFamilyStore("Standard1"), verify);
|
46,883 | public void testGetSliceFromSuperBasic() throws Throwable
{
final Table table = Table.open("Keyspace1");
final ColumnFamilyStore cfStore = table.getColumnFamilyStore("Super1");
final String ROW = "row2";
<BUG>Runner setup = new Runner()
{
public void run() throws Exception
{</BUG>
RowMutation rm = new RowMutation("Keyspace1", ROW);
| [DELETED] |
46,884 | SuperColumn sc = new SuperColumn("sc1".getBytes(), new LongType());
sc.addColumn(new Column(getBytes(1), "val1".getBytes(), 1L));
cf.addColumn(sc);
rm.add(cf);
rm.apply();
<BUG>}
};</BUG>
Runner verify = new Runner()
{
public void run() throws Exception
| [DELETED] |
46,885 | ColumnFamily cf = cfStore.getColumnFamily(ROW, new QueryPath("Super1"), ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY, true, 10);
assertColumns(cf, "sc1");
assertEquals(new String(cf.getColumn("sc1".getBytes()).getSubColumn(getBytes(1)).value()), "val1");
}
};
<BUG>reTest(setup, table.getColumnFamilyStore("Standard1"), verify);
}</BUG>
public static void assertColumns(ColumnFamily cf, String... columnNames)
{
Collection<IColumn> columns = cf == null ? new TreeSet<IColumn>() : cf.getSortedColumns();
| reTest(table.getColumnFamilyStore("Standard1"), verify);
|
46,886 | package org.neo4j.index.impl.lucene;
import static org.junit.Assert.assertTrue;
import java.io.File;
<BUG>import java.lang.Thread.State;
import java.util.Random;</BUG>
import org.junit.Test;
import org.neo4j.graphdb.DynamicRelationshipType;
import org.neo4j.graphdb.GraphDatabaseService;
| import static org.junit.Assert.assertEquals;
import java.util.Map;
import java.util.Random;
|
46,887 | import org.neo4j.graphdb.DynamicRelationshipType;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
<BUG>import org.neo4j.graphdb.index.Index;
import org.neo4j.index.Neo4jTestCase;
import org.neo4j.kernel.EmbeddedGraphDatabase;
public class TestRecovery</BUG>
{
| import org.neo4j.helpers.collection.MapUtil;
import org.neo4j.kernel.impl.index.IndexStore;
public class TestRecovery
|
46,888 | public void testIndexDeleteIssue() throws Exception
{
GraphDatabaseService db = newGraphDbService();
db.index().forNodes( "index" );
db.shutdown();
<BUG>Runtime.getRuntime().exec( new String[] { "java", "-cp", System.getProperty( "java.class.path" ),
AddDeleteQuit.class.getName(), getDbPath()
} ).waitFor();</BUG>
new EmbeddedGraphDatabase( getDbPath() ).shutdown();
| assertEquals( 0, Runtime.getRuntime().exec( new String[] { "java", "-cp", System.getProperty( "java.class.path" ),
AddDeleteQuit.class.getName(), getDbPath() } ).waitFor() );
|
46,889 | ") has been marked as deleted in this transaction" );
}
}
static class CommandList
{
<BUG>private final List<LuceneCommand> commands = new ArrayList<LuceneCommand>();
int addCount;
int removeCount;</BUG>
void add( LuceneCommand command )
{
| private boolean containsWrites;
|
46,890 | cloth2.CREATE_SHEAR_SPRINGS = true;
cloth2.CREATE_BEND_SPRINGS = true;
cloth2.bend_spring_mode = 0;
cloth2.bend_spring_dist = 3;
createGUI();
<BUG>frameRate(60);
</BUG>
}
public void initBodies(){
physics.reset();
| frameRate(600);
|
46,891 | body.use_particles_color = (DISPLAY_MODE == 0);
body.drawParticles(this.g);
}
}
for(DwSoftBody2D body : softbodies){
<BUG>if(DISPLAY_SPRINGS_BEND ) body.drawSprings(this.g, DwSpringConstraint.TYPE.BEND , DISPLAY_MODE);
if(DISPLAY_SPRINGS_SHEAR ) body.drawSprings(this.g, DwSpringConstraint.TYPE.SHEAR , DISPLAY_MODE);
if(DISPLAY_SPRINGS_STRUCT) body.drawSprings(this.g, DwSpringConstraint.TYPE.STRUCT, DISPLAY_MODE);
}</BUG>
if(DELETE_SPRINGS){
| body.DISPLAY_SPRINGS_BEND = DISPLAY_SPRINGS_BEND;
body.DISPLAY_SPRINGS_SHEAR = DISPLAY_SPRINGS_SHEAR;
body.DISPLAY_SPRINGS_STRUCT = DISPLAY_SPRINGS_STRUCT;
body.displaySprings(this.g, DISPLAY_MODE, DwSpringConstraint.TYPE.BEND );
body.displaySprings(this.g, DISPLAY_MODE, DwSpringConstraint.TYPE.SHEAR );
body.displaySprings(this.g, DISPLAY_MODE, DwSpringConstraint.TYPE.STRUCT);
|
46,892 | body.use_particles_color = (DISPLAY_MODE == 0);
body.drawParticles(this.g);
}
}
for(DwSoftBody2D body : softbodies){
<BUG>if(DISPLAY_SPRINGS_BEND ) body.drawSprings(this.g, DwSpringConstraint.TYPE.BEND , DISPLAY_MODE);
if(DISPLAY_SPRINGS_SHEAR ) body.drawSprings(this.g, DwSpringConstraint.TYPE.SHEAR , DISPLAY_MODE);
if(DISPLAY_SPRINGS_STRUCT) body.drawSprings(this.g, DwSpringConstraint.TYPE.STRUCT, DISPLAY_MODE);
}</BUG>
if(DELETE_SPRINGS){
| body.DISPLAY_SPRINGS_BEND = DISPLAY_SPRINGS_BEND;
body.DISPLAY_SPRINGS_SHEAR = DISPLAY_SPRINGS_SHEAR;
body.DISPLAY_SPRINGS_STRUCT = DISPLAY_SPRINGS_STRUCT;
body.displaySprings(this.g, DISPLAY_MODE);
|
46,893 | body.use_particles_color = (DISPLAY_MODE == 0);
body.drawParticles(this.g);
}
}
for(DwSoftBody2D body : softbodies){
<BUG>if(DISPLAY_SPRINGS_BEND ) body.drawSprings(this.g, DwSpringConstraint.TYPE.BEND , DISPLAY_MODE);
if(DISPLAY_SPRINGS_SHEAR ) body.drawSprings(this.g, DwSpringConstraint.TYPE.SHEAR , DISPLAY_MODE);
if(DISPLAY_SPRINGS_STRUCT) body.drawSprings(this.g, DwSpringConstraint.TYPE.STRUCT, DISPLAY_MODE);
}</BUG>
if(DELETE_SPRINGS){
| body.DISPLAY_SPRINGS_BEND = DISPLAY_SPRINGS_BEND;
body.DISPLAY_SPRINGS_SHEAR = DISPLAY_SPRINGS_SHEAR;
body.DISPLAY_SPRINGS_STRUCT = DISPLAY_SPRINGS_STRUCT;
body.displaySprings(this.g, DISPLAY_MODE, DwSpringConstraint.TYPE.BEND );
body.displaySprings(this.g, DISPLAY_MODE, DwSpringConstraint.TYPE.SHEAR );
body.displaySprings(this.g, DISPLAY_MODE, DwSpringConstraint.TYPE.STRUCT);
|
46,894 | MineTweakerAPI.apply(new Remove(recipes));
} else {
LogHelper.logWarning(String.format("No %s Recipe found for %s. Command ignored!", Carpenter.name, output.toString()));
}
}
<BUG>private static class Remove extends BaseListRemoval<Recipe> {
public Remove(List<Recipe> recipes) {
super(Carpenter.name, RecipeManager.recipes, recipes);
</BUG>
}
| private static class Remove extends ForestryListRemoval<ICarpenterRecipe, ICarpenterManager> {
public Remove(List<ICarpenterRecipe> recipes) {
super(Carpenter.name, RecipeManagers.carpenterManager, recipes);
|
46,895 |
super(Carpenter.name, RecipeManager.recipes, recipes);
</BUG>
}
@Override
<BUG>protected String getRecipeInfo(Recipe recipe) {
return LogHelper.getStackDescription(recipe.getCraftingResult());
</BUG>
}
| MineTweakerAPI.apply(new Remove(recipes));
} else {
LogHelper.logWarning(String.format("No %s Recipe found for %s. Command ignored!", Carpenter.name, output.toString()));
private static class Remove extends ForestryListRemoval<ICarpenterRecipe, ICarpenterManager> {
public Remove(List<ICarpenterRecipe> recipes) {
super(Carpenter.name, RecipeManagers.carpenterManager, recipes);
protected String getRecipeInfo(ICarpenterRecipe recipe) {
return LogHelper.getStackDescription(recipe.getCraftingGridRecipe().getRecipeOutput());
|
46,896 | import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import minetweaker.api.item.WeightedItemStack;
import modtweaker2.helpers.LogHelper;
<BUG>import modtweaker2.utils.BaseListAddition;
import modtweaker2.utils.BaseListRemoval;
import net.minecraft.item.ItemStack;</BUG>
import stanhebben.zenscript.annotations.ZenClass;
| import modtweaker2.mods.forestry.ForestryListAddition;
import modtweaker2.mods.forestry.ForestryListRemoval;
import modtweaker2.mods.forestry.recipes.CentrifugeRecipe;
import net.minecraft.item.ItemStack;
|
46,897 | }
}
@ZenMethod
public static void removeRecipe(IIngredient input) {
List<ICentrifugeRecipe> recipes = new LinkedList<ICentrifugeRecipe>();
<BUG>for(ICentrifugeRecipe recipe : RecipeManager.recipes) {
</BUG>
if(recipe != null && matches(input, toIItemStack(recipe.getInput()))) {
recipes.add(recipe);
}
| MineTweakerAPI.apply(new Add(new CentrifugeRecipe(timePerItem, toStack(itemInput), products)));
private static class Add extends ForestryListAddition<ICentrifugeRecipe, ICentrifugeManager> {
public Add(ICentrifugeRecipe recipe) {
super(Centrifuge.name, RecipeManagers.centrifugeManager);
|
46,898 | import name.abuchen.portfolio.ui.dialogs.transactions.AccountTransactionDialog;
import name.abuchen.portfolio.ui.dialogs.transactions.AccountTransferDialog;
import name.abuchen.portfolio.ui.dialogs.transactions.OpenDialogAction;
import name.abuchen.portfolio.ui.dialogs.transactions.SecurityTransactionDialog;
import name.abuchen.portfolio.ui.util.AbstractDropDown;
<BUG>import name.abuchen.portfolio.ui.util.Colors;
import name.abuchen.portfolio.ui.util.chart.TimelineChart;</BUG>
import name.abuchen.portfolio.ui.util.viewers.Column;
import name.abuchen.portfolio.ui.util.viewers.ColumnEditingSupport;
import name.abuchen.portfolio.ui.util.viewers.ColumnEditingSupport.ModificationListener;
| import name.abuchen.portfolio.ui.util.SimpleAction;
import name.abuchen.portfolio.ui.util.chart.TimelineChart;
|
46,899 | public static String MenuConfigureCurrentDashboard;
public static String MenuConfigureDashboards;
public static String MenuConvertToBuy;
public static String MenuConvertToInboundDelivery;
public static String MenuConvertToOutboundDelivery;
<BUG>public static String MenuConvertToSell;
public static String MenuCreateColumnConfig;
public static String MenuDeleteDashboardColumn;</BUG>
public static String MenuDeleteWidget;
public static String MenuEditInvestmentPlan;
| public static String MenuCreateAccountOrTransaction;
public static String MenuCreatePortfolioOrTransaction;
public static String MenuDeleteDashboardColumn;
|
46,900 | import name.abuchen.portfolio.money.ExchangeRateProviderFactory;
import name.abuchen.portfolio.snapshot.PortfolioSnapshot;
import name.abuchen.portfolio.ui.Images;
import name.abuchen.portfolio.ui.Messages;
import name.abuchen.portfolio.ui.PortfolioPart;
<BUG>import name.abuchen.portfolio.ui.util.AbstractDropDown;
import name.abuchen.portfolio.ui.util.viewers.Column;</BUG>
import name.abuchen.portfolio.ui.util.viewers.ColumnEditingSupport;
import name.abuchen.portfolio.ui.util.viewers.ColumnEditingSupport.ModificationListener;
import name.abuchen.portfolio.ui.util.viewers.ColumnViewerSorter;
| import name.abuchen.portfolio.ui.util.SimpleAction;
import name.abuchen.portfolio.ui.util.viewers.Column;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.