<commit_before>package com.couchbase.cblite;

import com.couchbase.cblite.internal.CBLBody;

import java.util.HashMap;
import java.util.Map;

public class CBLNewRevision extends CBLRevisionBase {

    // private CBLBody body;
    private String parentRevID;
    private Map<String, Object> properties;

    protected CBLNewRevision(CBLDocument document, CBLRevision parentRevision) {

        super(document);

        parentRevID = parentRevision.getId();

        Map<String, Object> parentRevisionProperties = parentRevision.getProperties();

        if (parentRevisionProperties == null) {
            properties = new HashMap<String, Object>();
            properties.put("_id", document.getId());
            properties.put("_rev", parentRevID);
        }
        else {
            properties = new HashMap<String, Object>(parentRevisionProperties);
        }

    }

    public void setProperties(Map<String,Object> properties) {
        this.properties = properties;
    }

    public void setDeleted(boolean deleted) {
        if (deleted == true) {
            properties.put("_deleted", true);
        }
        else {
            properties.remove("_deleted");
        }
    }

    public CBLRevision getParentRevision() {
        if (parentRevID == null || parentRevID.length() == 0) {
            return null;
        }
        return document.getRevision(parentRevID);
    }

    public String getParentRevisionId() {
        return parentRevID;
    }

    public CBLRevision save() throws CBLiteException {
        return document.putProperties(properties, parentRevID);
    }

    public void addAttachment(CBLAttachment attachment, String name) {
        Map<String, Object> attachments =  (Map<String, Object>) properties.get("_attachments");
        attachments.put(name, attachment);
        properties.put("_attachments", attachments);
        attachment.setName(name);
        attachment.setRevision(this);
    }

    public void removeAttachmentNamed(String name) {
        addAttachment(null, name);
    }


}
<commit_msg>fix compile error<commit_after>package com.couchbase.cblite;

import com.couchbase.cblite.internal.CBLBody;

import java.util.HashMap;
import java.util.Map;

public class CBLNewRevision extends CBLRevisionBase {

    // private CBLBody body;
    private String parentRevID;
    private Map<String, Object> properties;

    protected CBLNewRevision(CBLDocument document, CBLRevision parentRevision) {

        super(document);

        parentRevID = parentRevision.getId();

        Map<String, Object> parentRevisionProperties = parentRevision.getProperties();

        if (parentRevisionProperties == null) {
            properties = new HashMap<String, Object>();
            properties.put("_id", document.getId());
            properties.put("_rev", parentRevID);
        }
        else {
            properties = new HashMap<String, Object>(parentRevisionProperties);
        }

    }

    public void setProperties(Map<String,Object> properties) {
        this.properties = properties;
    }

    public Map<String, Object> getProperties() {
        return properties;
    }

    public void setDeleted(boolean deleted) {
        if (deleted == true) {
            properties.put("_deleted", true);
        }
        else {
            properties.remove("_deleted");
        }
    }

    public CBLRevision getParentRevision() {
        if (parentRevID == null || parentRevID.length() == 0) {
            return null;
        }
        return document.getRevision(parentRevID);
    }

    public String getParentRevisionId() {
        return parentRevID;
    }

    public CBLRevision save() throws CBLiteException {
        return document.putProperties(properties, parentRevID);
    }

    public void addAttachment(CBLAttachment attachment, String name) {
        Map<String, Object> attachments =  (Map<String, Object>) properties.get("_attachments");
        attachments.put(name, attachment);
        properties.put("_attachments", attachments);
        attachment.setName(name);
        attachment.setRevision(this);
    }

    public void removeAttachmentNamed(String name) {
        addAttachment(null, name);
    }


}

{'fraction_non_alphanumeric': 0.10040640688501076, 'fraction_numerical': 0.0004781257470714798, 'mean_word_length': 2.7158081705150976, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6536960', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1099, 'n_words': 242}