Here are the examples of the java api class java.util.Enumeration taken from open source projects.
1. DTDBuilder#buildNamesTable()
Project: jdk7u-jdk
File: DTDBuilder.java
File: DTDBuilder.java
private void buildNamesTable() { for (Enumeration e = entityHash.elements(); e.hasMoreElements(); ) { Entity ent = (Entity) e.nextElement(); // Do even if not isGeneral(). That way, exclusions and inclusions // will definitely have their element. getNameId(ent.getName()); } for (Enumeration e = elements.elements(); e.hasMoreElements(); ) { Element el = (Element) e.nextElement(); getNameId(el.getName()); for (AttributeList atts = el.getAttributes(); atts != null; atts = atts.getNext()) { getNameId(atts.getName()); if (atts.getValue() != null) { getNameId(atts.getValue()); } Enumeration vals = atts.getValues(); while (vals != null && vals.hasMoreElements()) { String s = (String) vals.nextElement(); getNameId(s); } } } }
2. Stub#buildMethodList()
Project: openjdk
File: Stub.java
File: Stub.java
// buildMethodList /** * **/ private void buildMethodList(InterfaceEntry entry) { // Add the local methods Enumeration locals = entry.methods().elements(); while (locals.hasMoreElements()) addMethod((MethodEntry) locals.nextElement()); // Add the inherited methods Enumeration parents = entry.derivedFrom().elements(); while (parents.hasMoreElements()) { InterfaceEntry parent = (InterfaceEntry) parents.nextElement(); if (!parent.name().equals("Object")) buildMethodList(parent); } }
3. Skeleton#buildMethodList()
Project: openjdk
File: Skeleton.java
File: Skeleton.java
// buildMethodList /** * **/ private void buildMethodList(InterfaceEntry entry) { // Add the local methods Enumeration locals = entry.methods().elements(); while (locals.hasMoreElements()) addMethod((MethodEntry) locals.nextElement()); // Add the inherited methods Enumeration parents = entry.derivedFrom().elements(); while (parents.hasMoreElements()) { InterfaceEntry parent = (InterfaceEntry) parents.nextElement(); if (!parent.name().equals("Object")) buildMethodList(parent); } }
4. AttributeGen#unique()
Project: openjdk
File: AttributeGen.java
File: AttributeGen.java
// ctor /** * **/ private boolean unique(InterfaceEntry entry, String name) { // Compare the name to the methods of this interface Enumeration methods = entry.methods().elements(); while (methods.hasMoreElements()) { SymtabEntry method = (SymtabEntry) methods.nextElement(); if (name.equals(method.name())) return false; } // Recursively call unique on each derivedFrom interface Enumeration derivedFrom = entry.derivedFrom().elements(); while (derivedFrom.hasMoreElements()) if (!unique((InterfaceEntry) derivedFrom.nextElement(), name)) return false; // derivedFrom interfaces, then the name is unique. return true; }
5. JSFHelper#printRequest()
Project: myWMS
File: JSFHelper.java
File: JSFHelper.java
@SuppressWarnings("rawtypes") public void printRequest() { HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(); Enumeration e = request.getParameterNames(); while (e.hasMoreElements()) { System.out.println("Parameter = " + e.nextElement()); } Enumeration ea = request.getAttributeNames(); while (ea.hasMoreElements()) { System.out.println("Attribute = " + ea.nextElement()); } System.out.println("Requested URI = " + request.getRequestURI()); System.out.println("Requested URL = " + request.getRequestURL()); System.out.println("QueryString = " + request.getQueryString()); }
6. NanoHTTPD#serve()
Project: selendroid
File: NanoHTTPD.java
File: NanoHTTPD.java
// ================================================== // API parts // ================================================== /** * Override this to customize the server. * <p> * * (By default, this delegates to serveFile() and allows directory listing.) * * @param uri Percent-decoded URI without parameters, for example "/index.cgi" * @param method "GET", "POST" etc. * @param parms Parsed, percent decoded parameters from URI and, in case of POST, data. * @param header Header entries, percent decoded * @return HTTP response, see class Response for details */ public Response serve(String uri, String method, Properties header, Properties parms, Properties files) { myOut.println(method + " '" + uri + "' "); Enumeration e = header.propertyNames(); while (e.hasMoreElements()) { String value = (String) e.nextElement(); myOut.println(" HDR: '" + value + "' = '" + header.getProperty(value) + "'"); } e = parms.propertyNames(); while (e.hasMoreElements()) { String value = (String) e.nextElement(); myOut.println(" PRM: '" + value + "' = '" + parms.getProperty(value) + "'"); } e = files.propertyNames(); while (e.hasMoreElements()) { String value = (String) e.nextElement(); myOut.println(" UPLOADED: '" + value + "' = '" + files.getProperty(value) + "'"); } return serveFile(uri, header, myRootDir, true); }
7. NanoHTTPD#serve()
Project: selendroid
File: NanoHTTPD.java
File: NanoHTTPD.java
// ================================================== // API parts // ================================================== /** * Override this to customize the server. * <p> * * (By default, this delegates to serveFile() and allows directory listing.) * * @param uri * Percent-decoded URI without parameters, for example * "/index.cgi" * @param method * "GET", "POST" etc. * @param parms * Parsed, percent decoded parameters from URI and, in case of * POST, data. * @param header * Header entries, percent decoded * @return HTTP response, see class Response for details */ public Response serve(String uri, String method, Properties header, Properties parms, Properties files) { myOut.println(method + " '" + uri + "' "); Enumeration e = header.propertyNames(); while (e.hasMoreElements()) { String value = (String) e.nextElement(); myOut.println(" HDR: '" + value + "' = '" + header.getProperty(value) + "'"); } e = parms.propertyNames(); while (e.hasMoreElements()) { String value = (String) e.nextElement(); myOut.println(" PRM: '" + value + "' = '" + parms.getProperty(value) + "'"); } e = files.propertyNames(); while (e.hasMoreElements()) { String value = (String) e.nextElement(); myOut.println(" UPLOADED: '" + value + "' = '" + files.getProperty(value) + "'"); } return serveFile(uri, header, myRootDir, true); }
8. ZaurusEditor#resetTableForms()
Project: h-store
File: ZaurusEditor.java
File: ZaurusEditor.java
// reset everything after changes in the database private void resetTableForms() { lForm.show(pForm, "search"); lButton.show(pButton, "search"); Vector vAllTables = getAllTables(); // fill the drop down list again // get all table names and show a drop down list of them in cTables cTables.removeAll(); for (Enumeration e = vAllTables.elements(); e.hasMoreElements(); ) { cTables.addItem((String) e.nextElement()); } // remove all form panels from pForm for (Enumeration e = vHoldForms.elements(); e.hasMoreElements(); ) { pForm.remove((ZaurusTableForm) e.nextElement()); } // end of while (Enumeration e = vHoldForms.elements(); e.hasMoreElements();) // initialize a new list for the table names which have a form in pForm vHoldTableNames = new Vector(20); vHoldForms = new Vector(20); }
9. NanoHTTPD#serve()
Project: h-store
File: NanoHTTPD.java
File: NanoHTTPD.java
// ================================================== // API parts // ================================================== /** * Override this to customize the server.<p> * * (By default, this delegates to serveFile() and allows directory listing.) * * @parm uri Percent-decoded URI without parameters, for example "/index.cgi" * @parm method "GET", "POST" etc. * @parm parms Parsed, percent decoded parameters from URI and, in case of POST, data. * @parm header Header entries, percent decoded * @return HTTP response, see class Response for details */ @SuppressWarnings("unchecked") public Response serve(String uri, String method, Properties header, Properties parms) { System.out.println(method + " '" + uri + "' "); Enumeration e = header.propertyNames(); while (e.hasMoreElements()) { String value = (String) e.nextElement(); System.out.println(" HDR: '" + value + "' = '" + header.getProperty(value) + "'"); } e = parms.propertyNames(); while (e.hasMoreElements()) { String value = (String) e.nextElement(); System.out.println(" PRM: '" + value + "' = '" + parms.getProperty(value) + "'"); } return serveFile(uri, header, new File("."), true); }
10. JarFileClassLoader#findResources()
Project: geronimo-xbean
File: JarFileClassLoader.java
File: JarFileClassLoader.java
/** * {@inheritDoc} */ public Enumeration findResources(final String resourceName) throws IOException { // todo this is not right // first get the resources from the parent classloaders Enumeration parentResources = super.findResources(resourceName); // get the classes from my urls Enumeration myResources = (Enumeration) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return resourceFinder.findResources(resourceName); } }, acc); // join the two together Enumeration resources = new UnionEnumeration(parentResources, myResources); return resources; }
11. Area#isSingular()
Project: jdk7u-jdk
File: Area.java
File: Area.java
/** * Tests whether this <code>Area</code> is comprised of a single * closed subpath. This method returns <code>true</code> if the * path contains 0 or 1 subpaths, or <code>false</code> if the path * contains more than 1 subpath. The subpaths are counted by the * number of {@link PathIterator#SEG_MOVETO SEG_MOVETO} segments * that appear in the path. * @return <code>true</code> if the <code>Area</code> is comprised * of a single basic geometry; <code>false</code> otherwise. * @since 1.2 */ public boolean isSingular() { if (curves.size() < 3) { return true; } Enumeration enum_ = curves.elements(); // First Order0 "moveto" enum_.nextElement(); while (enum_.hasMoreElements()) { if (((Curve) enum_.nextElement()).getOrder() == 0) { return false; } } return true; }
12. DTDBuilder#saveEntities()
Project: jdk7u-jdk
File: DTDBuilder.java
File: DTDBuilder.java
/** * Save an entity to a stream. */ void saveEntities(DataOutputStream out) throws IOException { int num = 0; for (Enumeration e = entityHash.elements(); e.hasMoreElements(); ) { Entity ent = (Entity) e.nextElement(); if (ent.isGeneral()) { num++; } } out.writeShort((short) num); for (Enumeration e = entityHash.elements(); e.hasMoreElements(); ) { Entity ent = (Entity) e.nextElement(); if (ent.isGeneral()) { out.writeShort(getNameId(ent.getName())); out.writeByte(ent.getType() & ~GENERAL); out.writeUTF(ent.getString()); } } }
13. VectorTest#test_clone()
Project: j2objc
File: VectorTest.java
File: VectorTest.java
/** * @tests java.util.Vector#clone() */ public void test_clone() { // Test for method java.lang.Object java.util.Vector.clone() tVector.add(25, null); tVector.add(75, null); Vector v = (Vector) tVector.clone(); Enumeration orgNum = tVector.elements(); Enumeration cnum = v.elements(); while (orgNum.hasMoreElements()) { assertTrue("Not enough elements copied", cnum.hasMoreElements()); assertTrue("Vector cloned improperly, elements do not match", orgNum.nextElement() == cnum.nextElement()); } assertTrue("Not enough elements copied", !cnum.hasMoreElements()); }
14. VectorTest#test_clear()
Project: j2objc
File: VectorTest.java
File: VectorTest.java
/** * @tests java.util.Vector#clear() */ public void test_clear() { // Test for method void java.util.Vector.clear() Vector orgVector = vectorClone(tVector); tVector.clear(); assertEquals("a) Cleared Vector has non-zero size", 0, tVector.size()); Enumeration e = orgVector.elements(); while (e.hasMoreElements()) assertTrue("a) Cleared vector contained elements", !tVector.contains(e.nextElement())); tVector.add(null); tVector.clear(); assertEquals("b) Cleared Vector has non-zero size", 0, tVector.size()); e = orgVector.elements(); while (e.hasMoreElements()) assertTrue("b) Cleared vector contained elements", !tVector.contains(e.nextElement())); }
15. EnumerationCanBeIterationInspection#foo()
Project: intellij-community
File: EnumerationCanBeIterationInspection.java
File: EnumerationCanBeIterationInspection.java
static void foo(Vector v, Hashtable h) { Enumeration e = v.elements(); while (e.hasMoreElements()) { System.out.println(e.nextElement()); } Iterator i = v.iterator(); while (i.hasNext()) { System.out.println(i.next()); } e = h.elements(); while (e.hasMoreElements()) { System.out.println(e.nextElement()); } e = h.keys(); i = h.values().iterator(); while (i.hasNext()) { System.out.println(i.next()); } }
16. PKCS12KeyStoreSpi#engineSize()
Project: bc-java
File: PKCS12KeyStoreSpi.java
File: PKCS12KeyStoreSpi.java
public int engineSize() { Hashtable tab = new Hashtable(); Enumeration e = certs.keys(); while (e.hasMoreElements()) { tab.put(e.nextElement(), "cert"); } e = keys.keys(); while (e.hasMoreElements()) { String a = (String) e.nextElement(); if (tab.get(a) == null) { tab.put(a, "key"); } } return tab.size(); }
17. PKCS12KeyStoreSpi#engineAliases()
Project: bc-java
File: PKCS12KeyStoreSpi.java
File: PKCS12KeyStoreSpi.java
public Enumeration engineAliases() { Hashtable tab = new Hashtable(); Enumeration e = certs.keys(); while (e.hasMoreElements()) { tab.put(e.nextElement(), "cert"); } e = keys.keys(); while (e.hasMoreElements()) { String a = (String) e.nextElement(); if (tab.get(a) == null) { tab.put(a, "key"); } } return tab.keys(); }
18. PKCS12KeyStoreSpi#engineSize()
Project: bc-java
File: PKCS12KeyStoreSpi.java
File: PKCS12KeyStoreSpi.java
public int engineSize() { Hashtable tab = new Hashtable(); Enumeration e = certs.keys(); while (e.hasMoreElements()) { tab.put(e.nextElement(), "cert"); } e = keys.keys(); while (e.hasMoreElements()) { String a = (String) e.nextElement(); if (tab.get(a) == null) { tab.put(a, "key"); } } return tab.size(); }
19. PKCS12KeyStoreSpi#engineAliases()
Project: bc-java
File: PKCS12KeyStoreSpi.java
File: PKCS12KeyStoreSpi.java
public Enumeration engineAliases() { Hashtable tab = new Hashtable(); Enumeration e = certs.keys(); while (e.hasMoreElements()) { tab.put(e.nextElement(), "cert"); } e = keys.keys(); while (e.hasMoreElements()) { String a = (String) e.nextElement(); if (tab.get(a) == null) { tab.put(a, "key"); } } return tab.keys(); }
20. PKCS12KeyStoreSpi#engineSize()
Project: bc-java
File: PKCS12KeyStoreSpi.java
File: PKCS12KeyStoreSpi.java
public int engineSize() { Hashtable tab = new Hashtable(); Enumeration e = certs.keys(); while (e.hasMoreElements()) { tab.put(e.nextElement(), "cert"); } e = keys.keys(); while (e.hasMoreElements()) { String a = (String) e.nextElement(); if (tab.get(a) == null) { tab.put(a, "key"); } } return tab.size(); }
21. PKCS12KeyStoreSpi#engineAliases()
Project: bc-java
File: PKCS12KeyStoreSpi.java
File: PKCS12KeyStoreSpi.java
public Enumeration engineAliases() { Hashtable tab = new Hashtable(); Enumeration e = certs.keys(); while (e.hasMoreElements()) { tab.put(e.nextElement(), "cert"); } e = keys.keys(); while (e.hasMoreElements()) { String a = (String) e.nextElement(); if (tab.get(a) == null) { tab.put(a, "key"); } } return tab.keys(); }
22. ServletRequestHandler#collectPropertyNames()
Project: commons-jxpath
File: ServletRequestHandler.java
File: ServletRequestHandler.java
protected void collectPropertyNames(HashSet set, Object bean) { super.collectPropertyNames(set, bean); ServletRequestAndContext handle = (ServletRequestAndContext) bean; ServletRequest servletRequest = handle.getServletRequest(); Enumeration e = servletRequest.getAttributeNames(); while (e.hasMoreElements()) { set.add(e.nextElement()); } e = servletRequest.getParameterNames(); while (e.hasMoreElements()) { set.add(e.nextElement()); } }
23. WebDAVUtil#getAllProperties()
Project: cocoon
File: WebDAVUtil.java
File: WebDAVUtil.java
/** * get all properties for given uri * * @param uri the URI to get the properties from * @throws HttpException * @throws IOException */ public static List getAllProperties(String uri) throws HttpException, IOException { List sourceproperties = new ArrayList(); WebdavResource resource = WebDAVUtil.getWebdavResource(uri); Enumeration responses = resource.propfindMethod(0); Enumeration props = null; Property prop = null; while (responses.hasMoreElements()) { ResponseEntity response = (ResponseEntity) responses.nextElement(); props = response.getProperties(); while (props.hasMoreElements()) { prop = (Property) props.nextElement(); SourceProperty srcProperty = new SourceProperty(prop.getElement()); sourceproperties.add(srcProperty); } } return sourceproperties; }
24. WebDAVUtil#getProperty()
Project: cocoon
File: WebDAVUtil.java
File: WebDAVUtil.java
/** * get a property * * @param uri the URI to get the property from * @param name the name of the property * @param namespace the namespace of the property * @throws HttpException * @throws IOException */ public static SourceProperty getProperty(String uri, String name, String namespace) throws HttpException, IOException { Vector propNames = new Vector(1); propNames.add(new PropertyName(namespace, name)); Enumeration props = null; Property prop = null; WebdavResource resource = WebDAVUtil.getWebdavResource(uri); Enumeration responses = resource.propfindMethod(0, propNames); while (responses.hasMoreElements()) { ResponseEntity response = (ResponseEntity) responses.nextElement(); props = response.getProperties(); if (props.hasMoreElements()) { prop = (Property) props.nextElement(); return new SourceProperty(prop.getElement()); } } return null; }
25. Area#isSingular()
Project: LGame
File: Area.java
File: Area.java
/** * Tests whether this <code>Area</code> is comprised of a single closed * subpath. This method returns <code>true</code> if the path contains 0 or * 1 subpaths, or <code>false</code> if the path contains more than 1 * subpath. The subpaths are counted by the number of * {@link PathIterator#SEG_MOVETO SEG_MOVETO} segments that appear in the * path. * * @return <code>true</code> if the <code>Area</code> is comprised of a * single basic geometry; <code>false</code> otherwise. * @since 1.2 */ public boolean isSingular() { if (curves.size() < 3) { return true; } Enumeration enum_ = curves.elements(); // First Order0 "moveto" enum_.nextElement(); while (enum_.hasMoreElements()) { if (((Curve) enum_.nextElement()).getOrder() == 0) { return false; } } return true; }
26. Manager#disconnectClients()
Project: jmud
File: Manager.java
File: Manager.java
synchronized /* incomingClients, playingClients */ void disconnectClients() { Log.info("Desconectando clientes"); for (Enumeration ce = incomingClients.elements(); ce.hasMoreElements(); ) { Client c = (Client) ce.nextElement(); c.flush(); c.rawSend(Separators.NL + "Sistema desativado." + Separators.NL); c.disconnect(); } for (Enumeration ce = playingClients.elements(); ce.hasMoreElements(); ) { Client c = (Client) ce.nextElement(); c.saveChar(); c.flush(); c.rawSend(Separators.NL + "Sistema desativado." + Separators.NL); c.disconnect(); } }
27. AnnotationAttr#write()
Project: pluotsorbet
File: AnnotationAttr.java
File: AnnotationAttr.java
void write(ClassEnv e, DataOutputStream out) throws IOException, jasError { out.writeShort(e.getCPIndex(attr)); int len = 2; for (Enumeration en = anns.elements(); en.hasMoreElements(); ) len += ((Annotation) en.nextElement()).size(); out.writeInt(len); out.writeShort((short) anns.size()); for (Enumeration en = anns.elements(); en.hasMoreElements(); ) ((Annotation) en.nextElement()).write(e, out); }
28. DOMScanner#scan()
Project: openjdk
File: DOMScanner.java
File: DOMScanner.java
public void scan(Element e) throws SAXException { setCurrentLocation(e); receiver.setDocumentLocator(locator); receiver.startDocument(); NamespaceSupport nss = new NamespaceSupport(); buildNamespaceSupport(nss, e.getParentNode()); for (Enumeration en = nss.getPrefixes(); en.hasMoreElements(); ) { String prefix = (String) en.nextElement(); receiver.startPrefixMapping(prefix, nss.getURI(prefix)); } visit(e); for (Enumeration en = nss.getPrefixes(); en.hasMoreElements(); ) { String prefix = (String) en.nextElement(); receiver.endPrefixMapping(prefix); } setCurrentLocation(e); receiver.endDocument(); }
29. ZaurusEditor#resetTableForms()
Project: voltdb
File: ZaurusEditor.java
File: ZaurusEditor.java
// reset everything after changes in the database private void resetTableForms() { lForm.show(pForm, "search"); lButton.show(pButton, "search"); Vector vAllTables = getAllTables(); // fill the drop down list again // get all table names and show a drop down list of them in cTables cTables.removeAll(); for (Enumeration e = vAllTables.elements(); e.hasMoreElements(); ) { cTables.addItem((String) e.nextElement()); } // remove all form panels from pForm for (Enumeration e = vHoldForms.elements(); e.hasMoreElements(); ) { pForm.remove((ZaurusTableForm) e.nextElement()); } // end of while (Enumeration e = vHoldForms.elements(); e.hasMoreElements();) // initialize a new list for the table names which have a form in pForm vHoldTableNames = new Vector(20); vHoldForms = new Vector(20); }
30. JceTestUtil#getRegisteredAlgorithms()
Project: bc-java
File: JceTestUtil.java
File: JceTestUtil.java
static String[] getRegisteredAlgorithms(String prefix, String[] exclusionPatterns) { final BouncyCastleProvider prov = (BouncyCastleProvider) Security.getProvider("BC"); List matches = new ArrayList(); Enumeration algos = prov.keys(); while (algos.hasMoreElements()) { String algo = (String) algos.nextElement(); if (!algo.startsWith(prefix)) { continue; } String algoName = algo.substring(prefix.length()); if (!isExcluded(algoName, exclusionPatterns)) { matches.add(algoName); } } return (String[]) matches.toArray(new String[matches.size()]); }
31. X509Util#getAlgNames()
Project: bc-java
File: X509Util.java
File: X509Util.java
static Iterator getAlgNames() { Enumeration e = algorithms.keys(); List l = new ArrayList(); while (e.hasMoreElements()) { l.add(e.nextElement()); } return l.iterator(); }
32. X509CRLObject#loadCRLEntries()
Project: bc-java
File: X509CRLObject.java
File: X509CRLObject.java
private Set loadCRLEntries() { Set entrySet = new HashSet(); Enumeration certs = c.getRevokedCertificateEnumeration(); X500Name previousCertificateIssuer = c.getIssuer(); while (certs.hasMoreElements()) { TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry) certs.nextElement(); X509CRLEntryObject crlEntry = new X509CRLEntryObject(entry, isIndirect, previousCertificateIssuer); entrySet.add(crlEntry); if (isIndirect && entry.hasExtensions()) { Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer); if (currentCaName != null) { previousCertificateIssuer = X500Name.getInstance(GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName()); } } } return entrySet; }
33. X509CRLObject#loadCRLEntries()
Project: bc-java
File: X509CRLObject.java
File: X509CRLObject.java
private Set loadCRLEntries() { Set entrySet = new HashSet(); Enumeration certs = c.getRevokedCertificateEnumeration(); X500Name previousCertificateIssuer = c.getIssuer(); while (certs.hasMoreElements()) { TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry) certs.nextElement(); X509CRLEntryObject crlEntry = new X509CRLEntryObject(entry, isIndirect, previousCertificateIssuer); entrySet.add(crlEntry); if (isIndirect && entry.hasExtensions()) { Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer); if (currentCaName != null) { previousCertificateIssuer = X500Name.getInstance(GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName()); } } } return entrySet; }
34. X509Util#getAlgNames()
Project: bc-java
File: X509Util.java
File: X509Util.java
static Iterator getAlgNames() { Enumeration e = algorithms.keys(); List l = new ArrayList(); while (e.hasMoreElements()) { l.add(e.nextElement()); } return l.iterator(); }
35. X509CRLObject#loadCRLEntries()
Project: bc-java
File: X509CRLObject.java
File: X509CRLObject.java
private Set loadCRLEntries() { Set entrySet = new HashSet(); Enumeration certs = c.getRevokedCertificateEnumeration(); X500Name previousCertificateIssuer = c.getIssuer(); while (certs.hasMoreElements()) { TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry) certs.nextElement(); X509CRLEntryObject crlEntry = new X509CRLEntryObject(entry, isIndirect, previousCertificateIssuer); entrySet.add(crlEntry); if (isIndirect && entry.hasExtensions()) { Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer); if (currentCaName != null) { previousCertificateIssuer = X500Name.getInstance(GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName()); } } } return entrySet; }
36. X509Util#getAlgNames()
Project: bc-java
File: X509Util.java
File: X509Util.java
static Iterator getAlgNames() { Enumeration e = algorithms.keys(); List l = new ArrayList(); while (e.hasMoreElements()) { l.add(e.nextElement()); } return l.iterator(); }
37. X509CRLObject#loadCRLEntries()
Project: bc-java
File: X509CRLObject.java
File: X509CRLObject.java
private Set loadCRLEntries() { Set entrySet = new HashSet(); Enumeration certs = c.getRevokedCertificateEnumeration(); // the issuer X500Name previousCertificateIssuer = null; while (certs.hasMoreElements()) { TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry) certs.nextElement(); X509CRLEntryObject crlEntry = new X509CRLEntryObject(entry, isIndirect, previousCertificateIssuer); entrySet.add(crlEntry); if (isIndirect && entry.hasExtensions()) { Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer); if (currentCaName != null) { previousCertificateIssuer = X500Name.getInstance(GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName()); } } } return entrySet; }
38. X509CRLObject#loadCRLEntries()
Project: bc-java
File: X509CRLObject.java
File: X509CRLObject.java
private Set loadCRLEntries() { Set entrySet = new HashSet(); Enumeration certs = c.getRevokedCertificateEnumeration(); // the issuer X500Name previousCertificateIssuer = null; while (certs.hasMoreElements()) { TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry) certs.nextElement(); X509CRLEntryObject crlEntry = new X509CRLEntryObject(entry, isIndirect, previousCertificateIssuer); entrySet.add(crlEntry); if (isIndirect && entry.hasExtensions()) { Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer); if (currentCaName != null) { previousCertificateIssuer = X500Name.getInstance(GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName()); } } } return entrySet; }
39. DefaultSignedAttributeTableGenerator#copyHashTable()
Project: bc-java
File: DefaultSignedAttributeTableGenerator.java
File: DefaultSignedAttributeTableGenerator.java
private static Hashtable copyHashTable(Hashtable paramsMap) { Hashtable newTable = new Hashtable(); Enumeration keys = paramsMap.keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); newTable.put(key, paramsMap.get(key)); } return newTable; }
40. FileBackedMimeBodyPart#saveStreamToFile()
Project: bc-java
File: FileBackedMimeBodyPart.java
File: FileBackedMimeBodyPart.java
private static File saveStreamToFile(InternetHeaders headers, InputStream content, File tempFile) throws IOException { OutputStream out = new FileOutputStream(tempFile); Enumeration en = headers.getAllHeaderLines(); while (en.hasMoreElements()) { writeHeader(out, (String) en.nextElement()); } writeSeperator(out); saveContentToStream(out, content); return tempFile; }
41. SMIMEGenerator#extractHeaders()
Project: bc-java
File: SMIMEGenerator.java
File: SMIMEGenerator.java
private void extractHeaders(MimeBodyPart content, MimeMessage message) throws MessagingException { Enumeration e = message.getAllHeaders(); while (e.hasMoreElements()) { Header hdr = (Header) e.nextElement(); content.addHeader(hdr.getName(), hdr.getValue()); } }
42. TlsProtocol#writeSelectedExtensions()
Project: bc-java
File: TlsProtocol.java
File: TlsProtocol.java
protected static void writeSelectedExtensions(OutputStream output, Hashtable extensions, boolean selectEmpty) throws IOException { Enumeration keys = extensions.keys(); while (keys.hasMoreElements()) { Integer key = (Integer) keys.nextElement(); int extension_type = key.intValue(); byte[] extension_data = (byte[]) extensions.get(key); if (selectEmpty == (extension_data.length == 0)) { TlsUtils.checkUint16(extension_type); TlsUtils.writeUint16(extension_type, output); TlsUtils.writeOpaque16(extension_data, output); } } }
43. DTLSReliableHandshake#checkAll()
Project: bc-java
File: DTLSReliableHandshake.java
File: DTLSReliableHandshake.java
private static boolean checkAll(Hashtable inboundFlight) { Enumeration e = inboundFlight.elements(); while (e.hasMoreElements()) { if (((DTLSReassembler) e.nextElement()).getBodyIfComplete() == null) { return false; } } return true; }
44. DTLSReliableHandshake#checkInboundFlight()
Project: bc-java
File: DTLSReliableHandshake.java
File: DTLSReliableHandshake.java
/** * Check that there are no "extra" messages left in the current inbound flight */ private void checkInboundFlight() { Enumeration e = currentInboundFlight.keys(); while (e.hasMoreElements()) { Integer key = (Integer) e.nextElement(); if (key.intValue() >= next_receive_seq) { // TODO Should this be considered an error? } } }
45. DeferredHash#reset()
Project: bc-java
File: DeferredHash.java
File: DeferredHash.java
public void reset() { if (buf != null) { buf.reset(); return; } Enumeration e = hashes.elements(); while (e.hasMoreElements()) { Digest hash = (Digest) e.nextElement(); hash.reset(); } }
46. DeferredHash#update()
Project: bc-java
File: DeferredHash.java
File: DeferredHash.java
public void update(byte[] input, int inOff, int len) { if (buf != null) { buf.write(input, inOff, len); return; } Enumeration e = hashes.elements(); while (e.hasMoreElements()) { Digest hash = (Digest) e.nextElement(); hash.update(input, inOff, len); } }
47. DeferredHash#update()
Project: bc-java
File: DeferredHash.java
File: DeferredHash.java
public void update(byte input) { if (buf != null) { buf.write(input); return; } Enumeration e = hashes.elements(); while (e.hasMoreElements()) { Digest hash = (Digest) e.nextElement(); hash.update(input); } }
48. X509Extensions#equivalent()
Project: bc-java
File: X509Extensions.java
File: X509Extensions.java
public boolean equivalent(X509Extensions other) { if (extensions.size() != other.extensions.size()) { return false; } Enumeration e1 = extensions.keys(); while (e1.hasMoreElements()) { Object key = e1.nextElement(); if (!extensions.get(key).equals(other.extensions.get(key))) { return false; } } return true; }
49. X509Extensions#toASN1Primitive()
Project: bc-java
File: X509Extensions.java
File: X509Extensions.java
/** * <pre> * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension * * Extension ::= SEQUENCE { * extnId EXTENSION.&id ({ExtensionSet}), * critical BOOLEAN DEFAULT FALSE, * extnValue OCTET STRING } * </pre> */ public ASN1Primitive toASN1Primitive() { ASN1EncodableVector vec = new ASN1EncodableVector(); Enumeration e = ordering.elements(); while (e.hasMoreElements()) { ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier) e.nextElement(); X509Extension ext = (X509Extension) extensions.get(oid); ASN1EncodableVector v = new ASN1EncodableVector(); v.add(oid); if (ext.isCritical()) { v.add(ASN1Boolean.TRUE); } v.add(ext.getValue()); vec.add(new DERSequence(v)); } return new DERSequence(vec); }
50. SubjectDirectoryAttributes#toASN1Primitive()
Project: bc-java
File: SubjectDirectoryAttributes.java
File: SubjectDirectoryAttributes.java
/** * Produce an object suitable for an ASN1OutputStream. * * Returns: * * <pre> * SubjectDirectoryAttributes ::= Attributes * Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute * Attribute ::= SEQUENCE * { * type AttributeType * values SET OF AttributeValue * } * * AttributeType ::= OBJECT IDENTIFIER * AttributeValue ::= ANY DEFINED BY AttributeType * </pre> * * @return a ASN1Primitive */ public ASN1Primitive toASN1Primitive() { ASN1EncodableVector vec = new ASN1EncodableVector(); Enumeration e = attributes.elements(); while (e.hasMoreElements()) { vec.add((Attribute) e.nextElement()); } return new DERSequence(vec); }
51. Extensions#equivalent()
Project: bc-java
File: Extensions.java
File: Extensions.java
public boolean equivalent(Extensions other) { if (extensions.size() != other.extensions.size()) { return false; } Enumeration e1 = extensions.keys(); while (e1.hasMoreElements()) { Object key = e1.nextElement(); if (!extensions.get(key).equals(other.extensions.get(key))) { return false; } } return true; }
52. Extensions#toASN1Primitive()
Project: bc-java
File: Extensions.java
File: Extensions.java
/** * <pre> * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension * * Extension ::= SEQUENCE { * extnId EXTENSION.&id ({ExtensionSet}), * critical BOOLEAN DEFAULT FALSE, * extnValue OCTET STRING } * </pre> */ public ASN1Primitive toASN1Primitive() { ASN1EncodableVector vec = new ASN1EncodableVector(); Enumeration e = ordering.elements(); while (e.hasMoreElements()) { ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier) e.nextElement(); Extension ext = (Extension) extensions.get(oid); vec.add(ext); } return new DERSequence(vec); }
53. AbstractX500NameStyle#copyHashTable()
Project: bc-java
File: AbstractX500NameStyle.java
File: AbstractX500NameStyle.java
/** * Tool function to shallow copy a Hashtable. * * @param paramsMap table to copy * @return the copy of the table */ public static Hashtable copyHashTable(Hashtable paramsMap) { Hashtable newTable = new Hashtable(); Enumeration keys = paramsMap.keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); newTable.put(key, paramsMap.get(key)); } return newTable; }
54. ECPrivateKeyStructure#getObjectInTag()
Project: bc-java
File: ECPrivateKeyStructure.java
File: ECPrivateKeyStructure.java
private ASN1Primitive getObjectInTag(int tagNo) { Enumeration e = seq.getObjects(); while (e.hasMoreElements()) { ASN1Encodable obj = (ASN1Encodable) e.nextElement(); if (obj instanceof ASN1TaggedObject) { ASN1TaggedObject tag = (ASN1TaggedObject) obj; if (tag.getTagNo() == tagNo) { return (ASN1Primitive) ((ASN1Encodable) tag.getObject()).toASN1Primitive(); } } } return null; }
55. ECPrivateKey#getObjectInTag()
Project: bc-java
File: ECPrivateKey.java
File: ECPrivateKey.java
private ASN1Primitive getObjectInTag(int tagNo) { Enumeration e = seq.getObjects(); while (e.hasMoreElements()) { ASN1Encodable obj = (ASN1Encodable) e.nextElement(); if (obj instanceof ASN1TaggedObject) { ASN1TaggedObject tag = (ASN1TaggedObject) obj; if (tag.getTagNo() == tagNo) { return tag.getObject().toASN1Primitive(); } } } return null; }
56. Flags#decode()
Project: bc-java
File: Flags.java
File: Flags.java
/* Java 1.5 String decode(Map<Integer, String> decodeMap) { StringJoiner joiner = new StringJoiner(" "); for (int i : decodeMap.keySet()) { if (isSet(i)) joiner.add(decodeMap.get(i)); } return joiner.toString(); } */ String decode(Hashtable decodeMap) { StringJoiner joiner = new StringJoiner(" "); Enumeration e = decodeMap.keys(); while (e.hasMoreElements()) { Integer i = (Integer) e.nextElement(); if (isSet(i.intValue())) { joiner.add((String) decodeMap.get(i)); } } return joiner.toString(); }
57. AttributeTable#copyTable()
Project: bc-java
File: AttributeTable.java
File: AttributeTable.java
private Hashtable copyTable(Hashtable in) { Hashtable out = new Hashtable(); Enumeration e = in.keys(); while (e.hasMoreElements()) { Object key = e.nextElement(); out.put(key, in.get(key)); } return out; }
58. BERSet#encode()
Project: bc-java
File: BERSet.java
File: BERSet.java
void encode(ASN1OutputStream out) throws IOException { out.write(BERTags.SET | BERTags.CONSTRUCTED); out.write(0x80); Enumeration e = getObjects(); while (e.hasMoreElements()) { out.writeObject((ASN1Encodable) e.nextElement()); } out.write(0x00); out.write(0x00); }
59. BERSequence#encode()
Project: bc-java
File: BERSequence.java
File: BERSequence.java
void encode(ASN1OutputStream out) throws IOException { out.write(BERTags.SEQUENCE | BERTags.CONSTRUCTED); out.write(0x80); Enumeration e = getObjects(); while (e.hasMoreElements()) { out.writeObject((ASN1Encodable) e.nextElement()); } out.write(0x00); out.write(0x00); }
60. BEROctetString#fromSequence()
Project: bc-java
File: BEROctetString.java
File: BEROctetString.java
static BEROctetString fromSequence(ASN1Sequence seq) { ASN1OctetString[] v = new ASN1OctetString[seq.size()]; Enumeration e = seq.getObjects(); int index = 0; while (e.hasMoreElements()) { v[index++] = (ASN1OctetString) e.nextElement(); } return new BEROctetString(v); }
61. BERConstructedOctetString#fromSequence()
Project: bc-java
File: BERConstructedOctetString.java
File: BERConstructedOctetString.java
public static BEROctetString fromSequence(ASN1Sequence seq) { Vector v = new Vector(); Enumeration e = seq.getObjects(); while (e.hasMoreElements()) { v.addElement(e.nextElement()); } return new BERConstructedOctetString(v); }
62. ASN1Set#hashCode()
Project: bc-java
File: ASN1Set.java
File: ASN1Set.java
public int hashCode() { Enumeration e = this.getObjects(); int hashCode = size(); while (e.hasMoreElements()) { Object o = getNext(e); hashCode *= 17; hashCode ^= o.hashCode(); } return hashCode; }
63. ASN1Sequence#hashCode()
Project: bc-java
File: ASN1Sequence.java
File: ASN1Sequence.java
public int hashCode() { Enumeration e = this.getObjects(); int hashCode = size(); while (e.hasMoreElements()) { Object o = getNext(e); hashCode *= 17; hashCode ^= o.hashCode(); } return hashCode; }
64. RuntimeInstance#setProperties()
Project: bboss
File: RuntimeInstance.java
File: RuntimeInstance.java
/** * Add all properties contained in the file fileName to the RuntimeInstance properties */ public void setProperties(String fileName) { ExtendedProperties props = null; try { props = new ExtendedProperties(fileName); } catch (IOException e) { throw new VelocityException("Error reading properties from '" + fileName + "'", e); } Enumeration en = props.keys(); while (en.hasMoreElements()) { String key = en.nextElement().toString(); setProperty(key, props.get(key)); } }
65. JarHolder#getEntries()
Project: bboss
File: JarHolder.java
File: JarHolder.java
/** * @return The entries of the jar as a hashtable. */ public Hashtable getEntries() { Hashtable allEntries = new Hashtable(559); Enumeration all = theJar.entries(); while (all.hasMoreElements()) { JarEntry je = (JarEntry) all.nextElement(); // We don't map plain directory entries if (!je.isDirectory()) { allEntries.put(je.getName(), this.urlpath); } } return allEntries; }
66. PathMatchingResourcePatternResolver#findAllClassPathResources()
Project: bboss
File: PathMatchingResourcePatternResolver.java
File: PathMatchingResourcePatternResolver.java
/** * Find all class location resources with the given location via the ClassLoader. * @param location the absolute path within the classpath * @return the result as Resource array * @throws IOException in case of I/O errors * @see java.lang.ClassLoader#getResources * @see #convertClassLoaderURL */ protected Resource[] findAllClassPathResources(String location) throws IOException { String path = location; if (path.startsWith("/")) { path = path.substring(1); } Enumeration resourceUrls = getClassLoader().getResources(path); Set result = new LinkedHashSet(16); while (resourceUrls.hasMoreElements()) { URL url = (URL) resourceUrls.nextElement(); result.add(convertClassLoaderURL(url)); } return (Resource[]) result.toArray(new Resource[result.size()]); }
67. WebUtils#getTargetPage()
Project: bboss
File: WebUtils.java
File: WebUtils.java
/** * Return the target page specified in the request. * @param request current servlet request * @param paramPrefix the parameter prefix to check for * (e.g. "_target" for parameters like "_target1" or "_target2") * @param currentPage the current page, to be returned as fallback * if no target page specified * @return the page specified in the request, or current page if not found */ public static int getTargetPage(ServletRequest request, String paramPrefix, int currentPage) { Enumeration paramNames = request.getParameterNames(); while (paramNames.hasMoreElements()) { String paramName = (String) paramNames.nextElement(); if (paramName.startsWith(paramPrefix)) { for (int i = 0; i < WebUtils.SUBMIT_IMAGE_SUFFIXES.length; i++) { String suffix = WebUtils.SUBMIT_IMAGE_SUFFIXES[i]; if (paramName.endsWith(suffix)) { paramName = paramName.substring(0, paramName.length() - suffix.length()); } } return Integer.parseInt(paramName.substring(paramPrefix.length())); } } return currentPage; }
68. PropertiesLoaderUtils#loadAllProperties()
Project: bboss
File: PropertiesLoaderUtils.java
File: PropertiesLoaderUtils.java
/** * Load all properties from the given class path resource, * using the given class loader. * <p>Merges properties if more than one resource of the same name * found in the class path. * @param resourceName the name of the class path resource * @param classLoader the ClassLoader to use for loading * (or <code>null</code> to use the default class loader) * @return the populated Properties instance * @throws IOException if loading failed */ public static Properties loadAllProperties(String resourceName, ClassLoader classLoader) throws IOException { Assert.notNull(resourceName, "Resource name must not be null"); ClassLoader clToUse = classLoader; if (clToUse == null) { clToUse = ClassUtils.getDefaultClassLoader(); } Properties properties = new Properties(); Enumeration urls = clToUse.getResources(resourceName); while (urls.hasMoreElements()) { URL url = (URL) urls.nextElement(); InputStream is = null; try { URLConnection con = url.openConnection(); con.setUseCaches(false); is = con.getInputStream(); properties.load(is); } finally { if (is != null) { is.close(); } } } return properties; }
69. ListingAgent#getParamtereIgnoreCase()
Project: axis2-java
File: ListingAgent.java
File: ListingAgent.java
public String getParamtereIgnoreCase(HttpServletRequest req, String paraName) { Enumeration e = req.getParameterNames(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); if (name.equalsIgnoreCase(paraName)) { String value = req.getParameter(name); return value; } } return null; }
70. SOAPMonitorService#destroy()
Project: axis2-java
File: SOAPMonitorService.java
File: SOAPMonitorService.java
/** * Servlet termination */ public void destroy() { // End all connection threads Enumeration e = connections.elements(); while (e.hasMoreElements()) { ConnectionThread ct = (ConnectionThread) e.nextElement(); ct.close(); } // End main server socket thread if (serverSocket != null) { try { serverSocket.close(); } catch (Exception x) { } serverSocket = null; } }
71. RB#merge()
Project: axis2-java
File: RB.java
File: RB.java
/** Merge two Properties objects */ protected Properties merge(Properties p1, Properties p2) { if ((p1 == null) && (p2 == null)) { return null; } else if (p1 == null) { return p2; } else if (p2 == null) { return p1; } // Now merge. p1 takes precedence Enumeration enumeration = p2.keys(); while (enumeration.hasMoreElements()) { String key = (String) enumeration.nextElement(); if (p1.getProperty(key) == null) { p1.put(key, p2.getProperty(key)); } } return p1; }
72. Utils#getIpAddress()
Project: axis2-java
File: Utils.java
File: Utils.java
/** * Returns the ip address to be used for the replyto epr * CAUTION: * This will go through all the available network interfaces and will try to return an ip address. * First this will try to get the first IP which is not loopback address (127.0.0.1). If none is found * then this will return this will return 127.0.0.1. * This will <b>not<b> consider IPv6 addresses. * <p/> * TODO: * - Improve this logic to genaralize it a bit more * - Obtain the ip to be used here from the Call API * * @return Returns String. * @throws java.net.SocketException */ public static String getIpAddress() throws SocketException { Enumeration e = NetworkInterface.getNetworkInterfaces(); String address = "127.0.0.1"; while (e.hasMoreElements()) { NetworkInterface netface = (NetworkInterface) e.nextElement(); Enumeration addresses = netface.getInetAddresses(); while (addresses.hasMoreElements()) { InetAddress ip = (InetAddress) addresses.nextElement(); if (!ip.isLoopbackAddress() && isIP(ip.getHostAddress())) { return ip.getHostAddress(); } } } return address; }
73. RB#merge()
Project: axis2-java
File: RB.java
File: RB.java
/** * Merge two Properties objects */ protected Properties merge(Properties p1, Properties p2) { if ((p1 == null) && (p2 == null)) { return null; } else if (p1 == null) { return p2; } else if (p2 == null) { return p1; } // Now merge. p1 takes precedence Enumeration enumeration = p2.keys(); while (enumeration.hasMoreElements()) { String key = (String) enumeration.nextElement(); if (p1.getProperty(key) == null) { p1.put(key, p2.getProperty(key)); } } return p1; }
74. AxisService#adjustSchemaNames()
Project: axis2-java
File: AxisService.java
File: AxisService.java
/** * Run 2 - adjust the names */ private Map adjustSchemaNames(List schemas, Hashtable nameTable, Hashtable sourceURIToNewLocationMap) { Hashtable importedSchemas = new Hashtable(); // process the schemas in the main schema list for (int i = 0; i < schemas.size(); i++) { adjustSchemaName((XmlSchema) schemas.get(i), nameTable, importedSchemas, sourceURIToNewLocationMap); } // process all the rest in the name table Enumeration nameTableKeys = nameTable.keys(); while (nameTableKeys.hasMoreElements()) { adjustSchemaName((XmlSchema) nameTableKeys.nextElement(), nameTable, importedSchemas, sourceURIToNewLocationMap); } return importedSchemas; }
75. RegistryService#Unregister()
Project: axis1-java
File: RegistryService.java
File: RegistryService.java
/** * Unregister a serivce * @param server name */ public void Unregister(String name) { Enumeration e1 = registry.keys(); while (e1.hasMoreElements()) { Vector list = (Vector) registry.get(e1.nextElement()); Enumeration e2 = list.elements(); while (e2.hasMoreElements()) { Service s = (Service) e2.nextElement(); if (s.getServiceName().equals(name)) { list.remove(s); save(); } } } }
76. SOAPMonitorService#destroy()
Project: axis1-java
File: SOAPMonitorService.java
File: SOAPMonitorService.java
/** * Servlet termination */ public void destroy() { // End all connection threads Enumeration e = connections.elements(); while (e.hasMoreElements()) { ConnectionThread ct = (ConnectionThread) e.nextElement(); ct.close(); } // End main server socket thread if (server_socket != null) { try { server_socket.close(); } catch (Exception x) { } server_socket = null; } }
77. TestMessages#testAllMessages()
Project: axis1-java
File: TestMessages.java
File: TestMessages.java
public void testAllMessages() { String arg0 = "arg0"; String arg1 = "arg1"; String[] args = { arg0, arg1, "arg2" }; int count = 0; Enumeration keys = Messages.getResourceBundle().getKeys(); while (keys.hasMoreElements()) { count++; String key = (String) keys.nextElement(); try { String message = Messages.getMessage(key); message = Messages.getMessage(key, arg0); message = Messages.getMessage(key, arg0, arg1); message = Messages.getMessage(key, args); } catch (IllegalArgumentException iae) { throw new AssertionFailedError("Test failure on key = " + key + ": " + iae.getMessage()); } } assertTrue("expected # keys greater than " + expectedNumberKeysThreshold + ", only got " + count + "! VERIFY HIERARCHICAL MESSAGES WORK/LINKED CORRECTLY", count > expectedNumberKeysThreshold); }
78. AxisHTTPSessionListener#destroySession()
Project: axis1-java
File: AxisHTTPSessionListener.java
File: AxisHTTPSessionListener.java
/** * Static method to destroy all ServiceLifecycle objects within an * Axis session. */ static void destroySession(HttpSession session) { // Check for our marker so as not to do unneeded work if (session.getAttribute(AxisHttpSession.AXIS_SESSION_MARKER) == null) return; if (log.isDebugEnabled()) { log.debug("Got destroySession event : " + session); } Enumeration e = session.getAttributeNames(); while (e.hasMoreElements()) { Object next = e.nextElement(); if (next instanceof ServiceLifecycle) { ((ServiceLifecycle) next).destroy(); } } }
79. MessageElement#findElement()
Project: axis1-java
File: MessageElement.java
File: MessageElement.java
// setEncodingStyle implemented above // getEncodingStyle() implemented above protected MessageElement findElement(Vector vec, String namespace, String localPart) { if (vec.isEmpty()) { return null; } QName qname = new QName(namespace, localPart); Enumeration e = vec.elements(); MessageElement element; while (e.hasMoreElements()) { element = (MessageElement) e.nextElement(); if (element.getQName().equals(qname)) { return element; } } return null; }
80. RB#merge()
Project: axis1-java
File: RB.java
File: RB.java
/** * Merge two Properties objects */ protected Properties merge(Properties p1, Properties p2) { if ((p1 == null) && (p2 == null)) { return null; } else if (p1 == null) { return p2; } else if (p2 == null) { return p1; } // Now merge. p1 takes precedence Enumeration enumeration = p2.keys(); while (enumeration.hasMoreElements()) { String key = (String) enumeration.nextElement(); if (p1.getProperty(key) == null) { p1.put(key, p2.getProperty(key)); } } return p1; }
81. ForeachTask#executeAntTask()
Project: axis1-java
File: ForeachTask.java
File: ForeachTask.java
private void executeAntTask() { /* if (callee == null) { */ callee = (Ant) getProject().createTask("ant"); callee.setOwningTarget(getOwningTarget()); callee.setTaskName(getTaskName()); callee.init(); /* } */ callee.setAntfile(getProject().getProperty("ant.file")); callee.setTarget(subTarget); callee.setInheritAll(inheritAll); callee.setInheritRefs(inheritRefs); Enumeration keys = properties.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); String val = (String) properties.get(key); Property prop = callee.createProperty(); prop.setName(key); prop.setValue(val); } callee.execute(); System.gc(); System.gc(); System.gc(); }
82. MavenProxyPropertyLoader#getSubset()
Project: archiva
File: MavenProxyPropertyLoader.java
File: MavenProxyPropertyLoader.java
@SuppressWarnings("unchecked") private Properties getSubset(Properties props, String prefix) { Enumeration keys = props.keys(); Properties result = new Properties(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); String value = props.getProperty(key); if (key.startsWith(prefix)) { String newKey = key.substring(prefix.length()); result.setProperty(newKey, value); } } return result; }
83. CnZipOutputStream#finish()
Project: appcan-android
File: CnZipOutputStream.java
File: CnZipOutputStream.java
@SuppressWarnings("rawtypes") public void finish() throws IOException { ensureOpen(); if (this.finished) { return; } if (this.entry != null) { closeEntry(); } if (this.entries.size() < 1) { throw new ZipException("ZIP file must have at least one entry"); } long off = this.written; Enumeration e = this.entries.elements(); while (e.hasMoreElements()) { writeCEN((ZipEntry) e.nextElement()); } writeEND(off, this.written - off); this.finished = true; }
84. VerifiableProperties#verify()
Project: ambry
File: VerifiableProperties.java
File: VerifiableProperties.java
public void verify() { logger.info("Verifying properties"); Enumeration keys = props.propertyNames(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); if (!referenceSet.contains(key)) { logger.warn("Property {} is not valid", key); } else { logger.info("Property {} is overridden to {}", key, props.getProperty(key.toString())); } } }
85. AntClassLoader#cleanup()
Project: Jenkins2
File: AntClassLoader.java
File: AntClassLoader.java
/** * Cleans up any resources held by this classloader. Any open archive * files are closed. */ public synchronized void cleanup() { for (Enumeration e = jarFiles.elements(); e.hasMoreElements(); ) { JarFile jarFile = (JarFile) e.nextElement(); try { jarFile.close(); } catch (IOException ioe) { } } jarFiles = new Hashtable(); if (project != null) { project.removeBuildListener(this); } project = null; }
86. AntClassLoader#getClasspath()
Project: Jenkins2
File: AntClassLoader.java
File: AntClassLoader.java
/** * Returns the classpath this classloader will consult. * * @return the classpath used for this classloader, with elements * separated by the path separator for the system. */ public String getClasspath() { StringBuffer sb = new StringBuffer(); boolean firstPass = true; Enumeration componentEnum = pathComponents.elements(); while (componentEnum.hasMoreElements()) { if (!firstPass) { sb.append(System.getProperty("path.separator")); } else { firstPass = false; } sb.append(((File) componentEnum.nextElement()).getAbsolutePath()); } return sb.toString(); }
87. AdminWhitelistRule#doSubmit()
Project: Jenkins2
File: AdminWhitelistRule.java
File: AdminWhitelistRule.java
@RequirePOST public HttpResponse doSubmit(StaplerRequest req) throws IOException { jenkins.checkPermission(Jenkins.RUN_SCRIPTS); String whitelist = Util.fixNull(req.getParameter("whitelist")); if (!whitelist.endsWith("\n")) whitelist += "\n"; Enumeration e = req.getParameterNames(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); if (name.startsWith("class:")) { whitelist += name.substring(6) + "\n"; } } whitelisted.set(whitelist); String newRules = Util.fixNull(req.getParameter("filePathRules")); // test first before writing a potentially broken rules filePathRules.parseTest(newRules); filePathRules.set(newRules); return HttpResponses.redirectToDot(); }
88. RequestUtil#stowRequestAttributes()
Project: jdonframework
File: RequestUtil.java
File: RequestUtil.java
/** * Stores request attributes in session * * @param aRequest * the current request */ public static void stowRequestAttributes(HttpServletRequest aRequest) { if (aRequest.getSession().getAttribute(STOWED_REQUEST_ATTRIBS) != null) { return; } Enumeration e = aRequest.getAttributeNames(); Map map = new HashMap(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); map.put(name, aRequest.getAttribute(name)); } aRequest.getSession().setAttribute(STOWED_REQUEST_ATTRIBS, map); }
89. CheckWhatYouGet#main()
Project: jdk7u-jdk
File: CheckWhatYouGet.java
File: CheckWhatYouGet.java
public static void main(String[] args) throws Exception { CodeSource codesource = new CodeSource(null, (java.security.cert.Certificate[]) null); Permissions perms = null; ProtectionDomain pd = new ProtectionDomain(codesource, perms); // this should return null if (pd.getPermissions() != null) { System.err.println("TEST FAILED: incorrect Permissions returned"); throw new RuntimeException("test failed: incorrect Permissions returned"); } perms = new Permissions(); pd = new ProtectionDomain(codesource, perms); PermissionCollection pc = pd.getPermissions(); Enumeration e = pc.elements(); if (e.hasMoreElements()) { System.err.println("TEST FAILED: incorrect Permissions returned"); throw new RuntimeException("test failed: incorrect Permissions returned"); } }
90. ResultSet#write()
Project: jdk7u-jdk
File: ResultSet.java
File: ResultSet.java
public void write(PrintWriter pw) { pw.println("<result-set version=\"0.1\" name=\"" + title + "\">"); pw.println(" <test-desc>" + description + "</test-desc>"); pw.println(" <test-date start=\"" + start + "\" end=\"" + end + "\"/>"); for (int i = 0; i < preferredkeys.length; i++) { String key = preferredkeys[i]; pw.println(" <sys-prop key=\"" + key + "\" value=\"" + props.get(key) + "\"/>"); } Enumeration enum_ = props.keys(); while (enum_.hasMoreElements()) { Object key = enum_.nextElement(); if (!preferprops.containsKey(key)) { pw.println(" <sys-prop key=\"" + key + "\" value=\"" + props.get(key) + "\"/>"); } } for (int i = 0; i < results.size(); i++) { ((Result) results.elementAt(i)).write(pw); } pw.println("</result-set>"); }
91. Result#write()
Project: jdk7u-jdk
File: Result.java
File: Result.java
public void write(PrintWriter pw) { pw.println(" <result " + "num-reps=\"" + getRepsPerRun() + "\" " + "num-units=\"" + getUnitsPerRep() + "\" " + "name=\"" + test.getTreeName() + "\">"); Enumeration enum_ = modifiers.keys(); while (enum_.hasMoreElements()) { Modifier mod = (Modifier) enum_.nextElement(); Object v = modifiers.get(mod); String val = mod.getModifierValueName(v); pw.println(" <option " + "key=\"" + mod.getTreeName() + "\" " + "value=\"" + val + "\"/>"); } for (int i = 0; i < getNumRuns(); i++) { pw.println(" <time value=\"" + getTime(i) + "\"/>"); } pw.println(" </result>"); }
92. Crossings#findCrossings()
Project: jdk7u-jdk
File: Crossings.java
File: Crossings.java
public static Crossings findCrossings(Vector curves, double xlo, double ylo, double xhi, double yhi) { Crossings cross = new EvenOdd(xlo, ylo, xhi, yhi); Enumeration enum_ = curves.elements(); while (enum_.hasMoreElements()) { Curve c = (Curve) enum_.nextElement(); if (c.accumulateCrossings(cross)) { return null; } } if (debug) { cross.print(); } return cross; }
93. StateEdit#removeRedundantState()
Project: jdk7u-jdk
File: StateEdit.java
File: StateEdit.java
// // Internal support // /** * Remove redundant key/values in state hashtables. */ protected void removeRedundantState() { Vector<Object> uselessKeys = new Vector<Object>(); Enumeration myKeys = preState.keys(); // Locate redundant state while (myKeys.hasMoreElements()) { Object myKey = myKeys.nextElement(); if (postState.containsKey(myKey) && postState.get(myKey).equals(preState.get(myKey))) { uselessKeys.addElement(myKey); } } // Remove redundant state for (int i = uselessKeys.size() - 1; i >= 0; i--) { Object myKey = uselessKeys.elementAt(i); preState.remove(myKey); postState.remove(myKey); } }
94. SimpleAttributeSet#toString()
Project: jdk7u-jdk
File: SimpleAttributeSet.java
File: SimpleAttributeSet.java
/** * Converts the attribute set to a String. * * @return the string */ public String toString() { String s = ""; Enumeration names = getAttributeNames(); while (names.hasMoreElements()) { Object key = names.nextElement(); Object value = getAttribute(key); if (value instanceof AttributeSet) { // don't go recursive s = s + key + "=**AttributeSet** "; } else { s = s + key + "=" + value + " "; } } return s; }
95. HTMLWriter#convertToHTML40()
Project: jdk7u-jdk
File: HTMLWriter.java
File: HTMLWriter.java
/** * Copies the given AttributeSet to a new set, converting * any CSS attributes found to arguments of an HTML style * attribute. */ private static void convertToHTML40(AttributeSet from, MutableAttributeSet to) { Enumeration keys = from.getAttributeNames(); String value = ""; while (keys.hasMoreElements()) { Object key = keys.nextElement(); if (key instanceof CSS.Attribute) { value = value + " " + key + "=" + from.getAttribute(key) + ";"; } else { to.addAttribute(key, from.getAttribute(key)); } } if (value.length() > 0) { to.addAttribute(HTML.Attribute.STYLE, value); } }
96. HTMLWriter#writeEmbeddedTags()
Project: jdk7u-jdk
File: HTMLWriter.java
File: HTMLWriter.java
/** * Searches for embedded tags in the AttributeSet * and writes them out. It also stores these tags in a vector * so that when appropriate the corresponding end tags can be * written out. * * @exception IOException on any I/O error */ protected void writeEmbeddedTags(AttributeSet attr) throws IOException { // translate css attributes to html attr = convertToHTML(attr, oConvAttr); Enumeration names = attr.getAttributeNames(); while (names.hasMoreElements()) { Object name = names.nextElement(); if (name instanceof HTML.Tag) { HTML.Tag tag = (HTML.Tag) name; if (tag == HTML.Tag.FORM || tags.contains(tag)) { continue; } write('<'); write(tag.toString()); Object o = attr.getAttribute(tag); if (o != null && o instanceof AttributeSet) { writeAttributes((AttributeSet) o); } write('>'); tags.addElement(tag); tagValues.addElement(o); } } }
97. HTMLWriter#writeAttributes()
Project: jdk7u-jdk
File: HTMLWriter.java
File: HTMLWriter.java
/** * Writes out the attribute set. Ignores all * attributes with a key of type HTML.Tag, * attributes with a key of type StyleConstants, * and attributes with a key of type * HTML.Attribute.ENDTAG. * * @param attr an AttributeSet * @exception IOException on any I/O error * */ protected void writeAttributes(AttributeSet attr) throws IOException { // translate css attributes to html convAttr.removeAttributes(convAttr); convertToHTML32(attr, convAttr); Enumeration names = convAttr.getAttributeNames(); while (names.hasMoreElements()) { Object name = names.nextElement(); if (name instanceof HTML.Tag || name instanceof StyleConstants || name == HTML.Attribute.ENDTAG) { continue; } write(" " + name + "=\"" + convAttr.getAttribute(name) + "\""); } }
98. CSS#translateEmbeddedAttributes()
Project: jdk7u-jdk
File: CSS.java
File: CSS.java
private void translateEmbeddedAttributes(AttributeSet htmlAttrSet, MutableAttributeSet cssAttrSet) { Enumeration keys = htmlAttrSet.getAttributeNames(); if (htmlAttrSet.getAttribute(StyleConstants.NameAttribute) == HTML.Tag.HR) { // HR needs special handling due to us treating it as a leaf. translateAttributes(HTML.Tag.HR, htmlAttrSet, cssAttrSet); } while (keys.hasMoreElements()) { Object key = keys.nextElement(); if (key instanceof HTML.Tag) { HTML.Tag tag = (HTML.Tag) key; Object o = htmlAttrSet.getAttribute(tag); if (o != null && o instanceof AttributeSet) { translateAttributes(tag, (AttributeSet) o, cssAttrSet); } } else if (key instanceof CSS.Attribute) { cssAttrSet.addAttribute(key, htmlAttrSet.getAttribute(key)); } } }
99. DefaultTableColumnModel#getColumnIndex()
Project: jdk7u-jdk
File: DefaultTableColumnModel.java
File: DefaultTableColumnModel.java
/** * Returns the index of the first column in the <code>tableColumns</code> * array whose identifier is equal to <code>identifier</code>, * when compared using <code>equals</code>. * * @param identifier the identifier object * @return the index of the first column in the * <code>tableColumns</code> array whose identifier * is equal to <code>identifier</code> * @exception IllegalArgumentException if <code>identifier</code> * is <code>null</code>, or if no * <code>TableColumn</code> has this * <code>identifier</code> * @see #getColumn */ public int getColumnIndex(Object identifier) { if (identifier == null) { throw new IllegalArgumentException("Identifier is null"); } Enumeration enumeration = getColumns(); TableColumn aColumn; int index = 0; while (enumeration.hasMoreElements()) { aColumn = (TableColumn) enumeration.nextElement(); // Compare them this way in case the column's identifier is null. if (identifier.equals(aColumn.getIdentifier())) return index; index++; } throw new IllegalArgumentException("Identifier not found"); }
100. BasicSliderUI#getLowestValue()
Project: jdk7u-jdk
File: BasicSliderUI.java
File: BasicSliderUI.java
/** * Returns the smallest value that has an entry in the label table. * * @return smallest value that has an entry in the label table, or * null. * @since 1.6 */ protected Integer getLowestValue() { Dictionary dictionary = slider.getLabelTable(); if (dictionary == null) { return null; } Enumeration keys = dictionary.keys(); Integer min = null; while (keys.hasMoreElements()) { Integer i = (Integer) keys.nextElement(); if (min == null || i < min) { min = i; } } return min; }