test_class.declarator: container1 = PackageId.fromString("container1")
test_class.modifier: private final
test_class.original_string: private final PackageId container1 = PackageId.fromString("container1");
test_class.type: PackageId
test_class.var_name: container1
test_class.declarator: cont1sub1 = PackageId.fromString("cont1sub1")
test_class.modifier: private final
test_class.original_string: private final PackageId cont1sub1 = PackageId.fromString("cont1sub1");
test_class.type: PackageId
test_class.var_name: cont1sub1
test_class.declarator: cont1emb1 = PackageId.fromString("cont1emb1")
test_class.modifier: private final
test_class.original_string: private final PackageId cont1emb1 = PackageId.fromString("cont1emb1");
test_class.type: PackageId
test_class.var_name: cont1emb1
test_class.declarator: installable1 = new EmbeddedPackageInstallable(container1, "", cont1emb1)
test_class.modifier: private final
test_class.original_string: private final EmbeddedPackageInstallable installable1 = new EmbeddedPackageInstallable(container1, "", cont1emb1);
test_class.type: EmbeddedPackageInstallable
test_class.var_name: installable1
test_class.declarator: container2 = PackageId.fromString("container2")
test_class.modifier: private final
test_class.original_string: private final PackageId container2 = PackageId.fromString("container2");
test_class.type: PackageId
test_class.var_name: container2
test_class.declarator: cont2sub1 = PackageId.fromString("cont2sub1")
test_class.modifier: private final
test_class.original_string: private final PackageId cont2sub1 = PackageId.fromString("cont2sub1");
test_class.type: PackageId
test_class.var_name: cont2sub1
test_class.declarator: cont2emb1 = PackageId.fromString("cont2emb1")
test_class.modifier: private final
test_class.original_string: private final PackageId cont2emb1 = PackageId.fromString("cont2emb1");
test_class.type: PackageId
test_class.var_name: cont2emb1
test_class.declarator: installable2 = new EmbeddedPackageInstallable(container2, "", cont2emb1)
test_class.modifier: private final
test_class.original_string: private final EmbeddedPackageInstallable installable2 = new EmbeddedPackageInstallable(container2, "", cont2emb1);
test_class.type: EmbeddedPackageInstallable
test_class.var_name: installable2
test_class.declarator: graph = new PackageGraph()
test_class.modifier: private final
test_class.original_string: private final PackageGraph graph = new PackageGraph();
test_class.type: PackageGraph
test_class.var_name: graph
test_class.declarator: scan1 = Stream.of(container1, cont1sub1, cont1emb1).collect(Collectors.toSet())
test_class.modifier: private final
test_class.original_string: private final Set<PackageId> scan1 = Stream.of(container1, cont1sub1, cont1emb1).collect(Collectors.toSet());
test_class.type: Set<PackageId>
test_class.var_name: scan1
test_class.declarator: scan2 = Stream.of(container2, cont2sub1, cont2emb1).collect(Collectors.toSet())
test_class.modifier: private final
test_class.original_string: private final Set<PackageId> scan2 = Stream.of(container2, cont2sub1, cont2emb1).collect(Collectors.toSet());
test_class.type: Set<PackageId>
test_class.var_name: scan2
test_class.file: core/src/test/java/net/adamcin/oakpal/core/checks/PackageGraphTest.java
test_class.identifier: PackageGraphTest
test_case.body: @Test
      public void testIsLeftDescendantOfRight() {
          assertTrue("expect yes: cont1 -> cont1", graph.isLeftDescendantOfRight(container1, container1));
          assertTrue("expect yes: cont2 -> cont2", graph.isLeftDescendantOfRight(container2, container2));
          assertFalse("expect not: cont1 -> cont2", graph.isLeftDescendantOfRight(container1, container2));
          assertFalse("expect not: cont2 -> cont1", graph.isLeftDescendantOfRight(container2, container1));
          assertTrue("expect yes: cont1sub1 -> cont1", graph.isLeftDescendantOfRight(cont1sub1, container1));
          assertFalse("expect not: cont1 -> cont1sub1 ", graph.isLeftDescendantOfRight(container1, cont1sub1));
          assertTrue("expect yes: cont1emb1 -> cont1", graph.isLeftDescendantOfRight(cont1emb1, container1));
          assertFalse("expect not: cont1 -> cont1emb1 ", graph.isLeftDescendantOfRight(container1, cont1emb1));
          assertFalse("expect not: cont1sub1 -> cont1emb1 ", graph.isLeftDescendantOfRight(cont1sub1, cont1emb1));
          assertFalse("expect not: cont1emb1 -> cont1sub1 ", graph.isLeftDescendantOfRight(cont1emb1, cont1sub1));
          assertTrue("expect yes: cont2sub1 -> cont2", graph.isLeftDescendantOfRight(cont2sub1, container2));
          assertFalse("expect not: cont2 -> cont2sub1 ", graph.isLeftDescendantOfRight(container2, cont2sub1));
          assertTrue("expect yes: cont2emb1 -> cont2", graph.isLeftDescendantOfRight(cont2emb1, container2));
          assertFalse("expect not: cont2 -> cont2emb1 ", graph.isLeftDescendantOfRight(container2, cont2emb1));
          assertFalse("expect not: cont2sub1 -> cont2emb1 ", graph.isLeftDescendantOfRight(cont2sub1, cont2emb1));
          assertFalse("expect not: cont2emb1 -> cont2sub1 ", graph.isLeftDescendantOfRight(cont2emb1, cont2sub1));
  
          // mix things up a bit
  
          graph.identifyPackage(cont1sub1, null);
          assertFalse("expect not after new event: cont1sub1 -> cont1", graph.isLeftDescendantOfRight(cont1sub1, container1));
          graph.identifySubpackage(container2, cont1emb1);
          assertTrue("expect yes after new event: cont2 -> cont1emb1", graph.isLeftDescendantOfRight(container2, cont1emb1));
          assertTrue("expect yes after new event: cont2 -> cont1", graph.isLeftDescendantOfRight(container2, container1));
          graph.identifyEmbeddedPackage(container1, cont2sub1, null);
          assertTrue("expect yes after cycle: cont2 -> cont1emb1", graph.isLeftDescendantOfRight(container2, cont1emb1));
          assertFalse("expect not after cycle: cont2 -> cont1", graph.isLeftDescendantOfRight(container2, container1));
          assertFalse("expect not after cycle: cont1emb1 -> cont1", graph.isLeftDescendantOfRight(cont1emb1, container1));
          assertTrue("expect cont1emb1 is root after cycle", graph.isRoot(cont1emb1));
      }
test_case.class_method_signature: PackageGraphTest.testIsLeftDescendantOfRight()
test_case.full_signature: @Test public void testIsLeftDescendantOfRight()
test_case.identifier: testIsLeftDescendantOfRight
test_case.invocations: assertTrue isLeftDescendantOfRight assertTrue isLeftDescendantOfRight assertFalse isLeftDescendantOfRight assertFalse isLeftDescendantOfRight assertTrue isLeftDescendantOfRight assertFalse isLeftDescendantOfRight assertTrue isLeftDescendantOfRight assertFalse isLeftDescendantOfRight assertFalse isLeftDescendantOfRight assertFalse isLeftDescendantOfRight assertTrue isLeftDescendantOfRight assertFalse isLeftDescendantOfRight assertTrue isLeftDescendantOfRight assertFalse isLeftDescendantOfRight assertFalse isLeftDescendantOfRight assertFalse isLeftDescendantOfRight identifyPackage assertFalse isLeftDescendantOfRight identifySubpackage assertTrue isLeftDescendantOfRight assertTrue isLeftDescendantOfRight identifyEmbeddedPackage assertTrue isLeftDescendantOfRight assertFalse isLeftDescendantOfRight assertFalse isLeftDescendantOfRight assertTrue isRoot
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testIsLeftDescendantOfRight()
focal_class.declarator: identified = new LinkedList<>()
focal_class.modifier: final
focal_class.original_string: final LinkedList<PackageId> identified = new LinkedList<>();
focal_class.type: LinkedList<PackageId>
focal_class.var_name: identified
focal_class.declarator: nodes = new HashMap<>()
focal_class.modifier: final
focal_class.original_string: final Map<PackageId, PackageGraphNode> nodes = new HashMap<>();
focal_class.type: Map<PackageId, PackageGraphNode>
focal_class.var_name: nodes
focal_class.file: core/src/main/java/net/adamcin/oakpal/core/checks/PackageGraph.java
focal_class.identifier: PackageGraph
focal_class.interfaces: implements ProgressCheck
focal_class.class_method_signature: PackageGraph.getOrCreateNode(final @NotNull PackageId packageId)
focal_class.full_signature: private PackageGraphNode getOrCreateNode(final @NotNull PackageId packageId)
focal_class.identifier: getOrCreateNode
focal_class.modifiers: private
focal_class.parameters: (final @NotNull PackageId packageId)
focal_class.return: PackageGraphNode
focal_class.signature: PackageGraphNode getOrCreateNode(final @NotNull PackageId packageId)
focal_class.class_method_signature: PackageGraph.getReportedViolations()
focal_class.full_signature: @Override public Collection<Violation> getReportedViolations()
focal_class.identifier: getReportedViolations
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection<Violation>
focal_class.signature: Collection<Violation> getReportedViolations()
focal_class.class_method_signature: PackageGraph.startedScan()
focal_class.full_signature: @Override public void startedScan()
focal_class.identifier: startedScan
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void startedScan()
focal_class.class_method_signature: PackageGraph.identifyPackage(final PackageId packageId, final File file)
focal_class.full_signature: @Override public void identifyPackage(final PackageId packageId, final File file)
focal_class.identifier: identifyPackage
focal_class.modifiers: @Override public
focal_class.parameters: (final PackageId packageId, final File file)
focal_class.return: void
focal_class.signature: void identifyPackage(final PackageId packageId, final File file)
focal_class.class_method_signature: PackageGraph.identifySubpackage(final PackageId packageId, final PackageId parentId)
focal_class.full_signature: @Override public void identifySubpackage(final PackageId packageId, final PackageId parentId)
focal_class.identifier: identifySubpackage
focal_class.modifiers: @Override public
focal_class.parameters: (final PackageId packageId, final PackageId parentId)
focal_class.return: void
focal_class.signature: void identifySubpackage(final PackageId packageId, final PackageId parentId)
focal_class.class_method_signature: PackageGraph.identifyEmbeddedPackage(final PackageId packageId, final PackageId parentId,
                                          final EmbeddedPackageInstallable slingInstallable)
focal_class.full_signature: @Override public void identifyEmbeddedPackage(final PackageId packageId, final PackageId parentId,
                                          final EmbeddedPackageInstallable slingInstallable)
focal_class.identifier: identifyEmbeddedPackage
focal_class.modifiers: @Override public
focal_class.parameters: (final PackageId packageId, final PackageId parentId,
                                          final EmbeddedPackageInstallable slingInstallable)
focal_class.return: void
focal_class.signature: void identifyEmbeddedPackage(final PackageId packageId, final PackageId parentId,
                                          final EmbeddedPackageInstallable slingInstallable)
focal_class.class_method_signature: PackageGraph.isIdentified(final @NotNull PackageId packageId)
focal_class.full_signature: public boolean isIdentified(final @NotNull PackageId packageId)
focal_class.identifier: isIdentified
focal_class.modifiers: public
focal_class.parameters: (final @NotNull PackageId packageId)
focal_class.return: boolean
focal_class.signature: boolean isIdentified(final @NotNull PackageId packageId)
focal_class.class_method_signature: PackageGraph.getLastIdentified()
focal_class.full_signature: public @Nullable PackageId getLastIdentified()
focal_class.identifier: getLastIdentified
focal_class.modifiers: public @Nullable
focal_class.parameters: ()
focal_class.return: PackageId
focal_class.signature: PackageId getLastIdentified()
focal_class.class_method_signature: PackageGraph.isRoot(final @NotNull PackageId packageId)
focal_class.full_signature: public boolean isRoot(final @NotNull PackageId packageId)
focal_class.identifier: isRoot
focal_class.modifiers: public
focal_class.parameters: (final @NotNull PackageId packageId)
focal_class.return: boolean
focal_class.signature: boolean isRoot(final @NotNull PackageId packageId)
focal_class.class_method_signature: PackageGraph.isLeftDescendantOfRight(final @NotNull PackageId left, final @NotNull PackageId right)
focal_class.full_signature: public boolean isLeftDescendantOfRight(final @NotNull PackageId left, final @NotNull PackageId right)
focal_class.identifier: isLeftDescendantOfRight
focal_class.modifiers: public
focal_class.parameters: (final @NotNull PackageId left, final @NotNull PackageId right)
focal_class.return: boolean
focal_class.signature: boolean isLeftDescendantOfRight(final @NotNull PackageId left, final @NotNull PackageId right)
focal_class.class_method_signature: PackageGraph.internalGetSelfAndAncestors(final @NotNull PackageId self)
focal_class.full_signature: private Stream<PackageId> internalGetSelfAndAncestors(final @NotNull PackageId self)
focal_class.identifier: internalGetSelfAndAncestors
focal_class.modifiers: private
focal_class.parameters: (final @NotNull PackageId self)
focal_class.return: Stream<PackageId>
focal_class.signature: Stream<PackageId> internalGetSelfAndAncestors(final @NotNull PackageId self)
focal_class.class_method_signature: PackageGraph.getSelfAndAncestors(final @NotNull PackageId self)
focal_class.full_signature: public Collection<PackageId> getSelfAndAncestors(final @NotNull PackageId self)
focal_class.identifier: getSelfAndAncestors
focal_class.modifiers: public
focal_class.parameters: (final @NotNull PackageId self)
focal_class.return: Collection<PackageId>
focal_class.signature: Collection<PackageId> getSelfAndAncestors(final @NotNull PackageId self)
focal_class.class_method_signature: PackageGraph.internalGetSelfAndDescendents(final @NotNull PackageId self)
focal_class.full_signature: private Stream<PackageId> internalGetSelfAndDescendents(final @NotNull PackageId self)
focal_class.identifier: internalGetSelfAndDescendents
focal_class.modifiers: private
focal_class.parameters: (final @NotNull PackageId self)
focal_class.return: Stream<PackageId>
focal_class.signature: Stream<PackageId> internalGetSelfAndDescendents(final @NotNull PackageId self)
focal_class.class_method_signature: PackageGraph.getSelfAndDescendants(final @NotNull PackageId self)
focal_class.full_signature: public Collection<PackageId> getSelfAndDescendants(final @NotNull PackageId self)
focal_class.identifier: getSelfAndDescendants
focal_class.modifiers: public
focal_class.parameters: (final @NotNull PackageId self)
focal_class.return: Collection<PackageId>
focal_class.signature: Collection<PackageId> getSelfAndDescendants(final @NotNull PackageId self)
focal_method.body: public boolean isLeftDescendantOfRight(final @NotNull PackageId left, final @NotNull PackageId right) {
          if (left.equals(right)) {
              return true;
          }
          return Optional.ofNullable(getOrCreateNode(left).getParent())
                  .map(parent -> isLeftDescendantOfRight(parent.getId(), right))
                  .orElse(false);
      }
focal_method.class_method_signature: PackageGraph.isLeftDescendantOfRight(final @NotNull PackageId left, final @NotNull PackageId right)
focal_method.full_signature: public boolean isLeftDescendantOfRight(final @NotNull PackageId left, final @NotNull PackageId right)
focal_method.identifier: isLeftDescendantOfRight
focal_method.invocations: equals orElse map ofNullable getParent getOrCreateNode isLeftDescendantOfRight getId
focal_method.modifiers: public
focal_method.parameters: (final @NotNull PackageId left, final @NotNull PackageId right)
focal_method.return: boolean
focal_method.signature: boolean isLeftDescendantOfRight(final @NotNull PackageId left, final @NotNull PackageId right)