test_class.file: sjk-stacktrace/src/test/java/org/gridkit/jvmtool/stacktrace/codec/json/JfrEventParserTest.java
test_class.identifier: JfrEventParserTest
test_case.body: @Test
      public void verify_parsing_NativeMethodSample() throws IOException {
  
          JfrEventParser parser = new JfrEventParser();
  
          CommonEvent event = parser.parseNextEvent(new JsonEventSource() {
  
              boolean hasNext = true;
  
              @Override
              public boolean readNext(JsonStreamWriter writer) throws IOException {
  
                  jostart(writer);
                      jput(writer, "eventType", "jdk.NativeMethodSample");
                      jput(writer, "startTime", 1561544945483325579l);
                      jostart(writer, "sampledThread");
                          jput(writer, "osThreadId", 14064);
                          jput(writer, "javaName", "(JDP Packet Listener)");
                          jput(writer, "javaThreadId", 37);
                          jostart(writer, "group");
                              jput(writer, "parent", null);
                              jput(writer, "name", "JDP Client");
                          joend(writer);
                      joend(writer);
                      jostart(writer, "stackTrace");
                          jput(writer, "truncated", false);
                          jastart(writer, "frames");
                              jframe(writer,
                                      "java.net.TwoStacksPlainDatagramSocketImpl",
                                      "receive0",
                                      0, 0, "Native"
                              );
                              jframe(writer,
                                      "java.net.TwoStacksPlainDatagramSocketImpl",
                                      "receive",
                                      0, 2, "Interpreted"
                                      );
                              jframe(writer,
                                      "java.net.DatagramSocket",
                                      "receive",
                                      0, 322, "Interpreted"
                                      );
                          jaend(writer);
                      joend(writer);
                      jput(writer, "state", "STATE_RUNNABLE");
                  joend(writer);
  
                  return hasNext | (hasNext = false);
              }
          });
  
          ThreadSnapshotEvent tevent = (ThreadSnapshotEvent) event;
  
          Assertions.assertThat(tevent.threadName()).isEqualTo("(JDP Packet Listener)");
          Assertions.assertThat(tevent.threadId()).isEqualTo(37l);
          Assertions.assertThat(tevent.threadState()).isEqualTo(State.RUNNABLE);
          Assertions.assertThat(tevent.tags().firstTagFor("jfr.typeId")).isEqualTo("jdk.NativeMethodSample");
  
          Assertions.assertThat(tevent.stackTrace().depth()).isEqualTo(3);
          Assertions.assertThat(tevent.stackTrace().frameAt(0))
              .isEqualTo(new StackFrame("", "java.net.TwoStacksPlainDatagramSocketImpl", "receive0", "java", -2));
          Assertions.assertThat(tevent.stackTrace().frameAt(1))
              .isEqualTo(new StackFrame("", "java.net.TwoStacksPlainDatagramSocketImpl", "receive", null, -1));
          Assertions.assertThat(tevent.stackTrace().frameAt(2))
              .isEqualTo(new StackFrame("", "java.net.DatagramSocket", "receive", null, -1));
      }
test_case.class_method_signature: JfrEventParserTest.verify_parsing_NativeMethodSample()
test_case.full_signature: @Test public void verify_parsing_NativeMethodSample()
test_case.identifier: verify_parsing_NativeMethodSample
test_case.invocations: parseNextEvent jostart jput jput jostart jput jput jput jostart jput jput joend joend jostart jput jastart jframe jframe jframe jaend joend jput joend isEqualTo assertThat threadName isEqualTo assertThat threadId isEqualTo assertThat threadState isEqualTo assertThat firstTagFor tags isEqualTo assertThat depth stackTrace isEqualTo assertThat frameAt stackTrace isEqualTo assertThat frameAt stackTrace isEqualTo assertThat frameAt stackTrace
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void verify_parsing_NativeMethodSample()
focal_class.declarator: streamHandler = new JsonStreamHandler()
focal_class.modifier: private
focal_class.original_string: private JsonStreamHandler streamHandler = new JsonStreamHandler();
focal_class.type: JsonStreamHandler
focal_class.var_name: streamHandler
focal_class.declarator: handlerProxy = new ObjectHandlerProxy()
focal_class.modifier: private
focal_class.original_string: private ObjectHandlerProxy handlerProxy = new ObjectHandlerProxy();
focal_class.type: ObjectHandlerProxy
focal_class.var_name: handlerProxy
focal_class.declarator: nextEvent
focal_class.modifier: private
focal_class.original_string: private CommonEvent nextEvent;
focal_class.type: CommonEvent
focal_class.var_name: nextEvent
focal_class.file: sjk-stacktrace/src/main/java/org/gridkit/jvmtool/stacktrace/codec/json/JfrEventParser.java
focal_class.identifier: JfrEventParser
focal_class.interfaces: implements JsonEventAdapter
focal_class.class_method_signature: JfrEventParser.parseNextEvent(JsonEventSource source)
focal_class.full_signature: @Override public CommonEvent parseNextEvent(JsonEventSource source)
focal_class.identifier: parseNextEvent
focal_class.modifiers: @Override public
focal_class.parameters: (JsonEventSource source)
focal_class.return: CommonEvent
focal_class.signature: CommonEvent parseNextEvent(JsonEventSource source)
focal_class.class_method_signature: JfrEventParser.push(CommonEvent nextEvent)
focal_class.full_signature: public void push(CommonEvent nextEvent)
focal_class.identifier: push
focal_class.modifiers: public
focal_class.parameters: (CommonEvent nextEvent)
focal_class.return: void
focal_class.signature: void push(CommonEvent nextEvent)
focal_class.class_method_signature: JfrEventParser.createEventHandler(String typeId)
focal_class.full_signature: protected JsonObjectHandler createEventHandler(String typeId)
focal_class.identifier: createEventHandler
focal_class.modifiers: protected
focal_class.parameters: (String typeId)
focal_class.return: JsonObjectHandler
focal_class.signature: JsonObjectHandler createEventHandler(String typeId)
focal_method.body: @Override
      public CommonEvent parseNextEvent(JsonEventSource source) throws IOException {
          nextEvent = null;
          while(true) {
              streamHandler.reset(handlerProxy);
              if (!source.readNext(streamHandler)) {
                  return null;
              }
              if (!streamHandler.isAcomplished()) {
                  throw new IOException("Malformed JSON input");
              }
              if (nextEvent != null) {
                  return nextEvent;
              }
          }
      }
focal_method.class_method_signature: JfrEventParser.parseNextEvent(JsonEventSource source)
focal_method.full_signature: @Override public CommonEvent parseNextEvent(JsonEventSource source)
focal_method.identifier: parseNextEvent
focal_method.invocations: reset readNext isAcomplished
focal_method.modifiers: @Override public
focal_method.parameters: (JsonEventSource source)
focal_method.return: CommonEvent
focal_method.signature: CommonEvent parseNextEvent(JsonEventSource source)