You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-dev@jakarta.apache.org by bu...@apache.org on 2007/07/02 11:14:08 UTC

DO NOT REPLY [Bug 42791] New: - RuntimeVisible Annotations duplicated

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42791>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42791

           Summary: RuntimeVisible Annotations duplicated
           Product: BCEL
           Version: 5.3
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
        AssignedTo: bcel-dev@jakarta.apache.org
        ReportedBy: reinhard.pilz@dynatrace.com


Classes containing runtime visible annotations are invalid when processed by BCEL.

Example use case:

The class to be processed:

@javax.persistence.Entity
public class Item {
}



Here the code snippets we are using to process the class:

ClassGen classGen = new ClassGen(javaClass);
...
// perform changes
...
JavaClass result = classGen.getJavaClass();



The result contains now two attributes "RuntimeVisibleAnnotation" which is invalid.



Fix for the problem:

org.apache.bcel.generic.ClassGen:

On line 145 the list of attributes should not be filled with the annoation
attributes, as they are appended later anyways.

Original code:

for (int i = 0; i < attributes.length; i++) {
  addAttribute(attributes[i]);
}

Correct code:
for (int i = 0; i < attributes.length; i++) {
  if (!(attributes[i] instanceof Annotations)) {
    addAttribute(attributes[i]);
  }
}

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 42791] - RuntimeVisible Annotations duplicated

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42791>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42791


tcurdt@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org