(Node node)
| 62 | } |
| 63 | |
| 64 | public ClassInstance getCls(Node node) { |
| 65 | StringBuilder sb = new StringBuilder(); |
| 66 | |
| 67 | if (pkg != null) { |
| 68 | sb.append(pkg); |
| 69 | sb.append('/'); |
| 70 | } |
| 71 | |
| 72 | int pkgEnd = sb.length(); |
| 73 | |
| 74 | do { |
| 75 | if (node instanceof ClassOrInterfaceDeclaration || node instanceof EnumDeclaration) { |
| 76 | TypeDeclaration<?> typeDecl = (TypeDeclaration<?>) node; |
| 77 | |
| 78 | String namePart = typeDecl.getName().getIdentifier(); |
| 79 | |
| 80 | if (sb.length() > pkgEnd) { |
| 81 | sb.insert(pkgEnd, '$'); |
| 82 | sb.insert(pkgEnd, namePart); |
| 83 | } else { |
| 84 | sb.append(namePart); |
| 85 | } |
| 86 | } |
| 87 | } while ((node = node.getParentNode().orElse(null)) != null); |
| 88 | |
| 89 | ClassInstance cls = getClsByName(sb.toString()); |
| 90 | |
| 91 | return cls; |
| 92 | } |
| 93 | |
| 94 | public <T extends CallableDeclaration<T> & NodeWithParameters<T>> MethodInstance getMethod(T methodDecl) { |
| 95 | ClassInstance cls = getCls(methodDecl); |
no test coverage detected