AWS has been deprecated the "new AmazonS3Client()" to "AmazonS3ClientBuilder.defaultClient()". The "new AmazonS3Client()" returns "AmazonS3Client" whereas, "AmazonS3ClientBuilder.defaultClient()" returns "AmazonS3".
Solution1: Cast the 'AmazonS3' object to 'AmazonS3Client' like: method((AmazonS3Client) AmazonS3ClientBuilder.defaultClient())
Solution2: Change the parameters from 'AmazonS3Client' to 'AmazonS3', like: existing code: method(AmazonS3Client amazonS3Client) new code: method(AmazonS3 amazonS3)
But I'm not comfortable to change solution 2, as changing this will cost me a-lot for efforts and time for testing.
Question/Ask : Is there any other way to do this?