Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

JAnnotationUse should provide getters for clazz and memberValues properties #784

Closed
glassfishrobot opened this issue Jul 30, 2010 · 10 comments

Comments

@glassfishrobot
Copy link
Contributor

Currently there is no way to learn the annotation class and annotation
parameters from JAnnotationUse class. Class should have getters for it's members.

Environment

Operating System: All
Platform: All

Affected Versions

[2.2.1]

@glassfishrobot
Copy link
Contributor Author

Reported by [email protected]

@glassfishrobot
Copy link
Contributor Author

Was assigned to snajper

@glassfishrobot
Copy link
Contributor Author

snajper said:
reassigning

@glassfishrobot
Copy link
Contributor Author

snajper said:
fixed in codemodel build, will commit when proxy gets back up

@glassfishrobot
Copy link
Contributor Author

Marked as fixed on Thursday, April 14th 2011, 9:16:27 pm

@glassfishrobot
Copy link
Contributor Author

dma_k said:
I have NullPointerException with current implementation. This is because when memberValues is null and getAnnotationMembers() is called, it crashes:

Caused by: java.lang.NullPointerException
	at java.util.Collections$UnmodifiableMap.<init>(Collections.java:1274)
	at java.util.Collections.unmodifiableMap(Collections.java:1260)
	at com.sun.codemodel.JAnnotationUse.getAnnotationMembers(JAnnotationUse.java:73)

getAnnotationMembers() should have a protection against this situation.

@glassfishrobot
Copy link
Contributor Author

andreasz said:
The Current implementation is quite useless because you can't get the actual value. The JAnnotationValue class should provide at least a getter for the value that was passed to the param-Method.

@glassfishrobot
Copy link
Contributor Author

dma_k said:
AndreasZ, what you mean I believe I have already reported as #878.

@glassfishrobot
Copy link
Contributor Author

dma_k said:
NPE is now forked as #1040"). This simple problem was not solved within two yeas.

@glassfishrobot
Copy link
Contributor Author

This issue was imported from java.net JIRA JAXB-784

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant