Looks like a bug in Java ... what's going on he

I can't really recreate this problem, but it occurs in situations like the one below. Unfortunately the program is just too complex to post it all here. In other words, I'm not sure if this exact code will produce the bug, but it happens sometimes in similar situations:
        System.out.println("arrived here");
        // while not ready
        System.out.print("waiting until initialisation is ready..."+AnimationFrameManager.printCurrentFrame()+" ... ");
        // System.out.println("THIS LINE HAS BEEN PRINTED");
       while (!this.isReady)
            // do nothing
        System.out.println("done!");The bug is that I get output like this:-
arrived here
waiting until initialisation is ready...3...waiting until initialisation is ready...3...done!Why is it printing twice?
Weirder still is that if I put a line in-between the last println statement and the beginning of the while loop (for example, the line that is commented out above), then it works as expected!
i.e.
arrived here
THIS LINE HAS BEEN PRINTED
waiting until initialisation is ready...3...done!If I take the static method call out, it works as expected:
        System.out.println("arrived here");
        // while not ready
        System.out.print("waiting until initialisation is ready... "); // <!-- took the static method call out
        // System.out.println("THIS LINE HAS BEEN PRINTED");
       while (!this.isReady)
            // do nothing
        System.out.println("done!");Any ideas?
Edited by: GallahJava on Feb 2, 2010 7:47 PM
Edited by: GallahJava on Feb 2, 2010 7:52 PM

There is no GUI, just console output.
I realise there is multi-threading going on "behind the scenes", but I haven't explicitly created any threads except for one; this is the one-and-only thread created by me, does this help? I can't imagine how it could possibly be responsible for these "multithreading issues".
public class AnimationRunner implements Runnable
    private SuperImage[] images;
    private int imageNo;
    private static final int MAX_IMAGES = 39; // How many images in the progression?
    private static final int SWAP_DELAY = 850;
    public AnimationRunner()
            images = new SuperImage[MAX_IMAGES];
            System.out.print("\nInitialising images to memory...");
            for (int x = 0; x < MAX_IMAGES; x++)
                String imageFile = "images/anim-frame-" + (x + 1) + ".png";
                //System.out.println(imageFile);
                images[x] = SuperImage.createFrom(imageFile);
            System.out.println("done!");
            imageNo = 0;
            new Thread(this).start();
    public void run()
        System.out.println("Animation has started.");
        while (true)
            try
                Thread.sleep(SWAP_DELAY);
                if (imageNo >= MAX_IMAGES - 1)
                    imageNo = 1;
                else
                    imageNo++;
                //System.out.println("Now on image #" + (imageNo + 1) + "\n");
            catch (Exception e)
    public int getImageNo()
        return imageNo + 1;
    public SuperImage getImage()
        //System.out.println("\n(using image no."+(imageNo+1)+")\n");
        return images[imageNo];
}

Similar Messages

  • When I bring a song into iTunes next to the number there is what looks like an exclamation mark ! - WHAT DOES THAT MEAN?

    When I bring a song into iTunes next to the number there is what looks like an exclamation mark ! - WHAT DOES THAT MEAN?
    For example, 1 ! Without You
    I can't load it onto my ipod - I never saw that before.

    I found my answer - thanks

  • Looks like a bug in Date class

    Hi guys,
    I just logged in to highlight what I encountered when I was
    trying to convert milliseconds of a time stamp to a date/time
    string.
    Just see the following codes.
    public function
    convertTimeStampToDateAndTime(timeStampInMilliseconds:Number):String
    var stampReadableFormate:String = null;
    if(!isNaN(timeStampInMilliseconds))
    var stampDate:Date = new Date(timeStampInMilliseconds);
    var stampHour:Number = stampDate.getHours();
    var stampMin:Number = stampDate.getMinutes();
    var stampSec:Number = stampDate.getSeconds();
    var stampYear:Number = stampDate.getFullYear();
    var stampMonth:Number = stampDate.getMonth() + 1;
    var stampDate:Number = stampDate.getDate();
    stampReadableFormate = "" + stampDate + "/" + stampMonth +
    "/" + stampYear + " " + stampHour + ":" + stampMin + ":" +
    stampSec;
    trace("Date/Time=" + stampReadableFormate);
    return stampReadableFormate;
    Then I call this method from somewhere by using,
    var reportTime:String =
    this.convertTimeStampToDateAndTime(new Date().getTime());
    You can see trace method in convertTimeStampToDateAndTime()
    is giving you a correct output.
    But just change the convertTimeStampToDateAndTime() method in
    a way that you get time information after you got date, month and
    Year. To explain what I am taking about I have pasted changed code
    as following.
    public function
    convertTimeStampToDateAndTime(timeStampInMilliseconds:Number):String
    var stampReadableFormate:String = null;
    if(!isNaN(timeStampInMilliseconds))
    var stampDate:Date = new Date(timeStampInMilliseconds);
    var stampYear:Number = stampDate.getFullYear();
    var stampMonth:Number = stampDate.getMonth() + 1;
    var stampDate:Number = stampDate.getDate();
    var stampHour:Number = stampDate.getHours();
    var stampMin:Number = stampDate.getMinutes();
    var stampSec:Number = stampDate.getSeconds();
    stampReadableFormate = "" + stampDate + "/" + stampMonth +
    "/" + stampYear + " " + stampHour + ":" + stampMin + ":" +
    stampSec;
    trace("Date/Time=" + stampReadableFormate);
    return stampReadableFormate;
    now call
    var reportTime:String =
    this.convertTimeStampToDateAndTime(new Date().getTime());
    Now see the trace out put, what has happened, your timing
    informations are undefined.
    Looks like it is a bug to me.
    If this issue has already been discussed before I am very
    sorry by duplicating it.
    Chears
    Naleen

    Thanks for all the responses.
    I am not redefining stampDate inside your function/method.
    Please look at it again.
    I call convertTimeStampToDateAndTime() from out side and in
    my original post I have written it as following....
    var reportTime:String =
    this.convertTimeStampToDateAndTime(new Date().getTime());
    That is just an example for you to udnerstand it,
    But what we are doing in our actual application is we read an
    XML file which has time stamps on each elements as attributes. For
    an example, if following is the XML line....
    <element timeStamp='1195770453174'
    >blaaa</element>
    In Actionscript we call this method,
    var reportTime:String =
    this.convertTimeStampToDateAndTime(1195770453174);
    So I am not redefining at all.
    Just do a simple test by user self.
    My second point is.... If I am redefining a date again with
    same number of Milliseconds Date class constructor shouldn't care
    it.
    For an instance
    Var myMilliSEC1:Number = new Date().getTime(); // this is
    constructing today's date and converts to milliseconds
    var myDate1:Date = new Date(myMilliSEC1); //so this should
    give me the todays date again...
    Var myMilliSEC2:Number = myDate1.getTime();
    Now myMilliSEC1 should equal to myMilliSEC2
    But that is a different issue.... I am just answering for
    your comment on "REDEFINING DATE":
    Anyway thanks for your time and concern.

  • [SOLVED] Cannot boot (doesn't look like i915 bug)

    I can't boot my laptop.  Immediately after pressing enter in grub, I see black.  I put my laptop to sleep when it had about 10% battery remaining, and I'm guessing that it ran out of juice before I plugged it in.
    My last successful boot was just after installing linux 3.16.3-1 on September 21.  I booted with archboot and did a chroot.  The only "suspicious" packages I upgraded after this boot were xorg-server+common+xephyr and xf86-video-intel.  So I downgraded these.  No improvement.
    I read about the i915 kernel bug and couldn't find any lines mentioning i915_gem_stolen.c in journalctl -r.  But I downgraded my kernel to the kernel I had been using for a while, 3.15.5-2.  After this, I was happy to see the normal boot messages appearing.  However, when the console login appears, I can't input my user name.  Rather it disappears and reappears every second.  And, interestingly, it writes "Arch Linux 3.16.3-1-ARCH (tty1)" there instead of the kernel version I just downgraded to.
    The same behavior (disappearing and reappearing console login) happens when booting in recovery mode.
    Which logs do I need to look at in order to figure out what is going on?
    Thank you!
    Last edited by tinte (2014-09-27 15:41:01)

    Try rebooting with iso & doing the chroot thing then try to install the lts kernel & its headers/modules & then check everything.log etc for further clues & reboot after.
    The i915 bug has been a weird one with a whole host of different effects for everyone but as you are getting odd behaviour after a kernel downgrade I really would suggest the lts route just to see if that will give you a working system.
    good luck

  • Prints in what looks like greek or something ? What the heck gives ???

    I've had 3 HP's in 3 years and all eventually had this problem.  Why the heck does this suddenly print in what looks like greek every few sentences ?  Balance of print is readable.   Ready to take gun to this thing !!!!   grrr

    Don't shoot! Crazy text is no good. Try the steps outlined in the article below and let us know if it helps.
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01954177&cc=us&dlc=en&lc=en
    Best of Luck!
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • Using either safari or email, I often come up with pages of what looks like some kind of code, what's up

    Using either safari or mail, I often come up with what looks like code, what's up?

    We are having the same issues.  It is so frustrating!  I wish I knew how to fix it.

  • Updated iphone 4 now my camera looks like its taking xray pics what do i do?

    updated iphone 4 now camera looks like xray pics even on the phone everything is in color and the pic of the camera is in black and white

    Try a reset: Simultaneously hold down the Home and On buttons until the device shuts down. Ignore the off slider if it appears. Once shut down is complete, if it doesn't restart on it own, turn the device back on using the On button. In some cases it also helps to double click the Home button and close all apps BEFORE doing the reset.

  • My Menu names look like old bitmap graphics.  What happened?

    Not sure when this happened but the menu fonts both headers and in the drop downs look like poor bitmap fonts and not smooth like they used to.  My screen resolution is set tot he max and I don't have zoom turned on.  Any ideas?

    Go into your system preferences and check appearance then make sure Use LCD font smoothing when available is checked. 

  • Looks like a bug in DB, Getting a invalid number with a group by

    Hi All,
    This is very strange problem that I am encountering. Would like to hear from you, if you have also witnessed something similar:
    What I am doing:
    basically I am doing something like:
    Select x,y,z,count(distinct a) from
    taba,tabb,(select col1,col2 from tabc) tc,
    tabd left outer join tabe on tabd.col=tabe.col,
    viewf
    where (joins between the tabs)
    group by x,y,z
    All the join columns are number(10,0) in all the tables/views.
    If I run this query I get an invalid number 01722. If I comment the count(distinct a) column, the query runs fine.
    Or if I put the to_number for all the joined columns in the where clause, the query runs fine.
    I have never seen such behaviour of Oracle database. May be I am doing something really wrong?
    Looking for help.
    Thanks in advance.

    Well, I do not think it is related to GROUP BY or to DISTINCT. Most likely you have some column X that holds both numeric and non-numeric strings and some other column that indicates if column X value is numeric. If this is the case, you can get ORA-01722 simply becuase Oracle does not apply where clause predicates in the order they are listed. Assume column c1 holds numeric strings when column c2 is set to some specific value. Even if you use:
    WHERE c2 = 'some-value'
    AND TO_NUMBER(c1) = 5
    it is not guaranteed Oracle will first check c2 and only then c1. And if Oracle decides to check c1 first, TO_NUMBER will fail on the first non-numeric c1. Especially it can happen in not very recent Oracle versions. In recent versions most of the time optimizer is smart enough to realize that checking c2 costs less that converting c1 to number and then checking it, so it will check c2 first. Anyway, you need to use ORDERED_PREDICATES hint to let optimizer know to follow predicate sequence. For example, in 9i:
    SQL> create table tbx(flag varchar2(6),value varchar2(10))
      2  /
    Table created.
    SQL> insert into tbx values('alpha','abc');
    1 row created.
    SQL> insert into tbx values('number','123');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from tbx
      2  where flag = 'number' and value = 123
      3  /
    where flag = 'number' and value = 123
    ERROR at line 2:
    ORA-01722: invalid number
    SQL> select /*+ ORDERED_PREDICATES */ * from tbx
      2  where flag = 'number' and value = 123
      3  /
    FLAG   VALUE
    number 123
    SQL>SY.

  • Acrobat  CD Form Button Display incorrectly  when an effect  or transparency  is applied  Via indesign  Looks like a bug

    I have tested existing interactive pdfs that function perfectly in Acrobat XI and Adobe acrobat Reader but open the same files in Acrobat DC and Acrobat DC Reader and most of the documents i have designed and produces over last few years have been renderer useless
    Basically any interactive  form field wich uses  Effects,  Transparency  or  mode changes  like multiply  in every instance the  whole form element appear as a pixelated mess
    I have been posting  in an indesign Thread  https://forums.adobe.com/message/7427566#7427566  it contains  picture and a sample document
    Steve Werner has been helping  me   and has suggest  i post here too
    Graeme,
    I downloaded your PDF file. I have both Acrobat DC and Acrobat XI Pro and I can confirm that I view it the same way that you do.
    It clearly seems to be a bug. In the Acrobat beta group, most users are probably not InDesign users, and most of us who do use InDesign probably didn't create or test Show/Hide buttons using those forms of transparency. I'm sure it's not intentional, probably a side effect of some other change.
    It needs to be reported as a bug. I'd suggest using the Bug Report form here:
    Adobe - Feature Request/Bug Report Form
    Also, there are several Acrobat forums. I'd suggest posting (if you haven't already) in the these two forums:
    Rich Media & 3D
    PDF Forms

    It's good that you'll be submitting a bug. This sort of thing has happened before, and I think it's related some to the fact that InDesign is capable of generating field appearances that you can't set up in Acrobat (transparency in particular).

  • HT4623 Looks like a Bug in the Default Mail application of iOS 6 in an iPhone 4S

    In the mail application of my iPhone 4S running iOS6, while composing a new email, the recipients field marked as "To: " doesn't respond in a single tap rather requires two or three and sometimes even more taps for the blue input bar to appear and enable typing of the recipient's email address.
    I have tried resetting the iPhone completely to factory settings and erasing everything several times, but the problem still persists.
    It has nothing to do with the suggested automatic recipient addresses as the field doesn't gets activated itself in first tap and the blue bar doesn't appear unlike all other fields such as, "Subject", Cc, etc. It looks as if the touch screen didn't get any feedback and hence returned no response.
    Once after a few tapping trials, the blue input bar appears indicating the field ready for the recipient's address to be typed and then everything gets normal from there.
    Rest all the applications and everything on the iPhone is working perfectly fine with no problems anywhere at all.
    Kindly suggest the necessary measures.
    Also, I am facing exactly the similar situation with my iPod Touch 4th generation running on iOS 6 as well. This has made me conclude that it must be a bug in the mailing application.
    Both the devices are only a month old. Also they are configured for different account s and have completely different dat from one another as the ipod touch is being used by my sister who has a separate masbook to sync it.

    That connection is supported for tethering....
    Barry

  • Extra bars in score set -- looks like a bug

    I've been working on some tunes and wanted to display both the bass track and the track with lyrics. Logic Pro 8 seems to have some trouble with this. A bug seems to add additional portions of a bar. Check out this screen shot and note the extra bar 21. If I look at individual tracks, it is fine. If I change windows and go back, it seems to refresh the screen correctly. This problem creates a big problem when I'm trying to play along.
    Screen shot:
    http://www.punkjob.com/ScoreSet.jpg

    you'd be far better off displaying this in a seperate editor the 'old' way, if you ask me. incidentally is this a LP7 song or freshly minted in 8?
    nice bug BTW.

  • Looks like a bug in RoboHelpX6 - CSS

    I have been working in RoboHelpX6 on some CSS - Initially I
    updated an existing CSS, and changed the font that was being used.
    Was using Tahoma and changed it to Verdana, when I did this the CSS
    lost the word wrap. I then went and created a new CSS from scratch,
    stated it out with Tahoma like the first one, everything worked
    fine. Went in and changed the font to Verdana and again lost the
    word wrapping!!!
    Any reports on this yet?

    RoboHelp x5 rewrote CSS as well. I'm pretty sure they think
    it's a feature.
    The workaround I developed involves authoring/editing the
    .css files outside RH, keeping them under version control, and
    reverting them whenever RH tries to change them, plus copying clean
    .css files over the rewritten ones after projects have been
    generated.
    Note that for every stylesheet fname.css you have, RH will
    create a supposed "Netscape" version of the stylesheet called
    fname_ns.css. Again, I'm pretty sure they think this is a feature.
    Unless you like the way the _ns.css version looks on
    Netscape/Firefox/whatever, you will want to copy your clean
    fname.css over fname_ns.css as well.
    Amy

  • Firefox 5 is not able to download and open PDF files as Firefox 3.6 was able to. This looks like a bug to me. When will it be fixed?

    There are many web sites that I visit to download statements that are in PDF format. In Firefox 3.6, when I selected a statement to download, Firefox opened a new window that indicated that the PDF is being downloaded. When the download is complete Firefox either opens the document or the document is opened outside of Firefox by Adobe Reader. In both Firefox 4 and 5, the PDF file download never occurs. This functionality has always worked in Internet Explorer and Google Chrome. I currently use Adobe Reader X 10.1.0. I tried going back to Adobe Reader 9.4.5, but this did not make a difference. So I think the problem is in Firefox.

    it is not your ISP BT Retail that owns/repairs the lines it is openreach which although part of the BT Group has no more direct contact then any other ISP
    you can check your exchange here  http://usertools.plus.net/exchanges/mso.php
    http://usertools.plus.net/exchanges/?
    http://btbusiness.custhelp.com/app/service_status
    http://bt.custhelp.com/app/answers/detail/a_id/15036
    http://community.plus.net/exchange-information/
    If you like a post, or want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • Occasional invalid modified date on a file - looks like a bug

    In the Bridge script I'm working on, I need to compare the last modified dates of files. I've found that when I iterate through the app.document.visibleThumbnails array that in nearly every directory I test on, there are one or two files that return an "undefined" value for app.document.visibleThumbnail[i].spec.modified. It is not the same two files each run, but it's always at least one that has a missing value. It's a pretty simple test app to illustrate the problem:
    var thumbs = app.document.visibleThumbnails;
    for (var j in thumbs)
    var modDateSpec = thumbs[j].spec.modified;
    if (modDateSpec == undefined)
    Window.alert("modification date is undefined");
    Unless this value is not intended to be reliable, this appears to be a bug which is why I am reporting it. I have worked around the problem for now by getting the fsName from the same thumbnail, creating a new File object with that fsName and getting the modified date from that temp object.
    I've verified that purging and rebuilding the cache does not make the problem go away. I see this problem on many different directories.
    Is this the right place to report this type of bug or is there a different procedure I should follow?
    --John

    pessex wrote: Anybody know?  Or know of a different way that I COULD do it in Terminal?
    Don't know about Terminal, but, because you are using 10.9.x and iMovie, try the iMovie method:

Maybe you are looking for

  • How can I install on mac?

    have contacted apple but they cannot get adobe flash an my computer.  Keep trying to download but although it finishes as downloaded it does not

  • Accessing Element's name in Message mapping

    Hi,    I need to Access the Element's name in Message mapping (Using graphical tool or in user defined function). For Example: Element: <Company_Name>XYZ Co </Company_Name> I need to access the Element's name(i.e.)<b>"Company_Name"</b>. So that I can

  • Bookmarked pages and custom toolbar disappear after firefox crash?

    There is no way to restore pages and you have to manually re-drag all the buttons onto the toolbar! It also seems that if the download window is open, the download time counter messes up your dragging, LOL! Like it updates the time and speed every se

  • Using an old MBox (by DigiDesign/Avid with USB) as an audio interface.

    Hello, I've been using my old iMac (2004 vintage, running OS X10.4) for years to make my (guitar) music recordings, using an older version of ProTools as software and an MBox (DigiDesign/Avid) as the audio interface. Now that I have a new MB Pro runn

  • Supporting BW 3.5 and BI 7.0 Web Reports in NW04s Portal

    Hi All, I have been able to identify any documentation confirming that web reports from both BW 3.5 and BI 7.0 can be supported within the same portal.  Can someone please point me to documentation supporting this solution?  Or, provide me with furth