private String appendUserDefinedClassPathEntries(ClassPool classPool, List<String> classPathEntries) { StringBuilder classPathAsString = new StringBuilder(); for (String classPathEntry : classPathEntries) { try { classPool.appendClassPath(classPathEntry); if (!classPathAsString.toString().endsWith(File.pathSeparator)) { classPathAsString.append(File.pathSeparator); } classPathAsString.append(classPathEntry); } catch (NotFoundException e) { throw JApiCmpException.forClassLoading(e, classPathEntry, this); } } return classPathAsString.toString(); }
private String appendUserDefinedClassPathEntries(ClassPool classPool, List<String> classPathEntries) { StringBuilder classPathAsString = new StringBuilder(); for (String classPathEntry : classPathEntries) { try { classPool.appendClassPath(classPathEntry); if (!classPathAsString.toString().endsWith(File.pathSeparator)) { classPathAsString.append(File.pathSeparator); } classPathAsString.append(classPathEntry); } catch (NotFoundException e) { throw JApiCmpException.forClassLoading(e, classPathEntry, this); } } return classPathAsString.toString(); }
private static boolean isCtClassSerializable(JarArchiveComparatorOptions options, CtClass clazz, JarArchiveComparator jarArchiveComparator) { ClassPool pool = clazz.getClassPool(); try { return clazz.subtypeOf(pool.get("java.io.Serializable")); } catch (NotFoundException e) { if (options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) { return false; } else { throw JApiCmpException.forClassLoading(e, clazz.getName(), jarArchiveComparator); } } }
private static boolean isCtClassSerializable(JarArchiveComparatorOptions options, CtClass clazz, JarArchiveComparator jarArchiveComparator) { ClassPool pool = clazz.getClassPool(); try { return clazz.subtypeOf(pool.get("java.io.Serializable")); } catch (NotFoundException e) { if (options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) { return false; } else { throw JApiCmpException.forClassLoading(e, clazz.getName(), jarArchiveComparator); } } }
private void buildInterfaceMap(CtClass ctClass, JarArchiveComparator.ArchiveType archiveType, Map<String, CtClass> map) { try { CtClass[] interfaces = ctClass.getInterfaces(); for (CtClass ctInterface : interfaces) { map.put(ctInterface.getName(), ctInterface); buildInterfaceMap(archiveType, map, ctInterface); } Optional<CtClass> superClassOptional = getSuperclass(ctClass); if (superClassOptional.isPresent()) { buildInterfaceMap(superClassOptional.get(), archiveType, map); } } catch (NotFoundException e) { if (!options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) { throw JApiCmpException.forClassLoading(e, "Class not found: " + e.getMessage(), jarArchiveComparator); } } }
private void buildInterfaceMap(CtClass ctClass, JarArchiveComparator.ArchiveType archiveType, Map<String, CtClass> map) { try { CtClass[] interfaces = ctClass.getInterfaces(); for (CtClass ctInterface : interfaces) { map.put(ctInterface.getName(), ctInterface); buildInterfaceMap(archiveType, map, ctInterface); } Optional<CtClass> superClassOptional = getSuperclass(ctClass); if (superClassOptional.isPresent()) { buildInterfaceMap(superClassOptional.get(), archiveType, map); } } catch (NotFoundException e) { if (!options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) { throw JApiCmpException.forClassLoading(e, "Class not found: " + e.getMessage(), jarArchiveComparator); } } }
private Optional<CtClass> getSuperclass(CtClass ctClass) { try { CtClass superClass = ctClass.getSuperclass(); return Optional.fromNullable(superClass); } catch (NotFoundException e) { if (options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) { return Optional.absent(); } else { throw JApiCmpException.forClassLoading(e, e.getMessage(), jarArchiveComparator); } } }
private Optional<CtClass> getSuperclass(CtClass ctClass) { try { CtClass superClass = ctClass.getSuperclass(); return Optional.fromNullable(superClass); } catch (NotFoundException e) { if (options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) { return Optional.absent(); } else { throw JApiCmpException.forClassLoading(e, e.getMessage(), jarArchiveComparator); } } }
} catch (NotFoundException e) { if (!options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) { throw JApiCmpException.forClassLoading(e, name, this); } catch (NotFoundException e) { if (!options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) { throw JApiCmpException.forClassLoading(e, name, this); } catch (NotFoundException e) { if (!options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) { throw JApiCmpException.forClassLoading(e, name, this);
} catch (NotFoundException e) { if (!options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) { throw JApiCmpException.forClassLoading(e, name, this); } catch (NotFoundException e) { if (!options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) { throw JApiCmpException.forClassLoading(e, name, this); } catch (NotFoundException e) { if (!options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) { throw JApiCmpException.forClassLoading(e, name, this);
throw JApiCmpException.forClassLoading(newSuperclassName, this.jarArchiveComparator);
throw JApiCmpException.forClassLoading(newSuperclassName, this.jarArchiveComparator);