-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Model: - rename relation TType's relation to ValueEntity from `values` to `valueInstances`, to avoid clash with TTypedEntity's relation to ValueEntity (because of FamixJavaParameterType which uses both) Importer: - handle class references - handle enums - do not remove @type and @id keys when iterating over raw values (that made debugging difficult) - handle field descriptors with anonymous classes (using `$` as separator instead of a dot) - search for attributes on parametric classes by asking the generic superclass - infer using concrete parameter types - read declared type array dimensions - implicit switch from int to long when out of bounds Exporter: - handle class references - throw error when reaching broken state instead of persevering and generating uncompilable code - correctly export qualified names of any class using dispatch (there were problems with inner classes) - when finding accessed attributes in a method, handle case where variable is the receiver - add `withSubHierarchy` to also find interface implementors - work around VerveineJ problems by adding nil checks where they should normally never occur - better exception handling when using reflection - more polymorphism on UnknownType - add explicit cast to disambiguate between int and long when calling helpers - WIP handling of exceptions thrown by constructors and accessors Types: - handle `java.util.Calendar`
- Loading branch information
1 parent
d95b700
commit e18362d
Showing
37 changed files
with
495 additions
and
151 deletions.
There are no files selected for viewing
11 changes: 0 additions & 11 deletions
11
src/Famix-Value-Entities-Extensions/FamixValueOfObject.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
Extension { #name : 'FamixTType' } | ||
|
||
{ #category : '*Famix-Value-Entities-accessing' } | ||
FamixTType >> valueReferences [ | ||
"Relation named: #valueReferences type: #FamixValueOfTypeReference opposite: #value" | ||
FamixTType >> valueInstances [ | ||
"Relation named: #valueInstances type: #FamixValueOfType opposite: #type" | ||
|
||
<generated> | ||
<derived> | ||
<FMProperty: #valueReferences type: #FamixValueOfTypeReference opposite: #value> | ||
<FMProperty: #valueInstances type: #FamixValueOfType opposite: #type> | ||
<package: #'Famix-Value-Entities'> | ||
^ self attributeAt: #valueReferences ifAbsentPut: [ FMMultivalueLink on: self opposite: #value: ] | ||
^ self attributeAt: #valueInstances ifAbsentPut: [ FMMultivalueLink on: self opposite: #type: ] | ||
] | ||
|
||
{ #category : '*Famix-Value-Entities-accessing' } | ||
FamixTType >> valueReferences: anObject [ | ||
FamixTType >> valueInstances: anObject [ | ||
|
||
<generated> | ||
self valueReferences value: anObject | ||
self valueInstances value: anObject | ||
] | ||
|
||
{ #category : '*Famix-Value-Entities-accessing' } | ||
FamixTType >> values [ | ||
"Relation named: #values type: #FamixValueOfType opposite: #type" | ||
FamixTType >> valueReferences [ | ||
"Relation named: #valueReferences type: #FamixValueOfTypeReference opposite: #value" | ||
|
||
<generated> | ||
<derived> | ||
<FMProperty: #values type: #FamixValueOfType opposite: #type> | ||
<FMProperty: #valueReferences type: #FamixValueOfTypeReference opposite: #value> | ||
<package: #'Famix-Value-Entities'> | ||
^ self attributeAt: #values ifAbsentPut: [ FMMultivalueLink on: self opposite: #type: ] | ||
^ self attributeAt: #valueReferences ifAbsentPut: [ FMMultivalueLink on: self opposite: #value: ] | ||
] | ||
|
||
{ #category : '*Famix-Value-Entities-accessing' } | ||
FamixTType >> values: anObject [ | ||
FamixTType >> valueReferences: anObject [ | ||
|
||
<generated> | ||
self values value: anObject | ||
self valueReferences value: anObject | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Extension { #name : 'FamixJavaInterface' } | ||
|
||
{ #category : '*Famix-Value-Exporter' } | ||
FamixJavaInterface >> withSubHierarchy [ | ||
"Includes subinterfaces and their implementing classes" | ||
|
||
| result | | ||
result := Set new. | ||
self withSubclassHierarchy do: [ :interface | | ||
result add: interface. | ||
interface implementations do: [ :implementation | | ||
implementation implementingClass withSubclassesDo: [ :class | | ||
result add: class ] ] ]. | ||
^ result asOrderedCollection | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Extension { #name : 'FamixJavaPackage' } | ||
|
||
{ #category : '*Famix-Value-Exporter' } | ||
FamixJavaPackage >> fullyQualifiedNameOn: aFASTJavaModel [ | ||
|
||
^ parentPackage | ||
ifNil: [ aFASTJavaModel newQualifiedName name: name ] | ||
ifNotNil: [ | ||
aFASTJavaModel newQualifiedName | ||
name: name; | ||
namespace: (parentPackage fullyQualifiedNameOn: aFASTJavaModel) ] | ||
] | ||
|
||
{ #category : '*Famix-Value-Exporter' } | ||
FamixJavaPackage >> fullyQualifiedTypeNameOn: aFASTJavaModel [ | ||
|
||
^ parentPackage | ||
ifNil: [ aFASTJavaModel newQualifiedTypeName name: name ] | ||
ifNotNil: [ | ||
aFASTJavaModel newQualifiedTypeName | ||
name: name; | ||
namespace: | ||
(parentPackage fullyQualifiedTypeNameOn: aFASTJavaModel) ] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Extension { #name : 'FamixJavaWildcard' } | ||
|
||
{ #category : '*Famix-Value-Exporter' } | ||
FamixJavaWildcard >> needsJavaImport [ | ||
|
||
^ false | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Extension { #name : 'FamixTWithInheritances' } | ||
|
||
{ #category : '*Famix-Value-Exporter' } | ||
FamixTWithInheritances >> withSubHierarchy [ | ||
"Returns the complete sub-hierarchy, see implementors for special cases" | ||
|
||
^ self withSubclassHierarchy | ||
] |
Oops, something went wrong.