id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
47,501
public boolean areEqual(TerminationPoint updated, TerminationPoint orig) { HwvtepPhysicalLocatorAugmentation updatedPhysicalLocator = updated.getAugmentation(HwvtepPhysicalLocatorAugmentation.class); HwvtepPhysicalLocatorAugmentation origPhysicalLocator = orig.getAugmentation(HwvtepPhysicalLocatorAugmentation.class); <...
return updatedPhysicalLocator.getDstIp().equals(origPhysicalLocator.getDstIp()) && (updatedPhysicalLocator.getEncapsulationType() == origPhysicalLocator.getEncapsulationType());
47,502
NeutronNetworkInterface(final DataBroker dataBroker) { super(dataBroker); } @Override public boolean networkExists(String uuid) { <BUG>Network network = readMd(createInstanceIdentifier(toMd(uuid))); if (network == null) { return false; } return true;</BUG> }
[DELETED]
47,503
updateMd(delta); return true; } @Override public boolean networkInUse(String netUUID) { <BUG>if (!networkExists(netUUID)) { return true; } return false;</BUG> }
return !networkExists(netUUID);
47,504
return learntIpToPortOpt.get().getMacAddress(); } LOG.error("No resolution was found to GW ip {} in subnet {}", gatewayIp, subnetId.getValue()); return null; } <BUG>public static boolean isIPv6Subnet(String prefix) { IpPrefix ipPrefix = new IpPrefix(prefix.toCharArray()); if (ipPrefix.getIpv6Prefix() != null) { return ...
return new IpPrefix(prefix.toCharArray()).getIpv6Prefix() != null;
47,505
public boolean areEqual(LocalUcastMacs updated, LocalUcastMacs orig) { InstanceIdentifier<?> updatedMacRefIdentifier = updated.getLogicalSwitchRef().getValue(); HwvtepNodeName updatedMacNodeName = updatedMacRefIdentifier .firstKeyOf(LogicalSwitches.class).getHwvtepNodeName(); InstanceIdentifier<?> origMacRefIdentifier ...
return updated.getMacEntryKey().equals(orig.getMacEntryKey()) && updatedMacNodeName.equals(origMacNodeName);
47,506
availableGlobalNodes.put(globalId, Boolean.TRUE); } } boolean areBothGlobalAndPsNodeAvailable(InstanceIdentifier<Node> key) { String id = key.firstKeyOf(Node.class).getNodeId().getValue(); <BUG>String psId = null; String globalId = null; if (id.indexOf(HwvtepHAUtil.PHYSICALSWITCH) > 0) { psId = id;</BUG> globalId = id....
String globalId;
47,507
psId = id;</BUG> globalId = id.substring(0, id.indexOf(HwvtepHAUtil.PHYSICALSWITCH)); } else { globalId = id; } <BUG>if (availableGlobalNodes.containsKey(globalId) && availablePsNodes.containsKey(globalId)) { return true; } return false;</BUG> }
availableGlobalNodes.put(globalId, Boolean.TRUE); boolean areBothGlobalAndPsNodeAvailable(InstanceIdentifier<Node> key) { String id = key.firstKeyOf(Node.class).getNodeId().getValue(); String globalId; if (id.indexOf(HwvtepHAUtil.PHYSICALSWITCH) > 0) { return availableGlobalNodes.containsKey(globalId) && availablePsNod...
47,508
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.List; <BUG>import java.util.Optional; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class CommandDel...
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
47,509
.append(Text.of(TextColors.GREEN, "Usage: ")) .append(getUsage(source)) .build()); return CommandResult.empty(); } else if (isIn(REGIONS_ALIASES, parse.args[0])) { <BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); IRegion region = FGManager.getInstance().getRegion(parse.args[1...
String regionName = parse.args[1]; IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
47,510
</BUG> isWorldRegion = true; } if (region == null) <BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!")); if (region instanceof GlobalWorldRegion) { </BUG> throw new CommandException(Text.of("You may not delete the global region!")); }
if (world == null) throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!")); if (world == null) throw new CommandException(Text.of("Must specify a world!")); region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null); throw new CommandException(Text.of("No region exis...
47,511
source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region" ); return CommandResult.success(); } else if (isIn(HANDLERS_ALIASES, parse.args[0])) { if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); <BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[...
Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]); if (!handlerOpt.isPresent()) IHandler handler = handlerOpt.get(); if (handler instanceof GlobalHandler)
47,512
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix...
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
47,513
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix...
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
47,514
@Dependency(id = "foxcore") }, description = "A world protection plugin built for SpongeAPI. Requires FoxCore.", authors = {"gravityfox"}, url = "https://github.com/FoxDenStudio/FoxGuard") <BUG>public final class FoxGuardMain { public final Cause pluginCause = Cause.builder().named("plugin", this).build(); private stat...
private static FoxGuardMain instanceField;
47,515
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; }
47,516
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
47,517
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.*; <BUG>import java.util.stream.Collectors; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class Comm...
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
47,518
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix...
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
47,519
private static FGStorageManager instance; private final Logger logger = FoxGuardMain.instance().getLogger();</BUG> private final Set<LoadEntry> loaded = new HashSet<>(); private final Path directory = getDirectory(); private final Map<String, Path> worldDirectories; <BUG>private FGStorageManager() { defaultModifiedMap ...
public final HashMap<IFGObject, Boolean> defaultModifiedMap; private final UserStorageService userStorageService; private final Logger logger = FoxGuardMain.instance().getLogger(); userStorageService = FoxGuardMain.instance().getUserStorage(); defaultModifiedMap = new CacheMap<>((k, m) -> {
47,520
String name = fgObject.getName(); Path singleDir = dir.resolve(name.toLowerCase()); </BUG> boolean shouldSave = fgObject.shouldSave(); if (force || shouldSave) { <BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir); </BUG> constructDirectory(singleDir); try { fg...
UUID owner = fgObject.getOwner(); boolean isOwned = !owner.equals(SERVER_UUID); Optional<User> userOwner = userStorageService.get(owner); String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name; if (fgObject.autoSave()) { Path singleDir = serverDir.resolve(n...
47,521
if (fgObject.autoSave()) { Path singleDir = dir.resolve(name.toLowerCase()); </BUG> boolean shouldSave = fgObject.shouldSave(); if (force || shouldSave) { <BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir); </BUG> constructDirectory(singleDir); try { fgOb...
Path singleDir = serverDir.resolve(name.toLowerCase()); logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
47,522
public synchronized void loadRegionLinks() { logger.info("Loading region links"); try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) { Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen(); linksMap.entrySet().forEach(...
Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey()); if (regionOpt.isPresent()) { IRegion region = regionOpt.get(); logger.info("Loading links for region \"" + region.getName() + "\"");
47,523
public synchronized void loadWorldRegionLinks(World world) { logger.info("Loading world region links for world \"" + world.getName() + "\""); try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) { Map<String, String> linksMap = mainDB.hashMap("l...
Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey()); if (regionOpt.isPresent()) { IWorldRegion region = regionOpt.get(); logger.info("Loading links for world region \"" + region.getName() + "\"");
47,524
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
47,525
.autoCloseQuotes(true) .leaveFinalAsIs(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream() </BUG> .filter(new StartsWithPredicate(parse.current.token)) .co...
return Stream.of("region", "worldregion", "handler", "controller")
47,526
chart.addYAxisLabels(AxisLabelsFactory.newAxisLabels(labels)); chart.addXAxisLabels(AxisLabelsFactory.newNumericRangeAxisLabels(0, max)); chart.setBarWidth(BarChart.AUTO_RESIZE); chart.setSize(600, 500); chart.setHorizontal(true); <BUG>chart.setTitle("Total Evaluations by User"); showChartImg(resp, chart.toURLString())...
chart.setDataEncoding(DataEncoding.TEXT); return chart; }
47,527
checkEvaluationsEqual(eval4, foundissueProto.getEvaluations(0)); checkEvaluationsEqual(eval5, foundissueProto.getEvaluations(1)); } public void testGetRecentEvaluationsNoneFound() throws Exception { DbIssue issue = createDbIssue("fad", persistenceHelper); <BUG>DbEvaluation eval1 = createEvaluation(issue, "someone", 100...
[DELETED]
47,528
public int read() throws IOException { return inputStream.read(); } }); } <BUG>} protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {</BUG> DbUser user; Query query = getPersistenceManager().newQuery("select from " + persistenceHelper.getDbUserClass().getName() + " where openid == :myopenid")...
@SuppressWarnings({"unchecked"}) protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {
47,529
eval.setComment("my comment"); eval.setDesignation("MUST_FIX"); eval.setIssue(issue); eval.setWhen(when); eval.setWho(user.createKeyObject()); <BUG>eval.setEmail(who); return eval;</BUG> } protected PersistenceManager getPersistenceManager() { return testHelper.getPersistenceManager();
issue.addEvaluation(eval); return eval;
47,530
import org.opendaylight.controller.sal.action.Action; import org.opendaylight.controller.sal.action.Output; import org.opendaylight.controller.sal.core.ConstructionException; import org.opendaylight.controller.sal.core.Node; import org.opendaylight.controller.sal.core.NodeConnector; <BUG>import org.opendaylight.control...
import org.opendaylight.controller.sal.flowprogrammer.IPluginInFlowProgrammerService; import org.opendaylight.controller.sal.match.Match;
47,531
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.opendaylight.snmp4sdn.core.internal.Controller; import org.opendaylight.snmp4sdn.core.internal.SwitchHandler; import org.opendaylight.snmp4sdn.internal.DiscoveryService; <BUG>import org.opendaylight.snmp4sdn.eth.util.HexString; </BUG> @RunWith(PaxExam....
import org.opendaylight.snmp4sdn.protocol.util.HexString;
47,532
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.List; <BUG>import java.util.Optional; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class CommandDel...
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
47,533
.append(Text.of(TextColors.GREEN, "Usage: ")) .append(getUsage(source)) .build()); return CommandResult.empty(); } else if (isIn(REGIONS_ALIASES, parse.args[0])) { <BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); IRegion region = FGManager.getInstance().getRegion(parse.args[1...
String regionName = parse.args[1]; IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
47,534
</BUG> isWorldRegion = true; } if (region == null) <BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!")); if (region instanceof GlobalWorldRegion) { </BUG> throw new CommandException(Text.of("You may not delete the global region!")); }
if (world == null) throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!")); if (world == null) throw new CommandException(Text.of("Must specify a world!")); region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null); throw new CommandException(Text.of("No region exis...
47,535
source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region" ); return CommandResult.success(); } else if (isIn(HANDLERS_ALIASES, parse.args[0])) { if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); <BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[...
Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]); if (!handlerOpt.isPresent()) IHandler handler = handlerOpt.get(); if (handler instanceof GlobalHandler)
47,536
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix...
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
47,537
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix...
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
47,538
@Dependency(id = "foxcore") }, description = "A world protection plugin built for SpongeAPI. Requires FoxCore.", authors = {"gravityfox"}, url = "https://github.com/FoxDenStudio/FoxGuard") <BUG>public final class FoxGuardMain { public final Cause pluginCause = Cause.builder().named("plugin", this).build(); private stat...
private static FoxGuardMain instanceField;
47,539
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; }
47,540
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
47,541
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.*; <BUG>import java.util.stream.Collectors; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class Comm...
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
47,542
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix...
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
47,543
private static FGStorageManager instance; private final Logger logger = FoxGuardMain.instance().getLogger();</BUG> private final Set<LoadEntry> loaded = new HashSet<>(); private final Path directory = getDirectory(); private final Map<String, Path> worldDirectories; <BUG>private FGStorageManager() { defaultModifiedMap ...
public final HashMap<IFGObject, Boolean> defaultModifiedMap; private final UserStorageService userStorageService; private final Logger logger = FoxGuardMain.instance().getLogger(); userStorageService = FoxGuardMain.instance().getUserStorage(); defaultModifiedMap = new CacheMap<>((k, m) -> {
47,544
String name = fgObject.getName(); Path singleDir = dir.resolve(name.toLowerCase()); </BUG> boolean shouldSave = fgObject.shouldSave(); if (force || shouldSave) { <BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir); </BUG> constructDirectory(singleDir); try { fg...
UUID owner = fgObject.getOwner(); boolean isOwned = !owner.equals(SERVER_UUID); Optional<User> userOwner = userStorageService.get(owner); String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name; if (fgObject.autoSave()) { Path singleDir = serverDir.resolve(n...
47,545
if (fgObject.autoSave()) { Path singleDir = dir.resolve(name.toLowerCase()); </BUG> boolean shouldSave = fgObject.shouldSave(); if (force || shouldSave) { <BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir); </BUG> constructDirectory(singleDir); try { fgOb...
Path singleDir = serverDir.resolve(name.toLowerCase()); logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
47,546
public synchronized void loadRegionLinks() { logger.info("Loading region links"); try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) { Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen(); linksMap.entrySet().forEach(...
Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey()); if (regionOpt.isPresent()) { IRegion region = regionOpt.get(); logger.info("Loading links for region \"" + region.getName() + "\"");
47,547
public synchronized void loadWorldRegionLinks(World world) { logger.info("Loading world region links for world \"" + world.getName() + "\""); try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) { Map<String, String> linksMap = mainDB.hashMap("l...
Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey()); if (regionOpt.isPresent()) { IWorldRegion region = regionOpt.get(); logger.info("Loading links for world region \"" + region.getName() + "\"");
47,548
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
47,549
.autoCloseQuotes(true) .leaveFinalAsIs(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream() </BUG> .filter(new StartsWithPredicate(parse.current.token)) .co...
return Stream.of("region", "worldregion", "handler", "controller")
47,550
public class Relationship { private static final int ARROWHEAD_LENGTH = 10;</BUG> private static final int ARROWHEAD_WIDTH = ARROWHEAD_LENGTH / 2; private Line edge; private HTML label; <BUG>private Widget from; private Widget to; </BUG> private Line arrowheadLeft;
package org.neo4j.server.ext.visualization.gwt.client; import org.vaadin.gwtgraphics.client.Line; import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.Style.Position; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.user.client.ui.HTML; private static final int ARROWHEAD_LENGTH = 1...
47,551
arrowheadRight = new Line(0, 0, 0, 0); parent.add(arrowheadRight); updateArrowhead(); } private void addEdge(VGraphComponent parent) { <BUG>edge = new Line((int) Math.round(getCenterX(from)), (int) Math.round(getCenterY(from)), (int) Math.round(getCenterX(to)), (int) Math.round(getCenterY(to))); </BUG> parent.add(edge...
[DELETED]
47,552
label = new HTML("<div style='text-align:center'>" + type + "</div>"); parent.add(label); Style style = label.getElement().getStyle(); style.setPosition(Position.ABSOLUTE); style.setBackgroundColor("white"); <BUG>style.setFontSize(9, Unit.PX); </BUG> updateLabel(); } void update() {
style.setFontSize(10, Unit.PX);
47,553
void update() { updateEdge(); updateLabel(); updateArrowhead(); } <BUG>private void updateArrowhead() { double originX = getArrowheadOrigin(getCenterX(from), getCenterX(to)); double originY = getArrowheadOrigin(getCenterY(from), getCenterY(to)); double angle = Math.atan2(getCenterY(to) - getCenterY(from), getCenterX(...
double fromX = from.getCenterX(); double fromY = from.getCenterY(); double toX = to.getCenterX(); double toY = to.getCenterY(); double originX = getArrowheadOrigin(fromX, toX); double originY = getArrowheadOrigin(fromY, toY); double angle = Math.atan2(toY - fromY, toX - fromX);
47,554
double rightY = originY + rotateY(-ARROWHEAD_LENGTH, ARROWHEAD_WIDTH, angle); updateLine(arrowheadRight, originX, originY, rightX, rightY); } private void updateEdge() { <BUG>updateLine(edge, getCenterX(from), getCenterY(from), getCenterX(to), getCenterY(to)); </BUG> }
updateLine(edge, from.getCenterX(), from.getCenterY(), to.getCenterX(), to.getCenterY());
47,555
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; <BUG>import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.List;</BUG> public final class ...
import java.text.DateFormat; import java.util.Date; import java.util.List;
47,556
package org.jboss.as.patching.runner; <BUG>import org.jboss.as.boot.DirectoryStructure; import org.jboss.as.patching.LocalPatchInfo;</BUG> import org.jboss.as.patching.PatchInfo; import org.jboss.as.patching.PatchLogger; import org.jboss.as.patching.PatchMessages;
import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp; import org.jboss.as.patching.CommonAttributes; import org.jboss.as.patching.LocalPatchInfo;
47,557
package org.jboss.as.patching; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.patching.runner.PatchingException; import org.jboss.logging.Messages; import org.jboss.logging.annotations.Message; <BUG>import org.jboss.logging.annotations.MessageBundle; import java.io.IOException;</BUG> impor...
import org.jboss.logging.annotations.Cause; import java.io.IOException;
47,558
package org.opencms.editors.usergenerated.client.export; import org.opencms.editors.usergenerated.client.CmsRequestCounter; <BUG>import org.opencms.editors.usergenerated.client.CmsRpcCallHelper; import org.opencms.editors.usergenerated.shared.CmsFormContent; import org.opencms.editors.usergenerated.shared.rpc.I_CmsForm...
import org.opencms.editors.usergenerated.shared.CmsFormConstants; import org.opencms.editors.usergenerated.shared.CmsFormException; import org.opencms.gwt.client.util.CmsDebugLog; import org.opencms.util.CmsUUID;
47,559
package org.opencms.editors.usergenerated; import org.opencms.editors.usergenerated.shared.CmsFormConstants; <BUG>import org.opencms.editors.usergenerated.shared.CmsFormContent; import org.opencms.editors.usergenerated.shared.rpc.I_CmsFormEditService;</BUG> import org.opencms.file.CmsObject; import org.opencms.file.Cms...
import org.opencms.editors.usergenerated.shared.CmsFormException; import org.opencms.editors.usergenerated.shared.rpc.I_CmsFormEditService;
47,560
private static final Log LOG = CmsLog.getLog(CmsFormEditService.class); private static final long serialVersionUID = 5479252081304867604L; @Override public void checkPermissions(CmsObject cms) { } <BUG>public void destroySession(CmsUUID sessionId) throws CmsRpcException { </BUG> try { CmsFormSession formSession = getFo...
public void destroySession(CmsUUID sessionId) throws CmsFormException {
47,561
package org.opencms.editors.usergenerated.client; import org.opencms.editors.usergenerated.client.export.CmsClientFormSession; import org.opencms.editors.usergenerated.client.export.CmsXmlContentFormApi; <BUG>import org.opencms.editors.usergenerated.client.export.I_CmsStringCallback; </BUG> import org.opencms.editors.u...
import org.opencms.editors.usergenerated.client.export.I_CmsErrorCallback;
47,562
m_formSession = session; } public void uploadFields( final Set<String> fields, final Function<Map<String, String>, Void> filenameCallback, <BUG>final I_CmsStringCallback errorCallback) { </BUG> disableAllFileFieldsExcept(fields); final String id = CmsJsUtils.generateRandomId(); updateFormAction(id);
final I_CmsErrorCallback errorCallback) {
47,563
sessionId, fields, id, new AsyncCallback<Map<String, String>>() { public void onFailure(Throwable caught) { <BUG>errorCallback.call(caught.getMessage()); }</BUG> public void onSuccess(Map<String, String> fileNames) { filenameCallback.apply(fileNames); }
m_formSession.getContentFormApi().handleError(caught, errorCallback);
47,564
package org.opencms.editors.usergenerated.client.export; import org.opencms.editors.usergenerated.client.CmsFormWrapper; import org.opencms.editors.usergenerated.client.CmsJsUtils; import org.opencms.editors.usergenerated.shared.CmsFormConstants; <BUG>import org.opencms.editors.usergenerated.shared.CmsFormContent; impo...
import org.opencms.editors.usergenerated.shared.CmsFormException; import org.opencms.util.CmsUUID;
47,565
m_formWrapper.setFormSession(this); } public CmsUUID internalGetSessionId() { return m_content.getSessionId(); } <BUG>public void saveContent(final I_CmsStringCallback onSuccess, final I_CmsJavaScriptObjectCallback onFailure) { </BUG> m_apiRoot.getRpcHelper().executeRpc( CmsXmlContentFormApi.SERVICE.saveContent( m_cont...
public void saveContent(final I_CmsStringCallback onSuccess, final I_CmsErrorCallback onFailure) {
47,566
m_newValues.put(xpath, value); } public void uploadFile( final String fieldName, final I_CmsStringCallback fileCallback, <BUG>I_CmsStringCallback errorCallback) { </BUG> Set<String> fieldSet = new HashSet<String>(); fieldSet.add(fieldName); m_formWrapper.uploadFields(fieldSet, new Function<Map<String, String>, Void>() ...
I_CmsErrorCallback errorCallback) {
47,567
}, errorCallback); } public void uploadFiles( String[] fieldNames, final I_CmsJavaScriptObjectCallback fileCallback, <BUG>I_CmsStringCallback errorCallback) { </BUG> Set<String> fieldSet = new HashSet<String>(); for (String field : fieldNames) { fieldSet.add(field);
I_CmsErrorCallback errorCallback) {
47,568
debug("Class is annotation, skipping method analysis"); return; } final TIntHashSet affectedFiles = new TIntHashSet(DEFAULT_SET_CAPACITY, DEFAULT_SET_LOAD_FACTOR); Ref<ClassRepr> oldItRef = null; <BUG>for (final MethodRepr m : diff.methods().added()) { debug("Method: ", m.name);</BUG> if ((it.access & Opcodes.ACC_INTER...
for (final MethodRepr m : added) { debug("Method: ", m.name);
47,569
myFuture.affectFieldUsages(f, propagated, f.createUsage(myContext, it.name), state.myAffectedUsages, state.myDependants); } debug("End of removed fields processing"); return true; } <BUG>private boolean processChangedFields(final DiffState state, final ClassRepr.Diff diff, final ClassRepr it) { debug("Processing change...
final Collection<Pair<FieldRepr, Difference>> changed = diff.fields().changed(); if (changed.isEmpty()) { for (final Pair<FieldRepr, Difference> f : changed) { final Difference d = f.second;
47,570
state.myAffectedUsages.add(c.createUsage()); } } debug("End of removed classes processing."); } <BUG>private void processAddedClasses(final DiffState state) { debug("Processing added classes:"); for (final ClassRepr c : state.myClassDiff.added()) { </BUG> debug("Class name: ", c.name);
final Collection<ClassRepr> addedClasses = state.myClassDiff.added(); if (addedClasses.isEmpty()) { return; for (final ClassRepr c : addedClasses) {
47,571
}); } }); return; } <BUG>} showDialog(session, file, editorsProvider, stackFrame, evaluator, mode, text); </BUG> } private static void showDialog(@NotNull XDebugSession session,
XExpression expression = XExpressionImpl.fromText(StringUtil.notNullize(text), mode); showDialog(session, file, editorsProvider, stackFrame, evaluator, expression);
47,572
import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.CommonClassNames; import com.intellij.psi.PsiExpression; import com.intellij.psi.util.TypeConversionUtil; <BUG>import com.intellij.util.ThreeState; import com.intellij.xdebugger.XSourcePosition;</BUG> import ...
import com.intellij.xdebugger.XExpression; import com.intellij.xdebugger.XSourcePosition;
47,573
import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.Consumer; import com.intellij.xdebugger.XDebugSession; <BUG>import com.intellij.xdebugger.XDebuggerManager; import com.intellij.xdebugger.impl.X...
import com.intellij.xdebugger.XExpression; import com.intellij.xdebugger.impl.XDebugSessionImpl;
47,574
import com.intellij.ui.AppUIUtil; import com.intellij.ui.EditorTextField; import com.intellij.ui.ScreenUtil; import com.intellij.ui.awt.RelativePoint; import com.intellij.ui.popup.list.ListPopupImpl; <BUG>import com.intellij.xdebugger.XDebuggerManager; import com.intellij.xdebugger.breakpoints.XBreakpoint;</BUG> import...
import com.intellij.xdebugger.XExpression; import com.intellij.xdebugger.breakpoints.XBreakpoint;
47,575
package com.intellij.xdebugger.impl.ui.tree.actions; import com.intellij.execution.console.ConsoleExecuteAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.LangDataKeys; <BUG>import com.intellij.util.Consumer; import com.intellij.xdebugger.impl.actions.handlers.XEva...
import com.intellij.xdebugger.XExpression; import com.intellij.xdebugger.impl.actions.handlers.XEvaluateInConsoleFromEditorActionHandler;
47,576
package com.intellij.xdebugger.frame; <BUG>import com.intellij.util.ThreeState; import com.intellij.xdebugger.evaluation.XInstanceEvaluator;</BUG> import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.concurrency.Promise;
import com.intellij.xdebugger.XDebuggerUtil; import com.intellij.xdebugger.XExpression; import com.intellij.xdebugger.evaluation.EvaluationMode; import com.intellij.xdebugger.evaluation.XInstanceEvaluator;
47,577
@Nullable public String getEvaluationExpression() { return null; } @NotNull <BUG>public Promise<String> calculateEvaluationExpression() { return Promise.resolve(getEvaluationExpression()); }</BUG> @Nullable
public Promise<XExpression> calculateEvaluationExpression() { String expression = getEvaluationExpression(); XExpression res = expression != null ? XDebuggerUtil.getInstance().createExpression(expression, null, null, EvaluationMode.EXPRESSION) : null; return Promise.resolve(res);
47,578
artifacts.addAll( plugins ); final FilterArtifacts filter = getPluginArtifactsFilter(); artifacts = filter.filter( artifacts ); for ( final Artifact artifact : new HashSet<Artifact>( artifacts ) ) { <BUG>this.resolver.resolve( artifact, this.remotePluginRepositories, this.getLocal() ); }</BUG> return artifacts; } @Over...
ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest( session.getProjectBuildingRequest() ); buildingRequest.setLocalRepository( this.getLocal() ); buildingRequest.setRemoteRepositories( this.remotePluginRepositories ); getArtifactResolver().resolveArtifact( buildingRequest, artifact );
47,579
import org.apache.maven.shared.artifact.filter.collection.ArtifactIdFilter; import org.apache.maven.shared.artifact.filter.collection.ClassifierFilter; import org.apache.maven.shared.artifact.filter.collection.FilterArtifacts; import org.apache.maven.shared.artifact.filter.collection.GroupIdFilter; import org.apache.ma...
import org.apache.maven.shared.artifact.resolve.ArtifactResolverException; public abstract class AbstractResolveMojo
47,580
Bundle savedInstanceState) { final View rootView = inflater.inflate(R.layout.tab_qibla, container, false); final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass); qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_...
sOrientationListener = new android.hardware.SensorListener() {
47,581
import org.opendaylight.controller.cluster.notifications.RegisterRoleChangeListenerReply; import org.opendaylight.controller.cluster.notifications.RoleChangeNotification; import scala.concurrent.Await; import scala.concurrent.duration.FiniteDuration; public class ExampleRoleChangeListener extends AbstractUntypedActor i...
private static final String NOTIFIER_AKKA_URL = "akka://raft-test@127.0.0.1:2550/user/"; private Map<String, Boolean> notifierRegistrationStatus = new HashMap<>();
47,582
return checkEquivalence(a1.getLeft(), a2.getLeft()) && a1.getOperationToken().equals(a2.getOperationToken()); } private static boolean checkFoldableIfExpressionWithAssignments(JetIfExpression ifExpression) { JetExpression thenBranch = ifExpression.getThen(); JetExpression elseBranch = ifExpression.getElse(); <BUG>JetBi...
JetBinaryExpression thenAssignment = getFoldableBranchedAssignment(thenBranch); JetBinaryExpression elseAssignment = getFoldableBranchedAssignment(elseBranch);
47,583
if (!JetPsiUtil.checkWhenExpressionHasSingleElse(whenExpression)) return false; List<JetWhenEntry> entries = whenExpression.getEntries(); if (entries.isEmpty()) return false; List<JetBinaryExpression> assignments = new ArrayList<JetBinaryExpression>(); for (JetWhenEntry entry : entries) { <BUG>JetBinaryExpression assig...
JetBinaryExpression assignment = getFoldableBranchedAssignment(entry.getExpression());
47,584
if (!checkAssignmentsMatch(assignment, firstAssignment)) return false; } return true; } private static boolean checkFoldableIfExpressionWithReturns(JetIfExpression ifExpression) { <BUG>return checkAndGetFoldableBranchedReturn(ifExpression.getThen()) != null && checkAndGetFoldableBranchedReturn(ifExpression.getElse()) ...
return getFoldableBranchedReturn(ifExpression.getThen()) != null && getFoldableBranchedReturn(ifExpression.getElse()) != null;
47,585
private static boolean checkFoldableWhenExpressionWithReturns(JetWhenExpression whenExpression) { if (!JetPsiUtil.checkWhenExpressionHasSingleElse(whenExpression)) return false; List<JetWhenEntry> entries = whenExpression.getEntries(); if (entries.isEmpty()) return false; for (JetWhenEntry entry : entries) { <BUG>if (c...
if (getFoldableBranchedReturn(entry.getExpression()) == null) return false;
47,586
</BUG> } return true; } private static boolean checkFoldableIfExpressionWithAsymmetricReturns(JetIfExpression ifExpression) { <BUG>if (checkAndGetFoldableBranchedReturn(ifExpression.getThen()) == null || </BUG> ifExpression.getElse() != null) { return false; }
private static boolean checkFoldableWhenExpressionWithReturns(JetWhenExpression whenExpression) { if (!JetPsiUtil.checkWhenExpressionHasSingleElse(whenExpression)) return false; List<JetWhenEntry> entries = whenExpression.getEntries(); if (entries.isEmpty()) return false; for (JetWhenEntry entry : entries) { if (getFol...
47,587
JetExpression thenExpr = thenReturn.getReturnedExpression(); JetExpression elseExpr = elseReturn.getReturnedExpression(); assert thenExpr != null : FOLD_WITHOUT_CHECK; assert elseExpr != null : FOLD_WITHOUT_CHECK; thenReturn.replace(thenExpr); <BUG>elseReturn.replace(elseExpr); }</BUG> public static void foldIfExpressi...
ifExpression.replace(newReturnExpression); }
47,588
jFields.put("maxRetry", new Long(modelService.maxRetry)); jFields.put("runtimeDataId", dataId); if (UtilValidate.isNotEmpty(authUserLoginId)) { jFields.put("authUserLoginId", authUserLoginId); } <BUG>jobV = dispatcher.getDelegator().makeValue("JobSandbox", jFields); toBeStored.add(jobV); dispatcher.getDelegator().store...
jobV.create();
47,589
import org.ofbiz.service.jms.JmsListenerFactory; import org.ofbiz.service.job.JobManager; import org.ofbiz.service.job.JobManagerException; public class ServiceDispatcher { public static final String module = ServiceDispatcher.class.getName(); <BUG>public static final int lruLogSize = 200; protected static final Map ru...
public static final int LOCK_RETRIES = 3; protected static final Map runLog = new LRUMap(lruLogSize);
47,590
public void runSyncIgnore(String localName, ModelService modelService, Map context) throws GenericServiceException { Map result = runSync(localName, modelService, context); } public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException { Object result = serviceInvoker(loca...
if (result == null || !(result instanceof Map)) { return (Map) result;
47,591
import ml.puredark.hviewer.ui.activities.BaseActivity; import ml.puredark.hviewer.ui.dataproviders.ListDataProvider; import ml.puredark.hviewer.ui.fragments.SettingFragment; import ml.puredark.hviewer.ui.listeners.OnItemLongClickListener; import ml.puredark.hviewer.utils.SharedPreferencesUtil; <BUG>import static androi...
import static ml.puredark.hviewer.R.id.container; public class PictureViewerAdapter extends RecyclerView.Adapter<PictureViewerAdapter.PictureViewerViewHolder> {
47,592
final PictureViewHolder viewHolder = new PictureViewHolder(view); if (pictures != null && position < pictures.size()) { final Picture picture = pictures.get(getPicturePostion(position)); if (picture.pic != null) { loadImage(container.getContext(), picture, viewHolder); <BUG>} else if (site.hasFlag(Site.FLAG_SINGLE_PAGE...
} else if (site.hasFlag(Site.FLAG_SINGLE_PAGE_BIG_PICTURE) && site.extraRule != null) { if(site.extraRule.pictureRule != null && site.extraRule.pictureRule.url != null) getPictureUrl(container.getContext(), viewHolder, picture, site, site.extraRule.pictureRule.url, site.extraRule.pictureRule.highRes); else if(site.extr...
47,593
import java.util.regex.Pattern; import butterknife.BindView; import butterknife.ButterKnife; import ml.puredark.hviewer.R; import ml.puredark.hviewer.beans.Category; <BUG>import ml.puredark.hviewer.beans.CommentRule; import ml.puredark.hviewer.beans.Rule;</BUG> import ml.puredark.hviewer.beans.Selector; import ml.pured...
import ml.puredark.hviewer.beans.PictureRule; import ml.puredark.hviewer.beans.Rule;
47,594
inputGalleryRulePictureUrlReplacement.setText(site.galleryRule.pictureUrl.replacement); } if (site.galleryRule.pictureHighRes != null) { inputGalleryRulePictureHighResSelector.setText(joinSelector(site.galleryRule.pictureHighRes)); inputGalleryRulePictureHighResRegex.setText(site.galleryRule.pictureHighRes.regex); <BUG...
[DELETED]
47,595
inputExtraRuleCommentDatetimeReplacement.setText(site.extraRule.commentDatetime.replacement); } if (site.extraRule.commentContent != null) { inputExtraRuleCommentContentSelector.setText(joinSelector(site.extraRule.commentContent)); inputExtraRuleCommentContentRegex.setText(site.extraRule.commentContent.regex); <BUG>inp...
[DELETED]
47,596
lastSite.galleryRule.cover = loadSelector(inputGalleryRuleCoverSelector, inputGalleryRuleCoverRegex, inputGalleryRuleCoverReplacement); lastSite.galleryRule.category = loadSelector(inputGalleryRuleCategorySelector, inputGalleryRuleCategoryRegex, inputGalleryRuleCategoryReplacement); lastSite.galleryRule.datetime = load...
lastSite.galleryRule.pictureRule = (lastSite.galleryRule.pictureRule == null) ? new PictureRule() : lastSite.galleryRule.pictureRule; lastSite.galleryRule.pictureRule.thumbnail = loadSelector(inputGalleryRulePictureThumbnailSelector, inputGalleryRulePictureThumbnailRegex, inputGalleryRulePictureThumbnailReplacement); l...
47,597
lastSite.extraRule.cover = loadSelector(inputExtraRuleCoverSelector, inputExtraRuleCoverRegex, inputExtraRuleCoverReplacement); lastSite.extraRule.category = loadSelector(inputExtraRuleCategorySelector, inputExtraRuleCategoryRegex, inputExtraRuleCategoryReplacement); lastSite.extraRule.datetime = loadSelector(inputExtr...
lastSite.extraRule.pictureRule = (lastSite.extraRule.pictureRule == null) ? new PictureRule() : lastSite.extraRule.pictureRule; lastSite.extraRule.pictureRule.thumbnail = loadSelector(inputExtraRulePictureThumbnailSelector, inputExtraRulePictureThumbnailRegex, inputExtraRulePictureThumbnailReplacement); lastSite.extraR...
47,598
notifyItemChanged(position); if (mItemClickListener != null) mItemClickListener.onItemClick(v, position); } }); <BUG>if (tag.selected) label.getChildAt(0).setBackgroundResource(R.color.colorPrimary); else label.getChildAt(0).setBackgroundResource(R.color.dimgray);</BUG> }
[DELETED]
47,599
loadPicture(picture, task, null, true); } else if (!TextUtils.isEmpty(picture.pic) && !highRes) { picture.retries = 0; loadPicture(picture, task, null, false); } else if (task.collection.site.hasFlag(Site.FLAG_SINGLE_PAGE_BIG_PICTURE) <BUG>&& task.collection.site.extraRule != null && task.collection.site.extraRule.pic...
&& task.collection.site.extraRule != null) { if(task.collection.site.extraRule.pictureRule != null && task.collection.site.extraRule.pictureRule.url != null) getPictureUrl(picture, task, task.collection.site.extraRule.pictureRule.url, task.collection.site.extraRule.pictureRule.highRes); else if(task.collection.site.ext...
47,600
if (Picture.hasPicPosfix(picture.url)) { picture.pic = picture.url; loadPicture(picture, task, null, false); } else if (task.collection.site.hasFlag(Site.FLAG_JS_NEEDED_ALL)) { <BUG>new Handler(Looper.getMainLooper()).post(()->{ </BUG> WebView webView = new WebView(HViewerApplication.mContext); WebSettings mWebSettings...
new Handler(Looper.getMainLooper()).post(() -> {