/*
input:  /org/MyClass.class
output: org.MyClass
329703
public static String findClassName(ArchivePath path) {
        String className = path.get();
        className = className.replaceAll("/WEB-INF/classes/", "");
        if (className.charAt(0) == '/') {
            className = className.substring(1);
        }
        className = className.replaceAll("\\.class", "");
        className = className.replaceAll("/", ".");
        return className;
    }
708469
function generateFileName(className) {
    return className
        .replace(/component/gi, '')
        .replace(/system/gi, '')
        .replace('2D', '2d')
        .replace('3D', '3d')
        .replace(/^[A-Z]/, function(c) {
            return c.toLowerCase();
        })
        .replace(/[A-Z]/g, function(c) {
            return '-' + c.toLowerCase();
        }) + '.js';
}
894890
public static File getClassFileFromDirectoryInClassPath(String className) {
		String fileName = StringSupport.replaceAll(className, ".", "/");
		fileName += ".class";
		return getFileFromDirectoryInClassPath(fileName, System.getProperty("java.class.path"));
	}
708775
function() {
        var comp,
            c = this.__c,
            str = "";
        for (comp in c) {
            str += " " + comp;
        }
        str = str.substr(1);
        this._element.className = str;
    }
1000327
function () {
            var el = this.element(),
                cName = $B( el ).attr( 'class' ),
                args = arguments;
    
            if ( cName ) {
                var argNum = args.length, selector = '', i;
    
                for ( i = 0; i < argNum; ++i ) {
                    var arg = args[i];
                    if ( !$B.string.isWholeWord( cName, arg ) ) selector += ( ' ' + arg );
                }
    
                $B( el ).attr( 'class', cName + selector );
            } else {
                $B( el ).attr( 'class', Array.prototype.slice.call(args).join(' ') );
            }
        }
1073164
public static void main(String[] args) throws IOException, ClassNotFoundException {
    CoNLLDocumentReaderAndWriter f = new CoNLLDocumentReaderAndWriter();
    f.init(new SeqClassifierFlags());
    int numDocs = 0;
    int numTokens = 0;
    int numEntities = 0;
    String lastAnsBase = "";
    for (Iterator<List<CoreLabel>> it = f.getIterator(new FileReader(args[0])); it.hasNext(); ) {
      List<CoreLabel> doc = it.next();
      numDocs++;
      for (CoreLabel fl : doc) {
        // System.out.println("FL " + (++i) + " was " + fl);
        if (fl.word().equals(BOUNDARY)) {
          continue;
        }
        String ans = fl.get(AnswerAnnotation.class);
        String ansBase;
        String ansPrefix;
        String[] bits = ans.split("-");
        if (bits.length == 1) {
          ansBase = bits[0];
          ansPrefix = "";
        } else {
          ansBase = bits[1];
          ansPrefix = bits[0];
        }
        numTokens++;
        if (ansBase.equals("O")) {
        } else if (ansBase.equals(lastAnsBase)) {
          if (ansPrefix.equals("B")) {
            numEntities++;
          }
        } else {
          numEntities++;
        }
      }
    }
    System.out.println("File " + args[0] + " has " + numDocs + " documents, " +
            numTokens + " (non-blank line) tokens and " +
            numEntities + " entities.");
  }
673917
private String formatElement(final Object element, final Map classMap) {
        StringBuffer buf = new StringBuffer("\tat ");
        buf.append(element);
        try {
            String className = getClassNameMethod.invoke(element, (Object[])null).toString();
            Object classDetails = classMap.get(className);
            if (classDetails != null) {
                buf.append(classDetails);
            } else {
                Class cls = findClass(className);
                int detailStart = buf.length();
                buf.append('[');
                String mavenCoordinates = MavenCoordHelper.getMavenCoordinates(cls);
                if (!Objects.isBlank(mavenCoordinates)) {
                    buf.append(mavenCoordinates);
                } else {
                    try {
                        CodeSource source = cls.getProtectionDomain().getCodeSource();
                        if (source != null) {
                            URL locationURL = source.getLocation();
                            if (locationURL != null) {
                                //
                                //   if a file: URL
                                //
                                if ("file".equals(locationURL.getProtocol())) {
                                    String path = locationURL.getPath();
                                    if (path != null) {
                                        //
                                        //  find the last file separator character
                                        //
                                        int lastSlash = path.lastIndexOf('/');
                                        int lastBack = path.lastIndexOf(File.separatorChar);
                                        if (lastBack > lastSlash) {
                                            lastSlash = lastBack;
                                        }
                                        //
                                        //  if no separator or ends with separator (a directory)
                                        //     then output the URL, otherwise just the file name.
                                        //
                                        if (lastSlash <= 0 || lastSlash == path.length() - 1) {
                                            buf.append(locationURL);
                                        } else {
                                            buf.append(path.substring(lastSlash + 1));
                                        }
                                    }
                                } else {
                                    buf.append(locationURL);
                                }
                            }
                        }
                    } catch (SecurityException ex) {
                    }
                    buf.append(':');
                    Package pkg = cls.getPackage();
                    if (pkg != null) {
                        String implVersion = pkg.getImplementationVersion();
                        if (implVersion != null) {
                            buf.append(implVersion);
                        }
                    }
                }
                buf.append(']');
                classMap.put(className, buf.substring(detailStart));
            }
        } catch (Exception ex) {
        }
        return buf.toString();
    }
1321881
private void generateUMLClass(ClassDoc[] classes, String pkgname) throws IOException {
        for (int i=0; i<classes.length; i++) {
            ClassDoc c = classes[i];
            out.println("    <UML:Class stereotype=\"\" " +
                                     "package=\"" + pkgname + "\" " +
                                     "xmi.id=\"" + i + "\" " +
                                     "abstract=\"0\" " +
                                     "documentation=\"\" " +
                                     "name=\"" + c.name() + "\" " +
                                     "scope=\"200\">");
            MethodDoc[] methods = c.methods();
            for (int j=0; j<methods.length; j++) {
                MethodDoc md = methods[j];
                out.println("     <UML:Operation stereotype=\"\" " +
                                                "xmi.id=\"" + (1000*i + j) + "\" " +
                                                "type=\"void\" " +
                                                "abstract=\"0\" " +
                                                "documentation=\"\" " +
                                                "name=\"" + md.name() + "\" " +
                                                "scope=\"200\" />");
            }
            out.println("    </UML:Class>");
        }
    }
1203546
protected void generateClassUseFile() throws IOException {
        Content body = getClassUseHeader();
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
        div.addStyle(HtmlStyle.classUseContainer);
        if (pkgSet.size() > 0) {
            addClassUse(div);
        } else {
            div.addContent(getResource("doclet.ClassUse_No.usage.of.0",
                    classdoc.qualifiedName()));
        }
        body.addContent(div);
        addNavLinks(false, body);
        addBottom(body);
        printHtmlDocument(null, true, body);
    }
783905
function getClassIndex(element, className) {
  assertType(element, Node, false, 'Invalid element specified');
  assertType(className, 'string', false, `Invalid class name: ${className}`);
  let classList = element.className.split(' ');
  return classList.indexOf(className);
}
1327478
private String extractClassName(URL classURL) {
        String path = classURL.getPath();
        return path
            .replaceAll("^/", "")
            .replaceAll(".class$", "")
            .replaceAll("\\/", ".");
    }
91250
protected InputStream getClassInputStream(String classInternalName) {
        if (classInternalName == null || "".equals(classInternalName)) {
            return null;
        }

        InputStream inputStream = null;
        try {
            for (File jarFile : jarFiles) {
                ZipFile zipFile = new ZipFile(jarFile);
                ZipEntry zipEntry = zipFile.getEntry(classInternalName + ".class");
                if (zipEntry != null) {
                    InputStream zis = zipFile.getInputStream(zipEntry);
                    byte[] bytecode = toByteArray(zis);
                    if (isStreamForClass(new ByteArrayInputStream(bytecode), classInternalName)) {
                        inputStream = new ByteArrayInputStream(bytecode);
                    }
                    zis.close();
                }
                zipFile.close();

                if (inputStream != null) {
                    return inputStream;
                }
            }

            String fileName = classInternalName + ".class";
            fileName = fileName.substring(fileName.lastIndexOf('/') + 1);
            for (File classFile : classFiles) {
                if (classFile.getName().equals(fileName)) {
                    FileInputStream fis = new FileInputStream(classFile);
                    byte[] bytecode = toByteArray(fis);
                    if (isStreamForClass(new ByteArrayInputStream(bytecode), classInternalName)) {
                        inputStream = new ByteArrayInputStream(bytecode);
                    }
                    fis.close();
                }
                if (inputStream != null) {
                    return inputStream;
                }
            }
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }
        return null;
    }
1354076
@Override
   public void writeClassBody(Definition def, Writer out) throws IOException
   {

      out.write("public class " + getClassName(def) + " implements " +
            def.getMcfDefs().get(getNumOfMcf()).getConnInterfaceClass());
      writeLeftCurlyBracket(out, 0);
      int indent = 1;
      writeWithIndent(out, indent, "/** The logger */\n");
      writeWithIndent(out, indent, "private static Logger log = Logger.getLogger(" + getSelfClassName(def) + ");\n\n");

      writeWithIndent(out, indent, "/** ManagedConnection */\n");
      writeWithIndent(out, indent, "private " + def.getMcfDefs().get(getNumOfMcf()).getMcClass() + " mc;\n\n");

      writeWithIndent(out, indent, "/** ManagedConnectionFactory */\n");
      writeWithIndent(out, indent, "private " + def.getMcfDefs().get(getNumOfMcf()).getMcfClass() + " mcf;\n\n");

      //constructor
      writeWithIndent(out, indent, "/**\n");
      writeWithIndent(out, indent, " * Default constructor\n");
      writeWithIndent(out, indent, " * @param mc " + def.getMcfDefs().get(getNumOfMcf()).getMcClass());
      writeEol(out);
      writeWithIndent(out, indent, " * @param mcf " + def.getMcfDefs().get(getNumOfMcf()).getMcfClass());
      writeEol(out);
      writeWithIndent(out, indent, " */\n");

      writeWithIndent(out, indent, "public " + getClassName(def) + "(" +
            def.getMcfDefs().get(getNumOfMcf()).getMcClass() + " mc, " +
            def.getMcfDefs().get(getNumOfMcf()).getMcfClass() + " mcf)");
      writeLeftCurlyBracket(out, indent);
      writeWithIndent(out, indent + 1, "this.mc = mc;\n");
      writeWithIndent(out, indent + 1, "this.mcf = mcf;");
      writeRightCurlyBracket(out, indent);
      writeEol(out);

      writeMethod(def, out, indent);
      writeRightCurlyBracket(out, 0);
   }
160843
private synchronized void name(InstructionGroup group, ParserClassNode classNode) {
        // generate an MD5 hash across the buffer, use only the first 96 bit
        MD5Digester digester = new MD5Digester(classNode.name);
        group.getInstructions().accept(digester);
        for (FieldNode field: group.getFields()) digester.visitField(field);
        byte[] hash = digester.getMD5Hash();
        byte[] hash96 = new byte[12];
        System.arraycopy(hash, 0, hash96, 0, 12);

        // generate a name for the group based on the hash
        String name = group.getRoot().isActionRoot() ? "Action$" : "VarInit$";
        name += CUSTOM_BASE64.encodeToString(hash96, false);
        group.setName(name);
    }
1321579
private static String targetToString(Object target) {
		if (target instanceof Class) {
			return ((Class<?>) target).getName();
		} else {
			return target.toString();
		}
	}
1366702
public void dumpDTM(OutputStream os)
  {
    try
    {
      if(os==null)
      {
	      File f = new File("DTMDump"+((Object)this).hashCode()+".txt");
 	      System.err.println("Dumping... "+f.getAbsolutePath());
 	      os=new FileOutputStream(f);
      }
      PrintStream ps = new PrintStream(os);

      while (nextNode()){}

      int nRecords = m_size;

      ps.println("Total nodes: " + nRecords);

      for (int index = 0; index < nRecords; ++index)
      {
      	int i=makeNodeHandle(index);
        ps.println("=========== index=" + index + " handle=" + i + " ===========");
        ps.println("NodeName: " + getNodeName(i));
        ps.println("NodeNameX: " + getNodeNameX(i));
        ps.println("LocalName: " + getLocalName(i));
        ps.println("NamespaceURI: " + getNamespaceURI(i));
        ps.println("Prefix: " + getPrefix(i));

        int exTypeID = _exptype(index);

        ps.println("Expanded Type ID: "
                           + Integer.toHexString(exTypeID));

        int type = _type(index);
        String typestring;

        switch (type)
        {
        case DTM.ATTRIBUTE_NODE :
          typestring = "ATTRIBUTE_NODE";
          break;
        case DTM.CDATA_SECTION_NODE :
          typestring = "CDATA_SECTION_NODE";
          break;
        case DTM.COMMENT_NODE :
          typestring = "COMMENT_NODE";
          break;
        case DTM.DOCUMENT_FRAGMENT_NODE :
          typestring = "DOCUMENT_FRAGMENT_NODE";
          break;
        case DTM.DOCUMENT_NODE :
          typestring = "DOCUMENT_NODE";
          break;
        case DTM.DOCUMENT_TYPE_NODE :
          typestring = "DOCUMENT_NODE";
          break;
        case DTM.ELEMENT_NODE :
          typestring = "ELEMENT_NODE";
          break;
        case DTM.ENTITY_NODE :
          typestring = "ENTITY_NODE";
          break;
        case DTM.ENTITY_REFERENCE_NODE :
          typestring = "ENTITY_REFERENCE_NODE";
          break;
        case DTM.NAMESPACE_NODE :
          typestring = "NAMESPACE_NODE";
          break;
        case DTM.NOTATION_NODE :
          typestring = "NOTATION_NODE";
          break;
        case DTM.NULL :
          typestring = "NULL";
          break;
        case DTM.PROCESSING_INSTRUCTION_NODE :
          typestring = "PROCESSING_INSTRUCTION_NODE";
          break;
        case DTM.TEXT_NODE :
          typestring = "TEXT_NODE";
          break;
        default :
          typestring = "Unknown!";
          break;
        }

        ps.println("Type: " + typestring);

        int firstChild = _firstch(index);

        if (DTM.NULL == firstChild)
          ps.println("First child: DTM.NULL");
        else if (NOTPROCESSED == firstChild)
          ps.println("First child: NOTPROCESSED");
        else
          ps.println("First child: " + firstChild);

        if (m_prevsib != null)
        {
          int prevSibling = _prevsib(index);

          if (DTM.NULL == prevSibling)
            ps.println("Prev sibling: DTM.NULL");
          else if (NOTPROCESSED == prevSibling)
            ps.println("Prev sibling: NOTPROCESSED");
          else
            ps.println("Prev sibling: " + prevSibling);
        }

        int nextSibling = _nextsib(index);

        if (DTM.NULL == nextSibling)
          ps.println("Next sibling: DTM.NULL");
        else if (NOTPROCESSED == nextSibling)
          ps.println("Next sibling: NOTPROCESSED");
        else
          ps.println("Next sibling: " + nextSibling);

        int parent = _parent(index);

        if (DTM.NULL == parent)
          ps.println("Parent: DTM.NULL");
        else if (NOTPROCESSED == parent)
          ps.println("Parent: NOTPROCESSED");
        else
          ps.println("Parent: " + parent);

        int level = _level(index);

        ps.println("Level: " + level);
        ps.println("Node Value: " + getNodeValue(i));
        ps.println("String Value: " + getStringValue(i));
      }
    }
    catch(IOException ioe)
    {
      ioe.printStackTrace(System.err);
        throw new RuntimeException(ioe.getMessage());
    }
  }
434419
private static String classToString(final Class<?> c) {
        if (c.isArray()) {
            return toString(c.getComponentType()) + "[]";
        }

        final StringBuilder buf = new StringBuilder();

        if (c.getEnclosingClass() != null) {
            buf.append(classToString(c.getEnclosingClass())).append('.').append(c.getSimpleName());
        } else {
            buf.append(c.getName());
        }
        if (c.getTypeParameters().length > 0) {
            buf.append('<');
            appendAllTo(buf, ", ", c.getTypeParameters());
            buf.append('>');
        }
        return buf.toString();
    }