public void visitEnd()

in instrumentation/src/com/intellij/rt/coverage/instrumentation/filters/classFilter/PrivateConstructorOfUtilClassFilter.java [96:113]


  public void visitEnd() {
    if ((myAllMethodsStatic || isKotlinObjectOrCompanion() && KotlinUtils.isKotlinClass(myContext))
        && myConstructorIsEmpty
        && myConstructorLines != null
        && !isSealedClassConstructor()) {
      for (int line : myConstructorLines) {
        // Do not ignore constructor if it is the only line in the class
        boolean isKotlinObjectWithSingleLine = isKotlinObjectOrCompanion() && KotlinUtils.isKotlinClass(myContext) && myContext.getLineCount() <= 1;
        // However, const fields are inlined by the compiler.
        // In such a case, object is used just as scope, so we do not need to track coverage for it.
        boolean hasOnlyConstFields = !myHasMethods && myAllFieldsConst && (myHasConstFields || myIsCompanionObject);
        if (!isKotlinObjectWithSingleLine || hasOnlyConstFields) {
          myContext.removeLine(line);
        }
      }
    }
    super.visitEnd();
  }