コード例 #1
0
  private final void writeDebugInfo(int classId, int tag) {
    if (!Debug.COMMUNICATIONS || !getCheckCommunications()) throw new IllegalStateException();

    if (Debug.COMMUNICATIONS_LOG_ALL) {
      String name = ImmutableClass.ALL.get(classId).toString();
      Log.write(
          PlatformClass.getSimpleName(getClass())
              + ", "
              + ThreadAssert.getOrCreateCurrent().getWriterDebugCounter(this)
              + ", class: "
              + name
              + ", tag: "
              + tag);
    }

    Debug.assertion(classId == Helper.getInstance().getExpectedClass());
    long debugCounter = ThreadAssert.getOrCreateCurrent().getAndIncrementWriterDebugCounter(this);
    writeLongToBuffer(debugCounter);
    writeByteToBuffer((byte) classId);
    writeIntegerToBuffer(tag);
    writeIntegerToBuffer(getCustomDebugInfo1());
    writeIntegerToBuffer(getCustomDebugInfo2());
  }
コード例 #2
0
 void reset() {
   if (Debug.COMMUNICATIONS && getCheckCommunications())
     ThreadAssert.getOrCreateCurrent().resetWriterDebugCounter(this);
 }