Question about assignment conversion

JLS Third Edition, chapter 5.2 on page 93 and Discussion (p. 94), states that:
>
It is a compile time error if a chain of conversions contains two parametrized types that are not in a subtype relation.
And in the Discussion the following example is shown:
Integer -> Comparable<Integer> -> Comparable -> Comparable<String>
Which rocks, since Integer and String are not in a subtype relation. This is still possible because of support for legacy code (i.e. raw types).
However I wrote the following dummy code:
Integer a = 1;
          Comparable<Integer> ci = a;
          Comparable c = ci;
          Comparable<String> cs = c;expecting the compiler to 'trace' the chain of conversions and throw a compile-time error, but all it did was to produce an unchecked conversion warning when the value of the reference variable c is assigned to the reference variable cs.
Isn't this in contrast with what stated by JLS?

First, is there any particular reason why you used:
Integer a = Integer.valueOf(1);while I used
Integer a = 1; //boxing
Just to get rid of boxing conversion as a possible issue--which it shouldn't be, but might as well keep it simple.
Integer a = Integer.valueOf(1);
Comparable<String> cs1 = a; // errorbecause we are assigning to a Comparable<String> an
Integer value, and that's illegal, since String and
Integer are not in a subtype relation (?)Something like that, yes. I'm not sure of the exact clause of the JLS that forbids it.
>
Comparable<Integer> ci = a; // ok
Comparable<String> cs2 = ci; // errorbecause we are assigning to a Comparable<String> a
Comparable<Integer>, and again, String and Integer
are not in a subtype relation (?)Yep.
Comparable<String> cs3 = c1; // warning
Comparable<String> cs4 = c2; // warningit's what I believe is called 'heap pollution' I forget what that term means, and am too lazy to look it up, so I'll take your word for it.
and I
believe that on first use a ClassCastException will
be thrown Sounds right. Run it and see for yourself.
(although the compiler behaves correctly by
flagging an unchecked warning, for compatibility with
legacy systems, etc)Right.

Similar Messages

  • A question about assigning a default value

    Hi guys, I have a question about assigning a default value to a Numeric Decision CO. This Co needs 2 parameters to compare with each other. I wanna assign para1 during runtime and para2 during design time, but I have no idea how to assign a default value to para2 during design time. Can anyone help me solve this question? Thx a lot.
    BTW I`m searching an article about Time-off example`s "details". I have read several articles about time-off example, but those are not detailed enough. I wanna know about all details of COs. Can anyone forward such article to me, plz.  Thx again.^^

    Hi,
    You can assign a default value to the parameter of a callable object.
    First attach your CO to an Action.At the action level you can assign default values to the CO Parameters.
    Select the action in the design time.
    Select the parameters tab for that action.
    Select the required paramter. At the top, you can find Default value tab, with that you can assign default value.
    I think you can achieve your requirements with Business logic CO better.
    [Business Logic CO|http://help.sap.com/saphelp_nwce10/helpdata/en/44/3d3936c5c14a8fe10000000a1553f6/content.htm]
    Thanks

  • Question about UoM conversion

    I'm trying to implement the UoM conversion that is now standard in BI 7.0.  I think I have all the backend work done, but I'm having trouble converting the UoM on the front end when running a query.
    Here's what I did on the backend to set it up.
    1- I went to 0MATERIAL (BEx Explorer tab) and entered 0BASE_UOM as the Unit field. 
    2 - I then generated the conversion ODS.
    3 - I created transformation to the ODS using 0MAT_UNIT_ATTR.  I did have to use a master data lookup for the BASE_UOM field (using the values in 0MATERIAL) since the 0MAT_UNIT_ATTR didn't have the Base Unit of Measure, just the conversion one.
    4 - Loaded the ODS for 1 material (test material 1 EA = 1 EA and 1 KIT = 20 EA)
    5 - Defined a Converstion type (trans RSUOM).  I used Dynamic Option 3 (InfoObject, then T006 tables).  I set the Source UoM = DataRecord, and Target is set to "Selection during Conversion"
    Here's what I did on the query:
    1. For my key figure, I went to the conversions tab.  I selected my Conversion type.
    2. I created a user entry variable with a default value of "EA".
    When I run my report, I enter KITS on the selection screen, but the report still shows eaches.  I can navigate to the Currency conversion on the report via the menus, but I can't find anywhere for Units.
    Any ideas?
    Thanks,
    Rudy

    First, is there any particular reason why you used:
    Integer a = Integer.valueOf(1);while I used
    Integer a = 1; //boxing
    Just to get rid of boxing conversion as a possible issue--which it shouldn't be, but might as well keep it simple.
    Integer a = Integer.valueOf(1);
    Comparable<String> cs1 = a; // errorbecause we are assigning to a Comparable<String> an
    Integer value, and that's illegal, since String and
    Integer are not in a subtype relation (?)Something like that, yes. I'm not sure of the exact clause of the JLS that forbids it.
    >
    Comparable<Integer> ci = a; // ok
    Comparable<String> cs2 = ci; // errorbecause we are assigning to a Comparable<String> a
    Comparable<Integer>, and again, String and Integer
    are not in a subtype relation (?)Yep.
    Comparable<String> cs3 = c1; // warning
    Comparable<String> cs4 = c2; // warningit's what I believe is called 'heap pollution' I forget what that term means, and am too lazy to look it up, so I'll take your word for it.
    and I
    believe that on first use a ClassCastException will
    be thrown Sounds right. Run it and see for yourself.
    (although the compiler behaves correctly by
    flagging an unchecked warning, for compatibility with
    legacy systems, etc)Right.

  • Question about capture conversion

    Hi, relating to capture conversion and to the code below:
    public static void reverse(List<?> list) {
              rev(list);
         private static <X> void rev(List<X> l) {
         }Am I right in saying that the <X> (or whatever else for that matter), it's just giving a name to whatever type will be passed by the reverse method? The syntax looks strange since we are declaring a type in a void method, and since I'm an old fashioned Java 1.4 programmer I find a bit difficult to accept this new syntax; additionally
    the JLS is not terribly simple in defining capture conversion :)
    Message was edited by:
    mtedone

    First, is there any particular reason why you used:
    Integer a = Integer.valueOf(1);while I used
    Integer a = 1; //boxing
    Just to get rid of boxing conversion as a possible issue--which it shouldn't be, but might as well keep it simple.
    Integer a = Integer.valueOf(1);
    Comparable<String> cs1 = a; // errorbecause we are assigning to a Comparable<String> an
    Integer value, and that's illegal, since String and
    Integer are not in a subtype relation (?)Something like that, yes. I'm not sure of the exact clause of the JLS that forbids it.
    >
    Comparable<Integer> ci = a; // ok
    Comparable<String> cs2 = ci; // errorbecause we are assigning to a Comparable<String> a
    Comparable<Integer>, and again, String and Integer
    are not in a subtype relation (?)Yep.
    Comparable<String> cs3 = c1; // warning
    Comparable<String> cs4 = c2; // warningit's what I believe is called 'heap pollution' I forget what that term means, and am too lazy to look it up, so I'll take your word for it.
    and I
    believe that on first use a ClassCastException will
    be thrown Sounds right. Run it and see for yourself.
    (although the compiler behaves correctly by
    flagging an unchecked warning, for compatibility with
    legacy systems, etc)Right.

  • Question about unit conversion for BAPI_PO_CREATE1...

    Hello Experts,
    How do we bypass/supress the unit conversion in BAPI 'BAPI_PO_CREATE1'? Because what is happening
    right now is for example, I input in 88CV it will convert it to 'EA' as this is defined as the
    PO unit of measure. I want the 88 CV to be as it is.
    Also, I am manually populating the net price(net_price) with my own value as I do not want to get
    the net price from the info record. But it comes back as 0. I populate the 'X' fields as to let you know.

    This conversion takes place due to SPRO setting
    ask your functional people to do that
    goo SPRO->reference img->sap netweaveer->check units of measurement
    cheers
    s.janagar

  • Omniportlet  question - about assigning an url to a column

    Hi,
    i have created an omniportlet and assigned an url to one of its columns which passes parameters etc.
    the problem is, this must be just an information kind simple pop-up window but i cant resize or modify the window through onclick
    is there a way to modify the opened new windows size , appereance etc. on omniportlet?
    Regards

    Hi all,
    i have found it on metalink
    just writing
    javascript:window.open('URL YOU WANT','Popup','width=400,height=200'); javascript:location.reload();
    to Url field, works!!
    cheers,

  • Question about file conversion in the sender file adapter

    Hi, all.
    I am trying to get the file adapter to parse a file. The message type is the following:
    JOB
       Msg  0..1
          Transaction  0 ... unbounded
             Data   0 ... 1
                f1 string
                f2 string
    How would you define the recordset name and recordset structure to produce the same structure in the converted xml. I tried:
    recordset name : Msg
    recordset structure : Data, *
    But the transaction is missing. I tried:
    recordset name: Msg
    recordset structure : Transaction, *
    Then the data is missing. Note that the actual data in f1, f2 ... are loaded successfully though.
    Thanks,
    Jonathan.

    Hi, Hareesh
    I agree. But that is how it is defined now by someone else. It is hard to change it as he defines the same structure on the receiving side. I didn't want to change the receiving structure as it touches the proxy code too. So I want to make something short and sweet.
    Basically the data looks like this:
    11,222
    55,666
    The result xml should be something like:
    <JOB>
      <Msg>
         <Transaction>
            <DATA>
               11
               222
            </DATA>
         </Transaction>
         <Transaction>
            <DATA>
              55
              666
            </DATA>
          </Transaction>
      </MSG>
    </JOB>
    I know either the DATA has no meaning and it's giving me a headache ... but that's how it's done and I don't want to rock the boat too much. There are lots of mapping that I have changed otherwise.
    Thanks,
    Jonathan.

  • A question about users assigned roles extraction

    Dear all,
    I have a question about users assigned roles list extraction. I need the list of the users who have already been created along with their assigned roles. According to what I found on Google, there is a table named AGR_USERS which provides the roles assigned to each user. Yet, this table provides only the SAP ID of each user along with the assigned roles. What I need more is to have also the first name and second name of each user.
    So, do you know any table providing at least the following information:
    1) First name of each user
    2) Second name of each user
    3) SAP ID of each user
    4) All assigned roles to each user.
    NOTE: I really need to have first name and second name in separate columns
    Thanks in advance,
    Dariyoosh

    >
    Shekar.J wrote:
    > Agr_users for the user ID and role assignments
    > USR02 to check the validity of the User ID
    > and USER_ADDR for the first name and last name
    >
    > You can create a Table join of the above 3 tables to retrieve the data you require
    Thanks to you and others for your attention to my problem
    I don't know anything about ABAP programming, is there any transaction allowing to create this join? As it seems to me the column "UNAME" in the table "AGR_USERS" and the column "BNAME" in the table "USER_ADDR", both refer to the SAP ID of the user. As a result the condition of the join would be "WHERE (UNAME = BNAME)", is there  any transaction/programme allowing to create this join?
    Thanks in advance,
    Dariyoosh

  • Just installed iOS6, questions about "iMessage" and other things...

    I've been a satisfied iOS4 user since I bought my iPhone4, but I was forced to install iOS6 tonight in order to download a "free" app. I found a few new icons on the screen along with about 200 percent more "Settings" I'd like to ask some questions about. I'm sure a few of these could be answered by doing a frantic and thorough search through weeks of posts but I'm a little short on time right now.
    First, what exactly is iMessage? Looking at the page for it, I can't see any difference between it and regular text messages. The info page says its to avoid charges, but between my data plan and not being charged for text I don't see where theres any other benefit. The one person I text with the most recently asked me why I had not installed iMessage yet, and didn't have an answer when I asked him why I should. I guess he just wanted to see text replies in blue instead of green.
    In a related bit, flipping through Settings>Messages>Send & Receive I find a "2 addresses" section, with my phone number in there as well as my email under "You can be reached by iMessage at:" and "Start new conversations from:". What good does it do iMessages to have my email address? Does the Mail app handle text as well as email addresses? That seems to be the only explanation, and also very odd to think I'd be trying to text through my Mail app.
    Second, looking through the Settings>Mail I see now that I have an icloud email address as well as the mac.com address I've been desperately hanging on to for the past 10 years, and the me.com address they've been trying to force me into since those came out. (I was happy to see I could delete the me.com address from the phone. I wish I could delete it from the universe.)
    I wasn't even aware there was a such thing as icloud.com addresses. When did this happen? What is it used for?
    Third, under that icloud Setting I see a long list of apps with buttons labeled "Off" under it. What are those for? Under the Mac.com settings I see switches for "Mail" and "Notes", with Mail on and Notes off. The Notes app (which I haven't used since my old iPhone 3) still opens, regardless of this setting.
    Fourth, I now have an item called "Facetime" under my Settings. It is off, but underneath it says "Your phone number and/or email address will be shared with people you call". I understand caller ID normally sends caller number info to the receiver, but why would someone need my email address if I call them?
    Fifth, I now have a "Music" setting, at the bottom of which I see a "Home Sharing" item, which when clicked brings up my AppleID and asks me if I want to Sign Out or Cancel. What is Home Sharing? Its also at the bottom of the "Video" settings.
    Sixth, now I have Twitter and Facebook settings? For what? I don't have accounts with either of those companies. So why have settings, especially since it asks me to create accounts and download apps for those companies right in the Settings?
    Seventh, there is a camera icon on the unlock screen. Touching it causes the screen to bounce up about a quarter inch, almost but not quite revealing something behind it. I should probably just quit asking about this stuff already, but I'll take the bait - what is this now?
    Finally, what is the Notification Center used for?
    If I got a text under iOS4, it would put an alert on the Unlock screen. Scrolling through this huge list of things under the Notification settings I'm really blown away by all the apps set up to yell at me. I can see having an alert for a text message but Game Center? What the heck is that, and why is it set up to hit me with a "Badge App Icon" (whatever that is) when I get alerts from "Everyone". Similarly, the phone is set to alert me to something called a "Photostream Alert"? What is this? Why is there a Phone section for the Notification Center? So they can put a Notice on my screen to tell me the phone is ringing? Holy cow! The phone is set to send me alerts from the "Weather Widget". So if I miss the fact its raining there will be a message on my screen to let me know? Whats next - a buzzer to tell me I'm listening to music?
    There's a lot more, like what would I need Passbook for when I have the actual movie tickets, gate boarding passes, coupons, etc in my hands, but we'll leave that for another time. Many thanks to all who can offer some answers to my questions above.

    Hey Taantumus!
    Here is an article that will provide some guidance on this question:
    Apple ID: Changing your password
    http://support.apple.com/kb/ht5624
    The next time you use an Apple feature or service that uses Apple ID, you'll be asked to sign in with your new Apple ID password.
    Thanks for coming to the Apple Support Communities!
    Regards,
    Braden

  • Some question about International Travel

    Ok so i know alot of people have question about international travel weather is USA to Canada, Canada to USA or where ever.
    So i just got off the phone with someone from AT&T these are my questions for them. i hope it can help, im confuse myself.
    *1. I travel recently travel to canada a few weeks ago, when i cross the boarder i switch the data roaming ON and it picks up Rogers Wireless, a few days ago i try i again it said NO SERVICE is something wrong with my iPad?*
    NO, consider yourself lucky u didnt get charge for that roaming, your ipad well not work out of the US unless u buy one of our International plans that AT&T has provided. The reason for this is so you wont have any unwanted charge or high charge on your bill.
    *2. If i was to buy a sim card from Canada and pop it in to my US ipad well it work?*
    Honestly that's something you can try at your own risk, it's design for AT&T so by switching sim cards it may affect your ipad such as running slow, virus, crash. You can try it, i dont work for Rogers so i know nothing about them, i work for AT&T so i can only tell you about our plans and i wont lie to you.(I THINK U JUST DID) This ipad is not unlock just like the iphone so it well only work with AT&T.
    *3. If i pop my sim card out and put in an international sim card well it affect my plan at all or in any way?*
    Yes it can, right now your on the unlimited plan if you put in a different sim card and then re-put in ur AT&T one chances are you're going to loose your unlimited plan and have to settle for the newer plan. That's why AT&T has reduce it's international plans so people are more likely to use it. It's a contract we sign with Apple, if u want to use in canada you can always buy an Ipad in canada and use their plan. (***)
    At the end of this conversion i was just more angry with them. All in all she told bottom line is dont do anything stick with AT&T and pay for international plans. So i have to pay over price data plan if i want to use it intertanional? or i have to buy an ipad for each international places i go to?
    Has anyone try or done any of the 3 ive mention and did it affect ur plan or ipad in anyway?
    Thanks
    Andy

    Ok so here's a little more info
    I called AT&T again today asking them the same question the guy was more helpful then the one yesterday. Even though he kinda told me the same saying that the ipad need to be unlock. , Afterward he transfer me someone from Apple. The lady told me
    1. The ipad is UNLOCK so dont bother trying to get it unlock.
    2. she doesnt see why sticking in another sim card from one of the apple ipad carrier is a problem. U would just have to sign up activated it like u would when u first got it.
    3. Contact phone company (my case Rogers) to see if they carry the mico sim cards.
    4. She doesnt see why it would affect the current plan u have now.
    So at the end of all that she told me, seem like AT&T is just telling you, you cant do this or u shouldnt do that is simple THEY WANT YOU TO USE THEIR PLANS.
    so with that i said i just want to let everyone know. I'm gonna go pick my Micro sim cards from Canada in a bit and sign up for thier plan we'll keep everyone updated if anything change or how it work

  • Question about VPN on RV082

    Question about VPN on RV082
    i connect like diagram
    when i use shrewsoft for vpn ipsec i can not connect across rv082 to next hop on wan 1
    but when i use PPTP on windows 7 for vpn PPTP i can connect across rv082 but high latency on this connection
    please advice me for this issue
    many thank i hope someone help me on this

    ChicagoGuy72 wrote:
    Hello,
    I am working with vpn setups for the first time, so I have some questions I would really appriciate some help with. I would like to be able to connect to a computer on a home network through a linksys E2500 router. I have found alot of documentation on connecting to an external vpn from a computer on the lan side of the router, but nothing on connecting from the outside in. The router does have a static ip address with my internet provider, so I can contact the router from the outside. But makeing the connection to the computer on the other side of the router is where I am missing something or I dont realize that it is not possible. On the lan side I am using DHCP to assign the address to the computer I want to connect to. Perhaps I need to make it have a static address also? I realize that when I configure the connection from the outside that I need to direct the connection to the remote computer in some way, unless vpn connections are fully passed through the router and the connection issue I am haveing is with the "inside" computer.
    Other info:
    I am using windows 7 for the vpn access
    Thank you in advance for your help.
    Kindly check these links:
    http://www.cisco.com/en/US/tech/tk827/tk369/technologies_configuration_example09186a00801e51e2.shtml
    http://www.cisco.com/en/US/products/sw/secursw/ps2086/products_configuration_example09186a008009436a...

  • A few questions about Patone colors

    I have a few questions about patone colors since this is the first time I use them. I want to use them to create a letterhead and business cards in two colors.
    1)
    I do understand that the uncoated is more washed out than the coated patone colors. I heard that this is because the way paper absorbs the inkt. This is why the same inkt results in different colors on different paper (right?). My question is why is the patone uncoated black so much different than normal black (c=0 m=0 y=0 k=100) or rich black:
    When I print a normal document with cmyk, I can get pretty dark black colors. Why is it that I cannot have that dark black color with patone colors? Even text documents printed on a cheap printer can get a darker color than the Patone color. It just looks way too grey for me.
    2) For a first mockup, I want to print the patone colors as cmyk (since I put like 10 different colors on a page for fast comparison). I know that these cmyk colors differ from the patone colors and that I cannot get a 100% representation. But is there a way to convert patone to cmyk values?
    I hope that some of you can help me out with my questions.
    Thanks.

    You can get Pantone's CMYK tints in Illustrator, (Swatches Panel > Open Swatch Library > Color Books > PANTONE+ Color Bridge Coated or Uncoated) but in my view, what's the point?  If you're printing to a digital printer, just use RGB (HSB) or CMYK. Personally, I never use Pantone's CMYK so-called "equivalents."
    Pantone colors are all mixed pigmented inks, many of which fluoresce beyond the gamut limits of RGB and especially CMYK. The original Pantone Matching System (PMS) was created for the printing industry. It outlined pigmented ink formulations for each of its colors.
    Most digital printers (laser or inkjet) use CMYK. The CMYK color gamut is MUCH SMALLER than what many mixed inks, printed on either coated or uncoated papers can deliver. When you specify non-coated Pantone ink in AI, according to Pantone's conversion tables, AI tries to "approximate" what that color will look like on an uncoated sheet, using CMYK. -- In my opinion, this has little relevance to real-world conditions, and is to be avoided in most situations.
    If your project is going to be printed on a printing press with spot Pantone inks, then by all means, use Pantone colors. But don't trust the screen colors; rather get a Pantone swatch book and look at the actual inks on both coated and uncoated papers, according to the stock you will use on the press.
    With the printing industry rapidly dwindling in favor of the web and inkjet printers, Pantone has attempted to extend its relevance beyond the pull-date by publishing (in books and in software alliances, with such as Adobe) its old PMS inks, and their supposed LAB and CMYK equivalents. I say "supposed" because again, RGB monitors and CMYK inks can never be literally equivalent to many Pantone inks. But if you're going to print your project on a printing press, Pantone inks are still very relevant as "spot colors."
    I also set my AI Preferences > Appearance of Black to both Display All Blacks Accurately, and Output All Blacks Accurately. The only exception to this might be when printing on a digital printer, where there should be no registration issues.
    Rich black in AI is a screen phenomenon, unless in Prefs > Appearance of Black, you also specify "Output All Inks As Rich Black," -- something I would NEVER do if outputting for an actual printing press. I always set my blacks in AI to "Output All Blacks Acurately" when outputting for a press. If you fail to do this, then on the press you will see any minor registration problems, with C, M, and Y peeking out, especially around black type.  UGH!
    Good luck!  :+)

  • Basic questions about Infocube

    Hi, everyone.
    I got very basic questions about infocube data handling.
    With infopackage, I extracted all the data about employees from R/3.
    But there were some mistakes during inputting employee data, like positions,
    so I just extracted those employees data once more.
    Now I have two requests in infocube, where the first one has some wrong data.
    Is there any solutions about this?
    I might got it all wrong, so as beginner, any suggestions and explanations will
    be grateful.

    Hi,
    You can manually delete the earlier request by going in the Manage option of the cube. select the request and click on delete icon at the bottom.
    Other option is to make setting in the Infopackage to delete similar or overlapping request.
    Data target tab --> 6th column Automatic loading / deletion of similar request. --> click on the blank icon --> you will get a pop-up --> select the radio button - "delete existing request" --> Select Conditions --> Infosource are same, datasource are same and source system are same, --> selections are "Same or  More Comprehensive "
    Assign points if useful
    Regards
    Venkata Devaraj !!!

  • Question about PNP...LDB

    Hi All,
    I have been asked a simple but strange question about PNP LDB. When we assigned logical database in our program, it will basically create a selection screen, which have certain fields. Like Today.. Some date ranges. Person assigned number, company code, company status.
    From my standpoint I know when ever we give selection to PNP screen we have to check this selection parameters in our programs, like date range ,person number, employee status etc ….RIGHT?
    Somebody ask me that without checking selection in our report I mean any parameters, it can filter the record, my Answer was BIG “NO”. You need to check all the parameters in your program.
    Next question asked by me was what the purpose of PNP. I replied that rather then declaring and doing bunch of databases SAP provide logical database so current all the records and do what ever you like to do.
    What you think guys?
    Thanks

    Here`s the question , when I am giving "1"active employee in employee status why its pulling up the information for '0' withdrawn employee?
    Message was edited by: Saquib Khan

  • A question about creating packages as local objects in ABAP

    Hi,
    I have a question about creating packages with SE80. Whenever I create a new package it is assigned a new transport request. After that, I can create new programs inside this package, and each time I can choose whether to assign the new program to a transport request or just save it as a local object (I often do this for test programs that I don't transport and I remove them once my tests have been done).
    What I would like to ask is that, is it possible to create a package (and not just programs inside a given package) as a local object? so that every new object created in this package will be considered as a local object?
    Thanks in advane,
    Kind Regards,
    Dariyoosh

    Thomas Zloch wrote:
    Please also check the F1 help for the package field e.g. in SE80, SAP standard is in range A-S and U-X, namespaces start with "/", so you should be save. I am using the T namespace for temporary stuff since a long time and did not have a problem so far.
    > Thomas
    >
    > P.S. this applies to the package name only, of course
    Thank you very much for this remark, I checked F1 help for the package field and in fact as you mentioned these ranges are for local objects.
    Once again, thank you very much for your help.
    Kind Regards,
    Dariyoosh

Maybe you are looking for