Skip to content
Snippets Groups Projects
Commit 6b8d79a1 authored by Johannes Mey's avatar Johannes Mey
Browse files

fix templates and update expected files

parent 7c2be1ec
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
{{/useOptionals}} {{/useOptionals}}
{{/useExceptions}} {{/useExceptions}}
*/ */
syn {{typeName}} {{typeName}}.as{{subtypeName}}(); syn {{subtypeName}} {{typeName}}.as{{subtypeName}}();
{{#useExceptions}} {{#useExceptions}}
eq {{typeName}}.as{{subtypeName}}() { eq {{typeName}}.as{{subtypeName}}() {
throw new {{exceptionName}}(); throw new {{exceptionName}}();
......
/** Tests if {{typeName}} is a {{subtypeName}}. /** Tests if {{typeName}} is a {{subtypeName}}.
* @return 'true' if this is a {{subtypeName}}, otherwise 'false' * @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; eq {{subtypeName}}.is{{subtypeName}}() = true;
...@@ -3,19 +3,19 @@ aspect Navigation { ...@@ -3,19 +3,19 @@ aspect Navigation {
/** Tests if A is a A1. /** Tests if A is a A1.
* @return 'true' if this is a A1, otherwise 'false' * @return 'true' if this is a A1, otherwise 'false'
*/ */
syn A A.isA1() = false; syn boolean A.isA1() = false;
eq A1.isA1() = true; eq A1.isA1() = true;
/** Tests if A is a A2. /** Tests if A is a A2.
* @return 'true' if this is a A2, otherwise 'false' * @return 'true' if this is a A2, otherwise 'false'
*/ */
syn A A.isA2() = false; syn boolean A.isA2() = false;
eq A2.isA2() = true; eq A2.isA2() = true;
/** casts a A into a A1 if possible. /** casts a A into a A1 if possible.
* @return 'this' cast to a A1 or a * @return 'this' cast to a A1 or a
*/ */
syn A A.asA1(); syn A1 A.asA1();
eq A.asA1() { eq A.asA1() {
throw new java.lang.ClassCastException(); throw new java.lang.ClassCastException();
} }
...@@ -24,7 +24,7 @@ aspect Navigation { ...@@ -24,7 +24,7 @@ aspect Navigation {
/** casts a A into a A2 if possible. /** casts a A into a A2 if possible.
* @return 'this' cast to a A2 or a * @return 'this' cast to a A2 or a
*/ */
syn A A.asA2(); syn A2 A.asA2();
eq A.asA2() { eq A.asA2() {
throw new java.lang.ClassCastException(); throw new java.lang.ClassCastException();
} }
......
...@@ -3,26 +3,26 @@ aspect Navigation { ...@@ -3,26 +3,26 @@ aspect Navigation {
/** Tests if A is a A1. /** Tests if A is a A1.
* @return 'true' if this is a A1, otherwise 'false' * @return 'true' if this is a A1, otherwise 'false'
*/ */
syn A A.isA1() = false; syn boolean A.isA1() = false;
eq A1.isA1() = true; eq A1.isA1() = true;
/** Tests if A is a A2. /** Tests if A is a A2.
* @return 'true' if this is a A2, otherwise 'false' * @return 'true' if this is a A2, otherwise 'false'
*/ */
syn A A.isA2() = false; syn boolean A.isA2() = false;
eq A2.isA2() = true; eq A2.isA2() = true;
/** casts a A into a A1 if possible. /** casts a A into a A1 if possible.
* @return 'this' cast to a A1 or 'null' * @return 'this' cast to a A1 or 'null'
*/ */
syn A A.asA1(); syn A1 A.asA1();
eq A.asA1() = null; eq A.asA1() = null;
eq A1.asA1() = this; eq A1.asA1() = this;
/** casts a A into a A2 if possible. /** casts a A into a A2 if possible.
* @return 'this' cast to a A2 or 'null' * @return 'this' cast to a A2 or 'null'
*/ */
syn A A.asA2(); syn A2 A.asA2();
eq A.asA2() = null; eq A.asA2() = null;
eq A2.asA2() = this; eq A2.asA2() = this;
......
...@@ -3,19 +3,19 @@ aspect Navigation { ...@@ -3,19 +3,19 @@ aspect Navigation {
/** Tests if A is a A1. /** Tests if A is a A1.
* @return 'true' if this is a A1, otherwise 'false' * @return 'true' if this is a A1, otherwise 'false'
*/ */
syn A A.isA1() = false; syn boolean A.isA1() = false;
eq A1.isA1() = true; eq A1.isA1() = true;
/** Tests if A is a A2. /** Tests if A is a A2.
* @return 'true' if this is a A2, otherwise 'false' * @return 'true' if this is a A2, otherwise 'false'
*/ */
syn A A.isA2() = false; syn boolean A.isA2() = false;
eq A2.isA2() = true; eq A2.isA2() = true;
/** casts a A into a A1 if possible. /** casts a A into a A1 if possible.
* @return 'this' cast to a A1 or a * @return 'this' cast to a A1 or a
*/ */
syn A A.asA1(); syn A1 A.asA1();
eq A.asA1() { eq A.asA1() {
throw new RuntimeException(); throw new RuntimeException();
} }
...@@ -24,7 +24,7 @@ aspect Navigation { ...@@ -24,7 +24,7 @@ aspect Navigation {
/** casts a A into a A2 if possible. /** casts a A into a A2 if possible.
* @return 'this' cast to a A2 or a * @return 'this' cast to a A2 or a
*/ */
syn A A.asA2(); syn A2 A.asA2();
eq A.asA2() { eq A.asA2() {
throw new RuntimeException(); throw new RuntimeException();
} }
......
...@@ -3,26 +3,26 @@ aspect Navigation { ...@@ -3,26 +3,26 @@ aspect Navigation {
/** Tests if A is a A1. /** Tests if A is a A1.
* @return 'true' if this is a A1, otherwise 'false' * @return 'true' if this is a A1, otherwise 'false'
*/ */
syn A A.isA1() = false; syn boolean A.isA1() = false;
eq A1.isA1() = true; eq A1.isA1() = true;
/** Tests if A is a A2. /** Tests if A is a A2.
* @return 'true' if this is a A2, otherwise 'false' * @return 'true' if this is a A2, otherwise 'false'
*/ */
syn A A.isA2() = false; syn boolean A.isA2() = false;
eq A2.isA2() = true; eq A2.isA2() = true;
/** casts a A into a A1 if possible. /** casts a A into a A1 if possible.
* @return 'this' cast to a A1 or 'null' * @return 'this' cast to a A1 or 'null'
*/ */
syn A A.asA1(); syn A1 A.asA1();
eq A.asA1() = null; eq A.asA1() = null;
eq A1.asA1() = this; eq A1.asA1() = this;
/** casts a A into a A2 if possible. /** casts a A into a A2 if possible.
* @return 'this' cast to a A2 or 'null' * @return 'this' cast to a A2 or 'null'
*/ */
syn A A.asA2(); syn A2 A.asA2();
eq A.asA2() = null; eq A.asA2() = null;
eq A2.asA2() = this; eq A2.asA2() = this;
......
...@@ -3,26 +3,26 @@ aspect Navigation { ...@@ -3,26 +3,26 @@ aspect Navigation {
/** Tests if A is a A1. /** Tests if A is a A1.
* @return 'true' if this is a A1, otherwise 'false' * @return 'true' if this is a A1, otherwise 'false'
*/ */
syn A A.isA1() = false; syn boolean A.isA1() = false;
eq A1.isA1() = true; eq A1.isA1() = true;
/** Tests if A is a A2. /** Tests if A is a A2.
* @return 'true' if this is a A2, otherwise 'false' * @return 'true' if this is a A2, otherwise 'false'
*/ */
syn A A.isA2() = false; syn boolean A.isA2() = false;
eq A2.isA2() = true; eq A2.isA2() = true;
/** casts a A into a A1 if possible. /** casts a A into a A1 if possible.
* @return an Optional of 'this' cast to a A1 or an empty Optional * @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 A.asA1() = java.util.Optional.empty();
eq .asA1() = java.util.Optional.of(this); eq .asA1() = java.util.Optional.of(this);
/** casts a A into a A2 if possible. /** casts a A into a A2 if possible.
* @return an Optional of 'this' cast to a A2 or an empty Optional * @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 A.asA2() = java.util.Optional.empty();
eq .asA2() = java.util.Optional.of(this); eq .asA2() = java.util.Optional.of(this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment