tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject About Cobertura error on parsing ServiceProxy.java
Date Fri, 24 Jan 2014 01:54:58 GMT
Hi!

If you run tests with Cobertura 2.0.3 being enabled, it prints a
warning that it cannot parse the source code of ServiceProxy class:

It can be seen in Buildbot logs.

[cobertura-report] WARN   getAccumlatedCCNForSource, JavaNCSS got an
error while parsing the java file
/home/buildslave3/slave3/tomcat-trunk/build/java/org/apache/naming/factory/webservices/ServiceProxy.java
[cobertura-report] ParseException in STDIN
[cobertura-report] Last useful checkpoint:
"org.apache.naming.factory.webservices.ServiceProxy.getProxyPortQNameClass(Object[])"
[cobertura-report] Encountered " "@" "@ "" at line 106, column 14.
[cobertura-report] Was expecting one of:
[cobertura-report]     "assert" ...
[cobertura-report]     "boolean" ...
...


The same issue has already been reported:
https://github.com/cobertura/cobertura/issues/109

This is triggered by the following code in Tomcat:
        for (@SuppressWarnings("unchecked")
        Iterator<QName> ports = service.getPorts(); ports.hasNext();) {
            QName portName = ports.next();
            String portnameString = portName.getLocalPart();
            if (portnameString.equals(nameString)) {
                return service.getPort(name, serviceendpointClass);
            }
        }

If it bothers anyone, it is easy to move the "ports" variable out of
the loop, or move annotation to the method level.

I think there is no urge in fixing this and we can wait for a next
release of Cobertura.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message