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
3
votes
1 answer

A faster way to build model in inria Spoon

I am using inria Spoon to parse Java projects, and then extract information about classes, Interfaces, fields, and methods and all their references. I am using the below code to build model of an input project. SpoonAPI spoonAPI = new…
Iman
  • 91
  • 7
3
votes
1 answer

Execution failed for task ':spoon'. > org/eclipse/jdt/internal/core/util/CommentRecorderParser

I am new to Spoon. I just know that using Spoon we can analyze and transform source code. I want to use Spoon in my gradle project. I am using IntelliJ IDEA for this project. I am getting this error when I tried to build the…
aravindkanna
  • 663
  • 1
  • 7
  • 25
1
vote
0 answers

How to modify existing annotation through spoon in java

I am trying to modify my models and remove deprecated annotations. Explained below. Current Class Class User{ @Column(name="Name",percision = 3,constraint = "constraint") private String name; } After modification @Column(name="Name",percision =…
Piyush Bali
  • 103
  • 6
1
vote
2 answers

How to use spoon to get the properties of a class in java?

I have a java file and I want to get the exception message for the exception type after the throw keyword // this is the code of D:\\ProjectFile\\AST\\Test\\000001\\test.java if (len < 0 || offset < 0 || len + offset > b.length) { …
Link
  • 19
  • 2
1
vote
0 answers

How to add CtStatement using inria spoon

I have a requirement where I need to remove JNDI lookup code from class and @Autowire the same. Current class: public class BankProcessor { public Collection getAccountInformation(String customerId){ Context context = new InitialContext(); …
Sai
  • 21
  • 3
1
vote
2 answers

What is the difference between wala and soot?

I need to chose a framework for following tasks in Java: extract control flow graph interprocedural and intraprocedural analysis dataflow analysis PDG different souce code analysis tasks (like method body extraction, test code extraction) Which…
Exploring
  • 2,493
  • 11
  • 56
  • 97
1
vote
1 answer

Modify java method body with spoon

I am trying to refactor old SimpleFormController. I would like to replace getSuccessView() and gerFormView() calls with actual success view and form view Strings. I went through https://spoon.gforge.inria.fr/first_transformation.html, it shows how…
Pavan Kumar
  • 462
  • 5
  • 13
1
vote
0 answers

How to add multiple values to CtAnnotation in inria Spoon

I am using Spoon 8.2.0 and have tried with Spoon 8.3.0 beta 10 as well: In the code below I try to add more than one value to an annotation, but it does not work as expected. I have a Java annotation Summary in Summary.java: package…
jottler189
  • 58
  • 4
1
vote
1 answer

Create instance of anonymous class with SPOON

I need to pass an instance of an anonymous class as a function parameter, in Spoon. In my case I have an anonymous Comparator that I need to pass to a function that gets Comparator as a parameter. Here's my code: public boolean…
1
vote
1 answer

Getting text of non-Javadoc tag inside doc comment with Spoon

I would like to use inria-spoon to process Java source files having custom non-Javadoc tags inside Doc comments. However, when Spoon processes Doc comments the String returned using CtMethod#getDocComment() will have replaced the text of non-Javadoc…
jottler189
  • 58
  • 4
1
vote
1 answer

INRIA SPOON API MethodCalls-Retrieve Callee Classes for method.getExecutable() and method.getTarget()

I am trying to extract method calls for a project that I am parsing using the tool spoon developed by INRIA, I already have a methods mysql table where I stored all the methods (methodid, methodname, classid, classname ). I am using the following…
larasmith
  • 7
  • 5
1
vote
2 answers

Spoon - Applying a Processor

I have been following this tutorial on getting started with Spoon. I've been having difficulty getting the following command to run (located at the bottom of the page in the link above): $ java -classpath…
Liam
  • 11
  • 1
1
vote
1 answer

Spoon and JDT like code parsing tool for JSP scriplets?

I have used Eclipse JDT API for analysing and processing Java codes of several Java classes by making AST tree of code. I have also used Spoon code parsing tool for one of my projects and successfully processed Java class files. Is there any…
Amit
  • 13,134
  • 17
  • 77
  • 148
1
vote
1 answer

How do we deal with "The type xxx is already defined" in spoon's source code analysis for a big project's source code?

When we use spoon to analyze the source code of a big project like Hadoop, it occurs frequently the problem "The type xxx is already defined", because there may exist Java classes with the same class name and the same package directory in different…
Jiaxin Li
  • 15
  • 2
1
vote
1 answer

Using Spoon Gradle Plugin for create customized Annotations Processor

I'm trying to write annotation processor in android using SPOON. So my question is when I have written my annotation processor class, how to indicate it to the compiler. Suppose that my class is located at com.craftman.spoonprocessor.CustomProcessor
shadaï ALI
  • 1,447
  • 1
  • 11
  • 11
1
2 3 4