• Bug
  • Status: Open
  • 2 Major
  • Resolution:
  • interfaces
  • Reporter: teck
  • September 09, 2008
  • 0
  • Watchers: 0
  • December 16, 2011

Attachments

Description

The various ClassInfo implementations in our version of aspectwerkz don’t seem to handle certain field signatures well.

My understanding of the AW internals is that a unique hash is generated to represent particular fields in classes. The algorithm for generating the hash usually produces unique values, but not always. Specifically if within a particular class, if you have two (or more) fields of the same type *AND* the hashcode() value for the String names of the fields happen to be equal, you’ll get a collision.

For example, this class should illustrate the problem: class Foo { Object AV; Object B7; }

Obtaining the ASM ClassInfo for this class, and then iterating the fields will give two fields both named B7. The generated field hash will be the same since both are of same type (“Ljava/lang/Object;) and the hashcode of “AV” is equals to the hashcode of “B7”

The JavaClassInfo reports that there is only one field.

Running the attached Test.java program prints this: asm: B7 asm: B7 java: B7

Comments