private static void placeOrphanComments(CompilationUnit cu, List<Comment> orphanComments){ for (Comment comment : orphanComments){ placeOrphanComment(cu,comment); } }
private static void placeOrphanComment(Node node,Comment comment){ for (Node child : node.getChildrenNodes()){ if (child.contains(comment)){ placeOrphanComment(child,comment); return; } } node.addOrphanComment(comment); }