final Type[] arguments = Type.getArgumentTypes(methodCov.getDesc()); boolean comma = false; for(final Type arg : arguments) {
private void check(final IMethodCoverage method, final String className) { final String name = names.getQualifiedMethodName(className, method.getName(), method.getDesc(), method.getSignature()); checkRules(method, methodRules, "method", name); }
private void printMethod(final IMethodCoverage method, final boolean more) { final String desc = String.format("+- method %s%s", method.getName(), method.getDesc()); printDetails(desc, method); for (int nr = method.getFirstLine(); nr <= method .getLastLine(); nr++) { printLine(method.getLine(nr), nr, more ? "| " : " "); } }
private void resolveMethods(final IType type) { IClassCoverage classCoverage = (IClassCoverage) getCoverageFor(type); if (classCoverage == null) { return; } try { MethodLocator locator = new MethodLocator(type); for (IMethodCoverage methodCoverage : classCoverage.getMethods()) { final IMethod method = locator.findMethod(methodCoverage.getName(), methodCoverage.getDesc()); if (method != null) { coveragemap.put(method, methodCoverage); } else { TRACER .trace( "Method not found in Java model: {0}.{1}{2}", type.getFullyQualifiedName(), methodCoverage.getName(), methodCoverage.getDesc()); //$NON-NLS-1$ } } } catch (JavaModelException e) { TRACER.trace("Error while creating method locator for {0}: {1}", type //$NON-NLS-1$ .getFullyQualifiedName(), e); } } }
/** * Creates a 'method' element. * * @param coverage * method coverage node to write out * @return 'method' element * @throws IOException * in case of problems with the underlying output */ public ReportElement method(final IMethodCoverage coverage) throws IOException { final ReportElement element = namedElement("method", coverage.getName()); element.attr("desc", coverage.getDesc()); final int line = coverage.getFirstLine(); if (line != -1) { element.attr("line", line); } return element; }
@Override public void render() throws IOException { for (final IMethodCoverage m : getNode().getMethods()) { final String label = context.getLanguageNames().getMethodName( getNode().getName(), m.getName(), m.getDesc(), m.getSignature()); addItem(new MethodItem(m, label, sourcePage)); } super.render(); }