id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
39,201
@Override public boolean suggestUseCompoundFile() { return suggestUseCompoundFile; } private static class CustomMMapDirectory extends MMapDirectory implements ForceSyncDirectory { private final boolean syncToDisk; <BUG>private CustomMMapDirectory(File path, boolean syncToDisk) throws IOException { super(path); this.sy...
private CustomMMapDirectory(File path, LockFactory lockFactory, boolean syncToDisk) throws IOException { super(path, lockFactory); this.syncToDisk = syncToDisk;
39,202
package org.elasticsearch.index.store.fs; <BUG>import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.NIOFSDirectory;</BUG> import org.elasticsearch.env.Environment;
import org.apache.lucene.store.*;
39,203
@Override public boolean suggestUseCompoundFile() { return suggestUseCompoundFile; } private static class CustomNioFSDirectory extends NIOFSDirectory implements ForceSyncDirectory { private final boolean syncToDisk; <BUG>private CustomNioFSDirectory(File path, boolean syncToDisk) throws IOException { super(path); this...
private CustomNioFSDirectory(File path, LockFactory lockFactory, boolean syncToDisk) throws IOException { super(path, lockFactory); this.syncToDisk = syncToDisk;
39,204
package org.elasticsearch.index.store.fs; <BUG>import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.SimpleFSDirectory;</BUG> import org.elasticsearch.env.Environment;
import org.apache.lucene.store.*;
39,205
@Override public boolean suggestUseCompoundFile() { return suggestUseCompoundFile; } private static class CustomSimpleFSDirectory extends SimpleFSDirectory implements ForceSyncDirectory { private final boolean syncToDisk; <BUG>private CustomSimpleFSDirectory(File path, boolean syncToDisk) throws IOException { super(pa...
private CustomSimpleFSDirectory(File path, LockFactory lockFactory, boolean syncToDisk) throws IOException { super(path, lockFactory); this.syncToDisk = syncToDisk;
39,206
import java.util.Locale; import java.util.Set; import org.apache.commons.logging.Log; public class CmsResourceTypeXmlContainerPage extends CmsResourceTypeXmlContent { public static final int CONFIGURATION_TYPE_ID = 14; <BUG>public static final int SUB_CONTAINER_TYPE_ID = 17; private static final Log LOG = CmsLog.getLog...
public static final String SUB_CONTAINER_TYPE_NAME = "subcontainer"; private static final Log LOG = CmsLog.getLog(CmsResourceTypeXmlContainerPage.class);
39,207
import org.opencms.file.CmsFile; import org.opencms.file.CmsObject; import org.opencms.file.CmsProperty; import org.opencms.file.CmsResource; import org.opencms.file.CmsResourceFilter; <BUG>import org.opencms.file.CmsUser; import org.opencms.file.types.I_CmsResourceType;</BUG> import org.opencms.i18n.CmsLocaleManager; ...
import org.opencms.file.types.CmsResourceTypeXmlContainerPage; import org.opencms.file.types.I_CmsResourceType;
39,208
getRequest()); CmsSubContainerBean subContainer = xmlSubContainer.getSubContainer( cms, cms.getRequestContext().getLocale()); for (CmsContainerElementBean subElement : subContainer.getElements()) { <BUG>if (!ids.contains(subElement.getElementId())) { String subId = subElement.getClientId();</BUG> if (ids.contains(subId...
m_sessionCache.setCacheContainerElement(subElement.getClientId(), subElement); String subId = subElement.getClientId();
39,209
import com.intellij.openapi.roots.ModuleRootEvent; import com.intellij.openapi.roots.ProjectFileIndex; import com.intellij.openapi.util.Key; import com.intellij.openapi.util.NotNullLazyKey; import com.intellij.openapi.vfs.*; <BUG>import com.intellij.ui.EditorNotifications; import com.intellij.util.NotNullFunction; impo...
import com.intellij.util.NullableFunction; import com.intellij.util.SmartList;
39,210
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;
39,211
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;
39,212
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()));
39,213
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 {
39,214
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()));
39,215
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());
39,216
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));
39,217
produtoMedicamento.setCfop("1302"); produtoMedicamento.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produtoMedicamento.setCodigoDeBarras("36811963532505"); produtoMedicamento.setCodigoDeBarrasTributavel("36811963532505"); produtoMedicamento.setCampoeValorNota(NFProdutoCompoeValorNota.SIM);...
produtoMedicamento.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao()));
39,218
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"));
39,219
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()));
39,220
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()));
39,221
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()));
39,222
</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...
39,223
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"));
39,224
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()));
39,225
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));
39,226
public void deveGerarXMLDeAcordoComOPadraoEstabelecido() { final NFLoteConsultaRetorno retorno = new NFLoteConsultaRetorno(); retorno.setAmbiente(NFAmbiente.HOMOLOGACAO); retorno.setMotivo("8CwtnC5gWwUncMBYAZl9p4fvVx8RkCH2EKx2mtUNVA5tLoJsjNWL5CJ6DXNUHTWKpPl6fMKKxA0aXBu6IfmJLIHlPxtF0oZkKrNsGyGpwKqWxvDZ9HQGqscmhtTrp5NbNz...
retorno.setProtocolos(Collections.singletonList(FabricaDeObjetosFake.getNFProtocolo()));
39,227
.build(); } protected static ClonePart newClonePart(String resourceId, int unitStart, int cloneUnitLength) { return new ClonePart(resourceId, unitStart, unitStart, unitStart + cloneUnitLength + LINES_PER_BLOCK - 1); } <BUG>protected abstract List<CloneGroup> detect(CloneIndex index, List<Block> fileBlocks); </BUG> @Tes...
protected abstract List<CloneGroup> detect(CloneIndex index, Block[] fileBlocks);
39,228
@Test public void exampleFromPaper() { CloneIndex index = createIndex( newBlocks("y", "2 3 4 5"), newBlocks("z", "3 4")); <BUG>List<Block> fileBlocks = newBlocks("x", "1 2 3 4 5 6"); </BUG> List<CloneGroup> result = detect(index, fileBlocks); print(result); assertEquals(2, result.size());
Block[] fileBlocks = newBlocks("x", "1 2 3 4 5 6");
39,229
newClonePart("b", 0, 2))); } @Test public void only_one_query_of_index_for_each_unique_hash() { CloneIndex index = spy(createIndex()); <BUG>List<Block> fileBlocks = newBlocks("a", "1 2 1 2"); </BUG> detect(index, fileBlocks); verify(index).getBySequenceHash(new ByteArray("01")); verify(index).getBySequenceHash(new Byte...
Block[] fileBlocks = newBlocks("a", "1 2 1 2");
39,230
verify(index).getBySequenceHash(new ByteArray("02")); verifyNoMoreInteractions(index); } @Test public void shouldReturnEmptyListWhenNoBlocksForFile() { <BUG>List<CloneGroup> result = detect(null, new ArrayList<Block>()); </BUG> assertThat(result, sameInstance(Collections.EMPTY_LIST)); } @Test
List<CloneGroup> result = detect(null, new Block[0]);
39,231
} @Test public void problemWithEndOfFile() { CloneIndex cloneIndex = createIndex( newBlocks("b", "1 2 3 4")); <BUG>List<Block> fileBlocks = </BUG> newBlocks("a", "1 2 3"); List<CloneGroup> clones = detect(cloneIndex, fileBlocks); print(clones);
public void shouldReturnEmptyListWhenNoBlocksForFile() { List<CloneGroup> result = detect(null, new Block[0]); assertThat(result, sameInstance(Collections.EMPTY_LIST)); Block[] fileBlocks =
39,232
for (CloneGroup clone : clones) { System.out.println(clone); } System.out.println(); } <BUG>protected static List<Block> newBlocks(String resourceId, String hashes) { </BUG> List<Block> result = Lists.newArrayList(); int indexInFile = 0; for (int i = 0; i < hashes.length(); i += 2) {
protected static Block[] newBlocks(String resourceId, String hashes) {
39,233
assertEquals(1, result.size()); } @Test public void myTest() { CloneIndex index = createIndex(); <BUG>List<Block> fileBlocks = newBlocks("x", "a 2 b 2 c 2 2 2"); </BUG> List<CloneGroup> result = detect(index, fileBlocks); print(result); assertEquals(2, result.size());
Block[] fileBlocks = newBlocks("x", "a 2 b 2 c 2 2 2");
39,234
newClonePart("x", 7, 1))); } @Test public void myTest2() { CloneIndex index = createIndex(); <BUG>List<Block> fileBlocks = newBlocks("x", "a 2 3 b 2 3 c 2 3 d 2 3 2 3 2 3"); </BUG> List<CloneGroup> result = detect(index, fileBlocks); print(result); assertEquals(2, result.size());
Block[] fileBlocks = newBlocks("x", "a 2 3 b 2 3 c 2 3 d 2 3 2 3 2 3");
39,235
public void myTest3() { CloneIndex index = createIndex( newBlocks("b", "4 3 2"), newBlocks("c", "4 3 1") ); <BUG>List<Block> fileBlocks = newBlocks("a", "1 2 3 4"); </BUG> List<CloneGroup> result = detect(index, fileBlocks); print(result); assertEquals(4, result.size());
Block[] fileBlocks = newBlocks("a", "1 2 3 4");
39,236
newClonePart("a", 3, 1), newClonePart("b", 0, 1), newClonePart("c", 0, 1))); } @Override <BUG>protected List<CloneGroup> detect(CloneIndex index, List<Block> fileBlocks) { return SuffixTreeCloneDetectionAlgorithm.detect(index, fileBlocks); </BUG> }
[DELETED]
39,237
if (phaseAnnotation != null) { return phaseAnnotation.name(); } return Phase.Name.DEFAULT; } <BUG>private void evaluateMethod(Object extension, Method method, List results) { </BUG> try { Object result = method.invoke(extension); if (result != null) {
private void evaluateMethod(Object extension, Method method, List<Object> results) {
39,238
try { Object result = method.invoke(extension); if (result != null) { if (result instanceof Class) { results.addAll(componentContainer.getComponentsByType((Class) result)); <BUG>} else if (result instanceof Collection) { results.addAll((Collection) result); </BUG> } else {
} else if (result instanceof Collection<?>) { results.addAll((Collection<?>) result);
39,239
import org.sonar.duplications.detector.DetectorTestCase; import org.sonar.duplications.index.CloneGroup; import org.sonar.duplications.index.CloneIndex; public class OriginalCloneDetectionAlgorithmTest extends DetectorTestCase { @Override <BUG>protected List<CloneGroup> detect(CloneIndex index, List<Block> fileBlocks) ...
protected List<CloneGroup> detect(CloneIndex index, Block[] fileBlocks) { return OriginalCloneDetectionAlgorithm.detect(index, Arrays.asList(fileBlocks));
39,240
package com.easytoolsoft.easyreport.web.controller.common; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping(value = "/error") <BUG>public class ErrorController extends AbstractController { @RequestMapping(value = {"/404"})</BUG>...
public class ErrorController { @RequestMapping(value = {"/404"})
39,241
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
39,242
} @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);
39,243
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);
39,244
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(
39,245
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 {
39,246
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;
39,247
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) {
39,248
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;
39,249
import qubexplorer.NoSuchProjectException; import qubexplorer.PassEncoder; import qubexplorer.RadarIssue; import qubexplorer.ResourceKey; import qubexplorer.Severity; <BUG>import qubexplorer.SonarQubeProject; import qubexplorer.Summary;</BUG> public class SonarQube implements IssuesContainer{ private static final Stri...
import qubexplorer.SonarQubeProjectConfiguration; import qubexplorer.DefaultSonarQubeProjectConfiguration; import qubexplorer.Summary;
39,250
} } private static boolean isError401(ConnectionException ex) { return ex.getMessage().contains("HTTP error: 401"); } <BUG>public List<SonarQubeProject> getProjects(UserCredentials userCredentials) { </BUG> try{ Sonar sonar; if(userCredentials == null) {
public SonarQube() { this("http://localhost:9000"); public String getServerUrl() { return serverUrl; public String getVersion(UserCredentials userCredentials) {
39,251
import qubexplorer.UserCredentials; import qubexplorer.AuthorizationException; import qubexplorer.MvnModelFactory; import qubexplorer.MvnModelInputException; import qubexplorer.PassEncoder; <BUG>import qubexplorer.SonarQubeProject; </BUG> import qubexplorer.SonarQubeProjectBuilder; import qubexplorer.server.SonarQube; ...
import qubexplorer.SonarQubeProjectConfiguration;
39,252
return true; } else { return false; } } <BUG>private boolean addModuleProperties(String module, Project moduleProject, SonarQubeProject projectInfo) throws MvnModelInputException { SonarQubeProject subprojectInfo=projectInfo.createSubprojectInfo(moduleProject); boolean containsSources = configureSourcesAndBinariesProp...
private boolean addModuleProperties(String module, Project moduleProject, SonarQubeProjectConfiguration projectInfo) throws MvnModelInputException { SonarQubeProjectConfiguration subprojectInfo=SonarQubeProjectBuilder.getDefaultConfiguration(moduleProject); boolean containsSources = configureSourcesAndBinariesPropertie...
39,253
import org.apache.maven.model.Model; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.netbeans.api.project.Project; import org.openide.filesystems.FileObject; <BUG>public class SonarMvnProject implements SonarQubeProject { </BUG> private ...
public class SonarMvnProject implements SonarQubeProjectConfiguration {
39,254
if(version == null && model.getParent() != null) { version=model.getParent().getVersion(); } return version; } <BUG>@Override public SonarMvnProject createSubprojectInfo(Project subproject) { try { return new SonarMvnProject(subproject); } catch (MvnModelInputException ex) { throw new SonarQubeProjectException(ex); } }...
[DELETED]
39,255
try { return new SonarMvnProject(project); } catch (MvnModelInputException ex) { throw new SonarQubeProjectException(ex); } <BUG>}else{ return new SimpleSonarProject(project); }</BUG> }
[DELETED]
39,256
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.*;
39,257
.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);
39,258
</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...
39,259
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)
39,260
.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))
39,261
.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))
39,262
@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;
39,263
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; }
39,264
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
39,265
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.*;
39,266
.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))
39,267
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) -> {
39,268
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...
39,269
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);
39,270
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() + "\"");
39,271
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() + "\"");
39,272
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
39,273
.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")
39,274
String command = null; String result = null; Socket socket; while (continueListenning() && (socket = getSocket()) != null) { try { <BUG>time = System.currentTimeMillis(); try {</BUG> InputStream inputStream = socket.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "ISO-8859-1")...
InetAddress ipAddress = socket.getInetAddress();
39,275
InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "ISO-8859-1"); BufferedReader bufferedReader = new BufferedReader(inputStreamReader); command = bufferedReader.readLine(); if (command == null) { command = "DISCONNECTED"; <BUG>} else { result = AdministrationTCP.this.processCommand(command); </BU...
Client client = Client.get(ipAddress); User user = client == null ? null : client.getUser(); result = AdministrationTCP.this.processCommand(user, command);
39,276
} catch (SocketException ex) { Server.logDebug("interrupted " + getName() + " connection."); result = "INTERRUPTED\n"; } finally { socket.close(); <BUG>InetAddress address = socket.getInetAddress(); </BUG> clearSocket(); Server.logAdministration( time,
InetAddress address = ipAddress;
39,277
import java.util.Locale; import java.util.Map; import java.util.TreeMap; public class DependencyConvergenceReport extends AbstractProjectInfoReport <BUG>{ private List reactorProjects; private static final int PERCENTAGE = 100;</BUG> public String getOutputName() {
private static final int PERCENTAGE = 100; private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment .getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
39,278
sink.section1(); sink.sectionTitle1(); sink.text( getI18nString( locale, "title" ) ); sink.sectionTitle1_(); Map dependencyMap = getDependencyMap(); <BUG>generateLegend( locale, sink ); generateStats( locale, sink, dependencyMap ); generateConvergence( locale, sink, dependencyMap ); sink.section1_();</BUG> sink.body_()...
sink.lineBreak(); sink.section1_();
39,279
Iterator it = artifactMap.keySet().iterator(); while ( it.hasNext() ) { String version = (String) it.next(); sink.tableRow(); <BUG>sink.tableCell(); sink.text( version );</BUG> sink.tableCell_(); sink.tableCell(); generateVersionDetails( sink, artifactMap, version );
sink.tableCell( String.valueOf( cellWidth ) + "px" ); sink.text( version );
39,280
sink.tableCell(); sink.text( getI18nString( locale, "legend.shared" ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableCell(); iconError( sink );</BUG> sink.tableCell_(); sink.tableCell(); sink.text( getI18nString( locale, "legend.different" ) );
sink.tableCell( "15px" ); // according /images/icon_error_sml.gif iconError( sink );
39,281
sink.tableCaption(); sink.text( getI18nString( locale, "stats.caption" ) ); sink.tableCaption_();</BUG> sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.subprojects" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); s...
sink.bold(); sink.bold_(); sink.tableCaption_(); sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.subprojects" ) ); sink.tableHeaderCell_();
39,282
sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.dependencies" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( depCount ) );
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.dependencies" ) ); sink.tableHeaderCell_();
39,283
sink.text( String.valueOf( convergence ) + "%" ); sink.bold_(); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.readyrelease" ) ); sink.tableHeaderCell_();
39,284
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
39,285
List<IAtomContainer> molList = FluentIterable.from(mols).toList(); DepictionGenerator copy = this.withParam(BasicSceneGenerator.Scale.class, caclModelScale(molList)); final RendererModel model = copy.getModel(); final List<Bounds> molElems = copy.generate(molList, model, 1); <BUG>resetCoords(mols, scaleFactors); final ...
for (LayoutBackup backup : layoutBackups) backup.reset(); final List<Bounds> titles = new ArrayList<>();
39,286
for (IChemObject obj : this.highlight.keySet()) obj.removeProperty(StandardGenerator.HIGHLIGHT_COLOR); this.highlight.clear(); return new MolGridDepiction(model, molElems, titles, dimensions, nrow, ncol); } <BUG>private List<Double> prepareCoords(Iterable<IAtomContainer> mols) throws CDKException { List<Double> scaleF...
private void prepareCoords(Iterable<IAtomContainer> mols) throws CDKException { if (!ensure2dLayout(mol) && mol.getBondCount() > 0) {
39,287
if (highlightAtomMap) { myHighlight.putAll(makeHighlightAtomMap(reactants, products)); } myHighlight.putAll(highlight); highlight.clear(); <BUG>final List<Double> reactantScales = prepareCoords(reactants); final List<Double> productScales = prepareCoords(products); final List<Double> agentScales = prepareCoords(agents)...
for (Map.Entry<IChemObject, Color> e : myHighlight.entrySet())
39,288
List<Bounds> reactantBounds = copy.generate(reactants, model, 1); List<Bounds> productBounds = copy.generate(toList(rxn.getProducts()), model, rxn.getReactantCount()); List<Bounds> agentBounds = copy.generate(toList(rxn.getAgents()), model, rxn.getReactantCount() + rxn.getProductCount()); for (IChemObject obj : myHighl...
for (LayoutBackup backup : layoutBackups) backup.reset();
39,289
private final I18n i18n; private Filter filter; ApplicationElement(TodoItemRepository repository, I18n i18n) { this.repository = repository; this.i18n = i18n; <BUG>Elements.Builder builder = new Elements.Builder() .section().css("todoapp")</BUG> .header().css("header") .h(1).innerText(i18n.constants().todos()).end() .i...
TodoBuilder builder = new TodoBuilder() .section().css("todoapp")
39,290
import static org.junit.Assert.assertNotNull; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class ElementsBuilderTest { <BUG>private Elements.Builder builder; </BUG> @Before public void setUp() { Document document = mock(Document.cla...
private TestableBuilder builder;
39,291
when(document.createParagraphElement()).thenAnswer(invocation -> new StandaloneElement("p")); when(document.createSelectElement()).thenAnswer(invocation -> new StandaloneInputElement("select")); when(document.createSpanElement()).thenAnswer(invocation -> new StandaloneElement("span")); when(document.createTextAreaEleme...
builder = new TestableBuilder(document);
39,292
TodoItemRepository repository = new TodoItemRepository(BEAN_FACTORY); ApplicationElement application = new ApplicationElement(repository, i18n); Element body = Browser.getDocument().getBody(); body.appendChild(application.asElement()); body.appendChild(new FooterElement(i18n).asElement()); <BUG>Element e = new MyBuilde...
[DELETED]
39,293
@Override public String toString() { return (container ? "container" : "simple") + " @ " + level + ": " + element.getTagName(); } } <BUG>public static class Builder extends CoreBuilder<Builder> { public Builder() { super(Browser.getDocument()); } protected Builder(Document document) { super( document );</BUG> }
[DELETED]
39,294
return start(document.createElement(tag)); } public B start(Element element) { elements.push(new ElementInfo(element, true, level)); level++; <BUG>return (B) this; }</BUG> public B end() { assertCurrent(); if (level == 0) {
return that();
39,295
Element closingElement = elements.peek().element; for (ElementInfo child : children) { closingElement.appendChild(child.element); } level--; <BUG>return (B) this; }</BUG> private String dumpElements() { return elements.toString(); }
return that();
39,296
} public B on(EventType type, EventListener listener) { assertCurrent(); Element element = elements.peek().element; type.register(element, listener); <BUG>return (B) this; }</BUG> public B rememberAs(String id) { assertCurrent(); references.put(id, elements.peek().element);
public B attr(String name, String value) { elements.peek().element.setAttribute(name, value); return that();
39,297
System.out.println(change); } } }; @Override <BUG>protected Callback<VChild, Void> copyChildCallback() </BUG> { return (child) -> {
protected Callback<VChild, Void> copyIntoCallback()
39,298
package jfxtras.labs.icalendarfx.components; import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment; <BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty; import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG> import jfxtras.labs.icalendarfx.properties...
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
39,299
VEVENT ("VEVENT", Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES, PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_END, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TIME_START, PropertyType.DESCRIPTI...
PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,
39,300
VTODO ("VTODO", Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES, PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_COMPLETED, PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_DUE, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TI...
PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,