jclouds-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Gaul <notificati...@github.com>
Subject Re: [jclouds] Remove strings2 replaceall (#21)
Date Sat, 01 Jun 2013 03:40:04 GMT
> -            input = CHAR_TO_PATTERN.get(match).matcher(input).replaceAll(replacement);
> -         } catch (ExecutionException e) {
> -            throw new IllegalStateException("error creating pattern: " + match, e);
> -         }
> -      }
> -      return input;
> -   }
> -
> -   private static final LoadingCache<Character, Pattern> CHAR_TO_PATTERN = CacheBuilder.newBuilder()
> -         .<Character, Pattern> build(new CacheLoader<Character, Pattern>()
{
> -            @Override
> -            public Pattern load(Character plain) {
> -               return Pattern.compile(plain + "");
> -            }
> -         });
> -   

Caching is now the caller's responsibility.  In most cases they should allocate a static Pattern.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/21/files#r4488279

Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message