Ex08

Moderatoren: pmueller, SE - Design and Construction

bafnai
BASIC-Programmierer
BASIC-Programmierer
Beiträge: 126
Registriert: 13. Apr 2011 06:36

Ex08

Beitrag von bafnai » 29. Jun 2018 08:27

I just downloaded the template for exercise 8 and have some problems.

"sbt eclipse" results in

Code: Alles auswählen

[error] Could not create Eclipse project files:
[error] [Error evaluating task 'scalacOptions': error,Error evaluating task 'externalDependencyClasspath': error,Error evaluating task 'update': error,Error evaluating task 'updateClassifiers': error,Error evaluating task 'updateClassifiers': error]
"sbt compile" also results in several errors.

pmueller
Moderator
Moderator
Beiträge: 87
Registriert: 25. Jan 2018 11:14

Re: Ex08

Beitrag von pmueller » 29. Jun 2018 09:19

Hi,

I've updated the template.
Alternatively you can remove the last two dependencies in build.sbt.

Best,
Patrick

Benutzeravatar
5seconds
Endlosschleifenbastler
Endlosschleifenbastler
Beiträge: 155
Registriert: 27. Apr 2013 10:44

Re: Ex08

Beitrag von 5seconds » 5. Jul 2018 13:17

When using the annotation "TemplateMethod" I get compile issues. I'm using it like described in the exercise sheet / Readme.md:

Code: Alles auswählen

@TemplateMethod("<NAME_OF_A_PRIMITIVE_OPERATION>")
protected void <TEMPLATE_METHOD_NAME>() {...}
I also imported the Annotation interface via

Code: Alles auswählen

import de.tudarmstadt.stg.sedc.annotations.templateMethod.TemplateMethod
However, I get a compile error for each time I've put the TemplateMethod annotation:

Code: Alles auswählen

[warn]  <Path to file / Line of code> error: cannot find symbol
[warn]  @TemplateMethod("<NAME_OF_A_PRIMITIVE_OPERATION>")
error: annotation @TemplateMethod is missing a default value for the element 'primitiveOperationNames'
[warn]  @TemplateMethod("<NAME_OF_A_PRIMITIVE_OPERATION>")
I have already changed the dependencies in build.sbt
Somebody else has this problem and/or knows how to solve it?

pmueller
Moderator
Moderator
Beiträge: 87
Registriert: 25. Jan 2018 11:14

Re: Ex08

Beitrag von pmueller » 5. Jul 2018 13:37

Hi,

in Java the Syntax is a little bit different. You have to use the corresponding name of the field that is assigned, i.e. in this case:

Code: Alles auswählen

@TemplateMethod(primitiveOperationNames = "<NAME_OF_A_PRIMITIVE_OPERATION>")
protected void <TEMPLATE_METHOD_NAME>() {...}
Best,
Patrick

Antworten

Zurück zu „Software Engineering - Design and Construction“