Closed joeseibel closed 5 years ago
Leave this open. There are likely more dependencies that can be removed.
Found that org.osate.workspace depends on UI plugins. When building/running standalone this pulls in unnecessary UI plugins. Either remove dependency or put contributed AADL into another plugin.
Looking at IAadlProject
interface and its implementation AadlProject
. The interface is used within the plug-in, but not really anywhere else. OsateCorePlugin.create()
returns an IAadlProject
, but nothing ever calls it. Nothing calls the methods in IAadlWorkpace
that return IAadlProject
.
The only thing outside the plug-in that uses IAadlWorkspace
is OsateCorePlugin.create()
but nothing ever calls it.
Nothing outside the plug-in uses IAadlElement
.
Interface IOpenable
isn't even implemented.
Interface IParent
is only extended by IAadlWorkspace
which we've already seen is useless.
Exception AadlModelException
is only used by IAadlElement
and friends.
I'm going to get rid of the above classes/interfaces.
Also got rid of OsateCorePlugin.create()
Utility class ForAllIFile
is completely unused. Going to delete.
PreferenceInitializer
is referenced in the plugin.xml
file. It is used to set the default values for the workspace preference values. This probably should not be in the "internal" package org.osate.internal.workspace
.
Classes CharOperation
and CoreUtility
are unused. Removing.
IResourceUtility
is only used by ReinstantiateAadl.getCurrentSelection()
. It uses the method isInstanceFile
. This should be changed to have a local test method, or test in more simplified manner. The isInstanceFile
method seems heavy-weight.
The plug-in contains a copy of antlr.jar
that is reexports.
This is relied upon by org.osate.annexsupport
and org.osate.xtext.aadl2
.
Not sure if this is a good or bad thing?
The plug-in contains the standard predeclared property sets as contributed resource extensions. These are okay.
The plug-in depends on org.eclipse.ui
because of workbench preferences. The getPreferenceStore()
method comes from AbstractUIPlugin
. The preference store classes seem to be part of the ui plug-ins.
The dependency org.eclipse.emf.common
doesn't seem to be necessary (at least after removing all the dead classes).
org.eclipse.core.runtime
and org.eclipse.core.resources
are needed for IResourceUtility
. Can be removed when this class is dealt with.
At this point this package is left with
antlr.jar
IResourceUtility
As stated above, IResourceUtility
is only used by ReinstantiateAadl.getCurrentSelection()
. It uses the method isInstanceFile
. What is the right way to test if a file is an instance file? I searched the rest of the workspace, and everything else is just testing the file extension. We should update ReinstantiateAadl
and get rid of IResourceUtility
which then means we can get rid of the dependencies on org.eclipse.core.runtime
and org.eclipse.core.resources
.
The bigger problem is the workbench preferences which unfortunately are tied to the UI. Clearly these should be separate from the contributed resources.
Do we really need to be carrying around antlr.jar
?
WorkspacePlugin
shows signs of old conventions that are still left around.
SOURCE_FILE_EXT
and SOURCE_FILE_EXT2
. Both have the same value.MODEL_FILE_EXT
and INSTANCE_FILE_EXT
. Both have the same value. The code claims that there should be an .aail2
extension. INSTANCE_FILE_EXT
seems to be the surviving extension, and MODEL_FILE_EXT
seems obsolete.IResourceUtilty
declares names for resource properties that seem like they should be useful, but no one uses them anywhere:
public static final QualifiedName ResourceWithSyntaxErrors = new QualifiedName("org.osate.ResourceWithSyntaxErrors",
"BadAadlFile");
public static final QualifiedName ResourceDerived = new QualifiedName("org.osate.ResourceDerived",
"IResourceDerived");
public static final QualifiedName IsInstanceModel = new QualifiedName("org.osate.IsInstanceModel",
"IsInstanceModel");
As I said before, the only actual use of anything in IResourceUtility
outside of itself is in the ReinstantiateAadl
action handler. This can be changed to just test the file extension against WorkspacePlugin.INSTANCE_FILE_EXT
which is what things in the graphics editor and a few others places do.
I'm interested in getting comments on the two above issues (multiple naming conventions and resource properties) before I fully make this change and remove the class IResourceUtility
.
Looking WorkspacePlugin
AADL_PROPERTIES_FILE
is never referencedAADL_PROJECT_FILE
is never referencedAADL_PACKAGES_DIR
is referenced, but I don't understand it's functionPROPERTY_SETS_DIR
is never referencedWe should separate the workbench preference stuff from the contributed resources. Ideally I would keep the contributed resources in org.osate.workbench
and move the workbench preferences to an existing plug-in. The plug-in org.osate.ui
is the obvious choice, but most of the workbench preferences references come from org.osate.xtext.aadl2.ui
and I don't know if it is okay for that plug-in to depend on org.osate.ui
.
Marking CharOperation
, CoreUtility
, and ForAllIFile
as @Deprecated
Copied IResourceUtility.isInsanceFile()
to org.osate.ui.handlers.ReinstantiateAadl
to remove it's one use.
.
Marked AADL_PROPERTIES_FILES
, AADL_PROJECT_FILE
, AADL_PACKAGES_DIR
, and PROPERTY_SETS_DIR
as @deprecated
. (In WorkspacePlugin
)
Going to move all the workbench preferences stuff to org.osate.core
. Everything that uses the preferences already depends on this project.
Removed dependency on org.eclipse.ui
. Had to fiddle with a method in CoreUtility
to make this work.
Also moving antlr.jar
to org.osate.core
. Everything that needs it already depends on org.osate.core
.
Removing dependencies on org.osate.workspace
from
org.osate.annexsupport
org.osate.core
org.osate.ocarina
org.osate.xtext.aadl2
org.osate.xtext.aadl2.ui
Actually left the dependencies of org.osate.ocarina
alone because that is in a different repository.
We should remove all unnecessary plug-in dependencies.