id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
12,301 | <BUG>package net.i2p.desktopgui;
import java.awt.MenuItem;</BUG>
import java.awt.PopupMenu;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
| import java.awt.Desktop;
import java.awt.Desktop.Action;
import java.awt.MenuItem;
|
12,302 | super(ctx, main, useSwing);
_context = ctx;
log = ctx.logManager().getLog(InternalTrayManager.class);
}
public PopupMenu getMainMenu() {
<BUG>PopupMenu popup = new PopupMenu();
MenuItem browserLauncher = new MenuItem(_t("Launch I2P Browser"));
browserLauncher.addActionListener(new ActionListener() {</BUG>
@Override
public void actionPerformed(ActionEvent arg0) {
| MenuItem browserLauncher;
if (CONSOLE_ENABLED) {
browserLauncher.addActionListener(new ActionListener() {
|
12,303 | @Override
protected Object doInBackground() throws Exception {
return null;
}
@Override
<BUG>protected void done() {
try {
I2PDesktop.browse("http://localhost:7657");
} catch (BrowseException e1) {
log.log(Log.WARN, "Failed to open browser!", e1);</BUG>
}
| public void actionPerformed(ActionEvent arg0) {
new SwingWorker<Object, Object>() {
|
12,304 | RouterManager.cancelShutdown(_context);
return null;
}
}.execute();
}
<BUG>});
popup.add(browserLauncher);
popup.addSeparator();
desktopguiConfigurationLauncher.add(configSubmenu);</BUG>
popup.add(desktopguiConfigurationLauncher);
| if (CONSOLE_ENABLED) {
|
12,305 | _stopItem = stopItem;
_cancelItem = cancelItem;
return popup;
}
public JPopupMenu getSwingMainMenu() {
<BUG>JPopupMenu popup = new JPopupMenu();
JMenuItem browserLauncher = new JMenuItem(_t("Launch I2P Browser"));
browserLauncher.addActionListener(new ActionListener() {</BUG>
@Override
public void actionPerformed(ActionEvent arg0) {
| JMenuItem browserLauncher;
if (CONSOLE_ENABLED) {
browserLauncher.addActionListener(new ActionListener() {
|
12,306 | @Override
protected Object doInBackground() throws Exception {
return null;
}
@Override
<BUG>protected void done() {
try {
I2PDesktop.browse("http://localhost:7657");
} catch (BrowseException e1) {
log.log(Log.WARN, "Failed to open browser!", e1);</BUG>
}
| public void actionPerformed(ActionEvent arg0) {
new SwingWorker<Object, Object>() {
|
12,307 | RouterManager.cancelShutdown(_context);
return null;
}
}.execute();
}
<BUG>});
popup.add(browserLauncher);
popup.addSeparator();
desktopguiConfigurationLauncher.add(configSubmenu);</BUG>
popup.add(desktopguiConfigurationLauncher);
| if (CONSOLE_ENABLED) {
|
12,308 | package com.google.common.collect;
import static com.google.common.collect.BoundType.OPEN;
import static com.google.common.collect.Range.range;
import static com.google.common.truth.Truth.assertThat;
import com.google.common.annotations.GwtIncompatible;
<BUG>import com.google.common.testing.SerializableTester;
import java.util.List;</BUG>
import java.util.NavigableMap;
@GwtIncompatible // TreeRangeSet
public class TreeRangeSetTest extends AbstractRangeSetTest {
| import java.util.Arrays;
import java.util.List;
|
12,309 | expectEnclose = true;
break;
}
}
assertEquals(rangeSet + " was incorrect on encloses(" + query + ")", expectEnclose,
<BUG>rangeSet.encloses(query));
}</BUG>
}
public void testAllSingleRangesComplementAgainstRemove() {
for (Range<Integer> range : QUERY_RANGES) {
| assertEquals(
rangeSet + " was incorrect on enclosesAll([" + query + "])",
rangeSet.enclosesAll(ImmutableList.of(query)));
|
12,310 | assertTrue(rangeSet.contains(5));
assertEquals(Range.closed(7, 10), rangeSet.rangeContaining(8));
assertTrue(rangeSet.contains(8));
assertNull(rangeSet.rangeContaining(6));
assertFalse(rangeSet.contains(6));
<BUG>}
@GwtIncompatible // SerializableTester</BUG>
public void testSerialization() {
RangeSet<Integer> rangeSet = TreeRangeSet.create();
rangeSet.add(Range.closed(3, 10));
| assertNull(rangeSet.rangeContaining(1));
assertFalse(rangeSet.contains(1));
public void testRangeContaining2() {
|
12,311 | Range.atLeast(3),
Range.closed(4, 6),
Range.closedOpen(1, 3),
Range.openClosed(5, 7),
Range.open(3, 4));
<BUG>for (Set<Range<Integer>> subset : Sets.powerSet(ranges)) {
RangeSet<Integer> mutable = TreeRangeSet.create();
ImmutableRangeSet.Builder<Integer> builder = ImmutableRangeSet.builder();
for (Range<Integer> range : subset) {</BUG>
boolean overlaps = false;
| assertEquals(TreeRangeSet.create(subset), ImmutableRangeSet.unionOf(subset));
boolean anyOverlaps = false;
for (Range<Integer> range : subset) {
|
12,312 | ImmutableRangeSet.Builder<Integer> builder = ImmutableRangeSet.builder();
for (Range<Integer> range : subset) {</BUG>
boolean overlaps = false;
for (Range<Integer> other : mutable.asRanges()) {
if (other.isConnected(range) && !other.intersection(range).isEmpty()) {
<BUG>overlaps = true;
}</BUG>
}
try {
builder.add(range);
| boolean anyOverlaps = false;
for (Range<Integer> range : subset) {
anyOverlaps = true;
break;
|
12,313 | public interface RangeSet<C extends Comparable> {
boolean contains(C value);
Range<C> rangeContaining(C value);
boolean intersects(Range<C> otherRange);
boolean encloses(Range<C> otherRange);
<BUG>boolean enclosesAll(RangeSet<C> other);
boolean isEmpty();</BUG>
Range<C> span();
Set<Range<C>> asRanges();
Set<Range<C>> asDescendingSetOfRanges();
| boolean enclosesAll(Iterable<Range<C>> other);
boolean isEmpty();
|
12,314 | RangeSet<C> complement();
RangeSet<C> subRangeSet(Range<C> view);
void add(Range<C> range);
void remove(Range<C> range);
void clear();
<BUG>void addAll(RangeSet<C> other);
void removeAll(RangeSet<C> other);
@Override</BUG>
boolean equals(@Nullable Object obj);
@Override
| void addAll(Iterable<Range<C>> ranges);
void removeAll(Iterable<Range<C>> ranges);
|
12,315 | @Override
public void clear() {
remove(Range.<C>all());
}
@Override
<BUG>public boolean enclosesAll(RangeSet<C> other) {
for (Range<C> range : other.asRanges()) {
if (!encloses(range)) {</BUG>
return false;
}
| public boolean contains(C value) {
return rangeContaining(value) != null;
|
12,316 | for (Range<C> range : other.asRanges()) {
add(range);</BUG>
}
}
@Override
<BUG>public void removeAll(RangeSet<C> other) {
for (Range<C> range : other.asRanges()) {
remove(range);</BUG>
}
}
| public abstract Range<C> rangeContaining(C value);
public boolean isEmpty() {
return asRanges().isEmpty();
|
12,317 | import net.openhft.chronicle.hash.serialization.*;
import net.openhft.chronicle.hash.serialization.impl.SerializationBuilder;
import net.openhft.chronicle.map.replication.MapRemoteOperations;
import net.openhft.chronicle.set.ChronicleSetBuilder;
import net.openhft.chronicle.threads.NamedThreadFactory;
<BUG>import net.openhft.chronicle.values.ValueModel;
import net.openhft.chronicle.wire.TextWire;</BUG>
import net.openhft.chronicle.wire.Wire;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
| import net.openhft.chronicle.values.Values;
import net.openhft.chronicle.wire.TextWire;
|
12,318 | configureByDefault(tClass);
sizeIsStaticallyKnown = constantSizeMarshaller();
}
@SuppressWarnings("unchecked")
private void configureByDefault(Class<T> tClass) {
<BUG>if (tClass.isInterface()) {
try {</BUG>
ValueModel valueModel = ValueModel.acquire(tClass);
reader((BytesReader<T>) new ValueReader<>(tClass));
dataAccess(new ValueDataAccess<>(tClass));
| if (tClass.isInterface() && Values.isValueInterfaceOrImplClass(tClass)) {
try {
|
12,319 | DESC {
@Override
public String toString() {
return "desc";
}
<BUG>};
private static final SortOrder PROTOTYPE = ASC;
</BUG>
@Override
public SortOrder readFrom(StreamInput in) throws IOException {
| public static final SortOrder DEFAULT = DESC;
private static final SortOrder PROTOTYPE = DEFAULT;
|
12,320 | 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 = GeoDistanceSortBuilder.DEFAULT_COERCE;
boolean ignoreMalformed = GeoDistanceSortBuilder.DEFAULT_IGNORE_MALFORMED;
XContentParser.Token token;</BUG>
String currentName = parser.currentName();
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
| boolean coerce = false;
boolean ignoreMalformed = false;
XContentParser.Token token;
|
12,321 | 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>GeoDistanceSortBuilder.parseGeoPoints(parser, geoPoints);
fieldName = currentName;</BUG>
} else if (token == XContentParser.Token.START_OBJECT) {
if ("nested_filter".equals(currentName) || "nestedFilter".equals(currentName)) {
if (nestedHelper == null) {
| fieldName = currentName;
|
12,322 | if (temp == MultiValueMode.SUM) {
throw new IllegalArgumentException("sort_mode [sum] isn't supported for sorting by geo distance");
}</BUG>
this.sortMode = sortMode;
return this;
<BUG>}
public String sortMode() {
return this.sortMode;</BUG>
}
public GeoDistanceSortBuilder setNestedFilter(QueryBuilder nestedFilter) {
| @Override
public GeoDistanceSortBuilder order(SortOrder order) {
this.order = order;
@Override
public SortBuilder missing(Object missing) {
public GeoDistanceSortBuilder sortMode(String sortMode) {
|
12,323 | builder.field("unit", unit);
builder.field("distance_type", geoDistance.name().toLowerCase(Locale.ROOT));
if (order == SortOrder.DESC) {</BUG>
builder.field("reverse", true);
<BUG>} else {
builder.field("reverse", false);</BUG>
}
if (sortMode != null) {
builder.field("mode", sortMode);
}
| if (geoDistance != null) {
if (order == SortOrder.DESC) {
|
12,324 | import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
<BUG>public class OpenInvEntityListener implements Listener{
OpenInv plugin;
public OpenInvEntityListener(OpenInv scrap) {
plugin = scrap;</BUG>
}
| public class OpenInvEntityListener implements Listener
public OpenInvEntityListener(OpenInv scrap)
plugin = scrap;
|
12,325 | package lishid.openinv;
import lishid.openinv.commands.*;
<BUG>import lishid.openinv.utils.Metrics;
import org.bukkit.ChatColor;</BUG>
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginManager;
| import java.util.HashMap;
import lishid.openinv.utils.OpenInvPlayerInventory;
import org.bukkit.ChatColor;
|
12,326 | mainPlugin.getConfig().set("AnyChest." + name.toLowerCase() + ".toggle", status);
mainPlugin.saveConfig();
}
public static int GetItemOpenInvItem()
{
<BUG>if(mainPlugin.getConfig().get("ItemOpenInvItemID") == null)
</BUG>
{
SaveToConfig("ItemOpenInvItemID", 280);
}
| if (mainPlugin.getConfig().get("ItemOpenInvItemID") == null)
|
12,327 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
12,328 | }
@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);
|
12,329 | 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);
|
12,330 | 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(
|
12,331 | 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 {
|
12,332 | 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;
|
12,333 | 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) {
|
12,334 | 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;
|
12,335 | package fi.dy.masa.enderutilities.config;
<BUG>import java.io.File;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.common.config.Configuration;</BUG>
import net.minecraftforge.common.config.Property;
import net.minecraftforge.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
| import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.Configuration;
|
12,336 | public static boolean buildersWandUseTranslucentGhostBlocks;
public static int buildersWandBlocksPerTick;
public static int buildersWandReplaceBlocksPerTick;
public static float buildersWandGhostBlockAlpha;
public static float buildersWandMaxBlockHardness;
<BUG>public static int enderBucketCapacity;
public static int harvestLevelEnderAlloyAdvanced;
public static int portalFrameCheckLimit;
public static int portalLoopCheckLimit;
public static int portalAreaCheckLimit;
public static boolean useEnderCharge;</BUG>
public static boolean enderBowAllowPlayers;
| [DELETED] |
12,337 | public static int portalAreaCheckLimit;
public static boolean useEnderCharge;</BUG>
public static boolean enderBowAllowPlayers;
public static boolean enderBowAllowSelfTP;
public static boolean enderLassoAllowPlayers;
<BUG>public static String enderBagListType;
</BUG>
public static String[] enderBagBlacklist;
public static String[] enderBagWhitelist;
public static String[] teleportBlacklist;
| public static boolean buildersWandUseTranslucentGhostBlocks;
public static int buildersWandBlocksPerTick;
public static int buildersWandReplaceBlocksPerTick;
public static float buildersWandGhostBlockAlpha;
public static float buildersWandMaxBlockHardness;
public static boolean enderBagListTypeIsWhitelist;
|
12,338 | @EventHandler
public void preInit(FMLPreInitializationEvent event)
{
instance = this;
logger = event.getModLog();
<BUG>ConfigReader.loadConfigsAll(event.getSuggestedConfigurationFile());
EnderUtilitiesItems.init(); // Initialize and register mod items and item recipes</BUG>
EnderUtilitiesBlocks.init(); // Initialize and register mod blocks and block recipes
PacketHandler.init(); // Initialize network stuff
| ConfigReader.loadConfigsFromFile(event.getSuggestedConfigurationFile());
ModRegistry.checkLoadedMods();
EnderUtilitiesItems.init(); // Initialize and register mod items and item recipes
|
12,339 | public void init(FMLInitializationEvent event)
{
proxy.registerColorHandlers();
}
@EventHandler
<BUG>public void postInit(FMLPostInitializationEvent event)
{
Registry.registerEnderbagLists();
Registry.registerTeleportBlacklist();
ModRegistry.checkLoadedMods();
}
@EventHandler</BUG>
public void onServerStartingEvent(FMLServerStartingEvent event)
| [DELETED] |
12,340 | ModRegistry.checkLoadedMods();
}
@EventHandler</BUG>
public void onServerStartingEvent(FMLServerStartingEvent event)
<BUG>{
ChunkLoading.getInstance().init();</BUG>
EnergyBridgeTracker.readFromDisk();
}
@EventHandler
public void onMissingMappingEvent(FMLMissingMappingsEvent event)
| public void init(FMLInitializationEvent event)
proxy.registerColorHandlers();
ConfigReader.reLoadAllConfigs(true);
ChunkLoading.getInstance().init();
|
12,341 | package fi.dy.masa.enderutilities.config;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.GuiScreen;
<BUG>import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.fml.client.config.GuiConfig;</BUG>
import net.minecraftforge.fml.client.config.IConfigElement;
import fi.dy.masa.enderutilities.reference.Reference;
public class EnderUtilitiesConfigGui extends GuiConfig
| import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.client.config.GuiConfig;
|
12,342 | import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
<BUG>import fi.dy.masa.enderutilities.config.Configs;
import fi.dy.masa.enderutilities.item.base.IChunkLoadingItem;</BUG>
import fi.dy.masa.enderutilities.item.base.IKeyBound;
import fi.dy.masa.enderutilities.item.base.IModule;
import fi.dy.masa.enderutilities.item.base.ItemLocationBoundModular;
| import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;
import fi.dy.masa.enderutilities.item.base.IChunkLoadingItem;
|
12,343 | </BUG>
import fi.dy.masa.enderutilities.util.nbt.OwnerData;
import fi.dy.masa.enderutilities.util.nbt.TargetData;
import fi.dy.masa.enderutilities.util.nbt.UtilItemModular;
<BUG>import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;</BUG>
public class ItemEnderBag extends ItemLocationBoundModular implements IChunkLoadingItem, IKeyBound
{
| import fi.dy.masa.enderutilities.item.base.ItemModule.ModuleType;
import fi.dy.masa.enderutilities.item.part.ItemEnderCapacitor;
import fi.dy.masa.enderutilities.item.part.ItemLinkCrystal;
import fi.dy.masa.enderutilities.reference.Reference;
import fi.dy.masa.enderutilities.reference.ReferenceNames;
import fi.dy.masa.enderutilities.registry.BlackLists;
|
12,344 | import org.apache.commons.lang3.math.NumberUtils;
import org.json.JSONException;
import org.mariotaku.microblog.library.MicroBlog;
import org.mariotaku.microblog.library.MicroBlogException;
import org.mariotaku.microblog.library.twitter.model.RateLimitStatus;
<BUG>import org.mariotaku.microblog.library.twitter.model.Status;
import org.mariotaku.sqliteqb.library.AllColumns;</BUG>
import org.mariotaku.sqliteqb.library.Columns;
import org.mariotaku.sqliteqb.library.Columns.Column;
import org.mariotaku.sqliteqb.library.Expression;
| import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
|
12,345 | context.getApplicationContext().sendBroadcast(intent);
}
}
@Nullable
public static Location getCachedLocation(Context context) {
<BUG>if (BuildConfig.DEBUG) {
Log.v(LOGTAG, "Fetching cached location", new Exception());
}</BUG>
Location location = null;
| DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
|
12,346 | 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);
|
12,347 | 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);
|
12,348 | 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);
|
12,349 | 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;
|
12,350 | 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);
|
12,351 | 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);
|
12,352 | 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;
|
12,353 | }
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);
|
12,354 | 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);
|
12,355 | @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);
|
12,356 | 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);
|
12,357 | package org.apache.cxf.rt.security.saml.xacml;
import java.security.Principal;
import java.util.List;
import org.apache.cxf.message.Message;
import org.opensaml.xacml.ctx.RequestType;
<BUG>@Deprecated</BUG>
public interface XACMLRequestBuilder {
RequestType createRequest(Principal principal, List<String> roles, Message message) throws Exception;
@Deprecated
List<String> getResources(Message message);
@Deprecated
String getResource(Message message);
}
| [DELETED] |
12,358 | <BUG>package cn.nukkit.level.generator.biome;
import cn.nukkit.level.generator.noise.Simplex;</BUG>
import cn.nukkit.math.NukkitRandom;
import java.util.HashMap;
import java.util.Map;
| import cn.nukkit.level.generator.Normal;
import cn.nukkit.level.generator.biome.Biome;
import cn.nukkit.level.generator.noise.Simplex;
|
12,359 | package cn.nukkit.level.generator;
import cn.nukkit.block.*;
import cn.nukkit.level.ChunkManager;
<BUG>import cn.nukkit.level.format.FullChunk;
import cn.nukkit.level.generator.biome.Biome;</BUG>
import cn.nukkit.level.generator.biome.BiomeSelector;
import cn.nukkit.level.generator.noise.Simplex;
import cn.nukkit.level.generator.object.ore.OreType;
| import cn.nukkit.level.generator.Generator;
import cn.nukkit.level.generator.biome.Biome;
|
12,360 | private Simplex noiseMountains;
private Simplex noiseBaseGround;
private Simplex noiseRiver;
private BiomeSelector selector;
private int heightOffset;
<BUG>private final int seaHeight = 62;
</BUG>
private final int seaFloorHeight = 48;
private final int beathStartHeight = 60;
private final int beathStopHeight = 64;
| private final int seaHeight = 64;
|
12,361 | private final int seaFloorHeight = 48;
private final int beathStartHeight = 60;
private final int beathStopHeight = 64;
private final int bedrockDepth = 5;
private final int seaFloorGenerateRange = 5;
<BUG>private final int landHeightRange = 18; // 36 / 2
private final int mountainHeight = 13; // 26 / 2
private final int basegroundHeight = 3;
public Normal() {</BUG>
this(new HashMap<>());
| private final int landHeightRange = 18;
private final int mountainHeight = 13;
private int waterColor = 16777215;
protected float rainfall = 0.5F;
protected float temperature = 0.5F;
protected int grassColor = 0;
public Normal() {
|
12,362 | public class SwampBiome extends GrassyBiome {
public SwampBiome() {
super();
PopulatorLilyPad lilypad = new PopulatorLilyPad();
lilypad.setBaseAmount(4);
<BUG>PopulatorTree trees = new PopulatorTree(BlockSapling.OAK);
trees.setBaseAmount(2);</BUG>
PopulatorFlower flower = new PopulatorFlower();
flower.setBaseAmount(2);
flower.addType(Block.RED_FLOWER, BlockFlower.TYPE_BLUE_ORCHID);
| SwampTreePopulator trees = new SwampTreePopulator();
trees.setBaseAmount(2);
|
12,363 | import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.reset;
import static org.easymock.EasyMock.verify;
import static org.easymock.EasyMock.anyObject;
import static org.easymock.EasyMock.anyString;
<BUG>import static org.easymock.EasyMock.capture;
import static org.junit.Assert.assertTrue;</BUG>
public class UpgradeCatalog221Test {
private Injector injector;
private Provider<EntityManager> entityManagerProvider = createStrictMock(Provider.class);
| import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
|
12,364 | newPropertiesAmsHbaseSite.put("zookeeper.znode.parent", "/ams-hbase-secure");
testAmsHbaseSiteUpdates(new HashMap<String, String>(),
newPropertiesAmsHbaseSite,
amsHbaseSecuritySite,
clusterEnvProperties);
<BUG>clusterEnvProperties.put("security_enabled","false");
</BUG>
amsHbaseSecuritySite.put("zookeeper.znode.parent", "");
newPropertiesAmsHbaseSite.put("zookeeper.znode.parent", "/ams-hbase-unsecure");
testAmsHbaseSiteUpdates(new HashMap<String, String>(),
| clusterEnvProperties.put("security_enabled", "false");
|
12,365 | newPropertiesAmsHbaseSite.put("zookeeper.znode.parent", "/ams-hbase-unsecure");
testAmsHbaseSiteUpdates(new HashMap<String, String>(),
newPropertiesAmsHbaseSite,
amsHbaseSecuritySite,
clusterEnvProperties);
<BUG>clusterEnvProperties.put("security_enabled","true");
</BUG>
amsHbaseSecuritySite.put("zookeeper.znode.parent", "/hbase");
newPropertiesAmsHbaseSite.put("zookeeper.znode.parent", "/ams-hbase-secure");
testAmsHbaseSiteUpdates(new HashMap<String, String>(),
| clusterEnvProperties.put("security_enabled", "true");
|
12,366 | expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(),
anyObject(Map.class))).andReturn(createNiceMock(Config.class)).anyTimes();
replay(controller, injector2);
new UpgradeCatalog221(injector2).updateAMSConfigs();
easyMockSupport.verifyAll();
<BUG>Map<String, String> updatedProperties = propertiesCapture.getValue();
assertTrue(Maps.difference(newPropertiesAmsHbaseSite, updatedProperties).areEqual());</BUG>
}
@Test
public void testUpdateAmsHbaseSecuritySiteConfigs() throws Exception{
| String tickTime = updatedProperties.remove("hbase.zookeeper.property.tickTime");
assertEquals("6000", tickTime);
assertTrue(Maps.difference(newPropertiesAmsHbaseSite, updatedProperties).areEqual());
|
12,367 | 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() {
|
12,368 | public ReportElement getBase() {
return base;
}
@Override
public float print(PDDocument document, PDPageContentStream stream, int pageNumber, float startX, float startY, float allowedWidth) throws IOException {
<BUG>PDPage currPage = (PDPage) document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, true, false);
</BUG>
base.print(document, pageStream, pageNo, x, y, width);
pageStream.close();
| PDPage currPage = document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, PDPageContentStream.AppendMode.APPEND, false);
|
12,369 | public PdfTextStyle(String config) {
Assert.hasText(config);
String[] split = config.split(",");
Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000");
fontSize = Integer.parseInt(split[0]);
<BUG>font = resolveStandard14Name(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));</BUG>
}
public int getFontSize() {
return fontSize;
| font = getFont(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));
|
12,370 | package cc.catalysts.boot.report.pdf.elements;
import cc.catalysts.boot.report.pdf.config.PdfTextStyle;
import cc.catalysts.boot.report.pdf.utils.ReportAlignType;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
<BUG>import org.apache.pdfbox.pdmodel.font.PDFont;
import org.slf4j.Logger;</BUG>
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
import java.io.IOException;
| import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.apache.pdfbox.util.Matrix;
import org.slf4j.Logger;
|
12,371 | addTextSimple(stream, textConfig, textX, nextLineY, "");
return nextLineY;
}
try {
<BUG>String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, fixedText);
</BUG>
float x = calculateAlignPosition(textX, align, textConfig, allowedWidth, split[0]);
if (!underline) {
addTextSimple(stream, textConfig, x, nextLineY, split[0]);
} else {
| String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, text);
|
12,372 | public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
try {
stream.setFont(textConfig.getFont(), textConfig.getFontSize());
stream.setNonStrokingColor(textConfig.getColor());
stream.beginText();
<BUG>stream.newLineAtOffset(textX, textY);
stream.showText(text);</BUG>
} catch (Exception e) {
LOG.warn("Could not add text: " + e.getClass() + " - " + e.getMessage());
}
| stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY));
stream.showText(text);
|
12,373 | public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
addTextSimple(stream, textConfig, textX, textY, text);
try {
float lineOffset = textConfig.getFontSize() / 8F;
stream.setStrokingColor(textConfig.getColor());
<BUG>stream.setLineWidth(0.5F);
stream.drawLine(textX, textY - lineOffset, textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
</BUG>
stream.stroke();
} catch (IOException e) {
| stream.moveTo(textX, textY - lineOffset);
stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
|
12,374 | list.add(text.length());
return list;
}
public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) {
String endPart = "";
<BUG>String shortenedText = text;
List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {</BUG>
String[] splittedFirst = splitText(font, fontSize, allowedWidth, breakSplitted.get(0));
StringBuilder remaining = new StringBuilder(splittedFirst[1] == null ? "" : splittedFirst[1] + "\n");
| List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {
|
12,375 | package cc.catalysts.boot.report.pdf.elements;
import org.apache.pdfbox.pdmodel.PDDocument;
<BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
import java.io.IOException;</BUG>
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
| import org.apache.pdfbox.pdmodel.PDPageContentStream;
import java.io.IOException;
|
12,376 | if (connect(isProducer)) {
break;
}
} catch (InvalidSelectorException e) {
throw new ConnectionException(
<BUG>"Connection to JMS failed. Invalid message selector");
} catch (JMSException | NamingException e) {
logger.log(LogLevel.ERROR, "RECONNECTION_EXCEPTION",
</BUG>
new Object[] { e.toString() });
| Messages.getString("CONNECTION_TO_JMS_FAILED_INVALID_MSG_SELECTOR")); //$NON-NLS-1$
logger.log(LogLevel.ERROR, "RECONNECTION_EXCEPTION", //$NON-NLS-1$
|
12,377 | private synchronized void createConnectionNoRetry() throws ConnectionException {
if (!isConnectValid()) {
try {
connect(isProducer);
} catch (JMSException e) {
<BUG>logger.log(LogLevel.ERROR, "Connection to JMS failed", new Object[] { e.toString() });
throw new ConnectionException(
"Connection to JMS failed. Did not try to reconnect as the policy is reconnection policy does not apply here.");
}</BUG>
}
| logger.log(LogLevel.ERROR, "CONNECTION_TO_JMS_FAILED", new Object[] { e.toString() }); //$NON-NLS-1$
Messages.getString("CONNECTION_TO_JMS_FAILED_NO_RECONNECT_AS_RECONNECT_POLICY_DOES_NOT_APPLY")); //$NON-NLS-1$
|
12,378 | boolean res = false;
int count = 0;
do {
try {
if(count > 0) {
<BUG>logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count });
</BUG>
Thread.sleep(messageRetryDelay);
}
synchronized (getSession()) {
| logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count }); //$NON-NLS-1$
|
12,379 | getProducer().send(message);
res = true;
}
}
catch (JMSException e) {
<BUG>logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() });
logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT");
</BUG>
setConnect(null);
| logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() }); //$NON-NLS-1$
logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT"); //$NON-NLS-1$
|
12,380 | import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import com.ibm.streams.operator.Attribute;
import com.ibm.streams.operator.StreamSchema;
import com.ibm.streams.operator.Type;
<BUG>import com.ibm.streams.operator.Type.MetaType;
class ConnectionDocumentParser {</BUG>
private static final Set<String> supportedSPLTypes = new HashSet<String>(Arrays.asList("int8", "uint8", "int16", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"uint16", "int32", "uint32", "int64", "float32", "float64", "boolean", "blob", "rstring", "uint64", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
"decimal32", "decimal64", "decimal128", "ustring", "timestamp", "xml")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
| import com.ibm.streamsx.messaging.jms.Messages;
class ConnectionDocumentParser {
|
12,381 | return msgClass;
}
private void convertProviderURLPath(File applicationDir) throws ParseConnectionDocumentException {
if(!isAMQ()) {
if(this.providerURL == null || this.providerURL.trim().length() == 0) {
<BUG>throw new ParseConnectionDocumentException("A value must be specified for provider_url attribute in connection document");
}</BUG>
try {
URL url = new URL(providerURL);
if("file".equalsIgnoreCase(url.getProtocol())) { //$NON-NLS-1$
| throw new ParseConnectionDocumentException(Messages.getString("PROVIDER_URL_MUST_BE_SPECIFIED_IN_CONN_DOC")); //$NON-NLS-1$
|
12,382 | URL absProviderURL = new URL(url.getProtocol(), url.getHost(), applicationDir.getAbsolutePath() + File.separator + path);
this.providerURL = absProviderURL.toExternalForm();
}
}
} catch (MalformedURLException e) {
<BUG>throw new ParseConnectionDocumentException("Invalid provider_url value detected: " + e.getMessage());
}</BUG>
}
}
public void parseAndValidateConnectionDocument(String connectionDocument, String connection, String access,
| throw new ParseConnectionDocumentException(Messages.getString("INVALID_PROVIDER_URL", e.getMessage())); //$NON-NLS-1$
|
12,383 | for (int j = 0; j < accessSpecChildNodes.getLength(); j++) {
if (accessSpecChildNodes.item(j).getNodeName().equals("destination")) { //$NON-NLS-1$
destIndex = j;
} else if (accessSpecChildNodes.item(j).getNodeName().equals("uses_connection")) { //$NON-NLS-1$
if (!connection.equals(accessSpecChildNodes.item(j).getAttributes().getNamedItem("connection") //$NON-NLS-1$
<BUG>.getNodeValue())) {
throw new ParseConnectionDocumentException("The value of the connection parameter "
+ connection + " is not the same as the connection used by access element "
+ access + " as mentioned in the uses_connection element in connections document");</BUG>
}
| throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_CONNECTION_PARAM_NOT_THE_SAME_AS_CONN_USED_BY_ACCESS_ELEMENT", connection, access )); //$NON-NLS-1$
|
12,384 | nativeSchema = access_specification.item(i).getChildNodes().item(nativeSchemaIndex);
}
break;
}
}
<BUG>if (!accessFound) {
throw new ParseConnectionDocumentException("The value of the access parameter " + access
+ " is not found in the connections document");</BUG>
}
return nativeSchema;
| throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_ACCESS_PARAM_NOT_FOUND_IN_CONN_DOC", access )); //$NON-NLS-1$
|
12,385 | nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$
.getNodeValue()));
}
if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22)
&& ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema
<BUG>.getAttribute(nativeAttrName).getType().getMetaType() == Type.MetaType.BLOB))) {
throw new ParseConnectionDocumentException(" Blob data type is not supported for message class "
+ msgClass);</BUG>
}
Iterator<NativeSchema> it = nativeSchemaObjects.iterator();
| throw new ParseConnectionDocumentException(Messages.getString("BLOB_NOT_SUPPORTED_FOR_MSG_CLASS", msgClass)); //$NON-NLS-1$
|
12,386 | throw new ParseConnectionDocumentException(" Blob data type is not supported for message class "
+ msgClass);</BUG>
}
Iterator<NativeSchema> it = nativeSchemaObjects.iterator();
while (it.hasNext()) {
<BUG>if (it.next().getName().equals(nativeAttrName)) {
throw new ParseConnectionDocumentException("Parameter name: " + nativeAttrName
+ " is appearing more than once In native schema file");</BUG>
}
}
| nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$
.getNodeValue()));
if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22)
&& ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema
.getAttribute(nativeAttrName).getType().getMetaType() == Type.MetaType.BLOB))) {
throw new ParseConnectionDocumentException(Messages.getString("BLOB_NOT_SUPPORTED_FOR_MSG_CLASS", msgClass)); //$NON-NLS-1$
throw new ParseConnectionDocumentException(Messages.getString("PARAMETER_NOT_UNIQUE_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
|
12,387 | if (msgClass == MessageClass.text) {
typesWithLength = new HashSet<String>(Arrays.asList("Bytes")); //$NON-NLS-1$
}
Set<String> typesWithoutLength = new HashSet<String>(Arrays.asList("Byte", "Short", "Int", "Long", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"Float", "Double", "Boolean")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
<BUG>if (typesWithoutLength.contains(nativeAttrType) && nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) {
throw new ParseConnectionDocumentException("Length attribute should not be present for parameter: "
+ nativeAttrName + " In native schema file");</BUG>
}
if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA)
| throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
|
12,388 | if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA)
&& (msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22 || msgClass == MessageClass.xml)
&& (streamSchema.getAttribute(nativeAttrName) != null)
&& (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.RSTRING)
&& (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.USTRING)
<BUG>&& (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.BLOB)) {
throw new ParseConnectionDocumentException("Length attribute should not be present for parameter: "
+ nativeAttrName + " In native schema file");</BUG>
}
if (streamSchema.getAttribute(nativeAttrName) != null) {
| throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
|
12,389 | if (streamSchema.getAttribute(nativeAttrName) != null) {
MetaType metaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if (metaType == Type.MetaType.DECIMAL32 || metaType == Type.MetaType.DECIMAL64
|| metaType == Type.MetaType.DECIMAL128 || metaType == Type.MetaType.TIMESTAMP) {
if (nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) {
<BUG>throw new ParseConnectionDocumentException(
"Length attribute should not be present for parameter: " + nativeAttrName
+ " with type " + metaType + " in native schema file.");</BUG>
}
if (msgClass == MessageClass.bytes) {
| Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_WITH_TYPE_IN_NATIVE_SCHEMA", nativeAttrName, metaType )); //$NON-NLS-1$
|
12,390 | nativeAttrLength = -4;
}
}
}
if (typesWithLength.contains(nativeAttrType)) {
<BUG>if (nativeAttrLength == LENGTH_ABSENT_IN_NATIVE_SCHEMA && msgClass == MessageClass.bytes) {
throw new ParseConnectionDocumentException("Length attribute should be present for parameter: "
+ nativeAttrName + " In native schema file for message class bytes");</BUG>
}
if ((nativeAttrLength < 0) && nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) {
| throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA_FOR_MSG_CLASS_BYTES", nativeAttrName )); //$NON-NLS-1$
|
12,391 | if (streamSchema.getAttribute(nativeAttrName) != null) {
streamAttrName = streamSchema.getAttribute(nativeAttrName).getName();
streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if ((msgClass == MessageClass.stream || msgClass == MessageClass.map)
&& !mapSPLToNativeSchemaDataTypesForOtherMsgClass.get(streamAttrMetaType.getLanguageType())
<BUG>.equals(nativeAttrType)) {
throw new ParseConnectionDocumentException("Attribute Name: " + nativeAttrName + " with type:"
+ nativeAttrType + " in the native schema cannot be mapped with attribute: "
+ streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG>
}
| throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
|
12,392 | + nativeAttrType + " in the native schema cannot be mapped with attribute: "
+ streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG>
}
else if (msgClass == MessageClass.bytes
&& !mapSPLToNativeSchemaDataTypesForBytes.get(streamAttrMetaType.getLanguageType()).equals(
<BUG>nativeAttrType)) {
throw new ParseConnectionDocumentException("Attribute Name: " + nativeAttrName + " with type:"
+ nativeAttrType + " in the native schema cannot be mapped with attribute: "
+ streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG>
}
| if (streamSchema.getAttribute(nativeAttrName) != null) {
streamAttrName = streamSchema.getAttribute(nativeAttrName).getName();
streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if ((msgClass == MessageClass.stream || msgClass == MessageClass.map)
&& !mapSPLToNativeSchemaDataTypesForOtherMsgClass.get(streamAttrMetaType.getLanguageType())
.equals(nativeAttrType)) {
throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
|
12,393 | package com.ibm.streamsx.messaging.i18n;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
<BUG>private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.mqtt.MQTTMessages"; //$NON-NLS-1$
</BUG>
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
private Messages() {
| private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.i18n.CommonMessages"; //$NON-NLS-1$
|
12,394 |
String sval = prefix() + "streams." + stream.getKey() + " " + stream.getValue().get() + " " + now;
r.add(sval);</BUG>
}
<BUG>for(Entry<String, Counter> host : counter.getHostCounts().entrySet()) {
String hval = prefix() + "hosts." + Tools.decodeBase64(host.getKey()).replaceAll("[^a-zA-Z0-9\\.]", "") + " " + host.getValue().get() + " " + Tools.getUTCTimestamp();
r.add(hval);</BUG>
}
return r;
| public List<String> getAllMetrics() {
List<String> r = Lists.newArrayList();
int now = Tools.getUTCTimestamp();
String overall = prefix() + "total " + counter.getTotalCount() + " " + now;
r.add(overall);
for(Entry<String, Integer> stream : counter.getStreamCounts().entrySet()) {
String sval = prefix() + "streams." + stream.getKey() + " " + stream.getValue() + " " + now;
r.add(sval);
for(Entry<String, Integer> host : counter.getHostCounts().entrySet()) {
String hval = prefix() + "hosts." + Tools.decodeBase64(host.getKey()).replaceAll("[^a-zA-Z0-9\\.]", "") + " " + host.getValue() + " " + Tools.getUTCTimestamp();
r.add(hval);
|
12,395 | Map<String, Object> overall = Maps.newHashMap();
overall.put("value", counter.getTotalCount());
overall.put("source", source);
overall.put("name", "gl2-total");
gauges.add(overall);
<BUG>for(Entry<String, Counter> stream : counter.getStreamCounts().entrySet()) {
</BUG>
if (streamFilter.contains(stream.getKey())) {
LOG.debug("Not sending stream <{}> to Librato Metrics because it is listed in libratometrics_stream_filter", stream.getKey());
continue;
| for(Entry<String, Integer> stream : counter.getStreamCounts().entrySet()) {
|
12,396 | if (Tools.decodeBase64(host.getKey()).matches(hostFilter)) {
LOG.debug("Not sending host <{}> to Librato Metrics because it was matched by libratometrics_host_filter", host.getKey());
continue;
}
Map<String, Object> h = Maps.newHashMap();
<BUG>h.put("value", host.getValue().get());
h.put("source", source);</BUG>
h.put("name", "gl2-host-" + Tools.decodeBase64(host.getKey()).replaceAll("[^a-zA-Z0-9]", ""));
gauges.add(h);
}
| h.put("value", host.getValue());
h.put("source", source);
|
12,397 | import android.view.View;
import android.webkit.WebView;
import com.afollestad.materialdialogs.MaterialDialog;
import java.io.BufferedReader;
import java.io.InputStream;
<BUG>import java.io.InputStreamReader;
public class ChangelogDialog extends DialogFragment {</BUG>
public static ChangelogDialog create() {
ChangelogDialog dialog = new ChangelogDialog();
return dialog;
| import knf.animeflv.Utils.ThemeUtils;
public class ChangelogDialog extends DialogFragment {
|
12,398 | throw new IllegalStateException("This device does not support Web Views.");
}
MaterialDialog dialog = new MaterialDialog.Builder(getActivity())
.title("ChangeLog")
.customView(customView, false)
<BUG>.positiveText(android.R.string.ok)
.build();</BUG>
final WebView webView = (WebView) customView.findViewById(R.id.webview);
try {
StringBuilder buf = new StringBuilder();
| .backgroundColor(ThemeUtils.isAmoled(getActivity()) ? ColorsRes.Prim(getActivity()) : ColorsRes.Blanco(getActivity()))
.build();
|
12,399 | import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
<BUG>import knf.animeflv.Utils.Logger;
import xdroid.toaster.Toaster;</BUG>
public class BackDownload extends AppCompatActivity {
String aid;
String num;
| import knf.animeflv.Utils.ThemeUtils;
import xdroid.toaster.Toaster;
|
12,400 | .titleGravity(GravityEnum.CENTER)
.customView(R.layout.dialog_down, false)
.cancelable(true)
.autoDismiss(false)
.positiveText("Descargar")
<BUG>.negativeText("Cancelar")
.callback(new MaterialDialog.ButtonCallback() {</BUG>
@Override
public void onPositive(MaterialDialog dialog) {
super.onPositive(dialog);
| .backgroundColor(ThemeUtils.isAmoled(context) ? ColorsRes.Prim(context) : ColorsRes.Blanco(context))
.callback(new MaterialDialog.ButtonCallback() {
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.