当前位置: 首页>>代码示例>>Java>>正文


Java Repository.setRepository方法代码示例

本文整理汇总了Java中org.apache.bcel.Repository.setRepository方法的典型用法代码示例。如果您正苦于以下问题:Java Repository.setRepository方法的具体用法?Java Repository.setRepository怎么用?Java Repository.setRepository使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.bcel.Repository的用法示例。


在下文中一共展示了Repository.setRepository方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: clearRepository

import org.apache.bcel.Repository; //导入方法依赖的package包/类
/**
 * Clear the Repository and update it to reflect the classpath
 * specified by the current project.
 */
private void clearRepository() {
	// Purge repository of previous contents
	Repository.clearCache();

	// Clear InnerClassAccessMap cache.
	InnerClassAccessMap.instance().clearCache();

	// Create a URLClassPathRepository based on the current project,
	// and make it current.
	URLClassPathRepository repository = new URLClassPathRepository(); 
	Repository.setRepository(repository);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:17,代码来源:FindBugs.java

示例2: addAverroesLibraryClassFile

import org.apache.bcel.Repository; //导入方法依赖的package包/类
/**
 * Add the generated AverroesLibraryClass file to the Jar file.
 * 
 * @throws IOException
 * @throws URISyntaxException
 */
public void addAverroesLibraryClassFile() throws IOException, URISyntaxException {
	File dir = Paths.libraryClassesOutputDirectory();
	File placeholderJar = Paths.placeholderLibraryJarFile();
	File averroesLibraryClassJar = Paths.averroesLibraryClassJarFile();

	File file = FileUtils.listFiles(dir, new String[] { "class" }, true).stream()
			.filter(f -> relativize(dir, f).equals(Names.AVERROES_LIBRARY_CLASS_BC_SIG + ".class"))
			.collect(Collectors.toList()).get(0);
	String className = relativize(dir, file);

	// Add the class file to the separately crafted JAR file.
	if (file.isFile()) {
		add(dir, file);
	} else {
		throw new IllegalStateException("cannot find " + Names.AVERROES_LIBRARY_CLASS
				+ System.getProperty("line.separator") + "Invalid path given: " + fileName);
	}
	close();

	// Set BCEL's repository class path.
	SyntheticRepository rep = SyntheticRepository.getInstance(new ClassPath(averroesLibraryClassJar
			+ File.pathSeparator + placeholderJar + File.pathSeparator + Paths.organizedApplicationJarFile()));
	Repository.setRepository(rep);

	// Now add the class files (including ones from placeholder JAR) to the
	// BCEL repository.
	ClassParser parser = new ClassParser(averroesLibraryClassJar.getPath(), className);
	JavaClass cls = parser.parse();
	bcelClasses.add(cls);

	// Now we need to add all the BCEL classes (including ones from previous
	// placeholder JAR to force BCEL to load
	// those crafted files when it looks them up
	bcelClasses.forEach(c -> Repository.getRepository().storeClass(c));

	// Now verify all the generated class files
	verify();
}
 
开发者ID:karimhamdanali,项目名称:averroes,代码行数:45,代码来源:JarFile.java

示例3: transform

import org.apache.bcel.Repository; //导入方法依赖的package包/类
public byte[] transform(final byte[] original) {
    if(repository == null) {
        return doTransform(original);
    } else {
        synchronized(repositoryLock) {
            org.apache.bcel.util.Repository old = Repository.getRepository();
            Repository.setRepository(repository);
            try {
                return doTransform(original);
            } finally {
                Repository.setRepository(old);
            }
        }
    }
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:16,代码来源:BcelClassTransformer.java

示例4: setClassLoader

import org.apache.bcel.Repository; //导入方法依赖的package包/类
/**
 * Stores the class loader and makes it the Repository's class loader.
 * @param aClassLoader class loader to resolve classes with.
 */
public void setClassLoader(ClassLoader aClassLoader)
{
    Repository.setRepository(new ClassLoaderRepository(aClassLoader));
    mClassLoader = aClassLoader;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:ClassFileSetCheck.java

示例5: clearRepository

import org.apache.bcel.Repository; //导入方法依赖的package包/类
@Override
public void clearRepository() {
    // Set the backing store for the BCEL Repository to
    // be the AnalysisCache.
    Repository.setRepository(new AnalysisCacheToRepositoryAdapter());
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:7,代码来源:AnalysisCacheToAnalysisContextAdapter.java

示例6: clearRepository

import org.apache.bcel.Repository; //导入方法依赖的package包/类
/**
 * Clear the BCEL Repository in preparation for analysis.
 */
public void clearRepository() {
    // Set the backing store for the BCEL Repository to
    // be the AnalysisCache.
    Repository.setRepository(new AnalysisCacheToRepositoryAdapter());
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:9,代码来源:AnalysisContext.java


注:本文中的org.apache.bcel.Repository.setRepository方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。