-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfindings.txt
More file actions
49 lines (29 loc) · 3.87 KB
/
findings.txt
File metadata and controls
49 lines (29 loc) · 3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
HIGH — Will silently break on upstream API changes
1. [FIXED] SysML2PlantUMLText — blind constructor reflection (DiagramCommand.createViz())
createViz() now uses injector.getInstance(SysML2PlantUMLText.class) via the Guice injector. SysML2PlantUMLText is imported directly. No constructor iteration remains.
2. [FIXED] SysML2PlantUMLText — 7-name method fallback chain (DiagramCommand.generatePlantUML())
generatePlantUML() now calls createViz().sysML2PUML(List<EObject>) directly. The fallback chain is gone. The correct API method is documented in the class-level comment.
3. [OPEN] Private field access in SysMLEngineHelper — injector field
setAccessible(true) is still used to read SysMLInteractive's private static injector field (SysMLEngineHelper.java, around line 100). The code comment acknowledges that SysMLInteractive does not expose a public getInjector() method, making this an upstream API gap. The index-field access mentioned originally appears to have been removed. The injector reflection remains the only unresolved HIGH item.
4. [FIXED] getResourceSet() and getRootElement() called via reflection
Both are now called as direct method invocations. Reflection for these methods was removed in commit 8b508f3.
MEDIUM — Breaks on metamodel refactoring
5. [FIXED] Hardcoded metamodel type names as strings
All eClass().getName().equals/contains() type dispatch replaced with generated model type checks (org.omg.sysml.lang.sysml.*):
- DiagramCommand.isPackageLike(): uses exact EClass identity via SysMLPackage.eINSTANCE — instanceof cannot be used here because Package/LibraryPackage/Namespace are supertypes of almost every SysML element (Requirements, Parts, etc. all extend Namespace)
- DiagramCommand.collectFeatureValues(): now uses instanceof FeatureValue
- DiagramCommand.findView(): now uses instanceof ViewDefinition / ViewUsage
- DiagramCommand.getExposedElements(): now uses instanceof Expose
- ViewsCommand.collectViews(): now uses instanceof ViewDefinition / ViewUsage
- ViewsCommand.listChildren(): now uses instanceof Expose
6. [FIXED] Hardcoded reference name "importedElement" in two places
Both DiagramCommand.getExposedElements() and ViewsCommand.listChildren() now cast to Expose (which extends Import) and call expose.getImportedElement() directly. The EReference loop and string lookup are eliminated.
7. [FIXED] SysMLStandaloneSetup.doSetup() via Class.forName()
No Class.forName() call exists in the codebase. SysMLEngineHelper uses SysMLInteractive.createInstance(), which handles all Xtext/EMF standalone setup (KerMLStandaloneSetup, SysMLxStandaloneSetup, SysMLStandaloneSetup) internally. This finding was already resolved.
LOW — Acceptable but worth noting
8. [FIXED] getOwnedMember() reflection with fallback to eContents()
DiagramCommand.getTopLevelMembers() now casts to org.omg.sysml.lang.sysml.Namespace and calls ns.getOwnedMember() directly. The reflection was removed as part of the MEDIUM type-dispatch fixes (finding 5). The eContents() fallback remains for non-Namespace elements.
9. [FIXED] getType() reflection in ViewsCommand.getTypeAnnotation()
Now casts to org.omg.sysml.lang.sysml.Feature and calls f.getType() directly (returns EList<Type>). ViewUsage and most other annotated elements extend Feature, so the instanceof check is correct. Returns "" for non-Feature elements (same as before).
10. [FIXED] Issue diagnostics reflection in ValidateCommand
ValidateCommand.getMessage() now casts to org.eclipse.xtext.validation.Issue and calls getMessage(), getLineNumber(), getColumn() directly — no reflection. SysMLEngineHelper.isErrorSeverity() was fixed in the same pass: now casts to Issue and compares getSeverity() == Severity.ERROR instead of string-matching the toString(). Both SysMLInteractive.validate() and IResourceValidator.validate() return List<Issue>, so the cast is always valid. The Resource.Diagnostic fallback remains for non-Issue diagnostics.