Please check the Code snippet and detail the difference

Please go through the two code snippets given below...
Can some one please let me know if using generics is a better way to denote the signature and if yes, why is it so?
Thank you
Two classes:
class SimpleStr {
     String name = "SimpleStr";
     public SimpleStr(String name) {
          this.name = name;
     public String getName() {
          return this.name;
     public String toString() {
          return getName();
class MySimpleStr extends SimpleStr {
     String name = "MySimpleStr";
     public MySimpleStr(String name) {
          super(name);
          this.name = name;
     public String getName() {
          return this.name;
     public String toString() {
          return getName();
Code Snippet 1:
class AnotherSimpleStr {
     public <S extends SimpleStr>S getInfo() {
          return (S)new MySimpleStr("val3");
Code Snippet 2:
class AnotherSimpleStr {
     public SimpleStr getInfo() {
          return new MySimpleStr("val3");
}

Also, please see the code below, the getInfo() method is not taking care of Type safety right??!!!!
class AnotherSimpleStr {
     public <S extends SimpleStr>S getInfo() {
          return (S)new Object();
     public <S extends SimpleStr>S getInfoAgain(Class<S> cls) {
          return (S)new MySimpleStr("Val");
}

Similar Messages

  • Please check the below Cursor Procedure and correct that code Please

    Hai Every One.
    Please check the below code I have two issues in that code
    1. Invalid cursor
    2. Record must be enter
    Please correct this code and send me pls its urgent.I cont understand where i done mistake
    PROCEDURE fetch_detail_PROC IS
    cursor c1 is select * from quota_mast where quota_mast.divn=:quota_mast.divn and quota_mast.QUOT_tyPE=:quota_mast.QUOT_tyPE and quota_mast.INQNO=:quota_mast.INQNO;
    cursor c6 is select * from quota_det
    where quota_det.divn=:quota_mast.divn AND quota_det.QUOT_TYPE=:quota_mast.QUOT_tyPE and quota_det.enq_num=:quota_mast.INQNO
    ORDER BY quota_det.quot_no;
    --cursor c5 is select * from acc_mst where cdp=:quota_mast.ccdp and divn=:quota_mast.divn;
    --vn acc_mst%rowtype;
    i quota_mast%rowtype;
    detail1 quota_det%rowtype;
    BEGIN
         GO_BLOCK('quota_mast');
    for i in c1 LOOP
              :quota_mast.INQNO:=i.INQNO;
                        :quota_mast.DIVN:=i.DIVN;
                   :quota_mast.QUOT_NO:=i.QUOT_NO;
                        :quota_mast.quot_type:=i.quot_type;
                        :quota_mast.CCDP:=i.CCDP;
                        select nm into :QUOTA_MAST.PARTY_NAME from acc_mst where acc_mst.DIVN=:QUOTA_MAST.DIVN AND acc_mst.cdp=:ccdp;
                        :quota_mast.pak_for:=i.pack_for_PER;
                        :quota_mast.exc_duty:=i.exc_duty_PER;
                        :quota_mast.vat:=i.vat_PER;
                        :quota_mast.cst:=i.cst_PER;
                        :quota_mast.wct:=i.wct_PER;
                        :quota_mast.ser_tax:=i.ser_tax_PER;
                        :quota_mast.insu:=i.insu_PER;
                        :quota_mast.tot_tax:=i.tot_tax;
                        :quota_mast.tot_val:=i.tot_val;
                   :quota_mast.value:=i.value;
                                  next_record;
    end loop;
         first_record;
    GO_BLOCK('quota_det');
                   for detail1 in c6
              loop
                        :quota_det.quot_no:=detail1.quot_no;
              :quota_det.ENQ_NUM:=detail1.enq_num;
              :quota_det.item_code:=detail1.item_code;
              SELECT ITNM into :NM FROM itm_MST WHERE DIVN=:quota_mast.DIVN AND iCDP=:ITEM_CODE;
              :quota_det.price:=detail1.price;
              :quota_det.qty:=detail1.qty;
              :quota_det.DISC_PER:=detail1.DISC_PER;
                   next_record;
    END LOOP;
         first_record;
    close c6;
    --close c1;
    exception
    when others then
    message(sqlerrm);
    message(' ');
    END;
    Thank you..

    Oracle Forms is closely tied to the database meaning you can base your data blocks on your tables and Forms will handle fetching the data. I agree with Christian, your tables lend themselves to using a master - detail configuration and if you need to filter your block then you can use the Data Block WHERE Clause property.
    Please correct this code and send me pls its urgent.As to the urgency of your request, the forum is a community of "Volunteers." Enough said.
    Regarding your code, I see a several potential problems.
    First, how are your QUOTA_MAST and QUOTA_DET blocks synchronized? Are you using a block relationship? Are you using a combination of triggers to synchonize the QUOTA_DET block when you user navigates to a different record in the QUOTA_MAST block?
    Second, your Procedure name is "Fetch_Detail_Proc" but you are also fetching Master data as well. What is the purpose of your procedure and where do you call this procedure?
    Third, you're using SELECT * in your cursor queries. You should always explicitly name each column. What happens when your table changes and you need to search your code for a column that was dropped?
    Fourth, your cursor queries are referencing the same data blocks you are fetching data to populate. This gives the impression that you already have data in your block. This doesn't make sense - could you explain what you are trying to accomplish?
    Fifth, with respects to your code, the "Invalid Cursor" error (is this really the error you're getting?) is most likely caused by your explicit call to close the C1 cursor. As Andreas stated, when using a CURSOR FOR LOOP, the cursor is automatically opened, fetched and closed using this construct. There is no need to explicitly close the cursor, in fact - doing so will result in an invalid cursor error.
    As to the "Record must be entered" error, is sounds like you have required items in your block or your QUOTA_MAST block is not synchronized with your QUOTA_DET block, so when you attempt to navigate to a different block or record within your the same block the navigation cursor can't move because you haven't entered data that is required.
    Please tell us what you are attempting to do with this code so we can tell you if you are using the correct method.
    Craig...

  • Why does it say my coupon code is "Invalid coupon code. Please check the coupon code and re-enter."

    When I enter my coupon code to get my serial number it says "Invalid coupon code. Please check the coupon code and re-enter." It is the correct coupon code. And I have just deactivated my lisence on my old computer.

    If you had not deactivated it on the old computer and it is a Windows machine there would have been a chance of getting it using Belarc Advisor
    (http://www.belarc.com/free_download.html).  I do not know if you can still do so.
    You can try contacting Adobe support via chat and see if they can help.
    Serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • TS4268 After the update I am unable to log in to get iMessages. It says "Could not sign in. Please check your network connection and try again". My phone is connected to Wi-fi. What should I do?

    After the update I am unable to log in to get iMessages. It says "Could not sign in. Please check your network connection and try again". My phone is connected to Wi-fi. What should I do?

    Hi andrea110,
    Welcome to the Support Communities!
    The article below may be able to help you with this issue.
    Click on the link to see more details and screenshots.
    The settings are the same for iOS 7:
    iOS 6 and OS X Mountain Lion: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/TS2755?viewlocale=en_US
    Cheers,
    - Judy

  • Please check the code

    I AM TRYING TO REPLICATE THE ADDRESS OF EQUIPMENT FROM ECC TO CRM.
    I AM ABLE TO REPLICATE THE IDENTIFICATION NUMBER.
    WHILE USING THE SAME FUNCTION MODULE FOR ADDRESS, THE ADDRESS IS NOT GETTING REPLICATED.
    PLEASE CHECK THE CODE AND TELL ME WHAT PRE-REQUISITES MUST BE TAKEN INTO CONSIDERATION AND IS THERE ANY MISTAKE FROM ME.
    FULL POINTS WILL BE REWARDED.
    ITS VERY VERY URGENT.
    METHOD IF_EX_CRM_EQUI_LOAD~ENLARGE_COMPONENT_DATA.
    **Data declarations
    DATA:
        ls_equi          type crmt_equi_mess,
        ls_comp          type ibap_dat1,
        ls_comp_det1     TYPE IBAP_COMP3,
        ls_address_data  type ADDR1_DATA,
        ls_object      type comt_product_maintain_api,
        ls_object1     type comt_product,
        lv_object_id   type IB_DEVICEID,
        lv_object_guid type IB_OBJNR_GUID16.
    **Map Sort field from ECC to CRM
    Read table it_equi_dmbdoc-equi into ls_equi index 1.
    lv_object_id  = ls_equi-equnr.
    move is_object to ls_object.
    move ls_object-com_product to ls_object1.
    lv_object_guid = ls_object1-product_guid.
    move is_component to ls_comp.
    ls_comp_det1-deviceid    = lv_object_id.
    ls_comp_det1-object_guid = lv_object_guid.
    ls_comp_det1-EXTOBJTYP   = 'CRM_OBJECT'.
    ls_comp_det1-ibase       = ls_comp-ibase.
    ls_address_data-roomnumber = '1000'.
    ls_address_data-floor = '10'.
    ls_address_data-country = 'US'.
    CALL FUNCTION 'CRM_IBASE_COMP_CHANGE'
      EXPORTING
       i_comp                       = ls_comp
       I_COMP_DET             = ls_comp_det1
       I_ADDRESS_DATA     = ls_address_data
      I_ADDRESS_ADMIN           =
      I_PARTNER                 =
      I_DATE                    =
      I_TIME                    =
    EXCEPTIONS
      DATA_NOT_CONSISTENT       = 1
      IBASE_LOCKED              = 2
      NOT_SUCCESFUL             = 3
      OTHERS                    = 4
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    ENDMETHOD.

    Hi S B,
    May I the procedure for the replication of serialnumber into device ID that is Identification field In Ibase.
    And one more thing need this to be codded in the standard badi or needed an copy of the implementation .
    plz help me as u already have done the requirement.
    u will be twice rewarded.
    Thanking u in advance for the reply.
    Sree.

  • Passing values to subreport in SSRS throwing an error - Data Retrieval failed for the report, please check the log for more details.

    Hi,
    I have the subreport calling from the main report. The subreport is based on MDX query agianst the SSAS cube. some dimensions in cube has values 0 and 1.
    when I try to pass '0' to the sub report as the parameter value, it gives an error "Data Retrieval failed for the report, please check the log for more details".
    Actually I am using table for storing these parameter values. In the main report I am calling this table (dataset) and passing these values to subreport.
    so I have given like [0],[1] and this works fine. when I give only either [0] or [1] then it is throwing an error.
    Could you please advise on this.
    Appreciate all and any help.
    Thanks,
    Divya

    Hi Divya,
    Based on the current description, I understand that there is no issue if you pass two values from main report to subreport, while the issue occurs when passing one value to subreport.
    To narrow down the issue, I want to confirm whether the subreport can run if there is only [0] or [1] in the subreport. If so, it indicates the query statements exist error in the subreport. If it’s not the case, this shows the issue occurs during passing
    values from main report to subreport. To make further analysis, please post the details of query statements of the subreport to the forum.
    Regards,
    Heidi Duan
    Heidi Duan
    TechNet Community Support

  • Help-Task not found - Please check the Task Type, Name and Location are cor

    HI all,
    i have upgraded my owb from version 11gr1 to 11gr2. the installation is complete and all my mappings and objects are imported successfully.
    i was able to execute the mappings using the sql code:
    @/oracle/product/11.2.0/owb/rtp/sql/sqlplus_exec_template.sql
    by logging into sqlplus as the user in whose schema mappings are deployed.
    hOwever, suddenly i am getting the error since sometime back - not sure what might have happened or what might have gone wrong. can someone please help me understand what might be wrong - how to decode this?
    Here is my error:
    @/oracle/product/11.2.0/owb/rtp/sql/sqlplus_exec_template.sql
    Role set.
    Enter value for 1: WSODS
    Call completed.
    Enter value for 2: ODS_SCHEMA
    Enter value for 3: PLSQLMAP
    Enter value for 4: MAPPING_1
    Enter value for 6: ","
    Enter value for 5: ","
    Stage 1: Decoding Parameters
    |  location_name=ODS_SCHEMA
    |  task_type=PLSQLMAP
    |  task_name=MAPPING_1
    Stage 2: Opening Task
    begin
    ERROR at line 1:
    ORA-20001: Task not found - Please check the Task Type, Name and Location are
    correct.
    ORA-06512: at "OWBSYS.WB_RT_API_EXEC", line 759
    ORA-06512: at "OWBSYS.WB_RT_SCRIPT_UTIL", line 910
    ORA-06512: at line 2When i execute this: i get the result as follows:
    SELECT warehouse_object_id, store_id, object_type_id, object_type_name, object_name FROM owb$wb_rt_warehouse_objects
    where object_name = 'MAPPING_1';
    WAREHOUSE_OBJECT_ID     STORE_ID                OBJECT_TYPE_ID          OBJECT_TYPE_NAME                                                 OBJECT_NAME                                                     
    15947                   15325                   769                     PLSQLMap                                                         MAPPING_1                                                       
    1 rows selectedEdited by: Chaitanya on Mar 5, 2012 3:33 AM

    Hi Chaitanya,
    Did you get any resolution for this error? I'm facing the same error while trying to execute OWB mapping through this command.
    Any help would be much appreciated. Thanks.
    Regards,
    Jagari

  • When I try to use FaceTime on my Macbook Air, I try to verify the email I want people to call me with, and it says verified, but soon an message comes up that says "Could not verify the email address. Please check your network connection and try again."

    So our school lets us use Macbook Airs for the school year, and it has facetime on it. I know facetime isn't blocked because like everyone else is using it. So I decide to give it a try. I click the icon, it says enter your apple ID. I dont have one, so I click to make one, and do so. I then enter my apple ID and click next. The screen reads "People will call you using your email address. What email address would you like to use?" I enter my email address in the box below the message, and then go to my email and click the link, and sign in, thus verifying the email. I go back to the facetime window, and click next. At the top it says Verified, but when I click next it doesn't go on to the next step, it simply blacks out the next button so that I can not click it, and after a few minutes a message comes up that says "Could not verify the email address. Please check your network connection and try again."
    So that is the issue, please help!!!!!
    *Note-I repeat that I know it is not blocked by the school because everyone else uses it just fine.*

    Hello BassoonPlayer,
    Since you are using one of the the school's Macbooks, it is quite possible that the time and date are not properly set on the computer that you are using.  FaceTime will not work if you do not have the proper time zone set up for the location that you are in.  This past week, there were a two other Macbook users I've helped by simply telling them to set the Date/Time properly.  By the way, you described your problem very well, which makes it easier for us to help you.  Hope this solves your problem -- if not, post back and I can suggest other remedies.
    Wuz

  • SharePoint PPS 2013 Dashboard Designer error "Please check the data source for any unsaved changes and click on Test Data Source button"

    Hi,
    I am getting below error in SharePoint PPS 2013 Dashboard Designer. While create the Analysis Service by using "PROVIDER="MSOLAP";DATA SOURCE="http://testpivot2013:9090/Source%20Documents/TestSSource.xlsx"
    "An error occurred connecting to this data source. Please check the data source for any unsaved changes and click on Test Data Source button to confirm connection to the data source. "
    I have checked all the Sites and done all the steps also. But still getting the error.Its frustrating like anything. Everything is configured correctly but still getting this error.
    Thanks in advance.
    Poomani Sankaran

    Hi Poomani,
    Thanks for posting your issue,
    you must have to Install SQL Server 2012 ADOMD.Net  on your machine and find the browse the below mentioned URL to create SharePoint Dashboard with Analysis service step by step.
    http://www.c-sharpcorner.com/UploadFile/a9d961/create-an-analysis-service-data-source-connection-using-shar/
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • I am trying to order a book, I keep getting the same error message," A network error occurred while processing your order, please check your network connection and try again"

    I am trying to order a book with iphoto, I keep getting the same error message.
    " A network error occurred while processing your order, please check your network connection and try again"
    I get the billing part up, it has even uploaded my jpegs but at the final process, I get the same message.
    I have ordered two books a few months ago without any problems.
    Now I keep getting the same message either half way into
    the order or at the final hurdle after the images have been uploaded.
    Any ideas?
    My shared Network has been fine and that does'nt seem an issue.
    Help.

    Try again in a couple of hours - sometimes it is a temp condition
    LN

  • Dynamic Calc processor cannot lock more than [100] ESM blocks during the calculation, please increase CalcLockBlock setting and then retry(a small data cache setting could also cause this problem, please check the data cache size setting).

    Hi,
    Our Environment is Essbase 11.1.2.2 and working on Essbase EAS and Shared Services components.One of our user tried to run the Cal Script of one Application and faced this error.
    Dynamic Calc processor cannot lock more than [100] ESM blocks during the calculation, please increase CalcLockBlock setting and then retry(a small data cache setting could also cause this problem, please check the data cache size setting).
    I have done some Google and found that we need to add something in Essbase.cfg file like below.
    1012704 Dynamic Calc processor cannot lock more than number ESM blocks during the calculation, please increase CalcLockBlock setting and then retry (a small data cache setting could also cause this problem, please check the data cache size setting).
    Possible Problems
    Analytic Services could not lock enough blocks to perform the calculation.
    Possible Solutions
    Increase the number of blocks that Analytic Services can allocate for a calculation:
    Set the maximum number of blocks that Analytic Services can allocate to at least 500. 
    If you do not have an $ARBORPATH/bin/essbase.cfg file on the server computer, create one using a text editor.
    In the essbase.cfg file on the server computer, set CALCLOCKBLOCKHIGH to 500.
    Stop and restart Analytic Server.
    Add the SET LOCKBLOCK HIGH command to the beginning of the calculation script.
    Set the data cache large enough to hold all the blocks specified in the CALCLOCKBLOCKHIGH setting. 
    Determine the block size.
    Set the data catche size.
    Actually in our Server Config file(essbase.cfg) we dont have below data  added.
    CalcLockBlockHigh 2000
    CalcLockBlockDefault 200
    CalcLockBlocklow 50
    So my doubt is if we edit the Essbase.cfg file and add the above settings and restart the services will it work?  and if so why should we change the Server config file if the problem is with one application Cal Script. Please guide me how to proceed.
    Regards,
    Naveen

    Your calculation needs to hold more blocks in memory than your current set up allows.
    From the docs (quoting so I don't have to write it, not to be a smarta***:
    CALCLOCKBLOCK specifies the number of blocks that can be fixed at each level of the SET LOCKBLOCK HIGH | DEFAULT | LOW calculation script command.
    When a block is calculated, Essbase fixes (gets addressability to) the block along with the blocks containing its children. Essbase calculates the block and then releases it along with the blocks containing its children. By default, Essbase allows up to 100 blocks to be fixed concurrently when calculating a block. This is sufficient for most database calculations. However, you may want to set a number higher than 100 if you are consolidating very large numbers of children in a formula calculation. This ensures that Essbase can fix all the required blocks when calculating a data block and that performance will not be impaired.
    Example
    If the essbase.cfg file contains the following settings:
    CALCLOCKBLOCKHIGH 500  CALCLOCKBLOCKDEFAULT 200  CALCLOCKBLOCKLOW 50 
    then you can use the following SET LOCKBLOCK setting commands in a calculation script:
    SET LOCKBLOCK HIGH; 
    means that Essbase can fix up to 500 data blocks when calculating one block.
    Support doc is saying to change your config file so those settings can be made available for any calc script to use.
    On a side note, if this was working previously and now isn't then it is worth investigating if this is simply due to standard growth or a recent change that has made an unexpected significant impact.

  • I am getting the following message when I try to connect to iMessage on my Macbook Pro: Could not sign in. Please check your network connection and try again.

    Hello,
    I am not sure what is going on but I am unable to sign into my iMessage. I am trying to sign in but I keep getting the message: "Could not sign in. Please check your network connection and try again."  I can log into iTunes and all other things that request my Apple ID except the iMessage. I hope someone can help me out.

    iOS: Troubleshooting FaceTime and iMessage activation

  • There was a problem connecting to the server "Time Capsule".  The share does not exist on the server. Please check the share name, and then try again.

    The following error pop's up as an [OK] dialogue box after logging in the iMac,
    There was a problem connecting to the server "Time Capsule".
    The share does not exist on the server. Please check the share name, and then try again."
    As it happens, a connection to the Time Capsule is established usually, anyway. On occasion it doesn't.
    I have a Volume, Data, on the capsule, which similarly, usually mounts, but occassionally doesn't, with access permissions denied.
    Any suggestions on how begin to work out how to achieve networking seamlesness?

    First, restart the Time Capsule by disconnecting the power adapter and reconnecting it. If other devices on the network can see it, you can skip this step.
    From the menu bar, select
     ▹ System Preferences ▹ Network
    Click the lock icon in the lower left corner of the window and authenticate to unlock the settings, if necessary. Click the Advanced button, then select the TCP/IP tab in the sheet that drops down. Click Renew DHCP lease.
    Try again to back up.
    If you still can't, open the Time Machine preference pane and delete the TC from the list of backup destinations. You may have to unlock the settings by clicking the lock icon in order to do this. Then add it back.

  • An error occurred while sending mail. The mail server responded: Administrative prohibition. Please check the message and try again.

    An error occurred while sending mail. The mail server responded: Administrative prohibition. Please check the message and try again.
    Somtimes it says it spam also......

    The error message is being generated by your email provider's server. Best to ask them what they do not like about your messages and how to solve the problem.

  • What does this mean? The mail server responded: Too many messages. Please check the message and try again.

    I use BT yahoo mail with Thunderbird 24.6.0 in the last few days i've started getting this message when sending messages:
    An error occurred while sending mail. The mail server responded: Too many messages. Please check the message and try again.
    Now sometimes the messages are sent anyway and sometimes not. If I re-send sometimes it works and sometimes not. I've contacted BT 'tech support' who tell me there is nothing wrong with them or their servers and as webmail works ok they won't help. I strongly suspect it IS a BT issue, Any clues to fix this?

    The message means BT are lying basically. I have just spent the best part of an hour on chasing what limits BT place on mail sending... the internet contains a void.
    The closest thing I can locate is a BT rep here https://community.bt.com/t5/Email/E-Mail-message-limit/m-p/1045228/highlight/true#M17523 refusing to identify what limits they impose but advising their switch to critical path has more stringent controls. AFAIK Critical path is ca mail software solution sold by OpenWave Messaging http://owmessaging.com/
    So your paying for a totally undefined service. Congratulations!

Maybe you are looking for

  • Is there a table of error code descriptions anywhere?

    Keep getting an error code notice 8072 while trying to use Network share??

  • Project Will Not Open

    I was just working on a project all night and I got to a point where I just needed one more title screen to finish it up. But the title screen was in a different project. So, like I've done many times before, I saved, opened the other project copied

  • Error -61 with FTP Write permissions error; Not a publisher

    Hi, I am trying to use Safari to FTP with my schools server (FreeBSD) but when I try to delete something I get error -61 which is FTP Write permissions error; Not a publisher. When I select "Get Info" I see the permissions say "You can only read". Ho

  • Documentation Template for WD project

    Hi Experts, Do someone has template for documenting a Dynpro project. We have to document our WD application. Please provide some templates with example you use for documenting your project. Regards, Vishal.

  • Ipad crashed during sync and now can't open at all

    screen says iPad disabled and in small print it says ipad restoring to iCloud.   but it won't open to code page or allow me to hook up to iTunes.