Bug 331655 - auto-generated getters and setters to attributes are private in generated java classes
Summary: auto-generated getters and setters to attributes are private in generated jav...
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: 2.30 (KDE releases 19.12)
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on: 351103
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-01 20:03 UTC by Jean Jung
Modified: 2020-02-07 09:21 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.29.80 (KDE Applications 19.11.80)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean Jung 2014-03-01 20:03:55 UTC
When generating java classes its generate the accessor methods (getters and setters) for private atributes. The methods are generated with private modifier.

Reproducible: Always

Steps to Reproduce:
1.Create a class.
2.Define private atributes. 
3.Export code.
Actual Results:  
Private getters and setters are generated for atributes.

Expected Results:  
Public getters and setters to be generated for private atributes.
Comment 1 Joris Steyn 2014-03-02 10:22:03 UTC
Thanks for reporting your issue.

There are currently two java code generators. If you enable the new code generator in Umbrello general settings, you can select the scope for accessor methods in the code generator wizard (second page, under Language Options).

If you find that the old generator provides in some use cases that new one does not  / does something better, please let us know.
Comment 2 Benedikt Geißler 2016-04-13 18:10:53 UTC
Unfortunately I do not see any further options for the export of Java code. I'm using Umbrello 2.18.3 from OpenSUSE Leap 42.1 and there setting further options is only possible at the C++ code export.
Comment 3 Ralf Habacker 2016-04-15 19:41:04 UTC
(In reply to Benedikt Geißler from comment #2)
> Unfortunately I do not see any further options for the export of Java code.
> I'm using Umbrello 2.18.3 from OpenSUSE Leap 42.1 and there setting further
> options is only possible at the C++ code export.
New codegenerator is only enabled in the git master branch because of major design issues. See bug 351103
Comment 4 Ralf Habacker 2019-11-10 19:01:18 UTC
Git commit aea379fb09ceadaa636f2b9374693c582dd8963d by Ralf Habacker.
Committed on 10/11/2019 at 19:00.
Pushed by habacker into branch 'release/19.12'.

Fix 'auto-generated getters and setters to atributes are private in generated java classes'
FIXED-IN:2.29.90 (KDE Applications 19.11.90)

M  +4    -4    umbrello/codegenerators/java/javawriter.cpp

https://commits.kde.org/umbrello/aea379fb09ceadaa636f2b9374693c582dd8963d