What is the name of a nested parameterized type?

The draft spec gives an example of a nested parameterized class Zipper<B> inside a parameterized class Seq<A>. In the sample code the nested type is refered to as Seq<String>.Zipper<Number>. Hence I concluded that the following should work either:
package generics;
public class RawTypes {
private static class Outer<T> {
public class NonstaticInner<T> {}
public static void main(String[] args) {
Outer[] x = new Outer<String>();
Outer<String>.NonstaticInner<String> var = x.new NonstaticInner<String>();
Instead the compiler complains:
incompatible types
found : generics.RawTypes.Outer.NonstaticInner<java.lang.String>
required: generics.RawTypes.Outer<java.lang.String>.NonstaticInner<java.lang.String>
          Outer<String>.NonstaticInner<String> var = x.new NonstaticInner<String>();
When I use the raw outer type the compiler is happy. Like in:
Outer.NonstaticInner<String> var = x.new NonstaticInner<String>();
But that is not what I want say.
Why does this fail to compile? Because the outer class is a nested static class instead of a top-level class? That should not make a difference, I would think. What am I missing?
Angelika

I am quite surprised there is no reaction at your query.
It made me so interested in the spec I downloaded it.
At page 3 I read that no static meber could be parametrized.
I think this makes the behaviour of the compiler correct.No, I don't think so. The spec says:
"The scope of a type parameter is all of the declared class, except any static members or initializers, but including the type parameter section itself."
The spec does not say that static members could not be parameterized. It just says that the type parameter of a generic class cannot be used in any static members of that generic class, be it a static method or a static initializer or the declaration of a static field or a nested static class.
Stuff like this would be prohibited under the quoted wording:
class X<T> {
static T field;
static T getField() { ... }
static { T tmp; ... }
static class Y { T t; }
What I tried is not prohibited by anything in the spec, I believe. I simply defined a generic type (Outer) inside a nongeneric type (RawTypes):
public class RawTypes {
private static class Outer<T> {
public class NonstaticInner<T> {}
The weird thing is that the nested generic type RawTypes.Outer<T> behaves differently from a top-level generic type. Compare the above to the following:
public class Outer<T> {
public class NonstaticInner<T> {}
According to the spec I would refer to the class nested into class Outer<T> as Outer<String>.NonstaticInner<Integer>, for instance. That's basically the example on page 4 of the spec, where they have a Seq<String>.Zipper<Number>.
Why is the behavior entirely different when I want to refer to a class nested into RawTYpes.Outer<T>? Why can't I say RawTypes.Outer<String>.NonstaticInner<Integer>? Why do I have to name it RawTypes.Outer.NonstaticInner<Integer>? That does not make sense to me.
A nested static type is like a top-level type, except that is has a name prefix. Why would that change with the addition of generics to the language?
Outer.NonstaticInner<String> var = x.new
NonstaticInner<String>();
But that is not what I want say.What is it then that you want to say?
Do you want to confine the valid values of var to outer classes parametrized with the
String type? This will lead to problems (I think even with instances) as there is
no specific type for a parametrized class.What error would you expect when a variable
is passed having the correct "inner parameter type" but not the requested outer parameter type?I would expect the same error message that I would get when I assigned a Seq<String>.Zipper<Number> to a Seq<Integer>.Zipper<Number>. No?
Maybe it's just a bug in the prototype compiler, but who can tell if the spec does not say much about nested types what their names would be.
Angelika

Similar Messages

  • What are the names and the parameters of the SSIS reports

    what are the names and the parameters  of the SSIS reports
    (delivered with and included in the SSMS)
    to navigate from my reports to the build in reports
    it's necessary to know the reportname and the parameters.
    I want to "combine" respectively want to navigate
    from custom reports (works excellent) to the 5 build in reports
    please have a look at the attached picture and in particular
    to the blue arrow.SSIS_ReportsNavigation
    thank you for providing an answer or a hint.

    to navigate from my reports to the build in reports
    Those integrated reports in SSMS are not hosted in SSRS, so there is no URL available where you can navigate to.
    The reports run in client side rendering mode = RDLC.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • What's the name of FM for getting Sales Order Header / Item Status info

    Hello All:
    Do you know what's the name of Function Module for getting Sales Order Header / Item Status Overview ? Any sample code will be very much appreciated.
    Basically, I am trying to create a Webpage where user can enter the Sales Order document number and will return the Sales Order: Status Overview.
    Thanks,
    Dipankar Biswas

    Thanks everybody ! Appreciate for your prompt response. I was also looking for some sample code, and I did find some on. And here is one. I still have to try the code, but here is for all your reference:
    *& Report ZBAPI_SALESORDER_GETSTATUS *
    *& Read and Display the Sales Order Items and Status of the Order *
    REPORT zbapi_salesorder_getstatus NO STANDARD PAGE HEADING LINE-SIZE 200 LINE-COUNT 33(3).
    TABLES: vbap. "Sales Document Item Data.
    DATA: wa_bapireturn TYPE bapireturn,
    wa_bapisdstat TYPE bapisdstat,
    it_bapisdstat LIKE STANDARD TABLE OF wa_bapisdstat.
    TYPES: BEGIN OF ty_mat_name,
    matnr TYPE makt-matnr,
    maktx TYPE makt-maktx,
    END OF ty_mat_name.
    DATA: wa_mat_name TYPE ty_mat_name,
    it_mat_name LIKE TABLE OF wa_mat_name WITH KEY matnr .
    PARAMETERS: p_vbeln LIKE vbap-vbeln DEFAULT 5573.
    START-OF-SELECTION.
    SELECT matnr maktx FROM makt INTO TABLE it_mat_name.
    CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'
    EXPORTING
    salesdocument = p_vbeln
    IMPORTING
    return = wa_bapireturn
    TABLES
    statusinfo = it_bapisdstat.
    IF wa_bapireturn IS INITIAL. " Successful Execution.
    WRITE: / 'Document No: ' COLOR 1, 20 'PO Number : ', 40 'Status' , 50 'Delv.Stat',60 'Item No', 80 'Material', 90 'Material Description', 130 'Net Price' COLOR 2.
    ULINE.
    LOOP AT it_bapisdstat INTO wa_bapisdstat.
    WRITE: / wa_bapisdstat-doc_number. " Sales Document Number.
    READ TABLE it_mat_name INTO wa_mat_name WITH KEY matnr = wa_bapisdstat-material.
    WRITE: /20 wa_bapisdstat-purch_no, " Customer Purchase Order Number
    40 wa_bapisdstat-prc_stat_h, " Processing Status
    50 wa_bapisdstat-dlv_stat_h, " Delivery Status
    60 wa_bapisdstat-itm_number, " Item Number
    80 wa_bapisdstat-material, " Material
    90 wa_mat_name-maktx, " Material Description
    130(10) wa_bapisdstat-net_price. " Net Price
    CLEAR wa_bapisdstat.
    ENDLOOP.
    REFRESH it_bapisdstat[].
    ELSE.
    WRITE: wa_bapireturn-message.
    ENDIF.

  • I've installed LR on my new Mac - How do I find/what is the name of the file that opens to bring up my existing photos (on my external hd)?

    I've installed LR on my new Mac - How do I find/what is the name of the file that opens to bring up my existing photos (on my external hd)?

    Bookmarks and history are stored together in your profile folder in a database file named places.sqlite. These articles should help with restoring as much or as little of your other profile as you like:
    Locating the folder: [https://support.mozilla.com/en-US/kb/Profiles Profiles | How to | Firefox Help]
    The following article has suggestions for recovering bookmarks: [http://support.mozilla.com/en-US/kb/Lost%20Bookmarks Lost Bookmarks | Troubleshooting | Firefox Help].
    To move more settings, see: [https://support.mozilla.com/en-US/kb/Recovering+important+data+from+an+old+profile Recovering important data from an old profile].
    Hope this helps.

  • How to find out what is the name of table/view is being maintained in  IMG?

    Gurus,
    Any general trick to find out what is the name of table/view is being maintained
    by a given IMG item while configuring?
    Thanks,

    Hi,
    Click F1  on the table/ view you will get the table name and then go to transaction give this table name and click on Find Maintainance Dialog their you will get the views related to that table.
    Regards,
    IFF

  • What are the names of the flowers on Apple TV screen saver?

    what are the names of the flowers on Apple TV screen saver?
    I am looking for the the botanical names...
    Would anyone know where to find the credits for the photos used on the flowers screen saver?
    -carol8ne

    You can stream from a Mac via itunes selection (iPhoto events or a folder) - it has 8GB of solid state temporary storage, but quite how things are cached/flushed from here is a bit of a mystery - you cannot say designate 2GB to hold photos or prioritise photos over other material.
    Even rentals seem to flush if you've watched them and they haven't expired - relative fell asleep during a rental yesterday so i suggested she watched it today and it downloaded from scratch again, and the AppleTV hadn't had anything but music playing in the interim. Silly this really. There's a post on another section where someone used 17GB of their data allowance to watch a HD movie as it kept reloading!
    Yes you can stream photos from iPod/iPad using Airplay, but to be honest i don't think ATV2 offers that much over ATV1 for photos (yet anyway), and in some ways it's inferior.
    ATV2 is far more responsive/uses less power etc but I'm not convinced you get anything groundbeaking unless you have a lot of guests who could use it via Airplay from their iphones (and with ipads currently without cameras, photos would have to come from somewhere else in the first place).
    Message was edited by: Alley_Cat

  • What are the names of the ports I have in my Macbook Pro to plug an external monitor into?

    What are the names of the ports in my MacBook Pro that I can plug an external monitor into?

    You have Thunderbolt or Mini DisplayPort. If you know which external display you want or you already have it, look at the ports it has got and get a Mini DisplayPort adapter for it. There are Mini DisplayPort adapters for DVI, VGA and HDMI.
    Most external displays have DVI, VGA or HDMI. If you can use HDMI, use it, because it will provide much better quality. See > http://support.apple.com/kb/HT4241?viewlocale=en_US&locale=en_US
    Mini DisplayPort adapters can be used with Thunderbolt

  • What's the name of free Apple_applications to make short video clips?

    What are the names of free Apple_applications
    to create video clips consisting of several pictures combined with mp3 music?
    jonali

    Imovie is one of them, You should be able to find it on the app store.

  • What is the name of the song on the OVI maps comme...

    What is the name of the song featured on the commercial for OVI maps, the ad looks as though it's set in Florence, Italy but I'm not sure. Really would like to know. Also, I believe it's a female singer. Thanks a bunch, please help. 

    bah it was a royal pain the backside to uncover which damn song this was, but like the OP I too was enchanted with the melody.  Anyway without further adu, the song is Donkey by Bachelorette.  The song can be heard in full here:
    http://www.imeem.com/ccozie/music/DH_juR9p/bachelorette-donkey/

  • What is the name of the new apple docking station?

    what is the name of the new apple docking station?

    I believe it's a face in the Myriad Pro family. The font used in the text on the Graphics page appears to be Myriad Pro Semibold.
    These fonts aren't included with OS X.
    Hope this helps....

  • What is the name "cache" refer to?

    What is the name "cache" refer to in the following script?
    Is cache a class? But I cannot find it in the Coherence Documentation.
    CacheService service = cache.getCacheService();
    Cluster      cluster = service.getCluster();
    Thank you

    Thank you very much.
    But I think the Oracle documentation: Oracle Coherence Getting Started is not suitable for a beginner. Some aspects are not put sufficiently clear and not in details. Could you recommend some documentations easier and more suitable for a beginner?
    Many terms are cited without ant explanations. For example:
    thread-local lazy-initialization pattern,
    dedicated cache servers,
    container connection pool,
    threadpool,
    configuration macro,
    MBean,
    language bridges,
    Thank you
    Edited by: jetq on Jun 10, 2009 5:41 PM

  • By mistake I uninstalled my Acrobat someting, which gave me the opportunity to print .pdf and color-mark text. My licence key is [removed by moderator]. What is the name of the product? Where is the link for download and reinstall? Please help me r

    By mistake I uninstalled my Acrobat someting, which gave me the opportunity to print .pdf and color-mark text. My licence key is [removed by moderator - never disclose publicly]. What is the name of the product? Where is the link for download and reinstall? Please help me rapidly, Best regards / Stefan

    Sign in to your Adobe account online and look in the Plans/Products sections to see which program it might have been.

  • What is the name of the i-pad (retinal display) adaptor for photos of deer cameras? Husband's birthday gift, don't hunt.

    What if the name of the i-pad (retinal display) adaptor for photos of deer?
    Husband's 60th soon, need the gift!
                        Thanks

    There is a camera connection kit. Be sure to get the correct one for your husband's iPad.
    This one is for the 1st, 2nd and 3rd generation iPads;
    http://store.apple.com/us/product/MC531ZM/A/apple-ipad-camera-connection-kit?fno de=3a
    For the 4th generation iPad, these two adapters are sold separately;
    http://store.apple.com/us/product/MD822ZM/A/lightning-to-sd-card-camera-reader?f node=3a
    http://store.apple.com/us/product/MD821ZM/A/lightning-to-usb-camera-adapter?fnod e=3a

  • What is the name of Mail's email database

    What is the name of the file for the Mail's database? Is it located in the User Library?
    I have many duplicates in the email database that are not in Contacts. So this must be a different database? Emails take forever to auto complete.
    If I delete this file, will the application automatically rebuild it using contacts? I have over 1800 contacts.
    Thanks, Ted

    Ernie, I appear to have two address files. One is called AddressBook-v22.abcddb and the other AddressBook-v22.abcddb. But they are in two different folders that hold all of their associated files like metadata. In other words, two databases.
    The dates on all files are recent in both folders. Are the two databases required because one if the iCloud database and the other Daylite? Why such a strange setup?
    When I open Contacts, I have "All on My Mac", "Daylite -- All Contacts" and then "iCloud". Can I not configure Contacts to use only iCloud or All on My Mac? Perhaps this would speed up the search on the nearly 2,000 record for each database.
    I configured the address and calendar that lives on this computer as primary and it is backed up to iCloud. Daylite accesses the iCloud integrating its data to iCloud and then back to Contacts/Calendar.
    Barnie, I deleted the file MailRecents-v4.abcdmr. But the slow down continues. The problem appears to reside with the Contacts data. As I start typing a name in the email address field, it takes five to 7 seconds to list suggestions. And most of the suggestions contain exactly the same information repeated 2 to 3 times (duplicates).
    I routinely dedupe the Contacts file with the dedupe function. It usually finds 50 or more.
    (As a side note, I think CardDav and CalDav are works in progress. Either that, or third party applications like Daylite have not figured out how to integrate with CardDav and CalDav properly at this time.)
    Any suggestions for modifying the configuration to get better performance?

  • What in the name of Goodness have you done re: the full screen picture of Contacts on my iPhone? Sort it out Apple or I'm going back to Samsung, where maybe I should have stayed!

    What in the name of Goodness have you done with the full screen picture of Contacts? How dare you just change it without so much as a bye or leave? This is NOT progress but a throwback to about 1997! I supposedly 'updated' to an iPhone two weeks ago. Should have stayed with Samsung I reckon. I am deeply unimpressed!

    Bechepeziere wrote:
           Who in that organisation actually decided this was progress? Unbelieveable!
    stedman1 did it, yep, he's the one, blame him .

Maybe you are looking for

  • Report on Smartform..To make it efficient by removing SELECT ,ENDSELECT

    To make a smartform report efficient by removing all occurs & modify internal table statements. What i have been given to do is to select all data from respective tables put them into one internal table & then finally making tab2 or tab3 in the repor

  • How to move my all files to one folder

    hi, I had created different folders in the acrobat.com. Now, I want to move all my files from all the folders to a different folder. How can I do this? there is not copy or move options available. Please help..

  • Iphone 3g Identity

    My iphone works perfectly with my router but shows up with the device name "unknown" Can I name it? so that the router will the name I give to it? just as it does other devices connected to it. I have named it in the bluetooth settings so if someone

  • Unable to see Applications under navigate tab in Planning browser

    Unable to see Applications under navigate tab in Hyperion(9.3.1) workspace I have installed all Hyperion 9.3.1 products as per installation document Please Can any one tell me the solution. i have one more question .already i installed Hyperion Share

  • Calculate checksum of data block manually?

    I use bbed to check my database and find in the bad blocks, the computed checksum is different from the header value. Based on http://www.ixora.com.au/notes/cache_header.htm, the checksum is calculed with XOR algorithm. But when I calculate the data