Browse Source

fix for Bugzilla Bug 52928

 	Private members introduced via an interface are visible to the class
tags/Root_ajdt_support
acolyer 20 years ago
parent
commit
5795b4afc6

BIN
org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip View File


BIN
org.eclipse.jdt.core/jdtcore-for-aspectj.jar View File


+ 9
- 1
tests/ajcTests.xml View File

</inc-compile> </inc-compile>
</ajc-test> </ajc-test>


<ajc-test dir="bugs"
title="Private members introduced via an interface are visible to the class"
pr="52928">
<compile
files="VisiblePrivateInterfaceITDs.java" >
<message kind="error" line="13"/>
</compile>
</ajc-test>
</suite> </suite>

+ 24
- 0
tests/bugs/VisiblePrivateInterfaceITDs.java View File

// PR 52928

public class VisiblePrivateInterfaceITDs {

public static void main(String[] args) {
VisiblePrivateInterfaceITDs s = new VisiblePrivateInterfaceITDs();
s.aMethod();
}

public void aMethod() {
// x is introduced by the following aspect as private
// so it should not be accessible here
System.out.println("I have " + x); // CE 13
}

}

aspect SampleAspect {
private interface Tag {};
private int Tag.x = 0;
declare parents: VisiblePrivateInterfaceITDs implements Tag;
}

Loading…
Cancel
Save