Skip to content

Commit

Permalink
Bug fix (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
jphui authored Sep 5, 2024
1 parent 794996a commit 9e6a2e7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -932,8 +932,12 @@ public static <INTERNAL_SNAPSHOT extends RecordTemplate, VALUE extends RecordTem
final String valueMethodName = valueMethod.getName();
if (valueMethodName.startsWith("set")) {
final Optional<Class<?>> valueAspectClass = Arrays.stream(valueMethod.getParameterTypes()).findFirst();

// setDatasetRecommendationsInfo() --> hasDatasetRecommendationsInfo()
final String hasMethodName = valueMethodName.replaceFirst("set", "has");

if (valueAspectClass.isPresent() && aspectClasses.containsKey(valueAspectClass.get())
&& !(boolean) value.getClass().getMethod(valueMethodName.replace("set", "has")).invoke(value)) {
&& !(boolean) value.getClass().getMethod(hasMethodName).invoke(value)) {
value.getClass()
.getMethod(valueMethodName, valueAspectClass.get())
.invoke(value, aspectClasses.get(valueAspectClass.get()));
Expand Down

0 comments on commit 9e6a2e7

Please sign in to comment.