Package edu.umd.cs.findbugs.classfile

Examples of edu.umd.cs.findbugs.classfile.ICodeBaseEntry


        IScannableCodeBase codeBase = (IScannableCodeBase) discoveredCodeBase.getCodeBase();

        ICodeBaseIterator i = codeBase.iterator();
        while (i.hasNext()) {
            ICodeBaseEntry entry = i.next();
            if (VERBOSE) {
                System.out.println("Entry: " + entry.getResourceName());
            }

            if (!NO_PARSE_CLASS_NAMES && codeBase.isApplicationCodeBase()
                    && DescriptorFactory.isClassResource(entry.getResourceName()) && !(entry instanceof SingleFileCodeBaseEntry)) {
                parseClassName(entry);
            }

            // Note the resource exists in this codebase
            discoveredCodeBase.addCodeBaseEntry(entry);

            // If resource is a nested archive, add it to the worklist
            if (scanNestedArchives && (codeBase.isApplicationCodeBase() || codeBase instanceof DirectoryCodeBase)
                    && Archive.isLibraryFileName(entry.getResourceName())) {
                if (VERBOSE) {
                    System.out.println("Entry is an library!");
                }
                ICodeBaseLocator nestedArchiveLocator = classFactory.createNestedArchiveCodeBaseLocator(codeBase,
                        entry.getResourceName());
                addToWorkList(workList,
                        new WorkListItem(nestedArchiveLocator, codeBase.isApplicationCodeBase(), ICodeBase.Discovered.NESTED));
            }
        }
    }
View Full Code Here


     *            the codebase for examine for a Jar manifest
     * @throws IOException
     */
    private void scanJarManifestForClassPathEntries(LinkedList<WorkListItem> workList, ICodeBase codeBase) throws IOException {
        // See if this codebase has a jar manifest
        ICodeBaseEntry manifestEntry = codeBase.lookupResource("META-INF/MANIFEST.MF");
        if (manifestEntry == null) {
            // Do nothing - no Jar manifest found
            return;
        }

        // Try to read the manifest
        InputStream in = null;
        try {
            in = manifestEntry.openResource();
            Manifest manifest = new Manifest(in);

            Attributes mainAttrs = manifest.getMainAttributes();
            String classPath = mainAttrs.getValue("Class-Path");
            if (classPath != null) {
View Full Code Here

            public ICodeBaseEntry next() throws InterruptedException {
                scanForNextEntry();
                if (nextEntry == null) {
                    throw new NoSuchElementException();
                }
                ICodeBaseEntry result = nextEntry;
                nextEntry = null;
                return result;
            }

            private void scanForNextEntry() {
View Full Code Here

    private String findFullyQualifiedSourceFileName(IClassPath classPath, ClassDescriptor classDesc) throws IOException,
    CheckedAnalysisException {
        try {
            // Open and parse the class file to attempt
            // to discover the source file name.
            ICodeBaseEntry codeBaseEntry = classPath.lookupResource(classDesc.toResourceName());

            ClassParserUsingASM classParser = new ClassParserUsingASM(new ClassReader(codeBaseEntry.openResource()), classDesc,
                    codeBaseEntry);

            ClassInfo.Builder classInfoBuilder = new ClassInfo.Builder();
            classParser.parse(classInfoBuilder);
            ClassInfo classInfo = classInfoBuilder.build();
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.classfile.ICodeBaseEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.