<commit_before>package org.jetbrains.plugins.scala
package lang.psi.impl.statements

import com.intellij.psi._
import impl.light.LightElement
import com.intellij.openapi.util.TextRange
import lang.psi.api.expr.{ScBlockExpr, ScExpression}

final class FakePsiCodeBlock(body: ScExpression) extends LightElement(body.getManager, body.getLanguage) with PsiCodeBlock {
  def shouldChangeModificationCount(place: PsiElement): Boolean = false

  def getRBrace: PsiJavaToken = null

  def getLBrace: PsiJavaToken = null

  def getLastBodyElement: PsiElement = null

  def getFirstBodyElement: PsiElement = null

  def getStatements: Array[PsiStatement] = body match {
    case x: ScBlockExpr => x.statements.map(new FakePsiStatement(_)).toArray
    case _ => Array(new FakePsiStatement(body))
  }
}

final class FakePsiStatement(elem: PsiElement) extends LightElement(elem.getManager, elem.getLanguage) with PsiStatement {
  override def getTextRange: TextRange = elem.getTextRange

  override def getTextOffset: Int = elem.getTextOffset
}<commit_msg>SCL-2953 NPE in AddOverrideAnnotationAction while editing<commit_after>package org.jetbrains.plugins.scala
package lang.psi.impl.statements

import com.intellij.psi._
import impl.light.LightElement
import com.intellij.openapi.util.TextRange
import lang.psi.api.expr.{ScBlockExpr, ScExpression}

final class FakePsiCodeBlock(body: ScExpression) extends LightElement(body.getManager, body.getLanguage) with PsiCodeBlock {
  def shouldChangeModificationCount(place: PsiElement): Boolean = false

  def getRBrace: PsiJavaToken = null

  def getLBrace: PsiJavaToken = null

  def getLastBodyElement: PsiElement = null

  def getFirstBodyElement: PsiElement = null

  def getStatements: Array[PsiStatement] = body match {
    case x: ScBlockExpr => x.statements.map(new FakePsiStatement(_)).toArray
    case _ => Array(new FakePsiStatement(body))
  }

  override def getTextRange: TextRange = body.getTextRange

  override def getTextOffset: Int = body.getTextOffset
}

final class FakePsiStatement(elem: PsiElement) extends LightElement(elem.getManager, elem.getLanguage) with PsiStatement {
  override def getTextRange: TextRange = elem.getTextRange

  override def getTextOffset: Int = elem.getTextOffset
}
{'fraction_non_alphanumeric': 0.07969723953695458, 'fraction_numerical': 0.0017809439002671415, 'mean_word_length': 5.7074626865671645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2500578', 'n_tokens_mistral': 687, 'n_tokens_neox': 661, 'n_words': 165}