typing cleanups
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4105 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
b7f3f8b7a8
commit
032f82f713
|
@ -24,7 +24,6 @@ import java.util.Set;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import com.ibm.wala.cast.js.html.jericho.JerichoHtmlParser;
|
||||
import com.ibm.wala.cast.tree.CAstSourcePositionMap.Position;
|
||||
import com.ibm.wala.cast.tree.impl.LineNumberPosition;
|
||||
import com.ibm.wala.util.functions.Function;
|
||||
|
||||
|
@ -55,14 +54,14 @@ public class DomLessSourceExtractor extends JSSourceExtractor {
|
|||
this.entrypointRegion = new SourceRegion();
|
||||
}
|
||||
|
||||
protected Function<Integer,Position> makePos(int lineNumber, ITag governingTag) {
|
||||
protected Function<Integer,IncludedPosition> makePos(int lineNumber, ITag governingTag) {
|
||||
return makePos(entrypointUrl, lineNumber, governingTag);
|
||||
}
|
||||
|
||||
protected Function<Integer,Position> makePos(final URL url, final int lineNumber, ITag governingTag) {
|
||||
protected Function<Integer,IncludedPosition> makePos(final URL url, final int lineNumber, ITag governingTag) {
|
||||
final LineNumberPosition includePos = new LineNumberPosition(entrypointUrl, entrypointUrl, governingTag.getStartingLineNum());
|
||||
return new Function<Integer,Position>() {
|
||||
public Position apply(Integer object) {
|
||||
return new Function<Integer,IncludedPosition>() {
|
||||
public IncludedPosition apply(Integer object) {
|
||||
return new IncludedLineNumberPosition(url, url, lineNumber + object.intValue(), includePos);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -22,13 +22,13 @@ import com.ibm.wala.util.collections.HashMapFactory;
|
|||
* Maps line numbers to lines of other files (fileName + line).
|
||||
*/
|
||||
public class FileMapping{
|
||||
protected Map<Integer, Position> lineNumberToFileAndLine = HashMapFactory.make();
|
||||
protected Map<Integer, IncludedPosition> lineNumberToFileAndLine = HashMapFactory.make();
|
||||
|
||||
/**
|
||||
* @param line
|
||||
* @return Null if no mapping for the given line.
|
||||
*/
|
||||
public Position getAssociatedFileAndLine(int line){
|
||||
public IncludedPosition getAssociatedFileAndLine(int line){
|
||||
return lineNumberToFileAndLine.get(line);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,11 +10,9 @@
|
|||
*****************************************************************************/
|
||||
package com.ibm.wala.cast.js.html;
|
||||
|
||||
import com.ibm.wala.cast.tree.CAstSourcePositionMap.Position;
|
||||
|
||||
public class MutableFileMapping extends FileMapping {
|
||||
|
||||
void map(int line, Position originalPos){
|
||||
void map(int line, IncludedPosition originalPos){
|
||||
lineNumberToFileAndLine.put(line, originalPos);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ public class SourceRegion {
|
|||
public SourceRegion() {
|
||||
}
|
||||
|
||||
public void print(String text, Function<Integer,Position> originalPos){
|
||||
public void print(String text, Function<Integer,IncludedPosition> originalPos){
|
||||
source.append(text);
|
||||
int ln = 0;
|
||||
int numberOfLineDrops = getNumberOfLineDrops(text);
|
||||
|
@ -44,7 +44,7 @@ public class SourceRegion {
|
|||
}
|
||||
}
|
||||
|
||||
public void println(String text, Function<Integer,Position> originalPos){
|
||||
public void println(String text, Function<Integer,IncludedPosition> originalPos){
|
||||
print(text + "\n", originalPos);
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ public class SourceRegion {
|
|||
while ((line = br.readLine()) != null){
|
||||
lineNum++;
|
||||
|
||||
Position fileAndLine = otherRegion.fileMapping.getAssociatedFileAndLine(lineNum);
|
||||
IncludedPosition fileAndLine = otherRegion.fileMapping.getAssociatedFileAndLine(lineNum);
|
||||
if (fileAndLine!= null){
|
||||
fileMapping.map(currentLine, fileAndLine);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public abstract class AbstractEntity implements CAstEntity {
|
|||
return sourcePosition;
|
||||
}
|
||||
|
||||
public Iterator<?> getScopedEntities(CAstNode construct) {
|
||||
public Iterator<CAstEntity> getScopedEntities(CAstNode construct) {
|
||||
if (scopedEntities.containsKey(construct)) {
|
||||
return scopedEntities.get(construct).iterator();
|
||||
} else {
|
||||
|
|
|
@ -139,7 +139,7 @@ public interface CAstEntity {
|
|||
* Enclosed entities not induced by a specific AST node are mapped
|
||||
* by the construct 'null'.
|
||||
*/
|
||||
Iterator getScopedEntities(CAstNode construct);
|
||||
Iterator<CAstEntity> getScopedEntities(CAstNode construct);
|
||||
|
||||
/**
|
||||
* The CAPA AST of this entity.
|
||||
|
@ -171,7 +171,7 @@ public interface CAstEntity {
|
|||
* Returns an Iterator over the qualifiers of the given entity, if it has
|
||||
* any, e.g., "final", "private".
|
||||
*/
|
||||
Collection/*<CAstQualifier>*/ getQualifiers();
|
||||
Collection<CAstQualifier> getQualifiers();
|
||||
|
||||
/**
|
||||
* The CAst type of this entity.
|
||||
|
|
Loading…
Reference in New Issue