@Test void getRootPackageNoParent() throws Exception { PackageMetadata packageMetadata = mock(PackageMetadata.class); Package package_ = new Package(packageMetadata); assertEquals(package_, package_.getRootPackage()); }
@SuppressWarnings("java:S2259") public Package getRootPackage() { Package aPackage = this; while (aPackage.getParent() != null) { aPackage = aPackage.getParent(); } return aPackage; }
Package extends StaticEntity { @SuppressWarnings("java:S2259") public Package getRootPackage() { Package aPackage = this; while (aPackage.getParent() != null) { aPackage = aPackage.getParent(); } return aPackage; } }
Package extends StaticEntity { @SuppressWarnings("java:S2259") public Package getRootPackage() { Package aPackage = this; while (aPackage.getParent() != null) { aPackage = aPackage.getParent(); } return aPackage; } Package(Entity entity);  Package(EntityType entityType);  Package(String packageId, EntityType entityType); }
Package extends StaticEntity { @SuppressWarnings("java:S2259") public Package getRootPackage() { Package aPackage = this; while (aPackage.getParent() != null) { aPackage = aPackage.getParent(); } return aPackage; } Package(Entity entity);  Package(EntityType entityType);  Package(String packageId, EntityType entityType); static Package newInstance(Package aPackage); String getId(); Package setId(String id); @Nullable @CheckForNull Package getParent(); Package setParent(Package parentPackage); Iterable<Package> getChildren(); String getLabel(); Package setLabel(String label); @Nullable @CheckForNull String getDescription(); Package setDescription(String description); Iterable<Tag> getTags(); Package setTags(Iterable<Tag> tags); void addTag(Tag tag); void removeTag(Tag tag); Iterable<EntityType> getEntityTypes(); @SuppressWarnings("java:S2259") // potential multi-threading NPE Package getRootPackage(); @SuppressWarnings("java:S2259") // potential multi-threading NPEs @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Package extends StaticEntity { @SuppressWarnings("java:S2259") public Package getRootPackage() { Package aPackage = this; while (aPackage.getParent() != null) { aPackage = aPackage.getParent(); } return aPackage; } Package(Entity entity);  Package(EntityType entityType);  Package(String packageId, EntityType entityType); static Package newInstance(Package aPackage); String getId(); Package setId(String id); @Nullable @CheckForNull Package getParent(); Package setParent(Package parentPackage); Iterable<Package> getChildren(); String getLabel(); Package setLabel(String label); @Nullable @CheckForNull String getDescription(); Package setDescription(String description); Iterable<Tag> getTags(); Package setTags(Iterable<Tag> tags); void addTag(Tag tag); void removeTag(Tag tag); Iterable<EntityType> getEntityTypes(); @SuppressWarnings("java:S2259") // potential multi-threading NPE Package getRootPackage(); @SuppressWarnings("java:S2259") // potential multi-threading NPEs @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final String PACKAGE_SEPARATOR; }