-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from anneetien/230-Add-transientvolatilesynch…
…ronized-to-FamixJava-copied-from-compatibility-MM Add Transient, volatile and synchronized by copying Compatibility MM …
- Loading branch information
Showing
6 changed files
with
194 additions
and
6 deletions.
There are no files selected for viewing
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
45 changes: 45 additions & 0 deletions
45
src/Famix-Java-Entities/FamixJavaTCanBeSynchronized.trait.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
" | ||
I allow an entity to be synchronized | ||
ex: | ||
```java | ||
public class SynchronizedCounter { | ||
private int c = 0; | ||
public synchronized void increment() { | ||
c++; | ||
} | ||
} | ||
``` | ||
" | ||
Trait { | ||
#name : #FamixJavaTCanBeSynchronized, | ||
#instVars : [ | ||
'#isSynchronized => FMProperty' | ||
], | ||
#category : #'Famix-Java-Entities-Traits' | ||
} | ||
|
||
{ #category : #meta } | ||
FamixJavaTCanBeSynchronized classSide >> annotation [ | ||
|
||
<FMClass: #TCanBeSynchronized super: #Object> | ||
<package: #'Famix-Java-Entities'> | ||
<generated> | ||
^self | ||
] | ||
|
||
{ #category : #accessing } | ||
FamixJavaTCanBeSynchronized >> isSynchronized [ | ||
|
||
<FMProperty: #isSynchronized type: #Boolean> | ||
<generated> | ||
<FMComment: 'Entity can be declared synchronized'> | ||
^ isSynchronized | ||
] | ||
|
||
{ #category : #accessing } | ||
FamixJavaTCanBeSynchronized >> isSynchronized: anObject [ | ||
<generated> | ||
isSynchronized := 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
" | ||
I allow an entity to be transient | ||
ex: | ||
```java | ||
public class Student implements Serializable{ | ||
transient int age; //Now it will not be serialized | ||
} | ||
``` | ||
" | ||
Trait { | ||
#name : #FamixJavaTCanBeTransient, | ||
#instVars : [ | ||
'#isTransient => FMProperty' | ||
], | ||
#category : #'Famix-Java-Entities-Traits' | ||
} | ||
|
||
{ #category : #meta } | ||
FamixJavaTCanBeTransient classSide >> annotation [ | ||
|
||
<FMClass: #TCanBeTransient super: #Object> | ||
<package: #'Famix-Java-Entities'> | ||
<generated> | ||
^self | ||
] | ||
|
||
{ #category : #accessing } | ||
FamixJavaTCanBeTransient >> isTransient [ | ||
|
||
<FMProperty: #isTransient type: #Boolean> | ||
<generated> | ||
<FMComment: 'Entity can be declared transient'> | ||
^ isTransient | ||
] | ||
|
||
{ #category : #accessing } | ||
FamixJavaTCanBeTransient >> isTransient: anObject [ | ||
<generated> | ||
isTransient := 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
" | ||
I allow an entity to be volatible | ||
ex: | ||
```java | ||
public class SharedObject { | ||
public volatile int counter = 0; | ||
} | ||
``` | ||
" | ||
Trait { | ||
#name : #FamixJavaTCanBeVolatile, | ||
#instVars : [ | ||
'#isVolatile => FMProperty' | ||
], | ||
#category : #'Famix-Java-Entities-Traits' | ||
} | ||
|
||
{ #category : #meta } | ||
FamixJavaTCanBeVolatile classSide >> annotation [ | ||
|
||
<FMClass: #TCanBeVolatile super: #Object> | ||
<package: #'Famix-Java-Entities'> | ||
<generated> | ||
^self | ||
] | ||
|
||
{ #category : #accessing } | ||
FamixJavaTCanBeVolatile >> isVolatile [ | ||
|
||
<FMProperty: #isVolatile type: #Boolean> | ||
<generated> | ||
<FMComment: 'Entity can be declared volatile'> | ||
^ isVolatile | ||
] | ||
|
||
{ #category : #accessing } | ||
FamixJavaTCanBeVolatile >> isVolatile: anObject [ | ||
<generated> | ||
isVolatile := 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