method2testcases
stringlengths
118
3.08k
### Question: RedisList extends Commands { public long insertBefore(String key, String pivot, String value) { return getJedis().linsert(key, BinaryClient.LIST_POSITION.BEFORE, pivot, value); } private RedisList(); synchronized static RedisList getInstance(); long rPush(String key, String... values); long lPush(String ...
### Question: RedisList extends Commands { public List<String> range(String key, long start, long end) { logger.debug("Get range: [" + key + "] form " + start + " to " + end); return getJedis().lrange(key, start, end); } private RedisList(); synchronized static RedisList getInstance(); long rPush(String key, String......
### Question: RedisList extends Commands { public long remove(String key, long count, String value) { return getJedis().lrem(key, count, value); } private RedisList(); synchronized static RedisList getInstance(); long rPush(String key, String... values); long lPush(String key, String... values); long lPushX(String key...
### Question: RedisList extends Commands { public String trim(String key, long start, long end) { return getJedis().ltrim(key, start, end); } private RedisList(); synchronized static RedisList getInstance(); long rPush(String key, String... values); long lPush(String key, String... values); long lPushX(String key, Str...
### Question: RedisList extends Commands { public String index(String key, long index) { return getJedis().lindex(key, index); } private RedisList(); synchronized static RedisList getInstance(); long rPush(String key, String... values); long lPush(String key, String... values); long lPushX(String key, String... value)...
### Question: RedisSet extends Commands { public Long save(String key, String... member) { return getJedis().sadd(key, member); } private RedisSet(); synchronized static RedisSet getInstance(); Long save(String key, String... member); Long remove(String key, String... members); Set<String> getMembersSet(String key); S...
### Question: RedisSet extends Commands { public Long remove(String key, String... members) { return getJedis().srem(key, members); } private RedisSet(); synchronized static RedisSet getInstance(); Long save(String key, String... member); Long remove(String key, String... members); Set<String> getMembersSet(String key...
### Question: RedisSet extends Commands { public Set<String> getMembersSet(String key) { return getJedis().smembers(key); } private RedisSet(); synchronized static RedisSet getInstance(); Long save(String key, String... member); Long remove(String key, String... members); Set<String> getMembersSet(String key); String ...
### Question: PropertyFile { public static String update(String key,String value) throws ReadConfigException { String result; try { props = getProperties(Configs.PROPERTY_FILE); OutputStream fos = new FileOutputStream(Configs.PROPERTY_FILE); result = (String)props.replace(key,value); props.store(fos, "Update '" + key +...
### Question: RedisSet extends Commands { public String pop(String key) { return getJedis().spop(key); } private RedisSet(); synchronized static RedisSet getInstance(); Long save(String key, String... member); Long remove(String key, String... members); Set<String> getMembersSet(String key); String pop(String key); Se...
### Question: RedisSet extends Commands { public boolean contain(String key, String member) { return getJedis().sismember(key, member); } private RedisSet(); synchronized static RedisSet getInstance(); Long save(String key, String... member); Long remove(String key, String... members); Set<String> getMembersSet(String...
### Question: RedisSet extends Commands { public String randomMember(String key) { return getJedis().srandmember(key); } private RedisSet(); synchronized static RedisSet getInstance(); Long save(String key, String... member); Long remove(String key, String... members); Set<String> getMembersSet(String key); String pop...
### Question: RedisSet extends Commands { public Set<String> inter(String... keys) { return getJedis().sinter(keys); } private RedisSet(); synchronized static RedisSet getInstance(); Long save(String key, String... member); Long remove(String key, String... members); Set<String> getMembersSet(String key); String pop(S...
### Question: RedisSet extends Commands { public Long interStore(String key, String... keys) { return getJedis().sinterstore(key, keys); } private RedisSet(); synchronized static RedisSet getInstance(); Long save(String key, String... member); Long remove(String key, String... members); Set<String> getMembersSet(Strin...
### Question: RedisSet extends Commands { public Set<String> union(String... keys) { return getJedis().sunion(keys); } private RedisSet(); synchronized static RedisSet getInstance(); Long save(String key, String... member); Long remove(String key, String... members); Set<String> getMembersSet(String key); String pop(S...
### Question: RedisSet extends Commands { public Long unionStore(String key, String... keys) { return getJedis().sunionstore(key, keys); } private RedisSet(); synchronized static RedisSet getInstance(); Long save(String key, String... member); Long remove(String key, String... members); Set<String> getMembersSet(Strin...
### Question: RedisSet extends Commands { public Set<String> diff(String... keys) { return getJedis().sdiff(keys); } private RedisSet(); synchronized static RedisSet getInstance(); Long save(String key, String... member); Long remove(String key, String... members); Set<String> getMembersSet(String key); String pop(Str...
### Question: RedisSet extends Commands { public Long diffStore(String key, String... keys) { return getJedis().sdiffstore(key, keys); } private RedisSet(); synchronized static RedisSet getInstance(); Long save(String key, String... member); Long remove(String key, String... members); Set<String> getMembersSet(String ...
### Question: RedisSet extends Commands { public Long moveMember(String fromKey, String toKey, String member) { return getJedis().smove(fromKey, toKey, member); } private RedisSet(); synchronized static RedisSet getInstance(); Long save(String key, String... member); Long remove(String key, String... members); Set<Str...
### Question: PropertyFile { public static int getMaxId() throws ReadConfigException { String maxId; try { props = getProperties(Configs.PROPERTY_FILE); maxId = props.getString(Configs.MAX_POOL_ID); if (maxId == null) { save(Configs.MAX_POOL_ID, Configs.START_ID + ""); props = getProperties(Configs.PROPERTY_FILE); maxI...
### Question: RedisSortSet extends Commands { public Long save(String key, Double score, String member) { return getJedis().zadd(key, score, member); } private RedisSortSet(); synchronized static RedisSortSet getInstance(); Long save(String key, Double score, String member); Long index(String key, String member); Doub...
### Question: RedisSortSet extends Commands { public Long index(String key, String member) { return getJedis().zrank(key, member); } private RedisSortSet(); synchronized static RedisSortSet getInstance(); Long save(String key, Double score, String member); Long index(String key, String member); Double score(String key...
### Question: RedisSortSet extends Commands { public Double score(String key, String member) { return getJedis().zscore(key, member); } private RedisSortSet(); synchronized static RedisSortSet getInstance(); Long save(String key, Double score, String member); Long index(String key, String member); Double score(String ...
### Question: RedisSortSet extends Commands { public Long rank(String key, String member) { return getJedis().zrevrank(key, member); } private RedisSortSet(); synchronized static RedisSortSet getInstance(); Long save(String key, Double score, String member); Long index(String key, String member); Double score(String k...
### Question: RedisSortSet extends Commands { public Set<String> rangeByIndex(String key, long start, long end) { return getJedis().zrevrange(key, start, end); } private RedisSortSet(); synchronized static RedisSortSet getInstance(); Long save(String key, Double score, String member); Long index(String key, String mem...
### Question: RedisSortSet extends Commands { public Set<String> rangeByScore(String key, Double min, Double max) { return getJedis().zrevrangeByScore(key, max, min); } private RedisSortSet(); synchronized static RedisSortSet getInstance(); Long save(String key, Double score, String member); Long index(String key, Str...
### Question: RedisSortSet extends Commands { public Long interStore(String desKey, String... fromKey) { return getJedis().zinterstore(desKey, fromKey); } private RedisSortSet(); synchronized static RedisSortSet getInstance(); Long save(String key, Double score, String member); Long index(String key, String member); D...
### Question: RedisSortSet extends Commands { public Double increase(String key, Double score, String member) { return getJedis().zincrby(key, score, member); } private RedisSortSet(); synchronized static RedisSortSet getInstance(); Long save(String key, Double score, String member); Long index(String key, String memb...
### Question: RedisSortSet extends Commands { public Long remove(String key, String... value) { return getJedis().zrem(key, value); } private RedisSortSet(); synchronized static RedisSortSet getInstance(); Long save(String key, Double score, String member); Long index(String key, String member); Double score(String ke...
### Question: RedisSortSet extends Commands { public Long removeByRank(String key, long start, long end) { return getJedis().zremrangeByRank(key, start, end); } private RedisSortSet(); synchronized static RedisSortSet getInstance(); Long save(String key, Double score, String member); Long index(String key, String memb...
### Question: PropertyFile { public static Map<String,RedisPoolProperty> getAllPoolConfig() throws ReadConfigException { Map<String,RedisPoolProperty> map = new HashMap<>(); int maxId; try { maxId = getMaxId(); props = getProperties(Configs.PROPERTY_FILE); } catch (IOException e) { e.printStackTrace(); logger.error(Exc...
### Question: RedisSortSet extends Commands { public Long removeByScore(String key, Double min, Double max) { return getJedis().zremrangeByScore(key, min, max); } private RedisSortSet(); synchronized static RedisSortSet getInstance(); Long save(String key, Double score, String member); Long index(String key, String me...
### Question: RedisSortSet extends Commands { public Long size(String key) { return getJedis().zcard(key); } private RedisSortSet(); synchronized static RedisSortSet getInstance(); Long save(String key, Double score, String member); Long index(String key, String member); Double score(String key, String member); Long r...
### Question: RedisSortSet extends Commands { public Long count(String key, double min, double max) { return getJedis().zcount(key, min, max); } private RedisSortSet(); synchronized static RedisSortSet getInstance(); Long save(String key, Double score, String member); Long index(String key, String member); Double scor...
### Question: RedisKey extends Commands { public String set(String key, String value) { return getJedis().set(key, value); } private RedisKey(); synchronized static RedisKey getInstance(); String get(String key); String set(String key, String value); byte[] dump(String key); Long setExpire(String key, int second, Stri...
### Question: RedisKey extends Commands { public String get(String key) { Jedis jedis = getJedis(); if ("string".equals(jedis.type(key))) { return jedis.get(key); } else { logger.error(ExceptionInfo.KEY_TYPE_NOT_STRING + " and type is " + jedis.type(key)); return null; } } private RedisKey(); synchronized static Redis...
### Question: RedisKey extends Commands { public byte[] dump(String key) { return getJedis().dump(key); } private RedisKey(); synchronized static RedisKey getInstance(); String get(String key); String set(String key, String value); byte[] dump(String key); Long setExpire(String key, int second, String value); String s...
### Question: RedisKey extends Commands { public Long setExpire(String key, int second, String value) { Jedis jedis = getJedis(); jedis.set(key, value); return expire(key, second); } private RedisKey(); synchronized static RedisKey getInstance(); String get(String key); String set(String key, String value); byte[] dum...
### Question: RedisKey extends Commands { public String setExpireMs(String key, long second, String value) { return getJedis().psetex(key, second, value); } private RedisKey(); synchronized static RedisKey getInstance(); String get(String key); String set(String key, String value); byte[] dump(String key); Long setExp...
### Question: PoolManagement { public String createRedisPool(RedisPoolProperty property) throws Exception { int maxId = PropertyFile.getMaxId(); maxId++; property.setPoolId(maxId + ""); Map<String, ?> map = MythReflect.getFieldsValue(property); for (String key : map.keySet()) { PropertyFile.save(maxId + Configs.SEPARAT...
### Question: RedisKey extends Commands { public long increaseKey(String key) throws TypeErrorException { checkIntValue(key); return getJedis().incr(key); } private RedisKey(); synchronized static RedisKey getInstance(); String get(String key); String set(String key, String value); byte[] dump(String key); Long setExp...
### Question: RedisKey extends Commands { public long decreaseKey(String key) throws TypeErrorException { checkIntValue(key); return getJedis().decr(key); } private RedisKey(); synchronized static RedisKey getInstance(); String get(String key); String set(String key, String value); byte[] dump(String key); Long setExp...
### Question: RedisKey extends Commands { public long append(String key, String value) { return getJedis().append(key, value); } private RedisKey(); synchronized static RedisKey getInstance(); String get(String key); String set(String key, String value); byte[] dump(String key); Long setExpire(String key, int second, ...
### Question: RedisKey extends Commands { public List<String> getMultiKeys(String... keys) { return getJedis().mget(keys); } private RedisKey(); synchronized static RedisKey getInstance(); String get(String key); String set(String key, String value); byte[] dump(String key); Long setExpire(String key, int second, Stri...
### Question: RedisKey extends Commands { public String setMultiKey(String... keys) { return getJedis().mset(keys); } private RedisKey(); synchronized static RedisKey getInstance(); String get(String key); String set(String key, String value); byte[] dump(String key); Long setExpire(String key, int second, String valu...
### Question: RedisKey extends Commands { public String getEncoding(String key) { return getJedis().objectEncoding(key); } private RedisKey(); synchronized static RedisKey getInstance(); String get(String key); String set(String key, String value); byte[] dump(String key); Long setExpire(String key, int second, String...
### Question: RedisKey extends Commands { public Set<String> listAllKeys(int db) { logger.debug("RedisKey Management:" + this.getPools()); setDb(db); return getJedis().keys("*"); } private RedisKey(); synchronized static RedisKey getInstance(); String get(String key); String set(String key, String value); byte[] dump(...
### Question: RedisHash extends Commands { public Long save(String key, String member, String value) { return getJedis().hset(key, member, value); } private RedisHash(); synchronized static RedisHash getInstance(); Long save(String key, String member, String value); String save(String key, Map<String, String> map); Lo...
### Question: PoolManagement { public RedisPools createRedisPoolAndConnection(RedisPoolProperty property) throws Exception { return getRedisPool(createRedisPool(property)); } private PoolManagement(); synchronized static PoolManagement getInstance(); RedisPools getRedisPool(); RedisPools getRedisPool(String poolId); R...
### Question: RedisHash extends Commands { public Long saveWhenNotExist(String key, String member, String value) { return getJedis().hsetnx(key, member, value); } private RedisHash(); synchronized static RedisHash getInstance(); Long save(String key, String member, String value); String save(String key, Map<String, St...
### Question: RedisHash extends Commands { public String get(String key, String member) { return getJedis().hget(key, member); } private RedisHash(); synchronized static RedisHash getInstance(); Long save(String key, String member, String value); String save(String key, Map<String, String> map); Long saveWhenNotExist(...
### Question: RedisHash extends Commands { public Set<String> getMembers(String key) { return getJedis().hkeys(key); } private RedisHash(); synchronized static RedisHash getInstance(); Long save(String key, String member, String value); String save(String key, Map<String, String> map); Long saveWhenNotExist(String key...
### Question: RedisHash extends Commands { public List<String> getValues(String key) { return getJedis().hvals(key); } private RedisHash(); synchronized static RedisHash getInstance(); Long save(String key, String member, String value); String save(String key, Map<String, String> map); Long saveWhenNotExist(String key...
### Question: RedisHash extends Commands { public Long increase(String key, String member, long value) throws TypeErrorException { Long result; try { result = getJedis().hincrBy(key, member, value); } catch (Exception e) { throw new TypeErrorException(ExceptionInfo.TYPE_ERROR, e, RedisHash.class); } return result; } pr...
### Question: RedisHash extends Commands { public Double increaseByFloat(String key, String member, double value) throws TypeErrorException { Double result; try { result = getJedis().hincrByFloat(key, member, value); } catch (Exception e) { throw new TypeErrorException(ExceptionInfo.TYPE_ERROR, e, RedisHash.class); } r...
### Question: RedisHash extends Commands { public Long length(String key) { return getJedis().hlen(key); } private RedisHash(); synchronized static RedisHash getInstance(); Long save(String key, String member, String value); String save(String key, Map<String, String> map); Long saveWhenNotExist(String key, String mem...
### Question: RedisHash extends Commands { public Long remove(String key, String... members) { return getJedis().hdel(key, members); } private RedisHash(); synchronized static RedisHash getInstance(); Long save(String key, String member, String value); String save(String key, Map<String, String> map); Long saveWhenNot...
### Question: PoolManagement { public RedisPools getRedisPool() { if (currentPoolId == null) { logger.error(ExceptionInfo.NOT_EXIST_CURRENT_POOL); return null; } try { return getRedisPool(currentPoolId); } catch (Exception e) { logger.error(e.getMessage()); logger.debug(NoticeInfo.ERROR_INFO, e); return null; } } priva...
### Question: PoolManagement { public boolean checkConnection(RedisPoolProperty property) { if (!validate(property)) { return false; } RedisPools pools = new RedisPools(); pools.setProperty(property); boolean flag = pools.available(); pools.destroyPool(); return flag; } private PoolManagement(); synchronized static Po...
### Question: Metadata { public List<String> getDisplayOrder() { return mDisplayOrder; } Metadata(List<String> displayOrder, Map<String, JsonObject> groups, Map<String, GroupDef> groupDefinitions, List<Field> fields); List<String> getDisplayOrder(); Map<String, JsonObject> getGroups(); Map<String, GroupDef> getGroupDef...
### Question: Metadata { public List<Field> getFields() { return mFields; } Metadata(List<String> displayOrder, Map<String, JsonObject> groups, Map<String, GroupDef> groupDefinitions, List<Field> fields); List<String> getDisplayOrder(); Map<String, JsonObject> getGroups(); Map<String, GroupDef> getGroupDefinitions(); L...
### Question: BitcoinUtils { public static List<String> generateMnemonic(byte[] seedData) { if (MnemonicCode.INSTANCE == null) { return null; } try { return MnemonicCode.INSTANCE.toMnemonic(seedData); } catch (MnemonicException.MnemonicLengthException e) { Timber.e(e, "Unable to create mnemonic from word list"); } retu...
### Question: BitcoinUtils { public static boolean isValidPassphrase(String passphrase) { try { byte[] entropy = MnemonicCode.INSTANCE.toEntropy(Arrays.asList(passphrase.split(" "))); return entropy.length > 0; } catch (MnemonicException e) { Timber.e(e, "Invalid passphrase"); return false; } } static void init(Contex...
### Question: Cloud { public void createPacketsFile() { File packetsFile = new File(this.sharedDir, "Packets.txt"); if (packetsFile.exists()) { try { packetsFile.createNewFile(); } catch (IOException e) { log.error("Cannot create", e); } } try (PrintWriter writer = new PrintWriter(new FileOutputStream(packetsFile))) { ...
### Question: QuestionRepository implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { if (forceRemote) { return refreshData(); } else { if (caches.size() > 0) { return Flowable.just(caches); } else { return localDataSource.loadQuestions(false) .take(1) .flatMap(...
### Question: QuestionRemoteDataSource implements QuestionDataSource { @Override public void clearData() { throw new UnsupportedOperationException("Unsupported operation"); } @Inject QuestionRemoteDataSource(QuestionService questionService); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @Overr...
### Question: QuestionRepository implements QuestionDataSource { public Flowable<Question> getQuestion(long questionId) { return Flowable.fromIterable(caches).filter(question -> question.getId() == questionId); } @Inject QuestionRepository(@Local QuestionDataSource localDataSource, @Remote QuestionDataSource rem...
### Question: QuestionRepository implements QuestionDataSource { @Override public void clearData() { caches.clear(); localDataSource.clearData(); } @Inject QuestionRepository(@Local QuestionDataSource localDataSource, @Remote QuestionDataSource remoteDataSource); @Override Flowable<List<Question>> loadQuestions(...
### Question: QuestionRepository implements QuestionDataSource { @Override public void addQuestion(Question question) { throw new UnsupportedOperationException("Unsupported operation"); } @Inject QuestionRepository(@Local QuestionDataSource localDataSource, @Remote QuestionDataSource remoteDataSource); @Override...
### Question: QuestionLocalDataSource implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { return questionDao.getAllQuestions(); } @Inject QuestionLocalDataSource(QuestionDao questionDao); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @...
### Question: QuestionLocalDataSource implements QuestionDataSource { @Override public void addQuestion(Question question) { questionDao.insert(question); } @Inject QuestionLocalDataSource(QuestionDao questionDao); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @Override void addQuestion(Questi...
### Question: QuestionLocalDataSource implements QuestionDataSource { @Override public void clearData() { questionDao.deleteAll(); } @Inject QuestionLocalDataSource(QuestionDao questionDao); @Override Flowable<List<Question>> loadQuestions(boolean forceRemote); @Override void addQuestion(Question question); @Override ...
### Question: QuestionRemoteDataSource implements QuestionDataSource { @Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) { return questionService.loadQuestionsByTag(Config.ANDROID_QUESTION_TAG).map(QuestionResponse::getQuestions); } @Inject QuestionRemoteDataSource(QuestionService questionSe...
### Question: QuestionRemoteDataSource implements QuestionDataSource { @Override public void addQuestion(Question question) { throw new UnsupportedOperationException("Unsupported operation"); } @Inject QuestionRemoteDataSource(QuestionService questionService); @Override Flowable<List<Question>> loadQuestions(boolean f...
### Question: ToStringUserInterface extends AbstractUserInterface implements Appendable { @Override public String toString() { return b.toString(); } @Override int hashCode(); @Override String toString(); @Override boolean equals(Object obj); @Override Appendable append(CharSequence csq); @Override Appendable append(C...
### Question: LogInjector { public Log defaultLogger() { return (level, debug) -> (level == LogLevel.ERROR ? SYS_ERR : SYS_OUT) .print(level, debug); } Log defaultLogger(); }### Answer: @Test public void testDefaultLogging() throws Throwable { final String msg = "Success! " + hashCode(); borrowSout( ()-> LogInjector....
### Question: SlideRenderer { public void renderSlide(DomBuffer into, UiContainerExpr slide) { final DomBuffer out; if ("xapi-slide".equals(into.getTagName())) { out = into; } else { out = into.makeTag("xapi-slide"); } slide.getAttribute("id") .mapNullSafe(UiAttrExpr::getExpression) .mapNullSafe(ASTHelper::extractStrin...
### Question: SPUtils { public String getString(@NonNull String key) { return getString(key, ""); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@Non...
### Question: SPUtils { public int getInt(@NonNull String key) { return getInt(key, -1); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull Stri...
### Question: SPUtils { public long getLong(@NonNull String key) { return getLong(key, -1L); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull ...
### Question: SPUtils { public float getFloat(@NonNull String key) { return getFloat(key, -1f); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNu...
### Question: SPUtils { public boolean getBoolean(@NonNull String key) { return getBoolean(key, false); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getStrin...
### Question: SPUtils { public Map<String, ?> getAll() { return sp.getAll(); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key, @Non...
### Question: SPUtils { public void remove(@NonNull String key) { sp.edit().remove(key).apply(); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonN...
### Question: SPUtils { public boolean contains(@NonNull String key) { return sp.contains(key); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNu...
### Question: SPUtils { public void clear() { sp.edit().clear().apply(); } private SPUtils(String spName); static SPUtils getInstance(); static SPUtils getInstance(String spName); void put(@NonNull String key, @NonNull String value); String getString(@NonNull String key); String getString(@NonNull String key, @NonNull...
### Question: ProxyConfig { public String getProxyHost() { return proxyHost; } ProxyConfig(PropertyLoader propertyLoader); boolean isProxyRequired(); String getProxyType(); String getProxyHost(); int getProxyPort(); String getProxyAddress(); String getProxyUsername(); String getProxyPassword(); String getNonProxyHosts(...
### Question: CaselessProperties extends Properties { @Override public synchronized Object put(Object key, Object value) { lookup.put(((String) key), (String) key); return super.put(key, value); } @Override synchronized Object put(Object key, Object value); @Override String getProperty(String key); @Override String ge...
### Question: DefaultPropertyLoader implements PropertyLoader { @Override public String getProperty(String key) { String value = retrieveProperty(key); if (value.isEmpty()) { throw new IllegalArgumentException(String.format("Unable to find property %s", key)); } return value; } DefaultPropertyLoader(Properties properti...
### Question: DefaultPropertyLoader implements PropertyLoader { public String getEnvironment() { return environment; } DefaultPropertyLoader(Properties properties); String getEnvironment(); @Override String getProperty(String key); @Override String getProperty(String key, String defaultValue); @Override boolean getProp...
### Question: DefaultPropertyLoader implements PropertyLoader { @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } DefaultPropertyLoader(Properties properties); String getEnvironment(); @Override String getProperty(String key); @Overr...
### Question: DefaultPropertiesLoader implements PropertiesLoader { @Override public Properties getProperties() { return properties; } protected DefaultPropertiesLoader(String properties, String userProperties); private DefaultPropertiesLoader(); static DefaultPropertiesLoader getInstance(); @Override Properties getP...
### Question: ConcordionBase implements ResourceRegistry { @Override public boolean isRegistered(Closeable resource, ResourceScope scope) { return getResourcePairFromScope(resource, scope).isPresent(); } @Override void registerCloseableResource(Closeable resource, ResourceScope scope); @Override void registerCloseable...
### Question: PrometheusMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { @Override public void reportSpan(SpanData spanData) { String[] labelValues = getLabelValues(spanData); if (labelValues != null) { this.histogram.labels(labelValues).observe(spanData.getDuration() / (double)1000000); } }...
### Question: PrometheusMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { protected static String convertLabel(String label) { StringBuilder builder = new StringBuilder(label); for (int i=0; i < builder.length(); i++) { char ch = builder.charAt(i); if (!(ch == '_' || ch == ':' || Character.is...
### Question: TagMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getTags().get(name()); return ret == null ? defaultValue : ret; } TagMetricLabel(String name, Object defaultValue); @Override String name(); @Override Object defaultValue(); @Override Object va...
### Question: BaggageMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getBaggageItem(name()); return ret == null ? defaultValue : ret; } BaggageMetricLabel(String name, Object defaultValue); @Override String name(); @Override Object defaultValue(); @Override ...
### Question: InsertOrReplaceProxy implements MethodInterceptor { @Override public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable { if (method.getName().equals("toString") && args.length == 0) { String sql = toString((String) proxy.invoke(realInsert, args)); return sql; }...
### Question: ShadowResources { public String getString(@StringRes int id) throws NotFoundException { return getText(id).toString(); } ShadowResources(); String getString(@StringRes int id); @NonNull String[] getStringArray(@ArrayRes int id); @NonNull int[] getIntArray(@ArrayRes int id); String getPackageName(); }### ...
### Question: ShadowResources { @NonNull public String[] getStringArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getArrayIdTable(); Map<String, List<String>> stringArrayMap = getResourceStringArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (stringArr...