Questions tagged [inria-spoon]

Spoon is an open-source library that enables you to transform and analyze Java source code.

Spoon is an open-source library that enables you to transform and analyze Java source code . Spoon provides a complete and fine-grained Java metamodel where any program element (classes, methods, fields, statements, expressions...) can be accessed both for reading and modification. Spoon takes as input source code and produces transformed source code ready to be compiled.

51 questions
0
votes
0 answers

getParent() returning unexpected node

I have the following code to analyze a++; return a++; Now, I have the following implementation of method isToBeProcessed public boolean isToBeProcessed(CtUnaryOperator candidate) { if (!super.validMutationSpot(candidate))…
DrStein
  • 75
  • 2
  • 13
0
votes
1 answer

How creating a new class and saving it to disk with spoon

I'm newbie with Spoon and, if I managed to transform class I did not find the way to generate a new class from scratch and save it to disk. I managed to create a new class but I did not see it in the generation directory. Any help would be greatly…
AMuse
  • 1
  • 1
0
votes
1 answer

Unmodified files also copied to target directory in inria spoon transformation

I have written source code transformation using inria-spoon library. I have the following function in my transformer (which makes sure that my "process" function is invoked only for desired classes): public boolean isToBeProcessed(CtInterface
sanjay
  • 11
  • 3
0
votes
1 answer

Issue in adding Annotation SwaggerDefinition at class level

I am new to spoon library for transformation of java source. Trying to use it to transform existing REST services. Requirement is to add io.swagger.annotations.SwaggerDefinition annotation at class level, e.g.: @SwaggerDefinition( tags = { …
sanjay
  • 11
  • 3
0
votes
1 answer

Processing without all dependencies in INRIA SPOON

I want to process a class for which I cannot resolve all dependencies and I got the following error: Exception in thread "main" spoon.compiler.ModelBuildingException: The import org.apache.commons cannot be resolved at…
El Marce
  • 3,144
  • 1
  • 26
  • 40
0
votes
1 answer

Extract Java element based on its corresponding XML element

I have a XML file resulted from an input java file. I also have xPath expressions for the XML file. I need a function that receives one xPath expression and return its java element (in the abstract syntax tree). I tried the below code: First…
1 2 3
4