facebook

(reverse engineering error) String index out of range: -40

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

    Hello,

    I’m a brand new MyEclipse user. I like what I’ve seen so far. However, I am running into an issue with MyUML during the Reverse Engineering process. It halts partway through Pass 1 and pops up an error dialogue box that reads “Creation of element failed. String index out of range: -40”.

    After I cancel out of the dialogue, I see that it’s gotten part of the way through the process.

    This project is fairly large, with 114 packages and 1080 class files. My Eclipse install is fairly fresh (less than a week old); I only had Checkstyle and PMD plugins installed prior to MyEclipse.

    Please let me know if you need any further information — system information and a logfile is attached. I’m willing to do whatever it takes to see this problem solved.

    Thanks,
    Steve

    *** Date: Mon Sep 11 11:57:08 EDT 2006

    *** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.4.2_06

    *** MyEclipse details:
    MyEclipse Enterprise Workbench

    Version: 5.0 GA
    Build id: 20060805-5.0-GA

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: 5.0.1 GA
    Build id: 20060810-5.0.1-GA

    Eclipse Graphical Editing Framework

    Version: 3.2.0.v20060626
    Build id: 20060627-0816

    Eclipse Platform

    Version: 3.2.0.v20060609m-AgOexn6hlEUsvBO
    Build id: M20060629-1905

    Eclipse RCP

    Version: 3.2.0.v20060609m-SVDNgVrNoh-MeGG
    Build id: M20060629-1905

    Eclipse Java Development Tools

    Version: 3.2.0.v20060609m-F7snq1fxia-Z4XP
    Build id: M20060629-1905

    Eclipse Plug-in Development Environment

    Version: 3.2.0.v20060609m——6zXJJzJzJq
    Build id: M20060629-1905

    Eclipse Project SDK

    Version: 3.2.0.v20060609m-GNq6oQq-7es-Y81
    Build id: M20060629-1905

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\eclipse320\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    1c8_74
    -clean
    -product
    com.genuitec.myeclipse.product.ide
    -vm
    C:\WINDOWS\system32\javaw.exe

    !SESSION 2006-09-11 11:42:20.253 ———————————————–
    eclipse.buildId=M20060629-1905
    java.version=1.4.2_06
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    Framework arguments: -product com.genuitec.myeclipse.product.ide
    Command-line arguments: -os win32 -ws win32 -arch x86 -clean -product com.genuitec.myeclipse.product.ide

    !ENTRY com.genuitec.eclipse.core 1 0 2006-09-11 11:42:35.191
    !MESSAGE Unable to locate .myeclipse.properties file

    !ENTRY org.eclipse.jdt.ui 4 10001 2006-09-11 11:44:08.425
    !MESSAGE Internal Error
    !STACK 0
    java.lang.reflect.InvocationTargetException
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:381)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:313)
    at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:851)
    at com.genuitec.eclipse.core.portability.NewElementWizard.performFinish(NewElementWizard.java:112)
    at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:680)
    at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:355)
    at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:660)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
    at org.eclipse.jface.window.Window.open(Window.java:796)
    at com.genuitec.eclipse.uml.action.UMLImportSourcesActionDelegate$2.run(UMLImportSourcesActionDelegate.java:72)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
    at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
    at org.eclipse.core.launcher.Main.run(Main.java:977)
    at org.eclipse.core.launcher.Main.main(Main.java:952)
    Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -40
    at java.lang.String.substring(Unknown Source)
    at com.genuitec.eclipse.uml.wizard.ReverseEngineerJavaWizard.parseFile(ReverseEngineerJavaWizard.java:429)
    at com.genuitec.eclipse.uml.wizard.ReverseEngineerJavaWizard.doImport(ReverseEngineerJavaWizard.java:177)
    at com.genuitec.eclipse.uml.wizard.ReverseEngineerJavaWizard.finishPage(ReverseEngineerJavaWizard.java:114)
    at com.genuitec.eclipse.core.portability.NewElementWizard$2.run(NewElementWizard.java:105)
    at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
    at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:720)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1737)
    at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4023)
    at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:369)
    … 36 more
    Root exception:
    java.lang.StringIndexOutOfBoundsException: String index out of range: -40
    at java.lang.String.substring(Unknown Source)
    at com.genuitec.eclipse.uml.wizard.ReverseEngineerJavaWizard.parseFile(ReverseEngineerJavaWizard.java:429)
    at com.genuitec.eclipse.uml.wizard.ReverseEngineerJavaWizard.doImport(ReverseEngineerJavaWizard.java:177)
    at com.genuitec.eclipse.uml.wizard.ReverseEngineerJavaWizard.finishPage(ReverseEngineerJavaWizard.java:114)
    at com.genuitec.eclipse.core.portability.NewElementWizard$2.run(NewElementWizard.java:105)
    at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
    at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:720)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1737)
    at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4023)
    at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:369)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:313)
    at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:851)
    at com.genuitec.eclipse.core.portability.NewElementWizard.performFinish(NewElementWizard.java:112)
    at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:680)
    at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:355)
    at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:660)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
    at org.eclipse.jface.window.Window.open(Window.java:796)
    at com.genuitec.eclipse.uml.action.UMLImportSourcesActionDelegate$2.run(UMLImportSourcesActionDelegate.java:72)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
    at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
    at org.eclipse.core.launcher.Main.run(Main.java:977)
    at org.eclipse.core.launcher.Main.main(Main.java:952)

    #258557 Reply

    Riyad Kalla
    Member

    I believe you emailed support@ with the same report, if you can send us a subset of the classes or just a project with the classes in them such that we can test the issue here locally and file a bug with the problomatic classes attached that will help us get to the bottom of the problem faster.

    support@genuitec.com ATTN Riyad with a link to this thread as a reminder to why I’m getting the files. Thank you.

    #258740 Reply

    Riyad,

    I didn’t get the fatal error the last time I tried the import. I think the issue may be a memory-related one.

    As far as my other UML issues are concerned, I’ll raise them in a new thread when I start doing more intense work with the UML UI.

    Thanks,
    Steve

    #258789 Reply

    Riyad Kalla
    Member

    Steve,
    Over support@ or other threads have you updated your command line arguments to increase the memory for MyEclipse? That can resolve many issues for memory intensive operations.

    #259434 Reply

    kristint
    Member

    Hello.
    I’m having the same issues as the starter of this thread. I’m to evaluate MyEclipse for my organization, mainly because of the Java Reverse Engineering abilities.
    As far as I can tell I’ve done everything according to the memory related fixes I’ve read about in these forums (although my eclipse launch at install time already had the memory setting recommended). Is there any other quick fixes you can recommend? I don’t have alot of time to do this, and I cannot due to secrecy issues mail you my project/classes. But we are only talking about 30-40 POJOs that I want to reverse engineer into UML….

    My system information og error log is similar to that of the thread starter, except that I’m using java version 1.5.0_06

    I know I’m not giving you much to go on here, but I just wondered if there was something else I could try before I simply give up… 🙂

    Error message: Creation of element failed. String index out of range: -6

    #259456 Reply

    Riyad Kalla
    Member

    kristint,
    Do these source files use Java 5 language features at all? Also does the rev eng process fail every time on the same file? If for example you rev eng 10 of the POJOs, first, then 10 more, then 10 more?

    #259633 Reply

    jdaggs
    Member

    To All Interested,

    Well just to add my two cents worth I happened upon the same error. the problem appeared to be solved by removing ‘=’ characters from my comments.
    I don’t know why this works but here is the test that proves it:

    
     public class EqualComment
    {
        
        // remove or change the "equals" character in order to test;
        
      private String someAttribute;  // This attribute = That attribute
      
      private String anotherAttribute;  //This attribute is That Attribute
       
    }
    

    There is exactly one = sign in the class above remove it and the reverse engineering will work. Leave it in and you get the error.

    #259669 Reply

    Riyad Kalla
    Member

    jdaggs,
    I added an equals to the comment and successfully DnD’d the class onto the UML diagram, can you show me what I did wrong:

    #259671 Reply

    kristint
    Member

    (sorry for my late reply).

    Yes, we’re using Java 5 specific features (generics and enums mostly).
    I cannot tell which class seems to generate the error as it doesn’t report anything and I cannot figure out any order in which the classes gets reverse engineered. It simply generates UML for 7-8 classes and then fails with the error.

    I’ll look for any “=” in the comments as suggested here.

    #259673 Reply

    kristint
    Member

    jdaggs, splendid, that was exactly what cause my error. Thank you!
    You should probably report it as a bug? Didn’t exactly enjoy searching through my comments 🙂

    #259692 Reply

    Riyad Kalla
    Member

    Guys I want to report this as a bug, but as you see above I’m reverse engineering a class with an equals in a comment with no problem, both using DnD and using the UML menu option… can someone point out where I’m going wrong trying to duplicate this?

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: (reverse engineering error) String index out of range: -40

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