[Fwd: JMI question]
Samaresh <[email protected]> Wed, 25 May 2005 12:59:04 -0700
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --------------020009030801020601020100 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Any ideas?? I'm using jdk5_03. -------- Original Message -------- Subject: JMI question Date: Wed, 25 May 2005 10:10:45 -0700 From: Samaresh <[email protected]> To: cdp-buildsys-interest <[email protected]>, [email protected] Please take a look at the following code: public static Annotation getAnnotation(AnnotableElement element, String annotationType) { Collection<Annotation> annotations = element.getAnnotations(); Debug.print("Annotation for : " + element.getName() + " Size: " + annotations.size()); for(Annotation annotation : annotations) { Debug.print("Annotation Type : " + annotation.getType()); Debug.print("Annotation TypeName : " + annotation.getTypeName()); String name = annotation.getTypeName().getName(); if (name.indexOf(annotationType) != -1) { return annotation; } } return null; } This code works great on Windows2000, and not on Windows XP Prof. More specifically I'm looking for Annotations in Classes and Methods and annotation.getTypeName() comes out as null on XP. Note that I'm parsing a .class file and not a .java file. Is this a known issue. Any workaround? Thanks -- sam --------------020009030801020601020100 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"> <title></title> </head> <body text="#000000" bgcolor="#ffffff"> Any ideas??<br> <br> I'm using jdk5_03.<br> <br> -------- Original Message -------- <table cellpadding="0" cellspacing="0" border="0"> <tbody> <tr> <th valign="baseline" align="right" nowrap="nowrap">Subject: </th> <td>JMI question</td> </tr> <tr> <th valign="baseline" align="right" nowrap="nowrap">Date: </th> <td>Wed, 25 May 2005 10:10:45 -0700</td> </tr> <tr> <th valign="baseline" align="right" nowrap="nowrap">From: </th> <td>Samaresh <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]"><[email protected]></a></td> </tr> <tr> <th valign="baseline" align="right" nowrap="nowrap">To: </th> <td>cdp-buildsys-interest <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]"><[email protected]></a>, <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a></td> </tr> </tbody> </table> <br> <br> <pre>Please take a look at the following code: public static Annotation getAnnotation(AnnotableElement element, String annotationType) { Collection<Annotation> annotations = element.getAnnotations(); Debug.print("Annotation for : " + element.getName() + " Size: " + annotations.size()); for(Annotation annotation : annotations) { Debug.print("Annotation Type : " + annotation.getType()); Debug.print("Annotation TypeName : " + annotation.getTypeName()); String name = annotation.getTypeName().getName(); if (name.indexOf(annotationType) != -1) { return annotation; } } return null; } This code works great on Windows2000, and not on Windows XP Prof. More specifically I'm looking for Annotations in Classes and Methods and annotation.getTypeName() comes out as null on XP. Note that I'm parsing a .class file and not a .java file. Is this a known issue. Any workaround? Thanks -- sam </pre> </body> </html> --------------020009030801020601020100--