Roll method doesn't work properly

Hi there,
I ran into a problem with the roll method of GregorianCalendar class. Suppose the date is April 6, 00:00:00 2002, the following code will go throught the time changes:
GregorianCalendar cal = new GregorianCalender();
for (int i = 0; i < 24; i++) {
cal.roll(Calenader.HOUR_OF_DAY, 1);
April 6 01:00:00 2002
April 6 02:00:00 2002
April 6 22:00:00 2002
April 6 23:00:00 2002
April 6 00:00:00 2002
But if the current date is April 7, 2002 (daylight saving time change will occur at 2:00 am this day), the above code will result:
April 7 01:00:00 2002
April 7 02:00:00 2002
April 7 22:00:00 2002
April 7 23:00:00 2002
April 6 23:00:00 2002
April 6 00:00:00 2002
Can anyone tell me how to fix this problem or how to avoid this problem.
Thanks a lot.

It doesn't work quite that way for me, my first two lines are these:
April 6 01:00:00 PST 2002
April 6 03:00:00 PDT 2002
You'll notice that I printed the time zone out as well. My last three lines are these:
Sun Apr 07 23:00:00 PDT 2002
Sat Apr 06 23:00:00 PST 2002
Sat Apr 06 00:00:00 PST 2002
and I think there is an argument to be made that these are correct: applying roll() to Sun Apr 07 23:00:00 PDT 2002 should yield Sun Apr 07 00:00:00 PDT 2002; but since daylight saving time was not in effect at that moment, this is equivalent to Sat Apr 06 23:00:00 PST 2002, which is the actual result. On the other hand, here's a quote from the API documentation for Calendar:
"Roll rule. Larger fields are unchanged after the call."
which is an argument that they are incorrect: after the call, the hour should change but not the day. So I'd report it as a bug and see what answer you get.
How to fix the problem? What's the purpose of what you are doing?

Similar Messages

  • LVOOP "call parent method" doesn't work when used in sibling VI

    It seems to me that the "call parent method" doesn't work properly according to the description given in the LabVIEW help.
    I have two basic OOP functions I am doing examples for. I can get one to work easily and the other one is impossible.
    Background
    There are 3 basic situations in which you could use the "call parent method"
    You are calling the parent VI (or method) of a child VI from within the child VI
    You are calling the parent VI (or method) of a child VI from within a sibling VI
    You are calling the parent VI (or method) of a child VI from a different class/object.
    From the LabVIEW help system for "call parent method":
    Calls the nearest ancestor implementation of a class method. You can use the Call Parent Method node only on the block diagram of a member VI that belongs to a class that inherits member VIs from an ancestor class. The child member VI must be a dynamic dispatching member VI and have the same name as the ancestor member VI
    From my reading of that it means situation 3 is not supported but 1 & 2 should be.
    Unfortunately only Situation 1 works in LabVIEW 2012.
    Here is what I want
    And this is what I actually get
    What this means is that I can perform a classic "Extend Method" where a child VI will use the parent's implementation to augment it's functions BUT I cannot perform a "Revert Method" where I call the parent method's implementation rather than the one that belongs to the object.
    If you want a picture
    Any time I try and make operation2 the VI with the "call parent method" it shows up for about 1/2 sec and then turns into operation.
    So there are only 3 possibilities I can see
    Bug
    Neither situation 2 or 3 are intended to work (see above) and the help is misleading
    I just don't know what I am doing (and I am willing to accept this if someone can explain it to me)
    The downside is that if situation 2 above doesn't work it does make the "call parent node" much less usefull AND it's usage/application just doesn't make sense. You cannot just drop the "call parent node" on a diagram, it only works if you have an existing VI and you perform a replace. If you can only perform situation 1 (see above) then you should just drop the "call parent node" and it picks up the correct VI as there is only 1 option. Basically if situation 2 is not intended to work then the way you apply "call parent method" doesn't make sense.
    Attachements:
    For the really keen I have included 2 zip files
    One is the "Revert Method labVIEW project" which is of course not working properly because it wants to "call parent method" on operation not operation2
    The other zip file is all pictures with a PIN for both "Revert Method" and "Extend Method" so you can see the subtle but important differences and pictrures of the relavant block diagrams including what NI suggested to me as the original fix for this problem but wasn't (they were suggesting I implement Extend Method).
     If you are wondering where I got the names, concepts and PIN diagrams from see:
    Elemental Design Patterns
    By: Jason McColm Smith
    Publisher: Addison-Wesley Professional
    Pub. Date: March 28, 2012
    Print ISBN-10: 0-321-71192-0
    Print ISBN-13: 978-0-321-71192-2
    Web ISBN-10: 0-321-71255-2
    Web ISBN-13: 978-0-321-71255-4
     All the best
    David
    Attachments:
    Call parent node fault.zip ‏356 KB
    Call parent node fault.zip ‏356 KB

    Hi tst,
    Thankyou for your reply. Can you have a look at my comments below on the points you make.
    1) Have to disagree on that one. The help is unfortunately not clear. The part you quote in your reply only indicates that the VI you are applying "Call Parent Node" to must be dynamic dispatch. There is nowhere in the help it actually states that the call parent node applies to the VI of the block diagram it is placed into. Basically case 2 in my example fulfills all that the help file requires of it. The dynamic dispatch VI's operation are part of a class that inherits from a given ancestor. Operation 2 for Reverted behaviour is a child VI that is dynamic dispatch and has the same name as the ancestor VI (operation2). The help is missing one important piece of information and should be corrected.
    2) True it does work this way. I was trying to build case 2 and had not yet built my ancestor DD for operation so the function dropped but wasn't associated with any VI. I was able to do this via a replace (obviously once the ancestor Vi was built) so this one is just bad operator
    3) Keep in mind this is an example not my end goal. I have a child implementation because this is a case where I am trying to do a "reverse override" if you like.
    3a) The point of the example is to override an objects method (operation2) with it's parent's method NOT it's own. The reason there is a child implementation with specific code is to prove that the parent method is called not the one that relates to the object (child's VI). If I start having to put case structures into the child VI I make the child VI have to determine which code to execute. The point of Revert method is to take this function out of the method that is doing the work. (Single Use Principal and encapsulation)
    3b) The VI I am calling is a Dynamic Dispatch VI. That means if I drop the superclass's VI onto the child's block diagram it will become the child's implementation. Basically I can't use Dynamic Dispatch in this case at all. It would have to be static. That then means I have to put in additional logic unless there is some way to force a VI to use a particular version of a DD VI (which I can't seem to find).
    Additional Background
    One of the uses for "Revert Method" is in versioning.
    I have a parent Version1 implementation of something and a child Version2. The child uses Version2 BUT if it fails the error trapping performs a call to Version1.
    LabVIEW has the possibility of handling the scenario but only if both Case 1 and Case 2 work. It would actually be more useful if all 3 cases worked.
    The advantage of the call parent method moving one up the tree means I don't have the track what my current object is and choose from a possible list, if, for example the hierarchy is maybe 5 levels deep. (so V4 calls V3 with a simple application of "call parent method" rather than doing additional plumbing with case structures that require care and feeding). Basically the sort of thing OOP is meant to help reduce. Anything that doesn't allow case 2 or 3 means you have to work around the limitation from a software design perspective.
    If at the end of the day Case 2 and case 3 don't and won't ever work then the help file entry needs to be fixed.
    All the best
    David

  • Attributecollection feature doesn't work properly in cfinput tag.

    Attributecollection feature doesn't work properly in cfinput
    tag.
    Id specified is not used but name property instead.
    Steps to reproduce bug:
    1. Use code:
    <cfform>
    <cfset st = StructNew()>
    <cfset st.name = "ab">
    <cfset st.id = "a_b">
    <cfinput attributecollection="#st#" />
    <cfinput name="ac" id="a_c" />
    </cfform>
    Results:
    Output:
    <form name="test" id="test" action="/test/form.cfm"
    method="post" onsubmit="return _CF_checktest(this)">
    <input name="ab" id="ab" type="text" />
    <input name="ac" type="text" id="a_c" />
    </form>
    Expected results:
    <form name="test" id="test" action="/test/form.cfm"
    method="post" onsubmit="return _CF_checktest(this)">
    <input name="ab" id="a_b" type="text" />
    <input name="ac" type="text" id="a_c" />
    </form>
    Is this a bug?

    Thanks for bringing this issue to light.
    We are looking into it.

  • I cannot figure out how to make the text larger on an incoming email.  The finger method doesn't work and I cannot find any toolbar with which to do it.  I could find nothing in settings also.  Plese help and thank you.

    I cannot figure out how to make the text larger in a received email.  The finger method doesn't work and I can find no tool bar as I can for composing emails.  I can find nothing in settings.  Please help and thank you in advance.

    Hi there,
    Download a piece of software called TinkerTool - that might just solve your problem. I have used it myself to change the system fonts on my iMac. It is software and not an app.
    Good wishes,
    John.

  • My palm m105's touch screen doesn't work properly after a sync.

    I dug out my old m105, put new batteries in and start it. On first launch it auto runs the alignment tool, and after touching all the points it goes to the main screen and works fine. No problem till here.
    Now, I plug it into my old computer which still has the palm software with my apps, and I run the sync operation (from the palm device sync manager, cause I lost my cradle and I'm connected via the serial cable), and it syncs fine BUT, here comes the problem, when it finishes the sync (successfully) the touch screen is all misaligned. I can't go back to the home screen or do anything useful.
    My palm m105's touch screen doesn't work properly after a sync.
    I dug out my old m105, put new batteries in and start it. On first launch it auto runs the alignment tool, and after touching all the points it goes to the main screen and works fine. No problem till here.
    Now, I plug it into my old computer which still has the palm software with my apps, and I run the sync operation (from the palm device sync manager, cause I lost my cradle and I'm connected via the serial cable), and it syncs fine BUT, here comes the problem, when it finishes the sync (successfully) the touch screen is all misaligned. I can't go back to the home screen or do anything useful.
    Thanks in advance!
    Post relates to: Palm m105
    Post relates to: Palm m105

        Maldoman578,
    Let's help solve this mystery together! Is your screen freezing after every reboot? Is there any physical/liquid damage on the device? When did this issue begin? Did you notice this after a recent update or application download?
    EfrainM_VZW
    Follow us on Twitter @VZWSupport

  • My Safari doesn't work properly after installing Lion.  Don't like it, how can I uninstall? (Cloud not worth it)?

    I upgraded ti Lion 10.7.2 for icloud but it's causing other problems with my mac.  My Safari doesn't work properly anymore.  Wishing I didn't upgrade, anyone know how to fix this or do i just have to uninstall?  Thanks,

    Wipe the drive clean and install Snow Leopard from your install disk.
    Might be less work fixing Safari. Try Resetting Safari.

  • I have an iphone 3GS and I have upgraded it to iOS 6. Since then it doesn't work properly. Every now and then it has been restarting by itself and requiring restore. When I connect it to itunes it restarts again and again. Is there any solution?

    I have an iphone 3GS and I have upgraded it to iOS 6. Since then it doesn't work properly.
    Every now and then it has been restarting by itself and requiring restore. When I connect it to itunes it restarts again and again without letting me take any action. Is there any solution?

    Hey, There are afew things you can try.
    - Simply turn your phone off and back on again
    - Hold down your home button and your lock button and let goes as soon as the screen goes black (Phone will power down) - Then turn on your phone and hey presto!
    - Back up your iPhone to your PC, then restore it..
    this ones last cause I think you may have tried it already..
    - Close all open applications
    Hope this helps!
       Kieran.

  • HT1923 The sync function on my iPod Touch 3rd generation doesn't work properly.  My OS is up to date, but some of my podcasts won't transfer onto the iPod, and it won't delete ones I've already listened to.

    The sync function on my 3rd gen iPod Touch doesn't work properly.  It won't sync all the podcasts I've downloaded, and it won't delete ones I've listened to and deleted on iTunes.

    Close your iTunes,
    Go to command Prompt -
    (Win 7/Vista) - START/ALL PROGRAMS/ACCESSORIES, right mouse click "Command Prompt", choose "Run as Administrator".
    (Win XP SP2 &amp; above) - START/ALL PROGRAMS/ACCESSORIES/Command Prompt
    In the "Command Prompt" screen, type in
    netsh winsock reset
    Hit "ENTER" key
    Restart your computer.
    If you do get a prompt after restart windows to remap LSP, just click NO.
    Now launch your iTunes and see if it is working now.
    If you are still having these type of problems after trying the winsock reset, refer to this article to identify which software in your system is inserting LSP:
    iTunes 10.5 for Windows: May see performance issues and blank iTunes Store
    http://support.apple.com/kb/TS4123?viewlocale=en_US

  • What can I do if my CD or DVD drive doesn't work properly in Windows 8?

    QuestionWhat can I do when if my laptop CD or DVD drive doesn't work properly in Windows 8?
    AnswerNote: For help with this issue in Windows 7, please see this article.
    To get your CD or DVD drive working correctly, try these suggestions in the order listed.
    Reinstall the Driver
    Hold the Windows key and press the 'x' key to open a menu in the lower-left. In this menu, select "Device Manager." Expand "DVD/CD-ROM drives." Right-click the entry for the CD/DVD drive nested under "DVD/CD-ROM drives," then select "Uninstall." Finally, restart the computer. The computer will reinstall the drivers for the drive.
    Power Cycle
    Even when your laptop is off and unplugged, residual power can still be held in some components. While this is normal, clearing it can help with some hardware problems. Perform these steps to complete what’s called a power cycle.
    Ensure the laptop is turned off.
    Unplug the laptop's AC power cable.
    Unplug all wires and peripherals. This includes CDs, DVDs, USB sticks, mice, printers, and any other accessories.
    Remove the battery (if the model has a removable battery). If the model does not have a removable battery, check your user's guide to determine if you have a pinhole reset on the bottom. If you do, press this.
    Hold down the power button for thirty seconds.
    Reattach the battery if removed.
    Connect the AC adaptor to the power socket that was confirmed to be working in the first step.
    Connect the other end of the AC adaptor to your computer.
    Start the computer and test the drive
    Microsoft Fix-it
    Your computer may exhibit one or more of the following symptoms:
    Your CD or DVD drive no longer appears in Windows
    Your CD or DVD drive does not read or write and is shown as disabled
    The media in your CD or DVD drive cannot be read
    The media cannot be written to a CD or DVD inserted into the drive
    You receive an error message about your CD or DVD drive
    If any of these symptoms apply to your computer, use Microsoft Fix-it troubleshooter available here.
    System Restore
    Try using System Restore to restore to the most restore point from before the problem arose.
    How To: Understanding System Restore, Refresh, Reset, and, Recovery options in Windows 8 + Video
    System Recovery
    If the System Restore doesn't solve the issue, you could try a System Reset. Resetting your laptop to its original, out-of-the-box state is a great way to eliminate software as a possible cause of the problem. Note that doing a system reset will return the laptop to its default conditions, completely wiping your data. Information on how to perform a system recovery can be found in your user's guide.
    For more information on performing a recovery, see the following article:
    How To: Understanding System Restore, Refresh, Reset, and, Recovery options in Windows 8 + Video
    Contact Customer Support
    If the drive doesn't work after performing a recovery, it may be due to hardware failure. Please call customer support or seek servicing.

    See this Microsoft article - http://support.microsoft.com/kb/314060/en-us  For ways to fix manually
    and/or use the proper microsoft fixit 8.1 and 8 or the other one for Windows 7, Vista, and XP listed below.
    (these are from the Microsoft article)
    Resolution 2: Use the CD/DVD Fix it troubleshooter
    To automatically fix common issues with CD or DVD drives, click Run now, and then follow the on-screen instructions. Windows 8.1 and Windows 8   
    The Automatically diagnose and fix common problems with CD or DVD drives troubleshooter may automatically fix the problem described in this article.
                                    This troubleshooter fixes many problems. learn more
    Run now
    Windows 7, Windows Vista and Windows XP
    The Automatically diagnose and fix common problems with CD or DVD drives troubleshooter may automatically fix the problem described in this article.
                                    This troubleshooter fixes many problems. learn more
    Run now
    If your problem is not solved, try the next
    S70-ABT2N22 Windows 7 Pro & 8.1Pro, C55-A5180 Windows 8.1****Click on White “Kudos” STAR to say thanks!****

  • Satellite Pro L20 doesn't work properly with USB Fast Track audio i.f.

    Hello!
    I have used my Fast Track USB on new Toshiba Satellite L40 and I never had problems with it. I could set low latency and I did few songs with it.
    Yesterday I bought another notebook, thinking of home recording studio. It's used Toshiba Satellite Pro L20. It doesn't work properly with my interface. When I listen music on Winamp or do anything on Fruity Loops I hear loud clicks, pops, noises. They introduce samples, or they appear during playback or after a sample is stopped.
    I noticed, drivers for Satellite Pro L20 are a problem. Its not supported by Toshiba anymore?! The only drivers for chipset are very old and you can download em only from Toshiba website. The chipset is ATI Xpress 200M. Its drivers are with graphic card. Recently I noticed you can download "ATI Catalyst Legacy Display Driver for Windows XP - Motherboard/IGP Drivers 9.11" and CRACK IT to make it possible to install on mobile unit such as L20. Yep its funny but its impossible to do otherwise!
    things I have tried and they still not help:
    # drivers replacement, original were released in 2004. I installed recent version.
    # driver settings, low latency, high latency
    # asio and different settings
    # pluging the interface to another usb socket.
    # trying what happens when I use battery and when I use adapter
    # updated bios
    # turned off onboard units such as wifi card, sound card
    # checked IRQ list
    pops still appear.
    my config:
    Toshiba Satellite Pro L20
    Win XP Home SP3
    Celeron M 1,5GHz
    896Mb ram
    M-Audio Fast Track USB, drivers: 6.0.2
    Kind regards

    Thanks for answer. I still have L40 but I try to run my homerecording on L20. The L40 is now used by whole my family. It's possible to swap them but there's a problem - L20 has Norway keyboard and I'm the only person at home who doesn't often look down while typing. In Poland, we use standard ms keyboard. I'd buy special stickers, it's about only to make special chars get back to their places.
    I installed Windows on this computer end set it to best performance possible.
    Since I created this thread, guys from M-Audio support tried to solve my problem - nothing helped. I think potential solutions are exhausted.
    Message was edited by: lidia.pochron

  • Hp laserjet P1006 doesn't work properly

    my Hp laserjet P1006 doesn't work properly on my windows 7(64-bit) and whenever I try to print a page the orange light just flashes and then the green light flashes and then it doesn't print at all.I've tryed everyway including reinstalling the software or even turning it off and then turning it on.Pleaseeeee.............help!!!!!!!!!!!

    Hello
    I understand you are no longer able to print with the P1006 on Win8.1.
    Did you uninstall the P1006 first?
    If not uninstall and reinstall the printer software again.
    Both drivers are the same if you look at the version on the website and should still work with the Win8.1.
    If you need more assistance just let me know.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Lightroom 5: start button in the presentation module doesn't work properly

    Hi. I purchased LR 5 last week but the start button in the presentation mudule doesn't work properly. I get a black screen and nothing happens. I have to press the esc button several times to return to LR.Can you help me please
    Regards Eugene

    start button in the presentation mudule
    Can you clarify?
    There is no start button nor a presentation module.
    Do you mean the Play button in the Slideshow module?
    Which operating system?

  • Central Autoreaction Method doesn't work for NW 7.10 in SolMan 7.01

    Hello!
    The central autoreaction method doesn't work for the satellite system
    NW 7.10. For systems with kernel releases 4.6D, 640, 700 this method
    works fine and e-mail alerts are coming.
    The configuration steps I've checked:
    1. Configured SCOT. The mail_send job executes every 5 minutes.
    2. Background dispatching job is released: SAP_CCMS_MONI_BATCH_DP (In
    central CEN/000/DDIC and satellite system SAT/000/DDIC)
    3. Central dispatching job is released: SAP_CCMS_CENSYS_DISPATCHER
    (Only in central system CEN/000/DDIC)
    4. The sapccm4x-agent registered as web service within CEN using
    Create Remote Monitoring for NW 7.10:
    Connection test to SAPCCM4X.<satellite_host>.00 was performed successfully
    5. Created a new autoreaction method by copying method
    CCMS_OnAlert_Email_V2 to the own Z_CCMS_Email_Alert_CEN:
    Function Module - SALO_EMAIL_IN_CASE_OF_ALERT_V2
    Execute Method on Any Server and Only in Central System, triggered by
    CCMS agents
    SENDER (EMAIL_USER) exists in CEN/000 , RECEPIENT - <distr list
    SAP_BASIS in CEN/000>, RECIPIENT-TYPEID - C
    6. Got MTE Classes from NW 7.10 satellite system and assigned this method
    Z_CCMS_Email_Alert_CEN to an MTE-class CCMS_ORAucPSAPSR3 for NW 7.10
    satellite system. The alert is red right now.
    7. The mail_send job doesn't send anything, in SCOT there are no
    sending orders.
    8. Autoreaction status on this alert in CEN in RZ20 - Sent to CEN.
    CEN_CHECKED.
    9. The alert status in RZ20 in CEN - ACTION_REQUIRED. If I execute it
    in manual the alert status changes to ACTIVE, but no email and no
    messages in sending orders in SCOT.
    Please help me to solve this issue.
    Thank you!

    Hi,
    Since you are using RECIPIENT-TYPEID =C i.e. General distribution list, pls ensure to have shared type of list created in SBWP.
    Also pls verify your SCOT configutaion , if apropriate address area i.e. *@abc.com
    Also one point to note that even if you trigger auto reaction method manually via RZ20 , pls check if alert is listed in SOST.
    if yes , that means there is problem in either SCOT configuration or distribution list.
    If alert is not appearing in SOST , that means you need to check auto reaction method parameters;
    Z_CCMS_OnAlert_Email_V2 , here check release section if Auto reaction execution method is checked.
    Regards,
    Rupali

  • The cable doesn't work properly when connected as data cable.

    Hi,
    I have recently encountered problem of the cable. The thing is that if i use it just for charging with the plug, it works fine. But when i wanna use it with computer (i.e., accessing itunes, etc) or with my car, it doesn't work properly, it keeps switching between charging and discharging very fast. I will appreciate your quick support!
    Regards,
    Farhan

    Just for all the people to know, I found out the solution. You have to mark the correct side of the charging cable which connects at inlet of the phone. Because this point acts as a chip when used as data cable or auxiliary use (car,etc). That's why it charges with the plug on any side. I don't know what's the frequency of it happening to iphone 5s users, because I bought it recently (iOS 7.1.1) Hope it helps to others in future.

  • Key Command for "Go to Next Marker" doesn't work properly

    Hi there!
    While using Logic Pro 9.1.8 with Mountain Lion (10.8.2), it seems that the Key Command for "Go to Next/Previous Marker" doesn't work properly.
    The only effect is, that a grey rectangle moves in the top of the Arrange Area while ignoring the Markers itself.
    Any suggestions to solve it or is it me that is misbehaving?
    Cheers, GJ

    Hi
    The commands work correctly here on the same OS etc: Cycle Locators jump to the next/prev marker and the Playhead jumps to the Start of the Marker.
    Default KC are Control Command +Arrow Left/right
    Step 1: check you are using the correct key command :-)
    CCT

Maybe you are looking for

  • How to display the week of the year in a report

    Hi, I am doing a report, that needs to break down the information, according to month and then week. The week of the year isn't stored anywhere in the database, so i guess it would have to be calculated. How would i go about doing this in report?

  • How to embed multiple images easily

    Hello! I have been tying to figure out how I could easily embed multiple linked images easily. I have some 1000 .svg  images which have about 1-7 .tif images linked in to them. I now need to get those links embedded and becouse of the amount of image

  • Transaction IDX1: Port SAPQA1, client 500, RFC destination  contain error

    Hi experts I am configuring XI for MM-SUS scenario, when I try to send Idocs from R/3 to XI I have this message: Transaction IDX1: Port SAPQA1, client 500, RFC destination  contain error In XI transaction IDX1 I have maintened a port (MM_QA1) and RFC

  • Methods of a especific class

    How can I know or list all methods of a class?

  • No domain accessible to user logged in from BPEL Console

    I am unable to log in BPEL Console installed through SOA Suite 10.1.3.1.0. OC4Jadmin user integrated with OID. Unable to logged as oc4jadmin user to BPEL console or BPEL admin.