欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  资讯频道

Groovy 1.7.4 和1.8.0-beta-1版本发布

程序员文章站 2022-04-03 13:22:59
...

Groovy 1.7.4 和1.8.0-beta-1版本同时发布。

 

Groovy 1.7.4

此版本主要是对bug的修复,还添加了新的GDK方法,如:File.renameTo(String path)等。查看1.7.4发布文档:http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10242&version=16563

 

 

Groovy 1.8.0-beta-1

此版本主要是针对1.7中bug的修复和性能的提升,1.8.0最终版将在今年年底发布。

 

改进:

  • closures are now "callable" (inheriting from java.util.concurrent.Callable)
  • new AST transformations like
    • @Log to inject a logger in your classes
    • @ScriptField for creating a field in a script (should be renamed to @Field in the next beta)
    • @PackageScope now working also on methods and classes (not just fields as before)
    • @Synchronized for providing safer synchronization semantics
    • @InheritConstructors to inherit constructors, like often the case when extending exception classes
    • @IndexedProperties to add JavaBeans indexed property support
    • @AutoClone providing automatic cloning support to your beans
    • @AutoExternalize providing automatic externalization of your POGOs
    • @Canonical adding proper equals(), hashCode(), toString() methods
    • @EqualsAndHashCode adding an equals() and hashCode() method
    • @ToString for creating a default readable toString() method
    • @TupleConstructor for adding a tuple constructor
  • an additional syntax for strings, with $/.../$, to circumvent various escaping corner cases, like for example $/a/b\c$$ $//$
  • new GDK methods like Map.countBy{}, Map.collectEntries{}, Date.putAt() (subscript operator), Date.updated()
  • + obviously all other incremental improvements and new features from the Groovy 1.7 branch like
    • the new String methods like tr(), stripMargin(), stripIndent(), (un)expand(), 
    • Map's withDefault{} method, 
    • Closure's ncury() and rcury()
    • Sql's withBatch{} and withTransaction{}

查看详细发布文档:http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10242&version=16013

相关标签: Groovy