Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Help Please  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, so, our robotics team was kinda just thrown into this mess, which is fine we somewhat know what we are doing. BUT there is this one Unknown type where whenever we try and make it the type it is supposed to be it says its 'incompatible' . I'll copy and paste the code in just in case, but does anyone know what it could be? And if you see any other problems that slipped past us please tell me! Thank you!




Code:
 
Master Rancher
Posts: 1107
18
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a lot of code to simply find the issue, could you post the stacktrace?
 
Cc Fox
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah! Sorry for not being specific, Here you go! Thank you for responding so quickly!
 
Daniel Demesmaecker
Master Rancher
Posts: 1107
18
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is line 285 in your code? There you try to asign an object, but it fails. Did you copy paste the stackerror since I never heard of a java.llang.object
 
Sheriff
Posts: 24089
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At line 272 you have



So recognitions is a List of some type of objects, it doesn't say what type. It would be better to write



Then at line 285 you have



In your code your List is untyped so it's treated as a List of Objects. In this case the variable recognition is being assigned an Object reference. But this can't be assigned to the UNKNOWN_TYPE, and hence the error message.

So what exactly is the type you're trying to work with? I see that recognition is supposed to have a getLabel() and a getLeft() method, and probably others. You need to take the name of that type and change lines 272 and 285 to read




Notice that line 284 says you have to do that?

 
Marshal
Posts: 62881
203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you racing into space? Have you got all your oranges standardised for size? And welcome to the Ranch
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!