Below are some of the results found using Prime. Analysis Results is a collection of API-usage automata found using Prime. Search Results is a collection of automata found by Prime in response to a specific query.
In all cases, click the image for a larger, zoomable, image.
The CLI library is a command-line-options parser.
The following example demonstrates how, even before consolidation, a very strong hasOption
<--> getOptionValue
loop, and how hasOption
almost always starts that loop - because the programmers first check for the presence of a value before extracting it.
The Net library deals with network communication.
The following example shows the single result found when investigating FTPTimestampParserImpl
, and shows that it apparently used precisely the same why by all the found examples.
The Eclipse JDT library is the Eclipse plugin which enables working with the Java language, and the Core package is responsible for, among others, Java parsing.
The following example shows an interesting common sequence getJavaProject
--> getElementType
--> getType
/ getDeclaringType
/ getParent
--> exists
.
The following example seems to indicate that the result from isBinary
is used to determine whether isReadOnly
is invoked.
The following example shows a few interesting facts:
isConstructor
before getReturnType
, possibly because Java constructors don't have an AST node for a return type.resolveBinding
is used to obtain an ITypeBinding
from a Name
or SimpleName
.isArray
always precedes getElementType
.The following example shows the dominant usage of StringBuffer class - which is the class created when writing +
or +=
between strings in a Java source.
All the queries here are brought in their abbreviated forms. In their full forms all known types are fully qualified and question marks are replaced with unknown method calls.
A query which users a cached database manager to obtain a connection, then creates and runs a prepared statement and finally gets a double value form a specific field.
InitialContext ic = new InitialContext(); ic.?; PreparedStatement ps = ic.?; ResultSet rs = ps.executeQuery(); rs.?; double d = rs.getDouble("column");
The result shows not only the full appropriate sequence - including how to get a Connection
and how to set up a PreparedStatement
- but also even show get how getLong
is apparently very common after getDouble
:
Looking for any sequence which uses a specific implementation of a WebDriver, that creates a WebElement from the WebDriver via a specific method, and that clears and then submits a web form.
WebDriver d = new FirefoxDriver(); d.?; By by = ?; WebElement e = d.findElement(by); e.?; e.clear(); e.? e.submit();
The results shows that between clear
ing a textual field and submit
ting it, is very common to actually type in text in that field, via sendKeys
. The three variations demonstrate the need to navigate to a web page before attempting to find a web element on it, via navigate
, manage
or get
:
Aiming to obtain a String from command-line arguments that adhere to the GNU style. The query only requires initialization of a GnuParser instance, and that at a certain point a String will be obtained from it.
GnuParser p = new GnuParser(); p.?; String s = p.?; s.?;
The results show how to parse a command-line and how to get a string from it - the first is by getting the entire command-line as a string, the second is by getting the string of a specific option, and the third is getting the value of an option, with first verifying the option was provided: