| Summary: | getters/setters are private in generated java sources | ||
|---|---|---|---|
| Product: | [Applications] umbrello | Reporter: | noster |
| Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Debian stable | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
noster
2003-05-27 20:00:34 UTC
I believe that this has been fixed. You can now choose to set the get/set accessor method scope (visibility) according to a fixed choice, or the parent attribute/role visibility. fixed by Brian Thomas some time ago If it is possible to differentiate the accessor method scope from the attribute scope, I don't see a way to indicate this in the interface.
To be truly useful for Java code generation, here are the rules:
- if scope is private, create a private field with *no* accessors.
- if scope is public, create a *private* field with *public*-scope accessors.
// Fields
private int myPrivateAttribute;
private int myPublicAttribute;
...
// Accessor methods
// There should be no accessors for myPrivateAttribute!
/**
* Set the value of myPublicAttribute
* @param newVar the new value of myPublicAttribute
*/
private void setMyPublicAttribute ( int newVar ) {
myPublicAttribute = newVar;
}
/**
* Get the value of myPublicAttribute
* @return the value of myPublicAttribute
*/
private int getMyPublicAttribute ( ) {
return myPublicAttribute;
}
Aargh! now my comments have the bug:
accessors should be:
/**
* Set the value of myPublicAttribute
* @param newVar the new value of myPublicAttribute
*/
public void setMyPublicAttribute ( int newVar ) {
myPublicAttribute = newVar;
}
/**
* Get the value of myPublicAttribute
* @return the value of myPublicAttribute
*/
public int getMyPublicAttribute ( ) {
return myPublicAttribute;
}
|