• Post Reply Bookmark Topic Watch Topic
  • New Topic

NamedList$1$1  RSS feed

 
Peter Kirk
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi - I have an "Object" which I am trying to cast to its correct type.

If I call "getClass" on the object, it says it is a "NamedList" (from org.apache.solr.common.util.NamedList). But if I try to cast to "NamedList", I get an exception stating that NamedList$1$1 cannot be cast to NamedList. What does this mean?

Thanks.
 
Paweł Baczyński
Bartender
Posts: 2054
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you posted your code it would be easier to answer.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "$1" name means that it is most likely an anonymous inner class - the Java compiler generates names like that for anonymous inner classes.

Where did the object come from and why are you trying to cast it to a NamedList? I suspect you're not supposed to cast it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!