@surli surli released this Jul 4, 2018 · 412 commits to master since this release

Assets 6

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)
  • 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

  • ⚠️ 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)
  • 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