private List<JApiClass> createAndCompareClassLists(List<File> oldArchives, List<File> newArchives) { List<CtClass> oldClasses; List<CtClass> newClasses; if (this.options.getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.ONE_COMMON_CLASSPATH) { oldClasses = createListOfCtClasses(oldArchives, commonClassPool); newClasses = createListOfCtClasses(newArchives, commonClassPool); return compareClassLists(options, oldClasses, newClasses); } else if (this.options.getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.TWO_SEPARATE_CLASSPATHS) { oldClasses = createListOfCtClasses(oldArchives, oldClassPool); newClasses = createListOfCtClasses(newArchives, newClassPool); return compareClassLists(options, oldClasses, newClasses); } else { throw new JApiCmpException(Reason.IllegalState, "Unknown classpath mode: " + this.options.getClassPathMode()); } }
private List<JApiClass> createAndCompareClassLists(List<File> oldArchives, List<File> newArchives) { List<CtClass> oldClasses; List<CtClass> newClasses; if (this.options.getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.ONE_COMMON_CLASSPATH) { oldClasses = createListOfCtClasses(oldArchives, commonClassPool); newClasses = createListOfCtClasses(newArchives, commonClassPool); return compareClassLists(options, oldClasses, newClasses); } else if (this.options.getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.TWO_SEPARATE_CLASSPATHS) { oldClasses = createListOfCtClasses(oldArchives, oldClassPool); newClasses = createListOfCtClasses(newArchives, newClassPool); return compareClassLists(options, oldClasses, newClasses); } else { throw new JApiCmpException(Reason.IllegalState, "Unknown classpath mode: " + this.options.getClassPathMode()); } }
private void setupClasspaths() { if (this.options.getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.ONE_COMMON_CLASSPATH) { commonClassPool = new ClassPool(); commonClassPathAsString = setupClasspath(commonClassPool, this.options.getClassPathEntries()); } else if (this.options.getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.TWO_SEPARATE_CLASSPATHS) { oldClassPool = new ClassPool(); oldClassPathAsString = setupClasspath(oldClassPool, this.options.getOldClassPath()); newClassPool = new ClassPool(); newClassPathAsString = setupClasspath(newClassPool, this.options.getNewClassPath()); } else { throw new JApiCmpException(Reason.IllegalState, "Unknown classpath mode: " + this.options.getClassPathMode()); } }
public static JApiCmpException forClassLoading(Exception e, String name, JarArchiveComparator jarArchiveComparator) { String classPathAsString = "(CLASSPATH=" + jarArchiveComparator.getCommonClasspathAsString() + ")"; if (jarArchiveComparator.getJarArchiveComparatorOptions().getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.TWO_SEPARATE_CLASSPATHS) { classPathAsString = "(OLD CLASSPATH=" + jarArchiveComparator.getOldClassPathAsString() + " / NEW CLASSPATH=" + jarArchiveComparator.getNewClassPathAsString() + ")"; } return new JApiCmpException(JApiCmpException.Reason.ClassLoading, "Could not load '" + name + "': " + e.getMessage() + ". Please make sure that all libraries have been added to the classpath " + classPathAsString + " or try the option '--ignore-missing-classes'.", e); }
private void setupClasspaths() { if (this.options.getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.ONE_COMMON_CLASSPATH) { commonClassPool = new ClassPool(); commonClassPathAsString = setupClasspath(commonClassPool, this.options.getClassPathEntries()); } else if (this.options.getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.TWO_SEPARATE_CLASSPATHS) { oldClassPool = new ClassPool(); oldClassPathAsString = setupClasspath(oldClassPool, this.options.getOldClassPath()); newClassPool = new ClassPool(); newClassPathAsString = setupClasspath(newClassPool, this.options.getNewClassPath()); } else { throw new JApiCmpException(Reason.IllegalState, "Unknown classpath mode: " + this.options.getClassPathMode()); } }
public static JApiCmpException forClassLoading(Exception e, String name, JarArchiveComparator jarArchiveComparator) { String classPathAsString = "(CLASSPATH=" + jarArchiveComparator.getCommonClasspathAsString() + ")"; if (jarArchiveComparator.getJarArchiveComparatorOptions().getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.TWO_SEPARATE_CLASSPATHS) { classPathAsString = "(OLD CLASSPATH=" + jarArchiveComparator.getOldClassPathAsString() + " / NEW CLASSPATH=" + jarArchiveComparator.getNewClassPathAsString() + ")"; } return new JApiCmpException(JApiCmpException.Reason.ClassLoading, "Could not load '" + name + "': " + e.getMessage() + ". Please make sure that all libraries have been added to the classpath " + classPathAsString + " or try the option '--ignore-missing-classes'.", e); }
public static JApiCmpException forClassLoading(String name, JarArchiveComparator jarArchiveComparator) { String classPathAsString = "(CLASSPATH=" + jarArchiveComparator.getCommonClasspathAsString() + ")"; if (jarArchiveComparator.getJarArchiveComparatorOptions().getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.TWO_SEPARATE_CLASSPATHS) { classPathAsString = "(OLD CLASSPATH=" + jarArchiveComparator.getOldClassPathAsString() + " / NEW CLASSPATH=" + jarArchiveComparator.getNewClassPathAsString() + ")"; } return new JApiCmpException(JApiCmpException.Reason.ClassLoading, "Could not load '" + name + "'. Please make sure that all libraries have been added to the classpath " + classPathAsString + " or try the option '--ignore-missing-classes'."); } }
public static JApiCmpException forClassLoading(String name, JarArchiveComparator jarArchiveComparator) { String classPathAsString = "(CLASSPATH=" + jarArchiveComparator.getCommonClasspathAsString() + ")"; if (jarArchiveComparator.getJarArchiveComparatorOptions().getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.TWO_SEPARATE_CLASSPATHS) { classPathAsString = "(OLD CLASSPATH=" + jarArchiveComparator.getOldClassPathAsString() + " / NEW CLASSPATH=" + jarArchiveComparator.getNewClassPathAsString() + ")"; } return new JApiCmpException(JApiCmpException.Reason.ClassLoading, "Could not load '" + name + "'. Please make sure that all libraries have been added to the classpath " + classPathAsString + " or try the option '--ignore-missing-classes'."); } }
if (this.options.getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.ONE_COMMON_CLASSPATH) { try { loadedClass = Optional.of(commonClassPool.get(name)); } else if (this.options.getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.TWO_SEPARATE_CLASSPATHS) { if (archiveType == ArchiveType.OLD) { try { throw new JApiCmpException(Reason.IllegalState, "Unknown classpath mode: " + this.options.getClassPathMode());
if (this.options.getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.ONE_COMMON_CLASSPATH) { try { loadedClass = Optional.of(commonClassPool.get(name)); } else if (this.options.getClassPathMode() == JarArchiveComparatorOptions.ClassPathMode.TWO_SEPARATE_CLASSPATHS) { if (archiveType == ArchiveType.OLD) { try { throw new JApiCmpException(Reason.IllegalState, "Unknown classpath mode: " + this.options.getClassPathMode());
Optional<CtClass> oldClassOptional = Optional.absent(); Optional<CtClass> newClassOptional = Optional.absent(); JarArchiveComparatorOptions.ClassPathMode classPathMode = this.jarArchiveComparator.getJarArchiveComparatorOptions().getClassPathMode(); if (classPathMode == JarArchiveComparatorOptions.ClassPathMode.ONE_COMMON_CLASSPATH) { ClassPool classPool = this.jarArchiveComparator.getCommonClassPool();
Optional<CtClass> oldClassOptional = Optional.absent(); Optional<CtClass> newClassOptional = Optional.absent(); JarArchiveComparatorOptions.ClassPathMode classPathMode = this.jarArchiveComparator.getJarArchiveComparatorOptions().getClassPathMode(); if (classPathMode == JarArchiveComparatorOptions.ClassPathMode.ONE_COMMON_CLASSPATH) { ClassPool classPool = this.jarArchiveComparator.getCommonClassPool();