Package edu.umd.cs.findbugs.classfile

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


            //
            // Found findbugs-full.jar: add it to the aux classpath.
            // (This is a bit weird, since we only want to resolve a subset
            // of its classes.)
            //
            ICodeBaseLocator loc = new FilesystemCodeBaseLocator(findbugsFullJar);
            workList.addLast(new WorkListItem(loc, false, ICodeBase.Discovered.IN_SYSTEM_CLASSPATH));
        }
        return workList;
    }
View Full Code Here


            } else if (loc2.exists()) {
                loc = loc2;
            }
            if (loc != null) {
                found = true;
                ICodeBaseLocator codeBaseLocator = classFactory.createFilesystemCodeBaseLocator(loc.getPath());
                workList.add(new WorkListItem(codeBaseLocator, false, ICodeBase.Discovered.IN_SYSTEM_CLASSPATH));
            }
        }

        if (!found) {
            if (DEBUG) {
                System.out.println("Looking for " + jarFileName + " on classpath...");
            }
            //
            // See if the required jar file is available on the class path.
            //
            String javaClassPath = SystemProperties.getProperty("java.class.path");
            StringTokenizer t = new StringTokenizer(javaClassPath, File.pathSeparator);
            while (t.hasMoreTokens()) {
                String entry = t.nextToken();
                if (DEBUG) {
                    System.out.print("  Checking " + entry + "...");
                }

                if (matchesJarFile(entry, jarFileName)) {
                    found = true;
                } else if (matchesJarFile(entry, "findbugs.jar")) {
                    // See if the searched-for jar file can be found
                    // alongside findbugs.jar.
                    File findbugsJar = new File(entry);
                    File loc = new File(findbugsJar.getParent() + File.separator + jarFileName);
                    if (DEBUG) {
                        System.out.print(" [findbugs.jar, checking " + loc.getPath() + "] ");
                    }
                    if (loc.exists()) {
                        entry = loc.getPath();
                        found = true;
                    }
                }

                if (DEBUG) {
                    System.out.println(found ? "FOUND" : "no");
                }
                if (found) {
                    ICodeBaseLocator codeBaseLocator = classFactory.createFilesystemCodeBaseLocator(entry);
                    workList.add(new WorkListItem(codeBaseLocator, false, ICodeBase.Discovered.IN_SYSTEM_CLASSPATH));
                    break;
                }

            }
View Full Code Here

            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

                for (String path : pathList) {
                    // Create a codebase locator for the classpath entry
                    // relative to the codebase in which we discovered the Jar
                    // manifest
                    ICodeBaseLocator relativeCodeBaseLocator = codeBase.getCodeBaseLocator().createRelativeCodeBaseLocator(path);

                    // Codebases found in Class-Path entries are always
                    // added to the aux classpath, not the application.
                    addToWorkList(workList, new WorkListItem(relativeCodeBaseLocator, false, ICodeBase.Discovered.IN_JAR_MANIFEST));
                }
View Full Code Here

TOP

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

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.