add visibility information for fields and methods#847
add visibility information for fields and methods#847kroening merged 1 commit intodiffblue:masterfrom
Conversation
tautschnig
left a comment
There was a problem hiding this comment.
Minor suggestions for improvements.
There was a problem hiding this comment.
I think this blank line is safe to stay ;-)
There was a problem hiding this comment.
the line is back :-) this was an artifact from squashing some commits
There was a problem hiding this comment.
Shouldn't this be using the same set_access API? (member_type will thus need to be converted to a more specific type than typet.)
There was a problem hiding this comment.
the problem is that set_access is defined for struct_union_typet and therefore is only really usable for fields here. I had thought about using a special java_typet derived from typet which could have the set_access, too. Would you prefer that?
There was a problem hiding this comment.
What I would like to avoid is having typet objects floating around that have ID_access set without anything ever making use of that. Notably, would equality comparison succeed on two typet with ID_access set to different values -- likely not. Thus such information should either be communicated via "#access" ("ID_C_access") or with objects of proper type and API. Maybe it takes introducing java_typet, but then this needs to propagate to, e.g., base_type_eq.
efa5962 to
dbb9cfd
Compare
memberthas Booleansis_public,is_privateandis_protected. This was used, but not set infieldtand set but not used inmethodt.This also adds
ID_defaultwhen no other flag is set, in Java this allows visibility in the package, but not subclasses outside the package (cf. https://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html)