id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
44,301
package com.skin.ayada.runtime; import java.io.Writer; <BUG>import com.skin.ayada.jstl.TagLibrary; import com.skin.ayada.jstl.TagLibraryFactory;</BUG> public class JspFactory { public static PageContext getDefaultPageContext(Writer writer)
[DELETED]
44,302
public static PageContext getDefaultPageContext(Writer writer, int buffserSize, boolean autoFlush) { JspWriter out = new JspWriter(writer, buffserSize, autoFlush); DefaultPageContext pageContext = new DefaultPageContext(out); ExpressionContext expressionContext = DefaultExpressionFactory.getDefaultExpressionContext(pageContext); <BUG>TagLibrary tagLibrary = TagLibraryFactory.getStandardTagLibrary(); pageContext.setTagLibrary(tagLibrary);</BUG> pageContext.setTemplateContext(null); pageContext.setExpressionContext(expressionContext); return pageContext;
[DELETED]
44,303
package org.pepsoft.worldpainter; <BUG>import org.pepsoft.util.ColourUtils; import org.pepsoft.worldpainter.biomeschemes.CustomBiomeManager;</BUG> import org.pepsoft.worldpainter.layers.*; import org.pepsoft.worldpainter.layers.renderers.*; import java.awt.*;
import org.pepsoft.util.IconUtils; import org.pepsoft.worldpainter.biomeschemes.CustomBiomeManager;
44,304
import java.util.List; import static org.pepsoft.minecraft.Constants.*; import static org.pepsoft.worldpainter.Constants.*; public final class TileRenderer { public TileRenderer(TileProvider tileProvider, ColourScheme colourScheme, BiomeScheme biomeScheme, CustomBiomeManager customBiomeManager, int zoom) { <BUG>this(tileProvider, colourScheme, biomeScheme, customBiomeManager, zoom, false); } public TileRenderer(TileProvider tileProvider, ColourScheme colourScheme, BiomeScheme biomeScheme, CustomBiomeManager customBiomeManager, int zoom, boolean dry) {</BUG> biomeRenderer = new BiomeRenderer(biomeScheme, customBiomeManager); setTileProvider(tileProvider);
[DELETED]
44,305
if (notAllChunksPresent && (tile.getBitLayerValue(NotPresent.INSTANCE, x, y))) { } else if ((! noOpposites) && oppositesOverlap[x | (y << TILE_SIZE_BITS)] && CEILING_PATTERN[x & 0x7][y & 0x7]) { renderBuffer[x | (y << TILE_SIZE_BITS)] = 0xff000000; } else if (_void && tile.getBitLayerValue(org.pepsoft.worldpainter.layers.Void.INSTANCE, x, y)) { } else { <BUG>int colour = getPixelColour(tileX, tileY, x, y, layers, renderers, contourLines); colour = ColourUtils.multiply(colour, getBrightenAmount()); </BUG> final int offset = x + y * TILE_SIZE;
int colour = getPixelColour(tileX, tileY, x, y, layers, renderers, contourLines, hideTerrain, hideFluids); colour = ColourUtils.multiply(colour, getTerrainBrightenAmount());
44,306
if (notAllChunksPresent && (tile.getBitLayerValue(NotPresent.INSTANCE, x, y))) { } else if ((! noOpposites) && oppositesOverlap[x | (y << TILE_SIZE_BITS)]) { renderBuffer[x / scale + y * tileSize] = 0xff000000; } else if (_void && tile.getBitLayerValue(org.pepsoft.worldpainter.layers.Void.INSTANCE, x, y)) { } else { <BUG>int colour = getPixelColour(tileX, tileY, x, y, layers, renderers, contourLines); colour = ColourUtils.multiply(colour, getBrightenAmount()); </BUG> final int offset = x + y * TILE_SIZE;
} else if ((! noOpposites) && oppositesOverlap[x | (y << TILE_SIZE_BITS)] && CEILING_PATTERN[x & 0x7][y & 0x7]) { renderBuffer[x | (y << TILE_SIZE_BITS)] = 0xff000000; int colour = getPixelColour(tileX, tileY, x, y, layers, renderers, contourLines, hideTerrain, hideFluids); colour = ColourUtils.multiply(colour, getTerrainBrightenAmount());
44,307
if (lightOrigin == null) { throw new NullPointerException(); } this.lightOrigin = lightOrigin; } <BUG>private int getPixelColour(int tileX, int tileY, int x, int y, Layer[] layers, LayerRenderer[] renderers, boolean contourLines) { </BUG> final int offset = x + y * TILE_SIZE; final int intHeight = intHeightCache[offset]; heights[1][0] = getNeighbourHeight(x, y, 0, -1);
private int getPixelColour(int tileX, int tileY, int x, int y, Layer[] layers, LayerRenderer[] renderers, boolean contourLines, boolean hideTerrain, boolean hideFluids) {
44,308
fluidDeltas [2][1] = fluidHeights[2][1] - waterLevel; fluidHeights[1][2] = getNeighbourFluidHeight(x, y, 0, 1, waterLevel); fluidDeltas [1][2] = fluidHeights[1][2] - waterLevel; int colour; final int worldX = tileX | x, worldY = tileY | y; <BUG>if ((! dry) && (waterLevel > intHeight)) { </BUG> if (tile.getBitLayerValue(FloodWithLava.INSTANCE, x, y)) { colour = lavaColour; } else {
if ((! hideFluids) && (waterLevel > intHeight)) {
44,309
if (tile.getBitLayerValue(FloodWithLava.INSTANCE, x, y)) { colour = lavaColour; } else { colour = waterColour; } <BUG>} else { final float height = floatHeightCache[offset]; colour = ((! bottomless) && (intHeight == 0)) ? bedrockColour : tile.getTerrain(x, y).getColour(seed, worldX, worldY, height, intHeight, colourScheme); }</BUG> for (int i = 0; i < layers.length; i++) {
} else if (! hideTerrain) { colour = LIGHT_GREY;
44,310
for (int i = 0; i < layers.length; i++) { final Layer layer = layers[i]; switch (layer.getDataSize()) { case BIT: case BIT_PER_CHUNK: <BUG>if (dry && (layer instanceof Frost) && (waterLevel > intHeightCache[offset])) { </BUG> continue; } boolean bitLayerValue = tile.getBitLayerValue(layer, x, y);
if (hideFluids && (layer instanceof Frost) && (waterLevel > intHeightCache[offset])) {
44,311
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(TileRenderer.class); public enum LightOrigin { NORTHWEST { @Override public LightOrigin left() { <BUG>return SOUTHWEST; }</BUG> @Override public LightOrigin right() { return NORTHEAST;
return ABOVE; }
44,312
} }, SOUTHWEST{ @Override public LightOrigin left() { <BUG>return SOUTHEAST; }</BUG> @Override public LightOrigin right() { return NORTHWEST;
return NORTHEAST; NORTHEAST {
44,313
DESC { @Override public String toString() { return "desc"; } <BUG>}; private static final SortOrder PROTOTYPE = ASC; </BUG> @Override public SortOrder readFrom(StreamInput in) throws IOException {
public static final SortOrder DEFAULT = DESC; private static final SortOrder PROTOTYPE = DEFAULT;
44,314
GeoDistance geoDistance = GeoDistance.DEFAULT; boolean reverse = false; MultiValueMode sortMode = null; NestedInnerQueryParseSupport nestedHelper = null; final boolean indexCreatedBeforeV2_0 = context.indexShard().getIndexSettings().getIndexVersionCreated().before(Version.V_2_0_0); <BUG>boolean coerce = GeoDistanceSortBuilder.DEFAULT_COERCE; boolean ignoreMalformed = GeoDistanceSortBuilder.DEFAULT_IGNORE_MALFORMED; XContentParser.Token token;</BUG> String currentName = parser.currentName(); while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
boolean coerce = false; boolean ignoreMalformed = false; XContentParser.Token token;
44,315
String currentName = parser.currentName(); while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { currentName = parser.currentName(); } else if (token == XContentParser.Token.START_ARRAY) { <BUG>GeoDistanceSortBuilder.parseGeoPoints(parser, geoPoints); fieldName = currentName;</BUG> } else if (token == XContentParser.Token.START_OBJECT) { if ("nested_filter".equals(currentName) || "nestedFilter".equals(currentName)) { if (nestedHelper == null) {
fieldName = currentName;
44,316
if (temp == MultiValueMode.SUM) { throw new IllegalArgumentException("sort_mode [sum] isn't supported for sorting by geo distance"); }</BUG> this.sortMode = sortMode; return this; <BUG>} public String sortMode() { return this.sortMode;</BUG> } public GeoDistanceSortBuilder setNestedFilter(QueryBuilder nestedFilter) {
@Override public GeoDistanceSortBuilder order(SortOrder order) { this.order = order; @Override public SortBuilder missing(Object missing) { public GeoDistanceSortBuilder sortMode(String sortMode) {
44,317
builder.field("unit", unit); builder.field("distance_type", geoDistance.name().toLowerCase(Locale.ROOT)); if (order == SortOrder.DESC) {</BUG> builder.field("reverse", true); <BUG>} else { builder.field("reverse", false);</BUG> } if (sortMode != null) { builder.field("mode", sortMode); }
if (geoDistance != null) { if (order == SortOrder.DESC) {
44,318
package org.metaborg.spoofax.core.analysis.constraint; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Optional; <BUG>import java.util.UUID; import org.apache.commons.vfs2.FileObject;</BUG> import org.metaborg.core.MetaborgException; import org.metaborg.core.analysis.AnalysisException; import org.metaborg.core.context.IContext;
import java.util.stream.Collectors; import org.apache.commons.vfs2.FileObject;
44,319
import org.metaborg.core.language.ILanguageImpl; import org.metaborg.core.messages.IMessage; import org.metaborg.core.messages.MessageFactory; import org.metaborg.core.messages.MessageSeverity; import org.metaborg.core.resource.IResourceService; <BUG>import org.metaborg.core.source.ISourceLocation; import org.metaborg.meta.nabl2.solver.Message; import org.metaborg.meta.nabl2.stratego.StrategoTerms;</BUG> import org.metaborg.meta.nabl2.terms.ITerm;
import org.metaborg.meta.nabl2.constraints.messages.MessageKind; import org.metaborg.meta.nabl2.solver.ISolution; import org.metaborg.meta.nabl2.spoofax.analysis.EditorMessage; import org.metaborg.meta.nabl2.stratego.StrategoTerms;
44,320
protected final IStrategoRuntimeService runtimeService; protected final IStrategoCommon strategoCommon; protected final ISpoofaxTracingService tracingService; protected final ITermFactory termFactory; protected final StrategoTerms strategoTerms; <BUG>public AbstractConstraintAnalyzer( final AnalysisCommon analysisCommon, final IResourceService resourceService, final IStrategoRuntimeService runtimeService, final IStrategoCommon strategoCommon, final ITermFactoryService termFactoryService, final ISpoofaxTracingService tracingService) { this.analysisCommon = analysisCommon;</BUG> this.resourceService = resourceService;
public AbstractConstraintAnalyzer(final AnalysisCommon analysisCommon, final IResourceService resourceService, final IStrategoRuntimeService runtimeService, final IStrategoCommon strategoCommon, final ITermFactoryService termFactoryService, final ISpoofaxTracingService tracingService) { this.analysisCommon = analysisCommon;
44,321
input.detached() ? ("detached-" + UUID.randomUUID().toString()) : input.source().getName().getURI(); (input.valid() ? changed : removed).put(source, input); } return analyzeAll(changed, removed, context, runtime, facet.strategyName); } <BUG>protected abstract ISpoofaxAnalyzeResults analyzeAll(Map<String,ISpoofaxParseUnit> changed, Map<String,ISpoofaxParseUnit> removed, C context, HybridInterpreter runtime, String strategy) </BUG> throws AnalysisException;
protected abstract ISpoofaxAnalyzeResults analyzeAll(Map<String, ISpoofaxParseUnit> changed, Map<String, ISpoofaxParseUnit> removed, C context, HybridInterpreter runtime, String strategy)
44,322
} else { logger.warn("Ignoring location-less {}: {}", severity, message); return null; } } <BUG>protected List<Message> merge(List<Message> m1, List<Message> m2) { List<Message> m = Lists.newArrayList(); m.addAll(m1); m.addAll(m2); return m;</BUG> }
[DELETED]
44,323
import org.metaborg.core.analysis.AnalysisException; import org.metaborg.core.messages.IMessage; import org.metaborg.core.messages.MessageFactory; import org.metaborg.core.messages.MessageSeverity; import org.metaborg.core.resource.IResourceService; <BUG>import org.metaborg.meta.nabl2.constraints.IConstraint; import org.metaborg.meta.nabl2.solver.Solution;</BUG> import org.metaborg.meta.nabl2.solver.Solver; import org.metaborg.meta.nabl2.solver.UnsatisfiableException; import org.metaborg.meta.nabl2.spoofax.analysis.Actions;
import org.metaborg.meta.nabl2.constraints.messages.MessageKind; import org.metaborg.meta.nabl2.solver.Solution;
44,324
import org.xwiki.container.servlet.ServletContainerException; import org.xwiki.container.servlet.ServletContainerInitializer; import org.xwiki.context.Execution; import com.xpn.xwiki.XWiki; import com.xpn.xwiki.XWikiContext; <BUG>import com.xpn.xwiki.XWikiException; import com.xpn.xwiki.web.Utils; import com.xpn.xwiki.web.XWikiEngineContext; import com.xpn.xwiki.web.XWikiRequest; import com.xpn.xwiki.web.XWikiResponse;</BUG> import com.xpn.xwiki.web.XWikiServletContext;
import com.xpn.xwiki.user.api.XWikiUser;
44,325
super(context, rowDescriptor); } @Override protected void init() { super.init(); <BUG>mCheckBox = (CheckBox) findViewById(R.id.checkBox); mCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {</BUG> @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { onValueChanged(new Value<Boolean>(isChecked));
setStyleId(mCheckBox, CellDescriptor.APPEARANCE_TEXT_LABEL, CellDescriptor.COLOR_VALUE); mCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
44,326
BatchSuppressManager.SUPPRESS_INSPECTIONS_ANNOTATION_NAME.equals(text)) { final PsiElement annotationParent = annotation.getParent(); if (annotationParent instanceof PsiModifierList) { final Collection<String> ids = JavaSuppressionUtil.getInspectionIdsSuppressedInAnnotation((PsiModifierList)annotationParent); if (!myAllowedSuppressions.containsAll(ids)) { <BUG>registerError(annotation, annotation); }</BUG> } }
registerError(annotation, annotation, Boolean.TRUE);
44,327
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 String error404() { return "/error/404"; }
public class ErrorController { @RequestMapping(value = {"/404"})
44,328
public class GroupFactory extends GroupManager { private static GroupFactory s_instance; private static boolean s_initialized = false; private File m_groupsConfFile; private long m_lastModified; <BUG>private GroupFactory() { </BUG> } public static synchronized void init() throws IOException, FileNotFoundException, MarshalException, ValidationException { if (!s_initialized) {
public GroupFactory() {
44,329
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 CommandDelete extends FCCommandBase { private static final FlagMapper MAPPER = map -> key -> value -> { map.put(key, value);
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
44,330
.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]); </BUG> boolean isWorldRegion = false; if (region == null) {
String regionName = parse.args[1]; IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
44,331
</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 exists with the name \"" + regionName + "\"!")); if (region instanceof IGlobal) {
44,332
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[1]); if (handler == null) throw new ArgumentParseException(Text.of("No handler exists with that name!"), parse.args[1], 1); if (handler instanceof GlobalHandler)</BUG> throw new CommandException(Text.of("You may not delete the global handler!"));
Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]); if (!handlerOpt.isPresent()) IHandler handler = handlerOpt.get(); if (handler instanceof GlobalHandler)
44,333
.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 + args) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index == 1) {
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
44,334
.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 + args) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index == 1) {
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
44,335
@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 static FoxGuardMain instanceField;</BUG> @Inject private Logger logger;
private static FoxGuardMain instanceField;
44,336
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; }
44,337
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
44,338
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 CommandHere extends FCCommandBase { private static final String[] PRIORITY_ALIASES = {"priority", "prio", "p"}; private static final FlagMapper MAPPER = map -> key -> value -> {
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
44,339
.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 + args) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index > 0) {
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
44,340
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 = new CacheMap<>((k, m) -> {</BUG> if (k instanceof IFGObject) { m.put((IFGObject) k, true); return true;
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) -> {
44,341
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 { fgObject.save(singleDir);
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(name.toLowerCase()); logger.info((shouldSave ? "S" : "Force s") + "aving handler " + logName + " in directory: " + singleDir);
44,342
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 { fgObject.save(singleDir);
Path singleDir = serverDir.resolve(name.toLowerCase()); logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
44,343
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(entry -> { <BUG>IRegion region = FGManager.getInstance().getRegion(entry.getKey()); if (region != null) { logger.info("Loading links for region \"" + region.getName() + "\"");</BUG> String handlersString = entry.getValue();
Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey()); if (regionOpt.isPresent()) { IRegion region = regionOpt.get(); logger.info("Loading links for region \"" + region.getName() + "\"");
44,344
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("links", Serializer.STRING, Serializer.STRING).createOrOpen(); linksMap.entrySet().forEach(entry -> { <BUG>IRegion region = FGManager.getInstance().getWorldRegion(world, entry.getKey()); if (region != null) { logger.info("Loading links for world region \"" + region.getName() + "\"");</BUG> String handlersString = entry.getValue();
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() + "\"");
44,345
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
44,346
.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)) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index == 1) {
return Stream.of("region", "worldregion", "handler", "controller")
44,347
package org.jboss.as.jpa.injectors; import org.jboss.as.ee.component.BindingDescription; import org.jboss.as.ee.component.BindingSourceDescription; <BUG>import org.jboss.as.jpa.container.ExtendedEntityManager; import org.jboss.as.jpa.container.SFSBCallStack;</BUG> import org.jboss.as.jpa.container.SFSBXPCMap; import org.jboss.as.jpa.container.TransactionScopedEntityManager; import org.jboss.as.jpa.service.PersistenceUnitService;
import org.jboss.as.jpa.container.NonTxEmCloser; import org.jboss.as.jpa.container.SFSBCallStack;
44,348
if (type.equals(PersistenceContextType.TRANSACTION)) { entityManager = new TransactionScopedEntityManager(unitName, properties, emf);</BUG> if (log.isDebugEnabled()) log.debug("created new TransactionScopedEntityManager for unit name=" + unitName); } <BUG>else { EntityManager entityManager1 = SFSBCallStack.findPersistenceContext(unitName);</BUG> if (entityManager1 == null) { entityManager1 = emf.createEntityManager(properties); entityManager = new ExtendedEntityManager(unitName, entityManager1);
isExtended = false; entityManager = new TransactionScopedEntityManager(unitName, properties, emf); isExtended = true; EntityManager entityManager1 = SFSBCallStack.findPersistenceContext(unitName);
44,349
TransactionUtil.getInstance().registerExtendedWithTransaction(puScopedName, result); } } else { if (isInTx) { result = TransactionUtil.getInstance().getOrCreateTransactionScopedEntityManager(emf, puScopedName, properties); <BUG>} else { result = EntityManagerUtil.createEntityManager(emf, properties); }</BUG> } return result;
result = NonTxEmCloser.get(puScopedName); if (result == null) { NonTxEmCloser.add(puScopedName, result);
44,350
import javax.persistence.metamodel.Metamodel; import java.util.HashMap; import java.util.HashSet; import java.util.Map; public abstract class AbstractEntityManager implements EntityManager { <BUG>private static final HashSet<String> unwrapClassNamesThatShouldSkipPostInvocationStep = new HashSet<String>(); static { unwrapClassNamesThatShouldSkipPostInvocationStep.add("org.hibernate.Session"); }</BUG> private final Map<Class, Object> extensions = new HashMap<Class, Object>();
[DELETED]
44,351
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() );
44,352
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_();
44,353
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 );
44,354
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 );
44,355
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_();
44,356
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_();
44,357
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_();
44,358
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
44,359
@Test(expected = ExecutionException.class) public void testImproperOrNoManifestFile() throws Exception { String jar = JarFinder.getJar(WebCrawlApp.class, new Manifest()); Location deployedJar = lf.create(jar); deployedJar.deleteOnExit(); <BUG>TestHelper.getLocalManager(configuration).deploy(DefaultId.ACCOUNT, deployedJar); }</BUG> @Test public void testGoodPipeline() throws Exception { Location deployedJar = lf.create(
TestHelper.getLocalManager().deploy(DefaultId.ACCOUNT, deployedJar); }
44,360
@Test public void testGoodPipeline() throws Exception { Location deployedJar = lf.create( JarFinder.getJar(ToyApp.class, TestHelper.getManifestWithMainClass(ToyApp.class)) ); <BUG>ListenableFuture<?> p = TestHelper.getLocalManager(configuration).deploy(DefaultId.ACCOUNT, deployedJar); ApplicationWithPrograms input = (ApplicationWithPrograms)p.get();</BUG> Assert.assertEquals(input.getAppSpecLoc().getArchive(), deployedJar); Assert.assertEquals(input.getPrograms().iterator().next().getProcessorType(), Type.FLOW); Assert.assertEquals(input.getPrograms().iterator().next().getProgramName(), "ToyFlow");
ListenableFuture<?> p = TestHelper.getLocalManager().deploy(DefaultId.ACCOUNT, deployedJar); ApplicationWithPrograms input = (ApplicationWithPrograms)p.get();
44,361
return new BasicArguments(); } })); } TimeUnit.SECONDS.sleep(1); <BUG>OperationExecutor opex = injector.getInstance(OperationExecutor.class); </BUG> OperationContext opCtx = new OperationContext(DefaultId.ACCOUNT.getId(), app.getAppSpecLoc().getSpecification().getName()); QueueProducer queueProducer = new QueueProducer("Testing");
@Override public Arguments getUserArguments() { OperationExecutor opex = TestHelper.getInjector().getInstance(OperationExecutor.class);
44,362
new QueueEntry(codec.encodePayload(event))); opex.commit(opCtx, enqueue); } TimeUnit.SECONDS.sleep(10); Gson gson = new Gson(); <BUG>DiscoveryServiceClient discoveryServiceClient = injector.getInstance(DiscoveryServiceClient.class); </BUG> discoveryServiceClient.startAndWait(); Discoverable discoverable = discoveryServiceClient.discover( String.format("procedure.%s.%s.%s",
DiscoveryServiceClient discoveryServiceClient = TestHelper.getInjector().getInstance(DiscoveryServiceClient.class);
44,363
ListenableFuture<?> p = TestHelper.getLocalManager(configuration).deploy(DefaultId.ACCOUNT, deployedJar); final ApplicationWithPrograms app = (ApplicationWithPrograms)p.get();</BUG> ProgramController controller = null; for (final Program program : app.getPrograms()) { if (program.getProcessorType() == Type.FLOW) { <BUG>ProgramRunner runner = injector.getInstance(FlowProgramRunner.class); </BUG> controller = runner.run(program, new ProgramOptions() { @Override public String getName() {
} } @Test public void testCountRandomApp() throws Exception { TestHelper.getInjector().getInstance(DiscoveryService.class).startAndWait(); final ApplicationWithPrograms app = TestHelper.deployApplicationWithManager(TestCountRandomApp.class); ProgramRunner runner = TestHelper.getInjector().getInstance(FlowProgramRunner.class);
44,364
return p; } } return null; } <BUG>private ApplicationWithPrograms deployApp(Class<? extends Application> appClass) throws Exception { LocalLocationFactory lf = new LocalLocationFactory(); Location deployedJar = lf.create( JarFinder.getJar(appClass, TestHelper.getManifestWithMainClass(appClass)) ); deployedJar.deleteOnExit(); ListenableFuture<?> p = TestHelper.getLocalManager(configuration).deploy(DefaultId.ACCOUNT, deployedJar); return (ApplicationWithPrograms) p.get(); }</BUG> private byte[] tb(String val) {
[DELETED]
44,365
return new BasicArguments(); } })); } TimeUnit.SECONDS.sleep(4); <BUG>OperationExecutor opex = injector.getInstance(OperationExecutor.class); </BUG> OperationContext opCtx = new OperationContext(DefaultId.ACCOUNT.getId(), app.getAppSpecLoc().getSpecification().getName()); TransactionProxy proxy = new TransactionProxy();
@Override public Arguments getUserArguments() { OperationExecutor opex = TestHelper.getInjector().getInstance(OperationExecutor.class);
44,366
package com.continuuity; <BUG>import com.continuuity.api.Application; import com.continuuity.app.deploy.Manager;</BUG> import com.continuuity.app.guice.BigMamaModule; import com.continuuity.app.program.ManifestFields; import com.continuuity.app.services.AppFabricService;
import com.continuuity.app.DefaultId; import com.continuuity.app.deploy.Manager;
44,367
import com.continuuity.filesystem.Location; import com.continuuity.filesystem.LocationFactory; import com.continuuity.internal.app.BufferFileInputStream; import com.continuuity.internal.app.deploy.LocalManager; import com.continuuity.internal.app.deploy.pipeline.ApplicationWithPrograms; <BUG>import com.continuuity.app.deploy.ManagerFactory; import com.google.inject.Guice;</BUG> import com.google.inject.Injector; import org.junit.Assert; import java.nio.ByteBuffer;
import com.continuuity.internal.filesystem.LocalLocationFactory; import com.google.common.util.concurrent.ListenableFuture; import com.google.inject.Guice;
44,368
static { TempFolder tempFolder = new TempFolder(); configuration = CConfiguration.create(); configuration.set("app.output.dir", tempFolder.newFolder("app").getAbsolutePath()); configuration.set("app.tmp.dir", tempFolder.newFolder("temp").getAbsolutePath()); <BUG>injector = Guice.createInjector(new BigMamaModule(configuration), new DataFabricModules().getInMemoryModules()); }</BUG> public static Injector getInjector() { return injector; }
injector = Guice.createInjector(new BigMamaModule(configuration),
44,369
Manifest manifest = new Manifest(); manifest.getMainAttributes().put(ManifestFields.MANIFEST_VERSION, "1.0"); manifest.getMainAttributes().put(ManifestFields.MAIN_CLASS, klass.getName()); return manifest; } <BUG>public static Manager<Location, ApplicationWithPrograms> getLocalManager(CConfiguration configuration) { injector = Guice.createInjector(new BigMamaModule(configuration), new DataFabricModules().getInMemoryModules());</BUG> ManagerFactory factory = injector.getInstance(ManagerFactory.class); return (Manager<Location, ApplicationWithPrograms>)factory.create();
public static Manager<Location, ApplicationWithPrograms> getLocalManager() {
44,370
import org.junit.Test; import java.util.List; public class MDSBasedStoreTest { private MDSBasedStore store; private MetadataService.Iface metadataService; <BUG>private static CConfiguration configuration; static { configuration = TestHelper.configuration; }</BUG> @Before
private static CConfiguration configuration = TestHelper.configuration;
44,371
import org.mongojack.ObjectId; import javax.annotation.Nullable; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import java.time.ZonedDateTime; <BUG>import static java.util.Objects.requireNonNull; @AutoValue</BUG> @WithBeanGetter @JsonAutoDetect public abstract class IndexSetConfig implements Comparable<IndexSetConfig> {
import static com.google.common.base.Strings.isNullOrEmpty; @AutoValue
44,372
public abstract RetentionStrategyConfig retentionStrategy(); @JsonProperty(FIELD_CREATION_DATE) @NotNull public abstract ZonedDateTime creationDate(); @JsonProperty("index_analyzer") <BUG>@JsonIgnore public String indexAnalyzer() { return "standard"; }</BUG> @JsonProperty("index_template_name")
@NotBlank public abstract String indexAnalyzer();
44,373
.replicas(replicas) .rotationStrategyClass(rotationStrategyClass) .rotationStrategy(rotationStrategy) .retentionStrategyClass(retentionStrategyClass) .retentionStrategy(retentionStrategy) <BUG>.creationDate(creationDate) .build();</BUG> } public static IndexSetConfig create(String id, String title,
.indexAnalyzer(isNullOrEmpty(indexAnalyzer) ? "standard" : indexAnalyzer) .indexTemplateName(isNullOrEmpty(indexTemplateName) ? indexPrefix + "-template" : indexTemplateName) .indexOptimizationMaxNumSegments(maxNumSegments == null ? 1 : maxNumSegments) .indexOptimizationDisabled(indexOptimizationDisabled == null ? false : indexOptimizationDisabled) .build();
44,374
.indexPrefix(elasticsearchConfiguration.getIndexPrefix()) .shards(elasticsearchConfiguration.getShards()) .replicas(elasticsearchConfiguration.getReplicas()) .rotationStrategy(getRotationStrategyConfig(indexManagementConfig)) .retentionStrategy(getRetentionStrategyConfig(indexManagementConfig)) <BUG>.creationDate(ZonedDateTime.now(ZoneOffset.UTC)) .build();</BUG> final IndexSetConfig savedConfig = indexSetService.save(config); clusterConfigService.write(DefaultIndexSetConfig.create(savedConfig.id())); clusterConfigService.write(DefaultIndexSetCreated.create());
.indexAnalyzer(elasticsearchConfiguration.getAnalyzer()) .indexTemplateName(elasticsearchConfiguration.getTemplateName()) .indexOptimizationMaxNumSegments(elasticsearchConfiguration.getIndexOptimizationMaxNumSegments()) .indexOptimizationDisabled(elasticsearchConfiguration.isDisableIndexOptimization()) .build();
44,375
public abstract String nodeIdFile(); @JsonProperty("allow_highlighting") public abstract boolean allowHighlighting(); @JsonProperty("allow_leading_wildcard_searches") public abstract boolean allowLeadingWildcardSearches(); <BUG>@JsonProperty("elasticsearch_shards") public abstract int shards(); @JsonProperty("elasticsearch_replicas") public abstract int replicas();</BUG> @JsonProperty("stream_processing_timeout")
[DELETED]
44,376
public abstract int streamProcessingMaxFaults(); @JsonProperty("output_module_timeout") public abstract long outputModuleTimeout(); @JsonProperty("stale_master_timeout") public abstract int staleMasterTimeout(); <BUG>@JsonProperty("disable_index_optimization") public abstract boolean disableIndexOptimization(); @JsonProperty("index_optimization_max_num_segments") public abstract int indexOptimizationMaxSegments();</BUG> @JsonProperty("gc_warning_threshold")
[DELETED]
44,377
public abstract boolean disableIndexOptimization(); @JsonProperty("index_optimization_max_num_segments") public abstract int indexOptimizationMaxSegments();</BUG> @JsonProperty("gc_warning_threshold") public abstract String gcWarningThreshold(); <BUG>public static ExposedConfiguration create(Configuration configuration, ElasticsearchConfiguration esConfiguration) { return create(</BUG> configuration.getInputbufferProcessors(), configuration.getProcessBufferProcessors(), configuration.getOutputBufferProcessors(),
public abstract int streamProcessingMaxFaults(); @JsonProperty("output_module_timeout") public abstract long outputModuleTimeout(); @JsonProperty("stale_master_timeout") public abstract int staleMasterTimeout(); public static ExposedConfiguration create(Configuration configuration) { return create(
44,378
configuration.getRingSize(), configuration.getPluginDir(), configuration.getNodeIdFile(), configuration.isAllowHighlighting(), configuration.isAllowLeadingWildcardSearches(), <BUG>esConfiguration.getShards(), esConfiguration.getReplicas(),</BUG> configuration.getStreamProcessingTimeout(), configuration.getStreamProcessingMaxFaults(), configuration.getOutputModuleTimeout(),
[DELETED]
44,379
esConfiguration.getReplicas(),</BUG> configuration.getStreamProcessingTimeout(), configuration.getStreamProcessingMaxFaults(), configuration.getOutputModuleTimeout(), configuration.getStaleMasterTimeout(), <BUG>esConfiguration.isDisableIndexOptimization(), esConfiguration.getIndexOptimizationMaxNumSegments(),</BUG> configuration.getGcWarningThreshold().toString()); } @JsonCreator
configuration.getRingSize(), configuration.getPluginDir(), configuration.getNodeIdFile(), configuration.isAllowHighlighting(), configuration.isAllowLeadingWildcardSearches(),
44,380
@JsonProperty("ring_size") int ringSize, @JsonProperty("plugin_dir") String pluginDir, @JsonProperty("node_id_file") String nodeIdFile, @JsonProperty("allow_highlighting") boolean allowHighlighting, @JsonProperty("allow_leading_wildcard_searches") boolean allowLeadingWildcardSearches, <BUG>@JsonProperty("elasticsearch_shards") int shards, @JsonProperty("elasticsearch_replicas") int replicas,</BUG> @JsonProperty("stream_processing_timeout") long streamProcessingTimeout, @JsonProperty("stream_processing_max_faults") int streamProcessingMaxFaults, @JsonProperty("output_module_timeout") long outputModuleTimeout,
[DELETED]
44,381
@JsonProperty("elasticsearch_replicas") int replicas,</BUG> @JsonProperty("stream_processing_timeout") long streamProcessingTimeout, @JsonProperty("stream_processing_max_faults") int streamProcessingMaxFaults, @JsonProperty("output_module_timeout") long outputModuleTimeout, @JsonProperty("stale_master_timeout") int staleMasterTimeout, <BUG>@JsonProperty("disable_index_optimization") boolean disableIndexOptimization, @JsonProperty("index_optimization_max_num_segments") int indexOptimizationMaxSegments,</BUG> @JsonProperty("gc_warning_threshold") String gcWarningThreshold) { return new AutoValue_ExposedConfiguration( inputBufferProcessors,
@JsonProperty("ring_size") int ringSize, @JsonProperty("plugin_dir") String pluginDir, @JsonProperty("node_id_file") String nodeIdFile, @JsonProperty("allow_highlighting") boolean allowHighlighting, @JsonProperty("allow_leading_wildcard_searches") boolean allowLeadingWildcardSearches,
44,382
ringSize, pluginDir, nodeIdFile, allowHighlighting, allowLeadingWildcardSearches, <BUG>shards, replicas,</BUG> streamProcessingTimeout, streamProcessingMaxFaults, outputModuleTimeout,
[DELETED]
44,383
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;
44,384
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;
44,385
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,
44,386
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();
44,387
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;
44,388
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);
44,389
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,
44,390
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;
44,391
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;
44,392
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;
44,393
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;
44,394
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(),
44,395
.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())
44,396
.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())
44,397
} @Override public void lazyRegisterMBean(Object object, String name) { lazyPlatformMBeanServer.lazyRegisterMBean(object, name); } <BUG>} } </BUG>
void initEmbeddedServer() throws Exception { if (simpleRepoModule == null) { return;
44,398
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]
44,399
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) {
44,400
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);