id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
10,901
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBannerImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
if (deleteImage) { Utils.deleteMedia(context, imageUri);
10,902
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBackgroundImage(fileBody, tile); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
10,903
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); return twitter.updateProfileImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
10,904
import org.mariotaku.twidere.receiver.NotificationReceiver; import org.mariotaku.twidere.service.LengthyOperationsService; import org.mariotaku.twidere.util.ActivityTracker; import org.mariotaku.twidere.util.AsyncTwitterWrapper; import org.mariotaku.twidere.util.DataStoreFunctionsKt; <BUG>import org.mariotaku.twidere.util.DataStoreUtils; import org.mariotaku.twidere.util.ImagePreloader;</BUG> import org.mariotaku.twidere.util.InternalTwitterContentUtils; import org.mariotaku.twidere.util.JsonSerializer; import org.mariotaku.twidere.util.NotificationManagerWrapper;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.ImagePreloader;
10,905
final List<InetAddress> addresses = mDns.lookup(host); for (InetAddress address : addresses) { c.addRow(new String[]{host, address.getHostAddress()}); } } catch (final IOException ignore) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, ignore); }</BUG> }
DebugLog.w(LOGTAG, null, ignore);
10,906
for (Location location : twitter.getAvailableTrends()) { map.put(location); } return map.pack(); } catch (final MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
10,907
import android.content.Context; import android.content.SharedPreferences; import android.location.Location; import android.os.AsyncTask; import android.support.annotation.NonNull; <BUG>import android.util.Log; import org.mariotaku.twidere.BuildConfig; import org.mariotaku.twidere.Constants; import org.mariotaku.twidere.util.JsonSerializer;</BUG> import org.mariotaku.twidere.util.Utils;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.JsonSerializer;
10,908
} public static LatLng getCachedLatLng(@NonNull final Context context) { final Context appContext = context.getApplicationContext(); final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences(); if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null; <BUG>if (BuildConfig.DEBUG) { Log.d(HotMobiLogger.LOGTAG, "getting cached location"); }</BUG> final Location location = Utils.getCachedLocation(appContext);
DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
10,909
public int destroySavedSearchAsync(final UserKey accountKey, final long searchId) { final DestroySavedSearchTask task = new DestroySavedSearchTask(accountKey, searchId); return asyncTaskManager.add(task, true); } public int destroyStatusAsync(final UserKey accountKey, final String statusId) { <BUG>final DestroyStatusTask task = new DestroyStatusTask(context,accountKey, statusId); </BUG> return asyncTaskManager.add(task, true); } public int destroyUserListAsync(final UserKey accountKey, final String listId) {
final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
10,910
@Override public void afterExecute(Bus handler, SingleResponse<Relationship> result) { if (result.hasData()) { handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData())); } else if (result.hasException()) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, "Unable to update friendship", result.getException()); }</BUG> }
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
10,911
MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId); if (!Utils.isOfficialCredentials(context, accountId)) continue; try { microBlog.setActivitiesAboutMeUnread(cursor); } catch (MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
10,912
@Override public boolean intersects(Collection<AxisAlignedBB> boxes1, IBlockAccess world, BlockPos pos) { if (world instanceof IMultipartBlockAccess) { IPartInfo info = ((IMultipartBlockAccess) world).getPartInfo(); for (IPartInfo info2 : info.getContainer().getParts().values()) { <BUG>if (info2 != info && intersects(boxes1, info2.getPart().getOcclusionBoxes(info2.getWorld(), info2.getPos(), info2))) { return true;</BUG> } } return false;
if (info2 != info && intersects(boxes1, info2.getPart().getOcclusionBoxes(info2))) { return true;
10,913
public interface IWireContainer { World world(); BlockPos pos(); void requestNeighborUpdate(int connectionMask); void requestNetworkUpdate(); <BUG>void requestRenderUpdate(); class Dummy implements IWireContainer {</BUG> @Override public World world() { return null;
void dropWire(); class Dummy implements IWireContainer {
10,914
dependencies = {"mod:mcmultipart"} ) public class CharsetLibWires { @CharsetModule.Instance public static CharsetLibWires instance; <BUG>@CapabilityInject(IWireProxy.class) public static Capability<IWireProxy> WIRE_CAP;</BUG> public static BlockWire blockWire; public static ItemWire itemWire; @SideOnly(Side.CLIENT)
[DELETED]
10,915
if (wire != null) { return wire.getFactory().getSelectionBox(wire.getLocation(), 0); } else { return FULL_BLOCK_AABB; } <BUG>} @Override public void onPartPlacedBy(IPartInfo part, EntityLivingBase placer, ItemStack stack) { TileEntity tile = part.getTile().getTileEntity(); if (tile != null && tile instanceof TileWire) { ((TileWire) tile).onPlacedBy(part.getSlot() instanceof EnumFaceSlot ? ((EnumFaceSlot) part.getSlot()).getFacing() : null, stack); }</BUG> }
return Collections.singletonList(wire.getFactory().getSelectionBox(wire.getLocation(), 0)); return Collections.emptyList();
10,916
public IPartSlot getSlotForPlacement(World world, BlockPos pos, IBlockState state, EnumFacing facing, float hitX, float hitY, float hitZ, EntityLivingBase placer) { Wire wire = WireUtils.getWire(world, pos, WireFace.get(facing)); if (wire != null) { return EnumCenterSlot.CENTER; } else { <BUG>return EnumFaceSlot.fromFace(facing); </BUG> } } @Override
return EnumFaceSlot.fromFace(facing.getOpposite());
10,917
<BUG>package pl.asie.charset.lib.wires; import mcmultipart.api.item.ItemBlockMultipart; import mcmultipart.api.multipart.IMultipart; import net.minecraft.block.Block;</BUG> import net.minecraft.block.state.IBlockState;
import mcmultipart.MCMultiPart; import mcmultipart.api.container.IPartInfo; import mcmultipart.api.multipart.MultipartHelper; import mcmultipart.api.slot.IPartSlot; import net.minecraft.block.Block;
10,918
this.group = group; this.baseName = baseName; this.createDaemons = createDaemons; this.use_numbering=use_numbering; } <BUG>public void setThreadNamingPattern(String pattern) { includeClusterName=pattern.contains("c");</BUG> includeLocalAddress=pattern.contains("l"); } public void setClusterName(String channelName){
public void setPattern(String pattern) { includeClusterName=pattern.contains("c");
10,919
retval.setDaemon(createDaemons); renameThread(retval); return retval;</BUG> } public Thread newThread(Runnable r) { <BUG>Thread retval=newThread(group, r, baseName); retval.setDaemon(createDaemons); renameThread(retval); return retval;</BUG> }
return retval;
10,920
to.name = from.name; to.number = from.number; to.modifier = from.modifier; to.addAnnotations(from.annotations, true); to.standardOptions.putAll(from.standardOptions); <BUG>to.extraOptions.putAll(from.extraOptions); }</BUG> static void resolveFullName(Message message, StringBuilder buffer) { buffer.insert(0, message.name).insert(0, '.');
to.docs.addAll(from.docs); }
10,921
import org.apache.commons.io.FileUtils; public class BetterFpsHelper { public static final String MC_VERSION = "1.9"; public static final String VERSION = "1.2.1"; public static final String URL = "http://guichaguri.github.io/BetterFps/"; <BUG>public static final String UPDATE_URL = "https://raw.githubusercontent.com/Guichaguri/BetterFps/1.8/lastest-version.properties"; public static final LinkedHashMap<String, String> helpers = new LinkedHashMap<String, String>();</BUG> public static final LinkedHashMap<String, String> displayHelpers = new LinkedHashMap<String, String>(); static { helpers.put("vanilla", "VanillaMath");
public static final String UPDATE_URL = "http://widget.mcf.li/mc-mods/minecraft/229876-betterfps.json"; public static final LinkedHashMap<String, String> helpers = new LinkedHashMap<String, String>();
10,922
<BUG>package guichaguri.betterfps; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.Properties;</BUG> import net.minecraft.client.Minecraft;
import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import java.io.InputStreamReader;
10,923
import net.minecraft.util.text.event.ClickEvent; import net.minecraft.util.text.event.HoverEvent; public class UpdateChecker implements Runnable { private static boolean updateCheck = false; private static boolean done = false; <BUG>private static Properties prop = null; public static void check() {</BUG> if(!BetterFpsConfig.getConfig().updateChecker) { done = true; return;
private static String updateVersion = null; private static String updateDownload = null; public static void check() {
10,924
thread.setDaemon(true); thread.start(); } } public static void showChat() { <BUG>if(!done) return; if(prop == null) return; if(BetterFpsHelper.VERSION.equals(prop.getProperty("version"))) { prop = null; return; }</BUG> if(!BetterFps.isClient) return;
if(updateVersion == null && updateDownload == null) return;
10,925
@CopyMode(Mode.IGNORE) // Ignore the constructor to prevent an infinite loop public HopperBlock() { } @Override @CopyMode(Mode.APPEND) <BUG>public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { </BUG> TileEntity te = worldIn.getTileEntity(pos); if(te != null) { TileEntityHopper hopper = (TileEntityHopper)te;
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block neighborBlock) {
10,926
package it.feio.android.checklistview.models; <BUG>import android.content.Context; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; import android.widget.EditText; public class EditTextMultiLineNoEnter extends EditText { public EditTextMultiLineNoEnter(Context context) {</BUG> super(context);
import it.feio.android.checklistview.interfaces.EditTextEventListener; import android.view.KeyEvent; import android.view.inputmethod.InputConnectionWrapper; private EditTextEventListener mEditTextEventListener; public EditTextMultiLineNoEnter(Context context) {
10,927
package it.feio.android.checklistview.models; import it.feio.android.checklistview.R; import it.feio.android.checklistview.interfaces.CheckListChangedListener; import it.feio.android.checklistview.interfaces.CheckListEventListener; <BUG>import it.feio.android.checklistview.interfaces.Constants; import it.feio.android.checklistview.utils.AlphaManager;</BUG> import it.feio.android.checklistview.utils.DensityUtil; import android.annotation.SuppressLint; import android.annotation.TargetApi;
import it.feio.android.checklistview.interfaces.EditTextEventListener; import it.feio.android.checklistview.utils.AlphaManager;
10,928
import android.annotation.TargetApi; import android.content.Context; import android.graphics.Paint; import android.graphics.drawable.Drawable; import android.os.Build; <BUG>import android.os.Handler; import android.text.Editable;</BUG> import android.text.Spanned; import android.text.TextWatcher; import android.view.KeyEvent;
import android.provider.ContactsContract.DeletedContacts; import android.text.Editable;
10,929
import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) public class CheckListViewItem extends LinearLayout implements <BUG>OnCheckedChangeListener, OnClickListener, OnFocusChangeListener, OnEditorActionListener, TextWatcher { </BUG> private Context mContext; private CheckBox checkBox; private EditTextMultiLineNoEnter editText;
OnCheckedChangeListener, OnClickListener, OnFocusChangeListener, OnEditorActionListener, TextWatcher, EditTextEventListener {
10,930
if (Build.VERSION.SDK_INT >= 18) { editText.setTextAlignment(TEXT_ALIGNMENT_VIEW_START); } editText.setOnFocusChangeListener(this); editText.setOnEditorActionListener(this); <BUG>editText.addTextChangedListener(this); addView(editText);</BUG> addDeleteIcon(); if (isChecked) { checkBox.setChecked(true);
editText.setEditTextEventListener(this); addView(editText);
10,931
final TypeSpec deleteEndClass = buildDeleteEndClass(signature, lastSignature, hasCounter); partitionKeysWhereClasses.addAll(clusteringColsWhereClasses); partitionKeysWhereClasses.add(deleteEndClass); return partitionKeysWhereClasses; } <BUG>default List<TypeSpec> buildWhereClassesForStatic(EntityMetaSignature signature) { </BUG> final List<FieldSignatureInfo> partitionKeys = getPartitionKeysSignatureInfo(signature.fieldMetaSignatures); final ClassSignatureParams classSignatureParams = ClassSignatureParams.of(DELETE_STATIC_DSL_SUFFIX, DELETE_STATIC_WHERE_DSL_SUFFIX, DELETE_STATIC_END_DSL_SUFFIX,
public List<TypeSpec> buildWhereClassesForStatic(EntityMetaSignature signature) {
10,932
final List<TypeSpec> partitionKeysWhereClasses = buildWhereClassesForPartitionKeys(partitionKeys, classesSignature, false); final TypeSpec deleteEndClass = buildDeleteEndClass(signature, lastSignature, hasCounter); partitionKeysWhereClasses.add(deleteEndClass); return partitionKeysWhereClasses; } <BUG>default TypeSpec buildDeleteEndClass(EntityMetaSignature signature, </BUG> ClassSignatureInfo lastSignature, boolean hasCounter) { final TypeSpec.Builder builder = TypeSpec.classBuilder(lastSignature.className)
public TypeSpec buildDeleteEndClass(EntityMetaSignature signature,
10,933
classesSignature, hasClusterings); typeSpecs.add(0, typeSpec); return typeSpecs; } } <BUG>default TypeSpec buildDeleteWhereForPartitionKey(FieldSignatureInfo partitionInfo, </BUG> ClassSignatureInfo classSignature, ClassSignatureInfo nextSignature, boolean hasClusterings) {
public TypeSpec buildDeleteWhereForPartitionKey(FieldSignatureInfo partitionInfo,
10,934
final List<TypeSpec> typeSpecs = buildWhereClassesForClusteringColumns(clusteringCols, classesSignature); typeSpecs.add(0, currentType); return typeSpecs; } } <BUG>default TypeSpec buildDeleteWhereForClusteringColumn(FieldSignatureInfo clusteringColumnInfo, </BUG> ClassSignatureInfo classSignature, ClassSignatureInfo nextSignature) { final TypeSpec.Builder builder = TypeSpec.classBuilder(classSignature.className)
public TypeSpec buildDeleteWhereForClusteringColumn(FieldSignatureInfo clusteringColumnInfo,
10,935
builder.addMethod(buildAllColumns(deleteFromTypeName, DELETE_WHERE, "delete")); builder.addMethod(buildAllColumnsWithSchemaProvider(deleteFromTypeName, DELETE_WHERE, "delete")); deleteWhereDSLCodeGen.buildWhereClasses(signature).forEach(builder::addType); return builder.build(); } <BUG>default TypeSpec buildDeleteStaticClass(EntityMetaSignature signature, DeleteWhereDSLCodeGen deleteWhereDSLCodeGen) { </BUG> final String firstPartitionKey = signature.fieldMetaSignatures .stream() .filter(x -> x.context.columnType == ColumnType.PARTITION)
public TypeSpec buildDeleteStaticClass(EntityMetaSignature signature, DeleteWhereDSLCodeGen deleteWhereDSLCodeGen) {
10,936
.addParameter(metaClassType, "meta") .addStatement("super(rte)") .addStatement("this.meta = meta") .build(); } <BUG>default TypeSpec buildDeleteColumns(EntityMetaSignature signature, </BUG> String deleteColumnClass, TypeName deleteColumnsTypeName, TypeName deleteFromTypeName,
public TypeSpec buildDeleteColumns(EntityMetaSignature signature,
10,937
.forEach(x -> builder.addMethod(buildDeleteColumnMethod(deleteColumnsTypeName, x, ReturnType.THIS))); builder.addMethod(buildFrom(deleteFromTypeName, DELETE_WHERE, "deleteColumns")); builder.addMethod(buildFromWithSchemaProvider(deleteFromTypeName, DELETE_WHERE, "deleteColumns")); return builder.build(); } <BUG>default TypeSpec buildDeleteFrom(EntityMetaSignature signature, </BUG> String deleteFromClassName, TypeName deleteWhereTypeName) { return TypeSpec.classBuilder(deleteFromClassName)
public TypeSpec buildDeleteFrom(EntityMetaSignature signature,
10,938
.addStatement("return new $T(where)", deleteWhereTypeName) .returns(deleteWhereTypeName) .build()) .build(); } <BUG>default MethodSpec buildDeleteColumnMethod(TypeName deleteTypeName, FieldMetaSignature parsingResult, ReturnType returnType) { </BUG> final MethodSpec.Builder builder = MethodSpec.methodBuilder(parsingResult.context.fieldName) .addJavadoc("Generate DELETE <strong>$L</strong> ...", parsingResult.context.quotedCqlColumn) .addModifiers(Modifier.PUBLIC, Modifier.FINAL)
public MethodSpec buildDeleteColumnMethod(TypeName deleteTypeName, FieldMetaSignature parsingResult, ReturnType returnType) {
10,939
final ClassName abstractEndType = classSignatureParams.abstractEndType.orElse(classSignatureParams.abstractWhereType); signatures.add(ClassSignatureInfo.of(endTypeName, endReturnTypeName, genericType(abstractEndType, endReturnTypeName, signature.entityRawClass), endClassName)); return signatures; } <BUG>default MethodSpec buildWhereConstructor(TypeName whereType) { </BUG> return MethodSpec.constructorBuilder() .addModifiers(Modifier.PUBLIC) .addParameter(whereType, "where")
public MethodSpec buildWhereConstructor(TypeName whereType) {
10,940
.addModifiers(Modifier.PUBLIC) .addParameter(whereType, "where") .addStatement("super(where)") .build(); } <BUG>default MethodSpec buildColumnRelation(String relation, TypeName nextType, FieldSignatureInfo fieldInfo) { final String methodName = fieldInfo.fieldName + "_" + upperCaseFirst(relation); final MethodSpec.Builder builder = MethodSpec.methodBuilder(methodName)</BUG> .addJavadoc("Generate a SELECT ... FROM ... WHERE ... <strong>$L $L ?</strong>", fieldInfo.quotedCqlColumn, relationToSymbolForJavaDoc(relation))
public MethodSpec buildColumnRelation(String relation, TypeName nextType, FieldSignatureInfo fieldInfo, FieldNamePrefix fieldNamePrefix) { final String methodName = fieldNamePrefix == FieldNamePrefix.YES ? fieldInfo.fieldName + "_" + upperCaseFirst(relation) : upperCaseFirst(relation); final MethodSpec.Builder builder = MethodSpec.methodBuilder(methodName)
10,941
.addStatement("boundValues.add($N)", fieldInfo.fieldName) .addStatement("encodedValues.add(meta.$L.encodeFromJava($N))", fieldInfo.fieldName, fieldInfo.fieldName) .returns(nextType); return builder.addStatement("return new $T(where)", nextType).build(); } <BUG>default MethodSpec buildColumnInVarargs(TypeName nextType, FieldSignatureInfo fieldInfo) { final String methodName = fieldInfo.fieldName + "_IN"; final String param = fieldInfo.fieldName;</BUG> final MethodSpec.Builder builder = MethodSpec.methodBuilder(methodName)
public MethodSpec buildColumnInVarargs(TypeName nextType, FieldSignatureInfo fieldInfo, FieldNamePrefix fieldNamePrefix) { final String methodName = fieldNamePrefix == FieldNamePrefix.YES ? fieldInfo.fieldName + "_IN" : "IN"; final String param = fieldInfo.fieldName;
10,942
.addStatement("boundValues.add(varargs)") .addStatement("encodedValues.add(encodedVarargs)") .returns(nextType); return builder.addStatement("return new $T(where)", nextType).build(); } <BUG>static MethodSpec buildGetThis(TypeName currentType) { </BUG> return MethodSpec .methodBuilder("getThis") .addAnnotation(Override.class)
public MethodSpec buildGetThis(TypeName currentType) {
10,943
.addModifiers(Modifier.FINAL, Modifier.PROTECTED) .returns(currentType) .addStatement("return this") .build(); } <BUG>default MethodSpec buildGetMetaInternal(TypeName currentType) { </BUG> return MethodSpec .methodBuilder("getMetaInternal") .addAnnotation(Override.class)
public MethodSpec buildGetMetaInternal(TypeName currentType) {
10,944
.fieldMetaSignatures .stream() .filter(x -> x.context.columnType == ColumnType.COUNTER || x.context.columnType == ColumnType.STATIC_COUNTER) .count() > 0; } <BUG>default FieldSpec buildExactEntityMetaField(EntityMetaSignature signature) { </BUG> String entityMetaClassName = signature.className + META_SUFFIX; TypeName entityMetaExactType = ClassName.get(ENTITY_META_PACKAGE, entityMetaClassName); return FieldSpec.builder(entityMetaExactType, "meta", Modifier.FINAL, Modifier.PROTECTED).build();
public FieldSpec buildExactEntityMetaField(EntityMetaSignature signature) {
10,945
</BUG> String entityMetaClassName = signature.className + META_SUFFIX; TypeName entityMetaExactType = ClassName.get(ENTITY_META_PACKAGE, entityMetaClassName); return FieldSpec.builder(entityMetaExactType, "meta", Modifier.FINAL, Modifier.PROTECTED).build(); } <BUG>default FieldSpec buildEntityClassField(EntityMetaSignature signature) { </BUG> return FieldSpec.builder(classTypeOf(signature.entityRawClass), "entityClass", Modifier.FINAL, Modifier.PROTECTED) .initializer("$T.class", signature.entityRawClass) .build();
.fieldMetaSignatures .stream() .filter(x -> x.context.columnType == ColumnType.COUNTER || x.context.columnType == ColumnType.STATIC_COUNTER) .count() > 0; public FieldSpec buildExactEntityMetaField(EntityMetaSignature signature) { public FieldSpec buildEntityClassField(EntityMetaSignature signature) {
10,946
whereTypeName, privateFieldName, "unknown_keyspace_for_") .addStatement("return new $T(where)", newTypeName) .returns(newTypeName) .build(); } <BUG>static MethodSpec buildAllColumnsWithSchemaProvider(TypeName newTypeName, TypeName whereTypeName, String privateFieldName) { </BUG> return MethodSpec.methodBuilder("allColumns_From") .addModifiers(Modifier.PUBLIC, Modifier.FINAL) .addJavadoc("Generate ... * FROM ... using the given SchemaNameProvider")
public MethodSpec buildAllColumnsWithSchemaProvider(TypeName newTypeName, TypeName whereTypeName, String privateFieldName) {
10,947
.addStatement("final $T where = $L.all().from(currentKeyspace, currentTable).where()", whereTypeName, privateFieldName) .addStatement("return new $T(where)", newTypeName) .returns(newTypeName) .build(); } <BUG>static MethodSpec buildFrom(TypeName newTypeName, TypeName whereTypeName, String privateFieldName) { </BUG> return MethodSpec.methodBuilder("fromBaseTable") .addJavadoc("Generate a ... <strong>FROM xxx</strong> ... ") .addModifiers(Modifier.PUBLIC, Modifier.FINAL)
public MethodSpec buildFrom(TypeName newTypeName, TypeName whereTypeName, String privateFieldName) {
10,948
"meta.getTableOrViewName()).where()", whereTypeName, privateFieldName, "unknown_keyspace_for_") .addStatement("return new $T(where)", newTypeName) .returns(newTypeName) .build(); } <BUG>static MethodSpec buildFromWithSchemaProvider(TypeName newTypeName, TypeName whereTypeName, String privateFieldName) { </BUG> return MethodSpec.methodBuilder("from") .addJavadoc("Generate a ... <strong>FROM xxx</strong> ... using the given SchemaNameProvider") .addModifiers(Modifier.PUBLIC, Modifier.FINAL)
public MethodSpec buildFromWithSchemaProvider(TypeName newTypeName, TypeName whereTypeName, String privateFieldName) {
10,949
.addStatement("final $T where = $L.from(currentKeyspace, currentTable).where()", whereTypeName, privateFieldName) .addStatement("return new $T(where)", newTypeName) .returns(newTypeName) .build(); } <BUG>default List<FieldSignatureInfo> getPartitionKeysSignatureInfo(List<FieldMetaSignature> parsingResults) { </BUG> return new ArrayList<>(parsingResults .stream() .filter(x -> x.context.columnType == ColumnType.PARTITION)
public List<FieldSignatureInfo> getPartitionKeysSignatureInfo(List<FieldMetaSignature> parsingResults) {
10,950
.map(x -> Tuple4.of(x.context.fieldName, x.context.cqlColumn, x.sourceType, (PartitionKeyInfo) x.context.columnInfo)) .sorted(TUPLE4_PARTITION_KEY_SORTER) .map(x -> FieldSignatureInfo.of(x._1(), x._2(), x._3())) .collect(toList())); } <BUG>default List<FieldSignatureInfo> getClusteringColsSignatureInfo(List<FieldMetaSignature> parsingResults) { </BUG> return new ArrayList<>(parsingResults .stream() .filter(x -> x.context.columnType == ColumnType.CLUSTERING)
public List<FieldSignatureInfo> getClusteringColsSignatureInfo(List<FieldMetaSignature> parsingResults) {
10,951
.map(x -> Tuple4.of(x.context.fieldName, x.context.cqlColumn, x.sourceType, (ClusteringColumnInfo) x.context.columnInfo)) .sorted(TUPLE4_CLUSTERING_COLUMN_SORTER) .map(x -> FieldSignatureInfo.of(x._1(), x._2(), x._3())) .collect(toList())); } <BUG>default void buildLWtConditionMethods(EntityMetaSignature signature, ClassSignatureInfo currentSignature, boolean hasCounter, TypeSpec.Builder builder) { </BUG> if (!hasCounter) { signature.fieldMetaSignatures.stream() .filter(x -> x.context.columnType == ColumnType.NORMAL || x.context.columnType == ColumnType.STATIC)
public void buildLWtConditionMethods(EntityMetaSignature signature, String parentFQCN, ClassSignatureInfo currentSignature, boolean hasCounter, TypeSpec.Builder parentBuilder) {
10,952
</BUG> .returns(currentType) .build(); } <BUG>default MethodSpec buildLWTNotEqual(FieldSignatureInfo fieldSignatureInfo, TypeName currentType) { String methodName = "if" + upperCaseFirst(fieldSignatureInfo.fieldName) + "_NotEq"; return MethodSpec.methodBuilder(methodName)</BUG> .addJavadoc("Generate an ... <strong>IF $L != ?</strong>", fieldSignatureInfo.fieldName) .addAnnotation(AnnotationSpec.builder(SuppressWarnings.class).addMember("value", "$S", "static-access").build())
.addParameter(fieldSignatureInfo.typeName, fieldSignatureInfo.fieldName, Modifier.FINAL) .addStatement("boundValues.add($N)", fieldSignatureInfo.fieldName) .addStatement("encodedValues.add(meta.$L.encodeFromJava($N))", fieldSignatureInfo.fieldName, fieldSignatureInfo.fieldName) .addStatement("where.onlyIf($T.$L($S, $T.bindMarker($S)))", QUERY_BUILDER, relation, fieldSignatureInfo.cqlColumn, QUERY_BUILDER, fieldSignatureInfo.cqlColumn) .addStatement("return $T.this", currentType) public MethodSpec buildLWTNotEqual(FieldSignatureInfo fieldSignatureInfo, TypeName currentType) { String methodName = "NotEq"; return MethodSpec.methodBuilder(methodName)
10,953
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
10,954
} @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);
10,955
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);
10,956
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(
10,957
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 {
10,958
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;
10,959
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) {
10,960
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;
10,961
import jetbrains.mps.project.structure.modules.ModuleReference; import jetbrains.mps.smodel.*; import jetbrains.mps.smodel.descriptor.EditableSModelDescriptor; import jetbrains.mps.smodel.persistence.PersistenceSettings; import jetbrains.mps.smodel.persistence.def.ModelPersistence; <BUG>import jetbrains.mps.vfs.IFile; import javax.swing.JOptionPane;</BUG> import java.awt.Frame; import java.util.ArrayList; import java.util.List;
import javax.swing.JFrame; import javax.swing.JOptionPane;
10,962
upgradePersistence(modelDescriptors, PersistenceSettings.MAX_VERSION); } }); } } <BUG>public void upgradePersistenceInProject(Project project, Frame mainFrame) { </BUG> MPSProject p = project.getComponent(MPSProject.class); upgradePersistenceInUnit(project.getComponent(ProjectScope.class), "Project " + p.getProjectFile().toString(), mainFrame); }
public void upgradePersistenceInProject(Project project, JFrame mainFrame) {
10,963
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() {
private static final int PERCENTAGE = 100; private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment .getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
10,964
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.lineBreak(); sink.section1_();
10,965
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 );
sink.tableCell( String.valueOf( cellWidth ) + "px" ); sink.text( version );
10,966
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( "15px" ); // according /images/icon_error_sml.gif iconError( sink );
10,967
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() ) ); sink.tableCell_();
sink.bold(); sink.bold_(); sink.tableCaption_(); sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.subprojects" ) ); sink.tableHeaderCell_();
10,968
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.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.dependencies" ) ); sink.tableHeaderCell_();
10,969
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.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.readyrelease" ) ); sink.tableHeaderCell_();
10,970
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
10,971
package icy.gui.component; <BUG>import icy.action.RoiActions; import icy.gui.component.IcyTextField.TextChangeListener;</BUG> import icy.gui.component.button.IcyButton; import icy.gui.component.renderer.ImageTableCellRenderer; import icy.gui.inspector.RoiSettingFrame;
import icy.gui.component.AbstractRoisPanel.ColumnInfo; import icy.gui.component.AbstractRoisPanel.DescriptorResult; import icy.gui.component.IcyTextField.TextChangeListener;
10,972
import icy.gui.component.renderer.ImageTableCellRenderer; import icy.gui.inspector.RoiSettingFrame; import icy.gui.main.ActiveSequenceListener; import icy.gui.util.GuiUtil; import icy.gui.util.LookAndFeelUtil; <BUG>import icy.math.MathUtil; import icy.plugin.interface_.PluginROIDescriptor;</BUG> import icy.preferences.XMLPreferences; import icy.roi.ROI; import icy.roi.ROIDescriptor;
import icy.plugin.PluginLoader; import icy.plugin.PluginLoader.PluginLoaderEvent; import icy.plugin.PluginLoader.PluginLoaderListener; import icy.plugin.interface_.PluginROIDescriptor;
10,973
import plugins.kernel.roi.descriptor.property.ROISizeTDescriptor; import plugins.kernel.roi.descriptor.property.ROISizeXDescriptor; import plugins.kernel.roi.descriptor.property.ROISizeYDescriptor; import plugins.kernel.roi.descriptor.property.ROISizeZDescriptor; public abstract class AbstractRoisPanel extends ExternalizablePanel implements ActiveSequenceListener, <BUG>TextChangeListener, ListSelectionListener </BUG> { protected static final long serialVersionUID = -2870878233087117178L; protected static final String ID_VIEW = "view";
TextChangeListener, ListSelectionListener, PluginLoaderListener
10,974
primaryDescriptorComputer.start(); basicDescriptorComputer.start(); advancedDescriptorComputer.start(); refreshDescriptorList(); buildActionMap(); <BUG>refreshRois(); }</BUG> protected void initialize() { nameFilter = new IcyTextField();
PluginLoader.addListener(this); }
10,975
if ((sequence != null) && (ch < getChannelCount())) return " (" + sequence.getChannelName(ch) + ")"; return ""; } protected ROIDescriptor getROIDescriptor(String descriptorId) <BUG>{ synchronized (descriptorMap) { for (ROIDescriptor descriptor : descriptorMap.keySet()) </BUG> if (descriptor.getId().equals(descriptorId))
final ROIDescriptor[] descriptors; descriptors = descriptorMap.keySet().toArray(new ROIDescriptor[descriptorMap.size()]); for (ROIDescriptor descriptor : descriptors)
10,976
if (!sequenceImporterPlugins.isEmpty()) { importPanel.addButtonGroup("Sequence importer"); for (PluginDescriptor plugin : sequenceImporterPlugins) { <BUG>final AbstractCommandButton button = PluginCommandButton.createButton(plugin, false, false); button.addActionListener(new ActionListener()</BUG> { @Override public void actionPerformed(ActionEvent event)
button.setHorizontalAlignment(SwingConstants.LEFT); button.addActionListener(new ActionListener()
10,977
if (!importerPlugins.isEmpty()) { importPanel.addButtonGroup("General importer"); for (PluginDescriptor plugin : importerPlugins) { <BUG>final AbstractCommandButton button = PluginCommandButton.createButton(plugin, false, false); button.addActionListener(new ActionListener()</BUG> { @Override public void actionPerformed(ActionEvent event)
button.setHorizontalAlignment(SwingConstants.LEFT); button.addActionListener(new ActionListener()
10,978
package icy.gui.inspector; import icy.gui.component.AbstractRoisPanel; <BUG>import icy.main.Icy; import icy.preferences.GeneralPreferences;</BUG> import icy.roi.ROI; import icy.roi.ROIEvent; import icy.sequence.Sequence;
import icy.plugin.PluginLoader.PluginLoaderEvent; import icy.preferences.GeneralPreferences;
10,979
ArticleDao articleDao = new ArticleDao(); PaginatedList<UserArticleDto> paginatedList = PaginatedLists.create(limit, offset); Map<String, Article> articleMap = null; articleMap = articleDao.search(paginatedList, searchQuery); if (articleMap.size() > 0) { <BUG>UserArticleCriteria userArticleCriteria = new UserArticleCriteria(); userArticleCriteria.setUserId(userId); userArticleCriteria.setVisible(false); userArticleCriteria.setArticleIdIn(Lists.newArrayList(articleMap.keySet())); UserArticleDao userArticleDao = new UserArticleDao();</BUG> PaginatedList<UserArticleDto> userArticledList = PaginatedLists.create(paginatedList.getLimit(), 0);
UserArticleCriteria userArticleCriteria = new UserArticleCriteria() .setUserId(userId) .setVisible(false) UserArticleDao userArticleDao = new UserArticleDao();
10,980
private String tag; private String message; public String getLevel() { return level; } <BUG>public void setLevel(String level) { this.level = StringUtils.lowerCase(level); }</BUG> public String getTag() {
public LogCriteria setLevel(String level) { return this;
10,981
this.level = StringUtils.lowerCase(level); }</BUG> public String getTag() { return tag; } <BUG>public void setTag(String tag) { this.tag = StringUtils.lowerCase(tag); }</BUG> public String getMessage() {
return this; public LogCriteria setTag(String tag) { return this;
10,982
category = categoryDao.getCategory(id, principal.getId()); } catch (NoResultException e) { throw new ClientException("CategoryNotFound", MessageFormat.format("Category not found: {0}", id)); } UserArticleDao userArticleDao = new UserArticleDao(); <BUG>UserArticleCriteria userArticleCriteria = new UserArticleCriteria(); userArticleCriteria.setUnread(unread); userArticleCriteria.setUserId(principal.getId()); userArticleCriteria.setSubscribed(true); userArticleCriteria.setVisible(true); if (category.getParentId() != null) {</BUG> userArticleCriteria.setCategoryId(id);
[DELETED]
10,983
log.info(MessageFormat.format("Importing outline {0}/{1}", i + j + 1, feedCount)); } Outline outline = categoryOutlineList.get(j); String feedTitle = !Strings.isNullOrEmpty(outline.getText()) ? outline.getText() : outline.getTitle(); String feedUrl = outline.getXmlUrl(); <BUG>FeedSubscriptionCriteria feedSubscriptionCriteria = new FeedSubscriptionCriteria(); feedSubscriptionCriteria.setUserId(user.getId()); feedSubscriptionCriteria.setFeedUrl(feedUrl); List<FeedSubscriptionDto> feedSubscriptionList = feedSubscriptionDao.findByCriteria(feedSubscriptionCriteria);</BUG> if (!feedSubscriptionList.isEmpty()) {
FeedSubscriptionCriteria feedSubscriptionCriteria = new FeedSubscriptionCriteria() .setUserId(user.getId()) List<FeedSubscriptionDto> feedSubscriptionList = feedSubscriptionDao.findByCriteria(feedSubscriptionCriteria);
10,984
if (StringUtils.isBlank(title) && StringUtils.isBlank(url)) { if (log.isInfoEnabled()) { log.info(MessageFormat.format("Cannot import starred article with an empty title and url for feed {0}", rssUrl)); } } <BUG>ArticleCriteria articleCriteria = new ArticleCriteria(); articleCriteria.setTitle(title); articleCriteria.setUrl(url); articleCriteria.setFeedId(feedFromDb.getId()); ArticleDao articleDao = new ArticleDao();</BUG> List<ArticleDto> currentArticleList = articleDao.findByCriteria(articleCriteria);
ArticleCriteria articleCriteria = new ArticleCriteria() .setTitle(title) .setUrl(url) ArticleDao articleDao = new ArticleDao();
10,985
articleDao.create(article); ArticleCreatedAsyncEvent articleCreatedAsyncEvent = new ArticleCreatedAsyncEvent(); articleCreatedAsyncEvent.setArticleList(Lists.newArrayList(article)); AppContext.getInstance().getAsyncEventBus().post(articleCreatedAsyncEvent); } <BUG>UserArticleCriteria userArticleCriteria = new UserArticleCriteria(); userArticleCriteria.setUserId(user.getId()); userArticleCriteria.setArticleId(article.getId()); UserArticleDao userArticleDao = new UserArticleDao();</BUG> List<UserArticleDto> userArticleList = userArticleDao.findByCriteria(userArticleCriteria);
UserArticleCriteria userArticleCriteria = new UserArticleCriteria() .setUserId(user.getId()) UserArticleDao userArticleDao = new UserArticleDao();
10,986
protected Scheduler scheduler() { return Scheduler.newFixedDelaySchedule(0, 10, TimeUnit.MINUTES); } public void synchronizeAllFeeds() { FeedDao feedDao = new FeedDao(); <BUG>FeedCriteria feedCriteria = new FeedCriteria(); feedCriteria.setWithUserSubscription(true); List<FeedDto> feedList = feedDao.findByCriteria(feedCriteria);</BUG> List<FeedSynchronization> feedSynchronizationList = new ArrayList<FeedSynchronization>(); for (FeedDto feed : feedList) {
FeedCriteria feedCriteria = new FeedCriteria() List<FeedDto> feedList = feedDao.findByCriteria(feedCriteria);
10,987
guidIn.add(article.getGuid()); } ArticleSanitizer sanitizer = new ArticleSanitizer(); ArticleDao articleDao = new ArticleDao(); if (!guidIn.isEmpty()) { <BUG>ArticleCriteria articleCriteria = new ArticleCriteria(); articleCriteria.setFeedId(feed.getId()); articleCriteria.setGuidIn(guidIn); List<ArticleDto> currentArticleDtoList = articleDao.findByCriteria(articleCriteria);</BUG> List<Article> articleUpdatedList = new ArrayList<Article>();
ArticleCriteria articleCriteria = new ArticleCriteria() .setFeedId(feed.getId()) List<ArticleDto> currentArticleDtoList = articleDao.findByCriteria(articleCriteria);
10,988
articleUpdatedAsyncEvent.setArticleList(articleUpdatedList); AppContext.getInstance().getAsyncEventBus().post(articleUpdatedAsyncEvent); } } if (!articleMap.isEmpty()) { <BUG>FeedSubscriptionCriteria feedSubscriptionCriteria = new FeedSubscriptionCriteria(); feedSubscriptionCriteria.setFeedId(feed.getId()); FeedSubscriptionDao feedSubscriptionDao = new FeedSubscriptionDao();</BUG> List<FeedSubscriptionDto> feedSubscriptionList = feedSubscriptionDao.findByCriteria(feedSubscriptionCriteria); UserArticleDao userArticleDao = new UserArticleDao();
FeedSubscriptionCriteria feedSubscriptionCriteria = new FeedSubscriptionCriteria() FeedSubscriptionDao feedSubscriptionDao = new FeedSubscriptionDao();
10,989
log.warn(MessageFormat.format("Error parsing HTML page at URL {0}", url)); } } } public void createInitialUserArticle(String userId, FeedSubscription feedSubscription) { <BUG>UserArticleCriteria userArticleCriteria = new UserArticleCriteria(); userArticleCriteria.setUserId(userId); userArticleCriteria.setSubscribed(true); userArticleCriteria.setFeedId(feedSubscription.getFeedId()); UserArticleDao userArticleDao = new UserArticleDao();</BUG> PaginatedList<UserArticleDto> paginatedList = PaginatedLists.create(); //TODO we could fetch as many articles as in the feed, not 10
UserArticleCriteria userArticleCriteria = new UserArticleCriteria() .setUserId(userId) .setSubscribed(true) UserArticleDao userArticleDao = new UserArticleDao();
10,990
Appender appender = logger.getAppender("MEMORY"); if (appender == null || !(appender instanceof MemoryAppender)) { throw new ServerException("ServerError", "MEMORY appender not configured"); } MemoryAppender memoryAppender = (MemoryAppender) appender; <BUG>LogCriteria logCriteria = new LogCriteria(); logCriteria.setLevel(StringUtils.stripToNull(level)); logCriteria.setTag(StringUtils.stripToNull(tag)); logCriteria.setMessage(StringUtils.stripToNull(message)); PaginatedList<LogEntry> paginatedList = PaginatedLists.create(limit, offset);</BUG> memoryAppender.find(logCriteria, paginatedList);
LogCriteria logCriteria = new LogCriteria() .setLevel(StringUtils.stripToNull(level)) .setTag(StringUtils.stripToNull(tag)) PaginatedList<LogEntry> paginatedList = PaginatedLists.create(limit, offset);
10,991
public Response list( @QueryParam("unread") boolean unread) throws JSONException { if (!authenticate()) { throw new ForbiddenClientException(); } <BUG>FeedSubscriptionCriteria feedSubscriptionCriteria = new FeedSubscriptionCriteria(); feedSubscriptionCriteria.setUserId(principal.getId()); feedSubscriptionCriteria.setUnread(unread); FeedSubscriptionDao feedSubscriptionDao = new FeedSubscriptionDao();</BUG> List<FeedSubscriptionDto> feedSubscriptionList = feedSubscriptionDao.findByCriteria(feedSubscriptionCriteria);
FeedSubscriptionCriteria feedSubscriptionCriteria = new FeedSubscriptionCriteria() .setUserId(principal.getId()) FeedSubscriptionDao feedSubscriptionDao = new FeedSubscriptionDao();
10,992
@QueryParam("limit") Integer limit, @QueryParam("after_article") String afterArticle) throws JSONException { if (!authenticate()) { throw new ForbiddenClientException(); } <BUG>FeedSubscriptionCriteria feedSubscriptionCriteria = new FeedSubscriptionCriteria(); feedSubscriptionCriteria.setId(id); feedSubscriptionCriteria.setUserId(principal.getId()); FeedSubscriptionDao feedSubscriptionDao = new FeedSubscriptionDao();</BUG> List<FeedSubscriptionDto> feedSubscriptionList = feedSubscriptionDao.findByCriteria(feedSubscriptionCriteria);
FeedSubscriptionCriteria feedSubscriptionCriteria = new FeedSubscriptionCriteria() .setId(id) FeedSubscriptionDao feedSubscriptionDao = new FeedSubscriptionDao();
10,993
public Response getSynchronization( @PathParam("id") String id) throws JSONException { if (!authenticate()) { throw new ForbiddenClientException(); } <BUG>FeedSubscriptionCriteria feedSubscriptionCriteria = new FeedSubscriptionCriteria(); feedSubscriptionCriteria.setId(id); feedSubscriptionCriteria.setUserId(principal.getId()); FeedSubscriptionDao feedSubscriptionDao = new FeedSubscriptionDao();</BUG> List<FeedSubscriptionDto> feedSubscriptionList = feedSubscriptionDao.findByCriteria(feedSubscriptionCriteria);
FeedSubscriptionCriteria feedSubscriptionCriteria = new FeedSubscriptionCriteria() .setId(id) FeedSubscriptionDao feedSubscriptionDao = new FeedSubscriptionDao();
10,994
try { feed = feedService.synchronize(url); } catch (Exception e) { throw new ServerException("FeedError", MessageFormat.format("Error retrieving feed at {0}", url), e); } <BUG>feedSubscriptionCriteria = new FeedSubscriptionCriteria(); feedSubscriptionCriteria.setUserId(principal.getId()); feedSubscriptionCriteria.setFeedUrl(feed.getRssUrl()); feedSubscriptionList = feedSubscriptionDao.findByCriteria(feedSubscriptionCriteria);</BUG> if (!feedSubscriptionList.isEmpty()) {
feedSubscriptionCriteria = new FeedSubscriptionCriteria() .setUserId(principal.getId()) feedSubscriptionList = feedSubscriptionDao.findByCriteria(feedSubscriptionCriteria);
10,995
Element titleElement = opmlDocument.createElement("title"); titleElement.setTextContent(MessageUtil.getMessage(principal.getLocale(), "reader.export.title", principal.getName())); headElement.appendChild(titleElement); Element bodyElement = opmlDocument.createElement("body"); opmlElement.appendChild(bodyElement); <BUG>FeedSubscriptionCriteria feedSubscriptionCriteria = new FeedSubscriptionCriteria(); feedSubscriptionCriteria.setUserId(principal.getId()); FeedSubscriptionDao feedSubscriptionDao = new FeedSubscriptionDao();</BUG> List<FeedSubscriptionDto> feedSubscriptionList = feedSubscriptionDao.findByCriteria(feedSubscriptionCriteria); String oldCategoryId = null;
FeedSubscriptionCriteria feedSubscriptionCriteria = new FeedSubscriptionCriteria() FeedSubscriptionDao feedSubscriptionDao = new FeedSubscriptionDao();
10,996
import mage.constants.SetTargetPointer; import mage.constants.SubLayer; import mage.constants.TargetController; import mage.filter.common.FilterCreatureCard; import mage.game.Game; <BUG>import mage.game.permanent.Permanent; public class LazavDimirMastermind extends CardImpl {</BUG> public LazavDimirMastermind(UUID ownerId) { super(ownerId, 174, "Lazav, Dimir Mastermind", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{U}{U}{B}{B}"); this.expansionSetCode = "GTC";
import mage.target.targetpointer.FixedTarget; public class LazavDimirMastermind extends CardImpl {
10,997
public LazavDimirEffect copy() { return new LazavDimirEffect(this); } @Override public boolean apply(Game game, Ability source) { <BUG>Card card = game.getCard(getTargetPointer().getFirst(game, source)); </BUG> Permanent permanent = game.getPermanent(source.getSourceId()); if (card == null || permanent == null) { discard();
Card card = game.getCard(((FixedTarget)getTargetPointer()).getTarget());
10,998
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.List; <BUG>import java.util.Optional; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class CommandDelete extends FCCommandBase { private static final FlagMapper MAPPER = map -> key -> value -> { map.put(key, value);
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
10,999
.append(Text.of(TextColors.GREEN, "Usage: ")) .append(getUsage(source)) .build()); return CommandResult.empty(); } else if (isIn(REGIONS_ALIASES, parse.args[0])) { <BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); IRegion region = FGManager.getInstance().getRegion(parse.args[1]); </BUG> boolean isWorldRegion = false; if (region == null) {
String regionName = parse.args[1]; IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
11,000
</BUG> isWorldRegion = true; } if (region == null) <BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!")); if (region instanceof GlobalWorldRegion) { </BUG> throw new CommandException(Text.of("You may not delete the global region!")); }
if (world == null) throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!")); if (world == null) throw new CommandException(Text.of("Must specify a world!")); region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null); throw new CommandException(Text.of("No region exists with the name \"" + regionName + "\"!")); if (region instanceof IGlobal) {