_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q170100
HttpPidMinter.xpath
validation
private static String xpath( final String xml, final XPathExpression xpath ) throws ParserConfigurationException, SAXException, IOException, XPathExpressionException { final DocumentBuilder builder = DOCUMENT_BUILDER_FACTORY.newDocumentBuilder(); final Document doc = builder.parse(new ByteAr...
java
{ "resource": "" }
q170101
HttpPidMinter.get
validation
@Timed @Override public String get() { try { LOGGER.debug("mintPid()"); final HttpResponse resp = client.execute( minterRequest() ); return responseToPid( EntityUtils.toString(resp.getEntity()) ); } catch ( final IOException ex ) { LOGGER.warn("Err...
java
{ "resource": "" }
q170102
ConfigurationBinder.forClass
validation
public static <T extends Configuration> ConfigurationBinder<T> forClass(Class<T> klass, Binder binder) { return new ConfigurationBinder<>(klass, binder); }
java
{ "resource": "" }
q170103
ConfigurationBinder.toInstance
validation
public void toInstance(Config configuration) { Preconditions.checkNotNull(configuration, "Configuration Instance cannot be null."); if (annotationClass == null) { binder.bind(configClass).toInstance(configuration); } else { binder.bind(configClass).annotatedWith(annotat...
java
{ "resource": "" }
q170104
FilterPattern.newInstance
validation
public static FilterPattern newInstance( EnumSet<DispatcherType> dispatcherTypes, boolean matchAfter, Iterable<String> patterns) { return new FilterPattern(dispatcherTypes, matchAfter, ImmutableList.copyOf(patterns)); }
java
{ "resource": "" }
q170105
ConstructorInvocation.proceed
validation
public T proceed() throws Throwable { try { return constructor().newInstance(args); } catch (InvocationTargetException e) { throw e.getTargetException(); } }
java
{ "resource": "" }
q170106
QueueDrainObserver.fastPathOrderedEmit
test
protected final void fastPathOrderedEmit(U value, boolean delayError, Disposable disposable) { final Observer<? super V> observer = downstream; final SimplePlainQueue<U> q = queue; if (wip.get() == 0 && wip.compareAndSet(0, 1)) { if (q.isEmpty()) { accept(observer, v...
java
{ "resource": "" }
q170107
Observable.wrap
test
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Observable<T> wrap(ObservableSource<T> source) { ObjectHelper.requireNonNull(source, "source is null"); if (source instanceof Observable) { return RxJavaPlugins.onAssembly((Observable<T>)source); } ...
java
{ "resource": "" }
q170108
Observable.sorted
test
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Observable<T> sorted(Comparator<? super T> sortFunction) { ObjectHelper.requireNonNull(sortFunction, "sortFunction is null"); return toList().toObservable().map(Functions.listSorter(sortFunction)).flatMapIterable(Functions.<...
java
{ "resource": "" }
q170109
ObservableReplay.observeOn
test
public static <T> ConnectableObservable<T> observeOn(final ConnectableObservable<T> co, final Scheduler scheduler) { final Observable<T> observable = co.observeOn(scheduler); return RxJavaPlugins.onAssembly(new Replay<T>(co, observable)); }
java
{ "resource": "" }
q170110
UnicastProcessor.create
test
@CheckReturnValue @NonNull public static <T> UnicastProcessor<T> create(int capacityHint) { return new UnicastProcessor<T>(capacityHint); }
java
{ "resource": "" }
q170111
UnicastProcessor.create
test
@CheckReturnValue @NonNull public static <T> UnicastProcessor<T> create(int capacityHint, Runnable onCancelled) { ObjectHelper.requireNonNull(onCancelled, "onTerminate"); return new UnicastProcessor<T>(capacityHint, onCancelled); }
java
{ "resource": "" }
q170112
FlowableScalarXMap.tryScalarXMapSubscribe
test
@SuppressWarnings("unchecked") public static <T, R> boolean tryScalarXMapSubscribe(Publisher<T> source, Subscriber<? super R> subscriber, Function<? super T, ? extends Publisher<? extends R>> mapper) { if (source instanceof Callable) { T t; try { ...
java
{ "resource": "" }
q170113
FlowableScalarXMap.scalarXMap
test
public static <T, U> Flowable<U> scalarXMap(final T value, final Function<? super T, ? extends Publisher<? extends U>> mapper) { return RxJavaPlugins.onAssembly(new ScalarXMapFlowable<T, U>(value, mapper)); }
java
{ "resource": "" }
q170114
RxJavaPlugins.reset
test
public static void reset() { setErrorHandler(null); setScheduleHandler(null); setComputationSchedulerHandler(null); setInitComputationSchedulerHandler(null); setIoSchedulerHandler(null); setInitIoSchedulerHandler(null); setSingleSchedulerHandler(null); ...
java
{ "resource": "" }
q170115
Maybe.fromCompletable
test
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public static <T> Maybe<T> fromCompletable(CompletableSource completableSource) { ObjectHelper.requireNonNull(completableSource, "completableSource is null"); return RxJavaPlugins.onAssembly(new MaybeFromCompletable<T>(compl...
java
{ "resource": "" }
q170116
Maybe.fromSingle
test
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public static <T> Maybe<T> fromSingle(SingleSource<T> singleSource) { ObjectHelper.requireNonNull(singleSource, "singleSource is null"); return RxJavaPlugins.onAssembly(new MaybeFromSingle<T>(singleSource)); }
java
{ "resource": "" }
q170117
Maybe.retry
test
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Maybe<T> retry(long times, Predicate<? super Throwable> predicate) { return toFlowable().retry(times, predicate).singleElement(); }
java
{ "resource": "" }
q170118
ObjectHelper.requireNonNull
test
public static <T> T requireNonNull(T object, String message) { if (object == null) { throw new NullPointerException(message); } return object; }
java
{ "resource": "" }
q170119
Functions.identity
test
@SuppressWarnings("unchecked") public static <T> Function<T, T> identity() { return (Function<T, T>)IDENTITY; }
java
{ "resource": "" }
q170120
Functions.justCallable
test
public static <T> Callable<T> justCallable(T value) { return new JustValue<Object, T>(value); }
java
{ "resource": "" }
q170121
Functions.justFunction
test
public static <T, U> Function<T, U> justFunction(U value) { return new JustValue<T, U>(value); }
java
{ "resource": "" }
q170122
Functions.castFunction
test
public static <T, U> Function<T, U> castFunction(Class<U> target) { return new CastToClass<T, U>(target); }
java
{ "resource": "" }
q170123
UnicastSubject.create
test
@CheckReturnValue @NonNull public static <T> UnicastSubject<T> create() { return new UnicastSubject<T>(bufferSize(), true); }
java
{ "resource": "" }
q170124
UnicastSubject.create
test
@CheckReturnValue @NonNull public static <T> UnicastSubject<T> create(int capacityHint) { return new UnicastSubject<T>(capacityHint, true); }
java
{ "resource": "" }
q170125
UnicastSubject.create
test
@CheckReturnValue @NonNull public static <T> UnicastSubject<T> create(int capacityHint, Runnable onTerminate) { return new UnicastSubject<T>(capacityHint, onTerminate, true); }
java
{ "resource": "" }
q170126
UnicastSubject.create
test
@CheckReturnValue @NonNull public static <T> UnicastSubject<T> create(boolean delayError) { return new UnicastSubject<T>(bufferSize(), delayError); }
java
{ "resource": "" }
q170127
BlockingMultiObserver.blockingGetError
test
public Throwable blockingGetError() { if (getCount() != 0) { try { BlockingHelper.verifyNonBlocking(); await(); } catch (InterruptedException ex) { dispose(); return ex; } } return error; }
java
{ "resource": "" }
q170128
BlockingMultiObserver.blockingGetError
test
public Throwable blockingGetError(long timeout, TimeUnit unit) { if (getCount() != 0) { try { BlockingHelper.verifyNonBlocking(); if (!await(timeout, unit)) { dispose(); throw ExceptionHelper.wrapOrThrow(new TimeoutException(tim...
java
{ "resource": "" }
q170129
BlockingMultiObserver.blockingAwait
test
public boolean blockingAwait(long timeout, TimeUnit unit) { if (getCount() != 0) { try { BlockingHelper.verifyNonBlocking(); if (!await(timeout, unit)) { dispose(); return false; } } catch (Interrupte...
java
{ "resource": "" }
q170130
QueueDrainHelper.drainMaxLoop
test
public static <T, U> void drainMaxLoop(SimplePlainQueue<T> q, Subscriber<? super U> a, boolean delayError, Disposable dispose, QueueDrain<T, U> qd) { int missed = 1; for (;;) { for (;;) { boolean d = qd.done(); T v = q.poll(); bo...
java
{ "resource": "" }
q170131
QueueDrainHelper.request
test
public static void request(Subscription s, int prefetch) { s.request(prefetch < 0 ? Long.MAX_VALUE : prefetch); }
java
{ "resource": "" }
q170132
QueueDrainHelper.postComplete
test
public static <T> void postComplete(Subscriber<? super T> actual, Queue<T> queue, AtomicLong state, BooleanSupplier isCancelled) { if (queue.isEmpty()) { actual.onComplete(); ...
java
{ "resource": "" }
q170133
SinglePostCompleteSubscriber.complete
test
protected final void complete(R n) { long p = produced; if (p != 0) { BackpressureHelper.produced(this, p); } for (;;) { long r = get(); if ((r & COMPLETE_MASK) != 0) { onDrop(n); return; } if ((...
java
{ "resource": "" }
q170134
Notification.getValue
test
@SuppressWarnings("unchecked") @Nullable public T getValue() { Object o = value; if (o != null && !NotificationLite.isError(o)) { return (T)value; } return null; }
java
{ "resource": "" }
q170135
Notification.getError
test
@Nullable public Throwable getError() { Object o = value; if (NotificationLite.isError(o)) { return NotificationLite.getError(o); } return null; }
java
{ "resource": "" }
q170136
EndConsumerHelper.validate
test
public static boolean validate(Disposable upstream, Disposable next, Class<?> observer) { ObjectHelper.requireNonNull(next, "next is null"); if (upstream != null) { next.dispose(); if (upstream != DisposableHelper.DISPOSED) { reportDoubleSubscription(observer); ...
java
{ "resource": "" }
q170137
EndConsumerHelper.setOnce
test
public static boolean setOnce(AtomicReference<Disposable> upstream, Disposable next, Class<?> observer) { ObjectHelper.requireNonNull(next, "next is null"); if (!upstream.compareAndSet(null, next)) { next.dispose(); if (upstream.get() != DisposableHelper.DISPOSED) { ...
java
{ "resource": "" }
q170138
EndConsumerHelper.validate
test
public static boolean validate(Subscription upstream, Subscription next, Class<?> subscriber) { ObjectHelper.requireNonNull(next, "next is null"); if (upstream != null) { next.cancel(); if (upstream != SubscriptionHelper.CANCELLED) { reportDoubleSubscription(subsc...
java
{ "resource": "" }
q170139
EndConsumerHelper.setOnce
test
public static boolean setOnce(AtomicReference<Subscription> upstream, Subscription next, Class<?> subscriber) { ObjectHelper.requireNonNull(next, "next is null"); if (!upstream.compareAndSet(null, next)) { next.cancel(); if (upstream.get() != SubscriptionHelper.CANCELLED) { ...
java
{ "resource": "" }
q170140
BackpressureHelper.addCap
test
public static long addCap(long a, long b) { long u = a + b; if (u < 0L) { return Long.MAX_VALUE; } return u; }
java
{ "resource": "" }
q170141
BackpressureHelper.multiplyCap
test
public static long multiplyCap(long a, long b) { long u = a * b; if (((a | b) >>> 31) != 0) { if (u / a != b) { return Long.MAX_VALUE; } } return u; }
java
{ "resource": "" }
q170142
BackpressureHelper.add
test
public static long add(AtomicLong requested, long n) { for (;;) { long r = requested.get(); if (r == Long.MAX_VALUE) { return Long.MAX_VALUE; } long u = addCap(r, n); if (requested.compareAndSet(r, u)) { return r; ...
java
{ "resource": "" }
q170143
Completable.toNpe
test
private static NullPointerException toNpe(Throwable ex) { NullPointerException npe = new NullPointerException("Actually not, but can't pass out an exception otherwise..."); npe.initCause(ex); return npe; }
java
{ "resource": "" }
q170144
LinkedArrayList.add
test
public void add(Object o) { // if no value yet, create the first array if (size == 0) { head = new Object[capacityHint + 1]; tail = head; head[0] = o; indexInTail = 1; size = 1; } else // if the tail is full, create a new tail a...
java
{ "resource": "" }
q170145
SchedulerPoolFactory.shutdown
test
public static void shutdown() { ScheduledExecutorService exec = PURGE_THREAD.getAndSet(null); if (exec != null) { exec.shutdownNow(); } POOLS.clear(); }
java
{ "resource": "" }
q170146
SchedulerPoolFactory.create
test
public static ScheduledExecutorService create(ThreadFactory factory) { final ScheduledExecutorService exec = Executors.newScheduledThreadPool(1, factory); tryPutIntoPool(PURGE_ENABLED, exec); return exec; }
java
{ "resource": "" }
q170147
SubscriptionArbiter.setSubscription
test
public final void setSubscription(Subscription s) { if (cancelled) { s.cancel(); return; } ObjectHelper.requireNonNull(s, "s is null"); if (get() == 0 && compareAndSet(0, 1)) { Subscription a = actual; if (a != null && cancelOnReplace) {...
java
{ "resource": "" }
q170148
SerializedSubject.emitLoop
test
void emitLoop() { for (;;) { AppendOnlyLinkedArrayList<Object> q; synchronized (this) { q = queue; if (q == null) { emitting = false; return; } queue = null; } ...
java
{ "resource": "" }
q170149
ExceptionHelper.wrapOrThrow
test
public static RuntimeException wrapOrThrow(Throwable error) { if (error instanceof Error) { throw (Error)error; } if (error instanceof RuntimeException) { return (RuntimeException)error; } return new RuntimeException(error); }
java
{ "resource": "" }
q170150
ExceptionHelper.flatten
test
public static List<Throwable> flatten(Throwable t) { List<Throwable> list = new ArrayList<Throwable>(); ArrayDeque<Throwable> deque = new ArrayDeque<Throwable>(); deque.offer(t); while (!deque.isEmpty()) { Throwable e = deque.removeFirst(); if (e instanceof Compo...
java
{ "resource": "" }
q170151
ExceptionHelper.throwIfThrowable
test
@SuppressWarnings("unchecked") public static <E extends Throwable> Exception throwIfThrowable(Throwable e) throws E { if (e instanceof Exception) { return (Exception)e; } throw (E)e; }
java
{ "resource": "" }
q170152
CompositeDisposable.clear
test
public void clear() { if (disposed) { return; } OpenHashSet<Disposable> set; synchronized (this) { if (disposed) { return; } set = resources; resources = null; } dispose(set); }
java
{ "resource": "" }
q170153
CompositeDisposable.size
test
public int size() { if (disposed) { return 0; } synchronized (this) { if (disposed) { return 0; } OpenHashSet<Disposable> set = resources; return set != null ? set.size() : 0; } }
java
{ "resource": "" }
q170154
ObservableScalarXMap.tryScalarXMapSubscribe
test
@SuppressWarnings("unchecked") public static <T, R> boolean tryScalarXMapSubscribe(ObservableSource<T> source, Observer<? super R> observer, Function<? super T, ? extends ObservableSource<? extends R>> mapper) { if (source instanceof Callable) { T t; try { ...
java
{ "resource": "" }
q170155
ObservableScalarXMap.scalarXMap
test
public static <T, U> Observable<U> scalarXMap(T value, Function<? super T, ? extends ObservableSource<? extends U>> mapper) { return RxJavaPlugins.onAssembly(new ScalarXMapObservable<T, U>(value, mapper)); }
java
{ "resource": "" }
q170156
AppendOnlyLinkedArrayList.accept
test
public <U> boolean accept(Subscriber<? super U> subscriber) { Object[] a = head; final int c = capacity; while (a != null) { for (int i = 0; i < c; i++) { Object o = a[i]; if (o == null) { break; } i...
java
{ "resource": "" }
q170157
AppendOnlyLinkedArrayList.accept
test
public <U> boolean accept(Observer<? super U> observer) { Object[] a = head; final int c = capacity; while (a != null) { for (int i = 0; i < c; i++) { Object o = a[i]; if (o == null) { break; } if (N...
java
{ "resource": "" }
q170158
MulticastProcessor.start
test
public void start() { if (SubscriptionHelper.setOnce(upstream, EmptySubscription.INSTANCE)) { queue = new SpscArrayQueue<T>(bufferSize); } }
java
{ "resource": "" }
q170159
MulticastProcessor.startUnbounded
test
public void startUnbounded() { if (SubscriptionHelper.setOnce(upstream, EmptySubscription.INSTANCE)) { queue = new SpscLinkedArrayQueue<T>(bufferSize); } }
java
{ "resource": "" }
q170160
MulticastProcessor.offer
test
public boolean offer(T t) { if (once.get()) { return false; } ObjectHelper.requireNonNull(t, "offer called with null. Null values are generally not allowed in 2.x operators and sources."); if (fusionMode == QueueSubscription.NONE) { if (queue.offer(t)) { ...
java
{ "resource": "" }
q170161
SerialDisposable.get
test
@Nullable public Disposable get() { Disposable d = resource.get(); if (d == DisposableHelper.DISPOSED) { return Disposables.disposed(); } return d; }
java
{ "resource": "" }
q170162
DeferredScalarDisposable.complete
test
public final void complete(T value) { int state = get(); if ((state & (FUSED_READY | FUSED_CONSUMED | TERMINATED | DISPOSED)) != 0) { return; } Observer<? super T> a = downstream; if (state == FUSED_EMPTY) { this.value = value; lazySet(FUSED_RE...
java
{ "resource": "" }
q170163
DeferredScalarDisposable.error
test
public final void error(Throwable t) { int state = get(); if ((state & (FUSED_READY | FUSED_CONSUMED | TERMINATED | DISPOSED)) != 0) { RxJavaPlugins.onError(t); return; } lazySet(TERMINATED); downstream.onError(t); }
java
{ "resource": "" }
q170164
DeferredScalarDisposable.complete
test
public final void complete() { int state = get(); if ((state & (FUSED_READY | FUSED_CONSUMED | TERMINATED | DISPOSED)) != 0) { return; } lazySet(TERMINATED); downstream.onComplete(); }
java
{ "resource": "" }
q170165
Flowable.concatMapDelayError
test
@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final <R> Flowable<R> concatMapDelayError(Function<? super T, ? extends Publisher<? extends R>> mapper) { return concatMapDelayError(mapper, 2, true); }
java
{ "resource": "" }
q170166
Flowable.concatMapIterable
test
@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final <U> Flowable<U> concatMapIterable(Function<? super T, ? extends Iterable<? extends U>> mapper) { return concatMapIterable(mapper, 2); }
java
{ "resource": "" }
q170167
Flowable.sorted
test
@CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> sorted(Comparator<? super T> sortFunction) { ObjectHelper.requireNonNull(sortFunction, "sortFunction"); return toList().toFlowable().map(Functions.list...
java
{ "resource": "" }
q170168
PerfAsyncConsumer.await
test
public PerfAsyncConsumer await(int count) { if (count <= 1000) { while (getCount() != 0) { } } else { try { await(); } catch (InterruptedException ex) { throw new RuntimeException(ex); } } return this; }
java
{ "resource": "" }
q170169
DefaultSubscriber.request
test
protected final void request(long n) { Subscription s = this.upstream; if (s != null) { s.request(n); } }
java
{ "resource": "" }
q170170
PublishSubject.add
test
boolean add(PublishDisposable<T> ps) { for (;;) { PublishDisposable<T>[] a = subscribers.get(); if (a == TERMINATED) { return false; } int n = a.length; @SuppressWarnings("unchecked") PublishDisposable<T>[] b = new PublishD...
java
{ "resource": "" }
q170171
PublishSubject.remove
test
@SuppressWarnings("unchecked") void remove(PublishDisposable<T> ps) { for (;;) { PublishDisposable<T>[] a = subscribers.get(); if (a == TERMINATED || a == EMPTY) { return; } int n = a.length; int j = -1; for (int i = 0;...
java
{ "resource": "" }
q170172
FlowableReplay.observeOn
test
public static <T> ConnectableFlowable<T> observeOn(final ConnectableFlowable<T> cf, final Scheduler scheduler) { final Flowable<T> flowable = cf.observeOn(scheduler); return RxJavaPlugins.onAssembly(new ConnectableFlowableReplay<T>(cf, flowable)); }
java
{ "resource": "" }
q170173
HttpServiceMethod.parseAnnotations
test
static <ResponseT, ReturnT> HttpServiceMethod<ResponseT, ReturnT> parseAnnotations( Retrofit retrofit, Method method, RequestFactory requestFactory) { boolean isKotlinSuspendFunction = requestFactory.isKotlinSuspendFunction; boolean continuationWantsResponse = false; boolean continuationBodyNullable =...
java
{ "resource": "" }
q170174
NetworkBehavior.setDelay
test
public void setDelay(long amount, TimeUnit unit) { if (amount < 0) { throw new IllegalArgumentException("Amount must be positive value."); } this.delayMs = unit.toMillis(amount); }
java
{ "resource": "" }
q170175
NetworkBehavior.createErrorResponse
test
public Response<?> createErrorResponse() { Response<?> call; try { call = errorFactory.call(); } catch (Exception e) { throw new IllegalStateException("Error factory threw an exception.", e); } if (call == null) { throw new IllegalStateException("Error factory returned null."); ...
java
{ "resource": "" }
q170176
NetworkBehavior.calculateDelay
test
public long calculateDelay(TimeUnit unit) { float delta = variancePercent / 100f; // e.g., 20 / 100f == 0.2f float lowerBound = 1f - delta; // 0.2f --> 0.8f float upperBound = 1f + delta; // 0.2f --> 1.2f float bound = upperBound - lowerBound; // 1.2f - 0.8f == 0.4f float delayPercent = lowerBound +...
java
{ "resource": "" }
q170177
DataSourcePopulator.createSampleData
test
private void createSampleData(String username, String password) { Assert.notNull(documentDao, "DocumentDao required"); Assert.hasText(username, "Username required"); Authentication auth = new UsernamePasswordAuthenticationToken(username, password); try { // Set the SecurityContextHolder ThreadLocal so any ...
java
{ "resource": "" }
q170178
RegexRequestMatcher.valueOf
test
private static HttpMethod valueOf(String method) { try { return HttpMethod.valueOf(method); } catch (IllegalArgumentException e) { } return null; }
java
{ "resource": "" }
q170179
FilterBasedLdapUserSearch.searchForUser
test
@Override public DirContextOperations searchForUser(String username) { if (logger.isDebugEnabled()) { logger.debug("Searching for user '" + username + "', with user search " + this); } SpringSecurityLdapTemplate template = new SpringSecurityLdapTemplate( contextSource); template.setSearchControls...
java
{ "resource": "" }
q170180
MessageDigestPasswordEncoder.encode
test
public String encode(CharSequence rawPassword) { String salt = PREFIX + this.saltGenerator.generateKey() + SUFFIX; return digest(salt, rawPassword); }
java
{ "resource": "" }
q170181
MessageDigestPasswordEncoder.matches
test
public boolean matches(CharSequence rawPassword, String encodedPassword) { String salt = extractSalt(encodedPassword); String rawPasswordEncoded = digest(salt, rawPassword); return PasswordEncoderUtils.equals(encodedPassword.toString(), rawPasswordEncoded); }
java
{ "resource": "" }
q170182
SpringSecurityCoreVersion.performVersionChecks
test
private static void performVersionChecks(String minSpringVersion) { if (minSpringVersion == null) { return; } // Check Spring Compatibility String springVersion = SpringVersion.getVersion(); String version = getVersion(); if (disableChecks(springVersion, version)) { return; } logger.info("You ar...
java
{ "resource": "" }
q170183
SpringSecurityCoreVersion.disableChecks
test
private static boolean disableChecks(String springVersion, String springSecurityVersion) { if (springVersion == null || springVersion.equals(springSecurityVersion)) { return true; } return Boolean.getBoolean(DISABLE_CHECKS); }
java
{ "resource": "" }
q170184
SpringSecurityCoreVersion.getSpringVersion
test
private static String getSpringVersion() { Properties properties = new Properties(); try { properties.load(SpringSecurityCoreVersion.class.getClassLoader().getResourceAsStream("META-INF/spring-security.versions")); } catch (IOException | NullPointerException e) { return null; } return properties.getProp...
java
{ "resource": "" }
q170185
OpenIDLoginConfigurer.attributeExchange
test
public AttributeExchangeConfigurer attributeExchange(String identifierPattern) { AttributeExchangeConfigurer attributeExchangeConfigurer = new AttributeExchangeConfigurer( identifierPattern); this.attributeExchangeConfigurers.add(attributeExchangeConfigurer); return attributeExchangeConfigurer; }
java
{ "resource": "" }
q170186
HttpSecurity.oauth2Client
test
public OAuth2ClientConfigurer<HttpSecurity> oauth2Client() throws Exception { OAuth2ClientConfigurer<HttpSecurity> configurer = getOrApply(new OAuth2ClientConfigurer<>()); this.postProcess(configurer); return configurer; }
java
{ "resource": "" }
q170187
HttpSecurity.oauth2ResourceServer
test
public OAuth2ResourceServerConfigurer<HttpSecurity> oauth2ResourceServer() throws Exception { OAuth2ResourceServerConfigurer<HttpSecurity> configurer = getOrApply(new OAuth2ResourceServerConfigurer<>(getContext())); this.postProcess(configurer); return configurer; }
java
{ "resource": "" }
q170188
HttpSecurity.requiresChannel
test
public ChannelSecurityConfigurer<HttpSecurity>.ChannelRequestMatcherRegistry requiresChannel() throws Exception { ApplicationContext context = getContext(); return getOrApply(new ChannelSecurityConfigurer<>(context)) .getRegistry(); }
java
{ "resource": "" }
q170189
SpringSecurityLdapTemplate.compare
test
public boolean compare(final String dn, final String attributeName, final Object value) { final String comparisonFilter = "(" + attributeName + "={0})"; class LdapCompareCallback implements ContextExecutor { public Object executeWithContext(DirContext ctx) throws NamingException { SearchControls ctls = new...
java
{ "resource": "" }
q170190
SpringSecurityLdapTemplate.retrieveEntry
test
public DirContextOperations retrieveEntry(final String dn, final String[] attributesToRetrieve) { return (DirContextOperations) executeReadOnly(new ContextExecutor() { public Object executeWithContext(DirContext ctx) throws NamingException { Attributes attrs = ctx.getAttributes(dn, attributesToRetrieve); ...
java
{ "resource": "" }
q170191
SpringSecurityLdapTemplate.searchForSingleAttributeValues
test
public Set<String> searchForSingleAttributeValues(final String base, final String filter, final Object[] params, final String attributeName) { String[] attributeNames = new String[] { attributeName }; Set<Map<String, List<String>>> multipleAttributeValues = searchForMultipleAttributeValues( base, filter, par...
java
{ "resource": "" }
q170192
SpringSecurityLdapTemplate.searchForMultipleAttributeValues
test
public Set<Map<String, List<String>>> searchForMultipleAttributeValues( final String base, final String filter, final Object[] params, final String[] attributeNames) { // Escape the params acording to RFC2254 Object[] encodedParams = new String[params.length]; for (int i = 0; i < params.length; i++) { e...
java
{ "resource": "" }
q170193
SpringSecurityLdapTemplate.searchForSingleEntryInternal
test
public static DirContextOperations searchForSingleEntryInternal(DirContext ctx, SearchControls searchControls, String base, String filter, Object[] params) throws NamingException { final DistinguishedName ctxBaseDn = new DistinguishedName( ctx.getNameInNamespace()); final DistinguishedName searchBaseDn = ...
java
{ "resource": "" }
q170194
SpringSecurityLdapTemplate.buildControls
test
private static SearchControls buildControls(SearchControls originalControls) { return new SearchControls(originalControls.getSearchScope(), originalControls.getCountLimit(), originalControls.getTimeLimit(), originalControls.getReturningAttributes(), RETURN_OBJECT, originalControls.getDerefLinkFlag()); }
java
{ "resource": "" }
q170195
BasicLookupStrategy.lookupPrimaryKeys
test
private void lookupPrimaryKeys(final Map<Serializable, Acl> acls, final Set<Long> findNow, final List<Sid> sids) { Assert.notNull(acls, "ACLs are required"); Assert.notEmpty(findNow, "Items to find now required"); String sql = computeRepeatingSql(lookupPrimaryKeysWhereClause, findNow.size()); Set<Long> par...
java
{ "resource": "" }
q170196
J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource.buildDetails
test
public PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails buildDetails( HttpServletRequest context) { Collection<String> j2eeUserRoles = getUserRoles(context); Collection<? extends GrantedAuthority> userGas = j2eeUserRoles2GrantedAuthoritiesMapper .getGrantedAuthorities(j2eeUserRoles); if (logger...
java
{ "resource": "" }
q170197
LdapServerBeanDefinitionParser.createEmbeddedServer
test
private RootBeanDefinition createEmbeddedServer(Element element, ParserContext parserContext) { Object source = parserContext.extractSource(element); String suffix = element.getAttribute(ATT_ROOT_SUFFIX); if (!StringUtils.hasText(suffix)) { suffix = OPT_DEFAULT_ROOT_SUFFIX; } String port = element.ge...
java
{ "resource": "" }
q170198
HttpConfigurationBuilder.createServletApiFilter
test
private void createServletApiFilter(BeanReference authenticationManager) { final String ATT_SERVLET_API_PROVISION = "servlet-api-provision"; final String DEF_SERVLET_API_PROVISION = "true"; String provideServletApi = httpElt.getAttribute(ATT_SERVLET_API_PROVISION); if (!StringUtils.hasText(provideServletApi)) ...
java
{ "resource": "" }
q170199
HttpConfigurationBuilder.createJaasApiFilter
test
private void createJaasApiFilter() { final String ATT_JAAS_API_PROVISION = "jaas-api-provision"; final String DEF_JAAS_API_PROVISION = "false"; String provideJaasApi = httpElt.getAttribute(ATT_JAAS_API_PROVISION); if (!StringUtils.hasText(provideJaasApi)) { provideJaasApi = DEF_JAAS_API_PROVISION; } if...
java
{ "resource": "" }