facebook

Please Help me: Method should return an array

  1. MyEclipse Archived
  2.  > 
  3. UML Development
Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #242903 Reply

    snuser2
    Member

    Hi,

    i need to model a method which returns an array of objects. how can i implement this within myeclipseide?

    e.g: importStudentsFromFile(String studentList):Students[]

    hope anybody can give me a hint.

    thank you very much,
    snuser

    #242917 Reply

    Kapil Kapre
    Member

    snuser,
    Add a new method, double click it and just paste that signature into the in-place editor. Did that help?

    #242920 Reply

    snuser2
    Member

    thank you very much for your answer, i’ll try it.

    but first i have to solve another problem.

    i generated a subpackage within the uml diagram. but when i try to generate the java code the class within the subpackage isnt generated. i hav some more of these problems, when movin packages in or out of other packages the java code generation does not recognize my changes 🙁

    i am now using 4.0.3 under linux since i had problmes exporting diagrams to PNG with the M4.1 🙁

    mhh … i was so happy when myeclipseide added uml support 🙁

    #242925 Reply

    snuser2
    Member

    ahhh … i am driving nuts …. now i cant open my umr file “internal error” :-((((

    #242927 Reply

    snuser2
    Member

    Mhh .. i also tried to renemae the .umr~ file … but it doesnt work (but i can unzip the file so i dont think it’s corrupted)

    
     java.lang.IllegalArgumentException: 
        at org.eclipse.core.internal.runtime.Assert.isLegal(Assert.java:58)
        at org.eclipse.core.internal.runtime.Assert.isLegal(Assert.java:42)
        at org.eclipse.core.runtime.Status.setMessage(Status.java:174)
        at org.eclipse.core.runtime.Status.<init>(Status.java:81)
        at org.eclipse.ui.WorkbenchException.<init>(WorkbenchException.java:38)
        at org.eclipse.ui.PartInitException.<init>(PartInitException.java:36)
        at com.genuitec.eclipse.uml.editor.UMLEditor.init(UMLEditor.java:667)
        at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:778)
        at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596)
        at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:384)
        at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:552)
        at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:283)
        at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:126)
        at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:268)
        at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
        at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:391)
        at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1102)
        at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1051)
        at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1256)
        at org.eclipse.ui.internal.PartStack.add(PartStack.java:442)
        at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:109)
        at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:60)
        at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:212)
        at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:202)
        at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:758)
        at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:665)
        at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:628)
        at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2360)
        at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2295)
        at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage.java:2287)
        at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2273)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2268)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2249)
        at org.eclipse.ui.ide.IDE.openEditor(IDE.java:371)
        at org.eclipse.ui.ide.IDE.openEditor(IDE.java:334)
        at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:251)
        at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:131)
        at org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:49)
        at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:169)
        at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:153)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:222)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:198)
        at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:296)
        at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:869)
        at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:741)
        at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
        at org.eclipse.core.runtime.Platform.run(Platform.java:791)
        at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
        at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
        at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:739)
        at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:968)
        at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1067)
        at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:243)
        at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:238)
        at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:277)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1021)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2867)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2572)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
        at org.eclipse.core.launcher.Main.run(Main.java:973)
        at org.eclipse.core.launcher.Main.main(Main.java:948)
    
    #242932 Reply

    snuser2
    Member

    juhuuu … i could fix the umr problem by myself …

    there where some strange signs “^?” within the xmi (after unzipping) file.

    now it works …

    #242937 Reply

    Kapil Kapre
    Member

    sunser2,
    Thanks for following up with your experience. Could you give us the brief steps and what exactly you mean by

    i generated a subpackage within the uml diagram. but when i try to generate the java code the class within the subpackage isnt generated. i hav some more of these problems, when movin packages in or out of other packages the java code generation does not recognize my changes 🙁

    If we can isolate what exactly caused this behaviour, it would help us help you.
    Regarding those signs, what locale is your setup on?
    Thanks,
    Kapil

    #242940 Reply

    snuser2
    Member

    First of all i am using
    Eclipse 3.1.1 (Linux / Ubuntu)
    MyEclipse 4.0.3GA

    The Problem wit subpackages was the following: when playing around with the classes and packages (this means trying out where to place the classes and packages) i had to move and remove new ort old packages and classes. in some cases it seems like the java generator doesnt recognize that the location of a package or class has moved. e.g. i moved and renamed a package called “utility” but the java generator still offers me that package to generate.

    Another very very anoying problem is that after some time the “picture export” mechanism doesnt work. When i start a new umr the picture export works fine but after some time trying to export as .png only saves a 0 bit PNG. After that i cant work with the umr. (My english is too bad to describe what happens then but working in the diagram is not possible)

    #242941 Reply

    Kapil Kapre
    Member

    Are you using any command line parameters for increasing heap size when you start eclipse?
    Something like

    
     -vm -Xms128M -Xmx256M 
    
    #242943 Reply

    snuser2
    Member

    i use

    
     /usr/bin/eclipse -vm /usr/lib/j2sdk1.5-sun/ -vmargs -Xmx256m
    

    mhh .. strange, it seems like there was a carriage return after “-vm” ? …

    #242944 Reply

    Kapil Kapre
    Member

    That looks fine, Memory doesnt seem to be an issue. After several tries I could not replicate the behaviour you are describing. Can you give us any more detail? If we could replicate this issue our side that would help a lot in figuring out the cause.

    #242946 Reply

    snuser2
    Member

    Should i send you the umr ? it’s strange that after some time the image export fails (no error, just en empty file) and then my uml editor window scrambles when i move the mouse over it. it shows elements out of eclipse in the background so that i have toi restart eclipse.

    #242947 Reply

    Kapil Kapre
    Member

    Yes, that might help, send it along to support@genuitec.com with ATTN:Kapil as the subject.
    Thanks,
    Kapil

    #242952 Reply

    snuser2
    Member

    have you received my mail?

    #242953 Reply

    Kapil Kapre
    Member

    No, I havent yet, I’ll reply here w/ info as soon as I recieve the UMR.

Viewing 15 posts - 1 through 15 (of 17 total)
Reply To: Please Help me: Method should return an array

You must be logged in to post in the forum log in