Syntax errors were detected in some files.
1public void getObjectContentNoncompliant(AmazonS3 amazonS3Client, String bucketName, String key) throws IOException {
2 final S3Object s3object = amazonS3Client.getObject(bucketName, key);
3 // Noncompliant: the statement is incomplete and is missing ";" at the end.
4 System.out.println(s3object.getObjectMetadata())
5 InputStream reportStream = s3object.getObjectContent();
6 IOUtils.toString(reportStream);
7}
1public void getObjectContentCompliant(AmazonS3 amazonS3Client, String bucketName, String key) throws IOException {
2 final S3Object s3object = amazonS3Client.getObject(bucketName, key);
3 // Compliant: the statement is complete and ends with a ";".
4 System.out.println(s3object.getObjectMetadata());
5 InputStream reportStream = s3object.getObjectContent();
6 IOUtils.toString(reportStream);
7}