tweak comments
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3392 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
9636dd278a
commit
e3af3830d0
|
@ -18,80 +18,57 @@ import com.ibm.wala.types.Selector;
|
|||
import com.ibm.wala.types.TypeReference;
|
||||
|
||||
/**
|
||||
*
|
||||
* Basic interface for an object that represents a single Java method for analysis purposes.
|
||||
*
|
||||
* @author sfink
|
||||
*/
|
||||
public interface IMethod extends IMember, ContextItem {
|
||||
|
||||
/**
|
||||
* Is this method synchronized?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean isSynchronized();
|
||||
|
||||
/**
|
||||
* Is this method a class initializer?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean isClinit();
|
||||
|
||||
/**
|
||||
* Is this method an object initializer?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean isInit();
|
||||
|
||||
/**
|
||||
* Is this method native?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean isNative();
|
||||
|
||||
/**
|
||||
* Did someone synthesize this method? (As opposed to reading it from a class file)
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean isSynthetic();
|
||||
|
||||
/**
|
||||
* Is this method abstract?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean isAbstract();
|
||||
|
||||
/**
|
||||
* Is this method private?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean isPrivate();
|
||||
|
||||
/**
|
||||
* Is this method protected?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean isProtected();
|
||||
|
||||
/**
|
||||
* Is this method public?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean isPublic();
|
||||
|
||||
/**
|
||||
* Is this method final?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean isFinal();
|
||||
|
||||
|
@ -137,37 +114,30 @@ public interface IMethod extends IMember, ContextItem {
|
|||
TypeReference[] getDeclaredExceptions() throws InvalidClassFileException, UnsupportedOperationException;
|
||||
|
||||
/**
|
||||
* @return the source line number corresponding to a particular bytecode index, or -1 if the information is not
|
||||
* available.
|
||||
* @return the source line number corresponding to a particular bytecode index, or -1 if the information is not available.
|
||||
* @throws InvalidClassFileException
|
||||
*/
|
||||
int getLineNumber(int bcIndex) throws InvalidClassFileException;
|
||||
|
||||
/**
|
||||
* @return the (source code) name of the local variable of a given number at the specified program counter, or null if
|
||||
* the information is not available.
|
||||
* @return the (source code) name of the local variable of a given number at the specified program counter, or null if the
|
||||
* information is not available.
|
||||
* @throws InvalidClassFileException
|
||||
*/
|
||||
String getLocalVariableName(int bcIndex, int localNumber) throws InvalidClassFileException;
|
||||
|
||||
/**
|
||||
* something like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getSignature();
|
||||
|
||||
/**
|
||||
* something like: foo(Ljava/langString;)Ljava/lang/Class;
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public Selector getSelector();
|
||||
|
||||
/**
|
||||
* Method getDescriptor. something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;
|
||||
*
|
||||
* @return Descriptor
|
||||
* something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;
|
||||
*/
|
||||
Descriptor getDescriptor();
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import com.ibm.wala.types.TypeReference;
|
|||
|
||||
/**
|
||||
* General interface for a type hierarchy
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface IClassHierarchy extends Iterable<IClass> {
|
||||
|
||||
|
@ -31,8 +31,7 @@ public interface IClassHierarchy extends Iterable<IClass> {
|
|||
|
||||
/**
|
||||
* @return true if the add succeeded; false if it failed for some reason
|
||||
* @throws IllegalArgumentException
|
||||
* if klass is null
|
||||
* @throws IllegalArgumentException if klass is null
|
||||
*/
|
||||
public boolean addClass(IClass klass);
|
||||
|
||||
|
@ -50,61 +49,49 @@ public interface IClassHierarchy extends Iterable<IClass> {
|
|||
/**
|
||||
* Find the possible targets of a call to a method reference
|
||||
*
|
||||
* @param ref
|
||||
* method reference
|
||||
* @param ref method reference
|
||||
* @return the set of IMethods that this call can resolve to.
|
||||
* @throws IllegalArgumentException
|
||||
* if ref is null
|
||||
* @throws IllegalArgumentException if ref is null
|
||||
*/
|
||||
public Collection<IMethod> getPossibleTargets(MethodReference ref);
|
||||
|
||||
|
||||
/**
|
||||
* Find the possible targets of a call to a method reference where the receiver is of a certain type
|
||||
*
|
||||
* @param receiverClass the class of the receiver
|
||||
* @param ref method reference
|
||||
* @return the set of IMethods that this call can resolve to.
|
||||
*/
|
||||
public Set<IMethod> getPossibleTargets(IClass receiverClass, MethodReference ref);
|
||||
|
||||
/**
|
||||
* Return the unique receiver of an invocation of method on an object of type
|
||||
* m.getDeclaredClass
|
||||
* Return the unique receiver of an invocation of method on an object of type m.getDeclaredClass
|
||||
*
|
||||
* @return IMethod, or null if no appropriate receiver is found.
|
||||
* @throws IllegalArgumentException
|
||||
* if m is null
|
||||
* @throws IllegalArgumentException if m is null
|
||||
*/
|
||||
public IMethod resolveMethod(MethodReference m);
|
||||
|
||||
/**
|
||||
* @return the canonical IField that represents a given field , or
|
||||
* null if none found
|
||||
* @throws IllegalArgumentException
|
||||
* if f is null
|
||||
* @return the canonical IField that represents a given field , or null if none found
|
||||
* @throws IllegalArgumentException if f is null
|
||||
*/
|
||||
public IField resolveField(FieldReference f);
|
||||
|
||||
/**
|
||||
* @return the canonical IField that represents a given field , or
|
||||
* null if none found
|
||||
* @throws IllegalArgumentException
|
||||
* if f is null
|
||||
* @throws IllegalArgumentException
|
||||
* if klass is null
|
||||
* @return the canonical IField that represents a given field , or null if none found
|
||||
* @throws IllegalArgumentException if f is null
|
||||
* @throws IllegalArgumentException if klass is null
|
||||
*/
|
||||
public IField resolveField(IClass klass, FieldReference f);
|
||||
|
||||
/**
|
||||
* Return the unique receiver of an invocation of method on an object of type
|
||||
* declaringClass
|
||||
* Return the unique receiver of an invocation of method on an object of type declaringClass
|
||||
*
|
||||
* @param receiverClass
|
||||
* type of receiver
|
||||
* @param selector
|
||||
* method signature
|
||||
* @param receiverClass type of receiver
|
||||
* @param selector method signature
|
||||
* @return Method resolved method abstraction
|
||||
* @throws IllegalArgumentException
|
||||
* if receiverClass is null
|
||||
* @throws IllegalArgumentException if receiverClass is null
|
||||
*/
|
||||
public IMethod resolveMethod(IClass receiverClass, Selector selector);
|
||||
|
||||
|
@ -112,12 +99,11 @@ public interface IClassHierarchy extends Iterable<IClass> {
|
|||
* Load a class using one of the loaders specified for this class hierarchy
|
||||
*
|
||||
* @return null if can't find the class.
|
||||
* @throws IllegalArgumentException
|
||||
* if A is null
|
||||
* @throws IllegalArgumentException if A is null
|
||||
*/
|
||||
public IClass lookupClass(TypeReference A);
|
||||
|
||||
// public boolean isSyntheticClass(IClass c);
|
||||
// public boolean isSyntheticClass(IClass c);
|
||||
|
||||
public boolean isInterface(TypeReference type);
|
||||
|
||||
|
@ -128,14 +114,13 @@ public interface IClassHierarchy extends Iterable<IClass> {
|
|||
/**
|
||||
* Is c a subclass of T?
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* if c is null
|
||||
* @throws IllegalArgumentException if c is null
|
||||
*/
|
||||
public boolean isSubclassOf(IClass c, IClass T);
|
||||
|
||||
/**
|
||||
* Does c implement i?
|
||||
*
|
||||
*
|
||||
* @return true iff i is an interface and c is a class that implements i,
|
||||
*/
|
||||
public boolean implementsInterface(IClass c, IClass i);
|
||||
|
@ -146,24 +131,21 @@ public interface IClassHierarchy extends Iterable<IClass> {
|
|||
public Collection<IClass> computeSubClasses(TypeReference type);
|
||||
|
||||
/**
|
||||
* Solely for optimization; return a Collection<TypeReference> representing
|
||||
* the subclasses of Error
|
||||
* Solely for optimization; return a Collection<TypeReference> representing the subclasses of Error
|
||||
*
|
||||
* kind of ugly. a better scheme?
|
||||
*/
|
||||
public Collection<TypeReference> getJavaLangErrorTypes();
|
||||
|
||||
|
||||
/**
|
||||
* Solely for optimization; return a Collection<TypeReference> representing
|
||||
* the subclasses of {@link RuntimeException}
|
||||
* Solely for optimization; return a Collection<TypeReference> representing the subclasses of {@link RuntimeException}
|
||||
*
|
||||
* kind of ugly. a better scheme?
|
||||
*/
|
||||
public Collection<TypeReference> getJavaLangRuntimeExceptionTypes();
|
||||
|
||||
/**
|
||||
* @param type
|
||||
* an interface
|
||||
* @param type an interface
|
||||
* @return Set of IClass that represent implementors of the interface
|
||||
*/
|
||||
public Set<IClass> getImplementors(TypeReference type);
|
||||
|
@ -178,16 +160,13 @@ public interface IClassHierarchy extends Iterable<IClass> {
|
|||
*/
|
||||
public Collection<IClass> getImmediateSubclasses(IClass klass);
|
||||
|
||||
|
||||
/**
|
||||
* Does an expression c1 x := c2 y typecheck?
|
||||
*
|
||||
* i.e. is c2 a subtype of c1?
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* if c1 is null
|
||||
* @throws IllegalArgumentException
|
||||
* if c2 is null
|
||||
* @throws IllegalArgumentException if c1 is null
|
||||
* @throws IllegalArgumentException if c2 is null
|
||||
*/
|
||||
public boolean isAssignableFrom(IClass c1, IClass c2);
|
||||
|
||||
|
|
Loading…
Reference in New Issue