Bug 168063 - ITD fields on interfaces end up transient
Summary: ITD fields on interfaces end up transient
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.3RC1   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 1.5.4   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-14 10:26 EST by Eugene Kireyev CLA
Modified: 2007-10-10 10:21 EDT (History)
0 users

See Also:


Attachments
Test case files (532 bytes, application/x-gzip)
2006-12-14 10:31 EST, Eugene Kireyev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Kireyev CLA 2006-12-14 10:26:43 EST
After compiling following code by acj from aspectj 1.5.3:

public interface Persistable extends Serializable
{
        abstract public int getPersitableId();
}
------------------------------
public aspect PersistableImpl
{
 declare parents: Test1 extends Persistable;
 final public int Persistable.persistableId = System.identityHashCode(this);
 public int Persistable.getPersitableId()
 {
         return persistableId;
 }
}
------------------------------------------
public class Test1
{
        public static void main(String[] args)
        {
                Test1 obj1 = new Test1();
                if ( obj1 instanceof Persistable )
                {
                        System.out.println("obj1 is Persistable id="+((Persistab
le)obj1).getPersitableId());
                }
                else
                {
                        System.out.println("Not persistable!");
                }
        }
}
-------------------------------------

the persistableId field declared as transient within Test1 class:

   public transient int ajc$interField$test1_PersistableImpl$test1_Persistable$
persistableId; /* synthetic field */

(from decompiled code).
Expexted result: 
   public int ajc$interField$test1_PersistableImpl$test1_Persistable$
persistableId; /* synthetic field */
(As in code compiled by acj from aspectj 1.5.0).
Comment 1 Eugene Kireyev CLA 2006-12-14 10:31:19 EST
Created attachment 55679 [details]
Test case files
Comment 2 Andrew Clement CLA 2007-01-10 11:19:50 EST
fix committed - it is not all intertype fields that exhibit this problem, public ones are fine.  I turned your code into a test program that actually serialized an object and de-serialized (which causes the problem with it being transient to appear) and I've put the fix in.  It is a regression due to the work done under bug 147711.
Comment 3 Andrew Clement CLA 2007-02-16 12:58:10 EST
fix available.