Source:
<code>public boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException { Objects.requireNonNull(obj); Objects.requireNonNull(acl); if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) { throw new IllegalArgumentException("Unexpected argument passed to " + "BucketManager. OzoneObj type:" + obj.getResourceType()); } String volume = obj.getVolumeName(); String bucket = obj.getBucketName(); metadataManager.getLock().acquireBucketLock(volume, bucket); try { String dbBucketKey = metadataManager.getBucketKey(volume, bucket); OmBucketInfo bucketInfo = metadataManager.getBucketTable().get(dbBucketKey); if (bucketInfo == null) { LOG.debug("Bucket:{}/{} does not exist", volume, bucket); throw new OMException("Bucket " + bucket + " is not found", BUCKET_NOT_FOUND); } List<OzoneAcl> list = bucketInfo.getAcls(); <START> list.remove(acl); <END> OmBucketInfo updatedBucket = OmBucketInfo.newBuilder() .setVolumeName(bucketInfo.getVolumeName()) .setBucketName(bucketInfo.getBucketName()) .setStorageType(bucketInfo.getStorageType()) .setIsVersionEnabled(bucketInfo.getIsVersionEnabled()) .setCreationTime(bucketInfo.getCreationTime()) .setBucketEncryptionKey(bucketInfo.getEncryptionKeyInfo()) .addAllMetadata(bucketInfo.getMetadata()) .setAcls(list) .build(); metadataManager.getBucketTable().put(dbBucketKey, updatedBucket); } catch (IOException ex) { if (!(ex instanceof OMException)) { LOG.error("Remove acl operation failed for bucket:{}/{} acl:{}", volume, bucket, acl, ex); } throw ex; } finally { metadataManager.getLock().releaseBucketLock(volume, bucket); } return true; }</code><technical_language>if acl is found? skip metadata update in this case return false</technical_language>

Target:
public boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException { Objects.requireNonNull(obj); Objects.requireNonNull(acl); if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) { throw new IllegalArgumentException("Unexpected argument passed to " + "BucketManager. OzoneObj type:" + obj.getResourceType()); } String volume = obj.getVolumeName(); String bucket = obj.getBucketName(); metadataManager.getLock().acquireBucketLock(volume, bucket); try { String dbBucketKey = metadataManager.getBucketKey(volume, bucket); OmBucketInfo bucketInfo = metadataManager.getBucketTable().get(dbBucketKey); if (bucketInfo == null) { LOG.debug("Bucket:{}/{} does not exist", volume, bucket); throw new OMException("Bucket " + bucket + " is not found", BUCKET_NOT_FOUND); } List<OzoneAcl> list = bucketInfo.getAcls(); if (!list.contains(acl)) { LOG.info("Acl:{} not found in existing ACLs:{}.", acl, StringUtils.join(",", list)); return false; } list.remove(acl); OmBucketInfo updatedBucket = OmBucketInfo.newBuilder() .setVolumeName(bucketInfo.getVolumeName()) .setBucketName(bucketInfo.getBucketName()) .setStorageType(bucketInfo.getStorageType()) .setIsVersionEnabled(bucketInfo.getIsVersionEnabled()) .setCreationTime(bucketInfo.getCreationTime()) .setBucketEncryptionKey(bucketInfo.getEncryptionKeyInfo()) .addAllMetadata(bucketInfo.getMetadata()) .setAcls(list) .build(); metadataManager.getBucketTable().put(dbBucketKey, updatedBucket); } catch (IOException ex) { if (!(ex instanceof OMException)) { LOG.error("Remove acl operation failed for bucket:{}/{} acl:{}", volume, bucket, acl, ex); } throw ex; } finally { metadataManager.getLock().releaseBucketLock(volume, bucket); } return true; }