本文整理汇总了Java中proguard.classfile.visitor.ClassVersionSetter类的典型用法代码示例。如果您正苦于以下问题:Java ClassVersionSetter类的具体用法?Java ClassVersionSetter怎么用?Java ClassVersionSetter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClassVersionSetter类属于proguard.classfile.visitor包,在下文中一共展示了ClassVersionSetter类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import proguard.classfile.visitor.ClassVersionSetter; //导入依赖的package包/类
/**
* Sets the target version on classes in the given program class pool.
*/
public void execute(ClassPool programClassPool) throws IOException
{
Set newerClassVersions = configuration.warn != null ? null : new HashSet();
programClassPool.classesAccept(new ClassVersionSetter(configuration.targetClassVersion,
newerClassVersions));
if (newerClassVersions != null &&
newerClassVersions.size() > 0)
{
System.err.print("Warning: some classes have more recent versions (");
Iterator iterator = newerClassVersions.iterator();
while (iterator.hasNext())
{
Integer classVersion = (Integer)iterator.next();
System.err.print(ClassUtil.externalClassVersion(classVersion.intValue()));
if (iterator.hasNext())
{
System.err.print(",");
}
}
System.err.println(")");
System.err.println(" than the target version ("+ClassUtil.externalClassVersion(configuration.targetClassVersion)+").");
if (!configuration.ignoreWarnings)
{
System.err.println(" If you are sure this is not a problem,");
System.err.println(" you could try your luck using the '-ignorewarnings' option.");
throw new IOException("Please correct the above warnings first.");
}
}
}