Project

General

Profile

Bug #4579

Remove all references to specific module names from the code.

Added by David Welker over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Immediate
Assignee:
Category:
core
Target version:
Start date:
11/24/2009
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
4579

Description

In certain areas of the code, there are references to specific module names. This is extremely problematic in two scenarios:

(1) When branching or publishing, the name of a module changes. So, module X becomes X-1.0, or X-1.0 becomes X-1.0.0

(2) When refactoring resources formerly in X, may end up in X, Y and Z.

In order to get the Kepler-1.1 branch to work, I had to refactor module names out of 7 classes across 4 different modules. This would be totally unnecessary if the new configuration system had not adopted a design where specific module names are referenced. Furthermore, when I publish the Kepler-1.1 branch, I will have to refactor all of these references once again. For every patch, these refrences will have to be refactored. And so on. At the very least, we need to solve problem (1). However, problem (2) should be solved as well, as it would be little work.

Finally, there is a related problem. Apparently, the name of modules is somehow referenced in setting Ptolemy names. But Ptolemy names cannot have a period. However, module names will have a period when they have a version attached.

The solution is to never reference a module name from the code.

Here is the stack trace:

ptolemy.kernel.util.IllegalActionException: Cannot set a name with a period: Actors-1.0
[run] in .<Unnamed Object>
[run] at ptolemy.kernel.util.NamedObj.setName(NamedObj.java:1917)
[run] at ptolemy.kernel.ComponentEntity.setName(ComponentEntity.java:603)
[run] at ptolemy.kernel.util.NamedObj.<init>(NamedObj.java:246)
[run] at ptolemy.kernel.util.NamedObj.<init>(NamedObj.java:215)
[run] at ptolemy.kernel.InstantiableNamedObj.<init>(InstantiableNamedObj.java:119)
[run] at ptolemy.kernel.Entity.<init>(Entity.java:135)
[run] at ptolemy.kernel.ComponentEntity.<init>(ComponentEntity.java:105)
[run] at ptolemy.kernel.CompositeEntity.<init>(CompositeEntity.java:163)
[run] at ptolemy.moml.EntityLibrary.<init>(EntityLibrary.java:202)
[run] at org.kepler.moml.FolderEntityLibrary.<init>(FolderEntityLibrary.java:44)
[run] at org.kepler.objectmanager.library.LibraryManager.createAndAddTreeItem(LibraryManager.java:378)
[run] at org.kepler.objectmanager.library.LibraryGenerator.generate(LibraryGenerator.java:83)
[run] at org.kepler.objectmanager.library.LibraryManager.buildLibrary(LibraryManager.java:212)
[run] at org.kepler.objectmanager.library.LibraryManager.initialize(LibraryManager.java:271)
[run] at org.kepler.moml.KARLibraryBuilder.buildLibrary(KARLibraryBuilder.java:75)
[run] at ptolemy.actor.gui.UserActorLibrary.openLibrary(UserActorLibrary.java:202)
[run] at ptolemy.actor.gui.UserActorLibrary.openUserLibrary(UserActorLibrary.java:140)
[run] at ptolemy.vergil.VergilApplication._createDefaultConfiguration(VergilApplication.java:322)
[run] at ptolemy.vergil.VergilApplication._createEmptyConfiguration(VergilApplication.java:339)
[run] at ptolemy.actor.gui.ConfigurationApplication._parseArgs(ConfigurationApplication.java:1116)
[run] at ptolemy.vergil.VergilApplication._parseArgs(VergilApplication.java:469)
[run] at ptolemy.actor.gui.ConfigurationApplication.<init>(ConfigurationApplication.java:226)
[run] at ptolemy.actor.gui.MoMLApplication.<init>(MoMLApplication.java:81)
[run] at ptolemy.vergil.VergilApplication.<init>(VergilApplication.java:104)
[run] at ptolemy.vergil.VergilApplication$1.run(VergilApplication.java:211)
[run] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
[run] at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
[run] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
[run] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
[run] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
[run] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
[run] at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
[run] ptolemy.kernel.util.IllegalActionException: Cannot set a name with a period: Directors-1.0
[run] in .<Unnamed Object>
[run] at ptolemy.kernel.util.NamedObj.setName(NamedObj.java:1917)
[run] at ptolemy.kernel.ComponentEntity.setName(ComponentEntity.java:603)
[run] at ptolemy.kernel.util.NamedObj.<init>(NamedObj.java:246)
[run] at ptolemy.kernel.util.NamedObj.<init>(NamedObj.java:215)
[run] at ptolemy.kernel.InstantiableNamedObj.<init>(InstantiableNamedObj.java:119)
[run] at ptolemy.kernel.Entity.<init>(Entity.java:135)
[run] at ptolemy.kernel.ComponentEntity.<init>(ComponentEntity.java:105)
[run] at ptolemy.kernel.CompositeEntity.<init>(CompositeEntity.java:163)
[run] at ptolemy.moml.EntityLibrary.<init>(EntityLibrary.java:202)
[run] at org.kepler.moml.FolderEntityLibrary.<init>(FolderEntityLibrary.java:44)
[run] at org.kepler.objectmanager.library.LibraryManager.createAndAddTreeItem(LibraryManager.java:378)
[run] at org.kepler.objectmanager.library.LibraryGenerator.generate(LibraryGenerator.java:83)
[run] at org.kepler.objectmanager.library.LibraryManager.buildLibrary(LibraryManager.java:212)
[run] at org.kepler.objectmanager.library.LibraryManager.initialize(LibraryManager.java:271)
[run] at org.kepler.moml.KARLibraryBuilder.buildLibrary(KARLibraryBuilder.java:75)
[run] at ptolemy.actor.gui.UserActorLibrary.openLibrary(UserActorLibrary.java:202)
[run] at ptolemy.actor.gui.UserActorLibrary.openUserLibrary(UserActorLibrary.java:140)
[run] at ptolemy.vergil.VergilApplication._createDefaultConfiguration(VergilApplication.java:322)
[run] at ptolemy.vergil.VergilApplication._createEmptyConfiguration(VergilApplication.java:339)
[run] at ptolemy.actor.gui.ConfigurationApplication._parseArgs(ConfigurationApplication.java:1116)
[run] at ptolemy.vergil.VergilApplication._parseArgs(VergilApplication.java:469)
[run] at ptolemy.actor.gui.ConfigurationApplication.<init>(ConfigurationApplication.java:226)
[run] at ptolemy.actor.gui.MoMLApplication.<init>(MoMLApplication.java:81)
[run] at ptolemy.vergil.VergilApplication.<init>(VergilApplication.java:104)
[run] at ptolemy.vergil.VergilApplication$1.run(VergilApplication.java:211)
[run] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
[run] at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
[run] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
[run] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
[run] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
[run] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
[run] at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

History

#1 Updated by Chad Berkley over 9 years ago

Modules can now be referenced by a stem name which is the base name before a version, for instance "common" refers to "common-1.0". The methods ModuleTree.getModuleByStemName() and Module.getStemName() can be used to access this name.

#2 Updated by Redmine Admin over 6 years ago

Original Bugzilla ID was 4579

Also available in: Atom PDF