/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* A UnresolvedPermissionCollection stores a collection
* of UnresolvedPermission permissions.
*
* @see java.security.Permission
* @see java.security.Permissions
* @see java.security.UnresolvedPermission
*
*
* @author Roland Schemers
*
* @serial include
*/
final class UnresolvedPermissionCollection
extends PermissionCollection
{
/**
* Key is permission type, value is a list of the UnresolvedPermissions
* of the same type.
* Not serialized; see serialization section at end of class.
*/
/**
* Create an empty UnresolvedPermissionCollection object.
*
*/
public UnresolvedPermissionCollection() {
}
/**
* Adds a permission to this UnresolvedPermissionCollection.
* The key for the hash is the unresolved permission's type (class) name.
*
* @param permission the Permission object to add.
*/
{
if (! (permission instanceof UnresolvedPermission))
throw new IllegalArgumentException("invalid permission: "+
synchronized (this) {
if (v == null) {
v = new ArrayList<UnresolvedPermission>();
}
}
synchronized (v) {
}
}
/**
* get any unresolved permissions of the same type as p,
* and return the List containing them.
*/
synchronized (this) {
}
}
/**
* always returns false for unresolved permissions
*
*/
{
return false;
}
/**
* Returns an enumeration of all the UnresolvedPermission lists in the
* container.
*
* @return an enumeration of all the UnresolvedPermission objects.
*/
new ArrayList<>(); // where results are stored
// Get iterator of Map values (which are lists of permissions)
synchronized (this) {
synchronized (l) {
}
}
}
}
// Need to maintain serialization interoperability with earlier releases,
// which had the serializable field:
// private Hashtable permissions; // keyed on type
/**
* @serialField permissions java.util.Hashtable
* A table of the UnresolvedPermissions keyed on type, value is Vector
* of permissions
*/
};
/**
* @serialData Default field.
*/
/*
* Writes the contents of the perms field out as a Hashtable
* in which the values are Vectors for
* serialization compatibility with earlier releases.
*/
// Don't call out.defaultWriteObject()
// Copy perms into a Hashtable
// Convert each entry (List) into a Vector
synchronized (this) {
// Convert list into Vector
synchronized (list) {
}
// Add to Hashtable being serialized
}
}
// Write out serializable fields
out.writeFields();
}
/*
* Reads in a Hashtable in which the values are Vectors of
* UnresolvedPermissions and saves them in the perms field.
*/
// Don't call defaultReadObject()
// Read in serialized fields
// Get permissions
// Convert each entry (Vector) into a List
// Convert Vector into ArrayList
// Add to Hashtable being serialized
}
}
}