Bug 129107 - Program crash when importing classes from a java file
Summary: Program crash when importing classes from a java file
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Slackware Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-13 22:29 UTC by Manuel Reinaldo
Modified: 2006-06-16 00:53 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Reinaldo 2006-06-13 22:29:56 UTC
Version:           1.5.3 (using KDE KDE 3.5.3)
Installed from:    Slackware Packages
Compiler:          gcc (GCC) 3.3.6 
OS:                Linux

When importing classes from the file included the program gives a signal 11.

It happens in Slackware 10.2 running under Colinux and in Fedora 5 running in Vmware both with Umbrello 1.5.3 and in Mandriva 10 (native) with Umbrello 1.5.2

I simplified the file to the minimum that causes the crash.

--------------------------------
import java.awt.*;
import java.io.*;
import javax.swing.*;
import javax.swing.table.*;
import java.awt.Toolkit;

public class DiffWatchPoints
{
  DefaultTableModel model = new DefaultTableModel(){
        public boolean isCellEditable(int rowIndex, int mColIndex) {
            return false;
        }
    };
  public void create() 
  {  
  }
}
Comment 1 Oliver Kellogg 2006-06-16 00:53:13 UTC
SVN commit 551903 by okellogg:

parseStmt(): Handle "new" and sequemce of statements at state member declaration.
BUG:129107


 M  +22 -1     javaimport.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/javaimport.cpp #551902:551903
@@ -331,7 +331,28 @@
     // At this point we know it's some kind of attribute declaration.
     while (1) {
         while (nextToken != "," && nextToken != ";") {
-            name += nextToken;  // add possible array dimensions to `name'
+            if (nextToken == "=") {
+                if ((nextToken = advance()) == "new") {
+                    advance();
+                    if ((nextToken = advance()) == "(") {
+                        skipToClosing('(');
+                        if ((nextToken = advance()) == "{") {
+                            skipToClosing('{');
+                        } else {
+                            skipStmt();
+                            break;
+                        }
+                    } else {
+                        skipStmt();
+                        break;
+                    }
+                } else {
+                    skipStmt();
+                    break;
+                }
+            } else {
+                name += nextToken;  // add possible array dimensions to `name'
+            }
             nextToken = advance();
         }
         UMLObject *o = Import_Utils::insertAttribute(m_klass, m_currentAccess, name, typeName, m_comment);