Merge branch 'wala' into master

This commit is contained in:
Juergen Graf 2014-04-09 16:50:42 +02:00
commit 4648f0404a
81 changed files with 245 additions and 9148 deletions

View File

@ -5,18 +5,18 @@ Bundle-SymbolicName: com.ibm.wala.cast.java.jdt.test
Bundle-Version: 1.0.0
Bundle-Activator: com.ibm.wala.cast.java.jdt.test.Activator
Bundle-Vendor: IBM
Require-Bundle: com.ibm.wala.cast;bundle-version="1.0.0",
com.ibm.wala.cast.java;bundle-version="1.0.0",
com.ibm.wala.cast.java.test;bundle-version="1.0.0",
Require-Bundle: com.ibm.wala.cast.java.test;bundle-version="1.0.0",
com.ibm.wala.cast.test;bundle-version="1.0.0",
com.ibm.wala.core;bundle-version="1.1.3",
com.ibm.wala.ide.tests;bundle-version="1.1.3",
com.ibm.wala.core.tests;bundle-version="1.1.3",
com.ibm.wala.cast.java.jdt;bundle-version="1.0.0",
org.eclipse.core.runtime,
com.ibm.wala.cast.java;bundle-version="1.0.0",
com.ibm.wala.cast;bundle-version="1.0.0",
com.ibm.wala.ide;bundle-version="1.1.3",
com.ibm.wala.core;bundle-version="1.1.3",
org.eclipse.core.resources;bundle-version="3.4.1",
com.ibm.wala.ide.tests;bundle-version="1.1.3",
org.eclipse.jdt.core;bundle-version="3.4.2",
org.junit4;bundle-version="4.3.1"
org.junit4;bundle-version="4.8.1",
org.eclipse.core.runtime
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2869,7 +2869,6 @@ public class JDTJava2CAstTranslator {
}
public CAstSourcePositionMap.Position getPosition() {
Assertions.UNREACHABLE("CompilationUnitEntity.getPosition()");
return null;
}

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="source"/>
<classpathentry kind="lib" path="/com.ibm.wala.cast.java.polyglot/lib/polyglot.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,10 +1,5 @@
#Thu Feb 03 10:12:26 EST 2011
#Mon Jul 02 13:01:58 EDT 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0

View File

@ -11,7 +11,6 @@
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/java 1.6"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.cast.java.test.PolyglotJavaIRTests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.cast.java.polyglot.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Xmx512M"/>

View File

@ -1411,7 +1411,6 @@ public class PolyglotJava2CAstTranslator {
}
public CAstSourcePositionMap.Position getPosition() {
Assertions.UNREACHABLE("CompilationUnitEntity.getPosition()");
return null;
}

View File

@ -0,0 +1,103 @@
/p
/A.class
/AnonymousClass.class
/AnonymousClass.java
/AnonymousClass$1.class
/AnonymousClass$1FooImpl.class
/AnonymousClass$2.class
/AnonymousClass$Foo.class
/Array1.class
/Array1.java
/ArrayLiteral1.class
/ArrayLiteral1.java
/ArrayLiteral2.class
/ArrayLiteral2.java
/B.class
/BadLanguageExceptionEx1.class
/BadLanguageExceptionF1.class
/Bar.class
/Base.class
/Breaks.class
/Breaks.java
/Breaks$1.class
/Breaks$Ref.class
/CastFromNull.class
/CastFromNull.java
/Casts.class
/Casts.java
/Derived.class
/Exception1.class
/Exception1.java
/Exception2.class
/Exception2.java
/Finally1.class
/Finally1.java
/FooEx1.class
/FooEx2.class
/FooF1.class
/FooIT1.class
/FooQ.class
/IFoo.class
/Inheritance1.class
/Inheritance1.java
/InheritedField.class
/InheritedField.java
/InnerClass.class
/InnerClass.java
/InnerClass$WhatsIt.class
/InnerClass$WhatsIt$NotAgain.class
/InnerClass$WhatsThat.class
/InnerClassA.class
/InnerClassA.java
/InnerClassA$AA.class
/InnerClassA$AB.class
/InnerClassA$AB$ABA.class
/InnerClassA$AB$ABA$ABAA.class
/InnerClassA$AB$ABA$ABAB.class
/InnerClassA$AB$ABSubA.class
/InnerClassA$AB$ABSubA$ABSubAA.class
/InnerClassSuper.class
/InnerClassSuper.java
/InnerClassSuper$SuperOuter.class
/InterfaceTest1.class
/InterfaceTest1.java
/IntWrapper.class
/LocalClass.class
/LocalClass.java
/LocalClass$1Foo.class
/LocalClass$2Foo.class
/MiniaturList.class
/MiniaturList.java
/MiniaturSliceBug.class
/MiniaturSliceBug.java
/Monitor.class
/Monitor.java
/NullArrayInit.class
/NullArrayInit.java
/PrimitiveWrapper.class
/QualifiedStatic.class
/QualifiedStatic.java
/R.class
/Scoping1.class
/Scoping1.java
/Scoping2.class
/Scoping2.java
/Scoping2$1.class
/Simple1.class
/Simple1.java
/StaticInitializers.class
/StaticInitializers.java
/StaticInitializers$X.class
/StaticNesting.class
/StaticNesting.java
/StaticNesting$WhatsIt.class
/Sub.class
/Sub$SubInner.class
/Switch1.class
/Switch1.java
/Thread1.class
/Thread1.java
/TwoClasses.class
/TwoClasses.java
/WhileTest1.class
/WhileTest1.java

View File

@ -27,7 +27,6 @@ import java.util.jar.JarFile;
import org.junit.Assert;
import com.ibm.wala.cast.ir.translator.AstTranslator;
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
import com.ibm.wala.classLoader.IClass;
@ -283,9 +282,6 @@ public abstract class IRTests {
public Pair runTest(Collection<String> sources, List<String> libs, String[] mainClassDescriptors, List<? extends IRAssertion> ca,
boolean assertReachable) {
try {
boolean currentState = AstTranslator.NEW_LEXICAL;
AstTranslator.NEW_LEXICAL = false;
JavaSourceAnalysisEngine engine = getAnalysisEngine(mainClassDescriptors);
populateScope(engine, sources, libs);
@ -301,8 +297,6 @@ public abstract class IRTests {
IRAssertion.check(callGraph);
}
AstTranslator.NEW_LEXICAL = currentState;
return Pair.make(callGraph, engine.getPointerAnalysis());
} catch (Exception e) {

View File

@ -10,21 +10,26 @@
*****************************************************************************/
package com.ibm.wala.cast.java.ipa.callgraph;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import com.ibm.wala.cast.ipa.callgraph.ScopeMappingInstanceKeys;
import com.ibm.wala.cast.ipa.callgraph.ScopeMappingInstanceKeys.ScopeMappingInstanceKey;
import com.ibm.wala.cast.ir.translator.AstTranslator;
import com.ibm.wala.cast.java.loader.JavaSourceLoaderImpl.JavaClass;
import com.ibm.wala.cast.loader.AstMethod;
import com.ibm.wala.cast.loader.AstMethod.LexicalParent;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.ipa.callgraph.CGNode;
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
import com.ibm.wala.ipa.callgraph.propagation.InstanceKeyFactory;
import com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.util.collections.HashSetFactory;
import com.ibm.wala.util.collections.Pair;
public class JavaScopeMappingInstanceKeys extends ScopeMappingInstanceKeys {
@ -75,4 +80,11 @@ public class JavaScopeMappingInstanceKeys extends ScopeMappingInstanceKeys {
return result;
}
@Override
protected Collection<CGNode> getConstructorCallers(ScopeMappingInstanceKey smik, Pair<String, String> name) {
// for Java, the creator node is exactly what we want
return Collections.singleton(smik.getCreator());
}
}

View File

@ -0,0 +1,17 @@
/apollo-example.html
/crawl.html
/iframeTest2.html
/list.html
/nojs.html
/page1.html
/page11.html
/page11b.html
/page12.html
/page13.html
/page15.html
/page16.html
/page17.html
/page2.html
/page3.html
/page4.html
/windowx.html

View File

@ -44,8 +44,8 @@ public abstract class TestArgumentSensitivity extends TestJSCallGraphShape {
builder.setContextSelector(new ArgumentSpecialization.ArgumentCountContextSelector(builder.getContextSelector()));
builder.setContextInterpreter(new ArgumentSpecialization.ArgumentSpecializationContextIntepreter(options, cache));
CallGraph CG = builder.makeCallGraph(options);
CAstCallGraphUtil.AVOID_DUMP = false;
// CAstCallGraphUtil.AVOID_DUMP = false;
CAstCallGraphUtil.dumpCG(builder.getPointerAnalysis(), CG);
verifyGraphAssertions(CG, assertionsForArgs);

View File

@ -4,6 +4,7 @@ import java.io.IOException;
import java.net.URL;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import com.ibm.wala.cast.ipa.callgraph.CAstCallGraphUtil;
@ -24,6 +25,7 @@ public class TestJQueryExamples extends TestJSCallGraphShape {
JSSourceExtractor.DELETE_UPON_EXIT = false;
}
@Ignore("This tries to analyze unmodified jquery, which we can't do yet")
@Test public void testEx1() throws IOException, IllegalArgumentException, CancelException {
URL url = getClass().getClassLoader().getResource("pages/jquery/ex1.html");
JSCFABuilder builder = JSCallGraphBuilderUtil.makeHTMLCGBuilder(url);

View File

@ -155,7 +155,7 @@ public abstract class TestSimpleCallGraphShape extends TestJSCallGraphShape {
public void testForin() throws IOException, IllegalArgumentException, CancelException {
JSCFABuilder B = JSCallGraphBuilderUtil.makeScriptCGBuilder("tests", "forin.js");
CallGraph CG = B.makeCallGraph(B.getOptions());
JSCallGraphUtil.AVOID_DUMP = false;
// JSCallGraphUtil.AVOID_DUMP = false;
JSCallGraphUtil.dumpCG(B.getPointerAnalysis(), CG);
verifyGraphAssertions(CG, assertionsForForin);
}
@ -247,7 +247,7 @@ public abstract class TestSimpleCallGraphShape extends TestJSCallGraphShape {
PropagationCallGraphBuilder B = JSCallGraphBuilderUtil.makeScriptCGBuilder("tests", "string-prims.js");
B.getOptions().setTraceStringConstants(true);
CallGraph CG = B.makeCallGraph(B.getOptions());
JSCallGraphUtil.AVOID_DUMP = false;
// JSCallGraphUtil.AVOID_DUMP = false;
JSCallGraphUtil.dumpCG(B.getPointerAnalysis(), CG);
verifyGraphAssertions(CG, assertionsForStringPrims);
}
@ -448,7 +448,7 @@ public abstract class TestSimpleCallGraphShape extends TestJSCallGraphShape {
public void testReturnThis() throws IOException, IllegalArgumentException, CancelException {
PropagationCallGraphBuilder B = JSCallGraphBuilderUtil.makeScriptCGBuilder("tests", "return_this.js");
CallGraph CG = B.makeCallGraph(B.getOptions());
JSCallGraphUtil.AVOID_DUMP = false;
// JSCallGraphUtil.AVOID_DUMP = false;
JSCallGraphUtil.dumpCG(B.getPointerAnalysis(), CG);
verifyGraphAssertions(CG, assertionsForReturnThis);
}
@ -543,7 +543,7 @@ public abstract class TestSimpleCallGraphShape extends TestJSCallGraphShape {
public void testDispatch() throws IOException, IllegalArgumentException, CancelException {
PropagationCallGraphBuilder B = JSCallGraphBuilderUtil.makeScriptCGBuilder("tests", "dispatch.js");
CallGraph CG = B.makeCallGraph(B.getOptions());
JSCallGraphUtil.AVOID_DUMP = false;
// JSCallGraphUtil.AVOID_DUMP = false;
JSCallGraphUtil.dumpCG(B.getPointerAnalysis(), CG);
verifyGraphAssertions(CG, assertionsForDispatch);
}

View File

@ -40,12 +40,6 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
}
});
}
@Before
public void config() {
JSSourceExtractor.USE_TEMP_NAME = false;
JSSourceExtractor.DELETE_UPON_EXIT = true;
}
private static final Object[][] assertionsForPage1 = new Object[][] {
new Object[] { ROOT, new String[] { "page1.html" } },
@ -272,7 +266,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
URL url = getClass().getClassLoader().getResource("pages/list.html");
JSCFABuilder builder = JSCallGraphBuilderUtil.makeHTMLCGBuilder(url);
CallGraph CG = builder.makeCallGraph(builder.getOptions());
JSCallGraphBuilderUtil.AVOID_DUMP = false;
// JSCallGraphBuilderUtil.AVOID_DUMP = false;
JSCallGraphBuilderUtil.dumpCG(builder.getPointerAnalysis(), CG);
verifySourceAssertions(CG, sourceAssertionsForList);
}

View File

@ -26,7 +26,7 @@ import com.ibm.wala.util.collections.Pair;
public class DefaultSourceExtractor extends DomLessSourceExtractor{
private static class HtmlCallBack extends DomLessSourceExtractor.HtmlCallback{
protected static class HtmlCallBack extends DomLessSourceExtractor.HtmlCallback{
private final HashMap<String, String> constructors = HashMapFactory.make();
@ -111,8 +111,8 @@ public class DefaultSourceExtractor extends DomLessSourceExtractor{
printlnIndented(" document.forms[document.formCount++] = this;", tag);
printlnIndented(" var currentForm = this;", tag);
} if (tag.getName().equalsIgnoreCase("INPUT")) {
String prop = attrs.get("name").fst;
String type = attrs.get("type").fst;
String prop = attrs.containsKey("name") ? attrs.get("name").fst : null;
String type = attrs.containsKey("type") ? attrs.get("type").fst : null;
if (type != null && prop != null) {
if (type.equalsIgnoreCase("RADIO")) {

View File

@ -30,7 +30,7 @@ import com.ibm.wala.util.collections.Pair;
public class DomLessSourceExtractor extends JSSourceExtractor {
private static final Pattern LEGAL_JS_IDENTIFIER_REGEXP = Pattern.compile("[a-zA-Z$_][a-zA-Z\\d$_]*");
interface IGeneratorCallback extends IHtmlCallback {
protected interface IGeneratorCallback extends IHtmlCallback {
void writeToFinalRegion(SourceRegion finalRegion);
}

View File

@ -23,9 +23,9 @@ import java.util.Set;
*/
public abstract class JSSourceExtractor {
public static boolean DELETE_UPON_EXIT = true;
public static boolean DELETE_UPON_EXIT = false;
public static boolean USE_TEMP_NAME = true;
public static boolean USE_TEMP_NAME = false;
public abstract Set<MappedSourceModule> extractSources(URL entrypointUrl, IHtmlParser htmlParser, IUrlResolver urlResolver) throws IOException;

View File

@ -40,7 +40,6 @@ import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IField;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.classLoader.Language;
import com.ibm.wala.classLoader.NewSiteReference;
import com.ibm.wala.fixpoint.AbstractOperator;
import com.ibm.wala.fixpoint.UnaryOperator;
import com.ibm.wala.ipa.callgraph.AnalysisCache;
@ -64,7 +63,6 @@ import com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder;
import com.ibm.wala.ipa.callgraph.propagation.PropagationSystem;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.shrikeBT.BinaryOpInstruction;
import com.ibm.wala.shrikeBT.IBinaryOpInstruction.IOperator;
import com.ibm.wala.shrikeBT.IUnaryOpInstruction;
import com.ibm.wala.ssa.DefUse;
import com.ibm.wala.ssa.IR;

View File

@ -11,6 +11,7 @@
package com.ibm.wala.cast.js.ipa.callgraph;
import java.util.Collection;
import java.util.Collections;
import com.ibm.wala.cast.ipa.callgraph.ScopeMappingInstanceKeys;
import com.ibm.wala.cast.js.loader.JavaScriptLoader;
@ -21,9 +22,13 @@ import com.ibm.wala.cast.types.AstMethodReference;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.ipa.callgraph.CGNode;
import com.ibm.wala.ipa.callgraph.Context;
import com.ibm.wala.ipa.callgraph.ContextKey;
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
import com.ibm.wala.ipa.callgraph.propagation.InstanceKeyFactory;
import com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder;
import com.ibm.wala.ipa.callgraph.propagation.cfa.CallString;
import com.ibm.wala.ipa.callgraph.propagation.cfa.CallStringContextSelector;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeReference;
@ -60,7 +65,22 @@ public class JavaScriptScopeMappingInstanceKeys extends ScopeMappingInstanceKeys
@Override
protected Collection<CGNode> getConstructorCallers(ScopeMappingInstanceKey smik, Pair<String, String> name) {
final Collection<CGNode> result = super.getConstructorCallers(smik, name);
// in JavaScript, the 'new' instruction is wrapped in a synthetic constructor method. we want the
// caller of that constructor method, which we obtain from the context for the constructor method
final Context creatorContext = smik.getCreator().getContext();
CGNode callerOfConstructor = (CGNode) creatorContext.get(ContextKey.CALLER);
Collection<CGNode> result = null;
if (callerOfConstructor != null) {
return Collections.singleton(callerOfConstructor);
} else {
CallString cs = (CallString) creatorContext.get(CallStringContextSelector.CALL_STRING);
if (cs != null) {
IMethod[] methods = cs.getMethods();
assert methods.length == 1;
IMethod m = methods[0];
result = builder.getCallGraph().getNodes(m.getReference());
}
}
if (result == null) {
IClassHierarchy cha = smik.getCreator().getClassHierarchy();
MethodReference ref = MethodReference.findOrCreate(JavaScriptLoader.JS, TypeReference.findOrCreate(cha.getLoaders()[0].getReference(), name.snd), AstMethodReference.fnAtomStr, AstMethodReference.fnDesc.toString());

View File

@ -11,25 +11,19 @@
package com.ibm.wala.cast.ipa.callgraph;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import com.ibm.wala.cast.ipa.callgraph.LexicalScopingResolverContexts.LexicalScopingResolver;
import com.ibm.wala.cast.ir.translator.AstTranslator;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.classLoader.NewSiteReference;
import com.ibm.wala.classLoader.ProgramCounter;
import com.ibm.wala.ipa.callgraph.CGNode;
import com.ibm.wala.ipa.callgraph.Context;
import com.ibm.wala.ipa.callgraph.ContextItem;
import com.ibm.wala.ipa.callgraph.ContextKey;
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
import com.ibm.wala.ipa.callgraph.propagation.InstanceKeyFactory;
import com.ibm.wala.ipa.callgraph.propagation.PointerKey;
import com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder;
import com.ibm.wala.ipa.callgraph.propagation.cfa.CallString;
import com.ibm.wala.ipa.callgraph.propagation.cfa.CallStringContextSelector;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.collections.CompoundIterator;
import com.ibm.wala.util.collections.EmptyIterator;
@ -192,22 +186,11 @@ abstract public class ScopeMappingInstanceKeys implements InstanceKeyFactory {
}
}
protected Collection<CGNode> getConstructorCallers(ScopeMappingInstanceKey smik, Pair<String, String> name) {
final Context creatorContext = smik.getCreator().getContext();
CGNode callerOfConstructor = (CGNode) creatorContext.get(ContextKey.CALLER);
if (callerOfConstructor != null) {
return Collections.singleton(callerOfConstructor);
} else {
CallString cs = (CallString) creatorContext.get(CallStringContextSelector.CALL_STRING);
if (cs != null) {
IMethod[] methods = cs.getMethods();
assert methods.length == 1;
IMethod m = methods[0];
return builder.getCallGraph().getNodes(m.getReference());
}
}
return null;
}
/**
* get the CGNodes corresponding to the method that invoked the constructor for smik
*/
protected abstract Collection<CGNode> getConstructorCallers(ScopeMappingInstanceKey smik, Pair<String, String> name);
public InstanceKey getInstanceKeyForMultiNewArray(CGNode node, NewSiteReference allocation, int dim) {
return basic.getInstanceKeyForMultiNewArray(node, allocation, dim);
}

View File

@ -95,7 +95,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
/**
* set to true to use new handling of lexical scoping
*/
public static boolean NEW_LEXICAL = true;
public static final boolean NEW_LEXICAL = true;
/**

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.wala.core.tests"/>
@ -7,6 +7,7 @@
<listEntry value="4"/>
</listAttribute>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<stringAttribute key="org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE" value="/tmp/wala.out"/>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.ibm.wala.core.tests"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
@ -20,6 +21,7 @@
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;com.ibm.wala.core.testdata&quot; type=&quot;1&quot;/&gt;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/JDK 1.6"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.core.tests"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx800M -verbose:gc -Dcom.ibm.wala.util.fixedpoint.impl.verbose=true"/>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="dat"/>
<classpathentry kind="src" path="lib"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.ibm.wala.j2ee</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.ibm.etools.ctc.serviceprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.ibm.etools.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>com.ibm.etools.ctc.javaprojectnature</nature>
</natures>
</projectDescription>

View File

@ -1,315 +0,0 @@
#Tue Dec 02 11:37:04 EST 2008
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=ignore
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nullReference=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=1
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
org.eclipse.jdt.core.formatter.comment.line_length=132
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_empty_lines=false
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=132
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=2
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true

View File

@ -1,6 +0,0 @@
#Thu Jan 03 11:24:41 EST 2008
eclipse.preferences.version=1
formatter_profile=_WALA
formatter_settings_version=11
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>

View File

@ -1,24 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: com.ibm.wala.j2ee
Bundle-Version: 1.1.3.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: .,
com.ibm.wala.j2ee,
com.ibm.wala.j2ee.util
Require-Bundle: com.ibm.wala.core;visibility:=reexport,
org.eclipse.jem;visibility:=reexport,
org.eclipse.jst.j2ee.core;visibility:=reexport,
org.eclipse.wst.common.emf,
org.eclipse.jem.util,
org.eclipse.jem.workbench,
org.eclipse.wst.common.frameworks,
org.eclipse.emf.ecore.xmi,
com.ibm.icu;visibility:=reexport,
com.ibm.wala.shrike;bundle-version="1.1.3",
org.eclipse.core.runtime,
javax.servlet,
org.eclipse.jst.common.frameworks
Bundle-RequiredExecutionEnvironment: J2SE-1.5

View File

@ -1,9 +0,0 @@
bin.includes = dat/benignext.xml,\
META-INF/,\
.,\
plugin.properties
jars.compile.order = .
output.. = bin/
source.. = dat/,\
src/,\
lib/

View File

@ -1,276 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="com.ibm.wala.j2ee" default="build.jars" basedir=".">
<property name="basews" value="${ws}"/>
<property name="baseos" value="${os}"/>
<property name="basearch" value="${arch}"/>
<property name="basenl" value="${nl}"/>
<property name="bundleId" value="com.ibm.wala.j2ee"/>
<property name="bundleVersion" value="1.0.0"/>
<!-- Compiler settings. -->
<property name="javacFailOnError" value="true"/>
<property name="javacDebugInfo" value="on"/>
<property name="javacVerbose" value="false"/>
<property name="logExtension" value=".log"/>
<property name="compilerArg" value=""/>
<property name="javacSource" value="1.5"/>
<property name="javacTarget" value="1.5"/>
<condition property="dir_bootclasspath" value="${java.home}/../Classes">
<os family="mac"/>
</condition>
<property name="dir_bootclasspath" value="${java.home}/lib"/>
<path id="path_bootclasspath">
<fileset dir="${dir_bootclasspath}">
<include name="*.jar"/>
</fileset>
</path>
<property name="bootclasspath" refid="path_bootclasspath"/>
<property name="bundleJavacSource" value="${javacSource}"/>
<property name="bundleJavacTarget" value="${javacTarget}"/>
<property name="bundleBootClasspath" value="${bootclasspath}"/>
<target name="init" depends="properties">
<condition property="pluginTemp" value="${buildTempFolder}/plugins">
<isset property="buildTempFolder"/>
</condition>
<property name="pluginTemp" value="${basedir}"/>
<condition property="build.result.folder" value="${pluginTemp}/com.ibm.wala.j2ee_1.0.0">
<isset property="buildTempFolder"/>
</condition>
<property name="build.result.folder" value="${basedir}"/>
<property name="temp.folder" value="${basedir}/temp.folder"/>
<property name="plugin.destination" value="${basedir}"/>
</target>
<target name="properties" if="eclipse.running">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
</target>
<target name="build.update.jar" depends="init" description="Build the plug-in: com.ibm.wala.j2ee for an update site.">
<delete dir="${temp.folder}"/>
<mkdir dir="${temp.folder}"/>
<antcall target="build.jars"/>
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<jar destfile="${plugin.destination}/com.ibm.wala.j2ee_1.0.0.jar" basedir="${temp.folder}/com.ibm.wala.j2ee_1.0.0" filesetmanifest="merge"/>
<delete dir="${temp.folder}"/>
</target>
<target name="@dot" depends="init" unless="@dot" description="Create jar: com.ibm.wala.j2ee @dot.">
<delete dir="${temp.folder}/@dot.bin"/>
<mkdir dir="${temp.folder}/@dot.bin"/>
<path id="@dot.classpath">
<pathelement path="../com.ibm.wala.core/bin/"/>
<pathelement path="../com.ibm.wala.core/@dot"/>
<pathelement path="../com.ibm.wala.emf/bin/"/>
<pathelement path="../com.ibm.wala.emf/@dot"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.runtime_3.3.100.v20070530.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.osgi_3.3.0.v20070530.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.equinox.common_3.3.0.v20070426.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.jobs_3.3.0.v20070423.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.runtime.compatibility.registry_3.2.100.v20070316/runtime_registry_compatibility.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.runtime.compatibility.registry_3.2.100.v20070316"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.equinox.registry_3.3.0.v20070522.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.equinox.preferences_3.2.100.v20070522.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.runtime.compatibility.registry_3.2.100.v20070316/@dot"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.contenttype_3.2.100.v20070319.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.runtime.compatibility.auth_3.2.100.v20070502.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.equinox.app_1.0.0.v20070606.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.osgi.services_3.1.200.v20070605.jar"/>
<pathelement path="${eclipse.root}/plugins/javax.servlet_2.4.0.v200706111738.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.emf.ecore_2.3.0.v200706262000.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.emf.common_2.3.0.v200706262000.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.resources_3.3.0.v20070604.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.resources.compatibility_3.2.100.v20070502.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.resources.win32_3.3.0.v20070226.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.ant.core_3.1.200.v20070522.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.variables_3.2.0.v20070426.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.expressions_3.3.0.v20070606-0010.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.filesystem_1.1.0.v20070606.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.filesystem.win32.x86_1.1.0.v20070510.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.emf.ecore.xmi_2.3.0.v200706262000.jar"/>
<pathelement path="../com.ibm.wala.shrike/bin/"/>
<pathelement path="../com.ibm.wala.shrike/@dot"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jface_3.3.0.I20070606-0010.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.swt_3.3.0.v3346.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.swt.win32.win32.x86_3.3.0.v3346.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.commands_3.3.0.I20070605-0010.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jdt.core_3.3.0.v_771.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jdt.compiler.apt_1.0.0.v20070510-2000.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jdt.compiler.tool_1.0.0.v_771.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.text_3.3.0.v20070606-0010.jar"/>
<pathelement path="${eclipse.root}/plugins/com.ibm.icu_3.6.1.v20070417.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.team.core_3.3.0.I20070607.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jem_2.0.0.v200705302225.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jem.proxy_2.0.0.v200705302225.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jdt.launching_3.3.0.v20070510.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.debug.core_3.3.0.v20070607-1800.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jdt.debug_3.3.0.v20070530a/jdi.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jdt.debug_3.3.0.v20070530a/jdimodel.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jdt.debug_3.3.0.v20070530a/tools.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jem.util_2.0.0.v200705302225.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.pde.core_3.3.0.v20070608-1300.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.update.configurator_3.2.100.v20070615.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.filebuffers_3.3.0.v20070606-0010.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.pde.build_3.3.0.v20070612/pdebuild.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.update.core_3.2.100.v20070615.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.update.core.win32_3.2.100.v20070615.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.net_1.0.0.I20070531.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.runtime.compatibility_3.1.200.v20070502.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.ui_3.3.0.I20070614-0800.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.ui.workbench_3.3.0.I20070608-1100.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.ui.workbench.compatibility_3.2.0.I20070319-0010/@dot"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.ui.workbench.compatibility_3.2.0.I20070319-0010/compatibility.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.help_3.3.0.v20070524.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jface.databinding_1.1.0.I20070606-0010.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.core.databinding_1.0.0.I20070606-0010.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jst.j2ee.core_1.1.102.v200706111630.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.wst.common.frameworks_1.1.102.v200706071630.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.wst.common.environment_1.0.200.v200705302225.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.osgi.util_3.1.200.v20070605.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.wst.common.emf_1.1.103.v200706071630.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.wst.validation_1.1.101.v200706071630.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.wst.common.project.facet.core_1.2.0.v200706071740.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.wst.xml.core_1.1.200.v200706120811.jar"/>
<pathelement path="${eclipse.root}/plugins/org.apache.xerces_2.8.0.v200705301630.jar"/>
<pathelement path="${eclipse.root}/plugins/org.apache.xml.resolver_1.1.0.v200705310020.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.wst.common.uriresolver_1.1.201.v200705302225.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.wst.sse.core_1.1.201.v200706212223.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.emf.ecore.edit_2.3.0.v200706262000.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.emf.edit_2.3.0.v200706262000.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.emf.ecore.change_2.3.0.v200706262000.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.wst.common.emfworkbench.integration_1.1.103.v200706071630.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.wst.common.core_1.1.101.v200706120315.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.wst.common.modulecore_1.1.102.v200706071630.jar"/>
<pathelement path="${eclipse.root}/plugins/org.eclipse.jem.workbench_2.0.0.v200705302225.jar"/>
</path>
<!-- compile the source code -->
<javac destdir="${temp.folder}/@dot.bin" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bundleBootClasspath}" source="${bundleJavacSource}" target="${bundleJavacTarget}" >
<compilerarg line="${compilerArg}" compiler="${build.compiler}"/>
<classpath refid="@dot.classpath" />
<src path="dat/" />
<src path="src/" />
<src path="lib/" />
<exclude name="**/bak/"/>
<compilerarg value="@${basedir}/javaCompiler...args" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<compilerarg line="-log '${temp.folder}/@dot.bin${logExtension}'" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
</javac>
<!-- Copy necessary resources -->
<copy todir="${temp.folder}/@dot.bin" failonerror="true" overwrite="false">
<fileset dir="dat/">
<exclude name="**/*.java"/>
<exclude name="**/package.htm*"/>
</fileset>
<fileset dir="src/">
<exclude name="**/*.java"/>
<exclude name="**/package.htm*"/>
</fileset>
<fileset dir="lib/">
<exclude name="**/*.java"/>
<exclude name="**/package.htm*"/>
</fileset>
</copy>
<mkdir dir="${build.result.folder}"/>
<copy todir="${build.result.folder}/@dot" failonerror="true" overwrite="false">
<fileset dir="${temp.folder}/@dot.bin">
</fileset>
</copy>
<delete dir="${temp.folder}/@dot.bin"/>
</target>
<target name="src.zip" depends="init" unless="src.zip">
<mkdir dir="${build.result.folder}"/>
<zip destfile="${build.result.folder}/src.zip" filesonly="false" whenempty="skip" update="false">
<fileset dir="dat/">
<include name="**/*.java"/>
</fileset>
<fileset dir="src/">
<include name="**/*.java"/>
</fileset>
<fileset dir="lib/">
<include name="**/*.java"/>
</fileset>
</zip>
</target>
<target name="build.jars" depends="init" description="Compile classes and build nested jars for the plug-in: com.ibm.wala.j2ee.">
<available property="@dot" file="${build.result.folder}/@dot"/>
<antcall target="@dot"/>
</target>
<target name="build.sources" depends="init">
<available property="src.zip" file="${build.result.folder}/src.zip"/>
<antcall target="src.zip"/>
</target>
<target name="gather.bin.parts" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/com.ibm.wala.j2ee_1.0.0"/>
<copy todir="${destination.temp.folder}/com.ibm.wala.j2ee_1.0.0" failonerror="true" overwrite="false">
<fileset dir="${build.result.folder}/@dot">
<include name="**"/>
</fileset>
</copy>
<copy todir="${destination.temp.folder}/com.ibm.wala.j2ee_1.0.0" failonerror="true" overwrite="false">
<fileset dir="${basedir}">
<include name="dat/DefaultWebsphereModules.xml"/>
<include name="dat/SyntheticContainerModel.xml"/>
<include name="dat/benignext.xml"/>
<include name="META-INF/"/>
</fileset>
</copy>
</target>
<target name="build.zips" depends="init">
</target>
<target name="gather.sources" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/com.ibm.wala.j2ee_1.0.0"/>
<copy file="${build.result.folder}/src.zip" todir="${destination.temp.folder}/com.ibm.wala.j2ee_1.0.0" failonerror="false" overwrite="false"/>
</target>
<target name="gather.logs" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/com.ibm.wala.j2ee_1.0.0"/>
<copy todir="${destination.temp.folder}/com.ibm.wala.j2ee_1.0.0" failonerror="false" overwrite="false">
<fileset dir="${temp.folder}">
<include name="@dot.bin${logExtension}"/>
</fileset>
</copy>
</target>
<target name="clean" depends="init" description="Clean the plug-in: com.ibm.wala.j2ee of all the zips, jars and logs created.">
<delete dir="${build.result.folder}/@dot"/>
<delete file="${build.result.folder}/src.zip"/>
<delete file="${plugin.destination}/com.ibm.wala.j2ee_1.0.0.jar"/>
<delete file="${plugin.destination}/com.ibm.wala.j2ee_1.0.0.zip"/>
<delete dir="${temp.folder}"/>
</target>
<target name="refresh" depends="init" if="eclipse.running" description="Refresh this folder.">
<eclipse.convertPath fileSystemPath="C:/Data/Projects/Safe/workspaces/safe-build/com.ibm.wala.j2ee" property="resourcePath"/>
<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
</target>
<target name="zip.plugin" depends="init" description="Create a zip containing all the elements for the plug-in: com.ibm.wala.j2ee.">
<delete dir="${temp.folder}"/>
<mkdir dir="${temp.folder}"/>
<antcall target="build.jars"/>
<antcall target="build.sources"/>
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<antcall target="gather.sources">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<delete>
<fileset dir="${temp.folder}">
<include name="**/*.bin${logExtension}"/>
</fileset>
</delete>
<zip destfile="${plugin.destination}/com.ibm.wala.j2ee_1.0.0.zip" basedir="${temp.folder}" filesonly="true" whenempty="skip" update="false"/>
<delete dir="${temp.folder}"/>
</target>
</project>

View File

@ -1,560 +0,0 @@
<?xml version="1.0" ?>
<!-- specification of benign methods and some shortcuts for current analysis -->
<summary-spec>
<!-- the following are some shortcuts that are OK and helpful for CHA-like analysis,
to avoid spurious undecidability, or to account for JVM hacks -->
<classloader name="Extension">
<package name="com/ibm/ejs/ras" ignore="true"></package>
<package name="com/ibm/websphere/command">
<class name="CacheableCommandImpl">
<method name="&lt;clinit&gt;" descriptor="()V" />
<method name="&lt;init&gt;" descriptor="()V" />
<method name="execute" descriptor="()V">
<call type="virtual" name="performExecute" class="Lcom/ibm/websphere/command/CacheableCommandImpl" descriptor="()V" arg0="arg0" />
</method>
</class>
</package>
<package name="com/ibm/ws/webcontainer/jsp/runtime">
<class name="HttpJspBase">
<method name="&lt;clinit&gt;" descriptor="()V" />
<method name="getServletInfo" descriptor="()Ljava/lang/String;">
<new def="x" class="Ljava/lang/String" />
<return value="x" />
</method>
</class>
</package>
<package name="javax/ejb">
<class name="EJBContext">
<method name="getCallerPrincipal" descriptor="()Ljava/security/Principal;">
<new def="x" class="Ljava/security/Principal" />
<return value="x" />
</method>
<method name="getEJBHome" descriptor="()Ljavax/ejb/EJBHome;" factory="true">
<new def="x" class="Lcom/ibm/wala/Malleable" />
<return value="x" />
</method>
<method name="getUserTransaction" descriptor="()Ljavax/transaction/UserTransaction;">
<new def="x" class="Ljavax/transaction/UserTransaction" />
<return value="x" />
</method>
<method name="setRollbackOnly" descriptor="()V" />
</class>
<class name="EJBHome">
<method name="getEJBMetaData" descriptor="()Ljavax/ejb/EJBMetaData;">
<new def="x" class="Ljavax/ejb/EJBMetaData" />
<return value="x" />
</method>
<method name="getHomeHandle" descriptor="()Ljavax/ejb/HomeHandle;">
<new def="x" class="Ljavax/ejb/HomeHandle" />
<return value="x" />
</method>
<method name="remove" descriptor="(Ljavax/ejb/Handle;)V" />
<method name="remove" descriptor="(Ljava/lang/Object;)V" />
</class>
<class name="EJBLocalHome">
<method name="remove" descriptor="(Ljava/lang/Object;)V" />
</class>
<class name="EJBLocalObject">
<method name="remove" descriptor="()V">
<new def="x" class="Ljavax/ejb/RemoveException" />
<throw value="x" />
<new def="y" class="Ljavax/ejb/EJBException" />
<throw value="y" />
</method>
</class>
<class name="EJBMetaData" allocatable="true"></class>
<class name="EJBObject">
<method name="getEJBHome" descriptor="()Ljavax/ejb/EJBHome;" factory="true">
<new def="x" class="Lcom/ibm/wala/Malleable" />
<return value="x" />
</method>
<method name="getHandle" descriptor="()Ljavax/ejb/Handle;">
<new def="x" class="Ljavax/ejb/Handle" />
<return value="x" />
<poison reason="questionable model of EJBObject.getHandle()" level="severe" />
</method>
<method name="isIdentical" descriptor="(Ljavax/ejb/EJBObject;)Z">
<poison reason="questionable model of EJBObject.isIdentical()" level="severe" />
</method>
<method name="remove" descriptor="()V">
<new def="x" class="Ljavax/ejb/RemoveException" />
<throw value="x" />
<new def="y" class="Ljava/rmi/RemoteException" />
<throw value="y" />
<poison reason="questionable model of EJBObject.remove()" level="severe" />
</method>
</class>
<class name="EntityContext" allocatable="true">
<method name="setRollbackOnly" descriptor="()V" />
</class>
<class name="Handle" allocatable="true">
<method name="getEJBObject" descriptor="()Ljavax/ejb/EJBObject;" factory="true">
<new def="x" class="Lcom/ibm/wala/Malleable" />
<return value="x" />
</method>
</class>
<class name="MessageDrivenContext" allocatable="true">
<method name="setRollbackOnly" descriptor="()V" />
</class>
<class name="SessionContext" allocatable="true">
<method name="getEJBObject" descriptor="()Ljavax/ejb/EJBObject;" factory="true">
<new def="x" class="Lcom/ibm/wala/Malleable" />
<return value="x" />
</method>
<method name="setRollbackOnly" descriptor="()V" />
</class>
</package>
<package name="javax/jms">
<class name="BytesMessage" allocatable="true"></class>
<class name="Connection" allocatable="true">
<method name="close" descriptor="()V">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
<method name="start" descriptor="()V"></method>
</class>
<class name="Message" allocatable="true">
<method name="getBooleanProperty" descriptor="(Ljava/lang/String;)Z">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
<method name="getDoubleProperty" descriptor="(Ljava/lang/String;)D">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
<method name="getIntProperty" descriptor="(Ljava/lang/String;)I">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
<method name="getJMSMessageID" descriptor="()Ljava/lang/String;">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
<new def="y" class="Ljava/lang/String" />
<return value="y" />
</method>
<method name="getJMSRedelivered" descriptor="()Z">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
<method name="getLongProperty" descriptor="(Ljava/lang/String;)J">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
<method name="getShortProperty" descriptor="(Ljava/lang/String;)S">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
<method name="getStringProperty" descriptor="(Ljava/lang/String;)Ljava/lang/String;">
<new def="x" class="Ljavax/jms/QueueSession" />
<return value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
<method name="setBooleanProperty" descriptor="(Ljava/lang/String;Z)V">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
<method name="setDoubleProperty" descriptor="(Ljava/lang/String;D)V">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
<method name="setIntProperty" descriptor="(Ljava/lang/String;I)V">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
<method name="setLongProperty" descriptor="(Ljava/lang/String;J)V">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
<method name="setShortProperty" descriptor="(Ljava/lang/String;S)V">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
<method name="setStringProperty" descriptor="(Ljava/lang/String;Ljava/lang/String;)V">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
</class>
<class name="MessageConsumer" allocatable="true">
<method name="setMessageListener" descriptor="(Ljavax/jms/MessageListener;)V">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
</class>
<class name="MessageProducer" allocatable="true">
<method name="close" descriptor="()V">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
</class>
<class name="ObjectMessage" allocatable="true">
<method name="getObject" descriptor="()Ljava/io/Serializable;" factory="true">
<new def="x" class="Lcom/ibm/wala/Malleable" />
<return value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
<method name="setObject" descriptor="(Ljava/io/Serializable;)V">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
</class>
<class name="QueueConnection" allocatable="true">
<method name="createQueueSession" descriptor="(ZI)Ljavax/jms/QueueSession;">
<new def="x" class="Ljavax/jms/QueueSession" />
<return value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
</class>
<class name="QueueConnectionFactory" allocatable="true">
<method name="createQueueConnection" descriptor="()Ljavax/jms/QueueConnection;">
<new def="x" class="Ljavax/jms/QueueConnection" />
<return value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
</class>
<class name="QueueSender" allocatable="true">
<method name="send" descriptor="(Ljavax/jms/Message;)V">
<new def="x" class="Ljavax/jms/QueueConnection" />
<return value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
</class>
<class name="QueueSession" allocatable="true">
<method name="createSender" descriptor="(Ljavax/jms/Queue;)Ljavax/jms/QueueSender;">
<new def="x" class="Ljavax/jms/QueueSender" />
<return value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
</class>
<class name="Session" allocatable="true">
<method name="close" descriptor="()V" />
<method name="createObjectMessage" descriptor="()Ljavax/jms/ObjectMessage;">
<new def="x" class="Ljavax/jms/ObjectMessage" />
<return value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
<method name="createTextMessage" descriptor="()Ljavax/jms/TextMessage;">
<new def="x" class="Ljavax/jms/TextMessage" />
<return value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
</class>
<class name="StreamMessage" allocatable="true"></class>
<class name="TextMessage" allocatable="true">
<method name="getText" descriptor="()Ljava/lang/String;">
<new def="x" class="Ljava/lang/String" />
<return value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
<method name="setText" descriptor="(Ljava/lang/String;)V">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
</class>
<class name="TemporaryQueue" allocatable="true"></class>
<class name="TemporaryTopic" allocatable="true"></class>
<class name="TopicConnection" allocatable="true">
<method name="createTopicSession" descriptor="(ZI)Ljavax/jms/TopicSession;">
<new def="x" class="Ljavax/jms/TopicSession" />
<return value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
</class>
<class name="TopicConnectionFactory" allocatable="true">
<method name="createTopicConnection" descriptor="()Ljavax/jms/TopicConnection;">
<new def="x" class="Ljavax/jms/TopicConnection" />
<return value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
</class>
<class name="TopicPublisher" allocatable="true">
<method name="publish" descriptor="(Ljavax/jms/Message;)V">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
</class>
<class name="TopicSession" allocatable="true">
<method name="createPublisher" descriptor="(Ljavax/jms/Topic;)Ljavax/jms/TopicPublisher;">
<new def="x" class="Ljavax/jms/TopicPublisher" />
<return value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
<method name="createSubscriber" descriptor="(Ljavax/jms/Topic;)Ljavax/jms/TopicSubscriber;">
<new def="x" class="Ljavax/jms/TopicSubscriber" />
<return value="x" />
<new def="y" class="Ljavax/jms/JMSException" />
<throw value="y" />
</method>
</class>
<class name="TopicSubscriber" allocatable="true">
<method name="setMessageListener" descriptor="(Ljavax/jms/MessageListener;)V">
<new def="x" class="Ljavax/jms/JMSException" />
<throw value="x" />
</method>
</class>
</package>
<package name="javax/mail">
<class name="Transport" allocatable="true">
<method name="send" descriptor="(Ljavax/mail/Message;)V" />
</class>
<class name="URLName">
<method name="&lt;clinit&gt;" descriptor="()V" />
</class>
</package>
<package name="javax/mail/internet">
<class name="InternetAddress">
<method name="toString" descriptor="()Ljava/lang/String;">
<new def="x" class="Ljava/lang/String" />
<return value="x" />
</method>
</class>
<class name="MailDateFormat">
<method name="&lt;clinit&gt;" descriptor="()V" />
</class>
<class name="MimeMessage">
<method name="&lt;clinit&gt;" descriptor="()V" />
<method name="setSubject" descriptor="(Ljava/lang/String;)V" />
</class>
<class name="MimeUtility">
<method name="&lt;clinit&gt;" descriptor="()V" />
</class>
</package>
<package name="javax/servlet">
<class name="ServletContext" allocatable="true">
<method name="log" descriptor="(Ljava/lang/String;)V" />
</class>
<class name="ServletOutputStream" allocatable="true">
<method name="write" descriptor="(I)V" />
</class>
<class name="ServletRequest" allocatable="true">
<method name="getProtocol" descriptor="()Ljava/lang/String;">
<new def="x" class="Ljava/lang/String" />
<return value="x" />
</method>
</class>
<class name="ServletResponse" allocatable="true">
<method name="getWriter" descriptor="()Ljava/io/PrintWriter;">
<new def="x" class="Ljava/io/PrintWriter" />
<return value="x" />
</method>
<method name="setContentType" descriptor="(Ljava/lang/String;)V" />
</class>
</package>
<package name="javax/servlet/jsp">
<class name="JspFactory" allocatable="true">
<method name="getDefaultFactory" descriptor="()Ljavax/servlet/jsp/JspFactory;" static="true">
<new def="x" class="Ljavax/servlet/jsp/JspFactory" />
<return value="x" />
</method>
<method name="getPageContext" descriptor="(Ljavax/servlet/Servlet;Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljava/lang/String;ZIZ)Ljavax/servlet/jsp/PageContext;">
<new def="x" class="Ljavax/servlet/jsp/PageContext" />
<return value="x" />
</method>
<method name="releasePageContext" descriptor="(Ljavax/servlet/jsp/PageContext;)V"></method>
</class>
<class name="PageContext" allocatable="true">
<method name="forward" descriptor="(Ljava/lang/String;)V"></method>
<method name="getAttribute" descriptor="(Ljava/lang/String;)Ljava/lang/Object;" factory="true">
<new def="x" class="Lcom/ibm/wala/Malleable" />
<return value="x" />
</method>
<method name="getAttribute" descriptor="(Ljava/lang/String;I)Ljava/lang/Object;" factory="true">
<new def="x" class="Lcom/ibm/wala/Malleable" />
<return value="x" />
</method>
<method name="getOut" descriptor="()Ljavax/servlet/jsp/JspWriter;">
<new def="x" class="Ljavax/servlet/jsp/JspWriter" />
<return value="x" />
</method>
<method name="getServletConfig" descriptor="()Ljavax/servlet/ServletConfig;">
<new def="x" class="Lcom/ibm/wala/model/javax/servlet/ServletConfig" />
<return value="x" />
</method>
<method name="getServletContext" descriptor="()Ljavax/servlet/ServletContext;">
<call type="static" name="getModelInstance" class="Lcom/ibm/wala/model/javax/servlet/ServletContext" descriptor="()Ljavax/servlet/ServletContext;" def="x" />
<return value="x" />
</method>
<method name="getSession" descriptor="()Ljavax/servlet/http/HttpSession;">
<call type="static" name="getModelInstance" class="Lcom/ibm/wala/model/javax/servlet/http/HttpSession" descriptor="()Ljavax/servlet/http/HttpSession;" def="x" />
<return value="x" />
</method>
<method name="handlePageException" descriptor="(Ljava/lang/Exception;)V" />
<method name="handlePageException" descriptor="(Ljava/lang/Throwable;)V"></method>
<method name="setAttribute" descriptor="(Ljava/lang/String;Ljava/lang/Object;I)V" />
</class>
<class name="JspWriter" allocatable="true">
<method name="newLine" descriptor="()V" />
<method name="print" descriptor="(Z)V" />
<method name="print" descriptor="(C)V" />
<method name="print" descriptor="(I)V" />
<method name="print" descriptor="(J)V" />
<method name="print" descriptor="(F)V" />
<method name="print" descriptor="(D)V" />
<method name="print" descriptor="([C)V" />
<method name="print" descriptor="(Ljava/lang/String;)V" />
<method name="print" descriptor="(Ljava/lang/Object;)V" />
<method name="println" descriptor="(Z)V" />
<method name="println" descriptor="(C)V" />
<method name="println" descriptor="(I)V" />
<method name="println" descriptor="(J)V" />
<method name="println" descriptor="(F)V" />
<method name="println" descriptor="(D)V" />
<method name="println" descriptor="([C)V" />
<method name="println" descriptor="(Ljava/lang/String;)V" />
<method name="println" descriptor="(Ljava/lang/Object;)V" />
<method name="clear" descriptor="()V" />
<method name="clearBuffer" descriptor="()V" />
<method name="flush" descriptor="()V" />
<method name="close" descriptor="()V" />
</class>
</package>
<package name="javax/servlet/jsp/tagext" ignore="true"></package>
<package name="javax/transaction">
<class name="UserTransaction" allocatable="true">
<method name="begin" descriptor="()V">
<new def="x" class="Ljavax/transaction/NotSupportedException" />
<throw value="x" />
<new def="y" class="Ljavax/transaction/SystemException" />
<throw value="y" />
</method>
<method name="commit" descriptor="()V">
<new def="a" class="Ljavax/transaction/RollbackException" />
<throw value="a" />
<new def="b" class="Ljavax/transaction/SystemException" />
<throw value="b" />
<new def="c" class="Ljavax/transaction/HeuristicMixedException" />
<throw value="c" />
<new def="d" class="Ljavax/transaction/HeuristicRollbackException" />
<throw value="d" />
<new def="e" class="Ljava/lang/SecurityException" />
<throw value="e" />
<new def="f" class="Ljava/lang/IllegalStateException" />
<throw value="f" />
</method>
<method name="rollback" descriptor="()V">
<new def="b" class="Ljavax/transaction/SystemException" />
<throw value="b" />
<new def="e" class="Ljava/lang/SecurityException" />
<throw value="e" />
<new def="f" class="Ljava/lang/IllegalStateException" />
<throw value="f" />
</method>
</class>
</package>
<package name="org/apache/jasper/compiler" ignore="true" />
<package name="org/apache/taglibs/standard" ignore="true" />
<package name="org/apache/soap">
<class name="Fault">
<method name="getFaultCode" descriptor="()Ljava/lang/String;">
<new def="x" class="Ljava/lang/String" />
<return value="x" />
</method>
<method name="getFaultString" descriptor="()Ljava/lang/String;">
<new def="x" class="Ljava/lang/String" />
<return value="x" />
</method>
</class>
</package>
<package name="org/apache/soap/encoding">
<class name="SOAPMappingRegistry">
<method name="&lt;clinit&gt;" descriptor="()V" />
</class>
</package>
<package name="org/apache/soap/rpc">
<class name="Call">
<method name="invoke" descriptor="(Ljava/net/URL;Ljava/lang/String;)Lorg/apache/soap/rpc/Response;">
<new def="x" class="Lorg/apache/soap/rpc/Response" />
<return value="x" />
</method>
</class>
<class name="SOAPContext">
<method name="toString" descriptor="()Ljava/lang/String;">
<new def="x" class="Ljava/lang/String" />
<return value="x" />
</method>
</class>
</package>
</classloader>
<classloader name="Application">
<package name="org/apache/commons/logging" ignore="true" />
<package name="org/apache/struts/action">
<class name="Action">
<method name="&lt;init&gt;" descriptor="()V">
<new def="x" class="Lorg/apache/struts/action/ActionServlet" />
<call type="special" name="&lt;init&gt;" class="Lorg/apache/struts/action/ActionServlet" descriptor="()V" arg0="x" />
<call type="virtual" name="setServlet" class="Lorg/apache/struts/action/Action" descriptor="(Lorg/apache/struts/action/ActionServlet;)V" arg0="arg0" arg1="x" />
</method>
</class>
<class name="ActionForward">
<method name="findForward" descriptor="(Ljava/lang/String;)Lorg/apache/struts/action/ActionForward;">
<new def="x" class="Lorg/apache/struts/action/ActionForward" />
<return value="x" />
</method>
</class>
<class name="ActionServlet">
<method name="init" descriptor="()V"></method>
</class>
</package>
<package name="org/apache/struts/upload">
<class name="FormFile">
<method name="destroy" descriptor="()V"></method>
<method name="getFileName" descriptor="()Ljava/lang/String;">
<new def="x" class="Ljava/lang/String" />
<return value="x" />
</method>
</class>
<class name="MultipartRequestWrapper">
<method name="getParameterValues" descriptor="(Ljava/lang/String;)[Ljava/lang/String;">
<constant name="size" type="int" value="1" />
<new def="x" class="[Ljava/lang/String" size="size"/>
<new def="y" class="Ljava/lang/String" />
<aastore ref="x" value="y" index="0" />
<return value="x" />
</method>
</class>
</package>
<package name="org/apache/struts/util" ignore="true" />
<package name="org/apache/taglibs/standard/tlv" ignore="true" />
</classloader>
</summary-spec>

View File

@ -1,76 +0,0 @@
#ADAPTER#ACCESS#com.ibm.wala.core/bin/[+com/ibm/wala/analysis/pointers/*;+com/ibm/wala/analysis/reflection/*;+com/ibm/wala/analysis/stackMachine/*;+com/ibm/wala/analysis/typeInference/*;+com/ibm/wala/cfg/*;+com/ibm/wala/cfg/cdg/*;+com/ibm/wala/classLoader/*;+com/ibm/wala/client/*;+com/ibm/wala/client/impl/*;+com/ibm/wala/core/plugin/*;+com/ibm/wala/dataflow/IFDS/*;+com/ibm/wala/dataflow/graph/*;+com/ibm/wala/dataflow/ssa/*;+com/ibm/wala/emf/wrappers/*;+com/ibm/wala/escape/*;+com/ibm/wala/fixedpoint/impl/*;+com/ibm/wala/fixpoint/*;+com/ibm/wala/ipa/callgraph/*;+com/ibm/wala/ipa/callgraph/impl/*;+com/ibm/wala/ipa/callgraph/propagation/*;+com/ibm/wala/ipa/callgraph/propagation/cfa/*;+com/ibm/wala/ipa/callgraph/propagation/rta/*;+com/ibm/wala/ipa/cfg/*;+com/ibm/wala/ipa/cha/*;+com/ibm/wala/ipa/summaries/*;+com/ibm/wala/model/*;+com/ibm/wala/model/java/lang/*;+com/ibm/wala/properties/*;+com/ibm/wala/ssa/*;+com/ibm/wala/ssa/analysis/*;+com/ibm/wala/types/*;+com/ibm/wala/util/*;+com/ibm/wala/util/bytecode/*;+com/ibm/wala/util/collections/*;+com/ibm/wala/util/config/*;+com/ibm/wala/util/debug/*;+com/ibm/wala/util/graph/*;+com/ibm/wala/util/graph/impl/*;+com/ibm/wala/util/graph/traverse/*;+com/ibm/wala/util/heapTrace/*;+com/ibm/wala/util/intertionalization/*;+com/ibm/wala/util/intset/*;+com/ibm/wala/util/io/*;+com/ibm/wala/util/logging/*;+com/ibm/wala/util/math/*;+com/ibm/wala/util/perf/*;+com/ibm/wala/util/properties/*;+com/ibm/wala/util/properties/impl/*;+com/ibm/wala/util/warnings/*;+com/ibm/wala/viz/*;?**/*]
#ADAPTER#ACCESS#com.ibm.wala.core/@dot[+com/ibm/wala/analysis/pointers/*;+com/ibm/wala/analysis/reflection/*;+com/ibm/wala/analysis/stackMachine/*;+com/ibm/wala/analysis/typeInference/*;+com/ibm/wala/cfg/*;+com/ibm/wala/cfg/cdg/*;+com/ibm/wala/classLoader/*;+com/ibm/wala/client/*;+com/ibm/wala/client/impl/*;+com/ibm/wala/core/plugin/*;+com/ibm/wala/dataflow/IFDS/*;+com/ibm/wala/dataflow/graph/*;+com/ibm/wala/dataflow/ssa/*;+com/ibm/wala/emf/wrappers/*;+com/ibm/wala/escape/*;+com/ibm/wala/fixedpoint/impl/*;+com/ibm/wala/fixpoint/*;+com/ibm/wala/ipa/callgraph/*;+com/ibm/wala/ipa/callgraph/impl/*;+com/ibm/wala/ipa/callgraph/propagation/*;+com/ibm/wala/ipa/callgraph/propagation/cfa/*;+com/ibm/wala/ipa/callgraph/propagation/rta/*;+com/ibm/wala/ipa/cfg/*;+com/ibm/wala/ipa/cha/*;+com/ibm/wala/ipa/summaries/*;+com/ibm/wala/model/*;+com/ibm/wala/model/java/lang/*;+com/ibm/wala/properties/*;+com/ibm/wala/ssa/*;+com/ibm/wala/ssa/analysis/*;+com/ibm/wala/types/*;+com/ibm/wala/util/*;+com/ibm/wala/util/bytecode/*;+com/ibm/wala/util/collections/*;+com/ibm/wala/util/config/*;+com/ibm/wala/util/debug/*;+com/ibm/wala/util/graph/*;+com/ibm/wala/util/graph/impl/*;+com/ibm/wala/util/graph/traverse/*;+com/ibm/wala/util/heapTrace/*;+com/ibm/wala/util/intertionalization/*;+com/ibm/wala/util/intset/*;+com/ibm/wala/util/io/*;+com/ibm/wala/util/logging/*;+com/ibm/wala/util/math/*;+com/ibm/wala/util/perf/*;+com/ibm/wala/util/properties/*;+com/ibm/wala/util/properties/impl/*;+com/ibm/wala/util/warnings/*;+com/ibm/wala/viz/*;?**/*]
#ADAPTER#ACCESS#com.ibm.wala.emf/bin/[+com/ibm/wala/ecore/common/*;+com/ibm/wala/ecore/common/impl/*;+com/ibm/wala/ecore/common/util/*;+com/ibm/wala/ecore/graph/*;+com/ibm/wala/ecore/graph/impl/*;+com/ibm/wala/ecore/graph/util/*;+com/ibm/wala/ecore/j2ee/scope/*;+com/ibm/wala/ecore/j2ee/scope/impl/*;+com/ibm/wala/ecore/j2ee/scope/util/*;+com/ibm/wala/ecore/java/*;+com/ibm/wala/ecore/java/callGraph/*;+com/ibm/wala/ecore/java/callGraph/impl/*;+com/ibm/wala/ecore/java/callGraph/util/*;+com/ibm/wala/ecore/java/impl/*;+com/ibm/wala/ecore/java/pointerAnalysis/*;+com/ibm/wala/ecore/java/pointerAnalysis/impl/*;+com/ibm/wala/ecore/java/pointerAnalysis/util/*;+com/ibm/wala/ecore/java/scope/*;+com/ibm/wala/ecore/java/scope/impl/*;+com/ibm/wala/ecore/java/scope/util/*;+com/ibm/wala/ecore/java/util/*;+com/ibm/wala/ecore/perf/*;+com/ibm/wala/ecore/perf/impl/*;+com/ibm/wala/ecore/perf/util/*;+com/ibm/wala/ecore/regex/*;+com/ibm/wala/ecore/regex/impl/*;+com/ibm/wala/ecore/regex/util/*;?**/*]
#ADAPTER#ACCESS#com.ibm.wala.emf/@dot[+com/ibm/wala/ecore/common/*;+com/ibm/wala/ecore/common/impl/*;+com/ibm/wala/ecore/common/util/*;+com/ibm/wala/ecore/graph/*;+com/ibm/wala/ecore/graph/impl/*;+com/ibm/wala/ecore/graph/util/*;+com/ibm/wala/ecore/j2ee/scope/*;+com/ibm/wala/ecore/j2ee/scope/impl/*;+com/ibm/wala/ecore/j2ee/scope/util/*;+com/ibm/wala/ecore/java/*;+com/ibm/wala/ecore/java/callGraph/*;+com/ibm/wala/ecore/java/callGraph/impl/*;+com/ibm/wala/ecore/java/callGraph/util/*;+com/ibm/wala/ecore/java/impl/*;+com/ibm/wala/ecore/java/pointerAnalysis/*;+com/ibm/wala/ecore/java/pointerAnalysis/impl/*;+com/ibm/wala/ecore/java/pointerAnalysis/util/*;+com/ibm/wala/ecore/java/scope/*;+com/ibm/wala/ecore/java/scope/impl/*;+com/ibm/wala/ecore/java/scope/util/*;+com/ibm/wala/ecore/java/util/*;+com/ibm/wala/ecore/perf/*;+com/ibm/wala/ecore/perf/impl/*;+com/ibm/wala/ecore/perf/util/*;+com/ibm/wala/ecore/regex/*;+com/ibm/wala/ecore/regex/impl/*;+com/ibm/wala/ecore/regex/util/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.runtime_3.2.0.v20060603.jar[~org/eclipse/core/internal/preferences/legacy/*;~org/eclipse/core/internal/runtime/*;+org/eclipse/core/runtime/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.osgi_3.2.0.v20060601.jar[+org/eclipse/osgi/event/*;+org/eclipse/osgi/framework/console/*;+org/eclipse/osgi/framework/eventmgr/*;+org/eclipse/osgi/framework/log/*;+org/eclipse/osgi/service/datalocation/*;+org/eclipse/osgi/service/debug/*;+org/eclipse/osgi/service/environment/*;+org/eclipse/osgi/service/localization/*;+org/eclipse/osgi/service/pluginconversion/*;+org/eclipse/osgi/service/resolver/*;+org/eclipse/osgi/service/runnable/*;+org/eclipse/osgi/service/urlconversion/*;+org/eclipse/osgi/storagemanager/*;+org/eclipse/osgi/util/*;+org/osgi/framework/*;+org/osgi/service/condpermadmin/*;+org/osgi/service/packageadmin/*;+org/osgi/service/permissionadmin/*;+org/osgi/service/startlevel/*;+org/osgi/service/url/*;+org/osgi/util/tracker/*;~org/eclipse/core/runtime/adaptor/*;~org/eclipse/core/runtime/internal/adaptor/*;~org/eclipse/core/runtime/internal/stats/*;~org/eclipse/osgi/baseadaptor/*;~org/eclipse/osgi/baseadaptor/bundlefile/*;~org/eclipse/osgi/baseadaptor/hooks/*;~org/eclipse/osgi/baseadaptor/loader/*;~org/eclipse/osgi/framework/adaptor/*;~org/eclipse/osgi/framework/debug/*;~org/eclipse/osgi/framework/internal/core/*;~org/eclipse/osgi/framework/internal/protocol/*;~org/eclipse/osgi/framework/internal/protocol/bundleentry/*;~org/eclipse/osgi/framework/internal/protocol/bundleresource/*;~org/eclipse/osgi/framework/internal/protocol/reference/*;~org/eclipse/osgi/framework/internal/reliablefile/*;~org/eclipse/osgi/framework/launcher/*;~org/eclipse/osgi/framework/util/*;~org/eclipse/osgi/internal/baseadaptor/*;~org/eclipse/osgi/internal/module/*;~org/eclipse/osgi/internal/profile/*;~org/eclipse/osgi/internal/resolver/*;~org/eclipse/osgi/internal/verifier/*;~org/eclipse/osgi/internal/provisional/verifier/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.equinox.common_3.2.0.v20060603.jar[~org/eclipse/core/internal/runtime/*;~org/eclipse/core/internal/boot/*;+org/eclipse/core/runtime/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.jobs_3.2.0.v20060603.jar[~org/eclipse/core/internal/jobs/*;+org/eclipse/core/runtime/jobs/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.runtime.compatibility.registry_3.2.0.v20060603/runtime_registry_compatibility.jar[~org/eclipse/core/internal/registry/*;~org/eclipse/core/internal/registry/osgi/*;~org/eclipse/core/internal/registry/spi/*;+org/eclipse/core/runtime/*;+org/eclipse/core/runtime/dynamichelpers/*;+org/eclipse/core/runtime/spi/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.runtime.compatibility.registry_3.2.0.v20060603[~org/eclipse/core/internal/registry/*;~org/eclipse/core/internal/registry/osgi/*;~org/eclipse/core/internal/registry/spi/*;+org/eclipse/core/runtime/*;+org/eclipse/core/runtime/dynamichelpers/*;+org/eclipse/core/runtime/spi/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.equinox.registry_3.2.0.v20060601.jar[~org/eclipse/core/internal/registry/*;~org/eclipse/core/internal/registry/osgi/*;~org/eclipse/core/internal/registry/spi/*;+org/eclipse/core/runtime/*;+org/eclipse/core/runtime/dynamichelpers/*;+org/eclipse/core/runtime/spi/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.apache.xerces_2.8.0.v200606131651/resolver.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.apache.xerces_2.8.0.v200606131651/xercesImpl.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.apache.xerces_2.8.0.v200606131651/xml-apis.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.equinox.preferences_3.2.0.v20060601.jar[~org/eclipse/core/internal/preferences/*;~org/eclipse/core/internal/preferences/exchange/*;+org/eclipse/core/runtime/preferences/*;+org/osgi/service/prefs/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.runtime.compatibility.registry_3.2.0.v20060603/@dot[~org/eclipse/core/internal/registry/*;~org/eclipse/core/internal/registry/osgi/*;~org/eclipse/core/internal/registry/spi/*;+org/eclipse/core/runtime/*;+org/eclipse/core/runtime/dynamichelpers/*;+org/eclipse/core/runtime/spi/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.contenttype_3.2.0.v20060603.jar[~org/eclipse/core/internal/content/*;+org/eclipse/core/runtime/content/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.runtime.compatibility.auth_3.2.0.v20060601.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.emf.ecore_2.2.0.v200606271057.jar[+org/eclipse/emf/ecore/*;+org/eclipse/emf/ecore/impl/*;+org/eclipse/emf/ecore/plugin/*;+org/eclipse/emf/ecore/resource/*;+org/eclipse/emf/ecore/resource/impl/*;+org/eclipse/emf/ecore/util/*;+org/eclipse/emf/ecore/xml/namespace/*;+org/eclipse/emf/ecore/xml/namespace/impl/*;+org/eclipse/emf/ecore/xml/namespace/util/*;+org/eclipse/emf/ecore/xml/type/*;+org/eclipse/emf/ecore/xml/type/impl/*;+org/eclipse/emf/ecore/xml/type/internal/*;+org/eclipse/emf/ecore/xml/type/util/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.emf.common_2.2.0.v200606271057.jar[+org/eclipse/emf/common/*;+org/eclipse/emf/common/archive/*;+org/eclipse/emf/common/command/*;+org/eclipse/emf/common/notify/*;+org/eclipse/emf/common/notify/impl/*;+org/eclipse/emf/common/util/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.resources_3.2.0.v20060603.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.resources.compatibility_3.2.0.v20060603.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.resources.win32_3.2.0.v20060603.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.runtime.compatibility_3.1.100.v20060603.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.update.configurator_3.2.0.v20060605.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.ant.core_3.1.100.v20060531.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.variables_3.1.100.v20060605.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.expressions_3.2.0.v20060605-1400.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.filesystem_1.0.0.v20060603.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.filesystem.win32.x86_1.0.0.v20060603.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.emf.ecore.xmi_2.2.0.v200606271057.jar[+org/eclipse/emf/ecore/xmi/*;+org/eclipse/emf/ecore/xmi/impl/*;+org/eclipse/emf/ecore/xmi/util/*;?**/*]
#ADAPTER#ACCESS#com.ibm.wala.shrike/bin/[+com/ibm/wala/shrike/bench/*;+com/ibm/wala/shrike/copywriter/*;+com/ibm/wala/shrike/tools/*;+com/ibm/wala/shrikeBT/*;+com/ibm/wala/shrikeBT/analysis/*;+com/ibm/wala/shrikeBT/info/*;+com/ibm/wala/shrikeBT/shrikeCT/*;+com/ibm/wala/shrikeBT/shrikeCT/tools/*;+com/ibm/wala/shrikeBT/tools/*;+com/ibm/wala/shrikeCT/*;?**/*]
#ADAPTER#ACCESS#com.ibm.wala.shrike/@dot[+com/ibm/wala/shrike/bench/*;+com/ibm/wala/shrike/copywriter/*;+com/ibm/wala/shrike/tools/*;+com/ibm/wala/shrikeBT/*;+com/ibm/wala/shrikeBT/analysis/*;+com/ibm/wala/shrikeBT/info/*;+com/ibm/wala/shrikeBT/shrikeCT/*;+com/ibm/wala/shrikeBT/shrikeCT/tools/*;+com/ibm/wala/shrikeBT/tools/*;+com/ibm/wala/shrikeCT/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.jface_3.2.0.I20060605-1400.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.swt_3.2.0.v3232o.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.swt.win32.win32.x86_3.2.0.v3232m.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.commands_3.2.0.I20060605-1400.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.jdt.core_3.2.0.v_671.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.text_3.2.0.v20060605-1400.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/com.ibm.icu_3.4.4.1.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.team.core_3.2.0.I200606051140.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.jem_1.2.0.v20060530_RC2.jar[~org/eclipse/jem/internal/core/*;+org/eclipse/jem/internal/instantiation/*;+org/eclipse/jem/internal/instantiation/base/*;+org/eclipse/jem/internal/instantiation/impl/*;~org/eclipse/jem/internal/java/adapters/*;~org/eclipse/jem/internal/java/adapters/jdk/*;~org/eclipse/jem/internal/java/adapters/nls/*;+org/eclipse/jem/internal/java/beaninfo/*;~org/eclipse/jem/internal/java/init/*;+org/eclipse/jem/internal/java/instantiation/*;+org/eclipse/jem/java/*;+org/eclipse/jem/java/adapters/*;+org/eclipse/jem/java/impl/*;~org/eclipse/jem/java/internal/impl/*;+org/eclipse/jem/java/util/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.jem.proxy_1.2.0.v20060530_RC2.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.jdt.launching_3.2.0.v20060605.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.debug.core_3.2.0.v20060605.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.jdt.debug_3.2.0.v20060605/jdi.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.jdt.debug_3.2.0.v20060605/jdimodel.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.jdt.debug_3.2.0.v20060605/tools.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.jem.util_1.2.0.v20060530_RC2.jar[~org/eclipse/jem/internal/util/emf/workbench/*;~org/eclipse/jem/internal/util/emf/workbench/nature/*;~org/eclipse/jem/internal/util/emf/workbench/nls/*;+org/eclipse/jem/util/*;+org/eclipse/jem/util/emf/workbench/*;+org/eclipse/jem/util/emf/workbench/nature/*;+org/eclipse/jem/util/logger/*;+org/eclipse/jem/util/logger/proxy/*;+org/eclipse/jem/util/logger/proxyrender/*;+org/eclipse/jem/util/plugin/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.pde.core_3.2.0.v20060605.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.core.filebuffers_3.2.0.v20060605-1400.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.pde.build_3.2.0.v20060603/pdebuild.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.update.core_3.2.0.v20060605.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.update.core.win32_3.2.0.v20060605.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.ui_3.2.0.I20060605-1400.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.ui.workbench_3.2.0.I20060605-1400.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.ui.workbench.compatibility_3.2.0.I20060605-1400/@dot[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.ui.workbench.compatibility_3.2.0.I20060605-1400/compatibility.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.help_3.2.0.v20060602.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.jst.j2ee.core_1.1.0.v200606130315.jar[+org/eclipse/jst/j2ee/application/*;~org/eclipse/jst/j2ee/application/internal/impl/*;~org/eclipse/jst/j2ee/application/internal/util/*;+org/eclipse/jst/j2ee/client/*;~org/eclipse/jst/j2ee/client/internal/impl/*;~org/eclipse/jst/j2ee/client/internal/util/*;+org/eclipse/jst/j2ee/common/*;~org/eclipse/jst/j2ee/common/internal/impl/*;~org/eclipse/jst/j2ee/common/internal/util/*;~org/eclipse/jst/j2ee/commonarchivecore/internal/*;~org/eclipse/jst/j2ee/commonarchivecore/internal/exception/*;~org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/*;~org/eclipse/jst/j2ee/commonarchivecore/internal/impl/*;~org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/*;~org/eclipse/jst/j2ee/commonarchivecore/internal/util/*;~org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/*;~org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/*;~org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/util/*;+org/eclipse/jst/j2ee/core/internal/bindings/*;~org/eclipse/jst/j2ee/core/internal/plugin/*;+org/eclipse/jst/j2ee/ejb/*;~org/eclipse/jst/j2ee/ejb/internal/impl/*;~org/eclipse/jst/j2ee/ejb/internal/util/*;~org/eclipse/jst/j2ee/internal/*;~org/eclipse/jst/j2ee/internal/common/*;~org/eclipse/jst/j2ee/internal/model/translator/application/*;~org/eclipse/jst/j2ee/internal/model/translator/client/*;~org/eclipse/jst/j2ee/internal/model/translator/common/*;~org/eclipse/jst/j2ee/internal/model/translator/connector/*;~org/eclipse/jst/j2ee/internal/model/translator/ejb/*;~org/eclipse/jst/j2ee/internal/model/translator/webapplication/*;~org/eclipse/jst/j2ee/internal/model/translator/webservices/*;~org/eclipse/jst/j2ee/internal/xml/*;+org/eclipse/jst/j2ee/jca/*;~org/eclipse/jst/j2ee/jca/internal/impl/*;~org/eclipse/jst/j2ee/jca/internal/util/*;+org/eclipse/jst/j2ee/jsp/*;~org/eclipse/jst/j2ee/jsp/internal/impl/*;~org/eclipse/jst/j2ee/jsp/internal/util/*;~org/eclipse/jst/j2ee/model/internal/validation/*;~org/eclipse/jst/j2ee/taglib/internal/*;~org/eclipse/jst/j2ee/taglib/internal/impl/*;~org/eclipse/jst/j2ee/taglib/internal/util/*;+org/eclipse/jst/j2ee/webapplication/*;~org/eclipse/jst/j2ee/webapplication/internal/impl/*;~org/eclipse/jst/j2ee/webapplication/internal/util/*;~org/eclipse/jst/j2ee/webservice/internal/*;~org/eclipse/jst/j2ee/webservice/internal/util/*;~org/eclipse/jst/j2ee/webservice/internal/wsdd/*;+org/eclipse/jst/j2ee/webservice/jaxrpcmap/*;~org/eclipse/jst/j2ee/webservice/jaxrpcmap/internal/impl/*;~org/eclipse/jst/j2ee/webservice/jaxrpcmap/internal/util/*;+org/eclipse/jst/j2ee/webservice/wsclient/*;~org/eclipse/jst/j2ee/webservice/wsclient/internal/impl/*;~org/eclipse/jst/j2ee/webservice/wsclient/internal/util/*;+org/eclipse/jst/j2ee/webservice/wscommon/*;~org/eclipse/jst/j2ee/webservice/wscommon/internal/impl/*;~org/eclipse/jst/j2ee/webservice/wscommon/internal/util/*;+org/eclipse/jst/j2ee/webservice/wsdd/*;~org/eclipse/jst/j2ee/webservice/wsdd/internal/impl/*;~org/eclipse/jst/j2ee/webservice/wsdd/internal/util/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.wst.common.frameworks_1.1.0.v200606130645.jar[+org/eclipse/wst/common/frameworks/datamodel/*;+org/eclipse/wst/common/frameworks/datamodel/properties/*;~org/eclipse/wst/common/frameworks/internal/*;~org/eclipse/wst/common/frameworks/internal/activities/*;~org/eclipse/wst/common/frameworks/internal/datamodel/*;~org/eclipse/wst/common/frameworks/internal/enablement/*;~org/eclipse/wst/common/frameworks/internal/enablement/nonui/*;~org/eclipse/wst/common/frameworks/internal/operations/*;~org/eclipse/wst/common/frameworks/internal/plugin/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.wst.common.environment_1.0.100.v200606130645.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.osgi.util_3.1.100.v20060601.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.wst.common.emf_1.1.0.v200606130645.jar[~org/eclipse/wst/common/internal/emf/plugin/*;~org/eclipse/wst/common/internal/emf/resource/*;~org/eclipse/wst/common/internal/emf/utilities/*;?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.wst.validation_1.1.0.v200606130645.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.wst.common.project.facet.core_1.1.0.v200606130645.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.wst.xml.core_1.1.0.v200606142000.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.wst.common.uriresolver_1.1.0.v200606130645.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.wst.sse.core_1.1.0.v200606141450.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.emf.ecore.edit_2.2.0.v200606271057.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.emf.edit_2.2.0.v200606271057.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.emf.ecore.change_2.2.0.v200606271057.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.wst.common.emfworkbench.integration_1.1.0.v200606130645.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.xsd_2.2.0.v200606271057.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.wst.common.core_1.1.0.v200606130645.jar[?**/*]
#ADAPTER#ACCESS#eclipse/plugins/org.eclipse.jem.workbench_1.2.0.v20060530_RC2.jar[~org/eclipse/jem/internal/adapters/jdom/*;~org/eclipse/jem/internal/plugin/*;+org/eclipse/jem/workbench/utility/*;?**/*]

View File

@ -1,2 +0,0 @@
pluginName = Wala Framework - J2EE Library
providerName = WALA

View File

@ -1,150 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
import org.eclipse.jst.j2ee.ejb.MethodElement;
import org.eclipse.jst.j2ee.ejb.MethodElementKind;
import org.eclipse.jst.j2ee.ejb.TransactionAttributeType;
import com.ibm.wala.types.MemberReference;
import com.ibm.wala.util.debug.Assertions;
/**
* Represents a declarative transaction attribute, either from a deployment descriptor or synthetic
*/
public abstract class AbstractDeclaredTransaction implements Comparable<IDeclaredTransaction>, IDeclaredTransaction {
/**
* The governing entity bean.
*/
private final EnterpriseBean bean;
/**
* A constant from MethodElementKind
*/
private int kind;
/**
* A constant from TransactionAttributeType
*/
private int transactionType;
public AbstractDeclaredTransaction(EnterpriseBean B, int kind, int transactionType) {
this.bean = B;
this.kind = kind;
this.transactionType = transactionType;
}
public String toString() {
StringBuffer result = new StringBuffer(bean.getName() + ":" + kindString() + getMethodReference());
result.append("\n ");
result.append(transactionTypeString());
result.append("\n ");
return result.toString();
}
private String transactionTypeString() {
switch (transactionType) {
case TransactionAttributeType.MANDATORY:
return "MANDATORY";
case TransactionAttributeType.NEVER:
return "NEVER ";
case TransactionAttributeType.NOT_SUPPORTED:
return "NOT SUPPORTED ";
case TransactionAttributeType.REQUIRED:
return "REQUIRED ";
case TransactionAttributeType.REQUIRES_NEW:
return "REQUIRES NEW ";
case TransactionAttributeType.SUPPORTS:
return "SUPPORTS ";
default:
Assertions.UNREACHABLE();
return null;
}
}
private String kindString() {
switch (kind) {
case MethodElementKind.HOME:
return "Home Interface: ";
case MethodElementKind.REMOTE:
return "Remote Interface: ";
case MethodElementKind.LOCAL:
return "Local Interface: ";
case MethodElementKind.LOCAL_HOME:
return "LocalHome Interface: ";
case MethodElementKind.UNSPECIFIED:
return "Unspecified Interface: ";
default:
Assertions.UNREACHABLE();
return null;
}
}
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (this.getClass() != obj.getClass())
return false;
AbstractDeclaredTransaction other = (AbstractDeclaredTransaction) obj;
return (bean.equals(other.bean) && getMethodReference().equals(other.getMethodReference()) && kind == other.kind);
}
public int hashCode() {
return bean.hashCode() * 93 + kind * 5 + getMethodReference().hashCode();
}
public int compareTo(IDeclaredTransaction o) {
assert this.getClass().equals(o.getClass());
String A = bean.toString() + kindString() + getMethodReference().toString();
AbstractDeclaredTransaction other = (AbstractDeclaredTransaction) o;
String B = other.bean.toString() + other.kindString() + other.getMethodReference().toString();
return A.compareTo(B);
}
/**
* TODO: cache this?
*/
public abstract MemberReference getMethodReference();
public boolean isRequired() {
return transactionType == TransactionAttributeType.REQUIRED;
}
public boolean isRequiresNew() {
return transactionType == TransactionAttributeType.REQUIRES_NEW;
}
public boolean isNotSupported() {
return transactionType == TransactionAttributeType.NOT_SUPPORTED;
}
public boolean isNever() {
return transactionType == TransactionAttributeType.NEVER;
}
public boolean isMandatory() {
return transactionType == TransactionAttributeType.MANDATORY;
}
public boolean isSupports() {
return transactionType == TransactionAttributeType.SUPPORTS;
}
public EnterpriseBean getBean() {
return bean;
}
public abstract MethodElement getMethodElement();
}

View File

@ -1,159 +0,0 @@
/*******************************************************************************
* Copyright (c) 2008 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.util.Collection;
import java.util.Collections;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IField;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.classLoader.Language;
import com.ibm.wala.classLoader.SyntheticClass;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.ipa.summaries.BypassMethodTargetSelector;
import com.ibm.wala.ipa.summaries.MethodSummary;
import com.ibm.wala.ipa.summaries.SummarizedMethod;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.Descriptor;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.Selector;
import com.ibm.wala.types.TypeName;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.strings.Atom;
/**
* Method representing a factory that creates ActionForm objects. We extend {@link SummarizedMethod} to allow for re-use of the
* machinery in FactoryBypassInterpreter.
*/
public class ActionFormFactoryMethod extends SummarizedMethod {
public static final Atom name = Atom.findOrCreateUnicodeAtom("makeActionForm");
public static final Descriptor descr = Descriptor.findOrCreateUTF8("()" + StrutsEntrypoints.actionFormName + ";");
public static final TypeReference factoryClassRef = TypeReference.findOrCreate(ClassLoaderReference.Primordial, TypeName
.string2TypeName("Lcom/ibm/wala/FakeActionFormFactoryClass"));
public static final MethodReference ref = MethodReference.findOrCreate(factoryClassRef, name, descr);
public ActionFormFactoryMethod(IClassHierarchy cha) {
super(ref, makeNoOpFactorySummary(), new FakeActionFormFactoryClass(cha));
}
private static MethodSummary makeNoOpFactorySummary() {
MethodSummary noOpSummary = BypassMethodTargetSelector.generateStandardNoOp(Language.JAVA, ref, true);
noOpSummary.setFactory(true);
return noOpSummary;
}
private static class FakeActionFormFactoryClass extends SyntheticClass {
public FakeActionFormFactoryClass(IClassHierarchy cha) {
super(factoryClassRef, cha);
}
public Collection<IField> getAllFields() {
return Collections.emptySet();
}
public Collection<IClass> getAllImplementedInterfaces() {
return Collections.emptySet();
}
public Collection<IField> getAllInstanceFields() {
return Collections.emptySet();
}
public Collection<IMethod> getAllMethods() {
// TODO Auto-generated method stub
assert false;
return null;
}
public Collection<IField> getAllStaticFields() {
return Collections.emptySet();
}
public IMethod getClassInitializer() {
return null;
}
public Collection<IField> getDeclaredInstanceFields() {
return Collections.emptySet();
}
public Collection<IMethod> getDeclaredMethods() {
// TODO Auto-generated method stub
assert false;
return null;
}
public Collection<IField> getDeclaredStaticFields() {
return Collections.emptySet();
}
public Collection<IClass> getDirectInterfaces() {
return Collections.emptySet();
}
public IField getField(Atom name) {
assert false;
return null;
}
public IMethod getMethod(Selector selector) {
assert false;
return null;
}
public int getModifiers() {
assert false;
return 0;
}
public TypeName getName() {
return factoryClassRef.getName();
}
public IClass getSuperclass() {
return null;
}
public boolean isPublic() {
assert false;
return false;
}
public boolean isPrivate() {
// TODO Auto-generated method stub
assert false;
return false;
}
public boolean isReferenceType() {
assert false;
return false;
}
@Override
public int hashCode() {
return super.hashCode(); // like a singleton
}
@Override
public boolean equals(Object o) {
return super.equals(o);
}
}
}

View File

@ -1,146 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.util.HashMap;
import java.util.Iterator;
import org.eclipse.jst.j2ee.client.ApplicationClient;
import org.eclipse.jst.j2ee.commonarchivecore.internal.ApplicationClientFile;
import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.classLoader.Module;
import com.ibm.wala.classLoader.ModuleEntry;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.callgraph.Entrypoint;
import com.ibm.wala.ipa.callgraph.impl.DefaultEntrypoint;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.j2ee.util.TopLevelArchiveModule;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.Descriptor;
import com.ibm.wala.types.MemberReference;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeName;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.strings.Atom;
import com.ibm.wala.util.warnings.Warnings;
/**
* Representation of entrypoints gleaned from the descriptor for an {@link ApplicationClient} module.
*/
public class AppClientEntrypoints implements Iterable<Entrypoint> {
static final boolean DEBUG = false;
/**
* Map: MethodReference -> Entrypoint
*/
private HashMap<MethodReference, Entrypoint> entrypoints = HashMapFactory.make();
/**
* Governing class hierarchy
*/
private final IClassHierarchy cha;
/**
* Governing analysis scope
*/
private final AnalysisScope scope;
/**
* @param scope scope of analysis
* @param cha loaded class hierarchy
* @throws IllegalArgumentException if scope is null
*/
public AppClientEntrypoints(J2EEAnalysisScope scope, IClassHierarchy cha) {
if (scope == null) {
throw new IllegalArgumentException("scope is null");
}
this.cha = cha;
this.scope = scope;
ClassLoaderReference loader = scope.getApplicationLoader();
for (Iterator<Module> it = scope.getModules(loader).iterator(); it.hasNext();) {
Module M = (Module) it.next();
if (M instanceof TopLevelArchiveModule) {
addEntrypointsRecursive((TopLevelArchiveModule) M, loader);
}
}
}
/**
* Recursively traverse a module and add entrypoints from ApplicationClient archives
*
* @param T a WCCM archive
* @param loader governing class loader
*/
private void addEntrypointsRecursive(TopLevelArchiveModule T, ClassLoaderReference loader) {
if (T.getType() == TopLevelArchiveModule.APPLICATION_CLIENT_FILE) {
addEntrypoints((ApplicationClientFile) T.materializeArchive());
} else {
for (Iterator<ModuleEntry> it = T.getEntries(); it.hasNext();) {
ModuleEntry E = (ModuleEntry) it.next();
if (E.isModuleFile()) {
Module M = E.asModule();
if (M instanceof TopLevelArchiveModule) {
addEntrypointsRecursive((TopLevelArchiveModule) M, loader);
}
}
}
}
}
private void addEntrypoints(ApplicationClientFile file) {
ArchiveManifest manifest = file.getManifest();
String mainClass = manifest.getMainClass();
if (DEBUG) {
System.err.println(("AppClientEntrypoints: add for file " + file));
}
if (mainClass == null) {
if (DEBUG) {
System.err.println("AppClientEntrypoints:WARNING: mainClass is null");
}
return;
}
final Atom mainMethod = Atom.findOrCreateAsciiAtom("main");
TypeName mainName = TypeName.string2TypeName("L" + mainClass.replace('.', '/'));
final TypeReference T = TypeReference.findOrCreate(scope.getApplicationLoader(), mainName);
final MethodReference Main = MethodReference.findOrCreate(T, mainMethod, Descriptor.findOrCreateUTF8("([Ljava/lang/String;)V"));
if (DEBUG) {
System.err.println(("AppClientEntrypoints: create entrypoint " + Main));
}
IClass klass = cha.lookupClass(T);
if (klass == null) {
Warnings.add(LoadFailure.create(T));
return;
}
IMethod m = cha.resolveMethod(klass, Main.getSelector());
if (m == null) {
Warnings.add(LoadFailure.create(Main));
return;
}
entrypoints.put(Main, new DefaultEntrypoint(m, cha));
}
public Iterator<Entrypoint> iterator() {
return entrypoints.values().iterator();
}
/**
* @return true iff m is an entrypoint recorded by this class
*/
public boolean contains(MemberReference m) {
return entrypoints.keySet().contains(m);
}
}

View File

@ -1,158 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
import org.eclipse.jst.j2ee.ejb.CMRField;
import org.eclipse.jst.j2ee.ejb.EJBJar;
import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
import com.ibm.wala.types.FieldReference;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeReference;
/**
* Deployment descriptor data for a single EJB.
*
* TODO: this currently can represent either a session or entity bean. Introduce classes to distinguish between them.
*/
public interface BeanMetaData {
/**
* Return a Set of {@link FieldReference}, one corresponding to each CMP field in this bean.
*/
Collection<FieldReference> getCMPFields();
/**
* Return a Set of container managed relationship (cmr) fields, as FieldReference objects.
*/
Set<Object> getCMRFields();
/**
* Return a Map of the container created getter methods, as MethodReference objects, and the field that the method references.
*
* @return Map of container created getter methods and field reference.
*/
Map<Object, FieldReference> getGetterMethods();
/**
* Return a Map of the container created setter methods, as MethodReference objects, and the field that the method references.
*
* @return Map of container created setter methods and field reference.
*/
Map<Object, FieldReference> getSetterMethods();
/**
* Return a Map of container created getter methods for CMRs, as a mapping from MethodReference->FieldReference. The container is
* responsible for creating a getter method for each container managed relationship.
*/
Map<MethodReference, FieldReference> getCMRGetters();
/**
* Return a Map of container created setter methods for CMRs, as a mapping from MethodReference->FieldReference. The container is
* responsible for creating a setter method for each container managed relationship.
*/
Map<MethodReference, FieldReference> getCMRSetters();
/**
* Return the type of the EJB class for this entity bean
*/
TypeReference getEJBClass();
/**
* Return true if the bean is container managed.
*
* @return true if bean is container managed.
*/
boolean isContainerManaged();
/**
* Return true if the bean is a container managed entity.
*
* @return true if bean is a container managed entity.
*/
boolean isContainerManagedEntity();
/**
* Return true if the bean uses BMP
*
* @return true if bean uses BMP
*/
boolean isBeanManaged();
/**
* Return true if the bean is a session bean.
*
* @return true if bean is a session bean.
*/
boolean isSessionBean();
/**
* Return true if the bean is a message-driven
*
* @return true if bean is a message-driven
*/
boolean isMessageDrivenBean();
/**
* Return the Set of container created finder methods, as Method reference objects.
*
* @return Set of container created setter methods.
*/
public Set<MethodReference> getFinders();
/**
* Method getField.
*
* @param firstField
* @return FieldReference
*/
FieldReference getField(CMRField firstField);
/**
* @return WCCM representation of this bean.
*/
public EnterpriseBean getBean();
/**
* @return WCCM representation of this bean's container
*/
EJBJar getEJBJar();
/**
* @return TypeReference representing this entity's home interface
*/
TypeReference getHomeInterface();
/**
* @return TypeReference representing this entity's local home interface
*/
TypeReference getLocalHomeInterface();
/**
* @return TypeReference representing this entity's remote interface
*/
TypeReference getRemoteInterface();
/**
* @return TypeReference representing this entity's local interface
*/
TypeReference getLocalInterface();
/**
* @return TypeReference representing this entity's primary key type.
*/
TypeReference getPrimaryKeyType();
}

View File

@ -1,517 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.jem.java.JavaClass;
import org.eclipse.jem.java.Method;
import org.eclipse.jst.j2ee.ejb.CMPAttribute;
import org.eclipse.jst.j2ee.ejb.CMRField;
import org.eclipse.jst.j2ee.ejb.ContainerManagedEntity;
import org.eclipse.jst.j2ee.ejb.EJBJar;
import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
import org.eclipse.jst.j2ee.ejb.Entity;
import org.eclipse.jst.j2ee.ejb.Session;
import org.eclipse.jst.j2ee.ejb.TransactionType;
import com.ibm.wala.types.Descriptor;
import com.ibm.wala.types.FieldReference;
import com.ibm.wala.types.MemberReference;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeName;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.collections.HashSetFactory;
import com.ibm.wala.util.strings.Atom;
import com.ibm.wala.util.strings.StringStuff;
/**
* Simple implementation of the {@link BeanMetaData} interface.
*
* TODO: rework this class to have a hierarchy to distinguish between entities and other beans.
*/
public class BeanMetaDataImpl implements BeanMetaData {
/**
* Meta-data describing this enterprise bean
*/
private final EnterpriseBean bean;
/**
* Meta-data describing this enterprise bean's conatiner
*/
private final EJBJar ejbJar;
/**
* Reference to Java class information for this bean
*/
private final TypeReference klass;
/**
* Reference to home interface type
*/
private TypeReference homeInterface;
/**
* Reference to local home interface type
*/
private TypeReference localHomeInterface;
/**
* Reference to remote interface type
*/
private TypeReference remoteInterface;
/**
* Reference to local interface type
*/
private TypeReference localInterface;
/**
* Mapping from field name (Atom) to FieldReference for all CMP fields in this bean.
*/
private Map<Object, FieldReference> cmpFields;
BeanMetaDataImpl(EnterpriseBean b, EJBJar ejbJar, TypeReference cl) {
this.bean = b;
this.klass = cl;
this.ejbJar = ejbJar;
computeEJBInterfaces();
computeCMPFields();
}
/**
* initialized the cached references to EJB interfaces for this bean.
*/
private void computeEJBInterfaces() {
String homeName = bean.getHomeInterfaceName();
if (homeName != null) {
homeInterface = J2EEUtil.getTypeForInterface(klass.getClassLoader(), homeName);
}
String localHomeName = bean.getLocalHomeInterfaceName();
if (localHomeName != null) {
localHomeInterface = J2EEUtil.getTypeForInterface(klass.getClassLoader(), localHomeName);
}
String remoteName = bean.getRemoteInterfaceName();
if (remoteName != null) {
remoteInterface = J2EEUtil.getTypeForInterface(klass.getClassLoader(), remoteName);
}
String localName = bean.getLocalInterfaceName();
if (localName != null) {
localInterface = J2EEUtil.getTypeForInterface(klass.getClassLoader(), localName);
}
}
/**
* compute a Set of FieldReferences, one corresponding to each CMP field in this bean.
*/
private void computeCMPFields() {
cmpFields = Collections.emptyMap();
if (bean instanceof ContainerManagedEntity) {
ContainerManagedEntity cme = (ContainerManagedEntity) bean;
cmpFields = HashMapFactory.make(3);
addCMPAttributes(cme);
}
}
@SuppressWarnings("unchecked")
private void addCMPAttributes(ContainerManagedEntity cme) {
List CMPFields = cme.getPersistentAttributes();
for (Iterator<CMPAttribute> it = CMPFields.iterator(); it.hasNext();) {
CMPAttribute att = (CMPAttribute) it.next();
if (att.getType() == null) {
System.err.println("PANIC: null type in attribute: " + att);
continue;
}
FieldReference f = createFieldReference(att);
cmpFields.put(f.getName(), f);
}
for (Iterator cmrField = cme.getCMRFields().iterator(); cmrField.hasNext();) {
CMRField cmr = (CMRField) cmrField.next();
if (cmr.getType() == null) {
System.err.println("PANIC: null type in attribute: " + cmr);
continue;
}
FieldReference f = createFieldReference(cmr);
cmpFields.put(f.getName(), f);
}
}
/**
* Return a Set of FieldReferences, one corresponding to each CMP field in this bean.
*/
public Collection<FieldReference> getCMPFields() {
return cmpFields.values();
}
/**
* Return a Set of the bean's container managed relationship fields, as FieldReference objects.
*
* @return the bean's CMRs.
*/
@SuppressWarnings("unchecked")
public Set<Object> getCMRFields() {
Set<Object> result = Collections.emptySet();
if (bean instanceof ContainerManagedEntity) {
ContainerManagedEntity entity = (ContainerManagedEntity) bean;
result = HashSetFactory.make(3);
for (Iterator<CMRField> cmrField = entity.getCMRFields().iterator(); cmrField.hasNext();) {
CMRField cmr = (CMRField) cmrField.next();
if (cmr.getType() == null) {
System.err.println("PANIC: null attribute type for " + cmr);
continue;
}
FieldReference f = createFieldReference(cmr);
result.add(f);
}
}
return result;
}
/**
* Return the Set of container created getter methods, as MethodReference objects. The container is responsible for creating a
* getter method for each container managed field and relationship.
*
* @see com.ibm.wala.j2ee.BeanMetaData#getGetterMethods()
* @return Set of container created getter methods.
*/
@SuppressWarnings("unchecked")
public Map<Object, FieldReference> getGetterMethods() {
Map<Object, FieldReference> result = Collections.emptyMap();
if (bean instanceof ContainerManagedEntity) {
ContainerManagedEntity cme = (ContainerManagedEntity) bean;
result = HashMapFactory.make(3);
for (Iterator cmpFields = cme.getPersistentAttributes().iterator(); cmpFields.hasNext();) {
CMPAttribute attr = (CMPAttribute) cmpFields.next();
if (attr.getType() == null) {
System.err.println("PANIC: null type in attribute: " + attr);
continue;
}
MemberReference m = createGetterReference(attr, attr.getGetterName());
FieldReference f = createFieldReference(attr);
result.put(m, f);
}
for (Iterator cmrFields = cme.getCMRFields().iterator(); cmrFields.hasNext();) {
CMPAttribute attr = (CMPAttribute) cmrFields.next();
if (attr.getType() == null) {
System.err.println("PANIC: null type in attribute: " + attr);
continue;
}
MemberReference m = createGetterReference(attr, attr.getGetterName());
FieldReference f = createFieldReference(attr);
result.put(m, f);
}
}
return result;
}
/**
* Return the Set of container created getter methods for CMRs, as a mapping from MethodReference->FieldReference. The container
* is responsible for creating a getter method for each container managed relationship.
*/
@SuppressWarnings("unchecked")
public Map<MethodReference, FieldReference> getCMRGetters() {
Map<MethodReference, FieldReference> result = Collections.emptyMap();
if (bean instanceof ContainerManagedEntity) {
ContainerManagedEntity cme = (ContainerManagedEntity) bean;
result = HashMapFactory.make(3);
for (Iterator cmrFields = cme.getCMRFields().iterator(); cmrFields.hasNext();) {
CMPAttribute attr = (CMPAttribute) cmrFields.next();
if (attr.getType() == null) {
System.err.println("PANIC: null type in attribute: " + attr);
continue;
}
MethodReference m = createGetterReference(attr, attr.getGetterName());
FieldReference f = createFieldReference(attr);
result.put(m, f);
}
}
return result;
}
/**
* Return the Set of container created setter methods, as Method reference objects. The container is responsible for creating a
* setter method for each container managed field or relationship.
*
* @see com.ibm.wala.j2ee.BeanMetaData#getSetterMethods()
* @return Set of container created setter methods.
*/
@SuppressWarnings("unchecked")
public Map<Object, FieldReference> getSetterMethods() {
Map<Object, FieldReference> result = Collections.emptyMap();
if (bean instanceof ContainerManagedEntity) {
ContainerManagedEntity cme = (ContainerManagedEntity) bean;
result = HashMapFactory.make(3);
for (Iterator cmpFields = cme.getPersistentAttributes().iterator(); cmpFields.hasNext();) {
CMPAttribute attr = (CMPAttribute) cmpFields.next();
if (attr.getType() == null) {
System.err.println("PANIC: null type in attribute: " + attr);
continue;
}
MemberReference m = createSetterReference(attr, attr.getSetterName());
FieldReference f = createFieldReference(attr);
result.put(m, f);
}
for (Iterator cmrFields = cme.getCMRFields().iterator(); cmrFields.hasNext();) {
CMPAttribute attr = (CMPAttribute) cmrFields.next();
if (attr.getType() == null) {
System.err.println("PANIC: null type in attribute: " + attr);
continue;
}
MemberReference m = createSetterReference(attr, attr.getSetterName());
FieldReference f = createFieldReference(attr);
result.put(m, f);
}
}
return result;
}
/**
* Return the Set of container created setter methods for CMRs, as a mapping from MethodReference->FieldReference. The container
* is responsible for creating a setter method for each container managed relationship.
*/
@SuppressWarnings("unchecked")
public Map<MethodReference, FieldReference> getCMRSetters() {
Map<MethodReference, FieldReference> result = Collections.emptyMap();
if (bean instanceof ContainerManagedEntity) {
ContainerManagedEntity cme = (ContainerManagedEntity) bean;
result = HashMapFactory.make(3);
for (Iterator cmrFields = cme.getCMRFields().iterator(); cmrFields.hasNext();) {
CMPAttribute attr = (CMPAttribute) cmrFields.next();
if (attr.getType() == null) {
System.err.println("PANIC: null type in attribute: " + attr);
continue;
}
MethodReference m = createSetterReference(attr, attr.getSetterName());
FieldReference f = createFieldReference(attr);
result.put(m, f);
}
}
return result;
}
/**
* Return the Set of container created finder methods, as Method reference objects.
*/
public Set<MethodReference> getFinders() {
HashSet<MethodReference> result = HashSetFactory.make(5);
Method[] methods = bean.getLocalHomeMethodsForDeployment();
extractFinders(result, methods);
methods = bean.getHomeMethodsForDeployment();
extractFinders(result, methods);
return result;
}
private void extractFinders(HashSet<MethodReference> result, Method[] methods) {
for (int i = 0; i < methods.length; i++) {
Method method = methods[i];
if (isFinder(method)) {
MethodReference ref = createMethodReference(method);
result.add(ref);
}
}
}
private static boolean isFinder(Method method) {
return method.getName().indexOf("find") == 0;
}
/**
* Create a field reference from a container managed field attribute.
*
* @param att the container managed field attribute
*/
private FieldReference createFieldReference(CMPAttribute att) {
assert att != null : "null attribute";
assert att.getType() != null : "null attribute type";
Atom name = Atom.findOrCreateUnicodeAtom(att.getName());
String dString = att.getType().getJavaName();
dString = StringStuff.deployment2CanonicalTypeString(dString);
TypeReference fieldType = TypeReference.findOrCreate(klass.getClassLoader(), TypeName.string2TypeName(dString));
FieldReference f = FieldReference.findOrCreate(klass, name, fieldType);
return f;
}
/**
* Create a method reference from a finder
*
* @param method etools method representation
* @return MethodReference that represents the method.
*/
private MethodReference createMethodReference(Method method) {
return J2EEUtil.createMethodReference(method, klass.getClassLoader());
}
/**
* Create a method reference from a container managed field attribute.
*
* @param attr the container managed field attribute
* @param methodName the name of the method
* @return MethodReference that represents the method.
*/
private MethodReference createGetterReference(CMPAttribute attr, String methodName) {
String ret = StringStuff.deployment2CanonicalDescriptorTypeString(attr.getType().getJavaName());
Descriptor D = Descriptor.findOrCreateUTF8("()" + ret);
Atom name = Atom.findOrCreateUnicodeAtom(methodName);
MethodReference m = MethodReference.findOrCreate(klass, name, D);
return m;
}
/**
* Create a method reference from a container managed field attribute.
*
* @param attr the container managed field attribute
* @param methodName the name of the method
* @return MethodReference that represents the method.
*/
private MethodReference createSetterReference(CMPAttribute attr, String methodName) {
String arg = StringStuff.deployment2CanonicalDescriptorTypeString(attr.getType().getJavaName());
Atom name = Atom.findOrCreateUnicodeAtom(methodName);
Descriptor D = Descriptor.findOrCreateUTF8("(" + arg + ")V");
MethodReference m = MethodReference.findOrCreate(klass, name, D);
return m;
}
/*
* @see com.ibm.wala.j2ee.BeanMetaData#getEJBClass()
*/
public TypeReference getEJBClass() {
return klass;
}
/*
* @see com.ibm.wala.j2ee.BeanMetaData#isContainerManaged()
*/
public boolean isContainerManaged() {
if (bean.isContainerManagedEntity())
return true;
else if (bean.isSession()) {
Session s = (Session) bean;
if (s.getTransactionType() != null) {
TransactionType t = s.getTransactionType();
if (t.getValue() == TransactionType.CONTAINER) {
return true;
}
}
}
return false;
}
/*
* @see com.ibm.wala.j2ee.BeanMetaData#isContainerManaged()
*/
public boolean isContainerManagedEntity() {
return bean.isContainerManagedEntity();
}
/*
* @see com.ibm.wala.j2ee.BeanMetaData#isSessionBean()
*/
public boolean isSessionBean() {
return bean.isSession();
}
/*
* @see com.ibm.wala.j2ee.BeanMetaData#isMessageDrivenBean()
*/
public boolean isMessageDrivenBean() {
return bean.isMessageDriven();
}
/**
* @see com.ibm.wala.j2ee.BeanMetaData#getField(CMRField)
*/
public FieldReference getField(CMRField field) {
Atom name = Atom.findOrCreateUnicodeAtom(field.getName());
return cmpFields.get(name);
}
/**
* @see java.lang.Object#toString()
*/
public String toString() {
return klass.toString();
}
/**
* @return wccm model of this bean
*/
public EnterpriseBean getBean() {
return bean;
}
/*
* @see com.ibm.wala.j2ee.BeanMetaData#getHomeInterface()
*/
public TypeReference getHomeInterface() {
return homeInterface;
}
/*
* @see com.ibm.wala.j2ee.BeanMetaData#getLocalHomeInterface()
*/
public TypeReference getLocalHomeInterface() {
return localHomeInterface;
}
/*
* @see com.ibm.wala.j2ee.BeanMetaData#getRemoteInterface()
*/
public TypeReference getRemoteInterface() {
return remoteInterface;
}
/*
* @see com.ibm.wala.j2ee.BeanMetaData#getLocalInterface()
*/
public TypeReference getLocalInterface() {
return localInterface;
}
public TypeReference getPrimaryKeyType() {
if (bean instanceof Entity) {
JavaClass keyKlass = ((Entity) bean).getPrimaryKey();
String name = keyKlass.getQualifiedNameForReflection();
return J2EEUtil.getTypeForInterface(klass.getClassLoader(), name);
} else {
return null;
}
}
/*
* @see com.ibm.wala.j2ee.BeanMetaData#isBeanManaged()
*/
public boolean isBeanManaged() {
return bean.isBeanManagedEntity();
}
/*
* @see com.ibm.wala.j2ee.BeanMetaData#getEJBJar()
*/
public EJBJar getEJBJar() {
return ejbJar;
}
public int hashCode() {
return bean.hashCode() * 941;
}
}

View File

@ -1,327 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.ibm.wala.analysis.reflection.JavaTypeContext;
import com.ibm.wala.analysis.typeInference.ConeType;
import com.ibm.wala.analysis.typeInference.PointType;
import com.ibm.wala.analysis.typeInference.TypeAbstraction;
import com.ibm.wala.cfg.ControlFlowGraph;
import com.ibm.wala.cfg.InducedCFG;
import com.ibm.wala.classLoader.CallSiteReference;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.classLoader.Language;
import com.ibm.wala.classLoader.NewSiteReference;
import com.ibm.wala.classLoader.SyntheticMethod;
import com.ibm.wala.ipa.callgraph.CGNode;
import com.ibm.wala.ipa.callgraph.Context;
import com.ibm.wala.ipa.callgraph.ContextKey;
import com.ibm.wala.ipa.callgraph.impl.Everywhere;
import com.ibm.wala.ipa.callgraph.propagation.SSAContextInterpreter;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.ipa.summaries.SyntheticIR;
import com.ibm.wala.shrikeBT.IInvokeInstruction;
import com.ibm.wala.ssa.DefUse;
import com.ibm.wala.ssa.IR;
import com.ibm.wala.ssa.ISSABasicBlock;
import com.ibm.wala.ssa.SSAInstruction;
import com.ibm.wala.ssa.SSAInstructionFactory;
import com.ibm.wala.ssa.SSAInvokeInstruction;
import com.ibm.wala.ssa.SSAOptions;
import com.ibm.wala.types.Descriptor;
import com.ibm.wala.types.FieldReference;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.collections.EmptyIterator;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.debug.Assertions;
import com.ibm.wala.util.strings.Atom;
import com.ibm.wala.util.warnings.Warning;
import com.ibm.wala.util.warnings.Warnings;
/**
* Logic to interpret dynacache commands in context
*/
public class CommandInterpreter implements SSAContextInterpreter {
private static final boolean DEBUG = false;
private static final Atom PerformExecuteAtom = Atom.findOrCreateAsciiAtom("performExecute");
private final static Descriptor PerformExecuteDesc = Descriptor.findOrCreateUTF8("()V");
/**
* A cache of synthetic method implementations, indexed by Context
*/
private final Map<Context, SpecializedExecuteMethod> syntheticMethodCache = HashMapFactory.make();
/**
* Governing class hierarchy
*/
private final IClassHierarchy cha;
/**
* @param cha governing class hierarchy
* @param warnings object to track analysis warnings
*/
public CommandInterpreter(IClassHierarchy cha) {
this.cha = cha;
}
/*
* @see com.ibm.wala.ipa.callgraph.propagation.cfa.CFAContextInterpreter#getIR(com.ibm.wala.classLoader.IMethod,
* com.ibm.wala.ipa.callgraph.Context, com.ibm.wala.util.warnings.WarningSet)
*/
public IR getIR(CGNode node) {
SpecializedExecuteMethod m = findOrCreateSpecializedMethod(node);
return m.getIR();
}
public int getNumberOfStatements(CGNode node) {
SpecializedExecuteMethod m = findOrCreateSpecializedMethod(node);
return m.calls.size();
}
public boolean understands(CGNode node) {
if (!(node.getContext() instanceof JavaTypeContext)) {
return false;
}
return node.getMethod().getReference().equals(J2EEContextSelector.ExecuteMethod);
}
public Iterator<NewSiteReference> iterateNewSites(CGNode node) {
return EmptyIterator.instance();
}
/**
* Evaluate a new-instance method in a given Context
*/
public Iterator<SSAInstruction> getInvokeStatements(CGNode node) {
SpecializedExecuteMethod m = findOrCreateSpecializedMethod(node);
return m.getInvokeStatements().iterator();
}
public Iterator<CallSiteReference> iterateCallSites(CGNode node) {
final Iterator<SSAInstruction> I = getInvokeStatements(node);
return new Iterator<CallSiteReference>() {
public boolean hasNext() {
return I.hasNext();
}
public CallSiteReference next() {
SSAInvokeInstruction s = (SSAInvokeInstruction) I.next();
return s.getCallSite();
}
public void remove() {
Assertions.UNREACHABLE();
}
};
}
protected class SpecializedExecuteMethod extends SyntheticMethod {
/**
* List of synthetic invoke instructions we model for this specialized instance.
*/
private ArrayList<SSAInstruction> calls = new ArrayList<SSAInstruction>();
int nextLocal = 2;
private SpecializedExecuteMethod(IMethod execute, final TypeAbstraction T) {
super(execute, execute.getDeclaringClass(), false, false);
if (T instanceof PointType) {
addStatementsForConcreteType(T.getType().getReference());
} else if (T instanceof ConeType) {
if (((ConeType) T).isInterface()) {
Set<IClass> implementors = cha.getImplementors(T.getType().getReference());
if (implementors.isEmpty()) {
if (DEBUG) {
System.err.println(("Found no implementors of type " + T));
}
Warnings.add(NoSubtypesWarning.create(T));
}
addStatementsForSetOfTypes(implementors.iterator());
} else {
Collection<IClass> subclasses = cha.computeSubClasses(T.getType().getReference());
if (subclasses.isEmpty()) {
if (DEBUG) {
System.err.println(("Found no subclasses of type " + T));
}
Warnings.add(NoSubtypesWarning.create(T));
}
addStatementsForSetOfTypes(subclasses.iterator());
}
} else {
Assertions.UNREACHABLE("Unexpected type " + T.getClass());
}
}
/**
* Set up a method summary which allocates and returns an instance of concrete type T.
*/
private void addStatementsForConcreteType(final TypeReference T) {
if (DEBUG) {
System.err.println(("addStatementsForConcreteType: " + T));
}
SSAInstructionFactory insts = Language.JAVA.instructionFactory();
MethodReference performExecute = MethodReference.findOrCreate(T, PerformExecuteAtom, PerformExecuteDesc);
CallSiteReference site = CallSiteReference.make(calls.size(), performExecute, IInvokeInstruction.Dispatch.VIRTUAL);
int[] params = new int[1];
// value number 1 is the receiver.
params[0] = 1;
int exc = nextLocal++;
SSAInvokeInstruction s = insts.InvokeInstruction(params, exc, site);
calls.add(s);
}
private void addStatementsForSetOfTypes(Iterator<IClass> it) {
for (; it.hasNext();) {
IClass klass = (IClass) it.next();
TypeReference T = klass.getReference();
addStatementsForConcreteType(T);
}
}
/**
* @return List of InvokeInstruction
*/
public List<SSAInstruction> getInvokeStatements() {
return calls;
}
/**
* Two specialized methods can be different, even if they represent the same source method. So, revert to object identity for
* testing equality. TODO: this is non-optimal; could try to re-use specialized methods that have the same context.
*
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object obj) {
return this == obj;
}
/**
* Two specialized methods can be different, even if they represent the same source method. So, revert to object identity for
* testing equality. TODO: this is non-optimal; could try to re-use specialized methods that have the same context.
*/
public int hashCode() {
// TODO: change this to avoid non-determinism!
return System.identityHashCode(this);
}
public String toString() {
return super.toString();
}
/*
* @see com.ibm.wala.classLoader.IMethod#getStatements(com.ibm.wala.util.warnings.WarningSet)
*/
public SSAInstruction[] getStatements() {
SSAInstruction[] result = new SSAInstruction[calls.size()];
int i = 0;
for (Iterator<SSAInstruction> it = calls.iterator(); it.hasNext();) {
result[i++] = it.next();
}
return result;
}
public IR getIR() {
SSAInstruction[] instrs = getStatements();
return new SyntheticIR(this, Everywhere.EVERYWHERE, new InducedCFG(instrs, this, Everywhere.EVERYWHERE), instrs, SSAOptions
.defaultOptions(), null);
}
}
public Iterator<FieldReference> iterateFieldsRead(CGNode node) {
return EmptyIterator.instance();
}
public Iterator<FieldReference> iterateFieldsWritten(CGNode node) {
return EmptyIterator.instance();
}
/**
* @return a synthetic method representing the node
*/
private SpecializedExecuteMethod findOrCreateSpecializedMethod(CGNode node) {
if (!(node.getContext() instanceof JavaTypeContext))
assert false : "unexpected context: " + node;
SpecializedExecuteMethod m = syntheticMethodCache.get(node.getContext());
if (m == null) {
TypeAbstraction T = (TypeAbstraction) ((JavaTypeContext) node.getContext()).get(ContextKey.RECEIVER);
m = new SpecializedExecuteMethod(node.getMethod(), T);
syntheticMethodCache.put(node.getContext(), m);
}
return m;
}
public Set<Object> getCaughtExceptions(CGNode node) {
return Collections.emptySet();
}
public boolean hasObjectArrayLoad(CGNode node) {
return false;
}
public boolean hasObjectArrayStore(CGNode node) {
return false;
}
public Iterator<IClass> iterateCastTypes(CGNode node) {
return EmptyIterator.instance();
}
public boolean recordFactoryType(CGNode node, IClass klass) {
// this class does not observe factories
return false;
}
public ControlFlowGraph<SSAInstruction, ISSABasicBlock> getCFG(CGNode N) {
return getIR(N).getControlFlowGraph();
}
/**
* A warning when we fail to find subtypes for a command method
*/
private static class NoSubtypesWarning extends Warning {
final TypeAbstraction T;
NoSubtypesWarning(TypeAbstraction T) {
super(Warning.SEVERE);
this.T = T;
}
public String getMsg() {
return getClass().toString() + " : " + T;
}
public static NoSubtypesWarning create(TypeAbstraction T) {
return new NoSubtypesWarning(T);
}
}
public DefUse getDU(CGNode node) {
return new DefUse(getIR(node));
}
}

View File

@ -1,63 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import org.eclipse.jem.java.Method;
import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
import org.eclipse.jst.j2ee.ejb.MethodElement;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.MethodReference;
/**
* Represents a declarative transaction attribute in a deployment descriptor
*/
public class DeploymentDeclaredTransaction extends AbstractDeclaredTransaction {
/**
* The method whose call is declared to be a transaction
*/
private final Method method;
/**
* The MethodElement that gave birth to this transaction declaration
*/
private final MethodElement methodElement;
/**
* Reference to the governing class loader.
*/
private final ClassLoaderReference loader;
/**
* @param method
*/
public DeploymentDeclaredTransaction(EnterpriseBean B, Method method, MethodElement methodElement, ClassLoaderReference loader,
int kind, int transactionType) {
super(B, kind, transactionType);
this.method = method;
this.methodElement = methodElement;
this.loader = loader;
}
/**
* TODO: cache this?
*/
public MethodReference getMethodReference() {
return J2EEUtil.createMethodReference(method, loader);
}
public MethodElement getMethodElement() {
return methodElement;
}
}

View File

@ -1,161 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.eclipse.jst.j2ee.ejb.EJBRelationshipRole;
import com.ibm.wala.types.FieldReference;
import com.ibm.wala.types.MemberReference;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeReference;
/**
* Interface to data from deployment descriptors.
*/
public interface DeploymentMetaData {
/**
* Return the BeanMetaData describing a particular bean, or null if the type does not correspond to an EJB.
*/
BeanMetaData getBeanMetaData(TypeReference type);
Set<FieldReference> getAllCMPFields();
/**
* Return a Set of the container managed relationship (cmr) fields.
*
* @return Set of container managed relationship fields.
*/
Set<Object> getAllCMRFields();
/**
* Is a class an EJB remote interface?
*/
boolean isRemoteInterface(TypeReference t);
/**
* Is a class an EJB home interface?
*/
boolean isHomeInterface(TypeReference t);
/**
* Is a class an EJB local interface?
*/
boolean isLocalInterface(TypeReference t);
/**
* Is a class an EJB local home interface?
*/
boolean isLocalHomeInterface(TypeReference t);
/**
* Is a class an EJB interface (any flavor)?
*/
boolean isEJBInterface(TypeReference t);
/**
* Is type an MDB?
*/
boolean isMessageDriven(TypeReference type);
/**
* Return the entity bean implementation corresponding to the interface t
*
* @param t the home or remote interface for a bean
* @return the BeanMetaData, or null if not found.
*/
BeanMetaData getBeanForInterface(TypeReference t);
/**
* Return true if the class is container managed.
*
* @return true if the class is container managed.
*/
boolean isContainerManaged(TypeReference t);
TypeReference getCMPType(TypeReference typeReference);
boolean isCMPGetter(MemberReference mr);
FieldReference getCMPField(MemberReference mr);
boolean isCMPSetter(MemberReference mr);
/**
* Return the Set of MethodReferences corresponding to EJB finder methods.
*/
Collection<MethodReference> getAllFinders();
/**
* Return the Set of methods corresponding to EJB CMR getter methods, as a mapping from MethodReference -> FieldReference
*/
Map<MethodReference, FieldReference> getAllCMRGetters();
/**
* Given a field that is populated by a CMR, return the descriptor of the Bean type that the field will point to.
*/
BeanMetaData getCMRBean(FieldReference field);
/**
* @param method a finder
* @return the type representing the bean that is returned by this finder
*/
TypeReference getFinderBeanType(MemberReference method);
/**
* @return true iff ref is finder method
*/
boolean isFinder(MemberReference ref);
/**
* @return Iterator<BeanMetaData> of all entity beans available
*/
Iterator<BeanMetaData> iterateEntities();
/**
* @return Iterator<BeanMetaData> of all session beans available
*/
Iterator<BeanMetaData> iterateSessions();
/**
* @return Iterator<BeanMetaData> of all message-driven beans available
*/
Iterator<BeanMetaData> iterateMDBs();
/**
* @return true iff method is a getter for a CMR.
*/
boolean isCMRGetter(MemberReference method);
/**
* @return true iff method is a setter for a CMR.
*/
boolean isCMRSetter(MemberReference method);
/**
* @param field a field that represents a CMR
* @return the corresponding field on the opposite role of the CMR
*/
FieldReference getOppositeField(FieldReference field);
/**
* @param field a field that represents a CMR
* @return the governing EJBRelationshipRole
*/
EJBRelationshipRole getCMRRole(FieldReference field);
}

View File

@ -1,525 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile;
import org.eclipse.jst.j2ee.ejb.CMRField;
import org.eclipse.jst.j2ee.ejb.EJBJar;
import org.eclipse.jst.j2ee.ejb.EJBRelation;
import org.eclipse.jst.j2ee.ejb.EJBRelationshipRole;
import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
import com.ibm.wala.classLoader.Module;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.FieldReference;
import com.ibm.wala.types.MemberReference;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.collections.HashSetFactory;
import com.ibm.wala.util.debug.Assertions;
/**
* A simple implementation of the {@link DeploymentMetaData} interface
*/
public class DeploymentMetaDataImpl implements DeploymentMetaData {
static final boolean DEBUG = false;
/**
* A mapping from type reference for a bean to the BeanMetaData object that describes the bean.
*/
private HashMap<TypeReference, BeanMetaData> entities = HashMapFactory.make();
/**
* A mapping from type reference for a bean to the BeanMetaData object that describes the bean.
*/
private HashMap<TypeReference, BeanMetaData> sessions = HashMapFactory.make();
/**
* A mapping from type reference for a bean to the BeanMetaData object that describes the bean.
*/
private HashMap<TypeReference, BeanMetaData> MDBs = HashMapFactory.make();
/**
* A mapping from type reference for a bean to the BeanMetaData object that describes the bean.
*/
private HashMap<TypeReference, BeanMetaDataImpl> allBeans = HashMapFactory.make();
/**
* A mapping from type reference for a remote interface to the bean that implements it.
*/
private HashMap<TypeReference, BeanMetaData> remote2Bean = HashMapFactory.make();
/**
* A mapping from type reference for a home interface to the bean that implements it.
*/
private HashMap<TypeReference, BeanMetaData> home2Bean = HashMapFactory.make();
/**
* A mapping from type reference for a local interface to the bean that implements it.
*/
private HashMap<TypeReference, BeanMetaData> local2Bean = HashMapFactory.make();
/**
* A mapping from type reference for a local home interface to the bean that implements it.
*/
private HashMap<TypeReference, BeanMetaData> localHome2Bean = HashMapFactory.make();
/**
* All container-generated getters and setters; a mapping from MethodReference -> FieldReference
*/
private HashMap<Object, FieldReference> getters = HashMapFactory.make();
private HashMap<Object, FieldReference> setters = HashMapFactory.make();
/**
* All finder methods; a mapping from MethodReference -> Bean
*/
private HashMap<MethodReference, BeanMetaData> finder2Bean = HashMapFactory.make();
/**
* All CMR Getters as a mapping from MethodReference to FieldReference
*/
private HashMap<MethodReference, FieldReference> cmrGetters = HashMapFactory.make();
/**
* All CMR Setters as a mapping from MethodReference to FieldReference
*/
private HashMap<MethodReference, FieldReference> cmrSetters = HashMapFactory.make();
/**
* For CMR fields, a mapping from FieldReference -> BeanMetaData
*/
private HashMap<FieldReference, BeanMetaData> cmrField2Bean = HashMapFactory.make();
/**
* For CMR fields, a mapping from FieldReference -> EJBRelationshipRole
*/
private HashMap<FieldReference, EJBRelationshipRole> cmrField2Role = HashMapFactory.make();
/**
* A mapping between opposite fields in CMRs
*/
private HashMap<FieldReference, FieldReference> oppositeFields = HashMapFactory.make();
/**
* @param scope the analysis scope which defines the EJB jar files to analyze
*/
@SuppressWarnings( { "unchecked" })
public DeploymentMetaDataImpl(AnalysisScope scope) {
ClassLoaderReference loader = scope.getApplicationLoader();
for (Iterator<Module> i = scope.getModules(loader).iterator(); i.hasNext();) {
Module module = (Module) i.next();
// get the file as an EJB Jar archive
Archive archive = J2EEUtil.getArchive(module);
if (archive != null) {
if (archive.isEJBJarFile()) {
processEJBJarFile(loader, (EJBJarFile) archive);
} else if (archive.isEARFile()) {
for (Iterator<EJBJarFile> it = ((EARFile) archive).getEJBJarFiles().iterator(); it.hasNext();) {
EJBJarFile j = (EJBJarFile) it.next();
processEJBJarFile(loader, j);
}
}
}
}
}
/**
* @param loader governing class loader for the application
* @param archive WCCM object which holds the ejb jarfile
*/
@SuppressWarnings( { "unchecked" })
private void processEJBJarFile(ClassLoaderReference loader, EJBJarFile archive) {
// extract the deployment descriptor
EJBJar DD = null;
try {
DD = archive.getDeploymentDescriptor();
} catch (Throwable e) {
e.printStackTrace();
Assertions.UNREACHABLE("Failed to load deployment descriptor for " + archive);
}
// add each bean to the bean map
for (Iterator bi = DD.getEnterpriseBeans().iterator(); bi.hasNext();) {
EnterpriseBean b = (EnterpriseBean) bi.next();
TypeReference c = J2EEUtil.ejb2TypeReference(b, loader);
BeanMetaDataImpl bmd = new BeanMetaDataImpl(b, DD, c);
allBeans.put(c, bmd);
if (bmd.isContainerManaged()) {
entities.put(c, bmd);
} else if (bmd.isSessionBean()) {
sessions.put(c, bmd);
} else if (bmd.isMessageDrivenBean()) {
MDBs.put(c, bmd);
} else if (bmd.isBeanManaged()) {
entities.put(c, bmd);
} else {
Assertions.UNREACHABLE("unexpected bean type" + bmd);
}
String homeName = b.getHomeInterfaceName();
mapEJBInterface(loader, bmd, homeName, home2Bean);
String remoteName = b.getRemoteInterfaceName();
mapEJBInterface(loader, bmd, remoteName, remote2Bean);
String localName = b.getLocalInterfaceName();
mapEJBInterface(loader, bmd, localName, local2Bean);
String localHomeName = b.getLocalHomeInterfaceName();
mapEJBInterface(loader, bmd, localHomeName, localHome2Bean);
}
// cache the set of getter and setter methods
computeGettersAndSetters();
computeFinders();
computeCMRs(DD, loader);
}
/**
* @param loader the interface's defining class loader
* @param bmd data about the bean
* @param iName name of the interface
* @param iMap mapping from TypeReferece -> BeanMetaData
*/
private void mapEJBInterface(ClassLoaderReference loader, BeanMetaData bmd, String iName,
HashMap<TypeReference, BeanMetaData> iMap) {
if (iName == null)
return;
TypeReference iFace = J2EEUtil.getTypeForInterface(loader, iName);
// here's a bit of a kludge .. if there's a choice of beans for an
// interface,
// choose the last CMP implementation discovered
BeanMetaData old = iMap.get(iFace);
if (old != null) {
if (old.isContainerManaged()) {
// don't overwrite
return;
}
}
iMap.put(iFace, bmd);
}
public BeanMetaData getBeanMetaData(TypeReference type) {
return allBeans.get(type);
}
/**
* @see com.ibm.wala.j2ee.DeploymentMetaData#getAllCMPFields()
*/
public Set<FieldReference> getAllCMPFields() {
HashSet<FieldReference> result = HashSetFactory.make();
for (Iterator<Map.Entry<TypeReference, BeanMetaData>> i = entities.entrySet().iterator(); i.hasNext();) {
Map.Entry<TypeReference, BeanMetaData> entry = (Map.Entry<TypeReference, BeanMetaData>) i.next();
BeanMetaData bean = (BeanMetaData) entry.getValue();
result.addAll(bean.getCMPFields());
}
return result;
}
/**
* Return a Set of container managed relationship (cmr) fields.
*
* @see com.ibm.wala.j2ee.DeploymentMetaData#getAllCMRFields()
* @return Set of container managed relationship fields.
*/
public Set<Object> getAllCMRFields() {
HashSet<Object> result = HashSetFactory.make();
for (Iterator<Map.Entry<TypeReference, BeanMetaData>> i = entities.entrySet().iterator(); i.hasNext();) {
Map.Entry<TypeReference, BeanMetaData> entry = (Map.Entry<TypeReference, BeanMetaData>) i.next();
BeanMetaData bean = (BeanMetaData) entry.getValue();
result.addAll(bean.getCMRFields());
}
return result;
}
private void computeGettersAndSetters() {
for (Iterator<Map.Entry<TypeReference, BeanMetaData>> i = entities.entrySet().iterator(); i.hasNext();) {
Map.Entry<TypeReference, BeanMetaData> entry = (Map.Entry<TypeReference, BeanMetaData>) i.next();
BeanMetaData bean = (BeanMetaData) entry.getValue();
getters.putAll(bean.getGetterMethods());
setters.putAll(bean.getSetterMethods());
}
}
/**
* Set up the finder2Bean relation, which maps each finder method to its bean
*/
private void computeFinders() {
for (Iterator<Map.Entry<TypeReference, BeanMetaData>> i = entities.entrySet().iterator(); i.hasNext();) {
Map.Entry<TypeReference, BeanMetaData> entry = (Map.Entry<TypeReference, BeanMetaData>) i.next();
BeanMetaData bean = (BeanMetaData) entry.getValue();
for (Iterator<MethodReference> j = bean.getFinders().iterator(); j.hasNext();) {
MethodReference m = j.next();
if (DEBUG) {
System.err.println(("Found finder " + m));
}
finder2Bean.put(m, bean);
}
}
}
/**
* Set up mappings for CMRs
* <ul>
* <li>set up mapping from MethodReference -> FieldReference for CMR getters
* <li>set up mapping from FieldReference -> BeanMetaData for CMR Fields
* </ul>
*/
@SuppressWarnings("unchecked")
private void computeCMRs(EJBJar DD, ClassLoaderReference loader) {
for (Iterator<BeanMetaData> i = entities.values().iterator(); i.hasNext();) {
BeanMetaData bean = i.next();
cmrGetters.putAll(bean.getCMRGetters());
cmrSetters.putAll(bean.getCMRSetters());
}
if (DD.getEjbRelations() != null) {
for (Iterator<EJBRelation> it = DD.getEjbRelations().iterator(); it.hasNext();) {
EJBRelation relation = (EJBRelation) it.next();
EJBRelationshipRole firstRole = relation.getFirstRole();
EJBRelationshipRole secondRole = relation.getSecondRole();
CMRField firstField = firstRole.getCmrField();
FieldReference f1 = null;
FieldReference f2 = null;
if (firstField != null) {
EnterpriseBean sourceBean = firstRole.getSourceEntity();
TypeReference b = J2EEUtil.ejb2TypeReference(sourceBean, loader);
BeanMetaData sourceBeanData = entities.get(b);
f1 = sourceBeanData.getField(firstField);
EnterpriseBean otherBean = secondRole.getSourceEntity();
TypeReference o = J2EEUtil.ejb2TypeReference(otherBean, loader);
cmrField2Bean.put(f1, entities.get(o));
cmrField2Role.put(f1, firstRole);
}
CMRField secondField = secondRole.getCmrField();
if (secondField != null) {
EnterpriseBean sourceBean = secondRole.getSourceEntity();
TypeReference b = J2EEUtil.ejb2TypeReference(sourceBean, loader);
BeanMetaData sourceBeanData = entities.get(b);
f2 = sourceBeanData.getField(secondField);
EnterpriseBean otherBean = firstRole.getSourceEntity();
TypeReference o = J2EEUtil.ejb2TypeReference(otherBean, loader);
cmrField2Bean.put(f2, entities.get(o));
cmrField2Role.put(f2, secondRole);
}
if (firstField != null && secondField != null) {
oppositeFields.put(f1, f2);
oppositeFields.put(f2, f1);
}
}
}
}
/**
* @see com.ibm.wala.j2ee.DeploymentMetaData#isHomeInterface(TypeReference)
*/
public boolean isHomeInterface(TypeReference t) {
return home2Bean.keySet().contains(t);
}
/**
* @see com.ibm.wala.j2ee.DeploymentMetaData#isRemoteInterface(TypeReference)
*/
public boolean isRemoteInterface(TypeReference t) {
return remote2Bean.keySet().contains(t);
}
/**
* @see com.ibm.wala.j2ee.DeploymentMetaData#isHomeInterface(TypeReference)
*/
public boolean isLocalInterface(TypeReference t) {
return local2Bean.keySet().contains(t);
}
/**
* @see com.ibm.wala.j2ee.DeploymentMetaData#isRemoteInterface(TypeReference)
*/
public boolean isLocalHomeInterface(TypeReference t) {
return localHome2Bean.keySet().contains(t);
}
public boolean isEJBInterface(TypeReference t) {
return isHomeInterface(t) || isRemoteInterface(t) || isLocalInterface(t) || isLocalHomeInterface(t);
}
/**
* @see com.ibm.wala.j2ee.DeploymentMetaData#getBeanForInterface(TypeReference)
*/
public BeanMetaData getBeanForInterface(TypeReference t) {
BeanMetaData bmd = remote2Bean.get(t);
if (bmd == null) {
bmd = home2Bean.get(t);
}
if (bmd == null) {
bmd = local2Bean.get(t);
}
if (bmd == null) {
bmd = localHome2Bean.get(t);
}
return bmd;
}
public TypeReference getCMPType(TypeReference t) {
BeanMetaData bmd = entities.get(t);
return (bmd == null) ? null : bmd.getEJBClass();
}
/**
* @see com.ibm.wala.j2ee.DeploymentMetaData#isContainerManaged(TypeReference)
*/
public boolean isContainerManaged(TypeReference t) {
BeanMetaData bmd = allBeans.get(t);
if (bmd == null) {
return false;
}
return bmd.isContainerManaged();
}
/**
* @see com.ibm.wala.j2ee.DeploymentMetaData#getCMPField(MethodReference)
*/
public FieldReference getCMPField(MemberReference mr) {
if (getters.get(mr) != null) {
return getters.get(mr);
} else {
return setters.get(mr);
}
}
/**
* @see com.ibm.wala.j2ee.DeploymentMetaData#isCMPGetter(MethodReference)
*/
public boolean isCMPGetter(MemberReference mr) {
return getters.keySet().contains(mr);
}
/**
* @see com.ibm.wala.j2ee.DeploymentMetaData#isCMPSetter(MethodReference)
*/
public boolean isCMPSetter(MemberReference mr) {
return setters.keySet().contains(mr);
}
/**
* @see com.ibm.wala.j2ee.DeploymentMetaData#getAllFinders()
*/
public Collection<MethodReference> getAllFinders() {
return finder2Bean.keySet();
}
/**
* @see com.ibm.wala.j2ee.DeploymentMetaData#getAllCMRGetters()
*/
public Map<MethodReference, FieldReference> getAllCMRGetters() {
return cmrGetters;
}
/**
* @see com.ibm.wala.j2ee.DeploymentMetaData#getCMRBean(FieldReference)
*/
public BeanMetaData getCMRBean(FieldReference field) {
return cmrField2Bean.get(field);
}
/*
* @see com.ibm.wala.j2ee.DeploymentMetaData#getFinderBeanType(com.ibm.wala.classLoader.MethodReference)
*/
public TypeReference getFinderBeanType(MemberReference method) {
BeanMetaData bean = finder2Bean.get(method);
assert bean != null;
return bean.getEJBClass();
}
/*
* @see com.ibm.wala.j2ee.DeploymentMetaData#isFinder(com.ibm.wala.classLoader.MethodReference)
*/
public boolean isFinder(MemberReference ref) {
if (DEBUG) {
boolean result = finder2Bean.keySet().contains(ref);
System.err.println(("isFinder ? " + ref + " " + result));
}
return finder2Bean.keySet().contains(ref);
}
/*
* @see com.ibm.wala.j2ee.DeploymentMetaData#iterateEntities()
*/
public Iterator<BeanMetaData> iterateEntities() {
return entities.values().iterator();
}
/*
* @see com.ibm.wala.j2ee.DeploymentMetaData#iterateSessions()
*/
public Iterator<BeanMetaData> iterateSessions() {
return sessions.values().iterator();
}
/*
* @see com.ibm.wala.j2ee.DeploymentMetaData#iterateSessions()
*/
public Iterator<BeanMetaData> iterateMDBs() {
return MDBs.values().iterator();
}
/*
* @see com.ibm.wala.j2ee.DeploymentMetaData#isCMRGetter(com.ibm.wala.classLoader.MethodReference)
*/
public boolean isCMRGetter(MemberReference method) {
return cmrGetters.keySet().contains(method);
}
/*
* @see com.ibm.wala.j2ee.DeploymentMetaData#isCMRGetter(com.ibm.wala.classLoader.MethodReference)
*/
public boolean isCMRSetter(MemberReference method) {
return cmrSetters.keySet().contains(method);
}
/*
* @see com.ibm.wala.j2ee.DeploymentMetaData#getOppositeField(com.ibm.wala.classLoader.FieldReference)
*/
public FieldReference getOppositeField(FieldReference field) {
return oppositeFields.get(field);
}
/*
* @see com.ibm.wala.j2ee.DeploymentMetaData#getCMRRole(com.ibm.wala.classLoader.FieldReference)
*/
public EJBRelationshipRole getCMRRole(FieldReference field) {
return cmrField2Role.get(field);
}
/*
* @see com.ibm.wala.j2ee.DeploymentMetaData#isMessageDriven(com.ibm.wala.classLoader.TypeReference)
*/
public boolean isMessageDriven(TypeReference type) {
return MDBs.containsKey(type);
}
}

View File

@ -1,126 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.Descriptor;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.strings.Atom;
import com.ibm.wala.util.strings.ImmutableByteArray;
import com.ibm.wala.util.strings.UTF8Convert;
/**
* Constants defined in the EJB SPEC.
*/
public interface EJBConstants {
/*
* Some method names defined in the EJB spec
*/
public final static Atom ejbRemoveAtom = Atom.findOrCreateAsciiAtom("ejbRemove");
public final static byte[] ejbRemoveSig = UTF8Convert.toUTF8("()V");
public final static Atom ejbActivateAtom = Atom.findOrCreateAsciiAtom("ejbActivate");
public final static byte[] ejbActivateSig = UTF8Convert.toUTF8("()V");
public final static Atom ejbPassivateAtom = Atom.findOrCreateAsciiAtom("ejbPassivate");
public final static byte[] ejbPassivateSig = UTF8Convert.toUTF8("()V");
public final static Atom ejbLoadAtom = Atom.findOrCreateAsciiAtom("ejbLoad");
public final static byte[] ejbLoadSig = UTF8Convert.toUTF8("()V");
public final static Atom ejbStoreAtom = Atom.findOrCreateAsciiAtom("ejbStore");
public final static byte[] ejbStoreSig = UTF8Convert.toUTF8("()V");
public final static Atom setSessionContextAtom = Atom.findOrCreateAsciiAtom("setSessionContext");
public final static byte[] setSessionContextSig = UTF8Convert.toUTF8("(Ljavax/ejb/SessionContext;)V");
public final static Descriptor setSessionContextDescriptor = Descriptor
.findOrCreate(new ImmutableByteArray(setSessionContextSig));
public final static Atom setEntityContextAtom = Atom.findOrCreateAsciiAtom("setEntityContext");
public final static byte[] setEntityContextSig = UTF8Convert.toUTF8("(Ljavax/ejb/EntityContext;)V");
public final static Atom unsetEntityContextAtom = Atom.findOrCreateAsciiAtom("unsetEntityContext");
public final static byte[] unsetEntityContextSig = UTF8Convert.toUTF8("()V");
public final static Atom onMessageAtom = Atom.findOrCreateAsciiAtom("onMessage");
public final static byte[] onMessageBytes = UTF8Convert.toUTF8("(Ljavax/jms/Message;)V");
public final Descriptor onMessageDesc = Descriptor.findOrCreate(new ImmutableByteArray(onMessageBytes));
// some special methods defined by the contract for entity bean interfaces
public static final Atom CREATE = Atom.findOrCreateAsciiAtom("create");
public static final Atom EJB_CREATE = Atom.findOrCreateAsciiAtom("ejbCreate");
public static final Atom EJB_POST_CREATE = Atom.findOrCreateAsciiAtom("ejbPostCreate");
public static final Atom REMOVE = Atom.findOrCreateAsciiAtom("remove");
public static final Atom EJB_REMOVE = Atom.findOrCreateAsciiAtom("ejbRemove");
public static final Atom GET_PRIMARY_KEY = Atom.findOrCreateAsciiAtom("getPrimaryKey");
public static final Atom GET_EJB_META_DATA = Atom.findOrCreateAsciiAtom("getEJBMetaData");
public static final Atom GET_EJB_HOME = Atom.findOrCreateAsciiAtom("getEJBHome");
public static final Atom GET_HANDLE = Atom.findOrCreateAsciiAtom("getHandle");
public static final Atom IS_IDENTICAL = Atom.findOrCreateAsciiAtom("isIdentical");
// special-case support for some exceptions
public final static TypeReference CreateExceptionClass = TypeReference.findOrCreateClass(ClassLoaderReference.Extension,
"javax/ejb", "CreateException");
public final static TypeReference EJBExceptionClass = TypeReference.findOrCreateClass(ClassLoaderReference.Extension,
"javax/ejb", "EJBException");
public final static TypeReference FinderExceptionClass = TypeReference.findOrCreateClass(ClassLoaderReference.Extension,
"javax/ejb", "FinderException");
public final static TypeReference RemoveExceptionClass = TypeReference.findOrCreateClass(ClassLoaderReference.Extension,
"javax/ejb", "RemoveException");
public final static TypeReference RemoteExceptionClass = TypeReference.findOrCreateClass(ClassLoaderReference.Extension,
"java/rmi", "RemoteException");
public final static TypeReference ObjectNotFoundExceptionClass = TypeReference.findOrCreateClass(ClassLoaderReference.Extension,
"javax/ejb", "ObjectNotFoundException");
public final static TypeReference MessageClass = TypeReference.findOrCreateClass(ClassLoaderReference.Extension, "javax/jms",
"Message");
public final static TypeReference BytesMessageClass = TypeReference.findOrCreateClass(ClassLoaderReference.Extension,
"javax/jms", "BytesMessage");
public final static TypeReference ObjectMessageClass = TypeReference.findOrCreateClass(ClassLoaderReference.Extension,
"javax/jms", "ObjectMessage");
public final static TypeReference StreamMessageClass = TypeReference.findOrCreateClass(ClassLoaderReference.Extension,
"javax/jms", "StreamMessage");
public final static TypeReference TextMessageClass = TypeReference.findOrCreateClass(ClassLoaderReference.Extension, "javax/jms",
"TextMessage");
public final static TypeReference[] KnownMessages = new TypeReference[] { MessageClass, BytesMessageClass, ObjectMessageClass,
StreamMessageClass, TextMessageClass };
}

View File

@ -1,314 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.jem.java.Method;
import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile;
import org.eclipse.jst.j2ee.ejb.EJBJar;
import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
import org.eclipse.jst.j2ee.ejb.MessageDriven;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.classLoader.Module;
import com.ibm.wala.classLoader.NewSiteReference;
import com.ibm.wala.ipa.callgraph.Entrypoint;
import com.ibm.wala.ipa.callgraph.impl.DefaultEntrypoint;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.Descriptor;
import com.ibm.wala.types.MemberReference;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.collections.HashSetFactory;
import com.ibm.wala.util.debug.Assertions;
import com.ibm.wala.util.strings.Atom;
import com.ibm.wala.util.strings.ImmutableByteArray;
import com.ibm.wala.util.warnings.Warnings;
/**
* This class provides an enumeration of EJB methods as listed in EJB jar file deployment descriptors
*/
public class EJBEntrypoints implements Iterable<Entrypoint>, EJBConstants {
static final boolean DEBUG = false;
private final IClassHierarchy cha;
/**
* The set of Entrypoint for call graph construction.
*/
private List<Entrypoint> entrypoints = new LinkedList<Entrypoint>();
/**
* Should we include only MDB entrypoints
*/
private final boolean JUST_MDBS;
/**
* Method names in the Entity Bean interface
*/
private final static Map<Atom, ImmutableByteArray> entityBeanMethodNames = makeEntityBeanMethodMap();
private final static Map<Atom, ImmutableByteArray> makeEntityBeanMethodMap() {
HashMap<Atom, ImmutableByteArray> result = HashMapFactory.make(10);
result.put(ejbActivateAtom, new ImmutableByteArray(ejbActivateSig));
result.put(ejbLoadAtom, new ImmutableByteArray(ejbLoadSig));
result.put(ejbPassivateAtom, new ImmutableByteArray(ejbPassivateSig));
result.put(ejbRemoveAtom, new ImmutableByteArray(ejbRemoveSig));
result.put(ejbStoreAtom, new ImmutableByteArray(ejbStoreSig));
result.put(setEntityContextAtom, new ImmutableByteArray(setEntityContextSig));
result.put(unsetEntityContextAtom, new ImmutableByteArray(unsetEntityContextSig));
return result;
}
/**
* Method names in the Session Bean interface
*/
private final static Map<Atom, ImmutableByteArray> sessionBeanMethodNames = makeSessionBeanMethodMap();
private final static Map<Atom, ImmutableByteArray> makeSessionBeanMethodMap() {
HashMap<Atom, ImmutableByteArray> result = HashMapFactory.make(5);
result.put(ejbActivateAtom, new ImmutableByteArray(ejbActivateSig));
result.put(ejbPassivateAtom, new ImmutableByteArray(ejbPassivateSig));
result.put(ejbRemoveAtom, new ImmutableByteArray(ejbRemoveSig));
result.put(setSessionContextAtom, new ImmutableByteArray(setSessionContextSig));
return result;
}
/**
* Governing deployment descriptor information
*/
private DeploymentMetaData deployment;
private final J2EEClassTargetSelector classTargetSelector;
/**
* Create the set of EJB entrypoints that are defined in an analysis scope
*
* @param scope representation of the analysis scope.
*/
@SuppressWarnings( { "unchecked" })
public EJBEntrypoints(IClassHierarchy cha, J2EEAnalysisScope scope, DeploymentMetaData deployment, boolean justMDBs,
J2EEClassTargetSelector classTargetSelector) {
this.cha = cha;
this.deployment = deployment;
this.JUST_MDBS = justMDBs;
this.classTargetSelector = classTargetSelector;
ClassLoaderReference loader = scope.getApplicationLoader();
addEntrypointForSyntheticContainer();
for (Iterator<Module> i = scope.getModules(loader).iterator(); i.hasNext();) {
Module M = (Module) i.next();
// get the file as an EJB Jar archive
Archive archive = J2EEUtil.getArchive(M);
if (archive.isEJBJarFile()) {
addEntrypointsForEJBJarFile(scope, loader, archive);
} else if (archive.isEARFile()) {
EARFile ear = (EARFile) archive;
for (Iterator<EJBJarFile> it = ear.getEJBJarFiles().iterator(); it.hasNext();) {
EJBJarFile j = (EJBJarFile) it.next();
addEntrypointsForEJBJarFile(scope, loader, j);
}
}
}
}
/**
* Add an entrypoint which initializes the J2EE Container model
*/
private void addEntrypointForSyntheticContainer() {
final J2EEContainerModel klass = new J2EEContainerModel(deployment, cha);
entrypoints.add(new DefaultEntrypoint(klass.getClassInitializer().getReference(), cha) {
public TypeReference[] getParameterTypes(int i) {
if (i == 0) {
return new TypeReference[] { classTargetSelector.getAllocatedTarget(null, NewSiteReference.make(0, klass.getReference()))
.getReference() };
} else {
Assertions.UNREACHABLE();
return null;
}
}
});
}
/**
* @param scope analysis scope
* @param loader application class loader
* @param archive WCCM representation of EJB jar file.
*/
@SuppressWarnings( { "unchecked" })
private void addEntrypointsForEJBJarFile(J2EEAnalysisScope scope, ClassLoaderReference loader, Archive archive) {
// extract the deployment descriptor
EJBJar DD = ((EJBJarFile) archive).getDeploymentDescriptor();
// iterate over each bean described
for (Iterator bi = DD.getEnterpriseBeans().iterator(); bi.hasNext();) {
EnterpriseBean b = (EnterpriseBean) bi.next();
if (b.hasRemoteClient() && !JUST_MDBS) {
// add each method in the remote interface as an entrypoint
addRemoteMethods(b, b.getRemoteMethodsForDeployment(), loader);
// add each method in the home interface as an entrypoint
addHomeMethods(b, b.getHomeMethodsForDeployment(), loader);
if (scope.useEJBLifecycleEntrypoints()) {
addEJBLifecycleEntrypoints(b, loader);
}
} else if (b.isMessageDriven()) {
addMessageDestination((MessageDriven) b, loader);
}
}
// prune the set of entrypoints based on transaction declarations
pruneEntrypointsByTransactions(archive, loader);
}
private void addMessageDestination(MessageDriven b, ClassLoaderReference loader) {
TypeReference T = J2EEUtil.ejb2TypeReference(b, loader);
MethodReference e = MethodReference.findOrCreate(T, onMessageAtom, onMessageDesc);
if (DEBUG) {
System.err.println(("Add entrypoint: " + e + " from bean " + b));
}
IMethod m = cha.resolveMethod(e);
if (m == null) {
Warnings.add(LoadFailure.create(e));
return;
}
entrypoints.add(new MDBEntrypoint(m, cha, T));
}
/**
* Remove any entrypoints that are marked as MANDATORY transactions; we can't call these from the outside world without raising an
* exception.
*
* TODO: this algorithm is inefficient; but it shouldn't matter, since this is a one-time cost on a small set, I hope. If this is
* a problem, represent the entrypoints as a Map from MethodReference -> Entrypoint, to allow constant time deletions.
*/
private void pruneEntrypointsByTransactions(Archive A, ClassLoaderReference loader) {
Set<DeploymentDeclaredTransaction> S = TransactionUtil.createDeclaredTransactionEntries(A, loader);
Set<MethodReference> M = HashSetFactory.make(); // set of MethodReferences to prune.
for (Iterator<DeploymentDeclaredTransaction> it = S.iterator(); it.hasNext();) {
DeploymentDeclaredTransaction X = (DeploymentDeclaredTransaction) it.next();
if (X.isMandatory()) {
M.add(X.getMethodReference());
}
}
// walk through the list of entrypoints and delete any in set M.
Set<Entrypoint> toRemove = HashSetFactory.make();
for (Iterator<Entrypoint> it = entrypoints.iterator(); it.hasNext();) {
Entrypoint E = it.next();
MemberReference m = E.getMethod().getReference();
if (M.contains(m)) {
toRemove.add(E);
}
}
entrypoints.removeAll(toRemove);
}
private void addRemoteMethods(EnterpriseBean b, Method[] methods, ClassLoaderReference loader) {
TypeReference T = J2EEUtil.ejb2TypeReference(b, loader);
BeanMetaData bean = deployment.getBeanMetaData(T);
TypeReference remoteInterface = bean.getRemoteInterface();
addMethods(bean, remoteInterface, methods, loader);
}
private void addHomeMethods(EnterpriseBean b, Method[] methods, ClassLoaderReference loader) {
TypeReference T = J2EEUtil.ejb2TypeReference(b, loader);
BeanMetaData bean = deployment.getBeanMetaData(T);
TypeReference remoteInterface = bean.getHomeInterface();
addMethods(bean, remoteInterface, methods, loader);
}
private void addEJBLifecycleEntrypoints(EnterpriseBean b, ClassLoaderReference loader) {
TypeReference type = J2EEUtil.ejb2TypeReference(b, loader);
Iterator<Map.Entry<Atom, ImmutableByteArray>> i = b.isSession() ? sessionBeanMethodNames.entrySet().iterator()
: entityBeanMethodNames.entrySet().iterator();
while (i.hasNext()) {
Map.Entry<Atom, ImmutableByteArray> entry = i.next();
Atom name = (Atom) entry.getKey();
ImmutableByteArray sig = (ImmutableByteArray) entry.getValue();
Descriptor D = Descriptor.findOrCreate(sig);
MethodReference e = MethodReference.findOrCreate(type, name, D);
if (DEBUG) {
System.err.println(("Add entrypoint: " + e + " from bean " + b));
}
IMethod m = cha.resolveMethod(e);
if (m == null) {
Warnings.add(LoadFailure.create(m));
continue;
}
entrypoints.add(new EJBLifecycleEntrypoint(m, cha, type));
}
}
/**
* Add some EJB methods to the entrypoint set
*
* @param methods array of Method from the bean
*/
private void addMethods(final BeanMetaData bean, TypeReference interfaceType, Method[] methods, ClassLoaderReference loader) {
for (int i = 0; i < methods.length; i++) {
Method method = methods[i];
MethodReference declaredMethod = J2EEUtil.createMethodReference(method, loader);
MethodReference target = MethodReference
.findOrCreate(interfaceType, declaredMethod.getName(), declaredMethod.getDescriptor());
if (DEBUG) {
System.err.println(("Add entrypoint: " + target + " from method list"));
}
final IClass klass = cha.lookupClass(interfaceType);
if (klass == null) {
Warnings.add(LoadFailure.create(interfaceType));
continue;
}
IMethod m = cha.resolveMethod(klass, target.getSelector());
if (m == null) {
Warnings.add(LoadFailure.create(target));
continue;
}
entrypoints.add(new DefaultEntrypoint(m, cha) {
public TypeReference[] getParameterTypes(int i) {
if (i == 0) {
return new TypeReference[] { classTargetSelector.getAllocatedTarget(null,
NewSiteReference.make(0, klass.getReference())).getReference() };
} else {
return super.getParameterTypes(i);
}
}
});
}
}
public Iterator<Entrypoint> iterator() {
return entrypoints.iterator();
}
public String toString() {
String result = "";
for (Iterator<Entrypoint> i = entrypoints.iterator(); i.hasNext();) {
result += i.next() + "\n";
}
return result;
}
}

View File

@ -1,36 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.ipa.callgraph.impl.DefaultEntrypoint;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.types.TypeReference;
class EJBLifecycleEntrypoint extends DefaultEntrypoint {
private final TypeReference bean;
EJBLifecycleEntrypoint(IMethod m, IClassHierarchy cha, TypeReference bean) {
super(m, cha);
this.bean = bean;
}
public TypeReference[] getParameterTypes(int i) {
if (i == 0) {
// special logic for "this"
return new TypeReference[] {bean};
} else {
return super.getParameterTypes(i);
}
}
}

View File

@ -1,29 +0,0 @@
package com.ibm.wala.j2ee;
import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
import org.eclipse.jst.j2ee.ejb.MethodElement;
import com.ibm.wala.types.MemberReference;
/**
*/
public interface IDeclaredTransaction extends Comparable<IDeclaredTransaction> {
public abstract MemberReference getMethodReference();
public abstract boolean isRequired();
public abstract boolean isRequiresNew();
public abstract boolean isNotSupported();
public abstract boolean isNever();
public abstract boolean isMandatory();
public abstract boolean isSupports();
public abstract EnterpriseBean getBean();
public abstract MethodElement getMethodElement();
}

View File

@ -1,144 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.jar.JarFile;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import com.ibm.wala.classLoader.JarFileModule;
import com.ibm.wala.classLoader.Language;
import com.ibm.wala.classLoader.Module;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.util.config.AnalysisScopeReader;
import com.ibm.wala.util.config.FileOfClasses;
import com.ibm.wala.util.io.FileProvider;
/**
* Description of analysis for EJBs
*/
public class J2EEAnalysisScope extends AnalysisScope {
private final static String BASIC_FILE = "SyntheticContainerModel.xml";
private final static String DEFAULT_FILE = "DefaultWebsphereModules.xml";
private final static String EXCLUSIONS_FILE = "J2EEClassHierarchyExclusions.txt";
private final boolean lifecycleEntrypoints;
static {
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl());
}
/**
* @param lifecycleEntrypoints Should EJB lifecycle entrypoints be considered as call graph entrypoints?
*/
public J2EEAnalysisScope(String baseScope, ClassLoader loader, boolean lifecycleEntrypoints) throws IOException {
this(baseScope, loader, (new FileProvider()).getFile(EXCLUSIONS_FILE), lifecycleEntrypoints);
}
/**
* @param lifecycleEntrypoints Should EJB lifecycle entrypoints be considered as call graph entrypoints?
*/
public J2EEAnalysisScope(String baseScope, ClassLoader loader, File exclusionsFile, boolean lifecycleEntrypoints)
throws IOException {
super(Collections.singleton(Language.JAVA));
AnalysisScope base = AnalysisScopeReader.readJavaScope(baseScope, exclusionsFile, loader);
for (ClassLoaderReference cl : base.getLoaders()) {
for (Module m : base.getModules(cl)) {
addToScope(cl, m);
}
}
if (exclusionsFile != null) {
FileOfClasses file = FileOfClasses.createFileOfClasses(exclusionsFile);
setExclusions(file);
}
this.lifecycleEntrypoints = lifecycleEntrypoints;
}
/**
* @param lifecycleEntrypoints Should EJB lifecycle entrypoints be considered as call graph entrypoints?
*/
public static J2EEAnalysisScope makeDefault(ClassLoader loader, boolean lifecycleEntrypoints) throws IOException {
return new J2EEAnalysisScope(DEFAULT_FILE, loader, lifecycleEntrypoints);
}
public static J2EEAnalysisScope make(JarFile[] J2SELibs, JarFile[] J2EELibs, ClassLoader loader, boolean lifecycleEntrypoints)
throws IOException {
return make(J2SELibs, J2EELibs, EXCLUSIONS_FILE, loader, lifecycleEntrypoints);
}
/**
* @param lifecycleEntrypoints Should EJB lifecycle entrypoints be considered as call graph entrypoints?
*/
public static J2EEAnalysisScope make(JarFile[] J2SELibs, JarFile[] J2EELibs, String exclusionsFile, ClassLoader loader,
boolean lifecycleEntrypoints) throws IOException {
J2EEAnalysisScope scope;
scope = new J2EEAnalysisScope(BASIC_FILE, loader, new File(exclusionsFile), lifecycleEntrypoints);
for (int i = 0; i < J2SELibs.length; i++) {
JarFileModule lib = new JarFileModule(J2SELibs[i]);
scope.addToScope(scope.getPrimordialLoader(), lib);
}
for (int i = 0; i < J2EELibs.length; i++) {
JarFileModule lib = new JarFileModule(J2EELibs[i]);
scope.addToScope(scope.getExtensionLoader(), lib);
}
return scope;
}
/**
* @param lifecycleEntrypoints Should EJB lifecycle entrypoints be considered as call graph entrypoints?
*/
public static J2EEAnalysisScope make(Module[] J2SELibs, Module[] J2EELibs, String exclusionsFile, ClassLoader loader,
boolean lifecycleEntrypoints) throws IOException {
J2EEAnalysisScope scope;
if (exclusionsFile == null) {
exclusionsFile = EXCLUSIONS_FILE;
}
scope = new J2EEAnalysisScope(BASIC_FILE, loader, new File(exclusionsFile), lifecycleEntrypoints);
for (int i = 0; i < J2SELibs.length; i++) {
scope.addToScope(scope.getPrimordialLoader(), J2SELibs[i]);
}
for (int i = 0; i < J2EELibs.length; i++) {
scope.addToScope(scope.getExtensionLoader(), J2EELibs[i]);
}
return scope;
}
public boolean useEJBLifecycleEntrypoints() {
return lifecycleEntrypoints;
}
/**
* Add each Module in application loader of the passed-in scope, to the application loader of this scope.
*
* @param scope an analysis scope.
* @throws IllegalArgumentException if scope is null
*/
public void addToApplicationLoader(AnalysisScope scope) {
if (scope == null) {
throw new IllegalArgumentException("scope is null");
}
ClassLoaderReference app = scope.getApplicationLoader();
for (Module m : scope.getModules(app)) {
addToScope(getApplicationLoader(), m);
}
}
}

View File

@ -1,43 +0,0 @@
package com.ibm.wala.j2ee;
import com.ibm.wala.classLoader.JarFileEntry;
import com.ibm.wala.classLoader.JarFileModule;
import com.ibm.wala.classLoader.Module;
import com.ibm.wala.util.io.FileSuffixes;
import com.ibm.wala.util.ref.CacheReference;
public class J2EEArchiveFileEntry extends JarFileEntry {
private Object contents;
protected J2EEArchiveFileEntry(String entryName, JarFileModule jarFile) {
super(entryName, jarFile);
}
private static final String prefix = "WEB-INF/classes/";
private static final int length = prefix.length();
@Override
public String getClassName() {
String name = FileSuffixes.stripSuffix(getName());
if (FileSuffixes.isWarFile(getJarFile().getName())) {
if (name.startsWith(prefix)) {
name = name.substring(length);
}
}
return name;
}
@Override
public Module asModule() {
return new J2EENestedArchiveFileModule(this);
}
public byte[] getContents() {
byte[] b = (byte[]) CacheReference.get(contents);
if (b == null) {
b = getJarFileModule().getContents(getJarFile().getEntry(getName()));
contents = CacheReference.make(b);
}
return b;
}
}

View File

@ -1,18 +0,0 @@
package com.ibm.wala.j2ee;
import java.util.jar.JarFile;
import java.util.zip.ZipEntry;
import com.ibm.wala.classLoader.JarFileModule;
import com.ibm.wala.classLoader.ModuleEntry;
public class J2EEArchiveFileModule extends JarFileModule {
public J2EEArchiveFileModule(JarFile f) {
super(f);
}
@Override
protected ModuleEntry createEntry(ZipEntry z) {
return new J2EEArchiveFileEntry(z.getName(), this);
}
}

View File

@ -1,110 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IClassLoader;
import com.ibm.wala.classLoader.NewSiteReference;
import com.ibm.wala.ipa.callgraph.CGNode;
import com.ibm.wala.ipa.callgraph.ClassTargetSelector;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.ipa.summaries.BypassSyntheticClass;
import com.ibm.wala.ipa.summaries.BypassSyntheticClassLoader;
import com.ibm.wala.types.TypeName;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.debug.Assertions;
/**
* A class that selects concrete types for new statements.
*/
public class J2EEClassTargetSelector implements ClassTargetSelector {
private static final boolean DEBUG = false;
/**
* A delegate if the j2ee rules fail
*/
private final ClassTargetSelector parent;
/**
* Governing deployment information
*/
private final DeploymentMetaData metaData;
/**
* Governing class hierarchy
*/
private final IClassHierarchy cha;
private final BypassSyntheticClassLoader bypassLoader;
/**
* @param parent a target selector to delegate to if logic here fails
* @param metaData information about the deployment descriptor
* @param cha governing class hierarchy
* @param bypassLoader class loader to deal with J2EE bypass logic
*/
public J2EEClassTargetSelector(ClassTargetSelector parent, DeploymentMetaData metaData, IClassHierarchy cha,
IClassLoader bypassLoader) {
this.cha = cha;
this.parent = parent;
this.metaData = metaData;
this.bypassLoader = (BypassSyntheticClassLoader) bypassLoader;
assert metaData != null;
IClass x = new J2EEContainerModel(metaData, cha);
this.bypassLoader.registerClass(J2EEContainerModel.containerModelName, x);
}
public IClass getAllocatedTarget(CGNode caller, NewSiteReference site) {
TypeReference nominalRef = site.getDeclaredType();
if (DEBUG) {
System.err.println(("J2EEClassTargetSelector getAllocatedTarget: " + nominalRef));
}
if (nominalRef == null) {
assert nominalRef != null : "null declared type in site " + site;
}
IClass realType = cha.lookupClass(nominalRef);
if (realType == null) {
if (DEBUG) {
System.err.println(("cha lookup failed. Delegating to " + parent.getClass()));
}
return parent.getAllocatedTarget(caller, site);
}
TypeReference realRef = realType.getReference();
if (metaData.isContainerManaged(realRef) || metaData.isEJBInterface(realRef)) {
if (realType.isAbstract() || realType.isInterface()) {
TypeName syntheticName = BypassSyntheticClass.getName(realRef);
IClass result = bypassLoader.lookupClass(syntheticName);
if (result != null) {
return result;
} else {
IClass x = new BypassSyntheticClass(realType, bypassLoader, cha);
bypassLoader.registerClass(syntheticName, x);
return x;
}
} else {
if (realType.isInterface()) {
Assertions.UNREACHABLE("did not hijack allocation of " + realType);
}
return realType;
}
} else {
if (DEBUG) {
System.err.println(("Not bypassed. Delegating to " + parent.getClass()));
}
return parent.getAllocatedTarget(caller, site);
}
}
}

View File

@ -1,20 +0,0 @@
/*******************************************************************************
* Copyright (c) 2007 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
public interface J2EEConstants {
/**
* Name of the file which holds compiled classes used to model J2EE
*/
public static final String J2EE_MODEL_JAR = "wala.j2ee.jar.model";
}

View File

@ -1,386 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import com.ibm.wala.classLoader.CallSiteReference;
import com.ibm.wala.classLoader.FieldImpl;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IClassLoader;
import com.ibm.wala.classLoader.IField;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.classLoader.Language;
import com.ibm.wala.classLoader.NewSiteReference;
import com.ibm.wala.classLoader.SyntheticClass;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.ipa.summaries.MethodSummary;
import com.ibm.wala.ipa.summaries.SummarizedMethod;
import com.ibm.wala.shrikeBT.BytecodeConstants;
import com.ibm.wala.shrikeBT.IInvokeInstruction;
import com.ibm.wala.shrikeCT.ClassConstants;
import com.ibm.wala.ssa.SSAInstructionFactory;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.Descriptor;
import com.ibm.wala.types.FieldReference;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.Selector;
import com.ibm.wala.types.TypeName;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.collections.Iterator2Collection;
import com.ibm.wala.util.debug.Assertions;
import com.ibm.wala.util.strings.Atom;
/**
* A synthetic class that models aspects of the J2EE Container.
*/
class J2EEContainerModel extends SyntheticClass implements BytecodeConstants, EJBConstants {
private final static Atom syntheticLoaderName = Atom.findOrCreateUnicodeAtom("Synthetic");
private final static ClassLoaderReference syntheticLoaderRef = new ClassLoaderReference(syntheticLoaderName, ClassLoaderReference.Java, ClassLoaderReference.Application);
public static final TypeName containerModelName = TypeName.string2TypeName("L$ContainerModel");
public static final TypeName entityBeanName = TypeName.string2TypeName("Ljavax/ejb/EntityBean");
public static final TypeName entityContextName = TypeName.string2TypeName("Ljavax/ejb/EntityContext");
public static final TypeName sessionBeanName = TypeName.string2TypeName("Ljavax/ejb/SessionBean");
public static final TypeName sessionContextName = TypeName.string2TypeName("Ljavax/ejb/SessionContext");
public static final TypeName messageBeanName = TypeName.string2TypeName("Ljavax/ejb/MessageDrivenBean");
public static final TypeName messageContextName = TypeName.string2TypeName("Ljavax/ejb/MessageDrivenContext");
public static final TypeReference containerModelRef = TypeReference.findOrCreate(syntheticLoaderRef, containerModelName);
public static final TypeReference entityBeanRef = TypeReference.findOrCreate(ClassLoaderReference.Extension, entityBeanName);
public static final TypeReference entityContextRef = TypeReference.findOrCreate(ClassLoaderReference.Extension, entityContextName);
public static final TypeReference sessionBeanRef = TypeReference.findOrCreate(ClassLoaderReference.Extension, sessionBeanName);
public static final TypeReference sessionContextRef = TypeReference.findOrCreate(ClassLoaderReference.Extension, sessionContextName);
public static final TypeReference messageBeanRef = TypeReference.findOrCreate(ClassLoaderReference.Extension, messageBeanName);
public static final TypeReference messageContextRef = TypeReference.findOrCreate(ClassLoaderReference.Extension, messageContextName);
public static final Descriptor setEntityContextDescriptor = Descriptor.findOrCreate(new TypeName[] { entityContextName },
TypeReference.VoidName);
public static final Descriptor setSessionContextDescriptor = Descriptor.findOrCreate(new TypeName[] { sessionContextName },
TypeReference.VoidName);
public static final Descriptor setMessageContextDescriptor = Descriptor.findOrCreate(new TypeName[] { messageContextName },
TypeReference.VoidName);
public static final MethodReference setEntityContext = MethodReference.findOrCreate(entityBeanRef, Atom
.findOrCreateAsciiAtom("setEntityContext"), setEntityContextDescriptor);
public static final MethodReference setSessionContext = MethodReference.findOrCreate(sessionBeanRef, Atom
.findOrCreateAsciiAtom("setSessionContext"), setSessionContextDescriptor);
public static final MethodReference setMessageContext = MethodReference.findOrCreate(messageBeanRef, Atom
.findOrCreateAsciiAtom("setMessageDrivenContext"), setMessageContextDescriptor);
/**
* Governing deployment information
*/
private final DeploymentMetaData deployment;
/**
* Governing class hierarchy
*/
private final IClassHierarchy cha;
J2EEContainerModel(DeploymentMetaData deployment, IClassHierarchy cha) {
super(containerModelRef, cha);
this.cha = cha;
this.deployment = deployment;
initializeStaticFieldRefs();
}
public IClassLoader getClassLoader() {
return cha.getLoader(syntheticLoaderRef);
}
public IClass getSuperclass() {
return cha.lookupClass(TypeReference.JavaLangObject);
}
public Collection<IClass> getAllInterfaces() {
return Collections.emptyList();
}
public String getSourceFileName() {
return "This synthetic J2EE model class has no source source";
}
public Collection<IField> getDeclaredInstanceFields() {
return Collections.emptySet();
}
public Collection<IField> getAllInstanceFields() {
return Collections.emptySet();
}
public IMethod getMethod(Selector selector) {
if ((selector.getName() == MethodReference.clinitName) && (selector.getDescriptor().equals(MethodReference.defaultInitDesc)))
return getClassInitializer();
else
return null;
}
public Collection<IMethod> getDeclaredMethods() {
return Collections.singleton(getClassInitializer());
}
public String toString() {
return "<Synthetic J2EE Container Model>";
}
private Collection<FieldReference> staticFieldRefs = null;
private Map<Atom, IField> staticFieldMap = null;
/**
* Create a phony field name which logically holds a pointer to the one true
* instance of a given bean type
*/
public static Atom getBeanFieldName(TypeReference beanType) {
return getBeanFieldName(beanType.getName());
}
/**
* Create a phony field name which logically holds a pointer to the one true
* instance of a given bean type TODO: reconsider this atom generator ....
*/
public static Atom getBeanFieldName(TypeName beanTypeName) {
return Atom.findOrCreateUnicodeAtom("$$existing$" + beanTypeName.toString().replace('/', '$'));
}
/**
* Create a phony field reference which logically holds a pointer to the one
* true instance of a given bean type
*/
public static FieldReference getBeanFieldRef(TypeReference ejbType) {
return FieldReference.findOrCreate(containerModelRef, getBeanFieldName(ejbType), ejbType);
}
/**
* Create a phony field reference which logically holds a pointer to the one
* true instance of a given bean type
*/
public static FieldReference getBeanFieldRef(BeanMetaData bean) {
return getBeanFieldRef(bean.getEJBClass());
}
private void initializeStaticFieldRefs() {
final Iterator<BeanMetaData> entityBeans = deployment.iterateEntities();
final Iterator<BeanMetaData> sessionBeans = deployment.iterateSessions();
final Iterator<BeanMetaData> messageBeans = deployment.iterateMDBs();
Iterator<FieldReference> it = new Iterator<FieldReference>() {
public void remove() {
throw new UnsupportedOperationException();
}
public boolean hasNext() {
return entityBeans.hasNext() || sessionBeans.hasNext() || messageBeans.hasNext();
}
public FieldReference next() {
if (entityBeans.hasNext()) {
return getBeanFieldRef(entityBeans.next());
} else if (sessionBeans.hasNext()) {
return getBeanFieldRef(sessionBeans.next());
} else {
return getBeanFieldRef(messageBeans.next());
}
}
};
staticFieldRefs = Iterator2Collection.toSet(it);
initializeStaticFieldMap();
}
private void initializeStaticFieldMap() {
staticFieldMap = HashMapFactory.make();
for (Iterator<FieldReference> fs = staticFieldRefs.iterator(); fs.hasNext();) {
FieldReference f = fs.next();
staticFieldMap.put(f.getName(), new FieldImpl(this, f, ClassConstants.ACC_STATIC, null));
}
}
/*
* @see com.ibm.wala.classLoader.IClass#getDeclaredStaticFields()
*/
public Collection<IField> getDeclaredStaticFields() {
return staticFieldMap.values();
}
public IField getField(Atom name) {
if (staticFieldMap == null) {
initializeStaticFieldMap();
}
return staticFieldMap.get(name);
}
private IMethod clinitMethod = null;
/**
* Create a <clinit> method for the synthetic container class
*
* @see com.ibm.wala.classLoader.IClass#getClassInitializer()
*/
public IMethod getClassInitializer() {
if (clinitMethod == null) {
SSAInstructionFactory insts = Language.JAVA.instructionFactory();
MethodReference clinit = MethodReference.findOrCreate(containerModelRef, MethodReference.clinitName,
MethodReference.defaultInitDesc);
MethodSummary code = new MethodSummary(clinit);
code.setStatic(true);
int nextLocal = code.getNumberOfParameters() + 1;
Iterator<IField> fields = getDeclaredStaticFields().iterator();
while (fields.hasNext()) {
FieldReference field = fields.next().getReference();
TypeReference ejbType = field.getFieldType();
// 1. create bean type representing pool objects
int beanAlloc = nextLocal++;
code.addStatement(insts.NewInstruction(beanAlloc, NewSiteReference.make(code.getNextProgramCounter(), ejbType)));
// 2. call set...Context, as required by lifecycle.
int contextAlloc = nextLocal++;
int ignoredExceptions = nextLocal++;
if (deployment.getBeanMetaData(ejbType).isSessionBean()) {
code.addStatement(insts.NewInstruction(contextAlloc, NewSiteReference.make(code.getNextProgramCounter(),
sessionContextRef)));
code.addStatement(insts.InvokeInstruction(new int[] { beanAlloc, contextAlloc }, ignoredExceptions, CallSiteReference
.make(code.getNextProgramCounter(), setSessionContext, IInvokeInstruction.Dispatch.INTERFACE)));
} else if (deployment.getBeanMetaData(ejbType).isMessageDrivenBean()) {
code.addStatement(insts.NewInstruction(contextAlloc, NewSiteReference.make(code.getNextProgramCounter(),
messageContextRef)));
code.addStatement(insts.InvokeInstruction(new int[] { beanAlloc, contextAlloc }, ignoredExceptions, CallSiteReference
.make(code.getNextProgramCounter(), setMessageContext, IInvokeInstruction.Dispatch.INTERFACE)));
// message driven beans also get ejbCreate called at this point
// (or that is how I interpret the spec, such as it is)
int moreIgnoredExceptions = nextLocal++;
MethodReference ejbCreate = MethodReference.findOrCreate(ejbType, EJB_CREATE, Descriptor.findOrCreate(null,
TypeReference.VoidName));
code.addStatement(insts.InvokeInstruction(new int[] { beanAlloc }, moreIgnoredExceptions, CallSiteReference.make(code
.getNextProgramCounter(), ejbCreate, IInvokeInstruction.Dispatch.VIRTUAL)));
} else {
code.addStatement(insts.NewInstruction(contextAlloc, NewSiteReference.make(code.getNextProgramCounter(),
entityContextRef)));
code.addStatement(insts.InvokeInstruction(new int[] { beanAlloc, contextAlloc }, ignoredExceptions, CallSiteReference
.make(code.getNextProgramCounter(), setEntityContext, IInvokeInstruction.Dispatch.INTERFACE)));
}
// 3. put bean into static field representing pool.
code.addStatement(insts.PutInstruction(beanAlloc, field));
}
clinitMethod = new SummarizedMethod(clinit, code, this);
}
return clinitMethod;
}
/*
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object arg0) {
return arg0.getClass().equals(getClass());
}
/*
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
return 7;
}
/*
* @see com.ibm.wala.classLoader.IClass#getModifiers()
*/
public int getModifiers() {
// TODO Auto-generated method stub
Assertions.UNREACHABLE();
return 0;
}
/*
* @see com.ibm.wala.classLoader.IClass#getAllImplementedInterfaces()
*/
public Collection<IClass> getAllImplementedInterfaces() {
return Collections.emptySet();
}
/*
* @see com.ibm.wala.classLoader.IClass#getAllAncestorInterfaces()
*/
public Collection<IClass> getAllAncestorInterfaces() {
// TODO Auto-generated method stub
Assertions.UNREACHABLE();
return null;
}
/*
* @see com.ibm.wala.classLoader.IClass#getName()
*/
public TypeName getName() {
return getReference().getName();
}
/*
* @see com.ibm.wala.classLoader.IClass#isReferenceType()
*/
public boolean isReferenceType() {
return getReference().isReferenceType();
}
/*
* @see com.ibm.wala.classLoader.IClass#getDirectInterfaces()
*/
public Collection<IClass> getDirectInterfaces() {
// TODO Auto-generated method stub
Assertions.UNREACHABLE();
return null;
}
public Collection<IField> getAllStaticFields() {
return getDeclaredStaticFields();
}
public Collection<IField> getAllFields() {
return getDeclaredStaticFields();
}
public Collection<IMethod> getAllMethods() {
return Collections.singleton(getClassInitializer());
}
public boolean isPublic() {
return false;
}
public boolean isPrivate() {
return false;
}
}

View File

@ -1,80 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import com.ibm.wala.analysis.reflection.JavaTypeContext;
import com.ibm.wala.analysis.typeInference.TypeAbstraction;
import com.ibm.wala.classLoader.CallSiteReference;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.ipa.callgraph.CGNode;
import com.ibm.wala.ipa.callgraph.Context;
import com.ibm.wala.ipa.callgraph.ContextSelector;
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
import com.ibm.wala.j2ee.util.ReceiverTypeInference;
import com.ibm.wala.j2ee.util.ReceiverTypeInferenceCache;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.Descriptor;
import com.ibm.wala.types.MemberReference;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeName;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.intset.EmptyIntSet;
import com.ibm.wala.util.intset.IntSet;
import com.ibm.wala.util.strings.Atom;
/**
* This class provides context selection logic for special J2EE methods.
*/
public class J2EEContextSelector implements ContextSelector {
private static final TypeName CacheableCommandImpl = TypeName.string2TypeName("Lcom/ibm/websphere/command/CacheableCommandImpl");
private static final Atom ExecuteAtom = Atom.findOrCreateAsciiAtom("execute");
private final static Descriptor ExecuteDesc = Descriptor.findOrCreateUTF8("()V");
private final static TypeReference CacheableCommandImplClass = TypeReference.findOrCreate(ClassLoaderReference.Extension,
CacheableCommandImpl);
public final static MemberReference ExecuteMethod = MethodReference.findOrCreate(CacheableCommandImplClass, ExecuteAtom,
ExecuteDesc);
private final ReceiverTypeInferenceCache typeInference;
public J2EEContextSelector(ReceiverTypeInferenceCache typeInference) {
this.typeInference = typeInference;
}
/**
* Analyze each call to Command.execute() in a different context
*/
public Context getCalleeTarget(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey[] receiver) {
if (callee.getReference().equals(ExecuteMethod)) {
ReceiverTypeInference R = typeInference.findOrCreate(caller);
if (R == null) {
return null;
}
TypeAbstraction type = R.getReceiverType(site);
if (type == null) {
// Type inference failed; raise a severe warning
return null;
}
return new JavaTypeContext(type);
} else {
return null;
}
}
public IntSet getRelevantParameters(CGNode caller, CallSiteReference site) {
return EmptyIntSet.instance;
}
}

View File

@ -1,76 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.util.Iterator;
import com.ibm.wala.ipa.callgraph.Entrypoint;
import com.ibm.wala.ipa.callgraph.impl.ComposedEntrypoints;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.util.strings.Atom;
/**
* Entrypoints for an EAR file.
*/
public class J2EEEntrypoints implements Iterable<Entrypoint> {
private final static boolean USE_STRUTS_ACTIONS = true;
private Iterable<Entrypoint> entrypoints;
private final AppClientEntrypoints appClientEntrypoints;
private final StrutsEntrypoints strutsEntrypoints;
/**
* @param scope representation of the analysis scope
* @param cha governing class hierarchy
* @param useEjbEntrypoints should the analysis assume external callers on the EJB interfaces?
*/
public J2EEEntrypoints(J2EEAnalysisScope scope, DeploymentMetaData dmd, IClassHierarchy cha, boolean useEjbEntrypoints) {
ServletEntrypoints servletEntrypoints = new ServletEntrypoints(scope, cha);
J2EEClassTargetSelector classTargetSelector = new J2EEClassTargetSelector(null, dmd, cha, cha.getLoader(scope.getLoader(Atom
.findOrCreateUnicodeAtom("Synthetic"))));
EJBEntrypoints ejbEntrypoints = null;
if (useEjbEntrypoints) {
// pick up all ejb entrypoints
ejbEntrypoints = new EJBEntrypoints(cha, scope, dmd, false, classTargetSelector);
} else {
// pick up only MDB EJB entrypoints
ejbEntrypoints = new EJBEntrypoints(cha, scope, dmd, true, classTargetSelector);
}
entrypoints = new ComposedEntrypoints(servletEntrypoints, ejbEntrypoints);
appClientEntrypoints = new AppClientEntrypoints(scope, cha);
entrypoints = new ComposedEntrypoints(entrypoints, appClientEntrypoints);
if (USE_STRUTS_ACTIONS) {
strutsEntrypoints = new StrutsEntrypoints(scope, cha);
entrypoints = new ComposedEntrypoints(entrypoints, strutsEntrypoints);
} else {
strutsEntrypoints = null;
}
}
public Iterator<Entrypoint> iterator() {
return entrypoints.iterator();
}
public AppClientEntrypoints getAppClientEntrypoints() {
return appClientEntrypoints;
}
public StrutsEntrypoints getStrutsEntrypoints() {
return strutsEntrypoints;
}
}

View File

@ -1,200 +0,0 @@
package com.ibm.wala.j2ee;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.Map;
import java.util.jar.JarInputStream;
import java.util.zip.ZipEntry;
import com.ibm.wala.classLoader.Module;
import com.ibm.wala.classLoader.ModuleEntry;
import com.ibm.wala.shrikeCT.ClassReader;
import com.ibm.wala.shrikeCT.InvalidClassFileException;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.debug.Assertions;
import com.ibm.wala.util.io.FileSuffixes;
import com.ibm.wala.util.ref.CacheReference;
public class J2EENestedArchiveFileModule implements Module {
private ModuleEntry parent;
private Map<String, Object> cache = null;
protected J2EENestedArchiveFileModule(ModuleEntry parent) {
this.parent = parent;
}
private byte[] readBytes(InputStream stream) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] temp = new byte[1024];
int n = stream.read(temp);
while (n != -1) {
out.write(temp, 0, n);
n = stream.read(temp);
}
return out.toByteArray();
}
private byte[] getParentContents() throws IOException {
if (parent instanceof J2EEArchiveFileEntry) {
return ((J2EEArchiveFileEntry) parent).getContents();
} else if (parent instanceof Entry) {
return ((Entry) parent).getContents();
} else {
InputStream stream = parent.getInputStream();
try {
return readBytes(stream);
} finally {
if (stream != null) {
stream.close();
}
}
}
}
private void populateCache() {
if (cache != null) {
return;
}
try {
cache = HashMapFactory.make();
byte[] b = getParentContents();
JarInputStream stream = new JarInputStream(new ByteArrayInputStream(b));
for (ZipEntry z = stream.getNextEntry(); z != null; z = stream.getNextEntry()) {
byte[] bb = readBytes(stream);
try {
if (FileSuffixes.isClassFile(z.getName())) {
// check that we can read without an InvalidClassFileException
new ClassReader(bb);
}
cache.put(z.getName(), CacheReference.make(bb));
} catch (InvalidClassFileException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
Assertions.UNREACHABLE();
}
}
} catch(IOException e) {
e.printStackTrace();
Assertions.UNREACHABLE();
}
}
public byte[] getContents(String entry) {
byte[] bytes = (byte[]) CacheReference.get(cache.get(entry));
if (bytes != null) {
return bytes;
}
try {
byte[] parent = getParentContents();
JarInputStream stream = new JarInputStream(new ByteArrayInputStream(parent));
for (ZipEntry z = stream.getNextEntry(); z != null; z = stream.getNextEntry()) {
if (entry.equals(z.getName())) {
bytes = readBytes(stream);
try {
if (FileSuffixes.isClassFile(entry)) {
// check that we can read without an InvalidClassFileException
new ClassReader(bytes);
}
cache.put(entry, CacheReference.make(bytes));
break;
} catch (InvalidClassFileException e1) {
e1.printStackTrace();
Assertions.UNREACHABLE();
return null;
}
}
}
} catch (IOException e) {
e.printStackTrace();
Assertions.UNREACHABLE();
return null;
}
return bytes;
}
public Iterator<ModuleEntry> getEntries() {
populateCache();
final Iterator<String> it = cache.keySet().iterator();
return new Iterator<ModuleEntry>() {
public boolean hasNext() {
return it.hasNext();
}
public ModuleEntry next() {
return new Entry(it.next());
}
public void remove() {
Assertions.UNREACHABLE();
}
};
}
private static final String prefix = "WEB-INF/classes/";
private static final int length = prefix.length();
private class Entry implements ModuleEntry {
private final String name;
public Entry(String name) {
this.name = name;
}
public String getName() {
return name;
}
public boolean isClassFile() {
return FileSuffixes.isClassFile(name);
}
public boolean isSourceFile() {
return FileSuffixes.isSourceFile(name);
}
public boolean isModuleFile() {
return FileSuffixes.isJarFile(name) ||
FileSuffixes.isWarFile(name);
}
public Module asModule() {
if (isModuleFile()) {
return new J2EENestedArchiveFileModule(this);
} else {
Assertions.UNREACHABLE();
return null;
}
}
public String getClassName() {
if (isClassFile()) {
String name = FileSuffixes.stripSuffix(getName());
if (FileSuffixes.isWarFile(name)) {
if (name.startsWith(prefix)) {
name = name.substring(length);
}
}
return name;
} else {
Assertions.UNREACHABLE();
return null;
}
}
public byte[] getContents() {
return J2EENestedArchiveFileModule.this.getContents(name);
}
public InputStream getInputStream() {
return new ByteArrayInputStream(getContents());
}
}
}

View File

@ -1,230 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.jem.java.JavaParameter;
import org.eclipse.jem.java.Method;
import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory;
import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException;
import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl;
import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
import com.ibm.wala.classLoader.ClassFileModule;
import com.ibm.wala.classLoader.JarFileModule;
import com.ibm.wala.classLoader.Module;
import com.ibm.wala.ipa.callgraph.CGNode;
import com.ibm.wala.ipa.callgraph.CallGraph;
import com.ibm.wala.j2ee.util.TopLevelArchiveModule;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.Descriptor;
import com.ibm.wala.types.MemberReference;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeName;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.collections.HashSetFactory;
import com.ibm.wala.util.debug.Assertions;
import com.ibm.wala.util.strings.Atom;
import com.ibm.wala.util.strings.StringStuff;
/**
* Miscellaneous utilities for J2EE processing
*/
public class J2EEUtil {
public static final TypeReference EJB_HOME = TypeReference.findOrCreateClass(ClassLoaderReference.Extension, "javax/ejb",
"EJBHome");
public static final TypeReference EJB_LOCAL_HOME = TypeReference.findOrCreateClass(ClassLoaderReference.Extension, "javax/ejb",
"EJBLocalHome");
public static final TypeReference EJB_OBJECT = TypeReference.findOrCreateClass(ClassLoaderReference.Extension, "javax/ejb",
"EJBObject");
public static final TypeReference EJB_LOCAL_OBJECT = TypeReference.findOrCreateClass(ClassLoaderReference.Extension, "javax/ejb",
"EJBLocalObject");
/**
* Get the WCCM archive representing a particular module
*
* @param M the module to analyze
* @return Archive, or null if no WCCM conversion is possible
*/
public static Archive getArchive(Module M) {
CommonarchiveFactory factory = CommonarchiveFactoryImpl.getActiveFactory();
try {
if (M instanceof JarFileModule) {
String fileName = ((JarFileModule) M).getAbsolutePath();
return factory.openArchive(fileName);
} else if (M instanceof TopLevelArchiveModule) {
TopLevelArchiveModule AM = (TopLevelArchiveModule) M;
return AM.materializeArchive();
} else if (M instanceof ClassFileModule) {
return null;
} else {
return null;
}
} catch (OpenFailureException e) {
e.printStackTrace();
Assertions.UNREACHABLE();
return null;
}
}
/**
* Create a ClassReference to represent an EnterpriseBean
*
* @param b the bean in question
* @param loader reference to the class loader that loads the bean
*/
public static TypeReference ejb2TypeReference(EnterpriseBean b, ClassLoaderReference loader) {
String klass = b.getEjbClass().getQualifiedNameForReflection();
klass = StringStuff.deployment2CanonicalTypeString(klass);
TypeReference c = TypeReference.findOrCreate(loader, TypeName.string2TypeName(klass));
return c;
}
/**
* Create a method reference from a finder
*
* @param method etools method representation
* @return MethodReference that represents the method.
*/
public static MethodReference createMethodReference(Method method, ClassLoaderReference loader) {
String tString = method.getJavaClass().getQualifiedName();
tString = StringStuff.deployment2CanonicalTypeString(tString);
TypeReference T = TypeReference.findOrCreate(loader, TypeName.string2TypeName(tString));
String sig = J2EEUtil.buildDescriptor(method);
Descriptor D = Descriptor.findOrCreateUTF8(sig);
Atom name = Atom.findOrCreateUnicodeAtom(method.getName());
MethodReference ref = MethodReference.findOrCreate(T, name, D);
return ref;
}
/**
* @param loader a governing class loader reference
* @param iName name of an interface
* @return corresponding TypeReference
*/
public static TypeReference getTypeForInterface(ClassLoaderReference loader, String iName) {
assert iName != null;
iName = "L" + iName.replace('.', '/');
TypeReference iFace = TypeReference.findOrCreate(loader, TypeName.string2TypeName(iName));
return iFace;
}
/**
* Build up a string representing the method's signature. Returns a string describing this Method. The string is formatted as the
* method name, followed by a parenthesized, comma-separated list of the method's formal parameter types, followed by the return
* type.
*
* This implementation clone-and-owned from com.ibm.etools.java.impl.MethodImpl.getSignature()
*
* TODO: Move me elsewhere.
*
* For example:
*
* (Ljava/lang/Object;)Z
*
* @param method the Method in question
* @return String a String representation of the signature.
* @throws IllegalArgumentException if method is null
*/
@SuppressWarnings("unchecked")
public static String buildDescriptor(Method method) {
if (method == null) {
throw new IllegalArgumentException("method is null");
}
StringBuffer sb = new StringBuffer();
sb.append("(");
List params = method.getParameters();
int parmSize = params.size();
for (int j = 0; j < parmSize; j++) {
JavaParameter param = (JavaParameter) params.get(j);
if (param.isReturn())
continue; // listParameters() includes return type in array
String s = param.getJavaType().getQualifiedName();
sb.append(StringStuff.deployment2CanonicalDescriptorTypeString(s));
}
sb.append(")");
if (method.getReturnType() == null) {
// SJF: I don't understand why this should ever happen.
// TODO: look into this
// for now, just assume void
sb.append("V");
} else {
String r = method.getReturnType().getQualifiedName();
sb.append(StringStuff.deployment2CanonicalDescriptorTypeString(r));
}
return sb.toString();
}
/**
* We define the "logical entrypoints" for J2EE to be the normal call graph entrypoints; except for servlet entrypoints ... which
* are treated a little specially.
*
* @param cg governing call graph
* @return Set of nodes which should be considered "entrypoints" for this analysis.
*/
public static Set<CGNode> getLogicalEntrypointNodes(CallGraph cg) {
HashSet<CGNode> result = HashSetFactory.make();
for (Iterator<CGNode> it = cg.getEntrypointNodes().iterator(); it.hasNext();) {
CGNode n = (CGNode) it.next();
MemberReference m = n.getMethod().getReference();
TypeReference t = m.getDeclaringClass();
if (isServletFrameworkType(t)) {
Set<CGNode> set = HashSetFactory.make();
result.addAll(servletFrontier(cg, n, set));
} else {
result.add(n);
}
}
return result;
}
private static boolean isServletFrameworkType(TypeReference t) {
return t.equals(ServletEntrypoints.Servlet) || t.equals(ServletEntrypoints.HttpServlet)
|| t.equals(ServletEntrypoints.HttpJspBase);
}
/**
* @param n a call graph node declared on javax.servlet.Servlet or javax.servlet.HttpServlet
* @return the set of nodes S s.t. for m in S, m is reachable from n, m is not a method on Servlet or HttpServlet, and there is a
* predecessor p of m s.t. p is a method on Servlet or HttpServlet.
*/
public static Collection<CGNode> servletFrontier(CallGraph cg, CGNode n, Set<CGNode> seen) {
HashSet<CGNode> result = HashSetFactory.make();
seen.add(n);
for (Iterator<? extends CGNode> it = cg.getSuccNodes(n); it.hasNext();) {
CGNode m = (CGNode) it.next();
TypeReference t = m.getMethod().getDeclaringClass().getReference();
if (isServletFrameworkType(t)) {
if (!seen.contains(m))
result.addAll(servletFrontier(cg, m, seen));
} else {
result.add(m);
}
}
return result;
}
}

View File

@ -1,31 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import com.ibm.wala.util.warnings.Warning;
/**
* A warning for when we can't load some reference
*/
public class LoadFailure extends Warning {
final Object ref;
LoadFailure(Object ref) {
super(Warning.SEVERE);
this.ref = ref;
}
public String getMsg() {
return getClass().toString() + " : " + ref;
}
public static LoadFailure create(Object ref) {
return new LoadFailure(ref);
}
}

View File

@ -1,34 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.types.TypeReference;
class MDBEntrypoint extends EJBLifecycleEntrypoint {
MDBEntrypoint(IMethod m, IClassHierarchy cha, TypeReference bean) {
super(m, cha, bean);
assert m.getDescriptor().equals(EJBConstants.onMessageDesc);
}
/*
* @see com.ibm.wala.ipa.callgraph.Entrypoint#getParameterTypes(int)
*/
public TypeReference[] getParameterTypes(int i) {
if (i == 1) {
return (TypeReference[]) EJBConstants.KnownMessages.clone();
} else {
return super.getParameterTypes(i);
}
}
}

View File

@ -1,350 +0,0 @@
package com.ibm.wala.j2ee;
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IClassLoader;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.callgraph.Entrypoint;
import com.ibm.wala.ipa.callgraph.impl.DefaultEntrypoint;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.Descriptor;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeName;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.collections.HashSetFactory;
import com.ibm.wala.util.strings.Atom;
import com.ibm.wala.util.strings.ImmutableByteArray;
import com.ibm.wala.util.strings.UTF8Convert;
/**
* This class provides an iterator of entrypoints that are implementations of servlet methods.
*/
public class ServletEntrypoints implements Iterable<Entrypoint>, EJBConstants {
static final boolean DEBUG = false;
public final static Atom doFilterName = Atom.findOrCreateUnicodeAtom("doFilter");
private final static Descriptor doFilterDesc = Descriptor
.findOrCreateUTF8("(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V");
private final static Atom destroyName = Atom.findOrCreateUnicodeAtom("destroy");
private final static Descriptor destroyDesc = Descriptor.findOrCreateUTF8("()V");
private final static Atom getServletConfigName = Atom.findOrCreateUnicodeAtom("getServletConfig");
private final static Descriptor getServletConfigDesc = Descriptor.findOrCreateUTF8("()Ljavax/servlet/ServletConfig;");
private final static Atom getServletInfoName = Atom.findOrCreateUnicodeAtom("getServletInfo");
private final static Descriptor getServletInfoDesc = Descriptor.findOrCreateUTF8("()Ljava/lang/String;");
private final static Atom initName = Atom.findOrCreateUnicodeAtom("init");
private final static Descriptor initDesc = Descriptor.findOrCreateUTF8("(Ljavax/servlet/ServletConfig;)V");
public final static Atom serviceName = Atom.findOrCreateUnicodeAtom("service");
private final static byte[] serviceDescAtom = UTF8Convert
.toUTF8("(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V");
private final static Descriptor serviceDesc = Descriptor.findOrCreate(new ImmutableByteArray(serviceDescAtom));
public final static Atom finalizeName = Atom.findOrCreateUnicodeAtom("finalize");
private final static Descriptor finalizeDesc = Descriptor.findOrCreateUTF8("()V");
private final static Atom[] servletMethodNames = { destroyName, getServletConfigName, getServletInfoName, initName, serviceName,
finalizeName };
private final static Descriptor[] servletMethodDescs = { destroyDesc, getServletConfigDesc, getServletInfoDesc, initDesc,
serviceDesc, finalizeDesc };
private final static Atom[] servletFilterMethodNames = { doFilterName };
private final static Descriptor[] servletFilterMethodDescs = { doFilterDesc };
private final static TypeName servletName = TypeName.string2TypeName("Ljavax/servlet/Servlet");
public final static TypeReference Servlet = TypeReference.findOrCreate(ClassLoaderReference.Extension, servletName);
private final static TypeName servletFilterName = TypeName.string2TypeName("Ljavax/servlet/Filter");
public final static TypeReference ServletFilter = TypeReference.findOrCreate(ClassLoaderReference.Extension, servletFilterName);
private final static TypeName httpServletName = TypeName.string2TypeName("Ljavax/servlet/http/HttpServlet");
public final static TypeReference HttpServlet = TypeReference.findOrCreate(ClassLoaderReference.Extension, httpServletName);
private final static TypeName httpJspBaseName = TypeName.string2TypeName("Lcom/ibm/ws/webcontainer/jsp/runtime/HttpJspBase");
public final static TypeReference HttpJspBase = TypeReference.findOrCreate(ClassLoaderReference.Extension, httpJspBaseName);
final static TypeName servletRequest = TypeName.string2TypeName("Ljavax/servlet/ServletRequest");
public final static TypeReference ServletRequest = TypeReference.findOrCreate(ClassLoaderReference.Extension, servletRequest);
public final static TypeName servletResponse = TypeName.string2TypeName("Ljavax/servlet/ServletResponse");
public final static TypeReference ServletResponse = TypeReference.findOrCreate(ClassLoaderReference.Extension, servletResponse);
final static TypeName httpServletRequest = TypeName.string2TypeName("Ljavax/servlet/http/HttpServletRequest");
public final static TypeReference HttpServletRequest = TypeReference.findOrCreate(ClassLoaderReference.Extension, servletRequest);
public final static TypeName httpServletResponse = TypeName.string2TypeName("Ljavax/servlet/http/HttpServletResponse");
public final static TypeReference HttpServletResponse = TypeReference.findOrCreate(ClassLoaderReference.Extension,
servletResponse);
private final static TypeName servletContext = TypeName.string2TypeName("Ljavax/servlet/ServletContext");
public final static TypeReference ServletContext = TypeReference.findOrCreate(ClassLoaderReference.Extension, servletContext);
private final static TypeName servletConfig = TypeName.string2TypeName("Ljavax/servlet/ServletConfig");
public final static TypeReference ServletConfig = TypeReference.findOrCreate(ClassLoaderReference.Extension, servletConfig);
private final static TypeName walaHttpServletRequest = TypeName
.string2TypeName("Lcom/ibm/wala/model/javax/servlet/http/HttpServletRequest");
public final static TypeReference WalaHttpServletRequest = TypeReference.findOrCreate(ClassLoaderReference.Extension,
walaHttpServletRequest);
private final static TypeName walaHttpServletResponse = TypeName
.string2TypeName("Lcom/ibm/wala/model/javax/servlet/http/HttpServletResponse");
public final static TypeReference WalaHttpServletResponse = TypeReference.findOrCreate(ClassLoaderReference.Extension,
walaHttpServletResponse);
private final static TypeName walaServletContextModel = TypeName
.string2TypeName("Lcom/ibm/wala/model/javax/servlet/ServletContext");
public final static TypeReference WalaServletContextModel = TypeReference.findOrCreate(ClassLoaderReference.Extension,
walaServletContextModel);
private final static TypeName walaServletConfigModel = TypeName
.string2TypeName("Lcom/ibm/wala/model/javax/servlet/ServletConfig");
public final static TypeReference WalaServletConfigModel = TypeReference.findOrCreate(ClassLoaderReference.Extension,
walaServletConfigModel);
private final static TypeName actionServlet = TypeName.string2TypeName("Lorg/apache/struts/action/ActionServlet");
public final static MethodReference servletInit = MethodReference.findOrCreate(Servlet, initName, initDesc);
private Set<Entrypoint> entrypoints = HashSetFactory.make();
/**
* Set of servlet (or ServletFilter) implementations found.
*/
private Set<IClass> servlets = HashSetFactory.make();
/**
* Mapping of TypeName -> TypeReference; this map controls selection of concrete types for parameters to some servlet methods.
*/
private final static HashMap<TypeName, TypeReference> concreteParameterMap = HashMapFactory.make(5);
static {
concreteParameterMap.put(httpServletRequest, WalaHttpServletRequest);
concreteParameterMap.put(httpServletResponse, WalaHttpServletResponse);
concreteParameterMap.put(servletRequest, WalaHttpServletRequest);
concreteParameterMap.put(servletResponse, WalaHttpServletResponse);
concreteParameterMap.put(servletContext, WalaServletContextModel);
concreteParameterMap.put(servletConfig, WalaServletConfigModel);
}
private final AnalysisScope scope;
private final IClassHierarchy cha;
private boolean isInitialized;
/**
* @param scope scope of analysis
* @param cha loaded class hierarchy
*/
public ServletEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
this.scope = scope;
this.cha = cha;
}
private void init() {
if (isInitialized) {
return;
}
isInitialized = true;
TypeReference actionServletType = TypeReference.findOrCreate(scope.getApplicationLoader(), actionServlet);
IClass actionServletClass = cha.lookupClass(actionServletType);
IClass servlet = cha.lookupClass(Servlet);
IClass servletFilter = cha.lookupClass(ServletFilter);
assert servlet != null;
assert servletFilter != null;
for (Iterator<IClass> it = getCandidateEntryClasses(cha); it.hasNext();) {
IClass klass = (IClass) it.next();
if (klass != null) {
if (DEBUG) {
System.err.println((getClass() + " consider " + klass));
}
if (cha.lookupClass(klass.getReference()) == null) {
continue;
}
// ignore struts ActionServlets
if (cha.lookupClass(actionServletType) != null) {
if (cha.isSubclassOf(klass, actionServletClass)) {
continue;
}
}
if (cha.implementsInterface(klass, servlet)) {
servlets.add(klass);
final TypeReference type = klass.getReference();
for (int i = 0; i < servletMethodNames.length; i++) {
Atom name = servletMethodNames[i];
Descriptor desc = servletMethodDescs[i];
MethodReference M = MethodReference.findOrCreate(type, name, desc);
IMethod m = cha.resolveMethod(M);
if (cha.resolveMethod(M) != null) {
entrypoints.add(new DefaultEntrypoint(m, cha) {
/**
* Assume all ServletRequest and ServletResponse are HTTP flavor.
*/
public TypeReference[] getParameterTypes(int i) {
if (i == 0) {
// "this" pointer
return new TypeReference[] { type };
} else {
TypeReference[] tArray = super.getParameterTypes(i);
assert tArray.length == 1;
TypeReference T = tArray[0];
TypeName n = T.getName();
TypeReference Tp = getConcreteServletParameterType(n);
if (Tp != null) {
T = Tp;
}
return new TypeReference[] { T };
}
}
});
}
}
}
if (cha.implementsInterface(klass, servletFilter)) {
servlets.add(klass);
final TypeReference type = klass.getReference();
for (int i = 0; i < servletFilterMethodNames.length; i++) {
Atom name = servletFilterMethodNames[i];
Descriptor desc = servletFilterMethodDescs[i];
MethodReference M = MethodReference.findOrCreate(type, name, desc);
IMethod m = cha.resolveMethod(M);
if (cha.resolveMethod(M) != null) {
entrypoints.add(new DefaultEntrypoint(m, cha) {
/**
* Assume all ServletRequest and ServletResponse are HTTP flavor.
*/
public TypeReference[] getParameterTypes(int i) {
if (i == 0) {
// "this" pointer
return new TypeReference[] { type };
} else {
TypeReference[] tArray = super.getParameterTypes(i);
assert tArray.length == 1;
TypeReference T = tArray[0];
TypeName n = T.getName();
TypeReference Tp = concreteParameterMap.get(n);
if (Tp != null) {
T = Tp;
}
return new TypeReference[] { T };
}
}
});
}
}
}
}
}
}
/**
* return the set of classes that should be examined when searching for servlet entrypoints.
*/
protected Iterator<IClass> getCandidateEntryClasses(IClassHierarchy cha) {
IClassLoader appLoader = cha.getLoader(ClassLoaderReference.Application);
return appLoader.iterateAllClasses();
}
public Iterator<Entrypoint> iterator() {
init();
return entrypoints.iterator();
}
public String toString() {
init();
StringBuffer result = new StringBuffer();
result.append("Servlets:");
Iterator<IClass> it = servlets.iterator();
if (it.hasNext()) {
while (it.hasNext()) {
result.append("\n ");
result.append(it.next());
}
} else {
result.append(" none");
}
return result.toString();
}
/**
* return the concrete type to use for a parameter to a servlet with declared type n.
*/
public static TypeReference getConcreteServletParameterType(TypeName n) {
TypeReference Tp = concreteParameterMap.get(n);
return Tp;
}
public static boolean isStandardServlet(IClass klass) {
IClassHierarchy cha = klass.getClassHierarchy();
TypeReference actionServletType = TypeReference.findOrCreate(ClassLoaderReference.Application, actionServlet);
IClass actionServletClass = cha.lookupClass(actionServletType);
IClass servlet = cha.lookupClass(Servlet);
IClass servletFilter = cha.lookupClass(ServletFilter);
if (servlet == null) {
throw new IllegalStateException("javax.servlet.Servlet not loaded.");
}
if (servletFilter == null) {
throw new IllegalStateException("javax.servlet.ServletFilter not loaded.");
}
if (cha.implementsInterface(klass, servlet) || cha.implementsInterface(klass, servletFilter)) {
// ignore struts ActionServlets
if (actionServletClass != null) {
if (cha.isSubclassOf(klass, actionServletClass)) {
return false;
}
}
return true;
}
return false;
}
}

View File

@ -1,159 +0,0 @@
package com.ibm.wala.j2ee;
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
import java.util.Iterator;
import java.util.Set;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IClassLoader;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.ipa.callgraph.Entrypoint;
import com.ibm.wala.ipa.callgraph.impl.DefaultEntrypoint;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.Descriptor;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeName;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.collections.HashSetFactory;
import com.ibm.wala.util.strings.Atom;
/**
* This class provides an iterator of entrypoints that are implementations of Spring methods.
*/
public class SpringEntrypoints implements Iterable<Entrypoint> {
static final boolean DEBUG = false;
public final static Atom handleRequestName = Atom.findOrCreateUnicodeAtom("handleRequest");
private final static Descriptor handleRequestDesc = Descriptor
.findOrCreateUTF8("(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;");
private final static Atom[] springMethodNames = { handleRequestName };
private final static Descriptor[] springMethodDescs = { handleRequestDesc };
private final static TypeName SpringControllerName = TypeName.string2TypeName("Lorg/springframework/web/servlet/mvc/Controller");
public final static TypeReference SpringController = TypeReference.findOrCreate(ClassLoaderReference.Extension,
SpringControllerName);
private Set<Entrypoint> entrypoints = HashSetFactory.make();
/**
* Set of servlet (or ServletFilter) implementations found.
*/
private Set<IClass> springControllers = HashSetFactory.make();
private final IClassHierarchy cha;
private boolean isInitialized;
/**
* @param cha loaded class hierarchy
*/
public SpringEntrypoints(IClassHierarchy cha) {
this.cha = cha;
}
private void init() {
if (isInitialized) {
return;
}
isInitialized = true;
// TypeReference actionServletType = TypeReference.findOrCreate(scope.getApplicationLoader(), actionServlet);
// IClass actionServletClass = cha.lookupClass(actionServletType);
IClass springController = cha.lookupClass(SpringController);
if (springController == null) {
return;
}
for (Iterator<IClass> it = getCandidateEntryClasses(cha); it.hasNext();) {
IClass klass = (IClass) it.next();
if (klass != null) {
if (DEBUG) {
System.err.println((getClass() + " consider " + klass));
}
if (cha.lookupClass(klass.getReference()) == null) {
continue;
}
if (cha.implementsInterface(klass, springController)) {
springControllers.add(klass);
final TypeReference type = klass.getReference();
for (int i = 0; i < springMethodNames.length; i++) {
Atom name = springMethodNames[i];
Descriptor desc = springMethodDescs[i];
MethodReference M = MethodReference.findOrCreate(type, name, desc);
IMethod m = cha.resolveMethod(M);
if (cha.resolveMethod(M) != null) {
entrypoints.add(new DefaultEntrypoint(m, cha) {
/**
* Assume all ServletRequest and ServletResponse are HTTP flavor.
*/
public TypeReference[] getParameterTypes(int i) {
if (i == 0) {
// "this" pointer
return new TypeReference[] { type };
} else {
TypeReference[] tArray = super.getParameterTypes(i);
assert tArray.length == 1;
TypeReference T = tArray[0];
TypeName n = T.getName();
TypeReference Tp = ServletEntrypoints.getConcreteServletParameterType(n);
if (Tp != null) {
T = Tp;
}
return new TypeReference[] { T };
}
}
});
}
}
}
}
}
}
/**
* return the set of classes that should be examined when searching for servlet entrypoints.
*/
protected Iterator<IClass> getCandidateEntryClasses(IClassHierarchy cha) {
IClassLoader appLoader = cha.getLoader(ClassLoaderReference.Application);
return appLoader.iterateAllClasses();
}
public Iterator<Entrypoint> iterator() {
init();
return entrypoints.iterator();
}
public String toString() {
init();
StringBuffer result = new StringBuffer();
result.append("SpringControllers:");
Iterator<IClass> it = springControllers.iterator();
if (it.hasNext()) {
while (it.hasNext()) {
result.append("\n ");
result.append(it.next());
}
} else {
result.append(" none");
}
return result.toString();
}
}

View File

@ -1,382 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import com.ibm.wala.classLoader.CallSiteReference;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IClassLoader;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.callgraph.Entrypoint;
import com.ibm.wala.ipa.callgraph.impl.AbstractRootMethod;
import com.ibm.wala.ipa.callgraph.impl.DefaultEntrypoint;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.shrikeBT.IInvokeInstruction;
import com.ibm.wala.ssa.SSAInvokeInstruction;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.Descriptor;
import com.ibm.wala.types.MemberReference;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeName;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.collections.HashSetFactory;
import com.ibm.wala.util.strings.Atom;
/**
* This class provides an iterator of {@link Entrypoint}s that are implementations of org.apache.struts.action.Action
*/
public class StrutsEntrypoints implements Iterable<Entrypoint>, EJBConstants {
public final static Atom executeName = Atom.findOrCreateUnicodeAtom("execute");
/**
* Should we attempt to speculate that methods are dispatched to based on the method descriptor?
*/
public final static boolean SPECULATE_DISPATCH_ACTIONS = true;
private final static String executeDescString = "(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)Lorg/apache/struts/action/ActionForward;";
private final static String httpExecuteDescString = "(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/apache/struts/action/ActionForward;";
private final static Descriptor executeDesc = Descriptor.findOrCreateUTF8(executeDescString);
private final static Descriptor httpExecuteDesc = Descriptor.findOrCreateUTF8(httpExecuteDescString);
private final static Atom plugInInitName = Atom.findOrCreateUnicodeAtom("init");
private final static Atom plugInDestroyName = Atom.findOrCreateUnicodeAtom("destroy");
private final static Descriptor plugInInitDesc = Descriptor
.findOrCreateUTF8("(Lorg/apache/struts/action/ActionServlet;Lorg/apache/struts/config/ModuleConfig;)V");
private final static Descriptor plugInDestroyDesc = Descriptor.findOrCreateUTF8("()V");
private final static TypeName actionName = TypeName.string2TypeName("Lorg/apache/struts/action/Action");
public final static TypeName actionFormName = TypeName.string2TypeName("Lorg/apache/struts/action/ActionForm");
private final static TypeName plugInName = TypeName.string2TypeName("Lorg/apache/struts/action/PlugIn");
private final static TypeName requestProcessorName = TypeName.string2TypeName("Lorg/apache/struts/action/RequestProcessor");
private Map<MethodReference, Entrypoint> entrypoints = HashMapFactory.make();
/**
* Set of action implementations found.
*/
private Set<IClass> actions = HashSetFactory.make();
/**
* Set of plugin implementations found.
*/
private Set<IClass> plugins = HashSetFactory.make();
/**
* Set of request processor implementations found.
*/
private Set<IClass> requestProcessors = HashSetFactory.make();
/**
* This map controls selection of concrete types for parameters to some servlet methods.
*/
private final static HashMap<TypeName, TypeReference> concreteParameterMap = HashMapFactory.make(2);
static {
concreteParameterMap.put(ServletEntrypoints.httpServletRequest, ServletEntrypoints.WalaHttpServletRequest);
concreteParameterMap.put(ServletEntrypoints.httpServletResponse, ServletEntrypoints.WalaHttpServletResponse);
concreteParameterMap.put(ServletEntrypoints.servletRequest, ServletEntrypoints.WalaHttpServletRequest);
concreteParameterMap.put(ServletEntrypoints.servletResponse, ServletEntrypoints.WalaHttpServletResponse);
}
/**
* @param scope scope of analysis
* @param cha loaded class hierarchy
*/
public StrutsEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
TypeReference actionType = TypeReference.findOrCreate(scope.getApplicationLoader(), actionName);
IClass actionClass = cha.lookupClass(actionType);
if (actionClass == null) {
return;
}
for (Iterator<IClass> it = getCandidateEntryClasses(cha); it.hasNext();) {
IClass klass = (IClass) it.next();
if (isConcreteStrutsAction(klass)) {
actions.add(klass);
TypeReference type = klass.getReference();
MethodReference M = MethodReference.findOrCreate(type, executeName, httpExecuteDesc);
IMethod im = cha.resolveMethod(M);
if (im != null) {
entrypoints.put(M, new StrutsActionEntrypoint(klass, im, cha));
}
if (SPECULATE_DISPATCH_ACTIONS) {
addSpeculativeDispatchMethods(klass, cha);
}
}
if (isConcreteStrutsPlugIn(klass)) {
plugins.add(klass);
TypeReference type = klass.getReference();
MethodReference M = MethodReference.findOrCreate(type, plugInInitName, plugInInitDesc);
IMethod im = cha.resolveMethod(M);
if (im != null) {
entrypoints.put(M, new StrutsPlugInEntrypoint(im, cha));
}
M = MethodReference.findOrCreate(type, plugInDestroyName, plugInDestroyDesc);
im = cha.resolveMethod(M);
if (im != null) {
entrypoints.put(M, new StrutsPlugInEntrypoint(im, cha));
}
}
if (isConcreteRequestProcessor(klass)) {
requestProcessors.add(klass);
TypeReference requestProcessorType = TypeReference.findOrCreate(ClassLoaderReference.Application, requestProcessorName);
IClass requestProcessorClass = klass.getClassHierarchy().lookupClass(requestProcessorType);
for (IMethod m : klass.getDeclaredMethods()) {
// if the method overrides a method in RequestProcessor, make it an entrypoint
MethodReference mref = m.getReference();
if (cha.getPossibleTargets(requestProcessorClass, mref).contains(m)) {
// bingo
// TODO exclude <init>()?
entrypoints.put(mref, new StrutsRequestProcessorEntrypoint(klass, m, cha));
}
}
}
}
}
public static boolean isConcreteRequestProcessor(IClass klass) {
TypeReference requestProcessorType = TypeReference.findOrCreate(ClassLoaderReference.Application, requestProcessorName);
IClass requestProcessorClass = klass.getClassHierarchy().lookupClass(requestProcessorType);
if (requestProcessorClass == null) {
return false;
}
if (klass.isAbstract()) {
return false;
}
if (klass.getReference().equals(requestProcessorType)) {
return false;
}
if (klass.getClassHierarchy().isAssignableFrom(requestProcessorClass, klass)) {
return true;
}
return false;
}
public static boolean isConcreteStrutsPlugIn(IClass klass) {
TypeReference plugInType = TypeReference.findOrCreate(ClassLoaderReference.Application, plugInName);
IClass plugInClass = klass.getClassHierarchy().lookupClass(plugInType);
if (plugInClass == null) {
return false;
}
if (klass.isAbstract()) {
return false;
}
if (klass.getReference().equals(plugInType)) {
return false;
}
if (klass.getClassHierarchy().isAssignableFrom(plugInClass, klass)) {
return true;
}
return false;
}
public static boolean isConcreteStrutsAction(IClass klass) {
TypeReference actionType = TypeReference.findOrCreate(ClassLoaderReference.Application, actionName);
IClass actionClass = klass.getClassHierarchy().lookupClass(actionType);
if (actionClass == null) {
return false;
}
if (klass.isAbstract()) {
return false;
}
if (klass.getReference().equals(actionType)) {
return false;
}
if (klass.getClassHierarchy().isSubclassOf(klass, actionClass)) {
return true;
}
return false;
}
/**
* Add any methods that look like they might be DispatchAction targets, based on the method signature.
*
* TODO: instead, parse the struts xml directly.
*
* @param klass an Action
*/
private void addSpeculativeDispatchMethods(IClass klass, IClassHierarchy cha) {
IClass c = klass;
while (c != null) {
for (Iterator<IMethod> it = c.getDeclaredMethods().iterator(); it.hasNext();) {
IMethod M = (IMethod) it.next();
Descriptor D = M.getDescriptor();
if (D.equals(executeDesc) || D.equals(httpExecuteDesc)) {
MethodReference m = MethodReference.findOrCreate(klass.getReference(), M.getName(), M.getDescriptor());
entrypoints.put(m, new StrutsActionEntrypoint(klass, M, cha));
}
}
c = c.getSuperclass();
}
}
public Iterator<Entrypoint> iterator() {
return entrypoints.values().iterator();
}
public String toString() {
StringBuffer result = new StringBuffer();
result.append("Actions:");
Iterator<IClass> it = actions.iterator();
if (it.hasNext()) {
while (it.hasNext()) {
result.append("\n ");
result.append(it.next());
}
} else {
result.append(" none");
}
result.append("\n");
result.append("PlugIns:");
Iterator<IClass> it1 = plugins.iterator();
if (it1.hasNext()) {
while (it1.hasNext()) {
result.append("\n ");
result.append(it1.next());
}
} else {
result.append(" none");
}
result.append("\n");
result.append("RequestProcessors:");
Iterator<IClass> it2 = requestProcessors.iterator();
if (it2.hasNext()) {
while (it2.hasNext()) {
result.append("\n ");
result.append(it2.next());
}
} else {
result.append(" none");
}
return result.toString();
}
/**
* @return true iff m is an entrypoint recorded by this class
*/
public boolean contains(MemberReference m) {
return entrypoints.keySet().contains(m);
}
/**
* An entrypoint which assumes all ServletRequest and ServletResponses are of the HTTP flavor.
*/
private static class StrutsActionEntrypoint extends DefaultEntrypoint {
private final TypeReference receiver;
public StrutsActionEntrypoint(IClass concreteType, IMethod method, IClassHierarchy cha) {
super(method, cha);
receiver = concreteType.getReference();
}
@Override
public TypeReference[] getParameterTypes(int i) {
if (i == 0) {
return new TypeReference[] { receiver };
} else {
TypeReference[] tarray = super.getParameterTypes(i);
assert tarray.length == 1;
TypeReference T = tarray[0];
TypeName n = T.getName();
TypeReference Tprime = concreteParameterMap.get(n);
if (Tprime != null) {
T = Tprime;
}
return new TypeReference[] { T };
}
}
@Override
protected int makeArgument(AbstractRootMethod m, int i) {
TypeName n = getParameterTypes(i)[0].getName();
if (n.equals(actionFormName)) {
// invoke a synthetic factory method that creates ActionForm objects
MethodReference declaredTarget = MethodReference.findOrCreate(ActionFormFactoryMethod.factoryClassRef,
ActionFormFactoryMethod.name, ActionFormFactoryMethod.descr);
CallSiteReference site = CallSiteReference.make(0, declaredTarget, IInvokeInstruction.Dispatch.STATIC);
SSAInvokeInstruction factoryInv = m.addInvocation(new int[0], site);
return factoryInv.getDef();
} else {
return super.makeArgument(m, i);
}
}
}
private static class StrutsRequestProcessorEntrypoint extends DefaultEntrypoint {
private final TypeReference receiver;
public StrutsRequestProcessorEntrypoint(IClass concreteType, IMethod method, IClassHierarchy cha) {
super(method, cha);
receiver = concreteType.getReference();
}
@Override
public TypeReference[] getParameterTypes(int i) {
if (i == 0) {
return new TypeReference[] { receiver };
} else {
TypeReference[] tarray = super.getParameterTypes(i);
assert tarray.length == 1;
TypeReference T = tarray[0];
TypeName n = T.getName();
TypeReference Tprime = concreteParameterMap.get(n);
if (Tprime != null) {
T = Tprime;
}
return new TypeReference[] { T };
}
}
}
/**
* An entrypoint which assumes all ServletRequest and ServletResponses are of the HTTP flavor. TODO: get rid of this and just use
* {@link DefaultEntrypoint}? --MS
*/
private static class StrutsPlugInEntrypoint extends DefaultEntrypoint {
public StrutsPlugInEntrypoint(IMethod method, IClassHierarchy cha) {
super(method, cha);
}
}
/**
* return the set of classes that should be examined when searching for struts entrypoints.
*/
protected Iterator<IClass> getCandidateEntryClasses(IClassHierarchy cha) {
IClassLoader appLoader = cha.getLoader(ClassLoaderReference.Application);
return appLoader.iterateAllClasses();
}
}

View File

@ -1,33 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.ipa.summaries.MethodSummary;
import com.ibm.wala.ipa.summaries.SummarizedMethod;
import com.ibm.wala.types.MethodReference;
/**
*/
public class SummarizedEJBMethod extends SummarizedMethod {
private final BeanMetaData bean;
public SummarizedEJBMethod(BeanMetaData bean, MethodReference ref, MethodSummary summary, IClass declaringClass) {
super(ref, summary, declaringClass);
this.bean = bean;
}
public BeanMetaData getBean() {
return bean;
}
}

View File

@ -1,143 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee;
import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;
import org.eclipse.jem.java.Method;
import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile;
import org.eclipse.jst.j2ee.ejb.AssemblyDescriptor;
import org.eclipse.jst.j2ee.ejb.EJBJar;
import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
import org.eclipse.jst.j2ee.ejb.MethodElement;
import org.eclipse.jst.j2ee.ejb.MethodElementKind;
import org.eclipse.jst.j2ee.ejb.MethodTransaction;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.util.collections.HashSetFactory;
/**
* Utilities for dealing with transaction declarations.
*/
public class TransactionUtil {
private static final boolean DEBUG = false;
private final static String EJBHOME = "javax.ejb.EJBHome";
private final static String EJBLOCALHOME = "javax.ejb.EJBLocalHome";
private final static String EJBOBJECT = "javax.ejb.EJBObject";
private final static String EJBLOCALOBJECT = "javax.ejb.EJBLocalObject";
/**
* Create a set of objects to represent transaction entrypoints defined in this module.
*/
@SuppressWarnings( { "unchecked" })
public static Set<DeploymentDeclaredTransaction> createDeclaredTransactionEntries(Archive A, ClassLoaderReference loader) {
if (DEBUG) {
System.err.println(("createDeclaredTransactionEntries: " + A + " type " + A.getClass()));
}
if (A.isEJBJarFile()) {
// extract the deployment descriptor
EJBJar DD = ((EJBJarFile) A).getDeploymentDescriptor();
return createDeclaredTransactionEntries(DD, loader);
} else if (A.isEARFile()) {
EARFile ear = (EARFile) A;
Set<DeploymentDeclaredTransaction> result = HashSetFactory.make();
for (Iterator it = ear.getEJBJarFiles().iterator(); it.hasNext();) {
EJBJarFile j = (EJBJarFile) it.next();
result.addAll(createDeclaredTransactionEntries(j, loader));
}
return result;
} else {
return Collections.emptySet();
}
}
/**
* Create a set of objects to represent transaction entrypoints defined in this module.
*/
@SuppressWarnings("unchecked")
private static Set<DeploymentDeclaredTransaction> createDeclaredTransactionEntries(EJBJar DD, ClassLoaderReference loader) {
if (DEBUG) {
System.err.println(("createDeclaredTransactionEntries: " + DD));
}
TreeSet<DeploymentDeclaredTransaction> result = new TreeSet<DeploymentDeclaredTransaction>();
AssemblyDescriptor AD = DD.getAssemblyDescriptor();
if (AD == null) {
System.err.println("Warning: no assembly descriptor found for EJBJar: " + DD);
return Collections.emptySet();
}
for (Iterator it = AD.getMethodTransactions().iterator(); it.hasNext();) {
MethodTransaction T = (MethodTransaction) it.next();
if (DEBUG) {
System.err.println(("got MethodTransaction " + T));
}
int TType = T.getTransactionAttribute().getValue();
for (Iterator elements = T.getMethodElements().iterator(); elements.hasNext();) {
MethodElement M = (MethodElement) elements.next();
EnterpriseBean b = M.getEnterpriseBean();
int elementKind = M.getType().getValue();
Method[] methods = M.getMethods();
for (int i = 0; i < methods.length; i++) {
int kind = (elementKind == MethodElementKind.UNSPECIFIED) ? deduceKind(b, methods[i]) : elementKind;
if (kind != MethodElementKind.UNSPECIFIED) {
result.add(new DeploymentDeclaredTransaction(b, methods[i], M, loader, kind, TType));
}
}
}
}
return result;
}
/**
* Figure out the EJB interface to which a method belongs
*/
private static int deduceKind(EnterpriseBean b, Method method) {
String home = b.getHomeInterfaceName();
String localHome = b.getLocalHomeInterfaceName();
String local = b.getLocalInterfaceName();
String remote = b.getRemoteInterfaceName();
String name = method.getJavaClass().getJavaName();
if (DEBUG) {
System.err.println(("deduceKind: " + b + " " + name));
}
if (name.equals(home) || name.equals(EJBHOME)) {
return MethodElementKind.HOME;
} else if (name.equals(localHome) || name.equals(EJBLOCALHOME)) {
return MethodElementKind.LOCAL_HOME;
} else if (name.equals(local) || name.equals(EJBLOCALOBJECT)) {
return MethodElementKind.LOCAL;
} else if (name.equals(remote) || name.equals(EJBOBJECT)) {
return MethodElementKind.REMOTE;
} else if (b.isMessageDriven() && method.getName().equals("onMessage")) {
// treat message-driven transactions like remote ones
return MethodElementKind.REMOTE;
} else {
// some other type we don't handle; give up.
return MethodElementKind.UNSPECIFIED;
}
}
}

View File

@ -1,94 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee.util;
import java.util.HashMap;
import com.ibm.wala.analysis.typeInference.TypeAbstraction;
import com.ibm.wala.analysis.typeInference.TypeInference;
import com.ibm.wala.classLoader.CallSiteReference;
import com.ibm.wala.classLoader.CodeScanner;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.shrikeCT.InvalidClassFileException;
import com.ibm.wala.ssa.IR;
import com.ibm.wala.ssa.SSAInstruction;
import com.ibm.wala.ssa.SSAInvokeInstruction;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.debug.Assertions;
/**
* Holds results of type inference for call site receivers.
*/
public class ReceiverTypeInference {
final private TypeInference ti;
/**
* Mapping from call site reference to InvokeInstruction. TODO: this kind of sucks. Redesign?
*/
private HashMap<CallSiteReference, SSAInvokeInstruction> invokeMap;
public ReceiverTypeInference(TypeInference ti) {
this.ti = ti;
try {
setupInvokeMap();
} catch (InvalidClassFileException e) {
e.printStackTrace();
Assertions.UNREACHABLE();
}
}
/**
* Method setupInvokeMap. TODO: redesign stuff so that all this is not necessary. TODO: has that time come .. is this unnecesary
* yet?
*/
private void setupInvokeMap() throws InvalidClassFileException {
invokeMap = HashMapFactory.make(5);
IR ir = ti.getIR();
IMethod method = ir.getMethod();
// set up mapping from Integer (program counter) -> CallSiteReference
HashMap<Integer, CallSiteReference> intMap = HashMapFactory.make(5);
for (CallSiteReference site : CodeScanner.getCallSites(method)) {
int pc = site.getProgramCounter();
intMap.put(Integer.valueOf(pc), site);
}
// now set up mapping from CallSiteReference -> InvokeInstruction
SSAInstruction[] instructions = ir.getInstructions();
for (int i = 0; i < instructions.length; i++) {
SSAInstruction s = instructions[i];
if (s instanceof SSAInvokeInstruction) {
SSAInvokeInstruction call = (SSAInvokeInstruction) s;
int pc = call.getProgramCounter();
CallSiteReference site = intMap.get(new Integer(pc));
invokeMap.put(site, call);
}
}
}
public TypeAbstraction getReceiverType(CallSiteReference site) {
SSAInvokeInstruction instruction = getInvokeInstruction(site);
if (instruction == null) {
return null;
}
int def = instruction.getReceiver();
if (def == -1) {
return null;
} else {
return ti.getType(def);
}
}
private SSAInvokeInstruction getInvokeInstruction(CallSiteReference site) {
return invokeMap.get(site);
}
}

View File

@ -1,64 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee.util;
import java.util.Map;
import com.ibm.wala.analysis.typeInference.TypeInference;
import com.ibm.wala.ipa.callgraph.AnalysisCache;
import com.ibm.wala.ipa.callgraph.CGNode;
import com.ibm.wala.ssa.IR;
import com.ibm.wala.ssa.SSAOptions;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.ref.CacheReference;
/**
* A soft cache of results of type inference
*/
public class ReceiverTypeInferenceCache {
private final AnalysisCache analysisCache;
public ReceiverTypeInferenceCache(AnalysisCache cache) {
this.analysisCache = cache;
}
/**
* A cache of TypeInference results; a mapping from CGNode -> ReceiverTypeInference
*/
private final Map<CGNode, Object> typeInferenceMap = HashMapFactory.make();
/**
* @param n node
* @return null if unable to perform type inference
*/
public ReceiverTypeInference findOrCreate(CGNode n) {
Object ref = typeInferenceMap.get(n);
ReceiverTypeInference result = (ReceiverTypeInference) CacheReference.get(ref);
try {
if (result == null) {
SSAOptions options = SSAOptions.defaultOptions();
// options.setUsePiNodes(true);
IR ir = analysisCache.getSSACache().findOrCreateIR(n.getMethod(), n.getContext(), options);
TypeInference T = TypeInference.make(ir, false);
result = new ReceiverTypeInference(T);
ref = CacheReference.make(result);
typeInferenceMap.put(n, ref);
}
return result;
} catch (ClassCastException e) {
// this might happen if it's not a ShrikeCTMethodWrapper
return null;
}
}
}

View File

@ -1,323 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee.util;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.Iterator;
import org.eclipse.jst.j2ee.commonarchivecore.internal.ApplicationClientFile;
import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile;
import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile;
import com.ibm.wala.classLoader.JarFileModule;
import com.ibm.wala.classLoader.Module;
import com.ibm.wala.classLoader.ModuleEntry;
import com.ibm.wala.j2ee.J2EEUtil;
import com.ibm.wala.util.collections.HashSetFactory;
import com.ibm.wala.util.debug.Assertions;
import com.ibm.wala.util.io.FileSuffixes;
/**
* A wrapper around a WCCM Archive.
*/
public class TopLevelArchiveModule implements Module {
/**
* Path to classpath root in a war
*/
private static final String WAR_CP_ROOT = "WEB-INF/classes/";
/**
* Path into which WSAD generates JSP implementations
*/
private static final String WAR_JSP_CP_ROOT = "WEB-INF/classes/WEB-INF/";
private static final String ORG_APACHE_JSP = "org/apache/jsp/";
public final static byte WAR_FILE = 0;
public final static byte OTHER_JAR_FILE = 1;
public final static byte APPLICATION_CLIENT_FILE = 2;
public final static byte EAR_FILE = 3;
public final static byte EJB_JAR_FILE = 4;
private boolean ignoreDependentJars = false;
private static final boolean DEBUG = false;
/**
* The JarFileModule that represents this archive. If this is null, it means that this is a nested archive. TODO: We'll need to
* clean up the class hierarchy so that BloatedArchive does not extend TopLevelArchive ... in which case we can assert that
* jarFile != null;
*/
private final JarFileModule jarFile;
public TopLevelArchiveModule(JarFileModule jarFile) {
this.jarFile = jarFile;
}
/**
* @param A an ARCHIVE
* @return one of EAR_FILE, JAR_FILE, WAR_FILE, or APPLICATION_CLIENT_FILE
*/
public static byte getTypeCode(Archive A) {
if (A instanceof EARFile) {
return EAR_FILE;
} else if (A instanceof EJBJarFile) {
return EJB_JAR_FILE;
} else if (A instanceof WARFile) {
return WAR_FILE;
} else if (A instanceof ApplicationClientFile) {
return APPLICATION_CLIENT_FILE;
} else {
return OTHER_JAR_FILE;
}
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
public String toString() {
return "ArchiveModule:" + materializeArchive().getName();
}
/**
* @return one of EAR_FILE, JAR_FILE, WAR_FILE, or APPLICATION_CLIENT_FILE
*/
public byte getType() {
return getTypeCode(materializeArchive());
}
/*
* (non-Javadoc)
*
* @see com.ibm.wala.classLoader.Module#getEntries()
*/
@SuppressWarnings( { "unchecked" })
public Iterator<ModuleEntry> getEntries() {
if (DEBUG) {
System.err.println(("ArchiveModule.getEntries(): " + this));
}
Archive A = materializeArchive();
Collection files = A.getFiles();
Collection<ModuleEntry> entries = HashSetFactory.make(files.size());
for (Iterator<File> it = files.iterator(); it.hasNext();) {
File f = (File) it.next();
if (f.isArchive()) {
byte code = getTypeCode((Archive) f);
if (ignoreDependentJars && code == OTHER_JAR_FILE) {
continue;
}
}
entries.add(new Entry(f));
}
return entries.iterator();
}
/**
* @return a WCCM Archive representing this module
*/
public Archive materializeArchive() {
return J2EEUtil.getArchive(jarFile);
}
/**
* @return true iff the jar file suffix is .war
*/
protected boolean isWarFile() {
if (jarFile == null) {
// this is a nested archive which should override this method.
Assertions.UNREACHABLE();
return false;
}
return jarFile.getJarFile().getName().indexOf(".war") > -1;
}
/**
* @param b
*/
public void setIgnoreDependentJars(boolean b) {
ignoreDependentJars = b;
}
private class Entry implements ModuleEntry {
private File F;
Entry(File F) {
this.F = F;
}
/*
* (non-Javadoc)
*
* @see com.ibm.wala.classLoader.ModuleEntry#getName()
*/
public String getName() {
return F.getURI();
}
/*
* (non-Javadoc)
*
* @see com.ibm.wala.classLoader.ModuleEntry#isClassFile()
*/
public boolean isClassFile() {
return FileSuffixes.isClassFile(F.getName());
}
/*
* (non-Javadoc)
*
* @see com.ibm.wala.classLoader.ModuleEntry#getInputStream()
*/
public InputStream getInputStream() {
try {
return F.getInputStream();
} catch (FileNotFoundException e) {
e.printStackTrace();
Assertions.UNREACHABLE();
return null;
} catch (IOException e) {
e.printStackTrace();
Assertions.UNREACHABLE();
return null;
}
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
public String toString() {
return getName();
}
/*
* (non-Javadoc)
*
* @see com.ibm.wala.classLoader.ModuleEntry#isModuleFile()
*/
public boolean isModuleFile() {
return F.isArchive();
}
public Module asModule() {
assert isModuleFile();
return new BloatedArchiveModule((Archive) F);
}
/*
* @see com.ibm.wala.classLoader.ModuleEntry#getClassName()
*/
public String getClassName() {
String name = getName();
if (isWarFile()) {
if (name.indexOf("/") == 0) {
name = name.substring(1);
}
if (name.indexOf(WAR_JSP_CP_ROOT) == 0) {
// this should be a JSP implementation.
name = name.substring(WAR_JSP_CP_ROOT.length());
name = ORG_APACHE_JSP + name;
} else if (name.indexOf(WAR_CP_ROOT) == 0) {
name = name.substring(WAR_CP_ROOT.length());
// if it looks like the default package, assume it's a jsp.
if (name.indexOf("/") == -1) {
name = ORG_APACHE_JSP + name;
}
}
}
return FileSuffixes.stripSuffix(name);
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
return F.hashCode() * 593;
}
/*
* (non-Javadoc)
*
* @see com.ibm.wala.classLoader.ModuleEntry#isSourceFile()
*/
public boolean isSourceFile() {
return false;
}
}
// TODO: clean up this class hierarchy; it sucks.
// an instance of BloatedArchiveModule should not be held onto for long.
public static class BloatedArchiveModule extends TopLevelArchiveModule {
private final Archive A;
public BloatedArchiveModule(Archive A) {
super(null);
this.A = A;
}
/*
* (non-Javadoc)
*
* @see com.ibm.wala.j2ee.util.TopLevelArchiveModule#materializeArchive()
*/
public Archive materializeArchive() {
return A;
}
/*
* (non-Javadoc)
*
* @see com.ibm.wala.j2ee.util.TopLevelArchiveModule#isWarFile()
*/
protected boolean isWarFile() {
return getTypeCode(A) == WAR_FILE;
}
/*
* (non-Javadoc)
*
* @see com.ibm.wala.j2ee.util.TopLevelArchiveModule#isWarFile()
*/
protected boolean isApplicationClientFile() {
return getTypeCode(A) == APPLICATION_CLIENT_FILE;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
return A.hashCode() * 2027;
}
}
}

View File

@ -1,76 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.j2ee.util;
import java.util.Set;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.callgraph.ClassTargetSelector;
import com.ibm.wala.ipa.callgraph.MethodTargetSelector;
import com.ibm.wala.ipa.cha.ClassHierarchy;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.j2ee.BeanMetaData;
import com.ibm.wala.j2ee.DeploymentMetaData;
import com.ibm.wala.j2ee.J2EEClassTargetSelector;
import com.ibm.wala.j2ee.J2EEMethodTargetSelector;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.collections.HashSetFactory;
import com.ibm.wala.util.strings.Atom;
/**
* Miscellaneous J2EE Utilities
*/
public class Util {
public static void addJ2EEBypassLogic(AnalysisOptions options, AnalysisScope scope, DeploymentMetaData dmd, IClassHierarchy cha,
ReceiverTypeInferenceCache typeInference) {
if (cha == null) {
throw new IllegalArgumentException("cha is null");
}
MethodTargetSelector ms = new J2EEMethodTargetSelector(scope, options.getMethodTargetSelector(), dmd, cha, typeInference);
options.setSelector(ms);
ClassTargetSelector cs = new J2EEClassTargetSelector(options.getClassTargetSelector(), dmd, cha, cha.getLoader(scope
.getLoader(Atom.findOrCreateUnicodeAtom("Synthetic"))));
options.setSelector(cs);
}
/**
* @param cha governing class hierarchy
* @return the Set of CMR fields for this bean, including inherited CMRs
*/
public static Set<Object> getCMRFields(BeanMetaData bean, DeploymentMetaData dmd, ClassHierarchy cha) {
Set<Object> result = HashSetFactory.make(5);
TypeReference T = bean.getEJBClass();
while (T != null) {
BeanMetaData B = dmd.getBeanMetaData(T);
if (B != null) {
result.addAll(B.getCMRFields());
}
IClass klass = cha.lookupClass(T);
assert klass != null;
IClass superKlass = klass.getSuperclass();
T = (superKlass == null) ? null : superKlass.getReference();
}
return result;
}
private static final String benignExtSpec = "benignext.xml";
public static void addDefaultJ2EEBypassLogic(AnalysisOptions options, AnalysisScope scope, ClassLoader cl, IClassHierarchy cha) {
com.ibm.wala.ipa.callgraph.impl.Util.addDefaultBypassLogic(options, scope, cl, cha);
com.ibm.wala.ipa.callgraph.impl.Util.addBypassLogic(options, scope, cl, benignExtSpec, cha);
}
}

View File

@ -1,25 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.model.javax.servlet;
class RequestDispatcher implements javax.servlet.RequestDispatcher {
public void forward(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) {
}
public void include(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) {
}
}

View File

@ -1,41 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.model.javax.servlet;
import java.util.Enumeration;
import java.util.Vector;
/**
* @author sfink
*
*/
public class ServletConfig implements javax.servlet.ServletConfig {
public String getServletName() {
return "some name";
}
public javax.servlet.ServletContext getServletContext() {
return com.ibm.wala.model.javax.servlet.ServletContext.getModelInstance();
}
public String getInitParameter(String arg0) {
return ServletRequest.getInputString();
}
public Enumeration<String> getInitParameterNames() {
Vector<String> v = new Vector<String>();
v.add(ServletRequest.getInputString());
return v.elements();
}
}

View File

@ -1,146 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.model.javax.servlet;
import javax.servlet.Servlet;
import com.ibm.wala.model.SyntheticFactory;
public class ServletContext implements javax.servlet.ServletContext {
private static ServletContext singleton = new ServletContext();
public static javax.servlet.ServletContext getModelInstance() {
return singleton;
}
private static java.util.Hashtable<String, Object> values = new java.util.Hashtable<String, Object>();
public Object getAttribute(String name) {
if (name.length() > 5) { // random condition.
return values.get(name);
} else {
return SyntheticFactory.getObject();
}
}
public java.util.Enumeration<String> getAttributeNames() {
return values.keys();
}
public javax.servlet.ServletContext getContext(String uripath) {
return singleton;
}
public String getInitParameter(String name) {
return ServletRequest.getInputString();
}
@SuppressWarnings("unchecked")
public java.util.Enumeration getInitParameterNames() {
return new java.util.Enumeration() {
public boolean hasMoreElements() {
return false;
}
public Object nextElement() {
return null;
}
};
}
public int getMajorVersion() {
return 2;
}
public String getMimeType(String file) {
return null;
}
public int getMinorVersion() {
return 3;
}
public javax.servlet.RequestDispatcher getNamedDispatcher(String name) {
return new RequestDispatcher();
}
public String getRealPath(String path) {
return path;
}
public javax.servlet.RequestDispatcher getRequestDispatcher(String path) {
return new RequestDispatcher();
}
public java.net.URL getResource(String path) {
try {
return new java.net.URL(path);
} catch (java.net.MalformedURLException e) {
return null;
}
}
public java.io.InputStream getResourceAsStream(String path) {
return null;
}
public java.util.Set<Object> getResourcePaths(String path) {
return java.util.Collections.emptySet();
}
public java.lang.String getServerInfo() {
return "WALA J2EE model";
}
public Servlet getServlet(java.lang.String name) {
return null;
}
public String getServletContextName() {
return "WALA J2EE model ServletContext";
}
@SuppressWarnings("unchecked")
public java.util.Enumeration getServletNames() {
return null;
}
@SuppressWarnings("unchecked")
public java.util.Enumeration getServlets() {
return null;
}
public void log(Exception exception, String msg) {
}
public void log(String msg) {
}
public void log(String message, Throwable throwable) {
}
public void removeAttribute(String name) {
values.remove(name);
}
public void setAttribute(String name, Object object) {
values.put(name, object);
}
public String getContextPath() {
return "";
}
}

View File

@ -1,197 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.model.javax.servlet;
import java.io.IOException;
import javax.servlet.ServletInputStream;
import com.ibm.wala.model.SyntheticFactory;
public class ServletRequest implements javax.servlet.ServletRequest {
private final java.util.Hashtable<String, Object> values = new java.util.Hashtable<String, Object>();
private java.util.Hashtable<String, String> parameters;
private String encoding = "iso88591-1";
// lazily initialize bogus model of parameters
private void initParameters() {
parameters = new java.util.Hashtable<String, String>();
parameters.put(getInputString(), getInputString());
}
/**
* The semantics of this are bogus ... be careful to hijack this.
*/
protected static String getInputString() {
return "some input string";
}
/**
* The semantics of this are bogus ... be careful to hijack this.
*/
public ServletRequest() {
}
public Object getAttribute(String name) {
if (name.length() > 5) { // random condition.
return values.get(name);
} else {
return SyntheticFactory.getObject();
}
}
public java.util.Enumeration<String> getAttributeNames() {
return values.keys();
}
public java.lang.String getCharacterEncoding() {
return encoding;
}
public int getContentLength() {
return -1;
}
public java.lang.String getContentType() {
return getInputString();
}
public javax.servlet.ServletInputStream getInputStream() {
return new ServletInputStream() {
@Override
public int read() throws IOException {
// kind of a bogus model, but ok for now ...
String s = getInputString();
int n = s.charAt(0);
return n;
}
};
}
public java.util.Locale getLocale() {
return java.util.Locale.getDefault();
}
@SuppressWarnings("unchecked")
public java.util.Enumeration getLocales() {
return new java.util.Enumeration() {
private boolean done = false;
public boolean hasMoreElements() {
return !done;
}
public Object nextElement() {
done = true;
return getLocale();
}
};
}
public String getParameter(String name) {
// Note, while the following is technically a more accurate model...
// return parameters.get(name);
// I'm using the following simpler model for now to avoid some unnecessary analysis
// of flow through the heap. Revisit this decision if necessary.
return getInputString();
}
public java.util.Map<String, String> getParameterMap() {
initParameters();
return parameters;
}
public java.util.Enumeration<String> getParameterNames() {
initParameters();
return parameters.keys();
}
public String[] getParameterValues(String name) {
initParameters();
return new String[] { parameters.get(name) };
}
public java.lang.String getProtocol() {
return getInputString();
}
public java.io.BufferedReader getReader() {
return null;
}
public String getRealPath(String path) {
return path;
}
public String getRemoteAddr() {
return "0.0.0.0";
}
public String getRemoteHost() {
return "remotehost";
}
public javax.servlet.RequestDispatcher getRequestDispatcher(String path) {
return new RequestDispatcher();
}
public String getScheme() {
return getInputString();
}
public String getServerName() {
return "localhost.localdomain";
}
public int getServerPort() {
return 80;
}
public boolean isSecure() {
return false;
}
public void removeAttribute(String name) {
values.remove(name);
}
public void setAttribute(String name, Object o) {
values.put(name, o);
}
public void setCharacterEncoding(String env) {
encoding = env;
}
public String getLocalAddr() {
// TODO Auto-generated method stub
return null;
}
public String getLocalName() {
// TODO Auto-generated method stub
return null;
}
public int getLocalPort() {
// TODO Auto-generated method stub
return 0;
}
public int getRemotePort() {
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -1,88 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.model.javax.servlet;
import javax.servlet.ServletOutputStream;
public class ServletResponse implements javax.servlet.ServletResponse {
private java.util.Locale locale = java.util.Locale.getDefault();;
private int bufferSize = -1;
private final ServletOutputStream out = new ServletOutputStream() {
public void write (int b) throws java.io.IOException {
}
};
public void flushBuffer() {
}
public int getBufferSize() {
return bufferSize;
}
public String getCharacterEncoding() {
return "iso8859-1";
}
public java.util.Locale getLocale() {
return locale;
}
public ServletOutputStream getOutputStream() {
return out;
}
public java.io.PrintWriter getWriter() {
return new java.io.PrintWriter( out );
}
public boolean isCommitted() {
return false;
}
public void reset() {
}
public void resetBuffer() {
}
public void setBufferSize(int size) {
bufferSize = size;
}
public void setContentLength(int len) {
}
public void setContentType(java.lang.String type) {
}
public void setLocale(java.util.Locale loc) {
locale = loc;
}
public String getContentType() {
// TODO Auto-generated method stub
return null;
}
public void setCharacterEncoding(String charset) {
// TODO Auto-generated method stub
}
}

View File

@ -1,136 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.model.javax.servlet.http;
import javax.servlet.http.Cookie;
public class HttpServletRequest
extends com.ibm.wala.model.javax.servlet.ServletRequest
implements javax.servlet.http.HttpServletRequest {
private java.util.Hashtable<String, String> headers;
// lazily initialize bogus model of headers
private void initHeaders() {
headers = new java.util.Hashtable<String, String>();
headers.put(getInputString(), getInputString());
}
public HttpServletRequest() {
super();
}
public String getAuthType() {
return getInputString();
}
public String getContextPath() {
return "this/that/the/other";
}
public Cookie[] getCookies() {
Cookie cookie = new Cookie(getInputString(), getInputString());
cookie.setComment(getInputString());
return new Cookie[] { cookie } ;
}
public long getDateHeader(String name) {
return 0;
}
public String getHeader(String name) {
initHeaders();
return headers.get(name);
}
public java.util.Enumeration<String> getHeaderNames() {
initHeaders();
return headers.keys();
}
public java.util.Enumeration<String> getHeaders(String name) {
initHeaders();
return headers.elements();
}
public int getIntHeader(String name) {
return (new Integer(getHeader(name))).intValue();
}
public String getMethod() {
return "GET";
}
public java.lang.String getPathInfo() {
return null;
}
public String getPathTranslated() {
return "path";
}
public String getQueryString() {
return getInputString();
}
public String getRemoteUser() {
return getInputString();
}
public String getRequestedSessionId() {
return "SESSION1";
}
public String getRequestURI() {
return getInputString();
}
public StringBuffer getRequestURL() {
return new StringBuffer(getRequestURI());
}
public String getServletPath() {
return "this/that/the/other";
}
public javax.servlet.http.HttpSession getSession() {
return HttpSession.getModelInstance();
}
public javax.servlet.http.HttpSession getSession(boolean create) {
return HttpSession.getModelInstance();
}
public java.security.Principal getUserPrincipal() {
return null;
}
public boolean isRequestedSessionIdFromCookie() {
return true;
}
public boolean isRequestedSessionIdFromUrl() {
return true;
}
public boolean isRequestedSessionIdFromURL() {
return true;
}
public boolean isRequestedSessionIdValid() {
return true;
}
public boolean isUserInRole(String role) {
return true;
}
}

View File

@ -1,89 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.model.javax.servlet.http;
import javax.servlet.http.Cookie;
public class HttpServletResponse
extends com.ibm.wala.model.javax.servlet.ServletResponse
implements javax.servlet.http.HttpServletResponse {
@SuppressWarnings("unchecked")
private final java.util.Hashtable<String, Comparable> headers = new java.util.Hashtable<String, Comparable>();
public void addCookie(Cookie cookie) {
}
public void addDateHeader(String name, long date) {
headers.put(name, new java.util.Date(date));
}
public void addHeader(String name, String value) {
headers.put(name, value);
}
public void addIntHeader(java.lang.String name, int value) {
headers.put(name, new Integer(value));
}
public boolean containsHeader(String name) {
return headers.containsKey(name);
}
public String encodeRedirectUrl(String url) {
return url;
}
public String encodeRedirectURL(String url) {
return url;
}
public String encodeUrl(String url) {
return url;
}
public String encodeURL(String url) {
return url;
}
public void sendError(int sc) {
}
public void sendError(int sc, String msg) {
}
public void sendRedirect(String location) {
}
public void setDateHeader(String name, long date) {
headers.put(name, new java.util.Date(date));
}
public void setHeader(String name, String value) {
headers.put(name, value);
}
public void setIntHeader(String name, int value) {
headers.put(name, new Integer(value));
}
public void setStatus(int sc) {
}
public void setStatus(int sc, String sm) {
}
}

View File

@ -1,183 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.model.javax.servlet.http;
import java.util.Enumeration;
import java.util.Hashtable;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSessionContext;
import com.ibm.wala.model.SyntheticFactory;
/**
* @author sfink
*
* TODO: finish this model
*/
public class HttpSession implements javax.servlet.http.HttpSession {
private static final HttpSession singleton = new HttpSession();
public static javax.servlet.http.HttpSession getModelInstance() {
return singleton;
}
private Hashtable<String, Object> attributes = new Hashtable<String, Object>();
private Hashtable<String, Object> values = new Hashtable<String, Object>();
/**
*
*/
public HttpSession() {
super();
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#getCreationTime()
*/
public long getCreationTime() {
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#getId()
*/
public String getId() {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#getLastAccessedTime()
*/
public long getLastAccessedTime() {
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#getServletContext()
*/
public ServletContext getServletContext() {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#setMaxInactiveInterval(int)
*/
public void setMaxInactiveInterval(int arg0) {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#getMaxInactiveInterval()
*/
public int getMaxInactiveInterval() {
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#getSessionContext()
*/
public HttpSessionContext getSessionContext() {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#getAttribute(java.lang.String)
*/
public Object getAttribute(String arg0) {
if (arg0.length() > 5) { // random condition.
return attributes.get(arg0);
} else {
return SyntheticFactory.getObject();
}
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#getValue(java.lang.String)
*/
public Object getValue(String arg0) {
if (arg0.length() > 5) { // random condition.
return values.get( arg0 );
} else {
return SyntheticFactory.getObject();
}
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#getAttributeNames()
*/
public Enumeration<String> getAttributeNames() {
return attributes.keys();
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#getValueNames()
*/
public String[] getValueNames() {
return new String[0];
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#setAttribute(java.lang.String, java.lang.Object)
*/
public void setAttribute(String arg0, Object arg1) {
attributes.put(arg0, arg1);
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#putValue(java.lang.String, java.lang.Object)
*/
public void putValue(String arg0, Object arg1) {
values.put(arg0, arg1);
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#removeAttribute(java.lang.String)
*/
public void removeAttribute(String arg0) {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#removeValue(java.lang.String)
*/
public void removeValue(String arg0) {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#invalidate()
*/
public void invalidate() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see javax.servlet.http.HttpSession#isNew()
*/
public boolean isNew() {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -1,14 +1,6 @@
#Thu Feb 03 10:35:13 EST 2011
#Tue Jun 05 11:13:30 EDT 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@ -17,7 +9,6 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@ -74,7 +65,6 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0

View File

@ -8,6 +8,14 @@ import com.ibm.wala.util.collections.FilterIterator;
import com.ibm.wala.util.collections.Pair;
import com.ibm.wala.util.graph.Graph;
/**
* Extends {@link DFSPathFinder} to discover all paths from a set of root nodes
* to nodes passing some {@link Filter}.
*
* Note that this code performs work that is potentially exponential in the size
* of the underlying graph, using exponential space. It most likely won't work
* even for graphs of moderate size.
*/
public class DFSAllPathsFinder<T> extends DFSPathFinder<T> {
public DFSAllPathsFinder(Graph<T> G, Iterator<T> nodes, Filter<T> f) {
@ -18,6 +26,7 @@ public class DFSAllPathsFinder<T> extends DFSPathFinder<T> {
super(G, N, f);
}
@Override
protected Iterator<? extends T> getConnected(T n) {
final List<T> cp = currentPath();
return new FilterIterator<T>(G.getSuccNodes(n), new Filter<T>() {