method2testcases stringlengths 118 6.63k |
|---|
### Question:
NamenodeJspHelper { static String getDelegationToken(final NamenodeProtocols nn, HttpServletRequest request, Configuration conf, final UserGroupInformation ugi) throws IOException, InterruptedException { Token<DelegationTokenIdentifier> token = ugi .doAs(new PrivilegedExceptionAction<Token<DelegationToken... |
### Question:
NamenodeJspHelper { static String getSecurityModeText() { if(UserGroupInformation.isSecurityEnabled()) { return "<div class=\"security\">Security is <em>ON</em></div>"; } else { return "<div class=\"security\">Security is <em>OFF</em></div>"; } } }### Answer:
@Test public void tesSecurityModeText() { c... |
### Question:
INodeFile extends INode implements BlockCollection { @Override public short getBlockReplication() { return (short) ((header & HEADERMASK) >> BLOCKBITS); } INodeFile(PermissionStatus permissions, BlockInfo[] blklist,
short replication, long modificationTime,
long... |
### Question:
INodeFile extends INode implements BlockCollection { @Override public long getPreferredBlockSize() { return header & ~HEADERMASK; } INodeFile(PermissionStatus permissions, BlockInfo[] blklist,
short replication, long modificationTime,
long atime, long preferredB... |
### Question:
INodeFile extends INode implements BlockCollection { void appendBlocks(INodeFile [] inodes, int totalAddedBlocks) { int size = this.blocks.length; BlockInfo[] newlist = new BlockInfo[size + totalAddedBlocks]; System.arraycopy(this.blocks, 0, newlist, 0, size); for(INodeFile in: inodes) { System.arraycopy(... |
### Question:
INodeFile extends INode implements BlockCollection { public static INodeFile valueOf(INode inode, String path) throws IOException { if (inode == null) { throw new FileNotFoundException("File does not exist: " + path); } if (!(inode instanceof INodeFile)) { throw new FileNotFoundException("Path is not a fi... |
### Question:
EditLogFileOutputStream extends EditLogOutputStream { @Override public void close() throws IOException { if (fp == null) { throw new IOException("Trying to use aborted output stream"); } try { if (doubleBuf != null) { doubleBuf.close(); doubleBuf = null; } if (fc != null && fc.isOpen()) { fc.truncate(fc.p... |
### Question:
EditLogFileOutputStream extends EditLogOutputStream { @Override public void abort() throws IOException { if (fp == null) { return; } IOUtils.cleanup(LOG, fp); fp = null; } EditLogFileOutputStream(File name, int size); @Override void write(FSEditLogOp op); @Override void writeRaw(byte[] bytes, int offset, ... |
### Question:
FSEditLogLoader { static EditLogValidation validateEditLog(EditLogInputStream in) { long lastPos = 0; long lastTxId = HdfsConstants.INVALID_TXID; long numValid = 0; FSEditLogOp op = null; while (true) { lastPos = in.getPosition(); try { if ((op = in.readOp()) == null) { break; } } catch (Throwable t) { FS... |
### Question:
NameNodeResourceChecker { @VisibleForTesting Collection<String> getVolumesLowOnSpace() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Going to check the following volumes disk space: " + volumes); } Collection<String> lowVolumes = new ArrayList<String>(); for (CheckedVolume volume : volumes.v... |
### Question:
StreamFile extends DfsServlet { static void copyFromOffset(FSInputStream in, OutputStream out, long offset, long count) throws IOException { in.seek(offset); IOUtils.copyBytes(in, out, count, false); } @Override @SuppressWarnings("unchecked") void doGet(HttpServletRequest request, HttpServletResponse res... |
### Question:
StreamFile extends DfsServlet { static void sendPartialData(FSInputStream in, OutputStream out, HttpServletResponse response, long contentLength, List<InclusiveByteRange> ranges) throws IOException { if (ranges == null || ranges.size() != 1) { response.setContentLength(0); response.setStatus(HttpServletRe... |
### Question:
StreamFile extends DfsServlet { @Override @SuppressWarnings("unchecked") public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String path = ServletUtil.getDecodedPath(request, "/streamFile"); final String rawPath = ServletUtil.getRawPath(... |
### Question:
FileJournalManager implements JournalManager { @Override synchronized public void finalizeLogSegment(long firstTxId, long lastTxId) throws IOException { File inprogressFile = NNStorage.getInProgressEditsFile(sd, firstTxId); File dstFile = NNStorage.getFinalizedEditsFile( sd, firstTxId, lastTxId); LOG.info... |
### Question:
FileJournalManager implements JournalManager { public static List<EditLogFile> matchEditLogs(File logDir) throws IOException { return matchEditLogs(FileUtil.listFiles(logDir)); } FileJournalManager(StorageDirectory sd,
StorageErrorReporter errorReporter); @Override void close(); @Override void forma... |
### Question:
DirectoryScanner implements Runnable { DirectoryScanner(DataNode dn, FsDatasetSpi<?> dataset, Configuration conf) { this.datanode = dn; this.dataset = dataset; int interval = conf.getInt(DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY, DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_DEFAULT); scan... |
### Question:
ParseFilter { public static void registerFilter(String name, String filterClass) { if(LOG.isInfoEnabled()) LOG.info("Registering new filter " + name); filterHashMap.put(name, filterClass); } Filter parseFilterString(String filterString); Filter parseFilterString(byte [] filterStringAsByteArray); byte [] ... |
### Question:
BlockPoolManager { void refreshNamenodes(Configuration conf) throws IOException { LOG.info("Refresh request received for nameservices: " + conf.get(DFSConfigKeys.DFS_NAMESERVICES)); Map<String, Map<String, InetSocketAddress>> newAddressMap = DFSUtil.getNNServiceRpcAddresses(conf); synchronized (refreshNam... |
### Question:
ColumnCountGetFilter extends FilterBase { public ColumnCountGetFilter() { super(); } ColumnCountGetFilter(); ColumnCountGetFilter(final int n); int getLimit(); @Override boolean filterAllRemaining(); @Override ReturnCode filterKeyValue(KeyValue v); @Override void reset(); static Filter createFilterFromAr... |
### Question:
ColumnRangeFilter extends FilterBase { @Override public String toString() { return this.getClass().getSimpleName() + " " + (this.minColumnInclusive ? "[" : "(") + Bytes.toStringBinary(this.minColumn) + ", " + Bytes.toStringBinary(this.maxColumn) + (this.maxColumnInclusive ? "]" : ")"); } ColumnRangeFilter... |
### Question:
AuthFilter extends AuthenticationFilter { @Override protected Properties getConfiguration(String prefix, FilterConfig config) throws ServletException { final Properties p = super.getConfiguration(CONF_PREFIX, config); p.setProperty(AUTH_TYPE, UserGroupInformation.isSecurityEnabled()? KerberosAuthenticatio... |
### Question:
BlockReaderLocalLegacy implements BlockReader { @Override public synchronized int read(ByteBuffer buf) throws IOException { int nRead = 0; if (verifyChecksum) { if (slowReadBuff.hasRemaining()) { int fromSlowReadBuff = Math.min(buf.remaining(), slowReadBuff.remaining()); writeSlice(slowReadBuff, buf, from... |
### Question:
ColumnPrefixFilter extends FilterBase { public ColumnPrefixFilter() { super(); } ColumnPrefixFilter(); ColumnPrefixFilter(final byte [] prefix); byte[] getPrefix(); @Override ReturnCode filterKeyValue(KeyValue kv); ReturnCode filterColumn(byte[] buffer, int qualifierOffset, int qualifierLength); static F... |
### Question:
MultipleColumnPrefixFilter extends FilterBase { public MultipleColumnPrefixFilter() { super(); } MultipleColumnPrefixFilter(); MultipleColumnPrefixFilter(final byte [][] prefixes); byte [][] getPrefix(); @Override ReturnCode filterKeyValue(KeyValue kv); ReturnCode filterColumn(byte[] buffer, int qualifie... |
### Question:
LocalHBaseCluster { public LocalHBaseCluster(final Configuration conf) throws IOException { this(conf, DEFAULT_NO); } LocalHBaseCluster(final Configuration conf); LocalHBaseCluster(final Configuration conf, final int noRegionServers); LocalHBaseCluster(final Configuration conf, final int noMasters,
... |
### Question:
RunnableCallable implements Callable<Void>, Runnable { @Override public void run() { if (runnable != null) { runnable.run(); } else { try { callable.call(); } catch (Exception ex) { throw new RuntimeException(ex); } } } RunnableCallable(Runnable runnable); RunnableCallable(Callable<?> callable); @Overrid... |
### Question:
User { public abstract <T> T runAs(PrivilegedAction<T> action); UserGroupInformation getUGI(); String getName(); String[] getGroupNames(); abstract String getShortName(); abstract T runAs(PrivilegedAction<T> action); abstract T runAs(PrivilegedExceptionAction<T> action); abstract void obtainAuthTokenForJ... |
### Question:
User { public static User getCurrent() throws IOException { User user; if (IS_SECURE_HADOOP) { user = new SecureHadoopUser(); } else { user = new HadoopUser(); } if (user.getUGI() == null) { return null; } return user; } UserGroupInformation getUGI(); String getName(); String[] getGroupNames(); abstract ... |
### Question:
FileSystemAccessService extends BaseService implements FileSystemAccess { protected FileSystem createFileSystem(Configuration namenodeConf) throws IOException { String user = UserGroupInformation.getCurrentUser().getShortUserName(); CachedFileSystem newCachedFS = new CachedFileSystem(purgeTimeout); Cached... |
### Question:
ServerWebApp extends Server implements ServletContextListener { static String getHomeDir(String name) { String homeDir = HOME_DIR_TL.get(); if (homeDir == null) { String sysProp = name + HOME_DIR; homeDir = System.getProperty(sysProp); if (homeDir == null) { throw new IllegalArgumentException(MessageForma... |
### Question:
ServerWebApp extends Server implements ServletContextListener { public void contextInitialized(ServletContextEvent event) { try { init(); } catch (ServerException ex) { event.getServletContext().log("ERROR: " + ex.getMessage()); throw new RuntimeException(ex); } } protected ServerWebApp(String name, Stri... |
### Question:
ServerWebApp extends Server implements ServletContextListener { protected InetSocketAddress resolveAuthority() throws ServerException { String hostnameKey = getName() + HTTP_HOSTNAME; String portKey = getName() + HTTP_PORT; String host = System.getProperty(hostnameKey); String port = System.getProperty(po... |
### Question:
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public synchronized HServerAddress getServerAddress() { return new HServerAddress(serverAddress); } HServerInfo(); HServerInfo(final HServerAddress serverAddress, final int webuiport); HServerInfo(HServerAddress serverAdd... |
### Question:
Param { protected abstract T parse(String str) throws Exception; Param(String name, T defaultValue); String getName(); T parseParam(String str); T value(); String toString(); }### Answer:
@Test public void testShort() throws Exception { Param<Short> param = new ShortParam("S", (short) 1) { }; test(param,... |
### Question:
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { @Override public synchronized String toString() { return ServerName.getServerName(this.serverAddress.getHostnameAndPort(), this.startCode); } HServerInfo(); HServerInfo(final HServerAddress serverAddress, final int webuipo... |
### Question:
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public void readFields(DataInput in) throws IOException { super.readFields(in); this.serverAddress.readFields(in); this.startCode = in.readLong(); this.webuiport = in.readInt(); } HServerInfo(); HServerInfo(final HServerAd... |
### Question:
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public int compareTo(HServerInfo o) { int compare = this.serverAddress.compareTo(o.getServerAddress()); if (compare != 0) return compare; if (this.webuiport != o.getInfoPort()) return this.webuiport - o.getInfoPort(); if (t... |
### Question:
TableSplit extends InputSplit implements Writable, Comparable<TableSplit> { @Override public int hashCode() { int result = tableName != null ? Arrays.hashCode(tableName) : 0; result = 31 * result + (scan != null ? scan.hashCode() : 0); result = 31 * result + (startRow != null ? Arrays.hashCode(startRow) :... |
### Question:
LoadIncrementalHFiles extends Configured implements Tool { protected List<LoadQueueItem> splitStoreFile(final LoadQueueItem item, final HTable table, byte[] startKey, byte[] splitKey) throws IOException { final Path hfilePath = item.hfilePath; final Path tmpDir = new Path(item.hfilePath.getParent(), "_tmp... |
### Question:
LoadIncrementalHFiles extends Configured implements Tool { public static byte[][] inferBoundaries(TreeMap<byte[], Integer> bdryMap) { ArrayList<byte[]> keysArray = new ArrayList<byte[]>(); int runningValue = 0; byte[] currStartKey = null; boolean firstBoundary = true; for (Map.Entry<byte[], Integer> item:... |
### Question:
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentExcepti... |
### Question:
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }### Answer:
@Test public void testShouldThrowOnDuplicateIndex() { thrown.expect(ZeroCellException.class); thrown.e... |
### Question:
ConverterUtils { public static Object convertValueToType(Class<?> fieldType, String formattedValue, String columnName, int rowNum) { Object value = null; if (fieldType == String.class) { value = String.valueOf(formattedValue); } else if (fieldType == LocalDateTime.class) { return Converters.toLocalDateTim... |
### Question:
Reader { public static <T> String[] columnsOf(Class<T> clazz) { return ColumnInfo.columnsOf(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }### Answer:
@Test public void testShouldExtractColumns() { String[] columnNames = new String[] { "ID", "FIRST_NAME... |
### Question:
GlideFutures { public static <T> ListenableFuture<T> submit(final RequestBuilder<T> requestBuilder) { return transformFromTargetAndResult(submitInternal(requestBuilder)); } private GlideFutures(); static ListenableFuture<Void> submitAndExecute(
final RequestManager requestManager,
RequestBuil... |
### Question:
ReEncodingGifResourceEncoder implements ResourceEncoder<GifDrawable> { @NonNull @Override public EncodeStrategy getEncodeStrategy(@NonNull Options options) { Boolean encodeTransformation = options.get(ENCODE_TRANSFORMATION); return encodeTransformation != null && encodeTransformation ? EncodeStrategy.TRAN... |
### Question:
GifHeaderParser { @NonNull public GifHeader parseHeader() { if (rawData == null) { throw new IllegalStateException("You must call setData() before parseHeader()"); } if (err()) { return header; } readHeader(); if (!err()) { readContents(); if (header.frameCount < 0) { header.status = STATUS_FORMAT_ERROR; ... |
### Question:
DiskLruCache implements Closeable { public synchronized void close() throws IOException { if (journalWriter == null) { return; } for (Entry entry : new ArrayList<Entry>(lruEntries.values())) { if (entry.currentEditor != null) { entry.currentEditor.abort(); } } trimToSize(); closeWriter(journalWriter); jou... |
### Question:
DiskLruCache implements Closeable { public Editor edit(String key) throws IOException { return edit(key, ANY_SEQUENCE_NUMBER); } private DiskLruCache(File directory, int appVersion, int valueCount, long maxSize); static DiskLruCache open(File directory, int appVersion, int valueCount, long maxSize); sync... |
### Question:
DiskLruCache implements Closeable { public static DiskLruCache open(File directory, int appVersion, int valueCount, long maxSize) throws IOException { if (maxSize <= 0) { throw new IllegalArgumentException("maxSize <= 0"); } if (valueCount <= 0) { throw new IllegalArgumentException("valueCount <= 0"); } F... |
### Question:
DiskLruCache implements Closeable { public synchronized boolean remove(String key) throws IOException { checkNotClosed(); Entry entry = lruEntries.get(key); if (entry == null || entry.currentEditor != null) { return false; } for (int i = 0; i < valueCount; i++) { File file = entry.getCleanFile(i); if (fil... |
### Question:
DiskLruCache implements Closeable { public synchronized Value get(String key) throws IOException { checkNotClosed(); Entry entry = lruEntries.get(key); if (entry == null) { return null; } if (!entry.readable) { return null; } for (File file : entry.cleanFiles) { if (!file.exists()) { return null; } } redu... |
### Question:
CustomViewTarget implements Target<Z> { @NonNull public final T getView() { return view; } CustomViewTarget(@NonNull T view); @Override void onStart(); @Override void onStop(); @Override void onDestroy(); @SuppressWarnings("WeakerAccess") // Public API @NonNull final CustomViewTarget<T, Z> waitForLayout()... |
### Question:
CustomViewTarget implements Target<Z> { @Override @Nullable public final Request getRequest() { Object tag = getTag(); if (tag != null) { if (tag instanceof Request) { return (Request) tag; } else { throw new IllegalArgumentException("You must not pass non-R.id ids to setTag(id)"); } } return null; } Cust... |
### Question:
CustomViewTarget implements Target<Z> { @Override public final void onLoadCleared(@Nullable Drawable placeholder) { sizeDeterminer.clearCallbacksAndListener(); onResourceCleared(placeholder); if (!isClearedByUs) { maybeRemoveAttachStateListener(); } } CustomViewTarget(@NonNull T view); @Override void onSt... |
### Question:
ChromiumUrlFetcher implements DataFetcher<T>, ChromiumRequestSerializer.Listener { @Override public void cancel() { serializer.cancelRequest(url, this); } ChromiumUrlFetcher(
ChromiumRequestSerializer serializer, ByteBufferParser<T> parser, GlideUrl url); @Override void loadData(Priority priority, D... |
### Question:
PluginXmlHandler extends DefaultHandler { List<String> getSerializables() { return serializables; } @Override void startElement(String uri, String localName, String qName, Attributes attributes); @Override void endElement(String uri, String localName, String qName); }### Answer:
@Test public void test()... |
### Question:
Utils { public static long computeArraySUID(String name) { ByteArrayOutputStream bout = new ByteArrayOutputStream(); DataOutputStream dout = new DataOutputStream(bout); try { dout.writeUTF(name); dout.writeInt(Modifier.PUBLIC | Modifier.FINAL | Modifier.ABSTRACT); dout.flush(); } catch (IOException ex) { ... |
### Question:
ConfigDataId implements Serializable { @Override public String toString() { return contextUri + "|" + href; } ConfigDataId(String contextUri, String href); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); }### Answer:
@Test public void testToString() { assertEq... |
### Question:
ConfigDataId implements Serializable { @Override public int hashCode() { return toString().hashCode(); } ConfigDataId(String contextUri, String href); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); }### Answer:
@Test public void testHashCode() { assertEquals(... |
### Question:
ConfigDataId implements Serializable { @Override public boolean equals(Object obj) { if (obj instanceof ConfigDataId) { ConfigDataId other = (ConfigDataId)obj; return other.contextUri.equals(contextUri) && other.href.equals(href); } else { return false; } } ConfigDataId(String contextUri, String href); @O... |
### Question:
NacosServiceDiscovery { public List<ServiceInstance> getInstances(String serviceId) throws NacosException { String group = discoveryProperties.getGroup(); List<Instance> instances = namingService().selectInstances(serviceId, group, true); return hostToServiceInstanceList(instances, serviceId); } NacosServ... |
### Question:
AbstractHttpRequestMatcher implements HttpRequestMatcher { protected abstract String getToStringInfix(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); }### Answer:
@Test public abstract void testGetToStringInfix(); |
### Question:
ParamExpression extends AbstractNameValueExpression<String> { @Override protected boolean isCaseSensitiveName() { return true; } ParamExpression(String expression); }### Answer:
@Test public void testIsCaseSensitiveName() { Assert.assertTrue(createExpression("a=1").isCaseSensitiveName()); Assert.assertT... |
### Question:
DubboTransportedMethodMetadataResolver { public Map<DubboTransportedMethodMetadata, RestMethodMetadata> resolve( Class<?> targetType) { Set<DubboTransportedMethodMetadata> dubboTransportedMethodMetadataSet = resolveDubboTransportedMethodMetadataSet( targetType); Map<String, RestMethodMetadata> restMethodM... |
### Question:
ReactiveSentinelCircuitBreaker implements ReactiveCircuitBreaker { @Override public <T> Mono<T> run(Mono<T> toRun, Function<Throwable, Mono<T>> fallback) { Mono<T> toReturn = toRun.transform(new SentinelReactorTransformer<>( new EntryConfig(resourceName, entryType))); if (fallback != null) { toReturn = to... |
### Question:
SentinelCircuitBreaker implements CircuitBreaker { @Override public <T> T run(Supplier<T> toRun, Function<Throwable, T> fallback) { Entry entry = null; try { entry = SphU.entry(resourceName, entryType); return toRun.get(); } catch (BlockException ex) { return fallback.apply(ex); } catch (Exception ex) { T... |
### Question:
NacosServiceDiscovery { public List<String> getServices() throws NacosException { String group = discoveryProperties.getGroup(); ListView<String> services = namingService().getServicesOfServer(1, Integer.MAX_VALUE, group); return services.getData(); } NacosServiceDiscovery(NacosDiscoveryProperties discove... |
### Question:
ProduceMediaTypeExpression extends AbstractMediaTypeExpression { public final boolean match(List<MediaType> acceptedMediaTypes) { boolean match = matchMediaType(acceptedMediaTypes); return (!isNegated() ? match : !match); } ProduceMediaTypeExpression(String expression); ProduceMediaTypeExpression(MediaT... |
### Question:
AbstractNameValueExpression implements NameValueExpression<T> { @Override public int hashCode() { int result = (isCaseSensitiveName() ? this.name.hashCode() : this.name.toLowerCase().hashCode()); result = 31 * result + (this.value != null ? this.value.hashCode() : 0); result = 31 * result + (this.negated ... |
### Question:
AbstractMediaTypeExpression implements MediaTypeExpression, Comparable<AbstractMediaTypeExpression> { @Override public int hashCode() { return this.mediaType.hashCode(); } AbstractMediaTypeExpression(String expression); AbstractMediaTypeExpression(MediaType mediaType, boolean negated); @Override MediaTy... |
### Question:
AbstractMediaTypeExpression implements MediaTypeExpression, Comparable<AbstractMediaTypeExpression> { @Override public int compareTo(AbstractMediaTypeExpression other) { return MediaType.SPECIFICITY_COMPARATOR.compare(this.getMediaType(), other.getMediaType()); } AbstractMediaTypeExpression(String express... |
### Question:
HeaderExpression extends AbstractNameValueExpression<String> { @Override protected boolean isCaseSensitiveName() { return false; } HeaderExpression(String expression); }### Answer:
@Test public void testIsCaseSensitiveName() { Assert.assertFalse(createExpression("a=1").isCaseSensitiveName()); Assert.ass... |
### Question:
HttpRequestParamsMatcher extends AbstractHttpRequestMatcher { @Override public boolean match(HttpRequest request) { if (CollectionUtils.isEmpty(expressions)) { return true; } for (ParamExpression paramExpression : expressions) { if (paramExpression.match(request)) { return true; } } return false; } HttpRe... |
### Question:
ConsumeMediaTypeExpression extends AbstractMediaTypeExpression { public final boolean match(MediaType contentType) { boolean match = getMediaType().includes(contentType); return (!isNegated() ? match : !match); } ConsumeMediaTypeExpression(String expression); ConsumeMediaTypeExpression(MediaType mediaTy... |
### Question:
AbstractHttpRequestMatcher implements HttpRequestMatcher { protected abstract Collection<?> getContent(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); }### Answer:
@Test public abstract void testGetContent(); |
### Question:
TyrusClientEngine implements ClientEngine { @Override public UpgradeRequest createUpgradeRequest(TimeoutHandler timeoutHandler) { switch (clientEngineState) { case INIT: { ClientEndpointConfig config = (ClientEndpointConfig) endpointWrapper.getEndpointConfig(); this.timeoutHandler = timeoutHandler; client... |
### Question:
TyrusExtension implements Extension, Serializable { @Override public String toString() { final StringBuilder sb = new StringBuilder("TyrusExtension{"); sb.append("name='").append(name).append('\''); sb.append(", parameters=").append(parameters); sb.append('}'); return sb.toString(); } TyrusExtension(Strin... |
### Question:
TyrusRemoteEndpoint implements javax.websocket.RemoteEndpoint { public void close(CloseReason cr) { LOGGER.fine("Close public void close(CloseReason cr): " + cr); webSocket.close(cr); } private TyrusRemoteEndpoint(TyrusSession session, TyrusWebSocket socket, TyrusEndpointWrapper endpointWrapper); @Overri... |
### Question:
TyrusClientEngine implements ClientEngine { @Override public ClientUpgradeInfo processResponse(final UpgradeResponse upgradeResponse, final Writer writer, final Connection.CloseListener closeListener) { if (LOGGER.isLoggable(Level.FINE)) { debugContext.appendLogMessage(LOGGER, Level.FINE, DebugContext.Typ... |
### Question:
Credentials { public String getUsername() { return username; } Credentials(String username, byte[] password); Credentials(String username, String password); String getUsername(); byte[] getPassword(); String toString(); }### Answer:
@Test public void testGetUsername() throws Exception { Credentials cred... |
### Question:
TyrusSession implements Session, DistributedSession { @Override public String getId() { return id; } TyrusSession(WebSocketContainer container, TyrusWebSocket socket, TyrusEndpointWrapper endpointWrapper,
String subprotocol, List<Extension> extensions, boolean isSecure,
U... |
### Question:
TyrusSession implements Session, DistributedSession { @Override public Map<String, Object> getUserProperties() { return userProperties; } TyrusSession(WebSocketContainer container, TyrusWebSocket socket, TyrusEndpointWrapper endpointWrapper,
String subprotocol, List<Extension> extensions,... |
### Question:
Credentials { public byte[] getPassword() { return password; } Credentials(String username, byte[] password); Credentials(String username, String password); String getUsername(); byte[] getPassword(); String toString(); }### Answer:
@Test public void testGetPasswordString() throws Exception { Credential... |
### Question:
Utils { public static Date parseHttpDate(String stringValue) throws ParseException { SimpleDateFormat formatRfc1123 = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz"); try { return formatRfc1123.parse(stringValue); } catch (ParseException e) { SimpleDateFormat formatRfc1036 = new SimpleDateFormat("EE... |
### Question:
TyrusServerConfiguration implements ServerApplicationConfig { @Override public Set<Class<?>> getAnnotatedEndpointClasses(Set<Class<?>> scanned) { return Collections.unmodifiableSet(annotatedClasses); } TyrusServerConfiguration(Set<Class<?>> classes, Set<ServerEndpointConfig> serverEndpointConfigs); Tyrus... |
### Question:
SslFilter extends Filter { @Override synchronized void write(final ByteBuffer applicationData, final CompletionHandler<ByteBuffer> completionHandler) { switch (state) { case NOT_STARTED: { writeQueue.write(applicationData, completionHandler); return; } case HANDSHAKING: { completionHandler.failed(new Ille... |
### Question:
TyrusFuture implements Future<T> { @Override public T get() throws InterruptedException, ExecutionException { latch.await(); if (throwable != null) { throw new ExecutionException(throwable); } return result; } @Override boolean cancel(boolean mayInterruptIfRunning); @Override boolean isCancelled(); @Over... |
### Question:
TyrusFuture implements Future<T> { @Override public boolean isDone() { return (latch.getCount() == 0); } @Override boolean cancel(boolean mayInterruptIfRunning); @Override boolean isCancelled(); @Override boolean isDone(); @Override T get(); @Override T get(long timeout, TimeUnit unit); void setResult(T ... |
### Question:
TyrusExtension implements Extension, Serializable { @Override public String getName() { return name; } TyrusExtension(String name); TyrusExtension(String name, List<Parameter> parameters); @Override String getName(); @Override List<Parameter> getParameters(); @Override String toString(); @Override boolea... |
### Question:
AbstractDAO implements DAO<TInterface> { @Override @SuppressWarnings("unchecked") public TInterface get(UID uid) throws NoResultException { return (TInterface) this.getEntity(uid); } @Override void beginTransaction(); @Override void rollback(); @Override void setForRollback(); @Override boolean isSetForR... |
### Question:
AbstractDAO implements DAO<TInterface> { @Override public boolean exists(UID uid) { Class<? extends TEntity> entityClass = this.getEntityClass(); TEntity entity = Ebean.find(entityClass).where().eq("uid", uid.toString()).findOne(); return entity != null; } @Override void beginTransaction(); @Override voi... |
### Question:
AbstractDAOGenericInvoiceImpl extends AbstractDAO<TInterface, TEntity> implements AbstractDAOGenericInvoice<TInterface> { @SuppressWarnings("unchecked") @Override public TInterface getLatestInvoiceFromSeries(String series, String businessUID) { JPABusinessEntity business = this.queryBusiness(businessUID).... |
### Question:
PTFinancialValidator extends FinancialValidator { @Override public boolean isValid() { if (this.financialID.length() != 9 || !this.financialID.matches("\\d+")) { return false; } List<Character> firstDigits = Lists.charactersOf("123568"); boolean validFirstDigit = firstDigits .stream() .map(c -> financialI... |
### Question:
DAOSupplierImpl extends AbstractDAO<SupplierEntity, JPASupplierEntity> implements DAOSupplier { @Override public List<SupplierEntity> getAllActiveSuppliers() { return this.checkEntityList(this.querySupplier().active.eq(true).findList(), SupplierEntity.class); } @Override SupplierEntity getEntityInstance(... |
### Question:
DAOCustomerImpl extends AbstractDAO<CustomerEntity, JPACustomerEntity> implements DAOCustomer { @Override public List<CustomerEntity> getAllActiveCustomers() { return this.checkEntityList(this.queryCustomer().active.eq(true).findList(), CustomerEntity.class); } @Override List<CustomerEntity> getAllActive... |
### Question:
DAOProductImpl extends AbstractDAO<ProductEntity, JPAProductEntity> implements DAOProduct { @Override public List<ProductEntity> getAllActiveProducts() { return this.checkEntityList(this.queryProduct().active.eq(true).findList(), ProductEntity.class); } @Override List<ProductEntity> getAllActiveProducts(... |
### Question:
DAOTicketImpl extends AbstractDAO<TicketEntity, JPATicketEntity> implements DAOTicket { @Override public UID getObjectEntityUID(String ticketUID) throws NoResultException { JPATicketEntity ticket = this.queryTicket().uid.eq(ticketUID).findOne(); if (ticket == null) { throw new NoResultException(); } retur... |
### Question:
DAOInvoiceSeriesImpl extends AbstractDAO<InvoiceSeriesEntity, JPAInvoiceSeriesEntity> implements DAOInvoiceSeries { @Override public InvoiceSeriesEntity getSeries(String series, String businessUID, LockModeType lockMode) { QJPAInvoiceSeriesEntity querySeries = this.queryInvoiceSeries(series, businessUID);... |
### Question:
TempfileBufferedInputStream extends InputStream { @Override public int read() throws IOException { byte[] bytes = new byte[1]; int read = read(bytes); return (read > 0) ? bytes[0] & 0xff : -1; } TempfileBufferedInputStream(InputStream source); TempfileBufferedInputStream(InputStream source, int threshold... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.