This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 87498

Summary: Generated code is uncompilable for Generalization link between class and interface
Product: uml Reporter: Alexandr Scherbatiy <sunflower>
Component: Code GenerationAssignee: Trey Spiva <tspiva>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P1    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Alexandr Scherbatiy 2006-10-19 10:40:29 UTC
I am able to draw a generalization link from class to interface.
But generated code contains 'class extends interface' string and it is not
compilable.
See also issue 79835 and issue 80551.

Steps to reproduce:

- Create a Java-Model UML project
- Create a Class diagram
- Put a Class element on the diagram and name it 'MyClass'
- Put an Interface element on the diagram and name it 'Myinterface'
- Generate code for the UML project
  'MyClass.java' and 'MyInterface.java' files are generated

- Draw a Generalization link from class to interface
- Generate code for the UML project
  The generated code is:
  -------------------------------------------------------------------
  public class MyClass extends MyInterface {
    public MyClass() {
    }
  }
  ---------------------------------------------------------------------

  The code is not compiled:
  ---------------------------------------------------------------------
  UMLProject1Sources\src\MyClass.java:3: no interface expected here
  public class MyClass extends MyInterface {
  1 error
  BUILD FAILED (total time: 3 seconds)
  ---------------------------------------------------------------------
Comment 1 Trey Spiva 2006-10-19 22:15:26 UTC
Retrieving the source file path from a relative file name was not working correctly.  Also, we where 
defaulting to the UML language instead of the projects default language.
Comment 2 Andrew Korostelev 2006-10-20 09:47:45 UTC
verified in all-nbms-griffin-061019_8