id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
23,301 | 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 ... | import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
23,302 | 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;
|
23,303 | 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"),
MIS... | APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
23,304 | 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_VE... | [DELETED] |
23,305 | 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, bytesToHex... | if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
23,306 | 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>
impor... | import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
23,307 | for (Town town : towns) {
jComboBox3.addItem(town.getName());
}
jComboBox3.addActionListener(new ActionListener() {
@Override
<BUG>public void actionPerformed(ActionEvent e) {
changeTown(towns.get(jComboBox3.getSelectedIndex()));
}</BUG>
});
initComponents();
| if (towns.size() > 0 && jComboBox3.getSelectedIndex() >= 0) {
|
23,308 | mainLevelToBuild = new javax.swing.JSpinner();
mainPic = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
farmLevelToBuild = new javax.swing.JSpinner();
storageLevelToBuild = new javax.swing.JSpinner();
<BUG>saveButton = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();</BUG>
jLabel3 = new jav... | jScrollPane1 = new javax.swing.JScrollPane();
jPanel2 = new javax.swing.JPanel();
|
23,309 | .addComponent(oraclePic))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(trade_officePic)
.addComponent(trade_officeLevelToBuild, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jLabel2))
<BUG>.addContainerGap(java... | .addContainerGap(347, Short.MAX_VALUE))
);
|
23,310 | saveButton.setText("Save");
saveButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveButtonActionPerformed(evt);
}
<BUG>});
jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());</BUG>
jLabel3.setText("Troops");
swordPic.setFont(new... | jScrollPane1.setPreferredSize(new java.awt.Dimension(1096, 130));
jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
23,311 | .addComponent(colonize_shipToBuild, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, 0)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(sea_monsterPic, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLay... | .addGap(0, 0, Short.MAX_VALUE))
|
23,312 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(</BUG>
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
<BUG>.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupL... | layout.setHorizontalGroup(
|
23,313 | private javax.swing.JSpinner ironerLevelToBuild;
private javax.swing.JLabel ironerPic;
private JComboBox<String> jComboBox1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
<BUG>private javax.swing.JLabel jLabel3;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private ja... | private javax.swing.JLabel jLabel4;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JSpinner libraryLevelToBuild;
|
23,314 | package Grepolis.GUI;
<BUG>import Grepolis.GrepolisBot;
import Grepolis.IO.Saver;</BUG>
import Grepolis.Town;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
| import Grepolis.IO.Loader;
import Grepolis.IO.Saver;
|
23,315 | private void addJTabbedPaneListener() {
ChangeListener changeListener = new ChangeListener() {
public void stateChanged(ChangeEvent changeEvent) {
JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent.getSource();
int index = sourceTabbedPane.getSelectedIndex();
<BUG>if (index == 1) { //queue tab
queueTab.changeTown... | Loader.loadTemplateTowns();
queueTab.changeTown();
|
23,316 | customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString());
customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName);
customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString());
customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName);
customTokens.put("%%mlTraceFo... | customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName);
customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName);
}
|
23,317 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
23,318 | }
@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);
|
23,319 | MemoEntry.COLUMN_REF_TOPIC__ID + " = ?"
, new String[]{String.valueOf(topicId)});
}
public Cursor selectMemo(long topicId) {
Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null,
<BUG>MemoEntry._ID + " DESC", null);
</BUG>
if (c != nu... | MemoEntry.COLUMN_ORDER + " ASC", null);
|
23,320 | 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(
|
23,321 | import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kiminonawa.mydiary.R;
import com.kiminonawa.mydiary.db.DBManager;
import com.kiminonawa.mydiary.shared.EditMode;
<BUG>import com.kiminonawa.mydiary.shared.ThemeManager;
import java.util.List;
public class MemoAdapter extends RecyclerView.A... | import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;
public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
|
23,322 | private DBManager dbManager;
private boolean isEditMode = false;
private EditMemoDialogFragment.MemoCallback callback;
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
<BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMe... | public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {
super(recyclerView);
this.mActivity = activity;
|
23,323 | 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) {
|
23,324 | 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;
|
23,325 | 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 OpenInvEntityList... | public class OpenInvEntityListener implements Listener
public OpenInvEntityListener(OpenInv scrap)
plugin = scrap;
|
23,326 | 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;
|
23,327 | 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)
|
23,328 | throw new IOException("Expected "+_fields+" fields, found "+st.length+" in "+line);
}
if (st[_path].length()==0) {
st[_path] = "/"; //$NON-NLS-1$
}
<BUG>boolean secure = Boolean.valueOf(st[_secure]).booleanValue();
long expires = Long.valueOf(st[_expires]).longValue();
</BUG>
if (expires==Long.MAX_VALUE) {
| boolean secure = Boolean.parseBoolean(st[_secure]);
long expires = Long.parseLong(st[_expires]);
|
23,329 | import com.fincatto.nfe310.FabricaDeObjetosFake;
import org.junit.Assert;
import org.junit.Test;
import java.math.BigDecimal;
import java.util.ArrayList;
<BUG>import java.util.Arrays;
import java.util.List;</BUG>
public class NFEnviaEventoCancelamentoTest {
@Test
public void deveObterEventosComoFoiSetado() {
| import java.util.Collections;
import java.util.List;
|
23,330 | import com.fincatto.nfe310.FabricaDeObjetosFake;
import com.fincatto.nfe310.classes.nota.NFNota;
import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
<BUG>import java.util.Arrays;
import java.util.List;</BUG>
public class NFLoteEnvioTest {
@Test
public void devePermitirNotasComTamanho50() {
| import java.util.Collections;
import java.util.List;
|
23,331 | public void deveGerarXMLDeAcordoComOPadraoEstabelecido() {
final NFLoteEnvio loteEnvio = new NFLoteEnvio();
loteEnvio.setIdLote("333972757970401");
loteEnvio.setVersao("3.10");
loteEnvio.setIndicadorProcessamento(NFLoteIndicadorProcessamento.PROCESSAMENTO_ASSINCRONO);
<BUG>loteEnvio.setNotas(Arrays.asList(FabricaDeObje... | loteEnvio.setNotas(Collections.singletonList(FabricaDeObjetosFake.getNFNota()));
|
23,332 | import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
<BUG>import java.util.Arrays;
public class FabricaDeObjetosFake {</BUG>
public static NFInformacaoImpostoDevolvido getNFInformacaoImpostoDevolvido() {
final NFInformacaoIm... | import java.util.Collections;
public class FabricaDeObjetosFake {
|
23,333 | info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente());
info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal());
info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao());
info.setIdentificador("89172658591754401086218048846976493475937081");
info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFN... | info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe()));
|
23,334 | imposto.setValorTotalTributos(new BigDecimal("999999999999.99"));
item.setImposto(imposto);
item.setNumeroItem(990);
item.setProduto(FabricaDeObjetosFake.getProdutoMedicamento());
item.setImpostoDevolvido(FabricaDeObjetosFake.getNFImpostoDevolvido());
<BUG>info.setItens(Arrays.asList(item));
info.setRetirada(FabricaDeO... | info.setItens(Collections.singletonList(item));
info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal());
|
23,335 | identificacao.setFormaPagamento(NFFormaPagamentoPrazo.A_PRAZO);
identificacao.setModelo(NFModelo.NFE);
identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ");
identificacao.setNumeroNota("999999999");
identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE);
<BUG>ident... | identificacao.setReferenciadas(Collections.singletonList(referenciada));
|
23,336 | produtoMedicamento.setCfop("1302");
produtoMedicamento.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq");
produtoMedicamento.setCodigoDeBarras("36811963532505");
produtoMedicamento.setCodigoDeBarrasTributavel("36811963532505");
produtoMedicamento.setCampoeValorNota(NFProdutoCompoeValorNota.SIM);... | produtoMedicamento.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao()));
|
23,337 | produtoMedicamento.setValorSeguro(new BigDecimal("999999999999.99"));
produtoMedicamento.setValorTotalBruto(new BigDecimal("999999999999.99"));
produtoMedicamento.setValorUnitario(new BigDecimal("9999999999.9999999999"));
produtoMedicamento.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999"));
produtoMed... | produtoMedicamento.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123"));
|
23,338 | info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal());
info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal());
info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte());
info.setVersao(new BigDecimal("3.10"));
<BUG>info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutori... | info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe()));
|
23,339 | identificacao.setFormaPagamento(NFFormaPagamentoPrazo.A_PRAZO);
identificacao.setModelo(NFModelo.NFE);
identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ");
identificacao.setNumeroNota("999999999");
identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE);
<BUG>ident... | identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada()));
|
23,340 | return compra;
}
public static NFNotaInfoCobranca getNFNotaInfoCobranca() {
final NFNotaInfoCobranca cobranca = new NFNotaInfoCobranca();
cobranca.setFatura(FabricaDeObjetosFake.getNFNotaInfoFatura());
<BUG>cobranca.setDuplicatas(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoDuplicata()));
</BUG>
return cobranca;
}
p... | cobranca.setDuplicatas(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoDuplicata()));
|
23,341 | </BUG>
produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP");
produto.setExtipi("999");
produto.setCodigoEspecificadorSituacaoTributaria("9999999");
<BUG>produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoIte... | produto.setCfop("1302");
produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq");
produto.setCodigoDeBarras("36811963532505");
produto.setCodigoDeBarrasTributavel("36811963532505");
produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM);
produto.setDeclaracoesImportacao(Collections.singleton... |
23,342 | produto.setValorFrete(new BigDecimal("999999999999.99"));
produto.setValorOutrasDespesasAcessorias(new BigDecimal("999999999999.99"));
produto.setValorSeguro(new BigDecimal("999999999999.99"));
produto.setValorTotalBruto(new BigDecimal("999999999999.99"));
produto.setValorUnitario(new BigDecimal("9999999999.9999999999"... | produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123"));
|
23,343 | medicamento.setQuantidade(new BigDecimal("9999999.999"));
return medicamento;
}
public static NFNotaInfoItemProdutoDeclaracaoImportacao getNFNotaInfoItemProdutoDeclaracaoImportacao() {
final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao();
<BUG>declaraoImpo... | declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao()));
|
23,344 | public static NFNotaInfoVolume getNFNotaInfoVolume() {
final NFNotaInfoVolume volume = new NFNotaInfoVolume();
volume.setEspecieVolumesTransportados("3Qf46HFs7FcWlhuQqLJ96vsrgJHu6B5ZXmmwMZ1RtvQVOV4Yp6M9VNqn5Ecb");
final NFNotaInfoLacre notaInfoLacre = new NFNotaInfoLacre();
notaInfoLacre.setNumeroLacre("gvmjb9BB2cmwsLb... | volume.setLacres(Collections.singletonList(notaInfoLacre));
|
23,345 | public void deveGerarXMLDeAcordoComOPadraoEstabelecido() {
final NFLoteConsultaRetorno retorno = new NFLoteConsultaRetorno();
retorno.setAmbiente(NFAmbiente.HOMOLOGACAO);
retorno.setMotivo("8CwtnC5gWwUncMBYAZl9p4fvVx8RkCH2EKx2mtUNVA5tLoJsjNWL5CJ6DXNUHTWKpPl6fMKKxA0aXBu6IfmJLIHlPxtF0oZkKrNsGyGpwKqWxvDZ9HQGqscmhtTrp5NbNz... | retorno.setProtocolos(Collections.singletonList(FabricaDeObjetosFake.getNFProtocolo()));
|
23,346 | import java.net.URI;
import java.util.Calendar;
import java.util.Date;
import java.util.Formatter;
import java.util.List;
<BUG>import javax.ws.rs.core.UriBuilder;
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.util.URIUtil;</BUG>
import org.suigeneris.jrcs.rcs.Version;
import or... | [DELETED] |
23,347 | if (home != null) {
space.setHome(home.getPrefixedFullName());
space.setXwikiRelativeUrl(home.getURL("view"));
space.setXwikiAbsoluteUrl(home.getExternalURL("view"));
}
<BUG>String pagesUri = UriBuilder.fromUri(baseUri).path(PagesResource.class).build(wikiName, spaceName).toString();
</BUG>
Link pagesLink = objectFacto... | String pagesUri = uri(baseUri, PagesResource.class, wikiName, spaceName);
|
23,348 | Link pagesLink = objectFactory.createLink();
pagesLink.setHref(pagesUri);
pagesLink.setRel(Relations.PAGES);
space.getLinks().add(pagesLink);
if (home != null) {
<BUG>String homeUri =
UriBuilder.fromUri(baseUri).path(PageResource.class).build(wikiName, spaceName, home.getName())
.toString();</BUG>
Link homeLink = obje... | String homeUri = uri(baseUri, PageResource.class, wikiName, spaceName, home.getName());
|
23,349 | .toString();</BUG>
Link homeLink = objectFactory.createLink();
homeLink.setHref(homeUri);
homeLink.setRel(Relations.HOME);
space.getLinks().add(homeLink);
<BUG>}
String searchUri =
UriBuilder.fromUri(baseUri).path(SpaceSearchResource.class).build(wikiName, spaceName).toString();</BUG>
Link searchLink = objectFactory.cr... | Link pagesLink = objectFactory.createLink();
pagesLink.setHref(pagesUri);
pagesLink.setRel(Relations.PAGES);
space.getLinks().add(pagesLink);
if (home != null) {
String homeUri = uri(baseUri, PageResource.class, wikiName, spaceName, home.getName());
String searchUri = uri(baseUri, SpaceSearchResource.class, wikiName, s... |
23,350 | if (!languages.isEmpty()) {
if (!doc.getDefaultLanguage().equals("")) {
translations.setDefault(doc.getDefaultLanguage());
Translation translation = objectFactory.createTranslation();
translation.setLanguage(doc.getDefaultLanguage());
<BUG>String pageTranslationUri =
UriBuilder.fromUri(baseUri).path(PageResource.class)... | uri(baseUri, PageResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
23,351 | }
}
for (String language : languages) {
Translation translation = objectFactory.createTranslation();
translation.setLanguage(language);
<BUG>String pageTranslationUri =
UriBuilder.fromUri(baseUri).path(PageTranslationResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), language).toString();</BUG>
Link p... | uri(baseUri, PageTranslationResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), language);
|
23,352 | Link pageTranslationLink = objectFactory.createLink();
pageTranslationLink.setHref(pageTranslationUri);
pageTranslationLink.setRel(Relations.PAGE);
translation.getLinks().add(pageTranslationLink);
String historyUri =
<BUG>UriBuilder.fromUri(baseUri).path(PageTranslationHistoryResource.class)
.build(doc.getWiki(), doc.g... | uri(baseUri, PageTranslationHistoryResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
language);
Link historyLink = objectFactory.createLink();
|
23,353 | pageSummary.setParent(doc.getParent());
if (parent != null && !parent.isNew()) {
pageSummary.setParentId(parent.getPrefixedFullName());
} else {
pageSummary.setParentId("");
<BUG>}
String spaceUri =
UriBuilder.fromUri(baseUri).path(SpaceResource.class).build(doc.getWiki(), doc.getSpace()).toString();</BUG>
Link spaceLi... | String spaceUri = uri(baseUri, SpaceResource.class, doc.getWiki(), doc.getSpace());
|
23,354 | UriBuilder.fromUri(baseUri).path(SpaceResource.class).build(doc.getWiki(), doc.getSpace()).toString();</BUG>
Link spaceLink = objectFactory.createLink();
spaceLink.setHref(spaceUri);
spaceLink.setRel(Relations.SPACE);
pageSummary.getLinks().add(spaceLink);
<BUG>if (parent != null) {
String parentUri =
UriBuilder.fromUr... | pageSummary.setParent(doc.getParent());
if (parent != null && !parent.isNew()) {
pageSummary.setParentId(parent.getPrefixedFullName());
} else {
pageSummary.setParentId("");
}
String spaceUri = uri(baseUri, SpaceResource.class, doc.getWiki(), doc.getSpace());
String parentUri = uri(baseUri, PageResource.class, parent.g... |
23,355 | Link historyLink = objectFactory.createLink();
historyLink.setHref(historyUri);
historyLink.setRel(Relations.HISTORY);
pageSummary.getLinks().add(historyLink);
if (!doc.getChildren().isEmpty()) {
<BUG>String pageChildrenUri =
UriBuilder.fromUri(baseUri).path(PageChildrenResource.class)
.build(doc.getWiki(), doc.getSpac... | uri(baseUri, PageChildrenResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
23,356 | objectsLink.setRel(Relations.OBJECTS);
pageSummary.getLinks().add(objectsLink);
}
com.xpn.xwiki.api.Object tagsObject = doc.getObject("XWiki.TagClass", 0);
if (tagsObject != null) {
<BUG>if (tagsObject.getProperty("tags") != null) {
String tagsUri =
UriBuilder.fromUri(baseUri).path(PageTagsResource.class)
.build(doc.ge... | String tagsUri = uri(baseUri, PageTagsResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
23,357 | tagsLink.setHref(tagsUri);
tagsLink.setRel(Relations.TAGS);
pageSummary.getLinks().add(tagsLink);
}
}
<BUG>String syntaxesUri = UriBuilder.fromUri(baseUri).path(SyntaxesResource.class).build().toString();
Link syntaxesLink = objectFactory.createLink();</BUG>
syntaxesLink.setHref(syntaxesUri);
syntaxesLink.setRel(Relati... | String syntaxesUri = uri(baseUri, SyntaxesResource.class);
Link syntaxesLink = objectFactory.createLink();
|
23,358 | }
return historySummary;
}
private static void fillAttachment(Attachment attachment, ObjectFactory objectFactory, URI baseUri,
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,
XWiki xwikiApi, Boolean withPrettyNames)
{</BUG>
Document doc = xwikiAttachment.getDocument... | com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,
{
|
23,359 | Calendar calendar = Calendar.getInstance();
calendar.setTime(xwikiAttachment.getDate());
attachment.setDate(calendar);
attachment.setXwikiRelativeUrl(xwikiRelativeUrl);
attachment.setXwikiAbsoluteUrl(xwikiAbsoluteUrl);
<BUG>String pageUri =
UriBuilder.fromUri(baseUri).path(PageResource.class).build(doc.getWiki(), doc.g... | String pageUri = uri(baseUri, PageResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
23,360 | }
return attachmentUri;
}</BUG>
public static Attachment createAttachment(ObjectFactory objectFactory, URI baseUri,
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,
XWiki xwikiApi, Boolean withPrettyNames)
{</BUG>
Attachment attachment = objectFactory.createAttachmen... | com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,
{
|
23,361 | attachmentLink.setRel(Relations.ATTACHMENT_DATA);
attachment.getLinks().add(attachmentLink);
return attachment;
}
public static Attachment createAttachmentAtVersion(ObjectFactory objectFactory, URI baseUri,
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,
XWiki xwiki... | com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,
{
|
23,362 | .build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(),
xwikiObject.getClassName(),
xwikiObject.getNumber()).toString();</BUG>
} else {
<BUG>propertiesUri =
UriBuilder
.fromUri(baseUri)
.path(ObjectPropertiesResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(),
... | fillObjectSummary(objectSummary, objectFactory, baseUri, doc, xwikiObject, xwikiApi, withPrettyNames);
Link objectLink = getObjectLink(objectFactory, baseUri, doc, xwikiObject, useVersion, Relations.OBJECT);
objectSummary.getLinks().add(objectLink);
String propertiesUri;
if (useVersion) {
uri(baseUri, ObjectPropertiesA... |
23,363 | .build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(),
xwikiObject.getClassName(), xwikiObject.getNumber(), propertyClass.getName())
.toString();</BUG>
} else {
<BUG>propertyUri =
UriBuilder
.fromUri(baseUri)
.path(ObjectPropertyResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiO... | propertiesUri =
uri(baseUri, ObjectPropertiesResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
xwikiObject.getClassName(), xwikiObject.getNumber());
|
23,364 | .build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(),
xwikiObject.getClassName(),
xwikiObject.getNumber()).toString();</BUG>
} else {
<BUG>objectUri =
UriBuilder
.fromUri(baseUri)
.path(ObjectResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(),
xwikiObject.ge... | private static Link getObjectLink(ObjectFactory objectFactory, URI baseUri, Document doc, BaseObject xwikiObject,
boolean useVersion, String relation)
String objectUri;
if (useVersion) {
uri(baseUri, ObjectAtPageVersionResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
doc.getVersion(), xwikiObject.getClassN... |
23,365 | Link propertyLink = objectFactory.createLink();
propertyLink.setHref(propertyUri);
propertyLink.setRel(Relations.SELF);
property.getLinks().add(propertyLink);
clazz.getProperties().add(property);
<BUG>}
String classUri =
UriBuilder.fromUri(baseUri).path(ClassResource.class).build(wikiName, xwikiClass.getName()).toStrin... | String classUri = uri(baseUri, ClassResource.class, wikiName, xwikiClass.getName());
|
23,366 | String classUri =
UriBuilder.fromUri(baseUri).path(ClassResource.class).build(wikiName, xwikiClass.getName()).toString();</BUG>
Link classLink = objectFactory.createLink();
classLink.setHref(classUri);
classLink.setRel(Relations.SELF);
<BUG>clazz.getLinks().add(classLink);
String propertiesUri =
UriBuilder.fromUri(base... | propertyLink.setHref(propertyUri);
propertyLink.setRel(Relations.SELF);
property.getLinks().add(propertyLink);
clazz.getProperties().add(property);
}
String classUri = uri(baseUri, ClassResource.class, wikiName, xwikiClass.getName());
String propertiesUri = uri(baseUri, ClassPropertiesResource.class, wikiName, xwikiCla... |
23,367 | <BUG>package org.xwiki.rest.internal;
import org.apache.commons.lang3.StringUtils;</BUG>
import org.xwiki.component.manager.ComponentManager;
import org.xwiki.context.Execution;
import org.xwiki.model.reference.EntityReferenceSerializer;
| import java.net.URI;
import javax.ws.rs.core.UriBuilder;
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.util.URIUtil;
import org.apache.commons.lang3.StringUtils;
|
23,368 | package com.sun.faces.application;
<BUG>import com.sun.faces.config.WebConfiguration;
import com.sun.faces.flow.FlowDiscoveryCDIExtension;
import com.sun.faces.util.FacesLogger;
import com.sun.faces.util.Util;
import java.io.IOException;</BUG>
import java.util.List;
| import static com.sun.faces.config.WebConfiguration.WebContextInitParameter.ClientWindowMode;
import static com.sun.faces.util.Util.getCdiBeanManager;
import static java.util.logging.Level.SEVERE;
import static java.util.logging.Level.WARNING;
import java.io.IOException;
|
23,369 | import com.sun.faces.util.Util;
import java.io.IOException;</BUG>
import java.util.List;
<BUG>import java.util.logging.Level;
import java.util.logging.Logger;
import javax.enterprise.inject.spi.Bean;</BUG>
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.Producer;
import javax.faces.co... | package com.sun.faces.application;
import static com.sun.faces.config.WebConfiguration.WebContextInitParameter.ClientWindowMode;
import static com.sun.faces.util.Util.getCdiBeanManager;
import static java.util.logging.Level.SEVERE;
import static java.util.logging.Level.WARNING;
import java.io.IOException;
import javax.... |
23,370 |
Flow toAdd = cur.produce(beanManager.<Flow>createCreationalContext(null));
</BUG>
if (null == toAdd) {
<BUG>LOGGER.log(Level.SEVERE, "Flow producer method {0}() returned null. Ignoring.", cur.toString());
</BUG>
} else {
flowHandler.addFlow(context, toAdd);
config.setHasFlows(true);
}
| List<Producer<Flow>> flowProducers = myExtension.getFlowProducers();
WebConfiguration config = WebConfiguration.getInstance();
if (!flowProducers.isEmpty()) {
enableClientWindowModeIfNecessary(context);
for (Producer<Flow> flowProducer : flowProducers) {
Flow toAdd = flowProducer.produce(beanManager.<Flow>createCreatio... |
23,371 | package com.sun.faces.application;
<BUG>import com.sun.faces.util.Util;
</BUG>
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
| import static com.sun.faces.util.Util.loadClass;
|
23,372 | Class<? extends SystemEvent> namedEvent = namedEvents.get(name);
if (namedEvent == null) {
try {
<BUG>namedEvent = Util.loadClass(name, this);
} catch (ClassNotFoundException ex) {
throw new FacesException ("An unknown event type was specified: " + name, ex);
}</BUG>
}
if (!ComponentSystemEvent.class.isAssignableFrom(... | namedEvent = (Class<? extends SystemEvent>) loadClass(name, this);
throw new FacesException("An unknown event type was specified: " + name, ex);
|
23,373 | import jetbrains.mps.openapi.editor.cells.CellActionType;
import jetbrains.mps.editor.runtime.cells.AbstractCellAction;
import jetbrains.mps.internal.collections.runtime.ListSequence;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFacto... | import jetbrains.mps.editor.runtime.selection.SelectionUtil;
import jetbrains.mps.openapi.editor.selection.SelectionManager;
public class IfStatement_LastBrace {
|
23,374 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.List;
<BUG>import java.util.Optional;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandDel... | import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
23,375 | .append(Text.of(TextColors.GREEN, "Usage: "))
.append(getUsage(source))
.build());
return CommandResult.empty();
} else if (isIn(REGIONS_ALIASES, parse.args[0])) {
<BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
IRegion region = FGManager.getInstance().getRegion(parse.args[1... | String regionName = parse.args[1];
IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
|
23,376 | </BUG>
isWorldRegion = true;
}
if (region == null)
<BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!"));
if (region instanceof GlobalWorldRegion) {
</BUG>
throw new CommandException(Text.of("You may not delete the global region!"));
}
| if (world == null)
throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!"));
if (world == null) throw new CommandException(Text.of("Must specify a world!"));
region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null);
throw new CommandException(Text.of("No region exis... |
23,377 | source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region"
);
return CommandResult.success();
} else if (isIn(HANDLERS_ALIASES, parse.args[0])) {
if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
<BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[... | Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]);
if (!handlerOpt.isPresent())
IHandler handler = handlerOpt.get();
if (handler instanceof GlobalHandler)
|
23,378 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix... | return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
23,379 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix... | return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
23,380 | @Dependency(id = "foxcore")
},
description = "A world protection plugin built for SpongeAPI. Requires FoxCore.",
authors = {"gravityfox"},
url = "https://github.com/FoxDenStudio/FoxGuard")
<BUG>public final class FoxGuardMain {
public final Cause pluginCause = Cause.builder().named("plugin", this).build();
private stat... | private static FoxGuardMain instanceField;
|
23,381 | private UserStorageService userStorage;
private EconomyService economyService = null;
private boolean loaded = false;
private FCCommandDispatcher fgDispatcher;
public static FoxGuardMain instance() {
<BUG>return instanceField;
}</BUG>
@Listener
public void construct(GameConstructionEvent event) {
instanceField = this;
| }
public static Cause getCause() {
return instance().pluginCause;
}
|
23,382 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
23,383 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.*;
<BUG>import java.util.stream.Collectors;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class Comm... | import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
23,384 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix... | return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
23,385 | private static FGStorageManager instance;
private final Logger logger = FoxGuardMain.instance().getLogger();</BUG>
private final Set<LoadEntry> loaded = new HashSet<>();
private final Path directory = getDirectory();
private final Map<String, Path> worldDirectories;
<BUG>private FGStorageManager() {
defaultModifiedMap ... | public final HashMap<IFGObject, Boolean> defaultModifiedMap;
private final UserStorageService userStorageService;
private final Logger logger = FoxGuardMain.instance().getLogger();
userStorageService = FoxGuardMain.instance().getUserStorage();
defaultModifiedMap = new CacheMap<>((k, m) -> {
|
23,386 | String name = fgObject.getName();
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fg... | UUID owner = fgObject.getOwner();
boolean isOwned = !owner.equals(SERVER_UUID);
Optional<User> userOwner = userStorageService.get(owner);
String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name;
if (fgObject.autoSave()) {
Path singleDir = serverDir.resolve(n... |
23,387 | if (fgObject.autoSave()) {
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgOb... | Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
|
23,388 | public synchronized void loadRegionLinks() {
logger.info("Loading region links");
try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(... | Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());
if (regionOpt.isPresent()) {
IRegion region = regionOpt.get();
logger.info("Loading links for region \"" + region.getName() + "\"");
|
23,389 | public synchronized void loadWorldRegionLinks(World world) {
logger.info("Loading world region links for world \"" + world.getName() + "\"");
try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("l... | Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (regionOpt.isPresent()) {
IWorldRegion region = regionOpt.get();
logger.info("Loading links for world region \"" + region.getName() + "\"");
|
23,390 | StringBuilder builder = new StringBuilder();
for (Iterator<IHandler> it = handlers.iterator(); it.hasNext(); ) {
builder.append(it.next().getName());
if (it.hasNext()) builder.append(",");
}
<BUG>return builder.toString();
}</BUG>
private final class LoadEntry {
public final String name;
public final Type type;
| public enum Type {
REGION, WREGION, HANDLER
|
23,391 | .autoCloseQuotes(true)
.leaveFinalAsIs(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream()
</BUG>
.filter(new StartsWithPredicate(parse.current.token))
.co... | return Stream.of("region", "worldregion", "handler", "controller")
|
23,392 | @Test
public void testRestletProducer() throws Exception {
Map<String, Object> headers = new HashMap<String, Object>();
headers.put("id", 123);
headers.put("beverage.beer", "Carlsberg");
<BUG>Object out = template.requestBodyAndHeaders("direct:start", null, headers);
</BUG>
assertEquals("<response>Beer is Good</respons... | String out = template.requestBodyAndHeaders("direct:start", null, headers, String.class);
|
23,393 | import org.restlet.representation.StringRepresentation;
public class RestletSetBodyTest extends RestletTestSupport {
protected static int portNum2 = AvailablePortFinder.getNextAvailable(4000);
@Test
public void testSetBody() throws Exception {
<BUG>String response = template.requestBody("restlet:http://0.0.0.0:" + port... | String response = template.requestBody("restlet:http://localhost:" + portNum + "/stock/ORCL?restletMethod=get", null, String.class);
|
23,394 | </BUG>
assertEquals("110", response);
}
@Test
public void testSetBodyRepresentation() throws Exception {
<BUG>HttpGet get = new HttpGet("http://0.0.0.0:" + portNum + "/images/123");
</BUG>
CloseableHttpClient httpclient = HttpClientBuilder.create().build();
InputStream is = null;
try {
| import org.restlet.representation.StringRepresentation;
public class RestletSetBodyTest extends RestletTestSupport {
protected static int portNum2 = AvailablePortFinder.getNextAvailable(4000);
public void testSetBody() throws Exception {
String response = template.requestBody("restlet:http://localhost:" + portNum + "/s... |
23,395 |
.to("http://127.0.0.1:" + portNum2 + "/test?bridgeEndpoint=true")
</BUG>
.setBody().constant("110");
<BUG>from("jetty:http://0.0.0.0:" + portNum2 + "/test").setBody().constant("response is back");
</BUG>
byte[] image = new byte[10];
for (int i = 0; i < 10; i++) {
image[i] = (byte)(i + 1);
}
| @Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
from("restlet:http://localhost:" + portNum + "/stock/{symbol}?restletMethods=get")
.to("http://localhost:" + portNum2 + "/test?bridgeEndpoint=true")
from("jetty:http:... |
23,396 | final String id = "89531";
Map<String, Object> headers = new HashMap<String, Object>();
headers.put(RestletConstants.RESTLET_LOGIN, "admin");
headers.put(RestletConstants.RESTLET_PASSWORD, "foo");
headers.put("id", id);
<BUG>String response = (String)template.requestBodyAndHeaders(
"direct:start-auth", "<order foo='1'/... | String response = template.requestBodyAndHeaders(
"direct:start-auth", "<order foo='1'/>", headers, String.class);
|
23,397 | @Override
protected void validate(File assetFile) throws ImageValidationException {
ImageValidator validator = new ImageValidator(assetFile, POSTER_TYPE);
validator.validateSize(POSTER_MIN_WIDTH, POSTER_MIN_HEIGHT);
validator.validateAspectRatio(new BigFraction(POSTER_AR_NUMERATOR).divide(POSTER_AR_DENOMINATOR));
<BUG>... | protected boolean checkMandatoryParams() {
return vendorId != null && locale != null;
validator.validateJpegOrPng();
|
23,398 | import com.netflix.imfutility.itunes.asset.CaptionsAssetProcessor;
import com.netflix.imfutility.itunes.asset.ChapterAssetProcessor;
import com.netflix.imfutility.itunes.asset.PosterAssetProcessor;
import com.netflix.imfutility.itunes.asset.SourceAssetProcessor;
import com.netflix.imfutility.itunes.asset.SubtitlesAsset... | import com.netflix.imfutility.itunes.audiomap.AudioMapXmlProvider;
import com.netflix.imfutility.itunes.audiomap.AudioMapXmlProvider.AudioOption;
import com.netflix.imfutility.itunes.chapters.ChaptersXmlProvider;
|
23,399 | import com.netflix.imfutility.itunes.locale.LocaleHelper;
import com.netflix.imfutility.itunes.locale.LocaleValidator;
import com.netflix.imfutility.itunes.mediainfo.SimpleMediaInfoBuilder;
import com.netflix.imfutility.itunes.metadata.MetadataXmlProvider;
import com.netflix.imfutility.itunes.metadata.film.FilmMetadata... | [DELETED] |
23,400 | import com.netflix.imfutility.itunes.inputparameters.ITunesCmdLineArgs;
import com.netflix.imfutility.itunes.inputparameters.ITunesDefaultTools;
import com.netflix.imfutility.itunes.inputparameters.ITunesInputParameters;
import com.netflix.imfutility.itunes.inputparameters.ITunesInputParametersValidator;
import com.net... | import com.netflix.imfutility.itunes.audiomap.AudioMapXmlProvider;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.