id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
45,001
if (LOG.isDebugEnabled()) { LOG.debug("Creating view instance " + viewName + "/" + version + "/" + instanceName); } instanceEntity.validate(viewEntity); <BUG>instanceDAO.create(instanceEntity); </BUG> try { bindViewInstance(viewEntity, instanceEntity); } catch (Exception e) {
instanceDAO.merge(instanceEntity);
45,002
expect(libDir.exists()).andReturn(true); expect(libDir.listFiles()).andReturn(new File[]{fileEntry}); expect(fileEntry.toURI()).andReturn(new URI("file:./")); Capture<ViewEntity> captureViewEntity = new Capture<ViewEntity>(); expect(vDAO.findByName("MY_VIEW{1.0.0}")).andReturn(null); <BUG>vDAO.create(capture(captureViewEntity)); expect(vDAO.findAll()).andReturn(Collections.<ViewEntity>emptyList());</BUG> replay(configuration, viewDir, extractedArchiveDir, viewArchive, archiveDir, entryFile, classesDir, libDir, fileEntry, viewJarFile, enumeration, jarEntry, is, fos, vDAO); ViewRegistry registry = ViewRegistry.getInstance();
expect(vDAO.merge(capture(captureViewEntity))).andReturn(null); expect(vDAO.findAll()).andReturn(Collections.<ViewEntity>emptyList());
45,003
expect(libDir.exists()).andReturn(true); expect(libDir.listFiles()).andReturn(new File[]{fileEntry}); expect(fileEntry.toURI()).andReturn(new URI("file:./")); Capture<ViewEntity> captureViewEntity = new Capture<ViewEntity>(); expect(vDAO.findByName("MY_VIEW{1.0.0}")).andReturn(null); <BUG>vDAO.create(capture(captureViewEntity)); expectLastCall().andThrow(new IllegalArgumentException("Expected exception.")); </BUG> expect(vDAO.findAll()).andReturn(Collections.<ViewEntity>emptyList()); replay(configuration, viewDir, extractedArchiveDir, viewArchive, archiveDir, entryFile, classesDir,
expect(vDAO.merge(capture(captureViewEntity))).andReturn(null);
45,004
properties.put("p1", "v1"); Configuration ambariConfig = new Configuration(properties); ViewConfig config = ViewConfigTest.getConfig(xml_valid_instance); ViewEntity viewEntity = getViewEntity(config, ambariConfig, getClass().getClassLoader(), ""); ViewInstanceEntity viewInstanceEntity = getViewInstanceEntity(viewEntity, config.getInstances().get(0)); <BUG>viewInstanceDAO.create(viewInstanceEntity); replay(viewDAO, viewInstanceDAO);</BUG> registry.addDefinition(viewEntity); registry.installViewInstance(viewInstanceEntity); Collection<ViewInstanceEntity> viewInstanceDefinitions = registry.getInstanceDefinitions(viewEntity);
expect(viewInstanceDAO.merge(viewInstanceEntity)).andReturn(null); replay(viewDAO, viewInstanceDAO);
45,005
Action unsubscribeAction = new Action() { @Override public void run() { unsubscribed.set(true); } <BUG>}; Observable.just(1).doOnDispose(unsubscribeAction) .takeLast(1).subscribe(); assertTrue(unsubscribed.get());</BUG> }
Observable.just(1) .concatWith(Observable.<Integer>never()) .takeLast(1) .subscribe() .dispose(); assertTrue(unsubscribed.get());
45,006
package io.reactivex.internal.operators.observable; import static org.junit.Assert.*; <BUG>import java.util.List; import org.junit.Test; import io.reactivex.*; import io.reactivex.disposables.Disposable;</BUG> import io.reactivex.exceptions.TestException;
import java.util.*; import io.reactivex.Observable; import io.reactivex.Observer; import io.reactivex.TestHelper; import io.reactivex.disposables.Disposable;
45,007
package io.reactivex.internal.operators.flowable; import static org.junit.Assert.*; <BUG>import java.util.List; </BUG> import org.junit.Test; import org.reactivestreams.*; import io.reactivex.*;
import java.util.*;
45,008
Flowable.range(1, 10).concatWith(Flowable.<Integer>never()) .doOnCancel(new Action() { @Override public void run() { unsub.set(true); <BUG>}}) .subscribe().dispose();</BUG> assertTrue(unsub.get()); } @Test(timeout = 10000)
.ignoreElements() .toFlowable() .subscribe().dispose();
45,009
package org.seleniumhq.selenium.fluent; <BUG>import org.openqa.selenium.Dimension; import org.openqa.selenium.Point;</BUG> import org.openqa.selenium.WebDriver; import java.util.List; public abstract class BaseFluentWebElement extends BaseFluentWebDriver {
[DELETED]
45,010
} public FluentSelects selects(By by) { MultipleResult multiple = multiple(by, "select"); return newFluentSelects(multiple.getResult(), multiple.getCtx()); } <BUG>public FluentWebElement h1() { </BUG> SingleResult single = single(tagName("h1"), "h1"); return newFluentWebElement(delegate, single.getResult(), single.getCtx()); }
protected BaseFluentWebElements spans() { return newFluentWebElements(multiple(tagName("span"), "span"));
45,011
int segment = myTemplate.getVariableSegmentNumber(variableName); if (segment < 0) return null; return new TextRange(mySegments.getSegmentStart(segment), mySegments.getSegmentEnd(segment)); } public boolean isFinished() { <BUG>return (myCurrentVariableNumber < 0); }</BUG> private void releaseAll() { if (mySegments != null) { mySegments.removeAll();
return myCurrentVariableNumber < 0;
45,012
myEditor.getCaretModel().moveToOffset(oldOffset); } setCurrentVariableNumber(-1); } } <BUG>public void redo() throws UnexpectedUndoException { }</BUG> public DocumentReference[] getAffectedDocuments() { if (myDocument == null) return new DocumentReference[0]; return new DocumentReference[]{DocumentReferenceByDocument.createDocumentReference(myDocument)};
public void redo() {
45,013
for (TemplateEditingListener listener : listeners) { listener.templateCancelled(myTemplate); } } private void preprocessTemplate(final PsiFile file, int caretOffset, final String textToInsert) { <BUG>if (file.getLanguage().equals(StdLanguages.JSPX)) { </BUG> if (XmlUtil.toCode(textToInsert)) { try { caretOffset += JspSpiUtil.escapeCharsInJspContext((JspFile)file, caretOffset, myTemplate.getTemplateText());
if (file.getLanguage().equals(StdLanguages.JSPX) && file instanceof JspFile) {
45,014
final LookupItem item = event.getItem(); if (item != null) { PsiDocumentManager.getInstance(myProject).commitAllDocuments(); Integer bracketCount = (Integer)item.getAttribute(LookupItem.BRACKETS_COUNT_ATTR); if (bracketCount != null) { <BUG>StringBuffer tail = new StringBuffer(); </BUG> for (int i = 0; i < bracketCount.intValue(); i++) { tail.append("[]"); }
StringBuilder tail = new StringBuilder();
45,015
PsiClass aClass = null; if (item instanceof PsiClass) { aClass = (PsiClass)item; } else if (item instanceof PsiType) { <BUG>aClass = PsiUtil.resolveClassInType(((PsiType)item)); }</BUG> if (aClass != null) { if (aClass instanceof PsiTypeParameter) { if (((PsiTypeParameter)aClass).getOwner() instanceof PsiMethod) {
aClass = PsiUtil.resolveClassInType((PsiType)item);
45,016
else { result = expressionNode.calculateResult(context); if (expressionNode instanceof ConstantNode) { if (result instanceof TextResult) { TextResult text = (TextResult)result; <BUG>if (text.getText().equals("") && defaultValue != null) { </BUG> result = defaultValue.calculateResult(context); } }
if (text.getText().length() == 0 && defaultValue != null) {
45,017
public static boolean debugMode = false; @ModConfigProperty(category = "Debug", name = "debugModeGOTG", comment = "Enable/Disable Debug Mode for the Gift Of The Gods") public static boolean debugModeGOTG = false; @ModConfigProperty(category = "Debug", name = "debugModeEnchantments", comment = "Enable/Disable Debug Mode for the Enchantments") public static boolean debugModeEnchantments = false; <BUG>@ModConfigProperty(category = "Weapons", name = "enableSwordsRecipes", comment = "Enable/Disable The ArmorPlus Sword's Recipes") public static boolean enableSwordsRecipes = true; @ModConfigProperty(category = "Weapons", name = "enableBattleAxesRecipes", comment = "Enable/Disable The ArmorPlus Battle Axes's Recipes") public static boolean enableBattleAxesRecipes = true; @ModConfigProperty(category = "Weapons", name = "enableBowsRecipes", comment = "Enable/Disable The ArmorPlus Bows's Recipes") public static boolean enableBowsRecipes = true; @ModConfigProperty(category = "Armors.SuperStarArmor.Effects", name = "enableSuperStarHRegen", comment = "Enable/Disable The Super Star Helmet Regeneration") </BUG> public static boolean enableSuperStarHRegen = true;
@ModConfigProperty(category = "Weapons", name = "enableSwordsRecipes", comment = "Enable/Disable ArmorPlus Sword's Recipes") @ModConfigProperty(category = "Weapons", name = "enableBattleAxesRecipes", comment = "Enable/Disable ArmorPlus Battle Axes's Recipes") @ModConfigProperty(category = "Weapons", name = "enableBowsRecipes", comment = "Enable/Disable ArmorPlus Bows's Recipes")
45,018
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class StopAnalyzerProvider extends AbstractAnalyzerProvider<StopAnalyzer> { </BUG> private final Set<String> stopWords; private final StopAnalyzer stopAnalyzer; @Inject public StopAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
public class StopAnalyzerProvider extends AbstractIndexAnalyzerProvider<StopAnalyzer> {
45,019
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class StandardAnalyzerProvider extends AbstractAnalyzerProvider<StandardAnalyzer> { </BUG> private final Set<String> stopWords; private final int maxTokenLength; private final StandardAnalyzer standardAnalyzer;
public class StandardAnalyzerProvider extends AbstractIndexAnalyzerProvider<StandardAnalyzer> {
45,020
import org.elasticsearch.index.Index; import org.elasticsearch.index.settings.IndexSettings; import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.settings.Settings; <BUG>public class KeywordAnalyzerProvider extends AbstractAnalyzerProvider<KeywordAnalyzer> { </BUG> private final KeywordAnalyzer keywordAnalyzer; @Inject public KeywordAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) { super(index, indexSettings, name);
public class KeywordAnalyzerProvider extends AbstractIndexAnalyzerProvider<KeywordAnalyzer> {
45,021
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class CzechAnalyzerProvider extends AbstractAnalyzerProvider<CzechAnalyzer> { </BUG> private final Set<?> stopWords; private final CzechAnalyzer analyzer; @Inject public CzechAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
public class CzechAnalyzerProvider extends AbstractIndexAnalyzerProvider<CzechAnalyzer> {
45,022
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class ArabicAnalyzerProvider extends AbstractAnalyzerProvider<ArabicAnalyzer> { </BUG> private final Set<String> stopWords; private final ArabicAnalyzer arabicAnalyzer; @Inject public ArabicAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
public class ArabicAnalyzerProvider extends AbstractIndexAnalyzerProvider<ArabicAnalyzer> {
45,023
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class CjkAnalyzerProvider extends AbstractAnalyzerProvider<CJKAnalyzer> { </BUG> private final Set<?> stopWords; private final CJKAnalyzer analyzer; @Inject public CjkAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
public class CjkAnalyzerProvider extends AbstractIndexAnalyzerProvider<CJKAnalyzer> {
45,024
Class<? extends TokenFilterFactory> type = tokenFilterSettings.getAsClass("type", null, "org.elasticsearch.index.analysis.", "TokenFilterFactory"); if (type == null) { throw new IllegalArgumentException("Token Filter [" + tokenFilterName + "] must have a type associated with it"); } tokenFilterBinder.addBinding(tokenFilterName).toProvider(FactoryProvider.newFactory(TokenFilterFactoryFactory.class, type)).in(Scopes.SINGLETON); <BUG>} for (AnalysisBinderProcessor processor : processors) { processor.processTokenFilters(tokenFilterBinder, tokenFiltersSettings); </BUG> }
AnalysisBinderProcessor.TokenFiltersBindings tokenFiltersBindings = new AnalysisBinderProcessor.TokenFiltersBindings(tokenFilterBinder, tokenFiltersSettings); processor.processTokenFilters(tokenFiltersBindings);
45,025
Class<? extends TokenizerFactory> type = tokenizerSettings.getAsClass("type", null, "org.elasticsearch.index.analysis.", "TokenizerFactory"); if (type == null) { throw new IllegalArgumentException("Tokenizer [" + tokenizerName + "] must have a type associated with it"); } tokenizerBinder.addBinding(tokenizerName).toProvider(FactoryProvider.newFactory(TokenizerFactoryFactory.class, type)).in(Scopes.SINGLETON); <BUG>} for (AnalysisBinderProcessor processor : processors) { processor.processTokenizers(tokenizerBinder, tokenizersSettings); </BUG> }
AnalysisBinderProcessor.TokenizersBindings tokenizersBindings = new AnalysisBinderProcessor.TokenizersBindings(tokenizerBinder, tokenizersSettings); processor.processTokenizers(tokenizersBindings);
45,026
} else { throw new IllegalArgumentException("Analyzer [" + analyzerName + "] must have a type associated with it or a tokenizer"); } } analyzerBinder.addBinding(analyzerName).toProvider(FactoryProvider.newFactory(AnalyzerProviderFactory.class, type)).in(Scopes.SINGLETON); <BUG>} for (AnalysisBinderProcessor processor : processors) { processor.processAnalyzers(analyzerBinder, analyzersSettings); </BUG> }
AnalysisBinderProcessor.AnalyzersBindings analyzersBindings = new AnalysisBinderProcessor.AnalyzersBindings(analyzerBinder, analyzersSettings, indicesAnalysisService); processor.processAnalyzers(analyzersBindings);
45,027
import org.elasticsearch.index.settings.IndexSettings; import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; <BUG>public class ThaiAnalyzerProvider extends AbstractAnalyzerProvider<ThaiAnalyzer> { </BUG> private final ThaiAnalyzer analyzer; @Inject public ThaiAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) { super(index, indexSettings, name);
public class ThaiAnalyzerProvider extends AbstractIndexAnalyzerProvider<ThaiAnalyzer> {
45,028
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class PersianAnalyzerProvider extends AbstractAnalyzerProvider<PersianAnalyzer> { </BUG> private final Set<?> stopWords; private final PersianAnalyzer analyzer; @Inject public PersianAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
public class PersianAnalyzerProvider extends AbstractIndexAnalyzerProvider<PersianAnalyzer> {
45,029
import org.elasticsearch.index.Index; import org.elasticsearch.index.settings.IndexSettings; import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.settings.Settings; <BUG>public class ChineseAnalyzerProvider extends AbstractAnalyzerProvider<ChineseAnalyzer> { </BUG> private final ChineseAnalyzer analyzer; @Inject public ChineseAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) { super(index, indexSettings, name);
public class ChineseAnalyzerProvider extends AbstractIndexAnalyzerProvider<ChineseAnalyzer> {
45,030
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class BrazilianAnalyzerProvider extends AbstractAnalyzerProvider<BrazilianAnalyzer> { </BUG> private final Set<?> stopWords; private final Set<?> stemExclusion; private final BrazilianAnalyzer analyzer;
public class BrazilianAnalyzerProvider extends AbstractIndexAnalyzerProvider<BrazilianAnalyzer> {
45,031
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class GermanAnalyzerProvider extends AbstractAnalyzerProvider<GermanAnalyzer> { </BUG> private final Set<?> stopWords; private final Set<?> stemExclusion; private final GermanAnalyzer analyzer;
public class GermanAnalyzerProvider extends AbstractIndexAnalyzerProvider<GermanAnalyzer> {
45,032
import org.elasticsearch.util.settings.ImmutableSettings; import org.elasticsearch.util.settings.Settings; import java.util.List; import java.util.Map; import static org.elasticsearch.util.collect.Lists.*; <BUG>public class CustomAnalyzerProvider extends AbstractAnalyzerProvider<CustomAnalyzer> { </BUG> private final TokenizerFactory tokenizerFactory; private final TokenFilterFactory[] tokenFilterFactories; private final CustomAnalyzer customAnalyzer;
public class CustomAnalyzerProvider extends AbstractIndexAnalyzerProvider<CustomAnalyzer> {
45,033
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class DutchAnalyzerProvider extends AbstractAnalyzerProvider<DutchAnalyzer> { </BUG> private final Set<?> stopWords; private final Set<?> stemExclusion; private final DutchAnalyzer analyzer;
public class DutchAnalyzerProvider extends AbstractIndexAnalyzerProvider<DutchAnalyzer> {
45,034
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class FrenchAnalyzerProvider extends AbstractAnalyzerProvider<FrenchAnalyzer> { </BUG> private final Set<?> stopWords; private final Set<?> stemExclusion; private final FrenchAnalyzer analyzer;
public class FrenchAnalyzerProvider extends AbstractIndexAnalyzerProvider<FrenchAnalyzer> {
45,035
import org.elasticsearch.index.Index; import org.elasticsearch.index.settings.IndexSettings; import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.settings.Settings; <BUG>public class SimpleAnalyzerProvider extends AbstractAnalyzerProvider<SimpleAnalyzer> { </BUG> private final SimpleAnalyzer simpleAnalyzer; @Inject public SimpleAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) { super(index, indexSettings, name);
public class SimpleAnalyzerProvider extends AbstractIndexAnalyzerProvider<SimpleAnalyzer> {
45,036
import org.elasticsearch.util.collect.Iterators; import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; <BUG>public class RussianAnalyzerProvider extends AbstractAnalyzerProvider<RussianAnalyzer> { </BUG> private final RussianAnalyzer analyzer; @Inject public RussianAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) { super(index, indexSettings, name);
public class RussianAnalyzerProvider extends AbstractIndexAnalyzerProvider<RussianAnalyzer> {
45,037
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class GreekAnalyzerProvider extends AbstractAnalyzerProvider<GreekAnalyzer> { </BUG> private final Set<?> stopWords; private final GreekAnalyzer analyzer; @Inject public GreekAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
public class GreekAnalyzerProvider extends AbstractIndexAnalyzerProvider<GreekAnalyzer> {
45,038
&& selected.iterator().next() instanceof ModelAttribute; moveBottomButton.setEnabled(enableMove); moveTopButton.setEnabled(enableMove); moveUpButton.setEnabled(enableMove); moveDownButton.setEnabled(enableMove); <BUG>} else { addAttributeButton.setEnabled(false);</BUG> removeButton.setEnabled(false); editButton.setEnabled(false); moveBottomButton.setEnabled(false);
addEntityButton.setEnabled(false); addAttributeButton.setEnabled(false);
45,039
removeButton.setEnabled(false); editButton.setEnabled(false); moveBottomButton.setEnabled(false); moveTopButton.setEnabled(false); moveUpButton.setEnabled(false); <BUG>moveDownButton.setEnabled(false); }</BUG> } @Override public boolean closing() {
importButton.setEnabled(false);
45,040
return getLeagueBySummoner(region, String.valueOf(summonerId)); } public Map<String, List<League>> getLeagueBySummoners(Region region, String... summonerIds) throws RiotApiException { Objects.requireNonNull(region); Objects.requireNonNull(summonerIds); <BUG>return LeagueApi.getLeagueBySummoners(getConfig(), region, Convert.joinString(",", summonerIds)); }</BUG> public Map<String, List<League>> getLeagueBySummoners(Region region, long... summonerIds) throws RiotApiException { Objects.requireNonNull(region);
[DELETED]
45,041
return leagues.get(teamId); } public Map<String, List<League>> getLeagueByTeams(Region region, String... teamIds) throws RiotApiException { Objects.requireNonNull(region); Objects.requireNonNull(teamIds); <BUG>return LeagueApi.getLeagueByTeams(getConfig(), region, Convert.joinString(",", teamIds)); }</BUG> public List<League> getLeagueEntryBySummoner(Region region, String summonerId) throws RiotApiException { Objects.requireNonNull(region);
ApiMethod method = new GetLeagueByTeams(getConfig(), region, Convert.joinString(",", teamIds)); return endpointManager.callMethodAndReturnDto(method);
45,042
return getLeagueEntryBySummoner(region, String.valueOf(summonerId)); } public Map<String, List<League>> getLeagueEntryBySummoners(Region region, String... summonerIds) throws RiotApiException { Objects.requireNonNull(region); Objects.requireNonNull(summonerIds); <BUG>return LeagueApi.getLeagueEntryBySummoners(getConfig(), region, Convert.joinString(",", summonerIds)); }</BUG> public Map<String, List<League>> getLeagueEntryBySummoners(Region region, long... summonerIds) throws RiotApiException { Objects.requireNonNull(region);
[DELETED]
45,043
return leagues.get(teamId); } public Map<String, List<League>> getLeagueEntryByTeams(Region region, String... teamIds) throws RiotApiException { Objects.requireNonNull(region); Objects.requireNonNull(teamIds); <BUG>return LeagueApi.getLeagueEntryByTeams(getConfig(), region, Convert.joinString(",", teamIds)); }</BUG> public LobbyEventList getLobbyEventsByTournament(String tournamentCode) throws RiotApiException { Objects.requireNonNull(tournamentCode);
ApiMethod method = new GetLeagueEntryByTeams(getConfig(), region, Convert.joinString(",", teamIds)); return endpointManager.callMethodAndReturnDto(method);
45,044
return TournamentApi.getLobbyEventsByTournament(getConfig(), tournamentCode); } public League getMasterLeague(Region region, QueueType queueType) throws RiotApiException { Objects.requireNonNull(region); Objects.requireNonNull(queueType); <BUG>return LeagueApi.getMasterLeague(getConfig(), region, queueType); }</BUG> public Map<String, MasteryPages> getMasteryPages(Region region, String... summonerIds) throws RiotApiException { Objects.requireNonNull(region); Objects.requireNonNull(summonerIds);
ApiMethod method = new GetMasterLeague(getConfig(), region, queueType); return endpointManager.callMethodAndReturnDto(method);
45,045
import net.rithms.riot.api.RiotApiException; import net.rithms.riot.api.endpoints.ApiMethod; import net.rithms.riot.api.endpoints.HttpHeadParameter; public class Request { public static final int CODE_SUCCESS_OK = 200; <BUG>public static final int CODE_SUCCESS_NOCONTENT = 204; </BUG> public static final int CODE_ERROR_BAD_REQUEST = 400; public static final int CODE_ERROR_UNAUTHORIZED = 401; public static final int CODE_ERROR_FORBIDDEN = 403;
public static final int CODE_SUCCESS_NO_CONTENT = 204;
45,046
throw new NullPointerException( "Neither the dtoClass nor the dtoType is set for that ApiMethod. Please manually set either of these as parameter for getDto()."); } public <T> T getDto(Class<T> desiredDto) throws RiotApiException, RateLimitException { requireSucceededRequestState(); <BUG>if (responseCode == CODE_SUCCESS_NOCONTENT) { </BUG> return null; } T dto = null;
if (responseCode == CODE_SUCCESS_NO_CONTENT) {
45,047
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;
45,048
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;
45,049
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"),
45,050
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]
45,051
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) {
45,052
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;
45,053
package org.zanata.webtrans.server; import java.util.HashMap; import java.util.List; <BUG>import java.util.Map; import javax.servlet.http.HttpSession;</BUG> import net.customware.gwt.dispatch.server.ActionHandler; import net.customware.gwt.dispatch.server.ActionResult; import net.customware.gwt.dispatch.server.Dispatch;
import java.util.Set; import javax.servlet.http.HttpSession;
45,054
Log log; @SuppressWarnings("rawtypes") @Create public void create() { <BUG>for (Class clazz : StandardDeploymentStrategy.instance().getAnnotatedClasses().get(ActionHandlerFor.class.getName())) { register(clazz); }</BUG> HotDeploymentStrategy hotDeploymentStrategy = HotDeploymentStrategy.instance();
Set<Class<?>> annotatedClasses = StandardDeploymentStrategy.instance().getAnnotatedClasses().get(ActionHandlerFor.class.getName()); if( annotatedClasses != null ) for (Class clazz : annotatedClasses) } }
45,055
register(clazz); }</BUG> HotDeploymentStrategy hotDeploymentStrategy = HotDeploymentStrategy.instance(); if (hotDeploymentStrategy != null && hotDeploymentStrategy.available()) { <BUG>for (Class clazz : hotDeploymentStrategy.getAnnotatedClasses().get(ActionHandlerFor.class.getName())) { register(clazz); }</BUG> }
Set<Class<?>> hotAnnotatedClasses = hotDeploymentStrategy.getAnnotatedClasses().get(ActionHandlerFor.class.getName()); if( hotAnnotatedClasses != null ) for (Class clazz : hotAnnotatedClasses)
45,056
public static final String DESCRIBE_OPT = "describe"; public static final String INSTANCES_OPT = "instances"; public static final String UNREGISTER_OPT = "unregister"; public static final String DETAIL_OPT = "detail"; public static final String REGISTER_OPT = "register"; <BUG>public static final String ENTENSION_NAME_OPT = "extensionName"; </BUG> public static final String JOB_NAME_OPT = "jobName"; public static final String DESCRIPTION = "description"; public static final String PATH = "path";
public static final String EXTENSION_NAME_OPT = "extensionName";
45,057
Set<String> optionsList = new HashSet<>(); for (Option option : commandLine.getOptions()) { optionsList.add(option.getOpt()); } String result; <BUG>String extensionName = commandLine.getOptionValue(ENTENSION_NAME_OPT); </BUG> String jobName = commandLine.getOptionValue(JOB_NAME_OPT); String filePath = commandLine.getOptionValue(FalconCLIConstants.FILE_PATH_OPT); String doAsUser = commandLine.getOptionValue(FalconCLIConstants.DO_AS_OPT);
String extensionName = commandLine.getOptionValue(EXTENSION_NAME_OPT);
45,058
result = client.resumeExtensionJob(jobName, doAsUser).getMessage(); } else if (optionsList.contains(FalconCLIConstants.DELETE_OPT)) { validateRequiredParameter(jobName, JOB_NAME_OPT); result = client.deleteExtensionJob(jobName, doAsUser).getMessage(); } else if (optionsList.contains(FalconCLIConstants.LIST_OPT)) { <BUG>validateRequiredParameter(extensionName, ENTENSION_NAME_OPT); </BUG> ExtensionJobList jobs = client.listExtensionJob(extensionName, doAsUser, commandLine.getOptionValue(FalconCLIConstants.SORT_ORDER_OPT), commandLine.getOptionValue(FalconCLIConstants.OFFSET_OPT),
validateRequiredParameter(extensionName, EXTENSION_NAME_OPT);
45,059
extensionOptions.addOptionGroup(group); Option url = new Option(FalconCLIConstants.URL_OPTION, true, "Falcon URL"); Option doAs = new Option(FalconCLIConstants.DO_AS_OPT, true, "doAs user"); Option debug = new Option(FalconCLIConstants.DEBUG_OPTION, false, "Use debug mode to see debugging statements on stdout"); <BUG>Option extensionName = new Option(ENTENSION_NAME_OPT, true, "Extension name"); </BUG> Option jobName = new Option(JOB_NAME_OPT, true, "Extension job name"); Option instanceStatus = new Option(FalconCLIConstants.INSTANCE_STATUS_OPT, true, "Instance status"); Option sortOrder = new Option(FalconCLIConstants.SORT_ORDER_OPT, true, "asc or desc order for results");
Option extensionName = new Option(EXTENSION_NAME_OPT, true, "Extension name");
45,060
public abstract APIResult suspend(EntityType entityType, String entityName, String colo, String doAsUser); public abstract APIResult resume(EntityType entityType, String entityName, String colo, String doAsUser); public abstract APIResult getStatus(EntityType entityType, String entityName, String colo, String doAsUser, boolean showScheduler); public abstract APIResult submitAndSchedule(String entityType, String filePath, Boolean skipDryRun, String doAsUser, <BUG>String properties); public abstract EntityList getEntityList(String entityType, String fields, String nameSubsequence, String</BUG> tagKeywords, String filterBy, String filterTags, String orderBy, String sortOrder, Integer offset, Integer numResults, String doAsUser); public abstract EntitySummaryResult getEntitySummary(String entityType, String cluster, String start, String end,
public abstract APIResult submitExtensionJob(String extensionName, String jobName, String configPath, public abstract EntityList getEntityList(String entityType, String fields, String nameSubsequence, String
45,061
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() );
45,062
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_();
45,063
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 );
45,064
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 );
45,065
sink.tableCaption(); sink.text( getI18nString( locale, "stats.caption" ) ); sink.tableCaption_();</BUG> sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.subprojects" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_();
sink.bold(); sink.bold_(); sink.tableCaption_(); sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.subprojects" ) ); sink.tableHeaderCell_();
45,066
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_();
45,067
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_();
45,068
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
45,069
import java.sql.SQLException; import java.sql.Statement; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; <BUG>import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set;</BUG> import java.util.concurrent.locks.Lock;
import java.util.HashMap; import java.util.Map; import java.util.Set;
45,070
if (msgin != null) { try { msgin.close(); } catch (IOException e) { } <BUG>} } } protected void updateSourceSequence(SourceSequence seq) </BUG> throws SQLException {
releaseResources(stmt, null); protected void storeMessage(Identifier sid, RMMessage msg, boolean outbound) throws IOException, SQLException { storeMessage(connection, sid, msg, outbound); protected void updateSourceSequence(Connection con, SourceSequence seq)
45,071
} catch (SQLException ex) { if (!isTableExistsError(ex)) { throw ex; } else { LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists."); <BUG>verifyTable(SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS); </BUG> } } finally { stmt.close();
verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
45,072
} catch (SQLException ex) { if (!isTableExistsError(ex)) { throw ex; } else { LOG.fine("Table CXF_RM_DEST_SEQUENCES already exists."); <BUG>verifyTable(DEST_SEQUENCES_TABLE_NAME, DEST_SEQUENCES_TABLE_COLS); </BUG> } } finally { stmt.close();
LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists."); verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
45,073
} } finally { stmt.close(); } for (String tableName : new String[] {OUTBOUND_MSGS_TABLE_NAME, INBOUND_MSGS_TABLE_NAME}) { <BUG>stmt = connection.createStatement(); try {</BUG> stmt.executeUpdate(MessageFormat.format(CREATE_MESSAGES_TABLE_STMT, tableName)); } catch (SQLException ex) { if (!isTableExistsError(ex)) {
stmt = con.createStatement(); try { stmt.executeUpdate(CREATE_DEST_SEQUENCES_TABLE_STMT);
45,074
throw ex; } else { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Table " + tableName + " already exists."); } <BUG>verifyTable(tableName, MESSAGES_TABLE_COLS); </BUG> } } finally { stmt.close();
LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists."); verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
45,075
if (newCols.size() > 0) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Table " + tableName + " needs additional columns"); } for (String[] newCol : newCols) { <BUG>Statement st = connection.createStatement(); try {</BUG> st.executeUpdate(MessageFormat.format(ALTER_TABLE_STMT_STR, tableName, newCol[0], newCol[1])); if (LOG.isLoggable(Level.FINE)) {
Statement st = con.createStatement(); try {
45,076
if (nextReconnectAttempt < System.currentTimeMillis()) { nextReconnectAttempt = System.currentTimeMillis() + reconnectDelay; reconnectDelay = reconnectDelay * useExponentialBackOff; } } <BUG>} public static void deleteDatabaseFiles() {</BUG> deleteDatabaseFiles(DEFAULT_DATABASE_NAME, true); } public static void deleteDatabaseFiles(String dbName, boolean now) {
public static void deleteDatabaseFiles() {
45,077
package org.glowroot.agent.config; import com.google.common.collect.ImmutableList; <BUG>import org.immutables.value.Value; import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;</BUG> @Value.Immutable public abstract class UiConfig { @Value.Default
import org.glowroot.common.config.ConfigDefaults; import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;
45,078
class RepoAdminImpl implements RepoAdmin { private final DataSource dataSource; private final List<CappedDatabase> rollupCappedDatabases; private final CappedDatabase traceCappedDatabase; private final ConfigRepository configRepository; <BUG>private final AgentDao agentDao; </BUG> private final GaugeValueDao gaugeValueDao; private final GaugeNameDao gaugeNameDao; private final TransactionTypeDao transactionTypeDao;
private final EnvironmentDao agentDao;
45,079
private final TransactionTypeDao transactionTypeDao; private final FullQueryTextDao fullQueryTextDao; private final TraceAttributeNameDao traceAttributeNameDao; RepoAdminImpl(DataSource dataSource, List<CappedDatabase> rollupCappedDatabases, CappedDatabase traceCappedDatabase, ConfigRepository configRepository, <BUG>AgentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao, </BUG> TransactionTypeDao transactionTypeDao, FullQueryTextDao fullQueryTextDao, TraceAttributeNameDao traceAttributeNameDao) { this.dataSource = dataSource;
EnvironmentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao,
45,080
this.fullQueryTextDao = fullQueryTextDao; this.traceAttributeNameDao = traceAttributeNameDao; } @Override public void deleteAllData() throws Exception { <BUG>Environment environment = agentDao.readEnvironment(""); dataSource.deleteAll();</BUG> agentDao.reinitAfterDeletingDatabase(); gaugeValueDao.reinitAfterDeletingDatabase(); gaugeNameDao.invalidateCache();
Environment environment = agentDao.read(""); dataSource.deleteAll();
45,081
public class SimpleRepoModule { private static final long SNAPSHOT_REAPER_PERIOD_MINUTES = 5; private final DataSource dataSource; private final ImmutableList<CappedDatabase> rollupCappedDatabases; private final CappedDatabase traceCappedDatabase; <BUG>private final AgentDao agentDao; private final TransactionTypeDao transactionTypeDao;</BUG> private final AggregateDao aggregateDao; private final TraceAttributeNameDao traceAttributeNameDao; private final TraceDao traceDao;
private final EnvironmentDao environmentDao; private final TransactionTypeDao transactionTypeDao;
45,082
rollupCappedDatabases.add(new CappedDatabase(file, sizeKb, ticker)); } this.rollupCappedDatabases = ImmutableList.copyOf(rollupCappedDatabases); traceCappedDatabase = new CappedDatabase(new File(dataDir, "trace-detail.capped.db"), storageConfig.traceCappedDatabaseSizeMb() * 1024, ticker); <BUG>agentDao = new AgentDao(dataSource); </BUG> transactionTypeDao = new TransactionTypeDao(dataSource); rollupLevelService = new RollupLevelService(configRepository, clock); FullQueryTextDao fullQueryTextDao = new FullQueryTextDao(dataSource);
environmentDao = new EnvironmentDao(dataSource);
45,083
traceDao = new TraceDao(dataSource, traceCappedDatabase, transactionTypeDao, fullQueryTextDao, traceAttributeNameDao); GaugeNameDao gaugeNameDao = new GaugeNameDao(dataSource); gaugeValueDao = new GaugeValueDao(dataSource, gaugeNameDao, clock); repoAdmin = new RepoAdminImpl(dataSource, rollupCappedDatabases, traceCappedDatabase, <BUG>configRepository, agentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao, </BUG> fullQueryTextDao, traceAttributeNameDao); if (backgroundExecutor == null) { reaperRunnable = null;
configRepository, environmentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao,
45,084
new TraceCappedDatabaseStats(traceCappedDatabase), "org.glowroot:type=TraceCappedDatabase"); platformMBeanServerLifecycle.lazyRegisterMBean(new H2DatabaseStats(dataSource), "org.glowroot:type=H2Database"); } <BUG>public AgentDao getAgentDao() { return agentDao; </BUG> } public TransactionTypeRepository getTransactionTypeRepository() {
public EnvironmentDao getEnvironmentDao() { return environmentDao;
45,085
package org.glowroot.agent.embedded.init; import java.io.Closeable; import java.io.File; <BUG>import java.lang.instrument.Instrumentation; import java.util.Map;</BUG> import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService;
import java.util.List; import java.util.Map;
45,086
import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Nullable; import com.google.common.base.MoreObjects; import com.google.common.base.Stopwatch; import com.google.common.base.Supplier; <BUG>import com.google.common.base.Ticker; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;</BUG> import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.glowroot.agent.collector.Collector.AgentConfigUpdater;
import com.google.common.collect.ImmutableList; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
45,087
import org.glowroot.agent.init.EnvironmentCreator; import org.glowroot.agent.init.GlowrootThinAgentInit; import org.glowroot.agent.init.JRebelWorkaround; import org.glowroot.agent.util.LazyPlatformMBeanServer; import org.glowroot.common.live.LiveAggregateRepository.LiveAggregateRepositoryNop; <BUG>import org.glowroot.common.live.LiveTraceRepository.LiveTraceRepositoryNop; import org.glowroot.common.repo.ConfigRepository; import org.glowroot.common.util.Clock;</BUG> import org.glowroot.common.util.OnlyUsedByTests; import org.glowroot.ui.CreateUiModuleBuilder;
import org.glowroot.common.repo.AgentRepository; import org.glowroot.common.repo.ImmutableAgentRollup; import org.glowroot.common.util.Clock;
45,088
SimpleRepoModule simpleRepoModule = new SimpleRepoModule(dataSource, dataDir, clock, ticker, configRepository, backgroundExecutor); simpleRepoModule.registerMBeans(new PlatformMBeanServerLifecycleImpl( agentModule.getLazyPlatformMBeanServer())); CollectorImpl collectorImpl = new CollectorImpl( <BUG>simpleRepoModule.getAgentDao(), simpleRepoModule.getAggregateDao(), simpleRepoModule.getTraceDao(),</BUG> simpleRepoModule.getGaugeValueDao()); collectorProxy.setInstance(collectorImpl); collectorImpl.init(baseDir, EnvironmentCreator.create(glowrootVersion),
simpleRepoModule.getEnvironmentDao(), simpleRepoModule.getTraceDao(),
45,089
.baseDir(baseDir) .glowrootDir(glowrootDir) .ticker(ticker) .clock(clock) .liveJvmService(agentModule.getLiveJvmService()) <BUG>.configRepository(simpleRepoModule.getConfigRepository()) .agentRepository(simpleRepoModule.getAgentDao()) </BUG> .transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository()) .traceAttributeNameRepository(
.agentRepository(new AgentRepositoryImpl()) .environmentRepository(simpleRepoModule.getEnvironmentDao())
45,090
.baseDir(baseDir) .glowrootDir(glowrootDir) .ticker(ticker) .clock(clock) .liveJvmService(null) <BUG>.configRepository(simpleRepoModule.getConfigRepository()) .agentRepository(simpleRepoModule.getAgentDao()) </BUG> .transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository()) .traceAttributeNameRepository(
.liveJvmService(agentModule.getLiveJvmService()) .agentRepository(new AgentRepositoryImpl()) .environmentRepository(simpleRepoModule.getEnvironmentDao())
45,091
} @Override public void lazyRegisterMBean(Object object, String name) { lazyPlatformMBeanServer.lazyRegisterMBean(object, name); } <BUG>} } </BUG>
void initEmbeddedServer() throws Exception { if (simpleRepoModule == null) { return;
45,092
List<GaugeConfig> configs = Lists.newArrayList(configService.getGaugeConfigs()); for (GaugeConfig loopConfig : configs) { if (loopConfig.mbeanObjectName().equals(gaugeConfig.getMbeanObjectName())) { throw new DuplicateMBeanObjectNameException(); } <BUG>} String version = Versions.getVersion(gaugeConfig); for (GaugeConfig loopConfig : configs) { if (Versions.getVersion(loopConfig.toProto()).equals(version)) { throw new IllegalStateException("This exact gauge already exists"); } } configs.add(GaugeConfig.create(gaugeConfig));</BUG> configService.updateGaugeConfigs(configs);
[DELETED]
45,093
configService.updateGaugeConfigs(configs); } } @Override public void updateGaugeConfig(String agentId, AgentConfig.GaugeConfig gaugeConfig, <BUG>String priorVersion) throws Exception { synchronized (writeLock) {</BUG> List<GaugeConfig> configs = Lists.newArrayList(configService.getGaugeConfigs()); boolean found = false; for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) {
GaugeConfig config = GaugeConfig.create(gaugeConfig); synchronized (writeLock) {
45,094
boolean found = false; for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) { GaugeConfig loopConfig = i.next(); String loopVersion = Versions.getVersion(loopConfig.toProto()); if (loopVersion.equals(priorVersion)) { <BUG>i.set(GaugeConfig.create(gaugeConfig)); found = true; break;</BUG> } else if (loopConfig.mbeanObjectName().equals(gaugeConfig.getMbeanObjectName())) { throw new DuplicateMBeanObjectNameException();
i.set(config);
45,095
boolean found = false; for (ListIterator<PluginConfig> i = configs.listIterator(); i.hasNext();) { PluginConfig loopPluginConfig = i.next(); if (pluginId.equals(loopPluginConfig.id())) { String loopVersion = Versions.getVersion(loopPluginConfig.toProto()); <BUG>checkVersionsEqual(loopVersion, priorVersion); PluginDescriptor pluginDescriptor = getPluginDescriptor(pluginId); i.set(PluginConfig.create(pluginDescriptor, properties));</BUG> found = true; break;
for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) { GaugeConfig loopConfig = i.next(); String loopVersion = Versions.getVersion(loopConfig.toProto()); if (loopVersion.equals(version)) { i.remove();
45,096
boolean found = false; for (ListIterator<InstrumentationConfig> i = configs.listIterator(); i.hasNext();) { InstrumentationConfig loopConfig = i.next(); String loopVersion = Versions.getVersion(loopConfig.toProto()); if (loopVersion.equals(priorVersion)) { <BUG>i.set(InstrumentationConfig.create(instrumentationConfig)); found = true; break; }</BUG> }
i.set(config); } else if (loopConfig.equals(config)) { throw new IllegalStateException("This exact instrumentation already exists");
45,097
package org.glowroot.agent.embedded.init; import java.io.File; import java.util.List; import org.glowroot.agent.collector.Collector; <BUG>import org.glowroot.agent.embedded.repo.AgentDao; import org.glowroot.agent.embedded.repo.AggregateDao; import org.glowroot.agent.embedded.repo.GaugeValueDao;</BUG> import org.glowroot.agent.embedded.repo.TraceDao; import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;
import org.glowroot.agent.embedded.repo.EnvironmentDao; import org.glowroot.agent.embedded.repo.GaugeValueDao;
45,098
</BUG> private final AggregateDao aggregateDao; private final TraceDao traceDao; private final GaugeValueDao gaugeValueDao; <BUG>CollectorImpl(AgentDao agentDao, AggregateDao aggregateRepository, TraceDao traceRepository, GaugeValueDao gaugeValueRepository) { this.agentDao = agentDao;</BUG> this.aggregateDao = aggregateRepository; this.traceDao = traceRepository;
import org.glowroot.wire.api.model.CollectorServiceOuterClass.Environment; import org.glowroot.wire.api.model.CollectorServiceOuterClass.GaugeValue; import org.glowroot.wire.api.model.CollectorServiceOuterClass.LogEvent; import org.glowroot.wire.api.model.TraceOuterClass.Trace; class CollectorImpl implements Collector { private final EnvironmentDao agentDao; CollectorImpl(EnvironmentDao agentDao, AggregateDao aggregateRepository, TraceDao traceRepository, GaugeValueDao gaugeValueRepository) { this.agentDao = agentDao;
45,099
public static class AnimationDesc { public AnimationListener listener; public Animation animation; public float speed; public float time; <BUG>public int loopCount; public float update(float delta) { </BUG> if (loopCount != 0 && animation != null) { final float duration = animation.duration;
protected AnimationDesc() { } protected float update(float delta) {
45,100
public float queuedTransitionTime; public AnimationDesc previous; public float transitionCurrentTime; public float transitionTargetTime; public boolean inAction; <BUG>public AnimationController (ModelInstance target) { </BUG> super(target); } private AnimationDesc obtain(final Animation anim, int loopCount, float speed, final AnimationListener listener) {
public AnimationController (final ModelInstance target) {