#vulnerable code 
                                @Override
    public String pay(final String target, final Cash amount,
        final String details) throws IOException {
        if (amount.compareTo(new Cash.S("$20")) < 0) {
            throw new SoftException(
                new Par(
                    "The amount %s is too small,",
                    "we won't send now to avoid big PayPal commission"
                ).say(amount)
            );
        }
        final Props props = new Props(this.farm);
        final AdaptivePaymentsService service = new AdaptivePaymentsService(
            new SolidMap<String, String>(
                new MapEntry<>("mode", props.get("//paypal/mode")),
                new MapEntry<>(
                    "acct1.UserName",
                    props.get("//paypal/username")
                ),
                new MapEntry<>(
                    "acct1.Password",
                    props.get("//paypal/password")
                ),
                new MapEntry<>(
                    "acct1.Signature",
                    props.get("//paypal/signature")
                ),
                new MapEntry<>(
                    "acct1.AppId",
                    props.get("//paypal/appid")
                )
            )
        );
        try {
            return Paypal.valid(
                service.pay(
                    this.request(
                        target,
                        amount.decimal().doubleValue(),
                        details
                    )
                )
            ).getPayKey();
        } catch (final SSLConfigurationException
            | InvalidCredentialException
            | InvalidResponseDataException
            | InterruptedException
            | ClientActionRequiredException
            | MissingCredentialException
            | OAuthException
            | HttpErrorException | IOException ex) {
            throw new IOException(
                String.format(
                    "Failed to pay %s to %s with memo \"%s\": %s %s",
                    amount, target, details,
                    ex.getClass().getName(), ex.getMessage()
                ),
                ex
            );
        }
    } 
                            #location 9 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Override
    public String pay(final String target, final Cash amount,
        final String details) throws IOException {
        final Props props = new Props(this.farm);
        final AdaptivePaymentsService service = new AdaptivePaymentsService(
            new SolidMap<String, String>(
                new MapEntry<>("mode", props.get("//paypal/mode")),
                new MapEntry<>(
                    "acct1.UserName",
                    props.get("//paypal/username")
                ),
                new MapEntry<>(
                    "acct1.Password",
                    props.get("//paypal/password")
                ),
                new MapEntry<>(
                    "acct1.Signature",
                    props.get("//paypal/signature")
                ),
                new MapEntry<>(
                    "acct1.AppId",
                    props.get("//paypal/appid")
                )
            )
        );
        try {
            return Paypal.valid(
                service.pay(
                    this.request(
                        target,
                        amount.decimal().doubleValue(),
                        details
                    )
                )
            ).getPayKey();
        } catch (final SSLConfigurationException
            | InvalidCredentialException
            | InvalidResponseDataException
            | InterruptedException
            | ClientActionRequiredException
            | MissingCredentialException
            | OAuthException
            | HttpErrorException | IOException ex) {
            throw new IOException(
                String.format(
                    "Failed to pay %s to %s with memo \"%s\": %s %s",
                    amount, target, details,
                    ex.getClass().getName(), ex.getMessage()
                ),
                ex
            );
        }
    }