How can I leave Subject as blank when fill nothing in the subject field of a comment? When we fill nothing in the subject field of comment, drupal will use the comment body as the value of subject. See the code in CommentForm::buildEntity

// Validate the comment's subject. If not specified, extract from comment
// body.
if (trim($comment-&gt;getSubject()) == '') {
  if ($comment-&gt;hasField('comment_body')) {
    // The body may be in any format, so:
    // 1) Filter it into HTML
    // 2) Strip out all HTML tags
    // 3) Convert entities back to plain-text.
    $comment_text = $comment-&gt;comment_body-&gt;processed;
    $comment-&gt;setSubject(Unicode::truncate(trim(Html::decodeEntities(strip_tags($comment_text))), 29, TRUE, TRUE));
  }
  // Edge cases where the comment body is populated only by HTML tags will
  // require a default subject.
  if ($comment-&gt;getSubject() == '') {
    $comment-&gt;setSubject($this-&gt;t('(No subject)'));
  }
}


I still need to show Subject if it's been filled, while leave the Subject as blank when the user fill nothing in. To programmatically change the default behavior, we may need to override the function after buildEntity take place, otherwise buildEntity will override it again to the comment body. Is it possible to do that?
You can use hook_ENTITY_TYPE_presave to do this, just call 

 if (!$entity-&gt;getSubject()) {
   $entity-&gt;setSubject(''); 
 }


if it isn’t filled.

Hope it makes sense.