use of com.android.annotations.NonNull in project kotlin by JetBrains.
the class DomPsiParser method getLocation.
@NonNull
@Override
public Location getLocation(@NonNull XmlContext context, @NonNull Node node) {
TextRange textRange = DomPsiConverter.getTextRange(node);
Position start = new DefaultPosition(-1, -1, textRange.getStartOffset());
Position end = new DefaultPosition(-1, -1, textRange.getEndOffset());
return Location.create(context.file, start, end);
}
use of com.android.annotations.NonNull in project kotlin by JetBrains.
the class DomPsiParser method getNameLocation.
@NonNull
@Override
public Location getNameLocation(@NonNull XmlContext context, @NonNull Node node) {
TextRange textRange = DomPsiConverter.getTextNameRange(node);
Position start = new DefaultPosition(-1, -1, textRange.getStartOffset());
Position end = new DefaultPosition(-1, -1, textRange.getEndOffset());
return Location.create(context.file, start, end);
}
use of com.android.annotations.NonNull in project kotlin by JetBrains.
the class Project method getJavaClassFolders.
/**
* Returns the list of output folders for class files
* @return a list of output folders to search for .class files
*/
@NonNull
public List<File> getJavaClassFolders() {
if (mJavaClassFolders == null) {
if (isAospFrameworksProject(mDir)) {
String top = getAospTop();
if (top != null) {
//$NON-NLS-1$
File out = new File(top, "out");
if (out.exists()) {
String relative = "target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar";
File jar = new File(out, relative.replace('/', File.separatorChar));
if (jar.exists()) {
mJavaClassFolders = Collections.singletonList(jar);
return mJavaClassFolders;
}
}
}
}
if (isAospBuildEnvironment()) {
String top = getAospTop();
if (mDir.getAbsolutePath().startsWith(top)) {
mJavaClassFolders = getAospJavaClassPath();
return mJavaClassFolders;
}
}
mJavaClassFolders = mClient.getJavaClassFolders(this);
}
return mJavaClassFolders;
}
use of com.android.annotations.NonNull in project kotlin by JetBrains.
the class ControlFlowGraph method toString.
/**
* Creates a human readable version of the graph
*
* @param start the starting instruction, or null if not known or to use the
* first instruction
* @return a string version of the graph
*/
@NonNull
public String toString(@Nullable Node start) {
StringBuilder sb = new StringBuilder(400);
AbstractInsnNode curr;
if (start != null) {
curr = start.instruction;
} else {
if (mNodeMap.isEmpty()) {
return "<empty>";
} else {
curr = mNodeMap.keySet().iterator().next();
while (curr.getPrevious() != null) {
curr = curr.getPrevious();
}
}
}
while (curr != null) {
Node node = mNodeMap.get(curr);
if (node != null) {
sb.append(node.toString(true));
}
curr = curr.getNext();
}
return sb.toString();
}
use of com.android.annotations.NonNull in project kotlin by JetBrains.
the class ControlFlowGraph method getNode.
/**
* Looks up (and if necessary) creates a graph node for the given instruction
*
* @param instruction the instruction
* @return the control flow graph node corresponding to the given
* instruction
*/
@NonNull
public Node getNode(@NonNull AbstractInsnNode instruction) {
Node node = mNodeMap.get(instruction);
if (node == null) {
node = new Node(instruction);
mNodeMap.put(instruction, node);
}
return node;
}
Aggregations