Skip to content

Releases: INRIA/spoon

spoon-core-5.8.0

11 Jul 11:50
Compare
Choose a tag to compare

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: #1417)
  • import: Sort imports alphabetically. (PR: #1434)
  • metamodel
    • CtTypeMember extends CtNamedElement. (PR: #1452)
    • Add a method to insert a statement at a specific position. (PR: #1423)
    • Annotes getter and setter with a CtRole. (PR: #1377)
    • Add first metamodel support. (PR: #1378)
  • role: Add field annotation with a role. (PR: #1368)
  • template: SubstitutionVisitor can replace substrings in NamedElements and References. (PR: #1441)
  • Add support for replacement by multiple elements CtElement#replace(Collection). (PR: #1369)
  • Add generic type information in shadow classes. (PR: #1352)
  • The template engine supports insertion of literals. (PR: #1403)

Bug Fixes

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

Documentation

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

Refactoring

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

Tests

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

Other

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

Authors

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

spoon-core-5.7.0

01 Jun 07:59
Compare
Choose a tag to compare

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

spoon-core-5.6.0

16 Mar 13:45
Compare
Choose a tag to compare

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

spoon-core-5.5.0

11 Jan 15:57
Compare
Choose a tag to compare

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 adb2fd7. (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 documen...
Read more

spoon-core-5.4.0

27 Oct 16:07
Compare
Choose a tag to compare

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)

spoon-core-5.3.0

19 Sep 13:13
Compare
Choose a tag to compare

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)

Spoon 5.2.0

30 Jun 08:57
Compare
Choose a tag to compare

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)

spoon-core-5.1.1

22 Jun 15:21
Compare
Choose a tag to compare

Hotfix

  • Updates remote repository to download JDT.

spoon-core-5.1.0

21 Mar 15:44
Compare
Choose a tag to compare

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

spoon-core-5.0.2

12 Feb 09:32
Compare
Choose a tag to compare

Fixes

  • Local type shouldn't start its name with its identifier in a constructor.
  • Uses CtFieldRead for class access in values of annotations.