Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Roxane MARECHAL
Source Code Analyzer
Commits
4eb8c8c7
Commit
4eb8c8c7
authored
Dec 22, 2019
by
Gerson Sunyé
Browse files
code reorganization
parent
6b87db32
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/atl/multithreading.atl
View file @
4eb8c8c7
library multithreading;
--------------------------------------------- DontCallThreadRun ---------------------------------------------
--Goes through all the methods to check if the following rule is followed:
--Don't call Thread.run()
--- Goes through all the variables to check if the following rule is followed:
--- Avoid using java.lang.ThreadGroup;
helper def: avoidThreadGroup() : Set(smm!Measure) =
java!VariableDeclarationStatement.allInstances()
-> select(variable | variable.type.type.name = 'ThreadGroup')
-> collect(variable | thisModule.measureAvoidThreadGroup(variable) );
--- Goes through all the methods to check if the following rule is followed:
--- Don't call Thread.run()
helper def: dontCallThreadRun() : Set(smm!Measure) =
java!MethodDeclaration.allInstances()
-> select (m | m.name='run' )
...
...
@@ -11,18 +18,7 @@ helper def: dontCallThreadRun() : Set(smm!Measure) =
-> select (m | m.abstractTypeDeclaration.name = 'Thread' )
-> collect (m | thisModule.MeasureDontCallThreadRun(m));
--------------------------------------------- AvoidThreadGroup ---------------------------------------------
--Goes through all the variables to check if the following rule is followed:
--Avoid using java.lang.ThreadGroup;
helper def: avoidThreadGroup() : Set(smm!Measure) =
java!VariableDeclarationStatement.allInstances()
-> select(variable | variable.type.type.name = 'ThreadGroup')
-> collect(variable | thisModule.measureAvoidThreadGroup(variable) );
--------------------------------------------- UseNotifyAllInsteadOfNotify ---------------------------------------------
-- Returns a set of measures each time the method 'notify()' is used instead of 'notifyAll()'
--- Returns a set of measures each time the method 'notify()' is used instead of 'notifyAll()'
helper def: useNotifyAllInsteadOfNotify(): Set(smm!Measure) =
-- Get the method declarations of notify() and for each of their MethodInvocation usages, create a measure
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment