id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
19,401 | import org.xwiki.rendering.syntax.Syntax;
import org.xwiki.rendering.transformation.TransformationException;
import org.xwiki.rendering.transformation.TransformationManager;
import org.xwiki.xml.html.HTMLCleaner;
import org.xwiki.xml.html.HTMLCleanerConfiguration;
<BUG>import org.xwiki.xml.html.HTMLUtils;
public class ... | import java.io.StringReader;
import java.lang.reflect.Type;
import java.util.*;
public class RenderingServiceImpl implements RenderingService, Startable {
|
19,402 | }
public <T> T getComponent(Type clazz) {
T component = this.<T>getComponent(clazz, "default");
return component;
}
<BUG>public String render(String markup, String sourceSyntax, String targetSyntax, boolean supportSectionEdit) throws Exception {
XDOM xdom = parse(markup, sourceSyntax);</BUG>
Syntax sSyntax = (sourceSyn... | public ComponentManager getComponentManager() {
return componentManager;
public String render(String markup, String sourceSyntax, String targetSyntax, boolean supportSectionEdit)
throws ConversionException, ComponentLookupException {
XDOM xdom = parse(markup, sourceSyntax);
|
19,403 | List<Block> children = parent.getChildren();
for (Block block : children) {
outputTree(block, level + 1);
}
}
<BUG>private WikiPrinter convert(XDOM xdom, Syntax sourceSyntax, Syntax targetSyntax, boolean supportSectionEdit) throws Exception {
try {</BUG>
TransformationManager transformationManager = componentManager.ge... | private WikiPrinter convert(XDOM xdom, Syntax sourceSyntax, Syntax targetSyntax, boolean supportSectionEdit)
throws ComponentLookupException, ConversionException {
try {
|
19,404 | if (LOG.isDebugEnabled()) {
outputTree(xdom, 0);
}
return xdom;
}
<BUG>private String renderXDOM(Block content, Syntax targetSyntax) throws Exception {
</BUG>
try {
BlockRenderer renderer = componentManager.getInstance(BlockRenderer.class, targetSyntax.toIdString());
WikiPrinter printer = new DefaultWikiPrinter();
| private String renderXDOM(Block content, Syntax targetSyntax) throws ConversionException {
|
19,405 | 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.*;
|
19,406 | .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);
|
19,407 | </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... |
19,408 | 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)
|
19,409 | .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))
|
19,410 | .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))
|
19,411 | @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;
|
19,412 | 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;
}
|
19,413 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
19,414 | 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.*;
|
19,415 | .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))
|
19,416 | 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) -> {
|
19,417 | 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... |
19,418 | 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);
|
19,419 | 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() + "\"");
|
19,420 | 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() + "\"");
|
19,421 | 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
|
19,422 | .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")
|
19,423 | assertPolicy(aim, SP12Constants.WSS10);
assertPolicy(aim, SP12Constants.TRUST_13);
assertPolicy(aim, SP11Constants.TRUST_10);
super.doResults(msg, actor, soapHeader, soapBody, results, utWithCallbacks);
}
<BUG>private void checkSignedEncryptedCoverage(
</BUG>
AssertionInfoMap aim,
SoapMessage msg,
Element soapHeader,
| private boolean checkSignedEncryptedCoverage(
|
19,424 | Element soapHeader,
Element soapBody,
Collection<WSDataRef> signed,
Collection<WSDataRef> encrypted
) throws SOAPException {
<BUG>CryptoCoverageUtil.reconcileEncryptedSignedRefs(signed, encrypted);
if (!isTransportBinding(aim)) {
assertTokens(
</BUG>
aim, SP12Constants.SIGNED_PARTS, signed, msg, soapHeader, soapBody, C... | boolean check = true;
check &= assertTokens(
|
19,425 | if (!isTransportBinding(aim)) {
assertTokens(
</BUG>
aim, SP12Constants.SIGNED_PARTS, signed, msg, soapHeader, soapBody, CoverageType.SIGNED
);
<BUG>assertTokens(
</BUG>
aim, SP12Constants.ENCRYPTED_PARTS, encrypted, msg, soapHeader, soapBody,
CoverageType.ENCRYPTED
);
| check &= assertTokens(
check &= assertTokens(
|
19,426 | List<WSSecurityEngineResult> utResults = new ArrayList<WSSecurityEngineResult>();
WSSecurityUtil.fetchAllActionResults(results, WSConstants.UT, utResults);
WSSecurityUtil.fetchAllActionResults(results, WSConstants.UT_NOPASSWORD, utResults);
List<WSSecurityEngineResult> samlResults = new ArrayList<WSSecurityEngineResult... | boolean check = true;
check &= x509Validator.validatePolicy(aim);
|
19,427 | RequiredParts rp = (RequiredParts)ai.getAssertion();
ai.setAsserted(true);
for (Header h : rp.getHeaders()) {
if (header == null
|| DOMUtils.getFirstChildWithName((Element)header, h.getQName()) == null) {
<BUG>ai.setNotAsserted("No header element of name " + h.getQName() + " found.");
}</BUG>
}
}
}
| return false;
|
19,428 | import jetbrains.mps.smodel.DynamicReference;
import jetbrains.mps.baseLanguage.tuples.runtime.MultiTuple;
import org.jetbrains.mps.openapi.model.SModelReference;
import jetbrains.mps.smodel.SModelStereotype;
<BUG>import org.apache.log4j.Level;
import java.util.HashSet;
import jetbrains.mps.util.JavaNameUtil;
import je... | import jetbrains.mps.textGen.TextGen;
import jetbrains.mps.util.InternUtil;
|
19,429 | BaseLanguageTextGen.registerExtendsRelation(Sequence.fromIterable(Sequence.<SNode>singleton(SLinkOperations.getTarget(SNodeOperations.cast(cls, MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept")), MetaAdapterFactory.getContainmentL... | BaseLanguageTextGen.referenceToShortName(SNodeOperations.getReference(methodCall, MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301adL, "baseMethodDeclaration")), textGen);
|
19,430 | package org.apache.qpid.jms.provider;
import java.io.IOException;
<BUG>import java.net.URI;
import org.apache.qpid.jms.message.JmsInboundMessageDispatch;</BUG>
import org.apache.qpid.jms.message.JmsOutboundMessageDispatch;
import org.apache.qpid.jms.meta.JmsResource;
public interface ProviderListener {
| import java.util.List;
import org.apache.qpid.jms.message.JmsInboundMessageDispatch;
|
19,431 | package org.apache.qpid.jms.provider;
import java.io.IOException;
<BUG>import java.net.URI;
import javax.jms.JMSException;</BUG>
import org.apache.qpid.jms.message.JmsInboundMessageDispatch;
import org.apache.qpid.jms.message.JmsMessageFactory;
import org.apache.qpid.jms.message.JmsOutboundMessageDispatch;
| import java.util.List;
import javax.jms.JMSException;
|
19,432 | LOG.trace("Outcome of delivery was rejected: {}", delivery);
ErrorCondition remoteError = ((Rejected) outcome).getError();
if (remoteError == null) {
remoteError = getEndpoint().getRemoteCondition();
}
<BUG>deliveryError = AmqpSupport.convertToException(getEndpoint(), remoteError);
</BUG>
} else if (outcome instanceof ... | deliveryError = AmqpSupport.convertToException(getParent().getProvider(), getEndpoint(), remoteError);
|
19,433 | package org.apache.qpid.jms;
import java.io.IOException;
<BUG>import java.net.URI;
import java.util.Map;</BUG>
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
| import java.util.List;
import java.util.Map;
|
19,434 | package org.apache.qpid.jms;
<BUG>import java.net.URI;
import javax.jms.MessageConsumer;</BUG>
import javax.jms.MessageProducer;
import javax.jms.Session;
import org.apache.qpid.jms.message.JmsInboundMessageDispatch;
| import java.util.List;
import javax.jms.MessageConsumer;
|
19,435 | package org.apache.qpid.jms.provider;
import java.io.IOException;
<BUG>import java.net.URI;
import org.apache.qpid.jms.message.JmsInboundMessageDispatch;</BUG>
import org.apache.qpid.jms.message.JmsOutboundMessageDispatch;
import org.apache.qpid.jms.meta.JmsResource;
public class DefaultProviderListener implements Prov... | import java.util.List;
import org.apache.qpid.jms.message.JmsInboundMessageDispatch;
|
19,436 | delayedDeliverySupported = true;
}
if (list.contains(SHARED_SUBS)) {
sharedSubsSupported = true;
}
<BUG>}
protected void processProperties(Map<Symbol, Object> properties) {</BUG>
if (properties.containsKey(QUEUE_PREFIX)) {
Object o = properties.get(QUEUE_PREFIX);
if (o instanceof String) {
| @SuppressWarnings("unchecked")
protected void processProperties(Map<Symbol, Object> properties) {
|
19,437 | public AmqpConnection(AmqpProvider provider, JmsConnectionInfo info, Connection protonConnection) {
super(info, protonConnection, provider);
this.provider = provider;
this.remoteURI = provider.getRemoteURI();
this.amqpMessageFactory = new AmqpJmsMessageFactory(this);
<BUG>this.properties = new AmqpConnectionProperties(... | this.properties = new AmqpConnectionProperties(info, provider);
|
19,438 | import org.osmorc.manifest.lang.psi.Clause;
import org.jetbrains.lang.manifest.psi.HeaderValuePart;
import org.osmorc.manifest.resolve.reference.providers.ManifestPackageReferenceSet;
import java.util.List;
public class BasePackageParser extends OsgiHeaderParser {
<BUG>public static final HeaderParser INSTANCE = new Ba... | @NotNull
@Override
public PsiReference[] getReferences(@NotNull HeaderValuePart headerValuePart) {
if (headerValuePart.getParent() instanceof Clause) {
return getPackageReferences(headerValuePart);
}
|
19,439 | if (packageName.charAt(size) == '?') {
packageName = packageName.substring(0, size);
}
PackageReferenceSet referenceSet = new ManifestPackageReferenceSet(packageName, psiElement, offset);
return referenceSet.getReferences().toArray(new PsiPackageReference[referenceSet.getReferences().size()]);
<BUG>}
@NotNull
@Override... | [DELETED] |
19,440 | import org.jetbrains.lang.manifest.header.HeaderParser;
import org.jetbrains.lang.manifest.header.HeaderParserProvider;
import aQute.bnd.osgi.Constants;
import java.util.Map;
public class OsgiManifestHeaderParsers implements HeaderParserProvider {
<BUG>private final Map<String,HeaderParser> myParsers;
</BUG>
public Osg... | private final Map<String, HeaderParser> myParsers;
|
19,441 | if (methodName == null) {
return;
}
final StringBuilder newExpression = new StringBuilder();
final PsiElement qualifier = methodExpression.getQualifier();
<BUG>if (qualifier != null) {
newExpression.append(qualifier.getText());
newExpression.append('.');
} else {</BUG>
final PsiMethod containingMethod =
| if (qualifier == null) {
|
19,442 | newExpression.append('.');
} else {</BUG>
final PsiMethod containingMethod =
PsiTreeUtil.getParentOfType(call, PsiMethod.class);
if (containingMethod != null &&
<BUG>AnnotationUtil.isAnnotated(containingMethod, "org.junit.Test", true)) {
ImportUtils.addStaticImport(element, "org.junit.Assert", "assertEquals");
}
}</BU... | [DELETED] |
19,443 | public void processIntention(PsiElement element)
throws IncorrectOperationException {
final PsiMethodCallExpression call =
(PsiMethodCallExpression)element;
final PsiReferenceExpression expression = call.getMethodExpression();
<BUG>final PsiElement qualifier = expression.getQualifier();
final String qualifierText;
if (... | [DELETED] |
19,444 | } else {
qualifierText = qualifier.getText() + '.';
}</BUG>
final PsiExpressionList argumentList = call.getArgumentList();
final PsiExpression[] args = argumentList.getExpressions();
<BUG>final String callString;
final String assertString;
if (args.length == 2) {</BUG>
@NonNls final String argText = args[0].getText();
... | otherArg = args[0];
}
actualArgumentText = otherArg.getText();
assertString = getAssertString(argText);
@NonNls final String argText = args[1].getText();
|
19,445 | "false".equals(argText) ||
"null".equals(argText)) {
otherArg = args[1];
} else {
otherArg = args[0];
<BUG>}
assertString = getAssertString(argText);
callString = qualifierText + assertString + '(' +
otherArg.getText() + ')';</BUG>
} else {
| actualArgumentText = otherArg.getText();
|
19,446 | public class VelocitySomeValuesNotInExchangeTest extends CamelTestSupport {
@Test
public void testWithAllValues() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
<BUG>mock.expectedBodiesReceived("Hello Claus\n"
+ "You have id: 123 if an id was assigned to you.");
</B... | mock.message(0).constant("Hello Claus");
mock.message(0).constant("You have id: 123 if an id was assigned to you.");
|
19,447 | }
@Test
public void testWithSomeValues() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
<BUG>mock.expectedBodiesReceived("Hello Claus\n"
+ "You have id: if an id was assigned to you.");
</BUG>
Map<String, Object> headers = new HashMap<String, Object>();
headers.put... | mock.message(0).constant("Hello Claus");
mock.message(0).constant("You have id: if an id was assigned to you.");
|
19,448 | import org.onosproject.net.flow.instructions.Instructions;
import org.onosproject.net.intent.FlowRuleIntent;
import org.onosproject.net.intent.Intent;
import org.onosproject.net.intent.IntentCompiler;
import org.onosproject.net.intent.IntentExtensionService;
<BUG>import org.onosproject.net.intent.OpticalOduIntent;
impo... | import org.onosproject.net.intent.PathIntent;
import org.onosproject.net.optical.OduCltPort;
|
19,449 | List<FlowRule> rules = new LinkedList<>();
rules = createRules(intent, intent.getSrc(), intent.getDst(), path, slotsMap, false);
if (intent.isBidirectional()) {
rules.addAll(createRules(intent, intent.getDst(), intent.getSrc(), path, slotsMap, true));
}
<BUG>return Collections.singletonList(new FlowRuleIntent(appId, in... | [DELETED] |
19,450 | .selector(selector)
.treatment(treatment)
.ingressPoint(ingressPoint)
.egressPoints(egressPoints)
.constraints(constraints)
<BUG>.priority(priority())
.build();</BUG>
service.submit(intent);
print("Single point to multipoint intent submitted:\n%s", intent.toString());
}
| .resourceGroup(resourceGroup())
.build();
|
19,451 | import org.onosproject.net.intent.IntentCompiler;
import org.onosproject.net.intent.IntentExtensionService;
import org.onosproject.net.intent.IntentId;
import org.onosproject.net.intent.IntentService;
import org.onosproject.net.intent.OpticalCircuitIntent;
<BUG>import org.onosproject.net.intent.OpticalConnectivityInten... | import org.onosproject.net.intent.PathIntent;
import org.onosproject.net.optical.OchPort;
|
19,452 | connectivityIntent = OpticalConnectivityIntent.builder()
.appId(appId)
.src(srcCP)
.dst(dstCP)
.signalType(ochPorts.getLeft().signalType())
<BUG>.bidirectional(intent.isBidirectional())
.build();</BUG>
if (!supportsMultiplexing) {
required = resources;
} else {
| .resourceGroup(intent.resourceGroup())
.build();
|
19,453 | rules.add(connectPorts(lowerIntent.getDst(), higherIntent.getDst(), higherIntent.priority(), slots));
if (higherIntent.isBidirectional()) {
rules.add(connectPorts(lowerIntent.getSrc(), higherIntent.getSrc(), higherIntent.priority(), slots));
rules.add(connectPorts(higherIntent.getDst(), lowerIntent.getDst(), higherInte... | return new FlowRuleIntent(appId, higherIntent.key(), rules,
higherIntent.resources(),
PathIntent.ProtectionType.PRIMARY,
higherIntent.resourceGroup());
|
19,454 | import com.google.common.annotations.Beta;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.Link;
<BUG>import org.onosproject.net.NetworkResource;
import org.onosproject.net.flow.DefaultTrafficSelector;</... | import org.onosproject.net.ResourceGroup;
import org.onosproject.net.flow.DefaultTrafficSelector;
|
19,455 | import static com.google.common.base.Preconditions.checkNotNull;
@Beta
public abstract class ConnectivityIntent extends Intent {
private final TrafficSelector selector;
private final TrafficTreatment treatment;
<BUG>private final List<Constraint> constraints;
protected ConnectivityIntent(ApplicationId appId,</BUG>
Key ... | @Deprecated
protected ConnectivityIntent(ApplicationId appId,
|
19,456 | import org.onosproject.net.flow.instructions.Instructions;
import org.onosproject.net.intent.FlowRuleIntent;
import org.onosproject.net.intent.Intent;
import org.onosproject.net.intent.IntentCompiler;
import org.onosproject.net.intent.IntentExtensionService;
<BUG>import org.onosproject.net.intent.OpticalPathIntent;
imp... | import org.onosproject.net.intent.PathIntent;
import org.slf4j.Logger;
|
19,457 | .selector(selector)
.treatment(treatment)
.ingressPoint(ingress)
.egressPoint(egress)
.constraints(constraints)
<BUG>.priority(priority())
.build();</BUG>
service.submit(intent);
print("Point to point intent submitted:\n%s", intent.toString());
}
| .resourceGroup(resourceGroup())
.build();
|
19,458 | .src(parentIntent.getSrc())
.dst(parentIntent.getDst())
.path(path)
.lambda(lambda)
.signalType(signalType)
<BUG>.bidirectional(parentIntent.isBidirectional())
.build();</BUG>
}
private void allocateResources(Intent intent, List<Resource> resources) {
List<ResourceAllocation> allocations = resourceService.allocate(inte... | .resourceGroup(parentIntent.resourceGroup())
.build();
|
19,459 | .one(oneId)
.two(twoId)
.selector(selector)
.treatment(treatment)
.constraints(constraints)
<BUG>.priority(priority())
.build();</BUG>
service.submit(intent);
print("Host to Host intent submitted:\n%s", intent.toString());
}
| .resourceGroup(resourceGroup())
.build();
|
19,460 | import org.onlab.util.Bandwidth;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
import org.onosproject.net.EncapsulationType;
<BUG>import org.onosproject.net.PortNumber;
import org.onosproject.net.flow.DefaultTrafficSelector;</BUG>
im... | import org.onosproject.net.ResourceGroup;
import org.onosproject.net.flow.DefaultTrafficSelector;
|
19,461 | @Option(name = "-e", aliases = "--encapsulation", description = "Encapsulation type",
required = false, multiValued = false)
private String encapsulationString = null;
@Option(name = "--hashed", description = "Hashed path selection",
required = false, multiValued = false)
<BUG>private boolean hashedPathSelection = fals... | @Option(name = "-r", aliases = "--resourceGroup", description = "Resource Group Id",
private String resourceGroupId = null;
protected TrafficSelector buildTrafficSelector() {
|
19,462 | .selector(selector)
.treatment(treatment)
.ingressPoints(ingressPoints)
.egressPoint(egress)
.constraints(constraints)
<BUG>.priority(priority())
.build();</BUG>
service.submit(intent);
print("Multipoint to single point intent submitted:\n%s", intent.toString());
}
| .resourceGroup(resourceGroup())
.build();
|
19,463 | import hudson.plugins.git.GitChangeSet;
import hudson.tasks.Publisher;
import hudson.tasks.Notifier;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.BuildStepMonitor;
<BUG>import net.sf.json.JSONObject;
import org.apache.http.HttpEntity;</BUG>
import org.apache.http.HttpResponse;
import org.apache.http.aut... | import org.apache.commons.lang.StringEscapeUtils;
import org.apache.http.HttpEntity;
|
19,464 | <BUG>package util;
import com.google.common.collect.ImmutableMap;</BUG>
import com.google.common.collect.Iterables;
import com.sonar.orchestrator.Orchestrator;
import com.sonar.orchestrator.build.BuildResult;
| import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableMap;
|
19,465 | import org.sonar.wsclient.issue.IssueQuery;
import org.sonar.wsclient.services.PropertyDeleteQuery;
import org.sonar.wsclient.services.PropertyUpdateQuery;
import org.sonarqube.ws.client.HttpConnector;
import org.sonarqube.ws.client.HttpWsClient;
<BUG>import org.sonarqube.ws.client.WsClient;
import static com.google.co... | import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.FluentIterable.from;
|
19,466 | import static com.sonar.orchestrator.container.Server.ADMIN_LOGIN;
import static com.sonar.orchestrator.container.Server.ADMIN_PASSWORD;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
<BUG>public class ItUtils {
privat... | public static final Splitter LINE_SPLITTER = Splitter.on(System.getProperty("line.separator"));
private ItUtils() {
|
19,467 | package it.qualityGate;
<BUG>import com.sonar.orchestrator.Orchestrator;
import com.sonar.orchestrator.build.SonarRunner;
</BUG>
import it.Category1Suite;
import java.io.File;
| import com.google.common.base.Predicate;
import com.sonar.orchestrator.build.BuildResult;
import com.sonar.orchestrator.build.SonarScanner;
|
19,468 | public void cleanUp() {
orchestrator.resetData();
provisionedProjectId = Long.parseLong(orchestrator.getServer().adminWsClient().projectClient().create(NewProject.create().key(PROJECT_KEY).name("Sample")).id());
}
@Test
<BUG>public void do_not_compute_status_if_no_gate() {
SonarRunner build = SonarRunner.create(projec... | [DELETED] |
19,469 | public void test_status_ok() {
QualityGate simple = qgClient().create("SimpleWithHighThreshold");
qgClient().setDefault(simple.id());
qgClient().createCondition(NewCondition.create(simple.id()).metricKey("ncloc").operator("GT").warningThreshold("40"));
try {
<BUG>SonarRunner build = SonarRunner.create(projectDir("quali... | SonarScanner build = SonarScanner.create(projectDir("qualitygate/xoo-sample"));
BuildResult buildResult = orchestrator.executeBuild(build);
verifyQGStatusInPostTask(buildResult, TASK_STATUS_SUCCESS, QG_STATUS_OK);
assertThat(fetchGateStatus().getData()).isEqualTo("OK");
|
19,470 | public void test_status_warning() {
QualityGate simple = qgClient().create("SimpleWithLowThreshold");
qgClient().setDefault(simple.id());
qgClient().createCondition(NewCondition.create(simple.id()).metricKey("ncloc").operator("GT").warningThreshold("10"));
try {
<BUG>SonarRunner build = SonarRunner.create(projectDir("q... | SonarScanner build = SonarScanner.create(projectDir("qualitygate/xoo-sample"));
BuildResult buildResult = orchestrator.executeBuild(build);
verifyQGStatusInPostTask(buildResult, TASK_STATUS_SUCCESS, QG_STATUS_WARN);
assertThat(fetchGateStatus().getData()).isEqualTo("WARN");
|
19,471 | public void test_status_error() {
QualityGate simple = qgClient().create("SimpleWithLowThreshold");
qgClient().setDefault(simple.id());
qgClient().createCondition(NewCondition.create(simple.id()).metricKey("ncloc").operator("GT").errorThreshold("10"));
try {
<BUG>SonarRunner build = SonarRunner.create(projectDir("quali... | SonarScanner build = SonarScanner.create(projectDir("qualitygate/xoo-sample"));
BuildResult buildResult = orchestrator.executeBuild(build);
verifyQGStatusInPostTask(buildResult, TASK_STATUS_SUCCESS, QG_STATUS_ERROR);
assertThat(fetchGateStatus().getData()).isEqualTo("ERROR");
|
19,472 | QualityGate error = qgClient().create("ErrorWithLowThreshold");
qgClient().createCondition(NewCondition.create(error.id()).metricKey("ncloc").operator("GT").errorThreshold("10"));
qgClient().setDefault(alert.id());
qgClient().selectProject(error.id(), provisionedProjectId);
try {
<BUG>SonarRunner build = SonarRunner.cr... | SonarScanner build = SonarScanner.create(projectDir("qualitygate/xoo-sample"));
BuildResult buildResult = orchestrator.executeBuild(build);
verifyQGStatusInPostTask(buildResult, TASK_STATUS_SUCCESS, QG_STATUS_ERROR);
assertThat(fetchGateStatus().getData()).isEqualTo("ERROR");
|
19,473 | QualityGate simple = qgClient().create("SimpleWithLowThresholdForBuildBreakStrategy");
qgClient().setDefault(simple.id());
qgClient().createCondition(NewCondition.create(simple.id()).metricKey("ncloc").operator("GT").errorThreshold("7"));
try {
File projectDir = projectDir("qualitygate/xoo-sample");
<BUG>SonarRunner bu... | SonarScanner build = SonarScanner.create(projectDir);
BuildResult buildResult = orchestrator.executeBuild(build);
verifyQGStatusInPostTask(buildResult, TASK_STATUS_SUCCESS, QG_STATUS_ERROR);
String taskId = getTaskIdInLocalReport(projectDir);
|
19,474 | @WorkerThread
public Inserter<Category> prepareInsertIntoCategory(@OnConflict int onConflictAlgorithm, boolean withoutAutoId) {
return new Inserter<Category>(connection, Category_Schema.INSTANCE, onConflictAlgorithm, withoutAutoId);
}
@CheckResult
<BUG>public Single<Inserter<Category>> prepareInsertIntoCategoryAsObserv... | public void transactionSync(@NonNull Runnable task) {
connection.transactionSync(task);
|
19,475 |
return prepareInsertIntoCategoryAsObservable(OnConflict.NONE, true);
</BUG>
}
@CheckResult
<BUG>public Single<Inserter<Category>> prepareInsertIntoCategoryAsObservable(@OnConflict int onConflictAlgorithm) {
return prepareInsertIntoCategoryAsObservable(onConflictAlgorithm, true);
</BUG>
}
| @WorkerThread
public void transactionSync(@NonNull Runnable task) {
connection.transactionSync(task);
|
19,476 | binding = FragmentListViewBinding.inflate(inflater, container, false);
orma = OrmaDatabase.builder(getContext())
.build();
adapter = new Adapter(getContext(), orma.relationOfTodo().orderByCreatedTimeAsc());
binding.list.setAdapter(adapter);
<BUG>binding.fab.setOnClickListener(v -> adapter.addItemAsSingle2(() -> {
Todo ... | binding.fab.setOnClickListener(v -> adapter.addItemAsSingle(() -> {
Todo todo = new Todo();
|
19,477 | final boolean done = !currentTodo.done;
getRelation()
.updater()
.idEq(todo.id)
.done(done)
<BUG>.executeAsSingle2()
.subscribeOn(Schedulers.io())</BUG>
.observeOn(AndroidSchedulers.mainThread())
.subscribe(integer -> {
setStrike(binding.title, done);
| .executeAsSingle()
.subscribeOn(Schedulers.io())
|
19,478 | .subscribe(integer -> {
setStrike(binding.title, done);
});
});
binding.getRoot().setOnLongClickListener(v -> {
<BUG>removeItemAsMaybe2(todo)
.subscribeOn(Schedulers.io())</BUG>
.subscribe();
return true;
});
| removeItemAsMaybe(todo)
.subscribeOn(Schedulers.io())
|
19,479 | Realm realm = Realm.getDefaultInstance();
realm.executeTransaction(r -> r.delete(RealmTodo.class));
realm.close();
hw.getWritableDatabase().execSQL("DELETE FROM todo");
orma.deleteFromTodo()
<BUG>.executeAsSingle2()
.subscribeOn(Schedulers.io())</BUG>
.observeOn(AndroidSchedulers.mainThread())
.flatMap(integer -> start... | .executeAsSingle()
.subscribeOn(Schedulers.io())
|
19,480 | @SuppressWarnings("unused")
Date createdTime = todo.createdTime;
count.incrementAndGet();
}
if (todos.count() != count.get()) {
<BUG>throw new AssertionError("unexpected value: " + count.get());
</BUG>
}
Log.d(TAG, "Orma/forEachAll count: " + count);
});
| String title = todo.title;
String content = todo.content;
throw new AssertionError("unexpected get: " + count.get());
|
19,481 | } while (cursor.moveToNext());
}
cursor.close();
long dbCount = longForQuery(db, "SELECT COUNT(*) FROM todo", null);
if (dbCount != count.get()) {
<BUG>throw new AssertionError("unexpected value: " + count.get() + " != " + dbCount);
</BUG>
}
Log.d(TAG, "HandWritten/forEachAll count: " + count);
});
| throw new AssertionError("unexpected get: " + count.get() + " != " + dbCount);
|
19,482 | 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() {
|
19,483 | Integer datasetId;
String datasetUrn;
String capacityName;
String capacityType;
String capacityUnit;
<BUG>String capacityLow;
String capacityHigh;
</BUG>
Long modifiedTime;
| Long capacityLow;
Long capacityHigh;
|
19,484 | import com.fasterxml.jackson.databind.ObjectMapper;
public class DatasetFieldPathRecord {
String fieldPath;
String role;
public DatasetFieldPathRecord() {
<BUG>}
@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this);
} catch (JsonProcessingException ex) {
return null;
}</BUG>
}
| [DELETED] |
19,485 | new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, DATASET_INVENTORY_TABLE);
public static final String GET_DATASET_DEPLOYMENT_BY_DATASET_ID =
"SELECT * FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_DEPLOYMENT_BY_URN =
"SELECT * FROM " + DATASET_DEPLOYMENT... | public static final String DELETE_DATASET_DEPLOYMENT_BY_DATASET_ID =
"DELETE FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_id=?";
|
19,486 | </BUG>
public static final String GET_DATASET_CAPACITY_BY_DATASET_ID =
"SELECT * FROM " + DATASET_CAPACITY_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_CAPACITY_BY_URN =
"SELECT * FROM " + DATASET_CAPACITY_TABLE + " WHERE dataset_urn = :dataset_urn";
<BUG>public static final String ... | new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, DATASET_INVENTORY_TABLE);
public static final String GET_DATASET_DEPLOYMENT_BY_DATASET_ID =
"SELECT * FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_DEPLOYMENT_BY_URN =
"SELECT * FROM " + DATASET_DEPLOYMENT... |
19,487 | "SELECT * FROM " + DATASET_CASE_SENSITIVE_TABLE + " WHERE dataset_urn = :dataset_urn";
public static final String GET_DATASET_REFERENCE_BY_DATASET_ID =
"SELECT * FROM " + DATASET_REFERENCE_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_REFERENCE_BY_URN =
"SELECT * FROM " + DATASET_REF... | public static final String DELETE_DATASET_REFERENCE_BY_DATASET_ID =
"DELETE FROM " + DATASET_REFERENCE_TABLE + " WHERE dataset_id=?";
|
19,488 | "SELECT * FROM " + DATASET_SECURITY_TABLE + " WHERE dataset_urn = :dataset_urn";
public static final String GET_DATASET_OWNER_BY_DATASET_ID =
"SELECT * FROM " + DATASET_OWNER_TABLE + " WHERE dataset_id = :dataset_id ORDER BY sort_id";
public static final String GET_DATASET_OWNER_BY_URN =
"SELECT * FROM " + DATASET_OWNE... | public static final String DELETE_DATASET_OWNER_BY_DATASET_ID =
"DELETE FROM " + DATASET_OWNER_TABLE + " WHERE dataset_id=?";
|
19,489 | "SELECT app_id FROM " + EXTERNAL_GROUP_TABLE + " WHERE group_id = :group_id GROUP BY group_id";
public static final String GET_DATASET_CONSTRAINT_BY_DATASET_ID =
"SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_CONSTRAINT_BY_URN =
"SELECT * FROM " +... | public static final String DELETE_DATASET_CONSTRAINT_BY_DATASET_ID =
"DELETE FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id=?";
|
19,490 | </BUG>
public static final String GET_DATASET_INDEX_BY_DATASET_ID =
"SELECT * FROM " + DATASET_INDEX_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_INDEX_BY_URN =
"SELECT * FROM " + DATASET_INDEX_TABLE + " WHERE dataset_urn = :dataset_urn";
<BUG>public static final String DELETE_DATAS... | "SELECT app_id FROM " + EXTERNAL_GROUP_TABLE + " WHERE group_id = :group_id GROUP BY group_id";
public static final String GET_DATASET_CONSTRAINT_BY_DATASET_ID =
"SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_CONSTRAINT_BY_URN =
"SELECT * FROM " +... |
19,491 | DatasetSecurityRecord record = om.convertValue(security, DatasetSecurityRecord.class);
record.setDatasetId(datasetId);
record.setDatasetUrn(urn);
record.setModifiedTime(System.currentTimeMillis() / 1000);
try {
<BUG>Map<String, Object> result = getDatasetSecurityByDatasetId(datasetId);
</BUG>
String[] columns = record.... | DatasetSecurityRecord result = getDatasetSecurityByDatasetId(datasetId);
|
19,492 | "confidential_flags", "is_recursive", "partitioned", "indexed", "namespace", "default_comment_id", "comment_ids"};
}
@Override
public List<Object> fillAllFields() {
return null;
<BUG>}
public String[] getFieldDetailColumns() {</BUG>
return new String[]{"dataset_id", "sort_id", "parent_sort_id", "parent_path", "field_na... | @JsonIgnore
public String[] getFieldDetailColumns() {
|
19,493 | partitioned != null && partitioned ? "Y" : "N", isRecursive != null && isRecursive ? "Y" : "N",
confidentialFlags, defaultValue, namespace, defaultCommentId, commentIds};
}
public DatasetFieldSchemaRecord() {
}
<BUG>@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this.getFieldVal... | [DELETED] |
19,494 | String fieldPath;
String descend;
Integer prefixLength;
String filter;
public DatasetFieldIndexRecord() {
<BUG>}
@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this);
} catch (JsonProcessingException ex) {
return null;
}</BUG>
}
| [DELETED] |
19,495 | String actorUrn;
String type;
Long time;
String note;
public DatasetChangeAuditStamp() {
<BUG>}
@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this);
} catch (JsonProcessingException ex) {
return null;
}</BUG>
}
| [DELETED] |
19,496 | package wherehows.common.schemas;
<BUG>import com.fasterxml.jackson.annotation.JsonIgnore;
import java.lang.reflect.Field;
import java.util.HashMap;</BUG>
import java.util.List;
import java.util.Map;
| import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.util.Date;
import java.util.Collection;
import java.util.HashMap;
|
19,497 | 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> {
|
19,498 | 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... |
19,499 | 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;
|
19,500 | 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] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.