groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vijaykumar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-7469) ClassCastException in groovy 2.3.10. See description section for more information
Date Wed, 01 Jul 2015 10:07:04 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-7469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14609864#comment-14609864
] 

Vijaykumar commented on GROOVY-7469:
------------------------------------

Any updates on this???? Thanks

> ClassCastException in groovy 2.3.10. See description section for more information
> ---------------------------------------------------------------------------------
>
>                 Key: GROOVY-7469
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7469
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.3.10
>            Reporter: Vijaykumar
>
> Hi Team,
> I'm facing an issue with groovy version 2.3.10. I'm doing the version upgrade from 2.2.2
to 2.3.10.
> The existing code is working in groovy 2.2.2 and the same code throws an exception (ClassCastException)
in groovy 2.3.10.
> //FoodItem Class -- start
> Class FoodItem extends Item 
> {
>         static Construct builder() {
>         new Construct() 
>         }
>   static class Construct
>   {
>   Item.Construct build
>   Construct() {
>             build = new   Item.Construct() { }
>    }
>    FoodItem build() {
>         new FoodItem (build.map)  // This line throws the classcastexception
>     }
> }
> //FoodItem Class -- End
> // Item class -- start
> abstract class Item 
> {
>  protected TreeMap map
>     protected Item() {
>         this.map = [:]
>     }
>     protected Item(TreeMap map) {
>         this.map = [:]
>         if (map != null) {
>             this.map = map
>         }
>     }
>     protected Item(Map map) {
>         this.map = [:]
>         if (map != null) {
>             this.map = new TreeMap(map)
>         }
>     }
>     TreeMap getMap() { this.map }
> abstract protected static class Construct {
>  protected TreeMap map
>         protected Construct() {
>             this.map = [:]
>         }
>         protected Construct(Item item) {
>             this.map = item.map as TreeMap
>         }
> }
> // Item class -- End



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message