Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn or fail when @HollowHashKey is used on unsupported types #186

Open
ghost opened this issue Mar 13, 2018 · 2 comments
Open

Warn or fail when @HollowHashKey is used on unsupported types #186

ghost opened this issue Mar 13, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 13, 2018

The @HollowHashKey annotation is supported on Map and Set types only. However, it's possible to annotate any type and the client API generator will silently ignore it. As it seems reasonable from examples in the docs to, say, apply it to a List this can result in confusion or churn later than need be. At least generate a warning when detecting the annotation on a type other than Map or Set, perhaps with it being a hard failure as an optional config (or fail by default with a mechanism to opt-out).

@ghost ghost changed the title Warn or fail when @HollowHashIndex is used on unsupported types Warn or fail when @HollowHashIndex is used on unsupported types Mar 13, 2018
@rpalcolea
Copy link
Member

@toolbear,

isn't this for @HollowHashKey instead?

Also, how do you envision this? Something at the HollowObjectTypeMapper level to fail if present in a non valid type or a Java AbstractProcessor that works on compile time so people could see warnings at compile level on their IDEs? That would take more to get done.

@akhaku akhaku changed the title Warn or fail when @HollowHashIndex is used on unsupported types Warn or fail when @HollowHashKey is used on unsupported types Mar 21, 2018
@akhaku
Copy link
Contributor

akhaku commented Mar 21, 2018

Yup, @HollowHashKey is indeed what he meant - updated. What we're going for here is the client code generation - if a data model object has eg a List member that is annotated with @HollowHashKey, the annotation is ignored silently, and a findElement isn't generated.

Sunjeet pushed a commit that referenced this issue Apr 10, 2019
* commit '0032a49676e47a778b713e1cc1439b2e0a13edf3':
  Java doc and change names of annotation attributes
  Java Docs for Cinder User facing interfaces
  Move validation related interfaces to validation package
  Fix Validator tests to use ViolationImpl
  Fix IndexValidator to use ViolationImpl
  Fix DataSpecValidatorTest to use ViolationImpl
  Define Validator interface with Violation and ValidationConfig interfaces. Make existing Violation be called ViolationImpl
  Comment out spike-code. To be written later for productized impl
  Add to Violation and change annotation name to SupportsValidation
  Data validation - annotatins and meta annotations definitions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants