Ticket #233 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Deleted role classes occupy namespace

Reported by: amertgen Owned by: stephan
Priority: minor Milestone: OTDT_1.3.0_M4
Component: otmodel Version: 1.2.7
Keywords: Cc:

Description

  1. Delete a role from a team class
  2. Open "New Role"-dialog and type in the name of the deleted role
    -> Error "Type already exists"

Closing and cleaning the project doesn't help. Restarting Eclipse clears the error.

Change History

follow-up: ↓ 2   Changed 3 years ago by mosconi

I can't reproduce this issue with current unstable build 1.2.8.200904050010 on Windows/Sun JDK1.6 (although I have seen the issue live at your desk ;-)). Do you have some more details about your setting and scenario? Could you provide a reproducable example?

in reply to: ↑ 1 ; follow-up: ↓ 3   Changed 3 years ago by amertgen

Replying to mosconi:

Still experience the error in OT 1.2.8.200904122017:

1) Build new OT project. Add team and role. Save file.

public team class MyTeam {
        protected class MyRole {

        }
}

2) Delete role manually via text editing. Save file.

public team class MyTeam {

}

3) Right-click MyTeam in package explorer. Select New -> Role in context menu. Try typing MyRole -> Type already exists

in reply to: ↑ 2   Changed 3 years ago by stephan

  • component changed from ui to otmodel
  • milestone set to OTDT_2.0.0

Replying to amertgen:

Replying to mosconi: Still experience the error in OT 1.2.8.200904122017:

I was about to give up several futile attempts to reproduce it with the exact same tool version and the steps you provided. Until I made the following variation: While the role exists, I opened the team compilation unit (file icon with "J") in the package explorer to show the team class (yellow "T" icon). Need not open the class, but class already had the expandable ("I have children") triangle handle.

Since this difference is reproducable the diagnosis is quite obvious: the package explorer content provider, when asked whether the team class has children, accesses the role class by a reference that is not cleaned up when the role is deleted.

Looking at the code of PackageExplorerAdaptor?.ContentProvider? it is unlikely, that this role itself keeps the reference: it doesn't have any fields (except for one boolean flag).

Hence, it is more likely that the content provider only triggers some action which causes some other component to store this offending reference.

Note that this ticket could be likely be a variation of #115, therefor I change the component to otmodel.

  Changed 3 years ago by stephan

  • keywords delete removed
  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from OTDT_2.0.0 to OTDT_1.3.0_M4

The root cause of this issue is fixed in r21644. Indeed the mentioned ContentProvider was the culprit: by in-place array manipulation it made the Java elements to refer to OT elements where they should not.

#115 remains open, though.

Note: See TracTickets for help on using tickets.