Code example for LoadingCache

Methods: get

0
 
        if (_cache == null) {
            return generate(bits);
        } else { 
            try { 
                return _cache.get(bits);
            } catch (ExecutionException e) {
                // propagate 
                throw new RuntimeException();
            } 
        } 
    } 
 
    private KeyPair generate(int bits) throws NoSuchAlgorithmException,
            NoSuchProviderException
    { 
        LOG.debug("Generating KeyPair for {} bits", bits);
 
        KeyPairGenerator generator =
            KeyPairGenerator.getInstance(this.algorithm, this.provider);
Experience pair programming with AI  Get Codota for Java