method2testcases stringlengths 118 6.63k |
|---|
### Question:
StringUtils { public static String upperCase(String str) { if(isNullOrEmpty(str)) { return str; } return str.toUpperCase(LOCALE_ENGLISH); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(... |
### Question:
StringUtils { public static int compare(String str1, String str2) { if( str1 == null || str2 == null) { throw new IllegalArgumentException("Arguments cannot be null"); } Collator collator = Collator.getInstance(LOCALE_ENGLISH); return collator.compare(str1, str2); } static Integer toInteger(StringBuilder... |
### Question:
StringUtils { public static boolean beginsWithIgnoreCase(final String data, final String seq) { return data.regionMatches(true, 0, seq, 0, seq.length()); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static Str... |
### Question:
StringUtils { public static boolean hasValue(String str) { return !isNullOrEmpty(str); } static Integer toInteger(StringBuilder value); static String toString(StringBuilder value); static Boolean toBoolean(StringBuilder value); static String fromInteger(Integer value); static String fromLong(Long value);... |
### Question:
StringUtils { public static Character findFirstOccurrence(String s, char ...charsToMatch) { int lowestIndex = Integer.MAX_VALUE; for (char toMatch : charsToMatch) { int currentIndex = s.indexOf(toMatch); if (currentIndex != -1 && currentIndex < lowestIndex) { lowestIndex = currentIndex; } } return lowestI... |
### Question:
AsperaTransferManager { public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) { if(asperaTransferManagerConfig.isMultiSession()){ for(TransferSpec transferSpec : transferSpecs.transfer_specs) { transferSpec.setRemote_host(updateRemoteHost(transferSpec.getRemote_host())); } } } protecte... |
### Question:
AwsHostNameUtils { @Deprecated public static String parseServiceName(URI endpoint) { String host = endpoint.getHost(); if (!host.endsWith(".amazonaws.com")) { throw new IllegalArgumentException( "Cannot parse a service name from an unrecognized endpoint (" + host + ")."); } String serviceAndRegion = host.... |
### Question:
VersionInfoUtils { static String userAgent() { String ua = InternalConfig.Factory.getInternalConfig() .getUserAgentTemplate(); if (ua == null) { return "aws-sdk-java"; } ua = ua .replace("aws","ibm-cos") .replace("{platform}", StringUtils.lowerCase(getPlatform())) .replace("{version}", getVersion()) .repl... |
### Question:
XpathUtils { public static Document documentFrom(InputStream is) throws SAXException, IOException, ParserConfigurationException { is = new NamespaceRemovingInputStream(is); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); builde... |
### Question:
TransferListener extends ITransferListener { public synchronized void setStatus(String xferId, String sessionId, String status, long bytes) { log.trace("TransferListener.setStatus >> " + System.nanoTime() + ": " + new Exception().getStackTrace()[1].getClassName()); if(status.equals("INIT") && isNewSession... |
### Question:
AsperaTransferManagerBuilder { public AsperaTransferManager build() { AsperaTransferManager transferManager = new AsperaTransferManager(this.s3Client, this.tokenManager, this.asperaConfig, this.asperaTransferManagerConfig); return transferManager; } AsperaTransferManagerBuilder(String apiKey, AmazonS3 s3C... |
### Question:
UriResourcePathUtils { public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String qu... |
### Question:
AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRed... |
### Question:
AsperaFaspManagerWrapper { public boolean pause(final String xferId) { log.info("Pausing transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 4, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 4, 0); log.trace("Method [modifyTrans... |
### Question:
JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> { @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } JsonErrorUnmarshaller(Class<? extends AmazonServiceException> exceptionClass, String han... |
### Question:
AsperaFaspManagerWrapper { public boolean resume(final String xferId) { log.info("Resuming transfer with xferId [" + xferId + "]"); log.trace("Calling method [modifyTransfer] with parameters [\"" + xferId + "\", 5, 0]"); boolean rtn = faspmanager2.modifyTransfer(xferId, 5, 0); log.trace("Method [modifyTra... |
### Question:
AmazonWebServiceRequest implements Cloneable, ReadLimitInfo, HandlerContextAware { protected final <T extends AmazonWebServiceRequest> T copyBaseTo(T target) { if (customRequestHeaders != null) { for (Map.Entry<String, String> e : customRequestHeaders.entrySet()) target.putCustomRequestHeader(e.getKey(), ... |
### Question:
RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { public RetryPolicy getLegacyRetryPolicy() { return this.legacyRetryPolicy; } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); @Override long computeDelayBeforeNextRetry(RetryPolicyCo... |
### Question:
RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public long computeDelayBeforeNextRetry(RetryPolicyContext context) { return legacyRetryPolicy.getBackoffStrategy().delayBeforeNextRetry( (AmazonWebServiceRequest) context.originalRequest(), (AmazonClientException) ... |
### Question:
RetryPolicyAdapter implements com.ibm.cloud.objectstorage.retry.v2.RetryPolicy { @Override public boolean shouldRetry(RetryPolicyContext context) { return !maxRetriesExceeded(context) && isRetryable(context); } RetryPolicyAdapter(RetryPolicy legacyRetryPolicy, ClientConfiguration clientConfiguration); @Ov... |
### Question:
S3ErrorResponseHandler implements
HttpResponseHandler<AmazonServiceException> { @Override public AmazonServiceException handle(HttpResponse httpResponse) throws XMLStreamException { final AmazonServiceException exception = createException(httpResponse); exception.setHttpHeaders(httpResponse.getHea... |
### Question:
AsperaFaspManagerWrapper { public boolean cancel(final String xferId) { log.info("Cancel transfer with xferId [" + xferId + "]"); log.trace("Calling method [stopTransfer] with parameters [\"" + xferId + "\", 8, 0]"); boolean rtn = faspmanager2.stopTransfer(xferId); log.trace("Method [stopTransfer] returne... |
### Question:
AsperaFaspManagerWrapper { public boolean isRunning(final String xferId) { log.trace("Calling method [isRunning] with parameters [\"" + xferId + "\"]"); boolean rtn = faspmanager2.isRunning(xferId); log.trace("Method [isRunning] returned for xferId [\"" + xferId + "\"] with result: [" + rtn + "]"); return... |
### Question:
RetryUtils { @Deprecated public static boolean isThrottlingException(AmazonServiceException exception) { return isThrottlingException((SdkBaseException) exception); } @Deprecated static boolean isRetryableServiceException(AmazonServiceException exception); static boolean isRetryableServiceException(SdkBa... |
### Question:
AsperaFaspManagerWrapper { public boolean configureLogLocation(final String ascpLogPath) { log.trace("Calling method [configureLogLocation] with parameters [\"" + ascpLogPath + "\"]"); boolean rtn = faspmanager2.configureLogLocation(ascpLogPath); log.trace("Method [configureLogLocation] returned for ascpL... |
### Question:
AsperaLibraryLoader { public static JarFile createJar() throws IOException, URISyntaxException { URL location = faspmanager2.class.getProtectionDomain().getCodeSource().getLocation(); return new JarFile(new File(location.toURI())); } static String load(); static JarFile createJar(); static String jarVers... |
### Question:
SdkFilterInputStream extends FilterInputStream implements
MetricAware, Releasable { public void abort() { if (in instanceof SdkFilterInputStream) { ((SdkFilterInputStream) in).abort(); } aborted = true; } protected SdkFilterInputStream(InputStream in); @SdkProtectedApi InputStream getDelegateStre... |
### Question:
ConnectionUtils { public HttpURLConnection connectToEndpoint(URI endpoint, Map<String, String> headers) throws IOException { return connectToEndpoint(endpoint, headers, "GET"); } private ConnectionUtils(); static ConnectionUtils getInstance(); HttpURLConnection connectToEndpoint(URI endpoint, Map<String,... |
### Question:
AsperaLibraryLoader { public static List<String> osLibs() { String OS = System.getProperty("os.name").toLowerCase(); if (OS.indexOf("win") >= 0){ return WINDOWS_DYNAMIC_LIBS; } else if (OS.indexOf("mac") >= 0) { return MAC_DYNAMIC_LIBS; } else if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.ind... |
### Question:
AsperaTransactionImpl implements AsperaTransaction { @Override public boolean isDone() { return (doesStatusMatch(DONE)||doesStatusMatch(ERROR)||doesStatusMatch(STOP)||doesStatusMatch(ARGSTOP)); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transfer... |
### Question:
AsperaTransactionImpl implements AsperaTransaction { @Override public boolean progress() { return doesStatusMatch(PROGRESS); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); @Override boolean pau... |
### Question:
SDKGlobalConfiguration { public static boolean isCertCheckingDisabled() { return isPropertyEnabled(System.getProperty(DISABLE_CERT_CHECKING_SYSTEM_PROPERTY)); } @Deprecated static void setGlobalTimeOffset(int timeOffset); @Deprecated static int getGlobalTimeOffset(); static boolean isInRegionOptimizedMod... |
### Question:
AwsClientBuilder { public abstract TypeToBuild build(); protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory); @SdkTestInternalApi protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider); final AWSCr... |
### Question:
AsperaTransactionImpl implements AsperaTransaction { @Override public boolean onQueue() { return doesStatusMatch(QUEUED); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); @Override boolean pause(... |
### Question:
RegionMetadata { public Region getRegion(final String name) { return provider.getRegion(name); } RegionMetadata(final List<Region> regions); RegionMetadata(RegionMetadataProvider provider); List<Region> getRegions(); Region getRegion(final String name); List<Region> getRegionsForService(final String serv... |
### Question:
RegionMetadata { public List<Region> getRegionsForService(final String service) { return provider.getRegionsForService(service); } RegionMetadata(final List<Region> regions); RegionMetadata(RegionMetadataProvider provider); List<Region> getRegions(); Region getRegion(final String name); List<Region> getR... |
### Question:
RegionMetadata { @Deprecated public Region getRegionByEndpoint(final String endpoint) { return provider.getRegionByEndpoint(endpoint); } RegionMetadata(final List<Region> regions); RegionMetadata(RegionMetadataProvider provider); List<Region> getRegions(); Region getRegion(final String name); List<Region... |
### Question:
AsperaTransactionImpl implements AsperaTransaction { @Override public boolean pause() { return asperaFaspManagerWrapper.pause(xferid); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); @Override b... |
### Question:
DefaultTokenManager implements TokenManager { @Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } if (token == null) { token = retrieveTokenFromCache(); } if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } if (isTokenExpi... |
### Question:
DefaultTokenManager implements TokenManager { protected synchronized void retrieveToken() { log.debug("OAuthTokenManager.retrieveToken"); if (token == null || (Long.valueOf(token.getExpiration()) < System.currentTimeMillis() / 1000L)) { log.debug("Token is null, retrieving initial token from provider"); b... |
### Question:
DefaultTokenManager implements TokenManager { public static void addProxyConfig(HttpClientBuilder builder, HttpClientSettings settings) { if (settings.isProxyEnabled()) { log.info("Configuring Proxy. Proxy Host: " + settings.getProxyHost() + " " + "Proxy Port: " + settings.getProxyPort()); builder.setRout... |
### Question:
AsperaTransactionImpl implements AsperaTransaction { @Override public boolean resume() { return asperaFaspManagerWrapper.resume(xferid); } AsperaTransactionImpl(String xferid, String bucketName, String key, String fileName, TransferProgress transferProgress, ProgressListenerChain listenerChain); @Override... |
### Question:
IBMOAuthSigner extends AbstractAWSSigner { @Override public void sign(SignableRequest<?> request, AWSCredentials credentials) { log.debug("++ OAuth signer"); IBMOAuthCredentials oAuthCreds = (IBMOAuthCredentials)credentials; if (oAuthCreds.getTokenManager() instanceof DefaultTokenManager) { DefaultTokenMa... |
### Question:
BasicIBMOAuthCredentials implements IBMOAuthCredentials { @Override public TokenManager getTokenManager() { return tokenManager; } BasicIBMOAuthCredentials(String apiKey, String serviceInstanceId); BasicIBMOAuthCredentials(TokenManager tokenManager); BasicIBMOAuthCredentials(TokenManager tokenManager, S... |
### Question:
AWSCredentialsProviderChain implements AWSCredentialsProvider { public AWSCredentials getCredentials() { if (reuseLastProvider && lastUsedProvider != null) { return lastUsedProvider.getCredentials(); } for (AWSCredentialsProvider provider : credentialsProviders) { try { AWSCredentials credentials = provid... |
### Question:
JsonCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (jsonConfigFile == null) { synchronized (this) { if (jsonConfigFile == null) { jsonConfigFile = new JsonConfigFile(); lastRefreshed = System.nanoTime(); } } } long now = System.nanoTime(); lon... |
### Question:
JsonCredentialsProvider implements AWSCredentialsProvider { @Override public void refresh() { if (jsonConfigFile != null) { jsonConfigFile.refresh(); lastRefreshed = System.nanoTime(); } } JsonCredentialsProvider(); JsonCredentialsProvider(String jsonConfigFilePath); JsonCredentialsProvider(JsonConfigFi... |
### Question:
ContainerCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return credentialsFetcher.getCredentials(); } ContainerCredentialsProvider(); @SdkInternalApi ContainerCredentialsProvider(CredentialsEndpointProvider credentailsEndpointProvider); @Overrid... |
### Question:
AsperaTransactionImpl implements AsperaTransaction { @Override public boolean cancel() { if (asperaFaspManagerWrapper.cancel(xferid)) { transferListener.removeAllTransactionSessions(xferid); return true; } else { return false; } } AsperaTransactionImpl(String xferid, String bucketName, String key, String ... |
### Question:
ContainerCredentialsFetcher extends BaseCredentialsFetcher { @Override public String toString() { return "ContainerCredentialsFetcher"; } ContainerCredentialsFetcher(CredentialsEndpointProvider credentialsEndpointProvider); @Override String toString(); }### Answer:
@Test public void testNoMetadataService... |
### Question:
AmazonWebServiceClient { public String getServiceName() { return getServiceNameIntern(); } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector); @SdkProtectedApi protecte... |
### Question:
AmazonWebServiceClient { @Deprecated protected Signer getSigner() { return signerProvider.getSigner(SignerProviderContext.builder().build()); } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(ClientConfiguration clientConfiguration,
RequestMetricCollect... |
### Question:
AmazonWebServiceClient { public final void setServiceNameIntern(String serviceName) { if (serviceName == null) throw new IllegalArgumentException( "The parameter serviceName must be specified!"); this.serviceName = serviceName; } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebS... |
### Question:
AmazonWebServiceClient { protected void setEndpointPrefix(String endpointPrefix) { if (endpointPrefix == null) { throw new IllegalArgumentException( "The parameter endpointPrefix must be specified!"); } this.endpointPrefix = endpointPrefix; } AmazonWebServiceClient(ClientConfiguration clientConfiguration)... |
### Question:
AmazonWebServiceClient { public void shutdown() { client.shutdown(); } AmazonWebServiceClient(ClientConfiguration clientConfiguration); AmazonWebServiceClient(ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector); @SdkProtectedApi protected AmazonWebServiceC... |
### Question:
DelegatingDnsResolver implements DnsResolver { @Override public InetAddress[] resolve(String host) throws UnknownHostException { return delegate.resolve(host); } DelegatingDnsResolver(com.ibm.cloud.objectstorage.DnsResolver delegate); @Override InetAddress[] resolve(String host); }### Answer:
@Test publi... |
### Question:
CompleteMultipartUpload implements Callable<UploadResult> { @Override public UploadResult call() throws Exception { CompleteMultipartUploadResult res; try { CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest( origReq.getBucketName(), origReq.getKey(), uploadId, collectPartETags()) .wi... |
### Question:
CompleteMultipartCopy implements Callable<CopyResult> { @Override public CopyResult call() throws Exception { CompleteMultipartUploadResult res; try { CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest( origReq.getDestinationBucketName(), origReq.getDestinationKey(), uploadId, collect... |
### Question:
RouteSimilarity { public RouteSimilarity(RouteData routeData, String currentRoute) { this.route = routeData.getNavigationTarget(); this.routeData = routeData; int urlSimilarity = calculateSimilarity(routeData.getUrl(), currentRoute); int routeAliasSimilarity = routeData.getRouteAliases().stream().map(rout... |
### Question:
RouteSimilarity { public String getRouteString() { return routeString; } RouteSimilarity(RouteData routeData, String currentRoute); RouteSimilarity(String url, String currentRouteParts); RouteData getRouteData(); Class<? extends Component> getRoute(); String getRouteString(); int getSimilarity(); }### A... |
### Question:
UpNavigationHelper implements Serializable { public static Optional<RouteSimilarity> getClosestRoute(String url, String[] availableRoutes) { if (url.lastIndexOf("/") > 0) { Optional<RouteSimilarity> result = Arrays.stream(availableRoutes) .filter(routeData -> !routeData.equals(url)) .map(routeData -> new ... |
### Question:
EventDateComparator implements Comparator<EventAdapter.Item> { @Override public int compare(EventAdapter.Item event1, EventAdapter.Item event2) { if (event1.getEvent().getStart() == null) { if (event2.getEvent().getStart() == null) { return 0; } else { return 1; } } else if (event2.getEvent().getStart() =... |
### Question:
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public HandlerResult authenticate(final Credential credential) throws GeneralSecurityException, PreventedException { try { if (this.legacyHandler.authenticate(credentialsAdapter.convert(credential))) { final CredentialMetaData... |
### Question:
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public boolean supports(final Credential credential) { return this.legacyHandler.supports(credentialsAdapter.convert(credential)); } LegacyAuthenticationHandlerAdapter(final org.jasig.cas.authentication.handler.AuthenticationH... |
### Question:
LegacyAuthenticationHandlerAdapter implements AuthenticationHandler { @Override public String getName() { if (this.legacyHandler instanceof NamedAuthenticationHandler) { return ((NamedAuthenticationHandler) this.legacyHandler).getName(); } else { return this.legacyHandler.getClass().getSimpleName(); } } L... |
### Question:
SmartOpenIdController extends DelegateController implements Serializable { @Override public boolean canHandle(final HttpServletRequest request, final HttpServletResponse response) { final String openIdMode = request.getParameter(OpenIdConstants.OPENID_MODE); if (StringUtils.equals(openIdMode, OpenIdConsta... |
### Question:
SmartOpenIdController extends DelegateController implements Serializable { public Map<String, String> getAssociationResponse(final HttpServletRequest request) { final ParameterList parameters = new ParameterList(request.getParameterMap()); final String mode = parameters.hasParameter(OpenIdConstants.OPENID... |
### Question:
CompositionBundle implements Bundle { private static Function composition(Context context) { return args -> { final Composition composition; switch (args.length) { case 0: composition = new Composition(); break; case 1: double frameRate = args[0].asDouble(); composition = new Composition(frameRate); break... |
### Question:
HotaruLexer extends Lexer { private Token tokenizeText(char openChar) { next(); clearBuffer(); int startPos = getPos() - 1; char current = peek(0); while (true) { if (current == '\\') { final var buffer = getBuffer(); current = next(); if (current == openChar) { current = next(); buffer.append(openChar); ... |
### Question:
InterpreterVisitor implements ResultVisitor<Value, Context> { @Override public Value get(AccessNode node, Context context) { Value container = node.root.accept(this, context); return getContainer(node.indices, context, container) .orElseThrow(() -> new TypeException("Unable to get property from non-access... |
### Question:
Composition { public int getVirtualWidth() { return virtualWidth; } Composition(); Composition(double frameRate); Composition(int sceneWidth, int sceneHeight); Composition(int sceneWidth, int sceneHeight, double frameRate); Composition(int sceneWidth, int sceneHeight, double frameRate, Paint backgroun... |
### Question:
CGLibProxy implements MethodInterceptor { public <T> T proxy(Class<T> clazz, Object shadowObject) { if (!ArgumentsUtils.hasNoArgumentsConstructor(clazz)) { Class[] argTypes = ArgumentsUtils.getConstructorsArgumensTypes(clazz); Object[] args = ArgumentsUtils.getArgumens(argTypes); return proxy(clazz, shado... |
### Question:
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = find... |
### Question:
KbSqlParser { protected static int getBindArgsCount(String sql) { Set<Expression> expressionSet = findBindArgsExpressions(sql); int count = 0; for (Expression expression : expressionSet) { count += getBindArgsCount(expression); } return count; } static String bindArgs(String sql, @Nullable Object[] bindA... |
### Question:
KbSqlParser { protected static Set<Expression> findBindArgsExpressions(String sql) { if (sql == null || sql.startsWith("PRAGMA") || !sql.contains("?")) { return new LinkedHashSet<>(); } KbSqlParserManager pm = new KbSqlParserManager(); try { Statement statement = pm.parse(sql); Set<Expression> expressionS... |
### Question:
ShadowContext implements Shadow { public File getFilesDir() { return getAndCreateDir("build/files/"); } ShadowContext(Resources resources); ShadowContext(Resources resources, ShadowResources shadowResources); @NonNull final String getString(@StringRes int resId); Resources getResources(); SharedPreferenc... |
### Question:
ShadowResources { public String getString(@StringRes int id) throws NotFoundException { return getText(id).toString(); } ShadowResources(); int getColor(@ColorRes int id); int getColor(@ColorRes int id, @Nullable Resources.Theme theme); String getString(@StringRes int id); @NonNull String[] getStringArray... |
### Question:
ShadowResources { @NonNull public String[] getStringArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getIdTable(R_ARRAY); Map<String, List<String>> stringArrayMap = getResourceStringArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (stringA... |
### Question:
ShadowResources { public int getColor(@ColorRes int id) throws NotFoundException { return getColor(id, null); } ShadowResources(); int getColor(@ColorRes int id); int getColor(@ColorRes int id, @Nullable Resources.Theme theme); String getString(@StringRes int id); @NonNull String[] getStringArray(@ArrayRe... |
### Question:
ShadowResources { @NonNull public int[] getIntArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getIdTable(R_ARRAY); Map<String, List<Integer>> intArrayMap = getResourceIntArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (intArrayMap.contai... |
### Question:
ShadowResources { public String getPackageName() { if (!TextUtils.isEmpty(mPackageName)) { return mPackageName; } String manifestPath = null; List<String> manifestPaths = Arrays.asList( "build/intermediates/manifests/aapt/debug/AndroidManifest.xml", "build/intermediates/manifests/aapt/release/AndroidManif... |
### Question:
ReflectUtils { public static Object invokeStatic(String className, String methodName, Object... arguments) { try { Class clazz = Class.forName(className); return invokeStatic(clazz, methodName, arguments); } catch (ClassNotFoundException e) { e.printStackTrace(); } return null; } static boolean hasClass(... |
### Question:
FileUtils { public static boolean deleteDir(File dir) { if (dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { boolean success = deleteDir(new File(dir, children[i])); if (!success) { return false; } } } return dir.delete(); } static boolean deleteDir(File di... |
### Question:
ArgumentsUtils { public static Class[] getConstructorsArgumensTypes(Class clazz) { Constructor[] constructors = getNotPrivateConstructors(clazz); if (constructors == null || constructors.length == 0) { return new Class[0]; } return constructors[0].getParameterTypes(); } static Class[] getConstructorsArgu... |
### Question:
ShadowCursor implements Cursor { protected Object getObject(int columnIndex, Object defaultValue) { Object value = getObject(columnIndex); if (value == null) { return defaultValue; } return value; } ShadowCursor(List<String> colums, List<List<Object>> datas); @Override int getCount(); @Override int getPos... |
### Question:
ShadowCursor implements Cursor { @Override public String getString(int columnIndex) { Object value = getObject(columnIndex); return value == null ? null : value.toString(); } ShadowCursor(List<String> colums, List<List<Object>> datas); @Override int getCount(); @Override int getPosition(); @Override boole... |
### Question:
XMLUtils { public static Document stringToDoc(String str) throws IOException { if (StringUtils.isNotEmpty(str)) { try { Reader reader = new StringReader(str); DocumentBuilder db = DocumentBuilderFactory.newInstance() .newDocumentBuilder(); Document doc = db.parse(new InputSource(reader)); reader.close(); ... |
### Question:
JMXFactory { public String getDomain() { return domain; } static ObjectName createMBean(String className, String attributes); static ObjectName createObjectName(String... strings); static ObjectName createSimpleMBean(String className,
String objectNameStr); static String getDefaultDomain(); static MBe... |
### Question:
JMXFactory { public static MBeanServer getMBeanServer() { return mbs; } static ObjectName createMBean(String className, String attributes); static ObjectName createObjectName(String... strings); static ObjectName createSimpleMBean(String className,
String objectNameStr); static String getDefaultDomain... |
### Question:
JMXFactory { public void setDomain(String domain) { JMXFactory.domain = domain; } static ObjectName createMBean(String className, String attributes); static ObjectName createObjectName(String... strings); static ObjectName createSimpleMBean(String className,
String objectNameStr); static String getDef... |
### Question:
ClientRegistry implements IClientRegistry, ClientRegistryMBean { public IClient newClient(Object[] params) throws ClientNotFoundException, ClientRejectedException { String id = nextId(); IClient client = new Client(id, this); addClient(id, client); return client; } ClientRegistry(); ClientRegistry(String... |
### Question:
ClientRegistry implements IClientRegistry, ClientRegistryMBean { protected void addClient(IClient client) { addClient(client.getId(), client); } ClientRegistry(); ClientRegistry(String name); Client getClient(String id); ClientList<Client> getClientList(); boolean hasClient(String id); IClient lookupClie... |
### Question:
ClientRegistry implements IClientRegistry, ClientRegistryMBean { public IClient lookupClient(String id) throws ClientNotFoundException { return getClient(id); } ClientRegistry(); ClientRegistry(String name); Client getClient(String id); ClientList<Client> getClientList(); boolean hasClient(String id); IC... |
### Question:
ClientRegistry implements IClientRegistry, ClientRegistryMBean { public Client getClient(String id) throws ClientNotFoundException { final Client result = (Client) clients.get(id); if (result == null) { throw new ClientNotFoundException(id); } return result; } ClientRegistry(); ClientRegistry(String name... |
### Question:
ClientRegistry implements IClientRegistry, ClientRegistryMBean { public ClientList<Client> getClientList() { ClientList<Client> list = new ClientList<Client>(); for (IClient c : clients.values()) { list.add((Client) c); } return list; } ClientRegistry(); ClientRegistry(String name); Client getClient(Stri... |
### Question:
ClientRegistry implements IClientRegistry, ClientRegistryMBean { @SuppressWarnings("unchecked") protected Collection<IClient> getClients() { if (!hasClients()) { return Collections.EMPTY_SET; } return Collections.unmodifiableCollection(clients.values()); } ClientRegistry(); ClientRegistry(String name); C... |
### Question:
ClientRegistry implements IClientRegistry, ClientRegistryMBean { protected void removeClient(IClient client) { clients.remove(client.getId()); } ClientRegistry(); ClientRegistry(String name); Client getClient(String id); ClientList<Client> getClientList(); boolean hasClient(String id); IClient lookupClie... |
### Question:
XMLUtils { public static String docToString(Document dom) { return XMLUtils.docToString1(dom); } static Document stringToDoc(String str); static String docToString(Document dom); static String docToString1(Document dom); static String docToString2(Document domDoc); }### Answer:
@Test @Ignore public void... |
### Question:
StreamUtils { public static IServerStream createServerStream(IScope scope, String name) { logger.debug("Creating server stream: {} scope: {}", name, scope); ServerStream stream = new ServerStream(); stream.setScope(scope); stream.setName(name); stream.setPublishedName(name); String key = scope.getName() +... |
### Question:
StreamUtils { public static IServerStream getServerStream(IScope scope, String name) { logger.debug("Looking up server stream: {} scope: {}", name, scope); String key = scope.getName() + '/' + name; if (serverStreamMap.containsKey(key)) { return serverStreamMap.get(key); } else { logger.warn("Server strea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.