You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the strengths of OpenRewrite is that its tree elements include semantic type information. In the case of the Java parser, type attribution is achieved by mapping type information from the Javac compiler into Rewrite's Java-type system. In previous versions of Rewrite, the framework used the flyweight pattern to cache the type information and promote referential de-duplication. The flyweights prevented memory exhaustion and reduced the size of serialized ASTs. An additional feature of Rewrite's Java-type system was that it would artificially break cycles by introducing a Cyclic reference.
As the library has evolved (and we have started collecting more type information), it has exposed limitations and gaps within the legacy type system. This release introduces a new Java Type caching system that is better suited to large-scale, automated refactoring. Most of the changes are "behind-the-scenes" and lead to a much more accurate type-attribution system.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
New Java Type Cache
One of the strengths of OpenRewrite is that its tree elements include semantic type information. In the case of the Java parser, type attribution is achieved by mapping type information from the Javac compiler into Rewrite's Java-type system. In previous versions of Rewrite, the framework used the flyweight pattern to cache the type information and promote referential de-duplication. The flyweights prevented memory exhaustion and reduced the size of serialized ASTs. An additional feature of Rewrite's Java-type system was that it would artificially break cycles by introducing a Cyclic reference.
As the library has evolved (and we have started collecting more type information), it has exposed limitations and gaps within the legacy type system. This release introduces a new Java Type caching system that is better suited to large-scale, automated refactoring. Most of the changes are "behind-the-scenes" and lead to a much more accurate type-attribution system.
Other Enhancements
Mapnotation for Gradle dependency declarations 2802d60Fixes
XmlParserthrows NPE when parsing a DTC without anexternalIdXmlParser throws NPE when parsing a DTC without an externalId #1150JsonParserVisitorparses longs withparseIntJsonParserVisitor parses longs with parseInt. #1145SourceFileare accepted by visitors. Scope which types ofSourceFileare accepted by visitors #1151ChangePackage.updateTypeis never called ChangePackageupdateTypeis never called #1140MissingOverrideAnnotationMismatched parenthesis in MissingOverrideAnnotation #1153AddImportshould not addjava.langto classes including classes in the default package AddImport should not add java.lang to classes including classes in the default package #1158 AddImports adds java.lang.* imports within default packages #1156AnchorandAliasmodels to YAML, and alias support forYaml.Scalarvalues. Add Anchor and Alias models to Yaml, and alias support for Yaml.Scalar values. #1155AddImport7007421JavaTemplatemethod argument substitution and Java8 type mapping cad4aed 9ab35a9UpgradeParentPommay downgrade versions UpgradeParentPom may downgrade versions #1107Xml.Document, it is transformed into aMavenwith an empty model If a Maven visitor successfully changes a non-Maven Xml.Document, it is transformed it into a a Maven with an empty model #1167ChangeMethodTargetToStaticVisitorto remove potential namespace conflicts. 2be7989BlankLinesVisitorfefdc00 35bb53fAutoFormatalways formats maven poms with 4 space indentation Xml AutoFormat always formats maven poms with 4 space indentation #1186AddPluginto correctly format any executions/configuration/dependencies Enhance Maven AddPlugin to correctly format any executions/configuration/dependencies #1187YamlParserthrowsEmptyStackExceptionYamlParser throws EmptyStackException #1180LatestReleaseto support timestamped suffixes 5503aacsrc/main/java/org/openrewrite/concourse/ChangeValue.java#1173FindPropertiesin rewrite-properties missingvisitMarkersFindProperties in rewrite-properties missing visitMarkers #1195FindPropertiesshould have a marker on the value, same as YAML and other search results FindProperties should have marker on the value, same as yaml and other search results #1196EmptyBlockVisitoref074f5NoValueOfOnStringTyperemoves necessary call to String#valueOf in string concatenation NoValueOfOnStringType removes necessary call to String#valueOf in string concatenation #1200MethodNameCasingshould not rename overridden methods by MethodNameCasing should not rename overridden methods #1217Autodetectcounts prefixes with neither tabs nor spaces as spaces Autodetect counts prefixes with neither tabs or spaces as spaces #1221UnnecessaryExplicitTypeArgumentscan lead to uncompilable code due to introduced ambiguity UnnecessaryExplicitTypeArguments can lead to uncompilable code due to introduced ambiguity #1211MinimumSwitchCasesshould prepend enum class to values or statically import them MinimumSwitchCases should prepend enum class to values or statically import them #1212AutoFormatunder-indents tag values Xml AutoFormat under-indents tag values #1189NestedEnumsAreNotStaticreformats whole enum #1222IndexOfChecksShouldUseAStartPositionshould ignore cases where the start position is undefined and the index expected to be greater than 0 IndexOfChecksShouldUseAStartPosition should ignore cases where the start position is undefined and the index expected to be greater than 0 #1225UnnecessaryThrowsremovesthrowsfrom the parent class and breaks subclasses overriding methods UnnecessaryThrows removes throws from parent class and breaks subclasses overriding methods #1207OrderPomElements. Preserve new line layout of pom's reordered by OrderPomElements. #1230MethodMatchershould acknowledgematchOverridesMethodMatcher should acknowledge matchOverrides #1219Class.forNamefor primitives inMethodMatcher, bettertoStringonJavaTypeChangeMethodAccessLevelshould pass onmatchOverridesChangeMethodAccessLevel should pass on matchOverrides #1240<?m2e ...?>tag results extraneous input warning when parsing pom<?m2e ...?>tag results extraneous input warning when parsing pom #1243nullas type #1246VersionRangeParser#1250RocksdbMavenPomCachecan lead to heap exhaustion. #1284Full Changelog: v7.16.0...v7.17.0
This discussion was created from the release 7.17.0.
Beta Was this translation helpful? Give feedback.
All reactions