Java cannot delete Attachments

As I found out there is a problem in deleting attachments programmatically with Java. I tested with Release 6.0.2 server, 6.0.3 german client and 6.5.1 client.

look at this statements:

EmbeddedObject objtarget = doc.getAttachment(“file.txt”);

if(objtarget != null)

objtarget.remove();

doc.save(false,false);

The attachment is deleted only if the document contains zero or one richtext items. The attachment is not deleted if the document contains more than one richtext items!

The problem persist for attachments not within a richtext item (visible at the end of document), result: attachment is not deleted

as well as attachments located in a richtext item, result: attachment reference is deleted from richtext item but attachment is still available (visible at the end of document).