_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q168400 | JavaWriter.beginInitializer | validation | public JavaWriter beginInitializer(boolean isStatic) throws IOException {
indent();
if (isStatic) {
out.write("static");
out.write(" {\n");
} else {
out.write("{\n");
}
scopes.push(Scope.INITIALIZER);
return this;
} | java | {
"resource": ""
} |
q168401 | JavaWriter.endType | validation | public JavaWriter endType() throws IOException {
popScope(Scope.TYPE_DECLARATION, Scope.INTERFACE_DECLARATION);
types.pop();
indent();
out.write("}\n");
return this;
} | java | {
"resource": ""
} |
q168402 | JavaWriter.emitSingleLineComment | validation | public JavaWriter emitSingleLineComment(String comment, Object... args) throws IOException {
indent();
out.write("// ");
out.write(String.format(comment, args));
out.write("\n");
return this;
} | java | {
"resource": ""
} |
q168403 | JavaWriter.emitAnnotationValue | validation | private JavaWriter emitAnnotationValue(Object value) throws IOException {
if (value instanceof Object[]) {
out.write("{");
boolean firstValue = true;
scopes.push(Scope.ANNOTATION_ARRAY_VALUE);
for (Object o : ((Object[]) value)) {
if (firstValue) {
firstValue = false;
... | java | {
"resource": ""
} |
q168404 | JavaWriter.endMethod | validation | public JavaWriter endMethod() throws IOException {
Scope popped = scopes.pop();
// support calling a constructor a "method" to support the legacy code
if (popped == Scope.NON_ABSTRACT_METHOD || popped == Scope.CONSTRUCTOR) {
indent();
out.write("}\n");
} else if (popped != Scope.ABSTRACT_MET... | java | {
"resource": ""
} |
q168405 | JavaWriter.type | validation | public static String type(Class<?> raw, String... parameters) {
if (parameters.length == 0) {
return raw.getCanonicalName();
}
if (raw.getTypeParameters().length != parameters.length) {
throw new IllegalArgumentException();
}
StringBuilder result = new StringBuilder();
result.append(... | java | {
"resource": ""
} |
q168406 | JavaWriter.emitModifiers | validation | private void emitModifiers(Set<Modifier> modifiers) throws IOException {
if (modifiers.isEmpty()) {
return;
}
// Use an EnumSet to ensure the proper ordering
if (!(modifiers instanceof EnumSet)) {
modifiers = EnumSet.copyOf(modifiers);
}
for (Modifier modifier : modifiers) {
ou... | java | {
"resource": ""
} |
q168407 | ParcelablePleaseAction.getPsiClassFromContext | validation | private PsiClass getPsiClassFromContext(AnActionEvent e) {
PsiFile psiFile = e.getData(LangDataKeys.PSI_FILE);
Editor editor = e.getData(PlatformDataKeys.EDITOR);
if (psiFile == null || editor == null) {
return null;
}
int offset = editor.getCaretModel().getOffset();
PsiElement elem... | java | {
"resource": ""
} |
q168408 | CodeGenerator.findAndRemoveMethod | validation | private void findAndRemoveMethod(String methodName, String... arguments) {
// Maybe there's an easier way to do this with mClass.findMethodBySignature(), but I'm not an expert on Psi*
PsiMethod[] methods = psiClass.findMethodsByName(methodName, false);
for (PsiMethod method : methods) {
PsiParameterL... | java | {
"resource": ""
} |
q168409 | CodeGenerator.generate | validation | public void generate() {
PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(psiClass.getProject());
JavaCodeStyleManager styleManager = JavaCodeStyleManager.getInstance(psiClass.getProject());
// Clear any previous
clearPrevious();
// Implements parcelable
makeClassImplementPa... | java | {
"resource": ""
} |
q168410 | CodeGenerator.makeClassImplementParcelable | validation | private void makeClassImplementParcelable(PsiElementFactory elementFactory, JavaCodeStyleManager styleManager) {
final PsiClassType[] implementsListTypes = psiClass.getImplementsListTypes();
final String implementsType = "android.os.Parcelable";
for (PsiClassType implementsListType : implementsListTypes) {... | java | {
"resource": ""
} |
q168411 | ParcelablePleaseProcessor.isClass | validation | private boolean isClass(Element element) {
if (element.getKind() == ElementKind.CLASS) {
if (element.getModifiers().contains(Modifier.ABSTRACT)) {
ProcessorMessage.error(element,
"Element %s is annotated with @%s but is an abstract class. "
+ "Abstract classes can not be a... | java | {
"resource": ""
} |
q168412 | TypeUtils.isTypeOf | validation | public static boolean isTypeOf(TypeMirror type, Class<?> clazz) {
return type.toString().equals(clazz.getCanonicalName());
} | java | {
"resource": ""
} |
q168413 | TypeUtils.isTypeOf | validation | public static Class<?> isTypeOf(TypeMirror type, List<Class<?>> classList) {
for (Class<?> c : classList) {
if (isTypeOf(type, c)) {
return c;
}
}
return null;
} | java | {
"resource": ""
} |
q168414 | TypeUtils.getPackageName | validation | public static String getPackageName(Elements elementUtils, TypeElement type) throws IOException {
PackageElement pkg = elementUtils.getPackageOf(type);
if (!pkg.isUnnamed()) {
return pkg.getQualifiedName().toString();
} else {
return ""; // Default package
}
} | java | {
"resource": ""
} |
q168415 | TypeUtils.getBinaryName | validation | public static String getBinaryName(Elements elementUtils, TypeElement type) throws IOException {
String packageName = getPackageName(elementUtils, type);
String qualifiedName = type.getQualifiedName().toString();
if (packageName.length() > 0) {
return packageName + '.' + qualifiedName.substring(packag... | java | {
"resource": ""
} |
q168416 | CodeGenerator.generateWriteToParcel | validation | private void generateWriteToParcel(JavaWriter jw, String originClass,
List<ParcelableField> fields) throws IOException {
jw.beginMethod("void", "writeToParcel", EnumSet.of(Modifier.PUBLIC, Modifier.STATIC),
originClass, PARAM_SOURCE, "Parcel", PARAM_PARCEL, "int", PARAM_FLAGS);
for (ParcelableFi... | java | {
"resource": ""
} |
q168417 | ParcelableField.isPublicClass | validation | private boolean isPublicClass(DeclaredType type) {
Element element = type.asElement();
return element.getModifiers().contains(javax.lang.model.element.Modifier.PUBLIC);
} | java | {
"resource": ""
} |
q168418 | ParcelableField.hasPublicEmptyConstructor | validation | private boolean hasPublicEmptyConstructor(DeclaredType type) {
Element element = type.asElement();
List<? extends Element> containing = element.getEnclosedElements();
for (Element e : containing) {
if (e.getKind() == ElementKind.CONSTRUCTOR) {
ExecutableElement c = (ExecutableElement) e;
... | java | {
"resource": ""
} |
q168419 | Determinants.determinant3x3 | validation | public static double determinant3x3(
final double r0c0,
final double r0c1,
final double r0c2,
final double r1c0,
final double r1c1,
final double r1c2,
final double r2c0,
final double r2c1,
final double r2c2)
{
double sum = 0.0;
sum += r0c0 * ((r1c1 * r2c2) - (r1c2 * r2c1));... | java | {
"resource": ""
} |
q168420 | Hunter.findBy | validation | public R findBy(ClassFileScanConfiguration scanConfig, SearchCriteria criteria) {
scanConfig = scanConfig.createCopy();
criteria = criteria.createCopy();
C context = createContext(scanConfig, criteria);
criteria.init(this.classHelper, context.pathMemoryClassLoader, this.memberFinder, this.pathHelper);
... | java | {
"resource": ""
} |
q168421 | Matrix4x4DGenerator.createOrthogonal | validation | public static Generator<Matrix4x4D> createOrthogonal()
{
return () -> {
final SecureRandom rng = new SecureRandom();
final double r0c0 = 1.0;
final double r0c1 = 0.0;
final double r0c2 = 0.0;
final double r0c3 = rng.nextDouble();
final double r1c0 = 0.0;
final double r1... | java | {
"resource": ""
} |
q168422 | RedisConnectionAsync.getBinaryMultiBulkReply | validation | @SuppressWarnings("unchecked")
public static List<byte[]> getBinaryMultiBulkReply(byte[] input) {
return (List<byte[]>) RedisProtocol.read(
new RedisInputStream(new ByteArrayInputStream(input)));
} | java | {
"resource": ""
} |
q168423 | BinaryRedisCluster.getBinaryTupledSet | validation | private Set<Tuple> getBinaryTupledSet() {
List<byte[]> membersWithScores = client.getBinaryMultiBulkReply();
Set<Tuple> set = new LinkedHashSet<Tuple>();
if (membersWithScores == null) {
return set;
}
Iterator<byte[]> iterator = membersWithScores.iterator();
... | java | {
"resource": ""
} |
q168424 | AbstractOperations.rawKey | validation | @SuppressWarnings("unchecked")
byte[] rawKey(Object key) {
Assert.notNull(key, "non null key required");
return keySerializer().serialize(key);
} | java | {
"resource": ""
} |
q168425 | AbstractOperations.rawHashKey | validation | @SuppressWarnings("unchecked")
<HK> byte[] rawHashKey(HK hashKey) {
Assert.notNull(hashKey, "non null hash key required");
return hashKeySerializer().serialize(hashKey);
} | java | {
"resource": ""
} |
q168426 | AbstractOperations.deserializeTupleValues | validation | @SuppressWarnings("unchecked")
Set<TypedTuple<V>> deserializeTupleValues(Set<Tuple> rawValues) {
Set<TypedTuple<V>> set = new LinkedHashSet<TypedTuple<V>>(rawValues.size());
for (Tuple rawValue : rawValues) {
set.add(new DefaultTypedTuple(valueSerializer().deserialize(rawValue.getValue()... | java | {
"resource": ""
} |
q168427 | AbstractOperations.deserializeHashKeys | validation | @SuppressWarnings("unchecked")
<T> Set<T> deserializeHashKeys(Set<byte[]> rawKeys) {
return SerializationUtils.deserialize(rawKeys, hashKeySerializer());
} | java | {
"resource": ""
} |
q168428 | AbstractOperations.deserializeHashValues | validation | @SuppressWarnings("unchecked")
<T> List<T> deserializeHashValues(List<byte[]> rawValues) {
return SerializationUtils.deserialize(rawValues, hashValueSerializer());
} | java | {
"resource": ""
} |
q168429 | AbstractOperations.deserializeHashMap | validation | @SuppressWarnings("unchecked")
<HK, HV> Map<HK, HV> deserializeHashMap(Map<byte[], byte[]> entries) {
// connection in pipeline/multi mode
if (entries == null) {
return null;
}
Map<HK, HV> map = new LinkedHashMap<HK, HV>(entries.size());
for (Map.Entry<byte[], b... | java | {
"resource": ""
} |
q168430 | AbstractOperations.deserializeHashList | validation | <HK, HV> Map<HK, List<HV>> deserializeHashList(Map<byte[], List<byte[]>> entries) {
// connection in pipeline/multi mode
if (entries == null) {
return null;
}
Map<HK, List<HV>> map = new LinkedHashMap<HK, List<HV>>(entries.size());
for (Map.Entry<byte[], List<byte[]... | java | {
"resource": ""
} |
q168431 | AbstractOperations.deserializeHashSet | validation | <HK, HV> Map<HK, Set<HV>> deserializeHashSet(Map<byte[], Set<byte[]>> entries) {
// connection in pipeline/multi mode
if (entries == null) {
return null;
}
Map<HK, Set<HV>> map = new LinkedHashMap<HK, Set<HV>>(entries.size());
for (Map.Entry<byte[], Set<byte[]>> ent... | java | {
"resource": ""
} |
q168432 | GatewayAddress.asListFromDomain | validation | public static List<GatewayAddress> asListFromDomain(final String domainAddress) {
if (domainAddress == null) {
throw new IllegalArgumentException("domain address must not be null");
}
GatewayAddress domain = new GatewayAddress(0, domainAddress);
InetAddress[] addresses;
... | java | {
"resource": ""
} |
q168433 | GatewayAddress.parseHost | validation | public static String parseHost(final String address) {
int ep = address.indexOf(":");
if (ep == -1 || ep == 0) {
throw new IllegalArgumentException("invalid address '" + address + "'");
}
return address.substring(0, ep).trim();
} | java | {
"resource": ""
} |
q168434 | GatewayAddress.parsePort | validation | public static int parsePort(final String address) {
int sp = address.indexOf(":");
if (sp == -1 && sp + 1 >= address.length()) {
throw new IllegalArgumentException("not found port '" + address + "'");
}
try {
return Integer.parseInt(address.substring(sp + 1, addr... | java | {
"resource": ""
} |
q168435 | RedisClusterClient.set | validation | public void set(final String key, final String value) {
set(SafeEncoder.encode(key), SafeEncoder.encode(value));
} | java | {
"resource": ""
} |
q168436 | RedisClusterPipeline.sync | validation | public void sync() {
if (this.client == null) {
return;
}
List<Object> unformatted = null;
try {
unformatted = this.client.getAll();
} catch (Exception e) {
this.brokenResource = true;
throw new GatewayException("gateway=" + this.s... | java | {
"resource": ""
} |
q168437 | RedisCluster.getTupledSet | validation | private Set<Tuple> getTupledSet() {
List<String> membersWithScores = client.getMultiBulkReply();
Set<Tuple> set = new LinkedHashSet<Tuple>();
Iterator<String> iterator = membersWithScores.iterator();
while (iterator.hasNext()) {
set.add(new Tuple(iterator.next(), Double.value... | java | {
"resource": ""
} |
q168438 | LeaderElectionSupport.stop | validation | public synchronized void stop() {
state = State.STOP;
dispatchEvent(LeaderElectionEventType.STOP_START);
logger.info("Stopping leader election support");
if (leaderOffer != null) {
try {
zooKeeper.delete(leaderOffer.getNodePath(), -1);
logger... | java | {
"resource": ""
} |
q168439 | GatewayClient.toExecuteInfo | validation | String toExecuteInfo(final int tryCount, final long startedTime, final GatewayServer server,
final RedisCluster redis) {
final StringBuilder sb = new StringBuilder();
final long executedTime = System.currentTimeMillis() - startedTime;
sb.append("time=").append(executedTi... | java | {
"resource": ""
} |
q168440 | MGSetquorum.setquorum | validation | public void setquorum(PartitionGroupServer master, int q,
String quorumMembers) throws MgmtSetquorumException,
MgmtSmrCommandException {
master.setQuorum(q, quorumMembers);
} | java | {
"resource": ""
} |
q168441 | ThreadLocalVariableHolder.checkPermission | validation | public static void checkPermission(String path, LockType type) throws MgmtZooKeeperException {
if (znodePermission.get() != null) {
znodePermission.get().checkPermission(path, type);
}
} | java | {
"resource": ""
} |
q168442 | BinaryRedisClusterClient.joinParameters | validation | private byte[][] joinParameters(byte[] first, byte[][] rest) {
byte[][] result = new byte[rest.length + 1][];
result[0] = first;
for (int i = 0; i < rest.length; i++) {
result[i + 1] = rest[i];
}
return result;
} | java | {
"resource": ""
} |
q168443 | BinaryRedisClusterClient.expireAt | validation | public void expireAt(final byte[] key, final long millisecondsTimestamp) {
sendCommand(Command.EXPIREAT, key, RedisProtocol.toByteArray(millisecondsTimestamp));
} | java | {
"resource": ""
} |
q168444 | BinaryRedisClusterClient.decrBy | validation | public void decrBy(final byte[] key, final long integer) {
sendCommand(Command.DECRBY, key, RedisProtocol.toByteArray(integer));
} | java | {
"resource": ""
} |
q168445 | BinaryRedisClusterClient.incrBy | validation | public void incrBy(final byte[] key, final long integer) {
sendCommand(Command.INCRBY, key, RedisProtocol.toByteArray(integer));
} | java | {
"resource": ""
} |
q168446 | BinaryRedisClusterClient.zaddBinary | validation | public void zaddBinary(final byte[] key, Map<Double, byte[]> scoreMembers) {
ArrayList<byte[]> args = new ArrayList<byte[]>(scoreMembers.size() * 2 + 1);
args.add(key);
for (Map.Entry<Double, byte[]> entry : scoreMembers.entrySet()) {
args.add(RedisProtocol.toByteArray(entry.getKey... | java | {
"resource": ""
} |
q168447 | BinaryRedisClusterClient.zrangeByScore | validation | public void zrangeByScore(final byte[] key, final byte[] min, final byte[] max) {
sendCommand(Command.ZRANGEBYSCORE, key, min, max);
} | java | {
"resource": ""
} |
q168448 | BinaryRedisClusterClient.zrangeByScoreWithScores | validation | public void zrangeByScoreWithScores(final byte[] key, final byte[] min, final byte[] max, final int offset,
final int count) {
sendCommand(Command.ZRANGEBYSCORE, key, min, max, Keyword.LIMIT.raw, RedisProtocol.toByteArray(offset), RedisProtocol.toByteArray(count), Keyword... | java | {
"resource": ""
} |
q168449 | BinaryRedisClusterClient.slaveofNoOne | validation | public void slaveofNoOne() {
sendCommand(Command.SLAVEOF, Keyword.NO.raw, Keyword.ONE.raw);
} | java | {
"resource": ""
} |
q168450 | BinaryRedisClusterClient.configSet | validation | public void configSet(final byte[] parameter, final byte[] value) {
sendCommand(Command.CONFIG, Keyword.SET.raw, parameter, value);
} | java | {
"resource": ""
} |
q168451 | BinaryRedisClusterClient.getbit | validation | public void getbit(byte[] key, long offset) {
sendCommand(Command.GETBIT, key, RedisProtocol.toByteArray(offset));
} | java | {
"resource": ""
} |
q168452 | BinaryRedisClusterClient.getrange | validation | public void getrange(byte[] key, long startOffset, long endOffset) {
sendCommand(Command.GETRANGE, key, RedisProtocol.toByteArray(startOffset), RedisProtocol.toByteArray(endOffset));
} | java | {
"resource": ""
} |
q168453 | EventSelector.shutdown | validation | public void shutdown() throws IOException {
try {
selector.close();
} catch (IOException e) {
Logger.error("Close nio event selector fail.", e);
throw e;
}
} | java | {
"resource": ""
} |
q168454 | EventSelector.process | validation | public ElapsedTime process() {
try {
long start = System.currentTimeMillis();
ioProcess();
long ioDone = System.currentTimeMillis();
loopProcess();
long end = System.currentTimeMillis();
return new ElapsedTime(start, ioDone, end);
... | java | {
"resource": ""
} |
q168455 | EventSelector.ioProcess | validation | public void ioProcess()
{
int numberOfKeys;
try {
numberOfKeys = selector.select(selectTimeout);
} catch (IOException e) {
Logger.error("Selector.select error.", e);
return;
}
if (0 == numberOfKeys) {
return;
}
... | java | {
"resource": ""
} |
q168456 | EventSelector.loopProcess | validation | public void loopProcess()
{
for (Session session : sessions.values())
{
long timeMillis = System.currentTimeMillis();
try {
session.callbackOnLoop(timeMillis);
} catch (Exception e) {
Logger.error("Exception occurs while callbackOnL... | java | {
"resource": ""
} |
q168457 | EventSelector.register | validation | public void register(Session session, int ops) throws ClosedChannelException {
if (sessions.containsKey(session.getID())) {
throw new IllegalStateException("Altready registered session");
}
SelectionKey selKey;
try {
selKey = session.getChannel().register... | java | {
"resource": ""
} |
q168458 | JadlerMocker.addDefaultHeader | validation | public void addDefaultHeader(final String name, final String value) {
Validate.notEmpty(name, "header name cannot be empty");
Validate.notNull(value, "header value cannot be null, use an empty string instead");
this.checkConfigurable();
this.defaultHeaders.put(name, value);
} | java | {
"resource": ""
} |
q168459 | Verifying.receivedTimes | validation | public void receivedTimes(final Matcher<Integer> nrRequestsPredicate) {
Validate.notNull(nrRequestsPredicate, "predicate cannot be null");
this.requestManager.evaluateVerification(predicates, nrRequestsPredicate);
} | java | {
"resource": ""
} |
q168460 | KeyValues.getValue | validation | public String getValue(final String key) {
Validate.notEmpty(key, "key cannot be empty");
final List<String> allValues = this.getValues(key);
return allValues != null ? allValues.get(0) : null;
} | java | {
"resource": ""
} |
q168461 | KeyValues.getValues | validation | public List<String> getValues(final String key) {
Validate.notEmpty(key, "name cannot be empty");
@SuppressWarnings("unchecked")
final List<String> result = (List<String>) values.get(key.toLowerCase());
return result == null || result.isEmpty() ? null : new ArrayList<String>(res... | java | {
"resource": ""
} |
q168462 | RequestUtils.addEncoding | validation | static void addEncoding(final Request.Builder builder, final HttpExchange httpExchange) {
final String contentType = httpExchange.getRequestHeaders().getFirst("Content-Type");
if (contentType != null) {
final Matcher matcher = CHARSET_PATTERN.matcher(contentType);
if (matcher.mat... | java | {
"resource": ""
} |
q168463 | StubbingFactory.createStubbing | validation | public Stubbing createStubbing(final Charset defaultEncoding, final int defaultStatus,
final MultiMap defaultHeaders) {
return new Stubbing(defaultEncoding, defaultStatus, defaultHeaders);
} | java | {
"resource": ""
} |
q168464 | JWTEncoder.encode | validation | public static String encode(JSONObject claims, String secret) {
String encodedHeader = getCommonHeader();
String encodedClaims = encodeJson(claims);
String secureBits = new StringBuilder(encodedHeader).append(TOKEN_SEP).append(encodedClaims).toString();
String sig = sign(secret, secure... | java | {
"resource": ""
} |
q168465 | TokenOptions.copyDate | validation | private Date copyDate(Date date) {
return (date != null) ? new Date(date.getTime()) : null;
} | java | {
"resource": ""
} |
q168466 | TokenGenerator.createToken | validation | public String createToken(Map<String, Object> data, TokenOptions options) {
if ((data == null || data.size() == 0) && (options == null || (!options.isAdmin() && !options.isDebug()))) {
throw new IllegalArgumentException("TokenGenerator.createToken: data is empty and no options are set. This token w... | java | {
"resource": ""
} |
q168467 | GoogleAPI.getErrorDialog | validation | Dialog getErrorDialog(int errorCode, int requestCode) {
final Dialog dialog = GoogleApiAvailability.getInstance().getErrorDialog(activity, errorCode, requestCode);
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterfac... | java | {
"resource": ""
} |
q168468 | GoogleAPI.connectAndRequestGoogleAccount | validation | void connectAndRequestGoogleAccount(int signInRequestCode, int errorResolutionRequestCode) {
if (client.isConnected()) {
requestGoogleAccount(signInRequestCode);
} else if (!client.isConnecting()) {
this.signInRequestCode = signInRequestCode;
this.errorResolutionReque... | java | {
"resource": ""
} |
q168469 | GoogleAPI.logoutAndClearState | validation | public void logoutAndClearState() {
if (client != null && client.isConnected()) {
logout();
client.disconnect();
}
activity = null;
client = null;
} | java | {
"resource": ""
} |
q168470 | CloudflareEdgeCache.invalidateIfNecessary | validation | @Override
public boolean invalidateIfNecessary(BaragonRequest request) {
if (request.getLoadBalancerService().getEdgeCacheDomains().isEmpty()) {
return false;
}
try {
boolean allSucceeded = true;
for (String edgeCacheDNS : request.getLoadBalancerService().getEdgeCacheDomains()) {
... | java | {
"resource": ""
} |
q168471 | BaragonServiceClient.getBaragonServiceStatus | validation | public Optional<BaragonServiceStatus> getBaragonServiceStatus(String baseUrl) {
final String uri = String.format(STATUS_FORMAT, baseUrl);
return getSingle(uri, "status", "", BaragonServiceStatus.class);
} | java | {
"resource": ""
} |
q168472 | BaragonServiceClient.getGlobalState | validation | public Collection<BaragonServiceState> getGlobalState() {
final String uri = String.format(STATE_FORMAT, getBaseUrl());
return getCollection(uri, "global state", BARAGON_SERVICE_STATE_COLLECTION);
} | java | {
"resource": ""
} |
q168473 | BaragonServiceClient.getLoadBalancerGroups | validation | public Collection<String> getLoadBalancerGroups() {
final String requestUri = String.format(LOAD_BALANCER_FORMAT, getBaseUrl());
return getCollection(requestUri, "load balancer groups", STRING_COLLECTION);
} | java | {
"resource": ""
} |
q168474 | BaragonServiceClient.getOccupiedBasePaths | validation | public Collection<String> getOccupiedBasePaths(String loadBalancerGroupName) {
final String requestUri = String.format(LOAD_BALANCER_ALL_BASE_PATHS_FORMAT, getBaseUrl(), loadBalancerGroupName);
return getCollection(requestUri, "occupied base paths", STRING_COLLECTION);
} | java | {
"resource": ""
} |
q168475 | BaragonServiceClient.getRequest | validation | public Optional<BaragonResponse> getRequest(String requestId) {
final String uri = String.format(REQUEST_ID_FORMAT, getBaseUrl(), requestId);
return getSingle(uri, "request", requestId, BaragonResponse.class);
} | java | {
"resource": ""
} |
q168476 | BaragonServiceClient.getQueuedRequests | validation | public Collection<QueuedRequestId> getQueuedRequests() {
final String uri = String.format(REQUEST_FORMAT, getBaseUrl());
return getCollection(uri, "queued requests", QUEUED_REQUEST_COLLECTION);
} | java | {
"resource": ""
} |
q168477 | ApplicationLoadBalancer.guaranteeRegistered | validation | private void guaranteeRegistered(TrafficSource trafficSource,
TargetGroup targetGroup,
Collection<TargetDescription> targets,
Collection<BaragonAgentMetadata> baragonAgents,
Collec... | java | {
"resource": ""
} |
q168478 | ApplicationLoadBalancer.deregisterRemovableTargets | validation | private void deregisterRemovableTargets(TrafficSource trafficSource,
BaragonGroup baragonGroup,
TargetGroup targetGroup,
Collection<BaragonAgentMetadata> agents,
... | java | {
"resource": ""
} |
q168479 | ApplicationLoadBalancer.guaranteeSameVPC | validation | private void guaranteeSameVPC(TargetGroup targetGroup,
Collection<BaragonAgentMetadata> agents,
Collection<LoadBalancer> loadBalancers) {
String vpcId = targetGroup.getVpcId();
for (BaragonAgentMetadata agent : agents) {
if (agent.getEc2().g... | java | {
"resource": ""
} |
q168480 | ApplicationLoadBalancer.guaranteeHasAllTargets | validation | private void guaranteeHasAllTargets(TrafficSource trafficSource,
TargetGroup targetGroup,
Collection<TargetDescription> targets,
Collection<BaragonAgentMetadata> baragonAgents) {
Collection<TargetDescri... | java | {
"resource": ""
} |
q168481 | SchemaLink.setHref | validation | public void setHref(String href) {
if (href.contains("%7B")) {
try {
href = URLDecoder.decode(href, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
}
this.href = new UriTemplate(href);
} | java | {
"resource": ""
} |
q168482 | MemberKey.newInstance | validation | static MemberKey newInstance(Object contextObject, String name) {
if (contextObject instanceof Class<?>) {
Class<?> clazz = (Class<?>) contextObject;
if (clazz.isEnum() && ("values".equals(name) || Reflections.isConstantName(clazz, name))) {
// Special handling for enums ... | java | {
"resource": ""
} |
q168483 | DefaultParser.lineSeparatorFound | validation | private void lineSeparatorFound(String lineSeparator) {
flushText();
flushLineSeparator(lineSeparator);
line++;
state = State.TEXT;
separatorIdx = 0;
} | java | {
"resource": ""
} |
q168484 | DefaultParser.flushTag | validation | private void flushTag() {
state = State.TEXT;
handler.tag(deriveTag(buffer.toString()));
delimiterIdx = 0;
clearBuffer();
} | java | {
"resource": ""
} |
q168485 | DefaultParser.extractContent | validation | private String extractContent(MustacheTagType tagType, String buffer) {
switch (tagType) {
case VARIABLE:
return buffer.trim();
case UNESCAPE_VARIABLE:
return (buffer.charAt(0) == ((String) EngineConfigurationKey.START_DELIMITER
.getDefaultValue()).ch... | java | {
"resource": ""
} |
q168486 | SegmentBases.readSegmentLines | validation | private static List<List<SegmentBase>> readSegmentLines(
ContainerSegmentBase container) {
List<List<SegmentBase>> lines = new ArrayList<>();
// Add the last line manually - there is no line separator to trigger
// flush
lines.add(readSegmentLines(lines, null, container));
... | java | {
"resource": ""
} |
q168487 | Patterns.newMustacheTagPattern | validation | public static Pattern newMustacheTagPattern(Configuration configuration) {
StringBuilder regex = new StringBuilder();
regex.append(Pattern.quote(configuration
.getStringPropertyValue(EngineConfigurationKey.START_DELIMITER)));
regex.append(".*?");
regex.append(Pattern.quot... | java | {
"resource": ""
} |
q168488 | Decorator.decorate | validation | public static <T> Decorator<T> decorate(T delegate, Map<String, Function<T, Object>> mappings, String delegateKey,
Configuration configuration) {
return IterableDecorator.isIterable(delegate)
? new IterableDecorator<>(delegate, ImmutableMap.copyOf(mappings), delegateKey, configuratio... | java | {
"resource": ""
} |
q168489 | Decorator.unwrap | validation | @SuppressWarnings("unchecked")
public static <T> T unwrap(T instance) {
return instance instanceof Decorator ? unwrap(((Decorator<T>) instance).delegate) : instance;
} | java | {
"resource": ""
} |
q168490 | MustacheEngineBuilder.build | validation | public synchronized MustacheEngine build() {
MustacheEngine engine = new DefaultMustacheEngine(this);
for (EngineBuiltCallback callback : engineReadyCallbacks) {
callback.engineBuilt(engine);
}
BuildInfo buildInfo = BuildInfo.load();
LOGGER.info("Engine built {} ({})"... | java | {
"resource": ""
} |
q168491 | MustacheEngineBuilder.addTemplateLocator | validation | public MustacheEngineBuilder addTemplateLocator(TemplateLocator locator) {
checkArgumentNotNull(locator);
checkNotBuilt();
this.templateLocators.add(locator);
return this;
} | java | {
"resource": ""
} |
q168492 | MustacheEngineBuilder.addResolver | validation | public MustacheEngineBuilder addResolver(Resolver resolver) {
checkArgumentNotNull(resolver);
checkNotBuilt();
this.resolvers.add(resolver);
return this;
} | java | {
"resource": ""
} |
q168493 | MustacheEngineBuilder.registerCallback | validation | public MustacheEngineBuilder registerCallback(
EngineBuiltCallback callback) {
checkArgumentNotNull(callback);
checkNotBuilt();
this.engineReadyCallbacks.add(callback);
return this;
} | java | {
"resource": ""
} |
q168494 | MustacheEngineBuilder.addValueConverter | validation | public MustacheEngineBuilder addValueConverter(ValueConverter converter) {
checkArgumentNotNull(converter);
checkNotBuilt();
this.valueConverters.add(converter);
return this;
} | java | {
"resource": ""
} |
q168495 | MustacheEngineBuilder.addContextConverter | validation | public MustacheEngineBuilder addContextConverter(ContextConverter converter) {
checkArgumentNotNull(converter);
checkNotBuilt();
this.contextConverters.add(converter);
return this;
} | java | {
"resource": ""
} |
q168496 | Strings.capitalizeFully | validation | public static String capitalizeFully(String text, Character delimiter) {
if (isEmpty(text)) {
return text;
}
text = text.toLowerCase();
boolean capitalizeNext = true;
StringBuilder builder = new StringBuilder();
for (int i = 0; i < text.length(); i++) {
... | java | {
"resource": ""
} |
q168497 | AbstractHelper.append | validation | protected void append(Options options, CharSequence sequence) {
TextSupport textSupport = this.textSupport;
if (textSupport == null || isUnescapeVariable(options)) {
options.append(sequence);
} else {
try {
textSupport.appendEscapedHtml(sequence.toString()... | java | {
"resource": ""
} |
q168498 | DefaultMustacheEngine.buildSourceCache | validation | private ComputingCache<String, Optional<String>> buildSourceCache() {
return buildCache("Source",
key ->
Optional.ofNullable(locateAndRead(key)),
(key, cause) ->
LOGGER.debug("Removed template source from cache [templateId: {}, caus... | java | {
"resource": ""
} |
q168499 | DefaultParsingHandler.push | validation | private void push(ContainerSegmentBase container) {
containerStack.addFirst(container);
LOGGER.trace("Push {} [name: {}]", container.getType(),
container.getContent());
} | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.