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

发布于 2010年07月26日
收藏 0

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


Groovy 1.7.4

此版本主要是对bug的修复,还添加了新的GDK方法,如:File.renameTo(String path)等。查看1.7.4发布文档:



Groovy 1.8.0-beta-1




  • 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{}



转载请注明:文章转载自 开源中国社区 []
本文标题:Groovy 1.7.4 和1.8.0-beta-1版本发布