Commit 65ea6477 authored by ArthuurT's avatar ArthuurT
Browse files

update conflicts

parent fbe695ca
<?xml version="1.0" encoding="ASCII"?>
<java:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:java="http://www.eclipse.org/MoDisco/Java/0.2.incubation/java" name="AtLeastOneConstructor">
<ownedElements name="main">
<ownedElements xsi:type="java:ClassDeclaration" originalCompilationUnit="//@compilationUnits.0" name="StaticClass">
<modifier visibility="public"/>
<bodyDeclarations xsi:type="java:FieldDeclaration" originalCompilationUnit="//@compilationUnits.0">
<modifier visibility="public" static="true"/>
<type type="//@orphanTypes.0"/>
<fragments originalCompilationUnit="//@compilationUnits.0" name="myWonderfultInterger">
<initializer xsi:type="java:NumberLiteral" originalCompilationUnit="//@compilationUnits.0" tokenValue="0"/>
</fragments>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:FieldDeclaration" originalCompilationUnit="//@compilationUnits.0">
<modifier visibility="public" static="true"/>
<type type="//@orphanTypes.0"/>
<fragments originalCompilationUnit="//@compilationUnits.0" name="myVeryUsefulInterger">
<initializer xsi:type="java:NumberLiteral" originalCompilationUnit="//@compilationUnits.0" tokenValue="0"/>
</fragments>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.0" name="doNothing">
<modifier visibility="public" static="true"/>
<body originalCompilationUnit="//@compilationUnits.0"/>
<returnType type="//@orphanTypes.5"/>
</bodyDeclarations>
</ownedElements>
<ownedElements xsi:type="java:ClassDeclaration" originalCompilationUnit="//@compilationUnits.1" name="ClassWithConstructor">
<modifier visibility="public"/>
<bodyDeclarations xsi:type="java:FieldDeclaration" originalCompilationUnit="//@compilationUnits.1">
<modifier visibility="private"/>
<type type="//@orphanTypes.0"/>
<fragments originalCompilationUnit="//@compilationUnits.1" name="x" usageInVariableAccess="//@ownedElements.0/@ownedElements.1/@bodyDeclarations.2/@body/@statements.0/@expression/@leftHandSide/@field"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:FieldDeclaration" originalCompilationUnit="//@compilationUnits.1">
<modifier visibility="private"/>
<type type="//@orphanTypes.0"/>
<fragments originalCompilationUnit="//@compilationUnits.1" name="y" usageInVariableAccess="//@ownedElements.0/@ownedElements.1/@bodyDeclarations.2/@body/@statements.1/@expression/@leftHandSide/@field //@ownedElements.0/@ownedElements.1/@bodyDeclarations.3/@body/@statements.0/@fragments.0/@initializer"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:ConstructorDeclaration" originalCompilationUnit="//@compilationUnits.1" name="ClassWithConstructor">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.1">
<statements xsi:type="java:ExpressionStatement" originalCompilationUnit="//@compilationUnits.1">
<expression xsi:type="java:Assignment" originalCompilationUnit="//@compilationUnits.1">
<leftHandSide xsi:type="java:FieldAccess" originalCompilationUnit="//@compilationUnits.1">
<field variable="//@ownedElements.0/@ownedElements.1/@bodyDeclarations.0/@fragments.0"/>
<expression xsi:type="java:ThisExpression" originalCompilationUnit="//@compilationUnits.1"/>
</leftHandSide>
<rightHandSide xsi:type="java:NumberLiteral" originalCompilationUnit="//@compilationUnits.1" tokenValue="0"/>
</expression>
</statements>
<statements xsi:type="java:ExpressionStatement" originalCompilationUnit="//@compilationUnits.1">
<expression xsi:type="java:Assignment" originalCompilationUnit="//@compilationUnits.1">
<leftHandSide xsi:type="java:FieldAccess" originalCompilationUnit="//@compilationUnits.1">
<field variable="//@ownedElements.0/@ownedElements.1/@bodyDeclarations.1/@fragments.0"/>
<expression xsi:type="java:ThisExpression" originalCompilationUnit="//@compilationUnits.1"/>
</leftHandSide>
<rightHandSide xsi:type="java:NumberLiteral" originalCompilationUnit="//@compilationUnits.1" tokenValue="0"/>
</expression>
</statements>
</body>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.1" name="beautifulMethod">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.1">
<statements xsi:type="java:VariableDeclarationStatement" originalCompilationUnit="//@compilationUnits.1">
<type type="//@orphanTypes.0"/>
<fragments originalCompilationUnit="//@compilationUnits.1" name="z">
<initializer xsi:type="java:SingleVariableAccess" variable="//@ownedElements.0/@ownedElements.1/@bodyDeclarations.1/@fragments.0"/>
</fragments>
<modifier/>
</statements>
</body>
<returnType type="//@orphanTypes.5"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:ClassDeclaration" originalCompilationUnit="//@compilationUnits.1" name="InternalClass">
<modifier visibility="public"/>
</bodyDeclarations>
</ownedElements>
<ownedElements xsi:type="java:ClassDeclaration" originalCompilationUnit="//@compilationUnits.2" name="NotTotalyStaticClass">
<modifier visibility="public"/>
<bodyDeclarations xsi:type="java:FieldDeclaration" originalCompilationUnit="//@compilationUnits.2">
<modifier visibility="public" static="true"/>
<type type="//@orphanTypes.0"/>
<fragments originalCompilationUnit="//@compilationUnits.2" name="myWonderfultInterger">
<initializer xsi:type="java:NumberLiteral" originalCompilationUnit="//@compilationUnits.2" tokenValue="0"/>
</fragments>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:FieldDeclaration" originalCompilationUnit="//@compilationUnits.2">
<modifier visibility="public" static="true"/>
<type type="//@orphanTypes.0"/>
<fragments originalCompilationUnit="//@compilationUnits.2" name="myVeryUsefulInterger">
<initializer xsi:type="java:NumberLiteral" originalCompilationUnit="//@compilationUnits.2" tokenValue="0"/>
</fragments>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.2" name="doNothing">
<modifier visibility="public" static="true"/>
<body originalCompilationUnit="//@compilationUnits.2"/>
<returnType type="//@orphanTypes.5"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.2" name="doSomething">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.2"/>
<returnType type="//@orphanTypes.5"/>
</bodyDeclarations>
</ownedElements>
<ownedElements xsi:type="java:ClassDeclaration" originalCompilationUnit="//@compilationUnits.3" name="ClassWithTwoConstructors">
<modifier visibility="public"/>
<bodyDeclarations xsi:type="java:ConstructorDeclaration" originalCompilationUnit="//@compilationUnits.3" name="ClassWithTwoConstructors">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.3"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:ConstructorDeclaration" originalCompilationUnit="//@compilationUnits.3" name="ClassWithTwoConstructors">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.3"/>
<parameters originalCompilationUnit="//@compilationUnits.3" name="interestingParameter">
<modifier/>
<type type="//@orphanTypes.0"/>
</parameters>
</bodyDeclarations>
</ownedElements>
<ownedElements xsi:type="java:ClassDeclaration" originalCompilationUnit="//@compilationUnits.4" name="ClassWithoutConstructor">
<modifier visibility="public"/>
</ownedElements>
</ownedElements>
<orphanTypes xsi:type="java:PrimitiveTypeInt" name="int" usagesInTypeAccess="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.0/@type //@ownedElements.0/@ownedElements.0/@bodyDeclarations.1/@type //@ownedElements.0/@ownedElements.1/@bodyDeclarations.0/@type //@ownedElements.0/@ownedElements.1/@bodyDeclarations.1/@type //@ownedElements.0/@ownedElements.1/@bodyDeclarations.3/@body/@statements.0/@type //@ownedElements.0/@ownedElements.2/@bodyDeclarations.0/@type //@ownedElements.0/@ownedElements.2/@bodyDeclarations.1/@type //@ownedElements.0/@ownedElements.3/@bodyDeclarations.1/@parameters.0/@type"/>
<orphanTypes xsi:type="java:PrimitiveTypeLong" name="long"/>
<orphanTypes xsi:type="java:PrimitiveTypeFloat" name="float"/>
<orphanTypes xsi:type="java:PrimitiveTypeDouble" name="double"/>
<orphanTypes xsi:type="java:PrimitiveTypeBoolean" name="boolean"/>
<orphanTypes xsi:type="java:PrimitiveTypeVoid" name="void" usagesInTypeAccess="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.2/@returnType //@ownedElements.0/@ownedElements.1/@bodyDeclarations.3/@returnType //@ownedElements.0/@ownedElements.2/@bodyDeclarations.2/@returnType //@ownedElements.0/@ownedElements.2/@bodyDeclarations.3/@returnType"/>
<orphanTypes xsi:type="java:PrimitiveTypeChar" name="char"/>
<orphanTypes xsi:type="java:PrimitiveTypeShort" name="short"/>
<orphanTypes xsi:type="java:PrimitiveTypeByte" name="byte"/>
<compilationUnits name="StaticClass.java" originalFilePath="/home/asao/eclipse-photon-workspace/AtLeastOneConstructor/src/main/StaticClass.java" package="//@ownedElements.0" types="//@ownedElements.0/@ownedElements.0"/>
<compilationUnits name="ClassWithConstructor.java" originalFilePath="/home/asao/eclipse-photon-workspace/AtLeastOneConstructor/src/main/ClassWithConstructor.java" package="//@ownedElements.0" types="//@ownedElements.0/@ownedElements.1"/>
<compilationUnits name="NotTotalyStaticClass.java" originalFilePath="/home/asao/eclipse-photon-workspace/AtLeastOneConstructor/src/main/NotTotalyStaticClass.java" package="//@ownedElements.0" types="//@ownedElements.0/@ownedElements.2"/>
<compilationUnits name="ClassWithTwoConstructors.java" originalFilePath="/home/asao/eclipse-photon-workspace/AtLeastOneConstructor/src/main/ClassWithTwoConstructors.java" package="//@ownedElements.0" types="//@ownedElements.0/@ownedElements.3"/>
<compilationUnits name="ClassWithoutConstructor.java" originalFilePath="/home/asao/eclipse-photon-workspace/AtLeastOneConstructor/src/main/ClassWithoutConstructor.java" package="//@ownedElements.0" types="//@ownedElements.0/@ownedElements.4"/>
</java:Model>
<?xml version="1.0" encoding="ASCII"?>
<java:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:java="http://www.eclipse.org/MoDisco/Java/0.2.incubation/java" name="BooleanGetMethodName">
<ownedElements name="main">
<ownedElements xsi:type="java:ClassDeclaration" originalCompilationUnit="//@compilationUnits.0" name="BooleanGetMethodName">
<modifier visibility="public"/>
<bodyDeclarations xsi:type="java:FieldDeclaration" originalCompilationUnit="//@compilationUnits.0">
<modifier visibility="private"/>
<type type="//@orphanTypes.4"/>
<fragments originalCompilationUnit="//@compilationUnits.0" name="full" usageInVariableAccess="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.3/@body/@statements.0/@expression/@field"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:FieldDeclaration" originalCompilationUnit="//@compilationUnits.0">
<modifier visibility="private"/>
<type type="//@orphanTypes.4"/>
<fragments originalCompilationUnit="//@compilationUnits.0" name="empty" usageInVariableAccess="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.4/@body/@statements.0/@expression/@field //@ownedElements.0/@ownedElements.0/@bodyDeclarations.6/@body/@statements.0/@expression/@field //@ownedElements.0/@ownedElements.0/@bodyDeclarations.7/@body/@statements.0/@expression/@rightOperand/@field"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:FieldDeclaration" originalCompilationUnit="//@compilationUnits.0">
<modifier visibility="private"/>
<type type="//@orphanTypes.0"/>
<fragments originalCompilationUnit="//@compilationUnits.0" name="quantity" usageInVariableAccess="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.5/@body/@statements.0/@expression/@field"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.0" name="getFull" redefinedMethodDeclaration="//@ownedElements.0/@ownedElements.1/@bodyDeclarations.0">
<annotations originalCompilationUnit="//@compilationUnits.0">
<type type="//@ownedElements.1/@ownedPackages.0/@ownedElements.0"/>
</annotations>
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.0">
<statements xsi:type="java:ReturnStatement" originalCompilationUnit="//@compilationUnits.0">
<expression xsi:type="java:FieldAccess" originalCompilationUnit="//@compilationUnits.0">
<field variable="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.0/@fragments.0"/>
<expression xsi:type="java:ThisExpression" originalCompilationUnit="//@compilationUnits.0"/>
</expression>
</statements>
</body>
<returnType type="//@orphanTypes.4"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.0" name="getEmpty">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.0">
<statements xsi:type="java:ReturnStatement" originalCompilationUnit="//@compilationUnits.0">
<expression xsi:type="java:FieldAccess" originalCompilationUnit="//@compilationUnits.0">
<field variable="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.1/@fragments.0"/>
<expression xsi:type="java:ThisExpression" originalCompilationUnit="//@compilationUnits.0"/>
</expression>
</statements>
</body>
<returnType type="//@orphanTypes.4"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.0" name="getQuantity">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.0">
<statements xsi:type="java:ReturnStatement" originalCompilationUnit="//@compilationUnits.0">
<expression xsi:type="java:FieldAccess" originalCompilationUnit="//@compilationUnits.0">
<field variable="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.2/@fragments.0"/>
<expression xsi:type="java:ThisExpression" originalCompilationUnit="//@compilationUnits.0"/>
</expression>
</statements>
</body>
<returnType type="//@orphanTypes.0"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.0" name="isEmpty">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.0">
<statements xsi:type="java:ReturnStatement" originalCompilationUnit="//@compilationUnits.0">
<expression xsi:type="java:FieldAccess" originalCompilationUnit="//@compilationUnits.0">
<field variable="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.1/@fragments.0"/>
<expression xsi:type="java:ThisExpression" originalCompilationUnit="//@compilationUnits.0"/>
</expression>
</statements>
</body>
<returnType type="//@orphanTypes.4"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.0" name="getEmpty">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.0">
<statements xsi:type="java:ReturnStatement" originalCompilationUnit="//@compilationUnits.0">
<expression xsi:type="java:InfixExpression" originalCompilationUnit="//@compilationUnits.0" operator="||">
<rightOperand xsi:type="java:FieldAccess" originalCompilationUnit="//@compilationUnits.0">
<field variable="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.1/@fragments.0"/>
<expression xsi:type="java:ThisExpression" originalCompilationUnit="//@compilationUnits.0"/>
</rightOperand>
<leftOperand xsi:type="java:SingleVariableAccess" variable="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.7/@parameters.0"/>
</expression>
</statements>
</body>
<parameters originalCompilationUnit="//@compilationUnits.0" name="param" usageInVariableAccess="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.7/@body/@statements.0/@expression/@leftOperand">
<modifier/>
<type type="//@orphanTypes.4"/>
</parameters>
<returnType type="//@orphanTypes.4"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.0" name="display">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.0">
<comments xsi:type="java:LineComment" originalCompilationUnit="//@compilationUnits.0" content="// do nothing" enclosedByParent="true"/>
</body>
<returnType type="//@orphanTypes.5"/>
</bodyDeclarations>
<superClass type="//@ownedElements.0/@ownedElements.1"/>
</ownedElements>
<ownedElements xsi:type="java:ClassDeclaration" originalCompilationUnit="//@compilationUnits.1" name="SuperBooleanGetMethodName" usagesInTypeAccess="//@ownedElements.0/@ownedElements.0/@superClass">
<modifier visibility="public"/>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.1" name="getFull" redefinitions="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.3">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.1">
<statements xsi:type="java:ReturnStatement" originalCompilationUnit="//@compilationUnits.1">
<expression xsi:type="java:BooleanLiteral" originalCompilationUnit="//@compilationUnits.1"/>
</statements>
</body>
<returnType type="//@orphanTypes.4"/>
</bodyDeclarations>
</ownedElements>
</ownedElements>
<ownedElements name="java" proxy="true">
<ownedPackages name="lang" proxy="true">
<ownedElements xsi:type="java:AnnotationTypeDeclaration" name="Override" proxy="true" usagesInTypeAccess="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.3/@annotations.0/@type"/>
</ownedPackages>
</ownedElements>
<orphanTypes xsi:type="java:PrimitiveTypeInt" name="int" usagesInTypeAccess="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.2/@type //@ownedElements.0/@ownedElements.0/@bodyDeclarations.5/@returnType"/>
<orphanTypes xsi:type="java:PrimitiveTypeLong" name="long"/>
<orphanTypes xsi:type="java:PrimitiveTypeFloat" name="float"/>
<orphanTypes xsi:type="java:PrimitiveTypeDouble" name="double"/>
<orphanTypes xsi:type="java:PrimitiveTypeBoolean" name="boolean" usagesInTypeAccess="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.0/@type //@ownedElements.0/@ownedElements.0/@bodyDeclarations.1/@type //@ownedElements.0/@ownedElements.0/@bodyDeclarations.3/@returnType //@ownedElements.0/@ownedElements.0/@bodyDeclarations.4/@returnType //@ownedElements.0/@ownedElements.0/@bodyDeclarations.6/@returnType //@ownedElements.0/@ownedElements.0/@bodyDeclarations.7/@returnType //@ownedElements.0/@ownedElements.0/@bodyDeclarations.7/@parameters.0/@type //@ownedElements.0/@ownedElements.1/@bodyDeclarations.0/@returnType"/>
<orphanTypes xsi:type="java:PrimitiveTypeVoid" name="void" usagesInTypeAccess="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.8/@returnType"/>
<orphanTypes xsi:type="java:PrimitiveTypeChar" name="char"/>
<orphanTypes xsi:type="java:PrimitiveTypeShort" name="short"/>
<orphanTypes xsi:type="java:PrimitiveTypeByte" name="byte"/>
<compilationUnits name="BooleanGetMethodName.java" originalFilePath="/home/asao/eclipse-photon-workspace/BooleanGetMethodName/src/main/BooleanGetMethodName.java" commentList="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.8/@body/@comments.0" package="//@ownedElements.0" types="//@ownedElements.0/@ownedElements.0"/>
<compilationUnits name="SuperBooleanGetMethodName.java" originalFilePath="/home/asao/eclipse-photon-workspace/BooleanGetMethodName/src/main/SuperBooleanGetMethodName.java" package="//@ownedElements.0" types="//@ownedElements.0/@ownedElements.1"/>
</java:Model>
<?xml version="1.0" encoding="ASCII"?>
<java:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:java="http://www.eclipse.org/MoDisco/Java/0.2.incubation/java" name="WhileLoopWithLiteralBoolean">
<ownedElements name="main">
<ownedElements xsi:type="java:ClassDeclaration" originalCompilationUnit="//@compilationUnits.0" name="WhileLoopWithLiteralBoolean">
<modifier visibility="public"/>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.0" name="test1">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.0">
<statements xsi:type="java:WhileStatement" originalCompilationUnit="//@compilationUnits.0">
<expression xsi:type="java:BooleanLiteral" originalCompilationUnit="//@compilationUnits.0" value="true"/>
<body xsi:type="java:Block" originalCompilationUnit="//@compilationUnits.0"/>
</statements>
</body>
<returnType type="//@orphanTypes.5"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.0" name="test2">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.0">
<statements xsi:type="java:DoStatement" originalCompilationUnit="//@compilationUnits.0">
<expression xsi:type="java:BooleanLiteral" originalCompilationUnit="//@compilationUnits.0" value="true"/>
<body xsi:type="java:Block" originalCompilationUnit="//@compilationUnits.0"/>
</statements>
</body>
<returnType type="//@orphanTypes.5"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.0" name="test3">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.0">
<statements xsi:type="java:WhileStatement" originalCompilationUnit="//@compilationUnits.0">
<expression xsi:type="java:BooleanLiteral" originalCompilationUnit="//@compilationUnits.0"/>
<body xsi:type="java:Block" originalCompilationUnit="//@compilationUnits.0"/>
</statements>
</body>
<returnType type="//@orphanTypes.5"/>
</bodyDeclarations>
<bodyDeclarations xsi:type="java:MethodDeclaration" originalCompilationUnit="//@compilationUnits.0" name="test4">
<modifier visibility="public"/>
<body originalCompilationUnit="//@compilationUnits.0">
<statements xsi:type="java:DoStatement" originalCompilationUnit="//@compilationUnits.0">
<expression xsi:type="java:BooleanLiteral" originalCompilationUnit="//@compilationUnits.0"/>
<body xsi:type="java:Block" originalCompilationUnit="//@compilationUnits.0"/>
</statements>
</body>
<returnType type="//@orphanTypes.5"/>
</bodyDeclarations>
</ownedElements>
</ownedElements>
<orphanTypes xsi:type="java:PrimitiveTypeInt" name="int"/>
<orphanTypes xsi:type="java:PrimitiveTypeLong" name="long"/>
<orphanTypes xsi:type="java:PrimitiveTypeFloat" name="float"/>
<orphanTypes xsi:type="java:PrimitiveTypeDouble" name="double"/>
<orphanTypes xsi:type="java:PrimitiveTypeBoolean" name="boolean"/>
<orphanTypes xsi:type="java:PrimitiveTypeVoid" name="void" usagesInTypeAccess="//@ownedElements.0/@ownedElements.0/@bodyDeclarations.0/@returnType //@ownedElements.0/@ownedElements.0/@bodyDeclarations.1/@returnType //@ownedElements.0/@ownedElements.0/@bodyDeclarations.2/@returnType //@ownedElements.0/@ownedElements.0/@bodyDeclarations.3/@returnType"/>
<orphanTypes xsi:type="java:PrimitiveTypeChar" name="char"/>
<orphanTypes xsi:type="java:PrimitiveTypeShort" name="short"/>
<orphanTypes xsi:type="java:PrimitiveTypeByte" name="byte"/>
<compilationUnits name="WhileLoopWithLiteralBoolean.java" originalFilePath="/home/asao/eclipse-photon-workspace/WhileLoopWithLiteralBoolean/src/main/WhileLoopWithLiteralBoolean.java" package="//@ownedElements.0" types="//@ownedElements.0/@ownedElements.0"/>
</java:Model>
......@@ -44,8 +44,10 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
-- Code Style rules
--
thisModule.atLeastOneConstructor(),
thisModule.avoidDollarSigns(),
thisModule.avoidPrefixingMethodParameters(),
thisModule.booleanGetMethodName(),
thisModule.extendsObject(),
thisModule.fieldDeclarationsShouldBeAtStartOfClass(),
thisModule.genericsNaming(),
......@@ -140,7 +142,8 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
thisModule.switchDensity(),
-- #FIXME: thisModule.unusedLocalVariable(),
thisModule.useAssertSameInsteadOfAssertTrue(),
thisModule.useAssertTrueInsteadOfAssertEquals()
thisModule.useAssertTrueInsteadOfAssertEquals(),
thisModule.whileLoopWithLiteralBoolean()
-- Bugged rules:
--
......@@ -223,6 +226,27 @@ rule MeasureArrayIsStoredDirectly(s: java!MethodDeclaration){
}
}
-- ----------------------------------------- AtLeastOneConstructor----------------------------------------------
--- A Measure instance if the class violates the rule AtLeastOneConstructor.
rule MeasureAtLeastOneConstructor(class: java!ClassDeclaration) {
to
om: smm!ObservedMeasure (
measure <- noc,
measurements <- measurement
),
noc: smm!DimensionalMeasure (
name <- 'AtLeastOneConstructor',
shortDescription <- 'Each non-static class should declare at least one constructor. Classes with solely static members are ignored.'
),
measurement: smm!DirectMeasurement (
error<- 'The class ' + class.name + ' declared no constructor'
)
do {
noc;
}
}
-- ------------------------------------------- AvoidCallingFinalize ---------------------------------------------
--- A Measure instance if the class violates the rule LongVariable.
rule MeasureAvoidCallingFinalize(methode : java!MethodInvocation) {
......@@ -507,6 +531,27 @@ rule MeasureAvoidUsingShortType(typeShort : java!VariableDeclarationStatement) {
}
}
--- A Measure instance if the class violates the rule BooleanGetMethodName.
rule MeasureBooleanGetMethodName(method: java!MethodDeclaration) {
to
om: smm!ObservedMeasure (
measure <- noc,
measurements <- measurement
),
noc: smm!DimensionalMeasure (
name <- 'BooleanGetMethodName',
shortDescription <- 'Methods that return boolean results should be named as predicate statements.
Avoid the use of the "get" prefix for these methods'
),
measurement: smm!DirectMeasurement (
error<- 'Bad method\'s name : ' + method.name + ' in the file ' + method.originalCompilationUnit.name
)
do {
noc;
}
}
--- A Measure instance if the class violates the rule CloneMethodMustBePublic.
rule MeasureCloneMethodMustBePublic(w: java!MethodDeclaration) {
to
......@@ -2019,7 +2064,26 @@ rule MesureUseAssertTrueInsteadOfAssertEquals(class : java!MethodInvocation) {
}
}
-- ----------------------------------------- WhileLoopWithLiteralBoolean----------------------------------------------
--- A Measure instance if the class violates the rule WhileLoopWithLiteralBoolean.
rule MeasureWhileLoopWithLiteralBoolean(statement: java!Statement) {
to
om: smm!ObservedMeasure (
measure <- noc,
measurements <- measurement
),
noc: smm!DimensionalMeasure (
name <- 'WhileLoopWithLiteralBoolean',
shortDescription <- 'While loop with false as an expression and Do loop with a boolean as an expression have no sense.'
),
measurement: smm!DirectMeasurement (
error<- 'Incorrect while/do statement in the file ' + statement.originalCompilationUnit.name
)
do {
noc;
}
}
......
......@@ -170,6 +170,36 @@ helper def: useAssertTrueInsteadOfAssertEquals() : Set(smm!Measure) =
->select(assert | assert.method.name = 'assertEquals')
->select(assert | thisModule.isWrongUseAssertTrueInsteadOfAssertEquals(assert))
->collect(assert | thisModule.MesureUseAssertTrueInsteadOfAssertEquals(assert));
--- Rule for metrics WhileLoopWithLiteralBoolean
helper def: whileLoopWithLiteralBoolean(): Set(smm!Measure) =
java!Statement.allInstances()->select(statement |
not statement.isAllowedStatement()
)->collect(statement |
thisModule.MeasureWhileLoopWithLiteralBoolean(statement)
);
-- This rule is only about to check if do/while statements are well used,
-- consequently other statements are "well used" statements by default
helper context java!Statement def: isAllowedStatement(): Boolean =
true;
-- While statements with a false boolean as an expression are not "well used"
helper context java!WhileStatement def: isAllowedStatement(): Boolean =
if self.expression.oclIsTypeOf(java!BooleanLiteral) then
self.expression.value
else
true
endif;
-- do...while statements with a boolean literal as an expression are not "well used"
helper context java!DoStatement def: isAllowedStatement(): Boolean =
not self.expression.oclIsTypeOf(java!BooleanLiteral);
-- Returns the number of parameters
helper context java!MethodDeclaration def: arity(): Integer =
self.parameters.size();
......
......@@ -167,3 +167,70 @@ helper context java!ClassDeclaration def: isNotAllFieldsDeclaredAtStartOfClass()
endif
)
endif;
--------------------------------------------- AtLeastOneConstructor ---------------------------------------------
-- Rule for metrics AtLeastOneConstructor
helper def: atLeastOneConstructor(): Set(smm!Measure) =
java!ClassDeclaration.allInstances()->select(class |
if not class.isStatic() then
not class.hasAtLeastOneConstructor()
else
false
endif
)->collect(method |
thisModule.MeasureAtLeastOneConstructor(method)
);
-- Returns true if the class defined at least one constructor, false otherwise
helper context java!ClassDeclaration def: hasAtLeastOneConstructor(): Boolean =
self.bodyDeclarations->select(declaration |
declaration.oclIsTypeOf(java!ConstructorDeclaration)
).notEmpty();
-- In this rule, we defined a class as static iff fields & methods are all static
-- If the class has something else than fields or methods, then it's not static
helper context java!BodyDeclaration def: isStatic(): Boolean =
false;
helper context java!FieldDeclaration def: isStatic(): Boolean =
self.modifier.static;
helper context java!MethodDeclaration def: isStatic(): Boolean =
self.modifier.static;
helper context java!ClassDeclaration def: isStatic(): Boolean =
if self.bodyDeclarations.isEmpty() then
false
else
self.bodyDeclarations->forAll(declaration |
declaration.isStatic()
)
endif;
--------------------------------------------- BooleanGetMethodName ---------------------------------------------
-- Rule for metrics BooleanGetMethodName
helper def: booleanGetMethodName() : Set(smm!Measure) =
java!MethodDeclaration.allInstances()->select(method |
method.name.startsWith('get') and
method.getReturnType() = 'boolean' and
method.arity() = 0 and
not method.isOverride()
)->collect(method |
thisModule.MeasureBooleanGetMethodName(method)
);
-- Retuns the returned type of a method
helper context java!MethodDeclaration def: getReturnType(): String =
if self.returnType.oclIsUndefined() then
'void' -- if the returned type is not defined, the returned type is void
else
self.returnType.type.name
endif;
-- Returns true if the method is annotated with "@Override", false otherwise
helper context java!MethodDeclaration def: isOverride(): Boolean =
self.annotations->exists(annotation |
annotation.type.type.name = 'Override'
);
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