- This topic has 6 replies, 2 voices, and was last updated 12 years, 11 months ago by support-swapna.
-
AuthorPosts
-
myeclipse_user_1ParticipantWhen generating Java from a UML class diagram by following these steps:
Select abc.uml, right click, MyEclipse, Generate Java …
Default values of class attributes are missing from generated Java class.
Exmaple:
=======UML:
STUBTYPE : String = EJBStubJava:
– Generated:
private static String STUBTYPE;– Expected:
private static String STUBTYPE = “EJBStub”;*** Date:
Friday, November 25, 2011 3:17:05 PM EST** System properties:
OS=WindowsXP
OS version=5.1.0
Java version=1.6.0_21Installation Summary:
=================*** MyEclipse details:
MyEclipse Enterprise Workbench
Version: 9.1
Build id: 9.1-20110701*** Eclipse details:
Eclipse Java EE IDE for Web Developers.Version: Helios Service Release 2
Build id: 20110218-0911Eclipse Platform
Version: 3.6.2.r362_v20110210-9gF78Gs1FrIGnHDHWkEcopoN8AmxeZflGDGKQi
Build id: M20110210-1200Eclipse Java Development Tools
Version: 3.6.2.r362_v20101117-0800-7z8XFW6FLFlmjJcvz03jyeFBLS_F
Build id: M20110210-1200Eclipse Graphical Editing Framework GEF
Version: 3.6.1.v20100908-1100-777B181A3Bz-6B663E7974242
Build id: 201009132020Eclipse RCP
Version: 3.6.2.r362_v20101104-9SAxFMKFkSAqi8axkv1ZjegmiBLY
Build id: M20110210-1200Eclipse Plug-in Development Environment
Version: 3.6.2.r362_v20110203-7b7mFL2FET3dhHalh1iNZtL
Build id: M20110210-1200Eclipse startup command=-os
win32
-ws
win32
-arch
x86
-showsplash
-launcher
C:\Chordiant_6_6\eclipse\eclipse.exe
-name
Eclipse
–launcher.library
C:\Chordiant_6_6\eclipse\plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222\eclipse_1312.dll
-startup
C:\Chordiant_6_6\eclipse\plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
-exitdata
aa4_40
-product
org.eclipse.epp.package.jee.product
-showlocation
-data
C:\POC_Project_9_0
-vm
C:/Chordiant_6_6/Oracle/Middleware/jdk160_21/bin/javaw.exe
support-swapnaModeratormyeclipse_user_1 ,
Sorry that you are seeing this issue with MyEclipse.
Can you answer some more questions for us ?
1) How did you install MyEclipse ? Is it through All-In-One Installer/Pulse/ Archived Update Site ?
2) Also share your Operating System and version details.
3) Can you give us detail steps on how you are creating the uml class diagram and adding the Stubtype to it for us to be able to replicate it at our end ?
myeclipse_user_1Participant1)
I installed eclipse JEE helios SR2 first:
File Name: eclipse-jee-helios-SR2-win32.zipThen installed myeclipse (Help -> Install New Software). Installed everything except for “MyEclipse Spring Optional Modules”.
File Name: myeclipse-9.1-archived-update-site.zipAlso, I was able to recreate this in MyEclipse 10:
File Name: myeclipse-10.0-offline-installer-windows.exe2)
Operating System:
Windows XP – Service Pack 33)
– Create test.uml (New -> MyEclipse -> UML -> UML2 Model -> test.uml)
– Create TestClass in test.umldi
– Select TestClass -> right click -> Add Property -> add new property called STUBTYPE
– Goto Outline -> Select <Model> test -> Rigth Click -> Generate Primitive Types -> UML
– Select STUBTYPE -> right click -> Show Properties -> Model -> Type -> String
– Select STUBTYPE -> right click -> Show Properties -> Advanced -> Default -> enter EJBStub (I tried “EJBStub” as well)
– Save all changes
– Goto Package Explorer -> Select test.uml -> Right Click -> MyEclipse -> Generate Java -> select /src of an existing Java Project -> Finish
– Open TestClass.java in that /src folder
– Default value we entered (EJBStub) is missing
support-swapnaModeratormyeclipse_user_1,
Thank you for the detailed steps. I could replicate the issue at my end.
I have filed a PR for the dev team to work on it.
Sorry for any inconvenience caused.
support-swapnaModeratormyeclipse_user_1 ,
I could get the default value in the generated class by selecting the isReadOnly option.
Select STUBTYPE -> right click -> Show Properties -> Model > Check the isReadOnlyAttached is the screenshot for your reference.
Let us know how it works for you.
Attachments:
You must be logged in to view attached files.
myeclipse_user_1ParticipantThanks for your reply.
I tried the steps you mentioned and it works fine. But it generated “final” attribute which is correct since we wanted it to be read only.
In our case, we do not want the attribute to be “final”.
support-swapnaModeratormyeclipse_user_1 ,
Our dev team is working on this issue. You can see it fixed in the next release.
Sorry for any inconvenience caused. -
AuthorPosts