Spoon v7.0.0 Release Notes

Release Date: 2018-07-04 // almost 6 years ago
  • πŸ”„ Changelog

    🍱 All potentially breaking changes are marked with a "⚠️"

    Major new features

    πŸ†• New features

    • 🍱 ⚠️ Explicitly fail when an element is added twice to two different parents. (PR: #2009)
    • 🍱 ⚠️ 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)
    • 0️⃣ 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)
    • 0️⃣ 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)
    • 0️⃣ 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

    • 🍱 ⚠️ comment: Creating an inline comment with newline separators throws an exception. (PR: #2080)
    • 🍱 ⚠️ Move experimental.modelobs to support.modelobs. (PR: #2140)
    • πŸš€ ⚠️ Remove deprecated elements from last release of Spoon. (PR: #2098)
    • 🍱 ⚠️ Remove usage of getActualClass() from CtTypeReferenceImpl. (PR: #2037)
    • 🍱 ⚠️ Set noclasspath to true as default. (PR: #1936)
    • 🍱 ⚠️ 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)
    • 0️⃣ 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