Source:
<code>public void analyzeSource(File sourceFile) throws IOException { JavaProjectBuilder project = new JavaProjectBuilder(); if (sourceFile.isDirectory()) { project.addSourceTree(sourceFile); Collection<File> documentFiles = FileUtils.listFiles(sourceFile, new String[] { "adoc" }, true); for (File documentFile : documentFiles) { try (InputStream documentIn = new FileInputStream(documentFile)) { analyzeDocument(documentFile.getName(), documentIn); } } } else if (sourceFile.isFile() && sourceFile.getName().endsWith(".jar")) { try (ZipFile zipFile = new ZipFile(sourceFile)) { Enumeration<? extends ZipEntry> zipEntries = zipFile.entries(); while (zipEntries.hasMoreElements()) { ZipEntry zipEntry = zipEntries.nextElement(); String zipEntryName = zipEntry.getName(); if (zipEntryName.endsWith(".java")) { try (InputStream sourceIn = zipFile.getInputStream(zipEntry)) { try (Reader sourceReader = new InputStreamReader(sourceIn, Charset.forName("UTF-8"))) { project.addSource(sourceReader); } } } else if (zipEntryName.endsWith(".adoc")) { try (InputStream documentIn = zipFile.getInputStream(zipEntry)) { analyzeDocument(zipEntryName, documentIn); } } } } } else { throw new IOException( "Don't know how to parse source file \"" + sourceFile.getAbsolutePath() + "\", should be a " + "directory or a .jar file." ); } List<JavaClass> types = new ArrayList<>(); List<JavaClass> services = new ArrayList<>(); separateClasses(project, types, services); analyzeTypes(types); <START> services.stream().filter(x -> !x.isInner()).forEach(this::analyzeService); <END> fixUndefinedTypeUsages(); fixUndefinedServiceUsages(); parseConstraints(); }</code><technical_language>If "analyzeTypes" methods, a new "analyzeServices" method</technical_language>

Target:
public void analyzeSource(File sourceFile) throws IOException { JavaProjectBuilder project = new JavaProjectBuilder(); if (sourceFile.isDirectory()) { project.addSourceTree(sourceFile); Collection<File> documentFiles = FileUtils.listFiles(sourceFile, new String[] { "adoc" }, true); for (File documentFile : documentFiles) { try (InputStream documentIn = new FileInputStream(documentFile)) { analyzeDocument(documentFile.getName(), documentIn); } } } else if (sourceFile.isFile() && sourceFile.getName().endsWith(".jar")) { try (ZipFile zipFile = new ZipFile(sourceFile)) { Enumeration<? extends ZipEntry> zipEntries = zipFile.entries(); while (zipEntries.hasMoreElements()) { ZipEntry zipEntry = zipEntries.nextElement(); String zipEntryName = zipEntry.getName(); if (zipEntryName.endsWith(".java")) { try (InputStream sourceIn = zipFile.getInputStream(zipEntry)) { try (Reader sourceReader = new InputStreamReader(sourceIn, Charset.forName("UTF-8"))) { project.addSource(sourceReader); } } } else if (zipEntryName.endsWith(".adoc")) { try (InputStream documentIn = zipFile.getInputStream(zipEntry)) { analyzeDocument(zipEntryName, documentIn); } } } } } else { throw new IOException( "Don't know how to parse source file \"" + sourceFile.getAbsolutePath() + "\", should be a " + "directory or a .jar file." ); } List<JavaClass> types = new ArrayList<>(); List<JavaClass> services = new ArrayList<>(); separateClasses(project, types, services); analyzeTypes(types); analyzeServices(services); parseConstraints(); }