• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

inconvertible types found : int required: java.lang.Short

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
]Fixed: changed Short to short. Compiled without errors.
Hello,

I was given this source code and asked to compile it: it fails with the error " inconvertible types found : int required: java.lang.Short".

The code does a bitwise shift to convert some hashed (I think) values to integer. The compiler fails when encountering this statement "s >>>= 5;"


The original author of the code swears up and down that it used to compile but cannot help me.

Note that I removed the SQL query from this code snippet due to its size...Any idea what could be the problem?
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Alan Christen wrote:
The original author of the code swears up and down that it used to compile but cannot help me.

Note that I removed the SQL query from this code snippet due to its size...Any idea what could be the problem?



What version of Java you are using, versus what version of Java the original author is using? I am guessing that the difference has to do with autoboxing.

Henry
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic