google-code-export / umple

Automatically exported from code.google.com/p/umple
1 stars 0 forks source link

Eclipse hangs when a circular generalization error message is expected #592

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Attempt to compile the following code with the eclipse plugin

class A {
  isA B;
  name;
}

class B {
  isA A;
}

What is the expected output? What do you see instead?
The plugin should output a circularity error "Class 'B' cannot cyclically 
extend Class 'A'"

Instead, eclipse hangs.

Note that the variable underneath the "isA B" is required. Without the 
variable, the error is generated properly. The variable can be in either class, 
but it is required to reproduce the error.

This error also causes umpleonline to become unresponsive.

Original issue reported on code.google.com by CraigBry...@gmail.com on 10 Jun 2014 at 4:56

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Another situation with this that is possibly related.
The code below, when compiled in eclipse, compiles sometimes, but other times 
gives a stackoverflow exception (stacktrace below):

class A {
  isA B;
  isA C;
}

class B {
  isA A;
}

class C {

}

!ENTRY org.eclipse.ui 4 0 2014-06-10 13:25:17.254
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.StackOverflowError
    at java.util.Collections$UnmodifiableList.<init>(Collections.java:1204)
    at java.util.Collections$UnmodifiableRandomAccessList.<init>(Collections.java:1282)
    at java.util.Collections.unmodifiableList(Collections.java:1190)
    at cruise.umple.compiler.UmpleClass.getSubclasses(UmpleClass.java:856)
    at cruise.umple.compiler.UmpleClass.notifySubclassesAncestorImmutable(UmpleClass.java:2443)
    at cruise.umple.compiler.UmpleClass.propagateImmutabilityToAllRelationships(UmpleClass.java:2437)
    at cruise.umple.compiler.UmpleClass.setAncestorIsImmutable(UmpleClass.java:2466)
    at cruise.umple.compiler.UmpleClass.notifySubclassesAncestorImmutable(UmpleClass.java:2445)
    at cruise.umple.compiler.UmpleClass.propagateImmutabilityToAllRelationships(UmpleClass.java:2437)
    at cruise.umple.compiler.UmpleClass.setAncestorIsImmutable(UmpleClass.java:2466)
    at cruise.umple.compiler.UmpleClass.notifySubclassesAncestorImmutable(UmpleClass.java:2445)
    at cruise.umple.compiler.UmpleClass.propagateImmutabilityToAllRelationships(UmpleClass.java:2437)
    at cruise.umple.compiler.UmpleClass.setAncestorIsImmutable(UmpleClass.java:2466)
    at cruise.umple.compiler.UmpleClass.notifySubclassesAncestorImmutable(UmpleClass.java:2445)
    at cruise.umple.compiler.UmpleClass.propagateImmutabilityToAllRelationships(UmpleClass.java:2437)
    at cruise.umple.compiler.UmpleClass.setAncestorIsImmutable(UmpleClass.java:2466)
    at cruise.umple.compiler.UmpleClass.notifySubclassesAncestorImmutable(UmpleClass.java:2445)
    at cruise.umple.compiler.UmpleClass.propagateImmutabilityToAllRelationships(UmpleClass.java:2437)
    at cruise.umple.compiler.UmpleClass.setAncestorIsImmutable(UmpleClass.java:2466)
    at cruise.umple.compiler.UmpleClass.notifySubclassesAncestorImmutable(UmpleClass.java:2445)
    at cruise.umple.compiler.UmpleClass.propagateImmutabilityToAllRelationships(UmpleClass.java:2437)
    at cruise.umple.compiler.UmpleClass.setAncestorIsImmutable(UmpleClass.java:2466)
....etc

Original comment by CraigBry...@gmail.com on 10 Jun 2014 at 6:32

GoogleCodeExporter commented 9 years ago
An even simpler case causes this hang:

class A {
  isA A;
  variable;
}

This causes the hang with the latest eclipse plugin, umpleonline, the current 
version of umple.jar, and an older version of umple.jar (umple_1.19.0.3287.jar).

Original comment by CraigBry...@gmail.com on 11 Jun 2014 at 1:46

GoogleCodeExporter commented 9 years ago
Another related problem with interfaces:

This code detects the cycle:

interface A {
  isA A;
  variable;
}

but, the follow code is processed without error:

interface A {
  variable;
  isA A;
}

Original comment by CraigBry...@gmail.com on 11 Jun 2014 at 2:54

GoogleCodeExporter commented 9 years ago
This bug appears to be caused by the fix for issue 543.

Specifically, line 1183 of UmpleInternalParser_CodeClass.ump.

Original comment by CraigBry...@gmail.com on 11 Jun 2014 at 6:35

GoogleCodeExporter commented 9 years ago
Much of the issue is solved but not the second part of comment 4

Original comment by TimothyCLethbridge on 11 Jun 2014 at 8:58

GoogleCodeExporter commented 9 years ago
The unsolved part of this issue is covered by issue 596.

Original comment by CraigBry...@gmail.com on 12 Jun 2014 at 4:17