Spoon is a metaprogramming library to analyze and transform Java source code (up to Java 15). :spoon: is made with :heart:, :beers: and :sparkles:. It parses source files to build a well-designed AST with powerful analysis and transformation API.

Overview

Maven Central Travis Build Status Coverage Status Maintainability Rating

Spoon

Spoon is an open-source library to analyze, rewrite, transform, transpile Java source code. It parses source files to build a well-designed AST with powerful analysis and transformation API. It fully supports modern Java versions up to Java 11, 12, 13, 14. Spoon is an official Inria open-source project, and member of the OW2 open-source consortium.

Documentation

The latest official documentation is available at http://spoon.gforge.inria.fr/ and a regularly updated PDF version is as https://projects.ow2.org/download/spoon/WebHome/spoon-user-manual.pdf.

Academic usage

If you use Spoon for academic purposes, please cite: Renaud Pawlak, Martin Monperrus, Nicolas Petitprez, Carlos Noguera, Lionel Seinturier. “Spoon: A Library for Implementing Analyses and Transformations of Java Source Code”. In Software: Practice and Experience, Wiley-Blackwell, 2015. Doi: 10.1002/spe.2346.

@article{pawlak:hal-01169705,
  TITLE = "{Spoon: A Library for Implementing Analyses and Transformations of Java Source Code}",
  AUTHOR = {Pawlak, Renaud and Monperrus, Martin and Petitprez, Nicolas and Noguera, Carlos and Seinturier, Lionel},
  JOURNAL = "{Software: Practice and Experience}",
  PUBLISHER = "{Wiley-Blackwell}",
  PAGES = {1155-1179},
  VOLUME = {46},
  URL = {https://hal.archives-ouvertes.fr/hal-01078532/document},
  YEAR = {2015},
  doi = {10.1002/spe.2346},
}

Professional support

If you need professional support on Spoon (development, training, extension), you are welcome to post a comment on https://github.com/INRIA/spoon/issues/3251

Getting started in 2 seconds

Get latest stable version with Maven, see https://search.maven.org/artifact/fr.inria.gforge.spoon/spoon-core

And start using it:

CtClass l = Launcher.parseClass("class A { void m() { System.out.println(\"yeah\");} }");

Documentation:

Contributing in 2 seconds

Create your first pull-request to improve the documentation, see doc! Proceed with your first bug fix! The community is open-minded, respectful and patient. All external contributions are welcome.

Design Philosophy

R1) The Spoon metamodel is as close as possible to the language concepts.

R2) The Spoon model of a program is complete and sound.

R3) The text version of a Spoon model is well-formed and semantically equivalent to the original program.

R4) The analysis and transformation API is intuitive and regular.

R5) Transformation operators are designed to warn as fast as possible about invalid programs. This is done either with static type checking or with dynamic checks when the operators are used.

R6) When feasible, the text version of a Spoon model is close to the original one.

Compiling

To compile Spoon, you need a Java Development Kit (JDK) and Maven:

git clone https://github.com/INRIA/spoon
cd spoon
mvn compile

To run the tests:

mvn test

Download

Latest version: https://search.maven.org/remote_content?g=fr.inria.gforge.spoon&a=spoon-core&v=LATEST&c=jar-with-dependencies - Javadoc

Maven:

<dependency>
    <groupId>fr.inria.gforge.spoon</groupId>
    <artifactId>spoon-core</artifactId>
    <!-- See rendered release value at http://spoon.gforge.inria.fr/ -->
    <version>{{site.spoon_release}}</version>
</dependency>

Releases

  • July 2020: Spoon 8.2.0 (changelog)
  • March 2020: Spoon 8.1.0 (changelog)
  • November 2019, Spoon 8.0.0 (changelog)
  • July 2019: Spoon 7.5.0 is released (changelog)
  • May 2019: Spoon 7.4.0 is released (changelog)
  • Februray 10, 2019: Spoon 7.3.0 is released (changelog)
  • December 4, 2018: Spoon 7.2.0 is released (changelog)
  • October 10, 2018: Spoon 7.1.0 is released (changelog)
  • July 4, 2018: Spoon 7.0.0 is released (changelog)
  • March 8, 2018: Spoon 6.2.0 is released (changelog)
  • December 20, 2017: Spoon 6.1.0 is released, merry christmas! 🎄 (changelog)
  • November 17, 2017: Spoon 6.0.0 is released! Check the (changelog) as there are few non backward-compatible changes ⚠️
  • September 6, 2017: Spoon 5.9.0 is released (changelog) back-to-work release!
  • July 11, 2017: Spoon 5.8.0 is released (changelog) Summer release 🍺 To be prefered wrt the previous one: fix lot of bugs.
  • June 01, 2017: Spoon 5.7.0 is released (changelog)
  • March 16, 2017: Spoon 5.6.0 is released (changelog) Spring release :-)
  • January 11, 2017: Spoon 5.5.0 is released (changelog). Happy new year!
  • October 27, 2016: Spoon 5.4.0 is released (changelog).
  • September 19, 2016: Spoon 5.3.0 is released (changelog).
  • June 30, 2016: Spoon 5.2.0 is released (changelog).
  • June 22, 2016: Spoon 5.1.1 is released (changelog).
  • March 21, 2016: Spoon 5.1.0 is released (changelog).
  • February 12, 2016: Spoon 5.0.2 is released (changelog).
  • February 3, 2016: Spoon 5.0.1 is released (changelog).
  • January 25, 2016: Spoon 5.0.0 is released (changelog).
  • November 18, 2015: Spoon 4.4.1 is released (changelog).
  • November 16, 2015: Spoon 4.4.0 is released (changelog).
  • September 22, 2015: Spoon 4.3.0 is released (changelog).
  • June 15, 2015: Spoon 4.2.0 is released (changelog).
  • May 7, 2015: Spoon 4.1.0 is released (changelog).
  • April 8, 2015: Spoon 4.0.0 is released (changelog).
  • February 11, 2015: Spoon 3.1 is released (changelog).
  • December 9, 2014: Spoon 3.0 is released (changelog).
  • November 12, 2014: Spoon 2.4 is released (changelog).
  • October 9, 2014: Spoon 2.3.1 is released (changelog).
  • September 12, 2014: Spoon 2.1 is released (changelog).
  • April 2, 2014: Spoon 2.0 is released (changelog).
  • September 30, 2013: Spoon 1.6 is released.
  • April 12, 2012: Spoon 1.5 is released.

Github Contributors

Alphabetical order of last names

git log --pretty="%an" | sed -e '/Spoon Bot/d' | sort -u | awk 'NF>=2 {print "* " $0}' | sort -k3
  • David Bernard
  • Artur Bosch
  • Egor Bredikhin
  • Maxime CLEMENT
  • Benoit Cornu
  • Andre Cruz
  • Benjamin DANGLOT
  • Scott Dickerson
  • Yann Diorcet
  • Thomas Durieux
  • Sergey Fedorov
  • Alcides Fonseca
  • Clement Fournier
  • Jan Galinski
  • Nicolas Harrand
  • Mickael Istria
  • Mehdi Kaytoue
  • Urs Keller
  • Filip Krakowski
  • Lukas Krejci
  • Ashutosh Kumar Verma
  • Roman Leventov
  • Fan Long
  • Kai Luo
  • Matias Martinez
  • Luke Merrick
  • Martin Monperrus
  • Vincenzo Musco
  • Carlos Noguera
  • Gerard Paligot
  • Renaud Pawlak
  • Nicolas Petitprez
  • Phillip Schichtel
  • Lionel Seinturier
  • Miguel Sozinho Ramalho
  • Marcel Steinbeck
  • Christopher Stokes
  • Eddie T
  • Simon Urli
  • Pavel Vojtechovsky
  • Stefan Wolf
  • Diorcet Yann
  • Gregor Zeitlinger
  • Tomasz Zielinski

Early contributors:

  • Olivier Barais
  • David Bernard
  • Benoit Cornu
  • Favio DeMarco
  • Didier Donsez
  • Christophe Dufour
  • Sebastian Lamelas Marcote
  • Matias Martinez
  • Carlos Noguera
  • Renaud Pawlak
  • Nicolas Pessemier
Comments
  • review: feature: introduce the concept of

    review: feature: introduce the concept of "Pattern"

    This PR introduces a new concept Pattern, which is an improvement of TemplateMatcher, it allows to match EVERY attribute of Spoon model - not only a subset like current TemplateMatcher.

    The concept of Pattern is like this:

    • Pattern consists of List of RootNodes. Main implementation of RootNode is ConstantNode, which handles constant values of attributes and ElementNode, which knows the node type and a Map<CtRole, RootNode> of nodes for handling of specific attributes. So ElementNodes and ConstantNodes together makes up the tree of the pattern - it mirrors to be generated/matched Spoon AST.
    • The variables in Pattern are represented by ParameterNode which links ParameterInfo, which defines which value from Map of parameters (ParameterValueProvider) has to substituted.
    • Structure of Pattern is usually created by copying/mirroring of an example template Spoon AST, but after it is initialized the Pattern processing is based on implementations of RootNode interface only. It doesn't need origin Spoon AST - so the matching and generating algorithms are much simpler and more flexible then before. The pattern can be created dynamically by code. No need to declare it in source as Template class. But there is of course a way how to create Pattern from legacy Template class too because in some cases it is possible. More complex patters can be first created from Template (like before) and then adapted by extra PatternBuilder calls to adjust things which were not possible with legacy Templates.
    • The Patterns are created by PatternBuilder, which accept any spoon AST. Even the legacy Template can be used to initialize Pattern. It is subject of future work to make a PatternBuilder intuitive and usable for clients.

    Both algorithms generating of code from template and matching code by template are primary behavior of new patterns and are 100% compatible. Everything what can be generated can be matched and opposite.

    opened by pvojtechovsky 112
  • [question] method call hierarchy

    [question] method call hierarchy

    Hello, I'm new to spoon and I'm wondering if following is possible to do with spoon.

    I have method externalServiceCall(...) which is called from many places in my application. Can I have call hierarchy to this method? What I want to achieve is that I will generate mappings of my @RestController to externalServiceCall(...).

    this is what I'm thinking about:

    • get all calls of method externalServiceCall(...)
    • from all methods extracted from previous step extract first parameter which is some enumeration implementing Service interface (with this I can extract the name of service)
    • continue with call hierarchy of externalServiceCall(...) and go upper until I find some annotation on method. In this case I'm searching for spring's @RequestMapping

    So in final I can have something like:

    • EXTERNAL_SERVICE1:
      • GET /endpoint1
      • POST /endpoint1/{id}
    • EXTERNAL_SERVICE2:
      • DELETE: /endpoint1
      • DELETE: /endpoint2

    this is example of how the externalService call looks like externalServiceCall(ProductServiceEnum.GET_DETAIL, request)

    ...

    opened by bilak 109
  • review: introduction of CtScannerFunction

    review: introduction of CtScannerFunction

    As I mentioned in #1005 it is sometime needed to

    • R1 to know when query step of type filterChildren enter/exit an element on one selected query step.
    • R2 to be able to skip processing of children of current element
    • R3 to be able to skip processing of siblings and children of current elements
    • R4 to be able to make mapping functions aware of query processing state (actually mainly whether query is terminated)

    There is already a Query Execution Context (QEC) impelemented by class CtQueryImpl$CurrentStep.

    There are needed these two things to implement this PR:

    1. to get access to the QEC, or to provide own extension of that context
    2. to define API of that QEC, which can be used to
      • drive execution of query
      • or to get query processing state.
        • the list of all Functions of the query
        • the index of actually processed Function
        • the depth of current node in the tree of nodes visited by this query

    Access to QEC

    The client might get access to QEC, by these ways: Access1) CtQuery#createQueryContext() By creation of QEC before query is executed. Then that instance can be used in functions of query to drive query

    //1) create instance of QEC
     CtQueryContext cc = anElement.map(...).createQueryContext();
    //2) use QEC to process query and to drive query, etc.
    cc.forEach(...)
    

    Access2) CtQuery#setQueryContext() By creating an own instance of QEC and setting it to query

    //1) create instance of QEC
     CtQueryContext cc = new QEC();
    //assign that instance to query
    anElement.map(...).setQueryContext(cc).forEach(...)
    

    Access3) (CtQueryContext)outputConsumer By conversion of outputConsumer of CtConsumableFunction(Object,CtConsumer) to QEC.

    anElement.map((input, output)->{
    CtQueryContext cc = (CtQueryContext)output;
    //use cc to drive query
    }).forEach((output)->{
    CtQueryContext cc = (CtQueryContext)output;
    //use the same cc instance like above to drive query
    });
    

    Access4) CtQuery extends CtQueryContext CtQuery extends CtQueryContext, so all the methods are available through query instance.

    API of QEC

    There might be these methods on QEC:

    • setOutputConsumer(CtConsumer) - sets the CtConsumer which will get results of this query execution
    • accept(Object input) - executes the query with input.
    • setTerminated(boolean) - terminates whole query
    • boolean isTerminated() - returns true if query is terminated
    • void onEnter(CtQueryListener) - register listener which is called before element is sent to mapping function
    • void onEnter(Filter, CtQueryListener) - some like onEnter, but calls listener only for elements which match the filter.
    • void onExit(CtQueryListener) - register listener which is called after element is sent to mapping function
    • void onExit(Filter, CtQueryListener) - same like onExit, but but calls listener only for elements which match the filter.
    • void onExitOf(Object, CtQueryListener) - same like onExit, but calls listener only when element is same like provided object.
    • void skipElement(CtElement); - skips element and all children. The mapping function is not called for such element and it's children
    • void setSkipMode(SkipMode); - skips elements depending mode until next call of setSkipMode or end of query.
    interface CtQueryListener<T> {
       void onElement(T element, CtQueryContext QEC);
    }
    

    Example

    //create query listener which skips all children of method
    CtQueryListener ql = new CtQueryListener() {
      boolean skipping = false;
       //return false to skip current element
       boolean onElement(CtElement e, CtQueryContext context) {
           if(skipping) return false;
           if(e instanceof CtMethod) {
              //if client wants to be called on exit of this element, then he can register listener for that
              context.onExitOf(e, (e, context)->{
                 skipping = false;
              });
              return false;
           }
           return true;
       }
    }
    anElement.map(...)..onEnter(ql).forEach(...);
    

    ...to be continued... Feedbacks and suggestions are welcome

    opened by pvojtechovsky 98
  • feature: all you want for queries

    feature: all you want for queries

    Requirements/goals for new features of queries:

    1. support of lazy foreach (better performance for large queries because no creation of useless intermediate lists)
      • CtQuery extends Iterator would an elegant solution but not possible because a Scanner is not iterable
    2. support for chaining of foreach
      • what should be the elements given for the next steps?
    3. support for lazy evaluation in map for functions that returns an iterator (already works for functions returning Iterable).
    4. support for queries reusable over multiple inputs (CtQuery query = new CtBaseQueryImpl().map(...).map(...) )
    5. support for sending of results of one step directly to next step, without necessity to build helper lists.
    interface CtQuery { // already exists
      /** Performs an action on each element of the query results.
        * Implemented efficiently for CtScanner based queries */
      CtQuery forEach(CtQueryStep);
    }
    
    interface CtQueryStep {
      /** 
       * evaluates query step and applies mapping of one input element to many output elements.
       * The output elements are `returned` by call of `outputConsumer.accept(outputElement)`, 
       * which is called once for each outputElement
       */
       void evaluate(Object input, CtConsumer<Object> outputConsumer);
    }
    
    /**This interface is equivavlent to java 8 Consumer. 
    We can remove it after we upgrade to java 8 */
    interface CtConsumer<T> {
     void accept(T item);
    }
    

    The method CtQuery#map(CtQueryStep) is semantically equal to the existing method CtQuery#map(CtFunction). The only difference is the way how result of mapping is delivered to the next query step.

    • Implementation of CtFunction - returns result by return objectBooleanOrList;. This is optimal for mapping functions which returns 1 or few elements.
    • Implementation of CtQueryStep- returns result by outputConsumer.apply(item), which is called for each spoon model element, which has to be returned by this step. This is optimal for mapping functions, which returns many elements.

    I need a spoon query, which correctly returns all the references to an private or protected class field. It means that query must search for references in correct scope(s).

    There was an idea how to implement it during development of PR #1018, but then we removed that code for simplicity reasons.

    @monperrus does it makes sense to create a new PR, which will reuse the same ideas again or do you know some better way?

    opened by pvojtechovsky 75
  • review: feat: TokenWriter - support for custom pretty printed formatting

    review: feat: TokenWriter - support for custom pretty printed formatting

    This PR implements new interface

    /**
     * The token based and context aware printer.
     */
    public interface PrinterTokenWriter {
    	/**
    	 * Writes one token of printed java source code to the registered {@link PrinterHelper}
    	 * @param type The type of the token
    	 * @param token the value of the token. The value type depends on TokenType. See {@link TokenType#getTokenClass()}
    	 */
    	void writeToken(TokenType type, Object token);
    	/**
    	 * @return {@link PrinterHelper} which this {@link PrinterTokenWriter} delegates printing to
    	 */
    	PrinterHelper getPrintHelper();
    	/**
    	 * @param printerHelper {@link PrinterHelper} which this {@link PrinterTokenWriter} delegates printing to
    	 */
    	void setPrintHelper(PrinterHelper printerHelper);
    
    	/**
    	 * Notifies about actually printed AST node
    	 * @param element to be printed element
    	 */
    	void onElementEnter(CtElement element);
    	/**
    	 * Notifies that printing of AST node was finished
    	 * @param element just printed element
    	 */
    	void onElementExit(CtElement element);
    
    	/**
    	 * resets to the initial state
    	 */
    	void reset();
    }
    /**
     * Defines type of token produced by PrettyPrinter
     */
    public enum TokenType {
    	/**
    	 * One of the separator characters (){}[];,.:@=&lt;&gt;?
    	 */
    	SEPARATOR(String.class),
    	/**
    	 * The operator of an expression. For example "==", "*", ...
    	 */
    	OPERATOR(String.class),
    	/**
    	 * java keyword. For example "class", "public", ...
    	 */
    	KEYWORD(String.class),
    	/**
    	 * identifier. For example "TheNameOfMyClass_Or_VariableEtc"
    	 */
    	IDENTIFIER(String.class),
    	/**
    	 * all the spaces, new lines and tabs
    	 */
    	WHITESPACE(String.class),
    	/**
    	 * the java literals. For example
    	 * "I am string"
    	 * 'c'
    	 * -4785.45
    	 * 4456.65e10
    	 * 0x00101011B
    	 */
    	LITERAL(String.class),
    	/**
    	 * The java comment. The token is instance of {@link CtComment}
    	 */
    	COMMENT(CtComment.class),
    	/**
    	 * The java doc tag. The token is instance of {@link CtJavaDocTag}
    	 */
    	JAVA_DOC_TAG(CtJavaDocTag.class),
    	/**
    	 * Special case of printing of CtCodeSnippetStatement.
    	 * The tokens are not resolved here!
    	 * Note:  the token value is {@link CtComment}
    	 */
    	CODE_SNIPPET(String.class),
    	/**
    	 * Special case of printing method signature.
    	 * It does not happen during printing of full sources,
    	 * but happen when printing an individual {@link CtExecutableReference}
    	 */
    	METHOD_SIGNATURE(String.class),
    	/**
    	 * represents new line
    	 * Note:  there is no token value expected here
    	 */
    	NEW_LINE(Void.class),
    	/**
    	 * represents the defined number of tabs
    	 * Note:  there is no token value expected here
    	 */
    	TABS(Void.class);
    }
    

    and there is method DefaultJavaPrettyPrinter#setPrinterTokenWriter(PrinterTokenWriter) which can be used to register that token based writer.

    The implementer of `PrinterTokenWriter#writeToken(...)' has to call registered PrinterHelper to print that token. The implementer can ignore/add some tokens, depending on context. It makes sense when client wants to influence formatting of pretty printed source code. Thanks to #onElementEnter and #onElementExit client is aware of the printed context and can influence formatting in context specific way.

    This PR keeps complexity of DefaultJavaPrettyPrinter on the same level. The detection of tokens is done automatically by new PrinterWriterTokenStreamAdapter.

    It even makes possible to simplify DefaultJavaPrettyPrinter in future, because it does not have to call PrinterHelper#writeTabs(), which might be called automatically by DefaultPrinterTokenWriter.

    I believe that in future we can write a PrinterTokenWriter implementation, which uses same formatting (autodetected) like origin source code or template which was used to generate new source code ... but is just a far dream yet ;-)

    opened by pvojtechovsky 70
  • feature: new query architecture with support for Java8 queries

    feature: new query architecture with support for Java8 queries

    Requirements for a new query architecture:

    • [x] map functions with arbitrary return types (incl. that are not CtElement)
    • [x] support for queries with Java 8 lambdas
    • [x] chained queries ( "chaining" means writing filterChildren(x).filterChildren(y)... or map(z).map(t)... or even filterChildren(p).map(q)...)
    • [x] lazy evaluation

    With this PR you can write code like

    CtMethod<?> method = ...
    List<CtMethod<?>> overridenMethods = Query.getElements(new OverriddenMethodFilter(method));
    

    Which makes usage of complex filters more reliable, because these filters can automatically define correct searching context. For example

    • OverriddenMethodFilter will search in root package
    • local variable reference filter will search in scope of its CtBock element
    • member variable reference filter will search in scope of its Class and depending on visibility in all inherited class, in current package or in root package
    • ...

    or you can write

    CtMethod<?> method = ...
    List<CtMethod<?>> overridenMethods = method.getElements(new OverriddenMethodFilter())
    

    which 1) is shortest code and 2) which will let us chain filters (later) into complex filters chains, which are able to browse spoon model in sequence of searching steps. I will probably need something like this for refactoring methods, I am preparing.

    opened by pvojtechovsky 52
  • CtExecutableReference in cloned method should refer to the clone, not to the method being cloned.

    CtExecutableReference in cloned method should refer to the clone, not to the method being cloned.

    Diff of the test which fails:

    diff --git a/src/test/java/spoon/test/method/MethodTest.java b/src/test/java/spoon/test/method/MethodTest.java
    index 0b585aa0..d689d4c0 100644
    --- a/src/test/java/spoon/test/method/MethodTest.java
    +++ b/src/test/java/spoon/test/method/MethodTest.java
    @@ -17,6 +17,7 @@
    
     package spoon.test.method;
    
    +import org.junit.Assert;
     import org.junit.Test;
     import spoon.Launcher;
     import spoon.reflect.declaration.CtClass;
    @@ -24,6 +25,8 @@ import spoon.reflect.declaration.CtMethod;
     import spoon.reflect.declaration.CtType;
     import spoon.reflect.declaration.ModifierKind;
     import spoon.reflect.factory.Factory;
    +import spoon.reflect.reference.CtExecutableReference;
    +import spoon.reflect.visitor.CtScanner;
     import spoon.reflect.visitor.filter.NamedElementFilter;
     import spoon.test.delete.testclasses.Adobada;
     import spoon.test.method.testclasses.Tacos;
    @@ -110,4 +113,22 @@ public class MethodTest {
     		assertTrue(compareFound);
     	}
    
    +	@Test
    +	public void testCloneMethod() throws Exception {
    +		Launcher l = new Launcher();
    +		l.getEnvironment().setNoClasspath(true);
    +		l.addInputResource("src/test/resources/noclasspath/A2.java");
    +		l.buildModel();
    +		CtMethod<?> methodB = l.getFactory().Class().get("A2").getMethodsByName("b").get(0);
    +		CtMethod<?> methodClone = methodB.clone();
    +		methodClone.accept(new CtScanner() {
    +			@Override
    +			public <T> void visitCtExecutableReference(CtExecutableReference<T> reference) {
    +				if (reference.getDeclaration() == methodB) {
    +					Assert.fail("Cloned method shouldn't have references to the former method");
    +				}
    +				super.visitCtExecutableReference(reference);
    +			}
    +		});
    +	}
     }
    
    opened by leventov 42
  • review: Rewrite type adaption

    review: Rewrite type adaption

    I was baited into rewriting type adaption a few weeks ago (damn you @MartinWitt and @SirYwell) and after suffering for a few too many working days it seems to be mostly compatible :)

    Fixes #4140.

    opened by I-Al-Istannen 39
  • review: feature: add support for pattern matching in Java 16 (JEP 394)

    review: feature: add support for pattern matching in Java 16 (JEP 394)

    This is a design to support the new pattern matching features that were finalized in Java 16. It addresses #3653 partly. As I'm not that familiar with the whole spoon project yet, there might be misunderstandings regarding some concepts from my side. Please let me know if anything is off.

    Design Notes:

    • As there are more pattern matching features planned (JEP 405: Record Patterns & Array Patterns (Preview) and JEP 406: Pattern Matching for switch (Preview)) it might make sense to have a common interface for different pattern matching variants. I had a CtPattern in the beginning but it ended up empty, so I decided to remove it again. If it can provide common functionality in future, it can be added back I guess.
    • In the current JLS, a LocalVariableDeclaration is a TypePattern (from my understanding). In spoon, that would make a CtLocalVariable to an CtExpression, as CtBinaryOperator wants a CtExpression as right hand operand. I decided to make CtLocalVariable a property of CtTypePattern instead to avoid issues with that.
    • This design is (meant to be) backwards compatible. Other approaches like specialising CtBinaryOperator would likely cause issues in that respect (at least everything I came up with).
    • JDT only added a LocalDeclaration field to their InstanceOfExpression. This seems to be less future-proof to me as the design proposed in this PR.

    Remaining questions/issues from my side:

    • The generated code partly changed license headers. I don't know how to deal with that (and why it is like that in the first place).
    • There is one remaining TODO in CtTypePatternImpl, as I wasn't sure if that's how the onObjectUpdate method is used correctly.
    • Generating and replacing the code in Metamodel produced a large diff (seems like EMODIFIER was missing in multiple places, while other roles were just moved a few lines up or down). I fixed/adapted the indendation differences, but I'm not sure how to deal with the rest of it.
    • Edit (2021-07-02): I needed to bump the spoon version used in the other modules to a SNAPSHOT version, Is it supposed to be like that?

    Thanks to @MartinWitt and @I-Al-Istannen for helping with the design decisions and issues I came accross.

    feature 
    opened by SirYwell 38
  • WIP: debug sniper mode with full project

    WIP: debug sniper mode with full project

    @monperrus Hey Martin, I managed to bundle the project here. I was unsure on how to set up this new part within the whole spoon project, I tried to add it to the main lib but unfortunately, I was unsuccessful in transforming it from Gradle to maven(it is due to the fact that the Gradle team does not provide the right and needed dependencies used for the development of Gradle plugin outside of Gradle), and since there is already a Gradle project inside I just added the whole Gradle project as a spoon subproject. I am opening the pull request to gather your input on how to proceed. In the PR you will find two new directories, one is called "leafactor-ci", I simply added my project as-is for now. I am using a published spoon dependency instead of a local one for now (having a local one would be better I guess). The Gradle plugin that leafactor-ci produces is published on the Gradle repository for now. I also added a small android application sample that uses the leafactor-ci plugin. The plugin simply refactors the sample app using the 'refactor' task in Gradle that the plugin provides. @monperrus Please take a look and tell me what you think.

    opened by moraispgsi 36
  • review: refactor: mutable collections of Spoon model handles parent and fire change events

    review: refactor: mutable collections of Spoon model handles parent and fire change events

    First step towards #1633 ... at the beginning only for CtBlock#statements ... later the same solution should be applied to each List, Set and Map of Spoon model

    WDYT?

    opened by pvojtechovsky 36
  • refactor: refactor bad smell UnnecessaryToStringCall

    refactor: refactor bad smell UnnecessaryToStringCall

    Repairing Code Style Issues

    UnnecessaryToStringCall

    The toString() method is not needed in cases the underlying method handles the conversion. Also calling toString() on a String is redundant. Removing them simplifies the code.

    Repairing Code Style Issues

    • UnnecessaryToStringCall (1)
    opened by MartinWitt 0
  • refactor: refactor bad smell RedundantArrayCreation

    refactor: refactor bad smell RedundantArrayCreation

    Repairing Code Style Issues

    RedundantArrayCreation

    Creating an empty array for calling varargs methods is redundant. You can call the method directly without the array. The fix is to remove the empty array.

    Repairing Code Style Issues

    • RedundantArrayCreation (1)
    opened by MartinWitt 0
  • Add GitHub issue notification when deploy job fails

    Add GitHub issue notification when deploy job fails

    There doesn't appear to be any GitHub issue notification setup for when the deploy job fails, as evidenced by #5055 not coming to our attention. It's a pretty important job so we do want to be notified.

    @monperrus can you setup the notification?

    chore 
    opened by slarse 3
  • fix(deps): update jfx.version to v19 (major)

    fix(deps): update jfx.version to v19 (major)

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | org.openjfx:javafx-fxml (source) | 11.0.2 -> 19 | age | adoption | passing | confidence | | org.openjfx:javafx-controls (source) | 11.0.2 -> 19 | age | adoption | passing | confidence | | org.openjfx:javafx-graphics (source) | 11.0.2 -> 19 | age | adoption | passing | confidence | | org.openjfx:javafx-base (source) | 11.0.2 -> 19 | age | adoption | passing | confidence |


    ⚠ Dependency Lookup Warnings ⚠

    Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information.


    Release Notes

    openjdk/jfx

    v14.0.1

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Support for static program slicing

    Support for static program slicing

    Describe the bug

    Does Spoon support to do static program slicing for inter-procedural program analysis.

    I see there are many many tools out there. But none of them support (or work actually) to do basic program analysis for example, data-flow analysis, control-flow analysis.

    I am curious to know whether Spoon would fill this gap!

    Source code you are trying to analyze/transform

    No response

    Source code for your Spoon processing

    No response

    Actual output

    No response

    Expected output

    No response

    Spoon Version

    latest

    JVM Version

    11

    What operating system are you using?

    Mac

    bug 
    opened by smith-co 0
  • [Bug]: Spoon cannot transform file

    [Bug]: Spoon cannot transform file

    Describe the bug

    I am using spoon to add comments to code blocks. For example when there is a "for" loop, I would add "start of for loop" to the code. I am using spoon's processor to achieve this. But when I run spoon processors on my files, I receive an error that I cannot understand. Do you have any idea what is going on?

    Source code you are trying to analyze/transform

    public class Temp {
        public void printHeaders()
    	{
    		int nbCols = columns.size();
    		for( int i = 0; i < nbCols; i++ )
    			columns.get( i ).hdrPrintsOn.print( null, new HdrInTreeTablePrinter( table, i ) );
    	}
    
    	@Override
    	public void print( Iterable<T> data )
    	{
    		killCurrentEdit();
    		table.emptyTable();
    
    		if( data == null )
    			return;
    
    		// sort if needed
    		if( userComparator != null )
    		{
    			ArrayList<T> tmp = new ArrayList<T>();
    			for( T t : data )
    			{
    				int ins = Collections.binarySearch( tmp, t, userComparator );
    				if( ins >= 0 )
    					tmp.add( ins, t );
    				else
    					tmp.add( -ins - 1, t );
    			}
    			data = tmp;
    		}
    
    		// each row
    		for( T d : data )
    		{
    			Row row = table.addRow( null );
    			row.setRef( refMng.getRef( d ) );
    
    			printRow( d, row );
    		}
    	}
    
    	@Override
    	public void updateRow( T object )
    	{
    		// find the row associated with this object
    		int objectRef = refMng.getRef( object );
    		Row item = getRow( objectRef );
    
    		if( edition != null && refMng.getRef( edition.editedObject ) == objectRef )
    			killCurrentEdit();
    
    		Row insPos = userComparator != null ? getInsertPoint( object ) : item;
    
    		// insert or move the row to the right place and create a cell printer
    		if( item == null )
    		{
    			// new
    			if( insPos != null )
    				insPos = insPos.addBefore();
    			else
    				insPos = table.addRow( null );
    
    			insPos.setRef( refMng.getRef( object ) );
    		}
    		else
    		{
    			if( insPos != item )
    			{
    				// GWT.log( "is at row " + row + " but should be at " + insPos
    				// );
    				item.moveBefore( insPos );
    				insPos = item;
    			}
    		}
    
    		// print the row
    		printRow( object, insPos );
    	}
    
    	private Row getInsertPoint( T object )
    	{
    		ArrayList<Row> items = table.getItemChilds( null );
    		int nbRows = items.size();
    		int objectRef = refMng.getRef( object );
    
    		if( userComparator != null )
    		{
    			for( Row item : items )
    			{
    				int refAtRow = item.getRef();
    
    				if( userComparator.compare( object, refMng.getObject( refAtRow ) ) <= 0 )
    				{
    					if( refAtRow == objectRef )
    					{
    						// keep the same place only if lesser than the nxt item
    						// or if there is no next
    						if( items.indexOf( item ) == nbRows - 1 )
    						{
    							return item;
    						}
    						else
    						{
    							int refAtNextRow = getRefAtRow( item.getNextSiblingItem() );
    							if( userComparator.compare( object, refMng.getObject( refAtNextRow ) ) <= 0 )
    								return item;
    						}
    					}
    					else
    					{
    						return item;
    					}
    				}
    			}
    		}
    
    		return null;
    	}
    
    	@Override
    	public void deleteRow( int ref )
    	{
    		Row item = getRow( ref );
    		if( item == null )
    			return;
    
    		// to reset the edition state, just in case... (an only if we are
    		// editing on the row we delete)
    		if( edition != null && refMng.getRef( edition.editedObject ) == ref )
    			killCurrentEdit();
    
    		item.remove();
    	}
    
    	@Override
    	public void setComparator( Comparator<T> comparator )
    	{
    		userComparator = comparator;
    		sortAndPrint( comparator );
    	}
    
    	public void sortAndPrint( final Comparator<T> userComparator )
    	{
    		class It
    		{
    			Row item;
    			T object;
    
    			It( Row item, T object )
    			{
    				this.object = object;
    				this.item = item;
    			}
    		}
    		;
    
    		ArrayList<It> its = new ArrayList<It>();
    
    		// get all objects from the table
    		ArrayList<Row> childs = table.getItemChilds( null );
    		for( Row item : childs )
    		{
    			int ref = getRefAtRow( item );
    
    			its.add( new It( item, refMng.getObject( ref ) ) );
    		}
    
    		// sort them
    		Collections.sort( its, new Comparator<It>()
    		{
    			@Override
    			public int compare( It o1, It o2 )
    			{
    				return userComparator.compare( o1.object, o2.object );
    			}
    		} );
    
    		// now reorder the lines
    		for( int j = 0; j < its.size(); j++ )
    		{
    			// item at position j ?
    			Row atJ = table.getItemChilds( null ).get( j );
    			// needed item is its[i].item
    			Row neededItem = its.get( j ).item;
    
    			if( atJ != neededItem )
    			{
    				// move its[i].item before item at position i
    				neededItem.moveBefore( atJ );
    			}
    		}
    	}
    
    	private int getRefAtRow( Row item )
    	{
    		return item.getRef();
    	}
    
    	// return the row index of the row associated to the object referenced as
    	// objectRef
    	// returns null if the row is not found
    	private Row getRow( int objectRef )
    	{
    		return table.getItemForRef( objectRef );
    	}
    
    	// returns a printer that can be used for the next call. a new one can be
    	// created
    	// WARNING : assumes the printer item is correctly initialized
    	private void printRow( T object, Row row )
    	{
    		// to reset the edition state, just in case...
    		if( edition != null && refMng.getRef( edition.editedObject ) == refMng.getRef( object ) )
    			killCurrentEdit();
    
    		// writes the element reference on the corresponding row element
    		// note that this does not create a hard link to the referenced object
    		// so
    		// no garbage is created here
    		row.setRef( refMng.getRef( object ) );
    
    		// each column
    		for( int i = 0; i < columns.size(); i++ )
    			columns.get( i ).prints.print( object, new CellInTreeTablePrinter( row, i ) );
    	}
    
    	private boolean beginEdit( Row item, int col )
    	{
    		int ref = getRefAtRow( item );
    
    		if( edition != null && ref == refMng.getRef( edition.editedObject ) )
    			return true; // already began !!!
    
    		killCurrentEdit();
    
    		Edits<T> editMng = columns.get( col ).edits;
    		if( editMng == null )
    			return false;
    
    		// find the T object that has been clicked
    		T object = refMng.getObject( ref );
    		assert object != null;
    		if( object == null )
    			return false;
    
    		Element td = item.getTdElement( col );
    
    		edition = new EditionState();
    
    		// initialize and set the current edit
    		edition.editedCol = col;
    		edition.editedObject = object;
    
    		// create a Printer corresponding to this cell
    		edition.editedPrinter = new CellInTreeTablePrinter( item, col );
    
    		// create an editor and init it
    		// -2 to remove padding : HACK HACK HACK
    		edition.editedEditor = editMng.createEditor( edition.editedObject, edition.editedPrinter, onEdit, td.getOffsetWidth() - 2, td.getClientHeight() - 2 );
    
    		return true;
    	}
    
    	private static class CellPos
    	{
    		Row item;
    		int col;
    
    		CellPos( Row item, int col )
    		{
    			this.item = item;
    			this.col = col;
    		}
    	}
    
    	private final MouseDownHandler onTableMouseDown = new MouseDownHandler()
    	{
    		@Override
    		public void onMouseDown( MouseDownEvent event )
    		{
    			Element source = DOM.eventGetTarget( Event.as( event.getNativeEvent() ) );
    
    			// try to see if it's not on a th element
    			int hdr = table.getEventTargetHeaderIdx( source );
    			if( hdr < 0 )
    				return;
    
    			DragDrop.initiate( source, onDragDrop, hdr, Event.as( event.getNativeEvent() ) );
    		}
    	};
    
    	DragDrop.Callback<Integer> onDragDrop = new DragDrop.Callback<Integer>()
    	{
    		@Override
    		public String getGhostInnerHTML( Integer cookie, Element source )
    		{
    			class TempPrinter implements Printer
    			{
    				String html = null;
    
    				@Override
    				public void setWidget( Widget widget )
    				{
    					assert false;
    				}
    
    				@Override
    				public void setText( String text )
    				{
    					html = text;
    				}
    
    				@Override
    				public void setHTML( String html )
    				{
    					this.html = html;
    				}
    			}
    
    			TempPrinter printer = new TempPrinter();
    
    			columns.get( cookie ).hdrPrintsOn.print( null, printer );
    
    			// Due to asynchronism, it may be possible that the printer did not
    			// yet print anything, well... Too late, we use the source element
    			// instead !!
    			if( printer.html == null )
    				return "<div style='background-color:rgba(120,120,120,0.4);'>" + source.getInnerHTML() + "</div>";
    
    			return "<div style='background-color:rgba(120,120,120,0.4);width:20px;height:20px;'>" + printer.html + "</div>";
    		}
    
    		@Override
    		public void onDragDropFinished( Integer cookie, Element source, Element destination )
    		{
    			int newPos = table.getEventTargetHeaderIdx( destination );
    			if( newPos < 0 )
    				return;
    
    			ColumnMng<T> dum = columns.get( cookie );
    			columns.set( cookie, columns.get( newPos ) );
    			columns.set( newPos, dum );
    
    			// Redraw headers
    			printHeaders();
    
    			// Redraw all objects in the table
    			ArrayList<Row> items = table.getItemChilds( null );
    			for( Row item : items )
    			{
    				int ref = item.getRef();
    				printRow( refMng.getObject( ref ), item );
    			}
    		}
    	};
    
    	private final Edits.Callback onEdit = new Edits.Callback()
    	{
    		@Override
    		public void cancelEdition()
    		{
    			killCurrentEdit();
    		}
    
    		@Override
    		public void validateEdition( boolean fJumpNext )
    		{
    			// just forget the edition state, but don't redraw
    			// that means we let the client continue drawing on its cell
    			if( edition != null && fJumpNext )
    			{
    				CellPos next = getNextPos( getRow( refMng.getRef( edition.editedObject ) ), edition.editedCol );
    
    				edition.close();
    				edition = null;
    
    				beginEdit( next.item, next.col );
    			}
    		}
    	};
    
    	// wait a bit to avoid ui jitter...
    	// use refMng in case the data change during the time waited
    	private void killCurrentEdit()
    	{
    		if( edition == null )
    			return;
    
    		// reprints the cell, with uptodate data
    		columns.get( edition.editedCol ).prints.print( refMng.getObject( refMng.getRef( edition.editedObject ) ), edition.editedPrinter );
    
    		edition.close();
    		edition = null;
    	}
    
    	CellPos getNextPos( Row item, int col )
    	{
    
    		// either on the same row
    		for( int c = col + 1; c < columns.size(); c++ )
    		{
    			if( columns.get( c ).edits != null )
    				return new CellPos( item, c );
    		}
    
    		// or on the next
    		item = item.getNextSiblingItem();
    		for( int c = 0; c < columns.size(); c++ )
    		{
    			if( columns.get( c ).edits != null )
    				return new CellPos( item, c );
    		}
    
    		return null;
    	}
    }
    

    Source code for your Spoon processing

    // file processors/ForProcessor.java
    package spoon.processors;
    
    import spoon.processing.AbstractProcessor;
    import spoon.reflect.visitor.filter.TypeFilter;
    import spoon.reflect.visitor.CtIterator;
    import spoon.reflect.declaration.CtElement;
    import spoon.reflect.code.CtFor;
    import spoon.reflect.code.CtComment;
    import spoon.reflect.factory.Factory;
    
    import java.util.List;
    import java.io.*;
    
    public class ForProcessor extends AbstractProcessor<CtFor> {
    	public void process(CtFor element) {
    		element.addComment(element.getFactory().Code().createComment("START OF FOR LOOP STATEMENT",CtComment.CommentType.INLINE));
    	}
    }
    

    Actual output

    Exception in thread "main" java.lang.Runtime Exception: Inconsistent Stack public static @Nonnull IMicroNode convertToMicroNode (fi
    nal @Nonnull Node aNode) {
    ValueEnforcer.notNull(aNode, "Node");
    IMicroNode ret;
    final short nNodeType=aNode.getNode Type();
    case Node. DOCUMENT_NODE :
    {
    ret = new MicroDocument ();
    break;
    }
    case Node. DOCUMENT_TYPE_NODE :
    {
    final DocumentType aDT = (DocumentType) aNode;
    ret = new MicroDocument Type (aDT.getName(), aDT.getPublicId(), aDT.getSystemId());
    break;
    }
    case Node.ELEMENT_NODE :
    final Element a Element = (Element) aNode;
    final String sNamespaceURI = aElement.getNamespaceURI();
    final IMicroElement eElement = ((sNamespaceURI != null)? new Micro Element(sNamespaceURI, aElement.getLocalName()): new MicroE
    lement (aElement.getTagName()));
    }
    case Node. ELEMENT_NODE :
    at
    at spoon.support.compiler.jdt. JDTTree Builder.endVisit(JDTTree Builder.java:541)
    at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration. traverse(MethodDeclaration.java:440)
    at org.eclipse.jdt.internal.compiler.ast. Type Declaration. traverse (Type Declaration.java:1699)
    at org.eclipse.jdt.internal.compiler.ast.CompilationUnit Declaration. traverse (Compilation Unit Declaration.java:827)
    at org.eclipse.jdt.internal.compiler.ast.CompilationUnit Declaration. traverse (CompilationUnit Declaration.java:788)
    at spoon.support.compiler.jdt. JDTBased SpoonCompiler.traverseUnit Declaration (JDTBased SpoonCompiler.java:481)
    at spoon.support.compiler.jdt. JDTBased SpoonCompiler.lambda$buildModel$0 (JDTBased SpoonCompiler.java:438)
    at spoon.support.compiler.jdt. JDTBased SpoonCompiler.forEach CompilationUnit (JDTBased SpoonCompiler.java:465)
    at spoon.support.compiler.jdt.JDTBased SpoonCompiler.buildModel (JDTBased Spoon Compiler.java:436)
    at spoon.support.compiler.jdt.JDTBased SpoonCompiler.build Units And Model (JDTBased SpoonCompiler.java:373)
    at spoon.support.compiler.jdt.JDTBased Spoon Compiler.buildSources (JDTBased SpoonCompiler.java:336)
    at spoon.support.compiler.jdt. JDTBased SpoonCompiler.build(JDTBased Spoon Compiler.java:117)
    at spoon.support.compiler.jdt. JDTBased SpoonCompiler.build(JDTBased SpoonCompiler.java:100)
    at spoon. Launcher.buildModel (Launcher.java:782)
    at spoon. Launcher.run(Launcher.java:733)
    at spoon. Launcher.run(Launcher.java:112)
    at spoon. Launcher.main(Launcher.java:105)
    spoon.support.compiler.jdt.ContextBuilder.exit(ContextBuilder.java:122)
    

    Expected output

    No response

    Spoon Version

    10.2.0

    JVM Version

    11

    What operating system are you using?

    Linux

    bug information-needed 
    opened by Ryan-Rong-24 1
Releases(spoon-core-10.2.0)
  • spoon-core-10.2.0(Oct 21, 2022)

  • spoon-core-10.1.0(Apr 12, 2022)

    Changelog

    New features

    • Support shift left and right operation inside VisitorPartialEvaluator. (PR: #4237)
    • Add support for first class resource in try-with-resource. (PR: #4371)
    • Add support for type parameters on method references. (PR: #4343)

    Bug fixes

    • ImportCleaner: Resolve imports of parent types. (PR: #4353)
    • Launcher: NPE in Launcher.prettyprint(). (PR: #4303)
    • MavenLauncher: Maximum recovery from missing libraries. (PR: #4336)
    • record: Valid assignments in record compact constructors. (PR: #4389)
    • Backward compatible modeling of try-with-resource. (PR: #4625)
    • Fix incorrect import. (PR: #4610)
    • Fix qodana warning with proper call to Array.toString(). (PR: #4536)
    • No parentheses for single lambda parameters. (PR: #4448)
    • Escape sequences in text-blocks are kept. (PR: #4409)
    • Fix square bracket printing in array field declarations. (PR: #4436)
    • Correct type reference for ClassLiteralAccess. (PR: #4383)
    • Do not strip super class from qualified name. (PR: #4359)
    • Handle spaces in classpath paths. (PR: #4358)
    • Print square brackets in array initalisation. (PR: #4341)
    • Clone metadata for elements created via template. (PR: #4396)
    • Fix testcases for windows CI. (PR: #4385)
    • Add junit extension for line endings. (PR: #4349)
    • Fix pretty-printing ordering for record parameters. (PR: #4366)
    • Prevent stackoverflow when visiting of cyclic annotation/package structures. (PR: #4356)
    • Prevent removal of static field import. (PR: #4331)
    • Prevent importing classes which are already imported via *. (PR: #4320)
    • Print each resource in CtTryWithResource exactly once and retain separator. (PR: #4309)
    • Lookup absolute path to maven executable. (PR: #4298)
    • Ensure sniper pretty-printer prints modifiers and type separated by a space. (PR: #4296)
    • Removed annotation should not appear in sniper mode. (PR: #4284)
    • Add missing space after modifiers in sniper mode. (PR: #4279)
    • Fix flaky test TestModule.testModuleNames(). (PR: #4286)
    • Correctly print type parameters of generic records. (PR: #4283)

    Migration to JUnit5

    • Migrate SMPL tests to JUnit5. (PR: #4598)
    • Migrate dataflow to Junit 5. (PR: #4618)
    • Migrate spoon-control-flow tests to JUnit 5. (PR: #4615)
    • Migrate decompiler to JUnit 5. (PR: #4599)
    • Migrate OneCanCallSetterWithNullParameterizedTest to JUnit 5. (PR: #4555)
    • Migrate InterfaceTest to JUnit 5. (PR: #4556)
    • Migrate TestInterfaceWithoutSetup to JUnit 5. (PR: #4557)
    • Migrate ImportBuilderTest to JUnit 5. (PR: #4562)
    • Migrate TestLabels to JUnit 5. (PR: #4563)
    • Migrate AnonymousInLambdaTest to JUnit 5. (PR: #4564)
    • Migrate SetParentTest to JUnit 5. (PR: #4567)
    • Migrate Maintest to JUnit 5. (PR: #4570)
    • Migrate ContractOnSettersParametrizedTest to JUnit 5. (PR: #4569)
    • Migrate InvocationTest to JUnit 5. (PR: #4558)
    • Migrate AnnotationPositionTest to JUnit 5. (PR: #4559)
    • Migrate SniperPrettyPrinterJavaxTest to JUnit 5. (PR: #4560)
    • Migrate JarTest to JUnit 5. (PR: #4561)
    • Migrate LambdaTest to JUnit 5. (PR: #4565)
    • Migrate InternalTest to JUnit 5. (PR: #4566)
    • Move test Java source to ./src/test/resources/. (PR: #4568)
    • Migrate MethodOverriddingTest to JUnit 5. (PR: #4550)
    • Migrate MethodTest to JUnit 5. (PR: #4551)
    • Migrate LoopTest to JUnit 5. (PR: #4552)
    • Migrate UnicodeBugTest to JUnit 5. (PR: #4553)
    • Migrate LiteralTest to JUnit 5. (PR: #4554)
    • Migrate ReplaceParametrizedTest. (PR: #4542)
    • Migrate ParallelProcessorTest to JUnit 5. (PR: #4543)
    • Migrate TestModule to JUnit 5. (PR: #4544)
    • Migrate ModifiersTest to JUnit 5. (PR: #4545)
    • Migrate TypeTest to JUnit 5. (PR: #4546)
    • Migrate BlockTest to JUnit 5. (PR: #4547)
    • Migrate MethodReferenceTest to JUnit 5. (PR: #4549)
    • Migrate FactoryTest to JUnit 5. (PR: #4530)
    • Migrate CUFilterTest to JUnit 5. (PR: #4531)
    • Migrate TypeFactoryTest to JUnit 5. (PR: #4532)
    • Migrate NameScopeTest to JUnit 5. (PR: #4533)
    • Migrate IntercessionTest to JUnit 5. (PR: #4534)
    • Migrate InsertMethodsTest to JUnit 5. (PR: #4535)
    • Migrate InitializerTest to JUnit 5. (PR: #4527)
    • Migrate ConstructorFactoryTest to JUnit 5. (PR: #4513)
    • Migrate CodeFactoryTest to JUnit 5. (PR: #4514)
    • Migrate ClassFactoryTest to JUnit 5. (PR: #4515)
    • Migrate AnnotationFactoryTest to JUnit 5. (PR: #4516)
    • Migrate to ExecutableTest to JUnit 5. (PR: #4517)
    • Migrate ExecutableRefTest to JUnit 5. (PR: #4518)
    • Migrate to ExceptionTest to JUnit 5. (PR: #4519)
    • Migrate EnumsTypeTest to JUnit 5. (PR: #4520)
    • Migrate FluentLauncherTest to JUnit 5. (PR: #4521)
    • Migrate ExecutableFactoryTest to JUnit 5. (PR: #4522)
    • Migrate FieldFactoryTest to JUnit 5. (PR: #4523)
    • Migrate FieldAccessTest to JUnit 5. (PR: #4524)
    • Migrate GenericsTest to JUnit 5. (PR: #4525)
    • Migrate StaticNoOrdered to JUnit 5. (PR: #4526)
    • Migrate RemoveTest to JUnit 5. (PR: #4528)
    • Migrate TopLevelTypeTest to JUnit 5. (PR: #4505)
    • Migrate PackageTest JUnit 5. (PR: #4504)
    • Migrate PositionTest to JUnit 5. (PR: #4503)
    • Migrate TestSourceFragment to JUnit 5. (PR: #4502)
    • Migrate LinesTest to JUnit 5. (PR: #4501)
    • Migrate LoopSniperJavaPrettyPrinterTest to JUnit 5. (PR: #4500)
    • Migrate PrinterTest JUnit 5. (PR: #4499)
    • Migrate VariableReferencesTest to JUnit 5. (PR: #4497)
    • Migrate TestCtBlock to JUnit 5. (PR: #4491)
    • Migrate QualifiedThisRefTest. (PR: #4498)
    • Migrate EvalTest to JUnit 5. (PR: #4495)
    • Migrate DeleteTest to JUnit 5. (PR: #4494)
    • Migrate CtBodyHolderTest to JUnit 5. (PR: #4493)
    • Migrate CtClassTest to JUnit 5. (PR: #4492)
    • Migrate GetBinaryFilesTest to JUnit 5. (PR: #4486)
    • Migrate NewClassTest to JUnit 5. (PR: #4490)
    • Migrate ControlTest to JUnit 5. (PR: #4489)
    • Migrate ConstructorCallTest to JUnit 5. (PR: #4488)
    • Migrate ConditionalTest to JUnit 5. (PR: #4487)
    • Migrate EqualTest to JUnit 5. (PR: #4485)
    • Migrate ParentTest to JUnit 5. (PR: #4506)
    • Migrate NullParentTest to JUnit 5. (PR: #4507)
    • Migrate ParameterTest to JUnit 5. (PR: #4508)
    • Migrate ClassesTest to JUnit 5. (PR: #4465)
    • Migrate ModelStreamerTest to JUnit 5. (PR: #4464)
    • Migrate SerializableTest to JUnit 5. (PR: #4463)
    • Migrate SignatureTest to Junit 5. (PR: #4462)
    • Migrate SnippetTest to JUnit 5. (PR: #4461)
    • Migrate TypeTest to Junit 5. (PR: #4460)
    • Migrate TestCtRole to JUnit 5. (PR: #4466)
    • Migrate VariableAccessTest to Junit 5. (PR: #4469)
    • Migrate ExecutableReferenceTest to Junit 5. (PR: #4471)
    • Migrate CtInheritanceScannerTest to JUnit 5. (PR: #4482)
    • Migrate PathTest to JUnit 5. (PR: #4479)
    • Migrate VariableReferencesModelTest to JUnit 5. (PR: #4476)
    • Migrate TypeReferenceTest to Junit 5. (PR: #4470)
    • Migrate ReferenceQueryTest to Junit 5. (PR: #4468)
    • Migrate ReplaceTest to Junit 5. (PR: #4467)
    • Migrate ProcessingTest to JUnit 5. (PR: #4478)
    • Migrate PropertiesTest to JUnit 5. (PR: #4477)
    • Migrate AnnotationFieldReferenceTest to JUnit 5. (PR: #4475)
    • Migrate CloneReferenceTest to JUnit 5. (PR: #4474)
    • Migrate ElasticsearchStackoverflowTest to JUnit 5. (PR: #4473)
    • Migrate ExecutableReferenceGenericTest to JUnit 5. (PR: #4472)
    • Migrate AnnotationTest to junit 5. (PR: #4415)
    • Migrate AccessTest to Junit 5. (PR: #4438)
    • Migrate AccessFullyQualifiedFieldTest to JUnit 5. (PR: #4439)
    • Migrate SourcePositionTest to JUnit 5. (PR: #4447)
    • Migrate VarArgsTest to JUnit 5. (PR: #4440)
    • Migrate TryCatchTest to JUnit 5. (PR: #4441)
    • Migrate TargetedExpressionTest to JUnit 5. (PR: #4442)
    • Migrate ResourceTest to JUnit 5. (PR: #4443)
    • Migrate ImplicitStaticFieldReferenceTest to JUnit 5. (PR: #4444)
    • Migrate StaticAccessTest to JUnit 5. (PR: #4445)
    • Migrate SpoonifierTest to JUnit 5. (PR: #4446)
    • Migrate AssignmentsEqualsTest to junit 5. (PR: #4424)
    • Migrate ToStringBugTest to Junit 5. (PR: #4422)
    • Migrate VisitorTest to Junit 5. (PR: #4423)
    • Migrate VisibilityTest to Junit 5. (PR: #4425)
    • Migrate ChangeCollectorTest to Junit 5. (PR: #4432)
    • Migrate CompilationTest to Junit 5. (PR: #4433)
    • Migrate TestCompilationUnit to Junit 5. (PR: #4434)
    • Migrate SpoonArchitectureEnforcerTest to Junit 5. (PR: #4430)
    • Migrate NoClasspathTest to Junit 5. (PR: #4431)
    • Migrate LauncherTest to Junit 5. (PR: #4428)
    • Migrate MetamodelTest to Junit 5. (PR: #4429)
    • Migrate ConstructorTest to JUnit 5. (PR: #4435)
    • Migrate CtScannerTest to junit 5. (PR: #4411)
    • Migrate MavenLauncherTest to Junit 5. (PR: #4416)
    • Migrate AnnotationValuesTest to Junit 5. (PR: #4418)
    • Migrate APITest to Junit 5. (PR: #4420)
    • Migrate FileSystemFolderTest to junit 5. (PR: #4419)
    • Migrate OutputTypeTest to Junit 5. (PR: #4417)
    • Migrate AnnotationLoopTest to junit 5. (PR: #4414)
    • Migrate TreeBuilderCompilerTest to junit 5. (PR: #4413)
    • Migrate CtVisitorTest to junit 5. (PR: #4412)
    • Migrate CloneTest to Junit 5. (PR: #4401)
    • Migrate CtTypeInformationTest to Junit 5. (PR: #4402)
    • Migrate GenerateParentlessPackageTest to junit 5. (PR: #4403)
    • Migrate CtBFSIteratorTest to junit 5. (PR: #4404)
    • Migrate CtInheritanceScannerMethodsTest to junit 5. (PR: #4405)
    • Migrate CtIteratorTest to junit 5. (PR: #4406)
    • Migrate to junit 5. (PR: #4398)
    • Migrate CompilationUnitPrintTest to junit 5. (PR: #4400)
    • Refactor StringLiteralTest to Junit 5. (PR: #4390)
    • Migrate UnknownDeclarationTest to junit 5. (PR: #4392)

    Dependencies

    • Update dependency com.fasterxml.jackson.core:jackson-databind to v2.13.2. (PR: #4632)
    • Update dependency org.bitbucket.mstrobel:procyon-compilertools to v0.6.0. (PR: #4620)
    • Update dependency org.slf4j:slf4j-api to v1.7.36. (PR: #4592)
    • Update dependency through2 to v4. (PR: #4459)
    • Update dependency org.slf4j:slf4j-api to v1.7.35. (PR: #4574)
    • Update dependency org.apache.maven.plugins:maven-dependency-plugin to v3.3.0. (PR: #4639)
    • Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.10.1. (PR: #4638)
    • Update dependency gradle to v7.4.1. (PR: #4635)
    • Update dependency ch.qos.logback:logback-classic to v1.2.11. (PR: #4631)
    • Update mockito monorepo to v4.4.0. (PR: #4634)
    • Update actions/checkout action to v3. (PR: #4630)
    • Update dependency com.google.guava:guava to v31.1-jre. (PR: #4629)
    • Update actions/setup-python action to v3. (PR: #4628)
    • Update actions/setup-java action to v3. (PR: #4627)
    • Update dependency org.junit.jupiter:junit-jupiter to v5.8.2. (PR: #4622)
    • Delete junit 4 dependency. (PR: #4619)
    • Update dependency org.sonatype.plugins:nexus-staging-maven-plugin to v1.6.11. (PR: #4609)
    • Update dependency org.sonatype.plugins:nexus-staging-maven-plugin to v1.6.10. (PR: #4597)
    • Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.10.0. (PR: #4602)
    • Update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.3.2. (PR: #4596)
    • Update dependency gradle to v7.4. (PR: #4590)
    • Update actions/setup-python action to v2.3.2. (PR: #4586)
    • Update jetbrains/qodana-action action to v4.2.5. (PR: #4583)
    • Update jetbrains/qodana-action action to v4.2.4. (PR: #4580)
    • Update mockito monorepo to v4.3.1. (PR: #4578)
    • Update mockito monorepo to v4.3.0. (PR: #4572)
    • Update dependency org.slf4j:slf4j-api to v1.7.33. (PR: #4496)
    • Update jetbrains/qodana-action action to v4.2.3. (PR: #4511)
    • Update dependency com.mysema.querydsl:querydsl-core to v3.7.4. (PR: #4450)
    • Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.9.0. (PR: #4481)
    • Update dependency org.apache.maven.plugins:maven-jar-plugin to v3.2.2. (PR: #4483)
    • Update actions/checkout action to v2.4.0. (PR: #4449)
    • Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.8.1. (PR: #4453)
    • Update dependency junit:junit to v4.13.2. (PR: #4452)
    • Update dependency org.apache.maven.plugins:maven-jar-plugin to v3.2.1. (PR: #4426)
    • Update plugin com.github.ben-manes.versions to v0.41.0. (PR: #4399)
    • Update jetbrains/qodana-action action to v4.2.2. (PR: #4397)
    • Update plugin com.github.ben-manes.versions to v0.40.0. (PR: #4391)
    • Update plugin com.github.johnrengelman.shadow to v7.1.2. (PR: #4388)
    • Update jetbrains/qodana-action action to v4.2.1. (PR: #4375)
    • Update dependency org.apache.maven.wagon:wagon-ssh to v3.5.1. (PR: #4386)
    • Update dependency ch.qos.logback:logback-classic to v1.2.10. (PR: #4379)
    • Update dependency org.apache.maven.wagon:wagon-ssh to v3.5.0. (PR: #4378)
    • Update dependency gradle to v7.3.3. (PR: #4376)
    • Update actions/setup-java action to v2.5.0. (PR: #4372)
    • Update mockito monorepo to v4.2.0. (PR: #4360)
    • Update dependency ch.qos.logback:logback-classic to v1.2.9. (PR: #4364)
    • Update dependency gradle to v7.3.2. (PR: #4355)
    • Update dependency ch.qos.logback:logback-classic to v1.2.8. (PR: #4352)
    • Update plugin com.github.johnrengelman.shadow to v7.1.1. (PR: #4354)
    • Update dependency org.benf:cfr to v0.152. (PR: #4347)
    • Update dependency org.eclipse.jdt:org.eclipse.jdt.core to v3.28.0. (PR: #4338)
    • Update dependency gradle to v7.3.1. (PR: #4321)
    • Update junit5 monorepo to v5.8.2. (PR: #4314)
    • Update actions/setup-java action to v2.4.0. (PR: #4316)
    • Update actions/setup-python action to v2.3.1. (PR: #4317)
    • Update mockito monorepo to v4.1.0. (PR: #4299)
    • Update actions/cache action to v2.1.7. (PR: #4304)
    • Update actions/setup-python action to v2.3.0. (PR: #4293)
    • Update dependency org.jetbrains:annotations to v23. (PR: #4276)
    • Update dependency ch.qos.logback:logback-classic to v1.2.7. (PR: #4280)
    • Update dependency gradle to v7.3. (PR: #4273)
    • Update actions/checkout commit hash to ec3a7ce. (PR: #4266)
    • Update actions/checkout action to v2.4.0. (PR: #4267)
    • Update plugin se.patrikerdes.use-latest-versions to v0.2.18. (PR: #4261)
    • Update dependency com.google.code.gson:gson to v2.8.9. (PR: #4260)
    • Update dependency fr.inria.gforge.spoon:spoon-core to v10. (PR: #4257)
    • Update dependency commons-cli:commons-cli to v1.5.0. (PR: #4258)
    • Use range for dependency maven-model. (PR: #4252)

    Authors

    | Name | Nb Commit | |---------|-----------| | MartinWitt | 180 | | renovate[bot] | 68 | | Aman Sharma | 15 | | Axel Howind | 8 | | Martin Monperrus | 8 | | Hannes Greule | 4 | | Simon Larsén | 4 | | Henry Chu | 2 | | Nicolas Harrand | 2 | | Thimo Seitz | 1 | | Ceki Gülcü | 1 | | Anton Lyxell | 1 | | intrigus-lgtm | 1 | | César Soto Valero | 1 | | I-Al-Istannen | 1 | | Rijnard van Tonder | 1 | | Viktor | 1 |

    Source code(tar.gz)
    Source code(zip)
  • spoon-core-10.0.0(Oct 27, 2021)

  • spoon-core-9.1.0(Sep 15, 2021)

  • spoon-core-9.0.0(Mar 18, 2021)

  • spoon-core-8.3.0(Oct 26, 2020)

  • spoon-core-8.2.0(Jul 29, 2020)

  • spoon-core-8.1.0(Mar 23, 2020)

  • spoon-core-8.0.0(Nov 6, 2019)

    New features

    • Add new variable refactoring class. (PR: #3162)
    • Add role EMODIFIER for extended modifier. (PR: #3098)
    • CtImportVisitor#visitUnresolvedImport. (PR: #3086)
    • DecompiledResource: Add a SpoonResource that can be used in any launcher. (PR: #3124)
    • SpoonifierVisitor: A visitor that generates the spoon code to recreate a spoon model. (PR: #3105)
    • decompiler: Add support for procyon. (PR: #3123)
    • visualisation
      • Panel added to show Spoon objects' properties. (PR: #3107)
      • Spoon visualiser improvement for accessing JavaDoc. (PR: #3101)
    • spoon-visualisation: Spoon AST visualisation tool. (PR: #3072)

    Bug Fixes

    • CreateVariableAssignment now creates a CtVariableWrite. (PR: #3157)
    • Fixes the toString() call on an array. (PR: #3134)
    • CtCompilationUnitImpl: Fix regression after auto-import refactoring. (PR: #3131)
    • Fix regression when rewriting static field access. (PR: #3115)
    • The type of string concatenation is not null. (PR: #3075)
    • (ParentExiter.java): set position for implicit loop body block. (PR: #3084)
    • Fix regression in field accesses of static fields. (PR: #3139)
    • Improve backward compatibility of toString and add toDebugString. (PR: #3099)
    • Don't check modifiers in CtVariable#getDeclaringType. (PR: #3066)
    • Fix regression in pretty printer (default DJPP is fully qualified). (PR: #3132)
    • Fix incorrect model for empty for loop. (PR: #3108)
    • Fix more regressions after auto-import refactoring. (PR: #3127)
    • ToStringWithImports works even with no position. (PR: #3110)
    • Fix regression in auto-import. (PR: #3125)
    • Indeed call the preprocessors in toString/autoimports. (PR: #3103)
    • CtElementImpl#toString: Fix toString for SniperPrinter. (PR: #3147)
    • DefaultJavaPrettyPrinter: Support for inline else if. (PR: #3088)
    • ImportCleaner: Import must be kept when they are used in Javadoc. (PR: #3160)
    • Iterators: Next() first checks hasNext and throws the correct error. (PR: #3164)
    • PositionBuilder: Fix lambda parameters position. (PR: #3137)
    • SourceFragmentContext: Visit field reference in import as well. (PR: #3161)
    • SourceOptions: Close the output stream in SourceOptions. (PR: #3089)
    • TypeNameScope: Order of processing LexicalScope elements of Type. (PR: #3085)
    • core: Parsing a one-line class produces correct line numbers. (PR: #3069)
    • import: Fix regression after import refactoring. (PR: #3149)
    • pom: Update/add license header in poms. (PR: #3143)

    Documentation

    • Add API documentation to public methods. (PR: #3152)
    • Add archunit to related work in architecture enforcement. (PR: #3146)
    • Improve documentation while preparing the MadridJUG meetup. (PR: #3141)
    • Improve landing page. (PR: #3128)
    • Minor improvement to example page. (PR: #3100)
    • Add example for snippet filtering. (PR: #3062)
    • ROADMAP.md: Roadmap 100% points to issues. (PR: #3119)
    • launcher.md: Improve decompilation doc. (PR: #3130)
    • visualisation: Mention the visualisation tool on the website. (PR: #3102)

    Refactoring

    • Use .equals() when comparing Strings and Boxed types. (PR: #3165)
    • Rename internal method with particularly confusing name. (PR: #3109)
    • Handling of imports in pretty printer. (PR: #2683)
    • Decompiler: Update interface (in preparation for DecompiledResource). (PR: #3122)
    • NoSourcePosition: Applies the null design pattern to compilation units. (PR: #3151)

    Authors

    | Name | Nb Commit | |---------|-----------| | Martin Monperrus | 30 | | Nicolas Harrand | 14 | | arno | 5 | | Haris Adzemovic | 3 | | Pavel Vojtechovsky | 3 | | Egor Bredikhin | 2 | | Rhys Compton | 1 | | Muhammet Ali AKBAY | 1 | | Simon Urli | 1 | | Thomas Durieux | 1 | | HectorSM | 1 | | Lionel Seinturier | 1 |

    Source code(tar.gz)
    Source code(zip)
  • spoon-decompiler-0.1.0(Sep 26, 2019)

  • spoon-core-7.5.0(Jul 28, 2019)

  • spoon-core-7.4.0(May 13, 2019)

    New features

    • Add CtType#toStringWithImports. (PR: #2945)
    • Check if a CtType is an array type. (PR: #2882)
    • CtBFSIterator: Add an iterator that explores a CtElement's children in breadth first order. (PR: #2904)
    • CtElement: Add a method to get all direct children of an element. (PR: #2906)
    • CtCommentImpl: Add _setRawContent to be able to bypass cleanComment. (PR: #2889)

    Bug Fixes

    • Handle special cases in CtAnnotationType. (PR: #2947)
    • Test and fix untested method createNewClass(). (PR: #2943)
    • Give appropriate permissions of files in doc folder. (PR: #2949)
    • Improve getCorrespondingRuntimeObject/convertElementToRuntimeObject to handle shadow fields. (PR: #2899)
    • JarLauncher: Fix #2951, Really delete temporary decompiled source directory. (PR: #2952)
    • ContextBuilder: Catch PositionBuilder exception and log it instead of crashing. (PR: #2907)
    • CtCompilationUnitImpl: ToString() no longer throws a NPE. (PR: #2918)
    • position: Type of CtNewClass is implicit without position. (PR: #2834)
    • TypeFactory: Raise an exception for deprecated createTypeParameterReference wildcard. (PR: #2890)

    Documentation

    • Add example for CtAssert#setExpressiont #2917. (PR: #2917)
    • Fix links in doc page "Examples of Spoon Usages". (PR: #2932)
    • CONTRIBUTING.md mentions our architectural rules. (PR: #2929)
    • Add & update links in the example page. (PR: #2925)
    • Fix jenkins badge. (PR: #2924)
    • Fix typos in slides. (PR: #2948)
    • Add example for CtAssert#setExpression. (PR: #2917)
    • Fix broken documentation. (PR: #2968)
    • Fix remaining Javadoc issues. (PR: #2910)
    • Fix doc in JavadocDescription.java. (PR: #2909)
    • Improve documentation on AST traversal. (PR: #2905)
    • Add slide decks. (PR: #2937)
    • Release.md: Improve documentation about releasing after release of 7.3.0. (PR: #2881)
    • spoon-control-flow: Fix javadoc errors. (PR: #2916)
    • command_line.md: Remove link to decommissioned Gforge. (PR: #2900)

    Refactoring

    • JDTCommentBuilder: Improve error message with position of offending comment. (PR: #2908)

    Tests

    • SourcePositionTest: Don't save temporary files in ./src. (PR: #2969)
    • Rename ArchitectureTest into DecompilerArchitectureTest in spoon-decompiler to avoid confusion. (PR: #2930)
    • CtTypeReference: Add test for methods CtTypeReference#unbox() and box(), fix #1842. (PR: #2919)
    • FieldAccessTest: Nested field access, and example for #2884.

    Other

    • Exclude GUI from coverage. (PR: #2940)
    • Switch to junit5. (PR: #2939)
    • Add Sonar Quality Gate badge. (PR: #2935)
    • Fix javadoc and reporting config and check it in CI. (PR: #2911)
    • Clean parent pom.xml. (PR: #2883)
    • Bump to 7.4.0-snapshot. (PR: #2874)

    Unknown

    • Adopt dual licensing MIT-CECILL-C (#2950). (PR: #2950)
    • Up. (PR: #2941)
    • Update the list of contributors. (PR: #2912)
    • Eclipse` in README. (PR: #2903)

    Authors

    | Name | Nb Commit | |---------|-----------| | Martin Monperrus | 28 | | Nicolas Harrand | 9 | | Alexander Shopov | 2 | | Charm | 1 | | Pavel Vojtechovsky | 1 | | GluckZhang | 1 | | Fabien DUMINY | 1 | | Simon Urli | 1 | | Mickael Istria | 1 |

    Source code(tar.gz)
    Source code(zip)
  • spoon-core-7.3.0(Feb 10, 2019)

    New features

    • Introduce the concept of lexical scope (interface LexicalScope). (PR: #2813)
    • Allow spoon to support duplicate definitions. (PR: #2772)
    • Add module for control-flow analysis. (PR: #2827)

    Bug Fixes

    • Fix NPE for multicatch qualified exceptions. (PR: #2862)
    • Reference of CtImport is fully qualified and has no generics. (PR: #2819)
    • IndexOutOfBoundsException in JDTCommentBuilder. (PR: #2840)
    • Fix static type wildcard imports. (PR: #2865)
    • Refactor code->runtime methods so that CtAnnotation#getValueOfObject does not overflow. (PR: #2866)
    • Fix classpath error with surefire. (PR: #2867)
    • Security issue with jackson-databind. (PR: #2856)
    • CompilationUnit has lineSeparatorPositions even for empty class. (PR: #2824)
    • Fix position of type modifier after comment. (PR: #2825)
    • NPE in JDTCommentBuilder. (PR: #2822)
    • PositionBuilder: Prevents exception for incomplete modifiers' position information. (PR: #2848)
    • position
      • Source position of CtFieldReference. (PR: #2830)
      • Position of reference of import and package declaration. (PR: #2832)
      • Fix source position of new ArrayList<>(). (PR: #2833)
    • doc: Fixes#2790 javadoc site deployment, adapting to new modules organization. (PR: #2826)

    Documentation

    • Fix broken link. (PR: #2871)
    • Fix unrendered link in doc. (PR: #2851)
    • Fix broken snippet. (PR: #2841)

    Refactoring

    • Rename getCurrentNameScope to getCurrentLexicalScope. (PR: #2857)
    • Access to JDK CompilationUnit contents and lineSeparatorPositions. (PR: #2831)
    • Refactor refactoring code :-) in Refactoring#copyType(). (PR: #2820)
    • performance: Optimize incremental launcher. (PR: #2821)

    Tests

    • MavenLauncher: Test that system dependencies are resolved in classpath fix #1682. (PR: #2836)

    Other

    • pom.xml: Updating commons-io and commons-lang3. (PR: #2853)
    • Moves JUnit dependency to parent pom. (PR: #2828)
    • Clean old Travis scripts. (PR: #2829)

    Community

    • Nicolas Harrand becomes integrator. (PR: #2818)

    Authors

    | Name | Nb Commit | |---------|-----------| | Pavel Vojtechovsky | 10 | | Martin Monperrus | 9 | | Egor Bredikhin | 3 | | Nicolas Harrand | 3 | | Thomas Durieux | 1 | | Kai Luo | 1 | | Benjamin DANGLOT | 1 | | Lionel Seinturier | 1 | | Simon Urli | 1 | | Clément Fournier | 1 |

    Source code(tar.gz)
    Source code(zip)
  • spoon-core-7.2.0(Dec 4, 2018)

    New features

    • Add CtImportVisitor. (PR: #2730)
    • Add CtTypeReference#canAccess(CtTypeMember). (PR: #2815)
    • AllTypeMembersFunction has new mode SKIP_PRIVATE. (PR: #2803)
    • Add support for javadoc inline tags. (PR: #2802)
    • Add encoding detection callback. (PR: #2788)
    • EarlyTerminatingScanner can scan content of compilation units. (PR: #2793)
    • Add assertCtElementEquals. (PR: #2767)
    • Add CtAbstractImportVisitor. (PR: #2764)
    • Add CtTypeReference#implicitParent. (PR: #2805)
    • Add CtComment#getRawContent(). (PR: #2746)
    • New CtTypeMemberWildcardImportReference for import package.Type.*. (PR: #2731)
    • CtScannerListener knows role of scanned element. (PR: #2739)
    • Add CtCompilationUnit for future import and sniper improvements. (PR: #2702)
    • Use Apache Common Compressor API to [de]compress serialized models. (PR: #2165)
    • Add metamodel concept CtPackageDeclaration. (PR: #2707)
    • Add support for Fernflower for decompilation. (PR: #2668)
    • Add support for transformation at load-time in the JVM. (PR: #2645)

    Bug Fixes

    • CtQueryImpl#detectTargetClassFromCCE, FilterTest#testInvalidQueryStep: Adapt parsing of ClassCastException message which has changed in oracle jdk 11. (PR: #2787)
    • FieldAccessTest: Adapt FieldAccessTest to oracle jdk 11/jdt changes. (PR: #2789)
    • MainTest: Quickfix for Travis 10min timeout. (PR: #2667)
    • doc: Explain the different kinds of pull-requests. (PR: #2647)
    • documentation: Pattern.md. (PR: #2735)
    • javadoc: Replace deprecated by better javadoc. (PR: #2663)
    • printer: Add space before else of if statement. (PR: #2679)
    • test
      • MainTest#testGenericContract on MS Windows. (PR: #2814)
      • ImportTest. (PR: #2816)
    • Modifiers of enum members. (PR: #2630)
    • One can call getModifiers on ".class" of "Aclass.class". (PR: #2776)
    • Fix incomplete behavior: Javadoc#setContent should parse tags. (PR: #2765)
    • Parsing of java version not starting with "1." in pom.xml. (PR: #2729)
    • CtPackageDeclaration has a valid source position. (PR: #2760)
    • JDT spoon compiler builds imports and then comments. (PR: #2807)
    • Broken link in papers.md. (PR: #2749)
    • CtImport position includes its comment. (PR: #2810)
    • PatternMatcher ignores isImplicit. (PR: #2726)
    • CtExecutableReference cannot use CtTypeParameterReference. (PR: #2725)
    • Upgrade insecure commons-compress to latest version. (PR: #2717)
    • Fix comment of CtAnnotation value. (PR: #2587)
    • MetamodelProperty#containerKindOf knows Collection. (PR: #2705)
    • Invalid error log message in ContextBuilder#getVariableDeclaration. (PR: #2677)
    • CtPackageDeclaration position doesn't include top file comment. (PR: #2811)
    • Sniper printer leaves when no more child tokens. (PR: #2808)
    • ChangeCollector detects changes in CtCompilationUnit too. (PR: #2794)
    • Use Environment encoding when writing files on disk. (PR: #2796)
    • Fix invalid if model with empty statements in then/else branch. (PR: #2733)

    Documentation

    • Improve documentation about release process. (PR: #2650)
    • Remove all hard coded version numbers to simplify release. (PR: #2786)
    • Spoon-decompiler is not spoon-bytecode. (PR: #2784)
    • Getting started for external dependency. (PR: #2752)
    • Fix broken link in doc. (PR: #2743)
    • Fix javadoc in TypeFactory.java. (PR: #2688)
    • Remove link to decommissioned Gforge. (PR: #2792)
    • Updated spelling and formatting of path.md page. (PR: #2696)
    • Add missing javadoc for PatternPrinter. (PR: #2689)
    • Fix @link in javadoc. (PR: #2685)
    • Fix contract sentence. (PR: #2691)
    • Add example in path.md. (PR: #2661)
    • website: Document IncrementalLauncher. (PR: #2651)

    Refactoring

    • Fix sonarqube - use Java array syntax (not C-like). (PR: #2686)
    • Better handling of SourceFragment in CompilationUnit. (PR: #2806)
    • Sort modifiers in ModelStreamerTest.java. (PR: #2755)
    • Excluding decompiler related features from spoon-core. (PR: #2766)
    • GetDocComment uses the same implementation as pretty-printer. (PR: #2775)
    • Improve error message with Spoon testing fluent API. (PR: #2769)
    • In clone code, builder.copy is called first. (PR: #2768)
    • JavaOutputProcessor uses Environment#createPrinter(). (PR: #2759)
    • Better error handling in CtFieldReference#getActualField. (PR: #2754)
    • Replace List<? extends Object> by List<?> in PatternTest. (PR: #2753)
    • Remove redundant cast. (PR: #2700)
    • Remove useless assignment in JDTTreeBuilderHelper.java. (PR: #2690)
    • Simplify negation (fix SonarQube). (PR: #2695)
    • CtTypeAccess#implicit is derived now. (PR: #2804)
    • Change assertion from assertSame to assertEquals. (PR: #2687)
    • Remove redundant parentheses in PatternBuilder. (PR: #2653)
    • Use static import for asserts in tests. (PR: #2655)
    • Remove redundant 'super' call from SpoonClassFileTransformerTest.java. (PR: #2678)
    • SourcePosition#equals should take into account all information. (PR: #2660)
    • Replace by . (PR: #2675)
    • Flip order of comparison - put literal first to lower risk of NPE. (PR: #2674)
    • Add missing braces to tests. (PR: #2673)
    • Remove deprecated annotation (for sonarqube). (PR: #2665)
    • Add final modifier. (PR: #2664)
    • Stream handling in SerializationModelStreamer#load(InputStream). (PR: #2635)
    • Replace length()==0 by isEmpty(). (PR: #2658)

    Performance

    • .travis.yml: Merge travis builds to fall under 5 builds. (PR: #2782)
    • MainTest: Parallelize execution of testElementToPathToElementEquivalency. (PR: #2694)
    • Cache result of CtTypeReference#findClass(). (PR: #2591)

    Tests

    • Remove long logs fof CtGenerationTest which makes CI log unreadable. (PR: #2750)
    • Minimize logs in FilterTest. (PR: #2756)
    • Generic contracts are run only on .testclasses.. (PR: #2716)
    • Use contains instead of indexOf. (PR: #2715)
    • Relax intercession test to prepare #2615. (PR: #2706)
    • Remove redundant cast. (PR: #2704)
    • Relax intercession test to prepare #2615.
    • Constructor with this(xxx) replaced by super(xxx)?. (PR: #2680)
    • In tests also, windows's classpath elements are separated by semi column. (PR: #2692)
    • IncrementalLauncherTest: Attempt to remove flackiness on windows CI. (PR: #2745)

    Other

    • Do not execute checkstyle for all jobs. (PR: #2799)
    • Maven-javadoc-plugin now supports the doclint parameter. (PR: #2800)
    • Check style doesn't check left curly on lambda. (PR: #2795)
    • Update build.sh to use the correct snapshot repo in Jenkins. (PR: #2777)
    • Change jenkins/build.sh to allow passing maven parameters. (PR: #2723)
    • Fix security issue in dependency. (PR: #2697)
    • Prepares checkstyle checking for src/test/java. (PR: #2611)
    • Remove deprecated methods after release. (PR: #2649)
    • Bump info after release of 7.1.0. (PR: #2648)

    Unknown

    • 7.2.0 released on Central.
    • Explicit rule on how integrators are chosen. (PR: #2791)
    • AccessFullyQualifiedFieldTest.java. (PR: #2656)

    Authors

    | Name | Nb Commit | |---------|-----------| | Pavel Vojtechovsky | 38 | | Martin Monperrus | 27 | | Tomasz Zieliński | 23 | | Nicolas Harrand | 12 | | Egor Bredikhin | 3 | | Simon Urli | 3 | | Mehdi Kaytoue | 1 | | lodart | 1 | | raymogg | 1 |

    Source code(tar.gz)
    Source code(zip)
  • spoon-core-7.1.0(Oct 10, 2018)

  • spoon-core-7.0.0(Jul 4, 2018)

    Changelog

    All potentially breaking changes are marked with a ":warning:"

    Major new features

    • Java 10 is now fully supported in Spoon (PR: #2054)
    • A new mechanism for matching code called "Pattern", see http://spoon.gforge.inria.fr/pattern.html. Kudos to @pvojtechovsky for this amazing job! (PR: #1686)

    New features

    • :warning: Explicitly fail when an element is added twice to two different parents. (PR: #2009)
    • :warning: Enable comments by default. (PR: #2065)
    • One can get annotation values directly. (PR: #2036)
    • Add the ability to follow the progress of the creation of the Spoon model. (PR: #2043)
    • Add support for incremental build. (PR: #1905)
    • Handles range version in MavenLauncher. (PR: #2057)
    • Introduce the concept of "Pattern". (PR: #1686)
    • Add CtAnnotation#getAllValues to reason about all annotation values. (PR: #2042)
    • Gzip model serialization. (PR: #2103)
    • EqualsVisitor can report which attribute is not equal. (PR: #1998)
    • Add CtElement#descendantIterator and CtElement#asIterable. (PR: #1986)
    • Add CtIterator for dfs-based iteration of CtElement's descendants. (PR: #1980)
    • Add SourcePosition#isValidPosition(), to detect invalid position without null or -1 checks. (PR: #1964)
    • Add #getSourceDetails to debug source code positions. (PR: #1950)
    • API methods to know when the initial model is built. (PR: #2138)
    • Add support to Java 10. (PR: #2054)
    • Add CtAnnotation#getWrappedValue to provide a regular interface for annotation values. (PR: #1935)
    • experimental: Add ChangeCollector to listen on changes and remembers them. (PR: #1941)
    • position: Add the position of the modifier in the ast. (PR: #1959)

    Bug Fixes

    • executable: Fix npe in getExecutableDeclaration when declaring type is null. (PR: #2021)
    • mavenlauncher: Add support for Maven dependency management. (PR: #2024)
    • metamodel: Mark unsettable setters of name, modifier and label. (PR: #2048)
    • module: Spoon is able to build Java 9 code with modules in full classpath. (PR: #2070)
    • pattern: Improve handling of CtTypeReference Pattern parameters. (PR: #2078)
    • position
      • Fix enum constructor call. (PR: #2146)
      • Fix position of nested type arguments like List<List<?>>. (PR: #2142)
      • Fix position of CtForEach. (PR: #2152)
      • Invalid end column. (PR: #2159)
      • Position of expressions ending with wildcard. (PR: #2151)
      • Position of CtCase includes it's statements. (PR: #2150)
      • Fix position of String arg[] and lambda parameter. (PR: #2149)
      • CtCatch has no modifiers, they are in CatchVariable. (PR: #2156)
      • Fix source position of empty method body. (PR: #2145)
    • reference: Fix npe in getTypeReference when the reference is null. (PR: #2020)
    • Bug in AccessibleVariablesFinder when executed after PartialEvaluation. (PR: #2123)
    • Fix line separators in test. (PR: #2111)
    • The imports are properly computed after processing. (PR: #2083)
    • Finish the change about the default classpath mode. (PR: #2074)
    • Enum#valueOf is now well shadowed. (PR: #2096)
    • Bug when getting CU from a parsed snippet. (PR: #2086)
    • Fix source position of CtCatch and CtCatchVariable. (PR: #2128)
    • DJPP is more tolerant to inconsistent model. (PR: #1903)
    • Init RoleHandler lazily to pass when RoleHandler is generated. (PR: #2068)
    • Fix missing license header. (PR: #2075)
    • Fix regression in Template. (PR: #2069)
    • Proper support for "Object[]::new" constructs. (PR: #1945)
    • NPE when calling getQualifiedName on some CtFieldReference. (PR: #2135)
    • Fix position of (String arg[]). (PR: #2015)
    • Support creation of partial shadow classes. (PR: #2040)
    • VarArgs parameters always have a CtArrayTypeReference type. (PR: #2131)
    • Prevent NPE due to getDeclaringType. (PR: #2039)
    • Fix regression due to #2009. (PR: #2035)
    • CtAnnotation#getValue returns the default value if one exists. (PR: #2034)
    • Detection of lambda expression method. (PR: #2023)
    • Expression type cast source positions. (PR: #2113)
    • Fix low-level JDT error due to some annotations (in particular @Nullable). (PR: #1975)
    • Npe in getEnclosingType when getTypeDeclaration is null. (PR: #2033)
    • Fix when interface method overrides object method. (PR: #2025)
    • Fix CtTypeParameter creation in shadow mode. (PR: #2031)
    • Consistent contract for getActualClass: never returns null. (PR: #2027)
    • Fix SonarQube warning by addiing transient modifiers in SpoonObjectFieldsTable. (PR: #2121)
    • EOL were not fully taken into account in Spoon. (PR: #2122)
    • Clarify Environment#checksAreSkipped and associated setters. (PR: #2011)
    • Set parent of auto-created CtExecutableReference. (PR: #2007)
    • Manage generics from interfaces in shadow mode. (PR: #1914)
    • Fix visibility of enum values. (PR: #1999)
    • Fix actualTypeArguments of array type reference. (PR: #1997)
    • SetModifiers(Collections.emptySet()) resets modifiers now. (PR: #1992)
    • Don't fail on ClassNotFoundException in CtQueryImpl. (PR: #1996)
    • NPE when CtQueryImpl#detectTargetClassFromCCE return null. (PR: #1995)
    • Handle comments at the bottom of a file. (PR: #1976)
    • Catch NoClassDefFoundError when we try to import a class absent from the classpath. (PR: #1974)
    • Fix LineFilter for loops with no body. (PR: #1973)
    • Fix the position of catch variables. (PR: #1969)
    • Set the constructor implicitness directly in JDTTreeBuilder. (PR: #1958)
    • Fix the source start and source end of package. (PR: #1957)
    • Fix failing build because of the usage of random in CompilationUnit comparison. (PR: #1954)
    • Provide default sorting of compilation units. (PR: #1938)
    • Remove useless CtPackageImpl#getPosition. (PR: #1952)
    • Fix position of new new SomeInterface() {...}. (PR: #1949)
    • Fix positions of TypeParameter, annonymous classes, and methods without modifiers. (PR: #1948)
    • Add a log warning in verifySourceClasspath. (PR: #1937)
    • Fix class class-level comments' position. (PR: #1931)
    • Always create new type reference for primitive type. (PR: #1940)
    • Comments after class name and before type members are associated to correct node. (PR: #1939)
    • Typo in javadoc of CtModel. (PR: #1942)
    • CtCatchVariable#getType() in noclasspath mode may return null. (PR: #1932)
    • Fix bugs and resource leaks found with error-prone. (PR: #1924)
    • Derived properties return unmodifiable collections. (PR: #1923)
    • CompilationTest#testFilterResourcesDir file separators on Windows. (PR: #1925)
    • All unsettable properties in the metamodel are derived too. (PR: #1904)
    • Comment /*/ parsing in JDTCommentBuilder. (PR: #2032)

    Refactoring

    • :warning: comment: Creating an inline comment with newline separators throws an exception. (PR: #2080)
    • :warning: Move experimental.modelobs to support.modelobs. (PR: #2140)
    • :warning: Remove deprecated elements from last release of Spoon. (PR: #2098)
    • :warning: Remove usage of getActualClass() from CtTypeReferenceImpl. (PR: #2037)
    • :warning: Set noclasspath to true as default. (PR: #1936)
    • :warning: Launcher#setArgs cannot be called twice. (PR: #2141)
    • position: CompoundSourcePosition extends SourcePosition. (PR: #2115)
    • Avoid duplicated calls in ImportScannerImpl. (PR: #2134)
    • Refactor imports of CtRole. (PR: #2132)
    • Deprecate methods computeImports in DJPP. (PR: #2124)
    • Fix checkstyle in tests. (PR: #2127)
    • Add transient modifiers in StandardEnvironment.java. (PR: #2059)
    • Remove old broken untested mechanism "buildOnlyOutdatedFiles". (PR: #1913)
    • Slightly change the import API. (PR: #2110)
    • Report missing parameter value in exception. (PR: #2079)
    • Fix bad resource usage with try-with-resources. (PR: #2045)
    • Move metamodel from src/test to src/main. (PR: #2016)
    • GetTypeDeclaration cannot crash in noclasspath mode. (PR: #2028)
    • Introduce ModelList and ModelSet, collections specific to Spoon that handle parents and change events. (PR: #1917)
    • Get*Field now use shadow types. (PR: #2008)
    • EqualsChecker#setNotEqual can be used to debug non-equality. (PR: #1993)
    • PartialSourcePosition only supports getCompilationUnit for fail-fast behavior. (PR: #1963)
    • Encapsulate try-with-resources for printing lists in DefaultJavaPrettyPrinter. (PR: #1956)
    • Never return null from CtElement#getPosition() but NoSourcePosition. (PR: #1951)
    • EnumValues constructor call should be marked as implicit. (PR: #2090)
    • Remove old, unused, untested class Timer. (PR: #2017)
    • Allow to use @Experimental on a single method. (PR: #2099)

    Tests

    • Unify MetamodelTest and MetaModelTest. (PR: #2012)
    • Improve MainTest. (PR: #2144)
    • Fix CtGenerationTest#testGenerateRoleHandler egg/chicken problem. (PR: #2087)
    • Better tests for derived and unsettable properties. (PR: #2050)
    • Fix MavenLauncherTest. (PR: #2049)
    • Compare the computed imports against human imports. (PR: #1365)
    • Add test to check that all setters trigger a change event. (PR: #2010)
    • Fix MavenLauncherTest to find paths using File separator. (PR: #2129)
    • Ignore OS specific EOL. (PR: #2006)
    • SpoonMetaModel can be built without spoon sources, only using shadow classes. (PR: #1907)
    • Remove testIncrementalModel. (PR: #2004)
    • Add test for ExpressionTemplate. (PR: #2002)
    • Add new test for shadow enums. (PR: #1926)
    • Add a test to check that in NO_OUTPUT mode, nothing is created. (PR: #1915)
    • Remove unused imports from tests. (PR: #2104)
    • Make checkstyle happy. (PR: #2116)
    • refactor
      • Move ClassWithSwitchExample.java to testclasses. (PR: #2158)
      • Move Castings.java to testclasses. (PR: #2155)
      • Move ArrayClass.java to testclasses. (PR: #2154)
      • Move ExtendedStringLiteralTestClass to testclasses. (PR: #2153)
      • Move Ifoo.java to testclasses. (PR: #2157)
    • Typo: invokation -> invocation. (PR: #2114)

    Documentation

    • Give our definition of public API. (PR: #2092)
    • Add Youtube Links of Spoon presentations on Readme. (PR: #2082)
    • Move package.html to package-info.java. (PR: #2005)
    • Add link to Google Scholar. (PR: #1987)
    • Update documentation after release 6.2. (PR: #1899)
    • Update README.md to state Java 10 support. (PR: #2091)

    Other

    • Remove bold emphasis of component in changelog. (PR: #2046)
    • Run Spoon tests also on JDK10. (PR: #2053)
    • Coverage computation now uses JDK9. (PR: #2071)
    • Upgrade JDT version to 3.13.102. (PR: #2052)
    • Upgrade copyright to 2018. (PR: #2058)
    • Check license header presence in CI. (PR: #2066)
    • Add SonarQube dashboard link. (PR: #2044)
    • Change README to encourage usage/contribution. (PR: #2030)
    • Fix SCM info in pom.xml. (PR: #1966)
    • Fix revapi comparison against Snapshot. (PR: #1920)
    • Fix typo in snapshot repository URL. (PR: #1910)
    • Deploy snapshots on maven.inria.fr instead of gforge.inria.fr for better availability. (PR: #1900)
    • Prepare for next development iteration.

    Authors

    | Name | Nb Commit | |---------|-----------| | Simon Urli | 48 | | Pavel Vojtechovsky | 48 | | Martin Monperrus | 20 | | Thomas Durieux | 20 | | Tomasz Zielinski | 9 | | Egor18 | 5 | | Miguel Sozinho Ramalho | 2 | | Ashutosh Kumar Verma | 2 | | Lionel Seinturier | 2 | | Filip Krakowski | 1 | | Mehdi Kaytoue | 1 | | Roman Leventov | 1 | | André Cruz | 1 |

    Source code(tar.gz)
    Source code(zip)
    spoon-core-7.0.0-jar-with-dependencies.jar(14.04 MB)
    spoon-core-7.0.0-javadoc.jar(4.60 MB)
    spoon-core-7.0.0-sources.jar(976.06 KB)
    spoon-core-7.0.0.jar(1.49 MB)
  • spoon-core-6.2.0(Mar 8, 2018)

    Thanks for the new contributors on this release 👍

    New features

    • Add support to change the destination file on disk for modules, packages and types. (PR: #1610)
    • Add CtScanner#scan(Map) for a better EarlyTerminatingScanner. (PR: #1805)
    • Add support for paths for all elements from model root (CtElement#getPath). (PR: #1874)
    • One could add a type member that already exists (equals but not same) and modify it afterwards. (PR: #1864)
    • Add method CtMethod#getTopDefinitions. (PR: #1844)
    • Add Refactoring#copyType and #copyMethod for advanced cloning. (PR: #1884)
    • All RoleHandlers supports set/add/remove. (PR: #1793)
    • Add methods getRoleHandlers(Class), forEachRoleHandler, getRoleHandlerWrtParent in RoleHandlerHelper. (PR: #1794)
    • SpoonModelTree GUI can be created with a custom root element. (PR: #1799)
    • Add support for clone process customization with CloneHelper#addClone. (PR: #1802)
    • Spoon Filter implements java.util.function.Predicate. (PR: #1798)

    Bug Fixes

    • GetDocComment returns the complete Javadoc comment, incl. tags. (PR: #1822)
    • Add RoleHandler setter for SUPER_TYPE and INTERFACE. (PR: #1890)
    • CtCatchVariable#multiType role TYPE changed to MULTI_TYPE. (PR: #1877)
    • Fully comply with the contract of CtScannerTest#testScannerCallsAllProperties. (PR: #1870)
    • Change how DJPP prints "return" so that it's checkstyle-compliant. (PR: #1871)
    • Unsettable properties are now really unsettable, and there is a test for this. (PR: #1893)
    • Fix equality for assignments. (PR: #1845)
    • GetDocComment() returns asterisk (*) and spaces before comment. (PR: #1841)
    • Small bugs in MethodTypingContext and CtTypeReference. (PR: #1838)
    • ClassTypingContext resolveTypeParameter can gracefully handle outer parameters. (PR: #1837)
    • Fix StringIndexOutOfBoundsException in CtJavadoc#getShortDescription. (PR: #1827)
    • TypeFactory#get(qualifiedName) for class names containing $. (PR: #1891)
    • Stackoverflow on AbstractTypingContext. (PR: #1817)
    • NPE when using MavenLauncher on module containing dependency with variable. (PR: #1810)
    • Undo #1798 for backward compatibility. (PR: #1811)
    • Filter extends Predicate is now working with projects in JDK7. (PR: #1808)
    • Shadow classes should be interpreted according to their kind (enum, interface, etc). (PR: #1806)
    • Easier specification of template parameters (without annotations). (PR: #1801)
    • DefaultJavaPrettyPrinter prints an ERROR comment instead of raising an exception when a field is missing in the model. (PR: #1797)
    • Various fixes in VisitorPartialEvaluator. (PR: #1800)
    • DefaultJavaPrettyPrinter exposes the tokenWriter for subclasses. (PR: #1796)
    • ParentFunction doesn't fail on null parent. (PR: #1795)
    • Add generic typing to TypeFactory constants. (PR: #1792)
    • serialization: SourcePosition#getFile() after deserialization. (PR: #1847)
    • Fix order of type members. (PR: #1787)

    Documentation

    • Add missing javadoc. (PR: #1843)
    • Add missing Javadoc in ModelsUtils. (PR: #1860)
    • Missing documentation in public methods used for pretty-printing. (PR: #1854)
    • Another set of Javadoc comments for public methods. (PR: #1856)
    • Add API documentation to interface JavaReflectionVisitor. (PR: #1850)
    • Add doc for public method in RtMethod. (PR: #1858)
    • Fix Javadoc (incorrect starting tag). (PR: #1839)
    • Fix missing javadoc. (PR: #1840)
    • Improve Javadoc of #getAllMethods. (PR: #1836)
    • Improves the documentation of getOverridingExecutable. (PR: #1828)
    • Bump Spoon number in doc. (PR: #1790)

    Refactoring

    • Improve Meta-Metamodel classes in src/test. (PR: #1894)
    • Refactor cloning code to increase extendability. (PR: #1878)
    • Remove CtParameterReferenceImpl#declaringExecutable. (PR: #1875)
    • Push down the equality checking code in EqualsVisitor. (PR: #1853)
    • Hide some methods that are clearly meant to be package visible. (PR: #1855)
    • Internal utility type in JDTTreeBuilder should be package-visible. (PR: #1848)
    • Package-visible class CommentHelper should have package-visible methods. (PR: #1849)
    • Remove wrong comments and unused imports. (PR: #1803)
    • prettyprinter: Restore DJPP#writeHeaders that clients can override. (PR: #1866)

    Tests

    • architecture: All public API methods should be documented with Javadoc. (PR: #1867)
    • Fix CI failure due to interaction between #1864 and #1787. (PR: #1868)
    • Move metamodel related method to class SpoonMetaModel for better discoverability. (PR: #1851)
    • Add method ModelUtils#getOptimizedString for handling EOL, TAB, etc in assertions. (PR: #1804)

    Chores

    • Enable unchecked compiler warnings. (PR: #1886)
    • Enables incremental compilation. (PR: #1885)
    • Fix javadoc linter config in pom.xml. (PR: #1881)
    • Add Eclipse's .checkstyle to .gitignore. (PR: #1882)
    • Add a script to update pom.xml for running pit-descartes. (PR: #1820)
    • Add CI script to check whether Spoon compiles with Maven 3.3.9. (PR: #1815)
    • revapi: Fix revapi commenting bot. (PR: #1863)
    • Prepare for next development iteration.

    Authors

    | Name | Nb Commit | |---------|-----------| | Martin Monperrus | 30 | | Pavel Vojtechovsky | 21 | | Simon Urli | 9 | | Egor18 | 4 | | Nicolas Harrand | 2 | | Thomas Durieux | 1 | | Shantanu | 1 |

    Source code(tar.gz)
    Source code(zip)
    spoon-core-6.2.0-jar-with-dependencies.jar(10.62 MB)
    spoon-core-6.2.0-javadoc.jar(4.15 MB)
    spoon-core-6.2.0-sources.jar(851.03 KB)
    spoon-core-6.2.0.jar(1.29 MB)
  • spoon-core-6.1.0(Dec 20, 2017)

    Christmas release! 🎄 🎅 ✨

    The main new feature of this release is the integration of Java 9 module in Spoon model, but it also contains some other new features and bug fixes. Thanks for the contributors, merry christmas and happy new year for all of you :)

    New features

    • Add Factory#createQuery(Iterable). (PR: #1777)
    • Add a method to get the unit type of the compilation unit. (PR: #1776)
    • Add support for Java9 constructs in the Spoon metamodel (CtModule and related concepts). (PR: #1730)
    • Support partial evaluation of new Object[]{...}.length -> Literal. (PR: #1750)
    • Add an explicit construct for imports in the metamodel (CtImport). (PR: #1707)
    • Add method hasAnnotation. (PR: #1737)
    • Add inheritance between roles (CtRole#getSuperRole(), CtRole#getSubRole()). (PR: #1725)
    • CtModel implements CtQueryable. (PR: #1739)
    • Processor properties can be passed as string. (PR: #1734)

    Bug Fixes

    • CompilationUnits are created on demand. (PR: #1782)
    • Start prefix space in ElementPrinterHelper. (PR: #1768)
    • Fix a NPE in CtTypeImpl#isSameParameter in noclasspath. (PR: #1767)
    • CtQueryImpl handles well preallocated exceptions done by JVM optimization. (PR: #1759)
    • Fix bug in partial evaluator. (PR: #1751)
    • Fix dirty exception in checking code at the end of model building. (PR: #1749)
    • annotation: Bug when using an annotation targeting declaration and types. (PR: #1774)
    • test: Improve CtGenerationTest and CtScannerTest. (PR: #1736)

    Documentation

    • Add explanation in Javadoc of CtTypeReference#getActualClass. (PR: #1761)
    • Bump version number after release 6.0.0. (PR: #1732)

    Refactoring

    • OutputType is available in Environment. (PR: #1784)
    • CompilationUnit returns an unmodifiable collection. (PR: #1781)
    • Manage sourceOutputDirectory in Environment. (PR: #1770)
    • SetSourceClasspath throws an exception in case a .class is given. (PR: #1766)
    • Add a new way to build a query in QueryFactory. (PR: #1740)

    Tests

    • Check inheritance behaviour when using noclasspath with a sourceclasspath. (PR: #1760)
    • Refactor test to be independent from JDK version. (PR: #1764)
    • Metamodel's MMField valueTypes are not implicit. (PR: #1756)
    • Add test for substitution of return expression.S() with expressions. (PR: #1755)
    • Prepare upcoming behavioral change in template matcher. (PR: #1748)
    • Add test for getAnnotation().value() on shadow classes. (PR: #1738)

    Other

    • Skip checkstyle in Travis install phase. (PR: #1746)

    Unknown

    • Prepare for next development iteration.

    Authors

    | Name | Nb Commit | |---------|-----------| | Simon Urli | 20 | | Pavel Vojtechovsky | 9 | | Martin Monperrus | 3 |

    Source code(tar.gz)
    Source code(zip)
    spoon-core-6.1.0-jar-with-dependencies.jar(10.61 MB)
    spoon-core-6.1.0-javadoc.jar(4.08 MB)
    spoon-core-6.1.0-sources.jar(835.87 KB)
    spoon-core-6.1.0.jar(1.28 MB)
  • spoon-core-6.0.0(Nov 17, 2017)

    New major Spoon 6.0.0 release 🎉

    ⚠️ This release breaks some existing API. Here follows the changelog with indication of what is breaking. Thanks to all contributors on this amazing release 👍

    New features

    • Roles
      • Add method CtElement#getRoleInParent(). (PR: #1669)
      • CtScanner supports scanning based on roles. (PR: #1632)
      • Add CtRole to CtReference. (PR: #1586)
      • One can get and set children of elements based on roles. (PR: #1582)
      • Spoon GUI shows roles of nodes. (PR: #1715)
    • Introduction of TokenWriter to support custom formatting of pretty-printed code. (PR: #1494)
    • Spoon runs on Java9 JVM with JDK9. (PR: #1585)
    • Add TypeFactory LIST, SET, MAP, ... constant type references. (PR: #1660)
    • Add new create method in Factory. (PR: #1659)
    • Add CtPackage#getQualifiedName. (PR: #1652)
    • The cloning behavior can be subclassed. (PR: #1580)
    • Add a static method to getting started with one single line of code. (PR: #1559)
    • Add support for analyzing whether a type reference is generic or not (method isGeneric). (PR: #1562)
    • Add support for implicit / explicit modifiers (CtExtendedModifier). (PR: #1649)
    • Add simple support for enter/exit in DJPP as in CtScanner. (PR: #1538)
    • Create a launcher to analyze maven projects. (PR: #1533)
    • Add utility methods in CtModifiable. (PR: #1726)

    Bug Fixes

    • :warning: [BREAKING] Fix ClassTypingContext#isSameSignature for generic methods. (PR: #1639)
    • :warning: [BREAKING] SetVisibility should only be used with private, public or protected. (PR: #1705)
    • :warning: [MAYBE BREAKING] Less hashcode collisions for CtReference. (PR: #1717)
    • :warning: [BREAKING] Move deprecated classes to spoon.legacy. (PR: #1518)
    • :warning: [BREAKING] Template: Replacing of field access by refining behaviour of String parameter. (PR: #1476)
    • :warning: [BREAKING] Remove the useless factory in Environment. (PR: #1673)
    • :warning: Fix bug with repeatable annotations. (PR: #1724)
    • Typo in RoleHandlersGenerator. (PR: #1709)
    • Method with varargs should never be transient. (PR: #1701)
    • JDTImportBuilder should not import all public methods from interfaces. (PR: #1620)
    • Explicit "final" modifier are possible in catch variables and should be kept when pretty-printing. (PR: #1690)
    • CtVariableAccess#getVariable() sets the type of "super". (PR: #1684)
    • MavenLauncher warns when a provided dependency is not loaded. (PR: #1681)
    • Add position for implicit blocks. (PR: #1678)
    • Bug related with cloning newClass invocation with anonymous class. (PR: #1667)
    • Improve contract+test of CtScanner and it relation to roles. (PR: #1642)
    • In CtCatchVariable set/getType is derived from multiType. (PR: #1668)
    • AbstractTypingContext should set consistent parents. (PR: #1664)
    • [BREAKING] CtTypeParameterReference#getBoundingType() consistently returns null when Object is the bound. (PR: #1661)
    • Remove useless code on CtElement#setParent. (PR: #1662)
    • Change default log level. (PR: #1646)
    • Fix StackOverflow in MethodTypingContext on <T, U extends T>. (PR: #1640)
    • Fix NPE in MavenLauncher when there is no build section. (PR: #1720)
    • CtTypeInformationTest now use patch JDK version for the expected test number. (PR: #1721)
    • Optional maven dependencies should not be passed to SpoonMavenLauncher. (PR: #1619)
    • Fix bug related to generics in CtTypeReference in noclasspath. (PR: #1609)
    • Auto-imports works for package-info. (PR: #1611)
    • CtNewClassImpl#setAnonymousClass has CtRole.NESTED_TYPE not CtRole.EXECUTABLE. (PR: #1605)
    • Pretty printer adds no space before comma in new array expression. (PR: #1602)
    • Spoon model is a tree not a lattice. (PR: #1592)
    • ImportBuilder checks visibility when importing starred imports. (PR: #1588)
    • The query engine also works on JVMs where lambdas are not in stack trace elements. (PR: #1579)
    • Cleaning of method signature computation. (PR: #1561)
    • DJPP sends "class" as keyword and wildcard "?" as separator token. (PR: #1568)
    • PotentialVariableDeclarationFunction should consider static scopes. (PR: #1536)
    • Fix issue with recursively defined annotation in shadow class. (PR: #1711)
    • Remove an hardcoded encoding value in CompilationUnitWrapper. (PR: #1544)
    • SetSimpleName of CtRootPackage if now fail-silent to simplify client code. (PR: #1523)
    • File resource leak in pretty printing. (PR: #1521)
    • Bump commons-io version. (PR: #1530)
    • prettyprinter
      • Invalid use of type access generics. (PR: #1454)
      • Bug related with "--lines" argument. (PR: #1558)
    • role
      • CtPackage.types is CtRole.CONTAINED_TYPE. (PR: #1600)
      • CtTypeAccess getTypeAccess uses CtRole.ACCESSED_TYPE. (PR: #1637)
      • CtTypeAccess.getAccessedType has CtRole.TYPE. (PR: #1630)
    • template
      • Relax template parameter constraint. (PR: #1535)

    Refactoring

    • :warning: [BREAKING] Get rid of snapshotLength and hasNewContent. (PR: #1576)
    • :warning: [BREAKING] CompilationUnit#create renamed to getOrCreate. (PR: #1645)
    • :warning: [BREAKING] CtModifiable add/removeModifier stick to convention on returned object. (PR: #1706)
    • :warning: [BREAKING] Remove ant related code and dependency. (PR: #1540)
    • :warning: [BREAKING] Move ElementPrinterHelper to the appropriate package. (PR: #1551)
    • :warning: [BREAKING] GetBoundingType returns Object by default. (PR: #1672)
    • All non-leaf interfaces of the metamodel should be visited by CtInheritanceScanner. (PR: #1703)
    • Remove replace methods which pollute code completion and do not provide additional behavior. (PR: #1704)
    • Move package spoon.generating.* from src/main to src/test. (PR: #1647)
    • Introduce CommentHelper, LiteralHelper and OperatorHelper. (PR: #1525)
    • Compute CtRole#forName automatically based on enum value names. (PR: #1702)
    • PrinterHelper prints tabs automatically. (PR: #1566)
    • DefaultJavaPrettyPrinter better uses OperatorHelper. (PR: #1553)
    • Delete old/useless config files. (PR: #1548)
    • Launcher#buildModel returns a CtModel. (PR: #1549)
    • Add constant for code compliance level. (PR: #1543)
    • Test code assumes java 8 compliance so as to allow lambdas in spoon code. (PR: #1539)
    • Use LiteralHelper in DefaultJavaPrettyPrinter. (PR: #1529)
    • modifier: CreateCtModifierHandler that handles the modifiers. (PR: #1677)
    • role
      • New CtRoles ARGUMENT_TYPE and TYPE_ARGUMENT. (PR: #1622)
      • Add CtRole.TYPE_MEMBER. (PR: #1625)
      • CtThrows uses EXPRESSION now. Rolls back usage of THROWN. (PR: #1624)
      • CtCodeSnippet has CtRole.SNIPPET. (PR: #1623)
      • Add and refactor CtRole annotations of model. (PR: #1606)

    Performance

    • MainTest#checkModelIsTree needs less memory. (PR: #1596)
    • Avoid slow CCE. Check acceptable type when possible. (PR: #1541)

    Tests

    • Add a test about the behavior of PropertySetter. (PR: #1612)
    • SpoonMetaModel checks whether provided model is complete. (PR: #1714)
    • Add an architectural test to catch package creation during code review. (PR: #1696)
    • Fix typo in MMType. (PR: #1708)
    • Check that CtComment works with \r separator. (PR: #1679)
    • Add explicit Spoon metamodel to facilitate consistency checks and code generation. (PR: #1627)
    • Declares missing packages for new architecture enforcing test. (PR: #1710)
    • Adds a test on roles for CtReference fields. (PR: #1601)
    • Don't use Junit3 classes in test suite, only use Junit4 org.junit.*. (PR: #1577)
    • Add a test to verify an important contract of setParent. (PR: #1591)
    • Add a new test to check if static imports are placed after type imports. (PR: #1572)
    • Enforce test naming discipline. (PR: #1554)
    • The ant dependency was removed so the test should be changed. (PR: #1547)
    • Fix test assertion with JDK8 1.8.0_15 on Travis. (PR: #1718)
    • Refactor: Faster test execution. (PR: #1552)

    Documentation

    • Improve getting started. (PR: #1676)
    • Clarify CtType#getAllMethods documentation. (PR: #1644)
    • End-of-life for mailing list spoon-discuss. (PR: #1643)
    • Clarifies contracts of @DerivedProperty. (PR: #1613)
    • Move around some documentation items for easier finding. (PR: #1564)
    • Add recent papers that use Spoon. (PR: #1556)
    • Update version number after the new release 5.9.0. (PR: #1517)

    Other

    • Change Revapi template to have class name shortening by a bunch of Freemarker macros. (PR: #1697)
    • Revapi reports are smaller on screen to save space on the corresponding Github page. (PR: #1692)
    • Revapi now deletes its own comments before commenting. (PR: #1683)
    • Improve Travis configuration for parallel jobs. (PR: #1655)
    • Bump revapi version. (PR: #1665)
    • Upgrade to org.eclipse.tycho:org.eclipse.jdt.core:3.13.0. (PR: #1492)
    • Now depends on Java8/JDK8. (PR: #1528)
    • maven: Remove maven reporting plugins that we never use. (PR: #1560)
    • Prepare for next development iteration.

    Authors

    | Name | Nb Commit | |---------|-----------| | Simon Urli | 49 | | Pavel Vojtechovsky | 44 | | Martin Monperrus | 22 | | Thomas Durieux | 4 | | tiagodrcarvalho | 1 | | Lukas Krejci | 1 |

    Source code(tar.gz)
    Source code(zip)
    spoon-core-6.0.0-jar-with-dependencies.jar(8.47 MB)
    spoon-core-6.0.0-javadoc.jar(3.89 MB)
    spoon-core-6.0.0-sources.jar(803.20 KB)
    spoon-core-6.0.0.jar(1.21 MB)
  • spoon-core-5.9.0(Sep 6, 2017)

    Spoon release on this back-to-work times!

    Thanks to all contributors 👍

    Changelog

    New features

    • Introduce NamedElementFilter (because NameFilter is ill-designed). (PR: #1500)
    • In auto-import mode, imports from original source code are reused. (PR: #1499)
    • Add automatically generated comments in template-produced code. (PR: #1465)
    • Add support for short pretty-printing of annotation value when appropriate. (PR: #1485)
    • prettyprinter: DefaultJavaPrettyPrinter#setLineSeparator(String). (PR: #1490)

    Bug Fixes

    • Fix a stack overflow when calling getDeclaration in noclasspath. (PR: #1515)
    • Fix issue related to processing generic types. (PR: #1504)
    • Fix NPE in noclasspath mode. (PR: #1502)
    • Compute positions of elements. (PR: #1493)
    • Support substitution of references to target type in inner type. (PR: #1477)
    • setInputClassloader: Bug when using a URLClassLoader with standard URLs. (PR: #1507)
    • comment: Splitting of comment by EOL. (PR: #1455)
    • template: Object is not an template parameter implicitly. (PR: #1461)
    • reference: Fix getReference of an unknown class that has the same name as an existing class. (PR: #1480)

    Documentation

    • Update usage of maven plugin to latest version 2.5. (PR: #1508)
    • Remove information about deleted stable branch. (PR: #1474)
    • release: Update release information in documentation. (PR: #1471)

    Refactoring

    • Encoding is correctly handled in Environment. (PR: #1498)
    • Deprecate PrettyPrinter#getPackageDeclaration. (PR: #1489)
    • printer: Remove deprecated method from PrinterHelper. (PR: #1472)

    Performance

    • Compile comments only if needed. (PR: #1487)
    • Collect list of source files only once. (PR: #1486)
    • No call to expensive toString in DoNotFurtherTemplateThisElement. (PR: #1478)

    Tests

    • Fix CtRenameLocalVariableRefactoringTest#testRenameAllLocalVariablesOfRenameTestSubject. (PR: #1491)

    Community

    • @pvojtechovsky gets merge honor and responsibility. (PR: #1468)

    Other

    • Fix pom.xml to allow deploying snapshots. (PR: #1495)
    • Prepare for next development iteration.

    Authors

    | Name | Nb Commit | |---------|-----------| | Pavel Vojtechovsky | 11 | | Simon Urli | 10 | | Wreulicke | 1 | | Marcel Steinbeck | 1 | | Lionel Seinturier | 1 | | Thomas Durieux | 1 | | Jan Galinski | 1 | | Martin Monperrus | 1 |

    Source code(tar.gz)
    Source code(zip)
    spoon-core-5.9.0-jar-with-dependencies.jar(7.16 MB)
    spoon-core-5.9.0-javadoc.jar(3.81 MB)
    spoon-core-5.9.0-sources.jar(788.71 KB)
    spoon-core-5.9.0.jar(1.09 MB)
  • spoon-core-5.8.0(Jul 11, 2017)

    This summer release mainly fixes a lot of bugs, in particular in the resolution of TypeParameters which were introduced in previous version. New experimental features are also introduced in this release.

    Thanks all our amazing contributors 👍

    New features

    • experimental: Add experimental support for model change listeners. (PR: https://github.com/INRIA/spoon/pull/1417)
    • import: Sort imports alphabetically. (PR: https://github.com/INRIA/spoon/pull/1434)
    • metamodel
      • CtTypeMember extends CtNamedElement. (PR: https://github.com/INRIA/spoon/pull/1452)
      • Add a method to insert a statement at a specific position. (PR: https://github.com/INRIA/spoon/pull/1423)
      • Annotes getter and setter with a CtRole. (PR: https://github.com/INRIA/spoon/pull/1377)
      • Add first metamodel support. (PR: https://github.com/INRIA/spoon/pull/1378)
    • role: Add field annotation with a role. (PR: https://github.com/INRIA/spoon/pull/1368)
    • template: SubstitutionVisitor can replace substrings in NamedElements and References. (PR: https://github.com/INRIA/spoon/pull/1441)
    • Add support for replacement by multiple elements CtElement#replace(Collection). (PR: https://github.com/INRIA/spoon/pull/1369)
    • Add generic type information in shadow classes. (PR: https://github.com/INRIA/spoon/pull/1352)
    • The template engine supports insertion of literals. (PR: https://github.com/INRIA/spoon/pull/1403)

    Bug Fixes

    • Ignore null items in ReplacementVisitor. (PR: https://github.com/INRIA/spoon/pull/1400)
    • CtComment#getContent should never return "null". (PR: https://github.com/INRIA/spoon/pull/1442)
    • Fix a bug with import static. (PR: https://github.com/INRIA/spoon/pull/1412)
    • Fix issue related to overridden methods in getAllMethods. (PR: https://github.com/INRIA/spoon/pull/1375)
    • Fix issue in ClassTypingContext#isOverriding. (PR: https://github.com/INRIA/spoon/pull/1411)
    • Fix bug related to CtTypeParameterReference and getDeclaration. (PR: https://github.com/INRIA/spoon/pull/1383)
    • Refactor SubstitutionVisitor to support null parameter values. (PR: https://github.com/INRIA/spoon/pull/1359)
    • Bug with escaped literal. (PR: https://github.com/INRIA/spoon/pull/1394)
    • Use getTypeDeclaration in CtTypeParameterReference. (PR: https://github.com/INRIA/spoon/pull/1387)
    • Ignore only ClassCastException in query code. (PR: https://github.com/INRIA/spoon/pull/1462)
    • Bugs related to continue algorithm of ClassTypingContext. (PR: https://github.com/INRIA/spoon/pull/1379)
    • Fix regression related to ReferenceBuilder and generics. (PR: https://github.com/INRIA/spoon/pull/1373)
    • Fix stackoverflow in ReferenceBuilder. (PR: https://github.com/INRIA/spoon/pull/1367)
    • Calls to default constructors outside the factory should still be possible, and a default factory is made available. (PR: https://github.com/INRIA/spoon/pull/1448)
    • Fix NPE with union catch inside lambda in noclasspath. (PR: https://github.com/INRIA/spoon/pull/1416)
    • comment: Printing of comments on MS Windows. (PR: https://github.com/INRIA/spoon/pull/1435)
    • factory: Create type reference from inner class. (PR: https://github.com/INRIA/spoon/pull/1361)
    • import: Fix NPE with import scanner. (PR: https://github.com/INRIA/spoon/pull/1437)
    • prettyprinter: Throws SpoonException with info instead of NPE in Pretty Printer on missing variable declaration. (PR: https://github.com/INRIA/spoon/pull/1451)
    • reflection: Add annotation value in the model. (PR: https://github.com/INRIA/spoon/pull/1384)
    • role: Fix wrong roles. (PR: https://github.com/INRIA/spoon/pull/1397)
    • template
      • Clarifies the contract of proxy template parameters. (PR: https://github.com/INRIA/spoon/pull/1457)
      • Substitution#insertAll should bypass Template methods. (PR: https://github.com/INRIA/spoon/pull/1348)
    • printer: Reset import context on reset. (PR: https://github.com/INRIA/spoon/pull/1360)

    Documentation

    • community: Add the integrator rules. (PR: https://github.com/INRIA/spoon/pull/1413)
    • Explicit the difference between isOverriding and isSubsignature. (PR: https://github.com/INRIA/spoon/pull/1449)
    • Update roadmap (inline comments are supported + link to 'features' issues). (PR: https://github.com/INRIA/spoon/pull/1440)
    • Add cool idea in roadmap (by @tdurieux). (PR: https://github.com/INRIA/spoon/pull/1433)
    • Improve explanation of getDeclaration. (PR: https://github.com/INRIA/spoon/pull/1429)
    • Update roadmap. (PR: https://github.com/INRIA/spoon/pull/1432)
    • Adds AutoJMH in the ecosystem page. (PR: https://github.com/INRIA/spoon/pull/1401)
    • Clean bad comment. (PR: https://github.com/INRIA/spoon/pull/1380)

    Refactoring

    • Change Substitution#createTypeFromTemplate return type to avoid cast. (PR: https://github.com/INRIA/spoon/pull/1464)
    • Add not-null check. (PR: https://github.com/INRIA/spoon/pull/1443)
    • Explicit handlingErrorPolicy of JDT in noClasspath and normal mode. (PR: https://github.com/INRIA/spoon/pull/1424)
    • Printing of lists in Spoon pretty printer. (PR: https://github.com/INRIA/spoon/pull/1428)
    • GetLabelledStatement is a derived propertty shared between CtContinue and CtBreak. (PR: https://github.com/INRIA/spoon/pull/1398)
    • role: Rename CtPathRole to CtRole and add new roles. (PR: https://github.com/INRIA/spoon/pull/1372)

    Tests

    • Use the factory instead of the constructor. (PR: https://github.com/INRIA/spoon/pull/1395)
    • Add test for template substitution of enum values. (PR: https://github.com/INRIA/spoon/pull/1389)
    • Add test for template substitution of variable access. (PR: https://github.com/INRIA/spoon/pull/1390)
    • Add test for template substitution of return. (PR: https://github.com/INRIA/spoon/pull/1391)
    • Add test for SubstitionVisitor class access. (PR: https://github.com/INRIA/spoon/pull/1388)
    • Test Template array access. (PR: https://github.com/INRIA/spoon/pull/1353)

    Other

    • Remove old useless file. (PR: https://github.com/INRIA/spoon/pull/1421)
    • Change revapi config for more relevant messages. (PR: https://github.com/INRIA/spoon/pull/1392)
    • Removes one checkstyle rule. (PR: https://github.com/INRIA/spoon/pull/1336)
    • Add new architectural rule. (PR: https://github.com/INRIA/spoon/pull/1355)
    • travis: Fix issue by using the last image on Travis https://github.com/INRIA/spoon/issues/1414. (PR: https://github.com/INRIA/spoon/pull/1418)
    • Update release numbers in documentation. (PR: https://github.com/INRIA/spoon/pull/1351)
    • Prepare for next development iteration.
    • Remove deprecated methods in ImportScanner. (PR: https://github.com/INRIA/spoon/pull/1366)

    Authors

    | Name | Nb Commit | | --- | --- | | Pavel Vojtechovsky | 23 | | Simon Urli | 16 | | Martin Monperrus | 12 | | Thomas Durieux | 11 | | Benjamin DANGLOT | 1 |

    Source code(tar.gz)
    Source code(zip)
    spoon-core-5.8.0-jar-with-dependencies.jar(7.15 MB)
    spoon-core-5.8.0-javadoc.jar(3.79 MB)
    spoon-core-5.8.0-sources.jar(782.21 KB)
    spoon-core-5.8.0.jar(1.08 MB)
  • spoon-core-5.7.0(Jun 1, 2017)

    New features

    • Add support for Java 8 receiver parameters. (PR: #1298)
    • Function to find all executables with the same signature. (PR: #1291)
    • Add new filter for finding lamdas (class LambdaFilter). (PR: #1315)
    • Add new function to collect subtypes (class SubInheritanceHierarchyFunction). (PR: #1290)
    • Add refactoring class CtParameterRemoveRefactoring. (PR: #1317)
    • Add SubInheritanceHierarchyResolver as helper for query mechanisms. (PR: #1309)
    • New filter ExecutableReferenceFilter. (PR: #1318)
    • Add public method MethodTypingContext#adaptMethod. (PR: #1288)
    • Add method GenericTypeAdapter#getAdaptationScope. (PR: #1287)
    • Add CtMethod#isOverriding(CtMethod). (PR: #1220)
    • Add support for typing analysis of generic types. (PR: #1218)
    • Add support for type erasure (CtType/CtTypeReference#getTypeErasure()). (PR: #1216)
    • Support for better analysis of generic type arguments (TypeReference#getTypeParameterReference() and TypeFactory#createReference(type,includingFormalTypeParams)). (PR: #1237)
    • SuperInheritanceHierarchyFunction supports references and listener. (PR: #1242)
    • Add support for renaming local variables. (PR: #1005)
    • comment: Add an AST node for the javadoc tags. (PR: #1310)
    • template: The template engine supports substitution of method names in method calls. (PR: #1325)

    Bug Fixes

    • Fix bug in CtExecutableReference#getActualMethod when parameters are generically typed. (PR: #1277)
    • Fix bug in getActualMethod() due to missing information in CtTypeParameterReference. (PR: #1286)
    • Improve line preservation mode. (PR: #1335)
    • Auto-import works for compilation units with multiple classes in the same file. (PR: #1322)
    • Fix import bug with java.lang.subpackage. (PR: #1327)
    • Fix NPE in isTypeInCollision. (PR: #1326)
    • Improve ImportScanner to support variables called "java". (PR: #1321)
    • Fix bug in qualified names in a special case due to missing information in JDT. Fix #1307. (PR: #1312)
    • Fix bug in import inference (auto-import mode). Close #1306. (PR: #1308)
    • In noClasspath, a type without import should be considered in the same package as the current class. (PR: #1302)
    • Fix SuperInheritanceHierarchyFunction in noClassPath mode. (PR: #1281)
    • Fix AnnotationFactory#create. (PR: #1340)
    • Fix JDT error when input resource contains an entirely commented class. (PR: #1279)
    • Fix special case not handled in factory.Annotation().annotate(). (PR: #1278)
    • Fix a couple of bugs in recent feature "generic type adaptation". (PR: #1275)
    • Fix regression regarding actual type arguments resolving. (PR: #1273)
    • #setParent is not a normal metamodel setter, and is excluded from SpoonTestHelpers#getAllSetters. (PR: #1261)
    • TestFactorySubFactory must only check public factory methods. (PR: #1263)
    • CtBlock#getLastStatement is a @DerivedProperty. (PR: #1262)
    • Fix a bug in wrongly qualified type in executable references. (PR: #1259)
    • Fix issue #1246. (PR: #1251)
    • Fix NPE in CtElement#getMetadataKeys. Closes #1239. (PR: #1240)

    Documentation

    • Add pointer to new Template example. (PR: #1343)
    • Document and refactor TemplateMatcher. (PR: #1319)
    • Update examples links from gforge.inria.fr to github.com. (PR: #1226)
    • Adds InspectorGuidget in ecosystem page. (PR: #1304)
    • Clarifies page on architectural rule checking with Spoon. (PR: #1301)
    • Fix link mix. (PR: #1297)
    • Fix javadoc of SuperInheritanceHierarchyFunction. (PR: #1289)
    • Update doc with release 5.6.0 information. (PR: #1227)

    Refactoring

    • Remove or update deprecation related to queries & filters. (PR: #1300)
    • Improve ImportScanner design, add getAllImports. (PR: #1339)
    • Renamed confusing duplicate classes. (PR: #1333)
    • Improve PrinterHelper (less duplication, more encapsulation). (PR: #1332)
    • Handle some rare limit cases. (PR: #1331)
    • Remove call to deprecated File#toURL. (PR: #1313)
    • Change generic type bound. (PR: #1314)
    • Replace string literals by constants. (PR: #1316)
    • Remove deprecated method computeImports. (PR: #1311)
    • Remove useless 'final' modifier in interface methods. (PR: #1334)
    • MethodTypingContext#isOverriding/isSameSignature/isSubSignature moved to ClassTypingContext. (PR: #1299)
    • MethodTypingContext#adaptMethod moved to ClassTypingContext. (PR: #1296)
    • AllTypeMembersFunction accepts now CtTypeInformation as parameter. (PR: #1285)
    • Use new CtMethod#isOverriding in method overriding/overriden filters. (PR: #1276)
    • Refactor and test initProperties. (PR: #1260)
    • Remove unused field. (PR: #1253)
    • Adds an architural rule for helper classes with static methods. (PR: #1247)
    • CtFormalTypeDeclarer extends CtTypeMember. (PR: #1235)
    • Refactor *VariableReferenceFunction around LocalVariableReferenceFunction. (PR: #1193)

    Performance

    • Use factory.Type().OBJECT to save memory. (PR: #1241)
    • Use TypeFactory#OBJECT. (PR: #1231)

    Tests

    • Improve TemplateMatcher test. (PR: #1323)

    Other

    • Checkstyle checks that the end of lines are consistent (unix-style \n only). (PR: #1344)
    • Fix broken revapi reports due to regression in revapi-reporter-text 0.8.0.
    • Revapi check should fail only for breaking changes. (PR: #1282)
    • Fix revapi bug. (PR: #1280)

    Unknown

    • Add 'getBinaryFiles' to CompilationUnit. Fixes #1230. (PR: #1232)
    • Prepare for next development iteration.

    Authors

    | Name | Nb Commit | |---------|-----------| | Pavel Vojtechovsky | 38 | | Simon Urli | 18 | | Martin Monperrus | 17 | | Thomas Durieux | 1 | | Marcel Steinbeck | 1 |

    Source code(tar.gz)
    Source code(zip)
    spoon-core-5.7.0-jar-with-dependencies.jar(7.08 MB)
    spoon-core-5.7.0-javadoc.jar(3.63 MB)
    spoon-core-5.7.0-sources.jar(735.06 KB)
    spoon-core-5.7.0.jar(1.01 MB)
  • spoon-core-5.6.0(Mar 16, 2017)

    Thanks all contributors to this new release, and special thanks to @pvojtechovsky who continue to do an amazing work on Spoon!

    New features

    • Add filter helpers (FieldReferenceFunction, FieldScopeFunction, SubtypeFilter). (PR: #1141)
    • ParentFunction is able to terminate early. (PR: #1211)
    • Introduces CtScannerFunction as basic infrastructure for advanced functions and queries. (PR: #1180)
    • Add support for CtScannerListener in EarlyTerminatingScanner. (PR: #1210)
    • Automatic explicit ThisAccess for fields. (PR: #1192)
    • CtLambda#getMethod() and fix of #1159. (PR: #1164)
    • Add helper for query variables (VariableReferenceFunction, VariableScopeFunction). (PR: #1114)
    • Add helper for query to get parents of element. (PR: #1153)
    • Add query functions AllTypeMembersFunction and SuperInheritanceHierarchyFunction. (PR: #1195)
    • Add filter helpers (LocalVariableReferenceFunction, LocalVariableScopeFunction). (PR: #1144)
    • Add filtering helpers (CatchVariableReferenceFunction, CatchVariableScopeFunction). (PR: #1145)
    • Add filtering helpers (ParameterReferenceFunction, ParameterScopeFunction). (PR: #1136)
    • Add support for early terminating queries with CtQuery#first(). (PR: #1138)
    • Add support for getting all children with CtQuery#filterChildren(null). (PR: #1140)
    • Add CtQuery#select(Filter). (PR: #1142)
    • Add query factory. (PR: #1093)
    • Add metamodel method CtTypeParameter#getTypeParameterDeclarer(). (PR: #1217)
    • Reusable and efficient CtQueries. (PR: #1090)
    • filter: Template matchers can be used as filter. (PR: #1110)

    Bug Fixes

    • CtMethod#isDefaultMethod. (PR: #1165)
    • Fix wrong behavior for special cases in removeStatement. Closes #1221. (PR: #1224)
    • Inner interfaces should be properly handled in CtTypeReferenceImpl#canAccess. (PR: #1189)
    • LocalVariableScopeFunction handles CtFor, CtTryWithResource, local classes. (PR: #1154)
    • Fix regression with a lambda expression extends Function. (PR: #1178)
    • CtExecutableReference#isOverriding correctly handles anonymous classes. (PR: #1219)
    • Fix autoimport regression. (PR: #1162)
    • Bug in isSubtypeOf (broken contract X.isSubtypeOf(X)==true). (PR: #1157)
    • Improve static import support in auto-import mode. (PR: #1155)
    • Fix regression (NPE) in DefaultJavaPrettyPrinter. (PR: #1214)
    • GetSuperClass does not throw exception in noClassPath mode. (PR: #1128)
    • Fix NPE when Spoon in executed from an empty working dir. (PR: #1208)
    • Visibility detection issue in CtElement #1099. (PR: #1102)
    • CtQuery: CCE on Query#forEach call of CtConsumer#apply. (PR: #1126)
    • comment: Support comment on string concatenation. (PR: #1124)
    • noclasspath: Fix the qualified name of partial qualified reference (inner class). (PR: #1201)

    Documentation

    • Adds hyperlink to the Spoon paper.
    • Announces the OW2 membership. (PR: #1151)
    • Update ecosystem (one single file to maintain + added syringe). (PR: #1147)
    • Add links to changelogs (#1133). (PR: #1133)
    • Add support files for FOSDEM'17. (PR: #1148)
    • Remove outdated last-updated information on pages. (PR: #1177)
    • More specific doc about the release process. (PR: #1131)
    • Fixes broken menu (#1122). (PR: #1122)
    • Fix javadoc JDK8 rules. (PR: #1112)
    • Prepare internal doc for the new release. (PR: #1109)
    • license: Update license year. (PR: #1130)

    Refactoring

    • Improve and simplify usage of PotentialVariableDeclarationFunction. (PR: #1194)
    • Remove FieldScopeFunction. (PR: #1186)
    • Remove deprecated elements from version 5.4.0. (PR: #1135)

    Performance

    • Improve performance of DirectReferenceFilter. (PR: #1132)

    Tests

    • Reduce the scope of the testSettersAreAllGood test. (PR: #1196)

    Other

    • Only publish revapi report if the PR is edited or opened. (PR: #1161)
    • Revapi configuration and helper scripts to detect API breaking changes. (PR: #1115)
    • travis: Travis must check that javadoc is well-formed. (PR: #1107)

    Unknown

    • Prepare for next development iteration.

    Authors

    | Name | Nb Commit | |---------|-----------| | Pavel Vojtechovsky | 29 | | Simon Urli | 17 | | Martin Monperrus | 5 | | Thomas Durieux | 3 | | Marcel Steinbeck | 1 |

    Source code(tar.gz)
    Source code(zip)
    spoon-core-5.6.0-jar-with-dependencies.jar(7.01 MB)
    spoon-core-5.6.0-javadoc.jar(3.50 MB)
    spoon-core-5.6.0-sources.jar(689.24 KB)
    spoon-core-5.6.0.jar(965.28 KB)
  • spoon-core-5.5.0(Jan 11, 2017)

    Thanks to all contributors!

    New features

    • New query architecture with support for Java8 queries. (PR: #1018)
    • Allow spoon to do static imports for methods and fields. (PR: #1040)
    • Interface to Exclude Compilation Units From CtModel. (PR: #1037)
    • API: Add CtTypeMember.getTopLevelType(). (PR: #1004)
    • CoreFactory
      • Add create(Class) so as to create elements by reflection. (PR: #949)
    • evaluation: Simplify classes based on static evaluation (first support). (PR: #1003)
    • filter: Compute filtered types by reflection from parameter of method matches. (PR: #1015)
    • getDeclaredOrInheritedField: Add CtTypeInformation.getDeclaredOrInheritedField(String fieldName). (PR: #967)
    • model: Add interface CtBodyHolder. (PR: #943)
    • position: Improve the element position. (PR: #984)
    • snippet:
      • Add support for compiling statements with return. (PR: #947)
      • Print Comment in CtSnippet. (PR: #1101)

    Bug Fixes

    • DefaultJavaPrettyPrinted: Fix bug when printing implicit accesses to static fields in autoimport. (PR: #913)
    • JDTBasedSpoonCompiler: Fix annotation bug when templates are used. (PR: #934)
    • NPE: Fix NullPointerException resulting from variable accesses in constructors. (PR: #1098)
    • Fixed name of test class. (PR: #1037)
    • Generate expected EOL even on Windows. (PR: #977)
    • No exception when writing to log. (PR: #920)
    • Test: APITest.testSetterInNodes() was not testing anything . fix #972. (PR: #1022)
    • Close input stream after creating a compilation unit to prevent TooManyOpenFilesException. (PR: #1097)
    • Fix ReferenceBuilder#getLambdaExecutableReference to return the innermost lambda #1100. (PR: #1103)
    • Set the type of a parameter declared in a lambda to Object instead of ommitting them when unknown. (PR: #1108)
    • Fixed formatting. (PR: #1037)
    • Fix inconsistencies between interface contract and double implementations of getAllExecutables. (PR: #1019)
    • Removes unused imports. (PR: #988)
    • Clean exception when Spoon is given a wrong path for input resource. (PR: #1057)
    • SignaturePrinter: Overrides visitCtAnnotationMethod in SignaturePrinter. (PR: #1030)
    • ThisAccess
      • The type access associated to a this must be the type containing the this. (PR: #1008)
      • Shorter this access. (PR: #1031)
    • access path: Fix regression with type parameters in access paths. (PR: #1007)
    • annotations: Fix Dropwazrd regression by fixing substituteAnnotation. (PR: #1032)
    • array: The qualified name of an array is not java.lang.reflect.Array. (PR: #995)
    • clone: Clone preserves comments and implicitness. (PR: #1028)
    • comments
      • Fixes pretty-printing bug for inline arrays with comments. (PR: #912)
      • Fix bug in comments in array initialization. (PR: #1088)
      • Fix a bug concerning multiple comments before a catch block. (PR: #1074)
      • Handle stacked comments in package-info.java. (PR: #1011)
      • Add support of comments in snippets. (PR: #930)
    • enum: GetAllMethods also returns the methods of Enum. (PR: #1016)
    • equal
      • Regenerate EqualVisitor based on new Scanner, which fixes a number of bugs incl. #978. (PR: #993)
      • Actual type references must be part of equality. (PR: #997)
    • getTypeDeclaration
      • First lookup in sources, then in classpath. (PR: #962)
      • GetTypeDeclaration('?') should point to Object. (PR: #973)
    • imports
      • Correct interplay between fully-qualified types and variable names . (PR: #1026)
      • Fix regressions with static imports and inner classes or enums. (PR: #1048)
      • Fix a static import bug, ripple of adb2fd7420b3bf01e696be87f4791759bfb6de53. (PR: #1060)
    • importscanner: Fix regression in fuly-qualified mode. (PR: #1052)
    • isAssignableFrom: Deprecate isAssignableFrom that is totally confusing, and for which there is an alternative. (PR: #948)
    • isSubtypeOf: Spoon can resolve anonymous references. (PR: #953)
    • launcher: Easy way to parse a complete class with package. (PR: #982)
    • log: Filter out some JDT errors in noclasspath. (PR: #926)
    • model
      • Fix NPE when compilation units array contains null elements. (PR: #928)
      • Complex access paths for types with visibility are now correctly handled. (PR: #974)
    • newinstance: Forces usage of the newest version of the class. (PR: #909)
    • parent: Stops furious useless exceptions. (PR: #963)
    • performance
      • Improves performance of VirtualFolder.getAllFiles() and getSubFolders(). (PR: #915)
      • Keep shadow classes. (PR: #898)
    • position: Implicit elements do not have position. (PR: #1086)
    • precompile: Specifies and fixes precompile option. (PR: #923)
    • pretty-print
      • Fix pretty-printing of 'this' access for inner classes. (PR: #1061)
      • The annotation values are now pretty-printed in the original order. (PR: #1067)
      • Parentheses are missing when pretty-pretting some ternary expressions. (PR: #927)
    • reference: Fix reference in ctconstructor. (PR: #1095)
    • scanner
      • Add missing scan properties based on a new powerful specification. (PR: #966)
    • serialization: Fix serialization issue in Factory. (PR: #955)
    • shadow: No ClassNotFoundException when building shadow classes by reflection. (PR: #1012)
    • subtype: Removes CtTypeImpl#isSubtypeOf that is wrong and anyway overridden by all subclasses. (PR: #954)
    • template: Check that Template is on source path of builder. (PR: #976)
    • test
      • Much stronger contracts for setter spec and tests. (PR: #975)
      • Fixes OS-dependent path in LauncherTest. (PR: #919)

    Documentation

    • Add --noclasspath for reducing first-usage friction.
    • Clarifies responsibility of CtNamedElement. (PR: #1062)
    • Adds adt poster and InDesign source. (PR: #1051)
    • Fix markdown issue in code_elements.md.
    • Improve readability and wording of doc/comments.md. (PR: #1079)
    • Fix broken link.
    • Improve navigability and first contact.
    • Update README.md (compiling, ecosystem, contributors). (PR: #1089)
    • Adds doc about constructor calls and the associated reference. (PR: #994)
    • Improve template documentation. (PR: #1068)
    • Adds documentation for explaining the code elements. (PR: #922)
    • SignaturePrinter: Improves doc of SignaturePrinter. (PR: #987)
    • info: Fix broken link to mailing list.
    • Fixes a typo in doc/gradle.md. (PR: #1078)
    • Fix issues related to javadoc in java 8. (PR: #1105)

    Refactoring

    • Same algorithm for building sources, templates and snippet. (PR: #946)
    • Remove code duplication and fix inconsistencies of class Substitution. (PR: #992)
    • Removes dead code. (PR: #989)
    • Check everywhere that Template is on source path of builder. (PR: #979)
    • Removes old unseless code. (PR: #983)
    • Remove unused printer code of visitCtCatchVariable. (PR: #965)
    • JDTBatchCompiler arg.sources not needed. (PR: #958)
    • Regenerate files with short this for future clean diffs. (PR: #1039)
    • Avoid creation of JDT hacking TMP files. (PR: #944)
    • JDTBatchCompiler.getUnits() parameter not required anymore. (PR: #942)
    • Remove old unmaintained/broken code. (PR: #937)
    • All factory methods are also in main Factory for usability and discoverability. (PR: #1082)
    • Removes duplicated code. (PR: #936)
    • Remove unused imports. (PR: #935)
    • Reuse existing CU in JDTBatchCompiler.getUnits(). (PR: #933)
    • Introduce JDTBasedSpoonCompiler.buildModel to remove code duplication. (PR: #931)
    • Improves JDTCommentBuilder. (PR: #924)
    • classloader: Adds test for classloader. (PR: #897)
    • printerContext: Assure correct restore of state. (PR: #999)
    • processingmanager: Removes duplicated code, improves readability. (PR: #1054)
    • Deprecate reference filtering that is now handled by standard element filtering. (PR: #1013)
    • Renamed label from units to unitLoop. (PR: #1037)
    • Remove dependency to CompilationUnitDeclaration. (PR: #1037)
    • Use filter to exclude instead of accapt units. (PR: #1037)
    • We must always have a source + exception handling. (PR: #996)
    • Added an interface used to filter particular CompilationUnitDeclaraions. (PR: #1037)

    Performance

    • Cache inputClassLoader corresponding to sourceClasspath. (PR: #990)
    • Improve performance of FindCommentParentScanner. (PR: #917)

    Tests

    • ParentContractTest: Improves contract about setting parents. (PR: #956)
    • TemplateMatcher: Add tests for named template matchers (uncovered cases). (PR: #1092)
    • VisitorPartialEvaluator: Add tests for VisitorPartialEvaluator. (PR: #939)
    • metamodel: Enforce the package design of the metamodel. (PR: #945)
    • superClass: Adds test that verifies the compilation of complex superclass references that use access paths with tricky visibility. (PR: #971)
    • template: Add test for super interface templates. (PR: #1020)
    • templatematcher: Add a new Junit test and dynamic assertion for TemplateMatcher. (PR: #1034)
    • Add test for method parameter templating. (PR: #1064)
    • Add tests and doc for template engine. (PR: #1072)
    • Add a test to check if TemplateMatcher can match two equivalent snippets. (PR: #1059)
    • Reduces I/O footprint (and found two IO bugs on the way). (PR: #969)
    • Add coverage for templates (and unify API thanks to this). (PR: #1049)
    • Add missing @Test. (PR: #950)
    • One test was not named correctly, hence was not run by Maven in CI, hiding a bug. (PR: #1036)
    • Update CompilationTest to match latest compiler changes. (PR: #940)
    • Remove unused imports. (PR: #941)
    • replacevisitor: Add a strong test and fix many bugs accordingly. (PR: #957)
    • Added a test for new compilation unit filter. (PR: #1037)

    Other

    • changelog: Improve the changelog generator. (PR: #1087)
    • jenkins: Purge local repository of all Spoon snapshots. (PR: #1065)
    • Change eclipse jdt core dependency now depends on Maven central only. (PR: #1063)
    • Update version of spoon-maven-plugin. (PR: #906)
    • build.sh: Update minimum version to fix problem with repo.eclipse.org.
    • coverage: Update coveralls version. (PR: #1001)
    • release: Update version number in documentation. (PR: #907)
    • Added license note to CompilationUnitFilter. (PR: #1037)

    Authors

    | Name | Nb Commit | | --- | --- | | Martin Monperrus | 52 | | Pavel Vojtechovsky | 36 | | Simon Urli | 21 | | Thomas Durieux | 13 | | Marcel Steinbeck | 11 | | Benjamin DANGLOT | 3 | | Дмитрий | 1 | | Artur Bosch | 1 | | Scott Dickerson | 1 | | arno_b | 1 | | Gérard Paligot | 1 | | Lionel Seinturier | 1 | | aveuiller | 1 |

    Source code(tar.gz)
    Source code(zip)
    spoon-core-5.5.0-jar-with-dependencies.jar(6.98 MB)
    spoon-core-5.5.0-javadoc.jar(3.34 MB)
    spoon-core-5.5.0-sources.jar(657.28 KB)
    spoon-core-5.5.0.jar(929.61 KB)
  • spoon-core-5.4.0(Oct 27, 2016)

    Important changes

    • CtElement are not comparable anymore (no natural order), they cannot be put in raw TreeSet (PR: #844)
    • The processing and scanning order has changed, it now follows the source code order (Issue: #681) (PR: #841)

    New feature

    • ast
      • Always a block for CtIf and CtLoop. (PR: #805)
    • cttype : New method to know whether a given method is part of a CtType. (PR: #880)
    • position : Defines a default source position for all elements. (PR: #861)

    Fixes

    • factory : Handles null parameter in Type#createReference(Class) and isSubTypeOf. (Closes #825). (Issue: #825) (PR: #837)
    • getDeclaration : Incorrect between getReference and getDeclaration for local variables. (PR: #888)
    • Fixes potential NullPointerException in JDTTreeBuilderQuery. (PR: #887)
    • Enables parallel tests. (PR: #838)
    • GetAllMethods in noclasspath return when encounter an unknown class. (PR: #864)
    • Better getDeclaration of CtLocalVariable (Fixes #868). (Issue: #868) (PR: #873)
    • compilation : Always uses the content of the ast to compile the ast (fixes #878). (Issue: #878) (PR: #879)
    • exception : Improves snippet compilation error message. (PR: #858)
    • if : Print the else body when the body is not a block (closes #881). (Issue: #881) (PR: #883)
    • isLocalType : Proper support for creating internal classes (fixes #776). (Issue: #776) (PR: #860)
    • literal
      • Fix literal type. (PR: #891)
      • Set the type of the CtLiteral via the CodeFactory. (PR: #829)
    • loop : Always use CtBlock in CtForeach. (PR: #847)
    • method : Avoid Concurrent modification with CtType#addMethod. (PR: #850)
    • position : Add default compilation unit when pretty-printing a new CtClass (closes #885). (Issue: #885) (PR: #886)
    • travis : The logs of Travis are not polluted by Javadoc warnings. (PR: #866)

    Documentation

    • Add missing paper information. (PR: #889)
    • Adds doc about architecture checking. (PR: #843)
    • Update papers.md. (PR: #834)
    • Update on release doc. (PR: #830)
    • gradle : Improves Gradle doc (fixes #875). (Issue: #875) (PR: #876)
    • support : Improves support documentation. (PR: #865)
    • release : Update release number. (PR: #831)

    Refactoring

    • Allow Launcher to use an existing Factory (Closes #862). (Issue: #862) (PR: #863)
    • Fix a test that fails on Eclipse due to its classloader. (PR: #859)
    • Removes all useless conditions with CtReference. (Closes #824). (Issue: #824) (PR: #836)
    • ast : Improves generic parameter type of setActualTypeReferences. (Closes #823). (Issue: #823) (PR: #835)
    • release : Remove deprecated code. (PR: #833)

    Other

    • jenkins : Clean. (PR: #848)
    • pom : Updates commons-io from 1.3.2 to 1.4. (Closes #845). (Issue: #845) (PR: #851)
    • release
      • Scripts to publish automatically a release. (PR: #852)
      • Adds nodejs script to generate changelog. (PR: #832)
    • travis : Avoid running several times the tests on Travis. (PR: #839)
    • version : Update spoon maven plugin version. (PR: #849)
    • website : Add a link checker (fixes #797). (Issue: #797) (PR: #872)
    Source code(tar.gz)
    Source code(zip)
    spoon-core-5.4.0-jar-with-dependencies.jar(6.97 MB)
    spoon-core-5.4.0-javadoc.jar(3.22 MB)
    spoon-core-5.4.0-sources.jar(639.19 KB)
    spoon-core-5.4.0.jar(922.89 KB)
  • spoon-core-5.3.0(Sep 19, 2016)

    New feature

    • ast
      • Adds CtTypeInformation#isGenerics method. (PR: #799)
      • Introduces new metamodel class CtTypeParameter for representing a generic type parameter. (Closes #606). (Issue: #606) (PR: #798)
    • wildcard : Creates a new metamodel element for representing a generics wildcard. (Closes #605). (Issue: #605) (PR: #796)

    Fixes

    • access
      • Qualified field access with import static. (PR: #789)
      • Qualified fieldaccess in noclasspath mode. (PR: #762)
    • Typecasts on conditionals are not scanned hence not cloned. (PR: #753)
    • Avoid NullPointerException in CtExecutableReferenceImpl.getDeclaration. (closes #808). (Issue: #808) (PR: #809)
    • Fix NPE in getUsedTypes (Closes #650). (Issue: #650) (PR: #800)
    • Fix regressions introduced by #748. (Issue: #748) (PR: #789)
    • GetAllMethods returns all methods, incl. those of library superclasses and java.lang.Object. (PR: #771)
    • annotation : Supports enum fields with Annotation#annotate() method. (Closes #750). (Issue: #750) (PR: #767)
    • actual : Rewrite actual types with their enclosing class. (PR: #789)
    • api : CtModel.processWith(). (PR: #821)
    • array
      • Builds dimensions with casts. (PR: #789)
      • Allows array in an array. (PR: #789)
    • docs : Changes target of getSignature in javadoc. (PR: #742)
    • enum : Handle synthetic methods of enums (fixes #793). (Issue: #793) (PR: #794)
    • executable
      • Allows block in executable. (PR: #789)
      • Fix method ExecutableFactory#createReference to handle static methods (Closes #817). (Issue: #817) (PR: #818)
    • factory : GetDeclaration from element created by factory should not return null. (closes #719). (Issue: #719) (PR: #735)
    • fieldaccess : Static field access in anonymous executable (closes #816). (Issue: #816) (PR: #819)
    • import : Skip findImport and createPackage if necessary. Fixes #759. (Issue: #759) (PR: #760)
    • lambda : Resolve Literal#constant if required. Fixes #755. (Issue: #755) (PR: #758)
    • method : Search method with generics. (Issue: #573) (PR: #799)
    • noclasspath
      • Mark target as implicit if it's an anonymous class. (Closes #707). (Issue: #707) (PR: #737)
      • Correct reference to parameters in lambda methods. (Closes #779). (Issue: #779) (PR: #802)
      • Access lookup in lambda expressions in noclasspath mode. (Issue: #813) (PR: #814)
      • Tolerates missing annotation types. (PR: #820)
      • Avoid exception when we call getAllFields method. (PR: #780)
    • package : Handle packages with only package-info.java. (Closes #748). (Issue: #748) (PR: #766)
    • reference
      • Allow creation of a reference from CtAnonymousExecutable. (Closes #739). (Issue: #739) (PR: #740)
      • Dynamically lookup the declaration of all variable references (closes #756). (Issue: #756) (PR: #764)
      • No declaring type in an executable reference of a lambda. (fixes #733). (Issue: #733) (PR: #734)
    • replace : Use generic replace with CtStatementList elements (closes #792). (Issue: #792) (PR: #795)
    • type : Fix exception in noclasspath due to PolyTypeBinding. (Closes #751). (Issue: #751) (PR: #804)

    Refactoring

    • ref : Removes unused CtCircularTypeReference. (PR: #799)
    • visitor : Rename EqualVisitor to DeepRepresentationVisitor. (Closes #791). (Issue: #791) (PR: #801)
    • Refactors DefaultJavaPrettyPrinter and JDTTreeBuilder to simplify future maintenance. (PR: #784)
    • Moves JDTTreeBuilder inner classes into top-level classes, adds one helper class with static methods. (PR: #746)
    • Removes getSignature() and create getShortRepresentation(). (PR: #738)
    Source code(tar.gz)
    Source code(zip)
    spoon-core-5.3.0-jar-with-dependencies.jar(6.97 MB)
    spoon-core-5.3.0-javadoc.jar(3.17 MB)
    spoon-core-5.3.0-sources.jar(629.79 KB)
    spoon-core-5.3.0.jar(918.64 KB)
  • spoon-core-5.2.0(Jun 30, 2016)

    Metamodel

    • Clean reset of collections in intercession methods. (PR: #712)
    • All setters allow null parameters. (PR: #694)
    • Introduces CtModel (Issue: #584) (PR: #589)
    • Creates factory methods for primitives. (Issue: #651) (PR: #700)
    • Remove CtImplicitTypeRef and CtImplicitArrayTypeRef. (PR: #667)

    New features

    • shadow : Build shadow elements using Reflection API. (PR: #569)
    • checks : Disable AST checks. (Issue: #649) (PR: #684)
    • comment
      • All comments are handled by the same option (-c). (Issue: #666) (PR: #676)
      • Adds comment support. (PR: #554)
    • filter : Adds LineFilter to reason about statements in blocks. (PR: #678)
    • clone : Adds the handy CtElement#clone (and deprecates CoreFactory#clone). (PR: #677)
    • Refactoring of CtElement.equals for performance. (PR: #674)
    • A faster implementation of 'replace' based on code generation. (PR: #632)

    Fixes

    • annot : Reference to an annotation field as an invocation. (Issue: #578) (PR: #660)
    • ast : Align CtNewClass with CtConstructorCall. (PR: #595)
    • cache : Invalidate cache of the compiler. (Issue: #575) (PR: #577)
    • clone
      • Scan declaring executable of CtParameterRef (closes #729). (Issue: #729) (PR: #730)
      • Fix bug (modifiers not deep copied). (PR: #727)
    • comment
      • Fix bug in the usage of the new flag (closes #721). (Issue: #721) (PR: #723)
      • Handles comments in CtNewArray and in CtConditional. (Issue: #588) (PR: #590)
    • compiler : Add class generated to compilation unit. (PR: #564)
    • conditional : Puts parenthesis when it is necessary. (PR: #669)
    • factory : Gets inner type from Class/InterfaceFactory. (closes #640). (Issue: #640) (PR: #682)
    • filter : Fixes NPE in VariableAccessFilter when the getVariable() is null (e.g. super). (PR: #641)
    • getparent : GetParent(Filter) does not return the current element when it matches the filter. (PR: #638)
    • lambda : Builds executable ref from a lambda. (PR: #665)
    • noclasspath : NPE in a scope usage. (Issue: #574) (PR: #576)
    • parent
      • Avoid NPE with CtElement#hasParent(CtElement) (Closes #679). (Issue: #679) (PR: #685)
      • HasParent should not always return false. (PR: #686)
    • performance : Rewrite CtExecutableReference#isOverriding. (Issue: #586) (PR: #592)
    • printer : Protects each getParent invocation in DefaultJavaPrettyPrinter. (PR: #704)
    • ref : Scan declaring type for CtExecutableReference. (PR: #715)
    • unbox : Don't throw a SCNFException with #unbox(). (PR: #620)
    • Declaring type OR package should be set for a reference, not both. (PR: #613)
    • Annotation values traversal should be delegated to scan(), fixes #603. (Issue: #603) (PR: #614)
    • Fix bugs in ImportScannerImpl. (PR: #596)
    • Fix a number of bugs related to handling of unnamed packages. (PR: #705)
    • Fix bug introduced in #689 (order to iterate with a Deque and Stack are different). (Issue: #689) (PR: #710)
    • Fix nullpointer in hasTypeInImports. (PR: #672)
    • Use CtTypeParameterRef for formal ops. (PR: #620)
    • Fix bugs in ClassFactory.create() methods. (PR: #610)
    • Fix many small bugs with double usage of AST nodes in different subtrees,. (PR: #645)
    • Doesn't warn for implicit source code. (PR: #696)
    • Fix a bug in CodeFactory.createThisAccess() (target was not set). (PR: #612)
    • Fix bugs with creating CtTypeAccess without cloning reference, that leads to problems with replace() in graph. (PR: #611)
    Source code(tar.gz)
    Source code(zip)
    spoon-core-5.2.0-jar-with-dependencies.jar(6.94 MB)
    spoon-core-5.2.0-javadoc.jar(3.12 MB)
    spoon-core-5.2.0-sources.jar(609.64 KB)
    spoon-core-5.2.0.jar(888.18 KB)
  • spoon-core-5.1.0(Mar 21, 2016)

    New features

    • Full support of intersection types. #535
    • Fluent api to test source code transformations. #517
    • Add field at the top of a type. #537

    Minor API changes

    • Annotation values are handled as CtExpression. #555 #556
    • CtVariableAccess#getType does not return null anymore, now delegates to getVariable().getType(). #548

    Fixes

    • No classpath:
      • NPE thrown with annotations on primitive type. #530
      • Anonymous class name must have an empty string. #530
      • NPE when build the type of a CtNewArray. #561
    • Generics:
      • Generics in declaring types of a constructor call. #538
      • A local type can have actual generic types. #542
      • Generics in declaring types of a new class. #545
    • Fields:
      • The qualified name of a type declared in an anonymous class. #541
    • Visibility:
      • Field access declared in a default class. #543

    Refactoring

    • Refactored responsabilities of equal/hashcode/signature. #532
    Source code(tar.gz)
    Source code(zip)
    spoon-core-5.1.0-jar-with-dependencies.jar(6.59 MB)
    spoon-core-5.1.0-javadoc.jar(2.70 MB)
    spoon-core-5.1.0-sources.jar(514.70 KB)
    spoon-core-5.1.0.jar(640.34 KB)
  • spoon-core-5.0.2(Feb 12, 2016)

Owner
Inria
Inria, the French national research institute for the digital sciences
Inria
mobsfscan is a static analysis tool that can find insecure code patterns in your Android and iOS source code.

mobsfscan is a static analysis tool that can find insecure code patterns in your Android and iOS source code. Supports Java, Kotlin, Swift, and Objective C Code. mobsfscan uses MobSF static analysis rules and is powered by semgrep and libsast pattern matcher.

Mobile Security Framework 347 Dec 29, 2022
SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.

SpotBugs is the spiritual successor of FindBugs, carrying on from the point where it left off with support of its community. SpotBugs is licensed unde

null 2.9k Jan 4, 2023
A tool to help eliminate NullPointerExceptions (NPEs) in your Java code with low build-time overhead

NullAway: Fast Annotation-Based Null Checking for Java NullAway is a tool to help eliminate NullPointerExceptions (NPEs) in your Java code. To use Nul

Uber Open Source 3.2k Dec 29, 2022
⚡️Lightning-fast linter for .env files. Written in Rust 🦀

⚡️ Lightning-fast linter for .env files. Written in Rust ?? Dotenv-linter can check / fix / compare .env files for problems that may cause the applica

null 1.5k Jan 1, 2023
Astra: a Java tool for analysing and refactoring Java source code

What is Astra? Astra is a Java tool for analysing and refactoring Java source code. For example: "References to type A should instead reference type B

Alfa 51 Dec 26, 2022
Reformats Java source code to comply with Google Java Style.

google-java-format google-java-format is a program that reformats Java source code to comply with Google Java Style. Using the formatter from the comm

Google 4.8k Dec 31, 2022
OpenGrok is a fast and usable source code search and cross reference engine, written in Java

Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved. OpenGrok - a wicked fast source browser OpenGrok - a wicked fast source br

Oracle 3.8k Jan 8, 2023
Sourcetrail - free and open-source interactive source explorer

Sourcetrail Sourcetrail is a free and open-source cross-platform source explorer that helps you get productive on unfamiliar source code. Windows: Lin

Coati Software 13.2k Jan 5, 2023
:coffee: SonarSource Static Analyzer for Java Code Quality and Security

Code Quality and Security for Java This SonarSource project is a code analyzer for Java projects. Information about the analysis of Java features is a

SonarSource 976 Jan 5, 2023
An extensible multilanguage static code analyzer.

PMD About PMD is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and

PMD 4.1k Jan 2, 2023
A static analyzer for Java, C, C++, and Objective-C

Infer Infer is a static analysis tool for Java, C++, Objective-C, and C. Infer is written in OCaml. Installation Read our Getting Started page for det

Facebook 13.7k Dec 28, 2022
Catch common Java mistakes as compile-time errors

Error Prone Error Prone is a static analysis tool for Java that catches common programming mistakes at compile-time. public class ShortSet { public

Google 6.3k Dec 31, 2022
A free injection hacked client for Minecraft using Java-agents

Swift Swift is a free and open-source injection hacked client base for Minecraft using Java-agents. Issues If you notice any bugs, you can let us know

static final 36 Oct 8, 2022
Java bytecode static analyzer

This project is abandoned and unlikely will be supported in future HuntBugs 0.0.11 New Java bytecode static analyzer tool based on Procyon Compiler To

Tagir Valeev 302 Aug 13, 2022
MathParser - a simple but powerful open-source math tool that parses and evaluates algebraic expressions written in pure java

MathParser is a simple but powerful open-source math tool that parses and evaluates algebraic expressions written in pure java. This projec

AmirHosseinAghajari 40 Dec 24, 2022
cglib - Byte Code Generation Library is high level API to generate and transform Java byte code. It is used by AOP, testing, data access frameworks to generate dynamic proxy objects and intercept field access.

cglib Byte Code Generation Library is high level API to generate and transform JAVA byte code. It is used by AOP, testing, data access frameworks to g

Code Generation Library 4.5k Jan 8, 2023
A Parser That parses OpenAPI definitions in JSON or YAML format and Generates Pact files That contain HTTP request/response interactions by parsing Given Open API specifications

This is a Parser That parses OpenAPI definitions in JSON or YAML format and Generates Pact files That contain HTTP request/response interactions by parsing Given Open API specifications.

dev-rgupta 2 Mar 19, 2022
esProc SPL is a scripting language for data processing, with well-designed rich library functions and powerful syntax, which can be executed in a Java program through JDBC interface and computing independently.

esProc esProc is the unique name for esProc SPL package. esProc SPL is an open-source programming language for data processing, which can perform comp

null 990 Dec 27, 2022