Warning msg for finally

I got a warning message for a finally statement, attached at the end.
Could not figure out why. The code is simple and followed.
Please help.
Thanks!!!
=======================================
import java.util.*;
import java.io.*;
public class TestFinally
     public TestFinally()
          output_TestFinally();
     public String output_TestFinally()
          String fn = "TestFinally.txt";
          try {
               PrintWriter outD = new PrintWriter( new FileWriter( fn ) );               
               String title = "TestFinally Report";               
               outD.println( title );          
               Date today = new Date();     
               outD.println( today.toString() + "\n" );          
               // Write header
               String s1 = "TEST1 ";
               String s2 = "TEST2 ";
               String s3 = "TEST3 ";
               String s4 = "TEST4 ";     
               outD.println( s1 + s2 + s3 + s4 );
               outD.println( "=========================================" );
               s1 = "abc ";
               s2 = "ABC ";          
               s3 = "xyz ";
               s4 = "XYZ ";
               outD.println( s1 + s2 + s3 + s4 );     
               outD.close();
          catch ( IOException exc )
               System.out.println( exc );
          finally
               System.out.println( "finally: Data saved in file " + fn );
               return fn;
     }     // output_TestFinally
public static void main(String[] args) {
          TestFinally tf = new TestFinally();          
} // class TestFinally
=======================================
C:\anna\bs01>javac TestFinally.java
TestFinally.java:48: warning: finally clause cannot complete normally
^
1 warning     

Though I do not see how this return statement could be
avoid. How about just moving it outside the finally block? Or not having a finally block? I have to agree with ChuckBing that the finally block looks rather strange in your example, and unless your code is supposed to do something different to what it looks like its doing, then it appears to be a bug in your code - you're reporting successfully saving a file even if the saving fails.
If I comment out the return statement in the
finally block, then I got an ERROR! Unless I change
the returned value from a String to void.Yes, you must return something, but there's no need for the return statement to be in a finally block.
I would still consider this is a compiler bug,You've done something unusual that more often than not would indicate a bug in your program, and the compiler is warning you about that - you are free to ignore the warning, though personally I wouldn't in this case.

Similar Messages

  • Sales order- Warning msg Static credit check

    Hi, SAP Guru,
    When I create a order & saving it ...a POP UP comes with warning msg the static credit limit exceeds..... Can any one please let me know the how I can remove the warning POP UP . As client do not want any pop up should come while saving the order.
    Please help.
    Thx & regards

    Hi,
    If you remove the entry from the field "Check credit" in "OVAK" T.Code,the credit check will not happen for this order type.Which we don't want.
    We need that the credit check should happen but the pop-up is to be removed.right?
    For this goto the T.Code "OVA8".
    Select your valid entry.Details.
    Remove the value as "blank" for the field "Reaction".Press F4 for more options.
    Beside this there is one more field "status/block" which is ticked means the order will be blocked for further transactions.And also status will be updated accordingly.
    These blocked order have to be released either by using the T.Code "VKM3/VKM1".
    Regards,
    Krishna.

  • Following Media Files Are Not Optimized For Final Cut Pro

    I'm sure you've seen this before and I've tried to search for a thread on it here and fell asleep, so sorry if this is a repeat.
    I have edited projects in Premiere Pro (on my PC) and I have tried to transfer them in FCP. It worked with the exception of two things:
    1. the error message, "Following Media Files Are Not Optimized For Final Cut Pro"
    2. the quality *****! watching it on the playback in FCP it looks great, but then when I burn it to Disc it's pixelated in spots and generally has a lower quality picture.
    I know that it's Standard Def. and can't expect the best, but I've done it before (once or twice) and it didn't seem this bad.
    Can someone suggest anything to help the quality? Should I run my AVIs through MPEG Steamclip to make it a QT file and if so what is the best format in that since there are many to choose from and most I'm not familiar with?
    Thank you,
    Crayton

    I did compress them to DV NTSC then burned it to DVD and the result was no bueno.
    I thought what I would do is try compressing them again before I send them on over to DVDSPRO. Here is a simplified break down of the situation:
    - I have edited the raw footage in Premiere Pro on my PC. They were recorded and captured as SD.
    - I rendered them in Premiere, then transfered the rendered AVI file to FCP.
    - When went to place the files in FCP, I received the warning message; "Following Media Files Are Not Optimized For Final Cut Pro" but I went forward anyways and it allowed me to do so.
    - Originally I went ahead and compressed them from FCP to QT Movie as a DV NTSC, which ended up poorly.
    - Therefore my question is, should I compress them using another file type (other then DV NTSC)? Which leads me to another program that I have called MPEG Streamclip, which offers tons of file types of which I am unfamiliar with most. I want the best quality of course but don't know what file type is the highest going from AVI to a format that can be accepted by FCP and ultimately DVDSPRO. Keeping in mind that I only have FCP5 and do not have Prores.
    Did that make sense?
    Thank you again,
    Crayton

  • Ho do we make msg. CK666 become warning msg when we do costing run?

    Dear Experts,
    The sys. activate transfer price for preserve use.
    When we do costing run for profit center valuation, the following error msg ocurred.
    CK666 Material 227BO0001/plant 1030: Transfer price could not be found.
    Diagnosis
    When switching profit center 0000008000->0000005000 (from the material component to the costing object), a transfer price could not be determined for transfer price variant 0 in respect of material 227BO0001 in plant 1030.
    System Response
    If you carry out costing for a profit center valuation, material 227BO0001 goes into the cost estimate without a value.
    If you create a cost estimate for group valuation, profit from material 227BO0001 is not transferred into the cost component split.
    Procedure
    Check the settings for transfer price variant 0.
    In OKEQ, the variant for TP is blank.
    Ho do we make msg. CK666 become warning msg when we do costing run? and let costing result can be release, or there's another way?
    Thanks in advance.

    There is alternative solution.
    Try using TCode SE91.
    Enter the class - CK and Enter the message number 666.
    Select that line message line.
    Go to Utilities, Click on "Where-Used-list" or press "CtrlShiftF3" from keyboard.
    Select programs and deselect all others.
    Identify your program and double click against that under short description.
    There you can change the letter from "E" to "W" as your requirement.
    NOTE: take assistance of ABAPer of this, Do enquire about the implication of the same in sandbox before doing anything on any other client.
    Thanks & Regards
    JP

  • Where warning msg & error  msg are maintained in SPRO

    Dear All,
                              pl give the menu path to know that Where warning msg & error  msg are maintained in SPRO.
    regards
    sap11

    Hi,
    In case of Purchasing, the path to maintain warning & error messages is:
    Material Management->Purchasing->Environment Data->Define Attributes of System Messages
    In case of Inventory Management,
    Material Management->Inventory Management and Physical Inventory->Define Attributes of System Messages
    In case of External Service Management,
    Material Management->External Services Management->Define Attributes of System Messages
    In case of Logistics Invoice verification,
    Material Management->Invoice Verification->Logistics Invoice Verification->Define Attributes of System Messages
    In case of Material Master,
    Logistics - General->Material Master->Basic Settings->Define Attributes of System Messages
    Then, for eash message no., Maintain whether the message is to be shown as warning or error or information message.
    Reward if useful.
    Thanks & Regards,
    Komal

  • Supress warning msg during RRI

    We have a query that jumps to R/3 tcode. when we try to jump, for some document no's the jump goes smooth .. for some other doc's, it throws a warning msg saying that the infosource is not linked to the source system. this happnes with some of the docs only. But the jump does go thru to R/3.
    I want to supress the warning msg during the jump. I tried in RSRT, but it doesnt help. the error code i get is RSBBS206. where do i have to exactly supress this warning?
    Any pointers or clues would be appreciated.
    thanks,
    Voodi

    Hi Vodi,
    In RSBBS, go to the sender query in change mode. There should be a tab in the middle column where you have to give your infosource name..
    For. eg If you want to jump from Cost centre report (BW) to Masterdata transaction in R/3, you ust assign this particular infosource in RSBBS settings..
    Hope it helps.

  • Warning msg "Signal is not contiguous"

    Hi,
    I used NI FGen to generate a sine wave to pump into a circuit (under test) and use NI Hi-speed Digitizer to capture the output of the circuit.
    The captured signal goes through a low pass filter.  This warning message appear at the filter when it is Run continuously.
    'Run Once' does not have problem.
    Has this got to do with synchronizing  the 2 modules in the PXI system or is it a matter of wrong sample rates.
    I have searched Help and it mentioned using TClk to synchronize the 2 modules. 
    How do you use TClk in Signal Express?
    How to solve this warning msg?
    Someone please help.....thanks.
    Regards,
    SeeMist

    Hello,
    I am glad to hear that you resolved the warning issue.  In regard to the other project, are you just interesting in generating the signal once?  What is the lay out of the steps in the project for both the FGEN and SCOPE?  Is the FGEN set to finite or continous generation mode?  How is the SCOPE step setup in the Execution Control tab? 
    SeeMist wrote:
    Currently (another project) I use the NI-FEN step to generate a signal from a .hws file (a 25khz burst signal).
    It works fine by itself and the "Scope Soft Front Panel" (SFP) is always good at capturing the generated signal.
    (The output of generator is externally connected to the input of the Scope).
    However, after I closed the SFP and inserted NI-Scope Acquire step in Signal Express, I was not always successful in capturing the signal generated.  Sometimes okay, sometimes not.
    The error occurred at the FGen step : "Finite Generation timeout"
    Do I have to initialise or there is a problem with my setting?  Trigger or synchronization problem?
    The setting of the FGen remains the same in both tests.
    The NI-Scope: Trigger = Edge ; Sample rate =100MS/s; Record Length =5000
    Samantha
    National Instruments
    Applications Engineer

  • Warning msg at the time of PR creation

    When I am creating the PR a Warning msg is being displayed as:-
    "Base unit of measure KG adopted from  material master record"
    Could anybody suggest me, why this msg is comming.
    and if I ignore it and go ahead with pressing enter, Is there any future impact by the same.

    Hi There
    When you create the PR, if you have not provide the unit of entry, System will read the master data and bring the base unit of measure,, and provide the warning message,, You can acknowledge that message and proceed further it is not an issue,,
    For more details ref the below link, it provides the details of diff units and usages,,
    http://help.sap.com/saphelp_46c/helpdata/en/a5/63310c43a211d189410000e829fbbd/content.htm
    Thanks
    Senthil

  • Warning msg. when trying to activate MP

    guys,
    I am trying to activate MP, and i am getting following Waring msg. ! what does it mean ? and how serious it it ?
    "The InfoProvider properties for ZCIA_M05 are not the same as the system default
    Message no. BRAIN376"
    thanks

    yes i did assign all the infoobject. i could activate it too, but before i could activate it, i got a warning msg.
    still, i ignore those and activate it.
    but i wasnt sure i serious it. Also i checked MP's properties and its all the same( like other MPs).
    But, i thought let me get some information from Experts about that worning !!!
    let me know if you have any idea about it.
    Also, When i was trying to Activate MP again, it was asking like " its already active, do u still want to active" and if i say yes, it
    gives me an error msg. " MP is not yet Locked"
    Do i need to Lock it ????? what is that ??
    thanks

  • WARNING MSG . DURING J1IEX

    Dear All ,
                             user had created a Stock transfer P.o , in this P.o there in no tab of  invoice , now it's Goods rcvd  is done here all excise details are maintained , here exscise base value is visible for all line items . now user had to post J1IEX so as he clicks on simulate a warning msg comes that is -" PLEASE CHECK EXCISE BASE FOR ITEM IS ZERO ! ".
    Pl help what to do .
    sap11

    Thanks guys, I figured it out.
    Message was edited by:
            voodi

  • Warning Msg during RRI

    When I'm trying to jump from a source report to target query via RRI, i get a warning msg (thought the query runs). I want to supress the msg.
    I tried supressing the msg in source query, target query and both of them together. Still the msg is being displayed. Where do I need to supress the msg if its during RRI process?
    The variable and the hierarchies being used for cost center is the same in both the queries. Any thoughts?
    Error msg:
    Invalid filter on 0COSTCENTER: Filter changed
        Message no. BRAIN502
    Diagnosis
        You tried to filter on a characteristic with active presentation
        hierarchy by a node of another hierarchy.
        This can only be done by switching the hierarhcy or for example by using
        the report/report interface.
    System Response
        The filter is not evaluated for the characteristic, but removed instead.
    Procedure
    Procedure for System Administration

    Thanks guys, I figured it out.
    Message was edited by:
            voodi

  • Report to Report Interface warning msg

    Hi,
    I am getting "Incompatible for target selection for fiscal year" warning msg in SAP BEX.I am using same variable in my source and target system to select fiscal year.
    How to supress this warning message?
    thanks
    venkii

    If your report is working fine as per expectation in RRI, and your requirement is to supress the warning message, you can set the global setting of the workbook to supress any warning messages.
    Question:
    Do you have any customer exit on this variable?
    - Danny

  • Transport datasource 0FI_AP_4 on R3 gets warning msg

    RSA6 on R3 and select the datasource 0FI_AP_4, click the truck picture icon which is "Transport datasource", get a warning msg:
    "Warnings have occurred (see log)", click the question mark for log, but still get the same short msg.  What could be the reason? 
    The reason why we are doing this is that we found a new field added to the structure and correspondingly the datasource fails to show up in the target system after transported.
    Thanks

    Hi,
    If your ES in DEV has more filed than ES of QA/PROD , then yiou need to release and import the transport request of that change to ES.
    Without tranporting the change to ES first ,you are trying to transport the request of DS(which internally depends upon the ES) ,so you are getting warning.
    With rgds,
    Anil Kumar Sharma .P

  • IMac to TV for Final Cut Pro

    I'm a newbie so forgive my ignorance.
    I have a mid 2010 iMac and I would like to hook it to my HD insignia TV to view playback for Final Cut content.
    I just need to know which method is the best (VGA, Mini DV, Hdmi, etc)
    What cords &  adapters do I need?
    I'm running OS X mountain Lion with Final Cut Pro X.
    Insignia 32inch HD TV model # NS-32LB451A11 (rev A)
    Thanks!

    Oh. I also have a Cakewalk US-25 EX 24bit 96 kHz sound card too.

  • Open Advances Warning msg in F-43

    Hi friends,
    I am posting an invoice through F-43. For the specified vendor, we do have some open advances. When I enter the Vendor no on the first screen and press Enter to move to the next screen, the system gives a warning message that "Net due date is in the past". After this message, when I enter the amount, and press Enter again, I do not get the message that "Down Payments exist for this message".
    Any idea why the system does not display the second warning mesage for Open Advances. It seems that the system bypasses the first message for Open advances and displays the second message only.
    If anybody has come across this situation, please let me know your feedback on the same.
    Thanks in advance,
    Hrishi

    If the net due date of the invoice is before the DUE ON date entered in the downpayment, system should not give you the warning you are looking for. The very purpose of this warning is to let the user know that you have entered the downpayment before and in your case you are making due the invoice posted later even before the the downpayment.
    The very purpose of using downpayment is to capture the payment as receivable till the time the actual expense occurs later, and at that time the status of downpayment is changed to clearing payables. But you are posting your invoice with a due date even before the due on date of downpayment, so as a procedure you should have posted this payment as regular payment (F-53 or F-58) instead of downpayment because you actual expense (and hence the invoice) happens before the payment based on due date.
    In your case you will notice if you post the same invoice with a due date later then the downpayment then you will get the message.
    Thanks
    Ron

Maybe you are looking for