Skip to content

Commit

Permalink
One more tweak post #4515 to remove non-visible implicit factory meth…
Browse files Browse the repository at this point in the history
…ods (#4549)
  • Loading branch information
cowtowncoder authored May 30, 2024
1 parent b6af5aa commit f91ec27
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,9 @@ protected void _addCreators(Map<String, POJOPropertyBuilder> props)
}

// Anything else left, add as possible implicit Creators
// ... but first, trim non-visible
_removeNonVisibleCreators(constructors);
_removeNonVisibleCreators(factories);
creators.setImplicitDelegating(constructors, factories);

// And finally add logical properties for the One Properties-based
Expand Down Expand Up @@ -765,6 +768,17 @@ private void _removeDisabledCreators(List<PotentialCreator> ctors)
}
}

private void _removeNonVisibleCreators(List<PotentialCreator> ctors)
{
Iterator<PotentialCreator> it = ctors.iterator();
while (it.hasNext()) {
PotentialCreator ctor = it.next();
if (!_visibilityChecker.isCreatorVisible(ctor.creator())) {
it.remove();
}
}
}

private void _removeNonFactoryStaticMethods(List<PotentialCreator> ctors)
{
final Class<?> rawType = _type.getRawClass();
Expand Down

0 comments on commit f91ec27

Please sign in to comment.