Summary: | [plan] ITD fields on interfaces marked as private are still woven as public, despite Bug 299552 | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Steve Ash <stevemash> |
Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> |
Status: | NEW --- | QA Contact: | |
Severity: | normal | ||
Priority: | P2 | CC: | aclement, estewart, stevemash |
Version: | 1.6.9 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: | |||
Bug Depends on: | 299552 | ||
Bug Blocks: |
Description
Steve Ash
2010-09-15 11:42:12 EDT
If want the actual *.aj and *.java files, I can attach, but the entire code is pasted above Hi Steve, I'm afraid I didn't make it clear under bug 299552 - that was addressing the situation for field itds on classes, not on interfaces. Interface ITD fields are handled quite differently, as can be seen by the end result being special accessors (get/set) on the interface and the implementation of those accessors (and the field itself) being added to all top most implementors of the interface. However, given the existence of the accessors, I should be able to make the visibility change for interface fields quite easily - I'll try to do that under this bug. Thanks for the testcode, I don't need the sources. Great! Wow thanks for the quick response! As a correction to my original post for anyone that comes across this in the future. I'm not sure what I was doing wrong before, but the @XmlTransient on an interface field ITD *is* being carried forward to the target *.class file. I must've not cleaned my project or something, because I tried 10 times yesterday, and the *.class file didn't have an XmlTransient on my ITD field. I even ran a bamboo build... I don't know. Its working now. So the @XmlTransient on the field might be an acceptable solution to my JAXB problem (ofc now after I've spent an hour writing transfer objects *shakes head*) None the less it would be great to get the fields at the "expected" visibility. Thanks again! Just as an additional effect of this bug, if a private interface field is defined, as in: public aspect WeldAspect { private String PublicInterface.stringField = "i am aspected"; public String PublicInterface.getStringField() { return stringField ; } } @SessionScoped public class SessionBean implements PublicInterface { public String getMyString() { return this.getStringField(); } } This will throw an error during Weld CDI bean validation: "WELD-000075 Normal scoped managed bean implementation class has a public field" Since 'stringField' is public, Weld will not create a proxy for beans with public fields. Verified in the Eclipse Class viewer: // Field descriptor #36 Ljava/lang/String; @org.aspectj.internal.lang.annotation.ajcITD(targetType="weldaspecttest.PublicInterface", name="stringField", modifiers=(int) 2) public java.lang.String stringField; Environment: Tomcat 7 Weld 1.1.10 Aspectj 1.7 in Eclipse AJDT 2.2.1.e42x-RELEASE-20120921-1400 unsetting the target field which is currently set for something already released Any update on this? This is still occurring in 1.8.0. |