Commit 347e5c01 authored by Gerson SUNYE's avatar Gerson SUNYE
Browse files

Merge branch 'master' into 'master'

Adding bahaviors in rules DoNotExtendJavaLangThrowable and DoNotExtendJavaLangError"

Closes #679, #736, #901, #898, and #810

See merge request naomod/mde/projet-2019!53
parents e4f84b7d e1fae55c
......@@ -7,7 +7,11 @@
</ownedElements>
<ownedElements xsi:type="java:ClassDeclaration" originalCompilationUnit="//@compilationUnits.1" name="DoNotExtendJavaLangErrorNotPass2">
<modifier visibility="public"/>
<superClass type="//@ownedElements.1/@ownedPackages.0/@ownedElements.1"/>
<superClass type="//@ownedElements.1/@ownedPackages.0/@ownedElements.1">
<qualifier xsi:type="java:PackageAccess" package="//@ownedElements.1/@ownedPackages.0">
<qualifier package="//@ownedElements.1"/>
</qualifier>
</superClass>
</ownedElements>
<ownedElements xsi:type="java:ClassDeclaration" originalCompilationUnit="//@compilationUnits.2" name="DoNotExtendJavaLangErrorNotPass1">
<modifier visibility="public"/>
......@@ -17,8 +21,8 @@
<modifier visibility="public"/>
</ownedElements>
</ownedElements>
<ownedElements name="java" proxy="true">
<ownedPackages name="lang" proxy="true">
<ownedElements name="java" proxy="true" usagesInPackageAccess="//@ownedElements.0/@ownedElements.1/@superClass/@qualifier/@qualifier">
<ownedPackages name="lang" proxy="true" usagesInPackageAccess="//@ownedElements.0/@ownedElements.1/@superClass/@qualifier">
<ownedElements xsi:type="java:ClassDeclaration" name="Object" proxy="true" usagesInTypeAccess="//@ownedElements.0/@ownedElements.0/@superClass"/>
<ownedElements xsi:type="java:ClassDeclaration" name="Error" proxy="true" usagesInTypeAccess="//@ownedElements.0/@ownedElements.1/@superClass //@ownedElements.0/@ownedElements.2/@superClass">
<superClass type="//@ownedElements.1/@ownedPackages.0/@ownedElements.2"/>
......
......@@ -17,13 +17,21 @@
<modifier visibility="public"/>
<superClass type="//@ownedElements.1/@ownedPackages.0/@ownedElements.3"/>
</ownedElements>
<ownedElements xsi:type="java:ClassDeclaration" originalCompilationUnit="//@compilationUnits.4" name="ThrowableNotPass5">
<modifier visibility="public"/>
<superClass type="//@ownedElements.1/@ownedPackages.0/@ownedElements.1">
<qualifier xsi:type="java:PackageAccess" package="//@ownedElements.1/@ownedPackages.0">
<qualifier package="//@ownedElements.1"/>
</qualifier>
</superClass>
</ownedElements>
</ownedElements>
<ownedElements name="java" proxy="true">
<ownedPackages name="lang" proxy="true">
<ownedElements name="java" proxy="true" usagesInPackageAccess="//@ownedElements.0/@ownedElements.4/@superClass/@qualifier/@qualifier">
<ownedPackages name="lang" proxy="true" usagesInPackageAccess="//@ownedElements.0/@ownedElements.4/@superClass/@qualifier">
<ownedElements xsi:type="java:ClassDeclaration" name="Exception" proxy="true" usagesInTypeAccess="//@ownedElements.0/@ownedElements.0/@superClass //@ownedElements.1/@ownedPackages.0/@ownedElements.3/@superClass">
<superClass type="//@ownedElements.1/@ownedPackages.0/@ownedElements.1"/>
</ownedElements>
<ownedElements xsi:type="java:ClassDeclaration" name="Throwable" proxy="true" usagesInTypeAccess="//@ownedElements.1/@ownedPackages.0/@ownedElements.0/@superClass //@ownedElements.0/@ownedElements.2/@superClass">
<ownedElements xsi:type="java:ClassDeclaration" name="Throwable" proxy="true" usagesInTypeAccess="//@ownedElements.1/@ownedPackages.0/@ownedElements.0/@superClass //@ownedElements.0/@ownedElements.2/@superClass //@ownedElements.0/@ownedElements.4/@superClass">
<superInterfaces type="//@ownedElements.1/@ownedPackages.1/@ownedElements.0"/>
</ownedElements>
<ownedElements xsi:type="java:ClassDeclaration" name="Object" proxy="true" usagesInTypeAccess="//@ownedElements.0/@ownedElements.1/@superClass"/>
......@@ -48,4 +56,5 @@
<compilationUnits name="ThrowablePass1.java" originalFilePath="C:\Users\33659\Gerson-workspace\throwable\src\throwable\ThrowablePass1.java" package="//@ownedElements.0" types="//@ownedElements.0/@ownedElements.1"/>
<compilationUnits name="ThrowableNotPass4.java" originalFilePath="C:\Users\33659\Gerson-workspace\throwable\src\throwable\ThrowableNotPass4.java" package="//@ownedElements.0" types="//@ownedElements.0/@ownedElements.2"/>
<compilationUnits name="ThrowablePass2.java" originalFilePath="C:\Users\33659\Gerson-workspace\throwable\src\throwable\ThrowablePass2.java" package="//@ownedElements.0" types="//@ownedElements.0/@ownedElements.3"/>
<compilationUnits name="ThrowableNotPass5.java" originalFilePath="C:\Users\33659\Gerson-workspace\throwable\src\throwable\ThrowableNotPass5.java" package="//@ownedElements.0" types="//@ownedElements.0/@ownedElements.4"/>
</java:Model>
......@@ -74,7 +74,7 @@ helper def: doNotExtendJavaLangError() : Set(smm!Measure) =
-- select all class create by the user
->select(it2| it2.proxy = false)
-- select all class who extend Error
->select(it3| it3.superClass.type.name = 'Error')
->select(it3| it3.superClass.type.name = 'Error' or it3.superClass.type.name = 'java.lang.Error')
-- collect all results and send an error message
->collect(it4|thisModule.MeasureDoNotExtendJavaLangError(it4))
;
......
......@@ -26,7 +26,7 @@ helper def: doNotExtendJavaLangThrowable() : Set(smm!Measure) =
-- select all class create by the user
->select(it2| it2.proxy = false)
-- select all class who extend Throwable
->select(it3| it3.superClass.type.name = 'Throwable')
->select(it3| it3.superClass.type.name = 'Throwable' or it3.superClass.type.name = 'java.lang.Throwable')
-- collect all results and send an error message
->collect(it4|thisModule.MeasureDoNotExtendJavaLangThrowable(it4))
;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment