The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

Representative line: Java conversion

Last post 07-09-2008 11:39 AM by cconroy. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 07-08-2008 4:26 PM

    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

    --Edward Dassmesser
  • 07-08-2008 4:38 PM In reply to

    Re: Representative line: Java conversion

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

    CheapBooks girl for ever
  • 07-08-2008 4:57 PM In reply to

    Re: Representative line: Java conversion

    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 guess I'm back.

    Please continue to spam the addresses below.

    PLEASE SPAM:
    jtobin@ohioinstituteofhealthcareers.edu
    jtobin@ohiobusinesscollege.edu
  • 07-08-2008 5:24 PM In reply to

    Re: Representative line: Java conversion

    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

    --Edward Dassmesser
  • 07-08-2008 5:31 PM In reply to

    Re: Representative line: Java conversion

    durnurd:
    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...

  • 07-08-2008 7:18 PM In reply to

    Re: Representative line: Java conversion

    durnurd:
    //object was active and is no inter active
    Maybe it's just not interactive. Did ya ever think of that?!
  • 07-08-2008 7:25 PM In reply to

    Re: Representative line: Java conversion

    durnurd:

    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?
  • 07-09-2008 10:56 AM In reply to

    Re: Representative line: Java conversion

    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? 

  • 07-09-2008 11:05 AM In reply to

    Re: Representative line: Java conversion

    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();
        } 

    --Edward Dassmesser
  • 07-09-2008 11:39 AM In reply to

    Re: Representative line: Java conversion

    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.

    What Would Brian Boitano Do?
Page 1 of 1 (10 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems