diff --git a/build-logic/src/main/kotlin/com/ibm/wala/gradle/VerifiedDownload.kt b/build-logic/src/main/kotlin/com/ibm/wala/gradle/VerifiedDownload.kt index 0e95bd439c..869f593c54 100644 --- a/build-logic/src/main/kotlin/com/ibm/wala/gradle/VerifiedDownload.kt +++ b/build-logic/src/main/kotlin/com/ibm/wala/gradle/VerifiedDownload.kt @@ -49,7 +49,7 @@ abstract class VerifiedDownload : DefaultTask() { @TaskAction fun downloadAndVerify() { downloadExtension.run { - src(this@VerifiedDownload.src.map { it.toURL() }) + src(this@VerifiedDownload.src) dest(this@VerifiedDownload.dest) overwrite(true) onlyIfModified(true) @@ -57,7 +57,7 @@ abstract class VerifiedDownload : DefaultTask() { retries(5) } verifyExtension.run { - src(this@VerifiedDownload.dest.get().asFile) + src(this@VerifiedDownload.dest) algorithm(this@VerifiedDownload.algorithm.get()) checksum(this@VerifiedDownload.checksum.get()) } diff --git a/cast/java/ecj/src/main/java/com/ibm/wala/cast/java/ecj/util/SourceDirCallGraph.java b/cast/java/ecj/src/main/java/com/ibm/wala/cast/java/ecj/util/SourceDirCallGraph.java index b5303a3898..f15af188a3 100644 --- a/cast/java/ecj/src/main/java/com/ibm/wala/cast/java/ecj/util/SourceDirCallGraph.java +++ b/cast/java/ecj/src/main/java/com/ibm/wala/cast/java/ecj/util/SourceDirCallGraph.java @@ -51,7 +51,9 @@ public interface Processor { *

Example args: -sourceDir /tmp/srcTest -mainClass LFoo */ public static void main(String[] args) - throws ClassHierarchyException, IllegalArgumentException, CallGraphBuilderCancelException, + throws ClassHierarchyException, + IllegalArgumentException, + CallGraphBuilderCancelException, IOException { new SourceDirCallGraph() .doit( @@ -68,7 +70,9 @@ protected ClassLoaderFactory getLoaderFactory(AnalysisScope scope) { } public void doit(String[] args, Processor processor) - throws ClassHierarchyException, IllegalArgumentException, CallGraphBuilderCancelException, + throws ClassHierarchyException, + IllegalArgumentException, + CallGraphBuilderCancelException, IOException { long start = System.currentTimeMillis(); Properties p = CommandLine.parse(args); diff --git a/cast/java/ecj/src/main/java/com/ibm/wala/cast/java/translator/jdt/JDTJava2CAstTranslator.java b/cast/java/ecj/src/main/java/com/ibm/wala/cast/java/translator/jdt/JDTJava2CAstTranslator.java index 8599988155..aa2ea2c80b 100644 --- a/cast/java/ecj/src/main/java/com/ibm/wala/cast/java/translator/jdt/JDTJava2CAstTranslator.java +++ b/cast/java/ecj/src/main/java/com/ibm/wala/cast/java/translator/jdt/JDTJava2CAstTranslator.java @@ -444,7 +444,9 @@ private CAstEntity visitTypeDecl(AbstractTypeDeclaration n, WalkContext context) makePosition(n.getName())); } - /** @param name Used in creating default constructor, and passed into new ClassEntity() */ + /** + * @param name Used in creating default constructor, and passed into new ClassEntity() + */ private CAstEntity createClassDeclaration( ASTNode n, List bodyDecls, @@ -4589,7 +4591,9 @@ private CAstEntity visit(EnumDeclaration n, WalkContext context) { makePosition(n.getName())); } - /** @param n for positioning. */ + /** + * @param n for positioning. + */ private CAstEntity createEnumConstructorWithParameters( IMethodBinding ctor, ASTNode n, diff --git a/cast/java/ecj/src/main/java/com/ibm/wala/cast/java/translator/jdt/JDTTypeDictionary.java b/cast/java/ecj/src/main/java/com/ibm/wala/cast/java/translator/jdt/JDTTypeDictionary.java index 286509e2cd..a71c71d033 100644 --- a/cast/java/ecj/src/main/java/com/ibm/wala/cast/java/translator/jdt/JDTTypeDictionary.java +++ b/cast/java/ecj/src/main/java/com/ibm/wala/cast/java/translator/jdt/JDTTypeDictionary.java @@ -64,7 +64,9 @@ public class JDTTypeDictionary extends CAstTypeDictionaryImpl { protected final JDTIdentityMapper fIdentityMapper; // TAGALONG - /** @param ast Needed to get root type "java.lang.Object" */ + /** + * @param ast Needed to get root type "java.lang.Object" + */ public JDTTypeDictionary(AST ast, JDTIdentityMapper identityMapper) { fAst = ast; fIdentityMapper = identityMapper; diff --git a/cast/java/src/main/java/com/ibm/wala/cast/java/ipa/slicer/AstJavaSlicer.java b/cast/java/src/main/java/com/ibm/wala/cast/java/ipa/slicer/AstJavaSlicer.java index 57e807e05b..0f0c85c659 100644 --- a/cast/java/src/main/java/com/ibm/wala/cast/java/ipa/slicer/AstJavaSlicer.java +++ b/cast/java/src/main/java/com/ibm/wala/cast/java/ipa/slicer/AstJavaSlicer.java @@ -47,7 +47,9 @@ public static Collection computeBackwardSlice(SDG sdg, Collection< return computeSlice(sdg, ss, true); } - /** @param ss a collection of statements of interest */ + /** + * @param ss a collection of statements of interest + */ public static Collection computeSlice( SDG sdg, Collection ss, boolean backward) throws CancelException { return new Slicer().slice(sdg, ss, backward); diff --git a/cast/java/src/main/java/com/ibm/wala/cast/java/loader/JavaSourceLoaderImpl.java b/cast/java/src/main/java/com/ibm/wala/cast/java/loader/JavaSourceLoaderImpl.java index 899d4cdc1c..0406529f56 100644 --- a/cast/java/src/main/java/com/ibm/wala/cast/java/loader/JavaSourceLoaderImpl.java +++ b/cast/java/src/main/java/com/ibm/wala/cast/java/loader/JavaSourceLoaderImpl.java @@ -85,6 +85,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl { /* BEGIN Custom change: Common superclass is optional */ private final boolean existsCommonSuperclass; // extension to deal with X10 that has no common superclass + /* END Custom change: Common superclass is optional */ /** @@ -589,6 +590,7 @@ public JavaSourceLoaderImpl( // standard case: we have a common super class this(true, loaderRef, parent, cha); } + /* END Custom change: Common superclass is optional */ public IClassHierarchy getClassHierarchy() { return cha; @@ -600,8 +602,10 @@ protected void loadAllSources(Set modules) { } protected abstract SourceModuleTranslator getTranslator(); + /* BEGIN Custom change: Optional deletion of fTypeMap */ public static volatile boolean deleteTypeMapAfterInit = true; + /* END Custom change: Optional deletion of fTypeMap */ @Override public void init(List modules) throws IOException { diff --git a/cast/js/html/nu_validator/src/main/java/com/ibm/wala/cast/js/html/nu_validator/NuValidatorHtmlParser.java b/cast/js/html/nu_validator/src/main/java/com/ibm/wala/cast/js/html/nu_validator/NuValidatorHtmlParser.java index 2b66be1f4e..ac48364749 100644 --- a/cast/js/html/nu_validator/src/main/java/com/ibm/wala/cast/js/html/nu_validator/NuValidatorHtmlParser.java +++ b/cast/js/html/nu_validator/src/main/java/com/ibm/wala/cast/js/html/nu_validator/NuValidatorHtmlParser.java @@ -60,7 +60,8 @@ private int countLines(char[] ch, int start, int length) { LineNumberReader r = new LineNumberReader(new StringReader(new String(ch, start, length))); try { - while (r.read() > -1) ; + while (r.read() > -1) + ; } catch (IOException e) { throw new RuntimeException("cannot read from string", e); } diff --git a/cast/js/nodejs/src/main/java/com/ibm/wala/cast/js/nodejs/NodejsCallGraphBuilderUtil.java b/cast/js/nodejs/src/main/java/com/ibm/wala/cast/js/nodejs/NodejsCallGraphBuilderUtil.java index 1985792c77..f3cb8b1323 100644 --- a/cast/js/nodejs/src/main/java/com/ibm/wala/cast/js/nodejs/NodejsCallGraphBuilderUtil.java +++ b/cast/js/nodejs/src/main/java/com/ibm/wala/cast/js/nodejs/NodejsCallGraphBuilderUtil.java @@ -44,7 +44,9 @@ import java.util.Collection; import java.util.Collections; -/** @author Brian Pfretzschner <brian.pfretzschner@gmail.com> */ +/** + * @author Brian Pfretzschner <brian.pfretzschner@gmail.com> + */ public class NodejsCallGraphBuilderUtil extends JSCallGraphUtil { public static PropagationCallGraphBuilder makeCGBuilder(File mainFile) diff --git a/cast/js/nodejs/src/main/java/com/ibm/wala/cast/js/nodejs/NodejsRequiredCoreModule.java b/cast/js/nodejs/src/main/java/com/ibm/wala/cast/js/nodejs/NodejsRequiredCoreModule.java index 42468f76d1..a5ea172355 100644 --- a/cast/js/nodejs/src/main/java/com/ibm/wala/cast/js/nodejs/NodejsRequiredCoreModule.java +++ b/cast/js/nodejs/src/main/java/com/ibm/wala/cast/js/nodejs/NodejsRequiredCoreModule.java @@ -24,7 +24,9 @@ import java.util.Set; import org.apache.commons.io.FilenameUtils; -/** @author Brian Pfretzschner <brian.pfretzschner@gmail.com> */ +/** + * @author Brian Pfretzschner <brian.pfretzschner@gmail.com> + */ public class NodejsRequiredCoreModule extends NodejsRequiredSourceModule { /** diff --git a/cast/js/nodejs/src/main/java/com/ibm/wala/cast/js/nodejs/NodejsRequiredSourceModule.java b/cast/js/nodejs/src/main/java/com/ibm/wala/cast/js/nodejs/NodejsRequiredSourceModule.java index 703fd0dfb7..13ecbdbea2 100644 --- a/cast/js/nodejs/src/main/java/com/ibm/wala/cast/js/nodejs/NodejsRequiredSourceModule.java +++ b/cast/js/nodejs/src/main/java/com/ibm/wala/cast/js/nodejs/NodejsRequiredSourceModule.java @@ -44,7 +44,9 @@ public class NodejsRequiredSourceModule extends SourceFileModule { private final String className; - /** @param f Must be a file located below folder workingDir. */ + /** + * @param f Must be a file located below folder workingDir. + */ protected NodejsRequiredSourceModule(String className, File f, SourceFileModule clonedFrom) throws IOException { super(f, clonedFrom); diff --git a/cast/js/nodejs/src/test/java/com/ibm/wala/cast/js/nodejs/test/NodejsRequireJsonTest.java b/cast/js/nodejs/src/test/java/com/ibm/wala/cast/js/nodejs/test/NodejsRequireJsonTest.java index 11679449e8..9d52c71cc0 100644 --- a/cast/js/nodejs/src/test/java/com/ibm/wala/cast/js/nodejs/test/NodejsRequireJsonTest.java +++ b/cast/js/nodejs/src/test/java/com/ibm/wala/cast/js/nodejs/test/NodejsRequireJsonTest.java @@ -20,7 +20,9 @@ import java.net.URL; import org.junit.jupiter.api.Test; -/** @author Brian Pfretzschner <brian.pfretzschner@gmail.com> */ +/** + * @author Brian Pfretzschner <brian.pfretzschner@gmail.com> + */ public class NodejsRequireJsonTest { @Test diff --git a/cast/js/nodejs/src/test/java/com/ibm/wala/cast/js/nodejs/test/NodejsRequireTargetSelectorResolveTest.java b/cast/js/nodejs/src/test/java/com/ibm/wala/cast/js/nodejs/test/NodejsRequireTargetSelectorResolveTest.java index 0901cdd044..6f07a3a7b3 100644 --- a/cast/js/nodejs/src/test/java/com/ibm/wala/cast/js/nodejs/test/NodejsRequireTargetSelectorResolveTest.java +++ b/cast/js/nodejs/src/test/java/com/ibm/wala/cast/js/nodejs/test/NodejsRequireTargetSelectorResolveTest.java @@ -20,7 +20,9 @@ import java.net.URL; import org.junit.jupiter.api.Test; -/** @author Brian Pfretzschner <brian.pfretzschner@gmail.com> */ +/** + * @author Brian Pfretzschner <brian.pfretzschner@gmail.com> + */ public class NodejsRequireTargetSelectorResolveTest { @Test diff --git a/cast/js/rhino/src/main/java/com/ibm/wala/cast/js/translator/RhinoToAstTranslator.java b/cast/js/rhino/src/main/java/com/ibm/wala/cast/js/translator/RhinoToAstTranslator.java index 9f25e4f437..c7b69bfa8e 100644 --- a/cast/js/rhino/src/main/java/com/ibm/wala/cast/js/translator/RhinoToAstTranslator.java +++ b/cast/js/rhino/src/main/java/com/ibm/wala/cast/js/translator/RhinoToAstTranslator.java @@ -320,6 +320,7 @@ private static boolean isPrologueScript(WalkContext context) { private static Node getCallTarget(FunctionCall n) { return n.getTarget(); } + /** is n a call to "primitive" within our synthetic modeling code? */ private static boolean isPrimitiveCall(WalkContext context, FunctionCall n) { return isPrologueScript(context) diff --git a/cast/js/rhino/src/test/java/com/ibm/wala/cast/js/vis/JsViewerDriver.java b/cast/js/rhino/src/test/java/com/ibm/wala/cast/js/vis/JsViewerDriver.java index 18249b10c6..8739b8218e 100644 --- a/cast/js/rhino/src/test/java/com/ibm/wala/cast/js/vis/JsViewerDriver.java +++ b/cast/js/rhino/src/test/java/com/ibm/wala/cast/js/vis/JsViewerDriver.java @@ -39,7 +39,11 @@ public class JsViewerDriver extends JSCallGraphBuilderUtil { public static void main(String args[]) - throws ClassHierarchyException, IllegalArgumentException, IOException, CancelException, Error, + throws ClassHierarchyException, + IllegalArgumentException, + IOException, + CancelException, + Error, WalaException { if (args.length != 1) { diff --git a/cast/js/src/main/java/com/ibm/wala/cast/js/callgraph/fieldbased/WorklistBasedOptimisticCallgraphBuilder.java b/cast/js/src/main/java/com/ibm/wala/cast/js/callgraph/fieldbased/WorklistBasedOptimisticCallgraphBuilder.java index a43d8565d1..9b0a414a34 100644 --- a/cast/js/src/main/java/com/ibm/wala/cast/js/callgraph/fieldbased/WorklistBasedOptimisticCallgraphBuilder.java +++ b/cast/js/src/main/java/com/ibm/wala/cast/js/callgraph/fieldbased/WorklistBasedOptimisticCallgraphBuilder.java @@ -204,6 +204,7 @@ public void processPendingReflectiveCallWorklist( } } } + // add flow corresponding to a new call edge private void addCallEdge( FlowGraph flowgraph, CallVertex c, FuncVertex callee, Set worklist) { diff --git a/cast/js/src/main/java/com/ibm/wala/cast/js/client/JavaScriptAnalysisEngine.java b/cast/js/src/main/java/com/ibm/wala/cast/js/client/JavaScriptAnalysisEngine.java index 92cf28e074..e22a0befa2 100644 --- a/cast/js/src/main/java/com/ibm/wala/cast/js/client/JavaScriptAnalysisEngine.java +++ b/cast/js/src/main/java/com/ibm/wala/cast/js/client/JavaScriptAnalysisEngine.java @@ -120,12 +120,16 @@ public enum BuilderType { private BuilderType builderType = BuilderType.OPTIMISTIC; - /** @return the builderType */ + /** + * @return the builderType + */ public BuilderType getBuilderType() { return builderType; } - /** @param builderType the builderType to set */ + /** + * @param builderType the builderType to set + */ public void setBuilderType(BuilderType builderType) { this.builderType = builderType; } diff --git a/cast/js/src/main/java/com/ibm/wala/cast/js/html/FileMapping.java b/cast/js/src/main/java/com/ibm/wala/cast/js/html/FileMapping.java index 3ad9129d55..9adf369af0 100644 --- a/cast/js/src/main/java/com/ibm/wala/cast/js/html/FileMapping.java +++ b/cast/js/src/main/java/com/ibm/wala/cast/js/html/FileMapping.java @@ -14,6 +14,8 @@ public interface FileMapping { - /** @return Null if no mapping for the given line. */ + /** + * @return Null if no mapping for the given line. + */ IncludedPosition getIncludedPosition(Position line); } diff --git a/cast/js/src/main/java/com/ibm/wala/cast/js/html/ITag.java b/cast/js/src/main/java/com/ibm/wala/cast/js/html/ITag.java index 8340fd8dfb..38d02fdfd4 100644 --- a/cast/js/src/main/java/com/ibm/wala/cast/js/html/ITag.java +++ b/cast/js/src/main/java/com/ibm/wala/cast/js/html/ITag.java @@ -20,7 +20,9 @@ */ public interface ITag { - /** @return tag's name (e.g., "HEAD" / "HTML" / "FORM") */ + /** + * @return tag's name (e.g., "HEAD" / "HTML" / "FORM") + */ String getName(); /** diff --git a/cast/js/src/main/java/com/ibm/wala/cast/js/html/jericho/JerichoHtmlParser.java b/cast/js/src/main/java/com/ibm/wala/cast/js/html/jericho/JerichoHtmlParser.java index f17ff1487f..317f13786e 100644 --- a/cast/js/src/main/java/com/ibm/wala/cast/js/html/jericho/JerichoHtmlParser.java +++ b/cast/js/src/main/java/com/ibm/wala/cast/js/html/jericho/JerichoHtmlParser.java @@ -26,7 +26,9 @@ import net.htmlparser.jericho.LoggerProvider; import net.htmlparser.jericho.Source; -/** @author danielk Uses the Jericho parser to go over the HTML */ +/** + * @author danielk Uses the Jericho parser to go over the HTML + */ public class JerichoHtmlParser implements IHtmlParser { static Set warnings = HashSetFactory.make(); @@ -113,7 +115,10 @@ public void parse(URL url, Reader reader, IHtmlCallback callback, String fileNam System.err.println("Error parsing file: " + e.getMessage()); } } - /** @author danielk Inner class does the actual traversal of the HTML using recursion */ + + /** + * @author danielk Inner class does the actual traversal of the HTML using recursion + */ private static class Parser { private final IHtmlCallback handler; private final String fileName; diff --git a/cast/js/src/main/java/com/ibm/wala/cast/js/ipa/callgraph/JSCallGraphUtil.java b/cast/js/src/main/java/com/ibm/wala/cast/js/ipa/callgraph/JSCallGraphUtil.java index 38e3682206..8dd17872b5 100755 --- a/cast/js/src/main/java/com/ibm/wala/cast/js/ipa/callgraph/JSCallGraphUtil.java +++ b/cast/js/src/main/java/com/ibm/wala/cast/js/ipa/callgraph/JSCallGraphUtil.java @@ -179,7 +179,9 @@ public static MethodReference getMethodReference(String funName) { return MR; } - /** @return The set of class names that where defined in the CHA as a result loading process. */ + /** + * @return The set of class names that where defined in the CHA as a result loading process. + */ public static Set loadAdditionalFile(IClassHierarchy cha, JavaScriptLoader cl, URL url) throws IOException { return loadAdditionalFile(cha, cl, new SourceURLModule(url)); diff --git a/cast/js/src/main/java/com/ibm/wala/cast/js/translator/PropertyReadExpander.java b/cast/js/src/main/java/com/ibm/wala/cast/js/translator/PropertyReadExpander.java index 21562fd0cc..793f367812 100644 --- a/cast/js/src/main/java/com/ibm/wala/cast/js/translator/PropertyReadExpander.java +++ b/cast/js/src/main/java/com/ibm/wala/cast/js/translator/PropertyReadExpander.java @@ -63,7 +63,9 @@ public ExpanderKey key() { /** are we handling a sub-node of an assignment? */ abstract boolean inAssignment(); - /** @see AssignPreOrPostOpContext */ + /** + * @see AssignPreOrPostOpContext + */ abstract void setAssign(CAstNode receiverTemp, CAstNode elementTemp); } diff --git a/cast/js/src/testFixtures/java/com/ibm/wala/cast/js/test/TestArgumentSensitivity.java b/cast/js/src/testFixtures/java/com/ibm/wala/cast/js/test/TestArgumentSensitivity.java index ed2757ca79..32b426c614 100644 --- a/cast/js/src/testFixtures/java/com/ibm/wala/cast/js/test/TestArgumentSensitivity.java +++ b/cast/js/src/testFixtures/java/com/ibm/wala/cast/js/test/TestArgumentSensitivity.java @@ -42,7 +42,10 @@ public abstract class TestArgumentSensitivity extends TestJSCallGraphShape { @Test public void testArgs() - throws IOException, IllegalArgumentException, CancelException, ClassHierarchyException, + throws IOException, + IllegalArgumentException, + CancelException, + ClassHierarchyException, WalaException { JavaScriptLoaderFactory loaders = JSCallGraphUtil.makeLoaders(null); AnalysisScope scope = JSCallGraphBuilderUtil.makeScriptScope("tests", "args.js", loaders); diff --git a/cast/js/src/testFixtures/java/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java b/cast/js/src/testFixtures/java/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java index 2ca23a17f0..9c4915a633 100644 --- a/cast/js/src/testFixtures/java/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java +++ b/cast/js/src/testFixtures/java/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java @@ -651,6 +651,7 @@ public void testReturnThis() new Object[] {"suffix:test1", new String[] {"suffix:bar1"}}, new Object[] {"suffix:test2", new String[] {"suffix:bar2"}} }; + // when using the ObjectSensitivityContextSelector, we additionally know that test1 does not call // bar2, // and test2 does not call bar1 diff --git a/cast/src/main/java/com/ibm/wala/cast/ipa/callgraph/CAstAnalysisScope.java b/cast/src/main/java/com/ibm/wala/cast/ipa/callgraph/CAstAnalysisScope.java index d98a09e5c0..11d0bf5182 100644 --- a/cast/src/main/java/com/ibm/wala/cast/ipa/callgraph/CAstAnalysisScope.java +++ b/cast/src/main/java/com/ibm/wala/cast/ipa/callgraph/CAstAnalysisScope.java @@ -79,7 +79,9 @@ public ClassLoaderReference getApplicationLoader() { return null; } - /** @return Returns the arrayClassLoader. */ + /** + * @return Returns the arrayClassLoader. + */ @Override public ArrayClassLoader getArrayClassLoader() { Assertions.UNREACHABLE(); @@ -102,7 +104,9 @@ public void addClassFileToScope(ClassLoaderReference loader, File file) { Assertions.UNREACHABLE(); } - /** @return the ClassLoaderReference specified by {@code name}. */ + /** + * @return the ClassLoaderReference specified by {@code name}. + */ @Override public ClassLoaderReference getLoader(Atom name) { assert name.equals(theLoader.getName()); @@ -115,7 +119,9 @@ public Collection getLoaders() { return Collections.singleton(theLoader); } - /** @return the number of loaders. */ + /** + * @return the number of loaders. + */ @Override public int getNumberOfLoaders() { return 1; diff --git a/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AbstractReflectiveGet.java b/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AbstractReflectiveGet.java index 5f4c35c454..aa830f845d 100644 --- a/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AbstractReflectiveGet.java +++ b/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AbstractReflectiveGet.java @@ -33,7 +33,9 @@ public String toString(SymbolTable symbolTable) { return getValueString(symbolTable, result) + " = " + super.toString(symbolTable); } - /** @see com.ibm.wala.ssa.SSAInstruction#getDef() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getDef() + */ @Override public boolean hasDef() { return true; @@ -49,7 +51,9 @@ public int getDef(int i) { return result; } - /** @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() + */ @Override public int getNumberOfUses() { return 2; diff --git a/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AbstractReflectivePut.java b/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AbstractReflectivePut.java index e378fc19a0..6902b8f875 100644 --- a/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AbstractReflectivePut.java +++ b/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AbstractReflectivePut.java @@ -33,13 +33,17 @@ public String toString(SymbolTable symbolTable) { return super.toString(symbolTable) + " = " + getValueString(symbolTable, value); } - /** @see com.ibm.wala.ssa.SSAInstruction#getDef() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getDef() + */ @Override public int getDef() { return -1; } - /** @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() + */ @Override public int getNumberOfUses() { return 3; diff --git a/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AssignInstruction.java b/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AssignInstruction.java index 8421f54bc5..f8680d6f30 100644 --- a/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AssignInstruction.java +++ b/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AssignInstruction.java @@ -31,7 +31,9 @@ public AssignInstruction(int iindex, int result, int val) { assert val != -1; } - /** @see com.ibm.wala.ssa.SSAInstruction#copyForSSA(SSAInstructionFactory, int[], int[]) */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#copyForSSA(SSAInstructionFactory, int[], int[]) + */ @Override public SSAInstruction copyForSSA(SSAInstructionFactory insts, int[] defs, int[] uses) { return ((AstInstructionFactory) insts) @@ -39,13 +41,17 @@ public SSAInstruction copyForSSA(SSAInstructionFactory insts, int[] defs, int[] iIndex(), defs == null ? getDef(0) : defs[0], uses == null ? getUse(0) : uses[0]); } - /** @see com.ibm.wala.ssa.SSAInstruction#toString(SymbolTable) */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#toString(SymbolTable) + */ @Override public String toString(SymbolTable symbolTable) { return getValueString(symbolTable, result) + " := " + getValueString(symbolTable, val); } - /** @see com.ibm.wala.ssa.SSAInstruction#visit(IVisitor) */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#visit(IVisitor) + */ @Override public void visit(IVisitor v) { ((AstPreInstructionVisitor) v).visitAssign(this); diff --git a/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AstLexicalAccess.java b/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AstLexicalAccess.java index 6c88c3fdbe..1faa390553 100644 --- a/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AstLexicalAccess.java +++ b/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AstLexicalAccess.java @@ -32,10 +32,13 @@ public abstract class AstLexicalAccess extends SSAInstruction { public static class Access { /** name being accessed */ public final String variableName; + /** name of entity that defines the variable */ public final String variableDefiner; + /** type of the lexical value */ public final TypeReference type; + /** value number used for name where access is being performed (not in the declaring entity) */ public final int valueNumber; diff --git a/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AstPropertyWrite.java b/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AstPropertyWrite.java index 729b68c4ff..c2b33db06b 100644 --- a/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AstPropertyWrite.java +++ b/cast/src/main/java/com/ibm/wala/cast/ir/ssa/AstPropertyWrite.java @@ -25,7 +25,9 @@ public String toString(SymbolTable symbolTable) { return super.toString(symbolTable) + " = " + getValueString(symbolTable, getValue()); } - /** @see com.ibm.wala.ssa.SSAInstruction#visit(IVisitor) */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#visit(IVisitor) + */ @Override public void visit(IVisitor v) { assert v instanceof AstInstructionVisitor; diff --git a/cast/src/main/java/com/ibm/wala/cast/loader/AstMethod.java b/cast/src/main/java/com/ibm/wala/cast/loader/AstMethod.java index 29e6182081..31e8a030d8 100644 --- a/cast/src/main/java/com/ibm/wala/cast/loader/AstMethod.java +++ b/cast/src/main/java/com/ibm/wala/cast/loader/AstMethod.java @@ -348,12 +348,14 @@ public boolean hasMonitorOp() { public int getNumberOfParameters() { return symtab.getParameterValueNumbers().length; } + /* BEGIN Custom change: precise bytecode positions */ @Override public SourcePosition getParameterSourcePosition(int paramNum) throws InvalidClassFileException { return null; } + /* END Custom change: precise bytecode positions */ @Override public int getLineNumber(int instructionIndex) { diff --git a/cast/src/main/java/com/ibm/wala/cast/tree/CAst.java b/cast/src/main/java/com/ibm/wala/cast/tree/CAst.java index 0e67d1f244..0f7c5545e4 100644 --- a/cast/src/main/java/com/ibm/wala/cast/tree/CAst.java +++ b/cast/src/main/java/com/ibm/wala/cast/tree/CAst.java @@ -38,6 +38,7 @@ public interface CAst { /** Make a node of type kind with four children. */ CAstNode makeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4); + /** Make a node of type kind with five children. */ CAstNode makeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4, CAstNode c5); diff --git a/cast/src/main/java/com/ibm/wala/cast/tree/visit/CAstVisitor.java b/cast/src/main/java/com/ibm/wala/cast/tree/visit/CAstVisitor.java index 4a7c6a0220..7c97a84387 100644 --- a/cast/src/main/java/com/ibm/wala/cast/tree/visit/CAstVisitor.java +++ b/cast/src/main/java/com/ibm/wala/cast/tree/visit/CAstVisitor.java @@ -21,7 +21,9 @@ import java.util.Iterator; import java.util.Map; -/** @author Igor Peshansky Ripped out of Julian's AstTranslator TODO: document me. */ +/** + * @author Igor Peshansky Ripped out of Julian's AstTranslator TODO: document me. + */ public abstract class CAstVisitor { public static boolean DEBUG = true; @@ -57,6 +59,7 @@ public interface Context { protected C makeFileContext(C context, CAstEntity n) { return context; } + /** * Construct a context for a Type entity. * @@ -66,6 +69,7 @@ protected C makeFileContext(C context, CAstEntity n) { protected C makeTypeContext(C context, CAstEntity n) { return context; } + /** * Construct a context for a Code entity. * @@ -85,6 +89,7 @@ protected C makeCodeContext(C context, CAstEntity n) { protected C makeLocalContext(C context, CAstNode n) { return context; } + /** * Construct a context for an Unwind node. * @@ -268,6 +273,7 @@ protected boolean enterEntity( CAstEntity n, C context, @SuppressWarnings("unused") CAstVisitor visitor) { return false; } + /** * Post-process an entity after visiting it. * @@ -290,6 +296,7 @@ public boolean visitEntity( CAstEntity n, C context, @SuppressWarnings("unused") CAstVisitor visitor) { return false; } + /** * Leave any entity. Override only this to change behavior for all entities. * @@ -312,6 +319,7 @@ public void leaveEntity( protected boolean visitFileEntity(CAstEntity n, C context, C fileC, CAstVisitor visitor) { return visitor.visitEntity(n, context, visitor); } + /** * Leave a File entity. * @@ -322,6 +330,7 @@ protected boolean visitFileEntity(CAstEntity n, C context, C fileC, CAstVisitor< protected void leaveFileEntity(CAstEntity n, C context, C fileContext, CAstVisitor visitor) { visitor.leaveEntity(n, context, visitor); } + /** * Visit a Field entity. * @@ -332,6 +341,7 @@ protected void leaveFileEntity(CAstEntity n, C context, C fileContext, CAstVisit protected boolean visitFieldEntity(CAstEntity n, C context, CAstVisitor visitor) { return visitor.visitEntity(n, context, visitor); } + /** * Leave a Field entity. * @@ -341,6 +351,7 @@ protected boolean visitFieldEntity(CAstEntity n, C context, CAstVisitor visit protected void leaveFieldEntity(CAstEntity n, C context, CAstVisitor visitor) { visitor.leaveEntity(n, context, visitor); } + /** * Visit a Field entity. * @@ -351,6 +362,7 @@ protected void leaveFieldEntity(CAstEntity n, C context, CAstVisitor visitor) protected boolean visitGlobalEntity(CAstEntity n, C context, CAstVisitor visitor) { return visitor.visitEntity(n, context, visitor); } + /** * Leave a Field entity. * @@ -360,6 +372,7 @@ protected boolean visitGlobalEntity(CAstEntity n, C context, CAstVisitor visi protected void leaveGlobalEntity(CAstEntity n, C context, CAstVisitor visitor) { visitor.leaveEntity(n, context, visitor); } + /** * Visit a Type entity. * @@ -372,6 +385,7 @@ protected boolean visitTypeEntity( CAstEntity n, C context, C typeContext, CAstVisitor visitor) { return visitor.visitEntity(n, context, visitor); } + /** * Leave a Type entity. * @@ -382,6 +396,7 @@ protected boolean visitTypeEntity( protected void leaveTypeEntity(CAstEntity n, C context, C typeContext, CAstVisitor visitor) { visitor.leaveEntity(n, context, visitor); } + /** * Visit a Function entity. * @@ -394,6 +409,7 @@ protected boolean visitFunctionEntity( CAstEntity n, C context, C codeContext, CAstVisitor visitor) { return visitor.visitEntity(n, context, visitor); } + /** * Leave a Function entity. * @@ -405,6 +421,7 @@ protected void leaveFunctionEntity( CAstEntity n, C context, C codeContext, CAstVisitor visitor) { visitor.leaveEntity(n, context, visitor); } + /** * Visit a Macro entity. * @@ -417,6 +434,7 @@ protected boolean visitMacroEntity( CAstEntity n, C context, C codeContext, CAstVisitor visitor) { return visitor.visitEntity(n, context, visitor); } + /** * Leave a Macro entity. * @@ -427,6 +445,7 @@ protected boolean visitMacroEntity( protected void leaveMacroEntity(CAstEntity n, C context, C codeContext, CAstVisitor visitor) { visitor.leaveEntity(n, context, visitor); } + /** * Visit a Script entity. * @@ -439,6 +458,7 @@ protected boolean visitScriptEntity( CAstEntity n, C context, C codeContext, CAstVisitor visitor) { return visitor.visitEntity(n, context, visitor); } + /** * Leave a Script entity. * @@ -487,6 +507,7 @@ public final void visitChildren(CAstNode n, int start, C context, CAstVisitor int end = n.getChildCount(); for (int i = start; i < end; i++) visitor.visit(n.getChild(i), context, visitor); } + /** * Visit all children of a node. * @@ -496,6 +517,7 @@ public final void visitChildren(CAstNode n, int start, C context, CAstVisitor public final void visitAllChildren(CAstNode n, C context, CAstVisitor visitor) { visitor.visitChildren(n, 0, context, visitor); } + /** * Recursively visit a given node. TODO: do assertions about structure belong here? * @@ -1117,6 +1139,7 @@ protected boolean visitAssignNodes( protected boolean enterNode(CAstNode n, C c, @SuppressWarnings("unused") CAstVisitor visitor) { return false; } + /** * Post-process a node after visiting it. * @@ -1138,6 +1161,7 @@ protected void postProcessNode( public boolean visitNode(CAstNode n, C c, @SuppressWarnings("unused") CAstVisitor visitor) { return false; } + /** * Leave any node. Override only this to change behavior for all nodes. * @@ -1158,6 +1182,7 @@ public void leaveNode(CAstNode n, C c, @SuppressWarnings("unused") CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a FunctionExpr node. * @@ -1167,6 +1192,7 @@ protected boolean visitFunctionExpr(CAstNode n, C c, CAstVisitor visitor) { protected void leaveFunctionExpr(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a FunctionStmt node. * @@ -1177,6 +1203,7 @@ protected void leaveFunctionExpr(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitFunctionStmt(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a FunctionStmt node. * @@ -1197,6 +1224,7 @@ protected void leaveFunctionStmt(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitClassStmt(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a FunctionStmt node. * @@ -1217,6 +1245,7 @@ protected void leaveClassStmt(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitLocalScope(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a LocalScope node. * @@ -1226,6 +1255,7 @@ protected boolean visitLocalScope(CAstNode n, C c, CAstVisitor visitor) { protected void leaveLocalScope(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a BlockExpr node. * @@ -1236,6 +1266,7 @@ protected void leaveLocalScope(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitBlockExpr(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a BlockExpr node. * @@ -1245,6 +1276,7 @@ protected boolean visitBlockExpr(CAstNode n, C c, CAstVisitor visitor) { protected void leaveBlockExpr(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a BlockStmt node. * @@ -1255,6 +1287,7 @@ protected void leaveBlockExpr(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitBlockStmt(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a BlockStmt node. * @@ -1264,6 +1297,7 @@ protected boolean visitBlockStmt(CAstNode n, C c, CAstVisitor visitor) { protected void leaveBlockStmt(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Loop node. * @@ -1274,6 +1308,7 @@ protected void leaveBlockStmt(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitLoop(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Visit a For..In node. * @@ -1284,6 +1319,7 @@ protected boolean visitLoop(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitForIn(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Visit a Loop node after processing the loop header. * @@ -1294,6 +1330,7 @@ protected void leaveLoopHeader( CAstNode n, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Leave a Loop node. * @@ -1303,6 +1340,7 @@ protected void leaveLoopHeader( protected void leaveLoop(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Leave a For..In node. * @@ -1312,6 +1350,7 @@ protected void leaveLoop(CAstNode n, C c, CAstVisitor visitor) { protected void leaveForIn(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a GetCaughtException node. * @@ -1322,6 +1361,7 @@ protected void leaveForIn(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitGetCaughtException(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a GetCaughtException node. * @@ -1331,6 +1371,7 @@ protected boolean visitGetCaughtException(CAstNode n, C c, CAstVisitor visito protected void leaveGetCaughtException(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a This node. * @@ -1341,6 +1382,7 @@ protected void leaveGetCaughtException(CAstNode n, C c, CAstVisitor visitor) protected boolean visitThis(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a This node. * @@ -1350,6 +1392,7 @@ protected boolean visitThis(CAstNode n, C c, CAstVisitor visitor) { protected void leaveThis(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Super node. * @@ -1360,6 +1403,7 @@ protected void leaveThis(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitSuper(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a Super node. * @@ -1369,6 +1413,7 @@ protected boolean visitSuper(CAstNode n, C c, CAstVisitor visitor) { protected void leaveSuper(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Call node. * @@ -1379,6 +1424,7 @@ protected void leaveSuper(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitCall(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a Call node. * @@ -1388,6 +1434,7 @@ protected boolean visitCall(CAstNode n, C c, CAstVisitor visitor) { protected void leaveCall(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Var node. * @@ -1398,6 +1445,7 @@ protected void leaveCall(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitVar(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a Var node. * @@ -1407,6 +1455,7 @@ protected boolean visitVar(CAstNode n, C c, CAstVisitor visitor) { protected void leaveVar(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Constant node. * @@ -1417,6 +1466,7 @@ protected void leaveVar(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitConstant(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a Constant node. * @@ -1426,6 +1476,7 @@ protected boolean visitConstant(CAstNode n, C c, CAstVisitor visitor) { protected void leaveConstant(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a BinaryExpr node. * @@ -1436,6 +1487,7 @@ protected void leaveConstant(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitBinaryExpr(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a BinaryExpr node. * @@ -1445,6 +1497,7 @@ protected boolean visitBinaryExpr(CAstNode n, C c, CAstVisitor visitor) { protected void leaveBinaryExpr(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a UnaryExpr node. * @@ -1455,6 +1508,7 @@ protected void leaveBinaryExpr(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitUnaryExpr(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a UnaryExpr node. * @@ -1464,6 +1518,7 @@ protected boolean visitUnaryExpr(CAstNode n, C c, CAstVisitor visitor) { protected void leaveUnaryExpr(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an ArrayLength node. * @@ -1474,6 +1529,7 @@ protected void leaveUnaryExpr(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitArrayLength(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an ArrayLength node. * @@ -1483,6 +1539,7 @@ protected boolean visitArrayLength(CAstNode n, C c, CAstVisitor visitor) { protected void leaveArrayLength(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an ArrayRef node. * @@ -1493,6 +1550,7 @@ protected void leaveArrayLength(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitArrayRef(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an ArrayRef node. * @@ -1502,6 +1560,7 @@ protected boolean visitArrayRef(CAstNode n, C c, CAstVisitor visitor) { protected void leaveArrayRef(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a DeclStmt node. * @@ -1512,6 +1571,7 @@ protected void leaveArrayRef(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitDeclStmt(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a DeclStmt node. * @@ -1521,6 +1581,7 @@ protected boolean visitDeclStmt(CAstNode n, C c, CAstVisitor visitor) { protected void leaveDeclStmt(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Return node. * @@ -1531,6 +1592,7 @@ protected void leaveDeclStmt(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitReturn(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a Return node. * @@ -1540,6 +1602,7 @@ protected boolean visitReturn(CAstNode n, C c, CAstVisitor visitor) { protected void leaveReturn(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Return node. * @@ -1550,6 +1613,7 @@ protected void leaveReturn(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitYield(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a Return node. * @@ -1559,6 +1623,7 @@ protected boolean visitYield(CAstNode n, C c, CAstVisitor visitor) { protected void leaveYield(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an Ifgoto node. * @@ -1569,6 +1634,7 @@ protected void leaveYield(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitIfgoto(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an Ifgoto node. * @@ -1578,6 +1644,7 @@ protected boolean visitIfgoto(CAstNode n, C c, CAstVisitor visitor) { protected void leaveIfgoto(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Goto node. * @@ -1588,6 +1655,7 @@ protected void leaveIfgoto(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitGoto(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a Goto node. * @@ -1597,6 +1665,7 @@ protected boolean visitGoto(CAstNode n, C c, CAstVisitor visitor) { protected void leaveGoto(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a LabelStmt node. * @@ -1607,6 +1676,7 @@ protected void leaveGoto(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitLabelStmt(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a LabelStmt node. * @@ -1616,6 +1686,7 @@ protected boolean visitLabelStmt(CAstNode n, C c, CAstVisitor visitor) { protected void leaveLabelStmt(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an IfStmt node. * @@ -1626,6 +1697,7 @@ protected void leaveLabelStmt(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitIfStmt(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Visit an IfStmt node after processing the condition. * @@ -1636,6 +1708,7 @@ protected void leaveIfStmtCondition( CAstNode n, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Visit an IfStmt node after processing the true clause. * @@ -1646,6 +1719,7 @@ protected void leaveIfStmtTrueClause( CAstNode n, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Leave an IfStmt node. * @@ -1655,6 +1729,7 @@ protected void leaveIfStmtTrueClause( protected void leaveIfStmt(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an IfExpr node. * @@ -1665,6 +1740,7 @@ protected void leaveIfStmt(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitIfExpr(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Visit an IfExpr node after processing the condition. * @@ -1675,6 +1751,7 @@ protected void leaveIfExprCondition( CAstNode n, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Visit an IfExpr node after processing the true clause. * @@ -1685,6 +1762,7 @@ protected void leaveIfExprTrueClause( CAstNode n, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Leave an IfExpr node. * @@ -1694,6 +1772,7 @@ protected void leaveIfExprTrueClause( protected void leaveIfExpr(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a New node. * @@ -1704,6 +1783,7 @@ protected void leaveIfExpr(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitNew(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a New node. * @@ -1713,6 +1793,7 @@ protected boolean visitNew(CAstNode n, C c, CAstVisitor visitor) { protected void leaveNew(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an ObjectLiteral node. * @@ -1723,6 +1804,7 @@ protected void leaveNew(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitObjectLiteral(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Visit an ObjectLiteral node after processing the {i}th field initializer. * @@ -1734,6 +1816,7 @@ protected void leaveObjectLiteralFieldInit( CAstNode n, int i, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Leave an ObjectLiteral node. * @@ -1743,6 +1826,7 @@ protected void leaveObjectLiteralFieldInit( protected void leaveObjectLiteral(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an ArrayLiteral node. * @@ -1753,6 +1837,7 @@ protected void leaveObjectLiteral(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitArrayLiteral(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Visit an ArrayLiteral node after processing the array object. * @@ -1763,6 +1848,7 @@ protected void leaveArrayLiteralObject( CAstNode n, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Visit an ArrayLiteral node after processing the {i}th element initializer. * @@ -1774,6 +1860,7 @@ protected void leaveArrayLiteralInitElement( CAstNode n, int i, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Leave a ArrayLiteral node. * @@ -1783,6 +1870,7 @@ protected void leaveArrayLiteralInitElement( protected void leaveArrayLiteral(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an ObjectRef node. * @@ -1793,6 +1881,7 @@ protected void leaveArrayLiteral(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitObjectRef(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an ObjectRef node. * @@ -1802,6 +1891,7 @@ protected boolean visitObjectRef(CAstNode n, C c, CAstVisitor visitor) { protected void leaveObjectRef(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an Assign node. Override only this to change behavior for all assignment nodes. * @@ -1812,6 +1902,7 @@ protected void leaveObjectRef(CAstNode n, C c, CAstVisitor visitor) { public boolean visitAssign(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an Assign node. Override only this to change behavior for all assignment nodes. * @@ -1821,6 +1912,7 @@ public boolean visitAssign(CAstNode n, C c, CAstVisitor visitor) { public void leaveAssign(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an ArrayRef Assignment node after visiting the RHS. * @@ -1835,6 +1927,7 @@ protected boolean visitArrayRefAssign( /* empty */ return false; } + /** * Visit an ArrayRef Assignment node after visiting the LHS. * @@ -1847,6 +1940,7 @@ protected void leaveArrayRefAssign( CAstNode n, CAstNode v, CAstNode a, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Visit an ArrayRef Op/Assignment node after visiting the RHS. * @@ -1867,6 +1961,7 @@ protected boolean visitArrayRefAssignOp( /* empty */ return false; } + /** * Visit an ArrayRef Op/Assignment node after visiting the LHS. * @@ -1885,6 +1980,7 @@ protected void leaveArrayRefAssignOp( @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Visit an ObjectRef Assignment node after visiting the RHS. * @@ -1899,6 +1995,7 @@ protected boolean visitObjectRefAssign( /* empty */ return false; } + /** * Visit an ObjectRef Assignment node after visiting the LHS. * @@ -1911,6 +2008,7 @@ protected void leaveObjectRefAssign( CAstNode n, CAstNode v, CAstNode a, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Visit an ObjectRef Op/Assignment node after visiting the RHS. * @@ -1931,6 +2029,7 @@ protected boolean visitObjectRefAssignOp( /* empty */ return false; } + /** * Visit an ObjectRef Op/Assignment node after visiting the LHS. * @@ -1949,6 +2048,7 @@ protected void leaveObjectRefAssignOp( @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Visit a BlockExpr Assignment node after visiting the RHS. * @@ -1963,6 +2063,7 @@ protected boolean visitBlockExprAssign( /* empty */ return false; } + /** * Visit a BlockExpr Assignment node after visiting the LHS. * @@ -1975,6 +2076,7 @@ protected void leaveBlockExprAssign( CAstNode n, CAstNode v, CAstNode a, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Visit a BlockExpr Op/Assignment node after visiting the RHS. * @@ -1995,6 +2097,7 @@ protected boolean visitBlockExprAssignOp( /* empty */ return false; } + /** * Visit a BlockExpr Op/Assignment node after visiting the LHS. * @@ -2013,6 +2116,7 @@ protected void leaveBlockExprAssignOp( @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Visit a Var Assignment node after visiting the RHS. * @@ -2027,6 +2131,7 @@ protected boolean visitVarAssign( /* empty */ return false; } + /** * Visit a Var Assignment node after visiting the LHS. * @@ -2039,6 +2144,7 @@ protected void leaveVarAssign( CAstNode n, CAstNode v, CAstNode a, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Visit an array literal Assignment node after visiting the RHS. * @@ -2053,6 +2159,7 @@ protected boolean visitArrayLiteralAssign( /* empty */ return false; } + /** * Visit an array literal Assignment node after visiting the LHS. * @@ -2065,6 +2172,7 @@ protected void leaveArrayLiteralAssign( CAstNode n, CAstNode v, CAstNode a, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Visit an array literal Assignment node after visiting the RHS. * @@ -2079,6 +2187,7 @@ protected boolean visitObjectLiteralAssign( /* empty */ return false; } + /** * Visit an array literal Assignment node after visiting the LHS. * @@ -2091,6 +2200,7 @@ protected void leaveObjectLiteralAssign( CAstNode n, CAstNode v, CAstNode a, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Visit a Var Op/Assignment node after visiting the RHS. * @@ -2111,6 +2221,7 @@ protected boolean visitVarAssignOp( /* empty */ return false; } + /** * Visit a Var Op/Assignment node after visiting the LHS. * @@ -2129,6 +2240,7 @@ protected void leaveVarAssignOp( @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Visit a Switch node. * @@ -2139,6 +2251,7 @@ protected void leaveVarAssignOp( protected boolean visitSwitch(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Visit a Switch node after processing the switch value. * @@ -2149,6 +2262,7 @@ protected void leaveSwitchValue( CAstNode n, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Leave a Switch node. * @@ -2158,6 +2272,7 @@ protected void leaveSwitchValue( protected void leaveSwitch(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Throw node. * @@ -2168,6 +2283,7 @@ protected void leaveSwitch(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitThrow(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a Throw node. * @@ -2177,6 +2293,7 @@ protected boolean visitThrow(CAstNode n, C c, CAstVisitor visitor) { protected void leaveThrow(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Catch node. * @@ -2187,6 +2304,7 @@ protected void leaveThrow(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitCatch(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a Catch node. * @@ -2196,6 +2314,7 @@ protected boolean visitCatch(CAstNode n, C c, CAstVisitor visitor) { protected void leaveCatch(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an Unwind node. * @@ -2206,6 +2325,7 @@ protected void leaveCatch(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitUnwind(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an Unwind node. * @@ -2215,6 +2335,7 @@ protected boolean visitUnwind(CAstNode n, C c, CAstVisitor visitor) { protected void leaveUnwind(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Try node. * @@ -2225,6 +2346,7 @@ protected void leaveUnwind(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitTry(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Visit a Try node after processing the try block. * @@ -2235,6 +2357,7 @@ protected void leaveTryBlock( CAstNode n, C c, @SuppressWarnings("unused") CAstVisitor visitor) { /* empty */ } + /** * Leave a Try node. * @@ -2244,6 +2367,7 @@ protected void leaveTryBlock( protected void leaveTry(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an Empty node. * @@ -2254,6 +2378,7 @@ protected void leaveTry(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitEmpty(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an Empty node. * @@ -2263,6 +2388,7 @@ protected boolean visitEmpty(CAstNode n, C c, CAstVisitor visitor) { protected void leaveEmpty(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Primitive node. * @@ -2273,6 +2399,7 @@ protected void leaveEmpty(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitPrimitive(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a Primitive node. * @@ -2282,6 +2409,7 @@ protected boolean visitPrimitive(CAstNode n, C c, CAstVisitor visitor) { protected void leavePrimitive(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Void node. * @@ -2292,6 +2420,7 @@ protected void leavePrimitive(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitVoid(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a Void node. * @@ -2301,6 +2430,7 @@ protected boolean visitVoid(CAstNode n, C c, CAstVisitor visitor) { protected void leaveVoid(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit a Cast node. * @@ -2311,6 +2441,7 @@ protected void leaveVoid(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitCast(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave a Cast node. * @@ -2320,6 +2451,7 @@ protected boolean visitCast(CAstNode n, C c, CAstVisitor visitor) { protected void leaveCast(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an InstanceOf node. * @@ -2330,6 +2462,7 @@ protected void leaveCast(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitInstanceOf(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an InstanceOf node. * @@ -2339,6 +2472,7 @@ protected boolean visitInstanceOf(CAstNode n, C c, CAstVisitor visitor) { protected void leaveInstanceOf(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an InstanceOf node. * @@ -2352,6 +2486,7 @@ protected void leaveAssert(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitAssert(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an InstanceOf node. * @@ -2365,6 +2500,7 @@ protected boolean visitEachElementHasNext(CAstNode n, C c, CAstVisitor visito protected void leaveEachElementHasNext(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an InstanceOf node. * @@ -2375,6 +2511,7 @@ protected void leaveEachElementHasNext(CAstNode n, C c, CAstVisitor visitor) protected boolean visitEachElementGet(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an FOR_EACH_ELEMENT_GET node. * @@ -2384,6 +2521,7 @@ protected boolean visitEachElementGet(CAstNode n, C c, CAstVisitor visitor) { protected void leaveEachElementGet(CAstNode n, C c, CAstVisitor visitor) { visitor.leaveNode(n, c, visitor); } + /** * Visit an TYPE_LITERAL_EXPR node. * @@ -2394,6 +2532,7 @@ protected void leaveEachElementGet(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitTypeLiteralExpr(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an TYPE_LITERAL_EXPR node. * @@ -2407,6 +2546,7 @@ protected void leaveTypeLiteralExpr(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitIsDefinedExpr(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an IS_DEFINED_EXPR node. * @@ -2420,6 +2560,7 @@ protected void leaveIsDefinedExpr(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitEcho(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an ECHO node. * @@ -2433,6 +2574,7 @@ protected void leaveEcho(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitInclude(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an INCLUDE node. * @@ -2446,6 +2588,7 @@ protected void leaveInclude(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitMacroVar(CAstNode n, C c, CAstVisitor visitor) { return visitor.visitNode(n, c, visitor); } + /** * Leave an MACRO_VAR node. * diff --git a/cast/src/main/java/com/ibm/wala/cast/tree/visit/DelegatingCAstVisitor.java b/cast/src/main/java/com/ibm/wala/cast/tree/visit/DelegatingCAstVisitor.java index b4098d1ffb..0b56d4063c 100644 --- a/cast/src/main/java/com/ibm/wala/cast/tree/visit/DelegatingCAstVisitor.java +++ b/cast/src/main/java/com/ibm/wala/cast/tree/visit/DelegatingCAstVisitor.java @@ -31,6 +31,7 @@ public abstract class DelegatingCAstVisitor exten protected C makeFileContext(C context, CAstEntity n) { return delegate.makeFileContext(context, n); } + /** * Construct a context for a Type entity or delegate by default. * @@ -41,6 +42,7 @@ protected C makeFileContext(C context, CAstEntity n) { protected C makeTypeContext(C context, CAstEntity n) { return delegate.makeTypeContext(context, n); } + /** * Construct a context for a Code entity or delegate by default. * @@ -62,6 +64,7 @@ protected C makeCodeContext(C context, CAstEntity n) { protected C makeLocalContext(C context, CAstNode n) { return delegate.makeLocalContext(context, n); } + /** * Construct a context for an Unwind node or delegate by default. * @@ -134,6 +137,7 @@ protected boolean doVisitEntity(CAstEntity n, C context, CAstVisitor visitor) protected boolean enterEntity(CAstEntity n, C context, CAstVisitor visitor) { return delegate.enterEntity(n, context, visitor); } + /** * Post-process an entity after visiting it. * @@ -156,6 +160,7 @@ protected void postProcessEntity(CAstEntity n, C context, CAstVisitor visitor public boolean visitEntity(CAstEntity n, C context, CAstVisitor visitor) { return delegate.visitEntity(n, context, visitor); } + /** * Leave any entity. Override only this to change behavior for all entities. * @@ -180,6 +185,7 @@ protected boolean visitFileEntity( CAstEntity n, C context, C fileContext, CAstVisitor visitor) { return delegate.visitFileEntity(n, context, fileContext, visitor); } + /** * Leave a File entity. * @@ -191,6 +197,7 @@ protected boolean visitFileEntity( protected void leaveFileEntity(CAstEntity n, C context, C fileContext, CAstVisitor visitor) { delegate.leaveFileEntity(n, context, fileContext, visitor); } + /** * Visit a Field entity. * @@ -202,6 +209,7 @@ protected void leaveFileEntity(CAstEntity n, C context, C fileContext, CAstVisit protected boolean visitFieldEntity(CAstEntity n, C context, CAstVisitor visitor) { return delegate.visitFieldEntity(n, context, visitor); } + /** * Leave a Field entity. * @@ -212,6 +220,7 @@ protected boolean visitFieldEntity(CAstEntity n, C context, CAstVisitor visit protected void leaveFieldEntity(CAstEntity n, C context, CAstVisitor visitor) { delegate.leaveFieldEntity(n, context, visitor); } + /** * Visit a Type entity. * @@ -225,6 +234,7 @@ protected boolean visitTypeEntity( CAstEntity n, C context, C typeContext, CAstVisitor visitor) { return delegate.visitTypeEntity(n, context, typeContext, visitor); } + /** * Leave a Type entity. * @@ -236,6 +246,7 @@ protected boolean visitTypeEntity( protected void leaveTypeEntity(CAstEntity n, C context, C typeContext, CAstVisitor visitor) { delegate.leaveTypeEntity(n, context, typeContext, visitor); } + /** * Visit a Function entity. * @@ -249,6 +260,7 @@ protected boolean visitFunctionEntity( CAstEntity n, C context, C codeContext, CAstVisitor visitor) { return delegate.visitFunctionEntity(n, context, codeContext, visitor); } + /** * Leave a Function entity. * @@ -261,6 +273,7 @@ protected void leaveFunctionEntity( CAstEntity n, C context, C codeContext, CAstVisitor visitor) { delegate.leaveFunctionEntity(n, context, codeContext, visitor); } + /** * Visit a Script entity. * @@ -274,6 +287,7 @@ protected boolean visitScriptEntity( CAstEntity n, C context, C codeContext, CAstVisitor visitor) { return delegate.visitScriptEntity(n, context, codeContext, visitor); } + /** * Leave a Script entity. * @@ -308,6 +322,7 @@ protected boolean doVisit(CAstNode n, C context, CAstVisitor visitor) { protected boolean enterNode(CAstNode n, C c, CAstVisitor visitor) { return delegate.enterNode(n, c, visitor); } + /** * Post-process a node after visiting it. * @@ -330,6 +345,7 @@ protected void postProcessNode(CAstNode n, C c, CAstVisitor visitor) { public boolean visitNode(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitNode(n, c, visitor); } + /** * Leave any node. Override only this to change behavior for all nodes. * @@ -352,6 +368,7 @@ public void leaveNode(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitFunctionExpr(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitFunctionExpr(n, c, visitor); } + /** * Leave a FunctionExpr node. * @@ -362,6 +379,7 @@ protected boolean visitFunctionExpr(CAstNode n, C c, CAstVisitor visitor) { protected void leaveFunctionExpr(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveFunctionExpr(n, c, visitor); } + /** * Visit a FunctionStmt node. * @@ -373,6 +391,7 @@ protected void leaveFunctionExpr(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitFunctionStmt(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitFunctionStmt(n, c, visitor); } + /** * Leave a FunctionStmt node. * @@ -383,6 +402,7 @@ protected boolean visitFunctionStmt(CAstNode n, C c, CAstVisitor visitor) { protected void leaveFunctionStmt(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveFunctionStmt(n, c, visitor); } + /** * Visit a ClassStmt node. * @@ -394,6 +414,7 @@ protected void leaveFunctionStmt(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitClassStmt(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitClassStmt(n, c, visitor); } + /** * Leave a FunctionStmt node. * @@ -404,6 +425,7 @@ protected boolean visitClassStmt(CAstNode n, C c, CAstVisitor visitor) { protected void leaveClassStmt(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveClassStmt(n, c, visitor); } + /** * Visit a LocalScope node. * @@ -415,6 +437,7 @@ protected void leaveClassStmt(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitLocalScope(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitLocalScope(n, c, visitor); } + /** * Leave a LocalScope node. * @@ -425,6 +448,7 @@ protected boolean visitLocalScope(CAstNode n, C c, CAstVisitor visitor) { protected void leaveLocalScope(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveLocalScope(n, c, visitor); } + /** * Visit a BlockExpr node. * @@ -436,6 +460,7 @@ protected void leaveLocalScope(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitBlockExpr(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitBlockExpr(n, c, visitor); } + /** * Leave a BlockExpr node. * @@ -446,6 +471,7 @@ protected boolean visitBlockExpr(CAstNode n, C c, CAstVisitor visitor) { protected void leaveBlockExpr(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveBlockExpr(n, c, visitor); } + /** * Visit a BlockStmt node. * @@ -457,6 +483,7 @@ protected void leaveBlockExpr(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitBlockStmt(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitBlockStmt(n, c, visitor); } + /** * Leave a BlockStmt node. * @@ -467,6 +494,7 @@ protected boolean visitBlockStmt(CAstNode n, C c, CAstVisitor visitor) { protected void leaveBlockStmt(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveBlockStmt(n, c, visitor); } + /** * Visit a Loop node. * @@ -478,6 +506,7 @@ protected void leaveBlockStmt(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitLoop(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitLoop(n, c, visitor); } + /** * Visit a Loop node after processing the loop header. * @@ -488,6 +517,7 @@ protected boolean visitLoop(CAstNode n, C c, CAstVisitor visitor) { protected void leaveLoopHeader(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveLoopHeader(n, c, visitor); } + /** * Leave a Loop node. * @@ -498,6 +528,7 @@ protected void leaveLoopHeader(CAstNode n, C c, CAstVisitor visitor) { protected void leaveLoop(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveLoop(n, c, visitor); } + /** * Visit a GetCaughtException node. * @@ -509,6 +540,7 @@ protected void leaveLoop(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitGetCaughtException(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitGetCaughtException(n, c, visitor); } + /** * Leave a GetCaughtException node. * @@ -519,6 +551,7 @@ protected boolean visitGetCaughtException(CAstNode n, C c, CAstVisitor visito protected void leaveGetCaughtException(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveGetCaughtException(n, c, visitor); } + /** * Visit a This node. * @@ -530,6 +563,7 @@ protected void leaveGetCaughtException(CAstNode n, C c, CAstVisitor visitor) protected boolean visitThis(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitThis(n, c, visitor); } + /** * Leave a This node. * @@ -540,6 +574,7 @@ protected boolean visitThis(CAstNode n, C c, CAstVisitor visitor) { protected void leaveThis(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveThis(n, c, visitor); } + /** * Visit a Super node. * @@ -551,6 +586,7 @@ protected void leaveThis(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitSuper(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitSuper(n, c, visitor); } + /** * Leave a Super node. * @@ -561,6 +597,7 @@ protected boolean visitSuper(CAstNode n, C c, CAstVisitor visitor) { protected void leaveSuper(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveSuper(n, c, visitor); } + /** * Visit a Call node. * @@ -572,6 +609,7 @@ protected void leaveSuper(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitCall(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitCall(n, c, visitor); } + /** * Leave a Call node. * @@ -582,6 +620,7 @@ protected boolean visitCall(CAstNode n, C c, CAstVisitor visitor) { protected void leaveCall(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveCall(n, c, visitor); } + /** * Visit a Var node. * @@ -593,6 +632,7 @@ protected void leaveCall(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitVar(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitVar(n, c, visitor); } + /** * Leave a Var node. * @@ -603,6 +643,7 @@ protected boolean visitVar(CAstNode n, C c, CAstVisitor visitor) { protected void leaveVar(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveVar(n, c, visitor); } + /** * Visit a Constant node. * @@ -614,6 +655,7 @@ protected void leaveVar(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitConstant(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitConstant(n, c, visitor); } + /** * Leave a Constant node. * @@ -624,6 +666,7 @@ protected boolean visitConstant(CAstNode n, C c, CAstVisitor visitor) { protected void leaveConstant(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveConstant(n, c, visitor); } + /** * Visit a BinaryExpr node. * @@ -635,6 +678,7 @@ protected void leaveConstant(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitBinaryExpr(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitBinaryExpr(n, c, visitor); } + /** * Leave a BinaryExpr node. * @@ -645,6 +689,7 @@ protected boolean visitBinaryExpr(CAstNode n, C c, CAstVisitor visitor) { protected void leaveBinaryExpr(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveBinaryExpr(n, c, visitor); } + /** * Visit a UnaryExpr node. * @@ -656,6 +701,7 @@ protected void leaveBinaryExpr(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitUnaryExpr(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitUnaryExpr(n, c, visitor); } + /** * Leave a UnaryExpr node. * @@ -666,6 +712,7 @@ protected boolean visitUnaryExpr(CAstNode n, C c, CAstVisitor visitor) { protected void leaveUnaryExpr(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveUnaryExpr(n, c, visitor); } + /** * Visit an ArrayLength node. * @@ -677,6 +724,7 @@ protected void leaveUnaryExpr(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitArrayLength(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitArrayLength(n, c, visitor); } + /** * Leave an ArrayLength node. * @@ -687,6 +735,7 @@ protected boolean visitArrayLength(CAstNode n, C c, CAstVisitor visitor) { protected void leaveArrayLength(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveArrayLength(n, c, visitor); } + /** * Visit an ArrayRef node. * @@ -698,6 +747,7 @@ protected void leaveArrayLength(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitArrayRef(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitArrayRef(n, c, visitor); } + /** * Leave an ArrayRef node. * @@ -708,6 +758,7 @@ protected boolean visitArrayRef(CAstNode n, C c, CAstVisitor visitor) { protected void leaveArrayRef(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveArrayRef(n, c, visitor); } + /** * Visit a DeclStmt node. * @@ -719,6 +770,7 @@ protected void leaveArrayRef(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitDeclStmt(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitDeclStmt(n, c, visitor); } + /** * Leave a DeclStmt node. * @@ -729,6 +781,7 @@ protected boolean visitDeclStmt(CAstNode n, C c, CAstVisitor visitor) { protected void leaveDeclStmt(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveDeclStmt(n, c, visitor); } + /** * Visit a Return node. * @@ -740,6 +793,7 @@ protected void leaveDeclStmt(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitReturn(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitReturn(n, c, visitor); } + /** * Leave a Return node. * @@ -750,6 +804,7 @@ protected boolean visitReturn(CAstNode n, C c, CAstVisitor visitor) { protected void leaveReturn(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveReturn(n, c, visitor); } + /** * Visit an Ifgoto node. * @@ -761,6 +816,7 @@ protected void leaveReturn(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitIfgoto(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitIfgoto(n, c, visitor); } + /** * Leave an Ifgoto node. * @@ -771,6 +827,7 @@ protected boolean visitIfgoto(CAstNode n, C c, CAstVisitor visitor) { protected void leaveIfgoto(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveIfgoto(n, c, visitor); } + /** * Visit a Goto node. * @@ -782,6 +839,7 @@ protected void leaveIfgoto(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitGoto(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitGoto(n, c, visitor); } + /** * Leave a Goto node. * @@ -792,6 +850,7 @@ protected boolean visitGoto(CAstNode n, C c, CAstVisitor visitor) { protected void leaveGoto(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveGoto(n, c, visitor); } + /** * Visit a LabelStmt node. * @@ -803,6 +862,7 @@ protected void leaveGoto(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitLabelStmt(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitLabelStmt(n, c, visitor); } + /** * Leave a LabelStmt node. * @@ -813,6 +873,7 @@ protected boolean visitLabelStmt(CAstNode n, C c, CAstVisitor visitor) { protected void leaveLabelStmt(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveLabelStmt(n, c, visitor); } + /** * Visit an IfStmt node. * @@ -824,6 +885,7 @@ protected void leaveLabelStmt(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitIfStmt(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitIfStmt(n, c, visitor); } + /** * Visit an IfStmt node after processing the condition. * @@ -834,6 +896,7 @@ protected boolean visitIfStmt(CAstNode n, C c, CAstVisitor visitor) { protected void leaveIfStmtCondition(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveIfStmtCondition(n, c, visitor); } + /** * Visit an IfStmt node after processing the true clause. * @@ -844,6 +907,7 @@ protected void leaveIfStmtCondition(CAstNode n, C c, CAstVisitor visitor) { protected void leaveIfStmtTrueClause(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveIfStmtTrueClause(n, c, visitor); } + /** * Leave an IfStmt node. * @@ -854,6 +918,7 @@ protected void leaveIfStmtTrueClause(CAstNode n, C c, CAstVisitor visitor) { protected void leaveIfStmt(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveIfStmt(n, c, visitor); } + /** * Visit an IfExpr node. * @@ -865,6 +930,7 @@ protected void leaveIfStmt(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitIfExpr(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitIfExpr(n, c, visitor); } + /** * Visit an IfExpr node after processing the condition. * @@ -875,6 +941,7 @@ protected boolean visitIfExpr(CAstNode n, C c, CAstVisitor visitor) { protected void leaveIfExprCondition(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveIfExprCondition(n, c, visitor); } + /** * Visit an IfExpr node after processing the true clause. * @@ -885,6 +952,7 @@ protected void leaveIfExprCondition(CAstNode n, C c, CAstVisitor visitor) { protected void leaveIfExprTrueClause(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveIfExprTrueClause(n, c, visitor); } + /** * Leave an IfExpr node. * @@ -895,6 +963,7 @@ protected void leaveIfExprTrueClause(CAstNode n, C c, CAstVisitor visitor) { protected void leaveIfExpr(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveIfExpr(n, c, visitor); } + /** * Visit a New node. * @@ -906,6 +975,7 @@ protected void leaveIfExpr(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitNew(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitNew(n, c, visitor); } + /** * Leave a New node. * @@ -916,6 +986,7 @@ protected boolean visitNew(CAstNode n, C c, CAstVisitor visitor) { protected void leaveNew(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveNew(n, c, visitor); } + /** * Visit an ObjectLiteral node. * @@ -927,6 +998,7 @@ protected void leaveNew(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitObjectLiteral(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitObjectLiteral(n, c, visitor); } + /** * Visit an ObjectLiteral node after processing the {i}th field initializer. * @@ -938,6 +1010,7 @@ protected boolean visitObjectLiteral(CAstNode n, C c, CAstVisitor visitor) { protected void leaveObjectLiteralFieldInit(CAstNode n, int i, C c, CAstVisitor visitor) { delegate.leaveObjectLiteralFieldInit(n, i, c, visitor); } + /** * Leave an ObjectLiteral node. * @@ -948,6 +1021,7 @@ protected void leaveObjectLiteralFieldInit(CAstNode n, int i, C c, CAstVisitor visitor) { delegate.leaveObjectLiteral(n, c, visitor); } + /** * Visit an ArrayLiteral node. * @@ -959,6 +1033,7 @@ protected void leaveObjectLiteral(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitArrayLiteral(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitArrayLiteral(n, c, visitor); } + /** * Visit an ArrayLiteral node after processing the array object. * @@ -969,6 +1044,7 @@ protected boolean visitArrayLiteral(CAstNode n, C c, CAstVisitor visitor) { protected void leaveArrayLiteralObject(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveArrayLiteralObject(n, c, visitor); } + /** * Visit an ArrayLiteral node after processing the {i}th element initializer. * @@ -980,6 +1056,7 @@ protected void leaveArrayLiteralObject(CAstNode n, C c, CAstVisitor visitor) protected void leaveArrayLiteralInitElement(CAstNode n, int i, C c, CAstVisitor visitor) { delegate.leaveArrayLiteralInitElement(n, i, c, visitor); } + /** * Leave a ArrayLiteral node. * @@ -990,6 +1067,7 @@ protected void leaveArrayLiteralInitElement(CAstNode n, int i, C c, CAstVisitor< protected void leaveArrayLiteral(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveArrayLiteral(n, c, visitor); } + /** * Visit an ObjectRef node. * @@ -1001,6 +1079,7 @@ protected void leaveArrayLiteral(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitObjectRef(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitObjectRef(n, c, visitor); } + /** * Leave an ObjectRef node. * @@ -1011,6 +1090,7 @@ protected boolean visitObjectRef(CAstNode n, C c, CAstVisitor visitor) { protected void leaveObjectRef(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveObjectRef(n, c, visitor); } + /** * Visit an Assign node. Override only this to change behavior for all assignment nodes. * @@ -1022,6 +1102,7 @@ protected void leaveObjectRef(CAstNode n, C c, CAstVisitor visitor) { public boolean visitAssign(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitAssign(n, c, visitor); } + /** * Leave an Assign node. Override only this to change behavior for all assignment nodes. * @@ -1032,6 +1113,7 @@ public boolean visitAssign(CAstNode n, C c, CAstVisitor visitor) { public void leaveAssign(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveAssign(n, c, visitor); } + /** * Visit an ArrayRef Assignment node after visiting the RHS. * @@ -1046,6 +1128,7 @@ protected boolean visitArrayRefAssign( CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor visitor) { return delegate.visitArrayRefAssign(n, v, a, c, visitor); } + /** * Visit an ArrayRef Assignment node after visiting the LHS. * @@ -1059,6 +1142,7 @@ protected void leaveArrayRefAssign( CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor visitor) { delegate.leaveArrayRefAssign(n, v, a, c, visitor); } + /** * Visit an ArrayRef Op/Assignment node after visiting the RHS. * @@ -1074,6 +1158,7 @@ protected boolean visitArrayRefAssignOp( CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor visitor) { return delegate.visitArrayRefAssignOp(n, v, a, pre, c, visitor); } + /** * Visit an ArrayRef Op/Assignment node after visiting the LHS. * @@ -1088,6 +1173,7 @@ protected void leaveArrayRefAssignOp( CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor visitor) { delegate.leaveArrayRefAssignOp(n, v, a, pre, c, visitor); } + /** * Visit an ObjectRef Assignment node after visiting the RHS. * @@ -1102,6 +1188,7 @@ protected boolean visitObjectRefAssign( CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor visitor) { return delegate.visitObjectRefAssign(n, v, a, c, visitor); } + /** * Visit an ObjectRef Assignment node after visiting the LHS. * @@ -1115,6 +1202,7 @@ protected void leaveObjectRefAssign( CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor visitor) { delegate.leaveObjectRefAssign(n, v, a, c, visitor); } + /** * Visit an ObjectRef Op/Assignment node after visiting the RHS. * @@ -1130,6 +1218,7 @@ protected boolean visitObjectRefAssignOp( CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor visitor) { return delegate.visitObjectRefAssignOp(n, v, a, pre, c, visitor); } + /** * Visit an ObjectRef Op/Assignment node after visiting the LHS. * @@ -1144,6 +1233,7 @@ protected void leaveObjectRefAssignOp( CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor visitor) { delegate.leaveObjectRefAssignOp(n, v, a, pre, c, visitor); } + /** * Visit a BlockExpr Assignment node after visiting the RHS. * @@ -1158,6 +1248,7 @@ protected boolean visitBlockExprAssign( CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor visitor) { return delegate.visitBlockExprAssign(n, v, a, c, visitor); } + /** * Visit a BlockExpr Assignment node after visiting the LHS. * @@ -1171,6 +1262,7 @@ protected void leaveBlockExprAssign( CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor visitor) { delegate.leaveBlockExprAssign(n, v, a, c, visitor); } + /** * Visit a BlockExpr Op/Assignment node after visiting the RHS. * @@ -1186,6 +1278,7 @@ protected boolean visitBlockExprAssignOp( CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor visitor) { return delegate.visitBlockExprAssignOp(n, v, a, pre, c, visitor); } + /** * Visit a BlockExpr Op/Assignment node after visiting the LHS. * @@ -1200,6 +1293,7 @@ protected void leaveBlockExprAssignOp( CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor visitor) { delegate.leaveBlockExprAssignOp(n, v, a, pre, c, visitor); } + /** * Visit a Var Assignment node after visiting the RHS. * @@ -1214,6 +1308,7 @@ protected boolean visitVarAssign( CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor visitor) { return delegate.visitVarAssign(n, v, a, c, visitor); } + /** * Visit a Var Assignment node after visiting the LHS. * @@ -1226,6 +1321,7 @@ protected boolean visitVarAssign( protected void leaveVarAssign(CAstNode n, CAstNode v, CAstNode a, C c, CAstVisitor visitor) { delegate.leaveVarAssign(n, v, a, c, visitor); } + /** * Visit a Var Op/Assignment node after visiting the RHS. * @@ -1241,6 +1337,7 @@ protected boolean visitVarAssignOp( CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor visitor) { return delegate.visitVarAssignOp(n, v, a, pre, c, visitor); } + /** * Visit a Var Op/Assignment node after visiting the LHS. * @@ -1255,6 +1352,7 @@ protected void leaveVarAssignOp( CAstNode n, CAstNode v, CAstNode a, boolean pre, C c, CAstVisitor visitor) { delegate.leaveVarAssignOp(n, v, a, pre, c, visitor); } + /** * Visit a Switch node. * @@ -1266,6 +1364,7 @@ protected void leaveVarAssignOp( protected boolean visitSwitch(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitSwitch(n, c, visitor); } + /** * Visit a Switch node after processing the switch value. * @@ -1276,6 +1375,7 @@ protected boolean visitSwitch(CAstNode n, C c, CAstVisitor visitor) { protected void leaveSwitchValue(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveSwitchValue(n, c, visitor); } + /** * Leave a Switch node. * @@ -1286,6 +1386,7 @@ protected void leaveSwitchValue(CAstNode n, C c, CAstVisitor visitor) { protected void leaveSwitch(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveSwitch(n, c, visitor); } + /** * Visit a Throw node. * @@ -1297,6 +1398,7 @@ protected void leaveSwitch(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitThrow(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitThrow(n, c, visitor); } + /** * Leave a Throw node. * @@ -1307,6 +1409,7 @@ protected boolean visitThrow(CAstNode n, C c, CAstVisitor visitor) { protected void leaveThrow(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveThrow(n, c, visitor); } + /** * Visit a Catch node. * @@ -1318,6 +1421,7 @@ protected void leaveThrow(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitCatch(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitCatch(n, c, visitor); } + /** * Leave a Catch node. * @@ -1328,6 +1432,7 @@ protected boolean visitCatch(CAstNode n, C c, CAstVisitor visitor) { protected void leaveCatch(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveCatch(n, c, visitor); } + /** * Visit an Unwind node. * @@ -1339,6 +1444,7 @@ protected void leaveCatch(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitUnwind(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitUnwind(n, c, visitor); } + /** * Leave an Unwind node. * @@ -1349,6 +1455,7 @@ protected boolean visitUnwind(CAstNode n, C c, CAstVisitor visitor) { protected void leaveUnwind(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveUnwind(n, c, visitor); } + /** * Visit a Try node. * @@ -1360,6 +1467,7 @@ protected void leaveUnwind(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitTry(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitTry(n, c, visitor); } + /** * Visit a Try node after processing the try block. * @@ -1370,6 +1478,7 @@ protected boolean visitTry(CAstNode n, C c, CAstVisitor visitor) { protected void leaveTryBlock(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveTryBlock(n, c, visitor); } + /** * Leave a Try node. * @@ -1380,6 +1489,7 @@ protected void leaveTryBlock(CAstNode n, C c, CAstVisitor visitor) { protected void leaveTry(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveTry(n, c, visitor); } + /** * Visit an Empty node. * @@ -1391,6 +1501,7 @@ protected void leaveTry(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitEmpty(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitEmpty(n, c, visitor); } + /** * Leave an Empty node. * @@ -1401,6 +1512,7 @@ protected boolean visitEmpty(CAstNode n, C c, CAstVisitor visitor) { protected void leaveEmpty(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveEmpty(n, c, visitor); } + /** * Visit a Primitive node. * @@ -1412,6 +1524,7 @@ protected void leaveEmpty(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitPrimitive(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitPrimitive(n, c, visitor); } + /** * Leave a Primitive node. * @@ -1422,6 +1535,7 @@ protected boolean visitPrimitive(CAstNode n, C c, CAstVisitor visitor) { protected void leavePrimitive(CAstNode n, C c, CAstVisitor visitor) { delegate.leavePrimitive(n, c, visitor); } + /** * Visit a Void node. * @@ -1433,6 +1547,7 @@ protected void leavePrimitive(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitVoid(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitVoid(n, c, visitor); } + /** * Leave a Void node. * @@ -1443,6 +1558,7 @@ protected boolean visitVoid(CAstNode n, C c, CAstVisitor visitor) { protected void leaveVoid(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveVoid(n, c, visitor); } + /** * Visit a Cast node. * @@ -1454,6 +1570,7 @@ protected void leaveVoid(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitCast(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitCast(n, c, visitor); } + /** * Leave a Cast node. * @@ -1464,6 +1581,7 @@ protected boolean visitCast(CAstNode n, C c, CAstVisitor visitor) { protected void leaveCast(CAstNode n, C c, CAstVisitor visitor) { delegate.leaveCast(n, c, visitor); } + /** * Visit an InstanceOf node. * @@ -1475,6 +1593,7 @@ protected void leaveCast(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitInstanceOf(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitInstanceOf(n, c, visitor); } + /** * Leave an InstanceOf node. * @@ -1497,6 +1616,7 @@ protected void leaveInstanceOf(CAstNode n, C c, CAstVisitor visitor) { protected boolean visitSpecialParentScope(CAstNode n, C c, CAstVisitor visitor) { return delegate.visitSpecialParentScope(n, c, visitor); } + /** * Leave a LocalScope node. * diff --git a/core/src/main/java/com/ibm/wala/analysis/arraybounds/ArrayBoundsGraphBuilder.java b/core/src/main/java/com/ibm/wala/analysis/arraybounds/ArrayBoundsGraphBuilder.java index de62b9fb8b..6d5a644510 100644 --- a/core/src/main/java/com/ibm/wala/analysis/arraybounds/ArrayBoundsGraphBuilder.java +++ b/core/src/main/java/com/ibm/wala/analysis/arraybounds/ArrayBoundsGraphBuilder.java @@ -30,6 +30,7 @@ */ public class ArrayBoundsGraphBuilder { private final IR ir; + /** Variables, which were already explored. */ private final HashSet foundVariables; diff --git a/core/src/main/java/com/ibm/wala/analysis/arraybounds/BinaryOpWithConstant.java b/core/src/main/java/com/ibm/wala/analysis/arraybounds/BinaryOpWithConstant.java index b20673a979..6ed6ab4e1a 100644 --- a/core/src/main/java/com/ibm/wala/analysis/arraybounds/BinaryOpWithConstant.java +++ b/core/src/main/java/com/ibm/wala/analysis/arraybounds/BinaryOpWithConstant.java @@ -12,7 +12,9 @@ * @author Stephan Gocht {@code } */ public class BinaryOpWithConstant { - /** @return normalized BinaryOpWithConstant or null, if normalization was not successful. */ + /** + * @return normalized BinaryOpWithConstant or null, if normalization was not successful. + */ public static BinaryOpWithConstant create(SSABinaryOpInstruction instruction, IR ir) { BinaryOpWithConstant result = null; diff --git a/core/src/main/java/com/ibm/wala/analysis/arraybounds/hypergraph/DirectedHyperEdge.java b/core/src/main/java/com/ibm/wala/analysis/arraybounds/hypergraph/DirectedHyperEdge.java index 45bd47db77..44da5db424 100644 --- a/core/src/main/java/com/ibm/wala/analysis/arraybounds/hypergraph/DirectedHyperEdge.java +++ b/core/src/main/java/com/ibm/wala/analysis/arraybounds/hypergraph/DirectedHyperEdge.java @@ -13,6 +13,7 @@ public class DirectedHyperEdge { /** Contains all destinations of this HyperEdge */ private final Set> tail; + /** Contains multiple sources of this HyperEdge */ private final Set> head; diff --git a/core/src/main/java/com/ibm/wala/analysis/arraybounds/hypergraph/HyperNode.java b/core/src/main/java/com/ibm/wala/analysis/arraybounds/hypergraph/HyperNode.java index c5831a6dde..78d4dbe1b6 100644 --- a/core/src/main/java/com/ibm/wala/analysis/arraybounds/hypergraph/HyperNode.java +++ b/core/src/main/java/com/ibm/wala/analysis/arraybounds/hypergraph/HyperNode.java @@ -18,6 +18,7 @@ public class HyperNode { * DirectedHyperGraph#updateNodeEdges()} */ private Set> outEdges; + /** * Set of edges, which have this node as source, can be set automatically with {@link * DirectedHyperGraph#updateNodeEdges()} diff --git a/core/src/main/java/com/ibm/wala/analysis/arraybounds/hypergraph/algorithms/ShortestPath.java b/core/src/main/java/com/ibm/wala/analysis/arraybounds/hypergraph/algorithms/ShortestPath.java index 88b2040b84..e31779a917 100644 --- a/core/src/main/java/com/ibm/wala/analysis/arraybounds/hypergraph/algorithms/ShortestPath.java +++ b/core/src/main/java/com/ibm/wala/analysis/arraybounds/hypergraph/algorithms/ShortestPath.java @@ -70,13 +70,17 @@ private void computeShortestPaths() { } } - /** @return weight > otherWeight */ + /** + * @return weight > otherWeight + */ private boolean greaterThen(Weight weight, Weight otherWeight) { return otherWeight.getType() == Type.NOT_SET || this.comparator.compare(weight, otherWeight) > 0; } - /** @return weight < otherWeight */ + /** + * @return weight < otherWeight + */ private boolean lessThen(Weight weight, Weight otherWeight) { return otherWeight.getType() == Type.NOT_SET || this.comparator.compare(weight, otherWeight) < 0; diff --git a/core/src/main/java/com/ibm/wala/analysis/exceptionanalysis/CGIntraproceduralExceptionAnalysis.java b/core/src/main/java/com/ibm/wala/analysis/exceptionanalysis/CGIntraproceduralExceptionAnalysis.java index b2898a8e88..fec788a8fb 100644 --- a/core/src/main/java/com/ibm/wala/analysis/exceptionanalysis/CGIntraproceduralExceptionAnalysis.java +++ b/core/src/main/java/com/ibm/wala/analysis/exceptionanalysis/CGIntraproceduralExceptionAnalysis.java @@ -56,7 +56,9 @@ public CGIntraproceduralExceptionAnalysis( } } - /** @return IntraproceduralExceptionAnalysis for given node. */ + /** + * @return IntraproceduralExceptionAnalysis for given node. + */ public IntraproceduralExceptionAnalysis getAnalysis(CGNode node) { if (!callGraph.containsNode(node)) { throw new IllegalArgumentException( diff --git a/core/src/main/java/com/ibm/wala/analysis/exceptionanalysis/ExceptionAnalysis.java b/core/src/main/java/com/ibm/wala/analysis/exceptionanalysis/ExceptionAnalysis.java index 35dc438a5e..e50b44207b 100644 --- a/core/src/main/java/com/ibm/wala/analysis/exceptionanalysis/ExceptionAnalysis.java +++ b/core/src/main/java/com/ibm/wala/analysis/exceptionanalysis/ExceptionAnalysis.java @@ -149,7 +149,9 @@ public boolean catchesException( } } - /** @return if the block has uncaught exceptions */ + /** + * @return if the block has uncaught exceptions + */ public boolean hasUncaughtExceptions(CGNode node, ISSABasicBlock block) { if (!isSolved) { throw new IllegalStateException("You need to use .solve() first!"); @@ -237,7 +239,9 @@ public Set getCGNodeExceptions(CGNode node) { } } - /** @return the used filter */ + /** + * @return the used filter + */ public InterproceduralExceptionFilter getFilter() { if (!isSolved) { throw new IllegalStateException("You need to use .solve() first!"); diff --git a/core/src/main/java/com/ibm/wala/analysis/exceptionanalysis/IntraproceduralExceptionAnalysis.java b/core/src/main/java/com/ibm/wala/analysis/exceptionanalysis/IntraproceduralExceptionAnalysis.java index 62013e5d4c..c57ce5555a 100644 --- a/core/src/main/java/com/ibm/wala/analysis/exceptionanalysis/IntraproceduralExceptionAnalysis.java +++ b/core/src/main/java/com/ibm/wala/analysis/exceptionanalysis/IntraproceduralExceptionAnalysis.java @@ -234,7 +234,9 @@ public static SSAInstruction getThrowingInstruction(ISSABasicBlock block) { return result; } - /** @return a set of all exceptions which will be caught, if thrown by the given block. */ + /** + * @return a set of all exceptions which will be caught, if thrown by the given block. + */ private Set collectCaughtExceptions(ISSABasicBlock block) { LinkedHashSet result = new LinkedHashSet<>(); List exceptionalSuccessors = diff --git a/core/src/main/java/com/ibm/wala/analysis/pointers/BasicHeapGraph.java b/core/src/main/java/com/ibm/wala/analysis/pointers/BasicHeapGraph.java index 3844f911fa..678ec3a6d8 100644 --- a/core/src/main/java/com/ibm/wala/analysis/pointers/BasicHeapGraph.java +++ b/core/src/main/java/com/ibm/wala/analysis/pointers/BasicHeapGraph.java @@ -294,7 +294,9 @@ private int[] computeSuccNodeNumbers(Object N, NumberedNodeManager nodeM } } - /** @return R, y \in R(x,y) if the node y is a predecessor of node x */ + /** + * @return R, y \in R(x,y) if the node y is a predecessor of node x + */ private IBinaryNaturalRelation computePredecessors(NumberedNodeManager nodeManager) { BasicNaturalRelation R = new BasicNaturalRelation( @@ -376,73 +378,97 @@ public int compare(Object arg1, Object arg2) { } } - /** @see com.ibm.wala.util.graph.NumberedNodeManager#getNumber(Object) */ + /** + * @see com.ibm.wala.util.graph.NumberedNodeManager#getNumber(Object) + */ @Override public int getNumber(Object N) { return G.getNumber(N); } - /** @see com.ibm.wala.util.graph.NumberedNodeManager#getNode(int) */ + /** + * @see com.ibm.wala.util.graph.NumberedNodeManager#getNode(int) + */ @Override public Object getNode(int number) { return G.getNode(number); } - /** @see com.ibm.wala.util.graph.NumberedNodeManager#getMaxNumber() */ + /** + * @see com.ibm.wala.util.graph.NumberedNodeManager#getMaxNumber() + */ @Override public int getMaxNumber() { return G.getMaxNumber(); } - /** @see com.ibm.wala.util.graph.NodeManager#iterator() */ + /** + * @see com.ibm.wala.util.graph.NodeManager#iterator() + */ @Override public Iterator iterator() { return G.iterator(); } - /** @see com.ibm.wala.util.graph.NodeManager#iterator() */ + /** + * @see com.ibm.wala.util.graph.NodeManager#iterator() + */ @Override public Stream stream() { return G.stream(); } - /** @see com.ibm.wala.util.graph.NodeManager#getNumberOfNodes() */ + /** + * @see com.ibm.wala.util.graph.NodeManager#getNumberOfNodes() + */ @Override public int getNumberOfNodes() { return G.getNumberOfNodes(); } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(Object) + */ @Override public Iterator getPredNodes(Object N) { return G.getPredNodes(N); } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(Object) + */ @Override public int getPredNodeCount(Object N) { return G.getPredNodeCount(N); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(Object) + */ @Override public Iterator getSuccNodes(Object N) { return G.getSuccNodes(N); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(Object) + */ @Override public int getSuccNodeCount(Object N) { return G.getSuccNodeCount(N); } - /** @see com.ibm.wala.util.graph.NodeManager#addNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#addNode(Object) + */ @Override public void addNode(Object n) throws UnimplementedError { Assertions.UNREACHABLE(); } - /** @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) + */ @Override public void removeNode(Object n) throws UnimplementedError { Assertions.UNREACHABLE(); @@ -469,7 +495,9 @@ public void removeAllIncidentEdges(Object node) throws UnsupportedOperationExcep throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.util.graph.NodeManager#containsNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#containsNode(Object) + */ @Override public boolean containsNode(Object N) { return G.containsNode(N); diff --git a/core/src/main/java/com/ibm/wala/analysis/pointers/HeapGraphImpl.java b/core/src/main/java/com/ibm/wala/analysis/pointers/HeapGraphImpl.java index 3e1a2debfa..1cdb70e11d 100644 --- a/core/src/main/java/com/ibm/wala/analysis/pointers/HeapGraphImpl.java +++ b/core/src/main/java/com/ibm/wala/analysis/pointers/HeapGraphImpl.java @@ -59,7 +59,9 @@ public void removeNodeAndEdges(Object N) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } - /** @return the heap model used in this pointer analysis. */ + /** + * @return the heap model used in this pointer analysis. + */ @Override public HeapModel getHeapModel() { return pa.getHeapModel(); diff --git a/core/src/main/java/com/ibm/wala/analysis/reflection/AbstractReflectionInterpreter.java b/core/src/main/java/com/ibm/wala/analysis/reflection/AbstractReflectionInterpreter.java index 40bf0c5890..326b3dcd8d 100644 --- a/core/src/main/java/com/ibm/wala/analysis/reflection/AbstractReflectionInterpreter.java +++ b/core/src/main/java/com/ibm/wala/analysis/reflection/AbstractReflectionInterpreter.java @@ -182,7 +182,9 @@ public SpecializedMethod( super(method, declaringClass, isStatic, isFactory); } - /** @param T type allocated by the instruction. */ + /** + * @param T type allocated by the instruction. + */ protected void addInstruction( final TypeReference T, SSAInstruction instr, boolean isAllocation) { if (isAllocation) { diff --git a/core/src/main/java/com/ibm/wala/analysis/reflection/CloneInterpreter.java b/core/src/main/java/com/ibm/wala/analysis/reflection/CloneInterpreter.java index 984b0a6fdb..08689b4f7c 100644 --- a/core/src/main/java/com/ibm/wala/analysis/reflection/CloneInterpreter.java +++ b/core/src/main/java/com/ibm/wala/analysis/reflection/CloneInterpreter.java @@ -208,7 +208,9 @@ private SSAInstruction[] makeStatements(IClass klass) { return statements.toArray(new SSAInstruction[0]); } - /** @return an IR that encodes the behavior of the clone method for a given type. */ + /** + * @return an IR that encodes the behavior of the clone method for a given type. + */ private IR makeIR(IMethod method, Context context, IClass klass) { assert klass != null; SSAInstruction instrs[] = makeStatements(klass); diff --git a/core/src/main/java/com/ibm/wala/analysis/reflection/FactoryBypassInterpreter.java b/core/src/main/java/com/ibm/wala/analysis/reflection/FactoryBypassInterpreter.java index 41fd01d532..61c4aadbf5 100644 --- a/core/src/main/java/com/ibm/wala/analysis/reflection/FactoryBypassInterpreter.java +++ b/core/src/main/java/com/ibm/wala/analysis/reflection/FactoryBypassInterpreter.java @@ -72,7 +72,9 @@ public class FactoryBypassInterpreter extends AbstractReflectionInterpreter { /** A cache of synthetic method implementations, indexed by Context */ private final Map syntheticMethodCache = HashMapFactory.make(); - /** @param options governing analysis options */ + /** + * @param options governing analysis options + */ public FactoryBypassInterpreter(AnalysisOptions options, IAnalysisCacheView iAnalysisCacheView) { this.options = options; this.cache = iAnalysisCacheView; @@ -128,7 +130,9 @@ public int getNumberOfStatements(CGNode node) { return m.allInstructions.size(); } - /** @see com.ibm.wala.ipa.callgraph.propagation.rta.RTAContextInterpreter#understands(CGNode) */ + /** + * @see com.ibm.wala.ipa.callgraph.propagation.rta.RTAContextInterpreter#understands(CGNode) + */ @Override public boolean understands(CGNode node) { if (node == null) { diff --git a/core/src/main/java/com/ibm/wala/analysis/reflection/GetMethodContext.java b/core/src/main/java/com/ibm/wala/analysis/reflection/GetMethodContext.java index 17f54a2b9d..e99ff55ecc 100644 --- a/core/src/main/java/com/ibm/wala/analysis/reflection/GetMethodContext.java +++ b/core/src/main/java/com/ibm/wala/analysis/reflection/GetMethodContext.java @@ -70,7 +70,8 @@ class NameItem implements ContextItem { String name() { return getName(); } - }; + } + ; @Override public ContextItem get(ContextKey name) { diff --git a/core/src/main/java/com/ibm/wala/analysis/reflection/InstanceKeyWithNode.java b/core/src/main/java/com/ibm/wala/analysis/reflection/InstanceKeyWithNode.java index 04daa14a4b..b87d4c61ec 100644 --- a/core/src/main/java/com/ibm/wala/analysis/reflection/InstanceKeyWithNode.java +++ b/core/src/main/java/com/ibm/wala/analysis/reflection/InstanceKeyWithNode.java @@ -16,6 +16,8 @@ /** An instance key which has an associated {@link CGNode}. */ public interface InstanceKeyWithNode extends InstanceKey { - /** @return the node which created this instance. */ + /** + * @return the node which created this instance. + */ CGNode getNode(); } diff --git a/core/src/main/java/com/ibm/wala/analysis/reflection/JavaLangClassContextInterpreter.java b/core/src/main/java/com/ibm/wala/analysis/reflection/JavaLangClassContextInterpreter.java index b447863542..d857b7b1f3 100644 --- a/core/src/main/java/com/ibm/wala/analysis/reflection/JavaLangClassContextInterpreter.java +++ b/core/src/main/java/com/ibm/wala/analysis/reflection/JavaLangClassContextInterpreter.java @@ -230,6 +230,7 @@ private static IR makeIR(IMethod method, Context context) { Assertions.UNREACHABLE("Unexpected method " + method); return null; } + /* END Custom change: caching */ @Override diff --git a/core/src/main/java/com/ibm/wala/analysis/stackMachine/AbstractIntStackMachine.java b/core/src/main/java/com/ibm/wala/analysis/stackMachine/AbstractIntStackMachine.java index e071c3634c..08232886cc 100644 --- a/core/src/main/java/com/ibm/wala/analysis/stackMachine/AbstractIntStackMachine.java +++ b/core/src/main/java/com/ibm/wala/analysis/stackMachine/AbstractIntStackMachine.java @@ -249,7 +249,9 @@ public MachineState getEntryState() { return solver.getIn(cfg.entry()); } - /** @return the state at the entry to a given block */ + /** + * @return the state at the entry to a given block + */ public MachineState getIn(ShrikeCFG.BasicBlock bb) { return solver.getIn(bb); } @@ -637,7 +639,9 @@ public void setLocal(int i, int j) { locals[i] = j; } - /** @return the number of the symbol corresponding to local i */ + /** + * @return the number of the symbol corresponding to local i + */ public int getLocal(int i) { if (locals == null || locals.length < i + 1) { if (OPTIMISTIC) { diff --git a/core/src/main/java/com/ibm/wala/analysis/typeInference/ConeType.java b/core/src/main/java/com/ibm/wala/analysis/typeInference/ConeType.java index bb48005012..0084f731b6 100644 --- a/core/src/main/java/com/ibm/wala/analysis/typeInference/ConeType.java +++ b/core/src/main/java/com/ibm/wala/analysis/typeInference/ConeType.java @@ -21,7 +21,9 @@ public class ConeType extends TypeAbstraction { private final IClass type; - /** @throws IllegalArgumentException if type is null */ + /** + * @throws IllegalArgumentException if type is null + */ public ConeType(IClass type) { if (type == null) { throw new IllegalArgumentException("type is null"); @@ -98,7 +100,9 @@ public boolean isInterface() { return getType().isInterface(); } - /** @return an Iterator of IClass that implement this interface */ + /** + * @return an Iterator of IClass that implement this interface + */ public Iterator iterateImplementors() { return type.getClassHierarchy().getImplementors(getType().getReference()).iterator(); } diff --git a/core/src/main/java/com/ibm/wala/analysis/typeInference/PointType.java b/core/src/main/java/com/ibm/wala/analysis/typeInference/PointType.java index c348311605..188d2913ab 100644 --- a/core/src/main/java/com/ibm/wala/analysis/typeInference/PointType.java +++ b/core/src/main/java/com/ibm/wala/analysis/typeInference/PointType.java @@ -19,7 +19,9 @@ public class PointType extends TypeAbstraction { private final IClass type; - /** @throws IllegalArgumentException if type is null */ + /** + * @throws IllegalArgumentException if type is null + */ public PointType(IClass type) { if (type == null) { throw new IllegalArgumentException("type is null"); diff --git a/core/src/main/java/com/ibm/wala/analysis/typeInference/TypeInference.java b/core/src/main/java/com/ibm/wala/analysis/typeInference/TypeInference.java index e2f0cccac2..4c96e1ad99 100644 --- a/core/src/main/java/com/ibm/wala/analysis/typeInference/TypeInference.java +++ b/core/src/main/java/com/ibm/wala/analysis/typeInference/TypeInference.java @@ -240,7 +240,9 @@ public byte evaluate(TypeVariable lhs) { } } - /** @see java.lang.Object#toString() */ + /** + * @see java.lang.Object#toString() + */ @Override public String toString() { return "delared type := " + type; diff --git a/core/src/main/java/com/ibm/wala/cfg/AbstractCFG.java b/core/src/main/java/com/ibm/wala/cfg/AbstractCFG.java index 32899cc29c..aa548fdcbc 100644 --- a/core/src/main/java/com/ibm/wala/cfg/AbstractCFG.java +++ b/core/src/main/java/com/ibm/wala/cfg/AbstractCFG.java @@ -159,14 +159,18 @@ public int getNumberOfExceptionalIn(T N) { return exceptionalEdgeManager.getPredNodeCount(N); } - /** @param number number of a basic block in this cfg */ + /** + * @param number number of a basic block in this cfg + */ boolean hasAnyNormalOut(int number) { return (fallThru.get(number) || normalEdgeManager.getSuccNodeCount(number) > 0 || normalToExit.get(number)); } - /** @param number number of a basic block in this cfg */ + /** + * @param number number of a basic block in this cfg + */ private int getNumberOfNormalOut(int number) { int xtra = 0; if (fallThru.get(number)) { @@ -178,7 +182,9 @@ private int getNumberOfNormalOut(int number) { return normalEdgeManager.getSuccNodeCount(number) + xtra; } - /** @param number number of a basic block in this cfg */ + /** + * @param number number of a basic block in this cfg + */ public int getNumberOfExceptionalOut(int number) { int xtra = 0; if (exceptionalToExit.get(number)) { @@ -453,7 +459,9 @@ public boolean hasNormalEdge(T src, T dst) { return normalEdgeManager.hasEdge(src, dst); } - /** @throws IllegalArgumentException if src or dst is null */ + /** + * @throws IllegalArgumentException if src or dst is null + */ public void addNormalEdge(T src, T dst) { if (src == null) { throw new IllegalArgumentException("src is null"); @@ -470,7 +478,9 @@ public void addNormalEdge(T src, T dst) { } } - /** @throws IllegalArgumentException if dst is null */ + /** + * @throws IllegalArgumentException if dst is null + */ public void addExceptionalEdge(T src, T dst) { if (dst == null) { throw new IllegalArgumentException("dst is null"); @@ -492,19 +502,25 @@ public void addExceptionalEdge(T src, T dst) { } } - /** @see com.ibm.wala.util.graph.Graph#removeNode(Object) */ + /** + * @see com.ibm.wala.util.graph.Graph#removeNode(Object) + */ @Override public void removeNodeAndEdges(T N) throws UnimplementedError { Assertions.UNREACHABLE(); } - /** @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) + */ @Override public void removeNode(T n) throws UnimplementedError { Assertions.UNREACHABLE(); } - /** @see com.ibm.wala.util.graph.NodeManager#containsNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#containsNode(Object) + */ @Override public boolean containsNode(T N) { return nodeManager.containsNode(N); @@ -529,7 +545,9 @@ protected void setCatchBlock(int i) { catchBlocks.set(i); } - /** @return true iff block i is a catch block */ + /** + * @return true iff block i is a catch block + */ public boolean isCatchBlock(int i) { return catchBlocks.get(i); } @@ -545,7 +563,9 @@ public IMethod getMethod() { return method; } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) + */ @Override public void removeAllIncidentEdges(T node) throws UnimplementedError { Assertions.UNREACHABLE(); diff --git a/core/src/main/java/com/ibm/wala/cfg/ControlFlowGraph.java b/core/src/main/java/com/ibm/wala/cfg/ControlFlowGraph.java index d158b69596..322dea5e86 100644 --- a/core/src/main/java/com/ibm/wala/cfg/ControlFlowGraph.java +++ b/core/src/main/java/com/ibm/wala/cfg/ControlFlowGraph.java @@ -18,7 +18,9 @@ public interface ControlFlowGraph> extends NumberedGraph, MinimalCFG { - /** @return the indices of the catch blocks, as a bit vector */ + /** + * @return the indices of the catch blocks, as a bit vector + */ BitVector getCatchBlocks(); /** @@ -27,7 +29,9 @@ public interface ControlFlowGraph> */ T getBlockForInstruction(int index); - /** @return the instructions of this CFG, as an array. */ + /** + * @return the instructions of this CFG, as an array. + */ I[] getInstructions(); /** @@ -38,6 +42,8 @@ public interface ControlFlowGraph> */ int getProgramCounter(int index); - /** @return the Method this CFG represents */ + /** + * @return the Method this CFG represents + */ IMethod getMethod(); } diff --git a/core/src/main/java/com/ibm/wala/cfg/IBasicBlock.java b/core/src/main/java/com/ibm/wala/cfg/IBasicBlock.java index dac2b19f55..c61ae5efb0 100644 --- a/core/src/main/java/com/ibm/wala/cfg/IBasicBlock.java +++ b/core/src/main/java/com/ibm/wala/cfg/IBasicBlock.java @@ -58,7 +58,9 @@ public interface IBasicBlock extends INodeWithNumber, Iterable extends NumberedGraph { /** Return the entry basic block in the CFG */ T entry(); - /** @return the synthetic exit block for the cfg */ + /** + * @return the synthetic exit block for the cfg + */ T exit(); /** diff --git a/core/src/main/java/com/ibm/wala/cfg/ShrikeCFG.java b/core/src/main/java/com/ibm/wala/cfg/ShrikeCFG.java index 4661c137f6..6f1c9fe885 100644 --- a/core/src/main/java/com/ibm/wala/cfg/ShrikeCFG.java +++ b/core/src/main/java/com/ibm/wala/cfg/ShrikeCFG.java @@ -524,7 +524,9 @@ public Set getExceptionHandlers() { return exceptionHandlers; } - /** @see com.ibm.wala.cfg.ControlFlowGraph#getProgramCounter(int) */ + /** + * @see com.ibm.wala.cfg.ControlFlowGraph#getProgramCounter(int) + */ @Override public int getProgramCounter(int index) { try { diff --git a/core/src/main/java/com/ibm/wala/cfg/Util.java b/core/src/main/java/com/ibm/wala/cfg/Util.java index 8175afc84e..161302c78b 100644 --- a/core/src/main/java/com/ibm/wala/cfg/Util.java +++ b/core/src/main/java/com/ibm/wala/cfg/Util.java @@ -21,7 +21,9 @@ /** Convenience methods for navigating a {@link ControlFlowGraph}. */ public class Util { - /** @return the last instruction in basic block b, as stored in the instruction array for cfg */ + /** + * @return the last instruction in basic block b, as stored in the instruction array for cfg + */ public static SSAInstruction getLastInstruction( ControlFlowGraph cfg, IBasicBlock b) { if (b == null) { diff --git a/core/src/main/java/com/ibm/wala/cfg/cdg/ControlDependenceGraph.java b/core/src/main/java/com/ibm/wala/cfg/cdg/ControlDependenceGraph.java index 55952dff07..d97cee6b54 100644 --- a/core/src/main/java/com/ibm/wala/cfg/cdg/ControlDependenceGraph.java +++ b/core/src/main/java/com/ibm/wala/cfg/cdg/ControlDependenceGraph.java @@ -220,7 +220,9 @@ public ControlDependenceGraph(MinimalCFG cfg, boolean wantEdgeLabels) { this.edgeManager = constructGraphEdges(buildControlDependence(wantEdgeLabels)); } - /** @param cfg governing control flow graph */ + /** + * @param cfg governing control flow graph + */ public ControlDependenceGraph(MinimalCFG cfg) { this(cfg, false); } diff --git a/core/src/main/java/com/ibm/wala/cfg/exc/intra/NullPointerTransferFunctionProvider.java b/core/src/main/java/com/ibm/wala/cfg/exc/intra/NullPointerTransferFunctionProvider.java index c4dac7a225..ec76e2f6c3 100644 --- a/core/src/main/java/com/ibm/wala/cfg/exc/intra/NullPointerTransferFunctionProvider.java +++ b/core/src/main/java/com/ibm/wala/cfg/exc/intra/NullPointerTransferFunctionProvider.java @@ -51,7 +51,9 @@ import java.util.ArrayList; import java.util.Arrays; -/** @author Juergen Graf <graf@kit.edu> */ +/** + * @author Juergen Graf <graf@kit.edu> + */ class NullPointerTransferFunctionProvider implements ITransferFunctionProvider { diff --git a/core/src/main/java/com/ibm/wala/classLoader/AbstractNestedJarFileModule.java b/core/src/main/java/com/ibm/wala/classLoader/AbstractNestedJarFileModule.java index a9be2efe11..ab13f2aa0c 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/AbstractNestedJarFileModule.java +++ b/core/src/main/java/com/ibm/wala/classLoader/AbstractNestedJarFileModule.java @@ -130,7 +130,9 @@ public void remove() { }; } - /** @author sfink an entry in a nested jar file. */ + /** + * @author sfink an entry in a nested jar file. + */ private class Entry implements ModuleEntry { private final String name; diff --git a/core/src/main/java/com/ibm/wala/classLoader/ArrayClass.java b/core/src/main/java/com/ibm/wala/classLoader/ArrayClass.java index 5f82d1175d..6ecd5e97f3 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/ArrayClass.java +++ b/core/src/main/java/com/ibm/wala/classLoader/ArrayClass.java @@ -206,7 +206,9 @@ public Collection getAllImplementedInterfaces() { return result; } - /** @see IClass#getAllImplementedInterfaces() */ + /** + * @see IClass#getAllImplementedInterfaces() + */ public Collection getAllAncestorInterfaces() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } diff --git a/core/src/main/java/com/ibm/wala/classLoader/BytecodeClass.java b/core/src/main/java/com/ibm/wala/classLoader/BytecodeClass.java index 26e3567f98..26860ddd82 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/BytecodeClass.java +++ b/core/src/main/java/com/ibm/wala/classLoader/BytecodeClass.java @@ -436,7 +436,9 @@ public IMethod getMethod(Selector selector) { return null; } - /** @return Collection of IClasses, representing the interfaces this class implements. */ + /** + * @return Collection of IClasses, representing the interfaces this class implements. + */ protected Collection computeAllInterfacesAsCollection() { Collection c = getDirectInterfaces(); Set result = HashSetFactory.make(); diff --git a/core/src/main/java/com/ibm/wala/classLoader/ClassLoaderFactoryImpl.java b/core/src/main/java/com/ibm/wala/classLoader/ClassLoaderFactoryImpl.java index dae10373fd..e91fa3057a 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/ClassLoaderFactoryImpl.java +++ b/core/src/main/java/com/ibm/wala/classLoader/ClassLoaderFactoryImpl.java @@ -33,7 +33,9 @@ public class ClassLoaderFactoryImpl implements ClassLoaderFactory { /** A Mapping from ClassLoaderReference to IClassLoader */ private final HashMap map = HashMapFactory.make(3); - /** @param exclusions A set of classes that class loaders should pretend don't exist. */ + /** + * @param exclusions A set of classes that class loaders should pretend don't exist. + */ public ClassLoaderFactoryImpl(SetOfClasses exclusions) { this.exclusions = exclusions; } @@ -152,7 +154,9 @@ public static InvalidClassLoaderImplementation create(String impl) { } } - /** @return the set of classes that will be ignored. */ + /** + * @return the set of classes that will be ignored. + */ public SetOfClasses getExclusions() { return exclusions; } diff --git a/core/src/main/java/com/ibm/wala/classLoader/CodeScanner.java b/core/src/main/java/com/ibm/wala/classLoader/CodeScanner.java index 85d52e7732..194443d123 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/CodeScanner.java +++ b/core/src/main/java/com/ibm/wala/classLoader/CodeScanner.java @@ -36,7 +36,9 @@ /** Simple utilities to scan {@link IMethod}s to gather information without building an IR. */ public class CodeScanner { - /** @throws IllegalArgumentException if m is null */ + /** + * @throws IllegalArgumentException if m is null + */ public static Collection getCallSites(IMethod m) throws InvalidClassFileException { if (m == null) { @@ -51,7 +53,9 @@ public static Collection getCallSites(IMethod m) } } - /** @throws IllegalArgumentException if m is null */ + /** + * @throws IllegalArgumentException if m is null + */ public static Collection getFieldsRead(IMethod m) throws InvalidClassFileException { if (m == null) { @@ -70,7 +74,9 @@ public static Collection getFieldsRead(IMethod m) } } - /** @throws IllegalArgumentException if m is null */ + /** + * @throws IllegalArgumentException if m is null + */ public static Collection getFieldsWritten(IMethod m) throws InvalidClassFileException { if (m == null) { @@ -108,7 +114,9 @@ public static Collection getArraysWritten(IMethod m) } } - /** @throws IllegalArgumentException if m is null */ + /** + * @throws IllegalArgumentException if m is null + */ public static Collection getNewSites(IMethod m) throws InvalidClassFileException { if (m == null) { @@ -234,7 +242,9 @@ public void visitGetCaughtException(SSAGetCaughtExceptionInstruction instruction return result; } - /** @throws IllegalArgumentException if statements == null */ + /** + * @throws IllegalArgumentException if statements == null + */ public static Iterator iterateCastTypes(SSAInstruction[] statements) throws IllegalArgumentException { if (statements == null) { diff --git a/core/src/main/java/com/ibm/wala/classLoader/DirectoryTreeModule.java b/core/src/main/java/com/ibm/wala/classLoader/DirectoryTreeModule.java index fcab4f3ae8..b68ef5ce1c 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/DirectoryTreeModule.java +++ b/core/src/main/java/com/ibm/wala/classLoader/DirectoryTreeModule.java @@ -20,7 +20,9 @@ public abstract class DirectoryTreeModule implements Module { protected final File root; - /** @param root a directory */ + /** + * @param root a directory + */ DirectoryTreeModule(File root) throws IllegalArgumentException { this.root = root; if (root == null) { diff --git a/core/src/main/java/com/ibm/wala/classLoader/FieldImpl.java b/core/src/main/java/com/ibm/wala/classLoader/FieldImpl.java index c5b3bd42e8..506705bde8 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/FieldImpl.java +++ b/core/src/main/java/com/ibm/wala/classLoader/FieldImpl.java @@ -77,12 +77,16 @@ public FieldImpl( this(declaringClass, canonicalRef, accessFlags, annotations, null); } - /** @return the genericSignature */ + /** + * @return the genericSignature + */ public TypeSignature getGenericSignature() { return genericSignature; } - /** @see com.ibm.wala.classLoader.IMember#getDeclaringClass() */ + /** + * @see com.ibm.wala.classLoader.IMember#getDeclaringClass() + */ @Override public IClass getDeclaringClass() { return declaringClass; @@ -116,7 +120,9 @@ public FieldReference getReference() { getDeclaringClass().getReference(), getName(), getFieldTypeReference()); } - /** @see com.ibm.wala.classLoader.IMember#getName() */ + /** + * @see com.ibm.wala.classLoader.IMember#getName() + */ @Override public Atom getName() { return fieldRef.getName(); diff --git a/core/src/main/java/com/ibm/wala/classLoader/FileModule.java b/core/src/main/java/com/ibm/wala/classLoader/FileModule.java index f24c0e958a..2a7545bf9e 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/FileModule.java +++ b/core/src/main/java/com/ibm/wala/classLoader/FileModule.java @@ -88,7 +88,9 @@ public boolean isModuleFile() { return false; } - /** @return Returns the file. */ + /** + * @return Returns the file. + */ public File getFile() { return file; } diff --git a/core/src/main/java/com/ibm/wala/classLoader/IBytecodeMethod.java b/core/src/main/java/com/ibm/wala/classLoader/IBytecodeMethod.java index 27331da3f4..f2d74a2040 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/IBytecodeMethod.java +++ b/core/src/main/java/com/ibm/wala/classLoader/IBytecodeMethod.java @@ -22,7 +22,9 @@ /** A method which originated in bytecode, decoded by Shrike */ public interface IBytecodeMethod extends IMethod { - /** @return the bytecode index corresponding to instruction i in the getInstructions() array */ + /** + * @return the bytecode index corresponding to instruction i in the getInstructions() array + */ int getBytecodeIndex(int i) throws InvalidClassFileException; /** @@ -31,10 +33,14 @@ public interface IBytecodeMethod extends IMethod { */ int getInstructionIndex(int bcIndex) throws InvalidClassFileException; - /** @return the Shrike representation of the exception handlers */ + /** + * @return the Shrike representation of the exception handlers + */ ExceptionHandler[][] getHandlers() throws InvalidClassFileException; - /** @return the Shrike instructions decoded from the bytecode */ + /** + * @return the Shrike instructions decoded from the bytecode + */ I[] getInstructions() throws InvalidClassFileException; /** @@ -50,10 +56,14 @@ public interface IBytecodeMethod extends IMethod { Iterator getArraysWritten() throws InvalidClassFileException; - /** @return the new sites declared in the bytecode for this method */ + /** + * @return the new sites declared in the bytecode for this method + */ Collection getNewSites() throws InvalidClassFileException; - /** @return information about any indirect uses of local variables */ + /** + * @return information about any indirect uses of local variables + */ IndirectionData getIndirectionData(); Collection[] getParameterAnnotations(); diff --git a/core/src/main/java/com/ibm/wala/classLoader/IClass.java b/core/src/main/java/com/ibm/wala/classLoader/IClass.java index 1673bce494..c86b67f0d1 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/IClass.java +++ b/core/src/main/java/com/ibm/wala/classLoader/IClass.java @@ -37,16 +37,24 @@ public interface IClass extends IClassHierarchyDweller { /** Is this class a Java interface? */ boolean isInterface(); - /** @return true iff this class is abstract */ + /** + * @return true iff this class is abstract + */ boolean isAbstract(); - /** @return true iff this class is public */ + /** + * @return true iff this class is public + */ boolean isPublic(); - /** @return true iff this class is private */ + /** + * @return true iff this class is private + */ boolean isPrivate(); - /** @return true iff this class is synthetic, i.e., compiler-generated */ + /** + * @return true iff this class is synthetic, i.e., compiler-generated + */ boolean isSynthetic(); /** @@ -94,7 +102,9 @@ public interface IClass extends IClassHierarchyDweller { /** Finds a field, given a name and a type. Returns {@code null} if not found. */ IField getField(Atom name, TypeName type); - /** @return canonical TypeReference corresponding to this class */ + /** + * @return canonical TypeReference corresponding to this class + */ TypeReference getReference(); /** @@ -116,13 +126,19 @@ public interface IClass extends IClassHierarchyDweller { */ Reader getSource() throws NoSuchElementException; - /** @return the method that is this class's initializer, or null if none */ + /** + * @return the method that is this class's initializer, or null if none + */ IMethod getClassInitializer(); - /** @return true iff the class is an array class. */ + /** + * @return true iff the class is an array class. + */ boolean isArrayClass(); - /** @return an Iterator of the IMethods declared by this class. */ + /** + * @return an Iterator of the IMethods declared by this class. + */ Collection getDeclaredMethods(); /** Compute the instance fields declared by this class or any of its superclasses. */ @@ -144,10 +160,14 @@ public interface IClass extends IClassHierarchyDweller { */ Collection getDeclaredInstanceFields(); - /** @return Collection of IField */ + /** + * @return Collection of IField + */ Collection getDeclaredStaticFields(); - /** @return the TypeName for this class */ + /** + * @return the TypeName for this class + */ TypeName getName(); /** Does 'this' refer to a reference type? If not, then it refers to a primitive type. */ diff --git a/core/src/main/java/com/ibm/wala/classLoader/IClassLoader.java b/core/src/main/java/com/ibm/wala/classLoader/IClassLoader.java index c3dbc49560..194516cf68 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/IClassLoader.java +++ b/core/src/main/java/com/ibm/wala/classLoader/IClassLoader.java @@ -41,13 +41,19 @@ public interface IClassLoader { */ ClassLoaderReference getReference(); - /** @return an Iterator of all classes loaded by this loader */ + /** + * @return an Iterator of all classes loaded by this loader + */ Iterator iterateAllClasses(); - /** @return the number of classes in scope to be loaded by this loader */ + /** + * @return the number of classes in scope to be loaded by this loader + */ int getNumberOfClasses(); - /** @return the unique name that identifies this class loader. */ + /** + * @return the unique name that identifies this class loader. + */ Atom getName(); /** @@ -98,7 +104,9 @@ public interface IClassLoader { */ Reader getSource(IClass klass) throws NoSuchElementException; - /** @return the parent IClassLoader, if any, or null */ + /** + * @return the parent IClassLoader, if any, or null + */ IClassLoader getParent(); /** diff --git a/core/src/main/java/com/ibm/wala/classLoader/IField.java b/core/src/main/java/com/ibm/wala/classLoader/IField.java index 307bce42ea..1f47cad139 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/IField.java +++ b/core/src/main/java/com/ibm/wala/classLoader/IField.java @@ -16,10 +16,14 @@ /** */ public interface IField extends IMember { - /** @return the canonical TypeReference of the declared type of the field */ + /** + * @return the canonical TypeReference of the declared type of the field + */ TypeReference getFieldTypeReference(); - /** @return canonical FieldReference representing this field */ + /** + * @return canonical FieldReference representing this field + */ FieldReference getReference(); /** Is this field final? */ diff --git a/core/src/main/java/com/ibm/wala/classLoader/IMember.java b/core/src/main/java/com/ibm/wala/classLoader/IMember.java index dbb1f2a6b5..3055d24f35 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/IMember.java +++ b/core/src/main/java/com/ibm/wala/classLoader/IMember.java @@ -28,7 +28,9 @@ public interface IMember extends IClassHierarchyDweller { */ IClass getDeclaringClass(); - /** @return the name of this member */ + /** + * @return the name of this member + */ Atom getName(); /** Is this member static? */ diff --git a/core/src/main/java/com/ibm/wala/classLoader/IMethod.java b/core/src/main/java/com/ibm/wala/classLoader/IMethod.java index ea5a63942a..c1a7bbd643 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/IMethod.java +++ b/core/src/main/java/com/ibm/wala/classLoader/IMethod.java @@ -62,16 +62,22 @@ public interface IMethod extends IMember, ContextItem { /** Is this method a bridge method? See JLS 3rd Edition 15.12.4.5 */ boolean isBridge(); - /** @return canonical MethodReference corresponding to this method */ + /** + * @return canonical MethodReference corresponding to this method + */ MethodReference getReference(); - /** @return true iff this method has at least one exception handler */ + /** + * @return true iff this method has at least one exception handler + */ boolean hasExceptionHandler(); /** By convention, for a non-static method, getParameterType(0) is the this pointer */ TypeReference getParameterType(int i); - /** @return the name of the return type for this method */ + /** + * @return the name of the return type for this method + */ TypeReference getReturnType(); /** Method getNumberOfParameters. This result includes the "this" pointer if applicable */ @@ -89,6 +95,7 @@ TypeReference[] getDeclaredExceptions() * information is not available. */ int getLineNumber(int bcIndex); + /* BEGIN Custom change: precise positions */ interface SourcePosition extends Comparable { int getFirstLine(); @@ -107,6 +114,7 @@ interface SourcePosition extends Comparable { SourcePosition getSourcePosition(int instructionIndex) throws InvalidClassFileException; SourcePosition getParameterSourcePosition(int paramNum) throws InvalidClassFileException; + /* END Custom change: precise positions */ /** @@ -127,7 +135,9 @@ interface SourcePosition extends Comparable { /** something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer; */ Descriptor getDescriptor(); - /** @return true iff the local variable table information for this method is available */ + /** + * @return true iff the local variable table information for this method is available + */ boolean hasLocalVariableTable(); default int getNumberOfDefaultParameters() { diff --git a/core/src/main/java/com/ibm/wala/classLoader/JVMClass.java b/core/src/main/java/com/ibm/wala/classLoader/JVMClass.java index fe58bff233..94ab64689c 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/JVMClass.java +++ b/core/src/main/java/com/ibm/wala/classLoader/JVMClass.java @@ -54,21 +54,27 @@ public boolean isInterface() { return result; } - /** @see com.ibm.wala.classLoader.IClass#isAbstract() */ + /** + * @see com.ibm.wala.classLoader.IClass#isAbstract() + */ @Override public boolean isAbstract() { boolean result = ((modifiers & Constants.ACC_ABSTRACT) != 0); return result; } - /** @see com.ibm.wala.classLoader.IClass#isSynthetic() */ + /** + * @see com.ibm.wala.classLoader.IClass#isSynthetic() + */ @Override public boolean isSynthetic() { boolean result = ((modifiers & Constants.ACC_SYNTHETIC) != 0); return result; } - /** @see com.ibm.wala.classLoader.IClass#getClassInitializer() */ + /** + * @see com.ibm.wala.classLoader.IClass#getClassInitializer() + */ @Override public IMethod getClassInitializer() { try { diff --git a/core/src/main/java/com/ibm/wala/classLoader/JarStreamModule.java b/core/src/main/java/com/ibm/wala/classLoader/JarStreamModule.java index 69b9464b3c..f5a3faf9c8 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/JarStreamModule.java +++ b/core/src/main/java/com/ibm/wala/classLoader/JarStreamModule.java @@ -131,7 +131,9 @@ public void remove() { }; } - /** @author sfink an entry in a nested jar file. */ + /** + * @author sfink an entry in a nested jar file. + */ private class Entry implements ModuleEntry { private final String name; diff --git a/core/src/main/java/com/ibm/wala/classLoader/Module.java b/core/src/main/java/com/ibm/wala/classLoader/Module.java index 1f6f00a97c..5294c70f05 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/Module.java +++ b/core/src/main/java/com/ibm/wala/classLoader/Module.java @@ -19,6 +19,8 @@ */ public interface Module { - /** @return an Iterator of the ModuleEntries in this Module. */ + /** + * @return an Iterator of the ModuleEntries in this Module. + */ Iterator getEntries(); } diff --git a/core/src/main/java/com/ibm/wala/classLoader/ModuleEntry.java b/core/src/main/java/com/ibm/wala/classLoader/ModuleEntry.java index 4457e198e9..8e01cc1b32 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/ModuleEntry.java +++ b/core/src/main/java/com/ibm/wala/classLoader/ModuleEntry.java @@ -16,16 +16,24 @@ /** A ModuleEntry represents a wrapper around a file representation in a {@link Module}. */ public interface ModuleEntry { - /** @return a String that represents the name of the file described by this object */ + /** + * @return a String that represents the name of the file described by this object + */ String getName(); - /** @return true if the file is a class file. */ + /** + * @return true if the file is a class file. + */ boolean isClassFile(); - /** @return true if the file is a source file. */ + /** + * @return true if the file is a source file. + */ boolean isSourceFile(); - /** @return an InputStream which provides the contents of this logical file. */ + /** + * @return an InputStream which provides the contents of this logical file. + */ InputStream getInputStream(); /** diff --git a/core/src/main/java/com/ibm/wala/classLoader/PhantomClass.java b/core/src/main/java/com/ibm/wala/classLoader/PhantomClass.java index 7cabcd598d..16d3c69fbc 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/PhantomClass.java +++ b/core/src/main/java/com/ibm/wala/classLoader/PhantomClass.java @@ -10,7 +10,9 @@ /** dummy class representing a missing superclass */ public class PhantomClass extends SyntheticClass { - /** @param T type reference describing this class */ + /** + * @param T type reference describing this class + */ public PhantomClass(TypeReference T, IClassHierarchy cha) { super(T, cha); } diff --git a/core/src/main/java/com/ibm/wala/classLoader/ProgramCounter.java b/core/src/main/java/com/ibm/wala/classLoader/ProgramCounter.java index af5eb7aac7..70f9592ec4 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/ProgramCounter.java +++ b/core/src/main/java/com/ibm/wala/classLoader/ProgramCounter.java @@ -19,7 +19,9 @@ public class ProgramCounter { /** Index into bytecode describing this instruction */ private final int programCounter; - /** @param programCounter Index into bytecode describing this instruction */ + /** + * @param programCounter Index into bytecode describing this instruction + */ public ProgramCounter(final int programCounter) { if (programCounter < 0) { throw new IllegalArgumentException("illegal programCounter: " + programCounter); diff --git a/core/src/main/java/com/ibm/wala/classLoader/ShrikeBTMethod.java b/core/src/main/java/com/ibm/wala/classLoader/ShrikeBTMethod.java index 1fc22b73f4..0cb08815a0 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/ShrikeBTMethod.java +++ b/core/src/main/java/com/ibm/wala/classLoader/ShrikeBTMethod.java @@ -85,6 +85,7 @@ protected static class BytecodeInfo { /** Mapping from instruction index to program counter. */ private int[] pcMap; + /* BEGIN Custom change: precise positions */ /** Cached map representing position information for bytecode instruction at given index */ @@ -224,7 +225,9 @@ private BytecodeInfo computeBCInfo() throws InvalidClassFileException { return result; } - /** @return true iff this method has a monitorenter or monitorexit */ + /** + * @return true iff this method has a monitorenter or monitorexit + */ public boolean hasMonitorOp() throws InvalidClassFileException { if (isNative()) { return false; @@ -232,7 +235,9 @@ public boolean hasMonitorOp() throws InvalidClassFileException { return getBCInfo().hasMonitorOp; } - /** @return Set of FieldReference */ + /** + * @return Set of FieldReference + */ public Iterator getFieldsWritten() throws InvalidClassFileException { if (isNative()) { return EmptyIterator.instance(); @@ -245,7 +250,9 @@ public Iterator getFieldsWritten() throws InvalidClassFileExcept } } - /** @return Iterator of FieldReference */ + /** + * @return Iterator of FieldReference + */ public Iterator getFieldsRead() throws InvalidClassFileException { if (isNative()) { return EmptyIterator.instance(); @@ -258,7 +265,9 @@ public Iterator getFieldsRead() throws InvalidClassFileException } } - /** @return Iterator of TypeReference */ + /** + * @return Iterator of TypeReference + */ public Iterator getArraysRead() throws InvalidClassFileException { if (isNative()) { return EmptyIterator.instance(); @@ -268,7 +277,9 @@ public Iterator getArraysRead() throws InvalidClassFileException : Arrays.asList(getBCInfo().arraysRead).iterator(); } - /** @return Iterator of TypeReference */ + /** + * @return Iterator of TypeReference + */ public Iterator getArraysWritten() throws InvalidClassFileException { if (isNative()) { return EmptyIterator.instance(); @@ -281,7 +292,9 @@ public Iterator getArraysWritten() throws InvalidClassFileExcepti } } - /** @return Iterator of TypeReference */ + /** + * @return Iterator of TypeReference + */ public Iterator getCastTypes() throws InvalidClassFileException { if (isNative()) { return EmptyIterator.instance(); @@ -542,7 +555,9 @@ public int hashCode() { return 9661 * getReference().hashCode(); } - /** @see com.ibm.wala.classLoader.SyntheticMethod#getMaxLocals() */ + /** + * @see com.ibm.wala.classLoader.SyntheticMethod#getMaxLocals() + */ public abstract int getMaxLocals(); // TODO: ShrikeBT should have a getMaxStack method on Decoder, I think. @@ -729,7 +744,9 @@ public TypeReference[] getDeclaredExceptions() throws InvalidClassFileException protected abstract String[] getDeclaredExceptionTypeNames() throws InvalidClassFileException; - /** @see com.ibm.wala.classLoader.IMethod#getDeclaredExceptions() */ + /** + * @see com.ibm.wala.classLoader.IMethod#getDeclaredExceptions() + */ private TypeReference[] computeDeclaredExceptions() { try { String[] strings = getDeclaredExceptionTypeNames(); @@ -749,6 +766,7 @@ private TypeReference[] computeDeclaredExceptions() { return null; } } + /* BEGIN Custom change: precise bytecode positions */ @Override @@ -760,6 +778,7 @@ public SourcePosition getSourcePosition(int bcIndex) throws InvalidClassFileExce public SourcePosition getParameterSourcePosition(int paramNum) throws InvalidClassFileException { return (getBCInfo().paramPositionMap == null) ? null : getBCInfo().paramPositionMap[paramNum]; } + /* END Custom change: precise bytecode positions */ @Override @@ -771,7 +790,9 @@ public int getLineNumber(int bcIndex) { } } - /** @return {@link Set}<{@link TypeReference}> */ + /** + * @return {@link Set}<{@link TypeReference}> + */ public Set getCaughtExceptionTypes() throws InvalidClassFileException { ExceptionHandler[][] handlers = getHandlers(); diff --git a/core/src/main/java/com/ibm/wala/classLoader/ShrikeCTMethod.java b/core/src/main/java/com/ibm/wala/classLoader/ShrikeCTMethod.java index 71eae3dafb..a0682fc292 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/ShrikeCTMethod.java +++ b/core/src/main/java/com/ibm/wala/classLoader/ShrikeCTMethod.java @@ -144,6 +144,7 @@ protected String[] getDeclaredExceptionTypeNames() throws InvalidClassFileExcept return reader.getClasses(); } } + /* BEGIN Custom change: precise positions */ private static final class SPos implements SourcePosition { String fileName; @@ -214,6 +215,7 @@ public String toString() { return fileName + '(' + firstLine + ',' + firstCol + '-' + lastLine + ',' + lastCol + ')'; } } + /* END Custom change: precise positions */ @Override protected void processDebugInfo(BytecodeInfo bcInfo) throws InvalidClassFileException { diff --git a/core/src/main/java/com/ibm/wala/classLoader/ShrikeClass.java b/core/src/main/java/com/ibm/wala/classLoader/ShrikeClass.java index 7a35e88747..fec778aa55 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/ShrikeClass.java +++ b/core/src/main/java/com/ibm/wala/classLoader/ShrikeClass.java @@ -47,7 +47,9 @@ public final class ShrikeClass extends JVMClass { /** The Shrike object that knows how to read the class file */ private final ShrikeClassReaderHandle reader; - /** @throws IllegalArgumentException if reader is null */ + /** + * @throws IllegalArgumentException if reader is null + */ public ShrikeClass(ShrikeClassReaderHandle reader, IClassLoader loader, IClassHierarchy cha) throws InvalidClassFileException { super(loader, cha); @@ -177,7 +179,9 @@ private void computeTypeReference() throws InvalidClassFileException { TypeReference.findOrCreate(getClassLoader().getReference(), TypeName.findOrCreate(name)); } - /** @see java.lang.Object#equals(Object) */ + /** + * @see java.lang.Object#equals(Object) + */ @Override public boolean equals(Object obj) { // it's ok to use instanceof since this class is final @@ -366,6 +370,7 @@ private TypeAnnotationsReader getFieldTypeAnnotationsReader( : TypeAnnotationsReader.AnnotationType.RuntimeVisibleTypeAnnotations, iter); } + /** read the runtime-invisible type annotations from the class file */ public Collection getRuntimeInvisibleTypeAnnotations(int fieldIndex) throws InvalidClassFileException { diff --git a/core/src/main/java/com/ibm/wala/classLoader/SourceFileModule.java b/core/src/main/java/com/ibm/wala/classLoader/SourceFileModule.java index 489084f8f4..67b91ee490 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/SourceFileModule.java +++ b/core/src/main/java/com/ibm/wala/classLoader/SourceFileModule.java @@ -21,6 +21,7 @@ public class SourceFileModule extends FileModule implements Module, ModuleEntry, SourceModule { private final String fileName; + /** cache result of {@link #getURL()}, for performance */ private URL url; diff --git a/core/src/main/java/com/ibm/wala/classLoader/SyntheticClass.java b/core/src/main/java/com/ibm/wala/classLoader/SyntheticClass.java index beea6a1f49..acac764055 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/SyntheticClass.java +++ b/core/src/main/java/com/ibm/wala/classLoader/SyntheticClass.java @@ -26,7 +26,10 @@ public abstract class SyntheticClass implements IClass { private final TypeReference T; private final IClassHierarchy cha; - /** @param T type reference describing this class */ + + /** + * @param T type reference describing this class + */ public SyntheticClass(TypeReference T, IClassHierarchy cha) { super(); this.T = T; diff --git a/core/src/main/java/com/ibm/wala/classLoader/SyntheticMethod.java b/core/src/main/java/com/ibm/wala/classLoader/SyntheticMethod.java index 16723cc977..945daa11d8 100644 --- a/core/src/main/java/com/ibm/wala/classLoader/SyntheticMethod.java +++ b/core/src/main/java/com/ibm/wala/classLoader/SyntheticMethod.java @@ -83,7 +83,9 @@ public boolean isInit() { return method.getSelector().equals(MethodReference.initSelector); } - /** @see com.ibm.wala.classLoader.IMethod#isStatic() */ + /** + * @see com.ibm.wala.classLoader.IMethod#isStatic() + */ @Override public boolean isStatic() { return isStatic; @@ -124,7 +126,9 @@ public boolean isBridge() { return false; } - /** @see com.ibm.wala.classLoader.IMethod#isAbstract() */ + /** + * @see com.ibm.wala.classLoader.IMethod#isAbstract() + */ @Override public boolean isSynchronized() { return false; @@ -310,6 +314,7 @@ public Atom getName() { public Descriptor getDescriptor() { return method.getSelector().getDescriptor(); } + /* BEGIN Custom change: : precise bytecode positions */ @Override @@ -321,6 +326,7 @@ public SourcePosition getSourcePosition(int bcIndex) throws InvalidClassFileExce public SourcePosition getParameterSourcePosition(int paramNum) throws InvalidClassFileException { return null; } + /* END Custom change: precise bytecode positions */ @Override diff --git a/core/src/main/java/com/ibm/wala/client/AbstractAnalysisEngine.java b/core/src/main/java/com/ibm/wala/client/AbstractAnalysisEngine.java index ebadec73da..16aa7b8ab5 100644 --- a/core/src/main/java/com/ibm/wala/client/AbstractAnalysisEngine.java +++ b/core/src/main/java/com/ibm/wala/client/AbstractAnalysisEngine.java @@ -155,7 +155,9 @@ public void buildAnalysisScope() throws IOException { addApplicationModulesToScope(); } - /** @return a IClassHierarchy object for this analysis scope */ + /** + * @return a IClassHierarchy object for this analysis scope + */ public IClassHierarchy buildClassHierarchy() { IClassHierarchy cha = null; ClassLoaderFactory factory = makeClassLoaderFactory(getScope().getExclusions()); @@ -181,7 +183,9 @@ protected IClassHierarchy setClassHierarchy(IClassHierarchy cha) { return this.cha = cha; } - /** @return Returns the call graph */ + /** + * @return Returns the call graph + */ protected CallGraph getCallGraph() { return cg; } diff --git a/core/src/main/java/com/ibm/wala/client/AbstractEngineStopwatch.java b/core/src/main/java/com/ibm/wala/client/AbstractEngineStopwatch.java index c7817d245f..9a4cb5dc86 100644 --- a/core/src/main/java/com/ibm/wala/client/AbstractEngineStopwatch.java +++ b/core/src/main/java/com/ibm/wala/client/AbstractEngineStopwatch.java @@ -15,10 +15,14 @@ /** An object to track performance of an analysis engine */ public abstract class AbstractEngineStopwatch implements EngineStopwatch { - /** @return the number of distinct categories timed by this object */ + /** + * @return the number of distinct categories timed by this object + */ protected abstract int getNumberOfCategories(); - /** @return an array of Strings that represent names of the categories tracked */ + /** + * @return an array of Strings that represent names of the categories tracked + */ protected abstract String[] getCategoryNames(); protected final StopwatchGC[] stopwatch; diff --git a/core/src/main/java/com/ibm/wala/client/EngineStopwatch.java b/core/src/main/java/com/ibm/wala/client/EngineStopwatch.java index 0a4261b2b0..30959e7be7 100644 --- a/core/src/main/java/com/ibm/wala/client/EngineStopwatch.java +++ b/core/src/main/java/com/ibm/wala/client/EngineStopwatch.java @@ -15,7 +15,9 @@ /** An object to track performance of analysis engine */ public interface EngineStopwatch { - /** @return a String representation of the information in this object */ + /** + * @return a String representation of the information in this object + */ String report(); /** start timing for some category */ diff --git a/core/src/main/java/com/ibm/wala/core/util/ProgressMasterImpl.java b/core/src/main/java/com/ibm/wala/core/util/ProgressMasterImpl.java index 7af37f7e66..9f547be400 100644 --- a/core/src/main/java/com/ibm/wala/core/util/ProgressMasterImpl.java +++ b/core/src/main/java/com/ibm/wala/core/util/ProgressMasterImpl.java @@ -116,6 +116,7 @@ public void subTask(String subTask) { public void cancel() { setCanceled(); } + /* END Custom change: subtasks and canceling */ @Override public synchronized void worked(int work) { diff --git a/core/src/main/java/com/ibm/wala/core/util/io/FileProvider.java b/core/src/main/java/com/ibm/wala/core/util/io/FileProvider.java index 8bf2129ca4..cec8a48d7b 100644 --- a/core/src/main/java/com/ibm/wala/core/util/io/FileProvider.java +++ b/core/src/main/java/com/ibm/wala/core/util/io/FileProvider.java @@ -38,7 +38,9 @@ public class FileProvider { private static final int DEBUG_LEVEL = Integer.parseInt(System.getProperty("wala.debug.file", "0")); - /** @return the jar file packaged with this plug-in of the given name, or null if not found. */ + /** + * @return the jar file packaged with this plug-in of the given name, or null if not found. + */ public Module getJarFileModule(String fileName) throws IOException { return getJarFileModule(fileName, FileProvider.class.getClassLoader()); } diff --git a/core/src/main/java/com/ibm/wala/core/util/shrike/ShrikeClassReaderHandle.java b/core/src/main/java/com/ibm/wala/core/util/shrike/ShrikeClassReaderHandle.java index 9bac676ab0..2e76829a11 100644 --- a/core/src/main/java/com/ibm/wala/core/util/shrike/ShrikeClassReaderHandle.java +++ b/core/src/main/java/com/ibm/wala/core/util/shrike/ShrikeClassReaderHandle.java @@ -28,6 +28,7 @@ public class ShrikeClassReaderHandle { private static final boolean DEBUG = false; + /** The module entry that defines the class file */ private final ModuleEntry entry; diff --git a/core/src/main/java/com/ibm/wala/core/util/shrike/ShrikeUtil.java b/core/src/main/java/com/ibm/wala/core/util/shrike/ShrikeUtil.java index 4cd4467da9..0d53e62506 100644 --- a/core/src/main/java/com/ibm/wala/core/util/shrike/ShrikeUtil.java +++ b/core/src/main/java/com/ibm/wala/core/util/shrike/ShrikeUtil.java @@ -38,7 +38,9 @@ public class ShrikeUtil implements BytecodeConstants { primitiveMap.put(Constants.TYPE_null, TypeReference.Null); } - /** @param type a type as a String returned by Shrike */ + /** + * @param type a type as a String returned by Shrike + */ public static TypeReference makeTypeReference(ClassLoaderReference loader, String type) throws IllegalArgumentException { if (type == null) { diff --git a/core/src/main/java/com/ibm/wala/core/util/ssa/ParameterAccessor.java b/core/src/main/java/com/ibm/wala/core/util/ssa/ParameterAccessor.java index 22a23794a5..73db5af6c5 100644 --- a/core/src/main/java/com/ibm/wala/core/util/ssa/ParameterAccessor.java +++ b/core/src/main/java/com/ibm/wala/core/util/ssa/ParameterAccessor.java @@ -157,6 +157,7 @@ public String toString() { public static class Parameter extends SSAValue { /** Implicit this or regular parameter? */ private final ParamerterDisposition disp; + /** Add to number to get position in descriptor */ private final int descriptorOffset; @@ -257,7 +258,9 @@ public ParamerterDisposition getDisposition() { return this.disp; } - /** @throws IllegalArgumentException if you compare this to an object totally different. */ + /** + * @throws IllegalArgumentException if you compare this to an object totally different. + */ @Override public boolean equals(final Object o) { if (o instanceof Parameter) { @@ -342,16 +345,21 @@ public String toString() { /** The Constructor used to create this ParameterAceesor */ private final BasedOn base; + /** The Method associated to this ParameterAceesor if constructed using a mRef */ private final MethodReference mRef; + /** The Method associated to this ParameterAceesor if constructed using an IMethod */ private final IMethod method; + /** The Value-Number for the implicit this-pointer or -1 if there is none */ private final int implicitThis; + /** * SSA-Number + descriptorOffset yield the parameters position in the Descriptor starting with 1 */ private final int descriptorOffset; + /** Number of parameters _excluding_ implicit this */ private final int numberOfParameters; @@ -1902,6 +1910,7 @@ public List connectThrough( final IClassHierarchy cha) { return connectThrough(callee, overrides, defaults, cha, null); } + // ***************************************************************************** // // Hand-through functions follow... diff --git a/core/src/main/java/com/ibm/wala/core/util/ssa/SSAValue.java b/core/src/main/java/com/ibm/wala/core/util/ssa/SSAValue.java index 336da28ac2..1645f4bf21 100644 --- a/core/src/main/java/com/ibm/wala/core/util/ssa/SSAValue.java +++ b/core/src/main/java/com/ibm/wala/core/util/ssa/SSAValue.java @@ -62,21 +62,27 @@ public class SSAValue { /** The SSA Value itself */ protected final int number; + /** The type of this variable */ protected final TypeReference type; + /** All variables with the same name in the source code share a key. */ public final VariableKey key; // TODO: Protect again? + /** Method the variable is valid in */ protected final MethodReference mRef; + /** If an instruction wrote to this value (set manually) */ private boolean isAssigned; /** All variables with the same name in the source code. */ public interface VariableKey {} + /** A key that cannot be recreated. */ public static class UniqueKey implements VariableKey { public UniqueKey() {} } + /** A key that matches variables by their type - does not compare to NamedKey. */ public static class TypeKey implements VariableKey { public final TypeName type; @@ -110,6 +116,7 @@ public String toString() { return ""; } } + /** This NamedKey also equals to TypeKeys. */ public static class WeaklyNamedKey extends NamedKey { public WeaklyNamedKey(final TypeName type, final String name) { @@ -141,6 +148,7 @@ public String toString() { return ""; } } + /** Identify variables by a string and type. */ public static class NamedKey implements VariableKey { public final String name; @@ -296,6 +304,7 @@ public void setAssigned() { public MethodReference getValidIn() { return this.mRef; } + /** * Return the optional variable name. * diff --git a/core/src/main/java/com/ibm/wala/core/util/ssa/SSAValueManager.java b/core/src/main/java/com/ibm/wala/core/util/ssa/SSAValueManager.java index dfe455855b..fbc0db0257 100644 --- a/core/src/main/java/com/ibm/wala/core/util/ssa/SSAValueManager.java +++ b/core/src/main/java/com/ibm/wala/core/util/ssa/SSAValueManager.java @@ -87,8 +87,10 @@ private enum ValueStatus { // TODO: nextLocal may be 0 on getUnamanged! /** The next variable not under management yet */ private int nextLocal; + /** for managing cascaded code blocks */ private int currentScope = 0; + /** Description only used for toString() */ private final String description; @@ -374,6 +376,7 @@ public SSAValue getUnmanaged(TypeReference type, VariableKey key) { public SSAValue getUnmanaged(TypeReference type, String name) { return getUnmanaged(type, new NamedKey(type.getName(), name)); } + /** * Retrieve the SSA-Number that is valid for a type in the current scope. * diff --git a/core/src/main/java/com/ibm/wala/core/util/ssa/TypeSafeInstructionFactory.java b/core/src/main/java/com/ibm/wala/core/util/ssa/TypeSafeInstructionFactory.java index e888f6dcfa..897b4dace9 100644 --- a/core/src/main/java/com/ibm/wala/core/util/ssa/TypeSafeInstructionFactory.java +++ b/core/src/main/java/com/ibm/wala/core/util/ssa/TypeSafeInstructionFactory.java @@ -779,6 +779,7 @@ public SSAConditionalBranchInstruction ConditionalBranchInstruction( final int target) { return insts.ConditionalBranchInstruction(iindex, operator, type, val1, val2, target); } + /** * result = array[index]. * diff --git a/core/src/main/java/com/ibm/wala/core/util/strings/Atom.java b/core/src/main/java/com/ibm/wala/core/util/strings/Atom.java index 981d19469d..d7290b087e 100644 --- a/core/src/main/java/com/ibm/wala/core/util/strings/Atom.java +++ b/core/src/main/java/com/ibm/wala/core/util/strings/Atom.java @@ -366,7 +366,9 @@ public byte getVal(int i) throws IllegalArgumentException { } } - /** @return true iff this atom contains the specified byte */ + /** + * @return true iff this atom contains the specified byte + */ public boolean contains(byte b) { for (byte element : val) { if (element == b) { diff --git a/core/src/main/java/com/ibm/wala/core/util/strings/StringStuff.java b/core/src/main/java/com/ibm/wala/core/util/strings/StringStuff.java index a3d910ed04..d07bb5f3b4 100644 --- a/core/src/main/java/com/ibm/wala/core/util/strings/StringStuff.java +++ b/core/src/main/java/com/ibm/wala/core/util/strings/StringStuff.java @@ -145,7 +145,8 @@ public static final TypeName parseForReturnTypeName(Language l, ImmutableByteArr } int i = 0; - while (b.get(i++) != ')') ; + while (b.get(i++) != ')') + ; if (b.length() < i + 1) { throw new IllegalArgumentException("invalid descriptor: " + b); } @@ -250,7 +251,8 @@ public static final TypeName[] parseForParameterNames(Language l, ImmutableByteA case TypeReference.OtherPrimitiveTypeCode: { int off = i - 1; - while (b.get(i++) != ';') ; + while (b.get(i++) != ';') + ; sigs.add(l.lookupPrimitiveType(new String(b.substring(off + 1, i - off - 2)))); continue; @@ -258,7 +260,8 @@ public static final TypeName[] parseForParameterNames(Language l, ImmutableByteA case TypeReference.ClassTypeCode: { int off = i - 1; - while (b.get(i++) != ';') ; + while (b.get(i++) != ';') + ; sigs.add(TypeName.findOrCreate(b, off, i - off - 1)); continue; @@ -274,7 +277,8 @@ public static final TypeName[] parseForParameterNames(Language l, ImmutableByteA TypeName T = null; byte c = b.get(i++); if (c == TypeReference.ClassTypeCode || c == TypeReference.OtherPrimitiveTypeCode) { - while (b.get(i++) != ';') ; + while (b.get(i++) != ';') + ; T = TypeName.findOrCreate(b, off, i - off - 1); } else { T = TypeName.findOrCreate(b, off, i - off); diff --git a/core/src/main/java/com/ibm/wala/dataflow/IFDS/BackwardsSupergraph.java b/core/src/main/java/com/ibm/wala/dataflow/IFDS/BackwardsSupergraph.java index ffb2ef5ceb..4cef13c079 100644 --- a/core/src/main/java/com/ibm/wala/dataflow/IFDS/BackwardsSupergraph.java +++ b/core/src/main/java/com/ibm/wala/dataflow/IFDS/BackwardsSupergraph.java @@ -42,7 +42,9 @@ public class BackwardsSupergraph implements ISupergraph { private final ExitFilter exitFilter = new ExitFilter(); - /** @param forwardGraph the graph to ``reverse'' */ + /** + * @param forwardGraph the graph to ``reverse'' + */ protected BackwardsSupergraph(ISupergraph forwardGraph) { if (forwardGraph == null) { throw new IllegalArgumentException("null forwardGraph"); @@ -119,7 +121,9 @@ public P getProcOf(T n) { return delegate.getProcOf(n); } - /** @see com.ibm.wala.util.graph.Graph#removeNodeAndEdges(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.Graph#removeNodeAndEdges(java.lang.Object) + */ @Override public void removeNodeAndEdges(Object N) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -135,43 +139,57 @@ public Stream stream() { return delegate.stream(); } - /** @see com.ibm.wala.util.graph.NodeManager#getNumberOfNodes() */ + /** + * @see com.ibm.wala.util.graph.NodeManager#getNumberOfNodes() + */ @Override public int getNumberOfNodes() { return delegate.getNumberOfNodes(); } - /** @see com.ibm.wala.util.graph.NodeManager#addNode(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#addNode(java.lang.Object) + */ @Override public void addNode(Object n) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.util.graph.NodeManager#removeNode(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#removeNode(java.lang.Object) + */ @Override public void removeNode(Object n) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.util.graph.NodeManager#containsNode(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#containsNode(java.lang.Object) + */ @Override public boolean containsNode(T N) { return delegate.containsNode(N); } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(java.lang.Object) + */ @Override public Iterator getPredNodes(T N) { return delegate.getSuccNodes(N); } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(java.lang.Object) + */ @Override public int getPredNodeCount(T N) { return delegate.getSuccNodeCount(N); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) + */ @Override public Iterator getSuccNodes(T N) { return delegate.getPredNodes(N); @@ -182,13 +200,17 @@ public boolean hasEdge(T src, T dst) { return delegate.hasEdge(dst, src); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(java.lang.Object) + */ @Override public int getSuccNodeCount(T N) { return delegate.getPredNodeCount(N); } - /** @see com.ibm.wala.util.graph.EdgeManager#addEdge(java.lang.Object, java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#addEdge(java.lang.Object, java.lang.Object) + */ @Override public void addEdge(Object src, Object dst) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -199,7 +221,9 @@ public void removeEdge(Object src, Object dst) throws UnsupportedOperationExcept throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) + */ @Override public void removeAllIncidentEdges(Object node) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -210,7 +234,9 @@ public T[] getEntriesForProcedure(P object) { return delegate.getExitsForProcedure(object); } - /** @see com.ibm.wala.dataflow.IFDS.ISupergraph#getEntriesForProcedure(java.lang.Object) */ + /** + * @see com.ibm.wala.dataflow.IFDS.ISupergraph#getEntriesForProcedure(java.lang.Object) + */ @Override public T[] getExitsForProcedure(P object) { return delegate.getEntriesForProcedure(object); diff --git a/core/src/main/java/com/ibm/wala/dataflow/IFDS/IFlowFunctionMap.java b/core/src/main/java/com/ibm/wala/dataflow/IFDS/IFlowFunctionMap.java index 7b9b9c4e95..5b99f463f9 100644 --- a/core/src/main/java/com/ibm/wala/dataflow/IFDS/IFlowFunctionMap.java +++ b/core/src/main/java/com/ibm/wala/dataflow/IFDS/IFlowFunctionMap.java @@ -17,7 +17,9 @@ */ public interface IFlowFunctionMap { - /** @return the flow function for a "normal" edge in the supergraph from src -> dest */ + /** + * @return the flow function for a "normal" edge in the supergraph from src -> dest + */ IUnaryFlowFunction getNormalFlowFunction(T src, T dest); /** @@ -35,7 +37,9 @@ public interface IFlowFunctionMap { */ IFlowFunction getReturnFlowFunction(T call, T src, T dest); - /** @return the flow function for a "call-to-return" edge in the supergraph from src -> dest */ + /** + * @return the flow function for a "call-to-return" edge in the supergraph from src -> dest + */ IUnaryFlowFunction getCallToReturnFlowFunction(T src, T dest); /** diff --git a/core/src/main/java/com/ibm/wala/dataflow/IFDS/ISupergraph.java b/core/src/main/java/com/ibm/wala/dataflow/IFDS/ISupergraph.java index 8371943e1d..f603de624e 100644 --- a/core/src/main/java/com/ibm/wala/dataflow/IFDS/ISupergraph.java +++ b/core/src/main/java/com/ibm/wala/dataflow/IFDS/ISupergraph.java @@ -36,7 +36,9 @@ public interface ISupergraph extends NumberedGraph { byte OTHER = 3; - /** @return the graph of procedures (e.g. a call graph) over which this supergraph is induced. */ + /** + * @return the graph of procedures (e.g. a call graph) over which this supergraph is induced. + */ Graph

getProcedureGraph(); /** @@ -87,10 +89,14 @@ public interface ISupergraph extends NumberedGraph { */ P getProcOf(T n); - /** @return the blocks in the supergraph that represents entry nodes for procedure p */ + /** + * @return the blocks in the supergraph that represents entry nodes for procedure p + */ T[] getEntriesForProcedure(P procedure); - /** @return the blocks in the supergraph that represents exit nodes for procedure p */ + /** + * @return the blocks in the supergraph that represents exit nodes for procedure p + */ T[] getExitsForProcedure(P procedure); /** @@ -118,7 +124,9 @@ public interface ISupergraph extends NumberedGraph { */ boolean isReturn(T n); - /** @return true iff this node is an entry node s_p for a procedure */ + /** + * @return true iff this node is an entry node s_p for a procedure + */ boolean isEntry(T n); /** diff --git a/core/src/main/java/com/ibm/wala/dataflow/IFDS/ITabulationWorklist.java b/core/src/main/java/com/ibm/wala/dataflow/IFDS/ITabulationWorklist.java index 455581c541..af7077a649 100644 --- a/core/src/main/java/com/ibm/wala/dataflow/IFDS/ITabulationWorklist.java +++ b/core/src/main/java/com/ibm/wala/dataflow/IFDS/ITabulationWorklist.java @@ -10,10 +10,14 @@ */ package com.ibm.wala.dataflow.IFDS; -/** @param represents type of nodes in the supergraph. */ +/** + * @param represents type of nodes in the supergraph. + */ public interface ITabulationWorklist { - /** @return the first object in the priority queue */ + /** + * @return the first object in the priority queue + */ PathEdge take(); void insert(PathEdge elt); diff --git a/core/src/main/java/com/ibm/wala/dataflow/IFDS/LocalPathEdges.java b/core/src/main/java/com/ibm/wala/dataflow/IFDS/LocalPathEdges.java index d10b41a2bb..d94b415249 100644 --- a/core/src/main/java/com/ibm/wala/dataflow/IFDS/LocalPathEdges.java +++ b/core/src/main/java/com/ibm/wala/dataflow/IFDS/LocalPathEdges.java @@ -326,7 +326,9 @@ public boolean contains(int i, int n, int j) { } } - /** @return set of d2 s.t. d1 -> d2 is a path edge for node n. */ + /** + * @return set of d2 s.t. d1 -> d2 is a path edge for node n. + */ public IntSet getReachable(int n, int d1) { if (PARANOID) { assert getReachableSlow(n, d1).sameValue(getReachableFast(n, d1)); @@ -376,7 +378,9 @@ private IntSet getReachableSlow(int n, int d1) { return result; } - /** @return set of d2 s.t. d1 -> d2 is a path edge for node n */ + /** + * @return set of d2 s.t. d1 -> d2 is a path edge for node n + */ private IntSet getReachableFast(int n, int d1) { IBinaryNaturalRelation R = altPaths.get(d1); diff --git a/core/src/main/java/com/ibm/wala/dataflow/IFDS/LocalSummaryEdges.java b/core/src/main/java/com/ibm/wala/dataflow/IFDS/LocalSummaryEdges.java index 693a22f7cc..1030b90e6c 100644 --- a/core/src/main/java/com/ibm/wala/dataflow/IFDS/LocalSummaryEdges.java +++ b/core/src/main/java/com/ibm/wala/dataflow/IFDS/LocalSummaryEdges.java @@ -140,7 +140,9 @@ public IntSet getInvertedSummaryEdgesForTarget(int s_p, int x, int d2) { } } - /** @return unique id n that represents the pair (s_p,x) */ + /** + * @return unique id n that represents the pair (s_p,x) + */ private int getIndexForEntryExitPair(int c, int r) { long id = LongUtil.pack(c, r); int result = entryExitMap.get(id); diff --git a/core/src/main/java/com/ibm/wala/dataflow/IFDS/TabulationResult.java b/core/src/main/java/com/ibm/wala/dataflow/IFDS/TabulationResult.java index 27150e23a7..59b5e9768e 100644 --- a/core/src/main/java/com/ibm/wala/dataflow/IFDS/TabulationResult.java +++ b/core/src/main/java/com/ibm/wala/dataflow/IFDS/TabulationResult.java @@ -30,10 +30,14 @@ public interface TabulationResult { */ IntSet getResult(T node); - /** @return the governing IFDS problem */ + /** + * @return the governing IFDS problem + */ TabulationProblem getProblem(); - /** @return the set of supergraph nodes for which any fact is reached */ + /** + * @return the set of supergraph nodes for which any fact is reached + */ Collection getSupergraphNodesReached(); /** @@ -42,6 +46,8 @@ public interface TabulationResult { */ IntSet getSummaryTargets(T n1, int d1, T n2); - /** @return the set of all {@link PathEdge}s that were used as seeds during the tabulation. */ + /** + * @return the set of all {@link PathEdge}s that were used as seeds during the tabulation. + */ Collection> getSeeds(); } diff --git a/core/src/main/java/com/ibm/wala/dataflow/IFDS/TabulationSolver.java b/core/src/main/java/com/ibm/wala/dataflow/IFDS/TabulationSolver.java index 0eaddf2652..f7cba0298d 100644 --- a/core/src/main/java/com/ibm/wala/dataflow/IFDS/TabulationSolver.java +++ b/core/src/main/java/com/ibm/wala/dataflow/IFDS/TabulationSolver.java @@ -695,7 +695,9 @@ protected void processParticularCallee( @SuppressWarnings("unused") protected void recordCall(T callNode, T callee, int d1, boolean gotReuse) {} - /** @return f(call_d, exit_d); */ + /** + * @return f(call_d, exit_d); + */ @SuppressWarnings("unused") protected IntSet computeBinaryFlow(int call_d, int exit_d, IBinaryReturnFlowFunction f) { if (DEBUG_LEVEL > 0) { @@ -705,7 +707,9 @@ protected IntSet computeBinaryFlow(int call_d, int exit_d, IBinaryReturnFlowFunc return result; } - /** @return f(d1) */ + /** + * @return f(d1) + */ @SuppressWarnings("unused") protected IntSet computeFlow(int d1, IUnaryFlowFunction f) { if (DEBUG_LEVEL > 0) { @@ -720,7 +724,9 @@ protected IntSet computeFlow(int d1, IUnaryFlowFunction f) { } } - /** @return f^{-1}(d2) */ + /** + * @return f^{-1}(d2) + */ protected IntSet computeInverseFlow(int d2, IReversibleFlowFunction f) { return f.getSources(d2); } @@ -963,7 +969,9 @@ public Collection> getSeeds() { } } - /** @return Returns the supergraph. */ + /** + * @return Returns the supergraph. + */ public ISupergraph getSupergraph() { return supergraph; } diff --git a/core/src/main/java/com/ibm/wala/dataflow/IFDS/VectorKillFlowFunction.java b/core/src/main/java/com/ibm/wala/dataflow/IFDS/VectorKillFlowFunction.java index cbc9c17b7e..e7e8180e34 100644 --- a/core/src/main/java/com/ibm/wala/dataflow/IFDS/VectorKillFlowFunction.java +++ b/core/src/main/java/com/ibm/wala/dataflow/IFDS/VectorKillFlowFunction.java @@ -18,7 +18,9 @@ public class VectorKillFlowFunction implements IReversibleFlowFunction { private final IntSet kill; - /** @param kill the intset of facts which are killed by this flow function */ + /** + * @param kill the intset of facts which are killed by this flow function + */ private VectorKillFlowFunction(IntSet kill) { if (kill == null) { throw new IllegalArgumentException("null kill"); diff --git a/core/src/main/java/com/ibm/wala/dataflow/ssa/SSAInference.java b/core/src/main/java/com/ibm/wala/dataflow/ssa/SSAInference.java index bfd199d23d..3bba6c79e2 100644 --- a/core/src/main/java/com/ibm/wala/dataflow/ssa/SSAInference.java +++ b/core/src/main/java/com/ibm/wala/dataflow/ssa/SSAInference.java @@ -124,7 +124,9 @@ private void createVariables(VariableFactory factory) { } } - /** @return the dataflow variable representing the value number, or null if none found. */ + /** + * @return the dataflow variable representing the value number, or null if none found. + */ @SuppressWarnings("unchecked") protected T getVariable(int valueNumber) { if (valueNumber < 0) { diff --git a/core/src/main/java/com/ibm/wala/demandpa/alg/InstanceKeyAndState.java b/core/src/main/java/com/ibm/wala/demandpa/alg/InstanceKeyAndState.java index 54285540e5..c1a8eec8a8 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/alg/InstanceKeyAndState.java +++ b/core/src/main/java/com/ibm/wala/demandpa/alg/InstanceKeyAndState.java @@ -40,7 +40,9 @@ import com.ibm.wala.demandpa.alg.statemachine.StateMachine.State; import com.ibm.wala.ipa.callgraph.propagation.InstanceKey; -/** @author Manu Sridharan */ +/** + * @author Manu Sridharan + */ public class InstanceKeyAndState extends WithState { public InstanceKeyAndState(InstanceKey ik, State state) { super(ik, state); diff --git a/core/src/main/java/com/ibm/wala/demandpa/alg/PointerKeyAndState.java b/core/src/main/java/com/ibm/wala/demandpa/alg/PointerKeyAndState.java index b5109f0c9a..acdf608ac6 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/alg/PointerKeyAndState.java +++ b/core/src/main/java/com/ibm/wala/demandpa/alg/PointerKeyAndState.java @@ -40,7 +40,9 @@ import com.ibm.wala.demandpa.alg.statemachine.StateMachine.State; import com.ibm.wala.ipa.callgraph.propagation.PointerKey; -/** @author Manu Sridharan */ +/** + * @author Manu Sridharan + */ public class PointerKeyAndState extends WithState { public PointerKeyAndState(PointerKey pk, State state) { diff --git a/core/src/main/java/com/ibm/wala/demandpa/alg/ThisFilteringHeapModel.java b/core/src/main/java/com/ibm/wala/demandpa/alg/ThisFilteringHeapModel.java index 41463ba0d2..0d230b9c07 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/alg/ThisFilteringHeapModel.java +++ b/core/src/main/java/com/ibm/wala/demandpa/alg/ThisFilteringHeapModel.java @@ -116,7 +116,9 @@ private FilteredPointerKey.TypeFilter getFilter(CGNode target) { } } - /** @return the receiver class for this method. */ + /** + * @return the receiver class for this method. + */ private IClass getReceiverClass(IMethod method) { TypeReference formalType = method.getParameterType(0); IClass C = cha.lookupClass(formalType); diff --git a/core/src/main/java/com/ibm/wala/demandpa/alg/refinepolicy/ManualFieldPolicy.java b/core/src/main/java/com/ibm/wala/demandpa/alg/refinepolicy/ManualFieldPolicy.java index 18f37d9f20..20627f701f 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/alg/refinepolicy/ManualFieldPolicy.java +++ b/core/src/main/java/com/ibm/wala/demandpa/alg/refinepolicy/ManualFieldPolicy.java @@ -141,7 +141,9 @@ public boolean nextPass() { return false; } - /** @return a String representation of the decisions made by this */ + /** + * @return a String representation of the decisions made by this + */ public String getHistory() { StringBuilder ret = new StringBuilder(); for (int i = 0; i < curDecision; i++) { diff --git a/core/src/main/java/com/ibm/wala/demandpa/alg/refinepolicy/RefinementPolicy.java b/core/src/main/java/com/ibm/wala/demandpa/alg/refinepolicy/RefinementPolicy.java index 7fd462c69d..f3bf58d7c0 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/alg/refinepolicy/RefinementPolicy.java +++ b/core/src/main/java/com/ibm/wala/demandpa/alg/refinepolicy/RefinementPolicy.java @@ -45,16 +45,24 @@ */ public interface RefinementPolicy { - /** @return the maximum number of refinement iterations for the query */ + /** + * @return the maximum number of refinement iterations for the query + */ int getNumPasses(); - /** @return the maximum number of nodes to traverse in pass {@code passNum} */ + /** + * @return the maximum number of nodes to traverse in pass {@code passNum} + */ int getBudgetForPass(int passNum); - /** @return the field refinement policy */ + /** + * @return the field refinement policy + */ FieldRefinePolicy getFieldRefinePolicy(); - /** @return the call graph refinement policy */ + /** + * @return the call graph refinement policy + */ CallGraphRefinePolicy getCallGraphRefinePolicy(); /** diff --git a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/AbstractDemandFlowGraph.java b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/AbstractDemandFlowGraph.java index 3a0b752ac0..fbcc37e896 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/AbstractDemandFlowGraph.java +++ b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/AbstractDemandFlowGraph.java @@ -110,7 +110,9 @@ public boolean hasSubgraphForNode(CGNode node) { return cgNodesVisited.contains(cg.getNumber(node)); } - /** @see com.ibm.wala.demandpa.flowgraph.IFlowGraph#getInstrsPassingParam(LocalPointerKey) */ + /** + * @see com.ibm.wala.demandpa.flowgraph.IFlowGraph#getInstrsPassingParam(LocalPointerKey) + */ public Iterator getParamSuccs(LocalPointerKey pk) { // TODO cache this result // TODO take some cgnode as parameter if we have calling context? @@ -142,7 +144,9 @@ public Iterator getParamSuccs(LocalPointerKey pk) { return paramSuccs.iterator(); } - /** @see com.ibm.wala.demandpa.flowgraph.IFlowGraph#getInstrsPassingParam(LocalPointerKey) */ + /** + * @see com.ibm.wala.demandpa.flowgraph.IFlowGraph#getInstrsPassingParam(LocalPointerKey) + */ public Iterator getParamPreds(LocalPointerKey pk) { // TODO Set instrs = callParams.get(pk); @@ -170,7 +174,9 @@ public Iterator getParamPreds(LocalPointerKey pk) { return paramPreds.iterator(); } - /** @see com.ibm.wala.demandpa.flowgraph.IFlowGraph#getInstrReturningTo(LocalPointerKey) */ + /** + * @see com.ibm.wala.demandpa.flowgraph.IFlowGraph#getInstrReturningTo(LocalPointerKey) + */ public Iterator getReturnSuccs(LocalPointerKey pk) { SSAAbstractInvokeInstruction callInstr = callDefs.get(pk); if (callInstr == null) return EmptyIterator.instance(); @@ -194,7 +200,9 @@ public Iterator getReturnSuccs(LocalPointerKey pk) { return returnSuccs.iterator(); } - /** @see com.ibm.wala.demandpa.flowgraph.IFlowGraph#getInstrReturningTo(LocalPointerKey) */ + /** + * @see com.ibm.wala.demandpa.flowgraph.IFlowGraph#getInstrReturningTo(LocalPointerKey) + */ public Iterator getReturnPreds(LocalPointerKey pk) { CGNode cgNode = returns.get(pk); if (cgNode == null) { diff --git a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/AssignBarLabel.java b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/AssignBarLabel.java index 957311922f..80962e8aa0 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/AssignBarLabel.java +++ b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/AssignBarLabel.java @@ -39,7 +39,9 @@ import com.ibm.wala.ipa.callgraph.propagation.FilteredPointerKey.TypeFilter; -/** @author Manu Sridharan */ +/** + * @author Manu Sridharan + */ public class AssignBarLabel implements IFlowLabelWithFilter { private static final AssignBarLabel noFilter = new AssignBarLabel(null); diff --git a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/AssignGlobalBarLabel.java b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/AssignGlobalBarLabel.java index e1fda3629b..43d9d51dba 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/AssignGlobalBarLabel.java +++ b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/AssignGlobalBarLabel.java @@ -37,7 +37,9 @@ */ package com.ibm.wala.demandpa.flowgraph; -/** @author Manu Sridharan */ +/** + * @author Manu Sridharan + */ public class AssignGlobalBarLabel implements IFlowLabel { private static final AssignGlobalBarLabel theInstance = new AssignGlobalBarLabel(); diff --git a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/DemandPointerFlowGraph.java b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/DemandPointerFlowGraph.java index da5f8a58cb..981da24325 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/DemandPointerFlowGraph.java +++ b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/DemandPointerFlowGraph.java @@ -188,7 +188,9 @@ public void visitArrayLoad(SSAArrayLoadInstruction instruction) { g.addEdge(result, arrayRef, GetFieldLabel.make(ArrayContents.v())); } - /** @see Visitor#visitArrayStore(com.ibm.wala.shrike.shrikeBT.IArrayStoreInstruction) */ + /** + * @see Visitor#visitArrayStore(com.ibm.wala.shrike.shrikeBT.IArrayStoreInstruction) + */ @Override public void visitArrayStore(SSAArrayStoreInstruction instruction) { // Assertions.UNREACHABLE(); @@ -205,7 +207,9 @@ public void visitArrayStore(SSAArrayStoreInstruction instruction) { g.addEdge(arrayRef, value, PutFieldLabel.make(ArrayContents.v())); } - /** @see Visitor#visitCheckCast(ITypeTestInstruction) */ + /** + * @see Visitor#visitCheckCast(ITypeTestInstruction) + */ @Override public void visitCheckCast(SSACheckCastInstruction instruction) { Set types = HashSetFactory.make(); @@ -228,7 +232,9 @@ public void visitCheckCast(SSACheckCastInstruction instruction) { g.addEdge(result, value, AssignLabel.make(filter)); } - /** @see Visitor#visitReturn(ReturnInstruction) */ + /** + * @see Visitor#visitReturn(ReturnInstruction) + */ @Override public void visitReturn(SSAReturnInstruction instruction) { // skip returns of primitive type @@ -244,7 +250,9 @@ public void visitReturn(SSAReturnInstruction instruction) { } } - /** @see Visitor#visitGet(IGetInstruction) */ + /** + * @see Visitor#visitGet(IGetInstruction) + */ @Override public void visitGet(SSAGetInstruction instruction) { visitGetInternal( @@ -281,7 +289,9 @@ protected void visitGetInternal(int lval, int ref, boolean isStatic, FieldRefere } } - /** @see Visitor#visitPut(IPutInstruction) */ + /** + * @see Visitor#visitPut(IPutInstruction) + */ @Override public void visitPut(SSAPutInstruction instruction) { visitPutInternal( @@ -316,7 +326,9 @@ public void visitPutInternal(int rval, int ref, boolean isStatic, FieldReference } } - /** @see Visitor#visitInvoke(IInvokeInstruction) */ + /** + * @see Visitor#visitInvoke(IInvokeInstruction) + */ @Override public void visitInvoke(SSAInvokeInstruction instruction) { @@ -342,7 +354,9 @@ public void visitInvoke(SSAInvokeInstruction instruction) { // callDefs.put(exc, instruction); } - /** @see Visitor#visitNew(NewInstruction) */ + /** + * @see Visitor#visitNew(NewInstruction) + */ @Override public void visitNew(SSANewInstruction instruction) { @@ -371,7 +385,9 @@ public void visitNew(SSANewInstruction instruction) { } } - /** @see Visitor#visitThrow(ThrowInstruction) */ + /** + * @see Visitor#visitThrow(ThrowInstruction) + */ @Override public void visitThrow(SSAThrowInstruction instruction) { // don't do anything: we handle exceptional edges diff --git a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/GetFieldBarLabel.java b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/GetFieldBarLabel.java index c8f9ec753d..8d92ecc0a6 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/GetFieldBarLabel.java +++ b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/GetFieldBarLabel.java @@ -39,7 +39,9 @@ import com.ibm.wala.classLoader.IField; -/** @author Manu Sridharan */ +/** + * @author Manu Sridharan + */ public class GetFieldBarLabel implements IFlowLabel { private final IField field; diff --git a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/IFlowGraph.java b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/IFlowGraph.java index ffb7adba5f..5c9cab0cd7 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/IFlowGraph.java +++ b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/IFlowGraph.java @@ -41,10 +41,14 @@ public interface IFlowGraph extends LabeledGraph { boolean hasSubgraphForNode(CGNode node); - /** @return {@code true} iff {@code pk} is a formal parameter */ + /** + * @return {@code true} iff {@code pk} is a formal parameter + */ boolean isParam(LocalPointerKey pk); - /** @return the {@link SSAInvokeInstruction}s passing some pointer as a parameter */ + /** + * @return the {@link SSAInvokeInstruction}s passing some pointer as a parameter + */ Iterator getInstrsPassingParam(LocalPointerKey pk); /** diff --git a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/IFlowLabel.java b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/IFlowLabel.java index 1c45a01821..fbce7ca720 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/IFlowLabel.java +++ b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/IFlowLabel.java @@ -46,7 +46,9 @@ public interface IFlowLabel { void visit(IFlowLabelVisitor v, Object dst); - /** @return the bar (inverse) edge corresponding to this edge */ + /** + * @return the bar (inverse) edge corresponding to this edge + */ IFlowLabel bar(); interface IFlowLabelVisitor { @@ -84,6 +86,8 @@ interface IFlowLabelVisitor { void visitParamBar(ParamBarLabel label, Object dst); } - /** @return true if this is a "barred" edge */ + /** + * @return true if this is a "barred" edge + */ boolean isBarred(); } diff --git a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/MatchBarLabel.java b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/MatchBarLabel.java index e21f2239e5..b3c2f50d72 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/MatchBarLabel.java +++ b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/MatchBarLabel.java @@ -37,7 +37,9 @@ */ package com.ibm.wala.demandpa.flowgraph; -/** @author Manu Sridharan */ +/** + * @author Manu Sridharan + */ public class MatchBarLabel implements IFlowLabel { private static final MatchBarLabel theInstance = new MatchBarLabel(); diff --git a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/NewBarLabel.java b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/NewBarLabel.java index 54ac23b3c4..11e422c2cb 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/NewBarLabel.java +++ b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/NewBarLabel.java @@ -37,7 +37,9 @@ */ package com.ibm.wala.demandpa.flowgraph; -/** @author Manu Sridharan */ +/** + * @author Manu Sridharan + */ public class NewBarLabel implements IFlowLabel { private static final NewBarLabel theInstance = new NewBarLabel(); diff --git a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/PutFieldBarLabel.java b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/PutFieldBarLabel.java index cfdbb0042a..8df7f5da18 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/PutFieldBarLabel.java +++ b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/PutFieldBarLabel.java @@ -39,7 +39,9 @@ import com.ibm.wala.classLoader.IField; -/** @author Manu Sridharan */ +/** + * @author Manu Sridharan + */ public class PutFieldBarLabel implements IFlowLabel { private final IField field; diff --git a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/SimpleDemandPointerFlowGraph.java b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/SimpleDemandPointerFlowGraph.java index 6cad8af7c8..4ad0592628 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/flowgraph/SimpleDemandPointerFlowGraph.java +++ b/core/src/main/java/com/ibm/wala/demandpa/flowgraph/SimpleDemandPointerFlowGraph.java @@ -173,12 +173,16 @@ private void addNodesForParameters(CGNode node) { addNode(heapModel.getPointerKeyForExceptionalReturnValue(node)); } - /** @return Returns the heapModel. */ + /** + * @return Returns the heapModel. + */ protected HeapModel getHeapModel() { return heapModel; } - /** @see com.ibm.wala.util.graph.AbstractNumberedGraph#getPredNodeNumbers(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.AbstractNumberedGraph#getPredNodeNumbers(java.lang.Object) + */ @Override public IntSet getPredNodeNumbers(Object node) throws UnimplementedError { if (node instanceof StaticFieldKey) { @@ -189,7 +193,9 @@ public IntSet getPredNodeNumbers(Object node) throws UnimplementedError { } } - /** @see com.ibm.wala.util.graph.AbstractNumberedGraph#getSuccNodeNumbers(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.AbstractNumberedGraph#getSuccNodeNumbers(java.lang.Object) + */ @Override public IntSet getSuccNodeNumbers(Object node) throws IllegalArgumentException { if (node instanceof com.ibm.wala.ipa.callgraph.propagation.StaticFieldKey) { @@ -199,7 +205,9 @@ public IntSet getSuccNodeNumbers(Object node) throws IllegalArgumentException { return super.getSuccNodeNumbers(node); } - /** @see com.ibm.wala.util.graph.AbstractGraph#getPredNodeCount(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getPredNodeCount(java.lang.Object) + */ @Override public int getPredNodeCount(Object N) throws UnimplementedError { if (N instanceof StaticFieldKey) { @@ -210,7 +218,9 @@ public int getPredNodeCount(Object N) throws UnimplementedError { } } - /** @see com.ibm.wala.util.graph.AbstractGraph#getPredNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getPredNodes(java.lang.Object) + */ @Override public Iterator getPredNodes(Object N) throws IllegalArgumentException { if (N instanceof com.ibm.wala.ipa.callgraph.propagation.StaticFieldKey) { @@ -220,7 +230,9 @@ public Iterator getPredNodes(Object N) throws IllegalArgumentException { return super.getPredNodes(N); } - /** @see com.ibm.wala.util.graph.AbstractGraph#getSuccNodeCount(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getSuccNodeCount(java.lang.Object) + */ @Override public int getSuccNodeCount(Object N) throws UnimplementedError { if (N instanceof StaticFieldKey) { @@ -231,7 +243,9 @@ public int getSuccNodeCount(Object N) throws UnimplementedError { } } - /** @see com.ibm.wala.util.graph.AbstractGraph#getSuccNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getSuccNodes(java.lang.Object) + */ @Override public Iterator getSuccNodes(Object N) { if (N instanceof StaticFieldKey) { @@ -299,7 +313,9 @@ private void addParamEdges(LocalPointerKey pk, CGNode node) { } } - /** @param pk value being def'fed by a call instruction (either normal or exceptional) */ + /** + * @param pk value being def'fed by a call instruction (either normal or exceptional) + */ private void addReturnEdges(LocalPointerKey pk, SSAInvokeInstruction callInstr) { boolean isExceptional = pk.getValueNumber() == callInstr.getException(); diff --git a/core/src/main/java/com/ibm/wala/demandpa/util/MemoryAccess.java b/core/src/main/java/com/ibm/wala/demandpa/util/MemoryAccess.java index 95879929a3..4fedfbcb15 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/util/MemoryAccess.java +++ b/core/src/main/java/com/ibm/wala/demandpa/util/MemoryAccess.java @@ -31,7 +31,9 @@ public MemoryAccess(int index, CGNode node) { this.node = node; } - /** @return Returns the instructionIndex. */ + /** + * @return Returns the instructionIndex. + */ public int getInstructionIndex() { return instructionIndex; } @@ -41,7 +43,9 @@ public String toString() { return "MemAccess: " + getNode() + ':' + getInstructionIndex(); } - /** @return Returns the node. */ + /** + * @return Returns the node. + */ public CGNode getNode() { return node; } diff --git a/core/src/main/java/com/ibm/wala/demandpa/util/MemoryAccessMap.java b/core/src/main/java/com/ibm/wala/demandpa/util/MemoryAccessMap.java index 60886ec3ec..7088beb2ca 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/util/MemoryAccessMap.java +++ b/core/src/main/java/com/ibm/wala/demandpa/util/MemoryAccessMap.java @@ -17,10 +17,14 @@ public interface MemoryAccessMap { - /** @return {@link Collection}<{@link MemoryAccess}> */ + /** + * @return {@link Collection}<{@link MemoryAccess}> + */ Collection getFieldReads(PointerKey baseRef, IField field); - /** @return {@link Collection}<{@link MemoryAccess}> */ + /** + * @return {@link Collection}<{@link MemoryAccess}> + */ Collection getFieldWrites(PointerKey baseRef, IField field); Collection getArrayReads(PointerKey arrayRef); diff --git a/core/src/main/java/com/ibm/wala/demandpa/util/SimpleMemoryAccessMap.java b/core/src/main/java/com/ibm/wala/demandpa/util/SimpleMemoryAccessMap.java index 382d3b830a..4b74036be4 100644 --- a/core/src/main/java/com/ibm/wala/demandpa/util/SimpleMemoryAccessMap.java +++ b/core/src/main/java/com/ibm/wala/demandpa/util/SimpleMemoryAccessMap.java @@ -48,7 +48,9 @@ import java.util.Objects; import java.util.Set; -/** @author sfink */ +/** + * @author sfink + */ public class SimpleMemoryAccessMap implements MemoryAccessMap { private static final boolean DEBUG = false; diff --git a/core/src/main/java/com/ibm/wala/escape/FILiveObjectAnalysis.java b/core/src/main/java/com/ibm/wala/escape/FILiveObjectAnalysis.java index 6907503882..5cf163be18 100644 --- a/core/src/main/java/com/ibm/wala/escape/FILiveObjectAnalysis.java +++ b/core/src/main/java/com/ibm/wala/escape/FILiveObjectAnalysis.java @@ -72,7 +72,9 @@ public boolean mayBeLive(CGNode allocMethod, int allocPC, CGNode m, int instruct return mayBeLive(ik, m, instructionIndex); } - /** @param instructionIndex index of an SSA instruction */ + /** + * @param instructionIndex index of an SSA instruction + */ @Override public boolean mayBeLive(InstanceKey ik, CGNode m, int instructionIndex) { if (liveEverywhere.contains(ik)) { diff --git a/core/src/main/java/com/ibm/wala/escape/LocalLiveRangeAnalysis.java b/core/src/main/java/com/ibm/wala/escape/LocalLiveRangeAnalysis.java index c7d03cbd5d..b7319d6393 100644 --- a/core/src/main/java/com/ibm/wala/escape/LocalLiveRangeAnalysis.java +++ b/core/src/main/java/com/ibm/wala/escape/LocalLiveRangeAnalysis.java @@ -88,7 +88,9 @@ public static boolean isLive(int v, int instructionIndex, IR ir, DefUse du) { } } - /** @param statements {@code Iterator} */ + /** + * @param statements {@code Iterator} + */ private static Collection findBlocks(IR ir, Iterator statements) { Collection s = Iterator2Collection.toSet(statements); Collection result = HashSetFactory.make(); diff --git a/core/src/main/java/com/ibm/wala/examples/drivers/PDFCallGraph.java b/core/src/main/java/com/ibm/wala/examples/drivers/PDFCallGraph.java index 5c71ebf0f6..f48be59a1c 100644 --- a/core/src/main/java/com/ibm/wala/examples/drivers/PDFCallGraph.java +++ b/core/src/main/java/com/ibm/wala/examples/drivers/PDFCallGraph.java @@ -99,7 +99,9 @@ public static Process run(String[] args) throws IllegalArgumentException, Cancel p.getProperty("exclusionFile", CallGraphTestUtil.REGRESSION_EXCLUSIONS)); } - /** @param appJar something like "c:/temp/testdata/java_cup.jar" */ + /** + * @param appJar something like "c:/temp/testdata/java_cup.jar" + */ public static Process run(String appJar, String exclusionFile) throws IllegalArgumentException, CancelException { try { diff --git a/core/src/main/java/com/ibm/wala/examples/drivers/PDFSDG.java b/core/src/main/java/com/ibm/wala/examples/drivers/PDFSDG.java index a871a2a9c0..28ff74d2f7 100644 --- a/core/src/main/java/com/ibm/wala/examples/drivers/PDFSDG.java +++ b/core/src/main/java/com/ibm/wala/examples/drivers/PDFSDG.java @@ -103,7 +103,9 @@ public static ControlDependenceOptions getControlDependenceOptions(Properties p) return null; } - /** @param appJar something like "c:/temp/testdata/java_cup.jar" */ + /** + * @param appJar something like "c:/temp/testdata/java_cup.jar" + */ public static Process run( String appJar, String mainClass, diff --git a/core/src/main/java/com/ibm/wala/examples/drivers/PDFSlice.java b/core/src/main/java/com/ibm/wala/examples/drivers/PDFSlice.java index 75bb7f42d1..a4e11b36a2 100644 --- a/core/src/main/java/com/ibm/wala/examples/drivers/PDFSlice.java +++ b/core/src/main/java/com/ibm/wala/examples/drivers/PDFSlice.java @@ -256,7 +256,9 @@ public static Graph pruneSDG(SDG sdg, final Collection makeNodeDecorator() { return s -> { switch (s.getKind()) { diff --git a/core/src/main/java/com/ibm/wala/examples/drivers/ScopeFileCallGraph.java b/core/src/main/java/com/ibm/wala/examples/drivers/ScopeFileCallGraph.java index 56a16dde75..4734638ef6 100644 --- a/core/src/main/java/com/ibm/wala/examples/drivers/ScopeFileCallGraph.java +++ b/core/src/main/java/com/ibm/wala/examples/drivers/ScopeFileCallGraph.java @@ -53,7 +53,9 @@ public class ScopeFileCallGraph { * uses all public methods of class_name. */ public static void main(String[] args) - throws IOException, ClassHierarchyException, IllegalArgumentException, + throws IOException, + ClassHierarchyException, + IllegalArgumentException, CallGraphBuilderCancelException { long start = System.currentTimeMillis(); Properties p = CommandLine.parse(args); diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisCache.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisCache.java index 8532ad9685..7f3e1b9ab9 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisCache.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisCache.java @@ -57,7 +57,9 @@ public IRFactory getIRFactory() { return irFactory; } - /** @see com.ibm.wala.ipa.callgraph.IAnalysisCacheView#getIR(com.ibm.wala.classLoader.IMethod) */ + /** + * @see com.ibm.wala.ipa.callgraph.IAnalysisCacheView#getIR(com.ibm.wala.classLoader.IMethod) + */ @Override public IR getIR(IMethod method, Context context) { if (method == null) { diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisOptions.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisOptions.java index 4f05a7a3ba..be5759f4a4 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisOptions.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisOptions.java @@ -223,12 +223,16 @@ public void setMaxNumberOfNodes(long maxNumberOfNodes) { this.maxNumberOfNodes = maxNumberOfNodes; } - /** @return Policy that determines methods called at call sites. */ + /** + * @return Policy that determines methods called at call sites. + */ public MethodTargetSelector getMethodTargetSelector() { return methodTargetSelector; } - /** @return Policy that determines types allocated at new statements. */ + /** + * @return Policy that determines types allocated at new statements. + */ public ClassTargetSelector getClassTargetSelector() { return classTargetSelector; } @@ -275,7 +279,9 @@ public int getMaxEvalBetweenTopo() { return maxEvalBetweenTopo; } - /** @return a fraction x s.t. the solver will resort the system when it grows by a factor of x */ + /** + * @return a fraction x s.t. the solver will resort the system when it grows by a factor of x + */ public double getTopologicalGrowthFactor() { return topologicalGrowthFactor; } @@ -288,17 +294,23 @@ public void setMaxEvalBetweenTopo(int i) { maxEvalBetweenTopo = i; } - /** @param d a fraction x s.t. the solver will resort the system when it grows by a factor of x */ + /** + * @param d a fraction x s.t. the solver will resort the system when it grows by a factor of x + */ public void setTopologicalGrowthFactor(double d) { topologicalGrowthFactor = d; } - /** @return options governing SSA construction */ + /** + * @return options governing SSA construction + */ public SSAOptions getSSAOptions() { return ssaOptions; } - /** @param ssaOptions options governing SSA construction */ + /** + * @param ssaOptions options governing SSA construction + */ public void setSSAOptions(SSAOptions ssaOptions) { this.ssaOptions = ssaOptions; } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisScope.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisScope.java index 44dec9bf7c..5a36b459f2 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisScope.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisScope.java @@ -164,7 +164,9 @@ public ClassLoaderReference getSyntheticLoader() { return getLoader(SYNTHETIC); } - /** @return the set of languages to be processed during this analysis session. */ + /** + * @return the set of languages to be processed during this analysis session. + */ public Collection getLanguages() { return languages.values(); } @@ -210,6 +212,7 @@ public void addJDKModuleToScope(String moduleName) throws IOException { } addToScope(ClassLoaderReference.Primordial, new JarFile(path.toString(), false)); } + /** * Add a jar file to the scope via an {@link InputStream}. NOTE: The InputStream should *not* be a * {@link java.util.jar.JarInputStream}; it should be a regular {@link InputStream} for the raw @@ -342,7 +345,9 @@ public String toString() { return result.toString(); } - /** @return a String that describes exclusions from the analysis scope. */ + /** + * @return a String that describes exclusions from the analysis scope. + */ protected Object getExclusionString() { return "Exclusions: " + exclusions; } @@ -363,12 +368,16 @@ public List getModules(ClassLoaderReference loader) { return result == null ? Collections.emptyList() : result; } - /** @return Returns the arrayClassLoader. */ + /** + * @return Returns the arrayClassLoader. + */ public ArrayClassLoader getArrayClassLoader() { return arrayClassLoader; } - /** @return the rt.jar (1.4), core.jar (1.5), java.core.jmod (13) file, or null if not found. */ + /** + * @return the rt.jar (1.4), core.jar (1.5), java.core.jmod (13) file, or null if not found. + */ private JarFile getRtJar() { return RtJar.getRtJar( new MapIterator<>( diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/CGNode.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/CGNode.java index 7129da76fa..754145dcd5 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/CGNode.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/CGNode.java @@ -45,16 +45,21 @@ public interface CGNode extends INodeWithNumber, ContextItem, IClassHierarchyDwe */ boolean addTarget(CallSiteReference site, CGNode target); - /** @return the "default" IR for this node used by the governing call graph */ + /** + * @return the "default" IR for this node used by the governing call graph + */ IR getIR(); - /** @return DefUse for the "default" IR for this node used by the governing call graph */ + /** + * @return DefUse for the "default" IR for this node used by the governing call graph + */ DefUse getDU(); /** * @return an Iterator of the types that may be allocated by a given method in a given context. */ Iterator iterateNewSites(); + /** * @return an Iterator of the call statements that may execute in a given method for a given * context diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraph.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraph.java index 36247f32c8..b6413eed55 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraph.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraph.java @@ -31,7 +31,9 @@ public interface CallGraph extends NumberedGraph { CGNode getFakeWorldClinitNode(); - /** @return an Iterator of the nodes designated as "root nodes" */ + /** + * @return an Iterator of the nodes designated as "root nodes" + */ Collection getEntrypointNodes(); /** @@ -48,7 +50,9 @@ public interface CallGraph extends NumberedGraph { */ Set getNodes(MethodReference m); - /** @return the governing class hierarchy for this call graph */ + /** + * @return the governing class hierarchy for this call graph + */ IClassHierarchy getClassHierarchy(); /** @@ -57,7 +61,9 @@ public interface CallGraph extends NumberedGraph { */ Set getPossibleTargets(CGNode node, CallSiteReference site); - /** @return the number of nodes that the call site may dispatch to */ + /** + * @return the number of nodes that the call site may dispatch to + */ int getNumberOfTargets(CGNode node, CallSiteReference site); /** diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraphBuilder.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraphBuilder.java index c159aed71b..1aa5555ad3 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraphBuilder.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraphBuilder.java @@ -32,7 +32,9 @@ CallGraph makeCallGraph(AnalysisOptions options, IProgressMonitor monitor) */ PointerAnalysis getPointerAnalysis(); - /** @return A cache of various analysis artifacts used during call graph construction. */ + /** + * @return A cache of various analysis artifacts used during call graph construction. + */ IAnalysisCacheView getAnalysisCache(); IClassHierarchy getClassHierarchy(); diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraphBuilderCancelException.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraphBuilderCancelException.java index 9529aee447..d47402012c 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraphBuilderCancelException.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraphBuilderCancelException.java @@ -36,7 +36,9 @@ public static CallGraphBuilderCancelException createCallGraphBuilderCancelExcept return new CallGraphBuilderCancelException(msg, cg, pointerAnalysis); } - /** @return the {@link CallGraph} in whatever state it was left when computation was canceled */ + /** + * @return the {@link CallGraph} in whatever state it was left when computation was canceled + */ public CallGraph getPartialCallGraph() { return cg; } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraphStats.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraphStats.java index 0d1edf8a68..e388a91b57 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraphStats.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/CallGraphStats.java @@ -109,7 +109,9 @@ public static CGStats getCGStats(CallGraph cg) { return new CGStats(nNodes, nEdges, collectMethods(cg).size(), countBytecodeBytes(cg)); } - /** @throws IllegalArgumentException if cg is null */ + /** + * @throws IllegalArgumentException if cg is null + */ public static String getStats(CallGraph cg) { return getCGStats(cg).toString(); } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/Context.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/Context.java index 6743e86401..fab0bd6b39 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/Context.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/Context.java @@ -21,10 +21,14 @@ * {java.lang.String, java.lang.Date} */ public interface Context extends ContextItem { - /** @return the objects corresponding to a given name */ + /** + * @return the objects corresponding to a given name + */ ContextItem get(ContextKey name); - /** @return whether this context has a specific type */ + /** + * @return whether this context has a specific type + */ default boolean isA(Class type) { return type.isInstance(this); } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/Entrypoint.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/Entrypoint.java index d2dd35f107..89823d4395 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/Entrypoint.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/Entrypoint.java @@ -33,7 +33,9 @@ public abstract class Entrypoint implements BytecodeConstants { /** The method to be called */ protected final IMethod method; - /** @param method the method to be called for this entrypoint */ + /** + * @param method the method to be called for this entrypoint + */ protected Entrypoint(IMethod method) { if (method == null) { throw new IllegalArgumentException("method is null"); @@ -171,15 +173,21 @@ public SSAAbstractInvokeInstruction addCall(AbstractRootMethod m) { return m.addInvocation(paramValues, site); } - /** @return the method this call invokes */ + /** + * @return the method this call invokes + */ public IMethod getMethod() { return method; } - /** @return types to allocate for parameter i; for non-static methods, parameter 0 is "this" */ + /** + * @return types to allocate for parameter i; for non-static methods, parameter 0 is "this" + */ public abstract TypeReference[] getParameterTypes(int i); - /** @return number of parameters to this call, including "this" for non-statics */ + /** + * @return number of parameters to this call, including "this" for non-statics + */ public abstract int getNumberOfParameters(); @Override diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/AbstractRootMethod.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/AbstractRootMethod.java index 656e604744..8ac8f5fd55 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/AbstractRootMethod.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/AbstractRootMethod.java @@ -105,7 +105,9 @@ public AbstractRootMethod( cache); } - /** @see SyntheticMethod#getStatements() */ + /** + * @see SyntheticMethod#getStatements() + */ @SuppressWarnings("deprecation") @Override public SSAInstruction[] getStatements(SSAOptions options) { diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/ArgumentTypeEntrypoint.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/ArgumentTypeEntrypoint.java index e063502b99..6ae93e83ba 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/ArgumentTypeEntrypoint.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/ArgumentTypeEntrypoint.java @@ -29,7 +29,9 @@ public class ArgumentTypeEntrypoint extends Entrypoint { private final IClassHierarchy cha; - /** @throws IllegalArgumentException if method == null */ + /** + * @throws IllegalArgumentException if method == null + */ protected TypeReference[][] makeParameterTypes(IMethod method) throws IllegalArgumentException { if (method == null) { throw new IllegalArgumentException("method == null"); diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/BasicCallGraph.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/BasicCallGraph.java index dcba8b5054..a5bf8b76c8 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/BasicCallGraph.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/BasicCallGraph.java @@ -180,15 +180,21 @@ public IMethod getMethod() { return method; } - /** @see java.lang.Object#equals(Object) */ + /** + * @see java.lang.Object#equals(Object) + */ @Override public abstract boolean equals(Object obj); - /** @see java.lang.Object#hashCode() */ + /** + * @see java.lang.Object#hashCode() + */ @Override public abstract int hashCode(); - /** @see java.lang.Object#toString() */ + /** + * @see java.lang.Object#toString() + */ @Override public String toString() { return "Node: " + method.toString() + " Context: " + context.toString(); @@ -237,7 +243,9 @@ public void removeNodeAndEdges(CGNode N) throws UnimplementedError { Assertions.UNREACHABLE(); } - /** @return NodeImpl, or null if none found */ + /** + * @return NodeImpl, or null if none found + */ @Override public CGNode getNode(IMethod method, Context C) { Key key = new Key(method, C); diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/ClassHierarchyClassTargetSelector.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/ClassHierarchyClassTargetSelector.java index ef9c88d357..ad9dfd7250 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/ClassHierarchyClassTargetSelector.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/ClassHierarchyClassTargetSelector.java @@ -24,7 +24,9 @@ public class ClassHierarchyClassTargetSelector implements ClassTargetSelector { private final IClassHierarchy cha; - /** @param cha governing class hierarchy */ + /** + * @param cha governing class hierarchy + */ public ClassHierarchyClassTargetSelector(IClassHierarchy cha) { this.cha = cha; } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/ExplicitCallGraph.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/ExplicitCallGraph.java index e111fbc2bd..7fef1192db 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/ExplicitCallGraph.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/ExplicitCallGraph.java @@ -56,6 +56,7 @@ public class ExplicitCallGraph extends BasicCallGraph private final long maxNumberOfNodes; private final IMethod fakeRootMethod; + /** special object to track call graph edges */ private final ExplicitEdgeManager edgeManager = makeEdgeManger(); @@ -326,7 +327,9 @@ public ControlFlowGraph getCFG() { } } - /** @see com.ibm.wala.ipa.callgraph.CallGraph#getClassHierarchy() */ + /** + * @see com.ibm.wala.ipa.callgraph.CallGraph#getClassHierarchy() + */ @Override public IClassHierarchy getClassHierarchy() { return cha; @@ -400,7 +403,9 @@ public boolean hasEdge(CGNode src, CGNode dst) { } } - /** @return Returns the edgeManger. */ + /** + * @return Returns the edgeManger. + */ @Override public NumberedEdgeManager getEdgeManager() { return edgeManager; diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/FakeRootClass.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/FakeRootClass.java index 7bd8cb3c20..a5353303df 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/FakeRootClass.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/FakeRootClass.java @@ -130,30 +130,40 @@ public Collection getAnnotations() { }); } - /** @see com.ibm.wala.classLoader.IClass#getModifiers() */ + /** + * @see com.ibm.wala.classLoader.IClass#getModifiers() + */ @Override public int getModifiers() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.classLoader.IClass#getSuperclass() */ + /** + * @see com.ibm.wala.classLoader.IClass#getSuperclass() + */ @Override public IClass getSuperclass() throws UnsupportedOperationException { return getClassHierarchy().getRootClass(); } - /** @see com.ibm.wala.classLoader.IClass#getAllImplementedInterfaces() */ + /** + * @see com.ibm.wala.classLoader.IClass#getAllImplementedInterfaces() + */ @Override public Collection getAllImplementedInterfaces() throws UnsupportedOperationException { return Collections.emptySet(); } - /** @see com.ibm.wala.classLoader.IClass#getAllImplementedInterfaces() */ + /** + * @see com.ibm.wala.classLoader.IClass#getAllImplementedInterfaces() + */ public Collection getAllAncestorInterfaces() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.classLoader.IClass#getMethod(com.ibm.wala.types.Selector) */ + /** + * @see com.ibm.wala.classLoader.IClass#getMethod(com.ibm.wala.types.Selector) + */ @Override public IMethod getMethod(Selector selector) throws UnsupportedOperationException { for (IMethod m : methods) { @@ -164,7 +174,9 @@ public IMethod getMethod(Selector selector) throws UnsupportedOperationException return null; } - /** @see com.ibm.wala.classLoader.IClass#getMethod(com.ibm.wala.types.Selector) */ + /** + * @see com.ibm.wala.classLoader.IClass#getMethod(com.ibm.wala.types.Selector) + */ @Override public IField getField(Atom name) { if (fakeRootStaticFields != null) { @@ -174,26 +186,34 @@ public IField getField(Atom name) { } } - /** @see com.ibm.wala.classLoader.IClass#getClassInitializer() */ + /** + * @see com.ibm.wala.classLoader.IClass#getClassInitializer() + */ @Override public IMethod getClassInitializer() throws UnimplementedError { Assertions.UNREACHABLE(); return null; } - /** @see com.ibm.wala.classLoader.IClass#getDeclaredMethods() */ + /** + * @see com.ibm.wala.classLoader.IClass#getDeclaredMethods() + */ @Override public Collection getDeclaredMethods() throws UnsupportedOperationException { return Collections.unmodifiableCollection(methods); } - /** @see com.ibm.wala.classLoader.IClass#getDeclaredInstanceFields() */ + /** + * @see com.ibm.wala.classLoader.IClass#getDeclaredInstanceFields() + */ @Override public Collection getDeclaredInstanceFields() throws UnsupportedOperationException { return Collections.emptySet(); } - /** @see com.ibm.wala.classLoader.IClass#getDeclaredStaticFields() */ + /** + * @see com.ibm.wala.classLoader.IClass#getDeclaredStaticFields() + */ @Override public Collection getDeclaredStaticFields() { if (fakeRootStaticFields != null) { @@ -203,37 +223,49 @@ public Collection getDeclaredStaticFields() { } } - /** @see com.ibm.wala.classLoader.IClass#isReferenceType() */ + /** + * @see com.ibm.wala.classLoader.IClass#isReferenceType() + */ @Override public boolean isReferenceType() { return getReference().isReferenceType(); } - /** @see com.ibm.wala.classLoader.IClass#getDirectInterfaces() */ + /** + * @see com.ibm.wala.classLoader.IClass#getDirectInterfaces() + */ @Override public Collection getDirectInterfaces() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.classLoader.IClass#getAllInstanceFields() */ + /** + * @see com.ibm.wala.classLoader.IClass#getAllInstanceFields() + */ @Override public Collection getAllInstanceFields() { return Collections.emptySet(); } - /** @see com.ibm.wala.classLoader.IClass#getAllStaticFields() */ + /** + * @see com.ibm.wala.classLoader.IClass#getAllStaticFields() + */ @Override public Collection getAllStaticFields() { return getDeclaredStaticFields(); } - /** @see com.ibm.wala.classLoader.IClass#getAllMethods() */ + /** + * @see com.ibm.wala.classLoader.IClass#getAllMethods() + */ @Override public Collection getAllMethods() { throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.classLoader.IClass#getAllFields() */ + /** + * @see com.ibm.wala.classLoader.IClass#getAllFields() + */ @Override public Collection getAllFields() { return getDeclaredStaticFields(); diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/Util.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/Util.java index f57fab40c0..793cc2f407 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/Util.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/impl/Util.java @@ -66,6 +66,7 @@ public static void setNativeSpec(String xmlFile) { public static String getNativeSpec() { return nativeSpec; } + /* END Custom change: change native spec */ /** * Set up an AnalysisOptions object with default selectors, corresponding to class hierarchy @@ -236,7 +237,9 @@ public static Iterable makeMainEntrypoints( return makeMainEntrypoints(scope, cha, new String[] {className}); } - /** @return Entrypoints for a set of J2SE Main classes */ + /** + * @return Entrypoints for a set of J2SE Main classes + */ public static Iterable makeMainEntrypoints( final IClassHierarchy cha, String className) { return makeMainEntrypoints(cha, new String[] {className}); @@ -254,7 +257,9 @@ public static Iterable makeMainEntrypoints( return makeMainEntrypoints(cha, classNames); } - /** @return Entrypoints for a set of J2SE Main classes */ + /** + * @return Entrypoints for a set of J2SE Main classes + */ public static Iterable makeMainEntrypoints( final IClassHierarchy cha, final String[] classNames) { if (cha == null) { @@ -1004,6 +1009,7 @@ public static SSAPropagationCallGraphBuilder makeVanillaZeroOneContainerCFABuild return new ZeroXContainerCFABuilder( cha, options, cache, appSelector, appInterpreter, ZeroXInstanceKeys.ALLOCATIONS); } + /** * @deprecated *

Use {@link Util#addDefaultBypassLogic(AnalysisOptions, ClassLoader, IClassHierarchy)} diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AbstractPointerAnalysis.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AbstractPointerAnalysis.java index e86783ef1d..f89b86d2a5 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AbstractPointerAnalysis.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AbstractPointerAnalysis.java @@ -23,6 +23,7 @@ public abstract class AbstractPointerAnalysis implements PointerAnalysis heapGraph; + /** Governing call graph. */ private final CallGraph cg; diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AbstractTypeInNode.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AbstractTypeInNode.java index ff3a6f78d5..aecf244437 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AbstractTypeInNode.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AbstractTypeInNode.java @@ -44,13 +44,17 @@ public AbstractTypeInNode(CGNode node, IClass type) { @Override public abstract String toString(); - /** @return the concrete type allocated */ + /** + * @return the concrete type allocated + */ @Override public IClass getConcreteType() { return type; } - /** @return the call graph node which contains this allocation */ + /** + * @return the call graph node which contains this allocation + */ @Override public CGNode getNode() { return node; diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AllocationSiteInNode.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AllocationSiteInNode.java index 916732d33e..be27bd00c1 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AllocationSiteInNode.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AllocationSiteInNode.java @@ -44,7 +44,9 @@ public String toString() { + '}'; } - /** @return Returns the site. */ + /** + * @return Returns the site. + */ public NewSiteReference getSite() { return site; } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AllocationSiteInNodeFactory.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AllocationSiteInNodeFactory.java index 85b6404cc4..6d96d16f27 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AllocationSiteInNodeFactory.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/AllocationSiteInNodeFactory.java @@ -51,7 +51,9 @@ public class AllocationSiteInNodeFactory implements InstanceKeyFactory { private final ClassBasedInstanceKeys classBased; - /** @param options Governing call graph construction options */ + /** + * @param options Governing call graph construction options + */ public AllocationSiteInNodeFactory(AnalysisOptions options, IClassHierarchy cha) { this.options = options; this.cha = cha; diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/ClassBasedInstanceKeys.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/ClassBasedInstanceKeys.java index c96a5ebf37..0f28ab510b 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/ClassBasedInstanceKeys.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/ClassBasedInstanceKeys.java @@ -120,7 +120,9 @@ public InstanceKey getInstanceKeyForConstant(TypeReference type, T S) { } } - /** @return a set of ConcreteTypeKeys that represent the exceptions the PEI may throw. */ + /** + * @return a set of ConcreteTypeKeys that represent the exceptions the PEI may throw. + */ @Override public InstanceKey getInstanceKeyForPEI(CGNode node, ProgramCounter peiLoc, TypeReference type) { IClass klass = cha.lookupClass(type); @@ -158,7 +160,9 @@ public InstanceKey getInstanceKeyForMetadataObject(Object obj, TypeReference obj } } - /** @return Returns the class hierarchy. */ + /** + * @return Returns the class hierarchy. + */ public IClassHierarchy getClassHierarchy() { return cha; } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/HeapModel.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/HeapModel.java index 84c38a5a3d..a5efe3c6fd 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/HeapModel.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/HeapModel.java @@ -16,9 +16,13 @@ /** A {@link HeapModel} embodies how a pointer analysis abstracts heap locations. */ public interface HeapModel extends InstanceKeyFactory, PointerKeyFactory { - /** @return an Iterator of all PointerKeys that are modeled. */ + /** + * @return an Iterator of all PointerKeys that are modeled. + */ Iterator iteratePointerKeys(); - /** @return the governing class hierarchy for this heap model */ + /** + * @return the governing class hierarchy for this heap model + */ IClassHierarchy getClassHierarchy(); } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/InstanceFieldPointerKey.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/InstanceFieldPointerKey.java index 1f5892392c..c5a53bc888 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/InstanceFieldPointerKey.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/InstanceFieldPointerKey.java @@ -12,6 +12,8 @@ public interface InstanceFieldPointerKey extends PointerKey { - /** @return the instance key which is the "container" for this pointer */ + /** + * @return the instance key which is the "container" for this pointer + */ InstanceKey getInstanceKey(); } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/InstanceKeyFactory.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/InstanceKeyFactory.java index 92adbe8ddd..7955aaa4cf 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/InstanceKeyFactory.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/InstanceKeyFactory.java @@ -17,7 +17,9 @@ /** An object that abstracts how to model instances in the heap. */ public interface InstanceKeyFactory { - /** @return the instance key that represents a particular allocation */ + /** + * @return the instance key that represents a particular allocation + */ InstanceKey getInstanceKeyForAllocation(CGNode node, NewSiteReference allocation); /** diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/NodeKey.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/NodeKey.java index 63e98ac489..a30751ca5b 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/NodeKey.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/NodeKey.java @@ -35,7 +35,10 @@ protected boolean internalEquals(Object obj) { protected int internalHashCode() { return node.hashCode() * 1621; } - /** @return the node this key represents */ + + /** + * @return the node this key represents + */ @Override public CGNode getNode() { return node; diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PointerAnalysis.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PointerAnalysis.java index d3a319d732..df1bd208fb 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PointerAnalysis.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PointerAnalysis.java @@ -26,10 +26,14 @@ public interface PointerAnalysis { */ OrdinalSet getPointsToSet(PointerKey key); - /** @return an Object that determines how to model abstract locations in the heap. */ + /** + * @return an Object that determines how to model abstract locations in the heap. + */ HeapModel getHeapModel(); - /** @return a graph view of the pointer analysis solution */ + /** + * @return a graph view of the pointer analysis solution + */ HeapGraph getHeapGraph(); /** @@ -38,10 +42,14 @@ public interface PointerAnalysis { */ OrdinalSetMapping getInstanceKeyMapping(); - /** @return all pointer keys known */ + /** + * @return all pointer keys known + */ Iterable getPointerKeys(); - /** @return all instance keys known */ + /** + * @return all instance keys known + */ Collection getInstanceKeys(); /** did the pointer analysis use a type filter for a given points-to set? (this is ugly). */ diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PointerAnalysisImpl.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PointerAnalysisImpl.java index 3d787fb794..32be1f99d2 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PointerAnalysisImpl.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PointerAnalysisImpl.java @@ -437,7 +437,9 @@ private OrdinalSet toOrdinalSet(InstanceKey[] ik) { return new OrdinalSet<>(s, instanceKeys); } - /** @return the points-to set for the exceptional return values from a particular call site */ + /** + * @return the points-to set for the exceptional return values from a particular call site + */ private OrdinalSet computeImplicitExceptionsForCall( CGNode node, SSAInvokeInstruction call) { MutableSparseIntSet S = MutableSparseIntSet.makeEmpty(); @@ -451,7 +453,9 @@ private OrdinalSet computeImplicitExceptionsForCall( return new OrdinalSet<>(S, instanceKeys); } - /** @see com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis#getHeapModel() */ + /** + * @see com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis#getHeapModel() + */ @Override public HeapModel getHeapModel() { return H; @@ -562,7 +566,9 @@ public IClassHierarchy getClassHierarchy() { } } - /** @see com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis#getPointerKeys() */ + /** + * @see com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis#getPointerKeys() + */ @Override public Iterable getPointerKeys() { return Iterator2Iterable.make(pointsToMap.iterateKeys()); diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PointsToMap.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PointsToMap.java index f342047cd0..72e9de3332 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PointsToMap.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PointsToMap.java @@ -68,7 +68,9 @@ public String toString() { */ private final BitVector transitiveRoots = new BitVector(); - /** @return iterator of all PointerKeys tracked */ + /** + * @return iterator of all PointerKeys tracked + */ public Iterator iterateKeys() { return pointerKeys.iterator(); } @@ -96,7 +98,9 @@ public PointsToSetVariable getPointsToSet(PointerKey p) { return result; } - /** @return the {@link PointsToSetVariable} recorded for a particular id */ + /** + * @return the {@link PointsToSetVariable} recorded for a particular id + */ public PointsToSetVariable getPointsToSet(int id) { int repI = uf.find(id); return (PointsToSetVariable) pointsToSets.get(repI); @@ -183,7 +187,9 @@ public void revertToPreTransitive() { } } - /** @return {@link Iterator}<{@link PointerKey}> */ + /** + * @return {@link Iterator}<{@link PointerKey}> + */ public Iterator getTransitiveRoots() { return new FilterIterator<>(iterateKeys(), this::isTransitiveRoot); } @@ -275,7 +281,9 @@ private void upgradeToFilter(PointsToSetVariable p, FilteredPointerKey.TypeFilte } } - /** @return the unique integer that identifies this pointer key */ + /** + * @return the unique integer that identifies this pointer key + */ public int getIndex(PointerKey p) { return pointerKeys.getMappedIndex(p); } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PropagationCallGraphBuilder.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PropagationCallGraphBuilder.java index 3eac186f9d..8584ce8ae8 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PropagationCallGraphBuilder.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PropagationCallGraphBuilder.java @@ -181,7 +181,9 @@ protected ExplicitCallGraph createEmptyCallGraph( return new ExplicitCallGraph(abstractRootMethod, options, getAnalysisCache()); } - /** @return true iff the klass represents java.lang.Object */ + /** + * @return true iff the klass represents java.lang.Object + */ protected boolean isJavaLangObject(IClass klass) { return klass.getReference().equals(TypeReference.JavaLangObject); } @@ -693,7 +695,9 @@ protected CGNode getTargetForCall( } } - /** @return the context selector for this call graph builder */ + /** + * @return the context selector for this call graph builder + */ public ContextSelector getContextSelector() { return contextSelector; } @@ -1147,7 +1151,9 @@ public UnaryOperator getPutAssignmentOperator() { return assignOperator; } - /** @return Returns the field. */ + /** + * @return Returns the field. + */ protected IField getField() { return field; } @@ -1356,7 +1362,9 @@ public String toString() { return "InverseFilter"; } - /** @see com.ibm.wala.ipa.callgraph.propagation.IPointerOperator#isComplex() */ + /** + * @see com.ibm.wala.ipa.callgraph.propagation.IPointerOperator#isComplex() + */ @Override public boolean isComplex() { return false; diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PropagationGraph.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PropagationGraph.java index 0295d069bf..ae270e68f6 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PropagationGraph.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PropagationGraph.java @@ -85,7 +85,9 @@ public class PropagationGraph implements IFixedPointSystem /** Number of implicit unary equations registered */ private int implicitUnaryCount = 0; - /** @return a relation in map m corresponding to a key */ + /** + * @return a relation in map m corresponding to a key + */ private static IBinaryNaturalRelation findOrCreateRelation( Map, IBinaryNaturalRelation> m, UnaryOperator key) { @@ -97,7 +99,9 @@ private static IBinaryNaturalRelation findOrCreateRelation( return result; } - /** @return a Relation object to track implicit equations using the operator */ + /** + * @return a Relation object to track implicit equations using the operator + */ private static IBinaryNaturalRelation makeRelation(AbstractOperator op) { byte[] implementation = null; if (op instanceof AssignOperator) { @@ -142,13 +146,17 @@ public void addVariable(PointsToSetVariable v) { } } - /** @see com.ibm.wala.util.graph.AbstractGraph#getNodeManager() */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getNodeManager() + */ @Override protected NumberedNodeManager getNodeManager() { return nodeManager; } - /** @see com.ibm.wala.util.graph.AbstractGraph#getEdgeManager() */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getEdgeManager() + */ @Override protected NumberedEdgeManager getEdgeManager() { return edgeManager; @@ -163,7 +171,9 @@ protected int getVarCount() { } } - /** @throws IllegalArgumentException if eq is null */ + /** + * @throws IllegalArgumentException if eq is null + */ public void addStatement(GeneralStatement eq) { if (eq == null) { throw new IllegalArgumentException("eq is null"); @@ -204,7 +214,9 @@ public void addStatement(UnaryStatement eq) throws IllegalA } } - /** @return true iff this equation should be represented implicitly in this data structure */ + /** + * @return true iff this equation should be represented implicitly in this data structure + */ private static boolean useImplicitRepresentation(IFixedPointStatement s) { AbstractStatement eq = (AbstractStatement) s; AbstractOperator op = eq.getOperator(); @@ -433,43 +445,57 @@ public void reorder() { */ private class VariableGraphView extends AbstractNumberedGraph { - /** @see com.ibm.wala.util.graph.Graph#removeNodeAndEdges(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.Graph#removeNodeAndEdges(java.lang.Object) + */ @Override public void removeNodeAndEdges(PointsToSetVariable N) { Assertions.UNREACHABLE(); } - /** @see com.ibm.wala.util.graph.NodeManager#iterator() */ + /** + * @see com.ibm.wala.util.graph.NodeManager#iterator() + */ @Override public Iterator iterator() { return getVariables(); } - /** @see com.ibm.wala.util.graph.NodeManager#getNumberOfNodes() */ + /** + * @see com.ibm.wala.util.graph.NodeManager#getNumberOfNodes() + */ @Override public int getNumberOfNodes() { return delegateGraph.getVarCount(); } - /** @see com.ibm.wala.util.graph.NodeManager#addNode(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#addNode(java.lang.Object) + */ @Override public void addNode(PointsToSetVariable n) { assert containsNode(n); } - /** @see com.ibm.wala.util.graph.NodeManager#removeNode(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#removeNode(java.lang.Object) + */ @Override public void removeNode(PointsToSetVariable n) { Assertions.UNREACHABLE(); } - /** @see com.ibm.wala.util.graph.NodeManager#containsNode(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#containsNode(java.lang.Object) + */ @Override public boolean containsNode(PointsToSetVariable N) { return delegateGraph.containsNode(N); } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(java.lang.Object) + */ @Override public Iterator getPredNodes(PointsToSetVariable v) { final Iterator> eqs = getStatementsThatDef(v); @@ -508,7 +534,9 @@ public void remove() { }; } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(java.lang.Object) + */ @Override public int getPredNodeCount(PointsToSetVariable v) { int result = 0; @@ -523,7 +551,9 @@ public int getPredNodeCount(PointsToSetVariable v) { return result; } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) + */ @Override public Iterator getSuccNodes(PointsToSetVariable v) { final Iterator eqs = getStatementsThatUse(v); @@ -562,7 +592,9 @@ public void remove() { }; } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(java.lang.Object) + */ @Override public int getSuccNodeCount(PointsToSetVariable v) { int result = 0; @@ -575,26 +607,34 @@ public int getSuccNodeCount(PointsToSetVariable v) { return result; } - /** @see com.ibm.wala.util.graph.EdgeManager#addEdge(java.lang.Object, java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#addEdge(java.lang.Object, java.lang.Object) + */ @Override public void addEdge(PointsToSetVariable src, PointsToSetVariable dst) { Assertions.UNREACHABLE(); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(java.lang.Object) + */ @Override public void removeAllIncidentEdges(PointsToSetVariable node) { Assertions.UNREACHABLE(); } - /** @see com.ibm.wala.util.graph.AbstractGraph#getNodeManager() */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getNodeManager() + */ @Override @SuppressWarnings("unchecked") protected NumberedNodeManager getNodeManager() { return nodeManager; } - /** @see com.ibm.wala.util.graph.AbstractGraph#getEdgeManager() */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getEdgeManager() + */ @Override @SuppressWarnings("unchecked") protected NumberedEdgeManager getEdgeManager() { @@ -704,7 +744,9 @@ public Iterator getVariables() { return IteratorUtil.filter(delegateGraph.iterator(), PointsToSetVariable.class); } - /** @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() */ + /** + * @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() + */ public void performVerboseAction() { if (VERBOSE) { System.err.println(("stats for " + getClass())); @@ -742,7 +784,9 @@ public boolean containsStatement(IFixedPointStatement eq) } } - /** @return true iff the graph already contains this equation */ + /** + * @return true iff the graph already contains this equation + */ private boolean containsImplicitStatement(UnaryStatement eq) { if (!containsVariable(eq.getLHS())) { return false; @@ -827,44 +871,58 @@ private abstract class FilteredConstraintGraphView abstract boolean isInteresting(AbstractStatement eq); - /** @see com.ibm.wala.util.graph.Graph#removeNodeAndEdges(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.Graph#removeNodeAndEdges(java.lang.Object) + */ @Override public void removeNodeAndEdges(PointsToSetVariable N) { Assertions.UNREACHABLE(); } - /** @see com.ibm.wala.util.graph.NodeManager#iterator() */ + /** + * @see com.ibm.wala.util.graph.NodeManager#iterator() + */ @Override public Iterator iterator() { return getVariables(); } - /** @see com.ibm.wala.util.graph.NodeManager#getNumberOfNodes() */ + /** + * @see com.ibm.wala.util.graph.NodeManager#getNumberOfNodes() + */ @Override public int getNumberOfNodes() { return delegateGraph.getVarCount(); } - /** @see com.ibm.wala.util.graph.NodeManager#addNode(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#addNode(java.lang.Object) + */ @Override public void addNode(PointsToSetVariable n) { Assertions.UNREACHABLE(); } - /** @see com.ibm.wala.util.graph.NodeManager#removeNode(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#removeNode(java.lang.Object) + */ @Override public void removeNode(PointsToSetVariable n) { Assertions.UNREACHABLE(); } - /** @see com.ibm.wala.util.graph.NodeManager#containsNode(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#containsNode(java.lang.Object) + */ @Override public boolean containsNode(PointsToSetVariable N) { Assertions.UNREACHABLE(); return false; } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(java.lang.Object) + */ @Override public Iterator getPredNodes(PointsToSetVariable v) { final Iterator> eqs = getStatementsThatDef(v); @@ -904,7 +962,9 @@ public void remove() { }; } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(java.lang.Object) + */ @Override public int getPredNodeCount(PointsToSetVariable v) { int result = 0; @@ -916,7 +976,9 @@ public int getPredNodeCount(PointsToSetVariable v) { return result; } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) + */ @Override public Iterator getSuccNodes(PointsToSetVariable v) { final Iterator eqs = getStatementsThatUse(v); @@ -957,7 +1019,9 @@ public void remove() { }; } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(java.lang.Object) + */ @Override public int getSuccNodeCount(PointsToSetVariable v) { int result = 0; @@ -969,26 +1033,34 @@ public int getSuccNodeCount(PointsToSetVariable v) { return result; } - /** @see com.ibm.wala.util.graph.EdgeManager#addEdge(java.lang.Object, java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#addEdge(java.lang.Object, java.lang.Object) + */ @Override public void addEdge(PointsToSetVariable src, PointsToSetVariable dst) { Assertions.UNREACHABLE(); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(java.lang.Object) + */ @Override public void removeAllIncidentEdges(PointsToSetVariable node) { Assertions.UNREACHABLE(); } - /** @see com.ibm.wala.util.graph.AbstractGraph#getNodeManager() */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getNodeManager() + */ @Override @SuppressWarnings("unchecked") protected NumberedNodeManager getNodeManager() { return nodeManager; } - /** @see com.ibm.wala.util.graph.AbstractGraph#getEdgeManager() */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getEdgeManager() + */ @Override protected NumberedEdgeManager getEdgeManager() { Assertions.UNREACHABLE(); diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PropagationSystem.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PropagationSystem.java index d77e199edd..07e5f3c421 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PropagationSystem.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/PropagationSystem.java @@ -115,7 +115,9 @@ public PropagationSystem( } } - /** @return an object which encapsulates the pointer analysis result */ + /** + * @return an object which encapsulates the pointer analysis result + */ public PointerAnalysis makePointerAnalysis(PropagationCallGraphBuilder builder) { return new PointerAnalysisImpl( builder, cg, pointsToMap, instanceKeys, pointerKeyFactory, instanceKeyFactory); @@ -180,7 +182,9 @@ public IntSet getInstanceKeysForClass(IClass klass) { return class2InstanceKey.get(klass); } - /** @return the instance key numbered with index i */ + /** + * @return the instance key numbered with index i + */ public InstanceKey getInstanceKey(int i) { return instanceKeys.getMappedObject(i); } @@ -384,19 +388,25 @@ public boolean newConstraint( return newStatement(L, op, R1, R2, true, true); } - /** @return true iff the system changes */ + /** + * @return true iff the system changes + */ public boolean newFieldWrite( PointerKey lhs, UnaryOperator op, PointerKey rhs) { return newConstraint(lhs, op, rhs); } - /** @return true iff the system changes */ + /** + * @return true iff the system changes + */ public boolean newFieldRead( PointerKey lhs, UnaryOperator op, PointerKey rhs) { return newConstraint(lhs, op, rhs); } - /** @return true iff the system changes */ + /** + * @return true iff the system changes + */ public boolean newConstraint(PointerKey lhs, InstanceKey value) { if (DEBUG) { System.err.println("Add constraint B: " + lhs + " U= " + value); @@ -576,7 +586,9 @@ protected void initializeWorkList() { addAllStatementsToWorkList(); } - /** @return an object that encapsulates the pointer analysis results */ + /** + * @return an object that encapsulates the pointer analysis results + */ public PointerAnalysis extractPointerAnalysis(PropagationCallGraphBuilder builder) { if (pointerAnalysis == null) { pointerAnalysis = makePointerAnalysis(builder); @@ -642,7 +654,9 @@ public IFixedPointSystem getFixedPointSystem() { return flowGraph; } - /** @see com.ibm.wala.ipa.callgraph.propagation.HeapModel#iteratePointerKeys() */ + /** + * @see com.ibm.wala.ipa.callgraph.propagation.HeapModel#iteratePointerKeys() + */ public Iterator iteratePointerKeys() { return pointsToMap.iterateKeys(); } @@ -706,7 +720,9 @@ public int getVerboseInterval() { return verboseInterval; } - /** @param verboseInterval The verboseInterval to set. */ + /** + * @param verboseInterval The verboseInterval to set. + */ public void setVerboseInterval(int verboseInterval) { this.verboseInterval = verboseInterval; } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/ReceiverInstanceContext.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/ReceiverInstanceContext.java index 2d6569b11a..b7bc7ac9fb 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/ReceiverInstanceContext.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/ReceiverInstanceContext.java @@ -19,7 +19,9 @@ public class ReceiverInstanceContext implements Context { private final InstanceKey ik; - /** @param I the instance key that represents the receiver */ + /** + * @param I the instance key that represents the receiver + */ public ReceiverInstanceContext(InstanceKey I) { if (I == null) { throw new IllegalArgumentException("null I"); diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/SSAContextInterpreter.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/SSAContextInterpreter.java index 7b7bd1d8af..db1c2406fc 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/SSAContextInterpreter.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/SSAContextInterpreter.java @@ -22,7 +22,9 @@ /** An object that provides an interface to local method information needed for CFA. */ public interface SSAContextInterpreter extends RTAContextInterpreter { - /** @return the IR that models the method context, or null if it's an unmodelled native method */ + /** + * @return the IR that models the method context, or null if it's an unmodelled native method + */ IR getIR(CGNode node); IRView getIRView(CGNode node); @@ -33,7 +35,9 @@ public interface SSAContextInterpreter extends RTAContextInterpreter { */ DefUse getDU(CGNode node); - /** @return the number of the statements in the IR, or -1 if it's an unmodelled native method. */ + /** + * @return the number of the statements in the IR, or -1 if it's an unmodelled native method. + */ int getNumberOfStatements(CGNode node); ControlFlowGraph getCFG(CGNode n); diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/SSAPropagationCallGraphBuilder.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/SSAPropagationCallGraphBuilder.java index ebae323bc8..83e3eef634 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/SSAPropagationCallGraphBuilder.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/SSAPropagationCallGraphBuilder.java @@ -233,7 +233,9 @@ protected boolean unconditionallyAddConstraintsFromNode(CGNode node, IProgressMo return true; } - /** @return a visitor to examine instructions in the ir */ + /** + * @return a visitor to examine instructions in the ir + */ protected ConstraintVisitor makeVisitor(CGNode node) { return new ConstraintVisitor(this, node); } @@ -1824,7 +1826,9 @@ protected IntSet getParamObjects(int paramVn, int rhsi) { return (byte) (NOT_CHANGED | sideEffectMask); } - /** @see com.ibm.wala.fixpoint.UnaryOperator#evaluate(IVariable, IVariable) */ + /** + * @see com.ibm.wala.fixpoint.UnaryOperator#evaluate(IVariable, IVariable) + */ @Override public byte evaluate(PointsToSetVariable lhs, final PointsToSetVariable[] rhs) { assert dispatchIndices.length >= rhs.length : "bad operator at " + call; @@ -2273,7 +2277,9 @@ public PointerKey getTargetPointerKey(CGNode target, int index) { } } - /** @return the receiver class for this method. */ + /** + * @return the receiver class for this method. + */ private IClass getReceiverClass(IMethod method) { TypeReference formalType = method.getParameterType(0); IClass C = getClassHierarchy().lookupClass(formalType); diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/SmushedAllocationSiteInstanceKeys.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/SmushedAllocationSiteInstanceKeys.java index 1853e44307..1f1c429fec 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/SmushedAllocationSiteInstanceKeys.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/SmushedAllocationSiteInstanceKeys.java @@ -35,7 +35,9 @@ public class SmushedAllocationSiteInstanceKeys implements InstanceKeyFactory { private final ClassBasedInstanceKeys classBased; - /** @param options Governing call graph construction options */ + /** + * @param options Governing call graph construction options + */ public SmushedAllocationSiteInstanceKeys(AnalysisOptions options, IClassHierarchy cha) { this.options = options; this.cha = cha; diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/UnarySideEffect.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/UnarySideEffect.java index 688c8bc169..98420e0690 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/UnarySideEffect.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/UnarySideEffect.java @@ -36,7 +36,9 @@ public final byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) { public abstract byte evaluate(PointsToSetVariable rhs); - /** @return Returns the fixed points-to-set associated with this side effect. */ + /** + * @return Returns the fixed points-to-set associated with this side effect. + */ PointsToSetVariable getFixedSet() { return fixedSet; } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/CallerContext.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/CallerContext.java index abd41a5067..d52c0a3d38 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/CallerContext.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/CallerContext.java @@ -20,7 +20,9 @@ public class CallerContext implements Context { private final CGNode caller; - /** @param caller the node which defines this context. */ + /** + * @param caller the node which defines this context. + */ public CallerContext(CGNode caller) { if (caller == null) { throw new IllegalArgumentException("null caller"); diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/CallerContextPair.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/CallerContextPair.java index 720ba22f83..377a99801f 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/CallerContextPair.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/CallerContextPair.java @@ -26,7 +26,9 @@ public class CallerContextPair extends CallerContext { private final Context baseContext; - /** @param caller the node which defines this context. */ + /** + * @param caller the node which defines this context. + */ public CallerContextPair(CGNode caller, Context baseContext) { super(caller); this.baseContext = baseContext; diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/CallerSiteContextPair.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/CallerSiteContextPair.java index 1a66d2509a..95cd75c55b 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/CallerSiteContextPair.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/CallerSiteContextPair.java @@ -25,7 +25,9 @@ public class CallerSiteContextPair extends CallerSiteContext { private final Context baseContext; - /** @param caller the node which defines this context. */ + /** + * @param caller the node which defines this context. + */ public CallerSiteContextPair(CGNode caller, CallSiteReference callSite, Context baseContext) { super(caller, callSite); if (caller == null) { diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/ContainerContextSelector.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/ContainerContextSelector.java index 4ca5e5b01d..8371967c5b 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/ContainerContextSelector.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/ContainerContextSelector.java @@ -308,7 +308,9 @@ public boolean mayUnderstand(CallSiteReference site, IMethod targetMethod, Insta } } - /** @return true iff C is a container class */ + /** + * @return true iff C is a container class + */ protected boolean isContainer(IClass C) { if (DEBUG) { System.err.println("isContainer? " + C + ' ' + ContainerUtil.isContainer(C)); diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/ZeroXInstanceKeys.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/ZeroXInstanceKeys.java index 0c5e938c0f..70e1f3d20c 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/ZeroXInstanceKeys.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/cfa/ZeroXInstanceKeys.java @@ -143,7 +143,9 @@ public ZeroXInstanceKeys( this.contextInterpreter = contextInterpreter; } - /** @return true iff the policy smushes some allocation sites */ + /** + * @return true iff the policy smushes some allocation sites + */ private boolean smushMany() { return (policy & SMUSH_MANY) > 0; } @@ -213,7 +215,9 @@ private boolean exceedsSmushLimit(IClass c, CGNode node) { return s.contains(c); } - /** @return Map: IClass -> Integer, the number of allocation sites for each type. */ + /** + * @return Map: IClass -> Integer, the number of allocation sites for each type. + */ private Map countAllocsByType(CGNode node) { Map count = HashMapFactory.make(); for (NewSiteReference n : Iterator2Iterable.make(contextInterpreter.iterateNewSites(node))) { diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/AbstractRTABuilder.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/AbstractRTABuilder.java index f98019620b..df4c057079 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/AbstractRTABuilder.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/AbstractRTABuilder.java @@ -355,7 +355,9 @@ protected void customInit() { } } - /** @return set of IClasses determined to be allocated */ + /** + * @return set of IClasses determined to be allocated + */ @SuppressWarnings("unchecked") public Set getAllocatedTypes() { return (Set) allocatedClasses.clone(); @@ -412,7 +414,9 @@ protected PropagationSystem makeSystem(AnalysisOptions options) { return result; } - /** @see com.ibm.wala.ipa.callgraph.CallGraphBuilder#getPointerAnalysis() */ + /** + * @see com.ibm.wala.ipa.callgraph.CallGraphBuilder#getPointerAnalysis() + */ @Override public PointerAnalysis getPointerAnalysis() { return TypeBasedPointerAnalysis.make(getOptions(), allocatedClasses, getCallGraph()); diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/CallSite.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/CallSite.java index 0a7946c31d..d88616f394 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/CallSite.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/CallSite.java @@ -38,7 +38,9 @@ public CallSiteReference getSite() { return fst; } - /** @return the Selector that identifies this site */ + /** + * @return the Selector that identifies this site + */ public Selector getSelector() { return getSite().getDeclaredTarget().getSelector(); } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/DefaultRTAInterpreter.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/DefaultRTAInterpreter.java index ec6e74bd90..9b6e65df94 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/DefaultRTAInterpreter.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/DefaultRTAInterpreter.java @@ -29,7 +29,9 @@ public class DefaultRTAInterpreter implements RTAContextInterpreter { private final ContextInsensitiveRTAInterpreter defaultInterpreter; - /** @param options governing analysis options */ + /** + * @param options governing analysis options + */ public DefaultRTAInterpreter(AnalysisOptions options, IAnalysisCacheView cache) { defaultInterpreter = new ContextInsensitiveSSAInterpreter(options, cache); } diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/RTAContextInterpreter.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/RTAContextInterpreter.java index 3b099ba2a3..14e7561bd8 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/RTAContextInterpreter.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/RTAContextInterpreter.java @@ -26,10 +26,14 @@ public interface RTAContextInterpreter extends CHAContextInterpreter { @Override Iterator iterateNewSites(CGNode node); - /** @return iterator of FieldReference */ + /** + * @return iterator of FieldReference + */ Iterator iterateFieldsRead(CGNode node); - /** @return iterator of FieldReference */ + /** + * @return iterator of FieldReference + */ Iterator iterateFieldsWritten(CGNode node); /** diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/RTASelectorKey.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/RTASelectorKey.java index 494c49d2cd..53eca64dd4 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/RTASelectorKey.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/RTASelectorKey.java @@ -49,7 +49,9 @@ public String toString() { return "RTAKey:" + selector.toString(); } - /** @see com.ibm.wala.ipa.callgraph.propagation.FilteredPointerKey#getTypeFilter() */ + /** + * @see com.ibm.wala.ipa.callgraph.propagation.FilteredPointerKey#getTypeFilter() + */ public IClass getTypeFilter() throws UnimplementedError { Assertions.UNREACHABLE(); return null; diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/TypeBasedPointerAnalysis.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/TypeBasedPointerAnalysis.java index 4a2e5bc418..7dd6fb916d 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/TypeBasedPointerAnalysis.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/propagation/rta/TypeBasedPointerAnalysis.java @@ -61,7 +61,9 @@ private TypeBasedPointerAnalysis( heapModel = new TypeBasedHeapModel(options, klasses, cg); } - /** @param c {@code Collection} */ + /** + * @param c {@code Collection} + */ private static MutableMapping makeInstanceKeys(Collection c) { if (c == null) { throw new IllegalArgumentException("null c"); diff --git a/core/src/main/java/com/ibm/wala/ipa/cfg/AbstractInterproceduralCFG.java b/core/src/main/java/com/ibm/wala/ipa/cfg/AbstractInterproceduralCFG.java index 0b3d030c61..81f2884024 100644 --- a/core/src/main/java/com/ibm/wala/ipa/cfg/AbstractInterproceduralCFG.java +++ b/core/src/main/java/com/ibm/wala/ipa/cfg/AbstractInterproceduralCFG.java @@ -390,27 +390,35 @@ public CGNode getCGNode(BasicBlockInContext B) throws IllegalArgumentExceptio return B.getNode(); } - /** @see com.ibm.wala.util.graph.Graph#removeNodeAndEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.Graph#removeNodeAndEdges(Object) + */ @Override public void removeNodeAndEdges(BasicBlockInContext N) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } - /** @see NodeManager#iterator() */ + /** + * @see NodeManager#iterator() + */ @Override public Iterator> iterator() { constructFullGraph("iterator"); return g.iterator(); } - /** @see NodeManager#iterator() */ + /** + * @see NodeManager#iterator() + */ @Override public Stream> stream() { constructFullGraph("stream"); return g.stream(); } - /** @see com.ibm.wala.util.graph.NodeManager#getNumberOfNodes() */ + /** + * @see com.ibm.wala.util.graph.NodeManager#getNumberOfNodes() + */ @Override public int getNumberOfNodes() { constructFullGraph("getNumberOfNodes"); @@ -527,19 +535,25 @@ private void addCallerEdges(CGNode n) { } } - /** @see com.ibm.wala.util.graph.NodeManager#addNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#addNode(Object) + */ @Override public void addNode(BasicBlockInContext n) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) + */ @Override public void removeNode(BasicBlockInContext n) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(Object) + */ @Override public Iterator> getPredNodes(BasicBlockInContext N) { initForPred(N); @@ -578,28 +592,36 @@ private void initForSucc(BasicBlockInContext N) { } } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(Object) + */ @Override public int getPredNodeCount(BasicBlockInContext N) { initForPred(N); return g.getPredNodeCount(N); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(Object) + */ @Override public Iterator> getSuccNodes(BasicBlockInContext N) { initForSucc(N); return g.getSuccNodes(N); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(Object) + */ @Override public int getSuccNodeCount(BasicBlockInContext N) { initForSucc(N); return g.getSuccNodeCount(N); } - /** @see com.ibm.wala.util.graph.EdgeManager#addEdge(Object, Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#addEdge(Object, Object) + */ @Override public void addEdge(BasicBlockInContext src, BasicBlockInContext dst) throws UnsupportedOperationException { @@ -612,7 +634,9 @@ public void removeEdge(BasicBlockInContext src, BasicBlockInContext dst) throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) + */ @Override public void removeAllIncidentEdges(BasicBlockInContext node) throws UnsupportedOperationException { @@ -624,19 +648,25 @@ public String toString() { return g.toString(); } - /** @see com.ibm.wala.util.graph.Graph#containsNode(Object) */ + /** + * @see com.ibm.wala.util.graph.Graph#containsNode(Object) + */ @Override public boolean containsNode(BasicBlockInContext N) { return g.containsNode(N); } - /** @return true iff basic block B ends in a call instuction */ + /** + * @return true iff basic block B ends in a call instuction + */ public boolean hasCall(BasicBlockInContext B) { addNodeForBasicBlockIfNeeded(B); return hasCallVector.get(getNumber(B)); } - /** @return true iff basic block B ends in a call instuction */ + /** + * @return true iff basic block B ends in a call instuction + */ protected boolean hasCall(BasicBlockInContext B, ControlFlowGraph cfg) { SSAInstruction[] statements = cfg.getInstructions(); @@ -667,7 +697,9 @@ public Set getCallTargets(BasicBlockInContext B) { return getCallTargets(B, cfg, getCGNode(B)); } - /** @return the set of CGNodes that B may call, according to the governing call graph. */ + /** + * @return the set of CGNodes that B may call, according to the governing call graph. + */ private Set getCallTargets( IBasicBlock B, ControlFlowGraph cfg, CGNode Bnode) { CallSiteReference site = getCallSiteForCallBlock(B, cfg); @@ -853,7 +885,9 @@ public boolean isReturn(BasicBlockInContext bb) throws IllegalArgumentExcepti return false; } - /** @return the governing {@link CallGraph} used to build this ICFG */ + /** + * @return the governing {@link CallGraph} used to build this ICFG + */ public CallGraph getCallGraph() { return cg; } diff --git a/core/src/main/java/com/ibm/wala/ipa/cfg/BasicBlockInContext.java b/core/src/main/java/com/ibm/wala/ipa/cfg/BasicBlockInContext.java index a544f6c2a8..feb6d48aac 100644 --- a/core/src/main/java/com/ibm/wala/ipa/cfg/BasicBlockInContext.java +++ b/core/src/main/java/com/ibm/wala/ipa/cfg/BasicBlockInContext.java @@ -35,49 +35,65 @@ public BasicBlockInContext(CGNode node, T bb) { this.node = node; } - /** @see com.ibm.wala.cfg.IBasicBlock#getFirstInstructionIndex() */ + /** + * @see com.ibm.wala.cfg.IBasicBlock#getFirstInstructionIndex() + */ @Override public int getFirstInstructionIndex() { return delegate.getFirstInstructionIndex(); } - /** @see com.ibm.wala.cfg.IBasicBlock#getLastInstructionIndex() */ + /** + * @see com.ibm.wala.cfg.IBasicBlock#getLastInstructionIndex() + */ @Override public int getLastInstructionIndex() { return delegate.getLastInstructionIndex(); } - /** @see com.ibm.wala.cfg.IBasicBlock#iterator() */ + /** + * @see com.ibm.wala.cfg.IBasicBlock#iterator() + */ @Override public Iterator iterator() { return delegate.iterator(); } - /** @see com.ibm.wala.cfg.IBasicBlock#getMethod() */ + /** + * @see com.ibm.wala.cfg.IBasicBlock#getMethod() + */ @Override public IMethod getMethod() { return delegate.getMethod(); } - /** @see com.ibm.wala.cfg.IBasicBlock#getNumber() */ + /** + * @see com.ibm.wala.cfg.IBasicBlock#getNumber() + */ @Override public int getNumber() { return delegate.getNumber(); } - /** @see com.ibm.wala.cfg.IBasicBlock#isCatchBlock() */ + /** + * @see com.ibm.wala.cfg.IBasicBlock#isCatchBlock() + */ @Override public boolean isCatchBlock() { return delegate.isCatchBlock(); } - /** @see com.ibm.wala.cfg.IBasicBlock#isEntryBlock() */ + /** + * @see com.ibm.wala.cfg.IBasicBlock#isEntryBlock() + */ @Override public boolean isEntryBlock() { return delegate.isEntryBlock(); } - /** @see com.ibm.wala.cfg.IBasicBlock#isExitBlock() */ + /** + * @see com.ibm.wala.cfg.IBasicBlock#isExitBlock() + */ @Override public boolean isExitBlock() { return delegate.isExitBlock(); diff --git a/core/src/main/java/com/ibm/wala/ipa/cfg/exceptionpruning/ExceptionFilter.java b/core/src/main/java/com/ibm/wala/ipa/cfg/exceptionpruning/ExceptionFilter.java index af354f5f40..2d0fbb4eb6 100644 --- a/core/src/main/java/com/ibm/wala/ipa/cfg/exceptionpruning/ExceptionFilter.java +++ b/core/src/main/java/com/ibm/wala/ipa/cfg/exceptionpruning/ExceptionFilter.java @@ -9,9 +9,13 @@ * @author Stephan Gocht {@code } */ public interface ExceptionFilter { - /** @return if the instruction does always throw an exception */ + /** + * @return if the instruction does always throw an exception + */ boolean alwaysThrowsException(Instruction instruction); - /** @return a list of exceptions, which have to be filtered for the given instruction */ + /** + * @return a list of exceptions, which have to be filtered for the given instruction + */ Collection filteredExceptions(Instruction instruction); } diff --git a/core/src/main/java/com/ibm/wala/ipa/cfg/exceptionpruning/ExceptionMatcher.java b/core/src/main/java/com/ibm/wala/ipa/cfg/exceptionpruning/ExceptionMatcher.java index cccc9667c9..f9581815c7 100644 --- a/core/src/main/java/com/ibm/wala/ipa/cfg/exceptionpruning/ExceptionMatcher.java +++ b/core/src/main/java/com/ibm/wala/ipa/cfg/exceptionpruning/ExceptionMatcher.java @@ -13,7 +13,9 @@ * @author Stephan Gocht {@code } */ public class ExceptionMatcher { - /** @return true, iff thrownExceptions is part of filteredExceptions */ + /** + * @return true, iff thrownExceptions is part of filteredExceptions + */ public static boolean isFiltered( Collection thrownExceptions, Collection filteredExceptions, diff --git a/core/src/main/java/com/ibm/wala/ipa/cfg/exceptionpruning/interprocedural/package-info.java b/core/src/main/java/com/ibm/wala/ipa/cfg/exceptionpruning/interprocedural/package-info.java index aac96e75ff..87ebb73af6 100644 --- a/core/src/main/java/com/ibm/wala/ipa/cfg/exceptionpruning/interprocedural/package-info.java +++ b/core/src/main/java/com/ibm/wala/ipa/cfg/exceptionpruning/interprocedural/package-info.java @@ -1,2 +1,4 @@ -/** @author stephan */ +/** + * @author stephan + */ package com.ibm.wala.ipa.cfg.exceptionpruning.interprocedural; diff --git a/core/src/main/java/com/ibm/wala/ipa/cha/ClassHierarchy.java b/core/src/main/java/com/ibm/wala/ipa/cha/ClassHierarchy.java index 3922c61220..6d1971ee43 100644 --- a/core/src/main/java/com/ibm/wala/ipa/cha/ClassHierarchy.java +++ b/core/src/main/java/com/ibm/wala/ipa/cha/ClassHierarchy.java @@ -89,6 +89,7 @@ public enum MissingSuperClassHandling { * merrily chugs along, tolerating the race. */ private final Map map; + /** {@link TypeReference} for the root type */ private TypeReference rootTypeRef; @@ -791,7 +792,9 @@ public ClassLoaderFactory getFactory() { return factory; } - /** @throws IllegalArgumentException if A is null */ + /** + * @throws IllegalArgumentException if A is null + */ @Override public IClass getLeastCommonSuperclass(IClass a, IClass b) { assert a.getClassLoader().getLanguage().equals(b.getClassLoader().getLanguage()); @@ -1138,7 +1141,9 @@ public Iterator iterator() { return new MapIterator<>(map.values().iterator(), toClass); } - /** @return The number of classes present in the class hierarchy. */ + /** + * @return The number of classes present in the class hierarchy. + */ @Override public int getNumberOfClasses() { return map.keySet().size(); diff --git a/core/src/main/java/com/ibm/wala/ipa/cha/ClassHierarchyFactory.java b/core/src/main/java/com/ibm/wala/ipa/cha/ClassHierarchyFactory.java index 4db6cbd9df..4e910a0f2c 100644 --- a/core/src/main/java/com/ibm/wala/ipa/cha/ClassHierarchyFactory.java +++ b/core/src/main/java/com/ibm/wala/ipa/cha/ClassHierarchyFactory.java @@ -20,7 +20,9 @@ public class ClassHierarchyFactory { - /** @return a ClassHierarchy object representing the analysis scope */ + /** + * @return a ClassHierarchy object representing the analysis scope + */ public static ClassHierarchy make(AnalysisScope scope) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); diff --git a/core/src/main/java/com/ibm/wala/ipa/cha/IClassHierarchy.java b/core/src/main/java/com/ibm/wala/ipa/cha/IClassHierarchy.java index 2ebd1b690a..0bc7f44293 100644 --- a/core/src/main/java/com/ibm/wala/ipa/cha/IClassHierarchy.java +++ b/core/src/main/java/com/ibm/wala/ipa/cha/IClassHierarchy.java @@ -41,7 +41,9 @@ public interface IClassHierarchy extends Iterable { */ boolean addClass(IClass klass); - /** @return The number of classes present in the class hierarchy. */ + /** + * @return The number of classes present in the class hierarchy. + */ int getNumberOfClasses(); boolean isRootClass(IClass c); @@ -165,10 +167,14 @@ public interface IClassHierarchy extends Iterable { */ Set getImplementors(TypeReference type); - /** @return the number of classes that immediately extend klass. */ + /** + * @return the number of classes that immediately extend klass. + */ int getNumberOfImmediateSubclasses(IClass klass); - /** @return the classes that immediately extend klass. */ + /** + * @return the classes that immediately extend klass. + */ Collection getImmediateSubclasses(IClass klass); /** diff --git a/core/src/main/java/com/ibm/wala/ipa/cha/SeqClassHierarchyFactory.java b/core/src/main/java/com/ibm/wala/ipa/cha/SeqClassHierarchyFactory.java index fced10180a..8075683372 100644 --- a/core/src/main/java/com/ibm/wala/ipa/cha/SeqClassHierarchyFactory.java +++ b/core/src/main/java/com/ibm/wala/ipa/cha/SeqClassHierarchyFactory.java @@ -20,7 +20,9 @@ public class SeqClassHierarchyFactory { - /** @return a ClassHierarchy object representing the analysis scope */ + /** + * @return a ClassHierarchy object representing the analysis scope + */ public static ClassHierarchy make(AnalysisScope scope) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); diff --git a/core/src/main/java/com/ibm/wala/ipa/slicer/HeapReachingDefs.java b/core/src/main/java/com/ibm/wala/ipa/slicer/HeapReachingDefs.java index 39e69130f4..cb8e53f7cb 100644 --- a/core/src/main/java/com/ibm/wala/ipa/slicer/HeapReachingDefs.java +++ b/core/src/main/java/com/ibm/wala/ipa/slicer/HeapReachingDefs.java @@ -679,7 +679,9 @@ IntSet gen(IExplodedBasicBlock b) { } } - /** @return int set representing all HEAP_PARAM_CALLEE statements in the domain. */ + /** + * @return int set representing all HEAP_PARAM_CALLEE statements in the domain. + */ private IntSet heapEntryStatements() { BitVectorIntSet result = new BitVectorIntSet(); for (Statement s : domain) { diff --git a/core/src/main/java/com/ibm/wala/ipa/slicer/HeapStatement.java b/core/src/main/java/com/ibm/wala/ipa/slicer/HeapStatement.java index 1e00f6793b..f15e25b4a9 100644 --- a/core/src/main/java/com/ibm/wala/ipa/slicer/HeapStatement.java +++ b/core/src/main/java/com/ibm/wala/ipa/slicer/HeapStatement.java @@ -109,6 +109,7 @@ public String toString() { public static final class HeapReturnCaller extends HeapStatement { // index into the instruction array of the relevant call instruction private final int callIndex; + // private final SSAAbstractInvokeInstruction call; public HeapReturnCaller(CGNode node, int callIndex, PointerKey loc) { diff --git a/core/src/main/java/com/ibm/wala/ipa/slicer/PDG.java b/core/src/main/java/com/ibm/wala/ipa/slicer/PDG.java index 71c07e5acd..c3ba5cfb53 100644 --- a/core/src/main/java/com/ibm/wala/ipa/slicer/PDG.java +++ b/core/src/main/java/com/ibm/wala/ipa/slicer/PDG.java @@ -782,7 +782,9 @@ private static int getBasePointer(SSAInstruction use) { } } - /** @return Statements representing each return instruction in the ir */ + /** + * @return Statements representing each return instruction in the ir + */ private Collection computeReturnStatements(final IR ir) { Predicate filter = o -> { @@ -798,7 +800,9 @@ private Collection computeReturnStatements(final IR ir) { new MapIterator<>(new FilterIterator<>(iterator(), filter), NormalStatement.class::cast)); } - /** @return {@link IntSet} representing instruction indices of each PEI in the ir */ + /** + * @return {@link IntSet} representing instruction indices of each PEI in the ir + */ private static IntSet getPEIs(final IR ir) { BitVectorIntSet result = new BitVectorIntSet(); for (int i = 0; i < ir.getInstructions().length; i++) { @@ -845,7 +849,9 @@ public static synchronized Statement ssaInstruction2Statement( } } - /** @return for each SSAInstruction, its instruction index in the ir instruction array */ + /** + * @return for each SSAInstruction, its instruction index in the ir instruction array + */ public static Map computeInstructionIndices(IR ir) { Map result = HashMapFactory.make(); if (ir != null) { @@ -1036,7 +1042,9 @@ private void addParamPassingStatements( } } - /** @return the set of all locations read by any callee at a call site. */ + /** + * @return the set of all locations read by any callee at a call site. + */ private static OrdinalSet unionHeapLocations( CallGraph cg, CGNode n, diff --git a/core/src/main/java/com/ibm/wala/ipa/slicer/SDGSupergraph.java b/core/src/main/java/com/ibm/wala/ipa/slicer/SDGSupergraph.java index a45a72c302..49dc9ab325 100644 --- a/core/src/main/java/com/ibm/wala/ipa/slicer/SDGSupergraph.java +++ b/core/src/main/java/com/ibm/wala/ipa/slicer/SDGSupergraph.java @@ -409,7 +409,9 @@ public IntSet getPredNodeNumbers(Statement node) { return sdg.getPredNodeNumbers(node); } - /** @see com.ibm.wala.util.graph.NumberedEdgeManager#getSuccNodeNumbers(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.NumberedEdgeManager#getSuccNodeNumbers(java.lang.Object) + */ @Override public IntSet getSuccNodeNumbers(Statement node) { return sdg.getSuccNodeNumbers(node); diff --git a/core/src/main/java/com/ibm/wala/ipa/slicer/Slicer.java b/core/src/main/java/com/ibm/wala/ipa/slicer/Slicer.java index 6e92829d0d..8041299c44 100644 --- a/core/src/main/java/com/ibm/wala/ipa/slicer/Slicer.java +++ b/core/src/main/java/com/ibm/wala/ipa/slicer/Slicer.java @@ -217,7 +217,9 @@ public static Collection computeBackwardSlice(SDG sdg, Collection< return computeSlice(sdg, ss, true); } - /** @param ss a collection of statements of interest */ + /** + * @param ss a collection of statements of interest + */ protected static Collection computeSlice( SDG sdg, Collection ss, boolean backward) throws CancelException { if (sdg == null) { @@ -310,26 +312,34 @@ public SliceProblem(Collection roots, ISDG sdg, boolean backward) { f = new SliceFunctions(); } - /** @see com.ibm.wala.dataflow.IFDS.TabulationProblem#getDomain() */ + /** + * @see com.ibm.wala.dataflow.IFDS.TabulationProblem#getDomain() + */ @Override public TabulationDomain getDomain() { // a dummy return new UnorderedDomain<>(); } - /** @see com.ibm.wala.dataflow.IFDS.TabulationProblem#getFunctionMap() */ + /** + * @see com.ibm.wala.dataflow.IFDS.TabulationProblem#getFunctionMap() + */ @Override public IPartiallyBalancedFlowFunctions getFunctionMap() { return f; } - /** @see com.ibm.wala.dataflow.IFDS.TabulationProblem#getMergeFunction() */ + /** + * @see com.ibm.wala.dataflow.IFDS.TabulationProblem#getMergeFunction() + */ @Override public IMergeFunction getMergeFunction() { return null; } - /** @see com.ibm.wala.dataflow.IFDS.TabulationProblem#getSupergraph() */ + /** + * @see com.ibm.wala.dataflow.IFDS.TabulationProblem#getSupergraph() + */ @Override public ISupergraph> getSupergraph() { return supergraph; diff --git a/core/src/main/java/com/ibm/wala/ipa/summaries/BypassMethodTargetSelector.java b/core/src/main/java/com/ibm/wala/ipa/summaries/BypassMethodTargetSelector.java index 9b16a33f8f..75aa992c69 100644 --- a/core/src/main/java/com/ibm/wala/ipa/summaries/BypassMethodTargetSelector.java +++ b/core/src/main/java/com/ibm/wala/ipa/summaries/BypassMethodTargetSelector.java @@ -259,7 +259,9 @@ public SSAInstruction[] getStatements() { } } - /** @return true iff we can treat m as a no-op method */ + /** + * @return true iff we can treat m as a no-op method + */ protected boolean canIgnore(MemberReference m) { TypeReference T = m.getDeclaringClass(); TypeName n = T.getName(); diff --git a/core/src/main/java/com/ibm/wala/ipa/summaries/BypassSyntheticClass.java b/core/src/main/java/com/ibm/wala/ipa/summaries/BypassSyntheticClass.java index 58aaa6ecad..7f86a65bfa 100644 --- a/core/src/main/java/com/ibm/wala/ipa/summaries/BypassSyntheticClass.java +++ b/core/src/main/java/com/ibm/wala/ipa/summaries/BypassSyntheticClass.java @@ -57,13 +57,17 @@ public BypassSyntheticClass(IClass realType, IClassLoader loader, IClassHierarch this.realType = realType; } - /** @see com.ibm.wala.classLoader.IClass#getClassLoader() */ + /** + * @see com.ibm.wala.classLoader.IClass#getClassLoader() + */ @Override public IClassLoader getClassLoader() { return loader; } - /** @see com.ibm.wala.classLoader.IClass#getSuperclass() */ + /** + * @see com.ibm.wala.classLoader.IClass#getSuperclass() + */ @Override public IClass getSuperclass() { if (realType.isInterface()) { @@ -76,7 +80,9 @@ public IClass getSuperclass() { } else return realType; } - /** @see com.ibm.wala.classLoader.IClass#getAllImplementedInterfaces() */ + /** + * @see com.ibm.wala.classLoader.IClass#getAllImplementedInterfaces() + */ @Override public Collection getAllImplementedInterfaces() { Collection realIfaces = realType.getAllImplementedInterfaces(); @@ -89,49 +95,65 @@ public Collection getAllImplementedInterfaces() { } } - /** @see com.ibm.wala.classLoader.IClass#getMethod(Selector) */ + /** + * @see com.ibm.wala.classLoader.IClass#getMethod(Selector) + */ @Override public IMethod getMethod(Selector selector) { return realType.getMethod(selector); } - /** @see com.ibm.wala.classLoader.IClass#getMethod(Selector) */ + /** + * @see com.ibm.wala.classLoader.IClass#getMethod(Selector) + */ @Override public IField getField(Atom name) { return realType.getField(name); } - /** @see com.ibm.wala.classLoader.IClass#getSourceFileName() */ + /** + * @see com.ibm.wala.classLoader.IClass#getSourceFileName() + */ @Override public String getSourceFileName() { return realType.getSourceFileName(); } - /** @see com.ibm.wala.classLoader.IClass#getClassInitializer() */ + /** + * @see com.ibm.wala.classLoader.IClass#getClassInitializer() + */ @Override public IMethod getClassInitializer() { return null; } - /** @see com.ibm.wala.classLoader.IClass#getDeclaredMethods() */ + /** + * @see com.ibm.wala.classLoader.IClass#getDeclaredMethods() + */ @Override public Collection getDeclaredMethods() { return realType.getDeclaredMethods(); } - /** @see com.ibm.wala.classLoader.IClass#getDeclaredInstanceFields() */ + /** + * @see com.ibm.wala.classLoader.IClass#getDeclaredInstanceFields() + */ @Override public Collection getDeclaredInstanceFields() { return realType.getDeclaredInstanceFields(); } - /** @see com.ibm.wala.classLoader.IClass#getDeclaredStaticFields() */ + /** + * @see com.ibm.wala.classLoader.IClass#getDeclaredStaticFields() + */ @Override public Collection getDeclaredStaticFields() { return realType.getDeclaredStaticFields(); } - /** @see com.ibm.wala.classLoader.IClass#isInterface() */ + /** + * @see com.ibm.wala.classLoader.IClass#isInterface() + */ public boolean isSyntheticImplentor() { return realType.isInterface(); } @@ -166,45 +188,59 @@ public int hashCode() { return realType.hashCode() * 1621; } - /** @see com.ibm.wala.classLoader.IClass#getModifiers() */ + /** + * @see com.ibm.wala.classLoader.IClass#getModifiers() + */ @Override public int getModifiers() throws UnimplementedError { Assertions.UNREACHABLE(); return 0; } - /** @see com.ibm.wala.classLoader.IClass#isReferenceType() */ + /** + * @see com.ibm.wala.classLoader.IClass#isReferenceType() + */ @Override public boolean isReferenceType() { return getReference().isReferenceType(); } - /** @see com.ibm.wala.classLoader.IClass#getDirectInterfaces() */ + /** + * @see com.ibm.wala.classLoader.IClass#getDirectInterfaces() + */ @Override public Collection getDirectInterfaces() throws UnimplementedError { Assertions.UNREACHABLE(); return null; } - /** @see com.ibm.wala.classLoader.IClass#getAllInstanceFields() */ + /** + * @see com.ibm.wala.classLoader.IClass#getAllInstanceFields() + */ @Override public Collection getAllInstanceFields() { return realType.getAllInstanceFields(); } - /** @see com.ibm.wala.classLoader.IClass#getAllStaticFields() */ + /** + * @see com.ibm.wala.classLoader.IClass#getAllStaticFields() + */ @Override public Collection getAllStaticFields() { return realType.getAllStaticFields(); } - /** @see com.ibm.wala.classLoader.IClass#getAllMethods() */ + /** + * @see com.ibm.wala.classLoader.IClass#getAllMethods() + */ @Override public Collection getAllMethods() { return realType.getAllMethods(); } - /** @see com.ibm.wala.classLoader.IClass#getAllFields() */ + /** + * @see com.ibm.wala.classLoader.IClass#getAllFields() + */ @Override public Collection getAllFields() { return realType.getAllFields(); diff --git a/core/src/main/java/com/ibm/wala/ipa/summaries/BypassSyntheticClassLoader.java b/core/src/main/java/com/ibm/wala/ipa/summaries/BypassSyntheticClassLoader.java index 8d9e37d474..ef7bdf915f 100644 --- a/core/src/main/java/com/ibm/wala/ipa/summaries/BypassSyntheticClassLoader.java +++ b/core/src/main/java/com/ibm/wala/ipa/summaries/BypassSyntheticClassLoader.java @@ -110,19 +110,25 @@ public ClassLoaderReference getReference() { return me; } - /** @return an Iterator of all classes loaded by this loader */ + /** + * @return an Iterator of all classes loaded by this loader + */ @Override public Iterator iterateAllClasses() { return syntheticClasses.values().iterator(); } - /** @return the number of classes in scope to be loaded by this loader */ + /** + * @return the number of classes in scope to be loaded by this loader + */ @Override public int getNumberOfClasses() { return syntheticClasses.size(); } - /** @return the unique name that identifies this class loader. */ + /** + * @return the unique name that identifies this class loader. + */ @Override public Atom getName() { return me.getName(); diff --git a/core/src/main/java/com/ibm/wala/ipa/summaries/LambdaSummaryClass.java b/core/src/main/java/com/ibm/wala/ipa/summaries/LambdaSummaryClass.java index 9ed9ba17e8..033de31fe6 100644 --- a/core/src/main/java/com/ibm/wala/ipa/summaries/LambdaSummaryClass.java +++ b/core/src/main/java/com/ibm/wala/ipa/summaries/LambdaSummaryClass.java @@ -112,13 +112,17 @@ public IClass getSuperclass() { return getClassHierarchy().getRootClass(); } - /** @return singleton set containing the relevant functional interface */ + /** + * @return singleton set containing the relevant functional interface + */ @Override public Collection getDirectInterfaces() { return Collections.singleton(getClassHierarchy().lookupClass(invoke.getDeclaredResultType())); } - /** @return relevant functional interface and all of its super-interfaces */ + /** + * @return relevant functional interface and all of its super-interfaces + */ @Override public Collection getAllImplementedInterfaces() { IClass iface = getClassHierarchy().lookupClass(invoke.getDeclaredResultType()); diff --git a/core/src/main/java/com/ibm/wala/ipa/summaries/MethodSummary.java b/core/src/main/java/com/ibm/wala/ipa/summaries/MethodSummary.java index 08090844d4..2b191a9056 100644 --- a/core/src/main/java/com/ibm/wala/ipa/summaries/MethodSummary.java +++ b/core/src/main/java/com/ibm/wala/ipa/summaries/MethodSummary.java @@ -134,7 +134,9 @@ public Map getConstants() { return constantValues; } - /** @return the number of parameters, including the implicit 'this' */ + /** + * @return the number of parameters, including the implicit 'this' + */ public int getNumberOfParameters() { if (numberOfParameters >= 0) { return numberOfParameters; diff --git a/core/src/main/java/com/ibm/wala/ipa/summaries/SummarizedMethod.java b/core/src/main/java/com/ibm/wala/ipa/summaries/SummarizedMethod.java index 602ecf2273..ddc9bda3f6 100644 --- a/core/src/main/java/com/ibm/wala/ipa/summaries/SummarizedMethod.java +++ b/core/src/main/java/com/ibm/wala/ipa/summaries/SummarizedMethod.java @@ -36,13 +36,17 @@ public SummarizedMethod(MethodReference ref, MethodSummary summary, IClass decla } } - /** @see com.ibm.wala.classLoader.IMethod#isNative() */ + /** + * @see com.ibm.wala.classLoader.IMethod#isNative() + */ @Override public boolean isNative() { return summary.isNative(); } - /** @see com.ibm.wala.classLoader.IMethod#isAbstract() */ + /** + * @see com.ibm.wala.classLoader.IMethod#isAbstract() + */ @Override public boolean isAbstract() { return false; @@ -84,19 +88,25 @@ public IR makeIR(Context context, SSAOptions options) { summary.getConstants()); } - /** @see com.ibm.wala.classLoader.IMethod#getNumberOfParameters() */ + /** + * @see com.ibm.wala.classLoader.IMethod#getNumberOfParameters() + */ @Override public int getNumberOfParameters() { return summary.getNumberOfParameters(); } - /** @see com.ibm.wala.classLoader.IMethod#isStatic() */ + /** + * @see com.ibm.wala.classLoader.IMethod#isStatic() + */ @Override public boolean isStatic() { return summary.isStatic(); } - /** @see com.ibm.wala.classLoader.IMethod#getParameterType(int) */ + /** + * @see com.ibm.wala.classLoader.IMethod#getParameterType(int) + */ @Override public TypeReference getParameterType(int i) { return summary.getParameterType(i); diff --git a/core/src/main/java/com/ibm/wala/ipa/summaries/VolatileMethodSummary.java b/core/src/main/java/com/ibm/wala/ipa/summaries/VolatileMethodSummary.java index 89a47d2a06..7f9a1fbb4d 100644 --- a/core/src/main/java/com/ibm/wala/ipa/summaries/VolatileMethodSummary.java +++ b/core/src/main/java/com/ibm/wala/ipa/summaries/VolatileMethodSummary.java @@ -328,6 +328,7 @@ public MethodSummary getMethodSummary() { return this.summary; } + // /** // * Re-enable write access to VolatileMethodSummary (CAUTION...). // * diff --git a/core/src/main/java/com/ibm/wala/ipa/summaries/XMLMethodSummaryReader.java b/core/src/main/java/com/ibm/wala/ipa/summaries/XMLMethodSummaryReader.java index eb6d4e5723..56e59c8deb 100644 --- a/core/src/main/java/com/ibm/wala/ipa/summaries/XMLMethodSummaryReader.java +++ b/core/src/main/java/com/ibm/wala/ipa/summaries/XMLMethodSummaryReader.java @@ -217,12 +217,16 @@ public Map getSummaries() { return summaries; } - /** @return Set of TypeReferences marked "allocatable" */ + /** + * @return Set of TypeReferences marked "allocatable" + */ public Set getAllocatableClasses() { return allocatable; } - /** @return Set of Atoms representing ignorable packages */ + /** + * @return Set of Atoms representing ignorable packages + */ public Set getIgnoredPackages() { return ignoredPackages; } diff --git a/core/src/main/java/com/ibm/wala/ssa/ConstantValue.java b/core/src/main/java/com/ibm/wala/ssa/ConstantValue.java index 0a12430271..8cec6eca01 100644 --- a/core/src/main/java/com/ibm/wala/ssa/ConstantValue.java +++ b/core/src/main/java/com/ibm/wala/ssa/ConstantValue.java @@ -26,7 +26,9 @@ public ConstantValue(double constant) { this(Double.valueOf(constant)); } - /** @return an object which represents the constant value */ + /** + * @return an object which represents the constant value + */ public Object getValue() { return constant; } @@ -41,28 +43,38 @@ public boolean isStringConstant() { return constant instanceof String; } - /** @return true iff this constant is "false" */ + /** + * @return true iff this constant is "false" + */ public boolean isFalseConstant() { return (constant instanceof Boolean) && constant.equals(Boolean.FALSE); } - /** @return true iff this constant is "true" */ + /** + * @return true iff this constant is "true" + */ public boolean isTrueConstant() { return (constant instanceof Boolean) && constant.equals(Boolean.TRUE); } - /** @return true iff this constant is "zero" */ + /** + * @return true iff this constant is "zero" + */ public boolean isZeroConstant() { return ((constant instanceof Number) && (((Number) constant).intValue() == 0)); } - /** @return true iff this constant is "null" */ + /** + * @return true iff this constant is "null" + */ @Override public boolean isNullConstant() { return (constant == null); } - /** @return true iff this constant is "one" */ + /** + * @return true iff this constant is "one" + */ public boolean isOneConstant() { return ((constant instanceof Number) && (((Number) constant).intValue() == 1)); } diff --git a/core/src/main/java/com/ibm/wala/ssa/DefUse.java b/core/src/main/java/com/ibm/wala/ssa/DefUse.java index c47ccc3b42..9db53da17c 100644 --- a/core/src/main/java/com/ibm/wala/ssa/DefUse.java +++ b/core/src/main/java/com/ibm/wala/ssa/DefUse.java @@ -81,7 +81,9 @@ public DefUse(final IR ir) { } } - /** @return the maximum value number in a particular IR */ + /** + * @return the maximum value number in a particular IR + */ protected int getMaxValueNumber() { return ir.getSymbolTable().getMaxValueNumber(); } @@ -113,7 +115,9 @@ protected int getNumberOfUses(SSAInstruction s) { return s.getNumberOfUses(); } - /** @return the {@link SSAInstruction} that defines the variable with value number v. */ + /** + * @return the {@link SSAInstruction} that defines the variable with value number v. + */ public SSAInstruction getDef(int v) { return (v < defs.length) ? defs[v] : null; } @@ -131,7 +135,9 @@ public Iterator getUses(int v) { private class UseIterator implements Iterator { final IntIterator it; - /** @param uses the set of value numbers whose uses this object iterates over */ + /** + * @param uses the set of value numbers whose uses this object iterates over + */ UseIterator(IntSet uses) { it = uses.intIterator(); } diff --git a/core/src/main/java/com/ibm/wala/ssa/IR.java b/core/src/main/java/com/ibm/wala/ssa/IR.java index f00c132ae9..1c0b3fa39c 100644 --- a/core/src/main/java/com/ibm/wala/ssa/IR.java +++ b/core/src/main/java/com/ibm/wala/ssa/IR.java @@ -260,13 +260,17 @@ public SSAInstruction[] getInstructions() { return instructions; } - /** @return the {@link SymbolTable} managing attributes for values in this method */ + /** + * @return the {@link SymbolTable} managing attributes for values in this method + */ @Override public SymbolTable getSymbolTable() { return symbolTable; } - /** @return the underlying {@link ControlFlowGraph} which defines this IR. */ + /** + * @return the underlying {@link ControlFlowGraph} which defines this IR. + */ @Override public SSACFG getControlFlowGraph() { return cfg; @@ -353,12 +357,16 @@ private void advanceBlock() { } } - /** @return array of value numbers representing parameters to this method */ + /** + * @return array of value numbers representing parameters to this method + */ public int[] getParameterValueNumbers() { return symbolTable.getParameterValueNumbers(); } - /** @return the value number of the ith parameter */ + /** + * @return the value number of the ith parameter + */ public int getParameter(int i) { return symbolTable.getParameter(i); } @@ -371,18 +379,24 @@ public TypeReference getParameterType(int i) { return method.getParameterType(i); } - /** @return number of parameters to this method, including "this" */ + /** + * @return number of parameters to this method, including "this" + */ public int getNumberOfParameters() { return method.getNumberOfParameters(); } - /** @return the method this IR represents */ + /** + * @return the method this IR represents + */ @Override public IMethod getMethod() { return method; } - /** @return iterator of the catch instructions in this IR */ + /** + * @return iterator of the catch instructions in this IR + */ public Iterator iterateCatchInstructions() { return new CatchIterator(); } @@ -448,7 +462,9 @@ public void visitAllInstructions(SSAInstruction.IVisitor v) { } } - /** @return an {@link Iterator} of all "normal" instructions on this IR */ + /** + * @return an {@link Iterator} of all "normal" instructions on this IR + */ public Iterator iterateNormalInstructions() { return new NormalIterator(); } @@ -490,7 +506,9 @@ public SSAInstruction next() { } } - /** @return an {@link Iterator} of all instructions (Normal, Phi, and Catch) */ + /** + * @return an {@link Iterator} of all instructions (Normal, Phi, and Catch) + */ public Iterator iterateAllInstructions() { return new CompoundIterator<>( iterateNormalInstructions(), @@ -498,7 +516,9 @@ public Iterator iterateAllInstructions() { iterateCatchInstructions(), new CompoundIterator<>(iteratePhis(), iteratePis()))); } - /** @return the exit basic block */ + /** + * @return the exit basic block + */ @Override public BasicBlock getExitBlock() { return cfg.exit(); @@ -573,7 +593,9 @@ public Iterator iterateNewSites() { return newSiteMapping.keySet().iterator(); } - /** @return an {@link Iterator} of all the call sites ( {@link CallSiteReference}s ) in this IR */ + /** + * @return an {@link Iterator} of all the call sites ( {@link CallSiteReference}s ) in this IR + */ @Override public Iterator iterateCallSites() { return new Iterator<>() { @@ -586,7 +608,8 @@ public Iterator iterateCallSites() { } private void advance() { - while (callSiteMapping.getRelatedCount(++i) == 0 && i <= limit) ; + while (callSiteMapping.getRelatedCount(++i) == 0 && i <= limit) + ; } @Override @@ -706,7 +729,9 @@ public ISSABasicBlock getBasicBlockForCatch(SSAGetCaughtExceptionInstruction ins return cfg.getBasicBlock(bb); } - /** @return the {@link SSAOptions} which controlled how this {@code IR} was built */ + /** + * @return the {@link SSAOptions} which controlled how this {@code IR} was built + */ public SSAOptions getOptions() { return options; } diff --git a/core/src/main/java/com/ibm/wala/ssa/ISSABasicBlock.java b/core/src/main/java/com/ibm/wala/ssa/ISSABasicBlock.java index 4fcc0a8a64..cc9594dec5 100644 --- a/core/src/main/java/com/ibm/wala/ssa/ISSABasicBlock.java +++ b/core/src/main/java/com/ibm/wala/ssa/ISSABasicBlock.java @@ -30,15 +30,23 @@ public interface ISSABasicBlock extends IBasicBlock { @Override boolean isEntryBlock(); - /** @return the phi instructions incoming to this block */ + /** + * @return the phi instructions incoming to this block + */ Iterator iteratePhis(); - /** @return the pi instructions incoming to this block */ + /** + * @return the pi instructions incoming to this block + */ Iterator iteratePis(); - /** @return the last instruction in this block. */ + /** + * @return the last instruction in this block. + */ SSAInstruction getLastInstruction(); - /** @return the set of exception types this block may catch. */ + /** + * @return the set of exception types this block may catch. + */ Iterator getCaughtExceptionTypes(); } diff --git a/core/src/main/java/com/ibm/wala/ssa/PhiValue.java b/core/src/main/java/com/ibm/wala/ssa/PhiValue.java index 428f6ddeba..0795774ed2 100644 --- a/core/src/main/java/com/ibm/wala/ssa/PhiValue.java +++ b/core/src/main/java/com/ibm/wala/ssa/PhiValue.java @@ -19,7 +19,9 @@ public class PhiValue implements Value { /** The phi instruction that defines this value */ private final SSAPhiInstruction phi; - /** @param phi The phi instruction that defines this value */ + /** + * @param phi The phi instruction that defines this value + */ PhiValue(SSAPhiInstruction phi) { this.phi = phi; } @@ -29,7 +31,9 @@ public String toString() { return "v" + phi.getDef(); } - /** @return The phi instruction that defines this value */ + /** + * @return The phi instruction that defines this value + */ public SSAPhiInstruction getPhiInstruction() { return phi; } diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAAbstractBinaryInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAAbstractBinaryInstruction.java index ebd4089071..63dc49c88b 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAAbstractBinaryInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAAbstractBinaryInstruction.java @@ -41,7 +41,9 @@ public int getDef(int i) { return result; } - /** @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() + */ @Override public int getNumberOfDefs() { return 1; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAAbstractInvokeInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAAbstractInvokeInstruction.java index f59cf29b07..deee2030e7 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAAbstractInvokeInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAAbstractInvokeInstruction.java @@ -40,7 +40,9 @@ protected SSAAbstractInvokeInstruction(int iindex, int exception, CallSiteRefere this.site = site; } - /** @return The call site, containing the program counter location and the method being called. */ + /** + * @return The call site, containing the program counter location and the method being called. + */ public CallSiteReference getCallSite() { return site; } @@ -63,13 +65,17 @@ public boolean isSpecial() { return getCallSite().isSpecial(); } - /** @return the value number of the receiver of a virtual call */ + /** + * @return the value number of the receiver of a virtual call + */ public int getReceiver() { assert site.getInvocationCode() != IInvokeInstruction.Dispatch.STATIC : toString(); return getUse(0); } - /** @return the program counter (index into the method's bytecode) for this call site. */ + /** + * @return the program counter (index into the method's bytecode) for this call site. + */ public int getProgramCounter() { return site.getProgramCounter(); } @@ -133,7 +139,9 @@ public MethodReference getDeclaredTarget() { return site.getDeclaredTarget(); } - /** @see com.ibm.wala.classLoader.CallSiteReference#getInvocationCode() */ + /** + * @see com.ibm.wala.classLoader.CallSiteReference#getInvocationCode() + */ public IInvokeInstruction.IDispatch getInvocationCode() { return site.getInvocationCode(); } diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAAbstractThrowInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAAbstractThrowInstruction.java index f139887319..e9e3883f44 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAAbstractThrowInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAAbstractThrowInstruction.java @@ -54,7 +54,9 @@ public boolean isFallThrough() { return false; } - /** @return value number of the thrown exception object. */ + /** + * @return value number of the thrown exception object. + */ public int getException() { return exception; } diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAAbstractUnaryInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAAbstractUnaryInstruction.java index 06789ad803..b58a486199 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAAbstractUnaryInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAAbstractUnaryInstruction.java @@ -24,7 +24,9 @@ protected SSAAbstractUnaryInstruction(int iindex, int result, int val) { this.val = val; } - /** @see com.ibm.wala.ssa.SSAInstruction#getDef() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getDef() + */ @Override public boolean hasDef() { return true; @@ -41,7 +43,9 @@ public int getDef(int i) { return result; } - /** @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() + */ @Override public int getNumberOfDefs() { return 1; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAArrayLoadInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAArrayLoadInstruction.java index 24f56b56fa..cc01748f04 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAArrayLoadInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAArrayLoadInstruction.java @@ -61,7 +61,9 @@ public void visit(IVisitor v) { v.visitArrayLoad(this); } - /** @see com.ibm.wala.ssa.SSAInstruction#getDef() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getDef() + */ @Override public boolean hasDef() { return true; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAArrayReferenceInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAArrayReferenceInstruction.java index 059471da7f..682eb7a19d 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAArrayReferenceInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAArrayReferenceInstruction.java @@ -56,7 +56,9 @@ public TypeReference getElementType() { return elementType; } - /** @return true iff this represents an array access of a primitive type element */ + /** + * @return true iff this represents an array access of a primitive type element + */ public boolean typeIsPrimitive() { return elementType.isPrimitiveType(); } diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAArrayStoreInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAArrayStoreInstruction.java index db4999c0bf..cb2cabbd2e 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAArrayStoreInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAArrayStoreInstruction.java @@ -58,7 +58,9 @@ public void visit(IVisitor v) { v.visitArrayStore(this); } - /** @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() + */ @Override public int getNumberOfUses() { return 3; @@ -73,7 +75,9 @@ public int getValue() { return value; } - /** @see com.ibm.wala.ssa.SSAInstruction#getUse(int) */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getUse(int) + */ @Override public int getUse(int j) { if (j == 2) return value; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSABinaryOpInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSABinaryOpInstruction.java index 4b6ee5aefa..c41d99a70d 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSABinaryOpInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSABinaryOpInstruction.java @@ -49,7 +49,9 @@ public String toString(SymbolTable symbolTable) { + getValueString(symbolTable, val2); } - /** @see com.ibm.wala.ssa.SSAInstruction#visit(IVisitor) */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#visit(IVisitor) + */ @Override public void visit(IVisitor v) throws NullPointerException { v.visitBinaryOp(this); @@ -60,7 +62,9 @@ public IBinaryOpInstruction.IOperator getOperator() { return operator; } - /** @see com.ibm.wala.ssa.SSAInstruction#isPEI() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#isPEI() + */ @Override public boolean isPEI() { return mayBeInteger @@ -68,7 +72,9 @@ public boolean isPEI() { || operator == BinaryOpInstruction.Operator.REM); } - /** @see com.ibm.wala.ssa.SSAInstruction#isFallThrough() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#isFallThrough() + */ @Override public boolean isFallThrough() { return true; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSABuilder.java b/core/src/main/java/com/ibm/wala/ssa/SSABuilder.java index 28d4a2211d..05b04acb78 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSABuilder.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSABuilder.java @@ -567,7 +567,9 @@ public void visitConversion(IConversionInstruction instruction) { instruction.throwsExceptionOnOverflow())); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) + */ @Override public void visitGet(IGetInstruction instruction) { int result = reuseOrCreateDef(); @@ -592,7 +594,9 @@ public void visitGet(IGetInstruction instruction) { workingState.push(result); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGoto(GotoInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGoto(GotoInstruction) + */ @Override public void visitGoto(com.ibm.wala.shrike.shrikeBT.GotoInstruction instruction) { emitInstruction( @@ -613,7 +617,9 @@ public void visitInstanceof(IInstanceofInstruction instruction) { emitInstruction(insts.InstanceofInstruction(getCurrentInstructionIndex(), result, ref, t)); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitInvoke(IInvokeInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitInvoke(IInvokeInstruction) + */ @Override public void visitInvoke(IInvokeInstruction instruction) { doIndirectReads(bytecodeIndirections.indirectlyReadLocals(getCurrentInstructionIndex())); @@ -679,7 +685,9 @@ public void visitLocalStore(IStoreInstruction instruction) { super.visitLocalStore(instruction); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitMonitor(MonitorInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitMonitor(MonitorInstruction) + */ @Override public void visitMonitor(com.ibm.wala.shrike.shrikeBT.MonitorInstruction instruction) { @@ -688,7 +696,9 @@ public void visitMonitor(com.ibm.wala.shrike.shrikeBT.MonitorInstruction instruc insts.MonitorInstruction(getCurrentInstructionIndex(), ref, instruction.isEnter())); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitNew(NewInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitNew(NewInstruction) + */ @Override public void visitNew(com.ibm.wala.shrike.shrikeBT.NewInstruction instruction) { int result = reuseOrCreateDef(); @@ -707,7 +717,9 @@ public void visitNew(com.ibm.wala.shrike.shrikeBT.NewInstruction instruction) { workingState.push(result); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) + */ @Override public void visitPut(IPutInstruction instruction) { int value = workingState.pop(); @@ -731,7 +743,9 @@ public void visitPut(IPutInstruction instruction) { } } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitReturn(ReturnInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitReturn(ReturnInstruction) + */ @Override public void visitReturn(com.ibm.wala.shrike.shrikeBT.ReturnInstruction instruction) { if (instruction.getPoppedCount() == 1) { @@ -744,7 +758,9 @@ public void visitReturn(com.ibm.wala.shrike.shrikeBT.ReturnInstruction instructi } } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitShift(IShiftInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitShift(IShiftInstruction) + */ @Override public void visitShift(IShiftInstruction instruction) { int val2 = workingState.pop(); @@ -763,7 +779,9 @@ public void visitShift(IShiftInstruction instruction) { true)); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitSwitch(SwitchInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitSwitch(SwitchInstruction) + */ @Override public void visitSwitch(com.ibm.wala.shrike.shrikeBT.SwitchInstruction instruction) { int val = workingState.pop(); @@ -807,7 +825,9 @@ private int findRethrowException() { } } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitThrow(ThrowInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitThrow(ThrowInstruction) + */ @Override public void visitThrow(com.ibm.wala.shrike.shrikeBT.ThrowInstruction instruction) { if (instruction.isRethrow()) { @@ -1084,6 +1104,7 @@ private int[] setLocal(int[] locals, int localNumber, int valueNumber) { return locals; } + /** * @param pc a program counter (index into ShrikeBT instruction array) * @param vn a value number @@ -1108,7 +1129,9 @@ private int[] findLocalsForValueNumber(int pc, int vn) { return locals == null ? null : extractIndices(locals, vn); } - /** @return the indices i s.t. x[i] == y, or null if none found. */ + /** + * @return the indices i s.t. x[i] == y, or null if none found. + */ private static int[] extractIndices(int[] x, int y) { assert x != null; int count = 0; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSACFG.java b/core/src/main/java/com/ibm/wala/ssa/SSACFG.java index 331518ae60..f3160b586d 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSACFG.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSACFG.java @@ -86,7 +86,9 @@ public class SSACFG /** cache a ref to the exit block for efficient access */ private BasicBlock exit; - /** @throws IllegalArgumentException if method is null */ + /** + * @throws IllegalArgumentException if method is null + */ @SuppressWarnings("unchecked") public SSACFG(IMethod method, AbstractCFG cfg, SSAInstruction[] instructions) { if (method == null) { @@ -555,18 +557,24 @@ public Iterator iterator() { return getAllInstructions().iterator(); } - /** @return true iff this basic block has at least one phi */ + /** + * @return true iff this basic block has at least one phi + */ public boolean hasPhi() { return stackSlotPhis != null || localPhis != null; } - /** @see com.ibm.wala.util.graph.INodeWithNumber#getGraphNodeId() */ + /** + * @see com.ibm.wala.util.graph.INodeWithNumber#getGraphNodeId() + */ @Override public int getGraphNodeId() { return number; } - /** @see com.ibm.wala.util.graph.INodeWithNumber#setGraphNodeId(int) */ + /** + * @see com.ibm.wala.util.graph.INodeWithNumber#setGraphNodeId(int) + */ @Override public void setGraphNodeId(int number) { // TODO Auto-generated method stub @@ -616,13 +624,17 @@ public int hashCode() { return delegate.getNode(getNumber()).hashCode() * 6271; } - /** @see com.ibm.wala.cfg.IBasicBlock#isExitBlock() */ + /** + * @see com.ibm.wala.cfg.IBasicBlock#isExitBlock() + */ @Override public boolean isExitBlock() { return this == SSACFG.this.exit(); } - /** @see com.ibm.wala.cfg.IBasicBlock#isEntryBlock() */ + /** + * @see com.ibm.wala.cfg.IBasicBlock#isEntryBlock() + */ @Override public boolean isEntryBlock() { return this == SSACFG.this.entry(); @@ -769,19 +781,25 @@ public int getNumber(ISSABasicBlock b) throws IllegalArgumentException { return b.getNumber(); } - /** @see com.ibm.wala.util.graph.NumberedGraph#getNode(int) */ + /** + * @see com.ibm.wala.util.graph.NumberedGraph#getNode(int) + */ @Override public BasicBlock getNode(int number) { return basicBlocks[number]; } - /** @see com.ibm.wala.util.graph.NumberedGraph#getMaxNumber() */ + /** + * @see com.ibm.wala.util.graph.NumberedGraph#getMaxNumber() + */ @Override public int getMaxNumber() { return basicBlocks.length - 1; } - /** @see com.ibm.wala.util.graph.Graph#iterator() */ + /** + * @see com.ibm.wala.util.graph.Graph#iterator() + */ @Override public Iterator iterator() { return Arrays.asList(basicBlocks).iterator(); @@ -792,13 +810,17 @@ public Stream stream() { return Arrays.stream(basicBlocks); } - /** @see com.ibm.wala.util.graph.Graph#getNumberOfNodes() */ + /** + * @see com.ibm.wala.util.graph.Graph#getNumberOfNodes() + */ @Override public int getNumberOfNodes() { return delegate.getNumberOfNodes(); } - /** @see com.ibm.wala.util.graph.Graph#getPredNodes(Object) */ + /** + * @see com.ibm.wala.util.graph.Graph#getPredNodes(Object) + */ @Override public Iterator getPredNodes(ISSABasicBlock b) throws IllegalArgumentException { if (b == null) { @@ -826,7 +848,9 @@ public void remove() { }; } - /** @see com.ibm.wala.util.graph.Graph#getPredNodeCount(Object) */ + /** + * @see com.ibm.wala.util.graph.Graph#getPredNodeCount(Object) + */ @Override public int getPredNodeCount(ISSABasicBlock b) throws IllegalArgumentException { if (b == null) { @@ -836,7 +860,9 @@ public int getPredNodeCount(ISSABasicBlock b) throws IllegalArgumentException { return delegate.getPredNodeCount(n); } - /** @see com.ibm.wala.util.graph.Graph#getSuccNodes(Object) */ + /** + * @see com.ibm.wala.util.graph.Graph#getSuccNodes(Object) + */ @Override public Iterator getSuccNodes(ISSABasicBlock b) throws IllegalArgumentException { if (b == null) { @@ -864,7 +890,9 @@ public void remove() { }; } - /** @see com.ibm.wala.util.graph.Graph#getSuccNodeCount(Object) */ + /** + * @see com.ibm.wala.util.graph.Graph#getSuccNodeCount(Object) + */ @Override public int getSuccNodeCount(ISSABasicBlock b) throws IllegalArgumentException { if (b == null) { @@ -874,7 +902,9 @@ public int getSuccNodeCount(ISSABasicBlock b) throws IllegalArgumentException { return delegate.getSuccNodeCount(n); } - /** @see com.ibm.wala.util.graph.NumberedGraph#addNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NumberedGraph#addNode(Object) + */ @Override public void addNode(ISSABasicBlock n) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -891,19 +921,25 @@ public void removeEdge(ISSABasicBlock src, ISSABasicBlock dst) throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) + */ @Override public void removeAllIncidentEdges(ISSABasicBlock node) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.util.graph.Graph#removeNode(Object) */ + /** + * @see com.ibm.wala.util.graph.Graph#removeNode(Object) + */ @Override public void removeNodeAndEdges(ISSABasicBlock N) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } - /** @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) + */ @Override public void removeNode(ISSABasicBlock n) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -915,7 +951,9 @@ public int getProgramCounter(int index) { return delegate.getProgramCounter(index); } - /** @see com.ibm.wala.util.graph.Graph#containsNode(Object) */ + /** + * @see com.ibm.wala.util.graph.Graph#containsNode(Object) + */ @Override public boolean containsNode(ISSABasicBlock N) { if (N instanceof BasicBlock) { @@ -944,7 +982,9 @@ public List getExceptionalSuccessors(final ISSABasicBlock b) { return c; } - /** @see com.ibm.wala.cfg.ControlFlowGraph#getExceptionalSuccessors(Object) */ + /** + * @see com.ibm.wala.cfg.ControlFlowGraph#getExceptionalSuccessors(Object) + */ @Override public Collection getExceptionalPredecessors(ISSABasicBlock b) { if (b == null) { @@ -1007,7 +1047,9 @@ public Collection getNormalSuccessors(ISSABasicBlock b) { return c; } - /** @see com.ibm.wala.cfg.ControlFlowGraph#getNormalSuccessors(Object) */ + /** + * @see com.ibm.wala.cfg.ControlFlowGraph#getNormalSuccessors(Object) + */ @Override public Collection getNormalPredecessors(ISSABasicBlock b) { if (b == null) { @@ -1083,7 +1125,9 @@ public static ExceptionLoadFailure create(TypeReference type, IMethod method) { } } - /** @return the basic block with a particular number */ + /** + * @return the basic block with a particular number + */ public BasicBlock getBasicBlock(int bb) { return basicBlocks[bb]; } diff --git a/core/src/main/java/com/ibm/wala/ssa/SSACache.java b/core/src/main/java/com/ibm/wala/ssa/SSACache.java index 517d7beada..1be4eb384a 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSACache.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSACache.java @@ -34,7 +34,9 @@ public class SSACache { /** A cache of DefUse information */ private final IAuxiliaryCache duCache; - /** @param factory a factory for creating IRs */ + /** + * @param factory a factory for creating IRs + */ public SSACache(IRFactory factory, IAuxiliaryCache irCache, IAuxiliaryCache duCache) { this.factory = factory; this.irCache = irCache; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSACheckCastInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSACheckCastInstruction.java index 80af132331..84f73d5c09 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSACheckCastInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSACheckCastInstruction.java @@ -92,7 +92,9 @@ public boolean hasDef() { return true; } - /** @return A new value number def'fed by this instruction when the type check succeeds. */ + /** + * @return A new value number def'fed by this instruction when the type check succeeds. + */ @Override public int getDef() { return result; @@ -104,7 +106,9 @@ public int getDef(int i) { return result; } - /** @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() + */ @Override public int getNumberOfDefs() { return 1; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAComparisonInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAComparisonInstruction.java index fdc3e8333a..cef1913c63 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAComparisonInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAComparisonInstruction.java @@ -62,7 +62,9 @@ public void visit(IVisitor v) throws NullPointerException { v.visitComparison(this); } - /** @see com.ibm.wala.ssa.SSAInstruction#getDef() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getDef() + */ @Override public boolean hasDef() { return true; @@ -79,7 +81,9 @@ public int getDef(int i) { return result; } - /** @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() + */ @Override public int getNumberOfDefs() { return 1; @@ -106,7 +110,9 @@ public boolean isFallThrough() { return true; } - /** @return Returns the opcode. */ + /** + * @return Returns the opcode. + */ public IComparisonInstruction.Operator getOperator() { return operator; } diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAConversionInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAConversionInstruction.java index 262f55570e..1c75164e9b 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAConversionInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAConversionInstruction.java @@ -45,7 +45,9 @@ public void visit(IVisitor v) throws NullPointerException { v.visitConversion(this); } - /** @see com.ibm.wala.ssa.SSAInstruction#getDef() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getDef() + */ @Override public boolean hasDef() { return true; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAGetCaughtExceptionInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAGetCaughtExceptionInstruction.java index 92504241fe..acc67be989 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAGetCaughtExceptionInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAGetCaughtExceptionInstruction.java @@ -57,7 +57,9 @@ public int getException() { return exceptionValueNumber; } - /** @see com.ibm.wala.ssa.SSAInstruction#getDef() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getDef() + */ @Override public boolean hasDef() { return true; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAGetInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAGetInstruction.java index 390e809364..948f6a803d 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAGetInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAGetInstruction.java @@ -53,13 +53,17 @@ public String toString(SymbolTable symbolTable) { } } - /** @see com.ibm.wala.ssa.SSAInstruction#visit(IVisitor) */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#visit(IVisitor) + */ @Override public void visit(IVisitor v) throws NullPointerException { v.visitGet(this); } - /** @see com.ibm.wala.ssa.SSAInstruction#getDef() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getDef() + */ @Override public boolean hasDef() { return true; @@ -76,7 +80,9 @@ public int getDef(int i) { return result; } - /** @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() + */ @Override public int getNumberOfDefs() { return 1; @@ -87,7 +93,9 @@ public int getNumberOfUses() { return isStatic() ? 0 : 1; } - /** @see com.ibm.wala.ssa.SSAInstruction#getUse(int) */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getUse(int) + */ @Override public int getUse(int j) { assert j == 0 && getRef() != -1; @@ -99,7 +107,9 @@ public int hashCode() { return result * 2371 + 6521; } - /** @see com.ibm.wala.ssa.SSAInstruction#isFallThrough() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#isFallThrough() + */ @Override public boolean isFallThrough() { return true; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAIndirectionData.java b/core/src/main/java/com/ibm/wala/ssa/SSAIndirectionData.java index e9824dbeb0..3ca98ec44f 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAIndirectionData.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAIndirectionData.java @@ -91,6 +91,8 @@ interface Name {} */ int getUse(int instructionIndex, T name); - /** @see #getUse */ + /** + * @see #getUse + */ void setUse(int instructionIndex, T name, int newUse); } diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAInstanceofInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAInstanceofInstruction.java index 90647d03bf..2e4a433789 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAInstanceofInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAInstanceofInstruction.java @@ -56,7 +56,9 @@ public void visit(IVisitor v) throws NullPointerException { v.visitInstanceof(this); } - /** @see com.ibm.wala.ssa.SSAInstruction#getDef() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getDef() + */ @Override public boolean hasDef() { return true; @@ -77,7 +79,9 @@ public TypeReference getCheckedType() { return checkedType; } - /** @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() + */ @Override public int getNumberOfDefs() { return 1; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAInstruction.java index 0dc0df8936..b7cc14c862 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAInstruction.java @@ -228,7 +228,9 @@ public int getUse(@SuppressWarnings("unused") int j) throws UnsupportedOperation @Override public abstract int hashCode(); - /** @return true iff this instruction may throw an exception. */ + /** + * @return true iff this instruction may throw an exception. + */ public boolean isPEI() { return false; } @@ -244,7 +246,9 @@ public Collection getExceptionTypes() { return Collections.emptySet(); } - /** @return true iff this instruction may fall through to the next */ + /** + * @return true iff this instruction may fall through to the next + */ public abstract boolean isFallThrough(); /** diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAInvokeInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAInvokeInstruction.java index 4077350ece..edd63d4abd 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAInvokeInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAInvokeInstruction.java @@ -94,7 +94,9 @@ public void visit(IVisitor v) { v.visitInvoke(this); } - /** @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() + */ @Override public int getNumberOfUses() { if (params == null) { @@ -124,7 +126,9 @@ public int getReturnValue(int i) { return result; } - /** @see com.ibm.wala.ssa.SSAInstruction#getUse(int) */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getUse(int) + */ @Override public int getUse(int j) { if (params == null) { diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAMonitorInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAMonitorInstruction.java index 9bc052dfdb..e82225996f 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAMonitorInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAMonitorInstruction.java @@ -73,7 +73,9 @@ public boolean isFallThrough() { return true; } - /** @return The value number of the object being locked or unlocked */ + /** + * @return The value number of the object being locked or unlocked + */ public int getRef() { return ref; } diff --git a/core/src/main/java/com/ibm/wala/ssa/SSANewInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSANewInstruction.java index 471ad5d8be..823ae363e6 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSANewInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSANewInstruction.java @@ -101,7 +101,9 @@ public void visit(IVisitor v) { v.visitNew(this); } - /** @see com.ibm.wala.ssa.SSAInstruction#getDef() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getDef() + */ @Override public boolean hasDef() { return true; @@ -123,7 +125,9 @@ public int getNumberOfDefs() { return 1; } - /** @return TypeReference */ + /** + * @return TypeReference + */ public TypeReference getConcreteType() { return site.getDeclaredType(); } diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAOptions.java b/core/src/main/java/com/ibm/wala/ssa/SSAOptions.java index 300789f122..44e6384ef6 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAOptions.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAOptions.java @@ -46,7 +46,9 @@ public DefaultValues getDefaultValues() { return defaultValues; } - /** @return the default SSA Options */ + /** + * @return the default SSA Options + */ public static SSAOptions defaultOptions() { return defaultOptions; } diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAPhiInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAPhiInstruction.java index 8de032e4a7..584d2de221 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAPhiInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAPhiInstruction.java @@ -85,7 +85,9 @@ public void visit(IVisitor v) { v.visitPhi(this); } - /** @see com.ibm.wala.ssa.SSAInstruction#getDef() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getDef() + */ @Override public boolean hasDef() { return true; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAPutInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAPutInstruction.java index ed128ccc3a..1e9e0f5ae7 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAPutInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAPutInstruction.java @@ -65,13 +65,17 @@ public void visit(IVisitor v) { v.visitPut(this); } - /** @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getNumberOfUses() + */ @Override public int getNumberOfUses() { return isStatic() ? 1 : 2; } - /** @see com.ibm.wala.ssa.SSAInstruction#getUse(int) */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#getUse(int) + */ @Override public int getUse(int j) { assert j == 0 || (!isStatic() && j == 1); @@ -87,7 +91,9 @@ public int hashCode() { return val * 9929 ^ 2063; } - /** @see com.ibm.wala.ssa.SSAInstruction#isFallThrough() */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#isFallThrough() + */ @Override public boolean isFallThrough() { return true; diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAReturnInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAReturnInstruction.java index cad65410c1..e8be933b55 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAReturnInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAReturnInstruction.java @@ -72,7 +72,9 @@ public int getUse(int j) { return result; } - /** @return true iff this return instruction returns a primitive value */ + /** + * @return true iff this return instruction returns a primitive value + */ public boolean returnsPrimitiveType() { return isPrimitive; } diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAThrowInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAThrowInstruction.java index 729b357005..13524eec9a 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAThrowInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAThrowInstruction.java @@ -30,7 +30,9 @@ public SSAInstruction copyForSSA(SSAInstructionFactory insts, int[] defs, int[] return insts.ThrowInstruction(iIndex(), uses == null ? getException() : uses[0]); } - /** @see com.ibm.wala.ssa.SSAInstruction#visit(IVisitor) */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#visit(IVisitor) + */ @Override public void visit(IVisitor v) throws NullPointerException { v.visitThrow(this); diff --git a/core/src/main/java/com/ibm/wala/ssa/SSAUnaryOpInstruction.java b/core/src/main/java/com/ibm/wala/ssa/SSAUnaryOpInstruction.java index c60c4e8954..690965f47e 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SSAUnaryOpInstruction.java +++ b/core/src/main/java/com/ibm/wala/ssa/SSAUnaryOpInstruction.java @@ -49,7 +49,9 @@ public String toString(SymbolTable symbolTable) { + getValueString(symbolTable, val); } - /** @see com.ibm.wala.ssa.SSAInstruction#visit(IVisitor) */ + /** + * @see com.ibm.wala.ssa.SSAInstruction#visit(IVisitor) + */ @Override public void visit(IVisitor v) throws NullPointerException { v.visitUnaryOp(this); diff --git a/core/src/main/java/com/ibm/wala/ssa/SymbolTable.java b/core/src/main/java/com/ibm/wala/ssa/SymbolTable.java index 447918804c..356c63bd30 100644 --- a/core/src/main/java/com/ibm/wala/ssa/SymbolTable.java +++ b/core/src/main/java/com/ibm/wala/ssa/SymbolTable.java @@ -35,7 +35,9 @@ public class SymbolTable implements Cloneable { private boolean copy = false; - /** @param numberOfParameters in the IR .. should be ir.getNumberOfParameters() */ + /** + * @param numberOfParameters in the IR .. should be ir.getNumberOfParameters() + */ public SymbolTable(int numberOfParameters) { if (numberOfParameters < 0) { throw new IllegalArgumentException("Illegal numberOfParameters: " + numberOfParameters); @@ -342,7 +344,9 @@ public boolean isNullConstant(int v) { } } - /** @throws IllegalArgumentException if rhs is null */ + /** + * @throws IllegalArgumentException if rhs is null + */ public int newPhi(int[] rhs) throws IllegalArgumentException { if (rhs == null) { throw new IllegalArgumentException("rhs is null"); @@ -436,7 +440,9 @@ public Value getValue(int valueNumber) { return values[valueNumber]; } - /** @return true iff this valueNumber is a parameter */ + /** + * @return true iff this valueNumber is a parameter + */ public boolean isParameter(int valueNumber) { return valueNumber <= getNumberOfParameters(); } diff --git a/core/src/main/java/com/ibm/wala/ssa/analysis/DeadAssignmentElimination.java b/core/src/main/java/com/ibm/wala/ssa/analysis/DeadAssignmentElimination.java index 745bf2c7e7..8620ea5ddc 100644 --- a/core/src/main/java/com/ibm/wala/ssa/analysis/DeadAssignmentElimination.java +++ b/core/src/main/java/com/ibm/wala/ssa/analysis/DeadAssignmentElimination.java @@ -156,7 +156,9 @@ protected void initializeWorkList() { addAllStatementsToWorkList(); } - /** @return true iff there are no uses of the given value number */ + /** + * @return true iff there are no uses of the given value number + */ private boolean isDead(int value) { Integer V = value; if (trivialDead.contains(V)) { diff --git a/core/src/main/java/com/ibm/wala/ssa/analysis/ExplodedControlFlowGraph.java b/core/src/main/java/com/ibm/wala/ssa/analysis/ExplodedControlFlowGraph.java index 14af70f8c5..4496da6a5d 100644 --- a/core/src/main/java/com/ibm/wala/ssa/analysis/ExplodedControlFlowGraph.java +++ b/core/src/main/java/com/ibm/wala/ssa/analysis/ExplodedControlFlowGraph.java @@ -345,7 +345,9 @@ public int getSuccNodeCount(IExplodedBasicBlock N) throws UnimplementedError { return Iterator2Collection.toSet(getSuccNodes(N)).size(); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) + */ @Override public Iterator getSuccNodes(IExplodedBasicBlock bb) { ExplodedBasicBlock eb = (ExplodedBasicBlock) bb; diff --git a/core/src/main/java/com/ibm/wala/types/ClassLoaderReference.java b/core/src/main/java/com/ibm/wala/types/ClassLoaderReference.java index d9938eb379..9ef1df5fa8 100644 --- a/core/src/main/java/com/ibm/wala/types/ClassLoaderReference.java +++ b/core/src/main/java/com/ibm/wala/types/ClassLoaderReference.java @@ -55,17 +55,23 @@ public ClassLoaderReference(Atom name, Atom language, ClassLoaderReference paren this.parent = parent; } - /** @return the name of this class loader */ + /** + * @return the name of this class loader + */ public Atom getName() { return name; } - /** @return the name of the language this class loader belongs to */ + /** + * @return the name of the language this class loader belongs to + */ public Atom getLanguage() { return language; } - /** @return the parent of this loader in the loader hierarchy, or null if none */ + /** + * @return the parent of this loader in the loader hierarchy, or null if none + */ public ClassLoaderReference getParent() { return parent; } diff --git a/core/src/main/java/com/ibm/wala/types/Descriptor.java b/core/src/main/java/com/ibm/wala/types/Descriptor.java index 17c0527201..91e241c8cb 100644 --- a/core/src/main/java/com/ibm/wala/types/Descriptor.java +++ b/core/src/main/java/com/ibm/wala/types/Descriptor.java @@ -89,7 +89,9 @@ public static Descriptor findOrCreateUTF8(Language l, String s) throws IllegalAr return findOrCreate(l, new ImmutableByteArray(b)); } - /** @param key "value" of this descriptor */ + /** + * @param key "value" of this descriptor + */ private Descriptor(Key key) { this.key = key; } @@ -109,22 +111,30 @@ public String toString() { return key.toString(); } - /** @return a unicode string representation of this descriptor */ + /** + * @return a unicode string representation of this descriptor + */ public String toUnicodeString() { return key.toUnicodeString(); } - /** @return the name of the return type of this descriptor */ + /** + * @return the name of the return type of this descriptor + */ public TypeName getReturnType() { return key.returnType; } - /** @return the type names for the parameters in this descriptor */ + /** + * @return the type names for the parameters in this descriptor + */ public TypeName[] getParameters() { return key.parameters; } - /** @return number of parameters in this descriptor */ + /** + * @return number of parameters in this descriptor + */ public int getNumberOfParameters() { return key.parameters == null ? 0 : key.parameters.length; } diff --git a/core/src/main/java/com/ibm/wala/types/FieldReference.java b/core/src/main/java/com/ibm/wala/types/FieldReference.java index 9ebb203f8b..191593c9be 100644 --- a/core/src/main/java/com/ibm/wala/types/FieldReference.java +++ b/core/src/main/java/com/ibm/wala/types/FieldReference.java @@ -76,7 +76,9 @@ private FieldReference(Key key, TypeReference fieldType) { } } - /** @return the descriptor component of this member reference */ + /** + * @return the descriptor component of this member reference + */ public TypeReference getFieldType() { return fieldType; } diff --git a/core/src/main/java/com/ibm/wala/types/MemberReference.java b/core/src/main/java/com/ibm/wala/types/MemberReference.java index 141500b623..f72ead4fa9 100644 --- a/core/src/main/java/com/ibm/wala/types/MemberReference.java +++ b/core/src/main/java/com/ibm/wala/types/MemberReference.java @@ -30,7 +30,9 @@ protected MemberReference(TypeReference type, Atom name, int hash) { this.hash = hash; } - /** @return the member name component of this member reference */ + /** + * @return the member name component of this member reference + */ public final Atom getName() { return name; } @@ -48,7 +50,9 @@ public final boolean equals(Object other) { return this == other; } - /** @return the type that declared this member */ + /** + * @return the type that declared this member + */ public TypeReference getDeclaringClass() { if (declaringClass == null) { // fail eagerly diff --git a/core/src/main/java/com/ibm/wala/types/MethodReference.java b/core/src/main/java/com/ibm/wala/types/MethodReference.java index bd9a3fcded..92535f800c 100644 --- a/core/src/main/java/com/ibm/wala/types/MethodReference.java +++ b/core/src/main/java/com/ibm/wala/types/MethodReference.java @@ -156,7 +156,9 @@ public static MethodReference findOrCreate( return findOrCreate(t, name, d); } - /** @return the descriptor component of this member reference */ + /** + * @return the descriptor component of this member reference + */ public Descriptor getDescriptor() { return selector.getDescriptor(); } @@ -192,12 +194,16 @@ public String toString() { returnType = TypeReference.findOrCreate(getDeclaringClass().getClassLoader(), r); } - /** @return return type of the method */ + /** + * @return return type of the method + */ public TypeReference getReturnType() { return returnType; } - /** @return ith parameter to the method. This does NOT include the implicit "this" pointer. */ + /** + * @return ith parameter to the method. This does NOT include the implicit "this" pointer. + */ public TypeReference getParameterType(int i) throws IllegalArgumentException { if (parameterTypes == null || i >= parameterTypes.length) { throw new IllegalArgumentException("illegal parameter number " + i + " for " + this); diff --git a/core/src/main/java/com/ibm/wala/types/TypeName.java b/core/src/main/java/com/ibm/wala/types/TypeName.java index 45f1139268..7cd3ca7e21 100644 --- a/core/src/main/java/com/ibm/wala/types/TypeName.java +++ b/core/src/main/java/com/ibm/wala/types/TypeName.java @@ -143,7 +143,9 @@ public static TypeName findOrCreateClassName(String packageName, String classNam return findOrCreateClass(p, c); } - /** @return the name of the array element type for an array */ + /** + * @return the name of the array element type for an array + */ public TypeName parseForArrayElementName() { int newDim; if ((key.dim & ElementMask) == PrimitiveMask) { @@ -160,7 +162,9 @@ public TypeName parseForArrayElementName() { return findOrCreate(key.packageName, key.className, newDim); } - /** @return a type name that represents an array of this element type */ + /** + * @return a type name that represents an array of this element type + */ private TypeName getDerivedTypeForElementType(byte mask) { int newDim; if (key.dim == -1) { @@ -334,12 +338,16 @@ public String toUnicodeString() { } } - /** @return the Atom naming the package for this type. */ + /** + * @return the Atom naming the package for this type. + */ public Atom getPackage() { return key.packageName; } - /** @return the Atom naming the class for this type (without package) */ + /** + * @return the Atom naming the class for this type (without package) + */ public Atom getClassName() { return key.className; } diff --git a/core/src/main/java/com/ibm/wala/types/TypeReference.java b/core/src/main/java/com/ibm/wala/types/TypeReference.java index 7806ce14d9..a7d0bebcb7 100644 --- a/core/src/main/java/com/ibm/wala/types/TypeReference.java +++ b/core/src/main/java/com/ibm/wala/types/TypeReference.java @@ -553,12 +553,16 @@ private TypeReference(ClassLoaderReference cl, TypeName tn) { name = tn; } - /** @return the classloader component of this type reference */ + /** + * @return the classloader component of this type reference + */ public ClassLoaderReference getClassLoader() { return classloader; } - /** @return the type name component of this type reference */ + /** + * @return the type name component of this type reference + */ public TypeName getName() { return name; } diff --git a/core/src/main/java/com/ibm/wala/types/annotations/TypeAnnotation.java b/core/src/main/java/com/ibm/wala/types/annotations/TypeAnnotation.java index 292e4c9c0d..68a26860b4 100644 --- a/core/src/main/java/com/ibm/wala/types/annotations/TypeAnnotation.java +++ b/core/src/main/java/com/ibm/wala/types/annotations/TypeAnnotation.java @@ -469,7 +469,9 @@ public CatchTarget(int catchIIndex, TypeReference catchType) { this.catchType = catchType; } - /** @return the handlers type, or {@link CatchTarget#ALL_EXCEPTIONS} */ + /** + * @return the handlers type, or {@link CatchTarget#ALL_EXCEPTIONS} + */ public TypeReference getCatchType() { return catchType; } @@ -965,7 +967,9 @@ public TypeAnnotationTarget visitTypeArgumentTarget( }; } - /** @return the {@link Annotation} of this {@code TypeAnnotation} */ + /** + * @return the {@link Annotation} of this {@code TypeAnnotation} + */ public Annotation getAnnotation() { return annotation; } @@ -979,12 +983,16 @@ public List> getTypePath() { return typePath; } - /** @return the {@link TypeAnnotationTarget} of this {@code TypeAnnotation} */ + /** + * @return the {@link TypeAnnotationTarget} of this {@code TypeAnnotation} + */ public TypeAnnotationTarget getTypeAnnotationTarget() { return typeAnnotationTarget; } - /** @return the {@link TargetType} of this {@code TypeAnnotation} */ + /** + * @return the {@link TargetType} of this {@code TypeAnnotation} + */ public TargetType getTargetType() { return targetType; } diff --git a/core/src/main/java/com/ibm/wala/types/generics/ClassSignature.java b/core/src/main/java/com/ibm/wala/types/generics/ClassSignature.java index fae365f4f9..b8a379174d 100644 --- a/core/src/main/java/com/ibm/wala/types/generics/ClassSignature.java +++ b/core/src/main/java/com/ibm/wala/types/generics/ClassSignature.java @@ -39,7 +39,9 @@ public static ClassSignature make(String sig) { return new ClassSignature(sig); } - /** @return the formal type parameters, or null if none */ + /** + * @return the formal type parameters, or null if none + */ public FormalTypeParameter[] getFormalTypeParameters() { if (rawString().charAt(0) != '<') { // no formal type parameters @@ -114,7 +116,9 @@ private int endOfFormalTypeParameters() { return i; } - /** @return the class signature, or null if none */ + /** + * @return the class signature, or null if none + */ public static ClassSignature getClassSignature(IClass klass) throws InvalidClassFileException { if (klass instanceof ShrikeClass) { ShrikeClass sc = (ShrikeClass) klass; diff --git a/core/src/main/java/com/ibm/wala/types/generics/FormalTypeParameter.java b/core/src/main/java/com/ibm/wala/types/generics/FormalTypeParameter.java index 9c7cfea853..d0666b9a5d 100644 --- a/core/src/main/java/com/ibm/wala/types/generics/FormalTypeParameter.java +++ b/core/src/main/java/com/ibm/wala/types/generics/FormalTypeParameter.java @@ -156,7 +156,9 @@ public TypeSignature[] getInterfaceBounds() { return interfaceBounds; } - /** @return the formal type parameters, or null if none */ + /** + * @return the formal type parameters, or null if none + */ public static FormalTypeParameter[] getTypeParameters(IClass klass) throws InvalidClassFileException { if (klass instanceof ShrikeClass) { diff --git a/core/src/main/java/com/ibm/wala/types/generics/MethodTypeSignature.java b/core/src/main/java/com/ibm/wala/types/generics/MethodTypeSignature.java index f44bd9c61d..9b67c7924e 100644 --- a/core/src/main/java/com/ibm/wala/types/generics/MethodTypeSignature.java +++ b/core/src/main/java/com/ibm/wala/types/generics/MethodTypeSignature.java @@ -39,7 +39,9 @@ public static MethodTypeSignature make(String genericsSignature) throws IllegalA return new MethodTypeSignature(genericsSignature); } - /** @return null if no arguments */ + /** + * @return null if no arguments + */ public TypeSignature[] getArguments() { String typeSig = rawString().replaceAll(".*\\(", "\\(").replaceAll("\\).*", "\\)"); String[] args = TypeSignature.parseForTypeSignatures(typeSig); @@ -91,7 +93,9 @@ private int endOfFormalTypeParameters() { return i; } - /** @return {@link TypeSignature} for arguments, which includes information about generic types */ + /** + * @return {@link TypeSignature} for arguments, which includes information about generic types + */ public static TypeSignature[] getArguments(IMethod method) throws InvalidClassFileException { if (method instanceof ShrikeCTMethod) { ShrikeCTMethod sm = (ShrikeCTMethod) method; diff --git a/core/src/main/java/com/ibm/wala/types/generics/TypeArgument.java b/core/src/main/java/com/ibm/wala/types/generics/TypeArgument.java index 798ae960b2..4164093c80 100644 --- a/core/src/main/java/com/ibm/wala/types/generics/TypeArgument.java +++ b/core/src/main/java/com/ibm/wala/types/generics/TypeArgument.java @@ -135,9 +135,11 @@ static String[] parseForTypeArguments(String typeArgs) { ++i; } if (typeArgs.charAt(i) == TypeReference.ClassTypeCode) { - while (typeArgs.charAt(i++) != ';') ; + while (typeArgs.charAt(i++) != ';') + ; } else if (typeArgs.charAt(i++) == (byte) 'T') { - while (typeArgs.charAt(i++) != ';') ; + while (typeArgs.charAt(i++) != ';') + ; } args.add(typeArgs.substring(off, i)); continue; @@ -147,7 +149,8 @@ static String[] parseForTypeArguments(String typeArgs) { case (byte) 'T': { // type variable int off = i - 1; - while (typeArgs.charAt(i++) != ';') ; + while (typeArgs.charAt(i++) != ';') + ; args.add(typeArgs.substring(off, i)); continue; } diff --git a/core/src/main/java/com/ibm/wala/types/generics/TypeSignature.java b/core/src/main/java/com/ibm/wala/types/generics/TypeSignature.java index 30baf9eb59..a6672e029c 100644 --- a/core/src/main/java/com/ibm/wala/types/generics/TypeSignature.java +++ b/core/src/main/java/com/ibm/wala/types/generics/TypeSignature.java @@ -168,7 +168,8 @@ static String[] parseForTypeSignatures(String typeSigs) throws IllegalArgumentEx case (byte) 'T': { // type variable int off = i - 1; - while (typeSigs.charAt(i++) != ';') ; + while (typeSigs.charAt(i++) != ';') + ; sigs.add(typeSigs.substring(off, i)); continue; } diff --git a/core/src/main/java/com/ibm/wala/types/generics/TypeVariableSignature.java b/core/src/main/java/com/ibm/wala/types/generics/TypeVariableSignature.java index 355ab44ab4..5aa2df4b13 100644 --- a/core/src/main/java/com/ibm/wala/types/generics/TypeVariableSignature.java +++ b/core/src/main/java/com/ibm/wala/types/generics/TypeVariableSignature.java @@ -62,7 +62,9 @@ public boolean isBaseType() { return false; } - /** @return -1 if there is no match */ + /** + * @return -1 if there is no match + */ public static int getTypeVariablePosition(TypeVariableSignature v, ShrikeClass klass) throws IllegalArgumentException { if (klass == null) { diff --git a/core/src/test/java/com/ibm/wala/core/tests/arraybounds/PruneArrayOutOfBoundExceptionEdge.java b/core/src/test/java/com/ibm/wala/core/tests/arraybounds/PruneArrayOutOfBoundExceptionEdge.java index a381fc1a42..01e17e37bb 100644 --- a/core/src/test/java/com/ibm/wala/core/tests/arraybounds/PruneArrayOutOfBoundExceptionEdge.java +++ b/core/src/test/java/com/ibm/wala/core/tests/arraybounds/PruneArrayOutOfBoundExceptionEdge.java @@ -66,6 +66,7 @@ public class PruneArrayOutOfBoundExceptionEdge { PruneArrayOutOfBoundExceptionEdge.class.getClassLoader(); private static final String DETECTABLE_TESTDATA = "Larraybounds/Detectable"; + /** * The number of Basic Blocks, which have an exception edge, that should be removed. (#[array * access] + #[other]) @@ -73,6 +74,7 @@ public class PruneArrayOutOfBoundExceptionEdge { private static final int DETECTABLE_EXPECTED_COUNT = 34 + 2; private static final String NOT_DETECTABLE_TESTDATA = "Larraybounds/NotDetectable"; + /** * The number of Basic Blocks, which have an exception edge, that should be removed. (#[array * access] + #[other]) @@ -80,6 +82,7 @@ public class PruneArrayOutOfBoundExceptionEdge { private static final int NOT_DETECTABLE_EXPECTED_COUNT = 0 + 3; private static final String NOT_IN_BOUND_TESTDATA = "Larraybounds/NotInBound"; + /** * The number of Basic Blocks, which have an exception edge, that should be removed. (#[array * access] + #[other]) diff --git a/core/src/test/java/com/ibm/wala/core/tests/basic/GraphDataflowTest.java b/core/src/test/java/com/ibm/wala/core/tests/basic/GraphDataflowTest.java index fc832a8e41..2a73e8c301 100644 --- a/core/src/test/java/com/ibm/wala/core/tests/basic/GraphDataflowTest.java +++ b/core/src/test/java/com/ibm/wala/core/tests/basic/GraphDataflowTest.java @@ -71,7 +71,9 @@ public void testSolverNodeOnly() throws CancelException { assertEquals(expectedStringNodeOnly(), result); } - /** @return the expected dataflow result as a String */ + /** + * @return the expected dataflow result as a String + */ public static String expectedStringNodeOnly() { return "------\n" + "Node A(0) = { 0 }\n" @@ -96,7 +98,9 @@ public static String expectedStringNodeEdge() { + "Node H(7) = { 7 }\n"; } - /** @return a graph with the expected structure */ + /** + * @return a graph with the expected structure + */ public static Graph buildGraph() { Graph G = SlowSparseNumberedGraph.make(); for (int i = 0; i < nodeNames.length(); i++) { diff --git a/core/src/test/java/com/ibm/wala/core/tests/callGraph/Java7CallGraphTest.java b/core/src/test/java/com/ibm/wala/core/tests/callGraph/Java7CallGraphTest.java index c93213ddd3..2c19234c8e 100644 --- a/core/src/test/java/com/ibm/wala/core/tests/callGraph/Java7CallGraphTest.java +++ b/core/src/test/java/com/ibm/wala/core/tests/callGraph/Java7CallGraphTest.java @@ -51,8 +51,14 @@ protected Path getTemporaryDirectory() { @Test public void testOcamlHelloHash() - throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException, - ClassNotFoundException, InvalidClassFileException, FailureException, SecurityException, + throws ClassHierarchyException, + IllegalArgumentException, + CancelException, + IOException, + ClassNotFoundException, + InvalidClassFileException, + FailureException, + SecurityException, InterruptedException { // Known to be broken on Windows, but not intentionally so. Please fix if you know how! // @@ -64,8 +70,14 @@ public void testOcamlHelloHash() } private void testOCamlJar(String jarFile, String... args) - throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException, - ClassNotFoundException, InvalidClassFileException, FailureException, SecurityException, + throws ClassHierarchyException, + IllegalArgumentException, + CancelException, + IOException, + ClassNotFoundException, + InvalidClassFileException, + FailureException, + SecurityException, InterruptedException { File F = TemporaryFile.urlToFile( diff --git a/core/src/test/java/com/ibm/wala/core/tests/exceptionpruning/ExceptionAnalysis2EdgeFilterTest.java b/core/src/test/java/com/ibm/wala/core/tests/exceptionpruning/ExceptionAnalysis2EdgeFilterTest.java index 9284babfec..eb1907d0d9 100644 --- a/core/src/test/java/com/ibm/wala/core/tests/exceptionpruning/ExceptionAnalysis2EdgeFilterTest.java +++ b/core/src/test/java/com/ibm/wala/core/tests/exceptionpruning/ExceptionAnalysis2EdgeFilterTest.java @@ -64,7 +64,9 @@ public class ExceptionAnalysis2EdgeFilterTest { @BeforeAll public static void init() - throws IOException, ClassHierarchyException, IllegalArgumentException, + throws IOException, + ClassHierarchyException, + IllegalArgumentException, CallGraphBuilderCancelException { AnalysisOptions options; AnalysisScope scope; diff --git a/core/src/test/java/com/ibm/wala/core/tests/exceptionpruning/ExceptionAnalysisTest.java b/core/src/test/java/com/ibm/wala/core/tests/exceptionpruning/ExceptionAnalysisTest.java index 49f43f3fae..d456325ee6 100644 --- a/core/src/test/java/com/ibm/wala/core/tests/exceptionpruning/ExceptionAnalysisTest.java +++ b/core/src/test/java/com/ibm/wala/core/tests/exceptionpruning/ExceptionAnalysisTest.java @@ -62,7 +62,9 @@ public class ExceptionAnalysisTest { @BeforeAll public static void init() - throws IOException, ClassHierarchyException, IllegalArgumentException, + throws IOException, + ClassHierarchyException, + IllegalArgumentException, CallGraphBuilderCancelException { AnalysisOptions options; AnalysisScope scope; diff --git a/core/src/test/java/com/ibm/wala/core/tests/shrike/DynamicCallGraphTest.java b/core/src/test/java/com/ibm/wala/core/tests/shrike/DynamicCallGraphTest.java index ed0fbddc69..80b6e61b12 100644 --- a/core/src/test/java/com/ibm/wala/core/tests/shrike/DynamicCallGraphTest.java +++ b/core/src/test/java/com/ibm/wala/core/tests/shrike/DynamicCallGraphTest.java @@ -54,8 +54,14 @@ private static CallGraph staticCG(String mainClass, String exclusionsFile) @Test public void testGraph() - throws IOException, ClassNotFoundException, InvalidClassFileException, FailureException, - SecurityException, IllegalArgumentException, ClassHierarchyException, CancelException, + throws IOException, + ClassNotFoundException, + InvalidClassFileException, + FailureException, + SecurityException, + IllegalArgumentException, + ClassHierarchyException, + CancelException, InterruptedException { instrument(testJarLocation); run("dynamicCG.MainClass", null); @@ -65,8 +71,14 @@ public void testGraph() @Test public void testCallbacks() - throws IOException, ClassNotFoundException, InvalidClassFileException, FailureException, - SecurityException, IllegalArgumentException, ClassHierarchyException, CancelException, + throws IOException, + ClassNotFoundException, + InvalidClassFileException, + FailureException, + SecurityException, + IllegalArgumentException, + ClassHierarchyException, + CancelException, InterruptedException { instrument(testJarLocation); run("dynamicCG.CallbacksMainClass", null); @@ -76,8 +88,14 @@ public void testCallbacks() @Test public void testExclusions() - throws IOException, ClassNotFoundException, InvalidClassFileException, FailureException, - SecurityException, IllegalArgumentException, ClassHierarchyException, CancelException, + throws IOException, + ClassNotFoundException, + InvalidClassFileException, + FailureException, + SecurityException, + IllegalArgumentException, + ClassHierarchyException, + CancelException, InterruptedException { instrument(testJarLocation); run("dynamicCG.MainClass", "ShrikeTestExclusions.txt"); @@ -87,8 +105,14 @@ public void testExclusions() @Test public void testLambdas() - throws IOException, ClassNotFoundException, InvalidClassFileException, FailureException, - SecurityException, IllegalArgumentException, ClassHierarchyException, CancelException, + throws IOException, + ClassNotFoundException, + InvalidClassFileException, + FailureException, + SecurityException, + IllegalArgumentException, + ClassHierarchyException, + CancelException, InterruptedException { instrument(testJarLocation); run("lambda.SortingExample", null); diff --git a/core/src/test/java/com/ibm/wala/core/tests/slicer/SlicerTest.java b/core/src/test/java/com/ibm/wala/core/tests/slicer/SlicerTest.java index 1fef81ccff..ccede85d0e 100644 --- a/core/src/test/java/com/ibm/wala/core/tests/slicer/SlicerTest.java +++ b/core/src/test/java/com/ibm/wala/core/tests/slicer/SlicerTest.java @@ -941,7 +941,10 @@ public void testTestMessageFormat() /** test for bug reported on mailing list by Joshua Garcia, 5/16/2010 */ @Test public void testTestInetAddr() - throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException, + throws ClassHierarchyException, + IllegalArgumentException, + CancelException, + IOException, UnsoundGraphException { AnalysisScope scope = findOrCreateAnalysisScope(); diff --git a/core/src/testSubjects/java/cfg/exc/intra/B.java b/core/src/testSubjects/java/cfg/exc/intra/B.java index 14c9430992..49870c0a1a 100644 --- a/core/src/testSubjects/java/cfg/exc/intra/B.java +++ b/core/src/testSubjects/java/cfg/exc/intra/B.java @@ -1,6 +1,8 @@ package cfg.exc.intra; -/** @author Martin Hecker */ +/** + * @author Martin Hecker + */ public class B { public int f; public B b; diff --git a/core/src/testSubjects/java/cornerCases/Abstract1.java b/core/src/testSubjects/java/cornerCases/Abstract1.java index f1ed007a91..c844d2c9f9 100644 --- a/core/src/testSubjects/java/cornerCases/Abstract1.java +++ b/core/src/testSubjects/java/cornerCases/Abstract1.java @@ -10,7 +10,9 @@ */ package cornerCases; -/** @author sfink */ +/** + * @author sfink + */ public abstract class Abstract1 { void foo() {} diff --git a/core/src/testSubjects/java/cornerCases/Abstract2.java b/core/src/testSubjects/java/cornerCases/Abstract2.java index aee32249a4..687bbacd33 100644 --- a/core/src/testSubjects/java/cornerCases/Abstract2.java +++ b/core/src/testSubjects/java/cornerCases/Abstract2.java @@ -10,7 +10,9 @@ */ package cornerCases; -/** @author sfink */ +/** + * @author sfink + */ public abstract class Abstract2 { void foo() {} diff --git a/core/src/testSubjects/java/cornerCases/Concrete2.java b/core/src/testSubjects/java/cornerCases/Concrete2.java index 2e49137c88..c51af2e3f2 100644 --- a/core/src/testSubjects/java/cornerCases/Concrete2.java +++ b/core/src/testSubjects/java/cornerCases/Concrete2.java @@ -10,5 +10,7 @@ */ package cornerCases; -/** @author sfink */ +/** + * @author sfink + */ public class Concrete2 extends Abstract2 {} diff --git a/core/src/testSubjects/java/demandpa/FlowsToTestArraySetIter.java b/core/src/testSubjects/java/demandpa/FlowsToTestArraySetIter.java index bc6b10120a..d54a553afb 100644 --- a/core/src/testSubjects/java/demandpa/FlowsToTestArraySetIter.java +++ b/core/src/testSubjects/java/demandpa/FlowsToTestArraySetIter.java @@ -10,7 +10,9 @@ */ package demandpa; -/** @author manu */ +/** + * @author manu + */ public class FlowsToTestArraySetIter { public static void main(String[] args) { diff --git a/core/src/testSubjects/java/demandpa/FlowsToTestFields.java b/core/src/testSubjects/java/demandpa/FlowsToTestFields.java index 57b4e8a189..e034f8046f 100644 --- a/core/src/testSubjects/java/demandpa/FlowsToTestFields.java +++ b/core/src/testSubjects/java/demandpa/FlowsToTestFields.java @@ -10,7 +10,9 @@ */ package demandpa; -/** @author manu */ +/** + * @author manu + */ public class FlowsToTestFields { public static void main(String[] args) { diff --git a/core/src/testSubjects/java/demandpa/FlowsToTestFieldsHarder.java b/core/src/testSubjects/java/demandpa/FlowsToTestFieldsHarder.java index a0fa0c7850..29f571e42e 100644 --- a/core/src/testSubjects/java/demandpa/FlowsToTestFieldsHarder.java +++ b/core/src/testSubjects/java/demandpa/FlowsToTestFieldsHarder.java @@ -10,7 +10,9 @@ */ package demandpa; -/** @author manu */ +/** + * @author manu + */ public class FlowsToTestFieldsHarder { public static void main(String[] args) { diff --git a/core/src/testSubjects/java/demandpa/FlowsToTestHashSet.java b/core/src/testSubjects/java/demandpa/FlowsToTestHashSet.java index 3f1551097f..892bc83dc9 100644 --- a/core/src/testSubjects/java/demandpa/FlowsToTestHashSet.java +++ b/core/src/testSubjects/java/demandpa/FlowsToTestHashSet.java @@ -10,7 +10,9 @@ */ package demandpa; -/** @author manu */ +/** + * @author manu + */ public class FlowsToTestHashSet { public static void main(String[] args) { diff --git a/core/src/testSubjects/java/demandpa/FlowsToTestId.java b/core/src/testSubjects/java/demandpa/FlowsToTestId.java index 82f80d767c..0d9be73803 100644 --- a/core/src/testSubjects/java/demandpa/FlowsToTestId.java +++ b/core/src/testSubjects/java/demandpa/FlowsToTestId.java @@ -10,7 +10,9 @@ */ package demandpa; -/** @author manu */ +/** + * @author manu + */ public class FlowsToTestId { static Object id(Object o) { diff --git a/core/src/testSubjects/java/demandpa/TestOnTheFlySimple.java b/core/src/testSubjects/java/demandpa/TestOnTheFlySimple.java index 32f0829223..db1f8fed7e 100644 --- a/core/src/testSubjects/java/demandpa/TestOnTheFlySimple.java +++ b/core/src/testSubjects/java/demandpa/TestOnTheFlySimple.java @@ -37,7 +37,9 @@ */ package demandpa; -/** @author manu */ +/** + * @author manu + */ public class TestOnTheFlySimple { static A makeA() { diff --git a/core/src/testSubjects/java/objSensitive/TestObjSensitive2.java b/core/src/testSubjects/java/objSensitive/TestObjSensitive2.java index e6bd21ffcf..8b98fb3591 100644 --- a/core/src/testSubjects/java/objSensitive/TestObjSensitive2.java +++ b/core/src/testSubjects/java/objSensitive/TestObjSensitive2.java @@ -9,6 +9,7 @@ * IBM Corporation - initial API and implementation */ package objSensitive; + /** test case for nObjBuilder */ public class TestObjSensitive2 { diff --git a/core/src/testSubjects/java/reflection/GetMethodContext.java b/core/src/testSubjects/java/reflection/GetMethodContext.java index 5889be0df8..11cb3212c2 100644 --- a/core/src/testSubjects/java/reflection/GetMethodContext.java +++ b/core/src/testSubjects/java/reflection/GetMethodContext.java @@ -49,7 +49,9 @@ public void bar() {} } public static void main(String[] args) - throws IllegalAccessException, NoSuchMethodException, IllegalArgumentException, + throws IllegalAccessException, + NoSuchMethodException, + IllegalArgumentException, InvocationTargetException { Method m; A a; diff --git a/core/src/testSubjects/java/reflection/Reflect10.java b/core/src/testSubjects/java/reflection/Reflect10.java index a387f7573e..69c334589c 100644 --- a/core/src/testSubjects/java/reflection/Reflect10.java +++ b/core/src/testSubjects/java/reflection/Reflect10.java @@ -16,8 +16,12 @@ /** Test of Method.invoke */ public class Reflect10 { public static void main(String[] args) - throws ClassNotFoundException, IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException, SecurityException, + throws ClassNotFoundException, + IllegalArgumentException, + InstantiationException, + IllegalAccessException, + InvocationTargetException, + SecurityException, NoSuchMethodException { Class c = Class.forName("java.lang.Integer"); Method[] m = c.getMethods(); diff --git a/core/src/testSubjects/java/reflection/Reflect11.java b/core/src/testSubjects/java/reflection/Reflect11.java index eb7c077a27..03e43e3302 100644 --- a/core/src/testSubjects/java/reflection/Reflect11.java +++ b/core/src/testSubjects/java/reflection/Reflect11.java @@ -16,8 +16,12 @@ /** Test of Method.invoke */ public class Reflect11 { public static void main(String[] args) - throws ClassNotFoundException, IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException, SecurityException, + throws ClassNotFoundException, + IllegalArgumentException, + InstantiationException, + IllegalAccessException, + InvocationTargetException, + SecurityException, NoSuchMethodException { Class c = Class.forName("java.lang.Integer"); Method[] m = c.getMethods(); diff --git a/core/src/testSubjects/java/reflection/Reflect12.java b/core/src/testSubjects/java/reflection/Reflect12.java index 32ef7291b6..99f6f786cc 100644 --- a/core/src/testSubjects/java/reflection/Reflect12.java +++ b/core/src/testSubjects/java/reflection/Reflect12.java @@ -16,8 +16,12 @@ /** Test of Method.invoke */ public class Reflect12 { public static void main(String[] args) - throws ClassNotFoundException, IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException, SecurityException, + throws ClassNotFoundException, + IllegalArgumentException, + InstantiationException, + IllegalAccessException, + InvocationTargetException, + SecurityException, NoSuchMethodException { Class c = Class.forName("reflection.Helper"); Method[] m = c.getMethods(); diff --git a/core/src/testSubjects/java/reflection/Reflect13.java b/core/src/testSubjects/java/reflection/Reflect13.java index 71dbcfdf8e..f4885eb05d 100644 --- a/core/src/testSubjects/java/reflection/Reflect13.java +++ b/core/src/testSubjects/java/reflection/Reflect13.java @@ -16,8 +16,12 @@ /** Test of Method.invoke */ public class Reflect13 { public static void main(String[] args) - throws ClassNotFoundException, IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException, SecurityException, + throws ClassNotFoundException, + IllegalArgumentException, + InstantiationException, + IllegalAccessException, + InvocationTargetException, + SecurityException, NoSuchMethodException { Class c = Class.forName("reflection.Helper"); Method[] m = c.getMethods(); diff --git a/core/src/testSubjects/java/reflection/Reflect14.java b/core/src/testSubjects/java/reflection/Reflect14.java index 99a467f61d..9b5ca128ea 100644 --- a/core/src/testSubjects/java/reflection/Reflect14.java +++ b/core/src/testSubjects/java/reflection/Reflect14.java @@ -17,8 +17,12 @@ /** Test of Method.invoke */ public class Reflect14 { public static void main(String[] args) - throws ClassNotFoundException, IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException, SecurityException, + throws ClassNotFoundException, + IllegalArgumentException, + InstantiationException, + IllegalAccessException, + InvocationTargetException, + SecurityException, NoSuchMethodException { Class c = Class.forName("reflection.Helper"); Method[] ms = c.getMethods(); diff --git a/core/src/testSubjects/java/reflection/Reflect15.java b/core/src/testSubjects/java/reflection/Reflect15.java index df8230a1e2..f71c39c41a 100644 --- a/core/src/testSubjects/java/reflection/Reflect15.java +++ b/core/src/testSubjects/java/reflection/Reflect15.java @@ -16,8 +16,11 @@ /** Test of Class.getConstructors(). */ public class Reflect15 { public static void main(String[] args) - throws ClassNotFoundException, IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException { + throws ClassNotFoundException, + IllegalArgumentException, + InstantiationException, + IllegalAccessException, + InvocationTargetException { Class c = Class.forName("reflection.Helper"); Constructor[] ctors = c.getConstructors(); Helper h = null; diff --git a/core/src/testSubjects/java/reflection/Reflect16.java b/core/src/testSubjects/java/reflection/Reflect16.java index dfe851f3d3..3fdba23760 100644 --- a/core/src/testSubjects/java/reflection/Reflect16.java +++ b/core/src/testSubjects/java/reflection/Reflect16.java @@ -16,8 +16,12 @@ /** Test of Method.invoke */ public class Reflect16 { public static void main(String[] args) - throws ClassNotFoundException, IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException, SecurityException, + throws ClassNotFoundException, + IllegalArgumentException, + InstantiationException, + IllegalAccessException, + InvocationTargetException, + SecurityException, NoSuchMethodException { Class c = Class.forName("reflection.Helper"); Method m = c.getDeclaredMethod("t", new Class[] {Integer.class, Integer.class}); diff --git a/core/src/testSubjects/java/reflection/Reflect17.java b/core/src/testSubjects/java/reflection/Reflect17.java index b16bf3aff3..864a9d6987 100644 --- a/core/src/testSubjects/java/reflection/Reflect17.java +++ b/core/src/testSubjects/java/reflection/Reflect17.java @@ -16,8 +16,12 @@ /** Test of Method.invoke */ public class Reflect17 { public static void main(String[] args) - throws ClassNotFoundException, IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException, SecurityException, + throws ClassNotFoundException, + IllegalArgumentException, + InstantiationException, + IllegalAccessException, + InvocationTargetException, + SecurityException, NoSuchMethodException { Class c = Class.forName("reflection.Helper"); Method m = c.getDeclaredMethod("t", new Class[] {Integer.class, Integer.class}); diff --git a/core/src/testSubjects/java/reflection/Reflect18.java b/core/src/testSubjects/java/reflection/Reflect18.java index 96a63d01b2..565c9be80d 100644 --- a/core/src/testSubjects/java/reflection/Reflect18.java +++ b/core/src/testSubjects/java/reflection/Reflect18.java @@ -16,8 +16,12 @@ /** Test of Method.invoke */ public class Reflect18 { public static void main(String[] args) - throws ClassNotFoundException, IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException, SecurityException, + throws ClassNotFoundException, + IllegalArgumentException, + InstantiationException, + IllegalAccessException, + InvocationTargetException, + SecurityException, NoSuchMethodException { Class c = Class.forName("reflection.Helper"); Method m = c.getDeclaredMethod("t", new Class[] {Integer.class, Integer.class}); diff --git a/core/src/testSubjects/java/reflection/Reflect19.java b/core/src/testSubjects/java/reflection/Reflect19.java index 5112b365f6..81ca26b0bb 100644 --- a/core/src/testSubjects/java/reflection/Reflect19.java +++ b/core/src/testSubjects/java/reflection/Reflect19.java @@ -16,8 +16,12 @@ /** Test of Constructor.newInstance */ public class Reflect19 { public static void main(String[] args) - throws ClassNotFoundException, IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException, SecurityException, + throws ClassNotFoundException, + IllegalArgumentException, + InstantiationException, + IllegalAccessException, + InvocationTargetException, + SecurityException, NoSuchMethodException { Class c = Class.forName("reflection.Helper"); Constructor m = c.getConstructor(new Class[] {Integer.class}); diff --git a/core/src/testSubjects/java/reflection/Reflect20.java b/core/src/testSubjects/java/reflection/Reflect20.java index c448592379..e95b536dcd 100644 --- a/core/src/testSubjects/java/reflection/Reflect20.java +++ b/core/src/testSubjects/java/reflection/Reflect20.java @@ -16,8 +16,12 @@ /** Test of Constructor.newInstance */ public class Reflect20 { public static void main(String[] args) - throws ClassNotFoundException, SecurityException, NoSuchMethodException, - IllegalAccessException, InstantiationException, IllegalArgumentException, + throws ClassNotFoundException, + SecurityException, + NoSuchMethodException, + IllegalAccessException, + InstantiationException, + IllegalArgumentException, InvocationTargetException { Class helperClass = Class.forName("reflection.Helper"); Class objectClass = Class.forName("java.lang.Object"); diff --git a/core/src/testSubjects/java/reflection/Reflect21.java b/core/src/testSubjects/java/reflection/Reflect21.java index e6c7687430..eb23e95279 100644 --- a/core/src/testSubjects/java/reflection/Reflect21.java +++ b/core/src/testSubjects/java/reflection/Reflect21.java @@ -16,8 +16,12 @@ /** Test of Constructor.newInstance */ public class Reflect21 { public static void main(String[] args) - throws ClassNotFoundException, SecurityException, NoSuchMethodException, - IllegalAccessException, InstantiationException, IllegalArgumentException, + throws ClassNotFoundException, + SecurityException, + NoSuchMethodException, + IllegalAccessException, + InstantiationException, + IllegalArgumentException, InvocationTargetException { Class helperClass = Class.forName("reflection.Helper"); Class objectClass = Class.forName("java.lang.Object"); diff --git a/core/src/testSubjects/java/reflection/Reflect22.java b/core/src/testSubjects/java/reflection/Reflect22.java index e1cdf43fe7..1820c7a178 100644 --- a/core/src/testSubjects/java/reflection/Reflect22.java +++ b/core/src/testSubjects/java/reflection/Reflect22.java @@ -16,8 +16,12 @@ /** Test of Constructor.newInstance */ public class Reflect22 { public static void main(String[] args) - throws ClassNotFoundException, SecurityException, NoSuchMethodException, - IllegalAccessException, InstantiationException, IllegalArgumentException, + throws ClassNotFoundException, + SecurityException, + NoSuchMethodException, + IllegalAccessException, + InstantiationException, + IllegalArgumentException, InvocationTargetException { Class helperClass = Class.forName("reflection.Helper"); Constructor[] constrs = helperClass.getDeclaredConstructors(); diff --git a/core/src/testSubjects/java/reflection/Reflect23.java b/core/src/testSubjects/java/reflection/Reflect23.java index 6b75ed6e89..02e67dc7d5 100644 --- a/core/src/testSubjects/java/reflection/Reflect23.java +++ b/core/src/testSubjects/java/reflection/Reflect23.java @@ -17,8 +17,12 @@ /** Test of Constructor.newInstance */ public class Reflect23 { public static void main(String[] args) - throws ClassNotFoundException, SecurityException, NoSuchMethodException, - IllegalAccessException, InstantiationException, IllegalArgumentException, + throws ClassNotFoundException, + SecurityException, + NoSuchMethodException, + IllegalAccessException, + InstantiationException, + IllegalArgumentException, InvocationTargetException { Class helperClass = Class.forName("reflection.Helper"); Object helperObject = helperClass.newInstance(); diff --git a/core/src/testSubjects/java/reflection/Reflect7.java b/core/src/testSubjects/java/reflection/Reflect7.java index 3118a61207..d20b9f073c 100644 --- a/core/src/testSubjects/java/reflection/Reflect7.java +++ b/core/src/testSubjects/java/reflection/Reflect7.java @@ -14,11 +14,17 @@ import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -/** @author pistoia */ +/** + * @author pistoia + */ public class Reflect7 { public static void main(String[] args) - throws ClassNotFoundException, NoSuchMethodException, IllegalArgumentException, - InstantiationException, IllegalAccessException, InvocationTargetException { + throws ClassNotFoundException, + NoSuchMethodException, + IllegalArgumentException, + InstantiationException, + IllegalAccessException, + InvocationTargetException { Class c = (Class) Class.forName("java.io.FilePermission"); Class[] paramTypes = new Class[] {"".getClass(), "".getClass()}; Constructor constr = c.getConstructor(paramTypes); diff --git a/core/src/testSubjects/java/reflection/Reflect8.java b/core/src/testSubjects/java/reflection/Reflect8.java index b0af9baf7b..8b01c69fba 100644 --- a/core/src/testSubjects/java/reflection/Reflect8.java +++ b/core/src/testSubjects/java/reflection/Reflect8.java @@ -16,8 +16,11 @@ /** Test of Class.getConstructors(). */ public class Reflect8 { public static void main(String[] args) - throws ClassNotFoundException, IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException { + throws ClassNotFoundException, + IllegalArgumentException, + InstantiationException, + IllegalAccessException, + InvocationTargetException { Class c = Class.forName("java.lang.Integer"); Constructor[] ctors = c.getConstructors(); Integer i = (Integer) ctors[0].newInstance(1); diff --git a/core/src/testSubjects/java/reflection/Reflect9.java b/core/src/testSubjects/java/reflection/Reflect9.java index 20a9f441ec..6c6f3168a9 100644 --- a/core/src/testSubjects/java/reflection/Reflect9.java +++ b/core/src/testSubjects/java/reflection/Reflect9.java @@ -16,8 +16,12 @@ /** Test of Method.invoke */ public class Reflect9 { public static void main(String[] args) - throws ClassNotFoundException, IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException, SecurityException, + throws ClassNotFoundException, + IllegalArgumentException, + InstantiationException, + IllegalAccessException, + InvocationTargetException, + SecurityException, NoSuchMethodException { Class c = Class.forName("java.lang.Integer"); Method m = c.getDeclaredMethod("toString", new Class[] {}); diff --git a/core/src/testSubjects/java/slice/TestArrays.java b/core/src/testSubjects/java/slice/TestArrays.java index 5fa5398257..8952fb4909 100644 --- a/core/src/testSubjects/java/slice/TestArrays.java +++ b/core/src/testSubjects/java/slice/TestArrays.java @@ -13,6 +13,7 @@ public class TestArrays { static void doNothing(Object o) {} + /** slice should include statements involving arr2 and i, exclude statements with arr1 and j */ public static void main(String[] args) { Object[] arr1 = new Object[10], arr2 = new Object[10]; diff --git a/core/src/testSubjects/java/staticInit/TestStaticInit.java b/core/src/testSubjects/java/staticInit/TestStaticInit.java index f8beebc7f5..5221f51f35 100644 --- a/core/src/testSubjects/java/staticInit/TestStaticInit.java +++ b/core/src/testSubjects/java/staticInit/TestStaticInit.java @@ -10,7 +10,9 @@ */ package staticInit; -/** @author manu */ +/** + * @author manu + */ public class TestStaticInit { private static class A { diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexCFG.java b/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexCFG.java index 4eb62bf5db..27d7390267 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexCFG.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexCFG.java @@ -669,7 +669,9 @@ public Set getExceptionHandlers() { return exceptionHandlers; } - /** @see com.ibm.wala.cfg.ControlFlowGraph#getProgramCounter(int) */ + /** + * @see com.ibm.wala.cfg.ControlFlowGraph#getProgramCounter(int) + */ @Override public int getProgramCounter(int index) { return dexMethod.getAddressFromIndex(index); diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexFileModule.java b/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexFileModule.java index 492a92ad84..22a9ab7572 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexFileModule.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexFileModule.java @@ -107,7 +107,9 @@ private DexFileModule(File f) throws IllegalArgumentException { this(f, AUTO_INFER_API_LEVEL); } - /** @param f the .dex or .apk file */ + /** + * @param f the .dex or .apk file + */ private DexFileModule(File f, int apiLevel) throws IllegalArgumentException { try { this.f = f; @@ -156,12 +158,16 @@ public DexFileModule(File f, String entry) throws IllegalArgumentException { this(f, entry, AUTO_INFER_API_LEVEL); } - /** @return The DexFile associated to this module. */ + /** + * @return The DexFile associated to this module. + */ public DexFile getDexFile() { return dexfile; } - /** @return The DexFile associated to this module. */ + /** + * @return The DexFile associated to this module. + */ public File getFile() { return f; } diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexIClass.java b/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexIClass.java index 4b421edc6f..20307874a0 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexIClass.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexIClass.java @@ -92,6 +92,7 @@ public class DexIClass extends BytecodeClass { private int clinitId = -1; private final DexModuleEntry dexModuleEntry; + // public IClassLoader loader; public DexIClass(IClassLoader loader, IClassHierarchy cha, final DexModuleEntry dexEntry) { @@ -175,7 +176,9 @@ public DexIClass(IClassLoader loader, IClassHierarchy cha, final DexModuleEntry staticFields = sfs.toArray(new IField[0]); } - /** @return The classDef Item associated with this class. */ + /** + * @return The classDef Item associated with this class. + */ public ClassDef getClassDefItem() { return classDef; } @@ -207,13 +210,17 @@ public boolean isInterface() { return (modifiers & INTERFACE.getValue()) != 0; } - /** @see com.ibm.wala.classLoader.IClass#isAbstract() */ + /** + * @see com.ibm.wala.classLoader.IClass#isAbstract() + */ @Override public boolean isAbstract() { return (modifiers & ABSTRACT.getValue()) != 0; } - /** @see com.ibm.wala.classLoader.IClass#isAbstract() */ + /** + * @see com.ibm.wala.classLoader.IClass#isAbstract() + */ @Override public boolean isSynthetic() { return (modifiers & SYNTHETIC.getValue()) != 0; @@ -228,7 +235,9 @@ public int getModifiers() throws UnsupportedOperationException { return modifiers; } - /** @see java.lang.Object#equals(Object) */ + /** + * @see java.lang.Object#equals(Object) + */ @Override public boolean equals(Object obj) { // it's ok to use instanceof since this class is final diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexIMethod.java b/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexIMethod.java index e12744b415..82a41168a2 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexIMethod.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/DexIMethod.java @@ -199,7 +199,9 @@ public static int getTotalInsts() { // Specific methods // ------------------------------------------ - /** @return the EncodedMethod object for which this DexIMethod is a wrapper. */ + /** + * @return the EncodedMethod object for which this DexIMethod is a wrapper. + */ public Method toEncodedMethod() { return eMethod; } diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/InstructionArray.java b/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/InstructionArray.java index fa0975d112..f4ede352f6 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/InstructionArray.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/InstructionArray.java @@ -181,12 +181,16 @@ public int getPcFromIndex(int index) { return index2pc.get(index); } - /** @return The instruction from its id. */ + /** + * @return The instruction from its id. + */ public Instruction getFromId(int id) { return instructions.get(id); } - /** @return The instruction from its pc. */ + /** + * @return The instruction from its pc. + */ public Instruction getFromPc(int pc) { return instructions.get(pc2index.get(pc)); } diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/WDexClassLoaderImpl.java b/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/WDexClassLoaderImpl.java index d2b1fc9344..751ec74c42 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/WDexClassLoaderImpl.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/classLoader/WDexClassLoaderImpl.java @@ -175,7 +175,9 @@ private void loadAllDexClasses(Collection moduleEntries) { } } - /** @return the IClassHierarchy of this classLoader. */ + /** + * @return the IClassHierarchy of this classLoader. + */ public IClassHierarchy getClassHierarcy() { return cha; } diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/dex/instructions/Instruction.java b/dalvik/src/main/java/com/ibm/wala/dalvik/dex/instructions/Instruction.java index 9d8c3a7b36..ed054e61e8 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/dex/instructions/Instruction.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/dex/instructions/Instruction.java @@ -131,12 +131,16 @@ public boolean isPEI() { return opcode.canThrow(); } - /** @return The DexIMethod which contains this instruction. */ + /** + * @return The DexIMethod which contains this instruction. + */ public DexIMethod getParentMethod() { return method; } - /** @return The opcode associated with this instruction. */ + /** + * @return The opcode associated with this instruction. + */ public Opcode getOpcode() { return opcode; } diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/dex/util/config/DexAnalysisScopeReader.java b/dalvik/src/main/java/com/ibm/wala/dalvik/dex/util/config/DexAnalysisScopeReader.java index 64240bcc63..642b6c010c 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/dex/util/config/DexAnalysisScopeReader.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/dex/util/config/DexAnalysisScopeReader.java @@ -58,6 +58,7 @@ public class DexAnalysisScopeReader extends AnalysisScopeReader { /* BEGIN Custom change: Fixes in AndroidAnalysisScope */ // private static final String BASIC_FILE = "conf" + File.separator+ "primordial.txt"; private static final String BASIC_FILE = "./primordial.txt"; // Path inside jar + /* END Custom change: Fixes in AndroidAnalysisScope */ public static AnalysisScope makeAndroidBinaryAnalysisScope(URI classPath, String exclusionsFile) throws IOException { diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/IntentModel.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/IntentModel.java index bd4eaa9b01..a538476fcd 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/IntentModel.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/IntentModel.java @@ -59,6 +59,7 @@ public class IntentModel extends AndroidModel { public final Atom name; public final Atom target; + // private SummarizedMethod activityModel; /** * Restrict the model to Activities. diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/MicroModel.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/MicroModel.java index 7b5009f6e8..201628ce46 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/MicroModel.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/MicroModel.java @@ -59,6 +59,7 @@ public class MicroModel extends AndroidModel { public final Atom name; public final Atom target; + // private SummarizedMethod activityModel; /** * Restrict the model to Activities. diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/MiniModel.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/MiniModel.java index ccff14269f..bb027345de 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/MiniModel.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/MiniModel.java @@ -73,6 +73,7 @@ public class MiniModel extends AndroidModel { private final Atom name; private final AndroidComponent forCompo; + /** * Restrict the model to Activities. * diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/AndroidModelParameterManager.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/AndroidModelParameterManager.java index a37b887fe0..624338e5e6 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/AndroidModelParameterManager.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/AndroidModelParameterManager.java @@ -95,12 +95,16 @@ private enum ValueStatus { // TODO: nextLocal may be 0 on getUnamanged! /** The next variable not under management yet */ private int nextLocal; + /** for managing cascaded code blocks */ private int currentScope = 0; + /** For checking if type is CREATE or REUSE (optional) */ private IInstantiationBehavior behaviour = null; + /** Description only used for toString() */ private String description; + // private MethodReference forMethod; /** Representing a ssa-number - thus a version of an instance to a type. */ @@ -468,7 +472,9 @@ public int getSuper(TypeReference type) { return ssa; } - /** @throws IllegalArgumentException if type was not seen before or is null */ + /** + * @throws IllegalArgumentException if type was not seen before or is null + */ public List getAllForPhi(TypeReference type) { if (type == null) { throw new IllegalArgumentException("The argument type may not be null"); @@ -583,7 +589,9 @@ public boolean needsPhi(TypeReference type) { throw new IllegalStateException("No suitable candidate has been found"); // TODO WRONG text } - /** @throws IllegalArgumentException if type was not seen before or is null */ + /** + * @throws IllegalArgumentException if type was not seen before or is null + */ public void invalidate(TypeReference type) { if (type == null) { throw new IllegalArgumentException("The argument type may not be null"); diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/DefaultInstantiationBehavior.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/DefaultInstantiationBehavior.java index 384784810c..0ea0ce9b6d 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/DefaultInstantiationBehavior.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/DefaultInstantiationBehavior.java @@ -307,7 +307,9 @@ public Exactness getExactness( return behaviours.get(typeK).exactness; } - /** @return InstanceBehavior.REUSE */ + /** + * @return InstanceBehavior.REUSE + */ @Override public InstanceBehavior getDafultBehavior() { return InstanceBehavior.REUSE; diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/IInstantiationBehavior.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/IInstantiationBehavior.java index e39d42bb16..f3c606ffa5 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/IInstantiationBehavior.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/IInstantiationBehavior.java @@ -45,7 +45,9 @@ import com.ibm.wala.types.TypeName; import java.io.Serializable; -/** @author Tobias Blaschke <code@tobiasblaschke.de> */ +/** + * @author Tobias Blaschke <code@tobiasblaschke.de> + */ public abstract class IInstantiationBehavior implements Serializable { private static final long serialVersionUID = -3698760758700891479L; diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/structure/AbstractAndroidModel.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/structure/AbstractAndroidModel.java index 4fb9e9ba80..ea0a704d8e 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/structure/AbstractAndroidModel.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/structure/AbstractAndroidModel.java @@ -116,6 +116,7 @@ protected List returnTypesBetween(IExecutionOrder start, IExecuti return returnTypes; } + // // The rest :) // diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/structure/LoopAndroidModel.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/structure/LoopAndroidModel.java index 504657ac9d..95c5c7a8ec 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/structure/LoopAndroidModel.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/structure/LoopAndroidModel.java @@ -93,6 +93,7 @@ public LoopAndroidModel( private int outerLoopPC = -1; Map outerStartingPhis; + /** * Prepares the PC to get looped to. * diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/structure/SingleStartAndroidModel.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/structure/SingleStartAndroidModel.java index 405320129e..c874027111 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/structure/SingleStartAndroidModel.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/structure/SingleStartAndroidModel.java @@ -93,6 +93,7 @@ public SingleStartAndroidModel( private int outerLoopPC = -1; Map outerStartingPhis; + /** * Prepares the PC to get looped to. * diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/AndroidBoot.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/AndroidBoot.java index 77a4f4c7c3..ac9263602c 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/AndroidBoot.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/AndroidBoot.java @@ -80,6 +80,7 @@ public enum BootAction { /** Crate an instance of android.app.ContextImpl for the apk. */ CREATE_APK_CONTEXT, } + // public static Set BOOT_ALL = EnumSet.allOf(BootAction); // private final MethodReference scope; diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/ExternalModel.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/ExternalModel.java index 4479ba8850..bc1b9081cf 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/ExternalModel.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/ExternalModel.java @@ -83,6 +83,7 @@ public class ExternalModel extends AndroidModel { public final Atom name; private SummarizedMethod activityModel; + // private final AndroidComponent target; // uses AndroidModel.cha; diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/Overrides.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/Overrides.java index 323f38c2fb..84a4b2f5e8 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/Overrides.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/Overrides.java @@ -236,7 +236,7 @@ public MethodTargetSelector overrideAll() throws CancelException { overrideMe, this.caller.getMethod().getReference().getDeclaringClass(), info, - /* callerNd = */ null); + /* callerNd= */ null); overrides.put(overrideMe, override); } monitor.worked(++monitorCounter); diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/SystemServiceModel.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/SystemServiceModel.java index 4699b43375..47374ec93b 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/SystemServiceModel.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/SystemServiceModel.java @@ -82,6 +82,7 @@ public class SystemServiceModel extends AndroidModel { public final Atom name; private SummarizedMethod activityModel; private final String target; + // uses AndroidModel.cha; /** * Do not call any EntryPoint. diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/UnknownTargetModel.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/UnknownTargetModel.java index e95d2423fc..133ec4b4aa 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/UnknownTargetModel.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/stubs/UnknownTargetModel.java @@ -90,6 +90,7 @@ public class UnknownTargetModel extends AndroidModel { private MiniModel miniModel = null; private ExternalModel externalModel = null; private final AndroidComponent target; + // uses AndroidModel.cha; /** @@ -103,7 +104,9 @@ protected boolean selectEntryPoint(AndroidEntryPoint ep) { return false; } - /** @param target Component Type, may be null: No restrictions are imposed on AndroidModel then */ + /** + * @param target Component Type, may be null: No restrictions are imposed on AndroidModel then + */ public UnknownTargetModel( final IClassHierarchy cha, final AnalysisOptions options, diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/impl/AndroidEntryPoint.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/impl/AndroidEntryPoint.java index de39b62854..bc97ef25a7 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/impl/AndroidEntryPoint.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/impl/AndroidEntryPoint.java @@ -128,6 +128,7 @@ public boolean isMemberOf(Atom klass) { // } // return cha.isSubclassOf(method.getDeclaringClass(), cha.lookupClass(type)); } + /** * Implement this interface to put entitys into the AndroidModel. * @@ -137,6 +138,7 @@ public boolean isMemberOf(Atom klass) { public interface IExecutionOrder extends Comparable { /** Returns an integer-representation of the ExecutionOrder. */ int getOrderValue(); + /** * AbstractAndroidModel inserts code at section switches. * @@ -198,30 +200,39 @@ public static class ExecutionOrder implements IExecutionOrder { // This is an Enum-Style class /** Visit the EntryPoint once at the beginning of the model use that for initialization stuff */ public static final ExecutionOrder AT_FIRST = new ExecutionOrder(0); + /** Basicly the same as AT_FIRST but visited after AT_FIRST */ public static final ExecutionOrder BEFORE_LOOP = new ExecutionOrder(Integer.MAX_VALUE / 8); + /** Visit multiple times (endless) in the loop */ public static final ExecutionOrder START_OF_LOOP = new ExecutionOrder(Integer.MAX_VALUE / 8 * 2); + /** Basicly the same as START_OF_LOOP */ public static final ExecutionOrder MIDDLE_OF_LOOP = new ExecutionOrder(Integer.MAX_VALUE / 8 * 3); + /** Do multiple calls in the loop. Visited after MIDDLE_OF_LOOP, before EEN_OF_LOOP */ public static final ExecutionOrder MULTIPLE_TIMES_IN_LOOP = new ExecutionOrder(Integer.MAX_VALUE / 8 * 4); + /** * Things in END_OF_LOOP are acutually part of the loop. Use AFTER_LOOP if you want them * executed only once */ public static final ExecutionOrder END_OF_LOOP = new ExecutionOrder(Integer.MAX_VALUE / 8 * 5); + /** Basicly the same as AT_LAST but visited before */ public static final ExecutionOrder AFTER_LOOP = new ExecutionOrder(Integer.MAX_VALUE / 8 * 6); + /** Last calls in the model */ public static final ExecutionOrder AT_LAST = new ExecutionOrder(Integer.MAX_VALUE / 8 * 7); + /** This value getts used by the detection heuristic - It is not recommended for manual use. */ public static final ExecutionOrder DEFAULT = MIDDLE_OF_LOOP; private final int value; + /** * Unrecommended way to generate the Order based on an Integer. * @@ -233,6 +244,7 @@ public static class ExecutionOrder implements IExecutionOrder { public ExecutionOrder(int val) { this.value = val; } + /** * Unrecommended way to generate the Order based on a Label-String. * diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/impl/DexEntryPoint.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/impl/DexEntryPoint.java index 2dbecab26e..66d9a6582b 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/impl/DexEntryPoint.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/impl/DexEntryPoint.java @@ -49,6 +49,7 @@ public class DexEntryPoint extends DefaultEntrypoint implements IClassHierarchyDweller { /* BEGIN Custom change */ private final IClassHierarchy cha; + /* END Custom change */ public DexEntryPoint(IMethod method, IClassHierarchy cha) { super(method, cha); @@ -71,6 +72,7 @@ public DexEntryPoint(MethodReference method, IClassHierarchy cha) { public IClassHierarchy getClassHierarchy() { return cha; } + /* END Custom change */ @Override protected TypeReference[] makeParameterTypes(IMethod method, int i) { diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/propagation/cfa/IntentStarters.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/propagation/cfa/IntentStarters.java index 2012676ed6..7ba54b90fd 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/propagation/cfa/IntentStarters.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/propagation/cfa/IntentStarters.java @@ -90,8 +90,10 @@ public enum StarterFlags { /** Contains information on how to call a starter-function. */ public static class StartInfo { private final Set targetAccuracy; + /** used to dispatch to the correct MiniModel if intent-target could not be retreived */ private final Set componentType; + /** relevant for the IntentContextSelector */ private final int[] relevantParameters; diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ssa/AbstractIntRegisterMachine.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ssa/AbstractIntRegisterMachine.java index 68f536ff56..43573011de 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ssa/AbstractIntRegisterMachine.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ssa/AbstractIntRegisterMachine.java @@ -263,7 +263,9 @@ public MachineState getEntryState() { return (MachineState) solver.getIn(cfg.entry()); } - /** @return the state at the entry to a given block */ + /** + * @return the state at the entry to a given block + */ public MachineState getIn(BasicBlock bb) { return (MachineState) solver.getIn(bb); } @@ -625,7 +627,9 @@ public void setLocal(int i, int j) { locals[i] = j; } - /** @return the number of the symbol corresponding to local i */ + /** + * @return the number of the symbol corresponding to local i + */ public int getLocal(int i) { if (locals == null) { if (OPTIMISTIC) { @@ -965,7 +969,9 @@ public void visitConstant(Constant instruction) { // // } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) + */ @Override public void visitGetField(GetField instruction) { // TODO @@ -980,7 +986,9 @@ public void visitGetField(GetField instruction) { // } // } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitInstanceof */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitInstanceof + */ @Override public void visitInstanceof(InstanceOf instruction) { // TODO @@ -989,7 +997,9 @@ public void visitInstanceof(InstanceOf instruction) { throw new UnimplementedError(); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitInvoke(IInvokeInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitInvoke(IInvokeInstruction) + */ @Override public void visitInvoke(Invoke instruction) { // TODO @@ -1004,7 +1014,9 @@ public void visitInvoke(Invoke instruction) { // } } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitMonitor(MonitorInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitMonitor(MonitorInstruction) + */ @Override public void visitMonitor(Monitor instruction) { // TODO @@ -1024,7 +1036,9 @@ public void visitMonitor(Monitor instruction) { // workingState.setLocal(index, workingState.pop()); // } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitNew(NewInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitNew(NewInstruction) + */ @Override public void visitNew(New instruction) { // TODO @@ -1040,7 +1054,9 @@ public void visitNew(New instruction) { // } // } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitPut(IPutInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitPut(IPutInstruction) + */ @Override public void visitPutField(PutField instruction) { // TODO @@ -1058,7 +1074,9 @@ public void visitPutField(PutField instruction) { // workingState.swap(); // } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitSwitch(SwitchInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitSwitch(SwitchInstruction) + */ @Override public void visitSwitch(Switch instruction) { // TODO @@ -1066,7 +1084,9 @@ public void visitSwitch(Switch instruction) { throw new UnimplementedError(); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitThrow(ThrowInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitThrow(ThrowInstruction) + */ @Override public void visitThrow(Throw instruction) { // TODO diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ssa/DexSSABuilder.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ssa/DexSSABuilder.java index 15bed2abb3..307107162c 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ssa/DexSSABuilder.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ssa/DexSSABuilder.java @@ -611,7 +611,9 @@ protected void setLocal(int dest, int result) { workingState.setLocal(dest, result); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitCheckCast */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitCheckCast + */ @Override public void visitCheckCast(CheckCast instruction) { int val = workingState.getLocal(instruction.object); @@ -730,7 +732,9 @@ public void visitConstant(Constant instruction) { // instruction.throwsExceptionOnOverflow())); // } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) + */ @Override public void visitGetField(GetField instruction) { int dest = instruction.destination; @@ -762,14 +766,18 @@ public void visitGetField(GetField instruction) { // workingState.push(result); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGoto(GotoInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGoto(GotoInstruction) + */ @Override public void visitGoto(Goto instruction) { emitInstruction( insts.GotoInstruction(getCurrentInstructionIndex(), instruction.destination)); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitInstanceof */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitInstanceof + */ @Override public void visitInstanceof(InstanceOf instruction) { int ref = workingState.getLocal(instruction.source); @@ -785,7 +793,9 @@ public void visitInstanceof(InstanceOf instruction) { getCurrentInstructionIndex(), result, ref, instruction.type)); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitInvoke(IInvokeInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitInvoke(IInvokeInstruction) + */ @Override public void visitInvoke(Invoke instruction) { // TODO: can other methods do indirect reads from a dex method? @@ -917,7 +927,9 @@ else if (n == m.getNumberOfParameters() + 1) { // super.visitLocalStore(instruction); // } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitMonitor(MonitorInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitMonitor(MonitorInstruction) + */ @Override public void visitMonitor(Monitor instruction) { int ref = workingState.getLocal(instruction.object); @@ -926,7 +938,9 @@ public void visitMonitor(Monitor instruction) { insts.MonitorInstruction(getCurrentInstructionIndex(), ref, instruction.enter)); } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitNew(NewInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitNew(NewInstruction) + */ @Override public void visitNew(New instruction) { int dest = instruction.destination; @@ -992,7 +1006,9 @@ public void visitNewArrayFilled(NewArrayFilled instruction) { */ } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) + */ @Override public void visitPutField(PutField instruction) { int value = workingState.getLocal(instruction.source); @@ -1013,7 +1029,9 @@ public void visitPutField(PutField instruction) { } } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitReturn(ReturnInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitReturn(ReturnInstruction) + */ @Override public void visitReturn(Return instruction) { if (instruction instanceof Return.ReturnDouble) { @@ -1060,7 +1078,9 @@ public void visitReturn(Return instruction) { // true)); // } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitSwitch(SwitchInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitSwitch(SwitchInstruction) + */ @Override public void visitSwitch(Switch instruction) { int val = workingState.getLocal(instruction.regA); @@ -1108,7 +1128,9 @@ private int findRethrowException() { } } - /** @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitThrow(ThrowInstruction) */ + /** + * @see com.ibm.wala.shrike.shrikeBT.IInstruction.Visitor#visitThrow(ThrowInstruction) + */ @Override public void visitThrow(Throw instruction) { int throwable = workingState.getLocal(instruction.throwable); @@ -1526,7 +1548,9 @@ public int[] allocateNewLocalsArray() { return result; } - /** @return the indices i s.t. x[i] == y, or null if none found. */ + /** + * @return the indices i s.t. x[i] == y, or null if none found. + */ private static int[] extractIndices(int[] x, int y) { int count = 0; for (int element : x) { diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/util/AndroidEntryPointManager.java b/dalvik/src/main/java/com/ibm/wala/dalvik/util/AndroidEntryPointManager.java index c3773c7e4b..092027046d 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/util/AndroidEntryPointManager.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/util/AndroidEntryPointManager.java @@ -83,6 +83,7 @@ public static AndroidEntryPointManager MANAGER = new AndroidEntryPointManager(); public static List ENTRIES = new ArrayList<>(); + /** This is TRANSIENT! */ private transient IInstantiationBehavior instantiation = null; @@ -126,6 +127,7 @@ public static Set getComponents() { // private boolean flatComponents = false; + /** * Controlls the initialization of Components. * @@ -194,6 +196,7 @@ public IInstantiationBehavior setInstantiationBehavior(IInstantiationBehavior in } private transient IProgressMonitor progressMonitor = null; + /** * Can be used to indicate the progress or to cancel operations. * @@ -211,6 +214,7 @@ public IProgressMonitor setProgressMonitor(IProgressMonitor monitor) { } private boolean doBootSequence = true; + /** * Whether to generate a global android environment. * @@ -245,6 +249,7 @@ public boolean setDoBootSequence(boolean doBootSequence) { } private Class abstractAndroidModel = LoopAndroidModel.class; + /** * What special handling to insert into the model. * @@ -676,6 +681,7 @@ public boolean existsIntentFor(TypeName clazz) { } private final transient Map seenIntentCalls = HashMapFactory.make(); + /** * DO NOT CALL! - This is for IntentContextSelector. * diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/util/AndroidManifestXMLReader.java b/dalvik/src/main/java/com/ibm/wala/dalvik/util/AndroidManifestXMLReader.java index 025c02d318..855294a2b1 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/util/AndroidManifestXMLReader.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/util/AndroidManifestXMLReader.java @@ -133,6 +133,7 @@ private interface ISubTags { } private interface HistoryKey {} + /** Only includes relevant tags. */ @SuppressWarnings("Convert2Lambda") private enum Tag implements HistoryKey { @@ -423,6 +424,7 @@ public String getName() { */ private abstract static class ParserItem { protected Tag self; + /** * Set the Tag this ParserItem-Instance is an Handler for. * @@ -456,6 +458,7 @@ public void enter(Attributes saxAttrs) { // if there is no such value in saxAttrs it returns null } } + /** * Remove all Attributes generated by self and self itself. * diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/util/AndroidPreFlightChecks.java b/dalvik/src/main/java/com/ibm/wala/dalvik/util/AndroidPreFlightChecks.java index b66d67eae1..628583d60f 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/util/AndroidPreFlightChecks.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/util/AndroidPreFlightChecks.java @@ -229,7 +229,7 @@ public boolean checkAllComponentsReuse() { final TypeName test = ep.getMethod().getDeclaringClass().getName(); IInstantiationBehavior.InstanceBehavior behave = behaviour.getBehavior( - test, /* asParameterTo= */ null, /* inCall= */ null, /* withName= */ null); + test, /* asParameterTo= */ null, /* inCall= */ null, /* withName= */ null); if (behave != IInstantiationBehavior.InstanceBehavior.REUSE) { pass = false; } diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ActivityEP.java b/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ActivityEP.java index a506d977a0..a9f90acc22 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ActivityEP.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ActivityEP.java @@ -76,6 +76,7 @@ public final class ActivityEP { ExecutionOrder.AT_FIRST, // ApplicationEP.onCreate, // Uncommenting would create a ring-dependency })); + // , // new AndroidEntryPoint.IExecutionOrder[] { // //ServiceEP.onCreate // Not necessarily but let's assume it // XXX: @@ -209,6 +210,7 @@ public final class ActivityEP { new AndroidEntryPoint.IExecutionOrder[] { onResume, onSaveInstanceState, ExecutionOrder.MIDDLE_OF_LOOP })); + /** * Perform any final cleanup before an activity is destroyed. * @@ -619,6 +621,7 @@ public final class ActivityEP { allInitialViewsSetUp, ExecutionOrder.MULTIPLE_TIMES_IN_LOOP })); + /** * Called when a generic motion event was not handled by any of the views inside of the activity. * @@ -845,6 +848,7 @@ public final class ActivityEP { public static final AndroidPossibleEntryPoint onActionModeFinished = new AndroidPossibleEntryPoint( "onActionModeFinished", ExecutionOrder.after(onActionModeStarted)); + /** Give the Activity a chance to control the UI for an action mode requested by the system. */ public static final AndroidPossibleEntryPoint onWindowStartingActionMode = new AndroidPossibleEntryPoint( @@ -852,6 +856,7 @@ public final class ActivityEP { ExecutionOrder.between( ExecutionOrder.MULTIPLE_TIMES_IN_LOOP, // TODO where to put?? onActionModeStarted)); + /** * Will be called if you have selected configurations you would like to handle with the * configChanges attribute in your manifest. If any configuration change occurs that is not @@ -876,10 +881,12 @@ public final class ActivityEP { public static final AndroidPossibleEntryPoint onCreateDescription = new AndroidPossibleEntryPoint( "onCreateDescription", ExecutionOrder.between(onSaveInstanceState, onPause)); + /** This method is called before pausing */ public static final AndroidPossibleEntryPoint onCreateThumbnail = new AndroidPossibleEntryPoint( "onCreateThumbnail", ExecutionOrder.directlyBefore(onCreateDescription)); + /** * This function will be called after any global assist callbacks. * @@ -934,6 +941,7 @@ public final class ActivityEP { */ public static final AndroidPossibleEntryPoint onUserLeaveHint = new AndroidPossibleEntryPoint("onUserLeaveHint", ExecutionOrder.directlyBefore(onPause)); + /** This is called whenever the current window attributes change. */ public static final AndroidPossibleEntryPoint onWindowAttributesChanged = new AndroidPossibleEntryPoint( diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ApplicationEP.java b/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ApplicationEP.java index d2d735025a..45a9bfadaf 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ApplicationEP.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ApplicationEP.java @@ -86,6 +86,7 @@ public final class ApplicationEP { ActivityEP.onConfigurationChanged, ExecutionOrder.END_OF_LOOP }, new AndroidEntryPoint.IExecutionOrder[] {ExecutionOrder.AT_LAST})); + /** * This is called when the overall system is running low on memory, and actively running processes * should trim their memory usage. diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/FragmentEP.java b/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/FragmentEP.java index 7a193cee4c..c3252657cd 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/FragmentEP.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/FragmentEP.java @@ -274,7 +274,9 @@ public final class FragmentEP { // Misc // - /** @see ActivityEP#onActivityResult */ + /** + * @see ActivityEP#onActivityResult + */ public static final AndroidPossibleEntryPoint onActivityResult = new AndroidPossibleEntryPoint( "onActivityResult", @@ -374,14 +376,19 @@ public final class FragmentEP { public static final AndroidPossibleEntryPoint onLowMemory = new AndroidPossibleEntryPoint( "onLowMemory", ExecutionOrder.directlyBefore(ActivityEP.onLowMemory)); - /** @see ActivityEP#onOptionsItemSelected */ + + /** + * @see ActivityEP#onOptionsItemSelected + */ public static final AndroidPossibleEntryPoint onOptionsItemSelected = new AndroidPossibleEntryPoint( "onOptionsItemSelected", ExecutionOrder.directlyAfter(ActivityEP.onOptionsItemSelected) // TODO: After? Before? ); - /** @see ActivityEP#onOptionsMenuClosed */ + /** + * @see ActivityEP#onOptionsMenuClosed + */ public static final AndroidPossibleEntryPoint onOptionsMenuClosed = new AndroidPossibleEntryPoint( "onOptionsMenuClosed", @@ -425,7 +432,9 @@ public final class FragmentEP { onDestroy, ExecutionOrder.AT_LAST // XXX: To early })); - /** @see ActivityEP#onTrimMemory */ + /** + * @see ActivityEP#onTrimMemory + */ public static final AndroidPossibleEntryPoint onTrimMemory = new AndroidPossibleEntryPoint( "onTrimMemory", ExecutionOrder.directlyBefore(ActivityEP.onTrimMemory)); diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ProviderEP.java b/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ProviderEP.java index 2703ed9bec..27788206b1 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ProviderEP.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ProviderEP.java @@ -116,6 +116,7 @@ public final class ProviderEP { // ActivityEP.onResume, ExecutionOrder.START_OF_LOOP })); + /** * Add the EntryPoint specifications defined in this file to the given list. * diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ServiceEP.java b/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ServiceEP.java index 60e443aec6..8890b2ef07 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ServiceEP.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/util/androidEntryPoints/ServiceEP.java @@ -578,6 +578,7 @@ public final class ServiceEP { ExecutionOrder.AT_FIRST, ProviderEP.onCreate, // ApplicationEP.onCreate })); + // , // new AndroidEntryPoint.IExecutionOrder[] { // // BroadcastReceivers oftain use a Service - so place it before them. diff --git a/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DalvikCallGraphTestBase.java b/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DalvikCallGraphTestBase.java index 341267951c..2fbe91d854 100644 --- a/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DalvikCallGraphTestBase.java +++ b/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DalvikCallGraphTestBase.java @@ -96,8 +96,14 @@ protected static Set applicationMethods(CallGraph cg) { } public void dynamicCG(File javaJarPath, String mainClass, String... args) - throws FileNotFoundException, IOException, ClassNotFoundException, InvalidClassFileException, - FailureException, SecurityException, IllegalArgumentException, InterruptedException { + throws FileNotFoundException, + IOException, + ClassNotFoundException, + InvalidClassFileException, + FailureException, + SecurityException, + IllegalArgumentException, + InterruptedException { File F; try (final FileInputStream in = new FileInputStream(javaJarPath)) { F = TemporaryFile.streamToFile(new File("build/test_jar.jar"), in); diff --git a/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DynamicDalvikComparisonJavaLibsTest.java b/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DynamicDalvikComparisonJavaLibsTest.java index 82a26e885a..73869ed31b 100644 --- a/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DynamicDalvikComparisonJavaLibsTest.java +++ b/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DynamicDalvikComparisonJavaLibsTest.java @@ -22,18 +22,30 @@ protected Path getTemporaryDirectory() { @Test public void testJLex() - throws ClassHierarchyException, IllegalArgumentException, IOException, CancelException, - InterruptedException, ClassNotFoundException, SecurityException, - InvalidClassFileException, FailureException { + throws ClassHierarchyException, + IllegalArgumentException, + IOException, + CancelException, + InterruptedException, + ClassNotFoundException, + SecurityException, + InvalidClassFileException, + FailureException { File inputFile = testFile("sample.lex"); test(null, TestConstants.JLEX_MAIN, TestConstants.JLEX, inputFile.getAbsolutePath()); } @Test public void testJavaCup() - throws ClassHierarchyException, IllegalArgumentException, IOException, CancelException, - InterruptedException, ClassNotFoundException, SecurityException, - InvalidClassFileException, FailureException { + throws ClassHierarchyException, + IllegalArgumentException, + IOException, + CancelException, + InterruptedException, + ClassNotFoundException, + SecurityException, + InvalidClassFileException, + FailureException { File inputFile = testFile("sample.cup"); test(null, TestConstants.JAVA_CUP_MAIN, TestConstants.JAVA_CUP, inputFile.getAbsolutePath()); } diff --git a/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DynamicDalvikComparisonTest.java b/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DynamicDalvikComparisonTest.java index c93c8309ed..b57e136c7b 100644 --- a/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DynamicDalvikComparisonTest.java +++ b/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DynamicDalvikComparisonTest.java @@ -32,9 +32,15 @@ public abstract class DynamicDalvikComparisonTest extends DalvikCallGraphTestBase { protected void test(URI[] androidLibs, String mainClass, String javaScopeFile, String... args) - throws ClassHierarchyException, IllegalArgumentException, IOException, CancelException, - InterruptedException, ClassNotFoundException, SecurityException, - InvalidClassFileException, FailureException { + throws ClassHierarchyException, + IllegalArgumentException, + IOException, + CancelException, + InterruptedException, + ClassNotFoundException, + SecurityException, + InvalidClassFileException, + FailureException { AnalysisScope javaScope = CallGraphTestUtil.makeJ2SEAnalysisScope( javaScopeFile, CallGraphTestUtil.REGRESSION_EXCLUSIONS); diff --git a/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DynamicDalvikComparisonTestForAndroidLibs.java b/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DynamicDalvikComparisonTestForAndroidLibs.java index 0c93abdb8c..ed973af577 100644 --- a/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DynamicDalvikComparisonTestForAndroidLibs.java +++ b/dalvik/src/test/java/com/ibm/wala/dalvik/test/callGraph/DynamicDalvikComparisonTestForAndroidLibs.java @@ -20,9 +20,15 @@ protected URI[] providedAndroidLibs() { @Test public void testJLex() - throws ClassHierarchyException, IllegalArgumentException, IOException, CancelException, - InterruptedException, ClassNotFoundException, SecurityException, - InvalidClassFileException, FailureException { + throws ClassHierarchyException, + IllegalArgumentException, + IOException, + CancelException, + InterruptedException, + ClassNotFoundException, + SecurityException, + InvalidClassFileException, + FailureException { File inputFile = testFile("sample.lex"); test( providedAndroidLibs(), @@ -33,9 +39,15 @@ public void testJLex() @Test public void testJavaCup() - throws ClassHierarchyException, IllegalArgumentException, IOException, CancelException, - InterruptedException, ClassNotFoundException, SecurityException, - InvalidClassFileException, FailureException { + throws ClassHierarchyException, + IllegalArgumentException, + IOException, + CancelException, + InterruptedException, + ClassNotFoundException, + SecurityException, + InvalidClassFileException, + FailureException { File inputFile = testFile("sample.cup"); test( providedAndroidLibs(), diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9ef23aec1b..44abb058d6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,28 +1,28 @@ [versions] eclipse = "4.21.0" eclipse-wst-jsdt = "1.0.201.v2010012803" -google-java-format = "1.7" -ktfmt = "0.42" -spotless = "6.13.0" +google-java-format = "1.17.0" +ktfmt = "0.44" +spotless = "6.20.0" [libraries] android-tools = "com.android.tools:r8:2.2.42" -ant = "org.apache.ant:ant:1.10.12" +ant = "org.apache.ant:ant:1.10.14" assertj-core = "org.assertj:assertj-core:3.24.2" commons-cli = "commons-cli:commons-cli:1.5.0" -commons-io = "commons-io:commons-io:2.11.0" +commons-io = "commons-io:commons-io:2.13.0" dexlib2 = "org.smali:dexlib2:2.5.2" eclipse-ecj = "org.eclipse.jdt:ecj:3.21.0" eclipse-osgi = "org.eclipse.platform:org.eclipse.osgi:3.17.0" eclipse-wst-jsdt-core = { module = "org.eclipse.wst.jsdt:core", version.ref = "eclipse-wst-jsdt" } eclipse-wst-jsdt-ui = { module = "org.eclipse.wst.jsdt:ui", version.ref = "eclipse-wst-jsdt" } -errorprone-core = "com.google.errorprone:error_prone_core:2.18.0" +errorprone-core = "com.google.errorprone:error_prone_core:2.21.1" gradle-goomph-plugin = "com.diffplug.gradle:goomph:3.42.2" -gradle-download-task = "de.undercouch:gradle-download-task:5.3.1" +gradle-download-task = "de.undercouch:gradle-download-task:5.5.0" gradle-errorprone-plugin = "net.ltgt.gradle:gradle-errorprone-plugin:3.0.1" gradle-spotless-plugin = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless" } -gson = "com.google.code.gson:gson:2.10" -guava = "com.google.guava:guava:32.0.1-jre" +gson = "com.google.code.gson:gson:2.10.1" +guava = "com.google.guava:guava:32.1.2-jre" hamcrest = "org.hamcrest:hamcrest:2.2" htmlparser = "nu.validator.htmlparser:htmlparser:1.4" java_cup = "java_cup:java_cup:0.9e" @@ -30,7 +30,7 @@ javax-annotation-api = { module = "javax.annotation:javax.annotation-api", versi jericho-html = "net.htmlparser.jericho:jericho-html:3.2" json = "org.json:json:20230618" jspecify = "org.jspecify:jspecify:0.3.0" -junit-bom = "org.junit:junit-bom:5.9.3" +junit-bom = "org.junit:junit-bom:5.10.0" junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api" } junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" } junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params" } @@ -38,7 +38,7 @@ junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher junit-vintage-engine = { module = "org.junit.vintage:junit-vintage-engine" } nullaway = "com.uber.nullaway:nullaway:0.10.12" rhino = "org.mozilla:rhino:1.7.14" -slf4j-api = "org.slf4j:slf4j-api:2.0.6" +slf4j-api = "org.slf4j:slf4j-api:2.0.7" w3c-css-sac = "org.eclipse.birt.runtime:org.w3c.css.sac:1.3.1.v200903091627" [plugins] diff --git a/ide/jdt/src/main/java/com/ibm/wala/ide/AbstractJavaAnalysisAction.java b/ide/jdt/src/main/java/com/ibm/wala/ide/AbstractJavaAnalysisAction.java index 2855246577..254757d829 100644 --- a/ide/jdt/src/main/java/com/ibm/wala/ide/AbstractJavaAnalysisAction.java +++ b/ide/jdt/src/main/java/com/ibm/wala/ide/AbstractJavaAnalysisAction.java @@ -179,7 +179,9 @@ private static void buildScope( } } - /** @see IActionDelegate#run(IAction) */ + /** + * @see IActionDelegate#run(IAction) + */ @Override public void run(IAction action) { IProgressService progressService = PlatformUI.getWorkbench().getProgressService(); @@ -190,13 +192,17 @@ public void run(IAction action) { } } - /** @see IActionDelegate#selectionChanged(IAction, ISelection) */ + /** + * @see IActionDelegate#selectionChanged(IAction, ISelection) + */ @Override public void selectionChanged(IAction action, ISelection selection) { currentSelection = selection; } - /** @return The current {@link ISelection} highlighted in the Eclipse workspace */ + /** + * @return The current {@link ISelection} highlighted in the Eclipse workspace + */ public ISelection getCurrentSelection() { return currentSelection; } diff --git a/ide/jdt/src/main/java/com/ibm/wala/ide/util/JdtUtil.java b/ide/jdt/src/main/java/com/ibm/wala/ide/util/JdtUtil.java index 88583a4aad..5f237f654e 100644 --- a/ide/jdt/src/main/java/com/ibm/wala/ide/util/JdtUtil.java +++ b/ide/jdt/src/main/java/com/ibm/wala/ide/util/JdtUtil.java @@ -433,7 +433,8 @@ public static final String[] parseForParameterTypes(String selector) ++i; } if (d.charAt(i++) == TypeReference.ClassTypeCode) { - while (d.charAt(i++) != ';') ; + while (d.charAt(i++) != ';') + ; sigs.add(d.substring(off, i).replaceAll("/", ".")); } else { sigs.add(d.substring(off, i)); diff --git a/ide/jdt/test/src/test/java/com/ibm/wala/demandpa/driver/DemandCastChecker.java b/ide/jdt/test/src/test/java/com/ibm/wala/demandpa/driver/DemandCastChecker.java index 902210e3e1..ce7c98a3a9 100644 --- a/ide/jdt/test/src/test/java/com/ibm/wala/demandpa/driver/DemandCastChecker.java +++ b/ide/jdt/test/src/test/java/com/ibm/wala/demandpa/driver/DemandCastChecker.java @@ -221,7 +221,7 @@ private static List> findFailingCasts( if (ir == null) continue; SSAInstruction[] instrs = ir.getInstructions(); for (SSAInstruction instr : instrs) { - if (numSafe + numMightFail > MAX_CASTS) break outer; + if ((long) numSafe + numMightFail > MAX_CASTS) break outer; SSAInstruction instruction = instr; if (instruction instanceof SSACheckCastInstruction) { SSACheckCastInstruction castInstr = (SSACheckCastInstruction) instruction; diff --git a/ide/src/main/java/com/ibm/wala/ide/ui/SWTTreeViewer.java b/ide/src/main/java/com/ibm/wala/ide/ui/SWTTreeViewer.java index 9baadf079d..8ea4821d56 100644 --- a/ide/src/main/java/com/ibm/wala/ide/ui/SWTTreeViewer.java +++ b/ide/src/main/java/com/ibm/wala/ide/ui/SWTTreeViewer.java @@ -188,7 +188,9 @@ public GraphViewer(Graph graph) throws WalaException { } } - /** @see org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.Composite) */ + /** + * @see org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.Composite) + */ @Override protected Control createContents(Composite parent) { treeViewer = new TreeViewer(parent); diff --git a/ide/src/main/java/com/ibm/wala/ide/ui/ViewIFDSLocalAction.java b/ide/src/main/java/com/ibm/wala/ide/ui/ViewIFDSLocalAction.java index 556c26fd24..ff5328506d 100644 --- a/ide/src/main/java/com/ibm/wala/ide/ui/ViewIFDSLocalAction.java +++ b/ide/src/main/java/com/ibm/wala/ide/ui/ViewIFDSLocalAction.java @@ -170,7 +170,9 @@ public static String stringify(SSAInstruction s) { return s.toString(); } - /** @see org.eclipse.jface.action.IAction#run() */ + /** + * @see org.eclipse.jface.action.IAction#run() + */ @Override public void run() { diff --git a/ide/src/main/java/com/ibm/wala/ide/ui/ViewIRAction.java b/ide/src/main/java/com/ibm/wala/ide/ui/ViewIRAction.java index 92ad478d83..b0ba83479c 100644 --- a/ide/src/main/java/com/ibm/wala/ide/ui/ViewIRAction.java +++ b/ide/src/main/java/com/ibm/wala/ide/ui/ViewIRAction.java @@ -80,7 +80,9 @@ public void run() { } } - /** @throws IllegalStateException if the viewer is not running */ + /** + * @throws IllegalStateException if the viewer is not running + */ protected IR getIRForSelection() { // we assume the tree viewer's current selection is a CGNode IStructuredSelection selection = viewer.getSelection(); diff --git a/ide/src/main/java/com/ibm/wala/ide/util/EclipseAnalysisScopeReader.java b/ide/src/main/java/com/ibm/wala/ide/util/EclipseAnalysisScopeReader.java index 86a342ded4..1e7242fb7b 100644 --- a/ide/src/main/java/com/ibm/wala/ide/util/EclipseAnalysisScopeReader.java +++ b/ide/src/main/java/com/ibm/wala/ide/util/EclipseAnalysisScopeReader.java @@ -39,6 +39,7 @@ public AnalysisScope readJavaScopeFromPlugin( public AnalysisScope makePrimordialScopeFromPlugin(File exclusionsFile) throws IOException { return makePrimordialScopeFromPlugin(exclusionsFile, CorePlugin.getDefault()); } + /** * @param exclusionsFile file holding class hierarchy exclusions. may be null * @throws IllegalStateException if there are problmes reading wala properties diff --git a/ide/src/main/java/com/ibm/wala/ide/util/EclipseFileProvider.java b/ide/src/main/java/com/ibm/wala/ide/util/EclipseFileProvider.java index 69a535d062..e0b01671d9 100644 --- a/ide/src/main/java/com/ibm/wala/ide/util/EclipseFileProvider.java +++ b/ide/src/main/java/com/ibm/wala/ide/util/EclipseFileProvider.java @@ -41,6 +41,7 @@ public EclipseFileProvider() { public EclipseFileProvider(Plugin plugIn) { this.plugIn = plugIn; } + /** * This class uses reflection to access classes and methods that are only available when Eclipse * is running as an IDE environment. The choice to use reflection is related to builds: with this @@ -94,7 +95,9 @@ public Module getJarFileModule(String fileName, ClassLoader loader) throws IOExc return getFromPlugin(CorePlugin.getDefault(), fileName); } - /** @return the jar file packaged with this plug-in of the given name, or null if not found. */ + /** + * @return the jar file packaged with this plug-in of the given name, or null if not found. + */ private JarFileModule getFromPlugin(Plugin p, String fileName) throws IOException { URL url = getFileURLFromPlugin(p, fileName); if (url == null) return null; diff --git a/ide/src/main/java/com/ibm/wala/ide/util/ProgressMonitorDelegate.java b/ide/src/main/java/com/ibm/wala/ide/util/ProgressMonitorDelegate.java index de6c2692f6..8f092ebb9b 100644 --- a/ide/src/main/java/com/ibm/wala/ide/util/ProgressMonitorDelegate.java +++ b/ide/src/main/java/com/ibm/wala/ide/util/ProgressMonitorDelegate.java @@ -59,6 +59,7 @@ public void subTask(String subTask) { public void cancel() { delegate.setCanceled(true); } + /* END Custom change: subtasks and canceling */ @Override public String getCancelMessage() { diff --git a/ide/tests/src/test/java/com/ibm/wala/examples/drivers/SWTPointsTo.java b/ide/tests/src/test/java/com/ibm/wala/examples/drivers/SWTPointsTo.java index ffcef22a0e..4d737f1d77 100644 --- a/ide/tests/src/test/java/com/ibm/wala/examples/drivers/SWTPointsTo.java +++ b/ide/tests/src/test/java/com/ibm/wala/examples/drivers/SWTPointsTo.java @@ -52,7 +52,9 @@ public static void main(String[] args) { run(p.getProperty("appJar")); } - /** @param appJar should be something like "c:/temp/testdata/java_cup.jar" */ + /** + * @param appJar should be something like "c:/temp/testdata/java_cup.jar" + */ public static ApplicationWindow run(String appJar) { try { diff --git a/scandroid/src/main/java/org/scandroid/domain/DomainElement.java b/scandroid/src/main/java/org/scandroid/domain/DomainElement.java index aa76603b0d..a2ef06f29b 100644 --- a/scandroid/src/main/java/org/scandroid/domain/DomainElement.java +++ b/scandroid/src/main/java/org/scandroid/domain/DomainElement.java @@ -63,6 +63,7 @@ public DomainElement(CodeElement codeElement, FlowType taintSource) { this.codeElement = codeElement; this.taintSource = taintSource; } + /* @Override public boolean equals(Object other) { diff --git a/scandroid/src/main/java/org/scandroid/domain/FieldElement.java b/scandroid/src/main/java/org/scandroid/domain/FieldElement.java index 494ea01c97..e5622e2722 100644 --- a/scandroid/src/main/java/org/scandroid/domain/FieldElement.java +++ b/scandroid/src/main/java/org/scandroid/domain/FieldElement.java @@ -53,12 +53,14 @@ public class FieldElement extends CodeElement { private final FieldReference fieldRef; private final InstanceKey object; + // private TypeReference object; public FieldElement(InstanceKey object, FieldReference fieldRef) { this.fieldRef = fieldRef; this.object = object; } + // public FieldElement(TypeReference object, String fieldname) // { // this.fieldname = fieldname; diff --git a/scandroid/src/main/java/org/scandroid/flow/OutflowAnalysis.java b/scandroid/src/main/java/org/scandroid/flow/OutflowAnalysis.java index 0ed6060b2c..53101ea63b 100644 --- a/scandroid/src/main/java/org/scandroid/flow/OutflowAnalysis.java +++ b/scandroid/src/main/java/org/scandroid/flow/OutflowAnalysis.java @@ -87,7 +87,9 @@ import org.scandroid.spec.StaticFieldSinkSpec; import org.scandroid.util.CGAnalysisContext; -/** @author acfoltzer */ +/** + * @author acfoltzer + */ public class OutflowAnalysis { private final CGAnalysisContext ctx; diff --git a/scandroid/src/main/java/org/scandroid/flow/StaticFieldSinkPoint.java b/scandroid/src/main/java/org/scandroid/flow/StaticFieldSinkPoint.java index 2da3b89d18..eebb00c272 100644 --- a/scandroid/src/main/java/org/scandroid/flow/StaticFieldSinkPoint.java +++ b/scandroid/src/main/java/org/scandroid/flow/StaticFieldSinkPoint.java @@ -54,7 +54,9 @@ import org.scandroid.spec.StaticFieldSinkSpec; import org.scandroid.util.CGAnalysisContext; -/** @author acfoltzer */ +/** + * @author acfoltzer + */ public class StaticFieldSinkPoint implements ISinkPoint { // private static final Logger logger = LoggerFactory // .getLogger(StaticFieldSinkPoint.class); diff --git a/scandroid/src/main/java/org/scandroid/flow/functions/IFDSTaintFlowFunctionProvider.java b/scandroid/src/main/java/org/scandroid/flow/functions/IFDSTaintFlowFunctionProvider.java index 39882f29a2..3542367b31 100644 --- a/scandroid/src/main/java/org/scandroid/flow/functions/IFDSTaintFlowFunctionProvider.java +++ b/scandroid/src/main/java/org/scandroid/flow/functions/IFDSTaintFlowFunctionProvider.java @@ -96,7 +96,9 @@ import org.scandroid.domain.ReturnElement; import org.scandroid.flow.types.FlowType; -/** @deprecated Replaced by TaintTransferFunctions. */ +/** + * @deprecated Replaced by TaintTransferFunctions. + */ @Deprecated public class IFDSTaintFlowFunctionProvider implements IFlowFunctionMap> { diff --git a/scandroid/src/main/java/org/scandroid/flow/functions/ReturnFlowFunction.java b/scandroid/src/main/java/org/scandroid/flow/functions/ReturnFlowFunction.java index 620b22e122..d33488d97c 100644 --- a/scandroid/src/main/java/org/scandroid/flow/functions/ReturnFlowFunction.java +++ b/scandroid/src/main/java/org/scandroid/flow/functions/ReturnFlowFunction.java @@ -49,13 +49,17 @@ import org.scandroid.domain.LocalElement; import org.scandroid.domain.ReturnElement; -/** @author creswick */ +/** + * @author creswick + */ public class ReturnFlowFunction implements IUnaryFlowFunction { private final IFDSTaintDomain domain; private final CodeElement ce; - /** @param def of the invoke instruction we're returning to */ + /** + * @param def of the invoke instruction we're returning to + */ public ReturnFlowFunction(IFDSTaintDomain domain, int def) { this.domain = domain; this.ce = new LocalElement(def); diff --git a/scandroid/src/main/java/org/scandroid/flow/types/StaticFieldFlow.java b/scandroid/src/main/java/org/scandroid/flow/types/StaticFieldFlow.java index 445b5c72ba..18c00feea8 100644 --- a/scandroid/src/main/java/org/scandroid/flow/types/StaticFieldFlow.java +++ b/scandroid/src/main/java/org/scandroid/flow/types/StaticFieldFlow.java @@ -43,7 +43,9 @@ import com.ibm.wala.ipa.cfg.BasicBlockInContext; import com.ibm.wala.ssa.ISSABasicBlock; -/** @author acfoltzer */ +/** + * @author acfoltzer + */ public class StaticFieldFlow extends FlowType { private final IField field; diff --git a/scandroid/src/main/java/org/scandroid/model/AppModelMethod.java b/scandroid/src/main/java/org/scandroid/model/AppModelMethod.java index f593eef2aa..44f83f97eb 100644 --- a/scandroid/src/main/java/org/scandroid/model/AppModelMethod.java +++ b/scandroid/src/main/java/org/scandroid/model/AppModelMethod.java @@ -79,6 +79,7 @@ public class AppModelMethod { int nextLocal; + /** A mapping from String (variable name) -> Integer (local number) */ private Map symbolTable = null; diff --git a/scandroid/src/main/java/org/scandroid/spec/AndroidSpecs.java b/scandroid/src/main/java/org/scandroid/spec/AndroidSpecs.java index 6faded44f4..99f3baf0d6 100644 --- a/scandroid/src/main/java/org/scandroid/spec/AndroidSpecs.java +++ b/scandroid/src/main/java/org/scandroid/spec/AndroidSpecs.java @@ -261,6 +261,7 @@ public SinkSpec[] getSinkSpecs() { } private static MethodNamePattern[] callBacks = new MethodNamePattern[] {}; + // public MethodNamePattern[] getCallBacks() { // if (callBacks == null) // callBacks = new MethodNamePattern[] {}; diff --git a/scandroid/src/main/java/org/scandroid/spec/FieldNamePattern.java b/scandroid/src/main/java/org/scandroid/spec/FieldNamePattern.java index 6c2fec2dc1..1cb723a571 100644 --- a/scandroid/src/main/java/org/scandroid/spec/FieldNamePattern.java +++ b/scandroid/src/main/java/org/scandroid/spec/FieldNamePattern.java @@ -59,6 +59,7 @@ public class FieldNamePattern { final String className; // null = match any class final String memberName; // null = match any method + // * used to match arbitrary substrings public FieldNamePattern(String c, String m) { className = c; diff --git a/scandroid/src/main/java/org/scandroid/spec/StaticFieldSinkSpec.java b/scandroid/src/main/java/org/scandroid/spec/StaticFieldSinkSpec.java index abac38f2dc..8d3f08fbdc 100644 --- a/scandroid/src/main/java/org/scandroid/spec/StaticFieldSinkSpec.java +++ b/scandroid/src/main/java/org/scandroid/spec/StaticFieldSinkSpec.java @@ -49,7 +49,9 @@ import org.scandroid.flow.types.FlowType; import org.scandroid.flow.types.StaticFieldFlow; -/** @author acfoltzer */ +/** + * @author acfoltzer + */ public class StaticFieldSinkSpec extends SinkSpec { private final IField field; diff --git a/scandroid/src/main/java/org/scandroid/spec/StaticFieldSourceSpec.java b/scandroid/src/main/java/org/scandroid/spec/StaticFieldSourceSpec.java index ebf30ff49d..c666f022a9 100644 --- a/scandroid/src/main/java/org/scandroid/spec/StaticFieldSourceSpec.java +++ b/scandroid/src/main/java/org/scandroid/spec/StaticFieldSourceSpec.java @@ -66,7 +66,9 @@ import org.scandroid.flow.types.StaticFieldFlow; import org.scandroid.util.CGAnalysisContext; -/** @author creswick */ +/** + * @author creswick + */ public class StaticFieldSourceSpec extends SourceSpec { private final IField field; diff --git a/scandroid/src/main/java/org/scandroid/spec/StaticSpecs.java b/scandroid/src/main/java/org/scandroid/spec/StaticSpecs.java index f268a05ebf..0f8b692c8b 100644 --- a/scandroid/src/main/java/org/scandroid/spec/StaticSpecs.java +++ b/scandroid/src/main/java/org/scandroid/spec/StaticSpecs.java @@ -48,7 +48,9 @@ import java.util.Collection; import java.util.List; -/** @author creswick */ +/** + * @author creswick + */ public class StaticSpecs implements ISpecs { private final ClassHierarchy cha; diff --git a/scandroid/src/main/java/org/scandroid/util/DexDotUtil.java b/scandroid/src/main/java/org/scandroid/util/DexDotUtil.java index dd1a448522..bc4549827e 100644 --- a/scandroid/src/main/java/org/scandroid/util/DexDotUtil.java +++ b/scandroid/src/main/java/org/scandroid/util/DexDotUtil.java @@ -172,7 +172,9 @@ public static File writeDotFile( } } - /** @return StringBuffer holding dot output representing G */ + /** + * @return StringBuffer holding dot output representing G + */ public static StringBuilder dotOutput(Graph g, NodeDecorator labels, String title) throws WalaException { StringBuilder result = new StringBuilder("digraph \"DirectedGraph\" {\n"); diff --git a/scandroid/src/main/java/org/scandroid/util/IEntryPointSpecifier.java b/scandroid/src/main/java/org/scandroid/util/IEntryPointSpecifier.java index 8161e3b36a..618c4b9651 100644 --- a/scandroid/src/main/java/org/scandroid/util/IEntryPointSpecifier.java +++ b/scandroid/src/main/java/org/scandroid/util/IEntryPointSpecifier.java @@ -44,6 +44,8 @@ public interface IEntryPointSpecifier { - /** @return a list of entrypoints for the given analysis context */ + /** + * @return a list of entrypoints for the given analysis context + */ List specify(AndroidAnalysisContext analysisContext); } diff --git a/scandroid/src/main/java/org/scandroid/util/ISCanDroidOptions.java b/scandroid/src/main/java/org/scandroid/util/ISCanDroidOptions.java index 947c351f57..31d8f677ed 100644 --- a/scandroid/src/main/java/org/scandroid/util/ISCanDroidOptions.java +++ b/scandroid/src/main/java/org/scandroid/util/ISCanDroidOptions.java @@ -48,63 +48,103 @@ */ public interface ISCanDroidOptions { - /** @return whether to create a full call graph pdf */ + /** + * @return whether to create a full call graph pdf + */ boolean pdfCG(); - /** @return whether to create an application-only call graph pdf */ + /** + * @return whether to create an application-only call graph pdf + */ boolean pdfPartialCG(); - /** @return whether to create a call graph of application + 1 level of system calls */ + /** + * @return whether to create a call graph of application + 1 level of system calls + */ boolean pdfOneLevelCG(); - /** @return whether to create a system + 1 level of application call graph */ + /** + * @return whether to create a system + 1 level of application call graph + */ boolean systemToApkCG(); - /** @return whether to print a full call graph to stdout */ + /** + * @return whether to print a full call graph to stdout + */ boolean stdoutCG(); - /** @return whether to include the Android library in flow analysis */ + /** + * @return whether to include the Android library in flow analysis + */ boolean includeLibrary(); - /** @return whether to analyze each entry point separately */ + /** + * @return whether to analyze each entry point separately + */ boolean separateEntries(); - /** @return whether to bring up a GUI to analyze domain elements for flow analysis */ + /** + * @return whether to bring up a GUI to analyze domain elements for flow analysis + */ boolean ifdsExplorer(); - /** @return whether to look for main methods and add them as entry points */ + /** + * @return whether to look for main methods and add them as entry points + */ boolean addMainEntrypoints(); - /** @return whether to use ServerThread.run as the entry point for analysis */ + /** + * @return whether to use ServerThread.run as the entry point for analysis + */ boolean useThreadRunMain(); - /** @return whether to run string prefix analysis */ + /** + * @return whether to run string prefix analysis + */ boolean stringPrefixAnalysis(); - /** @return whether to stop after generating the call graph */ + /** + * @return whether to stop after generating the call graph + */ boolean testCGBuilder(); - /** @return whether to log class hierarchy warnings */ + /** + * @return whether to log class hierarchy warnings + */ boolean classHierarchyWarnings(); - /** @return whether to log call graph builder warnings */ + /** + * @return whether to log call graph builder warnings + */ boolean cgBuilderWarnings(); - /** @return whether to check conformance to built-in policy */ + /** + * @return whether to check conformance to built-in policy + */ boolean useDefaultPolicy(); - /** @return the URI pointing to the jar or apk to analyze */ + /** + * @return the URI pointing to the jar or apk to analyze + */ URI getClasspath(); - /** @return the filename portion of the classpath to analyze */ + /** + * @return the filename portion of the classpath to analyze + */ String getFilename(); - /** @return a URI to the Android library jar */ + /** + * @return a URI to the Android library jar + */ URI getAndroidLibrary(); - /** @return the ReflectionOptions for this run */ + /** + * @return the ReflectionOptions for this run + */ ReflectionOptions getReflectionOptions(); - /** @return a URI to the XML method summaries file */ + /** + * @return a URI to the XML method summaries file + */ URI getSummariesURI(); } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/bench/InterfaceAnalyzer.java b/shrike/src/main/java/com/ibm/wala/shrike/bench/InterfaceAnalyzer.java index 2afb5d623d..39ec44c5bd 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/bench/InterfaceAnalyzer.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/bench/InterfaceAnalyzer.java @@ -21,7 +21,9 @@ import java.util.HashMap; import java.util.Map; -/** @author roca */ +/** + * @author roca + */ public class InterfaceAnalyzer { static final class TypeStats { int totalOccurrences; diff --git a/shrike/src/main/java/com/ibm/wala/shrike/bench/Slots.java b/shrike/src/main/java/com/ibm/wala/shrike/bench/Slots.java index baa3d08cd1..cc5c55fc1e 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/bench/Slots.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/bench/Slots.java @@ -10,7 +10,9 @@ */ package com.ibm.wala.shrike.bench; -/** @author roca@us.ibm.com */ +/** + * @author roca@us.ibm.com + */ public class Slots { public static Object o; diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/CheckCastInstruction.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/CheckCastInstruction.java index 17e4e021d1..5cf3ffe6ae 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/CheckCastInstruction.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/CheckCastInstruction.java @@ -46,7 +46,9 @@ public int getPoppedCount() { return 1; } - /** @return the type to which the operand is cast */ + /** + * @return the type to which the operand is cast + */ @Override public String[] getTypes() { return new String[] {type}; diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/ComparisonInstruction.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/ComparisonInstruction.java index c136054d11..282aefdbdd 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/ComparisonInstruction.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/ComparisonInstruction.java @@ -66,7 +66,9 @@ public boolean equals(Object o) { } } - /** @return OPR_cmp (for long), OPR_cmpl, or OPR_cmpg (for float and double) */ + /** + * @return OPR_cmp (for long), OPR_cmpl, or OPR_cmpg (for float and double) + */ @Override public Operator getOperator() { switch (opcode) { diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Compiler.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Compiler.java index 9959dee496..48cb65d2b6 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Compiler.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Compiler.java @@ -138,7 +138,9 @@ protected Compiler(MethodData info) { info.getInstructionsToBytecodes()); } - /** @return the JVM type for the class this method belongs to */ + /** + * @return the JVM type for the class this method belongs to + */ public final String getClassType() { return classType; } @@ -1933,7 +1935,9 @@ public static final class Output { this.instructionsToOffsets = instructionsToOffsets; } - /** @return the actual bytecodes */ + /** + * @return the actual bytecodes + */ public byte[] getCode() { return code; } @@ -1950,7 +1954,9 @@ public String getMethodName() { return name; } - /** @return the method signature in JVM format */ + /** + * @return the method signature in JVM format + */ public String getMethodSignature() { return signature; } @@ -1963,12 +1969,16 @@ public int getAccessFlags() { return name != null ? (ACC_PRIVATE | (isStatic ? ACC_STATIC : 0)) : 0; } - /** @return the raw exception handler table in JVM format */ + /** + * @return the raw exception handler table in JVM format + */ public int[] getRawHandlers() { return rawHandlers; } - /** @return whether the method is static */ + /** + * @return whether the method is static + */ public boolean isStatic() { return isStatic; } @@ -1981,12 +1991,16 @@ public int[] getNewBytecodesToOldBytecodes() { return newBytecodesToOldBytecodes; } - /** @return the maximum stack size in words as required by the JVM */ + /** + * @return the maximum stack size in words as required by the JVM + */ public int getMaxStack() { return maxStack; } - /** @return the maximum local variable size in words as required by the JVM */ + /** + * @return the maximum local variable size in words as required by the JVM + */ public int getMaxLocals() { return maxLocals; } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/ConstantInstruction.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/ConstantInstruction.java index f37cdd6ce7..8517c6bba7 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/ConstantInstruction.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/ConstantInstruction.java @@ -688,10 +688,14 @@ public int getCPIndex() { } } - /** @return the constant value pushed: an Integer, a Long, a Float, a Double, a String, or null */ + /** + * @return the constant value pushed: an Integer, a Long, a Float, a Double, a String, or null + */ public abstract Object getValue(); - /** @return the type of the value pushed */ + /** + * @return the type of the value pushed + */ public abstract String getType(); public static ConstantInstruction make(String type, Object constant) diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Decoder.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Decoder.java index a6c6255564..9fb9a7d1e7 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Decoder.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Decoder.java @@ -893,7 +893,9 @@ void setIndex(int i) { } } - /** @return the offset of the bytecode instruction deemed to be invalid */ + /** + * @return the offset of the bytecode instruction deemed to be invalid + */ public int getIndex() { return index; } @@ -1155,7 +1157,9 @@ public final int[] getInstructionsToBytecodes() { return instructionsToBytecodes; } - /** @return true iff the method decoded by this Decoder contains subroutines (JSRs) */ + /** + * @return true iff the method decoded by this Decoder contains subroutines (JSRs) + */ public final boolean containsSubroutines() { if (instructions == null) { throw new Error("Call decode() before calling containsSubroutines()"); diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/DupInstruction.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/DupInstruction.java index 784dff9453..3b9ecf74b9 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/DupInstruction.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/DupInstruction.java @@ -54,7 +54,9 @@ static DupInstruction make(int size, int delta) { return preallocated[size * 3 + delta]; } - /** @param delta 0 for dup, 1 for dup_x1 */ + /** + * @param delta 0 for dup, 1 for dup_x1 + */ public static DupInstruction make(int delta) { if (delta < 0 || delta > 1) { throw new IllegalArgumentException("Invalid dup delta: " + delta); diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/ExceptionHandler.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/ExceptionHandler.java index eb3dc0a4ee..9ab706b8e0 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/ExceptionHandler.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/ExceptionHandler.java @@ -55,7 +55,9 @@ public ExceptionHandler(int handler, String catchClass) { this(handler, catchClass, null); } - /** @return the label of the handler code */ + /** + * @return the label of the handler code + */ public int getHandler() { return handler; } @@ -64,7 +66,9 @@ public Object getCatchClassLoader() { return catchClassLoader; } - /** @return the type of exceptions to be caught, or null if all exceptions should be caught */ + /** + * @return the type of exceptions to be caught, or null if all exceptions should be caught + */ public String getCatchClass() { return catchClass; } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/IInstruction.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/IInstruction.java index c63ce7b2da..008346f25d 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/IInstruction.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/IInstruction.java @@ -76,7 +76,9 @@ public void visitLoadIndirect(ILoadIndirectInstruction instruction) {} public void visitStoreIndirect(IStoreIndirectInstruction instruction) {} } - /** @return true if the instruction can "fall through" to the following instruction */ + /** + * @return true if the instruction can "fall through" to the following instruction + */ boolean isFallThrough(); /** @@ -91,7 +93,9 @@ public void visitStoreIndirect(IStoreIndirectInstruction instruction) {} */ IInstruction redirectTargets(int[] targetMap); - /** @return the number of values this instruction pops off the working stack */ + /** + * @return the number of values this instruction pops off the working stack + */ int getPoppedCount(); /** diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/IInvokeInstruction.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/IInvokeInstruction.java index 4246feb322..aa54035240 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/IInvokeInstruction.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/IInvokeInstruction.java @@ -16,7 +16,9 @@ */ public interface IInvokeInstruction extends IInstruction { - /** @return one of BytecodeConstants.INVOKE[SPECIAL|VIRTUAL|STATIC|INTERFACE] */ + /** + * @return one of BytecodeConstants.INVOKE[SPECIAL|VIRTUAL|STATIC|INTERFACE] + */ IDispatch getInvocationCode(); String getMethodSignature(); diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Instruction.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Instruction.java index 41f28f4f24..b6942f2697 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Instruction.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Instruction.java @@ -51,7 +51,9 @@ public abstract class Instruction implements Constants, Cloneable, IInstruction final short opcode; - /** @return true if the instruction can "fall through" to the following instruction */ + /** + * @return true if the instruction can "fall through" to the following instruction + */ @Override public boolean isFallThrough() { return true; @@ -75,13 +77,17 @@ public IInstruction redirectTargets(int[] targetMap) { return this; } - /** @return the number of values this instruction pops off the working stack */ + /** + * @return the number of values this instruction pops off the working stack + */ @Override public int getPoppedCount() { return 0; } - /** @return the opcode selected for this instruction, or -1 if we don't know it yet */ + /** + * @return the opcode selected for this instruction, or -1 if we don't know it yet + */ public final short getOpcode() { return opcode; } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/InvokeDynamicInstruction.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/InvokeDynamicInstruction.java index f3d473b08a..a72f33d423 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/InvokeDynamicInstruction.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/InvokeDynamicInstruction.java @@ -157,8 +157,12 @@ ConstantPoolReader getLazyConstantPool() { } public CallSite bootstrap(Class cl) - throws ClassNotFoundException, NoSuchMethodException, SecurityException, - IllegalAccessException, IllegalArgumentException, InvocationTargetException, + throws ClassNotFoundException, + NoSuchMethodException, + SecurityException, + IllegalAccessException, + IllegalArgumentException, + InvocationTargetException, NoSuchFieldException { ClassLoader classLoader = cl.getClassLoader(); ClassLoader bootstrapCL = classLoader; diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/LoadInstruction.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/LoadInstruction.java index de067828f6..c2121ac232 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/LoadInstruction.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/LoadInstruction.java @@ -46,7 +46,9 @@ public static LoadInstruction make(String type, int index) throws IllegalArgumen } } - /** @return the index of the local variable loaded */ + /** + * @return the index of the local variable loaded + */ @Override public int getVarIndex() { return index; diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/MethodData.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/MethodData.java index c42abd18f3..bb4bf1ed18 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/MethodData.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/MethodData.java @@ -138,47 +138,65 @@ public void setHasChanged() { hasChanged = true; } - /** @return the method signature, in JVM format */ + /** + * @return the method signature, in JVM format + */ public String getSignature() { return signature; } - /** @return the method name */ + /** + * @return the method name + */ public String getName() { return name; } - /** @return the method access flags */ + /** + * @return the method access flags + */ public int getAccess() { return access; } - /** @return the JVM type for the class defining the method (e.g., Ljava/lang/Object;) */ + /** + * @return the JVM type for the class defining the method (e.g., Ljava/lang/Object;) + */ public String getClassType() { return classType; } - /** @return whether or not the method is static */ + /** + * @return whether or not the method is static + */ public boolean getIsStatic() { return (access & Constants.ACC_STATIC) != 0; } - /** @return whether or not the method is synchronized */ + /** + * @return whether or not the method is synchronized + */ public boolean getIsSynchronized() { return (access & Constants.ACC_SYNCHRONIZED) != 0; } - /** @return the exception handler lists */ + /** + * @return the exception handler lists + */ public ExceptionHandler[][] getHandlers() { return handlers; } - /** @return the instruction array */ + /** + * @return the instruction array + */ public IInstruction[] getInstructions() { return instructions; } - /** @return the map from instructions to bytecode offsets */ + /** + * @return the map from instructions to bytecode offsets + */ public int[] getInstructionsToBytecodes() { return instructionsToBytecodes; } @@ -239,7 +257,9 @@ void update( hasChanged = true; } - /** @return true iff the code has been updated at least once */ + /** + * @return true iff the code has been updated at least once + */ public boolean getHasChanged() { return hasChanged; } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/MethodEditor.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/MethodEditor.java index 17cc7bbe15..91c9a684bb 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/MethodEditor.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/MethodEditor.java @@ -170,19 +170,25 @@ private static String getStateMessage(int state) { } } - /** @return the current handler array */ + /** + * @return the current handler array + */ public ExceptionHandler[][] getHandlers() { verifyState(BEFORE_PASS | DURING_PASS); return handlers; } - /** @return the current instruction array */ + /** + * @return the current instruction array + */ public IInstruction[] getInstructions() { verifyState(BEFORE_PASS | DURING_PASS); return instructions; } - /** @return the current instructions-to-bytecode-offsets map */ + /** + * @return the current instructions-to-bytecode-offsets map + */ public int[] getInstructionsToBytecodes() { verifyState(BEFORE_PASS | DURING_PASS); return instructionsToBytecodes; @@ -685,7 +691,9 @@ public final void setIndex(MethodEditor e, int i) { editor = e; } - /** @return the index of the current instruction in the code array */ + /** + * @return the index of the current instruction in the code array + */ public final int getIndex() { return index; } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/PopInstruction.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/PopInstruction.java index 9bf142fc03..db735c3e23 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/PopInstruction.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/PopInstruction.java @@ -19,7 +19,9 @@ private PopInstruction(byte size) { this.size = size; } - /** @param size 1 or 2, the number of elements to pop */ + /** + * @param size 1 or 2, the number of elements to pop + */ public static PopInstruction make(int size) { if (size < 0 || size > 2) { throw new IllegalArgumentException("Invalid pop size: " + size); diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/StoreInstruction.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/StoreInstruction.java index 992599eeaf..75ac6b687e 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/StoreInstruction.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/StoreInstruction.java @@ -46,7 +46,9 @@ public static StoreInstruction make(String type, int index) throws IllegalArgume } } - /** @return the index of the local variable stored */ + /** + * @return the index of the local variable stored + */ @Override public int getVarIndex() { return index; diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/SwitchInstruction.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/SwitchInstruction.java index 7ec1e6a761..ca41e9af99 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/SwitchInstruction.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/SwitchInstruction.java @@ -24,12 +24,16 @@ private SwitchInstruction(short opcode, int[] casesAndLabels, int defaultLabel) this.defaultLabel = defaultLabel; } - /** @return the label which is branched to if none of the cases match */ + /** + * @return the label which is branched to if none of the cases match + */ public int getDefaultLabel() { return defaultLabel; } - /** @return an array of flattened (case, label) pairs, sorted in increasing order by case */ + /** + * @return an array of flattened (case, label) pairs, sorted in increasing order by case + */ public int[] getCasesAndLabels() { return casesAndLabels; } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Util.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Util.java index 35f1054d9f..bee7ac3e43 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Util.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/Util.java @@ -44,7 +44,9 @@ public static byte getWordSize(String s) { return getWordSize(s, 0); } - /** @return the JVM "stack word size" for the given JVM type, looking at index 'index' */ + /** + * @return the JVM "stack word size" for the given JVM type, looking at index 'index' + */ static byte getWordSize(String s, int index) { switch (s.charAt(index)) { case 'V': @@ -307,7 +309,9 @@ public static String makeArray(String t) { return ('[' + t).intern(); } - /** @return true iff t is an array type */ + /** + * @return true iff t is an array type + */ public static boolean isArrayType(String t) { if (t == null || t.length() == 0) { return false; @@ -321,7 +325,9 @@ public static boolean isArrayType(String t) { } } - /** @return true iff t is a primitive type */ + /** + * @return true iff t is a primitive type + */ public static boolean isPrimitiveType(String t) { if (t == null || t.length() == 0) { return false; diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/analysis/Analyzer.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/analysis/Analyzer.java index 3a864383b5..a9c28e9325 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/analysis/Analyzer.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/analysis/Analyzer.java @@ -31,7 +31,9 @@ import java.util.BitSet; import java.util.List; -/** @author roca */ +/** + * @author roca + */ public class Analyzer { public static final String thisType = "THIS"; @@ -426,12 +428,16 @@ public static final class FailureException extends Exception { this.path = path; } - /** @return the index of the Instruction which failed to verify */ + /** + * @return the index of the Instruction which failed to verify + */ public int getOffset() { return offset; } - /** @return a description of the reason why verification failed */ + /** + * @return a description of the reason why verification failed + */ public String getReason() { return reason; } @@ -487,17 +493,23 @@ public static final class PathElement { this.index = index; } - /** @return the bytecode offset of the instruction causing a value transfer. */ + /** + * @return the bytecode offset of the instruction causing a value transfer. + */ public int getIndex() { return index; } - /** @return the types of the local variabls at the instruction. */ + /** + * @return the types of the local variabls at the instruction. + */ public String[] getLocals() { return locals; } - /** @return the types of the working stack at the instruction. */ + /** + * @return the types of the working stack at the instruction. + */ public String[] getStack() { return stack; } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/analysis/ClassHierarchyProvider.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/analysis/ClassHierarchyProvider.java index 846401c750..ec31ce306c 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/analysis/ClassHierarchyProvider.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/analysis/ClassHierarchyProvider.java @@ -23,7 +23,9 @@ public interface ClassHierarchyProvider { */ String getSuperClass(String cl); - /** @return the superinterfaces of the given class, or null if they are not known */ + /** + * @return the superinterfaces of the given class, or null if they are not known + */ String[] getSuperInterfaces(String cl); /** @@ -32,6 +34,8 @@ public interface ClassHierarchyProvider { */ String[] getSubClasses(String cl); - /** @return whether or not cl is an interface, or Constants.MAYBE if not known */ + /** + * @return whether or not cl is an interface, or Constants.MAYBE if not known + */ int isInterface(String cl); } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/info/ThisAssignmentChecker.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/info/ThisAssignmentChecker.java index 041e5fa21b..c5ce05aadf 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/info/ThisAssignmentChecker.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/info/ThisAssignmentChecker.java @@ -56,7 +56,9 @@ public boolean notifyUpdate( return true; } - /** @return true iff 'this' is assigned to by the method */ + /** + * @return true iff 'this' is assigned to by the method + */ public static boolean isThisAssigned(MethodData info) throws IllegalArgumentException { if (info == null) { throw new IllegalArgumentException(); diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/shrikeCT/ClassInstrumenter.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/shrikeCT/ClassInstrumenter.java index e1230ecbee..28b6d305b5 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/shrikeCT/ClassInstrumenter.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/shrikeCT/ClassInstrumenter.java @@ -67,7 +67,9 @@ public ClassInstrumenter(String inputName, byte[] bytes, ClassHierarchyProvider this(inputName, new ClassReader(bytes), cha); } - /** @return name of resource from which this class was read */ + /** + * @return name of resource from which this class was read + */ public String getInputName() { return inputName; } @@ -99,7 +101,9 @@ public ClassInstrumenter(String inputName, ClassReader cr, ClassHierarchyProvide this.inputName = inputName; } - /** @return the reader for the class */ + /** + * @return the reader for the class + */ public ClassReader getReader() { return cr; } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/shrikeCT/tools/BootstrapDumper.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/shrikeCT/tools/BootstrapDumper.java index 999595c26f..11b5817c85 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/shrikeCT/tools/BootstrapDumper.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/shrikeCT/tools/BootstrapDumper.java @@ -70,9 +70,15 @@ public static void main(String[] args) throws Exception { } private void dumpAttributes(Class cl, ClassReader.AttrIterator attrs) - throws InvalidClassFileException, InvalidBytecodeException, ClassNotFoundException, - NoSuchMethodException, SecurityException, IllegalAccessException, - IllegalArgumentException, InvocationTargetException, NoSuchFieldException { + throws InvalidClassFileException, + InvalidBytecodeException, + ClassNotFoundException, + NoSuchMethodException, + SecurityException, + IllegalAccessException, + IllegalArgumentException, + InvocationTargetException, + NoSuchFieldException { for (; attrs.isValid(); attrs.advance()) { String name = attrs.getName(); if (name.equals("Code")) { @@ -106,9 +112,15 @@ private void dumpAttributes(Class cl, ClassReader.AttrIterator attrs) * @throws IllegalArgumentException if cr is null */ public void doClass(ClassLoader image, final ClassReader cr) - throws InvalidClassFileException, InvalidBytecodeException, ClassNotFoundException, - NoSuchMethodException, SecurityException, IllegalAccessException, - IllegalArgumentException, InvocationTargetException, NoSuchFieldException { + throws InvalidClassFileException, + InvalidBytecodeException, + ClassNotFoundException, + NoSuchMethodException, + SecurityException, + IllegalAccessException, + IllegalArgumentException, + InvocationTargetException, + NoSuchFieldException { if (cr == null) { throw new IllegalArgumentException("cr is null"); } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/shrikeCT/tools/BootstrapInstrumentor.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/shrikeCT/tools/BootstrapInstrumentor.java index 1dedd36974..ecc0c1ca5e 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/shrikeCT/tools/BootstrapInstrumentor.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/shrikeCT/tools/BootstrapInstrumentor.java @@ -77,7 +77,9 @@ public void doit(String[] args) throws Exception { } private Set dumpAttributes(ClassInstrumenter ci, ClassReader.AttrIterator attrs) - throws InvalidClassFileException, InvalidBytecodeException, SecurityException, + throws InvalidClassFileException, + InvalidBytecodeException, + SecurityException, IllegalArgumentException { Set result = HashSetFactory.make(); ClassReader cr = ci.getReader(); @@ -155,7 +157,9 @@ private Set dumpAttributes(ClassInstrumenter ci, ClassReader.AttrIte * @throws IllegalArgumentException if cr is null */ public Set doClass(final ClassInstrumenter ci) - throws InvalidClassFileException, InvalidBytecodeException, SecurityException, + throws InvalidClassFileException, + InvalidBytecodeException, + SecurityException, IllegalArgumentException { ClassReader cr = ci.getReader(); ClassReader.AttrIterator attrs = new ClassReader.AttrIterator(); diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/tools/OfflineInstrumenterBase.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/tools/OfflineInstrumenterBase.java index d728509dec..1ff73b3ac2 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/tools/OfflineInstrumenterBase.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeBT/tools/OfflineInstrumenterBase.java @@ -91,7 +91,9 @@ public final String getClassName() { /** Open the resource for reading as a stream. */ public abstract InputStream open() throws IOException; - /** @return true if this resource represents a class, false otherwise */ + /** + * @return true if this resource represents a class, false otherwise + */ public boolean isClass() { return true; } @@ -327,7 +329,9 @@ public final String[] parseStandardArgs(String[] args) return r; } - /** @return the number of source classes to be instrumented */ + /** + * @return the number of source classes to be instrumented + */ public final int getNumInputClasses() { return inputs.size(); } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/AnnotationsReader.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/AnnotationsReader.java index e2866df26e..05d81621c2 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/AnnotationsReader.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/AnnotationsReader.java @@ -32,14 +32,18 @@ public AnnotationsReader(ClassReader.AttrIterator iter, String label) beginOffset = attr; } - /** @return number of annotations in this attribute */ + /** + * @return number of annotations in this attribute + */ public int getAnnotationCount() throws InvalidClassFileException { int offset = beginOffset + 6; checkSize(offset, 2); return cr.getUShort(offset); } - /** @return total length of this attribute in bytes, including the first 6 bytes */ + /** + * @return total length of this attribute in bytes, including the first 6 bytes + */ public int getAttributeSize() throws InvalidClassFileException { int offset = beginOffset + 2; checkSize(offset, 4); diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/AttributeReader.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/AttributeReader.java index ebd4c8b6ce..b0060ccf73 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/AttributeReader.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/AttributeReader.java @@ -44,17 +44,23 @@ protected AttributeReader(ClassReader.AttrIterator attr, String expectedName) } } - /** @return the class reader the attribute belongs to */ + /** + * @return the class reader the attribute belongs to + */ public final ClassReader getClassReader() { return cr; } - /** @return the offset of the raw attribute data (including the attribute header) */ + /** + * @return the offset of the raw attribute data (including the attribute header) + */ public final int getRawOffset() { return attr; } - /** @return the size of the raw attribute data (including the attribute header) */ + /** + * @return the size of the raw attribute data (including the attribute header) + */ public final int getRawSize() { return length; } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ClassReader.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ClassReader.java index f8d1e6038f..1f17602544 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ClassReader.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ClassReader.java @@ -153,32 +153,44 @@ private int parseMethods(int offset, int count) throws InvalidClassFileException return offset; } - /** @return the raw class data bytes */ + /** + * @return the raw class data bytes + */ public byte[] getBytes() { return bytes; } - /** @return the magic number at the start of the class file. */ + /** + * @return the magic number at the start of the class file. + */ public int getMagic() { return getInt(0); } - /** @return the minor version of the class file */ + /** + * @return the minor version of the class file + */ public int getMinorVersion() { return getUShort(4); } - /** @return the major version of the class file */ + /** + * @return the major version of the class file + */ public int getMajorVersion() { return getUShort(6); } - /** @return the access flags for the class */ + /** + * @return the access flags for the class + */ public int getAccessFlags() { return getUShort(classInfoOffset); } - /** @return the index of the constant pool entry for the class name */ + /** + * @return the index of the constant pool entry for the class name + */ public int getNameIndex() { return getUShort(classInfoOffset + 2); } @@ -196,7 +208,9 @@ String getClassFromAddress(int addr) throws InvalidClassFileException { } } - /** @return the name of the class in JVM format (e.g., java/lang/Object) */ + /** + * @return the name of the class in JVM format (e.g., java/lang/Object) + */ public String getName() throws InvalidClassFileException { String s = getClassFromAddress(classInfoOffset + 2); if (s == null) { @@ -206,7 +220,9 @@ public String getName() throws InvalidClassFileException { } } - /** @return the constant pool index of the superclass name, or 0 if this is java.lang.Object */ + /** + * @return the constant pool index of the superclass name, or 0 if this is java.lang.Object + */ public int getSuperNameIndex() { return getUShort(classInfoOffset + 4); } @@ -219,7 +235,9 @@ public String getSuperName() throws InvalidClassFileException { return getClassFromAddress(classInfoOffset + 4); } - /** @return the number of interfaces this class implements */ + /** + * @return the number of interfaces this class implements + */ public int getInterfaceCount() { return interfaceCount; } @@ -230,13 +248,17 @@ private void verifyInterfaceIndex(int i) { } } - /** @return the constant pool index of the name of the i'th implemented interface */ + /** + * @return the constant pool index of the name of the i'th implemented interface + */ public int getInterfaceNameIndex(int i) { verifyInterfaceIndex(i); return getUShort(classInfoOffset + 8 + 2 * i); } - /** @return an array of the constant pool indices for the names of the implemented interfaces */ + /** + * @return an array of the constant pool indices for the names of the implemented interfaces + */ public int[] getInterfaceNameIndices() { int[] indices = new int[interfaceCount]; for (int i = 0; i < interfaceCount; i++) { @@ -245,7 +267,9 @@ public int[] getInterfaceNameIndices() { return indices; } - /** @return the name of the i'th implemented interface */ + /** + * @return the name of the i'th implemented interface + */ public String getInterfaceName(int i) throws InvalidClassFileException { verifyInterfaceIndex(i); String s = getClassFromAddress(classInfoOffset + 8 + 2 * i); @@ -257,7 +281,9 @@ public String getInterfaceName(int i) throws InvalidClassFileException { } } - /** @return an array of the names of the implemented interfaces */ + /** + * @return an array of the names of the implemented interfaces + */ public String[] getInterfaceNames() throws InvalidClassFileException { String[] names = new String[interfaceCount]; for (int i = 0; i < interfaceCount; i++) { @@ -280,7 +306,9 @@ public ConstantPoolParser getCP() { return cpParser; } - /** @return the signed 32-bit value at offset i in the class data */ + /** + * @return the signed 32-bit value at offset i in the class data + */ public int getInt(int i) { return (bytes[i] << 24) + ((bytes[i + 1] & 0xFF) << 16) @@ -288,27 +316,37 @@ public int getInt(int i) { + (bytes[i + 3] & 0xFF); } - /** @return the unsigned 16-bit value at offset i in the class data */ + /** + * @return the unsigned 16-bit value at offset i in the class data + */ public int getUShort(int i) { return ((bytes[i] & 0xFF) << 8) + (bytes[i + 1] & 0xFF); } - /** @return the signed 16-bit value at offset i in the class data */ + /** + * @return the signed 16-bit value at offset i in the class data + */ public int getShort(int i) { return (bytes[i] << 8) + (bytes[i + 1] & 0xFF); } - /** @return the signed 8-bit value at offset i in the class data */ + /** + * @return the signed 8-bit value at offset i in the class data + */ public byte getByte(int i) { return bytes[i]; } - /** @return the unsigned 8-bit value at offset i in the class data */ + /** + * @return the unsigned 8-bit value at offset i in the class data + */ public int getUnsignedByte(int i) { return bytes[i] & 0xff; } - /** @return the number of fields in the class */ + /** + * @return the number of fields in the class + */ public int getFieldCount() { return fieldOffsets.length - 1; } @@ -319,7 +357,9 @@ private void verifyFieldIndex(int f) { } } - /** @return the access flags for the f'th field */ + /** + * @return the access flags for the f'th field + */ public int getFieldAccessFlags(int f) { verifyFieldIndex(f); return getUShort(fieldOffsets[f]); @@ -338,13 +378,17 @@ String getUtf8FromAddress(int addr) throws InvalidClassFileException { } } - /** @return the name of the f'th field */ + /** + * @return the name of the f'th field + */ public String getFieldName(int f) throws InvalidClassFileException { verifyFieldIndex(f); return getUtf8FromAddress(fieldOffsets[f] + 2); } - /** @return the type of the f'th field, in JVM format (e.g., I, Z, java/lang/Object) */ + /** + * @return the type of the f'th field, in JVM format (e.g., I, Z, java/lang/Object) + */ public String getFieldType(int f) throws InvalidClassFileException { verifyFieldIndex(f); return getUtf8FromAddress(fieldOffsets[f] + 4); @@ -468,7 +512,9 @@ public int getDataSize() { return size - 6; } - /** @return the number of attributes left in the list, including this attribute (if valid) */ + /** + * @return the number of attributes left in the list, including this attribute (if valid) + */ public int getRemainingAttributesCount() { return remaining; } @@ -498,7 +544,9 @@ public String getName() throws InvalidClassFileException { } } - /** @return whether this iterator is valid */ + /** + * @return whether this iterator is valid + */ public boolean isValid() { return remaining > 0; } @@ -530,19 +578,25 @@ public void initFieldAttributeIterator(int f, AttrIterator iter) { iter.init(this, fieldOffsets[f] + 6); } - /** @return the offset of the raw class data for field f */ + /** + * @return the offset of the raw class data for field f + */ public int getFieldRawOffset(int f) { verifyFieldIndex(f); return fieldOffsets[f]; } - /** @return the size of the raw class data for field f */ + /** + * @return the size of the raw class data for field f + */ public int getFieldRawSize(int f) { verifyFieldIndex(f); return fieldOffsets[f + 1] - fieldOffsets[f]; } - /** @return the number of methods in the class */ + /** + * @return the number of methods in the class + */ public int getMethodCount() { return methodOffsets.length - 1; } @@ -553,43 +607,57 @@ private void verifyMethodIndex(int m) { } } - /** @return the offset of the raw class data for method m */ + /** + * @return the offset of the raw class data for method m + */ public int getMethodRawOffset(int m) { verifyMethodIndex(m); return methodOffsets[m]; } - /** @return the size of the raw class data for method m */ + /** + * @return the size of the raw class data for method m + */ public int getMethodRawSize(int m) { verifyMethodIndex(m); return methodOffsets[m + 1] - methodOffsets[m]; } - /** @return the access flags for method m */ + /** + * @return the access flags for method m + */ public int getMethodAccessFlags(int m) { verifyMethodIndex(m); return getUShort(methodOffsets[m]); } - /** @return the name of method m */ + /** + * @return the name of method m + */ public String getMethodName(int m) throws InvalidClassFileException { verifyMethodIndex(m); return getUtf8FromAddress(methodOffsets[m] + 2); } - /** @return the method descriptor of method m in JVM format (e.g., (ILjava/lang/Object;)V ) */ + /** + * @return the method descriptor of method m in JVM format (e.g., (ILjava/lang/Object;)V ) + */ public String getMethodType(int m) throws InvalidClassFileException { verifyMethodIndex(m); return getUtf8FromAddress(methodOffsets[m] + 4); } - /** @return the constant pool index of the name of method m */ + /** + * @return the constant pool index of the name of method m + */ public int getMethodNameIndex(int m) { verifyMethodIndex(m); return getUShort(methodOffsets[m] + 2); } - /** @return the constant pool index of the method descriptor of method m */ + /** + * @return the constant pool index of the method descriptor of method m + */ public int getMethodTypeIndex(int m) { verifyMethodIndex(m); return getUShort(methodOffsets[m] + 4); diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ClassWriter.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ClassWriter.java index 1efbfbc009..e7f8325502 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ClassWriter.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ClassWriter.java @@ -572,7 +572,9 @@ public void setInterfaceNames(String[] ifaces) { public abstract static class Element { public Element() {} - /** @return the number of bytes that will be generated. */ + /** + * @return the number of bytes that will be generated. + */ public abstract int getSize(); /** diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/CodeReader.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/CodeReader.java index 14143d7f73..324bc84e79 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/CodeReader.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/CodeReader.java @@ -41,22 +41,30 @@ public CodeReader(ClassReader.AttrIterator iter) throws InvalidClassFileExceptio } } - /** @return the maximum stack size used by the code, in words */ + /** + * @return the maximum stack size used by the code, in words + */ public int getMaxStack() { return cr.getUShort(attr + 6); } - /** @return the maximum local variable size used by the code, in words */ + /** + * @return the maximum local variable size used by the code, in words + */ public int getMaxLocals() { return cr.getUShort(attr + 8); } - /** @return the length of the bytecode array, in bytes */ + /** + * @return the length of the bytecode array, in bytes + */ public int getBytecodeLength() { return codeLen; } - /** @return the bytecode bytes */ + /** + * @return the bytecode bytes + */ public byte[] getBytecode() { byte[] r = new byte[codeLen]; System.arraycopy(cr.getBytes(), attr + 14, r, 0, r.length); diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ConstantPoolParser.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ConstantPoolParser.java index 0703987f87..b60d4e405a 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ConstantPoolParser.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ConstantPoolParser.java @@ -121,12 +121,16 @@ public ConstantPoolParser(byte[] bytes, int offset, int itemCount) parseConstantPool(offset, itemCount); } - /** @return the buffer holding the raw class file data */ + /** + * @return the buffer holding the raw class file data + */ public byte[] getRawBytes() { return bytes; } - /** @return the offset of the constant pool data in the raw class file buffer */ + /** + * @return the offset of the constant pool data in the raw class file buffer + */ public int getRawOffset() throws IllegalStateException { if (cpOffsets.length < 2) { throw new IllegalStateException(); @@ -134,7 +138,9 @@ public int getRawOffset() throws IllegalStateException { return cpOffsets[1]; } - /** @return the size of the constant pool data in the raw class file buffer */ + /** + * @return the size of the constant pool data in the raw class file buffer + */ public int getRawSize() throws IllegalStateException { if (cpOffsets.length < 2) { throw new IllegalStateException(); @@ -142,7 +148,9 @@ public int getRawSize() throws IllegalStateException { return cpOffsets[cpOffsets.length - 1] - cpOffsets[1]; } - /** @return the number of constant pool items (maximum item index plus one) */ + /** + * @return the number of constant pool items (maximum item index plus one) + */ public int getItemCount() { return cpOffsets.length - 1; } @@ -155,7 +163,9 @@ private void checkLength(int offset, int required) throws InvalidClassFileExcept } } - /** @return the type of constant pool item i, or 0 if i is an unused constant pool item */ + /** + * @return the type of constant pool item i, or 0 if i is an unused constant pool item + */ public byte getItemType(int i) throws IllegalArgumentException { if (i < 1 || i >= cpItems.length) { throw new IllegalArgumentException("Constant pool item #" + i + " out of range"); @@ -216,7 +226,9 @@ public String getCPMethodType(int i) throws InvalidClassFileException, IllegalAr return s; } - /** @return the String at constant pool item i */ + /** + * @return the String at constant pool item i + */ public String getCPString(int i) throws InvalidClassFileException, IllegalArgumentException { if (i < 1 || i >= cpItems.length) { throw new IllegalArgumentException("Constant pool item #" + i + " out of range"); @@ -309,7 +321,9 @@ public String getCPRefType(int i) throws InvalidClassFileException, IllegalArgum } } - /** @return the name part of the NameAndType at constant pool item i */ + /** + * @return the name part of the NameAndType at constant pool item i + */ public String getCPNATName(int i) throws InvalidClassFileException, IllegalArgumentException { if (i < 1 || i >= cpItems.length) { throw new IllegalArgumentException("Constant pool item #" + i + " out of range"); @@ -406,7 +420,9 @@ public String getCPHandleClass(int i) throws InvalidClassFileException, IllegalA } } - /** @return the type of the MethodHandle at constant pool item i */ + /** + * @return the type of the MethodHandle at constant pool item i + */ public byte getCPHandleKind(int i) throws InvalidClassFileException, IllegalArgumentException { if (i < 1 || i >= cpItems.length) { throw new IllegalArgumentException("Constant pool item #" + i + " out of range"); @@ -423,7 +439,9 @@ public byte getCPHandleKind(int i) throws InvalidClassFileException, IllegalArgu } } - /** @return the value of the Integer at constant pool item i */ + /** + * @return the value of the Integer at constant pool item i + */ public int getCPInt(int i) throws IllegalArgumentException { if (i < 1 || i >= cpItems.length) { throw new IllegalArgumentException("Constant pool item #" + i + " out of range"); @@ -435,7 +453,9 @@ public int getCPInt(int i) throws IllegalArgumentException { return getInt(offset + 1); } - /** @return the value of the Float at constant pool item i */ + /** + * @return the value of the Float at constant pool item i + */ public float getCPFloat(int i) throws IllegalArgumentException { if (i < 1 || i >= cpItems.length) { throw new IllegalArgumentException("Constant pool item #" + i + " out of range"); @@ -447,7 +467,9 @@ public float getCPFloat(int i) throws IllegalArgumentException { return getFloat(offset + 1); } - /** @return the value of the Long at constant pool item i */ + /** + * @return the value of the Long at constant pool item i + */ public long getCPLong(int i) throws IllegalArgumentException { if (i < 1 || i >= cpItems.length) { throw new IllegalArgumentException("Constant pool item #" + i + " out of range"); @@ -459,7 +481,9 @@ public long getCPLong(int i) throws IllegalArgumentException { return getLong(offset + 1); } - /** @return the value of the Double at constant pool item i */ + /** + * @return the value of the Double at constant pool item i + */ public double getCPDouble(int i) throws IllegalArgumentException { if (i < 1 || i >= cpItems.length) { throw new IllegalArgumentException("Constant pool item #" + i + " out of range"); @@ -471,7 +495,9 @@ public double getCPDouble(int i) throws IllegalArgumentException { return getDouble(offset + 1); } - /** @return the BootstrapMethodTable index of the bootstrap method for this invokedynamic */ + /** + * @return the BootstrapMethodTable index of the bootstrap method for this invokedynamic + */ public BootstrapMethod getCPDynBootstrap(int i) throws InvalidClassFileException, IllegalArgumentException { if (i < 1 || i >= cpItems.length) { @@ -535,7 +561,9 @@ private InvalidClassFileException invalidUtf8(int item, int offset) { + ')'); } - /** @return the value of the Utf8 string at constant pool item i */ + /** + * @return the value of the Utf8 string at constant pool item i + */ public String getCPUtf8(int i) throws InvalidClassFileException, IllegalArgumentException { if (i < 1 || i >= cpItems.length) { throw new IllegalArgumentException("Constant pool item #" + i + " out of range"); diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ConstantValueReader.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ConstantValueReader.java index 591fd04146..99f39db6a4 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ConstantValueReader.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ConstantValueReader.java @@ -19,7 +19,9 @@ public ConstantValueReader(ClassReader.AttrIterator iter) throws InvalidClassFil checkSizeEquals(attr + 6, 2); } - /** @return the index of the constant pool item holding the value */ + /** + * @return the index of the constant pool item holding the value + */ public int getValueCPIndex() { return cr.getUShort(attr + 6); } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ExceptionsReader.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ExceptionsReader.java index 442f867c15..686b6f8246 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ExceptionsReader.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/ExceptionsReader.java @@ -23,7 +23,9 @@ public ExceptionsReader(ClassReader.AttrIterator iter) throws InvalidClassFileEx checkSizeEquals(attr + 8, 2 * count); } - /** @return the indices of the constant pool items for the exceptions */ + /** + * @return the indices of the constant pool items for the exceptions + */ public int[] getRawTable() { int count = cr.getUShort(attr + 6); int[] r = new int[count]; @@ -31,7 +33,9 @@ public int[] getRawTable() { return r; } - /** @return the classes of exceptions that can be thrown by the method */ + /** + * @return the classes of exceptions that can be thrown by the method + */ public String[] getClasses() throws InvalidClassFileException { int count = cr.getUShort(attr + 6); String[] r = new String[count]; diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/InnerClassesReader.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/InnerClassesReader.java index a47c076225..e4a17f3289 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/InnerClassesReader.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/InnerClassesReader.java @@ -23,7 +23,9 @@ public InnerClassesReader(ClassReader.AttrIterator iter) throws InvalidClassFile checkSizeEquals(attr + 8, 8 * count); } - /** @return the raw values that make up this attribute */ + /** + * @return the raw values that make up this attribute + */ public int[] getRawTable() { int count = cr.getUShort(attr + 6); int[] r = new int[count * 4]; @@ -31,7 +33,9 @@ public int[] getRawTable() { return r; } - /** @return the names of inner classes this attribute holds information about. */ + /** + * @return the names of inner classes this attribute holds information about. + */ public String[] getInnerClasses() throws InvalidClassFileException { int count = cr.getUShort(attr + 6); String[] r = new String[count]; diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/InvalidClassFileException.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/InvalidClassFileException.java index 5a739b5a62..faab3d71b8 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/InvalidClassFileException.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/InvalidClassFileException.java @@ -31,7 +31,9 @@ public InvalidClassFileException(int offset, String s) { this.offset = offset; } - /** @return the offset within the data where the problem was detected */ + /** + * @return the offset within the data where the problem was detected + */ public int getOffset() { return offset; } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/LineNumberTableReader.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/LineNumberTableReader.java index 7fa4cceb8b..61926c49c4 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/LineNumberTableReader.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/LineNumberTableReader.java @@ -29,7 +29,9 @@ public LineNumberTableReader(ClassReader.AttrIterator iter) throws InvalidClassF checkSize(offset, count * 4); } - /** @return the raw line number table data, a flattened sequence of (startPC, lineNumber) pairs */ + /** + * @return the raw line number table data, a flattened sequence of (startPC, lineNumber) pairs + */ public int[] getRawTable() { int count = cr.getUShort(attr + 6); int[] r = new int[count * 2]; diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/SignatureReader.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/SignatureReader.java index 5a5bf54bd0..9998ea5534 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/SignatureReader.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/SignatureReader.java @@ -19,7 +19,9 @@ public SignatureReader(ClassReader.AttrIterator iter) throws InvalidClassFileExc checkSizeEquals(attr + 6, 2); } - /** @return the index of the constant pool item holding the value */ + /** + * @return the index of the constant pool item holding the value + */ public int getSignatureCPIndex() { return cr.getUShort(attr + 6); } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/SourceFileReader.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/SourceFileReader.java index 194d5c9594..7187abfb00 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/SourceFileReader.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/SourceFileReader.java @@ -19,7 +19,9 @@ public SourceFileReader(ClassReader.AttrIterator iter) throws InvalidClassFileEx checkSizeEquals(attr + 6, 2); } - /** @return the index of the constant pool item holding the value */ + /** + * @return the index of the constant pool item holding the value + */ public int getSourceFileCPIndex() { return cr.getUShort(attr + 6); } diff --git a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/TypeAnnotationsReader.java b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/TypeAnnotationsReader.java index 1ac7d3bd78..0ec2fdc429 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/TypeAnnotationsReader.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/shrikeCT/TypeAnnotationsReader.java @@ -683,6 +683,7 @@ public CatchTarget(int[] rawHandler, String catchType) { this.rawHandler = rawHandler; this.catchType = catchType; } + /** * @return The type-annotations targets raw handler, i.e.: a 4 tuple (startPC, endPC, catchPC, * catchClassIndex) diff --git a/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/CRTData.java b/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/CRTData.java index 360a2561b2..4bc04e6d6d 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/CRTData.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/CRTData.java @@ -48,10 +48,13 @@ public final class CRTData { /** start index in the code array of the code attribute */ private final int pc_start_index; + /** end index in the code array of the code attribute */ private final int pc_end_index; + /** positions in the source file */ private final Range source_positions; + /** * flags * diff --git a/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/Debug.java b/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/Debug.java index 3754624416..b4bf670dfd 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/Debug.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/Debug.java @@ -23,7 +23,9 @@ import java.util.Map; import java.util.Set; -/** @author Juergen Graf <juergen.graf@gmail.com> */ +/** + * @author Juergen Graf <juergen.graf@gmail.com> + */ public final class Debug { public static final boolean PRINT_CHARACTER_RANGE_TABLE = false; diff --git a/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/MethodPositions.java b/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/MethodPositions.java index 8de115d996..34223cd230 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/MethodPositions.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/MethodPositions.java @@ -61,8 +61,10 @@ public final class MethodPositions extends PositionsAttribute { /** positions of the method declaration */ private Range declaration; + /** positions of the method parameters */ private Range parameter; + /** positions of the method block */ private Range block_end; diff --git a/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/Position.java b/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/Position.java index 656148fc0a..c1130116ae 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/Position.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/Position.java @@ -28,8 +28,10 @@ public final class Position { /** Represents the undefined position. */ private static final int NOPOS = 0; + /** bits to shift to get the line number */ private static final int LINE_SHIFT = 10; + /** the bit mask of the column number */ private static final int COLUMN_MASK = 1023; diff --git a/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/Range.java b/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/Range.java index 2e23215ac6..b8e21ecd33 100644 --- a/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/Range.java +++ b/shrike/src/main/java/com/ibm/wala/shrike/sourcepos/Range.java @@ -27,6 +27,7 @@ public class Range { /** stores the start position */ private final Position start; + /** stores the end position */ private final Position end; diff --git a/util/src/main/java/com/ibm/wala/dataflow/graph/BitVectorFilter.java b/util/src/main/java/com/ibm/wala/dataflow/graph/BitVectorFilter.java index 9e01689f83..5c580b71b3 100644 --- a/util/src/main/java/com/ibm/wala/dataflow/graph/BitVectorFilter.java +++ b/util/src/main/java/com/ibm/wala/dataflow/graph/BitVectorFilter.java @@ -61,7 +61,9 @@ public byte evaluate(@Nullable BitVectorVariable lhs, BitVectorVariable rhs) } } - /** @see java.lang.Object#toString() */ + /** + * @see java.lang.Object#toString() + */ @Override public String toString() { return "U - " + mask; diff --git a/util/src/main/java/com/ibm/wala/dataflow/graph/BitVectorUnion.java b/util/src/main/java/com/ibm/wala/dataflow/graph/BitVectorUnion.java index 061e4d2236..0b38677e47 100644 --- a/util/src/main/java/com/ibm/wala/dataflow/graph/BitVectorUnion.java +++ b/util/src/main/java/com/ibm/wala/dataflow/graph/BitVectorUnion.java @@ -23,7 +23,9 @@ public static BitVectorUnion instance() { private BitVectorUnion() {} - /** @see java.lang.Object#toString() */ + /** + * @see java.lang.Object#toString() + */ @Override public String toString() { return "UNION"; diff --git a/util/src/main/java/com/ibm/wala/dataflow/graph/BooleanUnion.java b/util/src/main/java/com/ibm/wala/dataflow/graph/BooleanUnion.java index cc321e8345..8de325bdb9 100644 --- a/util/src/main/java/com/ibm/wala/dataflow/graph/BooleanUnion.java +++ b/util/src/main/java/com/ibm/wala/dataflow/graph/BooleanUnion.java @@ -23,7 +23,9 @@ public static BooleanUnion instance() { private BooleanUnion() {} - /** @see java.lang.Object#toString() */ + /** + * @see java.lang.Object#toString() + */ @Override public String toString() { return "UNION"; diff --git a/util/src/main/java/com/ibm/wala/dataflow/graph/IKilldallFramework.java b/util/src/main/java/com/ibm/wala/dataflow/graph/IKilldallFramework.java index fad88d6b54..9c7d9b050a 100644 --- a/util/src/main/java/com/ibm/wala/dataflow/graph/IKilldallFramework.java +++ b/util/src/main/java/com/ibm/wala/dataflow/graph/IKilldallFramework.java @@ -21,9 +21,13 @@ */ public interface IKilldallFramework> { - /** @return the flow graph which induces this dataflow problem */ + /** + * @return the flow graph which induces this dataflow problem + */ Graph getFlowGraph(); - /** @return an object which provides the flow function for each node in the graph */ + /** + * @return an object which provides the flow function for each node in the graph + */ ITransferFunctionProvider getTransferFunctionProvider(); } diff --git a/util/src/main/java/com/ibm/wala/dataflow/graph/ITransferFunctionProvider.java b/util/src/main/java/com/ibm/wala/dataflow/graph/ITransferFunctionProvider.java index 0e16d9b7e8..2f4972b921 100644 --- a/util/src/main/java/com/ibm/wala/dataflow/graph/ITransferFunctionProvider.java +++ b/util/src/main/java/com/ibm/wala/dataflow/graph/ITransferFunctionProvider.java @@ -23,16 +23,24 @@ */ public interface ITransferFunctionProvider> { - /** @return the transfer function from IN_node -> OUT_node */ + /** + * @return the transfer function from IN_node -> OUT_node + */ UnaryOperator getNodeTransferFunction(T node); - /** @return true if this provider provides node transfer functions */ + /** + * @return true if this provider provides node transfer functions + */ boolean hasNodeTransferFunctions(); - /** @return the transfer function from OUT_src -> EDGE_<src,dst> */ + /** + * @return the transfer function from OUT_src -> EDGE_<src,dst> + */ UnaryOperator getEdgeTransferFunction(T src, T dst); - /** @return true if this provider provides edge transfer functions */ + /** + * @return true if this provider provides edge transfer functions + */ boolean hasEdgeTransferFunctions(); /** diff --git a/util/src/main/java/com/ibm/wala/fixedpoint/impl/AbstractFixedPointSolver.java b/util/src/main/java/com/ibm/wala/fixedpoint/impl/AbstractFixedPointSolver.java index 8ba0eb264e..fbb74bdadd 100644 --- a/util/src/main/java/com/ibm/wala/fixedpoint/impl/AbstractFixedPointSolver.java +++ b/util/src/main/java/com/ibm/wala/fixedpoint/impl/AbstractFixedPointSolver.java @@ -105,7 +105,9 @@ public void initForFirstSolve() { firstSolve = false; } - /** @return true iff work list is empty */ + /** + * @return true iff work list is empty + */ public boolean emptyWorkList() { return workList.isEmpty(); } diff --git a/util/src/main/java/com/ibm/wala/fixedpoint/impl/BasicNullaryStatement.java b/util/src/main/java/com/ibm/wala/fixedpoint/impl/BasicNullaryStatement.java index f220231ea2..554e23c499 100644 --- a/util/src/main/java/com/ibm/wala/fixedpoint/impl/BasicNullaryStatement.java +++ b/util/src/main/java/com/ibm/wala/fixedpoint/impl/BasicNullaryStatement.java @@ -23,7 +23,9 @@ public BasicNullaryStatement(T lhs, NullaryOperator operator) { this.operator = operator; } - /** @return Returns the operator. */ + /** + * @return Returns the operator. + */ @Override public NullaryOperator getOperator() { return operator; diff --git a/util/src/main/java/com/ibm/wala/fixedpoint/impl/NullaryOperator.java b/util/src/main/java/com/ibm/wala/fixedpoint/impl/NullaryOperator.java index b14f003b58..cfb26162da 100644 --- a/util/src/main/java/com/ibm/wala/fixedpoint/impl/NullaryOperator.java +++ b/util/src/main/java/com/ibm/wala/fixedpoint/impl/NullaryOperator.java @@ -21,6 +21,7 @@ public abstract class NullaryOperator> extends AbstractOp public byte evaluate(T lhs, T[] rhs) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } + /** * Evaluate this equation, setting a new value for the left-hand side. * diff --git a/util/src/main/java/com/ibm/wala/fixpoint/BitVectorVariable.java b/util/src/main/java/com/ibm/wala/fixpoint/BitVectorVariable.java index 5a6fe4ca92..9485b8f511 100644 --- a/util/src/main/java/com/ibm/wala/fixpoint/BitVectorVariable.java +++ b/util/src/main/java/com/ibm/wala/fixpoint/BitVectorVariable.java @@ -23,7 +23,9 @@ public class BitVectorVariable extends AbstractVariable { public BitVectorVariable() {} - /** @see com.ibm.wala.fixpoint.IVariable#copyState(com.ibm.wala.fixpoint.IVariable) */ + /** + * @see com.ibm.wala.fixpoint.IVariable#copyState(com.ibm.wala.fixpoint.IVariable) + */ @Override public void copyState(@Nullable BitVectorVariable other) { if (other == null) { @@ -121,7 +123,9 @@ public boolean get(int b) { } } - /** @return the value of this variable as a bit vector ... null if the bit vector is empty. */ + /** + * @return the value of this variable as a bit vector ... null if the bit vector is empty. + */ @Nullable public IntSet getValue() { return V; diff --git a/util/src/main/java/com/ibm/wala/fixpoint/BooleanVariable.java b/util/src/main/java/com/ibm/wala/fixpoint/BooleanVariable.java index 9956f5458d..90f930c873 100644 --- a/util/src/main/java/com/ibm/wala/fixpoint/BooleanVariable.java +++ b/util/src/main/java/com/ibm/wala/fixpoint/BooleanVariable.java @@ -17,7 +17,9 @@ public class BooleanVariable extends AbstractVariable { public BooleanVariable() {} - /** @param b initial value for this variable */ + /** + * @param b initial value for this variable + */ public BooleanVariable(boolean b) { this.B = b; } @@ -42,12 +44,16 @@ public String toString() { return (B ? "[TRUE]" : "[FALSE]"); } - /** @return the value of this variable */ + /** + * @return the value of this variable + */ public boolean getValue() { return B; } - /** @throws IllegalArgumentException if other is null */ + /** + * @throws IllegalArgumentException if other is null + */ public void or(BooleanVariable other) { if (other == null) { throw new IllegalArgumentException("other is null"); diff --git a/util/src/main/java/com/ibm/wala/fixpoint/FixedPointConstants.java b/util/src/main/java/com/ibm/wala/fixpoint/FixedPointConstants.java index 44f45ef822..0e1538d152 100644 --- a/util/src/main/java/com/ibm/wala/fixpoint/FixedPointConstants.java +++ b/util/src/main/java/com/ibm/wala/fixpoint/FixedPointConstants.java @@ -18,16 +18,19 @@ public interface FixedPointConstants { * evaluated again. */ byte CHANGED = 1; + /** * A return value which indicates that lhs has not changed, and the statement might need to be * evaluated again. */ byte NOT_CHANGED = 0; + /** * A return value which indicates that lhs has changed, and the statement need not be evaluated * again. */ byte CHANGED_AND_FIXED = 3; + /** * A return value which indicates that lhs has not changed, and the statement need not be * evaluated again. @@ -36,8 +39,10 @@ public interface FixedPointConstants { /** The bit-mask which defines the "CHANGED" flag */ int CHANGED_MASK = 0x1; + /** The bit-mask which defines the "FIXED" flag */ int FIXED_MASK = 0x2; + /** The bit-mask which defines the "SIDE EFFECT" flag */ int SIDE_EFFECT_MASK = 0x4; } diff --git a/util/src/main/java/com/ibm/wala/fixpoint/IFixedPointSolver.java b/util/src/main/java/com/ibm/wala/fixpoint/IFixedPointSolver.java index ce5effe803..a5aca3f6aa 100644 --- a/util/src/main/java/com/ibm/wala/fixpoint/IFixedPointSolver.java +++ b/util/src/main/java/com/ibm/wala/fixpoint/IFixedPointSolver.java @@ -16,7 +16,9 @@ /** Solves a set of constraints */ public interface IFixedPointSolver> { - /** @return the set of statements solved by this {@code IFixedPointSolver} */ + /** + * @return the set of statements solved by this {@code IFixedPointSolver} + */ IFixedPointSystem getFixedPointSystem(); /** diff --git a/util/src/main/java/com/ibm/wala/fixpoint/IFixedPointStatement.java b/util/src/main/java/com/ibm/wala/fixpoint/IFixedPointStatement.java index 6818a6eed5..45c896e1b7 100644 --- a/util/src/main/java/com/ibm/wala/fixpoint/IFixedPointStatement.java +++ b/util/src/main/java/com/ibm/wala/fixpoint/IFixedPointStatement.java @@ -24,9 +24,10 @@ * corresponds to an "equation" in dataflow parlance, or a "constraint" in constraint solvers. */ public interface IFixedPointStatement> extends INodeWithNumber { - /** @return the left-hand side of this statement. */ - @Nullable - T getLHS(); + /** + * @return the left-hand side of this statement. + */ + @Nullable T getLHS(); /** returns the list of free variables appearing in the right-hand side of the statement */ T[] getRHS(); diff --git a/util/src/main/java/com/ibm/wala/fixpoint/IFixedPointSystem.java b/util/src/main/java/com/ibm/wala/fixpoint/IFixedPointSystem.java index 804e78105b..799be54f7e 100644 --- a/util/src/main/java/com/ibm/wala/fixpoint/IFixedPointSystem.java +++ b/util/src/main/java/com/ibm/wala/fixpoint/IFixedPointSystem.java @@ -36,16 +36,24 @@ public interface IFixedPointSystem> { */ Iterator getVariables(); - /** @return true iff this system already contains an equation that is equal() to s */ + /** + * @return true iff this system already contains an equation that is equal() to s + */ boolean containsStatement(IFixedPointStatement s); - /** @return true iff this system already contains a variable that is equal() to v. */ + /** + * @return true iff this system already contains a variable that is equal() to v. + */ boolean containsVariable(T v); - /** @return {@link Iterator}<statement>, the statements that use the variable */ + /** + * @return {@link Iterator}<statement>, the statements that use the variable + */ Iterator getStatementsThatUse(T v); - /** @return {@link Iterator}<statement>, the statements that def the variable */ + /** + * @return {@link Iterator}<statement>, the statements that def the variable + */ Iterator getStatementsThatDef(T v); int getNumberOfStatementsThatUse(T v); diff --git a/util/src/main/java/com/ibm/wala/fixpoint/IntSetVariable.java b/util/src/main/java/com/ibm/wala/fixpoint/IntSetVariable.java index 097487600f..e5cb99fb98 100644 --- a/util/src/main/java/com/ibm/wala/fixpoint/IntSetVariable.java +++ b/util/src/main/java/com/ibm/wala/fixpoint/IntSetVariable.java @@ -119,7 +119,9 @@ public boolean contains(int b) { } } - /** @return the value of this variable as a MutableSparseIntSet ... null if the set is empty. */ + /** + * @return the value of this variable as a MutableSparseIntSet ... null if the set is empty. + */ @NullUnmarked public MutableIntSet getValue() { return V; diff --git a/util/src/main/java/com/ibm/wala/fixpoint/UnaryStatement.java b/util/src/main/java/com/ibm/wala/fixpoint/UnaryStatement.java index d2b36849ce..4c3285030b 100644 --- a/util/src/main/java/com/ibm/wala/fixpoint/UnaryStatement.java +++ b/util/src/main/java/com/ibm/wala/fixpoint/UnaryStatement.java @@ -43,7 +43,9 @@ public T getLHS() { return lhs; } - /** @return the right-hand side of this equation. */ + /** + * @return the right-hand side of this equation. + */ public T getRightHandSide() { return rhs; } diff --git a/util/src/main/java/com/ibm/wala/util/MonitorUtil.java b/util/src/main/java/com/ibm/wala/util/MonitorUtil.java index 67d6d7b706..adf2392514 100644 --- a/util/src/main/java/com/ibm/wala/util/MonitorUtil.java +++ b/util/src/main/java/com/ibm/wala/util/MonitorUtil.java @@ -72,6 +72,7 @@ public static void throwExceptionIfCanceled(IProgressMonitor progressMonitor) } } } + /* BEGIN Custom change: more on subtasks */ public static void subTask(IProgressMonitor progressMonitor, String subTask) throws CancelException { diff --git a/util/src/main/java/com/ibm/wala/util/PlatformUtil.java b/util/src/main/java/com/ibm/wala/util/PlatformUtil.java index 9c8a274d82..60392b3bb1 100644 --- a/util/src/main/java/com/ibm/wala/util/PlatformUtil.java +++ b/util/src/main/java/com/ibm/wala/util/PlatformUtil.java @@ -84,7 +84,10 @@ public static String[] getJDKModules(boolean justBase) { public static Path getPathForJDKModule(String moduleName) { return Paths.get(System.getProperty("java.home"), "jmods", moduleName + ".jmod"); } - /** @return the major version of the Java runtime we are running on. */ + + /** + * @return the major version of the Java runtime we are running on. + */ public static int getJavaRuntimeVersion() { String version = System.getProperty("java.version"); if (version.startsWith("1.")) { diff --git a/util/src/main/java/com/ibm/wala/util/WalaException.java b/util/src/main/java/com/ibm/wala/util/WalaException.java index 5afc82a612..1867aca3d7 100644 --- a/util/src/main/java/com/ibm/wala/util/WalaException.java +++ b/util/src/main/java/com/ibm/wala/util/WalaException.java @@ -14,11 +14,17 @@ public class WalaException extends Exception { private static final long serialVersionUID = 3959226859263419122L; - /** @param s a message describing the failure */ + + /** + * @param s a message describing the failure + */ public WalaException(String s, Throwable cause) { super(s, cause); } - /** @param string a message describing the failure */ + + /** + * @param string a message describing the failure + */ public WalaException(String string) { super(string); } diff --git a/util/src/main/java/com/ibm/wala/util/WalaRuntimeException.java b/util/src/main/java/com/ibm/wala/util/WalaRuntimeException.java index 6183955eaf..0bb2a8c395 100644 --- a/util/src/main/java/com/ibm/wala/util/WalaRuntimeException.java +++ b/util/src/main/java/com/ibm/wala/util/WalaRuntimeException.java @@ -14,11 +14,17 @@ public class WalaRuntimeException extends RuntimeException { private static final long serialVersionUID = -272544923431659418L; - /** @param s a message describing the failure */ + + /** + * @param s a message describing the failure + */ public WalaRuntimeException(String s, Throwable cause) { super(s, cause); } - /** @param string a message describing the failure */ + + /** + * @param string a message describing the failure + */ public WalaRuntimeException(String string) { super(string); } diff --git a/util/src/main/java/com/ibm/wala/util/collections/ArrayIterator.java b/util/src/main/java/com/ibm/wala/util/collections/ArrayIterator.java index c99c70076e..621a96873b 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/ArrayIterator.java +++ b/util/src/main/java/com/ibm/wala/util/collections/ArrayIterator.java @@ -25,7 +25,9 @@ public class ArrayIterator implements Iterator { /** The array source for the iterator */ protected final T[] _elts; - /** @param elts the array which should be iterated over */ + /** + * @param elts the array which should be iterated over + */ public ArrayIterator(T[] elts) { this(elts, 0); } diff --git a/util/src/main/java/com/ibm/wala/util/collections/ArraySet.java b/util/src/main/java/com/ibm/wala/util/collections/ArraySet.java index fce70e83c2..fc075fef76 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/ArraySet.java +++ b/util/src/main/java/com/ibm/wala/util/collections/ArraySet.java @@ -108,7 +108,9 @@ private ArraySet(Collection other) { addAll(other); } - /** @throws UnsupportedOperationException if this {@link ArraySet} is immutable (optional) */ + /** + * @throws UnsupportedOperationException if this {@link ArraySet} is immutable (optional) + */ @Override @SuppressWarnings("all") public boolean add(T o) { @@ -188,7 +190,9 @@ public boolean remove(Object obj_) { return remove(ind); } - /** @return {@code true} (SJF: So why return a value?) */ + /** + * @return {@code true} (SJF: So why return a value?) + */ public boolean remove(int ind) { try { // hope i got this right... @@ -205,7 +209,9 @@ public void clear() { _curIndex = 0; } - /** @see java.util.Set#iterator() */ + /** + * @see java.util.Set#iterator() + */ @Override public Iterator iterator() { return new ArraySetIterator(); diff --git a/util/src/main/java/com/ibm/wala/util/collections/BimodalMap.java b/util/src/main/java/com/ibm/wala/util/collections/BimodalMap.java index ca4f582917..18fbe97cc7 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/BimodalMap.java +++ b/util/src/main/java/com/ibm/wala/util/collections/BimodalMap.java @@ -96,7 +96,9 @@ private void transferBackingStore() { backingStore.putAll(S); } - /** @throws UnsupportedOperationException if the backingStore doesn't support remove */ + /** + * @throws UnsupportedOperationException if the backingStore doesn't support remove + */ @Nullable @Override public V remove(Object key) { @@ -155,7 +157,9 @@ public Collection values() { ((backingStore == null) ? Collections.emptySet() : backingStore.values()); } - /** @throws UnimplementedError if the backingStore implementation does */ + /** + * @throws UnimplementedError if the backingStore implementation does + */ @Override @SuppressWarnings("unchecked") public Set> entrySet() { diff --git a/util/src/main/java/com/ibm/wala/util/collections/CollectionFilter.java b/util/src/main/java/com/ibm/wala/util/collections/CollectionFilter.java index a151be14b6..b3e9004798 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/CollectionFilter.java +++ b/util/src/main/java/com/ibm/wala/util/collections/CollectionFilter.java @@ -26,7 +26,9 @@ public CollectionFilter(Collection S) { this.S = S; } - /** @see com.ibm.wala.util.collections.FilterIterator */ + /** + * @see com.ibm.wala.util.collections.FilterIterator + */ @Override public boolean test(T o) { return S.contains(o); diff --git a/util/src/main/java/com/ibm/wala/util/collections/HashMapFactory.java b/util/src/main/java/com/ibm/wala/util/collections/HashMapFactory.java index 11dfa2fc50..a0d4feadfb 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/HashMapFactory.java +++ b/util/src/main/java/com/ibm/wala/util/collections/HashMapFactory.java @@ -20,7 +20,9 @@ */ public class HashMapFactory { - /** @return A ParanoidHashMap if DEBUG = true, a LinkedHashMap otherwise */ + /** + * @return A ParanoidHashMap if DEBUG = true, a LinkedHashMap otherwise + */ public static HashMap make(int size) { if (HashSetFactory.DEBUG) { return new ParanoidHashMap<>(size); @@ -29,7 +31,9 @@ public static HashMap make(int size) { } } - /** @return A ParanoidHashMap if DEBUG = true, a LinkedHashMap otherwise */ + /** + * @return A ParanoidHashMap if DEBUG = true, a LinkedHashMap otherwise + */ public static HashMap make() { if (HashSetFactory.DEBUG) { return new ParanoidHashMap<>(); @@ -38,7 +42,9 @@ public static HashMap make() { } } - /** @return A ParanoidHashMap if DEBUG = true, a LinkedHashMap otherwise */ + /** + * @return A ParanoidHashMap if DEBUG = true, a LinkedHashMap otherwise + */ public static HashMap make(Map t) { if (t == null) { throw new IllegalArgumentException("null t"); diff --git a/util/src/main/java/com/ibm/wala/util/collections/HashSetFactory.java b/util/src/main/java/com/ibm/wala/util/collections/HashSetFactory.java index 68ab8e0555..5d99cc35d4 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/HashSetFactory.java +++ b/util/src/main/java/com/ibm/wala/util/collections/HashSetFactory.java @@ -23,7 +23,9 @@ public class HashSetFactory { /** If true, this factory returns Paranoid versions of collections */ public static final boolean DEBUG = false; - /** @return A {@link ParanoidHashSet} if DEBUG = true, a java.util.HashSet otherwise */ + /** + * @return A {@link ParanoidHashSet} if DEBUG = true, a java.util.HashSet otherwise + */ public static HashSet make(int size) { if (DEBUG) { return new ParanoidHashSet<>(size); @@ -32,7 +34,9 @@ public static HashSet make(int size) { } } - /** @return A ParanoidHashSet if DEBUG = true, a java.util.HashSet otherwise */ + /** + * @return A ParanoidHashSet if DEBUG = true, a java.util.HashSet otherwise + */ public static HashSet make() { if (DEBUG) { return new ParanoidHashSet<>(); @@ -41,7 +45,9 @@ public static HashSet make() { } } - /** @return A ParanoidHashSet if DEBUG = true, a java.util.HashSet otherwise */ + /** + * @return A ParanoidHashSet if DEBUG = true, a java.util.HashSet otherwise + */ public static HashSet make(Collection s) { if (s == null) { throw new IllegalArgumentException("null s"); diff --git a/util/src/main/java/com/ibm/wala/util/collections/Heap.java b/util/src/main/java/com/ibm/wala/util/collections/Heap.java index 47c02659bc..3bbe79ccd6 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/Heap.java +++ b/util/src/main/java/com/ibm/wala/util/collections/Heap.java @@ -16,14 +16,18 @@ /** Simple Heap data structure. */ public abstract class Heap { - /** @return true iff elt1 is considered < elt2 */ + /** + * @return true iff elt1 is considered < elt2 + */ protected abstract boolean compareElements(T elt1, T elt2); private int numberOfElements; private T[] backingStore; - /** @return number of elements in this heap */ + /** + * @return number of elements in this heap + */ public int size() { return numberOfElements; } @@ -34,7 +38,9 @@ public Heap(int initialCapacity) { backingStore = (T[]) new Object[initialCapacity]; } - /** @return true iff this heap is non-empty */ + /** + * @return true iff this heap is non-empty + */ public final boolean isEmpty() { return numberOfElements == 0; } @@ -45,7 +51,9 @@ public void insert(T elt) { numberOfElements++; } - /** @return the first object in the priority queue */ + /** + * @return the first object in the priority queue + */ public T take() throws NoSuchElementException { if (numberOfElements == 0) { throw new NoSuchElementException(); diff --git a/util/src/main/java/com/ibm/wala/util/collections/IVector.java b/util/src/main/java/com/ibm/wala/util/collections/IVector.java index 03b86233ab..a2b46f5816 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/IVector.java +++ b/util/src/main/java/com/ibm/wala/util/collections/IVector.java @@ -18,7 +18,9 @@ *

TODO: get rid of this and use java.util.collection.RandomAccess */ public interface IVector extends Iterable { - /** @see com.ibm.wala.util.intset.IntVector#get(int) */ + /** + * @see com.ibm.wala.util.intset.IntVector#get(int) + */ T get(int x); /** @@ -28,9 +30,13 @@ public interface IVector extends Iterable { */ void set(int x, @Nullable T value); - /** @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() */ + /** + * @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() + */ void performVerboseAction(); - /** @return max i s.t get(i) != null */ + /** + * @return max i s.t get(i) != null + */ int getMaxIndex(); } diff --git a/util/src/main/java/com/ibm/wala/util/collections/ImmutableStack.java b/util/src/main/java/com/ibm/wala/util/collections/ImmutableStack.java index ca29dfa16c..b69488aa0c 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/ImmutableStack.java +++ b/util/src/main/java/com/ibm/wala/util/collections/ImmutableStack.java @@ -52,6 +52,24 @@ public class ImmutableStack implements Iterable { private static final int MAX_SIZE = Integer.MAX_VALUE; + /** + * Checks whether the given size would exceed {@link #MAX_SIZE}. + * + *

In a standard WALA build, {@link #MAX_SIZE} is {@link Integer#MAX_VALUE}, and therefore this + * check must always return {@code true}. For that reason, Error Prone warns about a {@code + * ComparisonOutOfRange}. However, one might choose to change how {@link #MAX_SIZE} is + * initialized, thereby creating the possibility for this check to return {@code fail}. We want to + * retain that as an option, so we still perform this check and use {@link SuppressWarnings} to + * suppress the Error Check warning. + * + * @param proposedSize possible new size + * @return true if the proposed size would exceed {@link #MAX_SIZE} + */ + @SuppressWarnings("ComparisonOutOfRange") + private static boolean isWithinSizeLimit(final int proposedSize) { + return proposedSize <= MAX_SIZE; + } + public static int getMaxSize() { return MAX_SIZE; } @@ -97,7 +115,7 @@ public ImmutableStack push(T entry) { } int size = entries.length + 1; T[] tmpEntries = null; - if (size <= MAX_SIZE) { + if (isWithinSizeLimit(size)) { tmpEntries = makeInternalArray(size); System.arraycopy(entries, 0, tmpEntries, 0, entries.length); tmpEntries[size - 1] = entry; @@ -129,7 +147,9 @@ public T peek() { return entries[entries.length - 1]; } - /** @throws EmptyStackException if stack is empty */ + /** + * @throws EmptyStackException if stack is empty + */ public ImmutableStack pop() { if (entries.length == 0) { throw new EmptyStackException(); @@ -159,7 +179,7 @@ public T get(int i) { @Override public String toString() { String objArrayToString = Arrays.toString(entries); - assert entries.length <= MAX_SIZE : objArrayToString; + assert isWithinSizeLimit(entries.length) : objArrayToString; return objArrayToString; } @@ -218,7 +238,7 @@ public ImmutableStack pushAll(ImmutableStack other) { } int size = entries.length + other.entries.length; T[] tmpEntries = null; - if (size <= MAX_SIZE) { + if (isWithinSizeLimit(size)) { tmpEntries = (T[]) new Object[size]; System.arraycopy(entries, 0, tmpEntries, 0, entries.length); System.arraycopy(other.entries, 0, tmpEntries, entries.length, other.entries.length); diff --git a/util/src/main/java/com/ibm/wala/util/collections/IndiscriminateFilter.java b/util/src/main/java/com/ibm/wala/util/collections/IndiscriminateFilter.java index 0071d46d54..d201e30729 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/IndiscriminateFilter.java +++ b/util/src/main/java/com/ibm/wala/util/collections/IndiscriminateFilter.java @@ -20,7 +20,9 @@ public static IndiscriminateFilter singleton() { return new IndiscriminateFilter<>(); } - /** @see FilterIterator */ + /** + * @see FilterIterator + */ @Override public boolean test(Object o) { return true; diff --git a/util/src/main/java/com/ibm/wala/util/collections/IntStack.java b/util/src/main/java/com/ibm/wala/util/collections/IntStack.java index 5630b9a7c8..f0067eb4ae 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/IntStack.java +++ b/util/src/main/java/com/ibm/wala/util/collections/IntStack.java @@ -17,6 +17,7 @@ public class IntStack { /** Comment for {@code top} */ private int top = -1; + /** Comment for {@code state} */ private int state[] = new int[0]; @@ -28,7 +29,9 @@ public void push(int i) { state[++top] = i; } - /** @return the int at the top of the stack */ + /** + * @return the int at the top of the stack + */ public int peek() { return state[top]; } @@ -42,17 +45,23 @@ public int pop() { return state[top--]; } - /** @return true iff the stack is empty */ + /** + * @return true iff the stack is empty + */ public boolean isEmpty() { return top == -1; } - /** @return the number of elements in the stack. */ + /** + * @return the number of elements in the stack. + */ public int size() { return top + 1; } - /** @return the ith int from the bottom of the stack */ + /** + * @return the ith int from the bottom of the stack + */ public int get(int i) { if (i < 0 || i > top) { throw new IndexOutOfBoundsException(); diff --git a/util/src/main/java/com/ibm/wala/util/collections/Iterator2Collection.java b/util/src/main/java/com/ibm/wala/util/collections/Iterator2Collection.java index edfc75ad03..cf9aafbf6e 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/Iterator2Collection.java +++ b/util/src/main/java/com/ibm/wala/util/collections/Iterator2Collection.java @@ -26,6 +26,7 @@ public abstract class Iterator2Collection implements Collection { protected abstract Collection getDelegate(); + /** Returns a {@link Set} containing all elements in i. Note that duplicates will be removed. */ public static Iterator2Set toSet(Iterator i) throws IllegalArgumentException { if (i == null) { diff --git a/util/src/main/java/com/ibm/wala/util/collections/IteratorUtil.java b/util/src/main/java/com/ibm/wala/util/collections/IteratorUtil.java index d039909d89..8e812733fa 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/IteratorUtil.java +++ b/util/src/main/java/com/ibm/wala/util/collections/IteratorUtil.java @@ -15,7 +15,9 @@ /** utilities dealing with Iterators */ public class IteratorUtil { - /** @return true iff the Iterator returns some elements which equals() the object o */ + /** + * @return true iff the Iterator returns some elements which equals() the object o + */ public static boolean contains(Iterator it, T o) { if (it == null) { throw new IllegalArgumentException("null it"); diff --git a/util/src/main/java/com/ibm/wala/util/collections/NonNullSingletonIterator.java b/util/src/main/java/com/ibm/wala/util/collections/NonNullSingletonIterator.java index bd8714e045..2cd0b42173 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/NonNullSingletonIterator.java +++ b/util/src/main/java/com/ibm/wala/util/collections/NonNullSingletonIterator.java @@ -22,7 +22,9 @@ public class NonNullSingletonIterator implements Iterator { @Nullable private T it; - /** @param o the single object in this collection, must be non-null */ + /** + * @param o the single object in this collection, must be non-null + */ public NonNullSingletonIterator(@Nullable T o) { if (o == null) { throw new IllegalArgumentException("o is null"); diff --git a/util/src/main/java/com/ibm/wala/util/collections/ParanoidHashMap.java b/util/src/main/java/com/ibm/wala/util/collections/ParanoidHashMap.java index 5d6fb12a39..40541bc750 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/ParanoidHashMap.java +++ b/util/src/main/java/com/ibm/wala/util/collections/ParanoidHashMap.java @@ -22,7 +22,9 @@ public class ParanoidHashMap extends LinkedHashMap { public static final long serialVersionUID = 909018793791787198L; - /** @throws NullPointerException if t is null */ + /** + * @throws NullPointerException if t is null + */ public ParanoidHashMap(Map t) throws NullPointerException { super(t.size()); putAll(t); @@ -34,7 +36,9 @@ public ParanoidHashMap(int size) { public ParanoidHashMap() {} - /** @see java.util.Map#put(java.lang.Object, java.lang.Object) */ + /** + * @see java.util.Map#put(java.lang.Object, java.lang.Object) + */ @Override public V put(K arg0, V arg1) { assertOverridesHashCode(arg0); @@ -54,7 +58,9 @@ public static void assertOverridesHashCode(Object o) throws UnimplementedError { } } - /** @see java.util.Map#putAll(java.util.Map) */ + /** + * @see java.util.Map#putAll(java.util.Map) + */ @Override public void putAll(Map arg0) { if (arg0 == null) { diff --git a/util/src/main/java/com/ibm/wala/util/collections/ParanoidHashSet.java b/util/src/main/java/com/ibm/wala/util/collections/ParanoidHashSet.java index 4e5107f809..b8a5a4ccf8 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/ParanoidHashSet.java +++ b/util/src/main/java/com/ibm/wala/util/collections/ParanoidHashSet.java @@ -31,7 +31,9 @@ public class ParanoidHashSet extends LinkedHashSet { /** If a hash set contains more than this number of items with the same hash code, complain. */ private final int BAD_HC = 3; - /** @throws NullPointerException if s is null */ + /** + * @throws NullPointerException if s is null + */ public ParanoidHashSet(Collection s) throws NullPointerException { super(s.size()); hcFreq = HashMapFactory.make(s.size()); diff --git a/util/src/main/java/com/ibm/wala/util/collections/SimpleVector.java b/util/src/main/java/com/ibm/wala/util/collections/SimpleVector.java index f5431177d7..7f4bbb7807 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/SimpleVector.java +++ b/util/src/main/java/com/ibm/wala/util/collections/SimpleVector.java @@ -29,7 +29,9 @@ public class SimpleVector implements IVector { public SimpleVector() {} - /** @see com.ibm.wala.util.intset.IntVector#get(int) */ + /** + * @see com.ibm.wala.util.intset.IntVector#get(int) + */ @NullUnmarked @Override @SuppressWarnings("unchecked") @@ -44,7 +46,9 @@ public T get(int x) { } } - /** @see com.ibm.wala.util.intset.IntVector#set(int, int) */ + /** + * @see com.ibm.wala.util.intset.IntVector#set(int, int) + */ @Override public void set(int x, @Nullable T value) { if (x < 0) { @@ -79,7 +83,9 @@ public void performVerboseAction() { System.err.println(("occupancy: " + computeOccupancy())); } - /** @return the percentage of entries in delegateStore that are non-null */ + /** + * @return the percentage of entries in delegateStore that are non-null + */ private double computeOccupancy() { int count = 0; for (Object element : store) { diff --git a/util/src/main/java/com/ibm/wala/util/collections/SparseVector.java b/util/src/main/java/com/ibm/wala/util/collections/SparseVector.java index 8f981c05e3..4970521ab5 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/SparseVector.java +++ b/util/src/main/java/com/ibm/wala/util/collections/SparseVector.java @@ -48,7 +48,9 @@ public SparseVector(int initialSize, float expansion) { indices = new TunedMutableSparseIntSet(initialSize, expansion); } - /** @see com.ibm.wala.util.intset.IntVector#get(int) */ + /** + * @see com.ibm.wala.util.intset.IntVector#get(int) + */ @NullUnmarked @Override @SuppressWarnings("unchecked") @@ -86,7 +88,9 @@ private void ensureCapacity(int capacity) { } } - /** @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() */ + /** + * @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() + */ @Override public void performVerboseAction() { System.err.println((getClass() + " stats: ")); @@ -94,7 +98,9 @@ public void performVerboseAction() { System.err.println(("indices.size() " + indices.size())); } - /** @see com.ibm.wala.util.intset.IntSet#intIterator() */ + /** + * @see com.ibm.wala.util.intset.IntSet#intIterator() + */ @Override public Iterator iterator() { return new Iterator<>() { @@ -123,7 +129,9 @@ public void remove() { }; } - /** @return max i s.t get(i) != null */ + /** + * @return max i s.t get(i) != null + */ @Override public int getMaxIndex() throws IllegalStateException { return indices.max(); diff --git a/util/src/main/java/com/ibm/wala/util/collections/TwoLevelVector.java b/util/src/main/java/com/ibm/wala/util/collections/TwoLevelVector.java index 9fa7aeeb93..35fe621bbb 100644 --- a/util/src/main/java/com/ibm/wala/util/collections/TwoLevelVector.java +++ b/util/src/main/java/com/ibm/wala/util/collections/TwoLevelVector.java @@ -33,7 +33,9 @@ public class TwoLevelVector implements IVector, Serializable { private int maxPage = -1; - /** @see com.ibm.wala.util.intset.IntVector#get(int) */ + /** + * @see com.ibm.wala.util.intset.IntVector#get(int) + */ @NullUnmarked @Nullable @Override @@ -99,13 +101,17 @@ private IVector findOrCreatePage(int page) { } } - /** @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() */ + /** + * @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() + */ @Override public void performVerboseAction() { // do nothing; } - /** @see com.ibm.wala.util.intset.IntSet#intIterator() */ + /** + * @see com.ibm.wala.util.intset.IntSet#intIterator() + */ @Override public Iterator iterator() { return new Iterator<>() { diff --git a/util/src/main/java/com/ibm/wala/util/graph/AbstractGraph.java b/util/src/main/java/com/ibm/wala/util/graph/AbstractGraph.java index dffe0aaec7..b22c6af030 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/AbstractGraph.java +++ b/util/src/main/java/com/ibm/wala/util/graph/AbstractGraph.java @@ -18,10 +18,14 @@ /** Basic functionality for a {@link Graph} that delegates node and edge management. */ public abstract class AbstractGraph implements Graph { - /** @return the object which manages nodes in the graph */ + /** + * @return the object which manages nodes in the graph + */ protected abstract NodeManager getNodeManager(); - /** @return the object which manages edges in the graph */ + /** + * @return the object which manages edges in the graph + */ protected abstract EdgeManager getEdgeManager(); @Override @@ -29,19 +33,25 @@ public Stream stream() { return getNodeManager().stream(); } - /** @see Graph#iterator() */ + /** + * @see Graph#iterator() + */ @Override public Iterator iterator() { return getNodeManager().iterator(); } - /** @see com.ibm.wala.util.graph.Graph#getNumberOfNodes() */ + /** + * @see com.ibm.wala.util.graph.Graph#getNumberOfNodes() + */ @Override public int getNumberOfNodes() { return getNodeManager().getNumberOfNodes(); } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(java.lang.Object) + */ @Override public int getPredNodeCount(T n) throws IllegalArgumentException { if (n == null) { @@ -50,7 +60,9 @@ public int getPredNodeCount(T n) throws IllegalArgumentException { return getEdgeManager().getPredNodeCount(n); } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(java.lang.Object) + */ @Override public Iterator getPredNodes(@Nullable T n) throws IllegalArgumentException { if (n == null) { @@ -59,7 +71,9 @@ public Iterator getPredNodes(@Nullable T n) throws IllegalArgumentException { return getEdgeManager().getPredNodes(n); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(java.lang.Object) + */ @Override public int getSuccNodeCount(T n) throws IllegalArgumentException { if (!containsNode(n) || n == null) { @@ -68,7 +82,9 @@ public int getSuccNodeCount(T n) throws IllegalArgumentException { return getEdgeManager().getSuccNodeCount(n); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) + */ @Override public Iterator getSuccNodes(@Nullable T n) throws IllegalArgumentException { if (n == null) { @@ -77,25 +93,33 @@ public Iterator getSuccNodes(@Nullable T n) throws IllegalArgumentException { return getEdgeManager().getSuccNodes(n); } - /** @see com.ibm.wala.util.graph.NodeManager#addNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#addNode(Object) + */ @Override public void addNode(T n) { getNodeManager().addNode(n); } - /** @see com.ibm.wala.util.graph.EdgeManager#addEdge(Object, Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#addEdge(Object, Object) + */ @Override public void addEdge(T src, T dst) throws IllegalArgumentException { getEdgeManager().addEdge(src, dst); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeEdge(java.lang.Object, java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeEdge(java.lang.Object, java.lang.Object) + */ @Override public void removeEdge(T src, T dst) throws IllegalArgumentException { getEdgeManager().removeEdge(src, dst); } - /** @see com.ibm.wala.util.graph.EdgeManager#hasEdge(java.lang.Object, java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#hasEdge(java.lang.Object, java.lang.Object) + */ @Override public boolean hasEdge(@Nullable T src, @Nullable T dst) { if (src == null) { @@ -107,7 +131,9 @@ public boolean hasEdge(@Nullable T src, @Nullable T dst) { return getEdgeManager().hasEdge(src, dst); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) + */ @Override public void removeAllIncidentEdges(T node) throws IllegalArgumentException { if (node == null) { @@ -116,7 +142,9 @@ public void removeAllIncidentEdges(T node) throws IllegalArgumentException { getEdgeManager().removeAllIncidentEdges(node); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) + */ @Override public void removeIncomingEdges(T node) throws IllegalArgumentException { if (node == null) { @@ -125,7 +153,9 @@ public void removeIncomingEdges(T node) throws IllegalArgumentException { getEdgeManager().removeIncomingEdges(node); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) + */ @Override public void removeOutgoingEdges(T node) throws IllegalArgumentException { if (node == null) { @@ -134,7 +164,9 @@ public void removeOutgoingEdges(T node) throws IllegalArgumentException { getEdgeManager().removeOutgoingEdges(node); } - /** @see com.ibm.wala.util.graph.Graph#removeNode(Object) */ + /** + * @see com.ibm.wala.util.graph.Graph#removeNode(Object) + */ @Override public void removeNodeAndEdges(T N) throws IllegalArgumentException { if (N == null) { @@ -144,7 +176,9 @@ public void removeNodeAndEdges(T N) throws IllegalArgumentException { getNodeManager().removeNode(N); } - /** @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) + */ @Override public void removeNode(T n) throws IllegalArgumentException { if (n == null) { @@ -177,7 +211,9 @@ public String toString() { return sb.toString(); } - /** @see com.ibm.wala.util.graph.NodeManager#containsNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#containsNode(Object) + */ @Override public boolean containsNode(@Nullable T n) { if (n == null) { diff --git a/util/src/main/java/com/ibm/wala/util/graph/AbstractNumberedGraph.java b/util/src/main/java/com/ibm/wala/util/graph/AbstractNumberedGraph.java index 4c9bb91df2..14d24e70a8 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/AbstractNumberedGraph.java +++ b/util/src/main/java/com/ibm/wala/util/graph/AbstractNumberedGraph.java @@ -21,27 +21,37 @@ public abstract class AbstractNumberedGraph extends AbstractGraph implements NumberedGraph { - /** @return the object which manages nodes in the graph */ + /** + * @return the object which manages nodes in the graph + */ @Override protected abstract NumberedNodeManager getNodeManager(); - /** @return the object which manages edges in the graph */ + /** + * @return the object which manages edges in the graph + */ @Override protected abstract NumberedEdgeManager getEdgeManager(); - /** @see com.ibm.wala.util.graph.NumberedNodeManager#getMaxNumber() */ + /** + * @see com.ibm.wala.util.graph.NumberedNodeManager#getMaxNumber() + */ @Override public int getMaxNumber() { return getNodeManager().getMaxNumber(); } - /** @see com.ibm.wala.util.graph.NumberedNodeManager#getNode(int) */ + /** + * @see com.ibm.wala.util.graph.NumberedNodeManager#getNode(int) + */ @Override public T getNode(int number) { return getNodeManager().getNode(number); } - /** @see com.ibm.wala.util.graph.NumberedNodeManager#getNumber(Object) */ + /** + * @see com.ibm.wala.util.graph.NumberedNodeManager#getNumber(Object) + */ @Override public int getNumber(@Nullable T N) { if (N == null) { @@ -58,14 +68,18 @@ public Iterator iterateNodes(final IntSet s) { return new NumberedNodeIterator<>(s, this); } - /** @see com.ibm.wala.util.graph.NumberedEdgeManager#getPredNodeNumbers(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.NumberedEdgeManager#getPredNodeNumbers(java.lang.Object) + */ @Override public IntSet getPredNodeNumbers(@Nullable T node) throws IllegalArgumentException { assert getEdgeManager() != null; return getEdgeManager().getPredNodeNumbers(node); } - /** @see com.ibm.wala.util.graph.NumberedEdgeManager#getSuccNodeNumbers(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.NumberedEdgeManager#getSuccNodeNumbers(java.lang.Object) + */ @Override public IntSet getSuccNodeNumbers(@Nullable T node) throws IllegalArgumentException { return getEdgeManager().getSuccNodeNumbers(node); diff --git a/util/src/main/java/com/ibm/wala/util/graph/GraphIntegrity.java b/util/src/main/java/com/ibm/wala/util/graph/GraphIntegrity.java index 3d91d31d25..2cc240a373 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/GraphIntegrity.java +++ b/util/src/main/java/com/ibm/wala/util/graph/GraphIntegrity.java @@ -188,7 +188,9 @@ public UnsoundGraphException(String s) { } } - /** @throws IllegalArgumentException if c is null */ + /** + * @throws IllegalArgumentException if c is null + */ public static void printCollection(String string, Collection c) { if (c == null) { throw new IllegalArgumentException("c is null"); diff --git a/util/src/main/java/com/ibm/wala/util/graph/GraphReachability.java b/util/src/main/java/com/ibm/wala/util/graph/GraphReachability.java index 10dadd0009..8bf14025dc 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/GraphReachability.java +++ b/util/src/main/java/com/ibm/wala/util/graph/GraphReachability.java @@ -63,7 +63,9 @@ public GraphReachability(Graph g, Predicate filter) { domain = new MutableMapping<>(Iterator2Collection.toSet(i).toArray()); } - /** @return the set of interesting nodes reachable from n */ + /** + * @return the set of interesting nodes reachable from n + */ public OrdinalSet getReachableSet(Object n) throws IllegalStateException { if (solver == null) { throw new IllegalStateException("must call solve() before calling getReachableSet()"); diff --git a/util/src/main/java/com/ibm/wala/util/graph/INodeWithNumberedEdges.java b/util/src/main/java/com/ibm/wala/util/graph/INodeWithNumberedEdges.java index 2602902812..e5b3e286f3 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/INodeWithNumberedEdges.java +++ b/util/src/main/java/com/ibm/wala/util/graph/INodeWithNumberedEdges.java @@ -18,13 +18,15 @@ * NumberedGraph} interface. */ public interface INodeWithNumberedEdges extends INodeWithNumber { - /** @return set of node numbers which are successors of this node */ - @Nullable - IntSet getSuccNumbers(); + /** + * @return set of node numbers which are successors of this node + */ + @Nullable IntSet getSuccNumbers(); - /** @return set of node numbers which are predecessors of this node */ - @Nullable - IntSet getPredNumbers(); + /** + * @return set of node numbers which are predecessors of this node + */ + @Nullable IntSet getPredNumbers(); /** Modify the graph so that node number n is a successor of this node */ void addSucc(int n); diff --git a/util/src/main/java/com/ibm/wala/util/graph/NodeManager.java b/util/src/main/java/com/ibm/wala/util/graph/NodeManager.java index 484b5de9ed..622bc55b63 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/NodeManager.java +++ b/util/src/main/java/com/ibm/wala/util/graph/NodeManager.java @@ -25,16 +25,22 @@ */ public interface NodeManager extends Iterable { - /** @return an {@link Iterator} of the nodes in this graph */ + /** + * @return an {@link Iterator} of the nodes in this graph + */ @Override default Iterator iterator() { return stream().iterator(); } - /** @return a {@link Stream} of the nodes in this graph */ + /** + * @return a {@link Stream} of the nodes in this graph + */ Stream stream(); - /** @return the number of nodes in this graph */ + /** + * @return the number of nodes in this graph + */ int getNumberOfNodes(); /** add a node to this graph */ @@ -43,6 +49,8 @@ default Iterator iterator() { /** remove a node from this graph */ void removeNode(T n) throws UnsupportedOperationException; - /** @return true iff the graph contains the specified node */ + /** + * @return true iff the graph contains the specified node + */ boolean containsNode(@Nullable T n); } diff --git a/util/src/main/java/com/ibm/wala/util/graph/NumberedEdgeManager.java b/util/src/main/java/com/ibm/wala/util/graph/NumberedEdgeManager.java index 3f53a3ecb4..980311561d 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/NumberedEdgeManager.java +++ b/util/src/main/java/com/ibm/wala/util/graph/NumberedEdgeManager.java @@ -16,9 +16,13 @@ /** Additional functionality for edges in numbered graphs */ public interface NumberedEdgeManager extends EdgeManager { - /** @return the numbers identifying the immediate successors of node */ + /** + * @return the numbers identifying the immediate successors of node + */ IntSet getSuccNodeNumbers(@Nullable T node); - /** @return the numbers identifying the immediate predecessors of node */ + /** + * @return the numbers identifying the immediate predecessors of node + */ IntSet getPredNodeNumbers(@Nullable T node); } diff --git a/util/src/main/java/com/ibm/wala/util/graph/NumberedNodeManager.java b/util/src/main/java/com/ibm/wala/util/graph/NumberedNodeManager.java index 6378891e5a..98ce5250de 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/NumberedNodeManager.java +++ b/util/src/main/java/com/ibm/wala/util/graph/NumberedNodeManager.java @@ -23,6 +23,8 @@ public interface NumberedNodeManager extends NodeManager { int getMaxNumber(); - /** @return iterator of nodes with the numbers in set s */ + /** + * @return iterator of nodes with the numbers in set s + */ Iterator iterateNodes(IntSet s); } diff --git a/util/src/main/java/com/ibm/wala/util/graph/impl/DelegatingNumberedEdgeManager.java b/util/src/main/java/com/ibm/wala/util/graph/impl/DelegatingNumberedEdgeManager.java index 492e859c19..7cbb11c8d8 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/impl/DelegatingNumberedEdgeManager.java +++ b/util/src/main/java/com/ibm/wala/util/graph/impl/DelegatingNumberedEdgeManager.java @@ -60,7 +60,9 @@ public void remove() { } } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(Object) + */ @Override public Iterator getPredNodes(@Nullable T N) throws IllegalArgumentException { if (N == null) { @@ -82,7 +84,9 @@ public IntSet getPredNodeNumbers(@Nullable T node) { return (pred == null) ? new SparseIntSet() : pred; } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(Object) + */ @Override public int getPredNodeCount(T N) throws IllegalArgumentException { if (N == null) { @@ -97,7 +101,9 @@ public int getPredNodeCount(T N) throws IllegalArgumentException { } } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(Object) + */ @Override public Iterator getSuccNodes(@Nullable T N) { if (N == null) { @@ -109,7 +115,9 @@ public Iterator getSuccNodes(@Nullable T N) { return (succ == null) ? empty : (Iterator) new IntSetNodeIterator(succ.intIterator()); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(Object) + */ @Override public int getSuccNodeCount(T N) { if (N == null) { @@ -120,7 +128,9 @@ public int getSuccNodeCount(T N) { return s == null ? 0 : s.size(); } - /** @see com.ibm.wala.util.graph.EdgeManager#addEdge(Object, Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#addEdge(Object, Object) + */ @Override public void addEdge(T src, T dst) { if (dst == null || src == null) { @@ -135,7 +145,9 @@ public void removeEdge(T src, T dst) throws UnimplementedError { Assertions.UNREACHABLE("Implement me"); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) + */ @Override public void removeAllIncidentEdges(T node) throws UnimplementedError { if (node == null) { @@ -145,7 +157,9 @@ public void removeAllIncidentEdges(T node) throws UnimplementedError { n.removeAllIncidentEdges(); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) + */ @Override public void removeIncomingEdges(T node) throws UnimplementedError { if (node == null) { @@ -155,7 +169,9 @@ public void removeIncomingEdges(T node) throws UnimplementedError { n.removeIncomingEdges(); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) + */ @Override public void removeOutgoingEdges(T node) throws UnimplementedError { if (node == null) { diff --git a/util/src/main/java/com/ibm/wala/util/graph/impl/DelegatingNumberedGraph.java b/util/src/main/java/com/ibm/wala/util/graph/impl/DelegatingNumberedGraph.java index d8e4920477..bc371135a2 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/impl/DelegatingNumberedGraph.java +++ b/util/src/main/java/com/ibm/wala/util/graph/impl/DelegatingNumberedGraph.java @@ -27,13 +27,17 @@ public class DelegatingNumberedGraph private final DelegatingNumberedEdgeManager edgeManager = new DelegatingNumberedEdgeManager<>(nodeManager); - /** @see com.ibm.wala.util.graph.AbstractGraph#getNodeManager() */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getNodeManager() + */ @Override protected NumberedNodeManager getNodeManager() { return nodeManager; } - /** @see com.ibm.wala.util.graph.AbstractGraph#getEdgeManager() */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getEdgeManager() + */ @Override protected NumberedEdgeManager getEdgeManager() { return edgeManager; diff --git a/util/src/main/java/com/ibm/wala/util/graph/impl/DelegatingNumberedNodeManager.java b/util/src/main/java/com/ibm/wala/util/graph/impl/DelegatingNumberedNodeManager.java index f2fa5981eb..35fafd73c4 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/impl/DelegatingNumberedNodeManager.java +++ b/util/src/main/java/com/ibm/wala/util/graph/impl/DelegatingNumberedNodeManager.java @@ -62,7 +62,9 @@ public int getMaxNumber() { return maxNumber; } - /** @see com.ibm.wala.util.graph.Graph#iterator() */ + /** + * @see com.ibm.wala.util.graph.Graph#iterator() + */ @Override @SuppressWarnings("unused") public Iterator iterator() { @@ -115,7 +117,9 @@ public Stream stream() { return Arrays.stream(nodes).filter(Objects::nonNull).map(node -> (T) node); } - /** @see com.ibm.wala.util.graph.Graph#getNumberOfNodes() */ + /** + * @see com.ibm.wala.util.graph.Graph#getNumberOfNodes() + */ @Override public int getNumberOfNodes() { return numberOfNodes; @@ -159,7 +163,9 @@ private void ensureCapacity(int number) { } } - /** @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) + */ @Override public void removeNode(T n) { if (n == null) { @@ -189,7 +195,9 @@ public String toString() { return result.toString(); } - /** @see com.ibm.wala.util.graph.NodeManager#containsNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#containsNode(Object) + */ @Override public boolean containsNode(@Nullable T n) { if (n == null) { diff --git a/util/src/main/java/com/ibm/wala/util/graph/impl/GraphInverter.java b/util/src/main/java/com/ibm/wala/util/graph/impl/GraphInverter.java index eea90a1443..4f28508701 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/impl/GraphInverter.java +++ b/util/src/main/java/com/ibm/wala/util/graph/impl/GraphInverter.java @@ -20,7 +20,9 @@ public static NumberedGraph invert(final NumberedGraph G) { return new InvertedNumberedGraph<>(G); } - /** @return A graph view that reverses the edges in G */ + /** + * @return A graph view that reverses the edges in G + */ public static Graph invert(final Graph G) { if (G instanceof NumberedGraph) { return new InvertedNumberedGraph<>((NumberedGraph) G); diff --git a/util/src/main/java/com/ibm/wala/util/graph/impl/NodeWithNumber.java b/util/src/main/java/com/ibm/wala/util/graph/impl/NodeWithNumber.java index 5eb8d318aa..a0149aa2e9 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/impl/NodeWithNumber.java +++ b/util/src/main/java/com/ibm/wala/util/graph/impl/NodeWithNumber.java @@ -25,7 +25,9 @@ public class NodeWithNumber implements INodeWithNumber { private int number = -1; - /** @return the number which identifies this node in the numbered graph */ + /** + * @return the number which identifies this node in the numbered graph + */ @Override public int getGraphNodeId() { return number; diff --git a/util/src/main/java/com/ibm/wala/util/graph/impl/NumberedNodeIterator.java b/util/src/main/java/com/ibm/wala/util/graph/impl/NumberedNodeIterator.java index 20ef417469..093fdbbb0d 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/impl/NumberedNodeIterator.java +++ b/util/src/main/java/com/ibm/wala/util/graph/impl/NumberedNodeIterator.java @@ -22,7 +22,9 @@ public class NumberedNodeIterator implements Iterator { final NumberedNodeManager nodeManager; - /** @throws IllegalArgumentException if s is null */ + /** + * @throws IllegalArgumentException if s is null + */ public NumberedNodeIterator(IntSet s, NumberedNodeManager nodeManager) { if (s == null) { throw new IllegalArgumentException("s is null"); diff --git a/util/src/main/java/com/ibm/wala/util/graph/impl/SlowNumberedNodeManager.java b/util/src/main/java/com/ibm/wala/util/graph/impl/SlowNumberedNodeManager.java index 5151fc931d..b149ec2ea7 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/impl/SlowNumberedNodeManager.java +++ b/util/src/main/java/com/ibm/wala/util/graph/impl/SlowNumberedNodeManager.java @@ -22,6 +22,7 @@ public class SlowNumberedNodeManager implements NumberedNodeManager, Serializable { private static final long serialVersionUID = 8956107128389624337L; + /** A bijection between integer <-> node */ private final MutableMapping map = MutableMapping.make(); @@ -67,7 +68,9 @@ public void addNode(T n) { map.add(n); } - /** @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#removeNode(Object) + */ @Override public void removeNode(T n) { map.deleteMappedObject(n); @@ -84,7 +87,9 @@ public String toString() { return result.toString(); } - /** @see com.ibm.wala.util.graph.NodeManager#containsNode(Object) */ + /** + * @see com.ibm.wala.util.graph.NodeManager#containsNode(Object) + */ @Override public boolean containsNode(@Nullable T N) { return getNumber(N) != -1; diff --git a/util/src/main/java/com/ibm/wala/util/graph/impl/SlowSparseNumberedGraph.java b/util/src/main/java/com/ibm/wala/util/graph/impl/SlowSparseNumberedGraph.java index 7e295ab33f..440183268c 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/impl/SlowSparseNumberedGraph.java +++ b/util/src/main/java/com/ibm/wala/util/graph/impl/SlowSparseNumberedGraph.java @@ -43,19 +43,25 @@ public SlowSparseNumberedGraph(int normalOutCount) { nodeManager, normalOutCount, BasicNaturalRelation.TWO_LEVEL); } - /** @see com.ibm.wala.util.graph.AbstractGraph#getNodeManager() */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getNodeManager() + */ @Override public NumberedNodeManager getNodeManager() { return nodeManager; } - /** @see com.ibm.wala.util.graph.AbstractGraph#getEdgeManager() */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getEdgeManager() + */ @Override public NumberedEdgeManager getEdgeManager() { return edgeManager; } - /** @return a graph with the same nodes and edges as g */ + /** + * @return a graph with the same nodes and edges as g + */ public static SlowSparseNumberedGraph duplicate(Graph g) { SlowSparseNumberedGraph result = make(); copyInto(g, result); diff --git a/util/src/main/java/com/ibm/wala/util/graph/impl/SparseNumberedEdgeManager.java b/util/src/main/java/com/ibm/wala/util/graph/impl/SparseNumberedEdgeManager.java index 796eddb84f..7c134985ec 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/impl/SparseNumberedEdgeManager.java +++ b/util/src/main/java/com/ibm/wala/util/graph/impl/SparseNumberedEdgeManager.java @@ -33,7 +33,9 @@ public final class SparseNumberedEdgeManager implements NumberedEdgeManager nodeManager) { this(nodeManager, 0, BasicNaturalRelation.TWO_LEVEL); } @@ -77,7 +79,9 @@ public SparseNumberedEdgeManager( private final IBinaryNaturalRelation predecessors; - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodes(java.lang.Object) + */ @Override public Iterator getPredNodes(@Nullable T N) throws IllegalArgumentException { int number = nodeManager.getNumber(N); @@ -89,7 +93,9 @@ public Iterator getPredNodes(@Nullable T N) throws IllegalArgumentException { return (s == null) ? empty : nodeManager.iterateNodes(s); } - /** @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getPredNodeCount(java.lang.Object) + */ @Override public int getPredNodeCount(T N) throws IllegalArgumentException { int number = nodeManager.getNumber(N); @@ -99,7 +105,9 @@ public int getPredNodeCount(T N) throws IllegalArgumentException { return predecessors.getRelatedCount(number); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) + */ @Override public Iterator getSuccNodes(@Nullable T N) throws IllegalArgumentException { int number = nodeManager.getNumber(N); @@ -111,7 +119,9 @@ public Iterator getSuccNodes(@Nullable T N) throws IllegalArgumentException { return (s == null) ? empty : nodeManager.iterateNodes(s); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodes(java.lang.Object) + */ public Iterator getSuccNodes(int number) { IntSet s = successors.getRelated(number); Iterator empty = EmptyIterator.instance(); @@ -139,18 +149,24 @@ public IntSet getPredNodeNumbers(@Nullable T node) throws IllegalArgumentExcepti return predecessors.getRelated(nodeManager.getNumber(node)); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(java.lang.Object) + */ @Override public int getSuccNodeCount(T N) throws IllegalArgumentException { return getSuccNodeCount(nodeManager.getNumber(N)); } - /** @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#getSuccNodeCount(java.lang.Object) + */ public int getSuccNodeCount(int number) { return successors.getRelatedCount(number); } - /** @see com.ibm.wala.util.graph.EdgeManager#addEdge(java.lang.Object, java.lang.Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#addEdge(java.lang.Object, java.lang.Object) + */ @Override public void addEdge(T src, T dst) throws IllegalArgumentException { int x = nodeManager.getNumber(src); @@ -176,7 +192,9 @@ public boolean hasEdge(@Nullable T src, @Nullable T dst) { return successors.contains(x, y); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) + */ @Override public void removeAllIncidentEdges(T node) throws IllegalArgumentException { final int number = nodeManager.getNumber(node); @@ -202,7 +220,9 @@ public void removeAllIncidentEdges(T node) throws IllegalArgumentException { predecessors.removeAll(number); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) + */ @Override public void removeIncomingEdges(T node) throws IllegalArgumentException { final int number = nodeManager.getNumber(node); @@ -239,7 +259,9 @@ public void removeEdge(T src, T dst) throws IllegalArgumentException { predecessors.remove(dstNumber, srcNumber); } - /** @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) */ + /** + * @see com.ibm.wala.util.graph.EdgeManager#removeAllIncidentEdges(Object) + */ @Override public void removeOutgoingEdges(T node) throws IllegalArgumentException { final int number = nodeManager.getNumber(node); diff --git a/util/src/main/java/com/ibm/wala/util/graph/impl/SparseNumberedGraph.java b/util/src/main/java/com/ibm/wala/util/graph/impl/SparseNumberedGraph.java index d4ad025878..bc3d6f674b 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/impl/SparseNumberedGraph.java +++ b/util/src/main/java/com/ibm/wala/util/graph/impl/SparseNumberedGraph.java @@ -46,13 +46,17 @@ public SparseNumberedGraph( this.edgeManager = edgeManager; } - /** @see com.ibm.wala.util.graph.AbstractGraph#getNodeManager() */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getNodeManager() + */ @Override protected NumberedNodeManager getNodeManager() { return nodeManager; } - /** @see com.ibm.wala.util.graph.AbstractGraph#getEdgeManager() */ + /** + * @see com.ibm.wala.util.graph.AbstractGraph#getEdgeManager() + */ @Override protected NumberedEdgeManager getEdgeManager() { return edgeManager; diff --git a/util/src/main/java/com/ibm/wala/util/graph/labeled/AbstractLabeledGraph.java b/util/src/main/java/com/ibm/wala/util/graph/labeled/AbstractLabeledGraph.java index 24e074cc3a..a81643c804 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/labeled/AbstractLabeledGraph.java +++ b/util/src/main/java/com/ibm/wala/util/graph/labeled/AbstractLabeledGraph.java @@ -55,7 +55,9 @@ public abstract class AbstractLabeledGraph extends AbstractGraph implements LabeledGraph { - /** @return the object which manages edges in the graph */ + /** + * @return the object which manages edges in the graph + */ @Override protected abstract LabeledEdgeManager getEdgeManager(); diff --git a/util/src/main/java/com/ibm/wala/util/graph/labeled/AbstractNumberedLabeledGraph.java b/util/src/main/java/com/ibm/wala/util/graph/labeled/AbstractNumberedLabeledGraph.java index 728e58ddbe..05e4a4e038 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/labeled/AbstractNumberedLabeledGraph.java +++ b/util/src/main/java/com/ibm/wala/util/graph/labeled/AbstractNumberedLabeledGraph.java @@ -19,7 +19,9 @@ public abstract class AbstractNumberedLabeledGraph extends AbstractNumberedGraph implements LabeledGraph, NumberedLabeledGraph { - /** @return the object which manages edges in the graph */ + /** + * @return the object which manages edges in the graph + */ @Override protected abstract NumberedLabeledEdgeManager getEdgeManager(); diff --git a/util/src/main/java/com/ibm/wala/util/graph/labeled/LabeledEdgeManager.java b/util/src/main/java/com/ibm/wala/util/graph/labeled/LabeledEdgeManager.java index e425a2a3f7..23f9162986 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/labeled/LabeledEdgeManager.java +++ b/util/src/main/java/com/ibm/wala/util/graph/labeled/LabeledEdgeManager.java @@ -67,8 +67,7 @@ public interface LabeledEdgeManager extends EdgeManager { * Sets the default object used as label for operations where no specific edge label is provided. * This is due to compatibility with the EdgeManager interface */ - @Nullable - U getDefaultLabel(); + @Nullable U getDefaultLabel(); /** * Return an Iterator over the immediate predecessor nodes of this Node in the Graph on edges with @@ -85,7 +84,9 @@ default Iterator getPredNodes(T N, Predicate pred) { getPredNodes(N), (p) -> getEdgeLabels(p, N).stream().anyMatch(pred)); } - /** @return the labels on edges whose destination is N */ + /** + * @return the labels on edges whose destination is N + */ Iterator getPredLabels(T N); /** @@ -106,7 +107,9 @@ default Iterator getPredNodes(T N, Predicate pred) { */ Iterator getSuccNodes(T N, U label); - /** @return the labels on edges whose source is N */ + /** + * @return the labels on edges whose source is N + */ Iterator getSuccLabels(T N); /** diff --git a/util/src/main/java/com/ibm/wala/util/graph/labeled/SlowSparseNumberedLabeledGraph.java b/util/src/main/java/com/ibm/wala/util/graph/labeled/SlowSparseNumberedLabeledGraph.java index 5afa4682cc..f7efb9e8f6 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/labeled/SlowSparseNumberedLabeledGraph.java +++ b/util/src/main/java/com/ibm/wala/util/graph/labeled/SlowSparseNumberedLabeledGraph.java @@ -61,7 +61,9 @@ public class SlowSparseNumberedLabeledGraph extends AbstractNumberedLabele /** */ private static final long serialVersionUID = -6929183520814732209L; - /** @return a graph with the same nodes and edges as g */ + /** + * @return a graph with the same nodes and edges as g + */ public static SlowSparseNumberedLabeledGraph duplicate(LabeledGraph g) { SlowSparseNumberedLabeledGraph result = new SlowSparseNumberedLabeledGraph<>(g.getDefaultLabel()); diff --git a/util/src/main/java/com/ibm/wala/util/graph/labeled/SparseNumberedLabeledEdgeManager.java b/util/src/main/java/com/ibm/wala/util/graph/labeled/SparseNumberedLabeledEdgeManager.java index 3abb03069a..1e9f3d3291 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/labeled/SparseNumberedLabeledEdgeManager.java +++ b/util/src/main/java/com/ibm/wala/util/graph/labeled/SparseNumberedLabeledEdgeManager.java @@ -91,7 +91,9 @@ private SparseNumberedEdgeManager getManagerForLabel(@Nullable U label) { return ret; } - /** @see LabeledEdgeManager#addEdge(java.lang.Object, java.lang.Object, java.lang.Object) */ + /** + * @see LabeledEdgeManager#addEdge(java.lang.Object, java.lang.Object, java.lang.Object) + */ @Override public void addEdge(T src, T dst, @Nullable U label) { nodeToSuccLabels.put(src, label); @@ -99,31 +101,41 @@ public void addEdge(T src, T dst, @Nullable U label) { getManagerForLabel(label).addEdge(src, dst); } - /** @see LabeledEdgeManager#getPredNodeCount(java.lang.Object, java.lang.Object) */ + /** + * @see LabeledEdgeManager#getPredNodeCount(java.lang.Object, java.lang.Object) + */ @Override public int getPredNodeCount(T N, U label) { return getManagerForLabel(label).getPredNodeCount(N); } - /** @see LabeledEdgeManager#getPredNodes(java.lang.Object, java.lang.Object) */ + /** + * @see LabeledEdgeManager#getPredNodes(java.lang.Object, java.lang.Object) + */ @Override public Iterator getPredNodes(@Nullable T N, U label) { return getManagerForLabel(label).getPredNodes(N); } - /** @see LabeledEdgeManager#getSuccNodeCount(java.lang.Object, java.lang.Object) */ + /** + * @see LabeledEdgeManager#getSuccNodeCount(java.lang.Object, java.lang.Object) + */ @Override public int getSuccNodeCount(T N, U label) { return getManagerForLabel(label).getSuccNodeCount(N); } - /** @see LabeledEdgeManager#getSuccNodes(java.lang.Object, java.lang.Object) */ + /** + * @see LabeledEdgeManager#getSuccNodes(java.lang.Object, java.lang.Object) + */ @Override public Iterator getSuccNodes(@Nullable T N, U label) { return getManagerForLabel(label).getSuccNodes(N); } - /** @see LabeledEdgeManager#hasEdge(java.lang.Object, java.lang.Object, java.lang.Object) */ + /** + * @see LabeledEdgeManager#hasEdge(java.lang.Object, java.lang.Object, java.lang.Object) + */ @Override public boolean hasEdge(@Nullable T src, @Nullable T dst, U label) { return getManagerForLabel(label).hasEdge(src, dst); @@ -140,13 +152,17 @@ public void removeAllIncidentEdges(T node) { removeOutgoingEdges(node); } - /** @see LabeledEdgeManager#removeEdge(java.lang.Object, java.lang.Object, java.lang.Object) */ + /** + * @see LabeledEdgeManager#removeEdge(java.lang.Object, java.lang.Object, java.lang.Object) + */ @Override public void removeEdge(T src, T dst, U label) throws IllegalArgumentException { getManagerForLabel(label).removeEdge(src, dst); } - /** @see LabeledEdgeManager#removeIncomingEdges(java.lang.Object) */ + /** + * @see LabeledEdgeManager#removeIncomingEdges(java.lang.Object) + */ @Override public void removeIncomingEdges(T node) throws IllegalArgumentException { for (U label : nodeToPredLabels.get(node)) { @@ -154,7 +170,9 @@ public void removeIncomingEdges(T node) throws IllegalArgumentException { } } - /** @see LabeledEdgeManager#removeOutgoingEdges(java.lang.Object) */ + /** + * @see LabeledEdgeManager#removeOutgoingEdges(java.lang.Object) + */ @Override public void removeOutgoingEdges(T node) throws IllegalArgumentException { for (U label : nodeToSuccLabels.get(node)) { diff --git a/util/src/main/java/com/ibm/wala/util/graph/traverse/BoundedBFSIterator.java b/util/src/main/java/com/ibm/wala/util/graph/traverse/BoundedBFSIterator.java index fd9ebf7cb2..d2a9369c3a 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/traverse/BoundedBFSIterator.java +++ b/util/src/main/java/com/ibm/wala/util/graph/traverse/BoundedBFSIterator.java @@ -166,7 +166,9 @@ public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } - /** @return the currentHops */ + /** + * @return the currentHops + */ public int getCurrentHops() { return currentHops; } diff --git a/util/src/main/java/com/ibm/wala/util/graph/traverse/DFS.java b/util/src/main/java/com/ibm/wala/util/graph/traverse/DFS.java index 84f53f84e4..a07848e52e 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/traverse/DFS.java +++ b/util/src/main/java/com/ibm/wala/util/graph/traverse/DFS.java @@ -138,7 +138,9 @@ public int compare(T o1, T o2) { } } - /** @return iterator of nodes of G in order of DFS discover time */ + /** + * @return iterator of nodes of G in order of DFS discover time + */ public static DFSDiscoverTimeIterator iterateDiscoverTime(Graph G) { if (G instanceof NumberedGraph) { return new NumberedDFSDiscoverTimeIterator<>((NumberedGraph) G); diff --git a/util/src/main/java/com/ibm/wala/util/graph/traverse/DFSDiscoverTimeIterator.java b/util/src/main/java/com/ibm/wala/util/graph/traverse/DFSDiscoverTimeIterator.java index aaca66623a..71313559b8 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/traverse/DFSDiscoverTimeIterator.java +++ b/util/src/main/java/com/ibm/wala/util/graph/traverse/DFSDiscoverTimeIterator.java @@ -30,6 +30,7 @@ public abstract class DFSDiscoverTimeIterator extends ArrayList implements Iterator { private static final long serialVersionUID = 4238700455408861924L; + /** an enumeration of all nodes to search from */ @Nullable private Iterator roots; diff --git a/util/src/main/java/com/ibm/wala/util/graph/traverse/GraphDFSDiscoverTimeIterator.java b/util/src/main/java/com/ibm/wala/util/graph/traverse/GraphDFSDiscoverTimeIterator.java index d2cfab922d..3446c630bb 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/traverse/GraphDFSDiscoverTimeIterator.java +++ b/util/src/main/java/com/ibm/wala/util/graph/traverse/GraphDFSDiscoverTimeIterator.java @@ -18,6 +18,7 @@ abstract class GraphDFSDiscoverTimeIterator extends DFSDiscoverTimeIterator { private static final long serialVersionUID = -5673397879499010863L; + /** the graph being searched */ @Nullable private Graph G; diff --git a/util/src/main/java/com/ibm/wala/util/graph/traverse/SlowDFSFinishTimeIterator.java b/util/src/main/java/com/ibm/wala/util/graph/traverse/SlowDFSFinishTimeIterator.java index b45e4c1d89..6859c39fcf 100644 --- a/util/src/main/java/com/ibm/wala/util/graph/traverse/SlowDFSFinishTimeIterator.java +++ b/util/src/main/java/com/ibm/wala/util/graph/traverse/SlowDFSFinishTimeIterator.java @@ -61,7 +61,9 @@ public SlowDFSFinishTimeIterator(Graph G, @Nullable Iterator nod init(G, nodes); } - /** @throws NullPointerException if G is null */ + /** + * @throws NullPointerException if G is null + */ public SlowDFSFinishTimeIterator(Graph G) throws NullPointerException { this(G, G == null ? null : G.iterator()); } diff --git a/util/src/main/java/com/ibm/wala/util/heapTrace/HeapTracer.java b/util/src/main/java/com/ibm/wala/util/heapTrace/HeapTracer.java index 39aa692b0b..560a2621a8 100644 --- a/util/src/main/java/com/ibm/wala/util/heapTrace/HeapTracer.java +++ b/util/src/main/java/com/ibm/wala/util/heapTrace/HeapTracer.java @@ -87,7 +87,9 @@ public class HeapTracer { } } - /** @param traceStatics Should all static fields be considered roots of the heap traversal? */ + /** + * @param traceStatics Should all static fields be considered roots of the heap traversal? + */ HeapTracer(boolean traceStatics) { rootInstances = Collections.emptySet(); this.traceStatics = traceStatics; @@ -107,7 +109,9 @@ public static void main(String[] args) { } } - /** @return the name of each class that's in the classpath */ + /** + * @return the name of each class that's in the classpath + */ private static String[] generateRootClassesFromWorkspace() { String classpath = System.getProperty("java.class.path"); Object[] binDirectories = extractBinDirectories(classpath); @@ -145,7 +149,9 @@ private static Collection findClassNames(String rootDir, File f) { return result; } - /** @return set of strings that are names of directories that contain "bin" */ + /** + * @return set of strings that are names of directories that contain "bin" + */ private static Object[] extractBinDirectories(String classpath) { StringTokenizer t = new StringTokenizer(classpath, ";"); HashSet result = HashSetFactory.make(); @@ -185,7 +191,9 @@ public Result perform() return result; } - /** @return the estimated size of the object */ + /** + * @return the estimated size of the object + */ private static int computeSizeOf(Object o) { int result = BYTES_IN_HEADER; Class c = o.getClass(); @@ -204,7 +212,9 @@ private static int computeSizeOf(Object o) { return result; } - /** @return the estimated size of the object */ + /** + * @return the estimated size of the object + */ private int sizeOf(Object o) { Class c = o.getClass(); if (c.isArray()) { @@ -219,7 +229,9 @@ private int sizeOf(Object o) { } } - /** @return size of a field of type c, in bytes */ + /** + * @return size of a field of type c, in bytes + */ private static int sizeOfSlot(Class c) { if (!c.isPrimitive()) { return 4; @@ -436,7 +448,9 @@ private static HashSet getAllInstanceFields(Class c) { private final HashMap, Field[]> allReferenceFieldsCache = HashMapFactory.make(); - /** @return Field[] representing reference instance fields of a class */ + /** + * @return Field[] representing reference instance fields of a class + */ private Field[] getAllReferenceInstanceFields(Class c) { if (allReferenceFieldsCache.containsKey(c)) return allReferenceFieldsCache.get(c); else { @@ -587,12 +601,16 @@ public int compare(Object o1, Object o2) { } } - /** @return Returns the totalSize. */ + /** + * @return Returns the totalSize. + */ public int getTotalSize() { return totalSize; } - /** @return Returns the totalInstances. */ + /** + * @return Returns the totalInstances. + */ public int getTotalInstances() { return totalInstances; } @@ -607,7 +625,9 @@ public class Result { /** a mapping from Field (static field roots) -> Demographics object */ private final HashMap roots = HashMapFactory.make(); - /** @return the Demographics object tracking objects traced from that root */ + /** + * @return the Demographics object tracking objects traced from that root + */ private Demographics findOrCreateDemographics(Field root) { Demographics d = roots.get(root); if (d == null) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/BasicNaturalRelation.java b/util/src/main/java/com/ibm/wala/util/intset/BasicNaturalRelation.java index 6b98dec768..6aa008fe26 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/BasicNaturalRelation.java +++ b/util/src/main/java/com/ibm/wala/util/intset/BasicNaturalRelation.java @@ -262,7 +262,9 @@ private IntSet getDelegate(int x) { return delegateStore.get(x); } - /** @return true iff there exists pair (x,y) for some y */ + /** + * @return true iff there exists pair (x,y) for some y + */ @Override public boolean anyRelated(int x) { return smallStore[0].get(x) != EMPTY_CODE; @@ -381,7 +383,9 @@ public void removeAll(int x) { delegateStore.set(x, null); } - /** @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() */ + /** + * @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() + */ @Override public void performVerboseAction() { if (VERBOSE) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/BimodalMutableIntSet.java b/util/src/main/java/com/ibm/wala/util/intset/BimodalMutableIntSet.java index dde2133f42..6039770cd2 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/BimodalMutableIntSet.java +++ b/util/src/main/java/com/ibm/wala/util/intset/BimodalMutableIntSet.java @@ -45,7 +45,9 @@ public void copySet(IntSet set) { assert impl instanceof BitVectorIntSet || impl instanceof MutableSparseIntSet; } - /** @return true iff we would like to use the same representation for V as we do for W */ + /** + * @return true iff we would like to use the same representation for V as we do for W + */ private static boolean sameRepresentation(IntSet V, IntSet W) { // for now we assume that we always want to use the same representation for // V as @@ -66,7 +68,9 @@ public boolean addAll(IntSet set) { return result; } - /** @see com.ibm.wala.util.intset.MutableIntSet#addAll(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.MutableIntSet#addAll(com.ibm.wala.util.intset.IntSet) + */ @Override public boolean addAllInIntersection(IntSet other, IntSet filter) { if (other instanceof BitVectorIntSet && !(impl instanceof BitVectorIntSet)) { @@ -140,13 +144,17 @@ public void intersectWith(IntSet set) throws UnimplementedError { } } - /** @see com.ibm.wala.util.intset.IntSet#contains(int) */ + /** + * @see com.ibm.wala.util.intset.IntSet#contains(int) + */ @Override public boolean contains(int i) { return impl.contains(i); } - /** @see com.ibm.wala.util.intset.IntSet#intersection(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#intersection(com.ibm.wala.util.intset.IntSet) + */ @NullUnmarked @Nullable @Override @@ -162,7 +170,9 @@ public IntSet intersection(IntSet that) throws UnimplementedError { } } - /** @see com.ibm.wala.util.intset.IntSet#union(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#union(com.ibm.wala.util.intset.IntSet) + */ @Override public IntSet union(IntSet that) { BimodalMutableIntSet temp = new BimodalMutableIntSet(); @@ -172,25 +182,33 @@ public IntSet union(IntSet that) { return temp; } - /** @see com.ibm.wala.util.intset.IntSet#isEmpty() */ + /** + * @see com.ibm.wala.util.intset.IntSet#isEmpty() + */ @Override public boolean isEmpty() { return impl.isEmpty(); } - /** @see com.ibm.wala.util.intset.IntSet#size() */ + /** + * @see com.ibm.wala.util.intset.IntSet#size() + */ @Override public int size() { return impl.size(); } - /** @see IntSet#intIterator() */ + /** + * @see IntSet#intIterator() + */ @Override public IntIterator intIterator() { return impl.intIterator(); } - /** @see com.ibm.wala.util.intset.IntSet#foreach(com.ibm.wala.util.intset.IntSetAction) */ + /** + * @see com.ibm.wala.util.intset.IntSet#foreach(com.ibm.wala.util.intset.IntSetAction) + */ @Override public void foreach(IntSetAction action) { impl.foreach(action); @@ -205,7 +223,9 @@ public void foreachExcluding(IntSet X, IntSetAction action) { impl.foreachExcluding(X, action); } - /** @see com.ibm.wala.util.intset.IntSet#max() */ + /** + * @see com.ibm.wala.util.intset.IntSet#max() + */ @Override public int max() throws IllegalStateException { return impl.max(); @@ -248,7 +268,9 @@ public void clear() { impl = MutableSparseIntSet.makeEmpty(); } - /** @throws IllegalArgumentException if x is null */ + /** + * @throws IllegalArgumentException if x is null + */ public BimodalMutableIntSet(BimodalMutableIntSet x) { if (x == null) { throw new IllegalArgumentException("x is null"); @@ -257,13 +279,17 @@ public BimodalMutableIntSet(BimodalMutableIntSet x) { assert impl instanceof BitVectorIntSet || impl instanceof MutableSparseIntSet; } - /** @see com.ibm.wala.util.intset.IntSet#sameValue(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#sameValue(com.ibm.wala.util.intset.IntSet) + */ @Override public boolean sameValue(IntSet that) { return impl.sameValue(that); } - /** @see com.ibm.wala.util.intset.IntSet#isSubset(IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#isSubset(IntSet) + */ @Override public boolean isSubset(IntSet that) throws IllegalArgumentException { if (that == null) { @@ -290,7 +316,9 @@ public String toString() { return impl.toString(); } - /** @see com.ibm.wala.util.intset.IntSet#containsAny(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#containsAny(com.ibm.wala.util.intset.IntSet) + */ @Override public boolean containsAny(IntSet that) throws IllegalArgumentException, UnimplementedError { if (that == null) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/BitSet.java b/util/src/main/java/com/ibm/wala/util/intset/BitSet.java index bb37bc1de2..481bd2c51c 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/BitSet.java +++ b/util/src/main/java/com/ibm/wala/util/intset/BitSet.java @@ -93,7 +93,9 @@ public boolean contains(T o) { return vector.get(n); } - /** @return a String representation */ + /** + * @return a String representation + */ @Override public String toString() { return vector.toString(); diff --git a/util/src/main/java/com/ibm/wala/util/intset/BitVector.java b/util/src/main/java/com/ibm/wala/util/intset/BitVector.java index 25cb894990..e5ca9bf95d 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/BitVector.java +++ b/util/src/main/java/com/ibm/wala/util/intset/BitVector.java @@ -319,7 +319,9 @@ public final boolean sameBits(BitVector B) { return true; } - /** @return true iff this is a subset of other */ + /** + * @return true iff this is a subset of other + */ @Override public boolean isSubset(BitVector other) { if (other == null) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/BitVectorBase.java b/util/src/main/java/com/ibm/wala/util/intset/BitVectorBase.java index 34c5ba9051..c6e8651086 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/BitVectorBase.java +++ b/util/src/main/java/com/ibm/wala/util/intset/BitVectorBase.java @@ -127,7 +127,9 @@ public String toString() { return buffer.toString(); } - /** @see com.ibm.wala.util.intset.IntSet#contains(int) */ + /** + * @see com.ibm.wala.util.intset.IntSet#contains(int) + */ public boolean contains(int i) { return get(i); } @@ -191,7 +193,9 @@ public int max() { return count + (31 - j); } - /** @return min j >= start s.t get(j) */ + /** + * @return min j >= start s.t get(j) + */ public int nextSetBit(int start) { if (start < 0) { throw new IllegalArgumentException("illegal start: " + start); diff --git a/util/src/main/java/com/ibm/wala/util/intset/BitVectorIntSet.java b/util/src/main/java/com/ibm/wala/util/intset/BitVectorIntSet.java index d670691cb6..97e31f13ee 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/BitVectorIntSet.java +++ b/util/src/main/java/com/ibm/wala/util/intset/BitVectorIntSet.java @@ -159,7 +159,9 @@ public void intersectWith(IntSet set) { populationCount = UNDEFINED; } - /** @see com.ibm.wala.util.intset.IntSet#intersection(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#intersection(com.ibm.wala.util.intset.IntSet) + */ @Override public BitVectorIntSet intersection(IntSet that) { BitVectorIntSet newbie = new BitVectorIntSet(); @@ -168,7 +170,9 @@ public BitVectorIntSet intersection(IntSet that) { return newbie; } - /** @see com.ibm.wala.util.intset.IntSet#union(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#union(com.ibm.wala.util.intset.IntSet) + */ @Override public IntSet union(IntSet that) { BitVectorIntSet temp = new BitVectorIntSet(); @@ -178,13 +182,17 @@ public IntSet union(IntSet that) { return temp; } - /** @see com.ibm.wala.util.intset.IntSet#isEmpty() */ + /** + * @see com.ibm.wala.util.intset.IntSet#isEmpty() + */ @Override public boolean isEmpty() { return size() == 0; } - /** @see com.ibm.wala.util.intset.IntSet#size() */ + /** + * @see com.ibm.wala.util.intset.IntSet#size() + */ @Override public int size() { populationCount = @@ -217,7 +225,9 @@ public int next() { }; } - /** @see com.ibm.wala.util.intset.IntSet#foreach(com.ibm.wala.util.intset.IntSetAction) */ + /** + * @see com.ibm.wala.util.intset.IntSet#foreach(com.ibm.wala.util.intset.IntSetAction) + */ @Override public void foreach(IntSetAction action) { if (action == null) { @@ -243,7 +253,9 @@ public SparseIntSet makeSparseCopy() { return new SparseIntSet(elements); } - /** @see com.ibm.wala.util.intset.IntSet#foreach(com.ibm.wala.util.intset.IntSetAction) */ + /** + * @see com.ibm.wala.util.intset.IntSet#foreach(com.ibm.wala.util.intset.IntSetAction) + */ @Override public void foreachExcluding(IntSet X, IntSetAction action) { if (X instanceof BitVectorIntSet) { @@ -316,12 +328,16 @@ public String toString() { return bitVector.toString(); } - /** @return min j >= n s.t get(j) */ + /** + * @return min j >= n s.t get(j) + */ public int nextSetBit(int n) { return bitVector.nextSetBit(n); } - /** @see com.ibm.wala.util.intset.IntSet#sameValue(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#sameValue(com.ibm.wala.util.intset.IntSet) + */ @Override public boolean sameValue(@Nullable IntSet that) throws IllegalArgumentException, UnimplementedError { @@ -359,7 +375,9 @@ private boolean sameValueInternal(SparseIntSet that) { return true; } - /** @see com.ibm.wala.util.intset.IntSet#isSubset(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#isSubset(com.ibm.wala.util.intset.IntSet) + */ @NullUnmarked @Override public boolean isSubset(@Nullable IntSet that) { @@ -396,7 +414,9 @@ public SparseIntSet toSparseIntSet() { return result; } - /** @throws IllegalArgumentException if set is null */ + /** + * @throws IllegalArgumentException if set is null + */ public boolean removeAll(BitVectorIntSet set) { if (set == null) { throw new IllegalArgumentException("set is null"); @@ -407,7 +427,9 @@ public boolean removeAll(BitVectorIntSet set) { return oldSize > size(); } - /** @see com.ibm.wala.util.intset.IntSet#containsAny(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#containsAny(com.ibm.wala.util.intset.IntSet) + */ @Override public boolean containsAny(IntSet set) throws IllegalArgumentException { if (set == null) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/BitVectorIntSetFactory.java b/util/src/main/java/com/ibm/wala/util/intset/BitVectorIntSetFactory.java index 41253de320..7ac78ea084 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/BitVectorIntSetFactory.java +++ b/util/src/main/java/com/ibm/wala/util/intset/BitVectorIntSetFactory.java @@ -15,7 +15,9 @@ /** */ public class BitVectorIntSetFactory implements MutableIntSetFactory { - /** @throws IllegalArgumentException if set is null */ + /** + * @throws IllegalArgumentException if set is null + */ @Override public BitVectorIntSet make(int[] set) { if (set == null) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/DebuggingMutableIntSet.java b/util/src/main/java/com/ibm/wala/util/intset/DebuggingMutableIntSet.java index 02dad1e03b..6a5f348cd7 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/DebuggingMutableIntSet.java +++ b/util/src/main/java/com/ibm/wala/util/intset/DebuggingMutableIntSet.java @@ -44,7 +44,9 @@ public void clear() { secondaryImpl.clear(); } - /** @return true iff this set contains integer i */ + /** + * @return true iff this set contains integer i + */ @Override public boolean contains(int i) { assert primaryImpl.contains(i) == secondaryImpl.contains(i); @@ -132,7 +134,9 @@ public boolean remove(int i) { return result; } - /** @return true iff this set contains integer i */ + /** + * @return true iff this set contains integer i + */ @Override public boolean containsAny(IntSet set) { if (set instanceof DebuggingMutableIntSet) { @@ -173,7 +177,9 @@ public IntSet intersection(IntSet that) { } } - /** @see com.ibm.wala.util.intset.IntSet#union(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#union(com.ibm.wala.util.intset.IntSet) + */ @Override public IntSet union(IntSet that) { MutableSparseIntSet temp = new MutableSparseIntSet(); @@ -183,7 +189,9 @@ public IntSet union(IntSet that) { return temp; } - /** @return true iff {@code this} has the same value as {@code that}. */ + /** + * @return true iff {@code this} has the same value as {@code that}. + */ @Override public boolean sameValue(IntSet that) { if (that instanceof DebuggingMutableIntSet) { @@ -200,7 +208,9 @@ public boolean sameValue(IntSet that) { } } - /** @return true iff {@code this} is a subset of {@code that}. */ + /** + * @return true iff {@code this} is a subset of {@code that}. + */ @Override public boolean isSubset(IntSet that) { if (that instanceof DebuggingMutableIntSet) { @@ -307,7 +317,9 @@ public boolean addAllInIntersection(IntSet other, IntSet filter) { } } - /** @see com.ibm.wala.util.intset.IntSet#intIterator() */ + /** + * @see com.ibm.wala.util.intset.IntSet#intIterator() + */ @Override public IntIterator intIterator() { MutableSparseIntSet bits = MutableSparseIntSet.makeEmpty(); diff --git a/util/src/main/java/com/ibm/wala/util/intset/IBinaryNaturalRelation.java b/util/src/main/java/com/ibm/wala/util/intset/IBinaryNaturalRelation.java index 2a267691dc..82f8b1591f 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/IBinaryNaturalRelation.java +++ b/util/src/main/java/com/ibm/wala/util/intset/IBinaryNaturalRelation.java @@ -21,20 +21,28 @@ public interface IBinaryNaturalRelation extends VerboseAction, Iterable */ boolean add(int x, int y); - /** @return IntSet of y s.t. R(x,y) or null if none. */ + /** + * @return IntSet of y s.t. R(x,y) or null if none. + */ IntSet getRelated(int x); - /** @return number of y s.t. R(x,y) */ + /** + * @return number of y s.t. R(x,y) + */ int getRelatedCount(int x); - /** @return true iff there exists pair (x,y) for some y */ + /** + * @return true iff there exists pair (x,y) for some y + */ boolean anyRelated(int x); void remove(int x, int y); void removeAll(int x); - /** @return true iff (x,y) \in R */ + /** + * @return true iff (x,y) \in R + */ boolean contains(int x, int y); int maxKeyValue(); diff --git a/util/src/main/java/com/ibm/wala/util/intset/IntIterator.java b/util/src/main/java/com/ibm/wala/util/intset/IntIterator.java index b9bb7081b1..fd78465f66 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/IntIterator.java +++ b/util/src/main/java/com/ibm/wala/util/intset/IntIterator.java @@ -13,9 +13,13 @@ /** a more efficient iterator for sets of integers */ public interface IntIterator { - /** @return true iff this iterator has a next element */ + /** + * @return true iff this iterator has a next element + */ boolean hasNext(); - /** @return next integer in the iteration */ + /** + * @return next integer in the iteration + */ int next(); } diff --git a/util/src/main/java/com/ibm/wala/util/intset/IntPair.java b/util/src/main/java/com/ibm/wala/util/intset/IntPair.java index fd5b8618fa..1e044afeed 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/IntPair.java +++ b/util/src/main/java/com/ibm/wala/util/intset/IntPair.java @@ -21,12 +21,16 @@ public IntPair(int x, int y) { this.y = y; } - /** @return Returns the x. */ + /** + * @return Returns the x. + */ public int getX() { return x; } - /** @return Returns the y. */ + /** + * @return Returns the y. + */ public int getY() { return y; } diff --git a/util/src/main/java/com/ibm/wala/util/intset/IntSet.java b/util/src/main/java/com/ibm/wala/util/intset/IntSet.java index bc4b7cf0e0..05a5eb39fc 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/IntSet.java +++ b/util/src/main/java/com/ibm/wala/util/intset/IntSet.java @@ -15,10 +15,14 @@ /** Set of integers; not necessary mutable TODO: extract a smaller interface? */ public interface IntSet extends Serializable { - /** @return true iff this set contains integer i */ + /** + * @return true iff this set contains integer i + */ boolean contains(int i); - /** @return true iff this set contains integer i */ + /** + * @return true iff this set contains integer i + */ boolean containsAny(IntSet set); /** @@ -35,13 +39,19 @@ public interface IntSet extends Serializable { */ IntSet union(IntSet that); - /** @return true iff this set is empty */ + /** + * @return true iff this set is empty + */ boolean isEmpty(); - /** @return the number of elements in this set */ + /** + * @return the number of elements in this set + */ int size(); - /** @return a perhaps more efficient iterator */ + /** + * @return a perhaps more efficient iterator + */ IntIterator intIterator(); /** Invoke an action on each element of the Set */ @@ -50,12 +60,18 @@ public interface IntSet extends Serializable { /** Invoke an action on each element of the Set, excluding elements of Set X */ void foreachExcluding(IntSet X, IntSetAction action); - /** @return maximum integer in this set. */ + /** + * @return maximum integer in this set. + */ int max(); - /** @return true iff {@code this} has the same value as {@code that}. */ + /** + * @return true iff {@code this} has the same value as {@code that}. + */ boolean sameValue(IntSet that); - /** @return true iff {@code this} is a subset of {@code that}. */ + /** + * @return true iff {@code this} is a subset of {@code that}. + */ boolean isSubset(IntSet that); } diff --git a/util/src/main/java/com/ibm/wala/util/intset/IntSetUtil.java b/util/src/main/java/com/ibm/wala/util/intset/IntSetUtil.java index 437037adaf..29321f477a 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/IntSetUtil.java +++ b/util/src/main/java/com/ibm/wala/util/intset/IntSetUtil.java @@ -183,7 +183,9 @@ public static MutableIntSet removeAll(MutableIntSet A, IntSet B) throws IllegalA } } - /** @return index \in [low,high] s.t. data[index] = key, or -1 if not found */ + /** + * @return index \in [low,high] s.t. data[index] = key, or -1 if not found + */ public static int binarySearch(int[] data, int key, int low, int high) throws IllegalArgumentException { if (data == null) { @@ -213,12 +215,16 @@ public static int binarySearch(int[] data, int key, int low, int high) } } - /** @return Returns the defaultIntSetFactory. */ + /** + * @return Returns the defaultIntSetFactory. + */ public static MutableIntSetFactory getDefaultIntSetFactory() { return defaultIntSetFactory; } - /** @param defaultIntSetFactory The defaultIntSetFactory to set. */ + /** + * @param defaultIntSetFactory The defaultIntSetFactory to set. + */ public static void setDefaultIntSetFactory(MutableIntSetFactory defaultIntSetFactory) { if (defaultIntSetFactory == null) { throw new IllegalArgumentException("null defaultIntSetFactory"); diff --git a/util/src/main/java/com/ibm/wala/util/intset/IntVector.java b/util/src/main/java/com/ibm/wala/util/intset/IntVector.java index fbd95212d9..c8f6a6395a 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/IntVector.java +++ b/util/src/main/java/com/ibm/wala/util/intset/IntVector.java @@ -17,6 +17,8 @@ public interface IntVector { void set(int x, int value); - /** @return max i s.t set(i) was called. */ + /** + * @return max i s.t set(i) was called. + */ int getMaxIndex(); } diff --git a/util/src/main/java/com/ibm/wala/util/intset/IntegerUnionFind.java b/util/src/main/java/com/ibm/wala/util/intset/IntegerUnionFind.java index 8acd13ff16..ead435352a 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/IntegerUnionFind.java +++ b/util/src/main/java/com/ibm/wala/util/intset/IntegerUnionFind.java @@ -21,6 +21,7 @@ public class IntegerUnionFind { private static final int MAX_VALUE = Integer.MAX_VALUE / 4; private static final int DEFAULT_SIZE = 100; + /** * parent[i+1] = * @@ -37,7 +38,9 @@ public IntegerUnionFind() { this(DEFAULT_SIZE); } - /** @param size initial size of the tables */ + /** + * @param size initial size of the tables + */ public IntegerUnionFind(int size) { if (size < 0 || size > MAX_VALUE) { throw new IllegalArgumentException("illegal size: " + size); @@ -85,7 +88,9 @@ private void grow(int size) { parent = Arrays.copyOf(parent, size + 1); } - /** @return representative of x's equivalence class */ + /** + * @return representative of x's equivalence class + */ public int find(int x) { if (x < 0) { throw new IllegalArgumentException("illegal x " + x); @@ -98,7 +103,9 @@ public int find(int x) { return findInternal(x + 1) - 1; } - /** @return representative of x's equivalence class */ + /** + * @return representative of x's equivalence class + */ private int findInternal(int x) { int root = x; while (parent[root] > 0) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/LongIterator.java b/util/src/main/java/com/ibm/wala/util/intset/LongIterator.java index 9911be283e..7d0cce00fd 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/LongIterator.java +++ b/util/src/main/java/com/ibm/wala/util/intset/LongIterator.java @@ -13,9 +13,13 @@ /** a more efficient iterator for sets of longs */ public interface LongIterator { - /** @return true iff this iterator has a next element */ + /** + * @return true iff this iterator has a next element + */ boolean hasNext(); - /** @return next integer in the iteration */ + /** + * @return next integer in the iteration + */ long next(); } diff --git a/util/src/main/java/com/ibm/wala/util/intset/LongSet.java b/util/src/main/java/com/ibm/wala/util/intset/LongSet.java index 82737a8e36..f4d375a2af 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/LongSet.java +++ b/util/src/main/java/com/ibm/wala/util/intset/LongSet.java @@ -15,10 +15,14 @@ /** Set of longs; not necessary mutable TODO: extract a smaller interface? */ public interface LongSet { - /** @return true iff this set contains long i */ + /** + * @return true iff this set contains long i + */ boolean contains(long i); - /** @return true iff this set contains integer i */ + /** + * @return true iff this set contains integer i + */ boolean containsAny(LongSet set); /** @@ -26,25 +30,36 @@ public interface LongSet { * * @return a new IntSet which is the intersection of this and that */ - @Nullable - LongSet intersection(LongSet that); + @Nullable LongSet intersection(LongSet that); - /** @return true iff this set is empty */ + /** + * @return true iff this set is empty + */ boolean isEmpty(); - /** @return the number of elements in this set */ + /** + * @return the number of elements in this set + */ int size(); - /** @return maximum integer in this set. */ + /** + * @return maximum integer in this set. + */ long max(); - /** @return true iff {@code this} has the same value as {@code that}. */ + /** + * @return true iff {@code this} has the same value as {@code that}. + */ boolean sameValue(LongSet that); - /** @return true iff {@code this} is a subset of {@code that}. */ + /** + * @return true iff {@code this} is a subset of {@code that}. + */ boolean isSubset(LongSet that); - /** @return a perhaps more efficient iterator */ + /** + * @return a perhaps more efficient iterator + */ LongIterator longIterator(); /** Invoke an action on each element of the Set */ diff --git a/util/src/main/java/com/ibm/wala/util/intset/LongSetUtil.java b/util/src/main/java/com/ibm/wala/util/intset/LongSetUtil.java index d5ad738655..c9e2c63f22 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/LongSetUtil.java +++ b/util/src/main/java/com/ibm/wala/util/intset/LongSetUtil.java @@ -150,7 +150,9 @@ public static MutableLongSet removeAll(MutableLongSet A, LongSet B) return A; } - /** @return index \in [low,high] s.t. data[index] = key, or -1 if not found */ + /** + * @return index \in [low,high] s.t. data[index] = key, or -1 if not found + */ public static int binarySearch(long[] data, long key, int low, int high) throws IllegalArgumentException { if (data == null) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/MutableMapping.java b/util/src/main/java/com/ibm/wala/util/intset/MutableMapping.java index 8aba474bda..de09a5de47 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/MutableMapping.java +++ b/util/src/main/java/com/ibm/wala/util/intset/MutableMapping.java @@ -43,7 +43,9 @@ public static MutableMapping make() { /** A mapping from object to Integer. */ final HashMap map = HashMapFactory.make(); - /** @throws IllegalArgumentException if array is null */ + /** + * @throws IllegalArgumentException if array is null + */ @SuppressWarnings("unchecked") public MutableMapping(final Object[] array) { if (array == null) { @@ -116,7 +118,9 @@ public String toString() { return result.toString(); } - /** @see com.ibm.wala.util.intset.OrdinalSetMapping#iterator() */ + /** + * @see com.ibm.wala.util.intset.OrdinalSetMapping#iterator() + */ @Override public Iterator iterator() { return map.keySet().iterator(); @@ -127,7 +131,9 @@ public Stream stream() { return map.keySet().stream(); } - /** @see com.ibm.wala.util.intset.SparseIntSet#singleton(int) */ + /** + * @see com.ibm.wala.util.intset.SparseIntSet#singleton(int) + */ public OrdinalSet makeSingleton(int i) { return new OrdinalSet<>(SparseIntSet.singleton(i), this); } diff --git a/util/src/main/java/com/ibm/wala/util/intset/MutableSharedBitVectorIntSet.java b/util/src/main/java/com/ibm/wala/util/intset/MutableSharedBitVectorIntSet.java index 1ea5baa854..332ef3447e 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/MutableSharedBitVectorIntSet.java +++ b/util/src/main/java/com/ibm/wala/util/intset/MutableSharedBitVectorIntSet.java @@ -38,7 +38,9 @@ public class MutableSharedBitVectorIntSet implements MutableIntSet { /** */ public MutableSharedBitVectorIntSet() {} - /** @throws IllegalArgumentException if set is null */ + /** + * @throws IllegalArgumentException if set is null + */ public MutableSharedBitVectorIntSet(MutableSharedBitVectorIntSet set) { if (set == null) { throw new IllegalArgumentException("set is null"); @@ -49,7 +51,9 @@ public MutableSharedBitVectorIntSet(MutableSharedBitVectorIntSet set) { this.sharedPart = set.sharedPart; } - /** @throws IllegalArgumentException if s is null */ + /** + * @throws IllegalArgumentException if s is null + */ public MutableSharedBitVectorIntSet(SparseIntSet s) { if (s == null) { throw new IllegalArgumentException("s is null"); @@ -65,7 +69,9 @@ public MutableSharedBitVectorIntSet(SparseIntSet s) { } } - /** @throws IllegalArgumentException if s is null */ + /** + * @throws IllegalArgumentException if s is null + */ public MutableSharedBitVectorIntSet(BitVectorIntSet s) { if (s == null) { throw new IllegalArgumentException("s is null"); @@ -140,7 +146,9 @@ private void checkOverflow() { } } - /** @see com.ibm.wala.util.intset.IntSet#contains(int) */ + /** + * @see com.ibm.wala.util.intset.IntSet#contains(int) + */ @Override public boolean contains(int i) { if (privatePart != null && privatePart.contains(i)) { @@ -152,7 +160,9 @@ public boolean contains(int i) { return false; } - /** @see com.ibm.wala.util.intset.IntSet#intersection(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#intersection(com.ibm.wala.util.intset.IntSet) + */ @Override public IntSet intersection(IntSet that) { if (that == null) { @@ -179,7 +189,9 @@ public IntSet intersection(IntSet that) { } } - /** @see com.ibm.wala.util.intset.IntSet#union(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#union(com.ibm.wala.util.intset.IntSet) + */ @Override public IntSet union(IntSet that) { MutableSharedBitVectorIntSet temp = new MutableSharedBitVectorIntSet(); @@ -189,7 +201,9 @@ public IntSet union(IntSet that) { return temp; } - /** @see com.ibm.wala.util.intset.IntSet#intersection(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#intersection(com.ibm.wala.util.intset.IntSet) + */ public IntSet intersection(MutableSharedBitVectorIntSet that) { MutableSparseIntSet t = makeSparseCopy(); t.intersectWith(that); @@ -200,13 +214,17 @@ public IntSet intersection(MutableSharedBitVectorIntSet that) { return result; } - /** @see com.ibm.wala.util.intset.IntSet#isEmpty() */ + /** + * @see com.ibm.wala.util.intset.IntSet#isEmpty() + */ @Override public boolean isEmpty() { return privatePart == null && sharedPart == null; } - /** @see com.ibm.wala.util.intset.IntSet#size() */ + /** + * @see com.ibm.wala.util.intset.IntSet#size() + */ @Override public int size() { int result = 0; @@ -215,7 +233,9 @@ public int size() { return result; } - /** @see IntSet#intIterator() */ + /** + * @see IntSet#intIterator() + */ @Override public IntIterator intIterator() { if (privatePart == null) { @@ -227,7 +247,9 @@ public IntIterator intIterator() { } } - /** @see com.ibm.wala.util.intset.IntSet#foreach(com.ibm.wala.util.intset.IntSetAction) */ + /** + * @see com.ibm.wala.util.intset.IntSet#foreach(com.ibm.wala.util.intset.IntSetAction) + */ @Override public void foreach(IntSetAction action) { if (privatePart != null) { @@ -288,7 +310,9 @@ private void foreachExcludingGeneral(IntSet X, IntSetAction action) { } } - /** @see com.ibm.wala.util.intset.IntSet#max() */ + /** + * @see com.ibm.wala.util.intset.IntSet#max() + */ @Override public int max() { int result = -1; @@ -301,7 +325,9 @@ public int max() { return result; } - /** @see com.ibm.wala.util.intset.IntSet#sameValue(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#sameValue(com.ibm.wala.util.intset.IntSet) + */ @Override public boolean sameValue(IntSet that) throws IllegalArgumentException, UnimplementedError { if (that == null) { @@ -323,7 +349,9 @@ public boolean sameValue(IntSet that) throws IllegalArgumentException, Unimpleme } } - /** @see com.ibm.wala.util.intset.IntSet#sameValue(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#sameValue(com.ibm.wala.util.intset.IntSet) + */ private boolean sameValue(SparseIntSet that) { if (size() != that.size()) { return false; @@ -358,7 +386,9 @@ private boolean sameValue(BitVectorIntSet that) { } } - /** @see com.ibm.wala.util.intset.IntSet#sameValue(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#sameValue(com.ibm.wala.util.intset.IntSet) + */ private boolean sameValue(MutableSharedBitVectorIntSet that) { if (size() != that.size()) { return false; @@ -426,7 +456,9 @@ private boolean sameValue(MutableSharedBitVectorIntSet that) { } } - /** @see com.ibm.wala.util.intset.IntSet#isSubset(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#isSubset(com.ibm.wala.util.intset.IntSet) + */ @Override public boolean isSubset(IntSet that) { if (that == null) { @@ -445,7 +477,9 @@ public boolean isSubset(IntSet that) { } } - /** @see com.ibm.wala.util.intset.IntSet#sameValue(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#sameValue(com.ibm.wala.util.intset.IntSet) + */ private boolean isSubset(MutableSharedBitVectorIntSet that) { if (size() > that.size()) { return false; @@ -917,7 +951,9 @@ public boolean hasSharedPart() { return sharedPart != null; } - /** @see com.ibm.wala.util.intset.IntSet#containsAny(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#containsAny(com.ibm.wala.util.intset.IntSet) + */ @Override public boolean containsAny(IntSet set) { if (set instanceof MutableSharedBitVectorIntSet) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/MutableSparseIntSet.java b/util/src/main/java/com/ibm/wala/util/intset/MutableSparseIntSet.java index cf76699594..4acbff8531 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/MutableSparseIntSet.java +++ b/util/src/main/java/com/ibm/wala/util/intset/MutableSparseIntSet.java @@ -103,7 +103,9 @@ public float getExpansionFactor() { return EXPANSION_FACTOR; } - /** @return true iff this value changes */ + /** + * @return true iff this value changes + */ @Override @SuppressWarnings("unused") public boolean add(int value) { @@ -153,7 +155,9 @@ public boolean add(int value) { return true; } - /** @throws IllegalArgumentException if that == null */ + /** + * @throws IllegalArgumentException if that == null + */ @NullUnmarked @Override @SuppressWarnings("unused") diff --git a/util/src/main/java/com/ibm/wala/util/intset/MutableSparseIntSetFactory.java b/util/src/main/java/com/ibm/wala/util/intset/MutableSparseIntSetFactory.java index dcc3d3c468..6c647cff8f 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/MutableSparseIntSetFactory.java +++ b/util/src/main/java/com/ibm/wala/util/intset/MutableSparseIntSetFactory.java @@ -15,7 +15,9 @@ /** An object that creates mutable sparse int sets. */ public class MutableSparseIntSetFactory implements MutableIntSetFactory { - /** @throws IllegalArgumentException if set is null */ + /** + * @throws IllegalArgumentException if set is null + */ @Override public MutableSparseIntSet make(int[] set) { if (set == null) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/MutableSparseLongSet.java b/util/src/main/java/com/ibm/wala/util/intset/MutableSparseLongSet.java index e7933ea47d..b33991df06 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/MutableSparseLongSet.java +++ b/util/src/main/java/com/ibm/wala/util/intset/MutableSparseLongSet.java @@ -91,7 +91,9 @@ public void remove(long value) { } } - /** @return true iff this value changes */ + /** + * @return true iff this value changes + */ @Override public boolean add(long value) { if (value < 0) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/MutableSparseLongSetFactory.java b/util/src/main/java/com/ibm/wala/util/intset/MutableSparseLongSetFactory.java index e7f6d99ab2..dd96afe9e8 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/MutableSparseLongSetFactory.java +++ b/util/src/main/java/com/ibm/wala/util/intset/MutableSparseLongSetFactory.java @@ -16,7 +16,9 @@ /** An object that creates mutable sparse int sets. */ public class MutableSparseLongSetFactory implements MutableLongSetFactory { - /** @throws IllegalArgumentException if set is null */ + /** + * @throws IllegalArgumentException if set is null + */ @Override public MutableLongSet make(long[] set) { if (set == null) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/OffsetBitVector.java b/util/src/main/java/com/ibm/wala/util/intset/OffsetBitVector.java index 8d471feeb0..b9cd6da4e1 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/OffsetBitVector.java +++ b/util/src/main/java/com/ibm/wala/util/intset/OffsetBitVector.java @@ -169,7 +169,9 @@ public boolean get(int bit) { return ((bits[ss] & (1 << shiftBits)) != 0); } - /** @return min j >= start s.t get(j) */ + /** + * @return min j >= start s.t get(j) + */ @Override public int nextSetBit(int start) { int nb = super.nextSetBit(Math.max(0, start - offset)); diff --git a/util/src/main/java/com/ibm/wala/util/intset/OrdinalSet.java b/util/src/main/java/com/ibm/wala/util/intset/OrdinalSet.java index 888a0c6d2a..c0ff44a37f 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/OrdinalSet.java +++ b/util/src/main/java/com/ibm/wala/util/intset/OrdinalSet.java @@ -103,7 +103,9 @@ public static OrdinalSet intersect(OrdinalSet A, OrdinalSet B) { return new OrdinalSet<>(isect, A.mapping); } - /** @return true if the contents of two sets are equal */ + /** + * @return true if the contents of two sets are equal + */ public static boolean equals(OrdinalSet a, OrdinalSet b) { if ((a == null && b == null) || a == b || (a.mapping == b.mapping && a.S == b.S)) { return true; @@ -167,7 +169,9 @@ public IntSet getBackingSet() { return S; } - /** @return true iff this set contains object */ + /** + * @return true iff this set contains object + */ @NullUnmarked public boolean contains(T object) { if (this == EMPTY || S == null || object == null) { @@ -181,7 +185,9 @@ public boolean isEmpty() { return size() == 0; } - /** @throws NullPointerException if instances is null */ + /** + * @throws NullPointerException if instances is null + */ public static Collection toCollection(OrdinalSet instances) { return Iterator2Collection.toSet(instances.iterator()); } diff --git a/util/src/main/java/com/ibm/wala/util/intset/OrdinalSetMapping.java b/util/src/main/java/com/ibm/wala/util/intset/OrdinalSetMapping.java index 40b531334a..d0ef3f8aa4 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/OrdinalSetMapping.java +++ b/util/src/main/java/com/ibm/wala/util/intset/OrdinalSetMapping.java @@ -15,19 +15,29 @@ /** An object that implements a bijection between whole numbers and objects. */ public interface OrdinalSetMapping extends Iterable { - /** @return the object numbered n. */ + /** + * @return the object numbered n. + */ T getMappedObject(int n) throws NoSuchElementException; - /** @return the number of a given object, or -1 if the object is not currently in the range. */ + /** + * @return the number of a given object, or -1 if the object is not currently in the range. + */ int getMappedIndex(Object o); - /** @return whether the given object is mapped by this mapping */ + /** + * @return whether the given object is mapped by this mapping + */ boolean hasMappedIndex(T o); - /** @return the maximum integer mapped to an object */ + /** + * @return the maximum integer mapped to an object + */ int getMaximumIndex(); - /** @return the current size of the bijection */ + /** + * @return the current size of the bijection + */ int getSize(); /** diff --git a/util/src/main/java/com/ibm/wala/util/intset/SemiSparseMutableIntSet.java b/util/src/main/java/com/ibm/wala/util/intset/SemiSparseMutableIntSet.java index 717016380b..2ee4903da3 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/SemiSparseMutableIntSet.java +++ b/util/src/main/java/com/ibm/wala/util/intset/SemiSparseMutableIntSet.java @@ -248,7 +248,9 @@ public void clear() { densePart = null; } - /** @return true iff this set contains integer i */ + /** + * @return true iff this set contains integer i + */ @Override public boolean contains(int i) { if (densePart != null && inDenseRange(i)) { @@ -258,7 +260,9 @@ public boolean contains(int i) { } } - /** @return true iff this set contains integer i */ + /** + * @return true iff this set contains integer i + */ @Override public boolean containsAny(IntSet set) { if (set == null) { @@ -300,7 +304,9 @@ public IntSet intersection(IntSet that) { return newThis; } - /** @see com.ibm.wala.util.intset.IntSet#union(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#union(com.ibm.wala.util.intset.IntSet) + */ @Override public IntSet union(IntSet that) { SemiSparseMutableIntSet temp = new SemiSparseMutableIntSet(); @@ -310,19 +316,25 @@ public IntSet union(IntSet that) { return temp; } - /** @return true iff this set is empty */ + /** + * @return true iff this set is empty + */ @Override public boolean isEmpty() { return sparsePart.isEmpty() && (densePart == null || densePart.isZero()); } - /** @return the number of elements in this set */ + /** + * @return the number of elements in this set + */ @Override public int size() { return sparsePart.size() + (densePart == null ? 0 : densePart.populationCount()); } - /** @return a perhaps more efficient iterator */ + /** + * @return a perhaps more efficient iterator + */ @Override public IntIterator intIterator() { class DensePartIterator implements IntIterator { @@ -385,7 +397,9 @@ public void foreachExcluding(IntSet X, IntSetAction action) { } } - /** @return maximum integer in this set. */ + /** + * @return maximum integer in this set. + */ @Override public int max() throws IllegalStateException { if (densePart == null) { @@ -621,7 +635,9 @@ public void intersectWith(IntSet set) { } } - /** @throws IllegalArgumentException if other is null */ + /** + * @throws IllegalArgumentException if other is null + */ @Override public boolean addAllInIntersection(IntSet other, IntSet filter) { if (other == null) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/SemiSparseMutableIntSetFactory.java b/util/src/main/java/com/ibm/wala/util/intset/SemiSparseMutableIntSetFactory.java index 66425a6733..f552b0665c 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/SemiSparseMutableIntSetFactory.java +++ b/util/src/main/java/com/ibm/wala/util/intset/SemiSparseMutableIntSetFactory.java @@ -16,7 +16,9 @@ public class SemiSparseMutableIntSetFactory implements MutableIntSetFactory { - /** @throws IllegalArgumentException if set is null */ + /** + * @throws IllegalArgumentException if set is null + */ @Override public SemiSparseMutableIntSet make(int[] set) { if (set == null) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/SimpleIntVector.java b/util/src/main/java/com/ibm/wala/util/intset/SimpleIntVector.java index 996d9e69e0..219ca6555a 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/SimpleIntVector.java +++ b/util/src/main/java/com/ibm/wala/util/intset/SimpleIntVector.java @@ -100,7 +100,9 @@ public void performVerboseAction() { System.err.println(("occupancy: " + computeOccupancy())); } - /** @return the percentage of entries in delegateStore that are non-null */ + /** + * @return the percentage of entries in delegateStore that are non-null + */ private double computeOccupancy() { int count1 = 0; for (int element : store) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/SparseIntSet.java b/util/src/main/java/com/ibm/wala/util/intset/SparseIntSet.java index eb4c804029..d4880edba5 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/SparseIntSet.java +++ b/util/src/main/java/com/ibm/wala/util/intset/SparseIntSet.java @@ -110,7 +110,9 @@ public final boolean contains(int x) { return IntSetUtil.binarySearch(elements, x, 0, size - 1) >= 0; } - /** @return index i s.t. elements[i] == x, or -1 if not found. */ + /** + * @return index i s.t. elements[i] == x, or -1 if not found. + */ public final int getIndex(int x) { if (elements == null) { return -1; @@ -394,7 +396,9 @@ public int next() throws NoSuchElementException { }; } - /** @return the largest element in the set */ + /** + * @return the largest element in the set + */ @Override public final int max() throws IllegalStateException { if (elements == null) { @@ -411,7 +415,9 @@ public void foreach(IntSetAction action) { for (int i = 0; i < size; i++) action.act(elements[i]); } - /** @see com.ibm.wala.util.intset.IntSet#foreach(com.ibm.wala.util.intset.IntSetAction) */ + /** + * @see com.ibm.wala.util.intset.IntSet#foreach(com.ibm.wala.util.intset.IntSetAction) + */ @Override public void foreachExcluding(IntSet X, IntSetAction action) { if (action == null) { @@ -521,7 +527,9 @@ public boolean containsAny(SparseIntSet set) throws IllegalArgumentException { return false; } - /** @return contents as an int[] */ + /** + * @return contents as an int[] + */ public int[] toIntArray() { int[] result = new int[size]; if (size > 0) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/SparseIntVector.java b/util/src/main/java/com/ibm/wala/util/intset/SparseIntVector.java index 5258bb62da..487963a46f 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/SparseIntVector.java +++ b/util/src/main/java/com/ibm/wala/util/intset/SparseIntVector.java @@ -73,7 +73,9 @@ private void ensureCapacity(int capacity) { } } - /** @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() */ + /** + * @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() + */ public void performVerboseAction() { System.err.println((getClass() + " stats: ")); System.err.println(("data.length " + data.length)); diff --git a/util/src/main/java/com/ibm/wala/util/intset/SparseLongIntVector.java b/util/src/main/java/com/ibm/wala/util/intset/SparseLongIntVector.java index 38a3ed4b16..9abf588711 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/SparseLongIntVector.java +++ b/util/src/main/java/com/ibm/wala/util/intset/SparseLongIntVector.java @@ -37,7 +37,9 @@ public SparseLongIntVector(int defaultValue) { this.defaultValue = defaultValue; } - /** @see com.ibm.wala.util.intset.IntVector#get(int) */ + /** + * @see com.ibm.wala.util.intset.IntVector#get(int) + */ public int get(long x) { int index = indices.getIndex(x); if (index == -1) { @@ -71,7 +73,9 @@ private void ensureCapacity(int capacity) { } } - /** @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() */ + /** + * @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() + */ public void performVerboseAction() { System.err.println((getClass() + " stats: ")); System.err.println(("data.length " + data.length)); diff --git a/util/src/main/java/com/ibm/wala/util/intset/SparseLongSet.java b/util/src/main/java/com/ibm/wala/util/intset/SparseLongSet.java index c5fc1c9bd6..c4d9c14496 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/SparseLongSet.java +++ b/util/src/main/java/com/ibm/wala/util/intset/SparseLongSet.java @@ -113,7 +113,9 @@ public final boolean contains(long x) { return LongSetUtil.binarySearch(elements, x, 0, size - 1) >= 0; } - /** @return index i s.t. elements[i] == x, or -1 if not found. */ + /** + * @return index i s.t. elements[i] == x, or -1 if not found. + */ public final int getIndex(long x) { if (elements == null) { return -1; @@ -329,7 +331,9 @@ public static SparseLongSet pair(long i, long j) { } } - /** @see com.ibm.wala.util.intset.IntSet#intersection(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#intersection(com.ibm.wala.util.intset.IntSet) + */ @Nullable @Override public LongSet intersection(LongSet that) throws IllegalArgumentException, UnimplementedError { @@ -346,7 +350,9 @@ public LongSet intersection(LongSet that) throws IllegalArgumentException, Unimp } } - /** @see com.ibm.wala.util.intset.IntSet#intIterator() */ + /** + * @see com.ibm.wala.util.intset.IntSet#intIterator() + */ @Override public LongIterator longIterator() { return new LongIterator() { @@ -390,7 +396,9 @@ public void foreachExcluding(LongSet X, LongSetAction action) { } } - /** @return the largest element in the set */ + /** + * @return the largest element in the set + */ @Override public final long max() throws IllegalStateException { if (elements == null) { @@ -399,7 +407,9 @@ public final long max() throws IllegalStateException { return (size > 0) ? elements[size - 1] : -1; } - /** @return a new sparse int set which adds j to s */ + /** + * @return a new sparse int set which adds j to s + */ public static SparseLongSet add(SparseLongSet s, int j) { if (s == null || s.elements == null) { return SparseLongSet.singleton(j); @@ -425,7 +435,9 @@ public static SparseLongSet add(SparseLongSet s, int j) { return result; } - /** @see com.ibm.wala.util.intset.IntSet#isSubset(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#isSubset(com.ibm.wala.util.intset.IntSet) + */ @Override public boolean isSubset(LongSet that) throws IllegalArgumentException, UnimplementedError { if (that == null) { @@ -439,7 +451,9 @@ public boolean isSubset(LongSet that) throws IllegalArgumentException, Unimpleme } } - /** @see com.ibm.wala.util.intset.IntSet#containsAny(com.ibm.wala.util.intset.IntSet) */ + /** + * @see com.ibm.wala.util.intset.IntSet#containsAny(com.ibm.wala.util.intset.IntSet) + */ @Override public boolean containsAny(LongSet set) { if (set == null) { diff --git a/util/src/main/java/com/ibm/wala/util/intset/TwoLevelIntVector.java b/util/src/main/java/com/ibm/wala/util/intset/TwoLevelIntVector.java index f4ac672608..b420c77644 100644 --- a/util/src/main/java/com/ibm/wala/util/intset/TwoLevelIntVector.java +++ b/util/src/main/java/com/ibm/wala/util/intset/TwoLevelIntVector.java @@ -91,7 +91,9 @@ private IntVector findOrCreatePage(int page) { } } - /** @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() */ + /** + * @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction() + */ public void performVerboseAction() { System.err.println(("stats of " + getClass())); System.err.println(("data: size = " + data.size())); diff --git a/util/src/main/java/com/ibm/wala/util/math/Logs.java b/util/src/main/java/com/ibm/wala/util/math/Logs.java index f4a85c77ff..b3f0df08e3 100644 --- a/util/src/main/java/com/ibm/wala/util/math/Logs.java +++ b/util/src/main/java/com/ibm/wala/util/math/Logs.java @@ -46,7 +46,9 @@ /** simple utilities with logarithms */ public class Logs { - /** @return true iff x == 2^n for some integer n */ + /** + * @return true iff x == 2^n for some integer n + */ public static boolean isPowerOf2(int x) { if (x < 0) { return false; @@ -55,7 +57,9 @@ public static boolean isPowerOf2(int x) { } } - /** @param x where x == 2^n for some integer n */ + /** + * @param x where x == 2^n for some integer n + */ public static int log2(int x) throws IllegalArgumentException { if (!isPowerOf2(x)) { throw new IllegalArgumentException(); diff --git a/util/src/main/java/com/ibm/wala/util/perf/Stopwatch.java b/util/src/main/java/com/ibm/wala/util/perf/Stopwatch.java index 3baf29b1f9..b130cd6952 100644 --- a/util/src/main/java/com/ibm/wala/util/perf/Stopwatch.java +++ b/util/src/main/java/com/ibm/wala/util/perf/Stopwatch.java @@ -32,12 +32,16 @@ public void stop() { elapsedTime += (endTime - startTime); } - /** @return elapsed time in ms */ + /** + * @return elapsed time in ms + */ public long getElapsedMillis() { return elapsedTime / 1000000; } - /** @return number of times this stopwatch was stopped */ + /** + * @return number of times this stopwatch was stopped + */ public int getCount() { return count; } diff --git a/util/src/main/java/com/ibm/wala/util/perf/StopwatchGC.java b/util/src/main/java/com/ibm/wala/util/perf/StopwatchGC.java index dc1b190b80..fdd3b6ea9a 100644 --- a/util/src/main/java/com/ibm/wala/util/perf/StopwatchGC.java +++ b/util/src/main/java/com/ibm/wala/util/perf/StopwatchGC.java @@ -59,17 +59,23 @@ public final String report() { return result; } - /** @return memory at the end of the phase, in MB */ + /** + * @return memory at the end of the phase, in MB + */ public float getEndMemory() { return (float) endMemory / 1000000; } - /** @return memory at the end of the phase, in MB */ + /** + * @return memory at the end of the phase, in MB + */ public float getStartMemory() { return (float) startMemory / 1000000; } - /** @return getEndMemory() - getStartMemory() */ + /** + * @return getEndMemory() - getStartMemory() + */ public float getFootprint() { return getEndMemory() - getStartMemory(); } diff --git a/util/src/main/java/com/ibm/wala/util/processes/JavaLauncher.java b/util/src/main/java/com/ibm/wala/util/processes/JavaLauncher.java index c7c87d3578..d1eba8cf6b 100644 --- a/util/src/main/java/com/ibm/wala/util/processes/JavaLauncher.java +++ b/util/src/main/java/com/ibm/wala/util/processes/JavaLauncher.java @@ -147,7 +147,9 @@ public String toString() { + ')'; } - /** @return the string that identifies the java executable file */ + /** + * @return the string that identifies the java executable file + */ public static String defaultJavaExe() { String java = System.getProperty("java.home") + File.separatorChar + "bin" + File.separatorChar + "java"; diff --git a/util/src/main/java/com/ibm/wala/util/tables/StringTable.java b/util/src/main/java/com/ibm/wala/util/tables/StringTable.java index 5ede7157f3..9d9400c887 100644 --- a/util/src/main/java/com/ibm/wala/util/tables/StringTable.java +++ b/util/src/main/java/com/ibm/wala/util/tables/StringTable.java @@ -67,7 +67,9 @@ public static StringTable readFromDirectTextFile(String fileName, Character comm // return readFromTextFile(f, comment); // } - /** @param f a file containing a table in text format, whitespace delimited */ + /** + * @param f a file containing a table in text format, whitespace delimited + */ public static StringTable readFromTextFile(File f, Character comment) throws FileNotFoundException, IOException { if (f == null) { @@ -167,7 +169,9 @@ private void populateRow(int row, String line, @Nullable Character delimiter) { } } - /** @param line a whitespace-delimited string of column names */ + /** + * @param line a whitespace-delimited string of column names + */ private void populateColumnHeadings(String line, @Nullable Character delimiter) { StringTokenizer st = delimiter == null diff --git a/util/src/main/java/com/ibm/wala/util/viz/DotUtil.java b/util/src/main/java/com/ibm/wala/util/viz/DotUtil.java index c66662f207..3b3123eb19 100644 --- a/util/src/main/java/com/ibm/wala/util/viz/DotUtil.java +++ b/util/src/main/java/com/ibm/wala/util/viz/DotUtil.java @@ -62,14 +62,18 @@ private static String outputTypeCmdLineParam() { /** Some versions of dot appear to croak on long labels. Reduce this if so. */ private static final int MAX_LABEL_LENGTH = Integer.MAX_VALUE; - /** @param the type of a graph node */ + /** + * @param the type of a graph node + */ public static void dotify( Graph g, NodeDecorator labels, String dotFile, String outputFile, String dotExe) throws WalaException { dotify(g, labels, null, dotFile, outputFile, dotExe); } - /** @param the type of a graph node */ + /** + * @param the type of a graph node + */ public static void dotify( Graph g, NodeDecorator labels, @@ -175,7 +179,9 @@ public static File writeDotFile( } } - /** @return StringBuffer holding dot output representing G */ + /** + * @return StringBuffer holding dot output representing G + */ public static StringBuilder dotOutput( Graph g, NodeDecorator labels, @Nullable String title) throws WalaException { StringBuilder result = new StringBuilder("digraph \"DirectedGraph\" {\n"); diff --git a/util/src/main/java/com/ibm/wala/util/viz/NodeDecorator.java b/util/src/main/java/com/ibm/wala/util/viz/NodeDecorator.java index 1d6263a26a..3b7f7f6d56 100644 --- a/util/src/main/java/com/ibm/wala/util/viz/NodeDecorator.java +++ b/util/src/main/java/com/ibm/wala/util/viz/NodeDecorator.java @@ -12,9 +12,13 @@ import com.ibm.wala.util.WalaException; -/** @param the node type */ +/** + * @param the node type + */ public interface NodeDecorator { - /** @return the String label for node n */ + /** + * @return the String label for node n + */ String getLabel(T n) throws WalaException; } diff --git a/util/src/main/java/com/ibm/wala/util/viz/PDFViewLauncher.java b/util/src/main/java/com/ibm/wala/util/viz/PDFViewLauncher.java index 1a4652842a..5047a06512 100644 --- a/util/src/main/java/com/ibm/wala/util/viz/PDFViewLauncher.java +++ b/util/src/main/java/com/ibm/wala/util/viz/PDFViewLauncher.java @@ -59,7 +59,9 @@ public String toString() { @Nullable private WalaException exception = null; - /** @see java.lang.Runnable#run() */ + /** + * @see java.lang.Runnable#run() + */ public void run() { String[] cmdarray = {getGvExe(), getPDFFile()}; try {