Friday, March 13, 2015

NullPointerException

java.lang.NullPointerException

NullPointerException is described in the javadoc comments as:

Thrown when an application attempts to use null in a case where an object is required. These include:
  • Calling the instance method of a null object.
  • Accessing or modifying the field of a null object.
  • Taking the length of null as if it were an array.
  • Accessing or modifying the slots of null as if it were an array.
  • Throwing null as if it were a Throwable value.

Applications should throw instances of this class to indicate other illegal uses of the null object.
author: unascribed version: 1.19, 12/19/03 since: JDK1.0

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

com.sun.corba.se.impl.interceptors.ClientRequestInfoImpl.get_reply_service_context(int)

/**
     * does not contain an etry for that ID, BAD_PARAM with a minor code of
     * TBD_BP is raised.
     */
public org.omg.IOP.ServiceContext get_reply_service_context(int id) {
    checkAccess(MID_GET_REPLY_SERVICE_CONTEXT);
    if (cachedReplyServiceContexts == null) {
        cachedReplyServiceContexts = new HashMap();
    }
    try {
        ServiceContexts serviceContexts = messageMediator.getReplyServiceContexts();
        if (serviceContexts == null) {
            throw new NullPointerException();
        }
        return getServiceContext(cachedReplyServiceContexts, serviceContexts, id);
    } catch (NullPointerException e) {
        throw stdWrapper.invalidServiceContextId(e);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.javax.rmi.CORBA.Util.copyObjects(Object[], org.omg.CORBA.ORB)

/**
     * Copies or connects an array of objects. Used by local stubs
     * to copy any number of actual parameters, preserving sharing
     * across parameters as necessary to support RMI semantics.
     * @param obj the objects to copy or connect.
     * @param orb the ORB.
     * @return the copied or connected objects.
     * @exception RemoteException if any object could not be copied or connected.
     */
public Object[] copyObjects(Object[] obj, org.omg.CORBA.ORB orb) throws RemoteException {
    if (obj == null) throw new NullPointerException();
    Class compType = obj.getClass().getComponentType();
    if (Remote.class.isAssignableFrom(compType) && !compType.isInterface()) {
        Remote[] result = new Remote[obj.length];
        System.arraycopy((Object) obj, 0, (Object) result, 0, obj.length);
        return (Object[]) copyObject(result, orb);
    } else return (Object[]) copyObject(obj, orb);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.util.IdentityHashtable.contains(Object)

/**
     * Tests if some key maps into the specified value in this hashtable.
     * This operation is more expensive than the <code>containsKey</code>
     * method.
     * @param      value   a value to search for.
     * @return     <code>true</code> if some key maps to the
     *             <code>value</code> argument in this hashtable;
     *             <code>false</code> otherwise.
     * @exception  NullPointerException  if the value is <code>null</code>.
     * @see        java.util.Hashtable#containsKey(java.lang.Object)
     * @since      JDK1.0
     */
public boolean contains(Object value) {
    if (value == null) {
        throw new NullPointerException();
    }
    IdentityHashtableEntry tab[] = table;
    for (int i = tab.length; i-- > 0; ) {
        for (IdentityHashtableEntry e = tab[i]; e != null; e = e.next) {
            if (e.value == value) {
                return true;
            }
        }
    }
    return false;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.util.IdentityHashtable.put(Object, Object)

/**
     * Maps the specified <code>key</code> to the specified 
     * <code>value</code> in this hashtable. Neither the key nor the 
     * value can be <code>null</code>. 
     * The value can be retrieved by calling the <code>get</code> method 
     * with a key that is equal to the original key. 
     * @param      key     the hashtable key.
     * @param      value   the value.
     * @return     the previous value of the specified key in this hashtable,
     *             or <code>null</code> if it did not have one.
     * @exception  NullPointerException  if the key or value is
     *               <code>null</code>.
     * @see     java.util.Hashtable#get(java.lang.Object)
     * @since   JDK1.0
     */
public Object put(Object key, Object value) {
    if (value == null) {
        throw new NullPointerException();
    }
    IdentityHashtableEntry tab[] = table;
    int hash = System.identityHashCode(key);
    int index = (hash & 0x7FFFFFFF) % tab.length;
    for (IdentityHashtableEntry e = tab[index]; e != null; e = e.next) {
        if ((e.hash == hash) && e.key == key) {
            Object old = e.value;
            e.value = value;
            return old;
        }
    }
    if (count >= threshold) {
        rehash();
        return put(key, value);
    }
    IdentityHashtableEntry e = new IdentityHashtableEntry();
    e.hash = hash;
    e.key = key;
    e.value = value;
    e.next = tab[index];
    tab[index] = e;
    count++;
    return null;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.util.JDKClassLoader.loadClass(Class, String)

static Class loadClass(Class aClass, String className) throws ClassNotFoundException {
    if (className == null) {
        throw new NullPointerException();
    }
    if (className.length() == 0) {
        throw new ClassNotFoundException();
    }
    ClassLoader loader;
    if (aClass != null) {
        loader = aClass.getClassLoader();
    } else {
        loader = bridge.getLatestUserDefinedLoader();
    }
    Object key = classCache.createKey(className, loader);
    if (classCache.knownToFail(key)) {
        throw new ClassNotFoundException(className);
    } else {
        try {
            return Class.forName(className, false, loader);
        } catch (ClassNotFoundException cnfe) {
            classCache.recordFailure(key);
            throw cnfe;
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.jmx.snmp.ThreadContext.restore(ThreadContext)

/**
     * Restore the context stack to an earlier state.  This typically
     * undoes the effect of one or more <code>push</code> calls.
     * @param oldContext the state to return.  This is usually the return
     * value of an earlier <code>push</code> operation.
     * @exception NullPointerException if <code>oldContext</code> is null.
     * @exception IllegalArgumentException if <code>oldContext</code>
     * does not represent a context from this thread, or if that
     * context was undone by an earlier <code>restore</code>.
     */
public static void restore(ThreadContext oldContext) throws NullPointerException, IllegalArgumentException {
    if (oldContext == null) throw new NullPointerException();
    for (ThreadContext context = getContext(); context != oldContext; context = context.previous) {
        if (context == null) {
            throw new IllegalArgumentException('Restored context is not ' + 'contained in current ' + 'context');
        }
    }
    if (oldContext.key == null) oldContext = null;
    setContext(oldContext);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable.contains(Object)

/**
     * Tests if some key maps into the specified value in this hashtable.
     * This operation is more expensive than the <code>containsKey</code>
     * method.
     */
public boolean contains(Object value) {
    if (value == null) throw new NullPointerException();
    int i;
    HashtableEntry e;
    HashtableEntry tab[] = table;
    for (i = tab.length; i-- > 0; ) {
        for (e = tab[i]; e != null; e = e.next) {
            if (e.value.equals(value)) {
                return true;
            }
        }
    }
    return false;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable.put(Object, Object)

/**
     * Maps the specified <code>key</code> to the specified 
     * <code>value</code> in this hashtable. Neither the key nor the 
     * value can be <code>null</code>. 
     * The value can be retrieved by calling the <code>get</code> method 
     * with a key that is equal to the original key. 
     */
public Object put(Object key, Object value) {
    if (value == null) throw new NullPointerException();
    HashtableEntry e;
    HashtableEntry tab[] = table;
    int hash = key.hashCode();
    int index = (hash & 0x7FFFFFFF) % tab.length;
    for (e = tab[index]; e != null; e = e.next) {
        if ((e.hash == hash) && e.key.equals(key)) {
            Object old = e.value;
            e.value = value;
            return old;
        }
    }
    if (count >= threshold) {
        rehash();
        return put(key, value);
    }
    e = new HashtableEntry();
    e.hash = hash;
    e.key = key;
    e.value = value;
    e.next = tab[index];
    tab[index] = e;
    count++;
    return null;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.Component.applyComponentOrientation(ComponentOrientation)

/**
     * Sets the <code>ComponentOrientation</code> property of this component
     * and all components contained within it.
     * @param orientation the new component orientation of this component and
     *        the components contained within it.
     * @exception NullPointerException if <code>orientation</code> is null.
     * @see #setComponentOrientation
     * @see #getComponentOrientation
     * @since 1.4
     */
public void applyComponentOrientation(ComponentOrientation orientation) {
    if (orientation == null) {
        throw new NullPointerException();
    }
    setComponentOrientation(orientation);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextSupport.getResource(String, BeanContextChild)

/**
     * @param name the name of the resource requested.
     * @param bcc  the child object making the request.
     * @return the requested resource as an InputStream
     */
public URL getResource(String name, BeanContextChild bcc) {
    if (name == null) throw new NullPointerException('name');
    if (bcc == null) throw new NullPointerException('bcc');
    if (containsKey(bcc)) {
        ClassLoader cl = bcc.getClass().getClassLoader();
        return cl != null ? cl.getResource(name) : ClassLoader.getSystemResource(name);
    } else throw new IllegalArgumentException('Not a valid child');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextSupport.getResourceAsStream(String, BeanContextChild)

/**
     * @param name the name of the resource requested.
     * @param bcc  the child object making the request.
     * @return  the requested resource as an InputStream
     * @throws  NullPointerException
     */
public InputStream getResourceAsStream(String name, BeanContextChild bcc) {
    if (name == null) throw new NullPointerException('name');
    if (bcc == null) throw new NullPointerException('bcc');
    if (containsKey(bcc)) {
        ClassLoader cl = bcc.getClass().getClassLoader();
        return cl != null ? cl.getResourceAsStream(name) : ClassLoader.getSystemResourceAsStream(name);
    } else throw new IllegalArgumentException('Not a valid child');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.ByteArrayInputStream.read(byte, int, int)

/**
     * Reads up to <code>len</code> bytes of data into an array of bytes 
     * from this input stream. 
     * If <code>pos</code> equals <code>count</code>,
     * then <code>-1</code> is returned to indicate
     * end of file. Otherwise, the  number <code>k</code>
     * of bytes read is equal to the smaller of
     * <code>len</code> and <code>count-pos</code>.
     * If <code>k</code> is positive, then bytes
     * <code>buf[pos]</code> through <code>buf[pos+k-1]</code>
     * are copied into <code>b[off]</code>  through
     * <code>b[off+k-1]</code> in the manner performed
     * by <code>System.arraycopy</code>. The
     * value <code>k</code> is added into <code>pos</code>
     * and <code>k</code> is returned.
     * This <code>read</code> method cannot block. 
     * @param   b     the buffer into which the data is read.
     * @param   off   the start offset of the data.
     * @param   len   the maximum number of bytes read.
     * @return  the total number of bytes read into the buffer, or
     *          <code>-1</code> if there is no more data because the end of
     *          the stream has been reached.
     */
public synchronized int read(byte b[], int off, int len) {
    if (b == null) {
        throw new NullPointerException();
    } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
        throw new IndexOutOfBoundsException();
    }
    if (pos >= count) {
        return -1;
    }
    if (pos + len > count) {
        len = count - pos;
    }
    if (len <= 0) {
        return 0;
    }
    System.arraycopy(buf, pos, b, off, len);
    pos += len;
    return len;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.File.createTempFile(String, String, File)

/**
     *  Creates a new empty file in the specified directory, using the
     * given prefix and suffix strings to generate its name.  If this method
     * returns successfully then it is guaranteed that:
     * <ol>
     * <li> The file denoted by the returned abstract pathname did not exist
     *      before this method was invoked, and
     * <li> Neither this method nor any of its variants will return the same
     *      abstract pathname again in the current invocation of the virtual
     *      machine.
     * </ol>
     * This method provides only part of a temporary-file facility.  To arrange
     * for a file created by this method to be deleted automatically, use the
     * <code>{@link #deleteOnExit}</code> method.
     *  The <code>prefix</code> argument must be at least three characters
     * long.  It is recommended that the prefix be a short, meaningful string
     * such as <code>'hjb'</code> or <code>'mail'</code>.  The
     * <code>suffix</code> argument may be <code>null</code>, in which case the
     * suffix <code>'.tmp'</code> will be used.
     *  To create the new file, the prefix and the suffix may first be
     * adjusted to fit the limitations of the underlying platform.  If the
     * prefix is too long then it will be truncated, but its first three
     * characters will always be preserved.  If the suffix is too long then it
     * too will be truncated, but if it begins with a period character
     * (<code>'.'</code>) then the period and the first three characters
     * following it will always be preserved.  Once these adjustments have been
     * made the name of the new file will be generated by concatenating the
     * prefix, five or more internally-generated characters, and the suffix.
     *  If the <code>directory</code> argument is <code>null</code> then the
     * system-dependent default temporary-file directory will be used.  The
     * default temporary-file directory is specified by the system property
     * <code>java.io.tmpdir</code>.  On UNIX systems the default value of this
     * property is typically <code>'/tmp'</code> or <code>'/var/tmp'</code>; on
     * Microsoft Windows systems it is typically <code>'C:\\WINNT\\TEMP'</code>.  A different
     * value may be given to this system property when the Java virtual machine
     * is invoked, but programmatic changes to this property are not guaranteed
     * to have any effect upon the temporary directory used by this method.
     * @param  prefix     The prefix string to be used in generating the file's
     *                    name; must be at least three characters long
     * @param  suffix     The suffix string to be used in generating the file's
     *                    name; may be <code>null</code>, in which case the
     *                    suffix <code>'.tmp'</code> will be used
     * @param  directory  The directory in which the file is to be created, or
     *                    <code>null</code> if the default temporary-file
     *                    directory is to be used
     * @return  An abstract pathname denoting a newly-created empty file
     * @throws  IllegalArgumentException
     *          If the <code>prefix</code> argument contains fewer than three
     *          characters
     * @throws  IOException  If a file could not be created
     * @throws  SecurityException
     *          If a security manager exists and its <code>{@link
     *          java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
     *          method does not allow a file to be created
     * @since 1.2
     */
public static File createTempFile(String prefix, String suffix, File directory) throws IOException {
    if (prefix == null) throw new NullPointerException();
    if (prefix.length() < 3) throw new IllegalArgumentException('Prefix string too short');
    String s = (suffix == null) ? '.tmp' : suffix;
    synchronized (tmpFileLock) {
        if (directory == null) {
            String tmpDir = getTempDir();
            directory = new File(tmpDir, fs.prefixLength(tmpDir));
        }
        SecurityManager sm = System.getSecurityManager();
        File f;
        do {
            f = generateFile(prefix, s, directory);
        } while (!checkAndCreate(f.getPath(), sm));
        return f;
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.InputStream.read(byte, int, int)

/**
     * Reads up to <code>len</code> bytes of data from the input stream into
     * an array of bytes.  An attempt is made to read as many as
     * <code>len</code> bytes, but a smaller number may be read.
     * The number of bytes actually read is returned as an integer.
     *  This method blocks until input data is available, end of file is
     * detected, or an exception is thrown.
     *  If <code>b</code> is <code>null</code>, a
     * <code>NullPointerException</code> is thrown.
     *  If <code>off</code> is negative, or <code>len</code> is negative, or
     * <code>off+len</code> is greater than the length of the array
     * <code>b</code>, then an <code>IndexOutOfBoundsException</code> is
     * thrown.
     *  If <code>len</code> is zero, then no bytes are read and
     * <code>0</code> is returned; otherwise, there is an attempt to read at
     * least one byte. If no byte is available because the stream is at end of
     * file, the value <code>-1</code> is returned; otherwise, at least one
     * byte is read and stored into <code>b</code>.
     *  The first byte read is stored into element <code>b[off]</code>, the
     * next one into <code>b[off+1]</code>, and so on. The number of bytes read
     * is, at most, equal to <code>len</code>. Let <i>k</i> be the number of
     * bytes actually read; these bytes will be stored in elements
     * <code>b[off]</code> through <code>b[off+</code><i>k</i><code>-1]</code>,
     * leaving elements <code>b[off+</code><i>k</i><code>]</code> through
     * <code>b[off+len-1]</code> unaffected.
     *  In every case, elements <code>b[0]</code> through
     * <code>b[off]</code> and elements <code>b[off+len]</code> through
     * <code>b[b.length-1]</code> are unaffected.
     *  If the first byte cannot be read for any reason other than end of
     * file, then an <code>IOException</code> is thrown. In particular, an
     * <code>IOException</code> is thrown if the input stream has been closed.
     *  The <code>read(b,</code> <code>off,</code> <code>len)</code> method
     * for class <code>InputStream</code> simply calls the method
     * <code>read()</code> repeatedly. If the first such call results in an
     * <code>IOException</code>, that exception is returned from the call to
     * the <code>read(b,</code> <code>off,</code> <code>len)</code> method.  If
     * any subsequent call to <code>read()</code> results in a
     * <code>IOException</code>, the exception is caught and treated as if it
     * were end of file; the bytes read up to that point are stored into
     * <code>b</code> and the number of bytes read before the exception
     * occurred is returned.  Subclasses are encouraged to provide a more
     * efficient implementation of this method.
     * @param      b     the buffer into which the data is read.
     * @param      off   the start offset in array <code>b</code>
     *                   at which the data is written.
     * @param      len   the maximum number of bytes to read.
     * @return     the total number of bytes read into the buffer, or
     *             <code>-1</code> if there is no more data because the end of
     *             the stream has been reached.
     * @exception  IOException  if an I/O error occurs.
     * @exception  NullPointerException  if <code>b</code> is <code>null</code>.
     * @see        java.io.InputStream#read()
     */
public int read(byte b[], int off, int len) throws IOException {
    if (b == null) {
        throw new NullPointerException();
    } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
        throw new IndexOutOfBoundsException();
    } else if (len == 0) {
        return 0;
    }
    int c = read();
    if (c == -1) {
        return -1;
    }
    b[off] = (byte) c;
    int i = 1;
    try {
        for (; i < len; i++) {
            c = read();
            if (c == -1) {
                break;
            }
            if (b != null) {
                b[off + i] = (byte) c;
            }
        }
    } catch (IOException ee) {
    }
    return i;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.LineNumberInputStream.read(byte, int, int)

/**
     * Reads up to <code>len</code> bytes of data from this input stream 
     * into an array of bytes. This method blocks until some input is available.
     * The <code>read</code> method of 
     * <code>LineNumberInputStream</code> repeatedly calls the 
     * <code>read</code> method of zero arguments to fill in the byte array.
     * @param      b     the buffer into which the data is read.
     * @param      off   the start offset of the data.
     * @param      len   the maximum number of bytes read.
     * @return     the total number of bytes read into the buffer, or
     *             <code>-1</code> if there is no more data because the end of
     *             this stream has been reached.
     * @exception  IOException  if an I/O error occurs.
     * @see        java.io.LineNumberInputStream#read()
     */
public int read(byte b[], int off, int len) throws IOException {
    if (b == null) {
        throw new NullPointerException();
    } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
        throw new IndexOutOfBoundsException();
    } else if (len == 0) {
        return 0;
    }
    int c = read();
    if (c == -1) {
        return -1;
    }
    b[off] = (byte) c;
    int i = 1;
    try {
        for (; i < len; i++) {
            c = read();
            if (c == -1) {
                break;
            }
            if (b != null) {
                b[off + i] = (byte) c;
            }
        }
    } catch (IOException ee) {
    }
    return i;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.ObjectInputStream.read(byte[], int, int)

/**
     * Reads into an array of bytes.  This method will block until some input
     * is available. Consider using java.io.DataInputStream.readFully to read
     * exactly 'length' bytes.
     * @param buf the buffer into which the data is read
     * @param off the start offset of the data
     * @param len the maximum number of bytes read
     * @return the actual number of bytes read, -1 is returned when the end of
     *   the stream is reached.
     * @throws IOException If an I/O error has occurred.
     * @see java.io.DataInputStream#readFully(byte[],int,int)
     */
public int read(byte[] buf, int off, int len) throws IOException {
    if (buf == null) {
        throw new NullPointerException();
    }
    int endoff = off + len;
    if (off < 0 || len < 0 || endoff > buf.length || endoff < 0) {
        throw new IndexOutOfBoundsException();
    }
    return bin.read(buf, off, len, false);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.ObjectOutputStream.write(byte[], int, int)

/**
     * Writes a sub array of bytes.
     * @param buf the data to be written
     * @param off the start offset in the data
     * @param len the number of bytes that are written
     * @throws IOException If an I/O error has occurred.
     */
public void write(byte[] buf, int off, int len) throws IOException {
    if (buf == null) {
        throw new NullPointerException();
    }
    int endoff = off + len;
    if (off < 0 || len < 0 || endoff > buf.length || endoff < 0) {
        throw new IndexOutOfBoundsException();
    }
    bout.write(buf, off, len, false);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.OutputStream.write(byte, int, int)

/**
     * Writes <code>len</code> bytes from the specified byte array 
     * starting at offset <code>off</code> to this output stream. 
     * The general contract for <code>write(b, off, len)</code> is that 
     * some of the bytes in the array <code>b</code> are written to the 
     * output stream in order; element <code>b[off]</code> is the first 
     * byte written and <code>b[off+len-1]</code> is the last byte written 
     * by this operation.
     * The <code>write</code> method of <code>OutputStream</code> calls 
     * the write method of one argument on each of the bytes to be 
     * written out. Subclasses are encouraged to override this method and 
     * provide a more efficient implementation. 
     * If <code>b</code> is <code>null</code>, a 
     * <code>NullPointerException</code> is thrown.
     * If <code>off</code> is negative, or <code>len</code> is negative, or 
     * <code>off+len</code> is greater than the length of the array 
     * <code>b</code>, then an <tt>IndexOutOfBoundsException</tt> is thrown.
     * @param      b     the data.
     * @param      off   the start offset in the data.
     * @param      len   the number of bytes to write.
     * @exception  IOException  if an I/O error occurs. In particular, 
     *             an <code>IOException</code> is thrown if the output 
     *             stream is closed.
     */
public void write(byte b[], int off, int len) throws IOException {
    if (b == null) {
        throw new NullPointerException();
    } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
        throw new IndexOutOfBoundsException();
    } else if (len == 0) {
        return;
    }
    for (int i = 0; i < len; i++) {
        write(b[off + i]);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.PipedInputStream.read(byte, int, int)

/**
     * Reads up to <code>len</code> bytes of data from this piped input
     * stream into an array of bytes. Less than <code>len</code> bytes
     * will be read if the end of the data stream is reached. This method
     * blocks until at least one byte of input is available.
     * If a thread was providing data bytes
     * to the connected piped output stream, but
     * the  thread is no longer alive, then an
     * <code>IOException</code> is thrown.
     * @param      b     the buffer into which the data is read.
     * @param      off   the start offset of the data.
     * @param      len   the maximum number of bytes read.
     * @return     the total number of bytes read into the buffer, or
     *             <code>-1</code> if there is no more data because the end of
     *             the stream has been reached.
     * @exception  IOException  if an I/O error occurs.
     */
public synchronized int read(byte b[], int off, int len) throws IOException {
    if (b == null) {
        throw new NullPointerException();
    } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
        throw new IndexOutOfBoundsException();
    } else if (len == 0) {
        return 0;
    }
    int c = read();
    if (c < 0) {
        return -1;
    }
    b[off] = (byte) c;
    int rlen = 1;
    while ((in >= 0) && (--len > 0)) {
        b[off + rlen] = buffer[out++];
        rlen++;
        if (out >= buffer.length) {
            out = 0;
        }
        if (in == out) {
            in = -1;
        }
    }
    return rlen;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.PipedOutputStream.connect(PipedInputStream)

/**
     * Connects this piped output stream to a receiver. If this object
     * is already connected to some other piped input stream, an 
     * <code>IOException</code> is thrown.
     * If <code>snk</code> is an unconnected piped input stream and 
     * <code>src</code> is an unconnected piped output stream, they may 
     * be connected by either the call:
     * <blockquote>
     * src.connect(snk)</blockquote>
     * or the call:
     * <blockquote>
     * snk.connect(src)</blockquote>
     * The two calls have the same effect.
     * @param      snk   the piped input stream to connect to.
     * @exception  IOException  if an I/O error occurs.
     */
public synchronized void connect(PipedInputStream snk) throws IOException {
    if (snk == null) {
        throw new NullPointerException();
    } else if (sink != null || snk.connected) {
        throw new IOException('Already connected');
    }
    sink = snk;
    snk.in = -1;
    snk.out = 0;
    snk.connected = true;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.PipedOutputStream.write(byte, int, int)

/**
     * Writes <code>len</code> bytes from the specified byte array 
     * starting at offset <code>off</code> to this piped output stream. 
     * If a thread was reading data bytes from the connected piped input 
     * stream, but the thread is no longer alive, then an 
     * <code>IOException</code> is thrown.
     * @param      b     the data.
     * @param      off   the start offset in the data.
     * @param      len   the number of bytes to write.
     * @exception  IOException  if an I/O error occurs.
     */
public void write(byte b[], int off, int len) throws IOException {
    if (sink == null) {
        throw new IOException('Pipe not connected');
    } else if (b == null) {
        throw new NullPointerException();
    } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
        throw new IndexOutOfBoundsException();
    } else if (len == 0) {
        return;
    }
    sink.receive(b, off, len);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.PipedWriter.connect(PipedReader)

/**
     * Connects this piped writer to a receiver. If this object
     * is already connected to some other piped reader, an 
     * <code>IOException</code> is thrown.
     * If <code>snk</code> is an unconnected piped reader and 
     * <code>src</code> is an unconnected piped writer, they may 
     * be connected by either the call:
     * <blockquote>
     * src.connect(snk)</blockquote>
     * or the call:
     * <blockquote>
     * snk.connect(src)</blockquote>
     * The two calls have the same effect.
     * @param      snk   the piped reader to connect to.
     * @exception  IOException  if an I/O error occurs.
     */
public synchronized void connect(PipedReader snk) throws IOException {
    if (snk == null) {
        throw new NullPointerException();
    } else if (sink != null || snk.connected) {
        throw new IOException('Already connected');
    } else if (snk.closedByReader || closed) {
        throw new IOException('Pipe closed');
    }
    sink = snk;
    snk.in = -1;
    snk.out = 0;
    snk.connected = true;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.SequenceInputStream.nextStream()

/**
     *  Continues reading in the next stream if an EOF is reached.
     */
final void nextStream() throws IOException {
    if (in != null) {
        in.close();
    }
    if (e.hasMoreElements()) {
        in = (InputStream) e.nextElement();
        if (in == null) throw new NullPointerException();
    } else in = null;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.SequenceInputStream.read(byte, int, int)

/**
     * Reads up to <code>len</code> bytes of data from this input stream
     * into an array of bytes. This method blocks until at least 1 byte
     * of input is available. If the first argument is <code>null</code>,
     * up to <code>len</code> bytes are read and discarded.
     * The <code>read</code> method of <code>SequenceInputStream</code>
     * tries to read the data from the current substream. If it fails to
     * read any characters because the substream has reached the end of
     * the stream, it calls the <code>close</code> method of the current
     * substream and begins reading from the next substream.
     * @param      b     the buffer into which the data is read.
     * @param      off   the start offset of the data.
     * @param      len   the maximum number of bytes read.
     * @return     int   the number of bytes read.
     * @exception  IOException  if an I/O error occurs.
     */
public int read(byte b[], int off, int len) throws IOException {
    if (in == null) {
        return -1;
    } else if (b == null) {
        throw new NullPointerException();
    } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
        throw new IndexOutOfBoundsException();
    } else if (len == 0) {
        return 0;
    }
    int n = in.read(b, off, len);
    if (n <= 0) {
        nextStream();
        return read(b, off, len);
    }
    return n;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.StringBufferInputStream.read(byte, int, int)

/**
     * Reads up to <code>len</code> bytes of data from this input stream
     * into an array of bytes.
     * The <code>read</code> method of
     * <code>StringBufferInputStream</code> cannot block. It copies the
     * low eight bits from the characters in this input stream's buffer into
     * the byte array argument.
     * @param      b     the buffer into which the data is read.
     * @param      off   the start offset of the data.
     * @param      len   the maximum number of bytes read.
     * @return     the total number of bytes read into the buffer, or
     *             <code>-1</code> if there is no more data because the end of
     *             the stream has been reached.
     */
public synchronized int read(byte b[], int off, int len) {
    if (b == null) {
        throw new NullPointerException();
    } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
        throw new IndexOutOfBoundsException();
    }
    if (pos >= count) {
        return -1;
    }
    if (pos + len > count) {
        len = count - pos;
    }
    if (len <= 0) {
        return 0;
    }
    String s = buffer;
    int cnt = len;
    while (--cnt >= 0) {
        b[off++] = (byte) s.charAt(pos++);
    }
    return len;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.ProcessBuilder.start()

/**
     * Starts a new process using the attributes of this process builder.
     * The new process will
     * invoke the command and arguments given by {@link #command()},
     * in a working directory as given by {@link #directory()},
     * with a process environment as given by {@link #environment()}.
     * This method checks that the command is a valid operating
     * system command.  Which commands are valid is system-dependent,
     * but at the very least the command must be a non-empty list of
     * non-null strings.
     * If there is a security manager, its
     * {@link SecurityManager#checkExec checkExec}
     * method is called with the first component of this object's
     * <code>command</code> array as its argument. This may result in
     * a {@link SecurityException} being thrown.
     * Starting an operating system process is highly system-dependent.
     * Among the many things that can go wrong are:
     * <ul>
     * <li>The operating system program file was not found.
     * <li>Access to the program file was denied.
     * <li>The working directory does not exist.
     * </ul>
     * In such cases an exception will be thrown.  The exact nature
     * of the exception is system-dependent, but it will always be a
     * subclass of {@link IOException}.
     * Subsequent modifications to this process builder will not
     * affect the returned {@link Process}.
     * @return  A new {@link Process} object for managing the subprocess
     * @throws  NullPointerException
     *          If an element of the command list is null
     * @throws  IndexOutOfBoundsException
     *          If the command is an empty list (has size <code>0</code>)
     * @throws  SecurityException
     *          If a security manager exists and its
     *          {@link SecurityManager#checkExec checkExec}
     *          method doesn't allow creation of the subprocess
     * @throws  IOException
     *          If an I/O error occurs
     * @see     Runtime#exec(String[], String[], java.io.File)
     * @see     SecurityManager#checkExec(String)
     */
public Process start() throws IOException {
    String[] cmdarray = command.toArray(new String[command.size()]);
    for (String arg : cmdarray) if (arg == null) throw new NullPointerException();
    String prog = cmdarray[0];
    SecurityManager security = System.getSecurityManager();
    if (security != null) security.checkExec(prog);
    String dir = directory == null ? null : directory.toString();
    return ProcessImpl.start(cmdarray, environment, dir, redirectErrorStream);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.ProcessEnvironment.nonNullString(Object)

private static String nonNullString(Object o) {
    if (o == null) throw new NullPointerException();
    return (String) o;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.Shutdown.remove(Thread)

static boolean remove(Thread hook) {
    synchronized (lock) {
        if (state > RUNNING) throw new IllegalStateException('Shutdown in progress');
        if (hook == null) throw new NullPointerException();
        if (hooks == null) {
            return false;
        } else {
            boolean rv = hooks.remove(new WrappedHook(hook));
            if (rv && hooks.isEmpty()) {
                hooks = null;
                Terminator.teardown();
            }
            return rv;
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.String.getBytes(String)

/**
     * Encodes this <tt>String</tt> into a sequence of bytes using the
     * named charset, storing the result into a new byte array.
     *  The behavior of this method when this string cannot be encoded in
     * the given charset is unspecified.  The {@link
     * java.nio.charset.CharsetEncoder} class should be used when more control
     * over the encoding process is required.
     * @param  charsetName
     *         the name of a supported
     *         {@link java.nio.charset.Charset </code>charset<code>}
     * @return  The resultant byte array
     * @exception  UnsupportedEncodingException
     *             If the named charset is not supported
     * @since      JDK1.1
     */
public byte[] getBytes(String charsetName) throws UnsupportedEncodingException {
    if (charsetName == null) throw new NullPointerException();
    return StringCoding.encode(charsetName, value, offset, count);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.String.toLowerCase(Locale)

/**
     * Converts all of the characters in this <code>String</code> to lower
     * case using the rules of the given <code>Locale</code>.  Case mapping is based
     * on the Unicode Standard version specified by the {@link java.lang.Character Character}
     * class. Since case mappings are not always 1:1 char mappings, the resulting 
     * <code>String</code> may be a different length than the original <code>String</code>.
     * Examples of lowercase  mappings are in the following table:
     * <table border='1' summary='Lowercase mapping examples showing language code of locale, upper case, lower case, and description'>
     * <tr>
     *   <th>Language Code of Locale</th>
     *   <th>Upper Case</th>
     *   <th>Lower Case</th>
     *   <th>Description</th>
     * </tr>
     * <tr>
     *   <td>tr (Turkish)</td>
     *   <td>\u0130</td>
     *   <td>\u0069</td>
     *   <td>capital letter I with dot above -> small letter i</td>
     * </tr>
     * <tr>
     *   <td>tr (Turkish)</td>
     *   <td>\u0049</td>
     *   <td>\u0131</td>
     *   <td>capital letter I -> small letter dotless i </td>
     * </tr>
     * <tr>
     *   <td>(all)</td>
     *   <td>French Fries</td>
     *   <td>french fries</td>
     *   <td>lowercased all chars in String</td>
     * </tr>
     * <tr>
     *   <td>(all)</td>
     *   <td><img src='doc-files/capiota.gif' alt='capiota'><img src='doc-files/capchi.gif' alt='capchi'>
     *       <img src='doc-files/captheta.gif' alt='captheta'><img src='doc-files/capupsil.gif' alt='capupsil'>
     *       <img src='doc-files/capsigma.gif' alt='capsigma'></td>
     *   <td><img src='doc-files/iota.gif' alt='iota'><img src='doc-files/chi.gif' alt='chi'>
     *       <img src='doc-files/theta.gif' alt='theta'><img src='doc-files/upsilon.gif' alt='upsilon'>
     *       <img src='doc-files/sigma1.gif' alt='sigma'></td>
     *   <td>lowercased all chars in String</td>
     * </tr>
     * </table>
     * @param locale use the case transformation rules for this locale
     * @return the <code>String</code>, converted to lowercase.
     * @see     java.lang.String#toLowerCase()
     * @see     java.lang.String#toUpperCase()
     * @see     java.lang.String#toUpperCase(Locale)
     * @since   1.1
     */
public String toLowerCase(Locale locale) {
    if (locale == null) {
        throw new NullPointerException();
    }
    int firstUpper;
    scan: {
        for (firstUpper = 0; firstUpper < count; ) {
            char c = value[offset + firstUpper];
            if ((c >= Character.MIN_HIGH_SURROGATE) && (c <= Character.MAX_HIGH_SURROGATE)) {
                int supplChar = codePointAt(firstUpper);
                if (supplChar != Character.toLowerCase(supplChar)) {
                    break scan;
                }
                firstUpper += Character.charCount(supplChar);
            } else {
                if (c != Character.toLowerCase(c)) {
                    break scan;
                }
                firstUpper++;
            }
        }
        return this;
    }
    char[] result = new char[count];
    int resultOffset = 0;
    System.arraycopy(value, offset, result, 0, firstUpper);
    String lang = locale.getLanguage();
    boolean localeDependent = (lang == 'tr' || lang == 'az' || lang == 'lt');
    char[] lowerCharArray;
    int lowerChar;
    int srcChar;
    int srcCount;
    for (int i = firstUpper; i < count; i += srcCount) {
        srcChar = (int) value[offset + i];
        if ((char) srcChar >= Character.MIN_HIGH_SURROGATE && (char) srcChar <= Character.MAX_HIGH_SURROGATE) {
            srcChar = codePointAt(i);
            srcCount = Character.charCount(srcChar);
        } else {
            srcCount = 1;
        }
        if (localeDependent || srcChar == '?') {
            lowerChar = ConditionalSpecialCasing.toLowerCaseEx(this, i, locale);
        } else {
            lowerChar = Character.toLowerCase(srcChar);
        }
        if ((lowerChar == Character.ERROR) || (lowerChar >= Character.MIN_SUPPLEMENTARY_CODE_POINT)) {
            if (lowerChar == Character.ERROR) {
                lowerCharArray = ConditionalSpecialCasing.toLowerCaseCharArray(this, i, locale);
            } else if (srcCount == 2) {
                resultOffset += Character.toChars(lowerChar, result, i + resultOffset) - srcCount;
                continue;
            } else {
                lowerCharArray = Character.toChars(lowerChar);
            }
            int mapLen = lowerCharArray.length;
            if (mapLen > srcCount) {
                char[] result2 = new char[result.length + mapLen - srcCount];
                System.arraycopy(result, 0, result2, 0, i + resultOffset);
                result = result2;
            }
            for (int x = 0; x < mapLen; ++x) {
                result[i + resultOffset + x] = lowerCharArray[x];
            }
            resultOffset += (mapLen - srcCount);
        } else {
            result[i + resultOffset] = (char) lowerChar;
        }
    }
    return new String(0, count + resultOffset, result);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.String.toUpperCase(Locale)

/**
     * Converts all of the characters in this <code>String</code> to upper
     * case using the rules of the given <code>Locale</code>. Case mapping is based
     * on the Unicode Standard version specified by the {@link java.lang.Character Character}
     * class. Since case mappings are not always 1:1 char mappings, the resulting 
     * <code>String</code> may be a different length than the original <code>String</code>.
     * Examples of locale-sensitive and 1:M case mappings are in the following table.
     * <table border='1' summary='Examples of locale-sensitive and 1:M case mappings. Shows Language code of locale, lower case, upper case, and description.'>
     * <tr>
     *   <th>Language Code of Locale</th>
     *   <th>Lower Case</th>
     *   <th>Upper Case</th>
     *   <th>Description</th>
     * </tr>
     * <tr>
     *   <td>tr (Turkish)</td>
     *   <td>\u0069</td>
     *   <td>\u0130</td>
     *   <td>small letter i -> capital letter I with dot above</td>
     * </tr>
     * <tr>
     *   <td>tr (Turkish)</td>
     *   <td>\u0131</td>
     *   <td>\u0049</td>
     *   <td>small letter dotless i -> capital letter I</td>
     * </tr>
     * <tr>
     *   <td>(all)</td>
     *   <td>\u00df</td>
     *   <td>\u0053 \u0053</td>
     *   <td>small letter sharp s -> two letters: SS</td>
     * </tr>
     * <tr>
     *   <td>(all)</td>
     *   <td>Fahrvergnügen</td>
     *   <td>FAHRVERGNÜGEN</td>
     *   <td></td>
     * </tr>
     * </table>
     * @param locale use the case transformation rules for this locale
     * @return the <code>String</code>, converted to uppercase.
     * @see     java.lang.String#toUpperCase()
     * @see     java.lang.String#toLowerCase()
     * @see     java.lang.String#toLowerCase(Locale)
     * @since   1.1
     */
public String toUpperCase(Locale locale) {
    if (locale == null) {
        throw new NullPointerException();
    }
    int firstLower;
    scan: {
        for (firstLower = 0; firstLower < count; ) {
            int c = (int) value[offset + firstLower];
            int srcCount;
            if ((c >= Character.MIN_HIGH_SURROGATE) && (c <= Character.MAX_HIGH_SURROGATE)) {
                c = codePointAt(firstLower);
                srcCount = Character.charCount(c);
            } else {
                srcCount = 1;
            }
            int upperCaseChar = Character.toUpperCaseEx(c);
            if ((upperCaseChar == Character.ERROR) || (c != upperCaseChar)) {
                break scan;
            }
            firstLower += srcCount;
        }
        return this;
    }
    char[] result = new char[count];
    int resultOffset = 0;
    System.arraycopy(value, offset, result, 0, firstLower);
    String lang = locale.getLanguage();
    boolean localeDependent = (lang == 'tr' || lang == 'az' || lang == 'lt');
    char[] upperCharArray;
    int upperChar;
    int srcChar;
    int srcCount;
    for (int i = firstLower; i < count; i += srcCount) {
        srcChar = (int) value[offset + i];
        if ((char) srcChar >= Character.MIN_HIGH_SURROGATE && (char) srcChar <= Character.MAX_HIGH_SURROGATE) {
            srcChar = codePointAt(i);
            srcCount = Character.charCount(srcChar);
        } else {
            srcCount = 1;
        }
        if (localeDependent) {
            upperChar = ConditionalSpecialCasing.toUpperCaseEx(this, i, locale);
        } else {
            upperChar = Character.toUpperCaseEx(srcChar);
        }
        if ((upperChar == Character.ERROR) || (upperChar >= Character.MIN_SUPPLEMENTARY_CODE_POINT)) {
            if (upperChar == Character.ERROR) {
                if (localeDependent) {
                    upperCharArray = ConditionalSpecialCasing.toUpperCaseCharArray(this, i, locale);
                } else {
                    upperCharArray = Character.toUpperCaseCharArray(srcChar);
                }
            } else if (srcCount == 2) {
                resultOffset += Character.toChars(upperChar, result, i + resultOffset) - srcCount;
                continue;
            } else {
                upperCharArray = Character.toChars(upperChar);
            }
            int mapLen = upperCharArray.length;
            if (mapLen > srcCount) {
                char[] result2 = new char[result.length + mapLen - srcCount];
                System.arraycopy(result, 0, result2, 0, i + resultOffset);
                result = result2;
            }
            for (int x = 0; x < mapLen; ++x) {
                result[i + resultOffset + x] = upperCharArray[x];
            }
            resultOffset += (mapLen - srcCount);
        } else {
            result[i + resultOffset] = (char) upperChar;
        }
    }
    return new String(0, count + resultOffset, result);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.System.nullInputStream()

/**
     * The following two methods exist because in, out, and err must be
     * initialized to null.  The compiler, however, cannot be permitted to
     * inline access to them, since they are later set to more sensible values
     * by initializeSystemClass().
     */
private static InputStream nullInputStream() throws NullPointerException {
    if (currentTimeMillis() > 0) return null;
    throw new NullPointerException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.System.nullPrintStream()

private static PrintStream nullPrintStream() throws NullPointerException {
    if (currentTimeMillis() > 0) return null;
    throw new NullPointerException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.net.NetworkInterface.getByInetAddress(InetAddress)

/**
     * Convenience method to search for a network interface that
     * has the specified Internet Protocol (IP) address bound to
     * it.
     * If the specified IP address is bound to multiple network 
     * interfaces it is not defined which network interface is
     * returned.
     * @param   addr
     *  The <tt>InetAddress</tt> to search with.
     * @return  A <tt>NetworkInterface</tt> 
     *          or <tt>null</tt> if there is no network interface
     *          with the specified IP address.
     * @throws  SocketException  
     *          If an I/O error occurs. 
     * @throws  NullPointerException
     *          If the specified address is <tt>null</tt>.
     */
public static NetworkInterface getByInetAddress(InetAddress addr) throws SocketException {
    if (addr == null) throw new NullPointerException();
    return getByInetAddress0(addr);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.net.NetworkInterface.getByName(String)

/**
     * Searches for the network interface with the specified name.
     * @param   name 
     *  The name of the network interface.
     * @return  A <tt>NetworkInterface</tt> with the specified name,
     *          or <tt>null</tt> if there is no network interface
     *  with the specified name.
     * @throws SocketException  
     *         If an I/O error occurs.
     * @throws  NullPointerException
     *  If the specified name is <tt>null</tt>.
     */
public static NetworkInterface getByName(String name) throws SocketException {
    if (name == null) throw new NullPointerException();
    return getByName0(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.MessageDigest.update(ByteBuffer)

/**
     * Update the digest using the specified ByteBuffer. The digest is
     * updated using the <code>input.remaining()</code> bytes starting
     * at <code>input.position()</code>.
     * Upon return, the buffer's position will be equal to its limit;
     * its limit will not have changed.
     * @param input the ByteBuffer
     * @since 1.5
     */
public final void update(ByteBuffer input) {
    if (input == null) {
        throw new NullPointerException();
    }
    engineUpdate(input);
    state = IN_PROGRESS;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.Provider.putService(Service)

/**
     * Add a service. If a service of the same type with the same algorithm
     * name exists and it was added using {@link #putService putService()}, 
     * it is replaced by the new service. 
     * This method also places information about this service
     * in the provider's Hashtable values in the format described in the
     * <a href='../../../guide/security/CryptoSpec.html'>
     * Java Cryptography Architecture API Specification & Reference </a>.
     * Also, if there is a security manager, its 
     * <code>checkSecurityAccess</code> method is called with the string 
     * <code>'putProviderProperty.'+name</code>, where <code>name</code> is 
     * the provider name, to see if it's ok to set this provider's property 
     * values. If the default implementation of <code>checkSecurityAccess</code>
     * is used (that is, that method is not overriden), then this results in
     * a call to the security manager's <code>checkPermission</code> method with
     * a <code>SecurityPermission('putProviderProperty.'+name)</code>
     * permission.
     * @param s the Service to add
     * @throws SecurityException
     *      if a security manager exists and its <code>{@link
     *      java.lang.SecurityManager#checkSecurityAccess}</code> method denies
     *      access to set property values.
     * @throws NullPointerException if s is null
     * @since 1.5
     */
protected synchronized void putService(Service s) {
    check('putProviderProperty.' + name);
    if (debug != null) {
        debug.println(name + '.putService(): ' + s);
    }
    if (s == null) {
        throw new NullPointerException();
    }
    if (serviceMap == null) {
        serviceMap = new LinkedHashMap<ServiceKey, Service>();
    }
    servicesChanged = true;
    String type = s.getType();
    String algorithm = s.getAlgorithm();
    ServiceKey key = new ServiceKey(type, algorithm, true);
    implRemoveService(serviceMap.get(key));
    serviceMap.put(key, s);
    for (String alias : s.getAliases()) {
        serviceMap.put(new ServiceKey(type, alias, true), s);
    }
    putPropertyStrings(s);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.Provider.removeService(Service)

/**
     * Remove a service previously added using 
     * {@link #putService putService()}. The specified service is removed from
     * this provider. It will no longer be returned by 
     * {@link #getService getService()} and its information will be removed 
     * from this provider's Hashtable.
     * Also, if there is a security manager, its 
     * <code>checkSecurityAccess</code> method is called with the string 
     * <code>'removeProviderProperty.'+name</code>, where <code>name</code> is 
     * the provider name, to see if it's ok to remove this provider's 
     * properties. If the default implementation of 
     * <code>checkSecurityAccess</code> is used (that is, that method is not 
     * overriden), then this results in a call to the security manager's 
     * <code>checkPermission</code> method with a
     * <code>SecurityPermission('removeProviderProperty.'+name)</code>
     * permission.
     * @param s the Service to be removed
     * @throws  SecurityException
     *          if a security manager exists and its <code>{@link
     *          java.lang.SecurityManager#checkSecurityAccess}</code> method denies
     *          access to remove this provider's properties.
     * @throws NullPointerException if s is null
     * @since 1.5
     */
protected synchronized void removeService(Service s) {
    check('removeProviderProperty.' + name);
    if (debug != null) {
        debug.println(name + '.removeService(): ' + s);
    }
    if (s == null) {
        throw new NullPointerException();
    }
    implRemoveService(s);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.Signature.update(ByteBuffer)

/**
     * Updates the data to be signed or verified using the specified
     * ByteBuffer. Processes the <code>data.remaining()</code> bytes
     * starting at at <code>data.position()</code>.
     * Upon return, the buffer's position will be equal to its limit;
     * its limit will not have changed.
     * @param data the ByteBuffer
     * @exception SignatureException if this signature object is not
     * initialized properly.
     * @since 1.5
     */
public final void update(ByteBuffer data) throws SignatureException {
    if ((state != SIGN) && (state != VERIFY)) {
        throw new SignatureException('object not initialized for ' + 'signature or verification');
    }
    if (data == null) {
        throw new NullPointerException();
    }
    engineUpdate(data);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.text.AttributedString.addAttribute(Attribute, Object)

/**
     * Adds an attribute to the entire string.
     * @param attribute the attribute key
     * @param value the value of the attribute; may be null
     * @exception IllegalArgumentException if the AttributedString has length 0
     * (attributes cannot be applied to a 0-length range).
     */
public void addAttribute(Attribute attribute, Object value) {
    if (attribute == null) {
        throw new NullPointerException();
    }
    int len = length();
    if (len == 0) {
        throw new IllegalArgumentException('Can't add attribute to 0-length text');
    }
    addAttributeImpl(attribute, value, 0, len);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.text.AttributedString.addAttribute(Attribute, Object, int, int)

/**
     * Adds an attribute to a subrange of the string.
     * @param attribute the attribute key
     * @param value The value of the attribute. May be null.
     * @param beginIndex Index of the first character of the range.
     * @param endIndex Index of the character following the last character of the range.
     * @exception IllegalArgumentException if beginIndex is less then 0, endIndex is
     * greater than the length of the string, or beginIndex and endIndex together don't
     * define a non-empty subrange of the string.
     */
public void addAttribute(Attribute attribute, Object value, int beginIndex, int endIndex) {
    if (attribute == null) {
        throw new NullPointerException();
    }
    if (beginIndex < 0 || endIndex > length() || beginIndex >= endIndex) {
        throw new IllegalArgumentException('Invalid substring range');
    }
    addAttributeImpl(attribute, value, beginIndex, endIndex);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.text.DecimalFormatSymbols.setCurrency(Currency)

/**
     * Sets the currency of these DecimalFormatSymbols.
     * This also sets the currency symbol attribute to the currency's symbol
     * in the DecimalFormatSymbols' locale, and the international currency
     * symbol attribute to the currency's ISO 4217 currency code.
     * @param currency the new currency to be used
     * @exception NullPointerException if <code>currency</code> is null
     * @since 1.4
     * @see #setCurrencySymbol
     * @see #setInternationalCurrencySymbol
     */
public void setCurrency(Currency currency) {
    if (currency == null) {
        throw new NullPointerException();
    }
    this.currency = currency;
    intlCurrencySymbol = currency.getCurrencyCode();
    currencySymbol = currency.getSymbol(locale);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.text.StringCharacterIterator.setText(String)

/**
     * Reset this iterator to point to a new string.  This package-visible
     * method is used by other java.text classes that want to avoid allocating
     * new StringCharacterIterator objects every time their setText method
     * is called.
     * @param  text   The String to be iterated over
     * @since 1.2
     */
public void setText(String text) {
    if (text == null) throw new NullPointerException();
    this.text = text;
    this.begin = 0;
    this.end = text.length();
    this.pos = 0;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Currency.getInstance(Locale)

/**
     * Returns the <code>Currency</code> instance for the country of the
     * given locale. The language and variant components of the locale
     * are ignored. The result may vary over time, as countries change their
     * currencies. For example, for the original member countries of the
     * European Monetary Union, the method returns the old national currencies
     * until December 31, 2001, and the Euro from January 1, 2002, local time
     * of the respective countries.
     * The method returns <code>null</code> for territories that don't
     * have a currency, such as Antarctica.
     * @param locale the locale for whose country a <code>Currency</code>
     * instance is needed
     * @return the <code>Currency</code> instance for the country of the given
     * locale, or null
     * @exception NullPointerException if <code>locale</code> or its country
     * code is null
     * @exception IllegalArgumentException if the country of the given locale
     * is not a supported ISO 3166 country code.
     */
public static Currency getInstance(Locale locale) {
    String country = locale.getCountry();
    if (country == null) {
        throw new NullPointerException();
    }
    if (country.length() != 2) {
        throw new IllegalArgumentException();
    }
    char char1 = country.charAt(0);
    char char2 = country.charAt(1);
    int tableEntry = getMainTableEntry(char1, char2);
    if ((tableEntry & COUNTRY_TYPE_MASK) == SIMPLE_CASE_COUNTRY_MASK && tableEntry != INVALID_COUNTRY_ENTRY) {
        char finalChar = (char) ((tableEntry & SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK) + 'A');
        int defaultFractionDigits = (tableEntry & SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK) >> SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_SHIFT;
        StringBuffer sb = new StringBuffer(country);
        sb.append(finalChar);
        return getInstance(sb.toString(), defaultFractionDigits);
    } else {
        if (tableEntry == INVALID_COUNTRY_ENTRY) {
            throw new IllegalArgumentException();
        }
        if (tableEntry == COUNTRY_WITHOUT_CURRENCY_ENTRY) {
            return null;
        } else {
            int index = (tableEntry & SPECIAL_CASE_COUNTRY_INDEX_MASK) - SPECIAL_CASE_COUNTRY_INDEX_DELTA;
            if (scCutOverTimes[index] == Long.MAX_VALUE || System.currentTimeMillis() < scCutOverTimes[index]) {
                return getInstance(scOldCurrencies[index], scOldCurrenciesDFD[index]);
            } else {
                return getInstance(scNewCurrencies[index], scNewCurrenciesDFD[index]);
            }
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Hashtable.contains(Object)

/**
     * Tests if some key maps into the specified value in this hashtable.
     * This operation is more expensive than the <code>containsKey</code>
     * method.
     * Note that this method is identical in functionality to containsValue,
     * (which is part of the Map interface in the collections framework).
     * @param      value   a value to search for.
     * @return     <code>true</code> if and only if some key maps to the
     *             <code>value</code> argument in this hashtable as 
     *             determined by the <tt>equals</tt> method;
     *             <code>false</code> otherwise.
     * @exception  NullPointerException  if the value is <code>null</code>.
     * @see        #containsKey(Object)
     * @see        #containsValue(Object)
     * @see    Map
     */
public synchronized boolean contains(Object value) {
    if (value == null) {
        throw new NullPointerException();
    }
    Entry tab[] = table;
    for (int i = tab.length; i-- > 0; ) {
        for (Entry<K, V> e = tab[i]; e != null; e = e.next) {
            if (e.value.equals(value)) {
                return true;
            }
        }
    }
    return false;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Hashtable.put(K, V)

/**
     * Maps the specified <code>key</code> to the specified 
     * <code>value</code> in this hashtable. Neither the key nor the 
     * value can be <code>null</code>. 
     * The value can be retrieved by calling the <code>get</code> method 
     * with a key that is equal to the original key. 
     * @param      key     the hashtable key.
     * @param      value   the value.
     * @return     the previous value of the specified key in this hashtable,
     *             or <code>null</code> if it did not have one.
     * @exception  NullPointerException  if the key or value is
     *               <code>null</code>.
     * @see     Object#equals(Object)
     * @see     #get(Object)
     */
public synchronized V put(K key, V value) {
    if (value == null) {
        throw new NullPointerException();
    }
    Entry tab[] = table;
    int hash = key.hashCode();
    int index = (hash & 0x7FFFFFFF) % tab.length;
    for (Entry<K, V> e = tab[index]; e != null; e = e.next) {
        if ((e.hash == hash) && e.key.equals(key)) {
            V old = e.value;
            e.value = value;
            return old;
        }
    }
    modCount++;
    if (count >= threshold) {
        rehash();
        tab = table;
        index = (hash & 0x7FFFFFFF) % tab.length;
    }
    Entry<K, V> e = tab[index];
    tab[index] = new Entry<K, V>(hash, key, value, e);
    count++;
    return null;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.ListResourceBundle.handleGetObject(String)

public final Object handleGetObject(String key) {
    if (lookup == null) {
        loadLookup();
    }
    if (key == null) {
        throw new NullPointerException();
    }
    return lookup.get(key);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.ListResourceBundle.loadLookup()

/**
     * We lazily load the lookup hashtable.  This function does the
     * loading.
     */
private synchronized void loadLookup() {
    if (lookup != null) return;
    Object[][] contents = getContents();
    HashMap temp = new HashMap(contents.length);
    for (int i = 0; i < contents.length; ++i) {
        String key = (String) contents[i][0];
        Object value = contents[i][1];
        if (key == null || value == null) {
            throw new NullPointerException();
        }
        temp.put(key, value);
    }
    lookup = temp;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Observable.addObserver(Observer)

/**
     * Adds an observer to the set of observers for this object, provided 
     * that it is not the same as some observer already in the set. 
     * The order in which notifications will be delivered to multiple 
     * observers is not specified. See the class comment.
     * @param   o   an observer to be added.
     * @throws NullPointerException   if the parameter o is null.
     */
public synchronized void addObserver(Observer o) {
    if (o == null) throw new NullPointerException();
    if (!obs.contains(o)) {
        obs.addElement(o);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.PriorityQueue.offer(E)

/**
     * Inserts the specified element into this priority queue.
     * @return <tt>true</tt>
     * @throws ClassCastException if the specified element cannot be compared
     * with elements currently in the priority queue according
     * to the priority queue's ordering.
     * @throws NullPointerException if the specified element is <tt>null</tt>.
     */
public boolean offer(E o) {
    if (o == null) throw new NullPointerException();
    modCount++;
    ++size;
    if (size >= queue.length) grow(size);
    queue[size] = o;
    fixUp(size);
    return true;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Properties.loadFromXML(InputStream)

/**
     * Loads all of the properties represented by the XML document on the
     * specified input stream into this properties table.
     * The XML document must have the following DOCTYPE declaration:
     * <!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>
     * Furthermore, the document must satisfy the properties DTD described
     * above.
     * The specified stream remains open after this method returns.
     * @param in the input stream from which to read the XML document.
     * @throws IOException if reading from the specified input stream
     *         results in an <tt>IOException</tt>.
     * @throws InvalidPropertiesFormatException Data on input stream does not
     *         constitute a valid XML document with the mandated document type.
     * @throws NullPointerException if <code>in</code> is null.
     * @see    #storeToXML(OutputStream, String, String)
     * @since 1.5
     */
public synchronized void loadFromXML(InputStream in) throws IOException, InvalidPropertiesFormatException {
    if (in == null) throw new NullPointerException();
    XMLUtils.load(this, in);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Properties.storeToXML(OutputStream, String)

/**
     * Emits an XML document representing all of the properties contained
     * in this table.
     *  An invocation of this method of the form <tt>props.storeToXML(os,
     * comment)</tt> behaves in exactly the same way as the invocation
     * <tt>props.storeToXML(os, comment, 'UTF-8');</tt>.
     * @param os the output stream on which to emit the XML document.
     * @param comment a description of the property list, or <code>null</code>
     *        if no comment is desired.
     * @throws IOException if writing to the specified output stream
     *         results in an <tt>IOException</tt>.
     * @throws NullPointerException if <code>os</code> is null.
     * @see    #loadFromXML(InputStream)
     * @since 1.5
     */
public synchronized void storeToXML(OutputStream os, String comment) throws IOException {
    if (os == null) throw new NullPointerException();
    storeToXML(os, comment, 'UTF-8');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Properties.storeToXML(OutputStream, String, String)

/**
     * Emits an XML document representing all of the properties contained
     * in this table, using the specified encoding.
     * The XML document will have the following DOCTYPE declaration:
     * <!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>
     *
     *If the specified comment is <code>null</code> then no comment
     * will be stored in the document.
     * The specified stream remains open after this method returns.
     * @param os the output stream on which to emit the XML document.
     * @param comment a description of the property list, or <code>null</code>
     *        if no comment is desired.
     * @throws IOException if writing to the specified output stream
     *         results in an <tt>IOException</tt>.
     * @throws NullPointerException if <code>os</code> is <code>null</code>,
     *         or if <code>encoding</code> is <code>null</code>.
     * @see    #loadFromXML(InputStream)
     * @since 1.5
     */
public synchronized void storeToXML(OutputStream os, String comment, String encoding) throws IOException {
    if (os == null) throw new NullPointerException();
    XMLUtils.save(this, os, comment, encoding);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.PropertyResourceBundle.handleGetObject(String)

public Object handleGetObject(String key) {
    if (key == null) {
        throw new NullPointerException();
    }
    return lookup.get(key);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.ResourceBundle.getBundle(String, Locale, ClassLoader)

/**
     * Gets a resource bundle using the specified base name, locale, and class loader.
     * 
     * Conceptually, <code>getBundle</code> uses the following strategy for locating and instantiating
     * resource bundles:
     * <code>getBundle</code> uses the base name, the specified locale, and the default
     * locale (obtained from {@link java.util.Locale#getDefault() Locale.getDefault})
     * to generate a sequence of <em>candidate bundle names</em>.
     * If the specified locale's language, country, and variant are all empty
     * strings, then the base name is the only candidate bundle name.
     * Otherwise, the following sequence is generated from the attribute
     * values of the specified locale (language1, country1, and variant1)
     * and of the default locale (language2, country2, and variant2):
     * <ul>
     * <li> baseName + '_' + language1 + '_' + country1 + '_' + variant1
     * <li> baseName + '_' + language1 + '_' + country1
     * <li> baseName + '_' + language1
     * <li> baseName + '_' + language2 + '_' + country2 + '_' + variant2
     * <li> baseName + '_' + language2 + '_' + country2
     * <li> baseName + '_' + language2
     * <li> baseName
     * </ul>
     * Candidate bundle names where the final component is an empty string are omitted.
     * For example, if country1 is an empty string, the second candidate bundle name is omitted.
     * 
     * <code>getBundle</code> then iterates over the candidate bundle names to find the first
     * one for which it can <em>instantiate</em> an actual resource bundle. For each candidate
     * bundle name, it attempts to create a resource bundle:
     * <ul>
     * <li>
     * First, it attempts to load a class using the candidate bundle name.
     * If such a class can be found and loaded using the specified class loader, is assignment
     * compatible with ResourceBundle, is accessible from ResourceBundle, and can be instantiated,
     * <code>getBundle</code> creates a new instance of this class and uses it as the <em>result
     * resource bundle</em>.
     * <li>
     * Otherwise, <code>getBundle</code> attempts to locate a property resource file.
     * It generates a path name from the candidate bundle name by replacing all '.' characters
     * with '/' and appending the string '.properties'.
     * It attempts to find a 'resource' with this name using
     * {@link java.lang.ClassLoader#getResource(java.lang.String) ClassLoader.getResource}.
     * (Note that a 'resource' in the sense of <code>getResource</code> has nothing to do with
     * the contents of a resource bundle, it is just a container of data, such as a file.)
     * If it finds a 'resource', it attempts to create a new
     * {@link PropertyResourceBundle} instance from its contents.
     * If successful, this instance becomes the <em>result resource bundle</em>.
     * </ul>
     * 
     * If no result resource bundle has been found, a <code>MissingResourceException</code>
     * is thrown.
     * 
     * Once a result resource bundle has been found, its parent chain is instantiated.
     * <code>getBundle</code> iterates over the candidate bundle names that can be
     * obtained by successively removing variant, country, and language
     * (each time with the preceding '_') from the bundle name of the result resource bundle.
     * As above, candidate bundle names where the final component is an empty string are omitted.
     * With each of the candidate bundle names it attempts to instantiate a resource bundle, as
     * described above.
     * Whenever it succeeds, it calls the previously instantiated resource
     * bundle's {@link #setParent(java.util.ResourceBundle) setParent} method
     * with the new resource bundle, unless the previously instantiated resource
     * bundle already has a non-null parent.
     * 
     * Implementations of <code>getBundle</code> may cache instantiated resource bundles
     * and return the same resource bundle instance multiple times. They may also
     * vary the sequence in which resource bundles are instantiated as long as the
     * selection of the result resource bundle and its parent chain are compatible with
     * the description above.
     * 
     * The <code>baseName</code> argument should be a fully qualified class name. However, for
     * compatibility with earlier versions, Sun's Java 2 runtime environments do not verify this,
     * and so it is possible to access <code>PropertyResourceBundle</code>s by specifying a
     * path name (using '/') instead of a fully qualified class name (using '.').
     * 
     * <strong>Example:</strong> The following class and property files are provided:
     * MyResources.class, MyResources_fr_CH.properties, MyResources_fr_CH.class,
     * MyResources_fr.properties, MyResources_en.properties, MyResources_es_ES.class.
     * The contents of all files are valid (that is, public non-abstract subclasses of ResourceBundle for
     * the '.class' files, syntactically correct '.properties' files).
     * The default locale is <code>Locale('en', 'GB')</code>.
     * Calling <code>getBundle</code> with the shown locale argument values instantiates
     * resource bundles from the following sources:
     * <ul>
     * <li>Locale('fr', 'CH'): result MyResources_fr_CH.class, parent MyResources_fr.properties, parent MyResources.class
     * <li>Locale('fr', 'FR'): result MyResources_fr.properties, parent MyResources.class
     * <li>Locale('de', 'DE'): result MyResources_en.properties, parent MyResources.class
     * <li>Locale('en', 'US'): result MyResources_en.properties, parent MyResources.class
     * <li>Locale('es', 'ES'): result MyResources_es_ES.class, parent MyResources.class
     * </ul>
     * The file MyResources_fr_CH.properties is never used because it is hidden by
     * MyResources_fr_CH.class.
     * 
     * @param baseName the base name of the resource bundle, a fully qualified class name
     * @param locale the locale for which a resource bundle is desired
     * @param loader the class loader from which to load the resource bundle
     * @exception java.lang.NullPointerException
     *     if <code>baseName</code>, <code>locale</code>, or <code>loader</code> is <code>null</code>
     * @exception MissingResourceException
     *     if no resource bundle for the specified base name can be found
     * @return a resource bundle for the given base name and locale
     * @since 1.2
     */
public static ResourceBundle getBundle(String baseName, Locale locale, ClassLoader loader) {
    if (loader == null) {
        throw new NullPointerException();
    }
    return getBundleImpl(baseName, locale, loader);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.ResourceBundle.getBundleImpl(String, Locale, ClassLoader)

private static ResourceBundle getBundleImpl(String baseName, Locale locale, ClassLoader loader) {
    if (baseName == null) {
        throw new NullPointerException();
    }
    String bundleName = baseName;
    String localeSuffix = locale.toString();
    if (localeSuffix.length() > 0) {
        bundleName += '_' + localeSuffix;
    } else if (locale.getVariant().length() > 0) {
        bundleName += '___' + locale.getVariant();
    }
    Locale defaultLocale = Locale.getDefault();
    Object lookup = findBundleInCache(loader, bundleName, defaultLocale);
    if (lookup == NOT_FOUND) {
        throwMissingResourceException(baseName, locale);
    } else if (lookup != null) {
        return (ResourceBundle) lookup;
    }
    Object parent = NOT_FOUND;
    try {
        Object root = findBundle(loader, baseName, defaultLocale, baseName, null);
        if (root == null) {
            putBundleInCache(loader, baseName, defaultLocale, NOT_FOUND);
            root = NOT_FOUND;
        }
        final Vector names = calculateBundleNames(baseName, locale);
        Vector bundlesFound = new Vector(MAX_BUNDLES_SEARCHED);
        boolean foundInMainBranch = (root != NOT_FOUND && names.size() == 0);
        if (!foundInMainBranch) {
            parent = root;
            for (int i = 0; i < names.size(); i++) {
                bundleName = (String) names.elementAt(i);
                lookup = findBundle(loader, bundleName, defaultLocale, baseName, parent);
                bundlesFound.addElement(lookup);
                if (lookup != null) {
                    parent = lookup;
                    foundInMainBranch = true;
                }
            }
        }
        parent = root;
        if (!foundInMainBranch) {
            final Vector fallbackNames = calculateBundleNames(baseName, defaultLocale);
            for (int i = 0; i < fallbackNames.size(); i++) {
                bundleName = (String) fallbackNames.elementAt(i);
                if (names.contains(bundleName)) {
                    break;
                }
                lookup = findBundle(loader, bundleName, defaultLocale, baseName, parent);
                if (lookup != null) {
                    parent = lookup;
                } else {
                    putBundleInCache(loader, bundleName, defaultLocale, parent);
                }
            }
        }
        parent = propagate(loader, names, bundlesFound, defaultLocale, parent);
    } catch (Exception e) {
        cleanUpConstructionList();
        throwMissingResourceException(baseName, locale);
    } catch (Error e) {
        cleanUpConstructionList();
        throw e;
    }
    if (parent == NOT_FOUND) {
        throwMissingResourceException(baseName, locale);
    }
    return (ResourceBundle) parent;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Scanner.findInLine(Pattern)

/**
     * Attempts to find the next occurrence of the specified pattern ignoring
     * delimiters. If the pattern is found before the next line separator, the
     * scanner advances past the input that matched and returns the string that
     * matched the pattern.
     * If no such pattern is detected in the input up to the next line
     * separator, then <code>null</code> is returned and the scanner's 
     * position is unchanged. This method may block waiting for input that 
     * matches the pattern.
     * Since this method continues to search through the input looking
     * for the specified pattern, it may buffer all of the input searching for
     * the desired token if no line separators are present.
     * @param pattern the pattern to scan for
     * @return the text that matched the specified pattern
     * @throws IllegalStateException if this scanner is closed
     */
public String findInLine(Pattern pattern) {
    ensureOpen();
    if (pattern == null) throw new NullPointerException();
    clearCaches();
    int endPosition = 0;
    saveState();
    while (true) {
        String token = findPatternInBuffer(separatorPattern(), 0);
        if (token != null) {
            endPosition = matcher.start();
            break;
        }
        if (needInput) {
            readInput();
        } else {
            endPosition = buf.limit();
            break;
        }
    }
    revertState();
    int horizonForLine = endPosition - position;
    return findWithinHorizon(pattern, horizonForLine);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Scanner.findWithinHorizon(Pattern, int)

/**
     * Attempts to find the next occurrence of the specified pattern.
     * This method searches through the input up to the specified
     * search horizon, ignoring delimiters. If the pattern is found the 
     * scanner advances past the input that matched and returns the string 
     * that matched the pattern. If no such pattern is detected then the 
     * null is returned and the scanner's position remains unchanged. This 
     * method may block waiting for input that matches the pattern.
     * A scanner will never search more than <code>horizon</code> code
     * points beyond its current position. Note that a match may be clipped
     * by the horizon; that is, an arbitrary match result may have been 
     * different if the horizon had been larger. The scanner treats the
     * horizon as a transparent, non-anchoring bound (see {@link 
     * Matcher#useTransparentBounds} and {@link Matcher#useAnchoringBounds}).
     * If horizon is <code>0</code>, then the horizon is ignored and
     * this method continues to search through the input looking for the 
     * specified pattern without bound. In this case it may buffer all of
     * the input searching for the pattern.
     * If horizon is negative, then an IllegalArgumentException is
     * thrown.
     * @param pattern the pattern to scan for
     * @return the text that matched the specified pattern
     * @throws IllegalStateException if this scanner is closed
     * @throws IllegalArgumentException if horizon is negative
     */
public String findWithinHorizon(Pattern pattern, int horizon) {
    ensureOpen();
    if (pattern == null) throw new NullPointerException();
    if (horizon < 0) throw new IllegalArgumentException('horizon < 0');
    clearCaches();
    while (true) {
        String token = findPatternInBuffer(pattern, horizon);
        if (token != null) {
            matchValid = true;
            return token;
        }
        if (needInput) readInput(); else break;
    }
    return null;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Scanner.hasNext(Pattern)

/**
     * Returns true if the next complete token matches the specified pattern.
     * A complete token is prefixed and postfixed by input that matches
     * the delimiter pattern. This method may block while waiting for input.
     * The scanner does not advance past any input.
     * @param pattern the pattern to scan for
     * @return true if and only if this scanner has another token matching
     *         the specified pattern
     * @throws IllegalStateException if this scanner is closed
     */
public boolean hasNext(Pattern pattern) {
    ensureOpen();
    if (pattern == null) throw new NullPointerException();
    hasNextPattern = null;
    saveState();
    while (true) {
        if (getCompleteTokenInBuffer(pattern) != null) {
            matchValid = true;
            cacheResult(pattern);
            return revertState(true);
        }
        if (needInput) readInput(); else return revertState(false);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Scanner.next(Pattern)

/**
     * Returns the next token if it matches the specified pattern. This 
     * method may block while waiting for input to scan, even if a previous
     * invocation of {@link #hasNext(Pattern)} returned <code>true</code>. 
     * If the match is successful, the scanner advances past the input that 
     * matched the pattern.
     * @param pattern the pattern to scan for
     * @return the next token
     * @throws NoSuchElementException if no more tokens are available
     * @throws IllegalStateException if this scanner is closed
     */
public String next(Pattern pattern) {
    ensureOpen();
    if (pattern == null) throw new NullPointerException();
    if (hasNextPattern == pattern) return getCachedResult();
    clearCaches();
    while (true) {
        String token = getCompleteTokenInBuffer(pattern);
        if (token != null) {
            matchValid = true;
            skipped = false;
            return token;
        }
        if (needInput) readInput(); else throwFor();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Scanner.skip(Pattern)

/**
     * Skips input that matches the specified pattern, ignoring delimiters.
     * This method will skip input if an anchored match of the specified
     * pattern succeeds.
     * If a match to the specified pattern is not found at the
     * current position, then no input is skipped and a 
     * <tt>NoSuchElementException</tt> is thrown.
     * Since this method seeks to match the specified pattern starting at
     * the scanner's current position, patterns that can match a lot of
     * input ('.*', for example) may cause the scanner to buffer a large
     * amount of input.
     * Note that it is possible to skip something without risking a
     * <code>NoSuchElementException</code> by using a pattern that can
     * match nothing, e.g., <code>sc.skip('[ \t]*')</code>.
     * @param pattern a string specifying the pattern to skip over
     * @return this scanner
     * @throws NoSuchElementException if the specified pattern is not found
     * @throws IllegalStateException if this scanner is closed
     */
public Scanner skip(Pattern pattern) {
    ensureOpen();
    if (pattern == null) throw new NullPointerException();
    clearCaches();
    while (true) {
        String token = matchPatternInBuffer(pattern);
        if (token != null) {
            matchValid = true;
            position = matcher.end();
            return this;
        }
        if (needInput) readInput(); else throw new NoSuchElementException();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.StringTokenizer.skipDelimiters(int)

/**
     * Skips delimiters starting from the specified position. If retDelims
     * is false, returns the index of the first non-delimiter character at or
     * after startPos. If retDelims is true, startPos is returned.
     */
private int skipDelimiters(int startPos) {
    if (delimiters == null) throw new NullPointerException();
    int position = startPos;
    while (!retDelims && position < maxPosition) {
        if (!hasSurrogates) {
            char c = str.charAt(position);
            if ((c > maxDelimCodePoint) || (delimiters.indexOf(c) < 0)) break;
            position++;
        } else {
            int c = str.codePointAt(position);
            if ((c > maxDelimCodePoint) || !isDelimiter(c)) {
                break;
            }
            position += Character.charCount(c);
        }
    }
    return position;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.TimeZone.setID(String)

/**
     * Sets the time zone ID. This does not change any other data in
     * the time zone object.
     * @param ID the new time zone ID.
     */
public void setID(String ID) {
    if (ID == null) {
        throw new NullPointerException();
    }
    this.ID = ID;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.AbstractExecutorService.submit(Runnable)

public Future<?> submit(Runnable task) {
    if (task == null) throw new NullPointerException();
    FutureTask<Object> ftask = new FutureTask<Object>(task, null);
    execute(ftask);
    return ftask;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.AbstractExecutorService.submit(Runnable, T)

public <T> Future<T> submit(Runnable task, T result) {
    if (task == null) throw new NullPointerException();
    FutureTask<T> ftask = new FutureTask<T>(task, result);
    execute(ftask);
    return ftask;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ArrayBlockingQueue.offer(E)

/**
     * Inserts the specified element at the tail of this queue if possible,
     * returning immediately if this queue is full.
     * @param o the element to add.
     * @return <tt>true</tt> if it was possible to add the element to
     *         this queue, else <tt>false</tt>
     * @throws NullPointerException if the specified element is <tt>null</tt>
     */
public boolean offer(E o) {
    if (o == null) throw new NullPointerException();
    final ReentrantLock lock = this.lock;
    lock.lock();
    try {
        if (count == items.length) return false; else {
            insert(o);
            return true;
        }
    } finally {
        lock.unlock();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ArrayBlockingQueue.offer(E, long, TimeUnit)

/**
     * Inserts the specified element at the tail of this queue, waiting if
     * necessary up to the specified wait time for space to become available.
     * @param o the element to add
     * @param timeout how long to wait before giving up, in units of
     * <tt>unit</tt>
     * @param unit a <tt>TimeUnit</tt> determining how to interpret the
     * <tt>timeout</tt> parameter
     * @return <tt>true</tt> if successful, or <tt>false</tt> if
     * the specified waiting time elapses before space is available.
     * @throws InterruptedException if interrupted while waiting.
     * @throws NullPointerException if the specified element is <tt>null</tt>.
     */
public boolean offer(E o, long timeout, TimeUnit unit) throws InterruptedException {
    if (o == null) throw new NullPointerException();
    final ReentrantLock lock = this.lock;
    lock.lockInterruptibly();
    try {
        long nanos = unit.toNanos(timeout);
        for (; ; ) {
            if (count != items.length) {
                insert(o);
                return true;
            }
            if (nanos <= 0) return false;
            try {
                nanos = notFull.awaitNanos(nanos);
            } catch (InterruptedException ie) {
                notFull.signal();
                throw ie;
            }
        }
    } finally {
        lock.unlock();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ArrayBlockingQueue.put(E)

/**
     * Adds the specified element to the tail of this queue, waiting if
     * necessary for space to become available.
     * @param o the element to add
     * @throws InterruptedException if interrupted while waiting.
     * @throws NullPointerException if the specified element is <tt>null</tt>.
     */
public void put(E o) throws InterruptedException {
    if (o == null) throw new NullPointerException();
    final E[] items = this.items;
    final ReentrantLock lock = this.lock;
    lock.lockInterruptibly();
    try {
        try {
            while (count == items.length) notFull.await();
        } catch (InterruptedException ie) {
            notFull.signal();
            throw ie;
        }
        insert(o);
    } finally {
        lock.unlock();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ConcurrentHashMap.containsValue(Object)

/**
     * Returns <tt>true</tt> if this map maps one or more keys to the
     * specified value. Note: This method requires a full internal
     * traversal of the hash table, and so is much slower than
     * method <tt>containsKey</tt>.
     * @param value value whose presence in this map is to be tested.
     * @return <tt>true</tt> if this map maps one or more keys to the
     * specified value.
     * @throws  NullPointerException  if the value is <tt>null</tt>.
     */
public boolean containsValue(Object value) {
    if (value == null) throw new NullPointerException();
    final Segment[] segments = this.segments;
    int[] mc = new int[segments.length];
    for (int k = 0; k < RETRIES_BEFORE_LOCK; ++k) {
        int sum = 0;
        int mcsum = 0;
        for (int i = 0; i < segments.length; ++i) {
            int c = segments[i].count;
            mcsum += mc[i] = segments[i].modCount;
            if (segments[i].containsValue(value)) return true;
        }
        boolean cleanSweep = true;
        if (mcsum != 0) {
            for (int i = 0; i < segments.length; ++i) {
                int c = segments[i].count;
                if (mc[i] != segments[i].modCount) {
                    cleanSweep = false;
                    break;
                }
            }
        }
        if (cleanSweep) return false;
    }
    for (int i = 0; i < segments.length; ++i) segments[i].lock();
    boolean found = false;
    try {
        for (int i = 0; i < segments.length; ++i) {
            if (segments[i].containsValue(value)) {
                found = true;
                break;
            }
        }
    } finally {
        for (int i = 0; i < segments.length; ++i) segments[i].unlock();
    }
    return found;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ConcurrentHashMap.put(K, V)

/**
     * Maps the specified <tt>key</tt> to the specified
     * <tt>value</tt> in this table. Neither the key nor the
     * value can be <tt>null</tt>. 
     *  The value can be retrieved by calling the <tt>get</tt> method
     * with a key that is equal to the original key.
     * @param      key     the table key.
     * @param      value   the value.
     * @return     the previous value of the specified key in this table,
     *             or <tt>null</tt> if it did not have one.
     * @throws  NullPointerException  if the key or value is
     *               <tt>null</tt>.
     */
public V put(K key, V value) {
    if (value == null) throw new NullPointerException();
    int hash = hash(key);
    return segmentFor(hash).put(key, hash, value, false);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ConcurrentHashMap.putIfAbsent(K, V)

/**
     * If the specified key is not already associated
     * with a value, associate it with the given value.
     * This is equivalent to
     *   if (!map.containsKey(key)) 
     *      return map.put(key, value);
     *   else
     *      return map.get(key);
     * Except that the action is performed atomically.
     * @param key key with which the specified value is to be associated.
     * @param value value to be associated with the specified key.
     * @return previous value associated with specified key, or <tt>null</tt>
     *         if there was no mapping for key.
     * @throws NullPointerException if the specified key or value is
     *            <tt>null</tt>.
     */
public V putIfAbsent(K key, V value) {
    if (value == null) throw new NullPointerException();
    int hash = hash(key);
    return segmentFor(hash).put(key, hash, value, true);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ConcurrentHashMap.replace(K, V)

/**
     * Replace entry for key only if currently mapped to some value.
     * Acts as
     *  if ((map.containsKey(key)) {
     *     return map.put(key, value);
     * } else return null;
     * except that the action is performed atomically.
     * @param key key with which the specified value is associated.
     * @param value value to be associated with the specified key.
     * @return previous value associated with specified key, or <tt>null</tt>
     *         if there was no mapping for key.  
     * @throws NullPointerException if the specified key or value is
     *            <tt>null</tt>.
     */
public V replace(K key, V value) {
    if (value == null) throw new NullPointerException();
    int hash = hash(key);
    return segmentFor(hash).replace(key, hash, value);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ConcurrentHashMap.replace(K, V, V)

/**
     * Replace entry for key only if currently mapped to given value.
     * Acts as
     *  if (map.get(key).equals(oldValue)) {
     *     map.put(key, newValue);
     *     return true;
     * } else return false;
     * except that the action is performed atomically.
     * @param key key with which the specified value is associated.
     * @param oldValue value expected to be associated with the specified key.
     * @param newValue value to be associated with the specified key.
     * @return true if the value was replaced
     * @throws NullPointerException if the specified key or values are
     * <tt>null</tt>.
     */
public boolean replace(K key, V oldValue, V newValue) {
    if (oldValue == null || newValue == null) throw new NullPointerException();
    int hash = hash(key);
    return segmentFor(hash).replace(key, hash, oldValue, newValue);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ConcurrentLinkedQueue.offer(E)

/**
     * Inserts the specified element to the tail of this queue.
     * @param o the element to add.
     * @return <tt>true</tt> (as per the general contract of
     * <tt>Queue.offer</tt>).
     * @throws NullPointerException if the specified element is <tt>null</tt>
     */
public boolean offer(E o) {
    if (o == null) throw new NullPointerException();
    Node<E> n = new Node<E>(o, null);
    for (; ; ) {
        Node<E> t = tail;
        Node<E> s = t.getNext();
        if (t == tail) {
            if (s == null) {
                if (t.casNext(s, n)) {
                    casTail(t, n);
                    return true;
                }
            } else {
                casTail(t, s);
            }
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ExecutorCompletionService.submit(Runnable, V)

public Future<V> submit(Runnable task, V result) {
    if (task == null) throw new NullPointerException();
    QueueingFuture f = new QueueingFuture(task, result);
    executor.execute(f);
    return f;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.Executors.callable(PrivilegedAction)

/**
     * Returns a {@link Callable} object that, when
     * called, runs the given privileged action and returns its result.
     * @param action the privileged action to run
     * @return a callable object
     * @throws NullPointerException if action null
     */
public static Callable<Object> callable(PrivilegedAction action) {
    if (action == null) throw new NullPointerException();
    return new PrivilegedActionAdapter(action);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.Executors.callable(PrivilegedExceptionAction)

/**
     * Returns a {@link Callable} object that, when
     * called, runs the given privileged exception action and returns
     * its result.
     * @param action the privileged exception action to run
     * @return a callable object
     * @throws NullPointerException if action null
     */
public static Callable<Object> callable(PrivilegedExceptionAction action) {
    if (action == null) throw new NullPointerException();
    return new PrivilegedExceptionActionAdapter(action);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.Executors.callable(Runnable)

/**
     * Returns a {@link Callable} object that, when
     * called, runs the given task and returns <tt>null</tt>.
     * @param task the task to run
     * @return a callable object
     * @throws NullPointerException if task null
     */
public static Callable<Object> callable(Runnable task) {
    if (task == null) throw new NullPointerException();
    return new RunnableAdapter<Object>(task, null);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.Executors.callable(Runnable, T)

/**
     * Returns a {@link Callable} object that, when
     * called, runs the given task and returns the given result.  This
     * can be useful when applying methods requiring a
     * <tt>Callable</tt> to an otherwise resultless action.
     * @param task the task to run
     * @param result the result to return
     * @throws NullPointerException if task null
     * @return a callable object
     */
public static <T> Callable<T> callable(Runnable task, T result) {
    if (task == null) throw new NullPointerException();
    return new RunnableAdapter<T>(task, result);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.Executors.unconfigurableExecutorService(ExecutorService)

/**
     * Returns an object that delegates all defined {@link
     * ExecutorService} methods to the given executor, but not any
     * other methods that might otherwise be accessible using
     * casts. This provides a way to safely 'freeze' configuration and
     * disallow tuning of a given concrete implementation.
     * @param executor the underlying implementation
     * @return an <tt>ExecutorService</tt> instance
     * @throws NullPointerException if executor null
     */
public static ExecutorService unconfigurableExecutorService(ExecutorService executor) {
    if (executor == null) throw new NullPointerException();
    return new DelegatedExecutorService(executor);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.Executors.unconfigurableScheduledExecutorService(ScheduledExecutorService)

/**
     * Returns an object that delegates all defined {@link
     * ScheduledExecutorService} methods to the given executor, but
     * not any other methods that might otherwise be accessible using
     * casts. This provides a way to safely 'freeze' configuration and
     * disallow tuning of a given concrete implementation.
     * @param executor the underlying implementation
     * @return a <tt>ScheduledExecutorService</tt> instance
     * @throws NullPointerException if executor null
     */
public static ScheduledExecutorService unconfigurableScheduledExecutorService(ScheduledExecutorService executor) {
    if (executor == null) throw new NullPointerException();
    return new DelegatedScheduledExecutorService(executor);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.LinkedBlockingQueue.offer(E)

/**
     * Inserts the specified element at the tail of this queue if possible,
     * returning immediately if this queue is full.
     * @param o the element to add.
     * @return <tt>true</tt> if it was possible to add the element to
     *         this queue, else <tt>false</tt>
     * @throws NullPointerException if the specified element is <tt>null</tt>
     */
public boolean offer(E o) {
    if (o == null) throw new NullPointerException();
    final AtomicInteger count = this.count;
    if (count.get() == capacity) return false;
    int c = -1;
    final ReentrantLock putLock = this.putLock;
    putLock.lock();
    try {
        if (count.get() < capacity) {
            insert(o);
            c = count.getAndIncrement();
            if (c + 1 < capacity) notFull.signal();
        }
    } finally {
        putLock.unlock();
    }
    if (c == 0) signalNotEmpty();
    return c >= 0;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.LinkedBlockingQueue.offer(E, long, TimeUnit)

/**
     * Inserts the specified element at the tail of this queue, waiting if
     * necessary up to the specified wait time for space to become available.
     * @param o the element to add
     * @param timeout how long to wait before giving up, in units of
     * <tt>unit</tt>
     * @param unit a <tt>TimeUnit</tt> determining how to interpret the
     * <tt>timeout</tt> parameter
     * @return <tt>true</tt> if successful, or <tt>false</tt> if
     * the specified waiting time elapses before space is available.
     * @throws InterruptedException if interrupted while waiting.
     * @throws NullPointerException if the specified element is <tt>null</tt>.
     */
public boolean offer(E o, long timeout, TimeUnit unit) throws InterruptedException {
    if (o == null) throw new NullPointerException();
    long nanos = unit.toNanos(timeout);
    int c = -1;
    final ReentrantLock putLock = this.putLock;
    final AtomicInteger count = this.count;
    putLock.lockInterruptibly();
    try {
        for (; ; ) {
            if (count.get() < capacity) {
                insert(o);
                c = count.getAndIncrement();
                if (c + 1 < capacity) notFull.signal();
                break;
            }
            if (nanos <= 0) return false;
            try {
                nanos = notFull.awaitNanos(nanos);
            } catch (InterruptedException ie) {
                notFull.signal();
                throw ie;
            }
        }
    } finally {
        putLock.unlock();
    }
    if (c == 0) signalNotEmpty();
    return true;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.LinkedBlockingQueue.put(E)

/**
     * Adds the specified element to the tail of this queue, waiting if
     * necessary for space to become available.
     * @param o the element to add
     * @throws InterruptedException if interrupted while waiting.
     * @throws NullPointerException if the specified element is <tt>null</tt>.
     */
public void put(E o) throws InterruptedException {
    if (o == null) throw new NullPointerException();
    int c = -1;
    final ReentrantLock putLock = this.putLock;
    final AtomicInteger count = this.count;
    putLock.lockInterruptibly();
    try {
        try {
            while (count.get() == capacity) notFull.await();
        } catch (InterruptedException ie) {
            notFull.signal();
            throw ie;
        }
        insert(o);
        c = count.getAndIncrement();
        if (c + 1 < capacity) notFull.signal();
    } finally {
        putLock.unlock();
    }
    if (c == 0) signalNotEmpty();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.PriorityBlockingQueue.offer(E)

/**
     * Inserts the specified element into this priority queue.
     * @param o the element to add
     * @return <tt>true</tt>
     * @throws ClassCastException if the specified element cannot be compared
     * with elements currently in the priority queue according
     * to the priority queue's ordering.
     * @throws NullPointerException if the specified element is <tt>null</tt>.
     */
public boolean offer(E o) {
    if (o == null) throw new NullPointerException();
    final ReentrantLock lock = this.lock;
    lock.lock();
    try {
        boolean ok = q.offer(o);
        assert ok;
        notEmpty.signal();
        return true;
    } finally {
        lock.unlock();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ScheduledThreadPoolExecutor.execute(Runnable)

/**
     * Execute command with zero required delay. This has effect
     * equivalent to <tt>schedule(command, 0, anyUnit)</tt>.  Note
     * that inspections of the queue and of the list returned by
     * <tt>shutdownNow</tt> will access the zero-delayed
     * {@link ScheduledFuture}, not the <tt>command</tt> itself.
     * @param command the task to execute
     * @throws RejectedExecutionException at discretion of
     * <tt>RejectedExecutionHandler</tt>, if task cannot be accepted
     * for execution because the executor has been shut down.
     * @throws NullPointerException if command is null
     */
public void execute(Runnable command) {
    if (command == null) throw new NullPointerException();
    schedule(command, 0, TimeUnit.NANOSECONDS);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ScheduledThreadPoolExecutor.schedule(Runnable, long, TimeUnit)

public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) {
    if (command == null || unit == null) throw new NullPointerException();
    long triggerTime = now() + unit.toNanos(delay);
    ScheduledFutureTask<?> t = new ScheduledFutureTask<Boolean>(command, null, triggerTime);
    delayedExecute(t);
    return t;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate(Runnable, long, long, TimeUnit)

public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) {
    if (command == null || unit == null) throw new NullPointerException();
    if (period <= 0) throw new IllegalArgumentException();
    if (initialDelay < 0) initialDelay = 0;
    long triggerTime = now() + unit.toNanos(initialDelay);
    ScheduledFutureTask<?> t = new ScheduledFutureTask<Object>(command, null, triggerTime, unit.toNanos(period));
    delayedExecute(t);
    return t;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ScheduledThreadPoolExecutor.scheduleWithFixedDelay(Runnable, long, long, TimeUnit)

public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) {
    if (command == null || unit == null) throw new NullPointerException();
    if (delay <= 0) throw new IllegalArgumentException();
    if (initialDelay < 0) initialDelay = 0;
    long triggerTime = now() + unit.toNanos(initialDelay);
    ScheduledFutureTask<?> t = new ScheduledFutureTask<Boolean>(command, null, triggerTime, unit.toNanos(-delay));
    delayedExecute(t);
    return t;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.SynchronousQueue.offer(E)

/**
    * Inserts the specified element into this queue, if another thread is
    * waiting to receive it.
    * @param o the element to add.
    * @return <tt>true</tt> if it was possible to add the element to
    *         this queue, else <tt>false</tt>
    * @throws NullPointerException if the specified element is <tt>null</tt>
    */
public boolean offer(E o) {
    if (o == null) throw new NullPointerException();
    final ReentrantLock qlock = this.qlock;
    for (; ; ) {
        Node node;
        qlock.lock();
        try {
            node = waitingConsumers.deq();
        } finally {
            qlock.unlock();
        }
        if (node == null) return false; else if (node.setItem(o)) return true;
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.SynchronousQueue.offer(E, long, TimeUnit)

/**
     * Inserts the specified element into this queue, waiting if necessary
     * up to the specified wait time for another thread to receive it.
     * @param o the element to add
     * @param timeout how long to wait before giving up, in units of
     * <tt>unit</tt>
     * @param unit a <tt>TimeUnit</tt> determining how to interpret the
     * <tt>timeout</tt> parameter
     * @return <tt>true</tt> if successful, or <tt>false</tt> if
     * the specified waiting time elapses before a consumer appears.
     * @throws InterruptedException if interrupted while waiting.
     * @throws NullPointerException if the specified element is <tt>null</tt>.
     */
public boolean offer(E o, long timeout, TimeUnit unit) throws InterruptedException {
    if (o == null) throw new NullPointerException();
    long nanos = unit.toNanos(timeout);
    final ReentrantLock qlock = this.qlock;
    for (; ; ) {
        Node node;
        boolean mustWait;
        if (Thread.interrupted()) throw new InterruptedException();
        qlock.lock();
        try {
            node = waitingConsumers.deq();
            if ((mustWait = (node == null))) node = waitingProducers.enq(o);
        } finally {
            qlock.unlock();
        }
        if (mustWait) return node.waitForTake(nanos); else if (node.setItem(o)) return true;
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.SynchronousQueue.put(E)

/**
     * Adds the specified element to this queue, waiting if necessary for
     * another thread to receive it.
     * @param o the element to add
     * @throws InterruptedException if interrupted while waiting.
     * @throws NullPointerException if the specified element is <tt>null</tt>.
     */
public void put(E o) throws InterruptedException {
    if (o == null) throw new NullPointerException();
    final ReentrantLock qlock = this.qlock;
    for (; ; ) {
        Node node;
        boolean mustWait;
        if (Thread.interrupted()) throw new InterruptedException();
        qlock.lock();
        try {
            node = waitingConsumers.deq();
            if ((mustWait = (node == null))) node = waitingProducers.enq(o);
        } finally {
            qlock.unlock();
        }
        if (mustWait) {
            node.waitForTake();
            return;
        } else if (node.setItem(o)) return;
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ThreadPoolExecutor.execute(Runnable)

/**
     * Executes the given task sometime in the future.  The task
     * may execute in a new thread or in an existing pooled thread.
     * If the task cannot be submitted for execution, either because this
     * executor has been shutdown or because its capacity has been reached,
     * the task is handled by the current <tt>RejectedExecutionHandler</tt>.
     * @param command the task to execute
     * @throws RejectedExecutionException at discretion of
     * <tt>RejectedExecutionHandler</tt>, if task cannot be accepted
     * for execution
     * @throws NullPointerException if command is null
     */
public void execute(Runnable command) {
    if (command == null) throw new NullPointerException();
    for (; ; ) {
        if (runState != RUNNING) {
            reject(command);
            return;
        }
        if (poolSize < corePoolSize && addIfUnderCorePoolSize(command)) return;
        if (workQueue.offer(command)) return;
        Runnable r = addIfUnderMaximumPoolSize(command);
        if (r == command) return;
        if (r == null) {
            reject(command);
            return;
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ThreadPoolExecutor.setRejectedExecutionHandler(RejectedExecutionHandler)

/**
     * Sets a new handler for unexecutable tasks.
     * @param handler the new handler
     * @throws NullPointerException if handler is null
     * @see #getRejectedExecutionHandler
     */
public void setRejectedExecutionHandler(RejectedExecutionHandler handler) {
    if (handler == null) throw new NullPointerException();
    this.handler = handler;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.ThreadPoolExecutor.setThreadFactory(ThreadFactory)

/**
     * Sets the thread factory used to create new threads.
     * @param threadFactory the new thread factory
     * @throws NullPointerException if threadFactory is null
     * @see #getThreadFactory
     */
public void setThreadFactory(ThreadFactory threadFactory) {
    if (threadFactory == null) throw new NullPointerException();
    this.threadFactory = threadFactory;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.locks.AbstractQueuedSynchronizer.isQueued(Thread)

/**
     * Returns true if the given thread is currently queued. 
     *  This implementation traverses the queue to determine
     * presence of the given thread.
     * @param thread the thread
     * @return true if the given thread in on the queue
     * @throws NullPointerException if thread null
     */
public final boolean isQueued(Thread thread) {
    if (thread == null) throw new NullPointerException();
    for (Node p = tail; p != null; p = p.prev) if (p.thread == thread) return true;
    return false;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.locks.AbstractQueuedSynchronizer.owns(ConditionObject)

/**
     * Queries whether the given ConditionObject 
     * uses this synchronizer as its lock.
     * @param condition the condition
     * @return <tt>true</tt> if owned
     * @throws NullPointerException if condition null
     */
public final boolean owns(ConditionObject condition) {
    if (condition == null) throw new NullPointerException();
    return condition.isOwnedBy(this);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.locks.ReentrantLock.getWaitQueueLength(Condition)

/**
     * Returns an estimate of the number of threads waiting on the
     * given condition associated with this lock. Note that because
     * timeouts and interrupts may occur at any time, the estimate
     * serves only as an upper bound on the actual number of waiters.
     * This method is designed for use in monitoring of the system
     * state, not for synchronization control.
     * @param condition the condition
     * @return the estimated number of waiting threads.
     * @throws IllegalMonitorStateException if this lock 
     * is not held
     * @throws IllegalArgumentException if the given condition is
     * not associated with this lock
     * @throws NullPointerException if condition null
     */
public int getWaitQueueLength(Condition condition) {
    if (condition == null) throw new NullPointerException();
    if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject)) throw new IllegalArgumentException('not owner');
    return sync.getWaitQueueLength((AbstractQueuedSynchronizer.ConditionObject) condition);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.locks.ReentrantLock.getWaitingThreads(Condition)

/**
     * Returns a collection containing those threads that may be
     * waiting on the given condition associated with this lock.
     * Because the actual set of threads may change dynamically while
     * constructing this result, the returned collection is only a
     * best-effort estimate. The elements of the returned collection
     * are in no particular order.  This method is designed to
     * facilitate construction of subclasses that provide more
     * extensive condition monitoring facilities.
     * @param condition the condition
     * @return the collection of threads
     * @throws IllegalMonitorStateException if this lock 
     * is not held
     * @throws IllegalArgumentException if the given condition is
     * not associated with this lock
     * @throws NullPointerException if condition null
     */
protected Collection<Thread> getWaitingThreads(Condition condition) {
    if (condition == null) throw new NullPointerException();
    if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject)) throw new IllegalArgumentException('not owner');
    return sync.getWaitingThreads((AbstractQueuedSynchronizer.ConditionObject) condition);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.locks.ReentrantLock.hasWaiters(Condition)

/**
     * Queries whether any threads are waiting on the given condition
     * associated with this lock. Note that because timeouts and
     * interrupts may occur at any time, a <tt>true</tt> return does
     * not guarantee that a future <tt>signal</tt> will awaken any
     * threads.  This method is designed primarily for use in
     * monitoring of the system state.
     * @param condition the condition
     * @return <tt>true</tt> if there are any waiting threads.
     * @throws IllegalMonitorStateException if this lock 
     * is not held
     * @throws IllegalArgumentException if the given condition is
     * not associated with this lock
     * @throws NullPointerException if condition null
     */
public boolean hasWaiters(Condition condition) {
    if (condition == null) throw new NullPointerException();
    if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject)) throw new IllegalArgumentException('not owner');
    return sync.hasWaiters((AbstractQueuedSynchronizer.ConditionObject) condition);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.locks.ReentrantReadWriteLock.getWaitQueueLength(Condition)

/**
     * Returns an estimate of the number of threads waiting on the
     * given condition associated with the write lock. Note that because
     * timeouts and interrupts may occur at any time, the estimate
     * serves only as an upper bound on the actual number of waiters.
     * This method is designed for use in monitoring of the system
     * state, not for synchronization control.
     * @param condition the condition
     * @return the estimated number of waiting threads.
     * @throws IllegalMonitorStateException if this lock 
     * is not held
     * @throws IllegalArgumentException if the given condition is
     * not associated with this lock
     * @throws NullPointerException if condition null
     */
public int getWaitQueueLength(Condition condition) {
    if (condition == null) throw new NullPointerException();
    if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject)) throw new IllegalArgumentException('not owner');
    return sync.getWaitQueueLength((AbstractQueuedSynchronizer.ConditionObject) condition);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.locks.ReentrantReadWriteLock.getWaitingThreads(Condition)

/**
     * Returns a collection containing those threads that may be
     * waiting on the given condition associated with the write lock.
     * Because the actual set of threads may change dynamically while
     * constructing this result, the returned collection is only a
     * best-effort estimate. The elements of the returned collection
     * are in no particular order.  This method is designed to
     * facilitate construction of subclasses that provide more
     * extensive condition monitoring facilities.
     * @param condition the condition
     * @return the collection of threads
     * @throws IllegalMonitorStateException if this lock 
     * is not held
     * @throws IllegalArgumentException if the given condition is
     * not associated with this lock
     * @throws NullPointerException if condition null
     */
protected Collection<Thread> getWaitingThreads(Condition condition) {
    if (condition == null) throw new NullPointerException();
    if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject)) throw new IllegalArgumentException('not owner');
    return sync.getWaitingThreads((AbstractQueuedSynchronizer.ConditionObject) condition);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.concurrent.locks.ReentrantReadWriteLock.hasWaiters(Condition)

/**
     * Queries whether any threads are waiting on the given condition
     * associated with the write lock. Note that because timeouts and
     * interrupts may occur at any time, a <tt>true</tt> return does
     * not guarantee that a future <tt>signal</tt> will awaken any
     * threads.  This method is designed primarily for use in
     * monitoring of the system state.
     * @param condition the condition
     * @return <tt>true</tt> if there are any waiting threads.
     * @throws IllegalMonitorStateException if this lock 
     * is not held
     * @throws IllegalArgumentException if the given condition is
     * not associated with this lock
     * @throws NullPointerException if condition null
     */
public boolean hasWaiters(Condition condition) {
    if (condition == null) throw new NullPointerException();
    if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject)) throw new IllegalArgumentException('not owner');
    return sync.hasWaiters((AbstractQueuedSynchronizer.ConditionObject) condition);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.logging.Handler.setErrorManager(ErrorManager)

/**
     * Define an ErrorManager for this Handler.
     * The ErrorManager's 'error' method will be invoked if any
     * errors occur while using this Handler.
     * @param em  the new ErrorManager
     * @exception  SecurityException  if a security manager exists and if
     *             the caller does not have <tt>LoggingPermission('control')</tt>.
     */
public void setErrorManager(ErrorManager em) {
    checkAccess();
    if (em == null) {
        throw new NullPointerException();
    }
    errorManager = em;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.logging.Handler.setLevel(Level)

/**
     * Set the log level specifying which message levels will be
     * logged by this <tt>Handler</tt>.  Message levels lower than this
     * value will be discarded. 
     * The intention is to allow developers to turn on voluminous
     * logging, but to limit the messages that are sent to certain
     * <tt>Handlers</tt>.
     * @param newLevel   the new value for the log level
     * @exception  SecurityException  if a security manager exists and if
     *             the caller does not have <tt>LoggingPermission('control')</tt>.
     */
public synchronized void setLevel(Level newLevel) throws SecurityException {
    if (newLevel == null) {
        throw new NullPointerException();
    }
    checkAccess();
    logLevel = newLevel;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.logging.LogManager.addLogger(Logger)

/**
     * Add a named logger.  This does nothing and returns false if a logger
     * with the same name is already registered.
     * The Logger factory methods call this method to register each
     * newly created Logger.
     * The application should retain its own reference to the Logger 
     * object to avoid it being garbage collected.  The LogManager
     * may only retain a weak reference.
     * @param   logger the new logger.
     * @return  true if the argument logger was registered successfully,
     *          false if a logger of that name already exists.
     * @exception NullPointerException if the logger name is null.
     */
public synchronized boolean addLogger(Logger logger) {
    final String name = logger.getName();
    if (name == null) {
        throw new NullPointerException();
    }
    Logger old = loggers.get(name);
    if (old != null) {
        return false;
    }
    loggers.put(name, logger);
    Level level = getLevelProperty(name + '.level', null);
    if (level != null) {
        doSetLevel(logger, level);
    }
    if (getProperty(name + '.handlers') != null) {
        AccessController.doPrivileged(new PrivilegedAction() {

            public Object run() {
                String names[] = parseClassNames(name + '.handlers');
                for (int i = 0; i < names.length; i++) {
                    String word = names[i];
                    try {
                        Class clz = ClassLoader.getSystemClassLoader().loadClass(word);
                        Handler h = (Handler) clz.newInstance();
                        try {
                            String levs = getProperty(word + '.level');
                            if (levs != null) {
                                h.setLevel(Level.parse(levs));
                            }
                            boolean useParent = getBooleanProperty(name + '.useParentHandlers', true);
                            if (!useParent) {
                                getLogger(name).setUseParentHandlers(false);
                            }
                        } catch (Exception ex) {
                            System.err.println('Can't set level for ' + word);
                        }
                        getLogger(name).addHandler(h);
                    } catch (Exception ex) {
                        System.err.println('Can't load log handler \'' + word + '\'');
                        System.err.println('' + ex);
                        ex.printStackTrace();
                    }
                }
                return null;
            }
        });
    }
    int ix = 1;
    for (; ; ) {
        int ix2 = name.indexOf('.', ix);
        if (ix2 < 0) {
            break;
        }
        String pname = name.substring(0, ix2);
        if (getProperty(pname + '.level') != null) {
            Logger plogger = Logger.getLogger(pname);
        }
        if (getProperty(pname + '.handlers') != null) {
            final String nname = pname;
            AccessController.doPrivileged(new PrivilegedAction() {

                public Object run() {
                    String names[] = parseClassNames(nname + '.handlers');
                    for (int i = 0; i < names.length; i++) {
                        String word = names[i];
                        try {
                            Class clz = ClassLoader.getSystemClassLoader().loadClass(word);
                            Handler h = (Handler) clz.newInstance();
                            try {
                                String levs = getProperty(word + '.level');
                                if (levs != null) {
                                    h.setLevel(Level.parse(levs));
                                }
                            } catch (Exception ex) {
                                System.err.println('Can't set level for ' + word);
                            }
                            if (getLogger(nname) == null) {
                                Logger nplogger = Logger.getLogger(nname);
                                addLogger(nplogger);
                            }
                            boolean useParent = getBooleanProperty(nname + '.useParentHandlers', true);
                            if (!useParent) {
                                getLogger(nname).setUseParentHandlers(false);
                            }
                        } catch (Exception ex) {
                            System.err.println('Can't load log handler \'' + word + '\'');
                            System.err.println('' + ex);
                            ex.printStackTrace();
                        }
                    }
                    return null;
                }
            });
        }
        ix = ix2 + 1;
    }
    LogNode node = findNode(name);
    node.logger = logger;
    Logger parent = null;
    LogNode nodep = node.parent;
    while (nodep != null) {
        if (nodep.logger != null) {
            parent = nodep.logger;
            break;
        }
        nodep = nodep.parent;
    }
    if (parent != null) {
        doSetParent(logger, parent);
    }
    node.walkAndSetParent(logger);
    return true;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.logging.LogManager.addPropertyChangeListener(PropertyChangeListener)

/**
     * Adds an event listener to be invoked when the logging
     * properties are re-read. Adding multiple instances of
     * the same event Listener results in multiple entries
     * in the property event listener table.
     * @param l  event listener
     * @exception  SecurityException  if a security manager exists and if
     *             the caller does not have LoggingPermission('control').
     * @exception NullPointerException if the PropertyChangeListener is null.
     */
public void addPropertyChangeListener(PropertyChangeListener l) throws SecurityException {
    if (l == null) {
        throw new NullPointerException();
    }
    checkAccess();
    changes.addPropertyChangeListener(l);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.logging.LogRecord.setLevel(Level)

/**
     * Set the logging message level, for example Level.SEVERE.
     * @param level the logging message level
     */
public void setLevel(Level level) {
    if (level == null) {
        throw new NullPointerException();
    }
    this.level = level;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.logging.Logger.setParent(Logger)

/**
     * Set the parent for this Logger.  This method is used by
     * the LogManager to update a Logger when the namespace changes.
     * It should not be called from application code.
     * @param  parent   the new parent logger
     * @exception  SecurityException  if a security manager exists and if
     *             the caller does not have LoggingPermission('control').
     */
public void setParent(Logger parent) {
    if (parent == null) {
        throw new NullPointerException();
    }
    manager.checkAccess();
    doSetParent(parent);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.logging.MemoryHandler.setPushLevel(Level)

/** 
     * Set the <tt>pushLevel</tt>.  After a <tt>LogRecord</tt> is copied 
     * into our internal buffer, if its level is greater than or equal to
     * the <tt>pushLevel</tt>, then <tt>push</tt> will be called.
     * @param newLevel the new value of the <tt>pushLevel</tt>
     * @exception  SecurityException  if a security manager exists and if
     *             the caller does not have <tt>LoggingPermission('control')</tt>.
     */
public void setPushLevel(Level newLevel) throws SecurityException {
    if (newLevel == null) {
        throw new NullPointerException();
    }
    LogManager manager = LogManager.getLogManager();
    checkAccess();
    pushLevel = newLevel;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.logging.StreamHandler.setOutputStream(OutputStream)

/**
     * Change the output stream.
     * <P>
     * If there is a current output stream then the <tt>Formatter</tt>'s 
     * tail string is written and the stream is flushed and closed.
     * Then the output stream is replaced with the new output stream.
     * @param out   New output stream.  May not be null.
     * @exception  SecurityException  if a security manager exists and if
     *             the caller does not have <tt>LoggingPermission('control')</tt>.
     */
protected synchronized void setOutputStream(OutputStream out) throws SecurityException {
    if (out == null) {
        throw new NullPointerException();
    }
    flushAndClose();
    output = out;
    doneHeader = false;
    String encoding = getEncoding();
    if (encoding == null) {
        writer = new OutputStreamWriter(output);
    } else {
        try {
            writer = new OutputStreamWriter(output, encoding);
        } catch (UnsupportedEncodingException ex) {
            throw new Error('Unexpected exception ' + ex);
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.prefs.AbstractPreferences.put(String, String)

/**
     * Implements the <tt>put</tt> method as per the specification in
     * {@link Preferences#put(String,String)}.
     * This implementation checks that the key and value are legal,
     * obtains this preference node's lock, checks that the node
     * has not been removed, invokes {@link #putSpi(String,String)}, and if
     * there are any preference change listeners, enqueues a notification
     * event for processing by the event dispatch thread.
     * @param key key with which the specified value is to be associated.
     * @param value value to be associated with the specified key.
     * @throws NullPointerException if key or value is <tt>null</tt>.
     * @throws IllegalArgumentException if <tt>key.length()</tt> exceeds
     *       <tt>MAX_KEY_LENGTH</tt> or if <tt>value.length</tt> exceeds
     *       <tt>MAX_VALUE_LENGTH</tt>.
     * @throws IllegalStateException if this node (or an ancestor) has been
     *         removed with the {@link #removeNode()} method.
     */
public void put(String key, String value) {
    if (key == null || value == null) throw new NullPointerException();
    if (key.length() > MAX_KEY_LENGTH) throw new IllegalArgumentException('Key too long: ' + key);
    if (value.length() > MAX_VALUE_LENGTH) throw new IllegalArgumentException('Value too long: ' + value);
    synchronized (lock) {
        if (removed) throw new IllegalStateException('Node has been removed.');
        putSpi(key, value);
        enqueuePreferenceChangeEvent(key, value);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.zip.Adler32.update(byte[], int, int)

/**
     * Updates checksum with specified array of bytes.
     */
public void update(byte[] b, int off, int len) {
    if (b == null) {
        throw new NullPointerException();
    }
    if (off < 0 || len < 0 || off > b.length - len) {
        throw new ArrayIndexOutOfBoundsException();
    }
    adler = updateBytes(adler, b, off, len);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.zip.CRC32.update(byte[], int, int)

/**
     * Updates CRC-32 with specified array of bytes.
     */
public void update(byte[] b, int off, int len) {
    if (b == null) {
        throw new NullPointerException();
    }
    if (off < 0 || len < 0 || off > b.length - len) {
        throw new ArrayIndexOutOfBoundsException();
    }
    crc = updateBytes(crc, b, off, len);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.zip.Deflater.deflate(byte[], int, int)

/**
     * Fills specified buffer with compressed data. Returns actual number
     * of bytes of compressed data. A return value of 0 indicates that
     * needsInput() should be called in order to determine if more input
     * data is required.
     * @param b the buffer for the compressed data
     * @param off the start offset of the data
     * @param len the maximum number of bytes of compressed data
     * @return the actual number of bytes of compressed data
     */
public synchronized int deflate(byte[] b, int off, int len) {
    if (b == null) {
        throw new NullPointerException();
    }
    if (off < 0 || len < 0 || off > b.length - len) {
        throw new ArrayIndexOutOfBoundsException();
    }
    return deflateBytes(b, off, len);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.zip.Deflater.ensureOpen()

private void ensureOpen() {
    if (strm == 0) throw new NullPointerException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.zip.Deflater.setDictionary(byte[], int, int)

/**
     * Sets preset dictionary for compression. A preset dictionary is used
     * when the history buffer can be predetermined. When the data is later
     * uncompressed with Inflater.inflate(), Inflater.getAdler() can be called
     * in order to get the Adler-32 value of the dictionary required for
     * decompression.
     * @param b the dictionary data bytes
     * @param off the start offset of the data
     * @param len the length of the data
     * @see Inflater#inflate
     * @see Inflater#getAdler
     */
public synchronized void setDictionary(byte[] b, int off, int len) {
    if (strm == 0 || b == null) {
        throw new NullPointerException();
    }
    if (off < 0 || len < 0 || off > b.length - len) {
        throw new ArrayIndexOutOfBoundsException();
    }
    setDictionary(strm, b, off, len);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.zip.Deflater.setInput(byte[], int, int)

/**
     * Sets input data for compression. This should be called whenever
     * needsInput() returns true indicating that more input data is required.
     * @param b the input data bytes
     * @param off the start offset of the data
     * @param len the length of the data
     * @see Deflater#needsInput
     */
public synchronized void setInput(byte[] b, int off, int len) {
    if (b == null) {
        throw new NullPointerException();
    }
    if (off < 0 || len < 0 || off > b.length - len) {
        throw new ArrayIndexOutOfBoundsException();
    }
    this.buf = b;
    this.off = off;
    this.len = len;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.zip.Inflater.ensureOpen()

private void ensureOpen() {
    if (strm == 0) throw new NullPointerException();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.zip.Inflater.inflate(byte[], int, int)

/**
     * Uncompresses bytes into specified buffer. Returns actual number
     * of bytes uncompressed. A return value of 0 indicates that
     * needsInput() or needsDictionary() should be called in order to
     * determine if more input data or a preset dictionary is required.
     * In the later case, getAdler() can be used to get the Adler-32
     * value of the dictionary required.
     * @param b the buffer for the uncompressed data
     * @param off the start offset of the data
     * @param len the maximum number of uncompressed bytes
     * @return the actual number of uncompressed bytes
     * @exception DataFormatException if the compressed data format is invalid
     * @see Inflater#needsInput
     * @see Inflater#needsDictionary
     */
public synchronized int inflate(byte[] b, int off, int len) throws DataFormatException {
    if (b == null) {
        throw new NullPointerException();
    }
    if (off < 0 || len < 0 || off > b.length - len) {
        throw new ArrayIndexOutOfBoundsException();
    }
    return inflateBytes(b, off, len);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.zip.Inflater.setDictionary(byte[], int, int)

/**
     * Sets the preset dictionary to the given array of bytes. Should be
     * called when inflate() returns 0 and needsDictionary() returns true
     * indicating that a preset dictionary is required. The method getAdler()
     * can be used to get the Adler-32 value of the dictionary needed.
     * @param b the dictionary data bytes
     * @param off the start offset of the data
     * @param len the length of the data
     * @see Inflater#needsDictionary
     * @see Inflater#getAdler
     */
public synchronized void setDictionary(byte[] b, int off, int len) {
    if (strm == 0 || b == null) {
        throw new NullPointerException();
    }
    if (off < 0 || len < 0 || off > b.length - len) {
        throw new ArrayIndexOutOfBoundsException();
    }
    setDictionary(strm, b, off, len);
    needDict = false;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.zip.Inflater.setInput(byte[], int, int)

/**
     * Sets input data for decompression. Should be called whenever
     * needsInput() returns true indicating that more input data is
     * required.
     * @param b the input data bytes
     * @param off the start offset of the input data
     * @param len the length of the input data
     * @see Inflater#needsInput
     */
public synchronized void setInput(byte[] b, int off, int len) {
    if (b == null) {
        throw new NullPointerException();
    }
    if (off < 0 || len < 0 || off > b.length - len) {
        throw new ArrayIndexOutOfBoundsException();
    }
    this.buf = b;
    this.off = off;
    this.len = len;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.zip.ZipFile.getEntry(String)

/**
     * Returns the zip file entry for the specified name, or null
     * if not found.
     * @param name the name of the entry
     * @return the zip file entry, or null if not found
     * @throws IllegalStateException if the zip file has been closed
     */
public ZipEntry getEntry(String name) {
    if (name == null) {
        throw new NullPointerException('name');
    }
    long jzentry = 0;
    synchronized (this) {
        ensureOpen();
        jzentry = getEntry(jzfile, name, true);
        if (jzentry != 0) {
            ZipEntry ze = new ZipEntry(name, jzentry);
            freeEntry(jzfile, jzentry);
            return ze;
        }
    }
    return null;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.zip.ZipFile.getInputStream(String)

/**
     * Returns an input stream for reading the contents of the specified
     * entry, or null if the entry was not found.
     */
private InputStream getInputStream(String name) throws IOException {
    if (name == null) {
        throw new NullPointerException('name');
    }
    long jzentry = 0;
    ZipFileInputStream in = null;
    synchronized (this) {
        ensureOpen();
        jzentry = getEntry(jzfile, name, false);
        if (jzentry == 0) {
            return null;
        }
        if (mappedBuffer != null) {
            in = new MappedZipFileInputStream(jzentry, name);
        } else {
            in = new ZipFileInputStream(jzentry);
        }
    }
    final ZipFileInputStream zfin = in;
    switch(getMethod(jzentry)) {
        case STORED:
            return zfin;
        case DEFLATED:
            long size = getSize(jzentry) + 2;
            if (size > 65536) size = 8192;
            if (size <= 0) size = 4096;
            return new InflaterInputStream(zfin, getInflater(), (int) size) {

                private boolean isClosed = false;

                public void close() throws IOException {
                    if (!isClosed) {
                        releaseInflater(inf);
                        this.in.close();
                        isClosed = true;
                    }
                }

                protected void fill() throws IOException {
                    if (eof) {
                        throw new EOFException('Unexpected end of ZLIB input stream');
                    }
                    len = this.in.read(buf, 0, buf.length);
                    if (len == -1) {
                        buf[0] = 0;
                        len = 1;
                        eof = true;
                    }
                    inf.setInput(buf, 0, len);
                }

                private boolean eof;

                public int available() throws IOException {
                    if (isClosed) return 0;
                    long avail = zfin.size() - inf.getBytesWritten();
                    return avail > (long) Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) avail;
                }
            };
        default:
            throw new ZipException('invalid compression method');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.stream.FileCacheImageInputStream.read(byte[], int, int)

public int read(byte[] b, int off, int len) throws IOException {
    if (b == null) {
        throw new NullPointerException();
    }
    if (off < 0 || len < 0 || off + len > b.length || off + len < 0) {
        throw new IndexOutOfBoundsException();
    }
    if (len == 0) {
        return 0;
    }
    checkClosed();
    bitOffset = 0;
    long pos = readUntil(streamPos + len);
    len = (int) Math.min((long) len, pos - streamPos);
    if (len > 0) {
        cache.seek(streamPos);
        cache.readFully(b, off, len);
        streamPos += len;
        return len;
    } else {
        return -1;
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.ObjectName.apply(ObjectName)

/**
     * Test whether this ObjectName, which may be a pattern,
     * matches another ObjectName.  If <code>name</code> is a pattern,
     * the result is false.  If this ObjectName is a pattern, the
     * result is true if and only if <code>name</code> matches the
     * pattern.  If neither this ObjectName nor <code>name</code> is
     * a pattern, the result is true if and only if the two
     * ObjectNames are equal as described for the {@link
     * #equals(Object)} method.
     * @param name The name of the MBean to compare to.
     * @return True if <code>name</code> matches this ObjectName.
     * @exception NullPointerException if <code>name</code> is null.
     * @since.unbundled JMX 1.2
     */
public boolean apply(ObjectName name) throws NullPointerException {
    if (name == null) throw new NullPointerException();
    if (name._domain_pattern || name._property_pattern) return false;
    if (!_domain_pattern && !_property_pattern) return _canonicalName.equals(name._canonicalName);
    return matchDomains(name) && matchKeys(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.MimeType.parse(String)

/**
     * Parses the given string into canonical pieces and stores the pieces in
     * {@link #myPieces <CODE>myPieces</CODE>}.
     * <P>
     * Special rules applied:
     * <UL>
     * <LI> If the media type is text, the value of a charset parameter is
     *      converted to lowercase.
     * </UL>
     * @param  s  MIME media type string.
     * @exception  NullPointerException
     *     (unchecked exception) Thrown if <CODE>s</CODE> is null. 
     * @exception  IllegalArgumentException
     *     (unchecked exception) Thrown if <CODE>s</CODE> does not obey the 
     *     syntax for a MIME media type string. 
     */
private void parse(String s) {
    if (s == null) {
        throw new NullPointerException();
    }
    LexicalAnalyzer theLexer = new LexicalAnalyzer(s);
    int theLexemeType;
    Vector thePieces = new Vector();
    boolean mediaTypeIsText = false;
    boolean parameterNameIsCharset = false;
    if (theLexer.getLexemeType() == TOKEN_LEXEME) {
        String mt = toUnicodeLowerCase(theLexer.getLexeme());
        thePieces.add(mt);
        theLexer.nextLexeme();
        mediaTypeIsText = mt.equals('text');
    } else {
        throw new IllegalArgumentException();
    }
    if (theLexer.getLexemeType() == TSPECIAL_LEXEME && theLexer.getLexemeFirstCharacter() == '/') {
        theLexer.nextLexeme();
    } else {
        throw new IllegalArgumentException();
    }
    if (theLexer.getLexemeType() == TOKEN_LEXEME) {
        thePieces.add(toUnicodeLowerCase(theLexer.getLexeme()));
        theLexer.nextLexeme();
    } else {
        throw new IllegalArgumentException();
    }
    while (theLexer.getLexemeType() == TSPECIAL_LEXEME && theLexer.getLexemeFirstCharacter() == ';') {
        theLexer.nextLexeme();
        if (theLexer.getLexemeType() == TOKEN_LEXEME) {
            String pn = toUnicodeLowerCase(theLexer.getLexeme());
            thePieces.add(pn);
            theLexer.nextLexeme();
            parameterNameIsCharset = pn.equals('charset');
        } else {
            throw new IllegalArgumentException();
        }
        if (theLexer.getLexemeType() == TSPECIAL_LEXEME && theLexer.getLexemeFirstCharacter() == '=') {
            theLexer.nextLexeme();
        } else {
            throw new IllegalArgumentException();
        }
        if (theLexer.getLexemeType() == TOKEN_LEXEME) {
            String pv = theLexer.getLexeme();
            thePieces.add(mediaTypeIsText && parameterNameIsCharset ? toUnicodeLowerCase(pv) : pv);
            theLexer.nextLexeme();
        } else if (theLexer.getLexemeType() == QUOTED_STRING_LEXEME) {
            String pv = removeBackslashes(theLexer.getLexeme());
            thePieces.add(mediaTypeIsText && parameterNameIsCharset ? toUnicodeLowerCase(pv) : pv);
            theLexer.nextLexeme();
        } else {
            throw new IllegalArgumentException();
        }
    }
    if (theLexer.getLexemeType() != EOF_LEXEME) {
        throw new IllegalArgumentException();
    }
    int n = thePieces.size();
    myPieces = (String[]) thePieces.toArray(new String[n]);
    int i, j;
    String temp;
    for (i = 4; i < n; i += 2) {
        j = 2;
        while (j < i && myPieces[j].compareTo(myPieces[i]) <= 0) {
            j += 2;
        }
        while (j < i) {
            temp = myPieces[j];
            myPieces[j] = myPieces[i];
            myPieces[i] = temp;
            temp = myPieces[j + 1];
            myPieces[j + 1] = myPieces[i + 1];
            myPieces[i + 1] = temp;
            j += 2;
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.AttributeSetUtilities.synchronizedView(AttributeSet)

/**
     * Creates a synchronized view of the given attribute set.
     * @param  attributeSet  Underlying attribute set.
     * @return  Synchronized view of <CODE>attributeSet</CODE>.
     * @exception  NullPointerException
     *     Thrown if <CODE>attributeSet</CODE> is null.
     */
public static AttributeSet synchronizedView(AttributeSet attributeSet) {
    if (attributeSet == null) {
        throw new NullPointerException();
    }
    return new SynchronizedAttributeSet(attributeSet);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.AttributeSetUtilities.synchronizedView(DocAttributeSet)

/**
     * Creates a synchronized view of the given doc attribute set.
     * @param  attributeSet  Underlying doc attribute set.
     * @return  Synchronized view of <CODE>attributeSet</CODE>.
     * @exception  NullPointerException
     *     Thrown if <CODE>attributeSet</CODE> is null.
     */
public static DocAttributeSet synchronizedView(DocAttributeSet attributeSet) {
    if (attributeSet == null) {
        throw new NullPointerException();
    }
    return new SynchronizedDocAttributeSet(attributeSet);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.AttributeSetUtilities.synchronizedView(PrintJobAttributeSet)

/**
     * Creates a synchronized view of the given print job attribute set.
     * @param  attributeSet  Underlying print job attribute set.
     * @return  Synchronized view of <CODE>attributeSet</CODE>.
     * @exception  NullPointerException
     *     Thrown if <CODE>attributeSet</CODE> is null.
     */
public static PrintJobAttributeSet synchronizedView(PrintJobAttributeSet attributeSet) {
    if (attributeSet == null) {
        throw new NullPointerException();
    }
    return new SynchronizedPrintJobAttributeSet(attributeSet);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.AttributeSetUtilities.synchronizedView(PrintRequestAttributeSet)

/**
     * Creates a synchronized view of the given print request attribute set.
     * @param  attributeSet  Underlying print request attribute set.
     * @return  Synchronized view of <CODE>attributeSet</CODE>.
     * @exception  NullPointerException
     *     Thrown if <CODE>attributeSet</CODE> is null.
     */
public static PrintRequestAttributeSet synchronizedView(PrintRequestAttributeSet attributeSet) {
    if (attributeSet == null) {
        throw new NullPointerException();
    }
    return new SynchronizedPrintRequestAttributeSet(attributeSet);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.AttributeSetUtilities.synchronizedView(PrintServiceAttributeSet)

/**
     * Creates a synchronized view of the given print service attribute set.
     * @param  attributeSet  Underlying print service attribute set.
     * @return  Synchronized view of <CODE>attributeSet</CODE>.
     */
public static PrintServiceAttributeSet synchronizedView(PrintServiceAttributeSet attributeSet) {
    if (attributeSet == null) {
        throw new NullPointerException();
    }
    return new SynchronizedPrintServiceAttributeSet(attributeSet);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.AttributeSetUtilities.unmodifiableView(AttributeSet)

/**
     * Creates an unmodifiable view of the given attribute set.
     * @param  attributeSet  Underlying attribute set.
     * @return  Unmodifiable view of <CODE>attributeSet</CODE>.
     * @exception  NullPointerException
     *     Thrown if <CODE>attributeSet</CODE> is null. Null is never a
     */
public static AttributeSet unmodifiableView(AttributeSet attributeSet) {
    if (attributeSet == null) {
        throw new NullPointerException();
    }
    return new UnmodifiableAttributeSet(attributeSet);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.AttributeSetUtilities.unmodifiableView(DocAttributeSet)

/**
     * Creates an unmodifiable view of the given doc attribute set.
     * @param  attributeSet  Underlying doc attribute set.
     * @return  Unmodifiable view of <CODE>attributeSet</CODE>.
     * @exception  NullPointerException
     *     Thrown if <CODE>attributeSet</CODE> is null.
     */
public static DocAttributeSet unmodifiableView(DocAttributeSet attributeSet) {
    if (attributeSet == null) {
        throw new NullPointerException();
    }
    return new UnmodifiableDocAttributeSet(attributeSet);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.AttributeSetUtilities.unmodifiableView(PrintJobAttributeSet)

/**
     * Creates an unmodifiable view of the given print job attribute set.
     * @param  attributeSet  Underlying print job attribute set.
     * @return  Unmodifiable view of <CODE>attributeSet</CODE>.
     * @exception  NullPointerException
     *     Thrown if <CODE>attributeSet</CODE> is null.
     */
public static PrintJobAttributeSet unmodifiableView(PrintJobAttributeSet attributeSet) {
    if (attributeSet == null) {
        throw new NullPointerException();
    }
    return new UnmodifiablePrintJobAttributeSet(attributeSet);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.AttributeSetUtilities.unmodifiableView(PrintRequestAttributeSet)

/**
     * Creates an unmodifiable view of the given print request attribute set.
     * @param  attributeSet  Underlying print request attribute set.
     * @return  Unmodifiable view of <CODE>attributeSet</CODE>.
     * @exception  NullPointerException
     *     Thrown if <CODE>attributeSet</CODE> is null.
     */
public static PrintRequestAttributeSet unmodifiableView(PrintRequestAttributeSet attributeSet) {
    if (attributeSet == null) {
        throw new NullPointerException();
    }
    return new UnmodifiablePrintRequestAttributeSet(attributeSet);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.AttributeSetUtilities.unmodifiableView(PrintServiceAttributeSet)

/**
     * Creates an unmodifiable view of the given print service attribute set.
     * @param  attributeSet  Underlying print service attribute set.
     * @return  Unmodifiable view of <CODE>attributeSet</CODE>.
     * @exception  NullPointerException
     *     Thrown if <CODE>attributeSet</CODE> is null.
     */
public static PrintServiceAttributeSet unmodifiableView(PrintServiceAttributeSet attributeSet) {
    if (attributeSet == null) {
        throw new NullPointerException();
    }
    return new UnmodifiablePrintServiceAttributeSet(attributeSet);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.standard.JobStateReasons.add(JobStateReason)

/**
     * Adds the specified element to this job state reasons attribute if it is 
     * not already present. The element to be added must be an instance of class 
     * {@link JobStateReason JobStateReason}. If this job state reasons 
     * attribute already contains the specified element, the call leaves this 
     * job state reasons attribute unchanged and returns <tt>false</tt>. 
     * @param  o  Element to be added to this job state reasons attribute.
     * @return  <tt>true</tt> if this job state reasons attribute did not
     *          already contain the specified element. 
     * @throws  NullPointerException
     *     (unchecked exception) Thrown if the specified element is null.
     * @throws  ClassCastException
     *     (unchecked exception) Thrown if the specified element is not an 
     *     instance of class {@link JobStateReason JobStateReason}. 
     */
public boolean add(JobStateReason o) {
    if (o == null) {
        throw new NullPointerException();
    }
    return super.add((JobStateReason) o);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.datatype.Duration.equals(Object)

/**
  * Checks if this duration object has the same duration
  * as another <code>Duration</code> object.
  * 
  * For example, 'P1D' (1 day) is equal to 'PT24H' (24 hours).
  * 
  * Duration X is equal to Y if and only if time instant
  * t+X and t+Y are the same for all the test time instants
  * specified in the section 3.2.6.2 of the XML Schema 1.0 
  * specification.
  * 
  * Note that there are cases where two <code>Duration</code>s are
  * 'incomparable' to each other, like one month and 30 days.
  * For example,
  * 
  * !new Duration('P1M').isShorterThan(new Duration('P30D'))
  * !new Duration('P1M').isLongerThan(new Duration('P30D'))
  * !new Duration('P1M').equals(new Duration('P30D'))
  * 
  * 
  * @param duration
  *      A non-null valid <code>Duration</code> object.
  * 
  * @return
  *      <code>true</code> if this duration is the same length as
  *         <code>duration</code>.
  *      <code>false</code> if <code>duration</code> is not a
  *         <code>Duration</code> object
  *         or its length is different from this duration.
  * 
  * @throws UnsupportedOperationException If the underlying implementation
  *   cannot reasonably process the request, e.g. W3C XML Schema allows for
  *   arbitrarily large/small/precise values, the request may be beyond the
  *   implementations capability.
  * @throws NullPointerException if parameter is null.
  *
  * @see #compare(Duration duration)
  */
public boolean equals(final Object duration) {
    if (duration == null) {
        throw new NullPointerException();
    }
    if (!(duration instanceof Duration)) {
        return false;
    }
    return compare((Duration) duration) == DatatypeConstants.EQUAL;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.SchemaFactoryFinder.newFactory(String)

/**
     * Creates a new {@link SchemaFactory} object for the specified
     * schema language.
     * @param schemaLanguage
     *      See {@link SchemaFactory Schema Language} table in <code>SchemaFactory</code>
     *      for the list of available schema languages.
     * @return <code>null</code> if the callee fails to create one.
     * @throws NullPointerException
     *      If the <tt>schemaLanguage</tt> parameter is null.
     */
public SchemaFactory newFactory(String schemaLanguage) {
    if (schemaLanguage == null) throw new NullPointerException();
    SchemaFactory f = _newFactory(schemaLanguage);
    if (f != null) {
        debugPrintln('factory '' + f.getClass().getName() + '' was found for ' + schemaLanguage);
    } else {
        debugPrintln('unable to find a factory for ' + schemaLanguage);
    }
    return f;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.ValidatorHandler.getFeature(String)

/**
     * Look up the value of a feature flag.
     * The feature name is any fully-qualified URI.  It is
     * possible for a {@link ValidatorHandler} to recognize a feature name but
     * temporarily be unable to return its value.
     * Some feature values may be available only in specific
     * contexts, such as before, during, or after a validation.
     * Implementors are free (and encouraged) to invent their own features,
     * using names built on their own URIs.
     * @param name The feature name, which is a non-null fully-qualified URI.
     * @return The current value of the feature (true or false).
     * @exception org.xml.sax.SAXNotRecognizedException If the feature
     *            value can't be assigned or retrieved.
     * @exception org.xml.sax.SAXNotSupportedException When the
     *            {@link ValidatorHandler} recognizes the feature name but 
     *            cannot determine its value at this time.
     * @throws NullPointerException
     *          When the name parameter is null.
     * @see #setFeature(String, boolean)
     */
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) throw new NullPointerException();
    throw new SAXNotRecognizedException(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.ValidatorHandler.getProperty(String)

/**
     * Look up the value of a property.
     * The property name is any fully-qualified URI.  It is
     * possible for a {@link ValidatorHandler} to recognize a property name but
     * temporarily be unable to return its value.
     * Some property values may be available only in specific
     * contexts, such as before, during, or after a validation.
     * {@link ValidatorHandler}s are not required to recognize any specific
     * property names.
     * Implementors are free (and encouraged) to invent their own properties,
     * using names built on their own URIs.
     * @param name The property name, which is a non-null fully-qualified URI.
     * @return The current value of the property.
     * @exception org.xml.sax.SAXNotRecognizedException If the property
     *            value can't be assigned or retrieved.
     * @exception org.xml.sax.SAXNotSupportedException When the
     *            XMLReader recognizes the property name but 
     *            cannot determine its value at this time.
     * @throws NullPointerException
     *          When the name parameter is null.
     * @see #setProperty(String, Object)
     */
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) throw new NullPointerException();
    throw new SAXNotRecognizedException(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.ValidatorHandler.setFeature(String, boolean)

/**
     * Set the value of a feature flag.
     * 
     * Feature can be used to control the way a {@link ValidatorHandler}
     * parses schemas, although {@link ValidatorHandler}s are not required
     * to recognize any specific property names.
     * The feature name is any fully-qualified URI.  It is
     * possible for a {@link ValidatorHandler} to expose a feature value but
     * to be unable to change the current value.
     * Some feature values may be immutable or mutable only 
     * in specific contexts, such as before, during, or after 
     * a validation.
     * @param name The feature name, which is a non-null fully-qualified URI.
     * @param value The requested value of the feature (true or false).
     * @exception org.xml.sax.SAXNotRecognizedException If the feature
     *            value can't be assigned or retrieved.
     * @exception org.xml.sax.SAXNotSupportedException When the
     *            {@link ValidatorHandler} recognizes the feature name but 
     *            cannot set the requested value.
     * @throws NullPointerException
     *          When the name parameter is null.
     * @see #getFeature(String)
     */
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) throw new NullPointerException();
    throw new SAXNotRecognizedException(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.ValidatorHandler.setProperty(String, Object)

/**
     * Set the value of a property.
     * The property name is any fully-qualified URI.  It is
     * possible for a {@link ValidatorHandler} to recognize a property name but
     * to be unable to change the current value.
     * Some property values may be immutable or mutable only 
     * in specific contexts, such as before, during, or after 
     * a validation.
     * {@link ValidatorHandler}s are not required to recognize setting
     * any specific property names.
     * @param name The property name, which is a non-null fully-qualified URI.
     * @param object The requested value for the property.
     * @exception org.xml.sax.SAXNotRecognizedException If the property
     *            value can't be assigned or retrieved.
     * @exception org.xml.sax.SAXNotSupportedException When the
     *            {@link ValidatorHandler} recognizes the property name but 
     *            cannot set the requested value.
     * @throws NullPointerException
     *          When the name parameter is null.
     */
public void setProperty(String name, Object object) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) throw new NullPointerException();
    throw new SAXNotRecognizedException(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.xpath.XPathFactoryFinder.newFactory(String)

/**
     * Creates a new {@link XPathFactory} object for the specified
     * schema language.
     * @param uri
     *       Identifies the underlying object model.
     * @return <code>null</code> if the callee fails to create one.
     * @throws NullPointerException
     *      If the parameter is null.
     */
public XPathFactory newFactory(String uri) {
    if (uri == null) throw new NullPointerException();
    XPathFactory f = _newFactory(uri);
    if (f != null) {
        debugPrintln('factory '' + f.getClass().getName() + '' was found for ' + uri);
    } else {
        debugPrintln('unable to find a factory for ' + uri);
    }
    return f;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

org.w3c.dom.bootstrap.DOMImplementationRegistry.addSource(DOMImplementationSource)

/**
     * Register an implementation.
     * @param s The source to be registered, may not be <code>null</code>
     */
public void addSource(final DOMImplementationSource s) {
    if (s == null) {
        throw new NullPointerException();
    }
    if (!sources.contains(s)) {
        sources.addElement(s);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xalan.internal.xsltc.trax.SmartTransformerFactoryImpl.setFeature(String, boolean)

/**
     * Set a feature for this <code>SmartTransformerFactory</code> and <code>Transformer</code>s
     * or <code>Template</code>s created by this factory.
     * 
     * Feature names are fully qualified {@link java.net.URI}s.
     * Implementations may define their own features.
     * An {@link TransformerConfigurationException} is thrown if this <code>TransformerFactory</code> or the
     * <code>Transformer</code>s or <code>Template</code>s it creates cannot support the feature.
     * It is possible for an <code>TransformerFactory</code> to expose a feature value but be unable to change its state.
     * 
     * See {@link javax.xml.transform.TransformerFactory} for full documentation of specific features.
     * @param name Feature name.
     * @param value Is feature state <code>true</code> or <code>false</code>.
     * @throws TransformerConfigurationException if this <code>TransformerFactory</code>
     *   or the <code>Transformer</code>s or <code>Template</code>s it creates cannot support this feature.
     * @throws NullPointerException If the <code>name</code> parameter is null.
     */
public void setFeature(String name, boolean value) throws TransformerConfigurationException {
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    } else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        featureSecureProcessing = value;
        return;
    } else {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name);
        throw new TransformerConfigurationException(err.toString());
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.getFeature(String)

/**
     * javax.xml.transform.sax.TransformerFactory implementation.
     * Look up the value of a feature (to see if it is supported).
     * This method must be updated as the various methods and features of this
     * class are implemented.
     * @param name The feature name
     * @return 'true' if feature is supported, 'false' if not
     */
public boolean getFeature(String name) {
    String[] features = { DOMSource.FEATURE, DOMResult.FEATURE, SAXSource.FEATURE, SAXResult.FEATURE, StreamSource.FEATURE, StreamResult.FEATURE, SAXTransformerFactory.FEATURE, SAXTransformerFactory.FEATURE_XMLFILTER };
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }
    for (int i = 0; i < features.length; i++) {
        if (name.equals(features[i])) {
            return true;
        }
    }
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return _isSecureProcessing;
    }
    return false;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.setFeature(String, boolean)

/**
     * Set a feature for this <code>TransformerFactory</code> and <code>Transformer</code>s
     * or <code>Template</code>s created by this factory.
     * 
     * Feature names are fully qualified {@link java.net.URI}s.
     * Implementations may define their own features.
     * An {@link TransformerConfigurationException} is thrown if this <code>TransformerFactory</code> or the
     * <code>Transformer</code>s or <code>Template</code>s it creates cannot support the feature.
     * It is possible for an <code>TransformerFactory</code> to expose a feature value but be unable to change its state.
     * 
     * See {@link javax.xml.transform.TransformerFactory} for full documentation of specific features.
     * @param name Feature name.
     * @param value Is feature state <code>true</code> or <code>false</code>.
     * @throws TransformerConfigurationException if this <code>TransformerFactory</code>
     *   or the <code>Transformer</code>s or <code>Template</code>s it creates cannot support this feature.
     * @throws NullPointerException If the <code>name</code> parameter is null.
     */
public void setFeature(String name, boolean value) throws TransformerConfigurationException {
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    } else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        _isSecureProcessing = value;
        return;
    } else {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name);
        throw new TransformerConfigurationException(err.toString());
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xml.internal.serialize.BaseMarkupSerializer.setOutputByteStream(OutputStream)

public void setOutputByteStream(OutputStream output) {
    if (output == null) {
        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, 'ArgumentIsNull', new Object[] { 'output' });
        throw new NullPointerException(msg);
    }
    _output = output;
    _writer = null;
    reset();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xml.internal.serialize.BaseMarkupSerializer.setOutputCharStream(Writer)

public void setOutputCharStream(Writer writer) {
    if (writer == null) {
        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, 'ArgumentIsNull', new Object[] { 'writer' });
        throw new NullPointerException(msg);
    }
    _writer = writer;
    _output = null;
    reset();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xml.internal.serialize.BaseMarkupSerializer.setOutputFormat(OutputFormat)

public void setOutputFormat(OutputFormat format) {
    if (format == null) {
        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, 'ArgumentIsNull', new Object[] { 'format' });
        throw new NullPointerException(msg);
    }
    _format = format;
    reset();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.JAXPExtensionsProvider.extFunction(String, String, Vector, Object)

/**
     * Execute the extension function.
     */
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException {
    try {
        if (funcName == null) {
            String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] { 'Function Name' });
            throw new NullPointerException(fmsg);
        }
        javax.xml.namespace.QName myQName = new QName(ns, funcName);
        if (extensionInvocationDisabled) {
            String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() });
            throw new XPathFunctionException(fmsg);
        }
        int arity = argVec.size();
        javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction(myQName, arity);
        ArrayList argList = new ArrayList(arity);
        for (int i = 0; i < arity; i++) {
            Object argument = argVec.elementAt(i);
            if (argument instanceof XNodeSet) {
                argList.add(i, ((XNodeSet) argument).nodelist());
            } else if (argument instanceof XObject) {
                Object passedArgument = ((XObject) argument).object();
                argList.add(i, passedArgument);
            } else {
                argList.add(i, argument);
            }
        }
        return (xpathFunction.evaluate(argList));
    } catch (XPathFunctionException xfe) {
        throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(xfe);
    } catch (Exception e) {
        throw new javax.xml.transform.TransformerException(e);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.JAXPExtensionsProvider.functionAvailable(String, String)

/**
     * Is the extension function available?
     */
public boolean functionAvailable(String ns, String funcName) throws javax.xml.transform.TransformerException {
    try {
        if (funcName == null) {
            String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] { 'Function Name' });
            throw new NullPointerException(fmsg);
        }
        javax.xml.namespace.QName myQName = new QName(ns, funcName);
        javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction(myQName, 0);
        if (xpathFunction == null) {
            return false;
        }
        return true;
    } catch (Exception e) {
        return false;
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.XPathExpressionImpl.evaluate(InputSource, QName)

/**
     * Evaluate the compiled XPath expression in the context of the 
     * specified <code>InputSource</code> and return the result as the
     *  specified type.
     * This method builds a data model for the {@link InputSource} and calls
     * {@link #evaluate(Object item, QName returnType)} on the resulting 
     * document object.
     * See 'Evaluation of XPath Expressions' section of JAXP 1.3 spec
     *  for context item evaluation,
     * variable, function and QName resolution and return type conversion.
     * If <code>returnType</code> is not one of the types defined in 
     * {@link XPathConstants},
     * then an <code>IllegalArgumentException</code> is thrown.
     *If <code>source</code> or <code>returnType</code> is <code>null</code>,
     * then a <code>NullPointerException</code> is thrown.
     * @param source The <code>InputSource</code> of the document to evaluate
     * over.
     * @param returnType The desired return type.
     * @return The <code>Object</code> that is the result of evaluating the
     * expression and converting the result to
     *   <code>returnType</code>.
     * @throws XPathExpressionException If the expression cannot be evaluated.
     * @throws IllegalArgumentException If <code>returnType</code> is not one
     * of the types defined in {@link XPathConstants}.
     * @throws NullPointerException If  <code>source</code> or 
     * <code>returnType</code> is <code>null</code>.
     */
public Object evaluate(InputSource source, QName returnType) throws XPathExpressionException {
    if ((source == null) || (returnType == null)) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL, null);
        throw new NullPointerException(fmsg);
    }
    if (!isSupported(returnType)) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() });
        throw new IllegalArgumentException(fmsg);
    }
    try {
        if (dbf == null) {
            dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);
            dbf.setValidating(false);
        }
        db = dbf.newDocumentBuilder();
        Document document = db.parse(source);
        return eval(document, returnType);
    } catch (Exception e) {
        throw new XPathExpressionException(e);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.XPathExpressionImpl.evaluate(Object, QName)

/**
     * Evaluate the compiled XPath expression in the specified context and
     *  return the result as the specified type.
     * See 'Evaluation of XPath Expressions' section of JAXP 1.3 spec
     * for context item evaluation,
     * variable, function and QName resolution and return type conversion.
     * If <code>returnType</code> is not one of the types defined 
     * in {@link XPathConstants},
     * then an <code>IllegalArgumentException</code> is thrown.
     * If a <code>null</code> value is provided for
     * <code>item</code>, an empty document will be used for the
     * context.
     * If <code>returnType</code> is <code>null</code>, then a 
     * <code>NullPointerException</code> is thrown.
     * @param item The starting context (node or node list, for example).
     * @param returnType The desired return type.
     * @return The <code>Object</code> that is the result of evaluating the
     * expression and converting the result to
     *   <code>returnType</code>.
     * @throws XPathExpressionException If the expression cannot be evaluated.
     * @throws IllegalArgumentException If <code>returnType</code> is not one
     * of the types defined in {@link XPathConstants}.
     * @throws NullPointerException If  <code>returnType</code> is
     * <code>null</code>.
     */
public Object evaluate(Object item, QName returnType) throws XPathExpressionException {
    if (returnType == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] { 'returnType' });
        throw new NullPointerException(fmsg);
    }
    if (!isSupported(returnType)) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() });
        throw new IllegalArgumentException(fmsg);
    }
    try {
        return eval(item, returnType);
    } catch (java.lang.NullPointerException npe) {
        throw new XPathExpressionException(npe);
    } catch (javax.xml.transform.TransformerException te) {
        Throwable nestedException = te.getException();
        if (nestedException instanceof javax.xml.xpath.XPathFunctionException) {
            throw (javax.xml.xpath.XPathFunctionException) nestedException;
        } else {
            throw new XPathExpressionException(te);
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl.getFeature(String)

/**
  * Get the state of the named feature.
  * 
  * 
  * Feature names are fully qualified {@link java.net.URI}s.
  * Implementations may define their own features.
  * An {@link XPathFactoryConfigurationException} is thrown if this
         * <code>XPathFactory</code> or the <code>XPath</code>s
  * it creates cannot support the feature.
  * It is possible for an <code>XPathFactory</code> to expose a feature 
         * value but be unable to change its state.
  * 
  * 
  * @param name Feature name.
  * 
  * @return State of the named feature.
  * 
  * @throws XPathFactoryConfigurationException if this 
         * <code>XPathFactory</code> or the <code>XPath</code>s
  *   it creates cannot support this feature.
         * @throws NullPointerException if <code>name</code> is 
         * <code>null</code>.
  */
public boolean getFeature(String name) throws XPathFactoryConfigurationException {
    if (name == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_GETTING_NULL_FEATURE, new Object[] { CLASS_NAME });
        throw new NullPointerException(fmsg);
    }
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return featureSecureProcessing;
    }
    String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_GETTING_UNKNOWN_FEATURE, new Object[] { name, CLASS_NAME });
    throw new XPathFactoryConfigurationException(fmsg);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl.isObjectModelSupported(String)

/**
  * Is specified object model supported by this 
         * <code>XPathFactory</code>?
  * 
  * @param objectModel Specifies the object model which the returned
         * <code>XPathFactory</code> will understand.
  *  
  * @return <code>true</code> if <code>XPathFactory</code> supports 
         * <code>objectModel</code>, else <code>false</code>.
  * 
  * @throws NullPointerException If <code>objectModel</code> is <code>null</code>.
  * @throws IllegalArgumentException If <code>objectModel.length() == 0</code>.
  */
public boolean isObjectModelSupported(String objectModel) {
    if (objectModel == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_OBJECT_MODEL_NULL, new Object[] { this.getClass().getName() });
        throw new NullPointerException(fmsg);
    }
    if (objectModel.length() == 0) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_OBJECT_MODEL_EMPTY, new Object[] { this.getClass().getName() });
        throw new IllegalArgumentException(fmsg);
    }
    if (objectModel.equals(XPathFactory.DEFAULT_OBJECT_MODEL_URI)) {
        return true;
    }
    return false;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl.setFeature(String, boolean)

/**
  * Set a feature for this <code>XPathFactory</code> and 
         * <code>XPath</code>s created by this factory.
  * 
  * 
  * Feature names are fully qualified {@link java.net.URI}s.
  * Implementations may define their own features.
  * An {@link XPathFactoryConfigurationException} is thrown if this
         * <code>XPathFactory</code> or the <code>XPath</code>s
  *  it creates cannot support the feature.
  * It is possible for an <code>XPathFactory</code> to expose a feature
         * value but be unable to change its state.
  * 
  * 
  * See {@link javax.xml.xpath.XPathFactory} for full documentation
         * of specific features.
  * 
  * @param name Feature name.
  * @param value Is feature state <code>true</code> or <code>false</code>.
  *  
  * @throws XPathFactoryConfigurationException if this 
         * <code>XPathFactory</code> or the <code>XPath</code>s
  *   it creates cannot support this feature.
         * @throws NullPointerException if <code>name</code> is 
         * <code>null</code>.
  */
public void setFeature(String name, boolean value) throws XPathFactoryConfigurationException {
    if (name == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_FEATURE_NAME_NULL, new Object[] { CLASS_NAME, new Boolean(value) });
        throw new NullPointerException(fmsg);
    }
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        featureSecureProcessing = value;
        return;
    }
    String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_FEATURE_UNKNOWN, new Object[] { name, CLASS_NAME, new Boolean(value) });
    throw new XPathFactoryConfigurationException(fmsg);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl.setXPathFunctionResolver(XPathFunctionResolver)

/**
         * Establish a default function resolver.
  * Any <code>XPath</code> objects constructed from this factory will use
  * the specified resolver by default.
  *
  * A <code>NullPointerException</code> is thrown if 
         * <code>resolver</code> is <code>null</code>.
  * @param resolver XPath function resolver.
  * 
  * @throws NullPointerException If <code>resolver</code> is 
         * <code>null</code>.
  */
public void setXPathFunctionResolver(XPathFunctionResolver resolver) {
    if (resolver == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_XPATH_FUNCTION_RESOLVER, new Object[] { CLASS_NAME });
        throw new NullPointerException(fmsg);
    }
    xPathFunctionResolver = resolver;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl.setXPathVariableResolver(XPathVariableResolver)

/**
  * Establish a default variable resolver.
  *
  * Any <code>XPath</code> objects constructed from this factory will use
  * the specified resolver by default.
  * 
  * A <code>NullPointerException</code> is thrown if <code>resolver</code> is <code>null</code>.
  * 
  * @param resolver Variable resolver.
  * 
  *  @throws NullPointerException If <code>resolver</code> is 
         * <code>null</code>.
  */
public void setXPathVariableResolver(XPathVariableResolver resolver) {
    if (resolver == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_XPATH_VARIABLE_RESOLVER, new Object[] { CLASS_NAME });
        throw new NullPointerException(fmsg);
    }
    xPathVariableResolver = resolver;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.XPathImpl.compile(String)

/**
     * Compile an XPath expression for later evaluation.
     * If <code>expression</code> contains any {@link XPathFunction}s,
     * they must be available via the {@link XPathFunctionResolver}.
     * An {@link XPathExpressionException} will be thrown if the <code>XPathFunction</code>
     * cannot be resovled with the <code>XPathFunctionResolver</code>.
     * If <code>expression</code> is <code>null</code>, a <code>NullPointerException</code> is thrown.
     * @param expression The XPath expression.
     * @return Compiled XPath expression.

     * @throws XPathExpressionException If <code>expression</code> cannot be compiled.
     * @throws NullPointerException If <code>expression</code> is <code>null</code>.
     */
public XPathExpression compile(String expression) throws XPathExpressionException {
    if (expression == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] { 'XPath expression' });
        throw new NullPointerException(fmsg);
    }
    try {
        com.sun.org.apache.xpath.internal.XPath xpath = new XPath(expression, null, prefixResolver, com.sun.org.apache.xpath.internal.XPath.SELECT);
        XPathExpressionImpl ximpl = new XPathExpressionImpl(xpath, prefixResolver, functionResolver, variableResolver, featureSecureProcessing);
        return ximpl;
    } catch (javax.xml.transform.TransformerException te) {
        throw new XPathExpressionException(te);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(String, InputSource, QName)

/**
     * Evaluate an XPath expression in the context of the specified <code>InputSource</code>
     * and return the result as the specified type.
     * This method builds a data model for the {@link InputSource} and calls
     * {@link #evaluate(String expression, Object item, QName returnType)} on the resulting document object.
     * See 'Evaluation of XPath Expressions' section of JAXP 1.3 spec 
     * for context item evaluation,
     * variable, function and QName resolution and return type conversion.
     * If <code>returnType</code> is not one of the types defined in {@link XPathConstants},
     * then an <code>IllegalArgumentException</code> is thrown.
     * If <code>expression</code>, <code>source</code> or <code>returnType</code> is <code>null</code>,
     * then a <code>NullPointerException</code> is thrown.
     * @param expression The XPath expression.
     * @param source The input source of the document to evaluate over.
     * @param returnType The desired return type.
     * @return The <code>Object</code> that encapsulates the result of evaluating the expression.
     * @throws XPathExpressionException If expression cannot be evaluated.
     * @throws IllegalArgumentException If <code>returnType</code> is not one of the types defined in {@link XPathConstants}.
     * @throws NullPointerException If <code>expression</code>, <code>source</code> or <code>returnType</code>
     *   is <code>null</code>.
     */
public Object evaluate(String expression, InputSource source, QName returnType) throws XPathExpressionException {
    if (source == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] { 'source' });
        throw new NullPointerException(fmsg);
    }
    if (expression == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] { 'XPath expression' });
        throw new NullPointerException(fmsg);
    }
    if (returnType == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] { 'returnType' });
        throw new NullPointerException(fmsg);
    }
    if (!isSupported(returnType)) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() });
        throw new IllegalArgumentException(fmsg);
    }
    try {
        Document document = getParser().parse(source);
        XObject resultObject = eval(expression, document);
        return getResultAsType(resultObject, returnType);
    } catch (SAXException e) {
        throw new XPathExpressionException(e);
    } catch (IOException e) {
        throw new XPathExpressionException(e);
    } catch (javax.xml.transform.TransformerException te) {
        Throwable nestedException = te.getException();
        if (nestedException instanceof javax.xml.xpath.XPathFunctionException) {
            throw (javax.xml.xpath.XPathFunctionException) nestedException;
        } else {
            throw new XPathExpressionException(te);
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(String, Object, QName)

/**
     * Evaluate an <code>XPath</code> expression in the specified context and return the result as the specified type.
     * See 'Evaluation of XPath Expressions' section of JAXP 1.3 spec
     * for context item evaluation,
     * variable, function and <code>QName</code> resolution and return type conversion.
     * If <code>returnType</code> is not one of the types defined in {@link XPathConstants} (
     * {@link XPathConstants#NUMBER NUMBER},
     * {@link XPathConstants#STRING STRING},
     * {@link XPathConstants#BOOLEAN BOOLEAN},
     * {@link XPathConstants#NODE NODE} or
     * {@link XPathConstants#NODESET NODESET})
     * then an <code>IllegalArgumentException</code> is thrown.
     * If a <code>null</code> value is provided for
     * <code>item</code>, an empty document will be used for the
     * context.
     * If <code>expression</code> or <code>returnType</code> is <code>null</code>, then a
     * <code>NullPointerException</code> is thrown.
     * @param expression The XPath expression.
     * @param item The starting context (node or node list, for example).
     * @param returnType The desired return type.
     * @return Result of evaluating an XPath expression as an <code>Object</code> of <code>returnType</code>.
     * @throws XPathExpressionException If <code>expression</code> cannot be evaluated.
     * @throws IllegalArgumentException If <code>returnType</code> is not one of the types defined in {@link XPathConstants}.
     * @throws NullPointerException If <code>expression</code> or <code>returnType</code> is <code>null</code>.
     */
public Object evaluate(String expression, Object item, QName returnType) throws XPathExpressionException {
    if (expression == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] { 'XPath expression' });
        throw new NullPointerException(fmsg);
    }
    if (returnType == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] { 'returnType' });
        throw new NullPointerException(fmsg);
    }
    if (!isSupported(returnType)) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() });
        throw new IllegalArgumentException(fmsg);
    }
    try {
        XObject resultObject = eval(expression, item);
        return getResultAsType(resultObject, returnType);
    } catch (java.lang.NullPointerException npe) {
        throw new XPathExpressionException(npe);
    } catch (javax.xml.transform.TransformerException te) {
        Throwable nestedException = te.getException();
        if (nestedException instanceof javax.xml.xpath.XPathFunctionException) {
            throw (javax.xml.xpath.XPathFunctionException) nestedException;
        } else {
            throw new XPathExpressionException(te);
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.XPathImpl.setNamespaceContext(NamespaceContext)

/**
     * Establishes a namespace context.
     * @param nsContext Namespace context to use
     */
public void setNamespaceContext(NamespaceContext nsContext) {
    if (nsContext == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] { 'NamespaceContext' });
        throw new NullPointerException(fmsg);
    }
    this.namespaceContext = nsContext;
    this.prefixResolver = new JAXPPrefixResolver(nsContext);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.XPathImpl.setXPathFunctionResolver(XPathFunctionResolver)

/**
     * Establishes a function resolver.
     * @param resolver XPath function resolver
     */
public void setXPathFunctionResolver(XPathFunctionResolver resolver) {
    if (resolver == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] { 'XPathFunctionResolver' });
        throw new NullPointerException(fmsg);
    }
    this.functionResolver = resolver;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xpath.internal.jaxp.XPathImpl.setXPathVariableResolver(XPathVariableResolver)

/**
     * Establishes a variable resolver.
     * @param resolver Variable Resolver
     */
public void setXPathVariableResolver(XPathVariableResolver resolver) {
    if (resolver == null) {
        String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] { 'XPathVariableResolver' });
        throw new NullPointerException(fmsg);
    }
    this.variableResolver = resolver;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xerces.internal.jaxp.datatype.DurationImpl.getField(DatatypeConstants.Field)

/**
     * Gets the value of a field. 
     * Fields of a duration object may contain arbitrary large value.
     * Therefore this method is designed to return a {@link Number} object.
     * In case of YEARS, MONTHS, DAYS, HOURS, and MINUTES, the returned
     * number will be a non-negative integer. In case of seconds,
     * the returned number may be a non-negative decimal value.
     * @param field
     *      one of the six Field constants (YEARS,MONTHS,DAYS,HOURS,
     *      MINUTES, or SECONDS.)
     * @return
     *      If the specified field is present, this method returns
     *      a non-null non-negative {@link Number} object that
     *      represents its value. If it is not present, return null.
     *      For YEARS, MONTHS, DAYS, HOURS, and MINUTES, this method
     *      returns a {@link BigInteger} object. For SECONDS, this
     *      method returns a {@link BigDecimal}. 
     * @throws NullPointerException
     *      If the field parameter is null.
     */
public Number getField(DatatypeConstants.Field field) {
    if (field == null) {
        String methodName = 'javax.xml.datatype.Duration' + '#isSet(DatatypeConstants.Field field) ';
        throw new NullPointerException(DatatypeMessageFormatter.formatMessage(null, 'FieldCannotBeNull', new Object[] { methodName }));
    }
    if (field == DatatypeConstants.YEARS) {
        return years;
    }
    if (field == DatatypeConstants.MONTHS) {
        return months;
    }
    if (field == DatatypeConstants.DAYS) {
        return days;
    }
    if (field == DatatypeConstants.HOURS) {
        return hours;
    }
    if (field == DatatypeConstants.MINUTES) {
        return minutes;
    }
    if (field == DatatypeConstants.SECONDS) {
        return seconds;
    }
    String methodName = 'javax.xml.datatype.Duration' + '#(getSet(DatatypeConstants.Field field)';
    throw new IllegalArgumentException(DatatypeMessageFormatter.formatMessage(null, 'UnknownField', new Object[] { methodName, field.toString() }));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xerces.internal.jaxp.datatype.DurationImpl.isSet(DatatypeConstants.Field)

/**
     * Checks if a field is set.
     * A field of a duration object may or may not be present.
     * This method can be used to test if a field is present.
     * @param field
     *      one of the six Field constants (YEARS,MONTHS,DAYS,HOURS,
     *      MINUTES, or SECONDS.)
     * @return
     *      true if the field is present. false if not.
     * @throws NullPointerException
     *      If the field parameter is null.
     */
public boolean isSet(DatatypeConstants.Field field) {
    if (field == null) {
        String methodName = 'javax.xml.datatype.Duration' + '#isSet(DatatypeConstants.Field field)';
        throw new NullPointerException(DatatypeMessageFormatter.formatMessage(null, 'FieldCannotBeNull', new Object[] { methodName }));
    }
    if (field == DatatypeConstants.YEARS) {
        return years != null;
    }
    if (field == DatatypeConstants.MONTHS) {
        return months != null;
    }
    if (field == DatatypeConstants.DAYS) {
        return days != null;
    }
    if (field == DatatypeConstants.HOURS) {
        return hours != null;
    }
    if (field == DatatypeConstants.MINUTES) {
        return minutes != null;
    }
    if (field == DatatypeConstants.SECONDS) {
        return seconds != null;
    }
    String methodName = 'javax.xml.datatype.Duration' + '#isSet(DatatypeConstants.Field field)';
    throw new IllegalArgumentException(DatatypeMessageFormatter.formatMessage(null, 'UnknownField', new Object[] { methodName, field.toString() }));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl.isSchemaLanguageSupported(String)

/**
     * Is specified schema supported by this <code>SchemaFactory</code>?
     * @param schemaLanguage Specifies the schema language which the returned <code>SchemaFactory</code> will understand.
     *    <code>schemaLanguage</code> must specify a <a href='#schemaLanguage'>valid</a> schema language.
     * @return <code>true</code> if <code>SchemaFactory</code> supports <code>schemaLanguage</code>, else <code>false</code>.
     * @throws NullPointerException If <code>schemaLanguage</code> is <code>null</code>.
     * @throws IllegalArgumentException If <code>schemaLanguage.length() == 0</code>
     *   or <code>schemaLanguage</code> does not specify a <a href='#schemaLanguage'>valid</a> schema language.
     */
public boolean isSchemaLanguageSupported(String schemaLanguage) {
    if (schemaLanguage == null) {
        throw new NullPointerException(messageFormatter.formatMessage(Locale.getDefault(), 'SchemaLanguageSupportedErrorWhenNull', new Object[] { this.getClass().getName() }));
    }
    if (schemaLanguage.length() == 0) {
        throw new IllegalArgumentException(messageFormatter.formatMessage(Locale.getDefault(), 'SchemaLanguageSupportedErrorWhenLength', new Object[] { this.getClass().getName() }));
    }
    if (schemaLanguage.equals(XMLConstants.W3C_XML_SCHEMA_NS_URI) || schemaLanguage.equals(XMLConstants.RELAXNG_NS_URI)) {
        return true;
    }
    return false;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.security.auth.Subject.getSubject(AccessControlContext)

/**
     * Get the <code>Subject</code> associated with the provided
     * <code>AccessControlContext</code>.
     *  The <code>AccessControlContext</code> may contain many
     * Subjects (from nested <code>doAs</code> calls).
     * In this situation, the most recent <code>Subject</code> associated
     * with the <code>AccessControlContext</code> is returned.
     * 
     * @param  acc the <code>AccessControlContext</code> from which to retrieve
     *  the <code>Subject</code>.
     * @return  the <code>Subject</code> associated with the provided
     *  <code>AccessControlContext</code>, or <code>null</code>
     *  if no <code>Subject</code> is associated
     *  with the provided <code>AccessControlContext</code>.
     * @exception SecurityException if the caller does not have permission
     *  to get the <code>Subject</code>. 
     * @exception NullPointerException if the provided
     *  <code>AccessControlContext</code> is <code>null</code>.
     */
public static Subject getSubject(final AccessControlContext acc) {
    java.lang.SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new AuthPermission('getSubject'));
    }
    if (acc == null) {
        throw new NullPointerException(ResourcesMgr.getString('invalid null AccessControlContext provided'));
    }
    return (Subject) AccessController.doPrivileged(new java.security.PrivilegedAction() {

        public Object run() {
            DomainCombiner dc = acc.getDomainCombiner();
            if (!(dc instanceof SubjectDomainCombiner)) return null;
            SubjectDomainCombiner sdc = (SubjectDomainCombiner) dc;
            return sdc.getSubject();
        }
    });
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.security.auth.Subject.doAs(Subject, java.security.PrivilegedAction)

/**
     * Perform work as a particular <code>Subject</code>.
     *  This method first retrieves the current Thread's
     * <code>AccessControlContext</code> via
     * <code>AccessController.getContext</code>,
     * and then instantiates a new <code>AccessControlContext</code>
     * using the retrieved context along with a new
     * <code>SubjectDomainCombiner</code> (constructed using
     * the provided <code>Subject</code>).
     * Finally, this method invokes <code>AccessController.doPrivileged</code>,
     * passing it the provided <code>PrivilegedAction</code>,
     * as well as the newly constructed <code>AccessControlContext</code>.
     * 
     * @param subject the <code>Subject</code> that the specified
     *   <code>action</code> will run as.  This parameter
     *   may be <code>null</code>. 
     * @param action the code to be run as the specified
     *   <code>Subject</code>. 
     * @return the <code>Object</code> returned by the PrivilegedAction's
     *   <code>run</code> method.
     * @exception NullPointerException if the <code>PrivilegedAction</code>
     *   is <code>null</code>. 
     * @exception SecurityException if the caller does not have permission
     *   to invoke this method.
     */
public static Object doAs(final Subject subject, final java.security.PrivilegedAction action) {
    java.lang.SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(SecurityConstants.DO_AS_PERMISSION);
    }
    if (action == null) throw new NullPointerException(ResourcesMgr.getString('invalid null action provided'));
    final AccessControlContext currentAcc = AccessController.getContext();
    return java.security.AccessController.doPrivileged(action, createContext(subject, currentAcc));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.security.auth.Subject.doAs(Subject, java.security.PrivilegedExceptionAction)

/**
     * Perform work as a particular <code>Subject</code>.
     *  This method first retrieves the current Thread's
     * <code>AccessControlContext</code> via
     * <code>AccessController.getContext</code>,
     * and then instantiates a new <code>AccessControlContext</code>
     * using the retrieved context along with a new
     * <code>SubjectDomainCombiner</code> (constructed using
     * the provided <code>Subject</code>).
     * Finally, this method invokes <code>AccessController.doPrivileged</code>,
     * passing it the provided <code>PrivilegedExceptionAction</code>,
     * as well as the newly constructed <code>AccessControlContext</code>.
     * 
     * @param subject the <code>Subject</code> that the specified
     *   <code>action</code> will run as.  This parameter
     *   may be <code>null</code>. 
     * @param action the code to be run as the specified
     *   <code>Subject</code>. 
     * @return the <code>Object</code> returned by the
     *   PrivilegedExceptionAction's <code>run</code> method.
     * @exception PrivilegedActionException if the
     *   <code>PrivilegedExceptionAction.run</code>
     *   method throws a checked exception. 
     * @exception NullPointerException if the specified
     *   <code>PrivilegedExceptionAction</code> is
     *   <code>null</code>. 
     * @exception SecurityException if the caller does not have permission
     *   to invoke this method.
     */
public static Object doAs(final Subject subject, final java.security.PrivilegedExceptionAction action) throws java.security.PrivilegedActionException {
    java.lang.SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(SecurityConstants.DO_AS_PERMISSION);
    }
    if (action == null) throw new NullPointerException(ResourcesMgr.getString('invalid null action provided'));
    final AccessControlContext currentAcc = AccessController.getContext();
    return java.security.AccessController.doPrivileged(action, createContext(subject, currentAcc));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.security.auth.Subject.doAsPrivileged(Subject, java.security.PrivilegedAction, java.security.AccessControlContext)

/**
     * Perform privileged work as a particular <code>Subject</code>.
     *  This method behaves exactly as <code>Subject.doAs</code>,
     * except that instead of retrieving the current Thread's
     * <code>AccessControlContext</code>, it uses the provided
     * <code>AccessControlContext</code>.  If the provided
     * <code>AccessControlContext</code> is <code>null</code>,
     * this method instantiates a new <code>AccessControlContext</code>
     * with an empty collection of ProtectionDomains.
     * 
     * @param subject the <code>Subject</code> that the specified
     *   <code>action</code> will run as.  This parameter
     *   may be <code>null</code>. 
     * @param action the code to be run as the specified
     *   <code>Subject</code>. 
     * @param acc the <code>AccessControlContext</code> to be tied to the
     *   specified <i>subject</i> and <i>action</i>. 
     * @return the <code>Object</code> returned by the PrivilegedAction's
     *   <code>run</code> method.
     * @exception NullPointerException if the <code>PrivilegedAction</code>
     *   is <code>null</code>. 
     * @exception SecurityException if the caller does not have permission
     *   to invoke this method.
     */
public static Object doAsPrivileged(final Subject subject, final java.security.PrivilegedAction action, final java.security.AccessControlContext acc) {
    java.lang.SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(SecurityConstants.DO_AS_PRIVILEGED_PERMISSION);
    }
    if (action == null) throw new NullPointerException(ResourcesMgr.getString('invalid null action provided'));
    final AccessControlContext callerAcc = (acc == null ? new AccessControlContext(new ProtectionDomain[0]) : acc);
    return java.security.AccessController.doPrivileged(action, createContext(subject, callerAcc));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.security.auth.Subject.doAsPrivileged(Subject, java.security.PrivilegedExceptionAction, java.security.AccessControlContext)

/**
     * Perform privileged work as a particular <code>Subject</code>.
     *  This method behaves exactly as <code>Subject.doAs</code>,
     * except that instead of retrieving the current Thread's
     * <code>AccessControlContext</code>, it uses the provided
     * <code>AccessControlContext</code>.  If the provided
     * <code>AccessControlContext</code> is <code>null</code>,
     * this method instantiates a new <code>AccessControlContext</code>
     * with an empty collection of ProtectionDomains.
     * 
     * @param subject the <code>Subject</code> that the specified
     *   <code>action</code> will run as.  This parameter
     *   may be <code>null</code>. 
     * @param action the code to be run as the specified
     *   <code>Subject</code>. 
     * @param acc the <code>AccessControlContext</code> to be tied to the
     *   specified <i>subject</i> and <i>action</i>. 
     * @return the <code>Object</code> returned by the
     *   PrivilegedExceptionAction's <code>run</code> method.
     * @exception PrivilegedActionException if the
     *   <code>PrivilegedExceptionAction.run</code>
     *   method throws a checked exception. 
     * @exception NullPointerException if the specified
     *   <code>PrivilegedExceptionAction</code> is
     *   <code>null</code>. 
     * @exception SecurityException if the caller does not have permission
     *   to invoke this method.
     */
public static Object doAsPrivileged(final Subject subject, final java.security.PrivilegedExceptionAction action, final java.security.AccessControlContext acc) throws java.security.PrivilegedActionException {
    java.lang.SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(SecurityConstants.DO_AS_PRIVILEGED_PERMISSION);
    }
    if (action == null) throw new NullPointerException(ResourcesMgr.getString('invalid null action provided'));
    final AccessControlContext callerAcc = (acc == null ? new AccessControlContext(new ProtectionDomain[0]) : acc);
    return java.security.AccessController.doPrivileged(action, createContext(subject, callerAcc));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl.getFeature(String)

public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) throw new NullPointerException(SAXMessageFormatter.formatMessage(Locale.getDefault(), 'nullparameter', new Object[] { 'getFeature(String)' }));
    if (name.equals(Constants.FEATURE_SECURE_PROCESSING)) return enableSP; else throw new SAXNotRecognizedException(SAXMessageFormatter.formatMessage(Locale.getDefault(), 'feature-not-supported', new Object[] { name }));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl.setFeature(String, boolean)

public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) throw new NullPointerException(SAXMessageFormatter.formatMessage(Locale.getDefault(), 'nullparameter', new Object[] { 'setFeature(String,boolean)' }));
    if (name.equals(Constants.FEATURE_SECURE_PROCESSING)) {
        enableSP = value;
    } else throw new SAXNotRecognizedException(SAXMessageFormatter.formatMessage(Locale.getDefault(), 'feature-not-supported', new Object[] { name }));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.Statement.invoke()

Object invoke() throws Exception {
    Object target = getTarget();
    String methodName = getMethodName();
    if (target == null || methodName == null) {
        throw new NullPointerException((target == null ? 'target' : 'methodName') + ' should not be null');
    }
    Object[] arguments = getArguments();
    if (target == Class.class && methodName.equals('forName')) {
        return ObjectHandler.classForName((String) arguments[0]);
    }
    Class[] argClasses = new Class[arguments.length];
    for (int i = 0; i < arguments.length; i++) {
        argClasses[i] = (arguments[i] == null) ? null : arguments[i].getClass();
    }
    AccessibleObject m = null;
    if (target instanceof Class) {
        if (methodName.equals('new')) {
            methodName = 'newInstance';
        }
        if (methodName.equals('newInstance') && ((Class) target).isArray()) {
            Object result = Array.newInstance(((Class) target).getComponentType(), arguments.length);
            for (int i = 0; i < arguments.length; i++) {
                Array.set(result, i, arguments[i]);
            }
            return result;
        }
        if (methodName.equals('newInstance') && arguments.length != 0) {
            if (target == Character.class && arguments.length == 1 && argClasses[0] == String.class) {
                return new Character(((String) arguments[0]).charAt(0));
            }
            m = ReflectionUtils.getConstructor((Class) target, argClasses);
        }
        if (m == null && target != Class.class) {
            m = ReflectionUtils.getMethod((Class) target, methodName, argClasses);
        }
        if (m == null) {
            m = ReflectionUtils.getMethod(Class.class, methodName, argClasses);
        }
    } else {
        if (target.getClass().isArray() && (methodName.equals('set') || methodName.equals('get'))) {
            int index = ((Integer) arguments[0]).intValue();
            if (methodName.equals('get')) {
                return Array.get(target, index);
            } else {
                Array.set(target, index, arguments[1]);
                return null;
            }
        }
        m = ReflectionUtils.getMethod(target.getClass(), methodName, argClasses);
    }
    if (m != null) {
        try {
            if (m instanceof Method) {
                return MethodUtil.invoke((Method) m, target, arguments);
            } else {
                return ((Constructor) m).newInstance(arguments);
            }
        } catch (IllegalAccessException iae) {
            throw new Exception('Statement cannot invoke: ' + methodName + ' on ' + target.getClass(), iae);
        } catch (InvocationTargetException ite) {
            Throwable te = ite.getTargetException();
            if (te instanceof Exception) {
                throw (Exception) te;
            } else {
                throw ite;
            }
        }
    }
    throw new NoSuchMethodException(toString());
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.XMLEncoder.outputStatement(Statement, Object, boolean)

private void outputStatement(Statement exp, Object outer, boolean isArgument) {
    Object target = exp.getTarget();
    String methodName = exp.getMethodName();
    if (target == null || methodName == null) {
        throw new NullPointerException((target == null ? 'target' : 'methodName') + ' should not be null');
    }
    Object[] args = exp.getArguments();
    boolean expression = exp.getClass() == Expression.class;
    Object value = (expression) ? getValue((Expression) exp) : null;
    String tag = (expression && isArgument) ? 'object' : 'void';
    String attributes = '';
    ValueData d = getValueData(value);
    if (expression) {
        if (d.refs > 1) {
            String instanceName = nameGenerator.instanceName(value);
            d.name = instanceName;
            attributes = attributes + ' id=' + quote(instanceName);
        }
    }
    if (target == outer) {
    } else if (target == Array.class && methodName.equals('newInstance')) {
        tag = 'array';
        attributes = attributes + ' class=' + quote(((Class) args[0]).getName());
        attributes = attributes + ' length=' + quote(args[1].toString());
        args = new Object[] {};
    } else if (target.getClass() == Class.class) {
        attributes = attributes + ' class=' + quote(((Class) target).getName());
    } else {
        d.refs = 2;
        outputValue(target, outer, false);
        outputValue(value, outer, false);
        return;
    }
    if ((!expression && methodName.equals('set') && args.length == 2 && args[0] instanceof Integer) || (expression && methodName.equals('get') && args.length == 1 && args[0] instanceof Integer)) {
        attributes = attributes + ' index=' + quote(args[0].toString());
        args = (args.length == 1) ? new Object[] {} : new Object[] { args[1] };
    } else if ((!expression && methodName.startsWith('set') && args.length == 1) || (expression && methodName.startsWith('get') && args.length == 0)) {
        attributes = attributes + ' property=' + quote(Introspector.decapitalize(methodName.substring(3)));
    } else if (!methodName.equals('new') && !methodName.equals('newInstance')) {
        attributes = attributes + ' method=' + quote(methodName);
    }
    Vector statements = statementList(value);
    if (args.length == 0 && statements.size() == 0) {
        writeln('<' + tag + attributes + '/>');
        return;
    }
    writeln('<' + tag + attributes + '>');
    indentation++;
    for (int i = 0; i < args.length; i++) {
        outputValue(args[i], null, true);
    }
    for (int i = 0; i < statements.size(); i++) {
        Statement s = (Statement) statements.get(i);
        outputStatement(s, value, false);
    }
    indentation--;
    writeln('</' + tag + '>');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.XMLEncoder.outputValue(Object, Object, boolean)

private void outputValue(Object value, Object outer, boolean isArgument) {
    if (value == null) {
        writeln('<null/>');
        return;
    }
    if (value instanceof Class) {
        writeln('<class>' + ((Class) value).getName() + '</class>');
        return;
    }
    ValueData d = getValueData(value);
    if (d.exp != null) {
        Object target = d.exp.getTarget();
        String methodName = d.exp.getMethodName();
        if (target == null || methodName == null) {
            throw new NullPointerException((target == null ? 'target' : 'methodName') + ' should not be null');
        }
        if (target instanceof Field && methodName.equals('get')) {
            Field f = (Field) target;
            writeln('<object class=' + quote(f.getDeclaringClass().getName()) + ' field=' + quote(f.getName()) + '/>');
            return;
        }
        Class primitiveType = ReflectionUtils.primitiveTypeFor(value.getClass());
        if (primitiveType != null && target == value.getClass() && methodName.equals('new')) {
            String primitiveTypeName = primitiveType.getName();
            if (primitiveType == Character.TYPE) {
                value = quoteCharacters(((Character) value).toString());
            }
            writeln('<' + primitiveTypeName + '>' + value + '</' + primitiveTypeName + '>');
            return;
        }
    } else if (value instanceof String) {
        writeln('<string>' + quoteCharacters((String) value) + '</string>');
        return;
    }
    if (d.name != null) {
        writeln('<object idref=' + quote(d.name) + '/>');
        return;
    }
    outputStatement(d.exp, outer, isArgument);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.openmbean.TabularDataSupport.checkKeyType(Object[])

/**
     * Checks if the specified key is valid for this <tt>TabularData</tt> instance.
     * @throws  NullPointerException
     * @throws  InvalidOpenTypeException
     */
private void checkKeyType(Object[] key) {
    if ((key == null) || (key.length == 0)) {
        throw new NullPointerException('Argument key cannot be null or empty.');
    }
    if (key.length != this.indexNamesArray.length) {
        throw new InvalidKeyException('Argument key's length=' + key.length + ' is different from the number of item values, which is ' + indexNamesArray.length + ', specified for the indexing rows in this TabularData instance.');
    }
    OpenType keyElementType;
    for (int i = 0; i < key.length; i++) {
        keyElementType = tabularType.getRowType().getType(this.indexNamesArray[i]);
        if ((key[i] != null) && (!keyElementType.isValue(key[i]))) {
            throw new InvalidKeyException('Argument element key[' + i + '] is not a value for the open type expected for ' + 'this element of the index, whose name is \'' + indexNamesArray[i] + '\' and whose open type is ' + keyElementType);
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.swing.Spring.checkArg(Object)

/**
     * If <code>s</code> is null, this throws an NullPointerException.
     */
private static void checkArg(Object s) {
    if (s == null) {
        throw new NullPointerException('Argument must not be null');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.openmbean.TabularDataSupport.checkValueType(CompositeData)

/**
     * Checks the specified value's type is valid for this <tt>TabularData</tt> instance 
     * (ie value is not null, and its composite type is equal to row type).
     * @throws  NullPointerException
     * @throws  InvalidOpenTypeException
     */
private void checkValueType(CompositeData value) {
    if (value == null) {
        throw new NullPointerException('Argument value cannot be null.');
    }
    if (!value.getCompositeType().equals(tabularType.getRowType())) {
        throw new InvalidOpenTypeException('Argument value's composite type [' + value.getCompositeType() + '] is not equal to ' + 'this TabularData instance's row type [' + tabularType.getRowType() + '].');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextSupport.add(Object)

/**
     * Adds/nests a child within this <tt>BeanContext</tt>.
     * Invoked as a side effect of java.beans.Beans.instantiate().
     * If the child object is not valid for adding then this method
     * throws an IllegalStateException.
     *
     * @param targetChild The child objects to nest 
     * within this <tt>BeanContext</tt>
     * @return true if the child was added successfully.
     * @see #validatePendingAdd
     */
public boolean add(Object targetChild) {
    if (targetChild == null) throw new IllegalArgumentException();
    if (children.containsKey(targetChild)) return false;
    synchronized (BeanContext.globalHierarchyLock) {
        if (children.containsKey(targetChild)) return false;
        if (!validatePendingAdd(targetChild)) {
            throw new IllegalStateException();
        }
        BeanContextChild cbcc = getChildBeanContextChild(targetChild);
        BeanContextChild bccp = null;
        synchronized (targetChild) {
            if (targetChild instanceof BeanContextProxy) {
                bccp = ((BeanContextProxy) targetChild).getBeanContextProxy();
                if (bccp == null) throw new NullPointerException('BeanContextPeer.getBeanContextProxy()');
            }
            BCSChild bcsc = createBCSChild(targetChild, bccp);
            BCSChild pbcsc = null;
            synchronized (children) {
                children.put(targetChild, bcsc);
                if (bccp != null) children.put(bccp, pbcsc = createBCSChild(bccp, targetChild));
            }
            if (cbcc != null) synchronized (cbcc) {
                try {
                    cbcc.setBeanContext(getBeanContextPeer());
                } catch (PropertyVetoException pve) {
                    synchronized (children) {
                        children.remove(targetChild);
                        if (bccp != null) children.remove(bccp);
                    }
                    throw new IllegalStateException();
                }
                cbcc.addPropertyChangeListener('beanContext', childPCL);
                cbcc.addVetoableChangeListener('beanContext', childVCL);
            }
            Visibility v = getChildVisibility(targetChild);
            if (v != null) {
                if (okToUseGui) v.okToUseGui(); else v.dontUseGui();
            }
            if (getChildSerializable(targetChild) != null) serializable++;
            childJustAddedHook(targetChild, bcsc);
            if (bccp != null) {
                v = getChildVisibility(bccp);
                if (v != null) {
                    if (okToUseGui) v.okToUseGui(); else v.dontUseGui();
                }
                if (getChildSerializable(bccp) != null) serializable++;
                childJustAddedHook(bccp, pbcsc);
            }
        }
        fireChildrenAdded(new BeanContextMembershipEvent(getBeanContextPeer(), bccp == null ? new Object[] { targetChild } : new Object[] { targetChild, bccp }));
    }
    return true;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.swing.plaf.metal.MetalLookAndFeel.setCurrentTheme(MetalTheme)

/**
     * Set the theme to be used by <code>MetalLookAndFeel</code>.
     * This may not be null.
     * After setting the theme, you need to re-install the
     * <code>MetalLookAndFeel</code>, as well as update the UI
     * of any previously created widgets. Otherwise the results are undefined.
     * These lines of code show you how to accomplish this:
     *   // turn off bold fonts
     *   MetalLookAndFeel.setCurrentTheme(theme);
     *   // re-install the Metal Look and Feel
     *   UIManager.setLookAndFeel(new MetalLookAndFeel());
     *   // only needed to update existing widgets
     *   SwingUtilities.updateComponentTreeUI(rootComponent);
     *
     * @param theme the theme to be used, non-null
     * @throws NullPointerException if given a null parameter
     * @see #getCurrentTheme
     */
public static void setCurrentTheme(MetalTheme theme) {
    if (theme == null) {
        throw new NullPointerException('Can't have null theme');
    }
    currentTheme = theme;
    cachedAppContext = AppContext.getAppContext();
    cachedAppContext.put('currentMetalTheme', theme);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Locale.setDefault(Locale)

/**
     * Sets the default locale for this instance of the Java Virtual Machine.
     * This does not affect the host locale.
     * If there is a security manager, its <code>checkPermission</code>
     * method is called with a <code>PropertyPermission('user.language', 'write')</code>
     * permission before the default locale is changed.
     * The Java Virtual Machine sets the default locale during startup
     * based on the host environment. It is used by many locale-sensitive
     * methods if no locale is explicitly specified.
     * Since changing the default locale may affect many different areas
     * of functionality, this method should only be used if the caller
     * is prepared to reinitialize locale-sensitive code running
     * within the same Java Virtual Machine, such as the user interface.
     * @throws SecurityException
     *        if a security manager exists and its
     *        <code>checkPermission</code> method doesn't allow the operation.
     * @throws NullPointerException if <code>newLocale</code> is null
     * @param newLocale the new default locale
     * @see SecurityManager#checkPermission
     * @see java.util.PropertyPermission
     */
public static synchronized void setDefault(Locale newLocale) {
    if (newLocale == null) throw new NullPointerException('Can't set default locale to NULL');
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) sm.checkPermission(new PropertyPermission('user.language', 'write'));
    defaultLocale = newLocale;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.datatype.Duration.addTo(Date)

/**
  * Adds this duration to a {@link Date} object.
  * 
  * 
  * The given date is first converted into
  * a {@link java.util.GregorianCalendar}, then the duration
  * is added exactly like the {@link #addTo(Calendar)} method.
  * 
  * 
  * The updated time instant is then converted back into a
  * {@link Date} object and used to update the given {@link Date} object.
  * 
  * 
  * This somewhat redundant computation is necessary to unambiguously
  * determine the duration of months and years.
  * 
  * @param date
  *      A date object whose value will be modified.
  * @throws NullPointerException
  *      if the date parameter is null.
  */
public void addTo(Date date) {
    if (date == null) {
        throw new NullPointerException('Cannot call ' + this.getClass().getName() + '#addTo(Date date) with date == null.');
    }
    Calendar cal = new GregorianCalendar();
    cal.setTime(date);
    this.addTo(cal);
    date.setTime(getCalendarTimeInMillis(cal));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.naming.ldap.LdapName.add(int, Rdn)

/**
     * Adds a single RDN at a specified position within this
     * LDAP name.
     * RDNs of this LDAP name at or after the index (if any) of the new
     * RDN are shifted up by one (away from index 0) to accommodate
     * the new RDN.
     * @param  comp The non-null RDN to add.
     * @param  posn The index at which to add the new RDN.
     *    Must be in the range [0,size()].
     * @return  The updated LdapName, not a new instance.
     *   Cannot be null.
     * @exception IndexOutOfBoundsException
     *   If posn is outside the specified range.
     */
public Name add(int posn, Rdn comp) {
    if (comp == null) {
        throw new NullPointerException('Cannot set comp to null');
    }
    rdns.add(posn, comp);
    unparsed = null;
    return this;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.datatype.XMLGregorianCalendar.equals(Object)

/**
     * Indicates whether parameter <code>obj</code> is 'equal to' this one.
     * @param obj to compare.
     * @return <code>true</code> when <code>obj</code> is an instance of <code>XMLGregorianCalendar</code>
     *   and  {@link #compare(XMLGregorianCalendar obj)} returns {@link DatatypeConstants#EQUAL}, otherwise <code>false</code>.
     * @throws NullPointerException If <code>obj</code> is <code>null</code>.
     */
public boolean equals(Object obj) {
    if (obj == null) {
        throw new NullPointerException('Cannot test null for equality with this XMLGregorianCalendar');
    }
    boolean result = false;
    if (obj instanceof XMLGregorianCalendar) {
        result = compare((XMLGregorianCalendar) obj) == DatatypeConstants.EQUAL;
    }
    return result;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.prefs.AbstractPreferences.addNodeChangeListener(NodeChangeListener)

public void addNodeChangeListener(NodeChangeListener ncl) {
    if (ncl == null) throw new NullPointerException('Change listener is null.');
    synchronized (lock) {
        if (removed) throw new IllegalStateException('Node has been removed.');
        if (nodeListeners == null) {
            nodeListeners = new NodeChangeListener[1];
            nodeListeners[0] = ncl;
        } else {
            NodeChangeListener[] old = nodeListeners;
            nodeListeners = new NodeChangeListener[old.length + 1];
            System.arraycopy(old, 0, nodeListeners, 0, old.length);
            nodeListeners[old.length] = ncl;
        }
    }
    startEventDispatchThreadIfNecessary();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.prefs.AbstractPreferences.addPreferenceChangeListener(PreferenceChangeListener)

public void addPreferenceChangeListener(PreferenceChangeListener pcl) {
    if (pcl == null) throw new NullPointerException('Change listener is null.');
    synchronized (lock) {
        if (removed) throw new IllegalStateException('Node has been removed.');
        PreferenceChangeListener[] old = prefListeners;
        prefListeners = new PreferenceChangeListener[old.length + 1];
        System.arraycopy(old, 0, prefListeners, 0, old.length);
        prefListeners[old.length] = pcl;
    }
    startEventDispatchThreadIfNecessary();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.Raster.createBandedRaster(DataBuffer, int, int, int, int, int, Point)

/**
     * Creates a Raster based on a BandedSampleModel with the
     * specified DataBuffer, width, height, scanline stride, bank
     * indices, and band offsets.  The number of bands is inferred
     * from bankIndices.length and bandOffsets.length, which must be
     * the same.  The upper left corner of the Raster is given by the
     * location argument.  If location is null, (0, 0) will be used.
     * @param dataBuffer the <code>DataBuffer</code> that contains the
     *        image data
     * @param w         the width in pixels of the image data
     * @param h         the height in pixels of the image data
     * @param scanlineStride the line stride of the image data
     * @param bankIndices the bank indices for each band
     * @param bandOffsets the offsets of all bands
     * @param location  the upper-left corner of the <code>Raster</code>
     * @return a WritableRaster object with the specified
     *         <code>DataBuffer</code>, width, height, scanline stride, 
     *         bank indices and band offsets.
     * @throws RasterFormatException if <code>w</code> or <code>h</code>
     *         is less than or equal to zero, or computing either
     *         <code>location.x + w</code> or
     *         <code>location.y + h</code> results in integer
     *         overflow
     * @throws IllegalArgumentException if <code>dataType</code> is not
     *         one of the supported data types, which are
     *         <code>DataBuffer.TYPE_BYTE</code>, 
     *         <code>DataBuffer.TYPE_USHORT</code> 
     *         or <code>DataBuffer.TYPE_INT</code>
     * @throws NullPointerException if <code>dataBuffer</code> is null
     */
public static WritableRaster createBandedRaster(DataBuffer dataBuffer, int w, int h, int scanlineStride, int bankIndices[], int bandOffsets[], Point location) {
    if (dataBuffer == null) {
        throw new NullPointerException('DataBuffer cannot be null');
    }
    if (location == null) {
        location = new Point(0, 0);
    }
    int dataType = dataBuffer.getDataType();
    int bands = bankIndices.length;
    if (bandOffsets.length != bands) {
        throw new IllegalArgumentException('bankIndices.length != bandOffsets.length');
    }
    BandedSampleModel bsm = new BandedSampleModel(dataType, w, h, scanlineStride, bankIndices, bandOffsets);
    switch(dataType) {
        case DataBuffer.TYPE_BYTE:
            return new ByteBandedRaster(bsm, dataBuffer, location);
        case DataBuffer.TYPE_USHORT:
            return new ShortBandedRaster(bsm, dataBuffer, location);
        case DataBuffer.TYPE_INT:
            return new SunWritableRaster(bsm, dataBuffer, location);
        default:
            throw new IllegalArgumentException('Unsupported data type ' + dataType);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.Raster.createInterleavedRaster(DataBuffer, int, int, int, int, int, Point)

/**
     * Creates a Raster based on a PixelInterleavedSampleModel with the
     * specified DataBuffer, width, height, scanline stride, pixel
     * stride, and band offsets.  The number of bands is inferred from
     * bandOffsets.length.  The upper left corner of the Raster
     * is given by the location argument.  If location is null, (0, 0)
     * will be used.
     *  Note that interleaved <code>DataBuffer.TYPE_INT</code>
     * Rasters are not supported.  To create a 1-band Raster of type
     * <code>DataBuffer.TYPE_INT</code>, use
     * Raster.createPackedRaster().
     * @param dataBuffer the <code>DataBuffer</code> that contains the
     *        image data
     * @param w         the width in pixels of the image data
     * @param h         the height in pixels of the image data
     * @param scanlineStride the line stride of the image data
     * @param pixelStride the pixel stride of the image data
     * @param bandOffsets the offsets of all bands
     * @param location  the upper-left corner of the <code>Raster</code>
     * @return a WritableRaster object with the specified
     *         <code>DataBuffer</code>, width, height, scanline stride, 
     *         pixel stride and band offsets.
     * @throws RasterFormatException if <code>w</code> or <code>h</code>
     *         is less than or equal to zero, or computing either
     *         <code>location.x + w</code> or
     *         <code>location.y + h</code> results in integer
     *         overflow
     * @throws IllegalArgumentException if <code>dataType</code> is not
     *         one of the supported data types, which are
     *         <code>DataBuffer.TYPE_BYTE</code>, 
     *         <code>DataBuffer.TYPE_USHORT</code>
     * @throws RasterFormatException if <code>dataBuffer</code> has more
     *         than one bank.
     * @throws NullPointerException if <code>dataBuffer</code> is null
     */
public static WritableRaster createInterleavedRaster(DataBuffer dataBuffer, int w, int h, int scanlineStride, int pixelStride, int bandOffsets[], Point location) {
    if (dataBuffer == null) {
        throw new NullPointerException('DataBuffer cannot be null');
    }
    if (location == null) {
        location = new Point(0, 0);
    }
    int dataType = dataBuffer.getDataType();
    PixelInterleavedSampleModel csm = new PixelInterleavedSampleModel(dataType, w, h, pixelStride, scanlineStride, bandOffsets);
    switch(dataType) {
        case DataBuffer.TYPE_BYTE:
            return new ByteInterleavedRaster(csm, dataBuffer, location);
        case DataBuffer.TYPE_USHORT:
            return new ShortInterleavedRaster(csm, dataBuffer, location);
        default:
            throw new IllegalArgumentException('Unsupported data type ' + dataType);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.Raster.createPackedRaster(DataBuffer, int, int, int, Point)

/**
     * Creates a Raster based on a MultiPixelPackedSampleModel with the
     * specified DataBuffer, width, height, and bits per pixel.  The upper
     * left corner of the Raster is given by the location argument.  If
     * location is null, (0, 0) will be used.
     * @param dataBuffer the <code>DataBuffer</code> that contains the
     *        image data
     * @param w         the width in pixels of the image data
     * @param h         the height in pixels of the image data
     * @param bitsPerPixel the number of bits for each pixel
     * @param location  the upper-left corner of the <code>Raster</code>
     * @return a WritableRaster object with the specified
     *         <code>DataBuffer</code>, width, height, and
     *         bits per pixel.
     * @throws RasterFormatException if <code>w</code> or <code>h</code>
     *         is less than or equal to zero, or computing either
     *         <code>location.x + w</code> or
     *         <code>location.y + h</code> results in integer
     *         overflow
     * @throws IllegalArgumentException if <code>dataType</code> is not
     *         one of the supported data types, which are
     *         <code>DataBuffer.TYPE_BYTE</code>, 
     *         <code>DataBuffer.TYPE_USHORT</code> 
     *         or <code>DataBuffer.TYPE_INT</code>
     * @throws RasterFormatException if <code>dataBuffer</code> has more
     *         than one bank.
     * @throws NullPointerException if <code>dataBuffer</code> is null
     */
public static WritableRaster createPackedRaster(DataBuffer dataBuffer, int w, int h, int bitsPerPixel, Point location) {
    if (dataBuffer == null) {
        throw new NullPointerException('DataBuffer cannot be null');
    }
    if (location == null) {
        location = new Point(0, 0);
    }
    int dataType = dataBuffer.getDataType();
    if (dataType != DataBuffer.TYPE_BYTE && dataType != DataBuffer.TYPE_USHORT && dataType != DataBuffer.TYPE_INT) {
        throw new IllegalArgumentException('Unsupported data type ' + dataType);
    }
    if (dataBuffer.getNumBanks() != 1) {
        throw new RasterFormatException('DataBuffer for packed Rasters' + ' must only have 1 bank.');
    }
    MultiPixelPackedSampleModel mppsm = new MultiPixelPackedSampleModel(dataType, w, h, bitsPerPixel);
    if (dataType == DataBuffer.TYPE_BYTE && (bitsPerPixel == 1 || bitsPerPixel == 2 || bitsPerPixel == 4)) {
        return new BytePackedRaster(mppsm, dataBuffer, location);
    } else {
        return new SunWritableRaster(mppsm, dataBuffer, location);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.Raster.createPackedRaster(DataBuffer, int, int, int, int, Point)

/**
     * Creates a Raster based on a SinglePixelPackedSampleModel with
     * the specified DataBuffer, width, height, scanline stride, and
     * band masks.  The number of bands is inferred from bandMasks.length.
     * The upper left corner of the Raster is given by
     * the location argument.  If location is null, (0, 0) will be used.
     * @param dataBuffer the <code>DataBuffer</code> that contains the
     *        image data
     * @param w         the width in pixels of the image data
     * @param h         the height in pixels of the image data
     * @param scanlineStride the line stride of the image data
     * @param bandMasks an array containing an entry for each band
     * @param location  the upper-left corner of the <code>Raster</code>
     * @return a WritableRaster object with the specified
     *         <code>DataBuffer</code>, width, height, scanline stride, 
     *         and band masks.
     * @throws RasterFormatException if <code>w</code> or <code>h</code>
     *         is less than or equal to zero, or computing either
     *         <code>location.x + w</code> or
     *         <code>location.y + h</code> results in integer
     *         overflow
     * @throws IllegalArgumentException if <code>dataType</code> is not
     *         one of the supported data types, which are
     *         <code>DataBuffer.TYPE_BYTE</code>, 
     *         <code>DataBuffer.TYPE_USHORT</code> 
     *         or <code>DataBuffer.TYPE_INT</code>
     * @throws RasterFormatException if <code>dataBuffer</code> has more
     *         than one bank.
     * @throws NullPointerException if <code>dataBuffer</code> is null
     */
public static WritableRaster createPackedRaster(DataBuffer dataBuffer, int w, int h, int scanlineStride, int bandMasks[], Point location) {
    if (dataBuffer == null) {
        throw new NullPointerException('DataBuffer cannot be null');
    }
    if (location == null) {
        location = new Point(0, 0);
    }
    int dataType = dataBuffer.getDataType();
    SinglePixelPackedSampleModel sppsm = new SinglePixelPackedSampleModel(dataType, w, h, scanlineStride, bandMasks);
    switch(dataType) {
        case DataBuffer.TYPE_BYTE:
            return new ByteInterleavedRaster(sppsm, dataBuffer, location);
        case DataBuffer.TYPE_USHORT:
            return new ShortInterleavedRaster(sppsm, dataBuffer, location);
        case DataBuffer.TYPE_INT:
            return new IntegerInterleavedRaster(sppsm, dataBuffer, location);
        default:
            throw new IllegalArgumentException('Unsupported data type ' + dataType);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.html.internal.dom.HTMLCollectionImpl.namedItem(String)

/**
     * Retrieves the named node from the collection. The name is matched case
     * sensitive against the <TT>id</TT> attribute of each element in the
     * collection, returning the first match. The tree is traversed in
     * depth-first order. This method might traverse the entire document tree.
     * @param name The name of the node to return
     * @return The specified node or null if no such node found
     */
public final Node namedItem(String name) {
    if (name == null) throw new NullPointerException('HTM013 Argument 'name' is null.');
    return namedItem(_topLevel, name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.org.apache.html.internal.dom.HTMLDOMImplementationImpl.createHTMLDocument(String)

/**
     * Create a new HTML document of the specified <TT>TITLE</TT> text.
     * @param title The document title text
     * @return New HTML document
     */
public final HTMLDocument createHTMLDocument(String title) throws DOMException {
    HTMLDocument doc;
    if (title == null) throw new NullPointerException('HTM014 Argument 'title' is null.');
    doc = new HTMLDocumentImpl();
    doc.setTitle(title);
    return doc;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.remote.JMXConnectorServer.connectionClosed(String, String, Object)

/**
     * Called by a subclass when a client connection is closed
     * normally.  Removes <code>connectionId</code> from the list returned
     * by {@link #getConnectionIds()}, then emits a {@link
     * JMXConnectionNotification} with type {@link
     * JMXConnectionNotification#CLOSED}.
     * @param connectionId the ID of the closed connection.
     * @param message the message for the emitted {@link
     * JMXConnectionNotification}.  Can be null.  See {@link
     * Notification#getMessage()}.
     * @param userData the <code>userData</code> for the emitted
     * {@link JMXConnectionNotification}.  Can be null.  See {@link
     * Notification#getUserData()}.
     * @exception NullPointerException if <code>connectionId</code>
     * is null.
     */
protected void connectionClosed(String connectionId, String message, Object userData) {
    if (connectionId == null) throw new NullPointerException('Illegal null argument');
    synchronized (connectionIds) {
        connectionIds.remove(connectionId);
    }
    sendNotification(JMXConnectionNotification.CLOSED, connectionId, message, userData);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.remote.JMXConnectorServer.connectionFailed(String, String, Object)

/**
     * Called by a subclass when a client connection fails.
     * Removes <code>connectionId</code> from the list returned by
     * {@link #getConnectionIds()}, then emits a {@link
     * JMXConnectionNotification} with type {@link
     * JMXConnectionNotification#FAILED}.
     * @param connectionId the ID of the failed connection.
     * @param message the message for the emitted {@link
     * JMXConnectionNotification}.  Can be null.  See {@link
     * Notification#getMessage()}.
     * @param userData the <code>userData</code> for the emitted
     * {@link JMXConnectionNotification}.  Can be null.  See {@link
     * Notification#getUserData()}.
     * @exception NullPointerException if <code>connectionId</code> is
     * null.
     */
protected void connectionFailed(String connectionId, String message, Object userData) {
    if (connectionId == null) throw new NullPointerException('Illegal null argument');
    synchronized (connectionIds) {
        connectionIds.remove(connectionId);
    }
    sendNotification(JMXConnectionNotification.FAILED, connectionId, message, userData);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.remote.JMXConnectorServer.connectionOpened(String, String, Object)

/**
     * Called by a subclass when a new client connection is opened.
     * Adds <code>connectionId</code> to the list returned by {@link
     * #getConnectionIds()}, then emits a {@link
     * JMXConnectionNotification} with type {@link
     * JMXConnectionNotification#OPENED}.
     * @param connectionId the ID of the new connection.  This must be
     * different from the ID of any connection previously opened by
     * this connector server.
     * @param message the message for the emitted {@link
     * JMXConnectionNotification}.  Can be null.  See {@link
     * Notification#getMessage()}.
     * @param userData the <code>userData</code> for the emitted
     * {@link JMXConnectionNotification}.  Can be null.  See {@link
     * Notification#getUserData()}.
     * @exception NullPointerException if <code>connectionId</code> is
     * null.
     */
protected void connectionOpened(String connectionId, String message, Object userData) {
    if (connectionId == null) throw new NullPointerException('Illegal null argument');
    synchronized (connectionIds) {
        connectionIds.add(connectionId);
    }
    sendNotification(JMXConnectionNotification.OPENED, connectionId, message, userData);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.swing.plaf.metal.MetalToolBarUI.register(JComponent)

/**
     * Registers the specified component.
     */
static synchronized void register(JComponent c) {
    if (c == null) {
        throw new NullPointerException('JComponent must be non-null');
    }
    components.add(new WeakReference(c));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.MBeanServerPermission.parseMask(String)

private static int parseMask(String name) {
    if (name == null) {
        throw new NullPointerException('MBeanServerPermission: ' + 'target name can't be null');
    }
    name = name.trim();
    if (name.equals('*')) return ALL_MASK;
    if (name.indexOf(',') < 0) return impliedMask(1 << nameIndex(name.trim()));
    int mask = 0;
    StringTokenizer tok = new StringTokenizer(name, ',');
    while (tok.hasMoreTokens()) {
        String action = tok.nextToken();
        int i = nameIndex(action.trim());
        mask |= (1 << i);
    }
    return impliedMask(mask);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.swing.plaf.metal.MetalMenuBarUI.createUI(JComponent)

/**
     * Creates the <code>ComponentUI</code> implementation for the passed
     * in component.
     * @param x JComponent to create the ComponentUI implementation for
     * @return ComponentUI implementation for <code>x</code>
     * @throws NullPointerException if <code>x</code> is null
     */
public static ComponentUI createUI(JComponent x) {
    if (x == null) {
        throw new NullPointerException('Must pass in a non-null component');
    }
    return new MetalMenuBarUI();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.swing.plaf.metal.MetalComboBoxUI.paintCurrentValue(Graphics, Rectangle, boolean)

/**
     * If necessary paints the currently selected item.
     * @param g Graphics to paint to
     * @param bounds Region to paint current value to
     * @param hasFocus whether or not the JComboBox has focus
     * @throws NullPointerException if any of the arguments are null.
     * @since 1.5
     */
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) {
    if (MetalLookAndFeel.usingOcean()) {
        bounds.x += 2;
        bounds.y += 2;
        bounds.width -= 3;
        bounds.height -= 4;
        super.paintCurrentValue(g, bounds, hasFocus);
    } else if (g == null || bounds == null) {
        throw new NullPointerException('Must supply a non-null Graphics and Rectangle');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.swing.plaf.metal.MetalComboBoxUI.paintCurrentValueBackground(Graphics, Rectangle, boolean)

/**
     * If necessary paints the background of the currently selected item.
     * @param g Graphics to paint to
     * @param bounds Region to paint background to
     * @param hasFocus whether or not the JComboBox has focus
     * @throws NullPointerException if any of the arguments are null.
     * @since 1.5
     */
public void paintCurrentValueBackground(Graphics g, Rectangle bounds, boolean hasFocus) {
    if (MetalLookAndFeel.usingOcean()) {
        g.setColor(MetalLookAndFeel.getControlDarkShadow());
        g.drawRect(bounds.x, bounds.y, bounds.width, bounds.height - 1);
        g.setColor(MetalLookAndFeel.getControlShadow());
        g.drawRect(bounds.x + 1, bounds.y + 1, bounds.width - 2, bounds.height - 3);
    } else if (g == null || bounds == null) {
        throw new NullPointerException('Must supply a non-null Graphics and Rectangle');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

org.xml.sax.helpers.XMLFilterImpl.setupParse()

/**
     * Set up before a parse.
     * Before every parse, check whether the parent is
     * non-null, and re-register the filter for all of the 
     * events.
     */
private void setupParse() {
    if (parent == null) {
        throw new NullPointerException('No parent for filter');
    }
    parent.setEntityResolver(this);
    parent.setDTDHandler(this);
    parent.setContentHandler(this);
    parent.setErrorHandler(this);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

org.xml.sax.helpers.ParserFactory.makeParser()

/**
     * Create a new SAX parser using the `org.xml.sax.parser' system property.
     * The named class must exist and must implement the
     * {@link org.xml.sax.Parser Parser} interface.
     * @exception java.lang.NullPointerException There is no value
     *            for the `org.xml.sax.parser' system property.
     * @exception java.lang.ClassNotFoundException The SAX parser
     *            class was not found (check your CLASSPATH).
     * @exception IllegalAccessException The SAX parser class was
     *            found, but you do not have permission to load
     *            it.
     * @exception InstantiationException The SAX parser class was
     *            found but could not be instantiated.
     * @exception java.lang.ClassCastException The SAX parser class
     *            was found and instantiated, but does not implement
     *            org.xml.sax.Parser.
     * @see #makeParser(java.lang.String)
     * @see org.xml.sax.Parser
     */
public static Parser makeParser() throws ClassNotFoundException, IllegalAccessException, InstantiationException, NullPointerException, ClassCastException {
    String className = System.getProperty('org.xml.sax.parser');
    if (className == null) {
        throw new NullPointerException('No value for sax.parser property');
    } else {
        return makeParser(className);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.remote.JMXConnectorServer.preRegister(MBeanServer, ObjectName)

/**
     * Called by an MBean server when this connector server is
     * registered in that MBean server.  This connector server becomes
     * attached to the MBean server and its {@link #getMBeanServer()}
     * method will return <code>mbs</code>.
     * If this connector server is already attached to an MBean
     * server, this method has no effect.  The MBean server it is
     * attached to is not necessarily the one it is being registered
     * in.
     * @param mbs the MBean server in which this connection server is
     * being registered.
     * @param name The object name of the MBean.
     * @return The name under which the MBean is to be registered.
     * @exception NullPointerException if <code>mbs</code> or
     * <code>name</code> is null.
     */
public synchronized ObjectName preRegister(MBeanServer mbs, ObjectName name) {
    if (mbs == null || name == null) throw new NullPointerException('Null MBeanServer or ObjectName');
    if (mbeanServer == null) {
        mbeanServer = mbs;
        myName = name;
    }
    return name;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.swing.tree.TreePath.pathByAddingChild(Object)

/**
     * Returns a new path containing all the elements of this object
     * plus <code>child</code>. <code>child</code> will be the last element
     * of the newly created TreePath.
     * This will throw a NullPointerException
     * if child is null.
     */
public TreePath pathByAddingChild(Object child) {
    if (child == null) throw new NullPointerException('Null child not allowed');
    return new TreePath(this, child);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.remote.rmi.RMIServerImpl.clientClosed(RMIConnection)

/**
     * Method called when a client connection created by {@link
     * #makeClient makeClient} is closed.  A subclass that defines
     * <code>makeClient</code> must arrange for this method to be
     * called when the resultant object's {@link RMIConnection#close()
     * close} method is called.  This enables it to be removed from
     * the <code>RMIServerImpl</code>'s list of connections.  It is
     * not an error for <code>client</code> not to be in that
     * list.
     * After removing <code>client</code> from the list of
     * connections, this method calls {@link #closeClient
     * closeClient(client)}.
     * @param client the client connection that has been closed.
     * @exception IOException if {@link #closeClient} throws this
     * exception.
     * @exception NullPointerException if <code>client</code> is null.
     */
protected void clientClosed(RMIConnection client) throws IOException {
    final boolean debug = logger.debugOn();
    if (debug) logger.trace('clientClosed', 'client=' + client);
    if (client == null) throw new NullPointerException('Null client');
    synchronized (clientList) {
        dropDeadReferences();
        for (Iterator it = clientList.iterator(); it.hasNext(); ) {
            WeakReference wr = (WeakReference) it.next();
            if (wr.get() == client) {
                it.remove();
                break;
            }
        }
    }
    if (debug) logger.trace('clientClosed', 'closing client.');
    closeClient(client);
    if (debug) logger.trace('clientClosed', 'sending notif');
    connServer.connectionClosed(client.getConnectionId(), 'Client connection closed', null);
    if (debug) logger.trace('clientClosed', 'done');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.remote.rmi.RMIIIOPServerImpl.makeClient(String, Subject)

/**
     * Creates a new client connection as an RMI object exported
     * through IIOP.
     * @param connectionId the ID of the new connection.  Every
     * connection opened by this connector server will have a
     * different ID.  The behavior is unspecified if this parameter is
     * null.
     * @param subject the authenticated subject.  Can be null.
     * @return the newly-created <code>RMIConnection</code>.
     * @exception IOException if the new client object cannot be
     * created or exported.
     */
protected RMIConnection makeClient(String connectionId, Subject subject) throws IOException {
    if (connectionId == null) throw new NullPointerException('Null connectionId');
    RMIConnection client = new RMIConnectionImpl(this, connectionId, getDefaultClassLoader(), subject, env);
    PortableRemoteObject.exportObject(client);
    return client;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.remote.rmi.RMIJRMPServerImpl.makeClient(String, Subject)

/**
     * Creates a new client connection as an RMI object exported
     * through JRMP. The port and socket factories for the new
     * {@link RMIConnection} object are the ones supplied
     * to the <code>RMIJRMPServerImpl</code> constructor.
     * @param connectionId the ID of the new connection. Every
     * connection opened by this connector server will have a
     * different id.  The behavior is unspecified if this parameter is
     * null.
     * @param subject the authenticated subject.  Can be null.
     * @return the newly-created <code>RMIConnection</code>.
     * @exception IOException if the new {@link RMIConnection}
     * object cannot be created or exported.
     */
protected RMIConnection makeClient(String connectionId, Subject subject) throws IOException {
    if (connectionId == null) throw new NullPointerException('Null connectionId');
    RMIConnection client = new RMIConnectionImpl(this, connectionId, getDefaultClassLoader(), subject, env);
    export(client);
    return client;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.prefs.AbstractPreferences.get(String, String)

/**
     * Implements the <tt>get</tt> method as per the specification in
     * {@link Preferences#get(String,String)}.
     * This implementation first checks to see if <tt>key</tt> is
     * <tt>null</tt> throwing a <tt>NullPointerException</tt> if this is
     * the case.  Then it obtains this preference node's lock,
     * checks that the node has not been removed, invokes {@link
     * #getSpi(String)}, and returns the result, unless the <tt>getSpi</tt>
     * invocation returns <tt>null</tt> or throws an exception, in which case
     * this invocation returns <tt>def</tt>.
     * @param key key whose associated value is to be returned.
     * @param def the value to be returned in the event that this
     *        preference node has no value associated with <tt>key</tt>.
     * @return the value associated with <tt>key</tt>, or <tt>def</tt>
     *         if no value is associated with <tt>key</tt>.
     * @throws IllegalStateException if this node (or an ancestor) has been
     *         removed with the {@link #removeNode()} method.
     * @throws NullPointerException if key is <tt>null</tt>.  (A 
     *         <tt>null</tt> default <i>is</i> permitted.)
     */
public String get(String key, String def) {
    if (key == null) throw new NullPointerException('Null key');
    synchronized (lock) {
        if (removed) throw new IllegalStateException('Node has been removed.');
        String result = null;
        try {
            result = getSpi(key);
        } catch (Exception e) {
        }
        return (result == null ? def : result);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ColorModel.getComponentSize(int)

/**
     * Returns the number of bits for the specified color/alpha component.
     * Color components are indexed in the order specified by the 
     * <code>ColorSpace</code>.  Typically, this order reflects the name
     * of the color space type. For example, for TYPE_RGB, index 0
     * corresponds to red, index 1 to green, and index 2
     * to blue.  If this <code>ColorModel</code> supports alpha, the alpha
     * component corresponds to the index following the last color
     * component.
     * @param componentIdx the index of the color/alpha component
     * @return the number of bits for the color/alpha component at the
     *  specified index.
     * @throws ArrayIndexOutOfBoundsException if <code>componentIdx</code> 
     *         is greater than the number of components or
     *         less than zero
     * @throws NullPointerException if the number of bits array is 
     *         <code>null</code>
     */
public int getComponentSize(int componentIdx) {
    if (nBits == null) {
        throw new NullPointerException('Number of bits array is null.');
    }
    return nBits[componentIdx];
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

org.xml.sax.helpers.ParserAdapter.setup(Parser)

/**
     * Internal setup method.
     * @param parser The embedded parser.
     * @exception java.lang.NullPointerException If the parser parameter
     *            is null.
     */
private void setup(Parser parser) {
    if (parser == null) {
        throw new NullPointerException('Parser argument must not be null');
    }
    this.parser = parser;
    atts = new AttributesImpl();
    nsSupport = new NamespaceSupport();
    attAdapter = new AttributeListAdapter();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.Raster.createCompatibleWritableRaster(Rectangle)

/**
     * Create a compatible WritableRaster with location (minX, minY)
     * and size (width, height) specified by rect, a
     * new SampleModel, and a new initialized DataBuffer.
     * @param rect a <code>Rectangle</code> that specifies the size and
     *        location of the <code>WritableRaster</code>
     * @return a compatible <code>WritableRaster</code> with the specified 
     *         size and location and a new sample model and data buffer.
     * @throws RasterFormatException if <code>rect</code> has width
     *         or height less than or equal to zero, or computing either
     *         <code>rect.x + rect.width</code> or
     *         <code>rect.y + rect.height</code> results in integer
     *         overflow
     * @throws NullPointerException if <code>rect<code> is null
     */
public WritableRaster createCompatibleWritableRaster(Rectangle rect) {
    if (rect == null) {
        throw new NullPointerException('Rect cannot be null');
    }
    return createCompatibleWritableRaster(rect.x, rect.y, rect.width, rect.height);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.Raster.createRaster(SampleModel, DataBuffer, Point)

/**
     *  Creates a Raster with the specified SampleModel and DataBuffer.
     *  The upper left corner of the Raster is given by the location argument.
     *  If location is null, (0, 0) will be used.
     *  @param sm the specified <code>SampleModel</code>
     *  @param db the specified <code>DataBuffer</code>
     *  @param location the upper-left corner of the <code>Raster</code>
     *  @return a <code>Raster</code> with the specified 
     *          <code>SampleModel</code>, <code>DataBuffer</code>, and
     *          location.
     * @throws RasterFormatException if computing either
     *         <code>location.x + sm.getWidth()</code> or
     *         <code>location.y + sm.getHeight()</code> results in integer
     *         overflow
     * @throws RasterFormatException if <code>dataBuffer</code> has more
     *         than one bank and the <code>sampleModel</code> is
     *         PixelInterleavedSampleModel, SinglePixelPackedSampleModel,
     *         or MultiPixelPackedSampleModel.
     *  @throws NullPointerException if either SampleModel or DataBuffer is 
     *          null
     */
public static Raster createRaster(SampleModel sm, DataBuffer db, Point location) {
    if ((sm == null) || (db == null)) {
        throw new NullPointerException('SampleModel and DataBuffer cannot be null');
    }
    if (location == null) {
        location = new Point(0, 0);
    }
    int dataType = sm.getDataType();
    if (sm instanceof PixelInterleavedSampleModel) {
        switch(dataType) {
            case DataBuffer.TYPE_BYTE:
                return new ByteInterleavedRaster(sm, db, location);
            case DataBuffer.TYPE_USHORT:
                return new ShortInterleavedRaster(sm, db, location);
        }
    } else if (sm instanceof SinglePixelPackedSampleModel) {
        switch(dataType) {
            case DataBuffer.TYPE_BYTE:
                return new ByteInterleavedRaster(sm, db, location);
            case DataBuffer.TYPE_USHORT:
                return new ShortInterleavedRaster(sm, db, location);
            case DataBuffer.TYPE_INT:
                return new IntegerInterleavedRaster(sm, db, location);
        }
    } else if (sm instanceof MultiPixelPackedSampleModel && dataType == DataBuffer.TYPE_BYTE && sm.getSampleSize(0) < 8) {
        return new BytePackedRaster(sm, db, location);
    }
    return new Raster(sm, db, location);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.Raster.createWritableRaster(SampleModel, DataBuffer, Point)

/**
     *  Creates a WritableRaster with the specified SampleModel and DataBuffer.
     *  The upper left corner of the Raster is given by the location argument.
     *  If location is null, (0, 0) will be used.
     *  @param sm the specified <code>SampleModel</code>
     *  @param db the specified <code>DataBuffer</code>
     *  @param location the upper-left corner of the 
     *         <code>WritableRaster</code>
     *  @return a <code>WritableRaster</code> with the specified 
     *          <code>SampleModel</code>, <code>DataBuffer</code>, and
     *          location.
     * @throws RasterFormatException if computing either
     *         <code>location.x + sm.getWidth()</code> or
     *         <code>location.y + sm.getHeight()</code> results in integer
     *         overflow
     * @throws RasterFormatException if <code>dataBuffer</code> has more
     *         than one bank and the <code>sampleModel</code> is
     *         PixelInterleavedSampleModel, SinglePixelPackedSampleModel,
     *         or MultiPixelPackedSampleModel.
     * @throws NullPointerException if either SampleModel or DataBuffer is null
     */
public static WritableRaster createWritableRaster(SampleModel sm, DataBuffer db, Point location) {
    if ((sm == null) || (db == null)) {
        throw new NullPointerException('SampleModel and DataBuffer cannot be null');
    }
    if (location == null) {
        location = new Point(0, 0);
    }
    int dataType = sm.getDataType();
    if (sm instanceof PixelInterleavedSampleModel) {
        switch(dataType) {
            case DataBuffer.TYPE_BYTE:
                return new ByteInterleavedRaster(sm, db, location);
            case DataBuffer.TYPE_USHORT:
                return new ShortInterleavedRaster(sm, db, location);
        }
    } else if (sm instanceof SinglePixelPackedSampleModel) {
        switch(dataType) {
            case DataBuffer.TYPE_BYTE:
                return new ByteInterleavedRaster(sm, db, location);
            case DataBuffer.TYPE_USHORT:
                return new ShortInterleavedRaster(sm, db, location);
            case DataBuffer.TYPE_INT:
                return new IntegerInterleavedRaster(sm, db, location);
        }
    } else if (sm instanceof MultiPixelPackedSampleModel && dataType == DataBuffer.TYPE_BYTE && sm.getSampleSize(0) < 8) {
        return new BytePackedRaster(sm, db, location);
    }
    return new SunWritableRaster(sm, db, location);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

org.xml.sax.helpers.XMLReaderAdapter.setup(XMLReader)

/**
     * Internal setup.
     * @param xmlReader The embedded XMLReader.
     */
private void setup(XMLReader xmlReader) {
    if (xmlReader == null) {
        throw new NullPointerException('XMLReader must not be null');
    }
    this.xmlReader = xmlReader;
    qAtts = new AttributesAdapter();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.xpath.XPathFactory.newInstance(String)

/**
    * Get a new <code>XPathFactory</code> instance using the specified object model.
    * To find a <code>XPathFactory</code> object,
    * this method looks the following places in the following order where 'the class loader' refers to the context class loader:
    * <ol>
    *   <li>
    *     If the system property {@link #DEFAULT_PROPERTY_NAME} + ':uri' is present,
    *     where uri is the parameter to this method, then its value is read as a class name.
    *     The method will try to create a new instance of this class by using the class loader,
    *     and returns it if it is successfully created.
    *   </li>
    *   <li>
    *     ${java.home}/lib/jaxp.properties is read and the value associated with the key being the system property above is looked for.
    *     If present, the value is processed just like above.
    *   </li>
    *   <li>
    *     The class loader is asked for service provider provider-configuration files matching <code>javax.xml.xpath.XPathFactory</code>
    *     in the resource directory META-INF/services.
    *     See the JAR File Specification for file format and parsing rules.
    *     Each potential service provider is required to implement the method:
    *       {@link #isObjectModelSupported(String objectModel)}
    *     The first service provider found in class loader order that supports the specified object model is returned.
    *   </li>
    *   <li>
    *     Platform default <code>XPathFactory</code> is located in a platform specific way.
    *     There must be a platform default XPathFactory for the W3C DOM, i.e. {@link #DEFAULT_OBJECT_MODEL_URI}.
    *   </li>
    * </ol>
    * If everything fails, an <code>XPathFactoryConfigurationException</code> will be thrown.
    * Tip for Trouble-shooting:
    * See {@link java.util.Properties#load(java.io.InputStream)} for exactly how a property file is parsed.
    * In particular, colons ':' need to be escaped in a property file, so make sure the URIs are properly escaped in it.
    * For example:
    *   http\://java.sun.com/jaxp/xpath/dom=org.acme.DomXPathFactory
    * 
    * @param uri Identifies the underlying object model.
    *   The specification only defines the URI {@link #DEFAULT_OBJECT_MODEL_URI},
    *   <code>http://java.sun.com/jaxp/xpath/dom</code> for the W3C DOM,
    *   the org.w3c.dom package, and implementations are free to introduce other URIs for other object models.
    * @return Instance of an <code>XPathFactory</code>.
    * @throws XPathFactoryConfigurationException If the specified object model is unavailable.
    * @throws NullPointerException If <code>uri</code> is <code>null</code>. 
  * @throws IllegalArgumentException If <code>uri.length() == 0</code>.
    */
public static final XPathFactory newInstance(final String uri) throws XPathFactoryConfigurationException {
    if (uri == null) {
        throw new NullPointerException('XPathFactory#newInstance(String uri) cannot be called with uri == null');
    }
    if (uri.length() == 0) {
        throw new IllegalArgumentException('XPathFactory#newInstance(String uri) cannot be called with uri == \'\'');
    }
    ClassLoader classLoader = ss.getContextClassLoader();
    if (classLoader == null) {
        classLoader = XPathFactory.class.getClassLoader();
    }
    XPathFactory xpathFactory = new XPathFactoryFinder(classLoader).newFactory(uri);
    if (xpathFactory == null) {
        throw new XPathFactoryConfigurationException('No XPathFctory implementation found for the object model: ' + uri);
    }
    return xpathFactory;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.net.SocketPermission.getMask(String)

/**
     * Convert an action string to an integer actions mask. 
     * @param action the action string
     * @return the action mask
     */
private static int getMask(String action) {
    if (action == null) {
        throw new NullPointerException('action can't be null');
    }
    if (action.equals('')) {
        throw new IllegalArgumentException('action can't be empty');
    }
    int mask = NONE;
    if (action == SecurityConstants.SOCKET_RESOLVE_ACTION) {
        return RESOLVE;
    } else if (action == SecurityConstants.SOCKET_CONNECT_ACTION) {
        return CONNECT;
    } else if (action == SecurityConstants.SOCKET_LISTEN_ACTION) {
        return LISTEN;
    } else if (action == SecurityConstants.SOCKET_ACCEPT_ACTION) {
        return ACCEPT;
    } else if (action == SecurityConstants.SOCKET_CONNECT_ACCEPT_ACTION) {
        return CONNECT | ACCEPT;
    }
    char[] a = action.toCharArray();
    int i = a.length - 1;
    if (i < 0) return mask;
    while (i != -1) {
        char c;
        while ((i != -1) && ((c = a[i]) == ' ' || c == '\r' || c == '\n' || c == '\f' || c == '\t')) i--;
        int matchlen;
        if (i >= 6 && (a[i - 6] == 'c' || a[i - 6] == 'C') && (a[i - 5] == 'o' || a[i - 5] == 'O') && (a[i - 4] == 'n' || a[i - 4] == 'N') && (a[i - 3] == 'n' || a[i - 3] == 'N') && (a[i - 2] == 'e' || a[i - 2] == 'E') && (a[i - 1] == 'c' || a[i - 1] == 'C') && (a[i] == 't' || a[i] == 'T')) {
            matchlen = 7;
            mask |= CONNECT;
        } else if (i >= 6 && (a[i - 6] == 'r' || a[i - 6] == 'R') && (a[i - 5] == 'e' || a[i - 5] == 'E') && (a[i - 4] == 's' || a[i - 4] == 'S') && (a[i - 3] == 'o' || a[i - 3] == 'O') && (a[i - 2] == 'l' || a[i - 2] == 'L') && (a[i - 1] == 'v' || a[i - 1] == 'V') && (a[i] == 'e' || a[i] == 'E')) {
            matchlen = 7;
            mask |= RESOLVE;
        } else if (i >= 5 && (a[i - 5] == 'l' || a[i - 5] == 'L') && (a[i - 4] == 'i' || a[i - 4] == 'I') && (a[i - 3] == 's' || a[i - 3] == 'S') && (a[i - 2] == 't' || a[i - 2] == 'T') && (a[i - 1] == 'e' || a[i - 1] == 'E') && (a[i] == 'n' || a[i] == 'N')) {
            matchlen = 6;
            mask |= LISTEN;
        } else if (i >= 5 && (a[i - 5] == 'a' || a[i - 5] == 'A') && (a[i - 4] == 'c' || a[i - 4] == 'C') && (a[i - 3] == 'c' || a[i - 3] == 'C') && (a[i - 2] == 'e' || a[i - 2] == 'E') && (a[i - 1] == 'p' || a[i - 1] == 'P') && (a[i] == 't' || a[i] == 'T')) {
            matchlen = 6;
            mask |= ACCEPT;
        } else {
            throw new IllegalArgumentException('invalid permission: ' + action);
        }
        boolean seencomma = false;
        while (i >= matchlen && !seencomma) {
            switch(a[i - matchlen]) {
                case ',':
                    seencomma = true;
                case ' ':
                case '\r':
                case '\n':
                case '\f':
                case '\t':
                    break;
                default:
                    throw new IllegalArgumentException('invalid permission: ' + action);
            }
            i--;
        }
        i -= matchlen;
    }
    return mask;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.security.auth.kerberos.ServicePermission.getMask(String)

/**
     * Convert an action string to an integer actions mask. 
     * @param action the action string
     * @return the action mask
     */
private static int getMask(String action) {
    if (action == null) {
        throw new NullPointerException('action can't be null');
    }
    if (action.equals('')) {
        throw new IllegalArgumentException('action can't be empty');
    }
    int mask = NONE;
    if (action == null) {
        return mask;
    }
    char[] a = action.toCharArray();
    int i = a.length - 1;
    if (i < 0) return mask;
    while (i != -1) {
        char c;
        while ((i != -1) && ((c = a[i]) == ' ' || c == '\r' || c == '\n' || c == '\f' || c == '\t')) i--;
        int matchlen;
        if (i >= 7 && (a[i - 7] == 'i' || a[i - 7] == 'I') && (a[i - 6] == 'n' || a[i - 6] == 'N') && (a[i - 5] == 'i' || a[i - 5] == 'I') && (a[i - 4] == 't' || a[i - 4] == 'T') && (a[i - 3] == 'i' || a[i - 3] == 'I') && (a[i - 2] == 'a' || a[i - 2] == 'A') && (a[i - 1] == 't' || a[i - 1] == 'T') && (a[i] == 'e' || a[i] == 'E')) {
            matchlen = 8;
            mask |= INITIATE;
        } else if (i >= 5 && (a[i - 5] == 'a' || a[i - 5] == 'A') && (a[i - 4] == 'c' || a[i - 4] == 'C') && (a[i - 3] == 'c' || a[i - 3] == 'C') && (a[i - 2] == 'e' || a[i - 2] == 'E') && (a[i - 1] == 'p' || a[i - 1] == 'P') && (a[i] == 't' || a[i] == 'T')) {
            matchlen = 6;
            mask |= ACCEPT;
        } else {
            throw new IllegalArgumentException('invalid permission: ' + action);
        }
        boolean seencomma = false;
        while (i >= matchlen && !seencomma) {
            switch(a[i - matchlen]) {
                case ',':
                    seencomma = true;
                case ' ':
                case '\r':
                case '\n':
                case '\f':
                case '\t':
                    break;
                default:
                    throw new IllegalArgumentException('invalid permission: ' + action);
            }
            i--;
        }
        i -= matchlen;
    }
    return mask;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.print.PrinterJob.pageDialog(PrintRequestAttributeSet)

/**
     * A convenience method which displays a cross-platform page setup dialog.
     * The choices available will reflect the print service currently
     * set on this PrinterJob.
     * The attributes parameter on input will reflect the client's
     * required initial selections in the user dialog. Attributes which are
     * not specified display using the default for the service. On return it
     * will reflect the user's choices. Selections may be updated by
     * the implementation to be consistent with the supported values
     * for the currently selected print service.
     * The return value will be a PageFormat equivalent to the
     * selections in the PrintRequestAttributeSet.
     * If the user cancels the dialog, the attributes will not reflect
     * any changes made by the user, and the return value will be null.
     * @param attributes on input is application supplied attributes,
     * on output the contents are updated to reflect user choices.
     * This parameter may not be null.
     * @return a page format if the user does not cancel the dialog;
     * <code>null</code> otherwise.
     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
     * returns true.
     * @exception NullPointerException if <code>attributes</code> parameter
     * is null.
     * @see java.awt.GraphicsEnvironment#isHeadless
     * @since     1.4
     */
public PageFormat pageDialog(PrintRequestAttributeSet attributes) throws HeadlessException {
    if (attributes == null) {
        throw new NullPointerException('attributes');
    }
    return pageDialog(defaultPage());
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.print.PrinterJob.printDialog(PrintRequestAttributeSet)

/**
     * A convenience method which displays a cross-platform print dialog
     * for all services which are capable of printing 2D graphics using the
     * <code>Pageable</code> interface. The selected printer when the
     * dialog is initially displayed will reflect the print service currently
     * attached to this print job.
     * If the user changes the print service, the PrinterJob will be
     * updated to reflect this, unless the user cancels the dialog.
     * As well as allowing the user to select the destination printer,
     * the user can also select values of various print request attributes.
     * The attributes parameter on input will reflect the applications
     * required initial selections in the user dialog. Attributes not
     * specified display using the default for the service. On return it
     * will reflect the user's choices. Selections may be updated by
     * the implementation to be consistent with the supported values
     * for the currently selected print service.
     * As the user scrolls to a new print service selection, the values
     * copied are based on the settings for the previous service, together
     * with any user changes. The values are not based on the original
     * settings supplied by the client.
     * With the exception of selected printer, the PrinterJob state is
     * not updated to reflect the user's changes.
     * For the selections to affect a printer job, the attributes must
     * be specified in the call to the
     * <code>print(PrintRequestAttributeSet)</code> method. If using
     * the Pageable interface, clients which intend to use media selected
     * by the user must create a PageFormat derived from the user's
     * selections.
     * If the user cancels the dialog, the attributes will not reflect
     * any changes made by the user.
     * @param attributes on input is application supplied attributes,
     * on output the contents are updated to reflect user choices.
     * This parameter may not be null.
     * @return <code>true</code> if the user does not cancel the dialog;
     * <code>false</code> otherwise.
     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
     * returns true.
     * @exception NullPointerException if <code>attributes</code> parameter
     * is null.
     * @see java.awt.GraphicsEnvironment#isHeadless
     * @since     1.4
     */
public boolean printDialog(PrintRequestAttributeSet attributes) throws HeadlessException {
    if (attributes == null) {
        throw new NullPointerException('attributes');
    }
    return printDialog();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.stream.MemoryCache.read(byte[], int, int, long)

/**
     * Copy <code>len</code> bytes from the cache, starting
     * at cache position <code>pos</code>, into the array 
     * <code>b</code> at offset <code>off</code>.
     * @exception NullPointerException if b is <code>null</code>
     * @exception IndexOutOfBoundsException if <code>off</code>,
     * <code>len</code> or <code>pos</code> are negative or if
     * <code>off + len > b.length</code> or if any portion of the
     * requested data is not in the cache (including if
     * <code>pos</code> is in a block that has already been disposed).
     */
public void read(byte[] b, int off, int len, long pos) throws IOException {
    if (b == null) {
        throw new NullPointerException('b == null!');
    }
    if ((off < 0) || (len < 0) || (pos < 0) || (off + len > b.length) || (off + len < 0)) {
        throw new IndexOutOfBoundsException();
    }
    if (pos + len > length) {
        throw new IndexOutOfBoundsException();
    }
    long index = pos / BUFFER_LENGTH;
    int offset = (int) pos % BUFFER_LENGTH;
    while (len > 0) {
        int nbytes = Math.min(len, BUFFER_LENGTH - offset);
        byte[] buf = getCacheBlock(index++);
        System.arraycopy(buf, offset, b, off, nbytes);
        len -= nbytes;
        off += nbytes;
        offset = 0;
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.stream.MemoryCache.write(byte[], int, int, long)

/**
     * Overwrites and/or appends the cache from a byte array.
     * The length of the cache will be extended as needed to hold
     * the incoming data.
     * @param b an array of bytes containing data to be written.
     * @param off the starting offset withing the data array.
     * @param len the number of bytes to be written.
     * @param pos the cache position at which to begin writing.
     * @exception NullPointerException if <code>b</code> is <code>null</code>.
     * @exception IndexOutOfBoundsException if <code>off</code>,
     * <code>len</code>, or <code>pos</code> are negative,
     * or if <code>off+len > b.length</code>.
     */
public void write(byte[] b, int off, int len, long pos) throws IOException {
    if (b == null) {
        throw new NullPointerException('b == null!');
    }
    if ((off < 0) || (len < 0) || (pos < 0) || (off + len > b.length) || (off + len < 0)) {
        throw new IndexOutOfBoundsException();
    }
    long lastPos = pos + len - 1;
    if (lastPos >= length) {
        pad(lastPos);
        length = lastPos + 1;
    }
    int offset = (int) (pos % BUFFER_LENGTH);
    while (len > 0) {
        byte[] buf = getCacheBlock(pos / BUFFER_LENGTH);
        int nbytes = Math.min(len, BUFFER_LENGTH - offset);
        System.arraycopy(b, off, buf, offset, nbytes);
        pos += nbytes;
        off += nbytes;
        len -= nbytes;
        offset = 0;
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextServicesSupport.addBeanContextServicesListener(BeanContextServicesListener)

/**
     * add a BeanContextServicesListener
     * @throw new NullPointerException
     */
public void addBeanContextServicesListener(BeanContextServicesListener bcsl) {
    if (bcsl == null) throw new NullPointerException('bcsl');
    synchronized (bcsListeners) {
        if (bcsListeners.contains(bcsl)) return; else bcsListeners.add(bcsl);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextServicesSupport.removeBeanContextServicesListener(BeanContextServicesListener)

/**
     * remove a BeanContextServicesListener
     */
public void removeBeanContextServicesListener(BeanContextServicesListener bcsl) {
    if (bcsl == null) throw new NullPointerException('bcsl');
    synchronized (bcsListeners) {
        if (!bcsListeners.contains(bcsl)) return; else bcsListeners.remove(bcsl);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextServicesSupport.addService(Class, BeanContextServiceProvider, boolean)

/**
     * add a service
     */
protected boolean addService(Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent) {
    if (serviceClass == null) throw new NullPointerException('serviceClass');
    if (bcsp == null) throw new NullPointerException('bcsp');
    synchronized (BeanContext.globalHierarchyLock) {
        if (services.containsKey(serviceClass)) return false; else {
            services.put(serviceClass, createBCSSServiceProvider(serviceClass, bcsp));
            if (bcsp instanceof Serializable) serializable++;
            if (!fireEvent) return true;
            BeanContextServiceAvailableEvent bcssae = new BeanContextServiceAvailableEvent(getBeanContextServicesPeer(), serviceClass);
            fireServiceAdded(bcssae);
            synchronized (children) {
                Iterator i = children.keySet().iterator();
                while (i.hasNext()) {
                    Object c = i.next();
                    if (c instanceof BeanContextServices) {
                        ((BeanContextServicesListener) c).serviceAvailable(bcssae);
                    }
                }
            }
            return true;
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextServicesSupport.revokeService(Class, BeanContextServiceProvider, boolean)

/**
     * remove a service
     */
public void revokeService(Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) {
    if (serviceClass == null) throw new NullPointerException('serviceClass');
    if (bcsp == null) throw new NullPointerException('bcsp');
    synchronized (BeanContext.globalHierarchyLock) {
        if (!services.containsKey(serviceClass)) return;
        BCSSServiceProvider bcsssp = (BCSSServiceProvider) services.get(serviceClass);
        if (!bcsssp.getServiceProvider().equals(bcsp)) throw new IllegalArgumentException('service provider mismatch');
        services.remove(serviceClass);
        if (bcsp instanceof Serializable) serializable--;
        Iterator i = bcsChildren();
        while (i.hasNext()) {
            ((BCSSChild) i.next()).revokeService(serviceClass, false, revokeCurrentServicesNow);
        }
        fireServiceRevoked(serviceClass, revokeCurrentServicesNow);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextServicesSupport.getService(BeanContextChild, Object, Class, Object, BeanContextServiceRevokedListener)

/**
     * obtain a service which may be delegated
     */
public Object getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException {
    if (child == null) throw new NullPointerException('child');
    if (serviceClass == null) throw new NullPointerException('serviceClass');
    if (requestor == null) throw new NullPointerException('requestor');
    if (bcsrl == null) throw new NullPointerException('bcsrl');
    Object service = null;
    BCSSChild bcsc;
    BeanContextServices bcssp = getBeanContextServicesPeer();
    synchronized (BeanContext.globalHierarchyLock) {
        synchronized (children) {
            bcsc = (BCSSChild) children.get(child);
        }
        if (bcsc == null) throw new IllegalArgumentException('not a child of this context');
        BCSSServiceProvider bcsssp = (BCSSServiceProvider) services.get(serviceClass);
        if (bcsssp != null) {
            BeanContextServiceProvider bcsp = bcsssp.getServiceProvider();
            service = bcsp.getService(bcssp, requestor, serviceClass, serviceSelector);
            if (service != null) {
                try {
                    bcsc.usingService(requestor, service, serviceClass, bcsp, false, bcsrl);
                } catch (TooManyListenersException tmle) {
                    bcsp.releaseService(bcssp, requestor, service);
                    throw tmle;
                } catch (UnsupportedOperationException uope) {
                    bcsp.releaseService(bcssp, requestor, service);
                    throw uope;
                }
                return service;
            }
        }
        if (proxy != null) {
            service = proxy.getService(bcssp, requestor, serviceClass, serviceSelector);
            if (service != null) {
                try {
                    bcsc.usingService(requestor, service, serviceClass, proxy, true, bcsrl);
                } catch (TooManyListenersException tmle) {
                    proxy.releaseService(bcssp, requestor, service);
                    throw tmle;
                } catch (UnsupportedOperationException uope) {
                    proxy.releaseService(bcssp, requestor, service);
                    throw uope;
                }
                return service;
            }
        }
    }
    return null;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.imageio.stream.ImageInputStreamImpl.readBytes(IIOByteBuffer, int)

public void readBytes(IIOByteBuffer buf, int len) throws IOException {
    if (len < 0) {
        throw new IndexOutOfBoundsException('len < 0!');
    }
    if (buf == null) {
        throw new NullPointerException('buf == null!');
    }
    byte[] data = new byte[len];
    len = read(data, 0, len);
    buf.setData(data);
    buf.setOffset(0);
    buf.setLength(len);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.Choice.insertNoInvalidate(String, int)

/**
     * Inserts an item to this <code>Choice</code>,
     * but does not invalidate the <code>Choice</code>.
     * Client methods must provide their own synchronization before
     * invoking this method.
     * @param item the item to be added
     * @param index the new item position
     * @exception NullPointerException if the item's value is equal to
     *  <code>null</code>
     */
private void insertNoInvalidate(String item, int index) {
    if (item == null) {
        throw new NullPointerException('cannot add null item to Choice');
    }
    pItems.insertElementAt(item, index);
    ChoicePeer peer = (ChoicePeer) this.peer;
    if (peer != null) {
        peer.addItem(item, index);
    }
    if (selectedIndex < 0 || selectedIndex >= index) {
        select(0);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.rmi.Naming.bind(String, Remote)

/**
     * Binds the specified <code>name</code> to a remote object.
     * @param name a name in URL format (without the scheme component) 
     * @param obj a reference for the remote object (usually a stub)
     * @exception AlreadyBoundException if name is already bound
     * @exception MalformedURLException if the name is not an appropriately
     *  formatted URL
     * @exception RemoteException if registry could not be contacted
     * @exception AccessException if this operation is not permitted (if
     * originating from a non-local host, for example)
     * @since JDK1.1
     */
public static void bind(String name, Remote obj) throws AlreadyBoundException, java.net.MalformedURLException, RemoteException {
    ParsedNamingURL parsed = parseURL(name);
    Registry registry = getRegistry(parsed);
    if (obj == null) throw new NullPointerException('cannot bind to null');
    registry.bind(parsed.name, obj);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.rmi.Naming.rebind(String, Remote)

/** 
     * Rebinds the specified name to a new remote object. Any existing
     * binding for the name is replaced.
     * @param name a name in URL format (without the scheme component)
     * @param obj new remote object to associate with the name
     * @exception MalformedURLException if the name is not an appropriately
     *  formatted URL
     * @exception RemoteException if registry could not be contacted
     * @exception AccessException if this operation is not permitted (if
     * originating from a non-local host, for example)
     * @since JDK1.1
     */
public static void rebind(String name, Remote obj) throws RemoteException, java.net.MalformedURLException {
    ParsedNamingURL parsed = parseURL(name);
    Registry registry = getRegistry(parsed);
    if (obj == null) throw new NullPointerException('cannot bind to null');
    registry.rebind(parsed.name, obj);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.net.URLEncoder.encode(String, String)

/**
     * Translates a string into <code>application/x-www-form-urlencoded</code>
     * format using a specific encoding scheme. This method uses the
     * supplied encoding scheme to obtain the bytes for unsafe
     * characters.
     * <em><strong>Note:</strong> The <a href=
     * 'http://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars'>
     * World Wide Web Consortium Recommendation</a> states that
     * UTF-8 should be used. Not doing so may introduce
     * incompatibilites.</em>
     * @param   s   <code>String</code> to be translated.
     * @param   enc   The name of a supported 
     *    <a href='../lang/package-summary.html#charenc'>character
     *    encoding</a>.
     * @return  the translated <code>String</code>.
     * @exception  UnsupportedEncodingException
     *             If the named encoding is not supported
     * @see URLDecoder#decode(java.lang.String, java.lang.String)
     * @since 1.4
     */
public static String encode(String s, String enc) throws UnsupportedEncodingException {
    boolean needToChange = false;
    StringBuffer out = new StringBuffer(s.length());
    Charset charset;
    CharArrayWriter charArrayWriter = new CharArrayWriter();
    if (enc == null) throw new NullPointerException('charsetName');
    try {
        charset = Charset.forName(enc);
    } catch (IllegalCharsetNameException e) {
        throw new UnsupportedEncodingException(enc);
    } catch (UnsupportedCharsetException e) {
        throw new UnsupportedEncodingException(enc);
    }
    for (int i = 0; i < s.length(); ) {
        int c = (int) s.charAt(i);
        if (dontNeedEncoding.get(c)) {
            if (c == ' ') {
                c = '+';
                needToChange = true;
            }
            out.append((char) c);
            i++;
        } else {
            do {
                charArrayWriter.write(c);
                if (c >= 0xD800 && c <= 0xDBFF) {
                    if ((i + 1) < s.length()) {
                        int d = (int) s.charAt(i + 1);
                        if (d >= 0xDC00 && d <= 0xDFFF) {
                            charArrayWriter.write(d);
                            i++;
                        }
                    }
                }
                i++;
            } while (i < s.length() && !dontNeedEncoding.get((c = (int) s.charAt(i))));
            charArrayWriter.flush();
            String str = new String(charArrayWriter.toCharArray());
            byte[] ba = str.getBytes(charset.name());
            for (int j = 0; j < ba.length; j++) {
                out.append('%');
                char ch = Character.forDigit((ba[j] >> 4) & 0xF, 16);
                if (Character.isLetter(ch)) {
                    ch -= caseDiff;
                }
                out.append(ch);
                ch = Character.forDigit(ba[j] & 0xF, 16);
                if (Character.isLetter(ch)) {
                    ch -= caseDiff;
                }
                out.append(ch);
            }
            charArrayWriter.reset();
            needToChange = true;
        }
    }
    return (needToChange ? out.toString() : s);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextServicesSupport.releaseService(BeanContextChild, Object, Object)

/**
     * release a service
     */
public void releaseService(BeanContextChild child, Object requestor, Object service) {
    if (child == null) throw new NullPointerException('child');
    if (requestor == null) throw new NullPointerException('requestor');
    if (service == null) throw new NullPointerException('service');
    BCSSChild bcsc;
    synchronized (BeanContext.globalHierarchyLock) {
        synchronized (children) {
            bcsc = (BCSSChild) children.get(child);
        }
        if (bcsc != null) bcsc.releaseService(requestor, service); else throw new IllegalArgumentException('child actual is not a child of this BeanContext');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.ScrollPane.getScrollPosition()

/**
     * Returns the current x,y position within the child which is displayed
     * at the 0,0 location of the scrolled panel's view port.
     * This is a convenience method which interfaces with the adjustable
     * objects which represent the state of the scrollbars.
     * @return the coordinate position for the current scroll position
     * @throws NullPointerException if the scrollpane does not contain
     *     a child
     */
public Point getScrollPosition() {
    if (ncomponents <= 0) {
        throw new NullPointerException('child is null');
    }
    return new Point(hAdjustable.getValue(), vAdjustable.getValue());
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.ScrollPane.setScrollPosition(int, int)

/**
     * Scrolls to the specified position within the child component.
     * A call to this method is only valid if the scroll pane contains
     * a child.  Specifying a position outside of the legal scrolling bounds
     * of the child will scroll to the closest legal position.
     * Legal bounds are defined to be the rectangle:
     * x = 0, y = 0, width = (child width - view port width),
     * height = (child height - view port height).
     * This is a convenience method which interfaces with the Adjustable
     * objects which represent the state of the scrollbars.
     * @param x the x position to scroll to
     * @param y the y position to scroll to
     * @throws NullPointerException if the scrollpane does not contain
     *     a child
     */
public void setScrollPosition(int x, int y) {
    synchronized (getTreeLock()) {
        if (ncomponents <= 0) {
            throw new NullPointerException('child is null');
        }
        hAdjustable.setValue(x);
        vAdjustable.setValue(y);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.ObjectName.construct(String, Hashtable)

/**
     * Construct an ObjectName from a domain and a Hashtable.
     * @param domain Domain of the ObjectName.
     * @param props  Hashtable containing couples <i>key</i> -> <i>value</i>.
     * @exception MalformedObjectNameException The <code>domain</code>
     * contains an illegal character, or one of the keys or values in
     * <code>table</code> contains an illegal character, or one of the
     * values in <code>table</code> does not follow the rules for quoting.
     * @exception NullPointerException One of the parameters is null.
     */
private void construct(String domain, Hashtable props) throws MalformedObjectNameException, NullPointerException {
    if (domain == null) throw new NullPointerException('domain cannot be null');
    if (props == null) throw new NullPointerException('key property list cannot be null');
    if (props.isEmpty()) throw new MalformedObjectNameException('key property list cannot be empty');
    if (!isDomain(domain)) throw new MalformedObjectNameException('Invalid domain: ' + domain);
    final StringBuffer sb = new StringBuffer();
    sb.append(domain).append(':');
    _domain_length = domain.length();
    int nb_props = props.size();
    _kp_array = new Property[nb_props];
    String[] keys = new String[nb_props];
    final Enumeration e = props.keys();
    final HashMap keys_map = new HashMap();
    Property prop;
    int key_index;
    for (int i = 0; e.hasMoreElements(); i++) {
        if (i > 0) sb.append(',');
        String key = '';
        try {
            key = (String) e.nextElement();
        } catch (Exception x) {
            throw new MalformedObjectNameException('Invalid key `' + key + ''');
        }
        String value = '';
        try {
            value = (String) props.get(key);
        } catch (Exception x) {
            throw new MalformedObjectNameException('Invalid value `' + value + ''');
        }
        key_index = sb.length();
        checkKey(key);
        sb.append(key);
        keys[i] = key;
        sb.append('=');
        checkValue(value);
        sb.append(value);
        prop = new Property(key_index, key.length(), value.length());
        addProperty(prop, i, keys_map, key);
    }
    int len = sb.length();
    char[] initial_chars = new char[len];
    sb.getChars(0, len, initial_chars, 0);
    char[] canonical_chars = new char[len];
    System.arraycopy(initial_chars, 0, canonical_chars, 0, _domain_length + 1);
    setCanonicalName(initial_chars, canonical_chars, keys, keys_map, _domain_length + 1, _kp_array.length);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.NumericValueExp.readObject(ObjectInputStream)

/**
     * Deserializes a {@link NumericValueExp} from an {@link ObjectInputStream}.
     */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    if (compat) {
        double doubleVal;
        long longVal;
        boolean isLong;
        ObjectInputStream.GetField fields = in.readFields();
        doubleVal = fields.get('doubleVal', (double) 0);
        if (fields.defaulted('doubleVal')) {
            throw new NullPointerException('doubleVal');
        }
        longVal = fields.get('longVal', (long) 0);
        if (fields.defaulted('longVal')) {
            throw new NullPointerException('longVal');
        }
        isLong = fields.get('valIsLong', false);
        if (fields.defaulted('valIsLong')) {
            throw new NullPointerException('valIsLong');
        }
        if (isLong) {
            this.val = new Long(longVal);
        } else {
            this.val = new Double(doubleVal);
        }
    } else {
        in.defaultReadObject();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.SecurityManager.checkRead(FileDescriptor)

/**
     * Throws a <code>SecurityException</code> if the 
     * calling thread is not allowed to read from the specified file 
     * descriptor. 
     * This method calls <code>checkPermission</code> with the
     * <code>RuntimePermission('readFileDescriptor')</code>
     * permission.
     * If you override this method, then you should make a call to 
     * <code>super.checkRead</code>
     * at the point the overridden method would normally throw an
     * exception.
     * @param      fd   the system-dependent file descriptor.
     * @exception  SecurityException  if the calling thread does not have
     *             permission to access the specified file descriptor.
     * @exception  NullPointerException if the file descriptor argument is
     *             <code>null</code>.
     * @see        java.io.FileDescriptor
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
public void checkRead(FileDescriptor fd) {
    if (fd == null) {
        throw new NullPointerException('file descriptor can't be null');
    }
    checkPermission(new RuntimePermission('readFileDescriptor'));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.SecurityManager.checkWrite(FileDescriptor)

/**
     * Throws a <code>SecurityException</code> if the 
     * calling thread is not allowed to write to the specified file 
     * descriptor. 
     * This method calls <code>checkPermission</code> with the
     * <code>RuntimePermission('writeFileDescriptor')</code>
     * permission.
     * If you override this method, then you should make a call to 
     * <code>super.checkWrite</code>
     * at the point the overridden method would normally throw an
     * exception.
     * @param      fd   the system-dependent file descriptor.
     * @exception SecurityException  if the calling thread does not have
     *             permission to access the specified file descriptor.
     * @exception  NullPointerException if the file descriptor argument is
     *             <code>null</code>.
     * @see        java.io.FileDescriptor
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
public void checkWrite(FileDescriptor fd) {
    if (fd == null) {
        throw new NullPointerException('file descriptor can't be null');
    }
    checkPermission(new RuntimePermission('writeFileDescriptor'));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.datatransfer.Clipboard.getData(DataFlavor)

/**
     * Returns an object representing the current contents of this clipboard
     * in the specified <code>DataFlavor</code>.
     * The class of the object returned is defined by the representation
     * class of <code>flavor</code>.
     * @param flavor the requested <code>DataFlavor</code> for the contents
     * @return an object representing the current contents of this clipboard
     *         in the specified <code>DataFlavor</code>
     * @throws NullPointerException if <code>flavor</code> is <code>null</code>
     * @throws IllegalStateException if this clipboard is currently unavailable
     * @throws UnsupportedFlavorException if the requested <code>DataFlavor</code>
     *         is not available
     * @throws IOException if the data in the requested <code>DataFlavor</code>
     *         can not be retrieved
     * @see DataFlavor#getRepresentationClass
     * @since 1.5
     */
public Object getData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
    if (flavor == null) {
        throw new NullPointerException('flavor');
    }
    Transferable cntnts = getContents(null);
    if (cntnts == null) {
        throw new UnsupportedFlavorException(flavor);
    }
    return cntnts.getTransferData(flavor);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.datatransfer.Clipboard.isDataFlavorAvailable(DataFlavor)

/**
     * Returns whether or not the current contents of this clipboard can be
     * provided in the specified <code>DataFlavor</code>.
     * @param flavor the requested <code>DataFlavor</code> for the contents
     * @return <code>true</code> if the current contents of this clipboard
     *         can be provided in the specified <code>DataFlavor</code>;
     *         <code>false</code> otherwise
     * @throws NullPointerException if <code>flavor</code> is <code>null</code>
     * @throws IllegalStateException if this clipboard is currently unavailable
     * @since 1.5
     */
public boolean isDataFlavorAvailable(DataFlavor flavor) {
    if (flavor == null) {
        throw new NullPointerException('flavor');
    }
    Transferable cntnts = getContents(null);
    if (cntnts == null) {
        return false;
    }
    return cntnts.isDataFlavorSupported(flavor);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.text.DecimalFormat.formatToCharacterIterator(Object)

/**
     * Formats an Object producing an <code>AttributedCharacterIterator</code>.
     * You can use the returned <code>AttributedCharacterIterator</code>
     * to build the resulting String, as well as to determine information
     * about the resulting String.
     * Each attribute key of the AttributedCharacterIterator will be of type
     * <code>NumberFormat.Field</code>, with the attribute value being the
     * same as the attribute key.
     * @exception NullPointerException if obj is null.
     * @exception IllegalArgumentException when the Format cannot format the
     *            given object.
     * @param obj The object to format
     * @return AttributedCharacterIterator describing the formatted value.
     * @since 1.4
     */
public AttributedCharacterIterator formatToCharacterIterator(Object obj) {
    CharacterIteratorFieldDelegate delegate = new CharacterIteratorFieldDelegate();
    StringBuffer sb = new StringBuffer();
    if (obj instanceof Double || obj instanceof Float) {
        format(((Number) obj).doubleValue(), sb, delegate);
    } else if (obj instanceof Long || obj instanceof Integer || obj instanceof Short || obj instanceof Byte) {
        format(((Number) obj).longValue(), sb, delegate);
    } else if (obj instanceof BigDecimal) {
        format((BigDecimal) obj, sb, delegate);
    } else if (obj instanceof BigInteger) {
        format((BigInteger) obj, sb, delegate, false);
    } else if (obj == null) {
        throw new NullPointerException('formatToCharacterIterator must be passed non-null object');
    } else {
        throw new IllegalArgumentException('Cannot format given Object as a Number');
    }
    return delegate.getIterator(sb.toString());
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.text.MessageFormat.formatToCharacterIterator(Object)

/**
     * Formats an array of objects and inserts them into the
     * <code>MessageFormat</code>'s pattern, producing an
     * <code>AttributedCharacterIterator</code>.
     * You can use the returned <code>AttributedCharacterIterator</code>
     * to build the resulting String, as well as to determine information
     * about the resulting String.
     * The text of the returned <code>AttributedCharacterIterator</code> is
     * the same that would be returned by
     * <blockquote>
     *     <code>{@link #format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition) format}(arguments, new StringBuffer(), null).toString()</code>
     * </blockquote>
     * In addition, the <code>AttributedCharacterIterator</code> contains at
     * least attributes indicating where text was generated from an
     * argument in the <code>arguments</code> array. The keys of these attributes are of
     * type <code>MessageFormat.Field</code>, their values are
     * <code>Integer</code> objects indicating the index in the <code>arguments</code>
     * array of the argument from which the text was generated.
     * The attributes/value from the underlying <code>Format</code>
     * instances that <code>MessageFormat</code> uses will also be
     * placed in the resulting <code>AttributedCharacterIterator</code>.
     * This allows you to not only find where an argument is placed in the
     * resulting String, but also which fields it contains in turn.
     * @param arguments an array of objects to be formatted and substituted.
     * @return AttributedCharacterIterator describing the formatted value.
     * @exception NullPointerException if <code>arguments</code> is null.
     * @exception IllegalArgumentException if an argument in the
     *            <code>arguments</code> array is not of the type
     *            expected by the format element(s) that use it.
     * @since 1.4
     */
public AttributedCharacterIterator formatToCharacterIterator(Object arguments) {
    StringBuffer result = new StringBuffer();
    ArrayList iterators = new ArrayList();
    if (arguments == null) {
        throw new NullPointerException('formatToCharacterIterator must be passed non-null object');
    }
    subformat((Object[]) arguments, result, null, iterators);
    if (iterators.size() == 0) {
        return createAttributedCharacterIterator('');
    }
    return createAttributedCharacterIterator((AttributedCharacterIterator[]) iterators.toArray(new AttributedCharacterIterator[iterators.size()]));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.text.SimpleDateFormat.formatToCharacterIterator(Object)

/**
     * Formats an Object producing an <code>AttributedCharacterIterator</code>.
     * You can use the returned <code>AttributedCharacterIterator</code>
     * to build the resulting String, as well as to determine information
     * about the resulting String.
     * Each attribute key of the AttributedCharacterIterator will be of type
     * <code>DateFormat.Field</code>, with the corresponding attribute value
     * being the same as the attribute key.
     * @exception NullPointerException if obj is null.
     * @exception IllegalArgumentException if the Format cannot format the
     *            given object, or if the Format's pattern string is invalid.
     * @param obj The object to format
     * @return AttributedCharacterIterator describing the formatted value.
     * @since 1.4
     */
public AttributedCharacterIterator formatToCharacterIterator(Object obj) {
    StringBuffer sb = new StringBuffer();
    CharacterIteratorFieldDelegate delegate = new CharacterIteratorFieldDelegate();
    if (obj instanceof Date) {
        format((Date) obj, sb, delegate);
    } else if (obj instanceof Number) {
        format(new Date(((Number) obj).longValue()), sb, delegate);
    } else if (obj == null) {
        throw new NullPointerException('formatToCharacterIterator must be passed non-null object');
    } else {
        throw new IllegalArgumentException('Cannot format given Object as a Date');
    }
    return delegate.getIterator(sb.toString());
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.swing.JRootPane.setGlassPane(Component)

/**
     * Sets a specified <code>Component</code> to be the glass pane for this
     * root pane.  The glass pane should normally be a lightweight,
     * transparent component, because it will be made visible when
     * ever the root pane needs to grab input events.  For example,
     * only one <code>JInternalFrame</code> is ever active when using a
     * DefaultDesktop, and any inactive <code>JInternalFrame</code>s'
     * glass panes are made visible so that clicking anywhere within
     * an inactive <code>JInternalFrame</code> can activate it.
     * @param glass the <code>Component</code> to use as the glass pane 
     *              for this <code>JRootPane</code>
     * @exception NullPointerException if the <code>glass</code> parameter is
     *  <code>null</code>
     */
public void setGlassPane(Component glass) {
    if (glass == null) {
        throw new NullPointerException('glassPane cannot be set to null.');
    }
    boolean visible = false;
    if (glassPane != null && glassPane.getParent() == this) {
        this.remove(glassPane);
        visible = glassPane.isVisible();
    }
    glass.setVisible(visible);
    glassPane = glass;
    this.add(glassPane, 0);
    if (visible) {
        repaint();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.SecurityManager.checkAccept(String, int)

/**
     * Throws a <code>SecurityException</code> if the 
     * calling thread is not permitted to accept a socket connection from 
     * the specified host and port number. 
     * This method is invoked for the current security manager by the 
     * <code>accept</code> method of class <code>ServerSocket</code>. 
     * This method calls <code>checkPermission</code> with the
     * <code>SocketPermission(host+':'+port,'accept')</code> permission.
     * If you override this method, then you should make a call to 
     * <code>super.checkAccept</code>
     * at the point the overridden method would normally throw an
     * exception.
     * @param      host   the host name of the socket connection.
     * @param      port   the port number of the socket connection.
     * @exception  SecurityException  if the calling thread does not have 
     *             permission to accept the connection.
     * @exception  NullPointerException if the <code>host</code> argument is
     *             <code>null</code>.
     * @see        java.net.ServerSocket#accept()
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
public void checkAccept(String host, int port) {
    if (host == null) {
        throw new NullPointerException('host can't be null');
    }
    if (!host.startsWith('[') && host.indexOf(':') != -1) {
        host = '[' + host + ']';
    }
    checkPermission(new SocketPermission(host + ':' + port, SecurityConstants.SOCKET_ACCEPT_ACTION));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.SecurityManager.checkConnect(String, int)

/**
     * Throws a <code>SecurityException</code> if the 
     * calling thread is not allowed to open a socket connection to the 
     * specified host and port number. 
     * A port number of <code>-1</code> indicates that the calling 
     * method is attempting to determine the IP address of the specified 
     * host name. 
     * This method calls <code>checkPermission</code> with the
     * <code>SocketPermission(host+':'+port,'connect')</code> permission if
     * the port is not equal to -1. If the port is equal to -1, then
     * it calls <code>checkPermission</code> with the
     * <code>SocketPermission(host,'resolve')</code> permission.
     * If you override this method, then you should make a call to 
     * <code>super.checkConnect</code>
     * at the point the overridden method would normally throw an
     * exception.
     * @param      host   the host name port to connect to.
     * @param      port   the protocol port to connect to.
     * @exception  SecurityException  if the calling thread does not have
     *             permission to open a socket connection to the specified
     *               <code>host</code> and <code>port</code>.
     * @exception  NullPointerException if the <code>host</code> argument is
     *             <code>null</code>.
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
public void checkConnect(String host, int port) {
    if (host == null) {
        throw new NullPointerException('host can't be null');
    }
    if (!host.startsWith('[') && host.indexOf(':') != -1) {
        host = '[' + host + ']';
    }
    if (port == -1) {
        checkPermission(new SocketPermission(host, SecurityConstants.SOCKET_RESOLVE_ACTION));
    } else {
        checkPermission(new SocketPermission(host + ':' + port, SecurityConstants.SOCKET_CONNECT_ACTION));
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.SecurityManager.checkConnect(String, int, Object)

/**
     * Throws a <code>SecurityException</code> if the 
     * specified security context is not allowed to open a socket 
     * connection to the specified host and port number. 
     * A port number of <code>-1</code> indicates that the calling 
     * method is attempting to determine the IP address of the specified 
     * host name. 
     *  If <code>context</code> is not an instance of 
     * <code>AccessControlContext</code> then a
     * <code>SecurityException</code> is thrown.
     * Otherwise, the port number is checked. If it is not equal
     * to -1, the <code>context</code>'s <code>checkPermission</code>
     * method is called with a 
     * <code>SocketPermission(host+':'+port,'connect')</code> permission.
     * If the port is equal to -1, then
     * the <code>context</code>'s <code>checkPermission</code> method 
     * is called with a
     * <code>SocketPermission(host,'resolve')</code> permission.
     * If you override this method, then you should make a call to 
     * <code>super.checkConnect</code>
     * at the point the overridden method would normally throw an
     * exception.
     * @param      host      the host name port to connect to.
     * @param      port      the protocol port to connect to.
     * @param      context   a system-dependent security context.
     * @exception  SecurityException if the specified security context
     *             is not an instance of <code>AccessControlContext</code>
     *             (e.g., is <code>null</code>), or does not have permission
     *             to open a socket connection to the specified
     *             <code>host</code> and <code>port</code>.
     * @exception  NullPointerException if the <code>host</code> argument is
     *             <code>null</code>.
     * @see        java.lang.SecurityManager#getSecurityContext()
     * @see        java.security.AccessControlContext#checkPermission(java.security.Permission)
     */
public void checkConnect(String host, int port, Object context) {
    if (host == null) {
        throw new NullPointerException('host can't be null');
    }
    if (!host.startsWith('[') && host.indexOf(':') != -1) {
        host = '[' + host + ']';
    }
    if (port == -1) checkPermission(new SocketPermission(host, SecurityConstants.SOCKET_RESOLVE_ACTION), context); else checkPermission(new SocketPermission(host + ':' + port, SecurityConstants.SOCKET_CONNECT_ACTION), context);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.connect(Remote, Remote)

/**
     * Makes a Remote object ready for remote communication. This normally
     * happens implicitly when the object is sent or received as an argument
     * on a remote method call, but in some circumstances it is useful to
     * perform this action by making an explicit call.  See the 
     * {@link Stub#connect} method for more information. 
     * @param target the object to connect.
     * @param source a previously connected object.
     * @throws RemoteException if <code>source</code> is not connected
     * or if <code>target</code> is already connected to a different ORB than
     * <code>source</code>.
     */
public void connect(Remote target, Remote source) throws RemoteException {
    if (target == null || source == null) {
        throw new NullPointerException('invalid argument');
    }
    ORB orb = null;
    try {
        if (StubAdapter.isStub(source)) {
            orb = StubAdapter.getORB(source);
        } else {
            Tie tie = Util.getTie(source);
            if (tie == null) {
            } else {
                orb = tie.orb();
            }
        }
    } catch (SystemException e) {
        throw new RemoteException(''source' object not connected', e);
    }
    boolean targetIsIIOP = false;
    Tie targetTie = null;
    if (StubAdapter.isStub(target)) {
        targetIsIIOP = true;
    } else {
        targetTie = Util.getTie(target);
        if (targetTie != null) {
            targetIsIIOP = true;
        } else {
        }
    }
    if (!targetIsIIOP) {
        if (orb != null) {
            throw new RemoteException(''source' object exported to IIOP, 'target' is JRMP');
        }
    } else {
        if (orb == null) {
            throw new RemoteException(''source' object is JRMP, 'target' is IIOP');
        }
        try {
            if (targetTie != null) {
                try {
                    ORB existingOrb = targetTie.orb();
                    if (existingOrb == orb) {
                        return;
                    } else {
                        throw new RemoteException(''target' object was already connected');
                    }
                } catch (SystemException e) {
                }
                targetTie.orb(orb);
            } else {
                StubAdapter.connect(target, orb);
            }
        } catch (SystemException e) {
            throw new RemoteException(''target' object was already connected', e);
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.exportObject(Remote)

/**
     * Makes a server object ready to receive remote calls. Note
     * that subclasses of PortableRemoteObject do not need to call this
     * method, as it is called by the constructor.
     * @param obj the server object to export.
     * @exception RemoteException if export fails.
     */
public void exportObject(Remote obj) throws RemoteException {
    if (obj == null) {
        throw new NullPointerException('invalid argument');
    }
    if (Util.getTie(obj) != null) {
        throw new ExportException(obj.getClass().getName() + ' already exported');
    }
    Tie theTie = Utility.loadTie(obj);
    if (theTie != null) {
        Util.registerTarget(theTie, obj);
    } else {
        UnicastRemoteObject.exportObject(obj);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(java.lang.Object, java.lang.Class)

/**
     * Checks to ensure that an object of a remote or abstract interface type
     * can be cast to a desired type.
     * @param narrowFrom the object to check.
     * @param narrowTo the desired type.
     * @return an object which can be cast to the desired type.
     * @throws ClassCastException if narrowFrom cannot be cast to narrowTo.
     */
public java.lang.Object narrow(java.lang.Object narrowFrom, java.lang.Class narrowTo) throws ClassCastException {
    java.lang.Object result = null;
    if (narrowFrom == null) return null;
    if (narrowTo == null) throw new NullPointerException('invalid argument');
    try {
        if (narrowTo.isAssignableFrom(narrowFrom.getClass())) return narrowFrom;
        if (narrowTo.isInterface() && narrowTo != java.io.Serializable.class && narrowTo != java.io.Externalizable.class) {
            org.omg.CORBA.Object narrowObj = (org.omg.CORBA.Object) narrowFrom;
            String id = RepositoryId.createForAnyType(narrowTo);
            if (narrowObj._is_a(id)) {
                return Utility.loadStub(narrowObj, narrowTo);
            } else {
                throw new ClassCastException('Object is not of remote type ' + narrowTo.getName());
            }
        } else {
            throw new ClassCastException('Class ' + narrowTo.getName() + ' is not a valid remote interface');
        }
    } catch (Exception error) {
        ClassCastException cce = new ClassCastException();
        cce.initCause(error);
        throw cce;
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.toStub(Remote)

/**
     * Returns a stub for the given server object.
     * @param obj the server object for which a stub is required. Must either be a subclass
     * of PortableRemoteObject or have been previously the target of a call to
     * {@link #exportObject}. 
     * @return the most derived stub for the object.
     * @exception NoSuchObjectException if a stub cannot be located for the given server object.
     */
public Remote toStub(Remote obj) throws NoSuchObjectException {
    Remote result = null;
    if (obj == null) {
        throw new NullPointerException('invalid argument');
    }
    if (StubAdapter.isStub(obj)) {
        return obj;
    }
    if (obj instanceof java.rmi.server.RemoteStub) {
        return obj;
    }
    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        result = Utility.loadStub(theTie, null, null, true);
    } else {
        if (Utility.loadTie(obj) == null) {
            result = java.rmi.server.RemoteObject.toStub(obj);
        }
    }
    if (result == null) {
        throw new NoSuchObjectException('object not exported');
    }
    return result;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.unexportObject(Remote)

/**
     * Deregisters a server object from the runtime, allowing the object to become
     * available for garbage collection.
     * @param obj the object to unexport.
     * @exception NoSuchObjectException if the remote object is not
     * currently exported.
     */
public void unexportObject(Remote obj) throws NoSuchObjectException {
    if (obj == null) {
        throw new NullPointerException('invalid argument');
    }
    if (StubAdapter.isStub(obj) || obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException('Can only unexport a server object.');
    }
    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj, true);
        } else {
            throw new NoSuchObjectException('Object not exported.');
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.KeyStore.getEntry(String, ProtectionParameter)

/**
     * Gets a keystore <code>Entry</code> for the specified alias
     * with the specified protection parameter.
     * @param alias get the keystore <code>Entry</code> for this alias
     * @param protParam the <code>ProtectionParameter</code>
     *  used to protect the <code>Entry</code>,
     *  which may be <code>null</code>
     * @return the keystore <code>Entry</code> for the specified alias,
     *  or <code>null</code> if there is no such entry
     * @exception NullPointerException if
     *  <code>alias</code> is <code>null</code>
     * @exception NoSuchAlgorithmException if the algorithm for recovering the
     *  entry cannot be found
     * @exception UnrecoverableEntryException if the specified
     *  <code>protParam</code> were insufficient or invalid
     * @exception KeyStoreException if the keystore has not been initialized
     *  (loaded).
     * @see #setEntry(String, KeyStore.Entry, KeyStore.ProtectionParameter)
     * @since 1.5
     */
public final Entry getEntry(String alias, ProtectionParameter protParam) throws NoSuchAlgorithmException, UnrecoverableEntryException, KeyStoreException {
    if (alias == null) {
        throw new NullPointerException('invalid null input');
    }
    if (!initialized) {
        throw new KeyStoreException('Uninitialized keystore');
    }
    return keyStoreSpi.engineGetEntry(alias, protParam);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.KeyStore.setEntry(String, Entry, ProtectionParameter)

/**
     * Saves a keystore <code>Entry</code> under the specified alias.
     * The protection parameter is used to protect the
     * <code>Entry</code>.
     *  If an entry already exists for the specified alias,
     * it is overridden.
     * @param alias save the keystore <code>Entry</code> under this alias
     * @param entry the <code>Entry</code> to save
     * @param protParam the <code>ProtectionParameter</code>
     *  used to protect the <code>Entry</code>,
     *  which may be <code>null</code>
     * @exception NullPointerException if
     *  <code>alias</code> or <code>entry</code>
     *  is <code>null</code>
     * @exception KeyStoreException if the keystore has not been initialized
     *  (loaded), or if this operation fails for some other reason
     * @see #getEntry(String, KeyStore.ProtectionParameter)
     * @since 1.5
     */
public final void setEntry(String alias, Entry entry, ProtectionParameter protParam) throws KeyStoreException {
    if (alias == null || entry == null) {
        throw new NullPointerException('invalid null input');
    }
    if (!initialized) {
        throw new KeyStoreException('Uninitialized keystore');
    }
    keyStoreSpi.engineSetEntry(alias, entry, protParam);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.System.checkKey(String)

private static void checkKey(String key) {
    if (key == null) {
        throw new NullPointerException('key can't be null');
    }
    if (key.equals('')) {
        throw new IllegalArgumentException('key can't be empty');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.net.URLConnection.addRequestProperty(String, String)

/**
     * Adds a general request property specified by a
     * key-value pair.  This method will not overwrite
     * existing values associated with the same key.
     * @param   key     the keyword by which the request is known
     *                  (e.g., '<code>accept</code>').
     * @param   value  the value associated with it.
     * @throws IllegalStateException if already connected
     * @throws NullPointerException if key is null
     * @see #getRequestProperties()
     * @since 1.4
     */
public void addRequestProperty(String key, String value) {
    if (connected) throw new IllegalStateException('Already connected');
    if (key == null) throw new NullPointerException('key is null');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.net.URLConnection.setRequestProperty(String, String)

/**
     * Sets the general request property. If a property with the key already
     * exists, overwrite its value with the new value.
     *  NOTE: HTTP requires all request properties which can
     * legally have multiple instances with the same key
     * to use a comma-seperated list syntax which enables multiple
     * properties to be appended into a single property.
     * @param   key     the keyword by which the request is known
     *                  (e.g., '<code>accept</code>').
     * @param   value   the value associated with it.
     * @throws IllegalStateException if already connected
     * @throws NullPointerException if key is <CODE>null</CODE>
     * @see #getRequestProperty(java.lang.String)
     */
public void setRequestProperty(String key, String value) {
    if (connected) throw new IllegalStateException('Already connected');
    if (key == null) throw new NullPointerException('key is null');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.SecurityManager.checkLink(String)

/**
     * Throws a <code>SecurityException</code> if the 
     * calling thread is not allowed to dynamic link the library code 
     * specified by the string argument file. The argument is either a 
     * simple library name or a complete filename. 
     * This method is invoked for the current security manager by 
     * methods <code>load</code> and <code>loadLibrary</code> of class 
     * <code>Runtime</code>. 
     * This method calls <code>checkPermission</code> with the
     * <code>RuntimePermission('loadLibrary.'+lib)</code> permission.
     * If you override this method, then you should make a call to 
     * <code>super.checkLink</code>
     * at the point the overridden method would normally throw an
     * exception.
     * @param      lib   the name of the library.
     * @exception  SecurityException if the calling thread does not have
     *             permission to dynamically link the library.
     * @exception  NullPointerException if the <code>lib</code> argument is
     *             <code>null</code>.
     * @see        java.lang.Runtime#load(java.lang.String)
     * @see        java.lang.Runtime#loadLibrary(java.lang.String)
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
public void checkLink(String lib) {
    if (lib == null) {
        throw new NullPointerException('library can't be null');
    }
    checkPermission(new RuntimePermission('loadLibrary.' + lib));
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextSupport.addBeanContextMembershipListener(BeanContextMembershipListener)

/**
     * Adds a BeanContextMembershipListener
     * @param  bcml the BeanContextMembershipListener to add
     * @throws NullPointerException
     */
public void addBeanContextMembershipListener(BeanContextMembershipListener bcml) {
    if (bcml == null) throw new NullPointerException('listener');
    synchronized (bcmListeners) {
        if (bcmListeners.contains(bcml)) return; else bcmListeners.add(bcml);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextSupport.removeBeanContextMembershipListener(BeanContextMembershipListener)

/**
     * Removes a BeanContextMembershipListener
     * @param  bcml the BeanContextMembershipListener to remove
     * @throws NullPointerException
     */
public void removeBeanContextMembershipListener(BeanContextMembershipListener bcml) {
    if (bcml == null) throw new NullPointerException('listener');
    synchronized (bcmListeners) {
        if (!bcmListeners.contains(bcml)) return; else bcmListeners.remove(bcml);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.remote.rmi.RMIConnector.addConnectionNotificationListener(NotificationListener, NotificationFilter, Object)

public void addConnectionNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) {
    if (listener == null) throw new NullPointerException('listener');
    connectionBroadcaster.addNotificationListener(listener, filter, handback);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.remote.rmi.RMIConnector.removeConnectionNotificationListener(NotificationListener)

public void removeConnectionNotificationListener(NotificationListener listener) throws ListenerNotFoundException {
    if (listener == null) throw new NullPointerException('listener');
    connectionBroadcaster.removeNotificationListener(listener);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.remote.rmi.RMIConnector.removeConnectionNotificationListener(NotificationListener, NotificationFilter, Object)

public void removeConnectionNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException {
    if (listener == null) throw new NullPointerException('listener');
    connectionBroadcaster.removeNotificationListener(listener, filter, handback);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.logging.Logging.setLoggerLevel(String, String)

public void setLoggerLevel(String loggerName, String levelName) {
    if (loggerName == null) {
        throw new NullPointerException('loggerName is null');
    }
    Logger logger = logManager.getLogger(loggerName);
    if (logger == null) {
        throw new IllegalArgumentException('Logger ' + loggerName + 'does not exist');
    }
    Level level = null;
    if (levelName != null) {
        level = Level.parse(levelName);
    }
    logger.setLevel(level);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.datatransfer.DataFlavor.initialize(String, String, ClassLoader)

/**
    * Common initialization code called from various constructors.
    * @param mimeType the MIME Content Type (must have a class= param)
    * @param humanPresentableName the human Presentable Name or 
    *                 <code>null</code>
    * @param classLoader the fallback class loader to resolve against
    * @throws MimeTypeParseException
    * @throws ClassNotFoundException
    * @throws  NullPointerException if <code>mimeType</code> is null
    * @see tryToLoadClass
    */
private void initialize(String mimeType, String humanPresentableName, ClassLoader classLoader) throws MimeTypeParseException, ClassNotFoundException {
    if (mimeType == null) {
        throw new NullPointerException('mimeType');
    }
    this.mimeType = new MimeType(mimeType);
    String rcn = getParameter('class');
    if (rcn == null) {
        if ('application/x-java-serialized-object'.equals(this.mimeType.getBaseType())) throw new IllegalArgumentException('no representation class specified for:' + mimeType); else representationClass = java.io.InputStream.class;
    } else {
        representationClass = DataFlavor.tryToLoadClass(rcn, classLoader);
    }
    this.mimeType.setParameter('class', representationClass.getName());
    if (humanPresentableName == null) {
        humanPresentableName = this.mimeType.getParameter('humanPresentableName');
        if (humanPresentableName == null) humanPresentableName = this.mimeType.getPrimaryType() + '/' + this.mimeType.getSubType();
    }
    this.humanPresentableName = humanPresentableName;
    this.mimeType.removeParameter('humanPresentableName');
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.datatransfer.DataFlavor.isMimeTypeEqual(String)

/**
     * Returns whether the string representation of the MIME type passed in
     * is equivalent to the MIME type of this <code>DataFlavor</code>.
     * Parameters are not included in the comparison.
     * @param mimeType the string representation of the MIME type
     * @return true if the string representation of the MIME type passed in is
     *         equivalent to the MIME type of this <code>DataFlavor</code>;
     *         false otherwise
     * @throws NullPointerException if mimeType is <code>null</code>
     */
public boolean isMimeTypeEqual(String mimeType) {
    if (mimeType == null) {
        throw new NullPointerException('mimeType');
    }
    if (this.mimeType == null) {
        return false;
    }
    try {
        return this.mimeType.match(new MimeType(mimeType));
    } catch (MimeTypeParseException mtpe) {
        return false;
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.modelmbean.ModelMBeanInfoSupport.readObject(ObjectInputStream)

/**
     * Deserializes a {@link ModelMBeanInfoSupport} from an {@link ObjectInputStream}.
     */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    if (compat) {
        ObjectInputStream.GetField fields = in.readFields();
        modelMBeanDescriptor = (Descriptor) fields.get('modelMBeanDescriptor', null);
        if (fields.defaulted('modelMBeanDescriptor')) {
            throw new NullPointerException('modelMBeanDescriptor');
        }
        modelMBeanAttributes = (MBeanAttributeInfo[]) fields.get('mmbAttributes', null);
        if (fields.defaulted('mmbAttributes')) {
            throw new NullPointerException('mmbAttributes');
        }
        modelMBeanConstructors = (MBeanConstructorInfo[]) fields.get('mmbConstructors', null);
        if (fields.defaulted('mmbConstructors')) {
            throw new NullPointerException('mmbConstructors');
        }
        modelMBeanNotifications = (MBeanNotificationInfo[]) fields.get('mmbNotifications', null);
        if (fields.defaulted('mmbNotifications')) {
            throw new NullPointerException('mmbNotifications');
        }
        modelMBeanOperations = (MBeanOperationInfo[]) fields.get('mmbOperations', null);
        if (fields.defaulted('mmbOperations')) {
            throw new NullPointerException('mmbOperations');
        }
    } else {
        in.defaultReadObject();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.relation.RoleInfo.readObject(ObjectInputStream)

/**
     * Deserializes a {@link RoleInfo} from an {@link ObjectInputStream}.
     */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    if (compat) {
        ObjectInputStream.GetField fields = in.readFields();
        name = (String) fields.get('myName', null);
        if (fields.defaulted('myName')) {
            throw new NullPointerException('myName');
        }
        isReadable = fields.get('myIsReadableFlg', false);
        if (fields.defaulted('myIsReadableFlg')) {
            throw new NullPointerException('myIsReadableFlg');
        }
        isWritable = fields.get('myIsWritableFlg', false);
        if (fields.defaulted('myIsWritableFlg')) {
            throw new NullPointerException('myIsWritableFlg');
        }
        description = (String) fields.get('myDescription', null);
        if (fields.defaulted('myDescription')) {
            throw new NullPointerException('myDescription');
        }
        minDegree = fields.get('myMinDegree', (int) 0);
        if (fields.defaulted('myMinDegree')) {
            throw new NullPointerException('myMinDegree');
        }
        maxDegree = fields.get('myMaxDegree', (int) 0);
        if (fields.defaulted('myMaxDegree')) {
            throw new NullPointerException('myMaxDegree');
        }
        referencedMBeanClassName = (String) fields.get('myRefMBeanClassName', null);
        if (fields.defaulted('myRefMBeanClassName')) {
            throw new NullPointerException('myRefMBeanClassName');
        }
    } else {
        in.defaultReadObject();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.relation.MBeanServerNotificationFilter.readObject(ObjectInputStream)

/**
     * Deserializes an {@link MBeanServerNotificationFilter} from an {@link ObjectInputStream}.
     */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    if (compat) {
        ObjectInputStream.GetField fields = in.readFields();
        selectedNames = (List) fields.get('mySelectObjNameList', null);
        if (fields.defaulted('mySelectObjNameList')) {
            throw new NullPointerException('mySelectObjNameList');
        }
        deselectedNames = (List) fields.get('myDeselectObjNameList', null);
        if (fields.defaulted('myDeselectObjNameList')) {
            throw new NullPointerException('myDeselectObjNameList');
        }
    } else {
        in.defaultReadObject();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.relation.RelationTypeSupport.readObject(ObjectInputStream)

/**
     * Deserializes a {@link RelationTypeSupport} from an {@link ObjectInputStream}.
     */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    if (compat) {
        ObjectInputStream.GetField fields = in.readFields();
        typeName = (String) fields.get('myTypeName', null);
        if (fields.defaulted('myTypeName')) {
            throw new NullPointerException('myTypeName');
        }
        roleName2InfoMap = (Map) fields.get('myRoleName2InfoMap', null);
        if (fields.defaulted('myRoleName2InfoMap')) {
            throw new NullPointerException('myRoleName2InfoMap');
        }
        isInRelationService = fields.get('myIsInRelServFlg', false);
        if (fields.defaulted('myIsInRelServFlg')) {
            throw new NullPointerException('myIsInRelServFlg');
        }
    } else {
        in.defaultReadObject();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.relation.Role.readObject(ObjectInputStream)

/**
     * Deserializes a {@link Role} from an {@link ObjectInputStream}.
     */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    if (compat) {
        ObjectInputStream.GetField fields = in.readFields();
        name = (String) fields.get('myName', null);
        if (fields.defaulted('myName')) {
            throw new NullPointerException('myName');
        }
        objectNameList = (List) fields.get('myObjNameList', null);
        if (fields.defaulted('myObjNameList')) {
            throw new NullPointerException('myObjNameList');
        }
    } else {
        in.defaultReadObject();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.relation.RoleUnresolved.readObject(ObjectInputStream)

/**
     * Deserializes a {@link RoleUnresolved} from an {@link ObjectInputStream}.
     */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    if (compat) {
        ObjectInputStream.GetField fields = in.readFields();
        roleName = (String) fields.get('myRoleName', null);
        if (fields.defaulted('myRoleName')) {
            throw new NullPointerException('myRoleName');
        }
        roleValue = (List) fields.get('myRoleValue', null);
        if (fields.defaulted('myRoleValue')) {
            throw new NullPointerException('myRoleValue');
        }
        problemType = fields.get('myPbType', (int) 0);
        if (fields.defaulted('myPbType')) {
            throw new NullPointerException('myPbType');
        }
    } else {
        in.defaultReadObject();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.relation.RoleResult.readObject(ObjectInputStream)

/**
     * Deserializes a {@link RoleResult} from an {@link ObjectInputStream}.
     */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    if (compat) {
        ObjectInputStream.GetField fields = in.readFields();
        roleList = (RoleList) fields.get('myRoleList', null);
        if (fields.defaulted('myRoleList')) {
            throw new NullPointerException('myRoleList');
        }
        unresolvedRoleList = (RoleUnresolvedList) fields.get('myRoleUnresList', null);
        if (fields.defaulted('myRoleUnresList')) {
            throw new NullPointerException('myRoleUnresList');
        }
    } else {
        in.defaultReadObject();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.io.FilePermission.init(int)

/**
     * initialize a FilePermission object. Common to all constructors.
     * Also called during de-serialization.
     * @param mask the actions mask to use.
     */
private void init(int mask) {
    if ((mask & ALL) != mask) throw new IllegalArgumentException('invalid actions mask');
    if (mask == NONE) throw new IllegalArgumentException('invalid actions mask');
    if ((cpath = getName()) == null) throw new NullPointerException('name can't be null');
    this.mask = mask;
    if (cpath.equals('<<ALL FILES>>')) {
        directory = true;
        recursive = true;
        cpath = '';
        return;
    }
    int len = cpath.length();
    char last = ((len > 0) ? cpath.charAt(len - 1) : 0);
    if (last == RECURSIVE_CHAR && (len == 1 || cpath.charAt(len - 2) == File.separatorChar)) {
        directory = true;
        recursive = true;
        cpath = cpath.substring(0, --len);
    } else if (last == WILD_CHAR && (len == 1 || cpath.charAt(len - 2) == File.separatorChar)) {
        directory = true;
        cpath = cpath.substring(0, --len);
    } else {
    }
    if (len == 0) {
        cpath = (String) java.security.AccessController.doPrivileged(new sun.security.action.GetPropertyAction('user.dir'));
    }
    cpath = (String) AccessController.doPrivileged(new java.security.PrivilegedAction() {

        public Object run() {
            try {
                File file = new File(cpath);
                String canonical_path = file.getCanonicalPath();
                int ln;
                if (directory && ((ln = canonical_path.length()) == 0 || canonical_path.charAt(ln - 1) != File.separatorChar)) {
                    return canonical_path + File.separator;
                } else {
                    return canonical_path;
                }
            } catch (IOException ioe) {
            }
            return cpath;
        }
    });
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.BasicPermission.init(String)

/**
     * initialize a BasicPermission object. Common to all constructors.
     */
private void init(String name) {
    if (name == null) throw new NullPointerException('name can't be null');
    int len = name.length();
    if (len == 0) {
        throw new IllegalArgumentException('name can't be empty');
    }
    char last = name.charAt(len - 1);
    if (last == '*' && (len == 1 || name.charAt(len - 2) == '.')) {
        wildcard = true;
        if (len == 1) {
            path = '';
        } else {
            path = name.substring(0, len - 1);
        }
    } else {
        path = name;
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.PropertyPermission.init(int)

/**
     * initialize a PropertyPermission object. Common to all constructors.
     * Also called during de-serialization.
     * @param mask the actions mask to use.
     */
private void init(int mask) {
    if ((mask & ALL) != mask) throw new IllegalArgumentException('invalid actions mask');
    if (mask == NONE) throw new IllegalArgumentException('invalid actions mask');
    if (getName() == null) throw new NullPointerException('name can't be null');
    this.mask = mask;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.ObjectName.construct(String)

/**
     * Initializes this {@link ObjectName} from the given string
     * representation.
     * @param name A string representation of the {@link ObjectName}
     * @exception MalformedObjectNameException The string passed as a
     * parameter does not have the right format.
     * @exception NullPointerException The <code>name</code> parameter
     * is null.
     */
private void construct(String name) throws MalformedObjectNameException, NullPointerException {
    if (name == null) throw new NullPointerException('name cannot be null');
    if (name.length() == 0) {
        _canonicalName = '*:*';
        _kp_array = _Empty_property_array;
        _ca_array = _Empty_property_array;
        _domain_length = 1;
        _propertyList = null;
        _domain_pattern = true;
        _property_pattern = true;
        return;
    }
    char[] name_chars = name.toCharArray();
    int len = name_chars.length;
    char[] canonical_chars = new char[len];
    int cname_index = 0;
    int index = 0;
    char c, c1;
    domain_parsing: while (index < len) {
        switch(c = name_chars[index]) {
            case ':':
                _domain_length = index++;
                break domain_parsing;
            case '=':
                int i = ++index;
                while ((i < len) && (name_chars[i++] != ':')) if (i == len) throw new MalformedObjectNameException('Domain part must be specified');
                break;
            case '\n':
                throw new MalformedObjectNameException('Invalid character '\\n' in domain name');
            case '*':
            case '?':
                _domain_pattern = true;
            default:
                index++;
        }
    }
    if (index == len) throw new MalformedObjectNameException('Key properties cannot be empty');
    System.arraycopy(name_chars, 0, canonical_chars, 0, _domain_length);
    canonical_chars[_domain_length] = ':';
    cname_index = _domain_length + 1;
    Property prop;
    HashMap keys_map = new HashMap();
    String[] keys;
    String key_name;
    boolean quoted_value;
    int property_index = 0;
    int in_index;
    int key_index, key_length, value_index, value_length;
    keys = new String[10];
    _kp_array = new Property[10];
    _property_pattern = false;
    while (index < len) {
        c = name_chars[index];
        if (c == '*') {
            if (_property_pattern) throw new MalformedObjectNameException('Cannot have several '*' characters in pattern ' + 'properties'); else {
                _property_pattern = true;
                if ((++index < len) && (name_chars[index] != ',')) throw new MalformedObjectNameException('Invalid character found after '*': end of ' + 'name or ',' expected'); else if (index == len) {
                    if (property_index == 0) {
                        _kp_array = _Empty_property_array;
                        _ca_array = _Empty_property_array;
                        _propertyList = _EmptyPropertyList;
                    }
                    break;
                } else {
                    index++;
                    continue;
                }
            }
        }
        in_index = index;
        key_index = in_index;
        while ((in_index < len) && ((c1 = name_chars[in_index++]) != '=')) switch(c1) {
            case '*':
            case '?':
            case ',':
            case ':':
            case '\n':
                final String ichar = ((c1 == '\n') ? '\\n' : '' + c1);
                throw new MalformedObjectNameException('Invalid character '' + ichar + '' in key part of property');
            default:
                ;
        }
        if (in_index == len) throw new MalformedObjectNameException('Unterminated key property part');
        if (in_index == index) throw new MalformedObjectNameException('Invalid key (empty)');
        value_index = in_index;
        key_length = value_index - key_index - 1;
        if (name_chars[in_index] == '\'') {
            quoted_value = true;
            quoted_value_parsing: while ((++in_index < len) && ((c1 = name_chars[in_index]) != '\'')) {
                if (c1 == '\\') {
                    if (++in_index == len) throw new MalformedObjectNameException('Unterminated quoted value');
                    switch(c1 = name_chars[in_index]) {
                        case '\\':
                        case '\'':
                        case '?':
                        case '*':
                        case 'n':
                            break;
                        default:
                            throw new MalformedObjectNameException('Invalid escape sequence '\\' + c1 + '' in quoted value');
                    }
                } else if (c1 == '\n') {
                    throw new MalformedObjectNameException('Newline in quoted value');
                } else {
                    switch(c1) {
                        case '?':
                        case '*':
                            throw new MalformedObjectNameException('Invalid unescaped reserved character '' + c1 + '' in quoted value');
                        default:
                            break;
                    }
                }
            }
            if (in_index == len) throw new MalformedObjectNameException('Unterminated quoted value'); else value_length = ++in_index - value_index;
        } else {
            quoted_value = false;
            while ((in_index < len) && ((c1 = name_chars[in_index]) != ',')) switch(c1) {
                case '*':
                case '?':
                case '=':
                case ':':
                case ''':
                case '\n':
                    final String ichar = ((c1 == '\n') ? '\\n' : '' + c1);
                    throw new MalformedObjectNameException('Invalid character '' + c1 + '' in value part of property');
                default:
                    in_index++;
            }
            value_length = in_index - value_index;
        }
        if (in_index == len - 1) {
            if (quoted_value) throw new MalformedObjectNameException('Invalid ending character `' + name_chars[in_index] + '''); else throw new MalformedObjectNameException('Invalid ending comma');
        } else in_index++;
        prop = new Property(key_index, key_length, value_length);
        key_name = name.substring(key_index, key_index + key_length);
        if (property_index == keys.length) {
            String[] tmp_string_array = new String[property_index + 10];
            System.arraycopy(keys, 0, tmp_string_array, 0, property_index);
            keys = tmp_string_array;
        }
        keys[property_index] = key_name;
        addProperty(prop, property_index, keys_map, key_name);
        property_index++;
        index = in_index;
    }
    setCanonicalName(name_chars, canonical_chars, keys, keys_map, cname_index, property_index);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.modelmbean.RequiredModelMBean.preRegister(MBeanServer, ObjectName)

/**
     * Allows the MBean to perform any operations it needs before
     * being registered in the MBean server.  If the name of the MBean
     * is not specified, the MBean can provide a name for its
     * registration.  If any exception is raised, the MBean will not be
     * registered in the MBean server.
     * <P>
     * In order to ensure proper run-time semantics of RequireModelMBean,
     * Any subclass of RequiredModelMBean overloading or overriding this
     * method should call <code>super.preRegister(server, name)</code>
     * in its own <code>preRegister</code> implementation.
     * @param server The MBean server in which the MBean will be registered.
     * @param name The object name of the MBean.  This name is null if
     * the name parameter to one of the <code>createMBean</code> or
     * <code>registerMBean</code> methods in the {@link MBeanServer}
     * interface is null.  In that case, this method must return a
     * non-null ObjectName for the new MBean.
     * @return The name under which the MBean is to be registered.
     * This value must not be null.  If the <code>name</code>
     * parameter is not null, it will usually but not necessarily be
     * the returned value.
     * @exception java.lang.Exception This exception will be caught by
     * the MBean server and re-thrown as an
     * {@link javax.management.MBeanRegistrationException
     * MBeanRegistrationException}.
     */
public ObjectName preRegister(MBeanServer server, ObjectName name) throws java.lang.Exception {
    if (name == null) throw new NullPointerException('name of RequiredModelMBean to registered is null');
    this.server = server;
    return name;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.management.relation.RelationNotification.readObject(ObjectInputStream)

/**
     * Deserializes a {@link RelationNotification} from an {@link ObjectInputStream}.
     */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    if (compat) {
        ObjectInputStream.GetField fields = in.readFields();
        newRoleValue = (List) fields.get('myNewRoleValue', null);
        if (fields.defaulted('myNewRoleValue')) {
            throw new NullPointerException('newRoleValue');
        }
        oldRoleValue = (List) fields.get('myOldRoleValue', null);
        if (fields.defaulted('myOldRoleValue')) {
            throw new NullPointerException('oldRoleValue');
        }
        relationId = (String) fields.get('myRelId', null);
        if (fields.defaulted('myRelId')) {
            throw new NullPointerException('relationId');
        }
        relationObjName = (ObjectName) fields.get('myRelObjName', null);
        if (fields.defaulted('myRelObjName')) {
            throw new NullPointerException('relationObjName');
        }
        relationTypeName = (String) fields.get('myRelTypeName', null);
        if (fields.defaulted('myRelTypeName')) {
            throw new NullPointerException('relationTypeName');
        }
        roleName = (String) fields.get('myRoleName', null);
        if (fields.defaulted('myRoleName')) {
            throw new NullPointerException('roleName');
        }
        unregisterMBeanList = (List) fields.get('myUnregMBeanList', null);
        if (fields.defaulted('myUnregMBeanList')) {
            throw new NullPointerException('unregisterMBeanList');
        }
    } else {
        in.defaultReadObject();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.datatransfer.SystemFlavorMap.addFlavorForUnencodedNative(String, DataFlavor)

/**
     * Adds a mapping from a single <code>String</code> native to a single
     * <code>DataFlavor</code>. Unlike <code>getFlavorsForNative</code>, the
     * mapping will only be established in one direction, and the native will
     * not be encoded. To establish a two-way mapping, call
     * <code>addUnencodedNativeForFlavor</code> as well. The new mapping will
     * be of lower priority than any existing mapping.
     * This method has no effect if a mapping from the specified
     * <code>String</code> native to the specified or equal
     * <code>DataFlavor</code> already exists.
     * @param nat the <code>String</code> native key for the mapping
     * @param flav the <code>DataFlavor</code> value for the mapping
     * @throws NullPointerException if nat or flav is <code>null</code>
     * @see #addUnencodedNativeForFlavor
     * @since 1.4
     */
public synchronized void addFlavorForUnencodedNative(String nat, DataFlavor flav) {
    if (nat == null || flav == null) {
        throw new NullPointerException('null arguments not permitted');
    }
    List flavors = (List) nativeToFlavor.get(nat);
    if (flavors == null) {
        flavors = new ArrayList(1);
        nativeToFlavor.put(nat, flavors);
    } else if (flavors.contains(flav)) {
        return;
    }
    flavors.add(flav);
    getFlavorsForNativeCache.remove(nat);
    getFlavorsForNativeCache.remove(null);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.datatransfer.SystemFlavorMap.addUnencodedNativeForFlavor(DataFlavor, String)

/**
     * Adds a mapping from the specified <code>DataFlavor</code> (and all
     * <code>DataFlavor</code>s equal to the specified <code>DataFlavor</code>)
     * to the specified <code>String</code> native.
     * Unlike <code>getNativesForFlavor</code>, the mapping will only be
     * established in one direction, and the native will not be encoded. To
     * establish a two-way mapping, call
     * <code>addFlavorForUnencodedNative</code> as well. The new mapping will 
     * be of lower priority than any existing mapping.
     * This method has no effect if a mapping from the specified or equal
     * <code>DataFlavor</code> to the specified <code>String</code> native
     * already exists.
     * @param flav the <code>DataFlavor</code> key for the mapping
     * @param nat the <code>String</code> native value for the mapping
     * @throws NullPointerException if flav or nat is <code>null</code>
     * @see #addFlavorForUnencodedNative
     * @since 1.4
     */
public synchronized void addUnencodedNativeForFlavor(DataFlavor flav, String nat) {
    if (flav == null || nat == null) {
        throw new NullPointerException('null arguments not permitted');
    }
    List natives = (List) flavorToNative.get(flav);
    if (natives == null) {
        natives = new ArrayList(1);
        flavorToNative.put(flav, natives);
    } else if (natives.contains(nat)) {
        return;
    }
    natives.add(nat);
    getNativesForFlavorCache.remove(flav);
    getNativesForFlavorCache.remove(null);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.datatransfer.SystemFlavorMap.setFlavorsForNative(String, DataFlavor[])

/**
     * Discards the current mappings for the specified <code>String</code>
     * native, and creates new mappings to the specified
     * <code>DataFlavor</code>s. Unlike <code>getFlavorsForNative</code>, the
     * mappings will only be established in one direction, and the natives need
     * not be encoded. To establish two-way mappings, call
     * <code>setNativesForFlavor</code> as well. The first
     * <code>DataFlavor</code> in the array will represent the highest priority
     * mapping. Subsequent <code>DataFlavor</code>s will represent mappings of
     * decreasing priority.
     * If the array contains several elements that reference equal
     * <code>DataFlavor</code>s, this method will establish new mappings
     * for the first of those elements and ignore the rest of them.
     * It is recommended that client code not reset mappings established by the
     * data transfer subsystem. This method should only be used for
     * application-level mappings.
     * @param nat the <code>String</code> native key for the mappings
     * @param flavors the <code>DataFlavor</code> values for the mappings
     * @throws NullPointerException if nat or flavors is <code>null</code>
     *         or if flavors contains <code>null</code> elements
     * @see #setNativesForFlavor
     * @since 1.4
     */
public synchronized void setFlavorsForNative(String nat, DataFlavor[] flavors) {
    if (nat == null || flavors == null) {
        throw new NullPointerException('null arguments not permitted');
    }
    nativeToFlavor.remove(nat);
    for (int i = 0; i < flavors.length; i++) {
        addFlavorForUnencodedNative(nat, flavors[i]);
    }
    disabledMappingGenerationKeys.add(nat);
    getFlavorsForNativeCache.remove(nat);
    getFlavorsForNativeCache.remove(null);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.datatransfer.SystemFlavorMap.setNativesForFlavor(DataFlavor, String[])

/**
     * Discards the current mappings for the specified <code>DataFlavor</code>
     * and all <code>DataFlavor</code>s equal to the specified
     * <code>DataFlavor</code>, and creates new mappings to the 
     * specified <code>String</code> natives.
     * Unlike <code>getNativesForFlavor</code>, the mappings will only be
     * established in one direction, and the natives will not be encoded. To
     * establish two-way mappings, call <code>setFlavorsForNative</code>
     * as well. The first native in the array will represent the highest
     * priority mapping. Subsequent natives will represent mappings of
     * decreasing priority.
     * If the array contains several elements that reference equal
     * <code>String</code> natives, this method will establish new mappings
     * for the first of those elements and ignore the rest of them.
     * It is recommended that client code not reset mappings established by the
     * data transfer subsystem. This method should only be used for
     * application-level mappings.
     * @param flav the <code>DataFlavor</code> key for the mappings
     * @param natives the <code>String</code> native values for the mappings
     * @throws NullPointerException if flav or natives is <code>null</code>
     *         or if natives contains <code>null</code> elements
     * @see #setFlavorsForNative
     * @since 1.4
     */
public synchronized void setNativesForFlavor(DataFlavor flav, String[] natives) {
    if (flav == null || natives == null) {
        throw new NullPointerException('null arguments not permitted');
    }
    flavorToNative.remove(flav);
    for (int i = 0; i < natives.length; i++) {
        addUnencodedNativeForFlavor(flav, natives[i]);
    }
    disabledMappingGenerationKeys.add(flav);
    getNativesForFlavorCache.remove(flav);
    getNativesForFlavorCache.remove(null);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.swing.plaf.basic.BasicTreeUI.installUI(JComponent)

public void installUI(JComponent c) {
    if (c == null) {
        throw new NullPointerException('null component passed to BasicTreeUI.installUI()');
    }
    tree = (JTree) c;
    prepareForUIInstall();
    installDefaults();
    installKeyboardActions();
    installComponents();
    installListeners();
    completeUIInstall();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.Font.getFamily(Locale)

/**
     * Returns the family name of this <code>Font</code>, localized for
     * the specified locale.
     * The family name of a font is font specific. Two fonts such as 
     * Helvetica Italic and Helvetica Bold have the same family name, 
     * <i>Helvetica</i>, whereas their font face names are 
     * <i>Helvetica Bold</i> and <i>Helvetica Italic</i>. The list of 
     * available family names may be obtained by using the 
     * {@link GraphicsEnvironment#getAvailableFontFamilyNames()} method.
     * Use <code>getFontName</code> to get the font face name of the font.
     * @param l locale for which to get the family name
     * @return a <code>String</code> representing the family name of the
     *  font, localized for the specified locale.
     * @see #getFontName
     * @see java.util.Locale
     * @since 1.2
     */
public String getFamily(Locale l) {
    if (l == null) {
        throw new NullPointerException('null locale doesn't mean default');
    }
    return getFont2D().getFamilyName(l);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.Font.getFontName(Locale)

/**
     * Returns the font face name of the <code>Font</code>, localized
     * for the specified locale. For example, Helvetica Fett could be
     * returned as the font face name.
     * Use <code>getFamily</code> to get the family name of the font.
     * @param l a locale for which to get the font face name
     * @return a <code>String</code> representing the font face name,
     *  localized for the specified locale.
     * @see #getFamily
     * @see java.util.Locale
     */
public String getFontName(Locale l) {
    if (l == null) {
        throw new NullPointerException('null locale doesn't mean default');
    }
    return getFont2D().getFontName(l);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.net.DatagramPacket.setData(byte[])

/** 
     * Set the data buffer for this packet. With the offset of 
     * this DatagramPacket set to 0, and the length set to
     * the length of <code>buf</code>.
     * @param buf the buffer to set for this packet.
     * @exception NullPointerException if the argument is null.
     * @see #getLength
     * @see #getData
     * @since JDK1.1 
     */
public synchronized void setData(byte[] buf) {
    if (buf == null) {
        throw new NullPointerException('null packet buffer');
    }
    this.buf = buf;
    this.offset = 0;
    this.length = buf.length;
    this.bufLength = buf.length;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.BufferedImage.getProperty(String)

/**
     * Returns a property of the image by name.
     * @param name the property name
     * @return an <code>Object</code> that is the property referred to by
     *          the specified <code>name</code>. 
     * @throws <code>NullPointerException<code> if the property name is null.
     */
public Object getProperty(String name) {
    if (name == null) {
        throw new NullPointerException('null property name is not allowed');
    }
    if (properties == null) {
        properties = new Hashtable();
    }
    Object o = properties.get(name);
    if (o == null) {
        o = java.awt.Image.UndefinedProperty;
    }
    return o;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.Graphics.getClipBounds(Rectangle)

/**
     * Returns the bounding rectangle of the current clipping area.
     * The coordinates in the rectangle are relative to the coordinate
     * system origin of this graphics context.  This method differs
     * from {@link #getClipBounds() getClipBounds} in that an existing 
     * rectangle is used instead of allocating a new one.  
     * This method refers to the user clip, which is independent of the
     * clipping associated with device bounds and window visibility.
     *  If no clip has previously been set, or if the clip has been 
     * cleared using <code>setClip(null)</code>, this method returns the 
     * specified <code>Rectangle</code>.
     * @param  r    the rectangle where the current clipping area is
     *              copied to.  Any current values in this rectangle are
     *              overwritten.
     * @return      the bounding rectangle of the current clipping area.
     */
public Rectangle getClipBounds(Rectangle r) {
    Rectangle clipRect = getClipBounds();
    if (clipRect != null) {
        r.x = clipRect.x;
        r.y = clipRect.y;
        r.width = clipRect.width;
        r.height = clipRect.height;
    } else if (r == null) {
        throw new NullPointerException('null rectangle parameter');
    }
    return r;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.SecurityManager.checkPackageAccess(String)

/**
     * Throws a <code>SecurityException</code> if the
     * calling thread is not allowed to access the package specified by
     * the argument.
     * This method is used by the <code>loadClass</code> method of class
     * loaders.
     * This method first gets a list of
     * restricted packages by obtaining a comma-separated list from
     * a call to
     * <code>java.security.Security.getProperty('package.access')</code>,
     * and checks to see if <code>pkg</code> starts with or equals
     * any of the restricted packages. If it does, then
     * <code>checkPermission</code> gets called with the
     * <code>RuntimePermission('accessClassInPackage.'+pkg)</code>
     * permission.
     * If this method is overridden, then
     * <code>super.checkPackageAccess</code> should be called
     * as the first line in the overridden method.
     * @param      pkg   the package name.
     * @exception  SecurityException  if the calling thread does not have
     *             permission to access the specified package.
     * @exception  NullPointerException if the package name argument is
     *             <code>null</code>.
     * @see        java.lang.ClassLoader#loadClass(java.lang.String, boolean)
     *  loadClass
     * @see        java.security.Security#getProperty getProperty
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
public void checkPackageAccess(String pkg) {
    if (pkg == null) {
        throw new NullPointerException('package name can't be null');
    }
    String[] pkgs;
    synchronized (packageAccessLock) {
        if (!packageAccessValid) {
            String tmpPropertyStr = (String) AccessController.doPrivileged(new PrivilegedAction() {

                public Object run() {
                    return java.security.Security.getProperty('package.access');
                }
            });
            packageAccess = getPackages(tmpPropertyStr);
            packageAccessValid = true;
        }
        pkgs = packageAccess;
    }
    for (int i = 0; i < pkgs.length; i++) {
        if (pkg.startsWith(pkgs[i]) || pkgs[i].equals(pkg + '.')) {
            checkPermission(new RuntimePermission('accessClassInPackage.' + pkg));
            break;
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.SecurityManager.checkPackageDefinition(String)

/**
     * Throws a <code>SecurityException</code> if the
     * calling thread is not allowed to define classes in the package
     * specified by the argument.
     * This method is used by the <code>loadClass</code> method of some
     * class loaders.
     * This method first gets a list of restricted packages by
     * obtaining a comma-separated list from a call to
     * <code>java.security.Security.getProperty('package.definition')</code>,
     * and checks to see if <code>pkg</code> starts with or equals
     * any of the restricted packages. If it does, then
     * <code>checkPermission</code> gets called with the
     * <code>RuntimePermission('defineClassInPackage.'+pkg)</code>
     * permission.
     * If this method is overridden, then
     * <code>super.checkPackageDefinition</code> should be called
     * as the first line in the overridden method.
     * @param      pkg   the package name.
     * @exception  SecurityException  if the calling thread does not have
     *             permission to define classes in the specified package.
     * @see        java.lang.ClassLoader#loadClass(java.lang.String, boolean)
     * @see        java.security.Security#getProperty getProperty
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
public void checkPackageDefinition(String pkg) {
    if (pkg == null) {
        throw new NullPointerException('package name can't be null');
    }
    String[] pkgs;
    synchronized (packageDefinitionLock) {
        if (!packageDefinitionValid) {
            String tmpPropertyStr = (String) AccessController.doPrivileged(new PrivilegedAction() {

                public Object run() {
                    return java.security.Security.getProperty('package.definition');
                }
            });
            packageDefinition = getPackages(tmpPropertyStr);
            packageDefinitionValid = true;
        }
        pkgs = packageDefinition;
    }
    for (int i = 0; i < pkgs.length; i++) {
        if (pkg.startsWith(pkgs[i]) || pkgs[i].equals(pkg + '.')) {
            checkPermission(new RuntimePermission('defineClassInPackage.' + pkg));
            break;
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.print.Book.setPage(int, Printable, PageFormat)

/**
     * Sets the <code>PageFormat</code> and the <code>Painter</code> for a
     * specified page number.
     * @param pageIndex the zero based index of the page whose
     *                  painter and format is altered
     * @param painter   the <code>Printable</code> instance that
     *                  renders the page
     * @param page      the size and orientation of the page
     * @throws IndexOutOfBoundsException if the specified
     *  page is not already in this <code>Book</code> 
     * @throws NullPointerException if the <code>painter</code> or
     *  <code>page</code> argument is <code>null</code>
     */
public void setPage(int pageIndex, Printable painter, PageFormat page) throws IndexOutOfBoundsException {
    if (painter == null) {
        throw new NullPointerException('painter is null');
    }
    if (page == null) {
        throw new NullPointerException('page is null');
    }
    mPages.setElementAt(new BookPage(painter, page), pageIndex);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.PopupMenu.show(Component, int, int)

/**
     * Shows the popup menu at the x, y position relative to an origin
     * component.
     * The origin component must be contained within the component
     * hierarchy of the popup menu's parent.  Both the origin and the parent 
     * must be showing on the screen for this method to be valid.
     * If this <code>PopupMenu</code> is being used as a <code>Menu</code>
     * (i.e., it has a non-<code>Component</code> parent),
     * then you cannot call this method on the <code>PopupMenu</code>.
     * @param origin the component which defines the coordinate space
     * @param x the x coordinate position to popup the menu
     * @param y the y coordinate position to popup the menu
     * @exception NullPointerException  if the parent is <code>null</code>
     * @exception IllegalArgumentException  if this <code>PopupMenu</code>
     *                has a non-<code>Component</code> parent
     * @exception IllegalArgumentException if the origin is not in the
     *                parent's heirarchy
     * @exception RuntimeException if the parent is not showing on screen
     */
public void show(Component origin, int x, int y) {
    MenuContainer localParent = parent;
    if (localParent == null) {
        throw new NullPointerException('parent is null');
    }
    if (!(localParent instanceof Component)) {
        throw new IllegalArgumentException('PopupMenus with non-Component parents cannot be shown');
    }
    Component compParent = (Component) localParent;
    if (compParent != origin && compParent instanceof Container && !((Container) compParent).isAncestorOf(origin)) {
        throw new IllegalArgumentException('origin not in parent's hierarchy');
    }
    if (compParent.getPeer() == null || !compParent.isShowing()) {
        throw new RuntimeException('parent not showing on screen');
    }
    if (peer == null) {
        addNotify();
    }
    synchronized (getTreeLock()) {
        if (peer != null) {
            ((PopupMenuPeer) peer).show(new Event(origin, 0, Event.MOUSE_DOWN, x, y, 0, 0));
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.AccessControlContext.checkPermission(Permission)

/** 
     * Determines whether the access request indicated by the
     * specified permission should be allowed or denied, based on
     * the security policy currently in effect, and the context in
     * this object.
     * This method quietly returns if the access request
     * is permitted, or throws a suitable AccessControlException otherwise. 
     * @param perm the requested permission.
     * @exception AccessControlException if the specified permission
     * is not permitted, based on the current security policy and the
     * context encapsulated by this object.
     * @exception NullPointerException if the permission to check for is null.
     */
public void checkPermission(Permission perm) throws AccessControlException {
    if (perm == null) {
        throw new NullPointerException('permission can't be null');
    }
    if (getDebug() != null) {
        if (Debug.isOn('stack')) Thread.currentThread().dumpStack();
        if (Debug.isOn('domain')) {
            if (context == null) {
                debug.println('domain (context is null)');
            } else {
                for (int i = 0; i < context.length; i++) {
                    debug.println('domain ' + i + ' ' + context[i]);
                }
            }
        }
    }
    if (context == null) return;
    for (int i = 0; i < context.length; i++) {
        if (context[i] != null && !context[i].implies(perm)) {
            if (debug != null) {
                debug.println('access denied ' + perm);
                if (Debug.isOn('failure')) {
                    Thread.currentThread().dumpStack();
                    final ProtectionDomain pd = context[i];
                    final Debug db = debug;
                    AccessController.doPrivileged(new PrivilegedAction() {

                        public Object run() {
                            db.println('domain that failed ' + pd);
                            return null;
                        }
                    });
                }
            }
            throw new AccessControlException('access denied ' + perm, perm);
        }
    }
    if (debug != null) debug.println('access allowed ' + perm);
    return;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.standard.PrinterStateReasons.put(PrinterStateReason, Severity)

/**
     * Adds the given printer state reason to this printer state reasons 
     * attribute, associating it with the given severity level. If this  
     * printer state reasons attribute previously contained a mapping for the  
     * given printer state reason, the old value is replaced. 
     * @param  reason    Printer state reason. This must be an instance of
     *                    class {@link PrinterStateReason PrinterStateReason}.
     * @param  severity  Severity of the printer state reason. This must be
     *                      an instance of class {@link Severity Severity}.
     * @return  Previous severity associated with the given printer state
     *          reason, or <tt>null</tt> if the given printer state reason was 
     *          not present. 
     * @throws  NullPointerException
     *     (unchecked exception) Thrown if <CODE>reason</CODE> is null or 
     *     <CODE>severity</CODE> is null. 
     * @throws  ClassCastException
     *     (unchecked exception) Thrown if <CODE>reason</CODE> is not an 
     *   instance of class {@link PrinterStateReason PrinterStateReason} or if 
     *     <CODE>severity</CODE> is not an instance of class {@link Severity 
     *     Severity}. 
     */
public Severity put(PrinterStateReason reason, Severity severity) {
    if (reason == null) {
        throw new NullPointerException('reason is null');
    }
    if (severity == null) {
        throw new NullPointerException('severity is null');
    }
    return super.put((PrinterStateReason) reason, (Severity) severity);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.regex.Matcher.replaceFirst(String)

/**
     * Replaces the first subsequence of the input sequence that matches the
     * pattern with the given replacement string.
     *  This method first resets this matcher.  It then scans the input
     * sequence looking for a match of the pattern.  Characters that are not
     * part of the match are appended directly to the result string; the match
     * is replaced in the result by the replacement string.  The replacement
     * string may contain references to captured subsequences as in the {@link
     * #appendReplacement appendReplacement} method.
     *  Given the regular expression <tt>dog</tt>, the input
     * <tt>'zzzdogzzzdogzzz'</tt>, and the replacement string
     * <tt>'cat'</tt>, an invocation of this method on a matcher for that
     * expression would yield the string <tt>'zzzcatzzzdogzzz'</tt>.  
     *  Invoking this method changes this matcher's state.  If the matcher
     * is to be used in further matching operations then it should first be
     * reset.  
     * @param  replacement
     *         The replacement string
     * @return  The string constructed by replacing the first matching
     *          subsequence by the replacement string, substituting captured
     * @throws  NullPointerException  if <code>replacement</code> is null.
     *          subsequences as needed
     */
public String replaceFirst(String replacement) {
    if (replacement == null) throw new NullPointerException('replacement');
    StringBuffer sb = new StringBuffer();
    reset();
    if (find()) appendReplacement(sb, replacement);
    appendTail(sb);
    return sb.toString();
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.security.auth.kerberos.ServicePermission.init(String, int)

/**
     * Initialize the ServicePermission object.
     */
private void init(String servicePrincipal, int mask) {
    if (servicePrincipal == null) throw new NullPointerException('service principal can't be null');
    if ((mask & ALL) != mask) throw new IllegalArgumentException('invalid actions mask');
    this.mask = mask;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.beans.beancontext.BeanContextServicesSupport.hasService(Class)

/**
     * has a service, which may be delegated
     */
public synchronized boolean hasService(Class serviceClass) {
    if (serviceClass == null) throw new NullPointerException('serviceClass');
    synchronized (BeanContext.globalHierarchyLock) {
        if (services.containsKey(serviceClass)) return true;
        BeanContextServices bcs = null;
        try {
            bcs = (BeanContextServices) getBeanContext();
        } catch (ClassCastException cce) {
            return false;
        }
        return bcs == null ? false : bcs.hasService(serviceClass);
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.standard.PrinterStateReasons.printerStateReasonSet(Severity)

/**
     * Obtain an unmodifiable set view of the individual printer state reason 
     * attributes at the given severity level in this PrinterStateReasons 
     * attribute. Each element in the set view is a {@link PrinterStateReason 
     * PrinterStateReason} object. The only elements in the set view are the 
     * {@link PrinterStateReason PrinterStateReason} objects that map to the 
     * given severity value. The set view is backed by this
     * PrinterStateReasons attribute, so changes to this PrinterStateReasons
     * attribute are reflected  in the set view.
     * The set view does not support element insertion or 
     * removal. The set view's iterator does not support element removal. 
     * @param  severity  Severity level.
     * @return  Set view of the individual {@link PrinterStateReason
     *          PrinterStateReason} attributes at the given {@link Severity 
     *          Severity} level. 
     * @exception  NullPointerException
     *     (unchecked exception) Thrown if <CODE>severity</CODE> is null.
     */
public Set<PrinterStateReason> printerStateReasonSet(Severity severity) {
    if (severity == null) {
        throw new NullPointerException('severity is null');
    }
    return new PrinterStateReasonSet(severity, entrySet());
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Scanner.makeReadable(InputStream, String)

private static Readable makeReadable(InputStream source, String charsetName) {
    if (source == null) throw new NullPointerException('source');
    InputStreamReader isr = null;
    try {
        isr = new InputStreamReader(source, charsetName);
    } catch (UnsupportedEncodingException uee) {
        IllegalArgumentException iae = new IllegalArgumentException();
        iae.initCause(uee);
        throw iae;
    }
    return isr;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Scanner.makeReadable(ReadableByteChannel)

private static Readable makeReadable(ReadableByteChannel source) {
    if (source == null) throw new NullPointerException('source');
    String defaultCharsetName = java.nio.charset.Charset.defaultCharset().name();
    return Channels.newReader(source, java.nio.charset.Charset.defaultCharset().name());
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.util.Scanner.makeReadable(ReadableByteChannel, String)

private static Readable makeReadable(ReadableByteChannel source, String charsetName) {
    if (source == null) throw new NullPointerException('source');
    if (!Charset.isSupported(charsetName)) throw new IllegalArgumentException(charsetName);
    return Channels.newReader(source, charsetName);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.AffineTransformOp.filter(BufferedImage, BufferedImage)

/**
     * Transforms the source <CODE>BufferedImage</CODE> and stores the results 
     * in the destination <CODE>BufferedImage</CODE>.  
     * If the color models for the two images do not match, a color
     * conversion into the destination color model is performed.
     * If the destination image is null,
     * a <CODE>BufferedImage</CODE> is created with the source 
     * <CODE>ColorModel</CODE>.
     * The coordinates of the rectangle returned by 
     * <code>getBounds2D(BufferedImage)</code>
     * are not necessarily the same as the coordinates of the 
     * <code>BufferedImage</code> returned by this method.  If the
     * upper-left corner coordinates of the rectangle are 
     * negative then this part of the rectangle is not drawn.  If the
     * upper-left corner coordinates of the  rectangle are positive 
     * then the filtered image is drawn at that position in the
     * destination <code>BufferedImage</code>.
     * An <CODE>IllegalArgumentException</CODE> is thrown if the source is
     * the same as the destination.
     * @param src The <CODE>BufferedImage</CODE> to transform.
     * @param dst The <CODE>BufferedImage</CODE> in which to store the results 
     * of the transformation.
     * @return The filtered <CODE>BufferedImage</CODE>.
     * @throws IllegalArgumentException if <code>src</code> and 
     *         <code>dst</code> are the same
     * @throws ImagingOpException if the image cannot be transformed
     *         because of a data-processing error that might be 
     *         caused by an invalid image format, tile format, or
     *         image-processing operation, or any other unsupported 
     *         operation.
     */
public final BufferedImage filter(BufferedImage src, BufferedImage dst) {
    if (src == null) {
        throw new NullPointerException('src image is null');
    }
    if (src == dst) {
        throw new IllegalArgumentException('src image cannot be the ' + 'same as the dst image');
    }
    boolean needToConvert = false;
    ColorModel srcCM = src.getColorModel();
    ColorModel dstCM;
    BufferedImage origDst = dst;
    if (dst == null) {
        dst = createCompatibleDestImage(src, null);
        dstCM = srcCM;
        origDst = dst;
    } else {
        dstCM = dst.getColorModel();
        if (srcCM.getColorSpace().getType() != dstCM.getColorSpace().getType()) {
            int type = xform.getType();
            boolean needTrans = ((type & (xform.TYPE_MASK_ROTATION | xform.TYPE_GENERAL_TRANSFORM)) != 0);
            if (!needTrans && type != xform.TYPE_TRANSLATION && type != xform.TYPE_IDENTITY) {
                double[] mtx = new double[4];
                xform.getMatrix(mtx);
                needTrans = (mtx[0] != (int) mtx[0] || mtx[3] != (int) mtx[3]);
            }
            if (needTrans && srcCM.getTransparency() == Transparency.OPAQUE) {
                ColorConvertOp ccop = new ColorConvertOp(hints);
                BufferedImage tmpSrc = null;
                int sw = src.getWidth();
                int sh = src.getHeight();
                if (dstCM.getTransparency() == Transparency.OPAQUE) {
                    tmpSrc = new BufferedImage(sw, sh, BufferedImage.TYPE_INT_ARGB);
                } else {
                    WritableRaster r = dstCM.createCompatibleWritableRaster(sw, sh);
                    tmpSrc = new BufferedImage(dstCM, r, dstCM.isAlphaPremultiplied(), null);
                }
                src = ccop.filter(src, tmpSrc);
            } else {
                needToConvert = true;
                dst = createCompatibleDestImage(src, null);
            }
        }
    }
    if (interpolationType != TYPE_NEAREST_NEIGHBOR && dst.getColorModel() instanceof IndexColorModel) {
        dst = new BufferedImage(dst.getWidth(), dst.getHeight(), BufferedImage.TYPE_INT_ARGB);
    }
    if (ImagingLib.filter(this, src, dst) == null) {
        throw new ImagingOpException('Unable to transform src image');
    }
    if (needToConvert) {
        ColorConvertOp ccop = new ColorConvertOp(hints);
        ccop.filter(dst, origDst);
    } else if (origDst != dst) {
        java.awt.Graphics2D g = origDst.createGraphics();
        try {
            g.setComposite(AlphaComposite.Src);
            g.drawImage(dst, 0, 0, null);
        } finally {
            g.dispose();
        }
    }
    return origDst;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.AffineTransformOp.filter(Raster, WritableRaster)

/**
     * Transforms the source <CODE>Raster</CODE> and stores the results in
     * the destination <CODE>Raster</CODE>.  This operation performs the
     * transform band by band.
     * If the destination <CODE>Raster</CODE> is null, a new 
     * <CODE>Raster</CODE> is created.
     * An <CODE>IllegalArgumentException</CODE> may be thrown if the source is
     * the same as the destination or if the number of bands in
     * the source is not equal to the number of bands in the
     * destination.
     * The coordinates of the rectangle returned by 
     * <code>getBounds2D(Raster)</code>
     * are not necessarily the same as the coordinates of the
     * <code>WritableRaster</code> returned by this method.  If the
     * upper-left corner coordinates of rectangle are negative then
     * this part of the rectangle is not drawn.  If the coordinates 
     * of the rectangle are positive then the filtered image is drawn at
     * that position in the destination <code>Raster</code>.
     * @param src The <CODE>Raster</CODE> to transform.
     * @param dst The <CODE>Raster</CODE> in which to store the results of the 
     * transformation.
     * @return The transformed <CODE>Raster</CODE>.
     * @throws ImagingOpException if the raster cannot be transformed
     *         because of a data-processing error that might be
     *         caused by an invalid image format, tile format, or
     *         image-processing operation, or any other unsupported
     *         operation.
     */
public final WritableRaster filter(Raster src, WritableRaster dst) {
    if (src == null) {
        throw new NullPointerException('src image is null');
    }
    if (dst == null) {
        dst = createCompatibleDestRaster(src);
    }
    if (src == dst) {
        throw new IllegalArgumentException('src image cannot be the ' + 'same as the dst image');
    }
    if (src.getNumBands() != dst.getNumBands()) {
        throw new IllegalArgumentException('Number of src bands (' + src.getNumBands() + ') does not match number of ' + ' dst bands (' + dst.getNumBands() + ')');
    }
    if (ImagingLib.filter(this, src, dst) == null) {
        throw new ImagingOpException('Unable to transform src image');
    }
    return dst;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.awt.image.ConvolveOp.filter(BufferedImage, BufferedImage)

/**
     * Performs a convolution on BufferedImages.  Each component of the
     * source image will be convolved (including the alpha component, if
     * present).
     * If the color model in the source image is not the same as that
     * in the destination image, the pixels will be converted
     * in the destination.  If the destination image is null,
     * a BufferedImage will be created with the source ColorModel.
     * The IllegalArgumentException may be thrown if the source is the
     * same as the destination.
     * @param src the source <code>BufferedImage</code> to filter
     * @param dst the destination <code>BufferedImage</code> for the 
     *        filtered <code>src</code>
     * @return the filtered <code>BufferedImage</code>
     * @throws NullPointerException if <code>src</code> is <code>null</code>
     * @throws IllegalArgumentException if <code>src</code> equals
     *         <code>dst</code>
     * @throws ImagingOpException if <code>src</code> cannot be filtered
     */
public final BufferedImage filter(BufferedImage src, BufferedImage dst) {
    if (src == null) {
        throw new NullPointerException('src image is null');
    }
    if (src == dst) {
        throw new IllegalArgumentException('src image cannot be the ' + 'same as the dst image');
    }
    boolean needToConvert = false;
    ColorModel srcCM = src.getColorModel();
    ColorModel dstCM;
    BufferedImage origDst = dst;
    if (srcCM instanceof IndexColorModel) {
        IndexColorModel icm = (IndexColorModel) srcCM;
        src = icm.convertToIntDiscrete(src.getRaster(), false);
        srcCM = src.getColorModel();
    }
    if (dst == null) {
        dst = createCompatibleDestImage(src, null);
        dstCM = srcCM;
        origDst = dst;
    } else {
        dstCM = dst.getColorModel();
        if (srcCM.getColorSpace().getType() != dstCM.getColorSpace().getType()) {
            needToConvert = true;
            dst = createCompatibleDestImage(src, null);
            dstCM = dst.getColorModel();
        } else if (dstCM instanceof IndexColorModel) {
            dst = createCompatibleDestImage(src, null);
            dstCM = dst.getColorModel();
        }
    }
    if (ImagingLib.filter(this, src, dst) == null) {
        throw new ImagingOpException('Unable to convolve src image');
    }
    if (needToConvert) {
        ColorConvertOp ccop = new ColorConvertOp(hints);
        ccop.filter(dst, origDst);
    } else if (origDst != dst) {
        java.awt.Graphics2D g = origDst.createGraphics();
        try {
            g.drawImage(dst, 0, 0, null);
        } finally {
            g.dispose();
        }
    }
    return origDst;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.Throwable.setStackTrace(StackTraceElement[])

/**
     * Sets the stack trace elements that will be returned by
     * {@link #getStackTrace()} and printed by {@link #printStackTrace()}
     * and related methods.
     * This method, which is designed for use by RPC frameworks and other
     * advanced systems, allows the client to override the default
     * stack trace that is either generated by {@link #fillInStackTrace()}
     * when a throwable is constructed or deserialized when a throwable is
     * read from a serialization stream.
     * @param   stackTrace the stack trace elements to be associated with
     * this <code>Throwable</code>.  The specified array is copied by this
     * call; changes in the specified array after the method invocation
     * returns will have no affect on this <code>Throwable</code>'s stack
     * trace.
     * @throws NullPointerException if <code>stackTrace</code> is
     *         <code>null</code>, or if any of the elements of
     *         <code>stackTrace</code> are <code>null</code>
     * @since  1.4
     */
public void setStackTrace(StackTraceElement[] stackTrace) {
    StackTraceElement[] defensiveCopy = (StackTraceElement[]) stackTrace.clone();
    for (int i = 0; i < defensiveCopy.length; i++) if (defensiveCopy[i] == null) throw new NullPointerException('stackTrace[' + i + ']');
    this.stackTrace = defensiveCopy;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.SchemaFactory.getFeature(String)

/**
     * Look up the value of a feature flag.
     * The feature name is any fully-qualified URI.  It is
     * possible for a {@link SchemaFactory} to recognize a feature name but
     * temporarily be unable to return its value.
     * Implementors are free (and encouraged) to invent their own features,
     * using names built on their own URIs.
     * @param name The feature name, which is a non-null fully-qualified URI.
     * @return The current value of the feature (true or false).
     * @exception org.xml.sax.SAXNotRecognizedException If the feature
     *            value can't be assigned or retrieved.
     * @exception org.xml.sax.SAXNotSupportedException When the
     *            {@link SchemaFactory} recognizes the feature name but 
     *            cannot determine its value at this time.
     * @exception NullPointerException
     *              if the name parameter is null.
     * @see #setFeature(String, boolean)
     */
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException('the name parameter is null');
    }
    throw new SAXNotRecognizedException(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.SchemaFactory.getProperty(String)

/**
     * Look up the value of a property.
     * The property name is any fully-qualified URI.  It is
     * possible for a {@link SchemaFactory} to recognize a property name but
     * temporarily be unable to return its value.
     * {@link SchemaFactory}s are not required to recognize any specific
     * property names.
     * Implementors are free (and encouraged) to invent their own properties,
     * using names built on their own URIs.
     * @param name The property name, which is a non-null fully-qualified URI.
     * @return The current value of the property.
     * @exception org.xml.sax.SAXNotRecognizedException If the property
     *            value can't be assigned or retrieved.
     * @exception org.xml.sax.SAXNotSupportedException When the
     *            XMLReader recognizes the property name but 
     *            cannot determine its value at this time.
     * @exception NullPointerException
     *              if the name parameter is null.
     * @see #setProperty(String, Object)
     */
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException('the name parameter is null');
    }
    throw new SAXNotRecognizedException(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.SchemaFactory.setFeature(String, boolean)

/**
     * Set the value of a feature flag.
     * 
     * Feature can be used to control the way a {@link SchemaFactory}
     * parses schemas, although {@link SchemaFactory}s are not required
     * to recognize any specific feature names.
     * The feature name is any fully-qualified URI.  It is
     * possible for a {@link SchemaFactory} to expose a feature value but
     * to be unable to change the current value.
  * All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
  * When the feature is:
  * <ul>
  *   <li>
  *     <code>true</code>: the implementation will limit XML processing to conform to implementation limits.
  *     Examples include enity expansion limits and XML Schema constructs that would consume large amounts of resources.
  *     If XML processing is limited for security reasons, it will be reported via a call to the registered
  *     {@link ErrorHandler#fatalError(SAXParseException exception)}.
  *     See {@link  #setErrorHandler(ErrorHandler errorHandler)}.
  *   </li>
  *   <li>
  *     <code>false</code>: the implementation will processing XML according to the XML specifications without
  *     regard to possible implementation limits.
  *   </li>
  * </ul>
  * 
     * @param name The feature name, which is a non-null fully-qualified URI.
     * @param value The requested value of the feature (true or false).
     * @exception org.xml.sax.SAXNotRecognizedException If the feature
     *            value can't be assigned or retrieved.
     * @exception org.xml.sax.SAXNotSupportedException When the
     *            {@link SchemaFactory} recognizes the feature name but 
     *            cannot set the requested value.
     * @exception NullPointerException
     *              if the name parameter is null.
     * @see #getFeature(String)
     */
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException('the name parameter is null');
    }
    throw new SAXNotRecognizedException(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.SchemaFactory.setProperty(String, Object)

/**
     * Set the value of a property.
     * The property name is any fully-qualified URI.  It is
     * possible for a {@link SchemaFactory} to recognize a property name but
     * to be unable to change the current value.
     * {@link SchemaFactory}s are not required to recognize setting
     * any specific property names.
     * @param name The property name, which is a non-null fully-qualified URI.
     * @param object The requested value for the property.
     * @exception org.xml.sax.SAXNotRecognizedException If the property
     *            value can't be assigned or retrieved.
     * @exception org.xml.sax.SAXNotSupportedException When the
     *            {@link SchemaFactory} recognizes the property name but 
     *            cannot set the requested value.
     * @exception NullPointerException
     *              if the name parameter is null.
     */
public void setProperty(String name, Object object) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException('the name parameter is null');
    }
    throw new SAXNotRecognizedException(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.Validator.getFeature(String)

/**
     * Look up the value of a feature flag.
     * The feature name is any fully-qualified URI.  It is
     * possible for a {@link Validator} to recognize a feature name but
     * temporarily be unable to return its value.
     * Some feature values may be available only in specific
     * contexts, such as before, during, or after a validation.
     * Implementors are free (and encouraged) to invent their own features,
     * using names built on their own URIs.
     * @param name The feature name, which is a non-null fully-qualified URI.
     * @return The current value of the feature (true or false).
     * @exception org.xml.sax.SAXNotRecognizedException If the feature
     *            value can't be assigned or retrieved.
     * @exception org.xml.sax.SAXNotSupportedException When the
     *            {@link Validator} recognizes the feature name but 
     *            cannot determine its value at this time.
     * @throws NullPointerException
     *          When the name parameter is null.
     * @see #setFeature(String, boolean)
     */
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) throw new NullPointerException('the name parameter is null');
    throw new SAXNotRecognizedException(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.Validator.getProperty(String)

/**
     * Look up the value of a property.
     * The property name is any fully-qualified URI.  It is
     * possible for a {@link Validator} to recognize a property name but
     * temporarily be unable to return its value.
     * Some property values may be available only in specific
     * contexts, such as before, during, or after a validation.
     * {@link Validator}s are not required to recognize any specific
     * property names.
     * Implementors are free (and encouraged) to invent their own properties,
     * using names built on their own URIs.
     * @param name The property name, which is a non-null fully-qualified URI.
     * @return The current value of the property.
     * @exception org.xml.sax.SAXNotRecognizedException If the property
     *            value can't be assigned or retrieved.
     * @exception org.xml.sax.SAXNotSupportedException When the
     *            XMLReader recognizes the property name but 
     *            cannot determine its value at this time.
     * @throws NullPointerException
     *          When the name parameter is null.
     * @see #setProperty(String, Object)
     */
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) throw new NullPointerException('the name parameter is null');
    throw new SAXNotRecognizedException(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.Validator.setFeature(String, boolean)

/**
     * Set the value of a feature flag.
     * 
     * Feature can be used to control the way a {@link Validator}
     * parses schemas, although {@link Validator}s are not required
     * to recognize any specific property names.
     * The feature name is any fully-qualified URI.  It is
     * possible for a {@link Validator} to expose a feature value but
     * to be unable to change the current value.
     * Some feature values may be immutable or mutable only 
     * in specific contexts, such as before, during, or after 
     * a validation.
     * @param name The feature name, which is a non-null fully-qualified URI.
     * @param value The requested value of the feature (true or false).
     * @exception org.xml.sax.SAXNotRecognizedException If the feature
     *            value can't be assigned or retrieved.
     * @exception org.xml.sax.SAXNotSupportedException When the
     *            {@link Validator} recognizes the feature name but 
     *            cannot set the requested value.
     * @throws NullPointerException
     *          When the name parameter is null.
     * @see #getFeature(String)
     */
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) throw new NullPointerException('the name parameter is null');
    throw new SAXNotRecognizedException(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.xml.validation.Validator.setProperty(String, Object)

/**
     * Set the value of a property.
     * The property name is any fully-qualified URI.  It is
     * possible for a {@link Validator} to recognize a property name but
     * to be unable to change the current value.
     * Some property values may be immutable or mutable only 
     * in specific contexts, such as before, during, or after 
     * a validation.
     * {@link Validator}s are not required to recognize setting
     * any specific property names.
     * @param name The property name, which is a non-null fully-qualified URI.
     * @param object The requested value for the property.
     * @exception org.xml.sax.SAXNotRecognizedException If the property
     *            value can't be assigned or retrieved.
     * @exception org.xml.sax.SAXNotSupportedException When the
     *            {@link Validator} recognizes the property name but 
     *            cannot set the requested value.
     * @throws NullPointerException
     *          When the name parameter is null.
     */
public void setProperty(String name, Object object) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) throw new NullPointerException('the name parameter is null');
    throw new SAXNotRecognizedException(name);
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.SecurityManager.checkAccess(Thread)

/**
     * Throws a <code>SecurityException</code> if the 
     * calling thread is not allowed to modify the thread argument. 
     * This method is invoked for the current security manager by the 
     * <code>stop</code>, <code>suspend</code>, <code>resume</code>, 
     * <code>setPriority</code>, <code>setName</code>, and 
     * <code>setDaemon</code> methods of class <code>Thread</code>. 
     * If the thread argument is a system thread (belongs to
     * the thread group with a <code>null</code> parent) then 
     * this method calls <code>checkPermission</code> with the
     * <code>RuntimePermission('modifyThread')</code> permission.
     * If the thread argument is <i>not</i> a system thread,
     * this method just returns silently.
     * Applications that want a stricter policy should override this
     * method. If this method is overridden, the method that overrides
     * it should additionally check to see if the calling thread has the
     * <code>RuntimePermission('modifyThread')</code> permission, and
     * if so, return silently. This is to ensure that code granted
     * that permission (such as the JDK itself) is allowed to
     * manipulate any thread.
     * If this method is overridden, then 
     * <code>super.checkAccess</code> should
     * be called by the first statement in the overridden method, or the 
     * equivalent security check should be placed in the overridden method.
     * @param      t   the thread to be checked.
     * @exception  SecurityException  if the calling thread does not have 
     *             permission to modify the thread.
     * @exception  NullPointerException if the thread argument is
     *             <code>null</code>.
     * @see        java.lang.Thread#resume() resume
     * @see        java.lang.Thread#setDaemon(boolean) setDaemon
     * @see        java.lang.Thread#setName(java.lang.String) setName
     * @see        java.lang.Thread#setPriority(int) setPriority
     * @see        java.lang.Thread#stop() stop
     * @see        java.lang.Thread#suspend() suspend
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
public void checkAccess(Thread t) {
    if (t == null) {
        throw new NullPointerException('thread can't be null');
    }
    if (t.getThreadGroup() == rootGroup) {
        checkPermission(SecurityConstants.MODIFY_THREAD_PERMISSION);
    } else {
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.SecurityManager.checkAccess(ThreadGroup)

/**
     * Throws a <code>SecurityException</code> if the 
     * calling thread is not allowed to modify the thread group argument. 
     * This method is invoked for the current security manager when a 
     * new child thread or child thread group is created, and by the 
     * <code>setDaemon</code>, <code>setMaxPriority</code>, 
     * <code>stop</code>, <code>suspend</code>, <code>resume</code>, and 
     * <code>destroy</code> methods of class <code>ThreadGroup</code>. 
     * If the thread group argument is the system thread group (
     * has a <code>null</code> parent) then 
     * this method calls <code>checkPermission</code> with the
     * <code>RuntimePermission('modifyThreadGroup')</code> permission.
     * If the thread group argument is <i>not</i> the system thread group,
     * this method just returns silently.
     * Applications that want a stricter policy should override this
     * method. If this method is overridden, the method that overrides
     * it should additionally check to see if the calling thread has the
     * <code>RuntimePermission('modifyThreadGroup')</code> permission, and
     * if so, return silently. This is to ensure that code granted
     * that permission (such as the JDK itself) is allowed to
     * manipulate any thread.
     * If this method is overridden, then 
     * <code>super.checkAccess</code> should
     * be called by the first statement in the overridden method, or the 
     * equivalent security check should be placed in the overridden method.
     * @param      g   the thread group to be checked.
     * @exception  SecurityException  if the calling thread does not have
     *             permission to modify the thread group.
     * @exception  NullPointerException if the thread group argument is
     *             <code>null</code>.
     * @see        java.lang.ThreadGroup#destroy() destroy
     * @see        java.lang.ThreadGroup#resume() resume
     * @see        java.lang.ThreadGroup#setDaemon(boolean) setDaemon
     * @see        java.lang.ThreadGroup#setMaxPriority(int) setMaxPriority
     * @see        java.lang.ThreadGroup#stop() stop
     * @see        java.lang.ThreadGroup#suspend() suspend
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
public void checkAccess(ThreadGroup g) {
    if (g == null) {
        throw new NullPointerException('thread group can't be null');
    }
    if (g == rootGroup) {
        checkPermission(SecurityConstants.MODIFY_THREADGROUP_PERMISSION);
    } else {
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.security.UnresolvedPermission.readObject(java.io.ObjectInputStream)

/**
     * Restores this object from a stream (i.e., deserializes it).
     */
private synchronized void readObject(java.io.ObjectInputStream ois) throws IOException, ClassNotFoundException {
    CertificateFactory cf;
    Hashtable cfs = null;
    ois.defaultReadObject();
    if (type == null) throw new NullPointerException('type can't be null');
    int size = ois.readInt();
    if (size > 0) {
        cfs = new Hashtable(3);
        this.certs = new java.security.cert.Certificate[size];
    }
    for (int i = 0; i < size; i++) {
        String certType = ois.readUTF();
        if (cfs.containsKey(certType)) {
            cf = (CertificateFactory) cfs.get(certType);
        } else {
            try {
                cf = CertificateFactory.getInstance(certType);
            } catch (CertificateException ce) {
                throw new ClassNotFoundException('Certificate factory for ' + certType + ' not found');
            }
            cfs.put(certType, cf);
        }
        byte[] encoded = null;
        try {
            encoded = new byte[ois.readInt()];
        } catch (OutOfMemoryError oome) {
            throw new IOException('Certificate too big');
        }
        ois.readFully(encoded);
        ByteArrayInputStream bais = new ByteArrayInputStream(encoded);
        try {
            this.certs[i] = cf.generateCertificate(bais);
        } catch (CertificateException ce) {
            throw new IOException(ce.getMessage());
        }
        bais.close();
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.URISyntax.verify(URI)

private static URI verify(URI uri) {
    if (uri == null) {
        throw new NullPointerException(' uri is null');
    }
    return uri;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

javax.print.attribute.TextSyntax.verify(String)

private static String verify(String value) {
    if (value == null) {
        throw new NullPointerException(' value is null');
    }
    return value;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

java.lang.SecurityManager.checkTopLevelWindow(Object)

/**
     * Returns <code>false</code> if the calling 
     * thread is not trusted to bring up the top-level window indicated 
     * by the <code>window</code> argument. In this case, the caller can 
     * still decide to show the window, but the window should include 
     * some sort of visual warning. If the method returns 
     * <code>true</code>, then the window can be shown without any 
     * special restrictions. 
     * See class <code>Window</code> for more information on trusted and 
     * untrusted windows. 
     * This method calls
     * <code>checkPermission</code> with the
     * <code>AWTPermission('showWindowWithoutWarningBanner')</code> permission,
     * and returns <code>true</code> if a SecurityException is not thrown,
     * otherwise it returns <code>false</code>.
     * If you override this method, then you should make a call to 
     * <code>super.checkTopLevelWindow</code>
     * at the point the overridden method would normally return 
     * <code>false</code>, and the value of 
     * <code>super.checkTopLevelWindow</code> should
     * be returned.
     * @param      window   the new window that is being created.
     * @return     <code>true</code> if the calling thread is trusted to put up
     *             top-level windows; <code>false</code> otherwise.
     * @exception  NullPointerException if the <code>window</code> argument is
     *             <code>null</code>.
     * @see        java.awt.Window
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
public boolean checkTopLevelWindow(Object window) {
    if (window == null) {
        throw new NullPointerException('window can't be null');
    }
    try {
        checkPermission(SecurityConstants.TOPLEVEL_WINDOW_PERMISSION);
        return true;
    } catch (SecurityException se) {
    }
    return false;
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

No comments:

Post a Comment