Griselle Z
Griselle Z

Reputation: 177

Xtend - saved files contain repeated data

I don't know why when I generate files fsa.generateFile(fileName, finalString) it creates the files fine, but when I clean the project, it doubles the output.

Even if I delete the file, it continues growing.

Is this a code or Eclipse problem?

Thank you.

Upvotes: 0

Views: 41

Answers (1)

Christian Dietrich
Christian Dietrich

Reputation: 11868

you store the file content for some reason as a member in the generator and never reset it

val root = resource?.allContents?.head as ProblemSpecification;
s += readFile(path_sigAlloyDeclaration+"sigAlloyDeclaration.txt")

i assume s either should be local to the doGenerate method or be reset at the start

s = ""
val root = resource?.allContents?.head as ProblemSpecification;
s += readFile(path_sigAlloyDeclaration+"sigAlloyDeclaration.txt")

Upvotes: 2

Related Questions