2007-02-02 17:17:13 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* Copyright (c) 2002 - 2006 IBM Corporation.
|
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
* are made available under the terms of the Eclipse Public License v1.0
|
|
|
|
* which accompanies this distribution, and is available at
|
|
|
|
* http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
*
|
|
|
|
* Contributors:
|
|
|
|
* IBM Corporation - initial API and implementation
|
|
|
|
*****************************************************************************/
|
|
|
|
package com.ibm.wala.cast.loader;
|
|
|
|
|
|
|
|
import java.util.Collection;
|
2013-04-11 01:09:10 +00:00
|
|
|
import java.util.Map;
|
2007-02-02 17:17:13 +00:00
|
|
|
|
2012-01-27 20:15:33 +00:00
|
|
|
import com.ibm.wala.cast.ir.translator.AstTranslator;
|
2008-12-02 14:08:12 +00:00
|
|
|
import com.ibm.wala.cast.ir.translator.AstTranslator.AstLexicalInformation;
|
2012-01-27 20:15:33 +00:00
|
|
|
import com.ibm.wala.cast.tree.CAstEntity;
|
2007-02-02 17:17:13 +00:00
|
|
|
import com.ibm.wala.cast.tree.CAstQualifier;
|
|
|
|
import com.ibm.wala.cast.tree.CAstSourcePositionMap.Position;
|
|
|
|
import com.ibm.wala.cfg.AbstractCFG;
|
|
|
|
import com.ibm.wala.cfg.ControlFlowGraph;
|
2013-04-11 01:09:10 +00:00
|
|
|
import com.ibm.wala.cfg.IBasicBlock;
|
2007-02-02 17:17:13 +00:00
|
|
|
import com.ibm.wala.classLoader.IClass;
|
|
|
|
import com.ibm.wala.classLoader.IMethod;
|
2011-03-29 13:56:48 +00:00
|
|
|
import com.ibm.wala.shrikeCT.InvalidClassFileException;
|
2017-02-23 15:10:39 +00:00
|
|
|
import com.ibm.wala.ssa.SSAInstruction;
|
2007-02-02 17:17:13 +00:00
|
|
|
import com.ibm.wala.ssa.SymbolTable;
|
|
|
|
import com.ibm.wala.types.Descriptor;
|
|
|
|
import com.ibm.wala.types.MethodReference;
|
|
|
|
import com.ibm.wala.types.Selector;
|
|
|
|
import com.ibm.wala.types.TypeReference;
|
2014-04-09 15:15:08 +00:00
|
|
|
import com.ibm.wala.types.annotations.Annotation;
|
2007-02-02 17:17:13 +00:00
|
|
|
import com.ibm.wala.util.collections.Pair;
|
2008-10-03 20:10:09 +00:00
|
|
|
import com.ibm.wala.util.intset.IntSet;
|
2008-01-24 22:05:51 +00:00
|
|
|
import com.ibm.wala.util.strings.Atom;
|
2007-02-02 17:17:13 +00:00
|
|
|
|
|
|
|
public abstract class AstMethod implements IMethod {
|
|
|
|
|
2012-01-27 20:15:33 +00:00
|
|
|
public interface Retranslatable {
|
|
|
|
void retranslate(AstTranslator xlator);
|
|
|
|
CAstEntity getEntity();
|
|
|
|
}
|
|
|
|
|
2007-02-02 17:17:13 +00:00
|
|
|
public interface DebuggingInformation {
|
|
|
|
|
2007-03-12 02:00:43 +00:00
|
|
|
Position getCodeBodyPosition();
|
2012-01-06 21:30:17 +00:00
|
|
|
|
2018-10-13 12:42:08 +00:00
|
|
|
Position getCodeNamePosition();
|
|
|
|
|
2007-02-02 17:17:13 +00:00
|
|
|
Position getInstructionPosition(int instructionOffset);
|
2012-01-06 21:30:17 +00:00
|
|
|
|
2007-02-02 17:17:13 +00:00
|
|
|
String[][] getSourceNamesForValues();
|
|
|
|
|
2018-05-08 12:01:35 +00:00
|
|
|
Position getOperandPosition(int instructionOffset, int operand);
|
|
|
|
|
2018-06-05 19:00:31 +00:00
|
|
|
Position getParameterPosition(int param);
|
|
|
|
|
2007-02-02 17:17:13 +00:00
|
|
|
}
|
|
|
|
|
2012-01-06 21:30:17 +00:00
|
|
|
/**
|
|
|
|
* lexical access information for some entity scope. used during call graph
|
|
|
|
* construction to handle lexical accesses.
|
|
|
|
*/
|
2007-02-02 17:17:13 +00:00
|
|
|
public interface LexicalInformation {
|
|
|
|
|
2012-01-06 21:30:17 +00:00
|
|
|
/**
|
|
|
|
* names possibly accessed in a nested lexical scope, represented as pairs
|
|
|
|
* (name,nameOfDefiningEntity)
|
|
|
|
*/
|
|
|
|
public Pair<String, String>[] getExposedNames();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* maps each exposed name (via its index in {@link #getExposedNames()}) to
|
|
|
|
* its value number at method exit.
|
|
|
|
*/
|
2007-02-02 17:17:13 +00:00
|
|
|
public int[] getExitExposedUses();
|
2012-01-06 21:30:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get a map from exposed name (via its index in {@link #getExposedNames()})
|
|
|
|
* to its value number at the instruction at offset instructionOffset.
|
|
|
|
*/
|
2007-02-02 17:17:13 +00:00
|
|
|
public int[] getExposedUses(int instructionOffset);
|
|
|
|
|
2012-01-06 21:30:17 +00:00
|
|
|
/**
|
|
|
|
* return all value numbers appearing as entries in either
|
|
|
|
* {@link #getExposedUses(int)} or {@link #getExitExposedUses()}
|
|
|
|
*/
|
2008-10-03 20:10:09 +00:00
|
|
|
public IntSet getAllExposedUses();
|
2007-06-12 13:43:16 +00:00
|
|
|
|
2012-01-06 21:30:17 +00:00
|
|
|
/**
|
|
|
|
* return the names of the enclosing methods declaring names that are
|
|
|
|
* lexically accessed by the entity
|
|
|
|
*/
|
2007-02-02 17:17:13 +00:00
|
|
|
public String[] getScopingParents();
|
2012-01-06 21:30:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* returns true if name may be read in nested lexical scopes but cannot be
|
|
|
|
* written
|
|
|
|
*/
|
2011-06-30 15:45:58 +00:00
|
|
|
public boolean isReadOnly(String name);
|
2012-01-06 21:30:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get the name of this entity, as it appears in the definer portion of a
|
|
|
|
* lexical name
|
|
|
|
*/
|
2011-06-30 15:45:58 +00:00
|
|
|
public String getScopingName();
|
2007-02-02 17:17:13 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-12-02 14:08:12 +00:00
|
|
|
protected final IClass cls;
|
Fix nearly all Eclipse warnings about using raw types
Along the way, I also converted many "for (;;)" loops into modern
"for (:)" loops. I didn't systematically look for all opportunities
to do this, though. I merely made this change where I was already
converting raw Iterator uses into modern Iterator<...> uses.
Better use of generics also allowed many casts to become statically
redundant. I have removed all such redundant casts.
Only three raw-types warnings remain after this batch of fixes. All
three involve raw uses of CallGraphBuilder. I've tried to fix these
too, but it quickly snowballs into a cascade of changes that may or
may not eventually reach a statically-type-save fixed point. I may
give these last few problem areas another go in the future. For now,
though, the hundreds of other fixes seem worth keeping even if there
are a few stragglers.
This commit may change some public APIs, but only by making weaker
type signatures stronger by replacing raw types with generic types.
For example, we may change something like "Set" into "Set<String>",
but we're not adding new arguments, changing any
underlying (post-generics-erasure) types, etc.
2017-07-09 18:38:35 +00:00
|
|
|
private final Collection<CAstQualifier> qualifiers;
|
|
|
|
private final AbstractCFG<?, ?> cfg;
|
2012-01-06 21:30:17 +00:00
|
|
|
private final SymbolTable symtab;
|
2008-12-02 14:08:12 +00:00
|
|
|
private final MethodReference ref;
|
|
|
|
private final boolean hasCatchBlock;
|
2009-07-17 13:58:55 +00:00
|
|
|
private final boolean hasMonitorOp;
|
2017-02-23 15:10:39 +00:00
|
|
|
private final Map<IBasicBlock<SSAInstruction>, TypeReference[]> catchTypes;
|
2008-12-02 14:08:12 +00:00
|
|
|
private final AstLexicalInformation lexicalInfo;
|
|
|
|
private final DebuggingInformation debugInfo;
|
2014-04-09 15:15:08 +00:00
|
|
|
private final Collection<Annotation> annotations;
|
2007-02-02 17:17:13 +00:00
|
|
|
|
Fix nearly all Eclipse warnings about using raw types
Along the way, I also converted many "for (;;)" loops into modern
"for (:)" loops. I didn't systematically look for all opportunities
to do this, though. I merely made this change where I was already
converting raw Iterator uses into modern Iterator<...> uses.
Better use of generics also allowed many casts to become statically
redundant. I have removed all such redundant casts.
Only three raw-types warnings remain after this batch of fixes. All
three involve raw uses of CallGraphBuilder. I've tried to fix these
too, but it quickly snowballs into a cascade of changes that may or
may not eventually reach a statically-type-save fixed point. I may
give these last few problem areas another go in the future. For now,
though, the hundreds of other fixes seem worth keeping even if there
are a few stragglers.
This commit may change some public APIs, but only by making weaker
type signatures stronger by replacing raw types with generic types.
For example, we may change something like "Set" into "Set<String>",
but we're not adding new arguments, changing any
underlying (post-generics-erasure) types, etc.
2017-07-09 18:38:35 +00:00
|
|
|
protected AstMethod(IClass cls, Collection<CAstQualifier> qualifiers, AbstractCFG<?, ?> cfg, SymbolTable symtab, MethodReference ref,
|
2017-02-23 15:10:39 +00:00
|
|
|
boolean hasCatchBlock, Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo,
|
2014-04-09 15:15:08 +00:00
|
|
|
DebuggingInformation debugInfo, Collection<Annotation> annotations) {
|
2007-02-02 17:17:13 +00:00
|
|
|
this.cls = cls;
|
|
|
|
this.cfg = cfg;
|
|
|
|
this.ref = ref;
|
|
|
|
this.symtab = symtab;
|
|
|
|
this.qualifiers = qualifiers;
|
2013-04-11 01:09:10 +00:00
|
|
|
this.catchTypes = caughtTypes;
|
2007-02-02 17:17:13 +00:00
|
|
|
this.hasCatchBlock = hasCatchBlock;
|
2009-07-17 13:58:55 +00:00
|
|
|
this.hasMonitorOp = hasMonitorOp;
|
2007-02-02 17:17:13 +00:00
|
|
|
this.lexicalInfo = lexicalInfo;
|
|
|
|
this.debugInfo = debugInfo;
|
2014-04-09 15:15:08 +00:00
|
|
|
this.annotations = annotations;
|
2007-02-02 17:17:13 +00:00
|
|
|
}
|
2012-01-06 21:30:17 +00:00
|
|
|
|
Fix nearly all Eclipse warnings about using raw types
Along the way, I also converted many "for (;;)" loops into modern
"for (:)" loops. I didn't systematically look for all opportunities
to do this, though. I merely made this change where I was already
converting raw Iterator uses into modern Iterator<...> uses.
Better use of generics also allowed many casts to become statically
redundant. I have removed all such redundant casts.
Only three raw-types warnings remain after this batch of fixes. All
three involve raw uses of CallGraphBuilder. I've tried to fix these
too, but it quickly snowballs into a cascade of changes that may or
may not eventually reach a statically-type-save fixed point. I may
give these last few problem areas another go in the future. For now,
though, the hundreds of other fixes seem worth keeping even if there
are a few stragglers.
This commit may change some public APIs, but only by making weaker
type signatures stronger by replacing raw types with generic types.
For example, we may change something like "Set" into "Set<String>",
but we're not adding new arguments, changing any
underlying (post-generics-erasure) types, etc.
2017-07-09 18:38:35 +00:00
|
|
|
protected AstMethod(IClass cls, Collection<CAstQualifier> qualifiers, MethodReference ref, Collection<Annotation> annotations) {
|
2007-02-02 17:17:13 +00:00
|
|
|
this.cls = cls;
|
|
|
|
this.qualifiers = qualifiers;
|
|
|
|
this.ref = ref;
|
2014-04-09 15:15:08 +00:00
|
|
|
this.annotations = annotations;
|
2007-02-02 17:17:13 +00:00
|
|
|
|
|
|
|
this.cfg = null;
|
|
|
|
this.symtab = null;
|
|
|
|
this.catchTypes = null;
|
|
|
|
this.hasCatchBlock = false;
|
2009-07-17 13:58:55 +00:00
|
|
|
this.hasMonitorOp = false;
|
2007-02-02 17:17:13 +00:00
|
|
|
this.lexicalInfo = null;
|
|
|
|
this.debugInfo = null;
|
2012-01-06 21:30:17 +00:00
|
|
|
|
2009-04-30 13:16:52 +00:00
|
|
|
assert isAbstract();
|
2007-02-02 17:17:13 +00:00
|
|
|
}
|
|
|
|
|
Fix nearly all Eclipse warnings about using raw types
Along the way, I also converted many "for (;;)" loops into modern
"for (:)" loops. I didn't systematically look for all opportunities
to do this, though. I merely made this change where I was already
converting raw Iterator uses into modern Iterator<...> uses.
Better use of generics also allowed many casts to become statically
redundant. I have removed all such redundant casts.
Only three raw-types warnings remain after this batch of fixes. All
three involve raw uses of CallGraphBuilder. I've tried to fix these
too, but it quickly snowballs into a cascade of changes that may or
may not eventually reach a statically-type-save fixed point. I may
give these last few problem areas another go in the future. For now,
though, the hundreds of other fixes seem worth keeping even if there
are a few stragglers.
This commit may change some public APIs, but only by making weaker
type signatures stronger by replacing raw types with generic types.
For example, we may change something like "Set" into "Set<String>",
but we're not adding new arguments, changing any
underlying (post-generics-erasure) types, etc.
2017-07-09 18:38:35 +00:00
|
|
|
public AbstractCFG<?, ?> cfg() {
|
2008-12-02 14:08:12 +00:00
|
|
|
return cfg;
|
|
|
|
}
|
2012-01-06 21:30:17 +00:00
|
|
|
|
2008-12-02 14:08:12 +00:00
|
|
|
public boolean hasCatchBlock() {
|
|
|
|
return hasCatchBlock();
|
|
|
|
}
|
2012-01-06 21:30:17 +00:00
|
|
|
|
2008-12-02 14:08:12 +00:00
|
|
|
public SymbolTable symbolTable() {
|
|
|
|
return symtab;
|
|
|
|
}
|
2012-01-06 21:30:17 +00:00
|
|
|
|
2017-02-23 15:10:39 +00:00
|
|
|
public Map<IBasicBlock<SSAInstruction>, TypeReference[]> catchTypes() {
|
2008-12-02 14:08:12 +00:00
|
|
|
return catchTypes;
|
|
|
|
}
|
2012-01-06 21:30:17 +00:00
|
|
|
|
2008-12-02 14:08:12 +00:00
|
|
|
public LexicalInformation cloneLexicalInfo() {
|
|
|
|
return new AstLexicalInformation(lexicalInfo);
|
|
|
|
}
|
2012-01-06 21:30:17 +00:00
|
|
|
|
2008-12-02 14:08:12 +00:00
|
|
|
public LexicalInformation lexicalInfo() {
|
|
|
|
return lexicalInfo;
|
|
|
|
}
|
2012-01-06 21:30:17 +00:00
|
|
|
|
2008-12-02 14:08:12 +00:00
|
|
|
public DebuggingInformation debugInfo() {
|
|
|
|
return debugInfo;
|
|
|
|
}
|
2012-01-06 21:30:17 +00:00
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2014-04-09 15:15:08 +00:00
|
|
|
public Collection<Annotation> getAnnotations() {
|
|
|
|
return annotations;
|
|
|
|
}
|
|
|
|
|
2007-02-02 17:17:13 +00:00
|
|
|
/**
|
2012-01-06 21:30:17 +00:00
|
|
|
* Parents of this method with respect to lexical scoping, that is, methods
|
|
|
|
* containing state possibly referenced lexically in this method
|
2007-02-02 17:17:13 +00:00
|
|
|
*/
|
2011-05-23 16:27:07 +00:00
|
|
|
public static abstract class LexicalParent {
|
2007-02-02 17:17:13 +00:00
|
|
|
public abstract String getName();
|
2012-01-06 21:30:17 +00:00
|
|
|
|
2007-02-02 17:17:13 +00:00
|
|
|
public abstract AstMethod getMethod();
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2012-01-06 21:30:17 +00:00
|
|
|
public int hashCode() {
|
|
|
|
return getName().hashCode() * getMethod().hashCode();
|
2007-02-02 17:17:13 +00:00
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public boolean equals(Object o) {
|
2012-01-06 21:30:17 +00:00
|
|
|
return (o instanceof LexicalParent) && getName().equals(((LexicalParent) o).getName())
|
|
|
|
&& getMethod().equals(((LexicalParent) o).getMethod());
|
2007-02-02 17:17:13 +00:00
|
|
|
}
|
2017-07-12 23:54:57 +00:00
|
|
|
}
|
2007-02-02 17:17:13 +00:00
|
|
|
|
|
|
|
public abstract LexicalParent[] getParents();
|
2012-01-06 21:30:17 +00:00
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public IClass getDeclaringClass() {
|
|
|
|
return cls;
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public String getSignature() {
|
2007-09-11 15:36:38 +00:00
|
|
|
return ref.getSignature();
|
2007-02-02 17:17:13 +00:00
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public Selector getSelector() {
|
|
|
|
return ref.getSelector();
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public boolean isClinit() {
|
|
|
|
return getSelector().equals(MethodReference.clinitSelector);
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public boolean isInit() {
|
2007-06-14 17:43:30 +00:00
|
|
|
return getSelector().getName().equals(MethodReference.initAtom);
|
2007-02-02 17:17:13 +00:00
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public Atom getName() {
|
|
|
|
return ref.getName();
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public Descriptor getDescriptor() {
|
|
|
|
return ref.getDescriptor();
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public MethodReference getReference() {
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public TypeReference getReturnType() {
|
|
|
|
return ref.getReturnType();
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public boolean isStatic() {
|
|
|
|
return qualifiers.contains(CAstQualifier.STATIC);
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public boolean isSynchronized() {
|
|
|
|
return qualifiers.contains(CAstQualifier.SYNCHRONIZED);
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public boolean isNative() {
|
|
|
|
return qualifiers.contains(CAstQualifier.NATIVE);
|
|
|
|
}
|
|
|
|
|
2018-10-03 05:28:21 +00:00
|
|
|
@Override
|
|
|
|
public boolean isWalaSynthetic() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public boolean isSynthetic() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public boolean isAbstract() {
|
|
|
|
return qualifiers.contains(CAstQualifier.ABSTRACT);
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public boolean isPrivate() {
|
|
|
|
return qualifiers.contains(CAstQualifier.PRIVATE);
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public boolean isProtected() {
|
|
|
|
return qualifiers.contains(CAstQualifier.PROTECTED);
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public boolean isPublic() {
|
|
|
|
return qualifiers.contains(CAstQualifier.PUBLIC);
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public boolean isFinal() {
|
|
|
|
return qualifiers.contains(CAstQualifier.FINAL);
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2009-12-03 16:56:49 +00:00
|
|
|
public boolean isBridge() {
|
2007-02-02 17:17:13 +00:00
|
|
|
return qualifiers.contains(CAstQualifier.VOLATILE);
|
|
|
|
}
|
|
|
|
|
Fix nearly all Eclipse warnings about using raw types
Along the way, I also converted many "for (;;)" loops into modern
"for (:)" loops. I didn't systematically look for all opportunities
to do this, though. I merely made this change where I was already
converting raw Iterator uses into modern Iterator<...> uses.
Better use of generics also allowed many casts to become statically
redundant. I have removed all such redundant casts.
Only three raw-types warnings remain after this batch of fixes. All
three involve raw uses of CallGraphBuilder. I've tried to fix these
too, but it quickly snowballs into a cascade of changes that may or
may not eventually reach a statically-type-save fixed point. I may
give these last few problem areas another go in the future. For now,
though, the hundreds of other fixes seem worth keeping even if there
are a few stragglers.
This commit may change some public APIs, but only by making weaker
type signatures stronger by replacing raw types with generic types.
For example, we may change something like "Set" into "Set<String>",
but we're not adding new arguments, changing any
underlying (post-generics-erasure) types, etc.
2017-07-09 18:38:35 +00:00
|
|
|
public ControlFlowGraph<?, ?> getControlFlowGraph() {
|
2007-02-02 17:17:13 +00:00
|
|
|
return cfg;
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public boolean hasExceptionHandler() {
|
|
|
|
return hasCatchBlock;
|
|
|
|
}
|
|
|
|
|
2009-07-17 13:58:55 +00:00
|
|
|
public boolean hasMonitorOp() {
|
|
|
|
return hasMonitorOp;
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public int getNumberOfParameters() {
|
|
|
|
return symtab.getParameterValueNumbers().length;
|
|
|
|
}
|
2011-03-29 13:56:48 +00:00
|
|
|
/** BEGIN Custom change: precise bytecode positions */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @see com.ibm.wala.classLoader.IMethod#getParameterSourcePosition(int)
|
|
|
|
*/
|
2017-05-08 14:39:49 +00:00
|
|
|
@Override
|
2011-03-29 13:56:48 +00:00
|
|
|
public SourcePosition getParameterSourcePosition(int paramNum) throws InvalidClassFileException {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
/** END Custom change: precise bytecode positions */
|
2007-02-02 17:17:13 +00:00
|
|
|
|
2013-06-25 15:57:37 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public int getLineNumber(int instructionIndex) {
|
|
|
|
Position pos = debugInfo.getInstructionPosition(instructionIndex);
|
|
|
|
if (pos == null) {
|
|
|
|
return -1;
|
|
|
|
} else {
|
|
|
|
return pos.getFirstLine();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-03-12 02:00:43 +00:00
|
|
|
public Position getSourcePosition() {
|
|
|
|
return debugInfo.getCodeBodyPosition();
|
|
|
|
}
|
|
|
|
|
2018-06-05 19:00:31 +00:00
|
|
|
public Position getParameterPosition(int paramIndex) {
|
|
|
|
return debugInfo.getParameterPosition(paramIndex);
|
|
|
|
}
|
|
|
|
|
2017-01-04 01:55:46 +00:00
|
|
|
@Override
|
2007-02-02 17:17:13 +00:00
|
|
|
public Position getSourcePosition(int instructionIndex) {
|
|
|
|
return debugInfo.getInstructionPosition(instructionIndex);
|
|
|
|
}
|
|
|
|
}
|