• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

SubList.java source is missing

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in the AbstractList class there is a method called subList(int fromIndex, int toIndex) which returns java.util.RandomAccessSubList<E> or java.util.SubList<E> references.
My problem is that i cant find the SubList.java and RandomAccessSublist.java sources under my jdk/scr directory.
Why they are missing and how is it possible to recompile the sources if there are missing files?
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The class is right there in the same file (AbstractList.java), just search for "class SubList"
In my jdk1.6.0_16 it is at line 592
 
Marshal
Posts: 80760
487
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

The subList() method returns a List. That means the exact implementation details are private, and might change. You can use that method without knowing the implementation details.
The code is not in jdk/scr, but in a file called src.zip inside your Java™ installation directory. You can see the code out of interest, like this:-
  • 1: Copy src.zip to a directory you have write permission in (eg /home or My documents)
  • 2: Unzip it.
  • 3: Open the java folder
  • 4: Open the util folder (note the folder names match the package name)
  • 5: Open the AbstractList.java file with a text editor.
  • Chandrakant Talele has helpfully given you the line number; it is a package-private inner (non-static) class whose instance is being returned. Note there are two versions depending on whether the surrounding object does or does not implement java.util.RandomAccess.
     
    Cs. Robert
    Greenhorn
    Posts: 2
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    ups thanks, i just checked that the SubList class is not an inner class of AbstractList so i thought it would be in a different source file, but i can see now there are more separate classes in the same source file.
    thanks
     
    reply
      Bookmark Topic Watch Topic
    • New Topic