Buggy code:
public abstract class ObjectStorageRESTBinding extends RestfulMarshallingHandler { protected static Logger LOG = Logger . getLogger ( ObjectStorageRESTBinding . class ) ; protected static final String SERVICE = "service" ; protected static final String BUCKET = "bucket" ; protected static final String OBJECT = "object" ; protected Map < String , String > operationMap ; protected Map < String , String > unsupportedOperationMap ; protected String key ; public ObjectStorageRESTBinding ( ) { } @ Override public void handleUpstream ( final ChannelHandlerContext channelHandlerContext , final ChannelEvent channelEvent ) throws Exception { } @ Override public void incomingMessage ( ChannelHandlerContext ctx , MessageEvent event ) throws Exception { } @ Override public void outgoingMessage ( ChannelHandlerContext ctx , MessageEvent event ) throws Exception { } public void handleData ( ObjectStorageDataRequestType dataRequest , ChannelBuffer content ) { } protected abstract Map < String , String > populateOperationMap ( ) { } protected abstract Map < String , String > populateUnsupportedOperationMap ( ) { } @ Override public Object bind ( final MappingHttpRequest httpRequest ) throws Exception { } protected void addLogData ( BaseMessage eucaMsg , Map bindingArguments ) { } protected void setRequiredParams ( final GroovyObject msg , User user ) throws Exception { } protected String getOperation ( MappingHttpRequest httpRequest , Map operationParams ) throws Exception { } private static final Ordering < String > STRING_COMPARATOR = Ordering . natural ( ) ; protected List < String > responseHeadersForStoring = Collections . unmodifiableList ( ObjectStorageRESTBinding . STRING_COMPARATOR . sortedCopy ( Lists . newArrayList ( CACHE_CONTROL , "Content-Disposition" , CONTENT_ENCODING , CONTENT_LENGTH , CONTENT_TYPE , EXPIRES ) ) ) ; protected void copyHeadersForStoring ( Map operationParams , MappingHttpRequest httpRequest ) { } protected void getTargetBucketParams ( Map operationParams , MappingHttpRequest httpRequest ) throws BindingException , S3Exception { } protected void getVersioningStatus ( Map operationParams , MappingHttpRequest httpRequest ) throws BindingException , S3Exception { } protected void parseExtendedHeaders ( Map operationParams , String headerString , String value ) throws BindingException { } protected AccessControlPolicy getAccessControlPolicy ( MappingHttpRequest httpRequest ) throws BindingException , S3Exception { AccessControlPolicy accessControlPolicy = new AccessControlPolicy ( ) ; AccessControlList accessControlList = new AccessControlList ( ) ; ArrayList < Grant > grants = new ArrayList < Grant > ( ) ; String aclString = "" ; try { aclString = getMessageString ( httpRequest ) ; if ( ( aclString . length ( ) ) > 0 ) { XMLParser xmlParser = new XMLParser ( aclString ) ; String ownerId = xmlParser . getValue ( "////Owner//ID" ) ; String displayName = xmlParser . getValue ( "////Owner//DisplayName" ) ; CanonicalUser canonicalUser = new CanonicalUser ( ownerId , displayName ) ; accessControlPolicy . setOwner ( canonicalUser ) ; List < String > permissions = xmlParser . getValues ( "////AccessControlList//Grant//Permission" ) ; if ( permissions == null ) { throw new MalformedACLErrorException ( "////AccessControlList//Grant//Permission" ) ; } DTMNodeList grantees = xmlParser . getNodes ( "////AccessControlList//Grant//Grantee" ) ; if ( grantees == null ) { throw new MalformedACLErrorException ( "////AccessControlList//Grant//Grantee" ) ; } for ( int i = 0 ; i < ( grantees . getLength ( ) ) ; ++ i ) { String id = xmlParser . getValue ( grantees . item ( i ) , "ID" ) ; if ( ( id . length ( ) ) > 0 ) { String canonicalUserName = xmlParser . getValue ( grantees . item ( i ) , "DisplayName" ) ; Grant grant = new Grant ( ) ; Grantee grantee = new Grantee ( ) ; grantee . setCanonicalUser ( new CanonicalUser ( id , canonicalUserName ) ) ; grant . setGrantee ( grantee ) ; grant . setPermission ( permissions . get ( i ) ) ; grants . add ( grant ) ; } else if ( ! ( "" . equals ( xmlParser . getValue ( grantees . item ( i ) , "EmailAddress" ) ) ) ) { String canonicalUserName = xmlParser . getValue ( grantees . item ( i ) , "DisplayName" ) ; Grant grant = new Grant ( ) ; Grantee grantee = new Grantee ( ) ; String email = xmlParser . getValue ( grantees . item ( i ) , "EmailAddress" ) ; <START_BUG> grantee . setCanonicalUser ( new CanonicalUser ( email , canonicalUserName ) ) ; <END_BUG> grant . setGrantee ( grantee ) ; grant . setPermission ( permissions . get ( i ) ) ; grants . add ( grant ) ; } else { String groupUri = xmlParser . getValue ( grantees . item ( i ) , "URI" ) ; if ( ( groupUri . length ( ) ) == 0 ) { throw new MalformedACLErrorException ( "Group-URI" ) ; } Grant grant = new Grant ( ) ; Grantee grantee = new Grantee ( ) ; grantee . setGroup ( new Group ( groupUri ) ) ; grant . setGrantee ( grantee ) ; grant . setPermission ( permissions . get ( i ) ) ; grants . add ( grant ) ; } } } } catch ( S3Exception e ) { throw e ; } catch ( Exception ex ) { throw new MalformedACLErrorException ( aclString ) ; } accessControlList . setGrants ( grants ) ; accessControlPolicy . setAccessControlList ( accessControlList ) ; return accessControlPolicy ; } protected AccessControlList getAccessControlList ( MappingHttpRequest httpRequest ) throws BindingException , S3Exception { } private ArrayList < Part > getPartsList ( MappingHttpRequest httpRequest ) throws BindingException { } protected String getOperationPath ( MappingHttpRequest httpRequest ) { } protected String getLocationConstraint ( MappingHttpRequest httpRequest ) throws S3Exception { } protected List < String > populateObject ( final GroovyObject obj , final Map < String , String > paramFieldMap , final Map < String , String > params ) { } protected void populateObjectFromBindingMap ( final GroovyObject obj , final Map < String , String > paramFieldMap , final MappingHttpRequest httpRequest , final Map bindingMap ) throws BindingException , S3Exception { }

Fix:
grantee . setEmailAddress ( email ) ;