Google Core Libraries for Java 1.5+

learn more… | top users | synonyms

2
votes
1answer
46 views

Decoding big text input: potential concurrency bugs?

The code here will be directly pasted from this project. Quick summary: it is related to a Stack Overflow question. So, basically, all the code below aims to implement ...
7
votes
1answer
163 views

Cache<Long, BlockingDeque<Peer>> combined with Striped<ReadWriteLock>: is it thread-safe

I've implemented PeersContainer class with all operations that I need. I need something like multimap in concurrent environment, moreover I need remove entities ...
5
votes
1answer
53 views

One-line initialisation for a constant list with all entries except one from another list

I'm looking to simplify the initialisation of the second constant, preferably to just one line. Any ideas? Anything from Guava or JDK (up to 1.6) is ok to use. ...
4
votes
2answers
62 views

Simplify finding indices of all instances of certain characters in a string

I have a string util method for finding potential "wrapping points" in a string. For example, if " " and "-" are considered ...
5
votes
1answer
258 views

Better code for converting a char to its UTF-8 percent encoding representation?

This is working code for a URI template (RFC 6570) implementation; when the character to render is not within a specific character set, it is needed to grab the UTF-8 representation of that character ...
5
votes
2answers
181 views

Helper class to memoize DateFormats application-wide

Premise Consider the following method: static String formatMyDate(Date date) { return new SimpleDateFormat("yyyy-MM-dd").format(date); } It's often ...
6
votes
1answer
316 views

Ability to forget the memoized supplier value

Guava has a feature request which is asking to provide the ability to forget memoized value on a given supplier. On top on that I needed another functionality where if during the calculation of ...
1
vote
2answers
271 views

At most one LocalDate per month in a list

I'm implementing argument check in a method where one parameter is a List of LocalDate objects (from Joda-Time). I want to make ...