id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
3,401 | 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);
|
3,402 | 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) {
|
3,403 | 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;
|
3,404 | else if (input.equalsIgnoreCase("decrease"))
decrease = true;
else
throw new IOException("Illegal font size: " + input);
boolean changed = false;
<BUG>GraphView viewer;
</BUG>
if (getViewer() instanceof ClusterViewer)
viewer = ((ClusterViewer) getViewer()).getGraphView();
else if (getViewer() instanceof GraphView)
| final GraphView viewer;
|
3,405 | if (getViewer() instanceof ClusterViewer)
viewer = ((ClusterViewer) getViewer()).getGraphView();
else if (getViewer() instanceof GraphView)
viewer = (GraphView) getViewer();
else return;
<BUG>Set<Node> nodes = new HashSet<>();
</BUG>
if (viewer.getSelectedNodes().size() == 0 && viewer.getSelectedEdges().size() == 0) {
for (Node v = viewer.getGraph().getFirstNode(); v != null; v = v.getNext())
nodes.add(v);
| final Set<Node> nodes = new HashSet<>();
|
3,406 | setData(taxa, distances);
getGraphView().setFixedNodeSize(true);
getGraphView().resetViews();
getGraphView().getScrollPane().revalidate();
getGraphView().fitGraphToWindow();
<BUG>getGraphView().setFont(ProgramProperties.get(ProgramProperties.DEFAULT_FONT, clusterViewer.getFont()));
</BUG>
clusterViewer.addFormatting(getGraphView());
clusterViewer.updateConvexHulls = true;
}
| getGraphView().setFont(ProgramProperties.get(ProgramProperties.DEFAULT_FONT, getGraphView().getFont()));
|
3,407 | throw new RuntimeException("getLCA() called for assignment using best hit");
}
private Map<String, Integer> loadAssignmentFiles(String cName, String fileName) {
final File file = new File(Basic.replaceFileSuffix(fileName, "." + cName.toLowerCase()));
if (file.exists() && file.canRead()) {
<BUG>System.err.println("External assignment file for " + cName + " detected: " + fileName);
final Map<String, Integer> map = new HashMap<>();</BUG>
try (final FileInputIterator it = new FileInputIterator(file, true)) {
while (it.hasNext()) {
final String[] tokens = Basic.split(it.next(), '\t');
| System.err.println("External assignment file for " + cName + " detected: " + file);
final Map<String, Integer> map = new HashMap<>();
|
3,408 | package megan.classification;
import jloda.util.Basic;
import jloda.util.ProgramProperties;
<BUG>import megan.classification.util.MultiTaggedAccessions;
import megan.classification.util.MultiWords;
import java.io.IOException;</BUG>
import java.util.HashMap;
import java.util.HashSet;
| import megan.classification.util.TaggedValueIterator;
import java.io.IOException;
|
3,409 | private final Set<Integer> ids = new HashSet<>();
private final Set<Integer> disabled = new HashSet<>();
private final boolean isTaxonomy;
private final MultiWords multiWords;
private final Map<Integer, int[]> id2segment = new HashMap<>();
<BUG>private final MultiTaggedAccessions taggedIds;
private final MultiTaggedAccessions giTaggedIds;
private final MultiTaggedAccessions accTaggedIds;
</BUG>
private int maxWarnings = 10;
| private final TaggedValueIterator taggedIds;
private final TaggedValueIterator giTaggedIds;
private final TaggedValueIterator accTaggedIds;
|
3,410 | this.idMapper = idMapper;
this.useTextParsing = idMapper.isUseTextParsing();
disabledIds.addAll(idMapper.getDisabledIds());
isTaxonomy = idMapper.getCName().equals(Classification.Taxonomy);
multiWords = new MultiWords();
<BUG>taggedIds = new MultiTaggedAccessions(false, idMapper.getIdTags());
giTaggedIds = new MultiTaggedAccessions(false, idMapper.isActiveMap(IdMapper.MapType.GI) && idMapper.isLoaded(IdMapper.MapType.GI), GI_TAGS);
accTaggedIds = new MultiTaggedAccessions(ProgramProperties.get(PROPERTIES_FIRST_WORD_IS_ACCESSION, true), idMapper.isActiveMap(IdMapper.MapType.Accession) && idMapper.isLoaded(IdMapper.MapType.Accession), ProgramProperties.get(PROPERTIES_ACCESSION_TAGS, ACCESSION_TAGS));
</BUG>
}
| taggedIds = new TaggedValueIterator(false, true, idMapper.getIdTags());
giTaggedIds = new TaggedValueIterator(false, idMapper.isActiveMap(IdMapper.MapType.GI) && idMapper.isLoaded(IdMapper.MapType.GI), GI_TAGS);
accTaggedIds = new TaggedValueIterator(ProgramProperties.get(PROPERTIES_FIRST_WORD_IS_ACCESSION, true), idMapper.isActiveMap(IdMapper.MapType.Accession) && idMapper.isLoaded(IdMapper.MapType.Accession), ProgramProperties.get(PROPERTIES_ACCESSION_TAGS, ACCESSION_TAGS));
|
3,411 | if (headerString == null)
return 0;
ids.clear();
disabled.clear();
headerString = headerString.trim();
<BUG>if (taggedIds.isEnabled()) {
int countLabels = taggedIds.compute(headerString);
for (int i = 0; i < countLabels; i++) {
final String label = taggedIds.getWord(i);</BUG>
try {
| taggedIds.restart(headerString);
for (String label : taggedIds) {
|
3,412 | private LocalBroadcastManager mLocalBroadcastManager;
private String mActiveDownloadUrlString;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
<BUG>setContentView(R.layout.activity_app_details2);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);</BUG>
toolbar.setTitle(""); // Nice and clean toolbar
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
| setContentView(R.layout.app_details2);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
3,413 | .inflate(R.layout.app_details2_screenshots, parent, false);
return new ScreenShotsViewHolder(view);
} else if (viewType == VIEWTYPE_WHATS_NEW) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.app_details2_whatsnew, parent, false);
<BUG>return new WhatsNewViewHolder(view);
} else if (viewType == VIEWTYPE_LINKS) {</BUG>
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.app_details2_links, parent, false);
return new ExpandableLinearLayoutViewHolder(view);
| } else if (viewType == VIEWTYPE_DONATE) {
.inflate(R.layout.app_details2_donate, parent, false);
return new DonateViewHolder(view);
} else if (viewType == VIEWTYPE_LINKS) {
|
3,414 | sendUsage(sender);
} else if (args.length >= 1) {
switch (args[0].toLowerCase()) {
case "reload":
cmdReload(sender);
<BUG>break;
case "convert":</BUG>
cmdConvert(sender, args);
break;
case "clear":
| case "debug":
handler.toggleDebug();
sender.sendMessage(Utils.format("&3NametagEdit debug has been " + (handler.debug() ? "&aENABLED" : "&cDISABLED")));
case "convert":
|
3,415 | import org.bukkit.scheduler.BukkitRunnable;
import java.util.*;
@Getter
@Setter
public class NametagHandler implements Listener {
<BUG>private AbstractConfig abstractConfig;
private boolean tabListDisabled;</BUG>
private List<GroupData> groupData = new ArrayList<>();
private Map<UUID, PlayerData> playerData = new HashMap<>();
private NametagEdit plugin;
| private boolean debug;
private boolean tabListDisabled;
|
3,416 | private NametagEdit plugin;
private NametagManager nametagManager;
public NametagHandler(NametagEdit plugin, NametagManager nametagManager) {
this.plugin = plugin;
this.nametagManager = nametagManager;
<BUG>Bukkit.getPluginManager().registerEvents(this, plugin);
this.tabListDisabled = plugin.getConfig().getBoolean("TabListDisabled");</BUG>
if (plugin.getConfig().getBoolean("MySQL.Enabled")) {
abstractConfig = new DatabaseConfig(plugin, this);
} else {
| this.debug = plugin.getConfig().getBoolean("Debug");
this.tabListDisabled = plugin.getConfig().getBoolean("TabListDisabled");
|
3,417 | void addGroup(GroupData data) {
groupData.add(data);
abstractConfig.add(data);
}
void reload() {
<BUG>plugin.reloadConfig();
this.tabListDisabled = plugin.getConfig().getBoolean("TabListDisabled");
plugin.getManager().reset();
</BUG>
abstractConfig.reload();
| [DELETED] |
3,418 | public void applyTags() {
for (Player online : Utils.getOnline()) {
if (online != null) {
applyTagToPlayer(online);
}
<BUG>}
}</BUG>
public void applyTagToPlayer(Player player) {
UUID uuid = player.getUniqueId();
PlayerData data = playerData.get(uuid);
| plugin.debug("Applied tags to all online players.");
|
3,419 | package com.nametagedit.plugin;
import com.nametagedit.plugin.api.INametagApi;
import com.nametagedit.plugin.api.NametagAPI;
import com.nametagedit.plugin.hooks.HookGroupManager;
import com.nametagedit.plugin.hooks.HookPermissionsEX;
<BUG>import com.nametagedit.plugin.hooks.HookZPermissions;
import lombok.Getter;</BUG>
import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
| import com.nametagedit.plugin.packets.PacketWrapper;
import lombok.Getter;
|
3,420 | private NametagHandler handler;
private NametagManager manager;
@Override
public void onEnable() {
saveDefaultConfig();
<BUG>manager = new NametagManager();
</BUG>
handler = new NametagHandler(this, manager);
if (getConfig().getBoolean("MetricsEnabled")) {
try {
| manager = new NametagManager(this);
|
3,421 | pluginManager.registerEvents(new HookGroupManager(handler), this);
}
getCommand("ne").setExecutor(new NametagCommand(handler));
if (api == null) {
api = new NametagAPI(manager);
<BUG>}
}</BUG>
@Override
public void onDisable() {
manager.reset();
| testCompat();
|
3,422 | import com.paypal.svcs.types.common.AccountIdentifier;
import java.util.List;
import java.util.ArrayList;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
<BUG>public class GetUserLimitsRequest{
private RequestEnvelope requestEnvelope;</BUG>
private AccountIdentifier user;
private String country;
private String currencyCode;
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private RequestEnvelope requestEnvelope;
|
3,423 | package com.paypal.svcs.types.ap;
import com.paypal.svcs.types.common.RequestEnvelope;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
<BUG>public class GetAvailableShippingAddressesRequest{
private RequestEnvelope requestEnvelope;</BUG>
private String key;
public GetAvailableShippingAddressesRequest (RequestEnvelope requestEnvelope, String key){
this.requestEnvelope = requestEnvelope;
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private RequestEnvelope requestEnvelope;
|
3,424 | package com.paypal.svcs.services;
import java.io.*;
import com.paypal.core.BaseService;
<BUG>import com.paypal.exception.*;
import com.paypal.core.NVPUtil;
import com.paypal.svcs.types.ap.CancelPreapprovalRequest;</BUG>
import com.paypal.svcs.types.ap.CancelPreapprovalResponse;
import com.paypal.svcs.types.ap.ConfirmPreapprovalRequest;
| import com.paypal.core.credential.ICredential;
import com.paypal.core.APICallPreHandler;
import com.paypal.core.nvp.PlatformAPICallPreHandler;
import com.paypal.svcs.types.ap.CancelPreapprovalRequest;
|
3,425 | import com.paypal.svcs.types.ap.GetShippingAddressesResponse;
import com.paypal.svcs.types.ap.GetUserLimitsRequest;
import com.paypal.svcs.types.ap.GetUserLimitsResponse;
import com.paypal.sdk.exceptions.OAuthException;
public class AdaptivePaymentsService extends BaseService{
<BUG>public static final String SERVICE_VERSION = "1.8.1";
public static final String SERVICE_NAME = "AdaptivePayments";
public AdaptivePaymentsService(File configFile) throws IOException {
super(SERVICE_NAME, SERVICE_VERSION);</BUG>
initConfig(configFile);
| public static final String SERVICE_VERSION = "1.8.2";
private static final String SDK_NAME="sdkname";
private static final String SDK_VERSION="sdkversion";
|
3,426 | package com.paypal.svcs.types.ap;
import com.paypal.svcs.types.common.RequestEnvelope;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
<BUG>public class GetPaymentOptionsRequest{
private RequestEnvelope requestEnvelope;</BUG>
private String payKey;
public GetPaymentOptionsRequest (RequestEnvelope requestEnvelope, String payKey){
this.requestEnvelope = requestEnvelope;
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private RequestEnvelope requestEnvelope;
|
3,427 | package com.paypal.svcs.types.ap;
import com.paypal.svcs.types.common.RequestEnvelope;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
<BUG>public class CancelPreapprovalRequest{
private RequestEnvelope requestEnvelope;</BUG>
private String preapprovalKey;
public CancelPreapprovalRequest (RequestEnvelope requestEnvelope, String preapprovalKey){
this.requestEnvelope = requestEnvelope;
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private RequestEnvelope requestEnvelope;
|
3,428 | package com.paypal.svcs.types.ap;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
import java.util.Map;
<BUG>public class InstitutionCustomer{
private String institutionId;</BUG>
private String firstName;
private String lastName;
private String displayName;
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private String institutionId;
|
3,429 | import java.util.ArrayList;
import com.paypal.svcs.types.common.CurrencyType;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
import java.util.Map;
<BUG>public class CurrencyList{
private List<CurrencyType> currency = new ArrayList<CurrencyType>();</BUG>
public CurrencyList (List<CurrencyType> currency){
this.currency = currency;
}
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private List<CurrencyType> currency = new ArrayList<CurrencyType>();
|
3,430 | package com.paypal.svcs.types.ap;
import com.paypal.svcs.types.ap.InstitutionCustomer;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
import java.util.Map;
<BUG>public class InitiatingEntity{
private InstitutionCustomer institutionCustomer;</BUG>
public InitiatingEntity (){
}
public InstitutionCustomer getInstitutionCustomer() {
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private InstitutionCustomer institutionCustomer;
|
3,431 | import java.util.ArrayList;
import com.paypal.svcs.types.ap.InvoiceItem;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
import java.util.Map;
<BUG>public class InvoiceData{
private List<InvoiceItem> item = new ArrayList<InvoiceItem>();</BUG>
private Double totalTax;
private Double totalShipping;
public InvoiceData (){
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private List<InvoiceItem> item = new ArrayList<InvoiceItem>();
|
3,432 | import com.paypal.svcs.types.common.RequestEnvelope;
import com.paypal.svcs.types.ap.CurrencyList;
import com.paypal.svcs.types.ap.CurrencyCodeList;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
<BUG>public class ConvertCurrencyRequest{
private RequestEnvelope requestEnvelope;</BUG>
private CurrencyList baseAmountList;
private CurrencyCodeList convertToCurrencyList;
private String countryCode;
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private RequestEnvelope requestEnvelope;
|
3,433 | package com.paypal.svcs.types.ap;
import com.paypal.svcs.types.common.RequestEnvelope;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
<BUG>public class ConfirmPreapprovalRequest{
private RequestEnvelope requestEnvelope;</BUG>
private String preapprovalKey;
private String fundingSourceId;
private String pin;
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private RequestEnvelope requestEnvelope;
|
3,434 | package com.paypal.svcs.types.ap;
import com.paypal.svcs.types.common.RequestEnvelope;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
<BUG>public class GetShippingAddressesRequest{
private RequestEnvelope requestEnvelope;</BUG>
private String key;
public GetShippingAddressesRequest (RequestEnvelope requestEnvelope, String key){
this.requestEnvelope = requestEnvelope;
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private RequestEnvelope requestEnvelope;
|
3,435 | package com.paypal.svcs.types.ap;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
import java.util.Map;
<BUG>public class FundingTypeInfo{
private String fundingType;</BUG>
public FundingTypeInfo (String fundingType){
this.fundingType = fundingType;
}
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private String fundingType;
|
3,436 | package com.paypal.svcs.types.ap;
import com.paypal.svcs.types.common.RequestEnvelope;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
<BUG>public class GetAllowedFundingSourcesRequest{
private RequestEnvelope requestEnvelope;</BUG>
private String key;
public GetAllowedFundingSourcesRequest (RequestEnvelope requestEnvelope, String key){
this.requestEnvelope = requestEnvelope;
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private RequestEnvelope requestEnvelope;
|
3,437 | package com.paypal.svcs.types.ap;
import com.paypal.svcs.types.common.RequestEnvelope;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
<BUG>public class GetFundingPlansRequest{
private RequestEnvelope requestEnvelope;</BUG>
private String payKey;
public GetFundingPlansRequest (RequestEnvelope requestEnvelope, String payKey){
this.requestEnvelope = requestEnvelope;
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private RequestEnvelope requestEnvelope;
|
3,438 | package com.paypal.svcs.types.ap;
import java.util.List;
import java.util.ArrayList;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
<BUG>public class CurrencyCodeList{
private List<String> currencyCode = new ArrayList<String>();</BUG>
public CurrencyCodeList (List<String> currencyCode){
this.currencyCode = currencyCode;
}
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private List<String> currencyCode = new ArrayList<String>();
|
3,439 | package com.paypal.svcs.types.ap;
import com.paypal.svcs.types.ap.FundingTypeList;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
import java.util.Map;
<BUG>public class FundingConstraint{
private FundingTypeList allowedFundingType;</BUG>
public FundingConstraint (){
}
public FundingTypeList getAllowedFundingType() {
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private FundingTypeList allowedFundingType;
|
3,440 | package com.paypal.svcs.types.ap;
import com.paypal.svcs.types.common.RequestEnvelope;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
<BUG>public class ExecutePaymentRequest{
private RequestEnvelope requestEnvelope;</BUG>
private String payKey;
private String actionType;
private String fundingPlanId;
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private RequestEnvelope requestEnvelope;
|
3,441 | package com.paypal.svcs.types.ap;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
import java.util.Map;
<BUG>public class DisplayOptions{
private String emailHeaderImageUrl;</BUG>
private String emailMarketingImageUrl;
private String headerImageUrl;
private String businessName;
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private String emailHeaderImageUrl;
|
3,442 | import java.util.ArrayList;
import com.paypal.svcs.types.ap.FundingTypeInfo;
import java.io.UnsupportedEncodingException;
import com.paypal.core.NVPUtil;
import java.util.Map;
<BUG>public class FundingTypeList{
private List<FundingTypeInfo> fundingTypeInfo = new ArrayList<FundingTypeInfo>();</BUG>
public FundingTypeList (List<FundingTypeInfo> fundingTypeInfo){
this.fundingTypeInfo = fundingTypeInfo;
}
| private static final String nameSpace="com.paypal.svcs.types.ap";
private static final String preferredPrefix="";
private List<FundingTypeInfo> fundingTypeInfo = new ArrayList<FundingTypeInfo>();
|
3,443 | import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
<BUG>import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;</BUG>
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.ContextMenu;
| import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
|
3,444 | import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
<BUG>import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;</BUG>
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.ContextMenu;
| import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
|
3,445 | import android.os.Handler;
import android.os.Looper;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.preference.PreferenceManager;
<BUG>import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.Toolbar;</BUG>
import android.util.Log;
import android.view.ContextMenu;
import android.view.KeyEvent;
| import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.Toolbar;
|
3,446 | mAltitude.setOnCheckedChangeListener(mCheckedChangeListener);
mDistance.setOnCheckedChangeListener(mCheckedChangeListener);
mCompass.setOnCheckedChangeListener(mCheckedChangeListener);
mLocation.setOnCheckedChangeListener(mCheckedChangeListener);
builder.setTitle(R.string.dialog_layer_title).setIcon(android.R.drawable.ic_dialog_map).setPositiveButton
<BUG>(R.string.btn_okay, null).setView(view);
</BUG>
dialog = builder.create();
return dialog;
case DIALOG_NOTRACK:
| (android.R.string.ok, null).setView(view);
|
3,447 | return;
}
ItemStack rStack = stack;
if(stack.getItemDamage() == OreDictionary.WILDCARD_VALUE)
{
<BUG>ArrayList<ItemStack> tmp = new ArrayList<ItemStack>();
stack.getItem().getSubItems(stack.getItem(), CreativeTabs.SEARCH, tmp);</BUG>
if(tmp.size() > 0)
{
rStack = tmp.get((int)((Minecraft.getSystemTime()/1000)%tmp.size()));
| NonNullList<ItemStack> tmp = NonNullList.func_191196_a();
stack.getItem().getSubItems(stack.getItem(), CreativeTabs.SEARCH, tmp);
|
3,448 | public String oreDict = "";
ItemStack baseStack = new ItemStack(Blocks.STONE); // Ensures that this base stack is never null
public BigItemStack(ItemStack stack)
{
baseStack = stack.copy();
<BUG>this.stackSize = baseStack.stackSize;
baseStack.stackSize = 1;
}</BUG>
public BigItemStack(Block block)
{
| this.stackSize = baseStack.func_190916_E();
baseStack.func_190920_e(1);
}
|
3,449 | int tmp1 = Math.max(1, stackSize); // Guarantees this method will return at least 1 item
while(tmp1 > 0)
{
int size = Math.min(tmp1, baseStack.getMaxStackSize());
ItemStack stack = baseStack.copy();
<BUG>stack.stackSize = size;
list.add(stack);</BUG>
tmp1 -= size;
}
return list;
| stack.func_190920_e(size);
list.add(stack);
|
3,450 | NBTTagCompound tags = stack.getTagCompound();
Item i = (Item)Item.REGISTRY.getObject(new ResourceLocation(tags.getString("orig_id")));
NBTTagCompound t = tags.hasKey("orig_tag")? tags.getCompoundTag("orig_tag") : null;
if(i != null)
{
<BUG>ItemStack converted = new ItemStack(i, stack.stackSize, stack.getItemDamage());
</BUG>
converted.setTagCompound(t);
player.inventory.setInventorySlotContents(slot, converted);
}
| ItemStack converted = new ItemStack(i, stack.func_190916_E(), stack.getItemDamage());
|
3,451 | package betterquesting.api.client.gui.lists;
<BUG>import java.util.ArrayList;
import java.util.List;</BUG>
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.creativetab.CreativeTabs;
| [DELETED] |
3,452 | import java.util.List;</BUG>
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
<BUG>import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;</BUG>
import betterquesting.api.client.gui.GuiElement;
import betterquesting.api.utils.BigItemStack;
import betterquesting.api.utils.RenderUtils;
| package betterquesting.api.client.gui.lists;
import net.minecraft.util.NonNullList;
import net.minecraftforge.oredict.OreDictionary;
|
3,453 | public static class ScrollingEntryItem extends GuiElement implements IScrollingEntry
{
private final Minecraft mc;
private BigItemStack stack;
private String desc = "";
<BUG>private List<ItemStack> subStacks = new ArrayList<ItemStack>();
public ScrollingEntryItem(Minecraft mc, BigItemStack stack, String desc)</BUG>
{
this.mc = mc;
this.stack = stack;
| private NonNullList<ItemStack> subStacks = NonNullList.func_191196_a();
public ScrollingEntryItem(Minecraft mc, BigItemStack stack, String desc)
|
3,454 | if(oreStack == null)
{
continue;
}
Item oItem = oreStack.getItem();
<BUG>List<ItemStack> tmp = new ArrayList<ItemStack>();
if(oreStack.getItemDamage() == OreDictionary.WILDCARD_VALUE)</BUG>
{
oItem.getSubItems(oItem, CreativeTabs.SEARCH, tmp);
}
| NonNullList<ItemStack> tmp = NonNullList.func_191196_a();
if(oreStack.getItemDamage() == OreDictionary.WILDCARD_VALUE)
|
3,455 | import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.passive.EntityPig;
<BUG>import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.MathHelper;</BUG>
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.logging.log4j.Level;
| import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
|
3,456 | if(button.id == 0 && callback != null)
{
callback.setValue(entity);
} else if(button.id == 1)
{
<BUG>Entity tmpE = EntityList.createEntityByName(button.displayString, this.mc.theWorld);
</BUG>
if(tmpE != null)
{
try
| Entity tmpE = EntityList.createEntityByIDFromName(new ResourceLocation(button.displayString), this.mc.theWorld);
|
3,457 | import betterquesting.api.questing.tasks.ITask;
import betterquesting.core.BetterQuesting;
import betterquesting.network.PacketSender;
import betterquesting.network.PacketTypeNative;
import betterquesting.questing.QuestDatabase;
<BUG>@SuppressWarnings("deprecation")
public class TileSubmitStation extends TileEntity implements IFluidHandler, ISidedInventory, ITickable, IItemHandlerModifiable
</BUG>
{
ItemStack[] itemStack = new ItemStack[2];
| public class TileSubmitStation extends TileEntity implements IFluidHandler, ISidedInventory, ITickable, IItemHandlerModifiable, IFluidTankProperties
|
3,458 | }
@Override
public void readFromNBT(NBTTagCompound tags)
{
super.readFromNBT(tags);
<BUG>itemStack[0] = ItemStack.loadItemStackFromNBT(tags.getCompoundTag("input"));
itemStack[1] = ItemStack.loadItemStackFromNBT(tags.getCompoundTag("ouput"));
</BUG>
try
| public String getName()
return BetterQuesting.submitStation.getLocalizedName();
public boolean hasCustomName()
|
3,459 | LOG.error( e, e );
return;
}
}
EucalyptusErrorMessageType errMsg = getErrorMessageType( exMsg, msg );
<BUG>errMsg.setException(exception.getCause());
replies.putMessage( errMsg );
}</BUG>
}
| errMsg.setException( exception.getCause( ) );
this.handle( errMsg );
|
3,460 | LOG.error( "This is a BUG: " + e1, e1 );
throw e1;
} catch ( NoAcceptingPipelineException e2 ) {
throw e2;
}
<BUG>}
}
ctx.sendUpstream( e );</BUG>
}
@Override
| [DELETED] |
3,461 | <BUG>package com.eucalyptus.ws.handlers;
import org.apache.log4j.Logger;
import org.jboss.netty.channel.ChannelDownstreamHandler;</BUG>
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelFuture;
| import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelDownstreamHandler;
|
3,462 | import edu.ucsb.eucalyptus.msgs.EucalyptusMessage;
import edu.ucsb.eucalyptus.msgs.EventRecord;
import edu.ucsb.eucalyptus.msgs.PutObjectType;
import edu.ucsb.eucalyptus.msgs.WalrusDataGetResponseType;
import edu.ucsb.eucalyptus.msgs.WalrusDeleteResponseType;
<BUG>@ChannelPipelineCoverage("one")
public class ServiceSinkHandler implements ChannelDownstreamHandler, ChannelUpstreamHandler{
private static Logger LOG = Logger.getLogger( ServiceSinkHandler.class );
@Override
public void handleDownstream( final ChannelHandlerContext ctx, final ChannelEvent e ) throws Exception {
ctx.sendDownstream( e );
}</BUG>
@Override
| @ChannelPipelineCoverage( "one" )
public class ServiceSinkHandler implements ChannelDownstreamHandler, ChannelUpstreamHandler {
private long QUEUE_TIMEOUT_MS = 2; //TODO: measure me
private long startTime;
private ChannelLocal<MappingHttpMessage> requestLocal = new ChannelLocal<MappingHttpMessage>();
|
3,463 | result_ = variableAssignmentExpression(builder_, level_ + 1);
}
else if (root_ == VARIABLE_EXPRESSION) {
result_ = variableExpression(builder_, level_ + 1);
}
<BUG>else {
Marker marker_ = builder_.mark();
enterErrorRecordingSection(builder_, level_, _SECTION_RECOVER_, null);
result_ = parse_root_(root_, builder_, level_);
exitErrorRecordingSection(builder_, level_, result_, true, _SECTION_RECOVER_, TOKEN_ADVANCER);
marker_.done(root_);</BUG>
}
| Marker marker_ = enter_section_(builder_, level_, _NONE_, null);
exit_section_(builder_, level_, marker_, root_, result_, true, TOKEN_ADVANCER);
|
3,464 | return builder_.getTreeBuilt();
}
protected boolean parse_root_(final IElementType root_, final PsiBuilder builder_, final int level_) {
return root(builder_, level_ + 1);
}
<BUG>private static final TokenSet[] EXTENDS_SETS_ = new TokenSet[] {
</BUG>
create_token_set_(BINARY_EXPRESSION, CONDITIONAL_EXPRESSION, EXPRESSION, INDEXED_EXPRESSION,
LITERAL_EXPRESSION, METHOD_CALL_EXPRESSION, NEW_EXPRESSION, PARENTHESIZED_EXPRESSION,
REFERENCE_EXPRESSION, SEQUENCE_EXPRESSION, UNARY_EXPRESSION, VARIABLE_ASSIGNMENT_EXPRESSION,
| public static final TokenSet[] EXTENDS_SETS_ = new TokenSet[] {
|
3,465 | create_token_set_(BINARY_EXPRESSION, CONDITIONAL_EXPRESSION, EXPRESSION, INDEXED_EXPRESSION,
LITERAL_EXPRESSION, METHOD_CALL_EXPRESSION, NEW_EXPRESSION, PARENTHESIZED_EXPRESSION,
REFERENCE_EXPRESSION, SEQUENCE_EXPRESSION, UNARY_EXPRESSION, VARIABLE_ASSIGNMENT_EXPRESSION,
VARIABLE_EXPRESSION),
};
<BUG>public static boolean type_extends_(IElementType child_, IElementType parent_) {
return type_extends_impl_(EXTENDS_SETS_, child_, parent_);
}</BUG>
static boolean arrayConstructorExpression(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "arrayConstructorExpression")) return false;
| [DELETED] |
3,466 | sequenceExpression(builder_, level_ + 1);
return true;
}
static boolean binaryOperations(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "binaryOperations")) return false;
<BUG>boolean result_ = false;
Marker marker_ = builder_.mark();
enterErrorRecordingSection(builder_, level_, _SECTION_GENERAL_, "<operator>");</BUG>
result_ = plusMinusOperations(builder_, level_ + 1);
if (!result_) result_ = divideMultiplyOperations(builder_, level_ + 1);
| Marker marker_ = enter_section_(builder_, level_, _NONE_, "<operator>");
|
3,467 | return result_;
}
static boolean bitwiseBooleanOperations(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "bitwiseBooleanOperations")) return false;
boolean result_ = false;
<BUG>Marker marker_ = builder_.mark();
result_ = consumeToken(builder_, OR);</BUG>
if (!result_) result_ = consumeToken(builder_, XOR);
if (!result_) result_ = consumeToken(builder_, AND);
if (!result_) result_ = consumeToken(builder_, BAND_KEYWORD);
| Marker marker_ = enter_section_(builder_);
result_ = consumeToken(builder_, OR);
|
3,468 | if (offset_ == next_offset_) {
empty_element_parsed_guard_(builder_, offset_, "expressionSequenceRequired_1");
break;
}
offset_ = next_offset_;
<BUG>}
if (!result_) {
marker_.rollbackTo();
}
else {
marker_.drop();
}</BUG>
return result_;
| empty_element_parsed_guard_(builder_, offset_, "referenceExpression_2");
|
3,469 | return consumeToken(builder_, INSTANCEOF_KEYWORD);
}
static boolean methodCallParameters(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "methodCallParameters")) return false;
boolean result_ = false;
<BUG>Marker marker_ = builder_.mark();
result_ = methodCallParameters_0(builder_, level_ + 1);
result_ = result_ && methodCallParameters_1(builder_, level_ + 1);
if (!result_) {
marker_.rollbackTo();
}
else {
marker_.drop();
}</BUG>
return result_;
| if (offset_ == next_offset_) {
empty_element_parsed_guard_(builder_, offset_, "referenceExpression_2");
break;
|
3,470 | Marker marker_ = builder_.mark();
enterErrorRecordingSection(builder_, level_, _SECTION_RECOVER_, null);
result_ = consumeToken(builder_, EXPRESSION_START);</BUG>
pinned_ = result_; // pin = 1
result_ = result_ && report_error_(builder_, rootElement(builder_, level_ + 1));
<BUG>result_ = pinned_ && consumeToken(builder_, EXPRESSION_END) && result_;
if (!result_ && !pinned_) {
marker_.rollbackTo();
}
else {
marker_.drop();
}
result_ = exitErrorRecordingSection(builder_, level_, result_, pinned_, _SECTION_RECOVER_, rootRecover_parser_);</BUG>
return result_ || pinned_;
| boolean result_ = false;
Marker marker_ = enter_section_(builder_);
result_ = consumeToken(builder_, DOT);
result_ = result_ && consumeToken(builder_, IDENTIFIER);
exit_section_(builder_, marker_, null, result_);
return result_;
|
3,471 | return expression(builder_, level_ + 1, -1);
}</BUG>
static boolean rootRecover(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "rootRecover")) return false;
<BUG>boolean result_ = false;
Marker marker_ = builder_.mark();
enterErrorRecordingSection(builder_, level_, _SECTION_NOT_, null);
result_ = !consumeToken(builder_, EXPRESSION_END);
marker_.rollbackTo();
result_ = exitErrorRecordingSection(builder_, level_, result_, false, _SECTION_NOT_, null);</BUG>
return result_;
| Marker marker_ = enter_section_(builder_);
result_ = consumeToken(builder_, DOT);
result_ = result_ && consumeToken(builder_, IDENTIFIER);
exit_section_(builder_, marker_, null, result_);
|
3,472 | enterErrorRecordingSection(builder_, level_, _SECTION_GENERAL_, "<method call expression>");</BUG>
result_ = referenceExpression(builder_, level_ + 1);
result_ = result_ && consumeToken(builder_, LPARENTH);
pinned_ = result_; // pin = 2
result_ = result_ && report_error_(builder_, methodCallParameters(builder_, level_ + 1));
<BUG>result_ = pinned_ && consumeToken(builder_, RPARENTH) && result_;
if (result_ || pinned_) {
marker_.done(METHOD_CALL_EXPRESSION);
}
else {
marker_.rollbackTo();
}
result_ = exitErrorRecordingSection(builder_, level_, result_, pinned_, _SECTION_GENERAL_, null);</BUG>
return result_ || pinned_;
| boolean result_ = false;
Marker marker_ = enter_section_(builder_);
result_ = consumeToken(builder_, DOT);
result_ = result_ && consumeToken(builder_, IDENTIFIER);
exit_section_(builder_, marker_, null, result_);
return result_;
|
3,473 | private Status execute(Bytecode.DoWhile bytecode, Constant[] frame, Context context) {
Status r = Status.NEXT;
while(r == Status.NEXT || r == Status.CONTINUE) {
r = executeAllWithin(frame, context.subBlockContext(bytecode.body()));
if(r == Status.NEXT) {
<BUG>Constant value = executeSingle(bytecode.operand(0), frame, context);
Constant.Bool operand = checkType(value,context,Constant.Bool.class);</BUG>
if(!operand.value()) { return Status.NEXT; }
}
| Constant.Bool operand = executeSingle(BOOL_T, bytecode.operand(0), frame, context);
|
3,474 | frame[j] = values[i];
}
return Status.RETURN;
}
private Status execute(Bytecode.Switch bytecode, Constant[] frame, Context context) {
<BUG>Constant value = executeSingle(bytecode.operand(0), frame, context);
</BUG>
for (Bytecode.Case c : bytecode.cases()) {
if(c.isDefault()) {
return executeAllWithin(frame,context.subBlockContext(c.block()));
| Constant value = executeSingle(ANY_T, bytecode.operand(0), frame, context);
|
3,475 | default:
return executeSingle((Bytecode.Operator) bytecode, frame, opContext);
</BUG>
}
<BUG>}
}</BUG>
private Constant executeSingle(Bytecode.Const bytecode, Constant[] frame, Context.Operand context) {
return bytecode.constant();
}
private Constant executeSingle(Bytecode.Convert bytecode, Constant[] frame, Context.Operand context) {
| val = executeSingle((Bytecode.Operator) bytecode, frame, opContext);
return checkType(val,context,expected);
|
3,476 | private Constant executeSingle(Bytecode.Const bytecode, Constant[] frame, Context.Operand context) {
return bytecode.constant();
}
private Constant executeSingle(Bytecode.Convert bytecode, Constant[] frame, Context.Operand context) {
try {
<BUG>Constant operand = executeSingle(bytecode.operand(),frame,context);
</BUG>
Type target = expander.getUnderlyingType(bytecode.type());
return convert(operand, target, context);
} catch (IOException e) {
| Constant operand = executeSingle(ANY_T, bytecode.operand(),frame,context);
|
3,477 | return operators[bytecode.opcode()].apply(values, this, context);
}
}
}
private Constant executeSingle(Bytecode.FieldLoad bytecode, Constant[] frame, Context.Operand context) {
<BUG>Constant.Record rec = (Constant.Record) executeSingle(bytecode.operand(),frame,context);
</BUG>
return rec.values().get(bytecode.fieldName());
}
private Constant executeSingle(Bytecode.Quantifier bytecode, Constant[] frame, Context.Operand context) {
| Constant.Record rec = executeSingle(RECORD_T,bytecode.operand(),frame,context);
|
3,478 | return false;
}
return true;
} else {
Bytecode.Range range = ranges[index];
<BUG>Constant.Integer start = checkType(executeSingle(range.startOperand(),frame,context),context,Constant.Integer.class);
Constant.Integer end = checkType(executeSingle(range.endOperand(),frame,context),context,Constant.Integer.class);
</BUG>
int var = range.variable();
| } else if(opcode == Bytecode.OPCODE_all){
Constant.Integer start = executeSingle(INT_T,range.startOperand(),frame,context);
Constant.Integer end = executeSingle(INT_T,range.endOperand(),frame,context);
|
3,479 | case Bytecode.OPCODE_lambda:
case Bytecode.OPCODE_none:
case Bytecode.OPCODE_some:
case Bytecode.OPCODE_all:
default:
<BUG>Constant val = executeSingle(operand, frame, opContext);
</BUG>
return new Constant[] { val };
}
}
| Constant val = executeSingle(ANY_T, operand, frame, opContext);
|
3,480 | return new Constant[] { val };
}
}
}
private Constant[] executeMulti(Bytecode.IndirectInvoke bytecode, Constant[] frame, Context.Operand context) {
<BUG>Constant operand = executeSingle(bytecode.operand(0),frame,context);
</BUG>
if(operand instanceof Constant.Lambda) {
Constant.Lambda cl = checkType(operand, context, Constant.Lambda.class);
Constant[] arguments = executeMulti(bytecode.arguments(),frame,context);
| Constant operand = executeSingle(ANY_T, bytecode.operand(0),frame,context);
|
3,481 | if (lval instanceof Bytecode.Operator) {
Bytecode.Operator op = (Bytecode.Operator) lval;
switch (op.kind()) {
case ARRAYINDEX: {
LVal src = constructLVal(op.operand(0),frame,context);
<BUG>Constant index = executeSingle(op.operand(1),frame,context);
checkType(index, context, Constant.Integer.class);
int i = ((Constant.Integer) index).value().intValue();
return new ArrayLVal(src,i);</BUG>
}
| Constant.Integer index = executeSingle(INT_T,op.operand(1),frame,context);
int i = index.value().intValue();
return new ArrayLVal(src,i);
|
3,482 | import org.apache.hadoop.hbase.client.Delete;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.RowLock;
<BUG>import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.io.BatchOperation;</BUG>
import org.apache.hadoop.hbase.io.BatchUpdate;
import org.apache.hadoop.hbase.io.Cell;
import org.apache.hadoop.hbase.io.HbaseMapWritable;
| import org.apache.hadoop.hbase.filter.Filter;
import org.apache.hadoop.hbase.filter.PrefixFilter;
import org.apache.hadoop.hbase.io.BatchOperation;
|
3,483 | out.writeInt(this.maxVersions);
if(this.filter == null) {
out.writeBoolean(false);
} else {
out.writeBoolean(true);
<BUG>HbaseObjectWritable.writeObject(out, this.filter,
Filter.class, null);
}</BUG>
if (this.oldFilter == null) {
out.writeBoolean(false);
| [DELETED] |
3,484 | long companyId, int start, int end,
OrderByComparator orderByComparator)
throws SystemException {
Map<String, Long> params = new HashMap<String, Long>();
params.put("companyId", new Long(companyId));
<BUG>List<Object> results = dynamicQuery(
getDynamicQuery(params), start, end, orderByComparator);
return toArticles(results);</BUG>
}
public int getCompanyArticlesCount(long companyId) throws SystemException {
| return dynamicQuery(
|
3,485 | long groupId, int start, int end,
OrderByComparator orderByComparator)
throws SystemException {
Map<String, Long> params = new HashMap<String, Long>();
params.put("groupId", new Long(groupId));
<BUG>List<Object> results = dynamicQuery(
getDynamicQuery(params), start, end, orderByComparator);
return toArticles(results);</BUG>
}
public List<Article> getGroupArticles(
| return dynamicQuery(
|
3,486 | public int getGroupArticlesCount(long groupId, long parentResourcePrimKey)
throws SystemException {
Map<String, Long> params = new HashMap<String, Long>();
params.put("groupId", new Long(groupId));
params.put("parentResourcePrimKey", new Long(parentResourcePrimKey));
<BUG>return dynamicQueryCount(getDynamicQuery(params));
</BUG>
}
public Article getLatestArticle(long resourcePrimKey)
throws PortalException, SystemException {
| return (int)dynamicQueryCount(getDynamicQuery(params));
|
3,487 | DLServiceUtil.addFile(
companyId, CompanyConstants.SYSTEM_STRING,
GroupConstants.DEFAULT_PARENT_GROUP_ID,
CompanyConstants.SYSTEM,
dirName + StringPool.SLASH + shortFileName, 0,
<BUG>StringPool.BLANK, now, serviceContext, bytes);
}
}</BUG>
return dirName;
}
| StringPool.BLANK, article.getModifiedDate(), serviceContext,
|
3,488 | dynamicQuery.add(property.eq(entry.getValue()));
}
dynamicQuery.add(
PropertyFactoryUtil.forName("version").in(subselectDynamicQuery));
return dynamicQuery;
<BUG>}
protected List<Article> toArticles(List<Object> results) {
List<Article> articles = new ArrayList<Article>(results.size());
for (Object result : results) {
articles.add((Article)result);
}
return articles;</BUG>
}
| [DELETED] |
3,489 | package com.example.mapdemo;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
<BUG>import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Polygon;</BUG>
import com.google.android.gms.maps.model.PolygonOptions;
import android.graphics.Color;
| import com.google.android.gms.maps.model.Dash;
import com.google.android.gms.maps.model.Dot;
import com.google.android.gms.maps.model.Gap;
import com.google.android.gms.maps.model.JointType;
import com.google.android.gms.maps.model.PatternItem;
import com.google.android.gms.maps.model.Polygon;
|
3,490 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
<BUG>import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;</BUG>
public final class PatchUtils {
| import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
3,491 | package org.jboss.as.patching.runner;
<BUG>import org.jboss.as.boot.DirectoryStructure;
import org.jboss.as.patching.LocalPatchInfo;</BUG>
import org.jboss.as.patching.PatchInfo;
import org.jboss.as.patching.PatchLogger;
import org.jboss.as.patching.PatchMessages;
| import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp;
import org.jboss.as.patching.CommonAttributes;
import org.jboss.as.patching.LocalPatchInfo;
|
3,492 | private static final String PATH_DELIMITER = "/";
public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;
enum Element {
ADDED_BUNDLE("added-bundle"),
ADDED_MISC_CONTENT("added-misc-content"),
<BUG>ADDED_MODULE("added-module"),
BUNDLES("bundles"),</BUG>
CUMULATIVE("cumulative"),
DESCRIPTION("description"),
MISC_FILES("misc-files"),
| APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
3,493 | final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
<BUG>case APPLIES_TO_VERSION:
builder.addAppliesTo(value);
break;</BUG>
case RESULTING_VERSION:
if(type == Patch.PatchType.CUMULATIVE) {
| [DELETED] |
3,494 | final StringBuilder path = new StringBuilder();
for(final String p : item.getPath()) {
path.append(p).append(PATH_DELIMITER);
}
path.append(item.getName());
<BUG>writer.writeAttribute(Attribute.PATH.name, path.toString());
if(type != ModificationType.REMOVE) {</BUG>
writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash()));
}
if(type != ModificationType.ADD) {
| if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
3,495 | package org.jboss.as.patching;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.patching.runner.PatchingException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
<BUG>import org.jboss.logging.annotations.MessageBundle;
import java.io.IOException;</BUG>
import java.util.List;
@MessageBundle(projectCode = "JBAS")
public interface PatchMessages {
| import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
3,496 | updateLanguagePath();
}
});
}
public void _init() {
<BUG>super._init();
myNamespace.setText(myOptions.getLanguageNamespace());</BUG>
myPath.setPath(myOptions.getLanguagePath());
updateLanguagePath();
}
| if (myOptions.getLanguageNamespace() == null) myOptions.setLanguageNamespace(myOptions.getProjectName());
myNamespace.setText(myOptions.getLanguageNamespace());
|
3,497 | if (myPath.getPath() == null || myPath.getPath().startsWith(prefix)) {
myPath.setPath(prefix + myNamespace.getText());
}
}
public void _init() {
<BUG>super._init();
myNamespace.setText(myOptions.getSolutionNamespace());</BUG>
myPath.setPath(myOptions.getSolutionPath());
updateSolutionPath();
}
| if (myOptions.getSolutionNamespace() == null) myOptions.setSolutionNamespace(myOptions.getProjectName());
myNamespace.setText(myOptions.getSolutionNamespace());
|
3,498 | File dir = file.getParentFile();
if (!(dir.isAbsolute())) {
throw new CommitStepException("Path should be absolute");
}
if (!(dir.exists())) {
<BUG>if (!(DirectoryUtil.askToCreateNewDirectory(JOptionPane.getFrameForComponent(myComponent), dir))) {
throw new CommitStepException("Enter correct path");
</BUG>
}
| [DELETED] |
3,499 | private Thread InputThread;
public PVR150Input()
{
if (!loadedLib && !Sage.EMBEDDED)
{
<BUG>System.loadLibrary("PVR150Input");
</BUG>
loadedLib = true;
}
}
| sage.Native.loadLibrary("PVR150Input");
|
3,500 | private static boolean loadedLib = false;
public PVR350OSDRenderingPlugin()
{
if (!loadedLib && !SageConstants.LITE)
{
<BUG>System.loadLibrary("PVR350OSDPlugin");
</BUG>
loadedLib = true;
Sage.writeDwordValue(Sage.HKEY_LOCAL_MACHINE,
"SYSTEM\\CurrentControlSet\\Services\\Globespan\\Parameters\\ivac15\\Driver",
| sage.Native.loadLibrary("PVR350OSDPlugin");
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.