From 6b8d79a1762aef4a435a1705bbb4e54c9c83e545 Mon Sep 17 00:00:00 2001 From: Johannes Mey <johannes.mey@tu-dresden.de> Date: Tue, 9 Feb 2021 09:56:22 +0100 Subject: [PATCH] fix templates and update expected files --- src/main/resources/AsA.mustache | 2 +- src/main/resources/IsA.mustache | 2 +- .../customexception/expected/Navigation.jrag | 8 ++++---- .../SimpleInheritance/default/expected/Navigation.jrag | 8 ++++---- .../SimpleInheritance/exception/expected/Navigation.jrag | 8 ++++---- .../SimpleInheritance/null/expected/Navigation.jrag | 8 ++++---- .../SimpleInheritance/optional/expected/Navigation.jrag | 8 ++++---- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/main/resources/AsA.mustache b/src/main/resources/AsA.mustache index f067f63..630068e 100644 --- a/src/main/resources/AsA.mustache +++ b/src/main/resources/AsA.mustache @@ -11,7 +11,7 @@ {{/useOptionals}} {{/useExceptions}} */ -syn {{typeName}} {{typeName}}.as{{subtypeName}}(); +syn {{subtypeName}} {{typeName}}.as{{subtypeName}}(); {{#useExceptions}} eq {{typeName}}.as{{subtypeName}}() { throw new {{exceptionName}}(); diff --git a/src/main/resources/IsA.mustache b/src/main/resources/IsA.mustache index 836d28b..331e687 100644 --- a/src/main/resources/IsA.mustache +++ b/src/main/resources/IsA.mustache @@ -1,5 +1,5 @@ /** Tests if {{typeName}} is a {{subtypeName}}. * @return 'true' if this is a {{subtypeName}}, otherwise 'false' */ -syn {{typeName}} {{typeName}}.is{{subtypeName}}() = false; +syn boolean {{typeName}}.is{{subtypeName}}() = false; eq {{subtypeName}}.is{{subtypeName}}() = true; diff --git a/src/test/resources/SimpleInheritance/customexception/expected/Navigation.jrag b/src/test/resources/SimpleInheritance/customexception/expected/Navigation.jrag index 55d5db5..a364b9e 100644 --- a/src/test/resources/SimpleInheritance/customexception/expected/Navigation.jrag +++ b/src/test/resources/SimpleInheritance/customexception/expected/Navigation.jrag @@ -3,19 +3,19 @@ aspect Navigation { /** Tests if A is a A1. * @return 'true' if this is a A1, otherwise 'false' */ - syn A A.isA1() = false; + syn boolean A.isA1() = false; eq A1.isA1() = true; /** Tests if A is a A2. * @return 'true' if this is a A2, otherwise 'false' */ - syn A A.isA2() = false; + syn boolean A.isA2() = false; eq A2.isA2() = true; /** casts a A into a A1 if possible. * @return 'this' cast to a A1 or a */ - syn A A.asA1(); + syn A1 A.asA1(); eq A.asA1() { throw new java.lang.ClassCastException(); } @@ -24,7 +24,7 @@ aspect Navigation { /** casts a A into a A2 if possible. * @return 'this' cast to a A2 or a */ - syn A A.asA2(); + syn A2 A.asA2(); eq A.asA2() { throw new java.lang.ClassCastException(); } diff --git a/src/test/resources/SimpleInheritance/default/expected/Navigation.jrag b/src/test/resources/SimpleInheritance/default/expected/Navigation.jrag index 122676a..861b67b 100644 --- a/src/test/resources/SimpleInheritance/default/expected/Navigation.jrag +++ b/src/test/resources/SimpleInheritance/default/expected/Navigation.jrag @@ -3,26 +3,26 @@ aspect Navigation { /** Tests if A is a A1. * @return 'true' if this is a A1, otherwise 'false' */ - syn A A.isA1() = false; + syn boolean A.isA1() = false; eq A1.isA1() = true; /** Tests if A is a A2. * @return 'true' if this is a A2, otherwise 'false' */ - syn A A.isA2() = false; + syn boolean A.isA2() = false; eq A2.isA2() = true; /** casts a A into a A1 if possible. * @return 'this' cast to a A1 or 'null' */ - syn A A.asA1(); + syn A1 A.asA1(); eq A.asA1() = null; eq A1.asA1() = this; /** casts a A into a A2 if possible. * @return 'this' cast to a A2 or 'null' */ - syn A A.asA2(); + syn A2 A.asA2(); eq A.asA2() = null; eq A2.asA2() = this; diff --git a/src/test/resources/SimpleInheritance/exception/expected/Navigation.jrag b/src/test/resources/SimpleInheritance/exception/expected/Navigation.jrag index fff7333..7fbfa0f 100644 --- a/src/test/resources/SimpleInheritance/exception/expected/Navigation.jrag +++ b/src/test/resources/SimpleInheritance/exception/expected/Navigation.jrag @@ -3,19 +3,19 @@ aspect Navigation { /** Tests if A is a A1. * @return 'true' if this is a A1, otherwise 'false' */ - syn A A.isA1() = false; + syn boolean A.isA1() = false; eq A1.isA1() = true; /** Tests if A is a A2. * @return 'true' if this is a A2, otherwise 'false' */ - syn A A.isA2() = false; + syn boolean A.isA2() = false; eq A2.isA2() = true; /** casts a A into a A1 if possible. * @return 'this' cast to a A1 or a */ - syn A A.asA1(); + syn A1 A.asA1(); eq A.asA1() { throw new RuntimeException(); } @@ -24,7 +24,7 @@ aspect Navigation { /** casts a A into a A2 if possible. * @return 'this' cast to a A2 or a */ - syn A A.asA2(); + syn A2 A.asA2(); eq A.asA2() { throw new RuntimeException(); } diff --git a/src/test/resources/SimpleInheritance/null/expected/Navigation.jrag b/src/test/resources/SimpleInheritance/null/expected/Navigation.jrag index 122676a..861b67b 100644 --- a/src/test/resources/SimpleInheritance/null/expected/Navigation.jrag +++ b/src/test/resources/SimpleInheritance/null/expected/Navigation.jrag @@ -3,26 +3,26 @@ aspect Navigation { /** Tests if A is a A1. * @return 'true' if this is a A1, otherwise 'false' */ - syn A A.isA1() = false; + syn boolean A.isA1() = false; eq A1.isA1() = true; /** Tests if A is a A2. * @return 'true' if this is a A2, otherwise 'false' */ - syn A A.isA2() = false; + syn boolean A.isA2() = false; eq A2.isA2() = true; /** casts a A into a A1 if possible. * @return 'this' cast to a A1 or 'null' */ - syn A A.asA1(); + syn A1 A.asA1(); eq A.asA1() = null; eq A1.asA1() = this; /** casts a A into a A2 if possible. * @return 'this' cast to a A2 or 'null' */ - syn A A.asA2(); + syn A2 A.asA2(); eq A.asA2() = null; eq A2.asA2() = this; diff --git a/src/test/resources/SimpleInheritance/optional/expected/Navigation.jrag b/src/test/resources/SimpleInheritance/optional/expected/Navigation.jrag index fe1ab5f..eb330f1 100644 --- a/src/test/resources/SimpleInheritance/optional/expected/Navigation.jrag +++ b/src/test/resources/SimpleInheritance/optional/expected/Navigation.jrag @@ -3,26 +3,26 @@ aspect Navigation { /** Tests if A is a A1. * @return 'true' if this is a A1, otherwise 'false' */ - syn A A.isA1() = false; + syn boolean A.isA1() = false; eq A1.isA1() = true; /** Tests if A is a A2. * @return 'true' if this is a A2, otherwise 'false' */ - syn A A.isA2() = false; + syn boolean A.isA2() = false; eq A2.isA2() = true; /** casts a A into a A1 if possible. * @return an Optional of 'this' cast to a A1 or an empty Optional */ - syn A A.asA1(); + syn A1 A.asA1(); eq A.asA1() = java.util.Optional.empty(); eq .asA1() = java.util.Optional.of(this); /** casts a A into a A2 if possible. * @return an Optional of 'this' cast to a A2 or an empty Optional */ - syn A A.asA2(); + syn A2 A.asA2(); eq A.asA2() = java.util.Optional.empty(); eq .asA2() = java.util.Optional.of(this); -- GitLab