id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
7,901
public void render(Component comp, Writer out) throws IOException { final WriterHelper wh = new WriterHelper(out); final Listitem self = (Listitem)comp; if(self.getMold().equals("select")){ wh.write("<option id=\"").write(self.getUuid()).write("\"").write(self.getOuterAttrs()).write(self.getInnerAttrs()).writeln(">"); <BUG>new Out(out).setMaxlength(self.getMaxlength()).setValue(self.getLabel()).render(); wh.write("</option>");</BUG> }else{ wh.write("<tr id=\"").write(self.getUuid()).write("\" z.type=\"Lit\"").write(self.getOuterAttrs()).write(self.getInnerAttrs()).writeln(">"); for (Iterator it = self.getChildren().iterator(); it.hasNext();) {
new Out(out, self.getLabel()).setMaxlength(self.getMaxlength()).render(); wh.write("</option>");
7,902
public void render(Component comp, Writer out) throws IOException { final WriterHelper wh = new WriterHelper(out); final Listheader self = (Listheader)comp; wh.write("<th id=\"").write(self.getUuid()).write("\" z.type=\"Lhr\"").write(self.getOuterAttrs()).write(self.getInnerAttrs()).writeln(">"); wh.write(self.getImgTag()); <BUG>new Out(out).setValue(self.getLabel()).render(); </BUG> for (Iterator it = self.getChildren().iterator(); it.hasNext();) { final Component child = (Component)it.next(); child.redraw(out);
new Out(out, self.getLabel()).render();
7,903
wh.write(" z.type=\"zul.widget.Ckbox\""); wh.write(self.getOuterAttrs()).write("><input type=\"checkbox\" id=\""); wh.write(uuid).write("!real\"").write(self.getInnerAttrs()); wh.write("/><label for=\"").write(uuid).write("!real\""); wh.write(self.getLabelAttrs()).write(">").write(self.getImgTag()); <BUG>new Out(out).setValue(self.getLabel()).render(); </BUG> wh.write("</label></span>"); wh.writeln(); }
new Out(out, self.getLabel()).render();
7,904
final Footer self = (Footer) comp; final String uuid = self.getUuid(); wh.write("<td id=\"").write(uuid).write("\""); wh.write(self.getOuterAttrs()).write(self.getInnerAttrs()).write(">"); wh.write(self.getImgTag()); <BUG>new Out(out).setValue(self.getLabel()).render(); </BUG> for (Iterator it = self.getChildren().iterator(); it.hasNext();) { ((Component) it.next()).redraw(out); }
new Out(out, self.getLabel()).render();
7,905
wh.write("<button type=\"button\" id=\"").write(uuid).write("\""); wh.write(" z.type=\"zul.widget.Button\"").write( self.getOuterAttrs()); wh.write(self.getInnerAttrs()).write(">"); if (self.getDir().equals("reverse")) { <BUG>new Out(out).setValue(self.getLabel()).render(); </BUG> if (self.isImageAssigned() && self.getOrient().equals("vertical")) wh.write("<br/>");
new Out(out, self.getLabel()).render();
7,906
final String uuid = self.getUuid(); wh.write("<select id=\"").write(uuid).write("\" z.type=\"zul.sel.Lisel\"").write(self.getOuterAttrs()).write(self.getInnerAttrs()).writeln(">"); for (Iterator it = self.getItems().iterator(); it.hasNext();) { final Listitem item = (Listitem)it.next(); wh.write("<option id=\"").write(item.getUuid()).write("\"").write(item.getOuterAttrs()).write(item.getInnerAttrs()).writeln(">"); <BUG>new Out(out).setMaxlength(self.getMaxlength()).setValue(item.getLabel()).render(); wh.write("</option>");</BUG> } wh.write("</select>"); }
new Out(out, item.getLabel()).setMaxlength(self.getMaxlength()).render(); wh.write("</option>");
7,907
public void render(Component comp, Writer out) throws IOException { final WriterHelper wh = new WriterHelper(out); final Toolbarbutton self = (Toolbarbutton) comp; wh.write("<a id=\"" + self.getUuid() + "\" z.type=\"zul.widget.Tbtn\"" + self.getOuterAttrs() + self.getInnerAttrs() + ">"); if (self.getDir().equals("reverse")){ <BUG>new Out(out).setValue(self.getLabel()).render(); </BUG> if (self.isImageAssigned() && self.getOrient().equals("vertical")){ wh.write("<br/>"); }
new Out(out, self.getLabel()).render();
7,908
else{ wh.write(self.getImgTag()); if (self.isImageAssigned() && self.getOrient().equals("vertical")){ wh.write("<br/>"); } <BUG>new Out(out).setValue(self.getLabel()).render(); </BUG> } wh.write("</a>"); }
new Out(out, self.getLabel()).render();
7,909
wh.write("javascript:;"); else wh.write(exec.encodeURL(self.getHref())); wh.write("\"").writeAttr("target",self.getTarget()); wh.write(" id=\"").write(uuid).write("!a\">").write(self.getImgTag()); <BUG>new Out(out).setValue(self.getLabel()).render(); </BUG> wh.write("</a>"); wh.writeln("</td>"); }else{
new Out(out, self.getLabel()).render();
7,910
public EditorCell_ComponentBase(EditorContext editorContext, SNode node) { super(editorContext, node); } @Override public void setX(int x) { <BUG>JComponent component = getComponent(); component.setLocation(x, component.getY()); super.setX(x); }</BUG> @Override
getComponent().setLocation(getX(), getY());
7,911
component.setLocation(x, component.getY()); super.setX(x); }</BUG> @Override public void setY(int y) { <BUG>JComponent component = getComponent(); component.setLocation(component.getX(), y); super.setY(y); }</BUG> @Override
public EditorCell_ComponentBase(EditorContext editorContext, SNode node) { super(editorContext, node); } public void setX(int x) { getComponent().setLocation(getX(), getY()); } getComponent().setLocation(getX(), getY()); }
7,912
import java.util.HashMap; import java.util.Locale; import java.util.Map; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; <BUG>import javax.portlet.PortletConfig; import javax.portlet.PortletPreferences;</BUG> import javax.portlet.PortletRequest; import javax.portlet.PortletRequestDispatcher; import javax.portlet.RenderRequest;
import javax.portlet.PortletContext; import javax.portlet.PortletPreferences;
7,913
package com.projecttango.examples.java.augmentedreality; import com.google.atap.tangoservice.Tango; import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoCameraIntrinsics; import com.google.atap.tangoservice.TangoConfig; <BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoEvent;</BUG> import com.google.atap.tangoservice.TangoOutOfDateException; import com.google.atap.tangoservice.TangoPoseData; import com.google.atap.tangoservice.TangoXyzIjData;
import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
7,914
super.onResume(); if (!mIsConnected) { mTango = new Tango(AugmentedRealityActivity.this, new Runnable() { @Override public void run() { <BUG>try { connectTango();</BUG> setupRenderer(); mIsConnected = true; } catch (TangoOutOfDateException e) {
TangoSupport.initialize(); connectTango();
7,915
if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) { mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics); mCameraPoseTimestamp = lastFramePose.timestamp;</BUG> } else { <BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread); }</BUG> } } } @Override
mRenderer.updateRenderCameraPose(lastFramePose); mCameraPoseTimestamp = lastFramePose.timestamp; Log.w(TAG, "Can't get device pose at time: " +
7,916
import org.rajawali3d.materials.Material; import org.rajawali3d.materials.methods.DiffuseMethod; import org.rajawali3d.materials.textures.ATexture; import org.rajawali3d.materials.textures.StreamingTexture; import org.rajawali3d.materials.textures.Texture; <BUG>import org.rajawali3d.math.Matrix4; import org.rajawali3d.math.vector.Vector3;</BUG> import org.rajawali3d.primitives.ScreenQuad; import org.rajawali3d.primitives.Sphere; import org.rajawali3d.renderer.RajawaliRenderer;
import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3;
7,917
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) { Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics); getCurrentCamera().setRotation(cameraPose.getOrientation()); getCurrentCamera().setPosition(cameraPose.getPosition()); }</BUG> public int getTextureId() {
public void updateRenderCameraPose(TangoPoseData cameraPose) { float[] rotation = cameraPose.getRotationAsFloats(); float[] translation = cameraPose.getTranslationAsFloats(); Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]); getCurrentCamera().setRotation(quaternion.conjugate()); getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
7,918
package com.projecttango.examples.java.helloareadescription; import com.google.atap.tangoservice.Tango; <BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoConfig;</BUG> import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig;
7,919
addColumn("indrelid", DataTypeManager.DefaultDataTypes.INTEGER, t); //$NON-NLS-1$ addColumn("indnatts", DataTypeManager.DefaultDataTypes.SHORT, t); //$NON-NLS-1$ addColumn("indisclustered", DataTypeManager.DefaultDataTypes.BOOLEAN, t); //$NON-NLS-1$ addColumn("indisunique", DataTypeManager.DefaultDataTypes.BOOLEAN, t); //$NON-NLS-1$ addColumn("indisprimary", DataTypeManager.DefaultDataTypes.BOOLEAN, t); //$NON-NLS-1$ <BUG>Column c = addColumn("indkey", DataTypeManager.DefaultDataTypes.STRING, t); //$NON-NLS-1$ c.setRuntimeType(DataTypeManager.getDataTypeName(DataTypeManager.getArrayType(DataTypeManager.DefaultDataClasses.SHORT))); </BUG> c.setProperty("pg_type:oid", String.valueOf(PG_TYPE_INT2VECTOR)); //$NON-NLS-1$ addColumn("indexprs", DataTypeManager.DefaultDataTypes.STRING, t); //$NON-NLS-1$
Column c = addColumn("indkey", DataTypeManager.getDataTypeName(DataTypeManager.getArrayType(DataTypeManager.DefaultDataClasses.SHORT)), t); //$NON-NLS-1$
7,920
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.*;
7,921
.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);
7,922
</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) {
7,923
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)
7,924
.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))
7,925
.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))
7,926
@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;
7,927
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; }
7,928
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
7,929
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.*;
7,930
.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))
7,931
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) -> {
7,932
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);
7,933
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);
7,934
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() + "\"");
7,935
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() + "\"");
7,936
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
7,937
.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")
7,938
else if (newIndex > repeatNodeSet.size()) adjustedNewIndex = repeatNodeSet.size(); else adjustedNewIndex = newIndex; } <BUG>xformsControls.getCurrentControlsState().updateRepeatIndex(repeatId, adjustedNewIndex); </BUG> } } else { currentControlsState.updateRepeatIndex(repeatId, 0);
currentControlsState.updateRepeatIndex(repeatId, adjustedNewIndex);
7,939
public class IncrementalTestGenerationHandler extends GenerationHandlerBase { private Map<String,String> generatedContent = new HashMap<String,String>(); private Map<String,String> existingContent; private IFile myFilesDir; private int timesCalled = 0; <BUG>private boolean myCheckIncremental = false; public IncrementalTestGenerationHandler() {</BUG> } public IncrementalTestGenerationHandler(Map<String,String> existingContent) { this.existingContent = existingContent;
private GenerationDependencies myLastDependencies; public IncrementalTestGenerationHandler() {
7,940
} public IncrementalTestGenerationHandler(Map<String,String> existingContent) { this.existingContent = existingContent; } public void checkIncremental() { <BUG>myCheckIncremental = true; }</BUG> public Map<String, String> getGeneratedContent() { return generatedContent; }
public GenerationDependencies getLastDependencies() { return myLastDependencies;
7,941
Assert.assertTrue("should be called once", timesCalled++ == 0); if(myCheckIncremental) { GenerationDependencies dep = status.getDependencies(); Assert.assertTrue("was not optimized", dep.getFromCacheCount() + dep.getSkippedCount() > 0); } <BUG>if (status.isOk()) { myFilesDir = FileGenerationUtil.getDefaultOutputDir(inputModel, targetDir);</BUG> IFile cachesDir = FileGenerationUtil.getDefaultOutputDir(inputModel, FileGenerationUtil.getCachesDir(targetDir)); StreamHandler streamHandler = new CollectingStreamHandler(cachesDir); try {
myLastDependencies = status.getDependencies(); myFilesDir = FileGenerationUtil.getDefaultOutputDir(inputModel, targetDir);
7,942
JDOMUtil.writeDocument(new Document(content), writer); saveStream(name, writer.toString(), isCache); } catch (IOException e) { Assert.fail(e.toString()); } <BUG>} else if(name.equals(".generated")) { try { JDOMUtil.writeDocument(new Document(content), myCaches.child(name)); } catch (IOException e) { Assert.fail(e.toString()); }</BUG> }
[DELETED]
7,943
jetbrains.mps.baseLanguage.math.runtime.IntervalTest.class, jetbrains.mps.vcs.diff.MergeRefactoringTest.class, jetbrains.mps.vcs.diff.MergeNotLoseExternalChangesTest.class, jetbrains.mps.vcs.diff.MergeReferencesTest.class, jetbrains.mps.vcs.diff.MergeConceptAndImportsTest.class, <BUG>jetbrains.mps.generator.test.ParallelPoolTest.class, jetbrains.mps.generator.test.ParallelGenerationMeasuringTest.class,</BUG> tests.Match_Test.class, tests.PerlReplace_Test.class, tests.Statements_Test.class,
jetbrains.mps.generator.test.IncrementalGenerationTest.class, jetbrains.mps.generator.test.ParallelGenerationMeasuringTest.class,
7,944
import java.util.Map; import java.util.Set; public class SourceStream { private final String name; private final Map<String, Integer> sourceClusters; <BUG>private final boolean isHCatEnabled; public SourceStream(String name, Map<String, Integer> sourceClusters, boolean isHCatEnabled) {</BUG> super();
public SourceStream(String name, Map<String, Integer> sourceClusters) {
7,945
package com.inmobi.conduit; public class DestinationStream { private final int retentionInHours; private final String name; private final Boolean isPrimary; <BUG>private final Boolean isHCatEnabled; public DestinationStream(String name, int retentionInHours, Boolean isPrimary, Boolean isHCatEnabled) {</BUG> this.name = name;
public DestinationStream(String name, int retentionInHours, Boolean isPrimary) {
7,946
Boolean isHCatEnabled) {</BUG> this.name = name; this.retentionInHours = retentionInHours; this.isPrimary = isPrimary; <BUG>this.isHCatEnabled = isHCatEnabled; } public Boolean isHCatEnabled() { return isHCatEnabled;</BUG> }
package com.inmobi.conduit; public class DestinationStream { private final int retentionInHours; private final String name; private final Boolean isPrimary; public DestinationStream(String name, int retentionInHours, Boolean isPrimary) {
7,947
List<GenericValue> allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", pcmpFindMap, null, false), true); tempVal = EntityUtil.getFirst(allPCMPs); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); tempVal = null; <BUG>} Timestamp fromDate = UtilDateTime.nowTimestamp(); if (tempVal != null) {</BUG> errMsg = UtilProperties.getMessage(resourceError, "contactmechservices.could_not_create_new_purpose_already_exists", locale);
if (UtilValidate.isEmpty(fromDate)) { if (tempVal != null) {
7,948
final int numConsumers = 4; final int consumerGroupId = 0; TTQueue queue = createQueue(); long dirtyVersion = 1; for(int i=0; i<numQueueEntries; i++) { <BUG>QueueEntry queueEntry=new QueueEntryImpl(Bytes.toBytes("value"+i%numConsumers)); queueEntry.addPartitioningKey(HASH_KEY, i); </BUG> assertTrue(queue.enqueue(queueEntry, dirtyVersion).isSuccess());
QueueEntry queueEntry=new QueueEntryImpl(Bytes.toBytes(i+1)); queueEntry.addPartitioningKey(HASH_KEY, i+1);
7,949
queueEntry.addPartitioningKey(HASH_KEY, i); </BUG> assertTrue(queue.enqueue(queueEntry, dirtyVersion).isSuccess()); } QueueConfig config = new QueueConfig(QueuePartitioner.PartitionerType.HASH, singleEntry); <BUG>StatefulQueueConsumer[] consumers = new StatefulQueueConsumer[numConsumers]; for(int i=0; i<numConsumers; i++) { </BUG> consumers[i]=new StatefulQueueConsumer(i, consumerGroupId, numConsumers, "group1", HASH_KEY, config);
final int numConsumers = 4; final int consumerGroupId = 0; TTQueue queue = createQueue(); long dirtyVersion = 1; for(int i=0; i<numQueueEntries; i++) { QueueEntry queueEntry=new QueueEntryImpl(Bytes.toBytes(i+1)); queueEntry.addPartitioningKey(HASH_KEY, i+1); StatefulQueueConsumer[] consumers = new StatefulQueueConsumer[numConsumers+1]; for(int i=1; i<=numConsumers; i++) {
7,950
static final byte [] META_ENTRY_PREFIX = {20}; //row <queueName>30<groupId><consumerId>, column 20<entryId> static final byte [] CONSUMER_READ_POINTER = {30}; //row <queueName>30<groupId><consumerId>, column 30 static final long INVALID_ENTRY_ID = -1; static final byte[] INVALID_ENTRY_ID_BYTES = Bytes.toBytes(INVALID_ENTRY_ID); static final long FIRST_QUEUE_ENTRY_ID = 1; <BUG>int batchSize = 20; </BUG> protected TTQueueNewOnVCTable(VersionedColumnarTable table, byte[] queueName, TimestampOracle timeOracle, final CConfiguration conf) { this.table = table;
int batchSize = 100;
7,951
final long currentEntryId = startEntryId + id; if(partitioner.usesHeaderData()) { final String partitioningKey = consumer.getPartitioningKey(); if (!headerResult.isEmpty()) { Map<byte[], Map<byte[], byte[]>> headerValue = headerResult.getValue(); <BUG>Map<byte[], byte[]> headerMap = headerValue.get(makeRowKey(GLOBAL_DATA_PREFIX, currentEntryId)); int hashValue = Bytes.toInt(headerMap.get(makeColumnName(ENTRY_HEADER, partitioningKey))); if(partitioner.shouldEmit(consumer, currentEntryId, hashValue)) {</BUG> newEntryIds.add(currentEntryId);
if(headerMap == null) { break outerLoop;
7,952
new byte[][] { acked, INVALID_ENTRY_ID_BYTES} ); } } @Override public void ack(QueueEntryPointer entryPointer, StatefulQueueConsumer statefulConsumer, ReadPointer readPointer) throws OperationException { <BUG>ack(entryPointer, (QueueConsumer) statefulConsumer, readPointer); </BUG> statefulConsumer.getQueueState().setActiveEntryId(INVALID_ENTRY_ID); } @Override
ackInternal(entryPointer, statefulConsumer, readPointer);
7,953
import org.apache.commons.lang3.math.NumberUtils; import org.json.JSONException; import org.mariotaku.microblog.library.MicroBlog; import org.mariotaku.microblog.library.MicroBlogException; import org.mariotaku.microblog.library.twitter.model.RateLimitStatus; <BUG>import org.mariotaku.microblog.library.twitter.model.Status; import org.mariotaku.sqliteqb.library.AllColumns;</BUG> import org.mariotaku.sqliteqb.library.Columns; import org.mariotaku.sqliteqb.library.Columns.Column; import org.mariotaku.sqliteqb.library.Expression;
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
7,954
context.getApplicationContext().sendBroadcast(intent); } } @Nullable public static Location getCachedLocation(Context context) { <BUG>if (BuildConfig.DEBUG) { Log.v(LOGTAG, "Fetching cached location", new Exception()); }</BUG> Location location = null;
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
7,955
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBannerImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
if (deleteImage) { Utils.deleteMedia(context, imageUri);
7,956
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBackgroundImage(fileBody, tile); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
7,957
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); return twitter.updateProfileImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
7,958
import org.mariotaku.twidere.receiver.NotificationReceiver; import org.mariotaku.twidere.service.LengthyOperationsService; import org.mariotaku.twidere.util.ActivityTracker; import org.mariotaku.twidere.util.AsyncTwitterWrapper; import org.mariotaku.twidere.util.DataStoreFunctionsKt; <BUG>import org.mariotaku.twidere.util.DataStoreUtils; import org.mariotaku.twidere.util.ImagePreloader;</BUG> import org.mariotaku.twidere.util.InternalTwitterContentUtils; import org.mariotaku.twidere.util.JsonSerializer; import org.mariotaku.twidere.util.NotificationManagerWrapper;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.ImagePreloader;
7,959
final List<InetAddress> addresses = mDns.lookup(host); for (InetAddress address : addresses) { c.addRow(new String[]{host, address.getHostAddress()}); } } catch (final IOException ignore) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, ignore); }</BUG> }
DebugLog.w(LOGTAG, null, ignore);
7,960
for (Location location : twitter.getAvailableTrends()) { map.put(location); } return map.pack(); } catch (final MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
7,961
import android.content.Context; import android.content.SharedPreferences; import android.location.Location; import android.os.AsyncTask; import android.support.annotation.NonNull; <BUG>import android.util.Log; import org.mariotaku.twidere.BuildConfig; import org.mariotaku.twidere.Constants; import org.mariotaku.twidere.util.JsonSerializer;</BUG> import org.mariotaku.twidere.util.Utils;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.JsonSerializer;
7,962
} public static LatLng getCachedLatLng(@NonNull final Context context) { final Context appContext = context.getApplicationContext(); final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences(); if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null; <BUG>if (BuildConfig.DEBUG) { Log.d(HotMobiLogger.LOGTAG, "getting cached location"); }</BUG> final Location location = Utils.getCachedLocation(appContext);
DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
7,963
public int destroySavedSearchAsync(final UserKey accountKey, final long searchId) { final DestroySavedSearchTask task = new DestroySavedSearchTask(accountKey, searchId); return asyncTaskManager.add(task, true); } public int destroyStatusAsync(final UserKey accountKey, final String statusId) { <BUG>final DestroyStatusTask task = new DestroyStatusTask(context,accountKey, statusId); </BUG> return asyncTaskManager.add(task, true); } public int destroyUserListAsync(final UserKey accountKey, final String listId) {
final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
7,964
@Override public void afterExecute(Bus handler, SingleResponse<Relationship> result) { if (result.hasData()) { handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData())); } else if (result.hasException()) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, "Unable to update friendship", result.getException()); }</BUG> }
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
7,965
MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId); if (!Utils.isOfficialCredentials(context, accountId)) continue; try { microBlog.setActivitiesAboutMeUnread(cursor); } catch (MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
7,966
public class CategoryManager { private static final java.util.logging.Logger LOGGER = Logger.getLogger(CategoryManager.class.getName()); private final ImageGalleryController controller; private DrawableDB db; <BUG>private final EventBus categoryEventBus = new EventBus("Category Event Bus"); private final LoadingCache<Category, LongAdder> categoryCounts</BUG> = CacheBuilder.newBuilder().build(CacheLoader.from(this::getCategoryCountHelper)); private final LoadingCache<Category, TagName> catTagNameMap = CacheBuilder.newBuilder().build(CacheLoader.from(cat -> getController().getTagsManager().getTagName(cat)));
private final EventBus categoryEventBus = new AsyncEventBus(Executors.newSingleThreadExecutor( new BasicThreadFactory.Builder().namingPattern("Category Event Bus").uncaughtExceptionHandler((Thread t, Throwable e) -> { LOGGER.log(Level.SEVERE, "uncaught exception in event bus handler", e); }).build() private final LoadingCache<Category, LongAdder> categoryCounts
7,967
groupKey = new GroupKey<Category>(DrawableAttribute.CATEGORY, CategoryManager.categoryFromTagName(evt.getTag().getName())); } final long fileID = evt.getTag().getContent().getId();</BUG> DrawableGroup g = getGroupForKey(groupKey); <BUG>addFileToGroup(g, groupKey, fileID); }</BUG> @SuppressWarnings("AssignmentToMethodParameter") private void addFileToGroup(DrawableGroup g, final GroupKey<?> groupKey, final long fileID) { if (g == null) { g = popuplateIfAnalyzed(groupKey, null);
} else if (groupBy == DrawableAttribute.TAGS && CategoryManager.isNotCategoryTagName(evt.getTag().getName())) { groupKey = new GroupKey<TagName>(DrawableAttribute.TAGS, evt.getTag().getName()); if (groupKey != null) { final long fileID = evt.getTag().getContent().getId();
7,968
package org.sleuthkit.autopsy.imagegallery.datamodel; import com.google.common.eventbus.EventBus; import java.util.Collection; import java.util.Collections; import java.util.List; <BUG>import java.util.Objects; import java.util.logging.Level; import java.util.stream.Collectors; import org.sleuthkit.autopsy.casemodule.services.TagsManager;</BUG> import org.sleuthkit.autopsy.coreutils.Logger;
import com.google.common.eventbus.AsyncEventBus; import java.util.concurrent.Executors; import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.sleuthkit.autopsy.casemodule.services.TagsManager;
7,969
import java.util.stream.Collectors; import org.sleuthkit.autopsy.casemodule.services.TagsManager;</BUG> import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.events.ContentTagDeletedEvent; <BUG>import org.sleuthkit.autopsy.imagegallery.datamodel.Category; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile;</BUG> import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.ContentTag; import org.sleuthkit.datamodel.TagName;
import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.sleuthkit.autopsy.casemodule.services.TagsManager;
7,970
try { return autopsyTagsManager.getAllTagNames().stream() .filter(CategoryManager::isCategoryTagName) .collect(Collectors.toSet()); } catch (TskCoreException | IllegalStateException ex) { <BUG>Logger.getLogger(DrawableTagsManager.class.getName()).log(Level.WARNING, "couldn't access case", ex); }</BUG> return Collections.emptySet(); } }
LOGGER.log(Level.WARNING, "couldn't access case", ex);
7,971
return autopsyTagsManager.addTagName(displayName); } catch (TagsManager.TagNameAlreadyExistsException ex) { throw new TskCoreException("tagame exists but wasn't found", ex); } } catch (IllegalStateException ex) { <BUG>Logger.getLogger(DrawableTagsManager.class.getName()).log(Level.SEVERE, "Case was closed out from underneath", ex); throw new TskCoreException("Case was closed out from underneath", ex);</BUG> } } }
LOGGER.log(Level.SEVERE, "Case was closed out from underneath", ex); throw new TskCoreException("Case was closed out from underneath", ex);
7,972
listNotesIntent.setAction("com.farmerbb.notepad.LIST_NOTES"); getActivity().sendBroadcast(listNotesIntent); } } private void showToast(int message) { <BUG>Toast toast = Toast.makeText(getActivity().getApplicationContext(), getResources().getString(message), Toast.LENGTH_SHORT); toast.show();</BUG> } public void onBackDialogNegativeClick(String filename) { showToast(R.string.changes_discarded);
Toast toast = Toast.makeText(getActivity(), getResources().getString(message), Toast.LENGTH_SHORT); toast.show();
7,973
package com.farmerbb.notepad; import android.app.Activity; import android.app.DialogFragment; import android.app.Fragment; <BUG>import android.app.FragmentTransaction; import android.content.Intent; import android.os.Bundle;</BUG> import android.view.KeyEvent; import android.widget.Toast;
import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle;
7,974
AppDeploymentRequest request = this.appDeploymentRequestArgumentCaptor.getValue(); assertEquals(this.resource, request.getResource()); assertEquals(0, request.getDeploymentProperties().size()); AppDefinition appDefinition = request.getDefinition(); assertEquals("partitionedJobTask:partitionedJob:step1:partition1", appDefinition.getName()); <BUG>assertEquals("1", appDefinition.getProperties().get(DeployerPartitionHandler.SPRING_CLOUD_TASK_JOB_EXECUTION_ID)); assertEquals("4", appDefinition.getProperties().get(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_EXECUTION_ID)); assertEquals("step1", appDefinition.getProperties().get(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_NAME)); assertEquals(1, results.size());</BUG> StepExecution resultStepExecution = results.iterator().next();
assertTrue(request.getCommandlineArguments().contains(formatArgs(DeployerPartitionHandler.SPRING_CLOUD_TASK_JOB_EXECUTION_ID, "1"))); assertTrue(request.getCommandlineArguments().contains(formatArgs(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_EXECUTION_ID, "4"))); assertTrue(request.getCommandlineArguments().contains(formatArgs(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_NAME, "step1"))); assertEquals(1, results.size());
7,975
handler.beforeTask(taskExecution); Collection<StepExecution> results = handler.handle(this.splitter, masterStepExecution); verify(this.taskLauncher).launch(this.appDeploymentRequestArgumentCaptor.capture()); AppDeploymentRequest request = this.appDeploymentRequestArgumentCaptor.getValue(); assertEquals(this.resource, request.getResource()); <BUG>assertEquals(2, request.getDeploymentProperties().size()); assertEquals("bar", request.getDeploymentProperties().get("foo")); assertEquals("qux", request.getDeploymentProperties().get("baz")); </BUG> AppDefinition appDefinition = request.getDefinition();
assertEquals(0, request.getDeploymentProperties().size());
7,976
assertEquals("qux", request.getDeploymentProperties().get("baz")); </BUG> AppDefinition appDefinition = request.getDefinition(); assertEquals("partitionedJobTask:partitionedJob:step1:partition1", appDefinition.getName()); <BUG>assertEquals("1", appDefinition.getProperties().get(DeployerPartitionHandler.SPRING_CLOUD_TASK_JOB_EXECUTION_ID)); assertEquals("4", appDefinition.getProperties().get(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_EXECUTION_ID)); assertEquals("step1", appDefinition.getProperties().get(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_NAME)); assertEquals(1, results.size());</BUG> StepExecution resultStepExecution = results.iterator().next();
handler.beforeTask(taskExecution); Collection<StepExecution> results = handler.handle(this.splitter, masterStepExecution); verify(this.taskLauncher).launch(this.appDeploymentRequestArgumentCaptor.capture()); AppDeploymentRequest request = this.appDeploymentRequestArgumentCaptor.getValue(); assertEquals(this.resource, request.getResource()); assertEquals(0, request.getDeploymentProperties().size()); assertTrue(request.getCommandlineArguments().contains(formatArgs(DeployerPartitionHandler.SPRING_CLOUD_TASK_JOB_EXECUTION_ID, "1"))); assertTrue(request.getCommandlineArguments().contains(formatArgs(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_EXECUTION_ID, "4"))); assertTrue(request.getCommandlineArguments().contains(formatArgs(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_NAME, "step1"))); assertEquals(1, results.size());
7,977
handler.beforeTask(taskExecution); Collection<StepExecution> results = handler.handle(this.splitter, masterStepExecution); verify(this.taskLauncher).launch(this.appDeploymentRequestArgumentCaptor.capture()); AppDeploymentRequest request = this.appDeploymentRequestArgumentCaptor.getValue(); assertEquals(this.resource, request.getResource()); <BUG>assertEquals(3, request.getDeploymentProperties().size()); assertEquals("bar", request.getDeploymentProperties().get("foo")); assertEquals("qux", request.getDeploymentProperties().get("baz")); assertEquals("batch", request.getDeploymentProperties().get("task")); </BUG> AppDefinition appDefinition = request.getDefinition();
assertEquals(0, request.getDeploymentProperties().size());
7,978
assertEquals("batch", request.getDeploymentProperties().get("task")); </BUG> AppDefinition appDefinition = request.getDefinition(); assertEquals("partitionedJobTask:partitionedJob:step1:partition1", appDefinition.getName()); <BUG>assertEquals("1", appDefinition.getProperties().get(DeployerPartitionHandler.SPRING_CLOUD_TASK_JOB_EXECUTION_ID)); assertEquals("4", appDefinition.getProperties().get(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_EXECUTION_ID)); assertEquals("step1", appDefinition.getProperties().get(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_NAME)); assertEquals(1, results.size());</BUG> StepExecution resultStepExecution = results.iterator().next();
handler.beforeTask(taskExecution); Collection<StepExecution> results = handler.handle(this.splitter, masterStepExecution); verify(this.taskLauncher).launch(this.appDeploymentRequestArgumentCaptor.capture()); AppDeploymentRequest request = this.appDeploymentRequestArgumentCaptor.getValue(); assertEquals(this.resource, request.getResource()); assertEquals(0, request.getDeploymentProperties().size()); assertTrue(request.getCommandlineArguments().contains(formatArgs(DeployerPartitionHandler.SPRING_CLOUD_TASK_JOB_EXECUTION_ID, "1"))); assertTrue(request.getCommandlineArguments().contains(formatArgs(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_EXECUTION_ID, "4"))); assertTrue(request.getCommandlineArguments().contains(formatArgs(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_NAME, "step1"))); assertEquals(1, results.size());
7,979
AppDeploymentRequest request = allRequests.get(i - 4); assertEquals(this.resource, request.getResource()); assertEquals(0, request.getDeploymentProperties().size()); AppDefinition appDefinition = request.getDefinition(); assertEquals("partitionedJobTask:partitionedJob:step1:partition" + (i - 3), appDefinition.getName()); <BUG>assertEquals("1", appDefinition.getProperties().get(DeployerPartitionHandler.SPRING_CLOUD_TASK_JOB_EXECUTION_ID)); assertEquals(String.valueOf(i), appDefinition.getProperties().get(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_EXECUTION_ID)); assertEquals("step1", appDefinition.getProperties().get(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_NAME)); }</BUG> }
assertTrue(request.getCommandlineArguments().contains(formatArgs(DeployerPartitionHandler.SPRING_CLOUD_TASK_JOB_EXECUTION_ID, "1"))); assertTrue(request.getCommandlineArguments().contains(formatArgs(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_EXECUTION_ID, String.valueOf(i)))); assertTrue(request.getCommandlineArguments().contains(formatArgs(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_NAME, "step1")));
7,980
private Map<String, String> environmentProperties = new HashMap<>(); private String stepName; private Log logger = LogFactory.getLog(DeployerPartitionHandler.class); private long pollInterval = 10000; private long timeout = -1; <BUG>private Environment environment; public DeployerPartitionHandler(TaskLauncher taskLauncher,</BUG> JobExplorer jobExplorer, Resource resource, String stepName) {
private Map<String, String> deploymentProperties; public DeployerPartitionHandler(TaskLauncher taskLauncher,
7,981
public void setPollInterval(long pollInterval) { this.pollInterval = pollInterval; } public void setTimeout(long timeout) { this.timeout = timeout; <BUG>} @BeforeTask</BUG> public void beforeTask(TaskExecution taskExecution) { this.taskExecution = taskExecution; }
public void setDeploymentProperties(Map<String, String> deploymentProperties) { this.deploymentProperties = deploymentProperties; @BeforeTask
7,982
import org.apache.bcel.generic.ReferenceType; import org.apache.bcel.generic.Type; import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.Detector; <BUG>import edu.umd.cs.findbugs.Lookup; import edu.umd.cs.findbugs.StatelessDetector;</BUG> import edu.umd.cs.findbugs.TypeAnnotation; import edu.umd.cs.findbugs.ba.AnalysisContext; import edu.umd.cs.findbugs.ba.CFG;
import edu.umd.cs.findbugs.MethodAnnotation; import edu.umd.cs.findbugs.StatelessDetector;
7,983
import com.intellij.psi.impl.source.resolve.ResolveCache; import com.intellij.psi.impl.source.tree.ChildRole; import com.intellij.psi.scope.ElementClassHint; import com.intellij.psi.scope.JavaScopeProcessorEvent; import com.intellij.psi.scope.NameHint; <BUG>import com.intellij.psi.scope.PsiScopeProcessor; import com.intellij.psi.tree.IElementType;</BUG> import com.intellij.psi.util.CachedValueProvider; import com.intellij.psi.util.ParameterizedCachedValue; import com.intellij.psi.util.ParameterizedCachedValueProvider;
import com.intellij.psi.stubs.StubElement; import com.intellij.psi.tree.IElementType;
7,984
import com.intellij.util.containers.HashSet; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.lang.ref.Reference; <BUG>import java.util.ArrayList; import java.util.List; import java.util.Map; </BUG> import java.util.concurrent.ConcurrentMap;
import java.util.*;
7,985
clone.clearCaches(); return clone; } @NotNull public PsiClass[] getClasses() { <BUG>final PsiJavaFileStub stub = (PsiJavaFileStub)getStub(); if (stub != null) {</BUG> return stub.getChildrenByType(JavaStubElementTypes.CLASS, PsiClass.ARRAY_FACTORY); } return calcTreeElement().getChildrenAsPsiElements(Constants.CLASS_BIT_SET, Constants.PSI_CLASS_ARRAY_CONSTRUCTOR);
final StubElement<?> stub = getStub(); if (stub != null) {
7,986
public String getPackageName() { PsiJavaFileStub stub = (PsiJavaFileStub)getStub(); if (stub != null) { return stub.getPackageName(); } <BUG>PsiPackageStatement statement = getPackageStatement(); if (statement == null) { return ""; } else { return statement.getPackageName(); }</BUG> }
return statement == null ? "" : statement.getPackageName();
7,987
} @NotNull public PsiJavaCodeReferenceElement[] getImplicitlyImportedPackageReferences() { return PsiImplUtil.namesToPackageReferences(myManager, IMPLICIT_IMPORTS); } <BUG>public static class StaticImportFilteringProcessor implements PsiScopeProcessor { </BUG> private final PsiScopeProcessor myDelegate; private String myNameToFilter; private boolean myIsProcessingOnDemand;
return calcTreeElement().getChildrenAsPsiElements(Constants.CLASS_BIT_SET, Constants.PSI_CLASS_ARRAY_CONSTRUCTOR);
7,988
package com.dangdang.ddframe.rdb.sharding.config.common.api; import com.dangdang.ddframe.rdb.sharding.api.rule.BindingTableRule; import com.dangdang.ddframe.rdb.sharding.api.rule.DataSourceRule; import com.dangdang.ddframe.rdb.sharding.api.rule.ShardingRule; import com.dangdang.ddframe.rdb.sharding.api.rule.TableRule; <BUG>import com.dangdang.ddframe.rdb.sharding.router.strategy.MultipleKeysShardingAlgorithm; import com.dangdang.ddframe.rdb.sharding.router.strategy.ShardingAlgorithm; import com.dangdang.ddframe.rdb.sharding.router.strategy.ShardingStrategy; import com.dangdang.ddframe.rdb.sharding.router.strategy.SingleKeyShardingAlgorithm;</BUG> import com.dangdang.ddframe.rdb.sharding.api.strategy.database.DatabaseShardingStrategy;
[DELETED]
7,989
import com.dangdang.ddframe.rdb.sharding.config.common.api.config.ShardingRuleConfig; import com.dangdang.ddframe.rdb.sharding.config.common.api.config.StrategyConfig; import com.dangdang.ddframe.rdb.sharding.config.common.api.config.TableRuleConfig; import com.dangdang.ddframe.rdb.sharding.config.common.internal.algorithm.ClosureDatabaseShardingAlgorithm; import com.dangdang.ddframe.rdb.sharding.config.common.internal.algorithm.ClosureTableShardingAlgorithm; <BUG>import com.dangdang.ddframe.rdb.sharding.config.common.internal.parser.InlineParser; import com.google.common.base.Function;</BUG> import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.collect.Lists;
import com.dangdang.ddframe.rdb.sharding.router.strategy.MultipleKeysShardingAlgorithm; import com.dangdang.ddframe.rdb.sharding.router.strategy.ShardingAlgorithm; import com.dangdang.ddframe.rdb.sharding.router.strategy.ShardingStrategy; import com.dangdang.ddframe.rdb.sharding.router.strategy.SingleKeyShardingAlgorithm; import com.google.common.base.Function;
7,990
this(logRoot, Collections.<String, DataSource>emptyMap(), shardingRuleConfig); } public ShardingRule build() { DataSourceRule dataSourceRule = buildDataSourceRule(); Collection<TableRule> tableRules = buildTableRules(dataSourceRule); <BUG>return new ShardingRule(dataSourceRule, tableRules, buildBindingTableRules(tableRules), buildShardingStrategy(shardingRuleConfig.getDefaultDatabaseStrategy(), DatabaseShardingStrategy.class), buildShardingStrategy(shardingRuleConfig.getDefaultTableStrategy(), TableShardingStrategy.class)); </BUG> }
return ShardingRule.builder().dataSourceRule(dataSourceRule).tableRules(tableRules).bindingTableRules(buildBindingTableRules(tableRules)) .databaseShardingStrategy(buildShardingStrategy(shardingRuleConfig.getDefaultDatabaseStrategy(), DatabaseShardingStrategy.class)) .tableShardingStrategy(buildShardingStrategy(shardingRuleConfig.getDefaultTableStrategy(), TableShardingStrategy.class)).build();
7,991
package com.dangdang.ddframe.rdb.sharding.config.common.api; import java.util.Arrays; import java.util.HashMap; import java.util.Map; <BUG>import javax.sql.DataSource; import com.dangdang.ddframe.rdb.sharding.api.rule.ShardingRule;</BUG> import com.dangdang.ddframe.rdb.sharding.api.rule.TableRule; import com.dangdang.ddframe.rdb.sharding.config.common.api.config.ShardingRuleConfig; import lombok.extern.slf4j.Slf4j;
import com.dangdang.ddframe.rdb.sharding.api.rule.DynamicDataNode; import com.dangdang.ddframe.rdb.sharding.api.rule.ShardingRule;
7,992
import org.apache.commons.dbcp.BasicDataSource; import org.junit.Test; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.Constructor; import static org.hamcrest.CoreMatchers.hasItems; <BUG>import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; @Slf4j</BUG> public class ShardingRuleBuilderTest { @Test
import static org.hamcrest.core.IsCollectionContaining.hasItem; import static org.junit.Assert.fail; @Slf4j
7,993
result.put(each.getAttribute(ShardingJdbcDataSourceBeanDefinitionParserTag.LOGIC_TABLE_ATTR), parseTableRuleConfig(each)); } return result; } private BeanDefinition parseTableRuleConfig(final Element tableElement) { <BUG>BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(TableRuleConfig.class); String actualTables = tableElement.getAttribute(ShardingJdbcDataSourceBeanDefinitionParserTag.ACTUAL_TABLES_ATTR);</BUG> if (!Strings.isNullOrEmpty(actualTables)) { factory.addPropertyValue("actualTables", actualTables); }
String dynamic = tableElement.getAttribute(ShardingJdbcDataSourceBeanDefinitionParserTag.DYNAMIC_TABLE_ATTR); if (!Strings.isNullOrEmpty(dynamic)) { factory.addPropertyValue("dynamic", dynamic); String actualTables = tableElement.getAttribute(ShardingJdbcDataSourceBeanDefinitionParserTag.ACTUAL_TABLES_ATTR);
7,994
public static final String TABLE_RULES_TAG = "table-rules"; public static final String TABLE_RULE_TAG = "table-rule"; public static final String BINDING_TABLE_RULES_TAG = "binding-table-rules"; public static final String BINDING_TABLE_RULE_TAG = "binding-table-rule"; public static final String LOGIC_TABLE_ATTR = "logic-table"; <BUG>public static final String LOGIC_TABLES_ATTR = "logic-tables"; public static final String ACTUAL_TABLES_ATTR = "actual-tables";</BUG> public static final String DATABASE_STRATEGY_ATTR = "database-strategy"; public static final String TABLE_STRATEGY_ATTR = "table-strategy"; public static final String DEFAULT_DATABASE_STRATEGY_ATTR = "default-database-strategy";
public static final String DYNAMIC_TABLE_ATTR = "dynamic"; public static final String ACTUAL_TABLES_ATTR = "actual-tables";
7,995
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.*;
7,996
.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);
7,997
</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) {
7,998
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)
7,999
.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))
8,000
.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))