Proper support for generics in visibility modifier check #3142

Closed
KTannenberg opened this Issue Apr 28, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@KTannenberg

KTannenberg commented Apr 28, 2016

Related to #61

Affects: VisibilityModifierCheck

Rationale: Current implementation is not strict enough and would allow to expose some mutable date by wrapping it into immutable class.

Requested:

  • Type of generics should be also checked against known immutable classes
    • For example, Optional<String> keyword or ImmutableMap<String, BigDecimal> perfValues or ImmutableMap<String, ImmutableSet<Long>> perfSeries should be considered OK, while ImmutableMap<String, ArrayList<Long>> perfSeries should not be considered as immutable field.
  • Currently if you add immutable class which happens to have generic type (like java.util.Optional<>) check allows you to create public fields with mutable type (although mutability is slightly restricted by container, i.e. ImmutableSet or Optional)
  • It will be nice to have TextArea with automatical word-wrapping instead of TextField in check's configuration window
@romani

This comment has been minimized.

Show comment
Hide comment
@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jun 10, 2016

Member

fix is merged.

Member

romani commented Jun 10, 2016

fix is merged.

@romani romani closed this Jun 10, 2016

@romani romani added the bug label Jun 10, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment