Пример #1
0
 @Test
 public void test2() {
   StructuredGraph graph = parseAndProcess("test2Snippet");
   NodeIterable<MonitorExitNode> monitors = graph.getNodes(MonitorExitNode.class);
   Assert.assertEquals(1, monitors.count());
   Assert.assertEquals(monitors.first().stateAfter().bci, 3);
 }
 @Override
 protected boolean checkMidTierGraph(StructuredGraph graph) {
   int count = 0;
   for (IsNullNode isNull : graph.getNodes().filter(IsNullNode.class).snapshot()) {
     ValueNode value = isNull.getValue();
     if (value instanceof CompressionNode) {
       count++;
       isNull.replaceFirstInput(value, ((CompressionNode) value).getValue());
     }
   }
   Assert.assertEquals("graph should contain exactly one IsNullNode", 1, count);
   return super.checkMidTierGraph(graph);
 }