From b20640521a3349d50c515cea15e9f85bc5587555 Mon Sep 17 00:00:00 2001 From: sarps Date: Mon, 5 Aug 2024 18:14:30 +0200 Subject: [PATCH] Added Javadocs --- .../java/postcompile/CustomClassResolver.java | 1 + .../postcompile/TransitivelyAccessesMethodsCondition.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/de/tum/cit/ase/ares/api/architecturetest/java/postcompile/CustomClassResolver.java b/src/main/java/de/tum/cit/ase/ares/api/architecturetest/java/postcompile/CustomClassResolver.java index c6b2c4bd..a7a8ea6a 100644 --- a/src/main/java/de/tum/cit/ase/ares/api/architecturetest/java/postcompile/CustomClassResolver.java +++ b/src/main/java/de/tum/cit/ase/ares/api/architecturetest/java/postcompile/CustomClassResolver.java @@ -32,6 +32,7 @@ public CustomClassResolver() { */ public Optional tryResolve(String typeName) { try { + // Try to resolve the class by the given type name. return Optional.ofNullable(allClasses.get(typeName)); } catch (IllegalArgumentException e) { return Optional.empty(); diff --git a/src/main/java/de/tum/cit/ase/ares/api/architecturetest/java/postcompile/TransitivelyAccessesMethodsCondition.java b/src/main/java/de/tum/cit/ase/ares/api/architecturetest/java/postcompile/TransitivelyAccessesMethodsCondition.java index 1380c407..48f39b53 100644 --- a/src/main/java/de/tum/cit/ase/ares/api/architecturetest/java/postcompile/TransitivelyAccessesMethodsCondition.java +++ b/src/main/java/de/tum/cit/ase/ares/api/architecturetest/java/postcompile/TransitivelyAccessesMethodsCondition.java @@ -175,6 +175,11 @@ private Set> getDirectAccessTargetsOutsideOfAnalyzedClasses(JavaAc Set subclasses = resolvedTarget.getSubclasses().stream().map(this::resolveTargetOwner).collect(toSet()); subclasses.add(resolvedTarget); + /** + * If the number of subclasses is more than 20, return an empty set. + * These classes are always generic interfaces or abstract classes + * TODO: Check if this is also the case for foreign packages + */ if (subclasses.size() > 20) { return Collections.emptySet(); }