Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4130982

java.lang.Package.getAllPackages() does not work properly

XMLWordPrintable

    • sparc
    • solaris_2.5



      Name: akC57697 Date: 04/21/98



      java.lang.Package.getAllPackages() does not work properly
      in JDK-1.2beta4 builds.

      The doc says:
      "
      public static Package[] getAllPackages()

          Get all the packages currently known for the callers classloader.
          Those packages correspond to
          classes loaded via or accessible by name to that classloader.
          If the callers classloader is null only
          the packages corresponding to system classes will be returned.
          Returns:
             a new array of packages known to the callers classloader. An zero
          length array is returned if none are known.
      "
      ---------------------8-<----------------------
      public class Packages {
        public static void main(String argv[]) {
         Package packages[] = Package.getAllPackages();
         System.out.println("Packages are:");
         for (int i=0;i<packages.length;i++)
          System.out.println(packages[i].getName());
         System.out.println("----------------");
        }
      }
      --------------------->-8----------------------
      See statistics:
      java full version "JDK-1.2beta3-N"
      Packages are:
      java.awt.dnd
      java.awt.datatransfer
      java.util.zip
      java.util.jar
      org.omg.CORBA.ContainedPackage
      java.awt.accessibility
      org.omg.CORBA
      java.awt.swing.event
      java.awt.swing.beaninfo
      java.awt.peer
      java.awt.image
      java.awt.swing.text.rtf
      java.awt.event
      java.awt.swing.border
      java.awt.print
      java.awt.swing.plaf.basic
      org.omg.CORBA.portable
      java.awt.swing.plaf.metal
      java.awt.swing.table
      java.util
      org.omg.CosNaming.NamingContextPackage
      java.sql
      org.omg.CORBA.InterfaceDefPackage
      java.lang.ref
      java.awt.swing.text
      java.beans.beancontext
      java.awt.swing.plaf
      org.omg.CosNaming
      java.security.spec
      com.sun.CORBA.iiop
      sunw.io
      java.rmi.server
      org.omg.CORBA.ContainerPackage
      sunw.util
      org.omg.CORBA.ORBPackage
      com.sun.CORBA.portable
      com.sun.CosNaming
      java.security.cert
      java.security.acl
      java.awt.swing.plaf.motif
      java.rmi.activation
      java.text
      java.awt.swing.undo
      java.rmi.registry
      java.applet
      java.awt.color
      java.io
      java.awt.swing.preview
      java.awt.swing.text.html
      java.awt.swing.plaf.windows
      java.rmi.dgc
      java.awt.swing.tree
      java.security
      java.awt.image.codec
      java.beans
      java.awt.im
      java.util.mime
      java.rmi
      java.security.interfaces
      java.awt.geom
      java.lang.reflect
      java.awt.swing.plaf.multi
      java.math
      org.omg.CORBA.TypeCodePackage
      java.awt.swing
      java.text.resources
      java.awt
      java.awt.dnd.peer
      java.lang
      java.awt.image.renderable
      java.net
      java.awt.font
      ----------------

      java full version "JDK-1.2beta4-A"
      Packages are:
      java.lang
      java.security
      java.io
      sun.io
      java.lang.ref
      java.util
      ----------------

      java full version "JDK-1.2beta4-B"
      Packages are:
      sun.io
      java.net
      java.util.zip
      sun.net.www
      java.security
      sun.security.provider
      sun.security.util
      sun.misc
      java.lang
      java.lang.reflect
      java.util
      sun.net.www.protocol.jar
      java.lang.ref
      sun.net.www.protocol.file
      java.io
      java.util.jar
      ----------------

      ======================================================================

            dconnellsunw David Connelly (Inactive)
            akuzminorcl Alexander Kuzmin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: