Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
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
f8815726
Commit
f8815726
authored
Dec 21, 2019
by
Raphael PAGE
Committed by
Gerson SUNYE
Dec 21, 2019
Browse files
Revert "REMOVED ALL IF THEN ELSE"
This reverts commit
7f7099f9
.
parent
105e035d
Changes
3
Show whitespace changes
Inline
Side-by-side
input/.gitignore
0 → 100644
View file @
f8815726
/org.eclipse.jdt.source.all.xmi
src/main/atl/analysis.atl
View file @
f8815726
...
...
@@ -39,6 +39,7 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
--
thisModule.avoidThreadGroup(),
thisModule.useNotifyAllInsteadOfNotify(),
thisModule.dontCallThreadRun(),
-- Code Style rules
...
...
@@ -138,7 +139,6 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
-- thisModule.avoidStringBufferField()
-- thisModule.avoidThrowingNewInstanceOfSameException(),
-- thisModule.stringToString(),
-- thisModule.dontCallThreadRun(),
-- thisModule.methodWithSameNameAsEnclosingClass(),
-- thisModule.dontUseFloatTypeForLoopIndices(),
-- thisModule.methodWithSameNameAsEnclosingClass(),
...
...
@@ -267,7 +267,7 @@ rule MeasureStringToString(method : java!MethodInvocation) {
}
-- creates a new Measure when Thread.run() is used instead of Thread.start()
rule MeasureDontCallThreadRun(method : java!Method
Invoc
ation) {
rule MeasureDontCallThreadRun(method : java!Method
Declar
ation) {
to
om: smm!ObservedMeasure (
measure <- noc,
...
...
@@ -556,7 +556,7 @@ rule MeasureAvoidPrintStackTrace(method : java!MethodInvocation) {
}
-- creates a new Measure when Thread.run() is used instead of Thread.start()
rule measureAvoidThreadGroup(variable : java!VariableDeclaration
Frag
ment) {
rule measureAvoidThreadGroup(variable : java!VariableDeclaration
State
ment) {
to
om: smm!ObservedMeasure (
measure <- noc,
...
...
src/main/atl/multithreading.atl
View file @
f8815726
...
...
@@ -5,9 +5,10 @@ library multithreading;
--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!MethodInvocation.allInstances()
-> select (m | m.method.name='run' )
-> select (m | m.method.abstractTypeDeclaration.name = 'Thread' )
java!MethodDeclaration.allInstances()
-> select (m | m.name='run' )
-> select (m | m.abstractTypeDeclaration <> OclUndefined )
-> select (m | m.abstractTypeDeclaration.name = 'Thread' )
-> collect (m | thisModule.MeasureDontCallThreadRun(m));
--------------------------------------------- AvoidThreadGroup ---------------------------------------------
...
...
Write
Preview
Markdown
is supported
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