Poking around Android API sources. There's FileDescriptor
with a data member descriptor
with no access modifier:
int descriptor;
Then there's class FileOutputStream
that constructs a new FileDescriptor and assigns to that field:
fd = new FileDescriptor();
fd.descriptor = fileSystem.open(...);
How is that compatible with the field access control model of Java? I thought package-private fields are not accessible from outside the declaring class, and there's no notion of friendship like in C++.