You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2019/01/21 12:26:00 UTC

[jira] [Closed] (GROOVY-7469) ClassCastException in groovy 2.3.10. See description section for more information

     [ https://issues.apache.org/jira/browse/GROOVY-7469?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King closed GROOVY-7469.
-----------------------------
    Resolution: Cannot Reproduce

I'll mark this as closed since we don't have a reproducible example. Please reopen if you have some specific code we can look at.

> 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
>            Priority: Major
>              Labels: usertask
>
> 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
(v7.6.3#76005)