New Check: ForbidParameterInAnnotation #108

Closed
romani opened this Issue Apr 6, 2013 · 5 comments

Projects

None yet

6 participants

@romani
Member
romani commented Apr 6, 2013

Use case:
usage of "expected" parameter in annotation Test (http://junit.sourceforge.net/javadoc/org/junit/Test.html ) is not convenient for UnitTesting as it prints exceptions in logs so it will be distracting during UTs failures examination in Jenkins or during maven build. It is hard to distinguish expected Exception and unexpected Exception that appear in test but due to lack of appropriate check does not fails.

Rule of thumb: no exceptions means all is ok, exception appear - it is a problem.

So we need to create Check that will allow us to detect parameter usage in in required Annotation.
Options:
"annotationName" is simple String
"parameterName" is simple String
"parameterValue" is regexp String, default value is ".*"

@arsen1992 arsen1992 was assigned May 8, 2013
@daniilyar daniilyar changed the title from New Check: ForbidParameterInAnnatation to New Check: ForbidParameterInAnnotation Apr 19, 2014
@drozzds drozzds was assigned by daniilyar Apr 19, 2014
@daniilyar daniilyar added easy and removed enhancement labels Aug 15, 2014
@romani
Member
romani commented Apr 18, 2015

Sergey does not have time to finish , but 90% of work is done:
drozzds/sevntu.checkstyle@cca522e

non finished discussion:
https://groups.google.com/d/msg/sevntu-checkstyle/5MFHVlFTmz8/YBuBK2IonZsJ

@romani romani assigned Andrew0701 and unassigned drozzds Apr 18, 2015
@Andrew0701 Andrew0701 was unassigned by romani Sep 26, 2015
@rnveach rnveach added a commit to rnveach/sevntu.checkstyle that referenced this issue Nov 12, 2016
@rnveach rnveach Issue #108: added ForbidAnnotationElementValueCheck 85aeae0
@rnveach rnveach added a commit to rnveach/sevntu.checkstyle that referenced this issue Nov 19, 2016
@rnveach rnveach Issue #108: added ForbidAnnotationElementValueCheck 73df330
@romani romani added this to the 1.22 milestone Nov 19, 2016
@rnveach rnveach was assigned by romani Nov 19, 2016
@romani
Member
romani commented Nov 19, 2016

fix is merged.

@romani romani closed this Nov 19, 2016
@romani
Member
romani commented Nov 20, 2016

@rnveach , issue to use new Check - checkstyle/checkstyle#3567

@rnveach
Contributor
rnveach commented Nov 21, 2016 edited

Update is in PR #487

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