Representative line: Java conversion



  • I work at a company where we take applications made for cell phones (MIDP) and convert them into applications for blackberries and windows mobile devices.  I think the one I'm working on now has already gone through this process, as it's a lot of search & replace in some cases.  Guess what I'm talking about:

     Timer m_iconBlinkTimer = new Timer(); // how int to blink the unit icon



  •  Lame, indeed.  Sadly, par for the course for most of the J2ME code I've seen.



  • Eh, it's a wtf, but only lowercase.

    On the other hand, why would you need to change all your longs to ints to go from normal phones to blackberries?



  • I believe the longs were converted to ints when the code was converted into regular cell-phone code from something else.

     

    Also, I've found another:

     

    //object was active and is no inter active



  • @durnurd said:

    I believe the longs were converted to ints when the code was converted into regular cell-phone code from something else.
     

    This is made all the more interesting by knowing (or at least having a good idea) the reasoning behind the madness. I wonder how many WTFs (at least in comments) are caused by just this...



  • @durnurd said:

    //object was active and is no inter active
    Maybe it's just not interactive. Did ya ever think of that?!



  • @durnurd said:

    I believe the longs were converted to ints when the code was converted into regular cell-phone code from something else.

     

    Also, I've found another:

     

    //object was active and is no inter active

    Looks like the "refactoring" was something akin to s/long/int/g but should've been s/long /int /g ... except it would still screw up the first comment. Anyway ... converting long to int? Why?


  • Looks like the "refactoring" was something akin to s/long/int/g but should've been s/long /int /g ... except it would still screw up the first comment. Anyway ... converting long to int? Why?

    sigh I hate to be that guy, but:

    java long: 64 bits, java int: 32 bits.

    C long: 32 bits (probably). 

     

    Someone did say "Java conversion" right? was that C to java or java to java? 



  • I'm guessing the above is correct.

     Here's another favorite:

        public int getImageHeight()
        {
                return m_Layout.getWidth();
        }

        public int getImageWidth()

        {

                return m_Layout.getHeight();

        } 



  • A while back, I found a bunch of instances of "shorto" in comments in various files across the codebase. This is J2SE, not mobile, no porting involved. No idea why that search and replace was done.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.