• Post Reply Bookmark Topic Watch Topic
  • New Topic

Possible lossy conversion from int to byte errors  RSS feed

 
John Vegas
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's probably really obvious, like it usually is, but I can't figure out why I am getting these errors on multiple functions.









EDIT: Thought it was annoying posting multiple topics asking for help on seperate errors, so I'll just ask here.
The error I get on this line of code is 'Custom may not have been initialized', but no matter what I do, the error sticks.


Thank you.
 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a method signature that asks for bytes, a type with a size of 8 bits.



You are calling methods with ints which have a size of 32 bit.



i2 has been defined as int. You need to tell the compiler explicitly that you are certain that you will not use more than 8 bit. And if that still happens it is all your fault.

this.onDemandFetcher.method563(1, 2, (byte)i2);

EDIT: Thought it was annoying posting multiple topics asking for help on seperate errors, so I'll just ask here.


On the contrary. Distinct problems justify distinct topics.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Vegas wrote:The error I get on this line of code is 'Custom may not have been initialized', but no matter what I do, the error sticks.


Thank you.

I don't know for sure but it might be because your variable name is identical to your class name and so when you say Custom.cache the compiler thinks you are referring to the variable rather than the class.
Try changing it to


 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hauke Ingmar Schmidt wrote:





Just for clarification: While 554 in most contexts does not equal 563, and the method signatures don't match, I assume that the pattern of these (generated? generated.) methods repeats. It would be more helpful if you showed the matching caller/callee pair.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!