Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
lujiefsi authored and KengoTODA committed Oct 7, 2021
1 parent 5b1ad9b commit b221290
Showing 1 changed file with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,30 +91,31 @@ public JrtfsCodeBase(ICodeBaseLocator codeBaseLocator, @Nonnull String fileName)
public Map<String, Object> createPackageToModuleMap(FileSystem fs) throws IOException {
HashMap<String, Object> packageToModule = new LinkedHashMap<>();
Path path = fs.getPath("packages");
try(Stream<Path> packList = Files.list(path)) {
packList.forEach(p -> {
try(Stream<Path> pList = Files.list(p)) {
Iterator<Path> modIter = pList.iterator();
while (modIter.hasNext()) {
Path module = modIter.next();
String packageKey = fileName(p).replace('.', '/');
String modulePath = fileName(module);
if (!modIter.hasNext() && !packageToModule.containsKey(packageKey)) {
packageToModule.put(packageKey, modulePath);
} else {
@SuppressWarnings("unchecked")
Set<Object> modules = (Set<Object>) packageToModule.get(packageKey);
if (modules == null) {
modules = new LinkedHashSet<>();
packageToModule.put(packageKey, modules);
try (Stream<Path> packList = Files.list(path)) {
packList.forEach(p -> {
try (Stream<Path> pList = Files.list(p)) {
Iterator<Path> modIter = pList.iterator();
while (modIter.hasNext()) {
Path module = modIter.next();
String packageKey = fileName(p).replace('.', '/');
String modulePath = fileName(module);
if (!modIter.hasNext() && !packageToModule.containsKey(packageKey)) {
packageToModule.put(packageKey, modulePath);
} else {
@SuppressWarnings("unchecked")
Set<Object> modules = (Set<Object>) packageToModule.get(packageKey);
if (modules == null) {
modules = new LinkedHashSet<>();
packageToModule.put(packageKey, modules);
}
modules.add(modulePath);
}
modules.add(modulePath);
}
} catch (IOException e) {
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
}
});};
});
} ;
return packageToModule;
}

Expand Down

0 comments on commit b221290

Please sign in to comment.