Tools for automatic detection of static errors. While common tools work with source-code, this approach analyses Java byte-code. It discovers possible Java Linkage Errors such as NoSuchMethodError.
1. STATIC PROBLEMS
DETECTION
Overview and Tool Demonstration
Kamil Ježek kjezek@kiv.zcu.cz
Přemek Brada brada@kiv.zcu.cz
Západočeská univerzita v Plzni
Katedra informatiky a výpočetní techniky
7. Compatibility May Be Tricky
public class Main {
public static void main(String[] args) {
Object n = new LineIterator().next();
}
}
public class LineIterator {
public String next() {
return …;
}
}
8. JVM and Compiler Differences
public class Main {
public static void main(String[] args) {
LineIterator it = …
Object n = it.next();
}
}
public class LineIterator {
public Object next() {
return …;
}
}
public interface LineIterator {
public Object next();
}
v1 v2
9. Evidence in Real Life Software
Popular projects
• Apache Roller
• Commons-IO
Even Maven is not answer
10. Example 1: Apache Roller
Apache Roller links to two httpcore versions
11. Impact on Apache Roller
Method releaseConnection() invoked by
Spring-web missing in httpcore 4.1
• Reported and acknowledged
12. Example 2: Apache Commons-io
Commons-io is distributed in two packages
13. Impact of Apache Commons-IO
Maven Central Repository
org.apache.commons used by 542 projects
commons-io used by 293 projects
22. Standard Debug II
• Log analysis (when enabled)
2015-04-15 17:17:58.538 WARN [org.eclipse.jetty.util.thread.QueuedThreadPool:run:577] -
java.lang.NoSuchMethodError: org.apache.commons.io.LineIterator.next()Ljava/lang/String;
at cz.zcu.kiv.examples.booking.preferences.RatingLoader.load(RatingLoader.java:29)
at cz.zcu.kiv.examples.booking.server.RunServer$2.handle(RunServer.java:53)
at spark.webserver.MatcherFilter.doFilter(MatcherFilter.java:139)
at spark.webserver.JettyHandler.doHandle(JettyHandler.java:54)
28. Conclusion
• Automatic tools
• Problems detected early in development
• Solve current problems
• Cheaper and more robust software
29. Discussion
Questions now
or
Kamil Ježek kjezek@kiv.zcu.cz
Přemek Brada brada@kiv.zcu.cz
Západočeská univerzita v Plzni
Katedra informatiky a výpočetní techniky