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

Ignore annotation #64

Closed
patm0le opened this issue Mar 25, 2016 · 3 comments
Closed

Ignore annotation #64

patm0le opened this issue Mar 25, 2016 · 3 comments

Comments

@patm0le
Copy link

patm0le commented Mar 25, 2016

It would be helpful to be able to exlude Annotation-classes in checks such as the jaxb XmlSeeAlso.

@XmlSeeAlso({ A1.class, A2.class })
public abstract class A {}
public class A1 extends A {}
public class A2 extends A {}
@schauder
Copy link
Collaborator

Why do you want to exclude annotations?

And only annotations (like the XmlSeeAlso) in your example?
Or also classes used in the value of the annotation (like A1 and A2) in your example.

@patm0le
Copy link
Author

patm0le commented Mar 28, 2016

Not sure if it makes sense to only exclude some annotations.
In our example @XmlSeeAlso is used as described in https://docs.oracle.com/javase/6/docs/api/javax/xml/bind/annotation/XmlSeeAlso.html.
A test without the annotations runs without warnings. When using the annotation we get the following (which is expected):
degraph.A1 -> degraph.A
degraph.A -> degraph.A1
degraph.A -> degraph.A2
degraph.A2 -> degraph.A

As it's a standard annotaton we don't have plans now to remove this annotation and search for a "cleaner" way. As with other tools to improve code quality (findbugs, PMD etc) I would also appreciate if there's a way to define some exclusions in degraph cause if you don't start at the green field there are many warnings/errors when using a new tool to improve quality. If we don't have exclusions and there are too many warnings/errors on a legacy project then nobody cares or tries to remove them.

As we have many entities with the mentioned annotation (only this annotations seems to make troubles so far), the output is more like spam than information. It would be helpful for us to only see "real" cycles as the XmlSeeAlso is only used for de-/serializsation and.

Maybe I'm just defining the test the wrong way. I attached the very simple test project. Is there a way to define a testcase the runs without warnings without removing the annotation?
degraph-test.zip

@schauder
Copy link
Collaborator

I think I understand the issue at hand.

I wouldn't include a special ignore-annotation-feature, but I have plans to make it possible to ignore dependencies (see #61).

Therefore I'm closing this issue.

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