Program: 79460
Project: 79460
Buggy source:
public static SigningKeyResolver defaultSigningKeyResolver(Optional<JWTKeyResolver> keyResolver){
  return new SigningKeyResolver(){
    private Key retreiveKey(    JwsHeader header,    Claims claims){
      if (!keyResolver.isPresent()) {
        return null;
      }
      SignatureAlgorithm algorithm=SignatureAlgorithm.forName(header.getAlgorithm());
      JWTKeyResolver actualResolver=keyResolver.get();
      Map<String,Object> allClaims=Stream.of(claims,(Map<String,Object>)header).map(Map::entrySet).flatMap(Collection::stream).collect(Collectors.toMap(Map.Entry::getKey,Map.Entry::getValue));
      Optional<byte[]> keyBytes=actualResolver.resolve(allClaims);
      if (!keyBytes.isPresent()) {
        return null;
      }
      if (algorithm.isHmac()) {
        return new SecretKeySpec(keyBytes.get(),algorithm.getJcaName());
      }
      if (algorithm.isRsa() || algorithm.isEllipticCurve()) {
        try {
          return keyFactorySupplier.get(algorithm.getFamilyName()).get().generatePublic(new X509EncodedKeySpec(keyBytes.get()));
        }
 catch (        InvalidKeySpecException ex) {
          throw new RuntimeException(ex);
        }
      }
      throw new UnsupportedOperationException("String_Node_Str" + algorithm.getFamilyName() + "String_Node_Str");
    }
    @Override public Key resolveSigningKey(    JwsHeader header,    Claims claims){
      return retreiveKey(header,claims);
    }
    @Override public Key resolveSigningKey(    JwsHeader header,    String plaintext){
      throw new UnsupportedOperationException();
    }
  }
;
}

Fixed version (ground truth):
static SigningKeyResolver defaultSigningKeyResolver(Optional<JwtKeyResolver> keyResolver){
  return new SigningKeyResolver(){
    private Key retreiveKey(    JwsHeader header,    Claims claims){
      if (!keyResolver.isPresent()) {
        return null;
      }
      SignatureAlgorithm algorithm=SignatureAlgorithm.forName(header.getAlgorithm());
      JwtKeyResolver actualResolver=keyResolver.get();
      Map<String,Object> allClaims=Stream.of(claims,(Map<String,Object>)header).map(Map::entrySet).flatMap(Collection::stream).collect(Collectors.toMap(Map.Entry::getKey,Map.Entry::getValue));
      Optional<byte[]> keyBytes=actualResolver.resolve(allClaims);
      if (!keyBytes.isPresent()) {
        return null;
      }
      if (algorithm.isHmac()) {
        return new SecretKeySpec(keyBytes.get(),algorithm.getJcaName());
      }
      if (algorithm.isRsa() || algorithm.isEllipticCurve()) {
        try {
          return keyFactorySupplier.get(algorithm.getFamilyName()).get().generatePublic(new X509EncodedKeySpec(keyBytes.get()));
        }
 catch (        InvalidKeySpecException ex) {
          throw new RuntimeException(ex);
        }
      }
      throw new UnsupportedOperationException("String_Node_Str" + algorithm.getFamilyName() + "String_Node_Str");
    }
    @Override public Key resolveSigningKey(    JwsHeader header,    Claims claims){
      return retreiveKey(header,claims);
    }
    @Override public Key resolveSigningKey(    JwsHeader header,    String plaintext){
      throw new UnsupportedOperationException();
    }
  }
;
}