From 456d36e5505dd5307b0bb563f945471570b8acaa Mon Sep 17 00:00:00 2001 From: sjfink Date: Thu, 3 Jan 2008 20:57:43 +0000 Subject: [PATCH] delete a bunch of old crap git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2279 f5eafffb-2e1d-0410-98e4-8ec43c5233c4 --- com.ibm.wala.j2ee/META-INF/MANIFEST.MF | 2 - .../ibm/wala/j2ee/client/IArrayContents.java | 25 --- .../src/com/ibm/wala/j2ee/client/IClass.java | 39 ----- .../src/com/ibm/wala/j2ee/client/IField.java | 39 ----- .../src/com/ibm/wala/j2ee/client/IMethod.java | 56 ------- .../wala/j2ee/client/IProgramLocation.java | 27 ---- .../wala/j2ee/client/J2EEAnalysisEngine.java | 44 ----- .../client/J2EECallGraphBuilderFactory.java | 61 ------- .../j2ee/client/impl/ArrayContentsImpl.java | 51 ------ .../impl/CallGraphBuilderFactoryFactory.java | 46 ------ .../ibm/wala/j2ee/client/impl/ClassImpl.java | 103 ------------ .../ibm/wala/j2ee/client/impl/FieldImpl.java | 50 ------ .../impl/J2EEAbstractAnalysisEngine.java | 150 ------------------ .../ibm/wala/j2ee/client/impl/MemberImpl.java | 53 ------- .../ibm/wala/j2ee/client/impl/MethodImpl.java | 77 --------- .../j2ee/client/impl/ProgramLocation.java | 69 -------- 16 files changed, 892 deletions(-) delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IArrayContents.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IClass.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IField.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IMethod.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IProgramLocation.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/J2EEAnalysisEngine.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/J2EECallGraphBuilderFactory.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/ArrayContentsImpl.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/CallGraphBuilderFactoryFactory.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/ClassImpl.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/FieldImpl.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/J2EEAbstractAnalysisEngine.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/MemberImpl.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/MethodImpl.java delete mode 100644 com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/ProgramLocation.java diff --git a/com.ibm.wala.j2ee/META-INF/MANIFEST.MF b/com.ibm.wala.j2ee/META-INF/MANIFEST.MF index 1211ffe24..3a085c490 100644 --- a/com.ibm.wala.j2ee/META-INF/MANIFEST.MF +++ b/com.ibm.wala.j2ee/META-INF/MANIFEST.MF @@ -7,8 +7,6 @@ Bundle-Vendor: %VENDORNAME Bundle-Localization: plugin Export-Package: ., com.ibm.wala.j2ee, - com.ibm.wala.j2ee.client, - com.ibm.wala.j2ee.client.impl, com.ibm.wala.j2ee.util Require-Bundle: com.ibm.wala.core;visibility:=reexport, org.eclipse.jem;visibility:=reexport, diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IArrayContents.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IArrayContents.java deleted file mode 100644 index bfc3c6e71..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IArrayContents.java +++ /dev/null @@ -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.j2ee.client; - -/** - * - * Interface to information about an array - * - * @author sfink - */ -public interface IArrayContents { - - /** - * @return declared type of this array - */ - IClass getDeclaredClass(); -} \ No newline at end of file diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IClass.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IClass.java deleted file mode 100644 index 64b8418fb..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IClass.java +++ /dev/null @@ -1,39 +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.client; - -/** - * - * Interface to information about a class. - * - * @author sfink - */ -public interface IClass { - /** - * This method returns something like "Primordial" or "Application" - * - * @return String representation of the name of the classloader - */ - public abstract String getClassLoaderName(); - /** - * This method returns something like com.ibm.foo.Foo - * - * @return String representation of the name of the method - */ - public abstract String getName(); - /** - * This method returns something like com.ibm.foo - * - * @return String representation of the name of the package - */ - public abstract String getPackage(); - -} \ No newline at end of file diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IField.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IField.java deleted file mode 100644 index 23a1fb516..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IField.java +++ /dev/null @@ -1,39 +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.client; - -/** - * - * Interface to information about a field. - * - * @author sfink - */ -public interface IField { - /** - * This method returns something of the form com.foo.bar - * - * @return String representation of the declaring class - */ - public abstract IClass getDeclaringClass(); - /** - * This method returns something like "Primordial" or "Application" - * - * @return String representation of the name of the classloader - */ - public abstract String getClassLoaderName(); - /** - * This method returns something like createLargeOrder - * - * @return String representation of the name of the method - */ - public abstract String getName(); - -} \ No newline at end of file diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IMethod.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IMethod.java deleted file mode 100644 index 798991bfa..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IMethod.java +++ /dev/null @@ -1,56 +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.client; - -/** - * Interface to information about a method. - * - * @author sfink - */ -public interface IMethod { - /** - * This method returns something of the form com.foo.bar - * - * @return String representation of the declaring class - */ - public abstract IClass getDeclaringClass(); - /** - * This method returns something like "Primordial" or "Application" - * - * @return String representation of the name of the classloader - */ - public abstract String getClassLoaderName(); - /** - * This method returns something like createLargeOrder - * - * @return String representation of the name of the method - */ - public abstract String getName(); - /** - * A descriptor is a string like: - * (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer; - * @return String representation of the signature - */ - public abstract String getDescriptor(); - /** - * A signature is a string like: - * com.foo.bar.createLargeOrder(IILjava/lang/String;SLjava/sql/Date;)Ljava/lang/Integer; - * @return String representation of the signature - */ - public abstract String getSignature(); - /** - * A selector is a string like: - * createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer; - * @return String representation of the selector - */ - public abstract String getSelector(); -} \ No newline at end of file diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IProgramLocation.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IProgramLocation.java deleted file mode 100644 index 5e745fa31..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/IProgramLocation.java +++ /dev/null @@ -1,27 +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.client; - - -/** - * - * Represents a static program location, a bytecode index in a method - * - * @author sfink - */ -public interface IProgramLocation { - - IMethod getMethod(); - - int getBytecodeIndex(); - - int getLineNumber(); -} diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/J2EEAnalysisEngine.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/J2EEAnalysisEngine.java deleted file mode 100644 index 159c9512d..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/J2EEAnalysisEngine.java +++ /dev/null @@ -1,44 +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.client; - -import java.util.jar.JarFile; - -import com.ibm.wala.classLoader.Module; - -/** - * - * An AnalysisEngine analyzes one or more J2EE modules, including - * ear files, J2EE clients, web modules, and ejb modules. - * - * @author Logan Colby - * @author Stephen Fink - */ - -public interface J2EEAnalysisEngine extends com.ibm.wala.client.AnalysisEngine { - - /** - * Specify the jar file that represent the contents of the j2ee.jar - * that the application relies on - * - * @param libs an array of jar files; for WAS, j2ee.jar and webcontainer.jar - */ - void setJ2EELibraries(JarFile[] libs); - - /** - * Specify the mdoules that represent the contents of the j2ee.jar - * that the application relies on - * - * @param libs an array of Modules; for WAS, j2ee.jar and webcontainer.jar - */ - void setJ2EELibraries(Module[] libs); - -} diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/J2EECallGraphBuilderFactory.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/J2EECallGraphBuilderFactory.java deleted file mode 100644 index 90b8acfc3..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/J2EECallGraphBuilderFactory.java +++ /dev/null @@ -1,61 +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.client; - -import com.ibm.wala.ipa.callgraph.AnalysisCache; -import com.ibm.wala.ipa.callgraph.AnalysisOptions; -import com.ibm.wala.ipa.callgraph.CallGraphBuilder; -import com.ibm.wala.ipa.cha.IClassHierarchy; -import com.ibm.wala.j2ee.DeploymentMetaData; -import com.ibm.wala.j2ee.J2EEAnalysisScope; - -/** - * - * A factory for call graph builders; tailored to J2EE - * - * @author sfink - */ -public interface J2EECallGraphBuilderFactory extends com.ibm.wala.client.CallGraphBuilderFactory { - - public final static String IMPL_PROPERTY = "callGraphBuilderFactoryImplementation"; - - public final static String RTA_BUILDER_FACTORY = "com.ibm.wala.j2ee.client.impl.RTABuilderFactory"; - - public final static String XTA_BUILDER_FACTORY = "com.ibm.wala.j2ee.client.impl.XTABuilderFactory"; - - public final static String XTA_CONTAINER_BUILDER_FACTORY = "com.ibm.wala.j2ee.client.impl.XTAContainerBuilderFactory"; - - public final static String ZERO_CFA_BUILDER_FACTORY = "com.ibm.wala.j2ee.client.impl.ZeroCFABuilderFactory"; - - public final static String ZERO_CONTAINER_CFA_BUILDER_FACTORY = "com.ibm.wala.j2ee.client.impl.ZeroContainerCFABuilderFactory"; - - public final static String ZERO_ONE_CFA_BUILDER_FACTORY = "com.ibm.wala.j2ee.client.impl.ZeroOneCFABuilderFactory"; - - public final static String ZERO_ONE_CONTAINER_CFA_BUILDER_FACTORY = "com.ibm.wala.j2ee.client.impl.ZeroOneContainerCFABuilderFactory"; - - public final static String OBJECT_SENSITIVE_CONTAINER_HACK_CFA_BUILDER_FACTORY = "com.ibm.wala.j2ee.client.impl.ObjectSensitiveContainerHackCFABuilderFactory"; - - /** - * @param options - * options that govern call graph construction - * @param cha - * governing class hierarchy - * @param scope - * representation of the analysis scope - * @param dmd - * deployment descriptor abstraction - * @param keepPointsTo - * preserve PointsTo graph for posterity? - * - */ - CallGraphBuilder make(AnalysisOptions options, AnalysisCache cache, IClassHierarchy cha, J2EEAnalysisScope scope, DeploymentMetaData dmd, - boolean keepPointsTo); -} diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/ArrayContentsImpl.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/ArrayContentsImpl.java deleted file mode 100644 index 68a6b8215..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/ArrayContentsImpl.java +++ /dev/null @@ -1,51 +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.client.impl; - -import com.ibm.wala.j2ee.client.IArrayContents; -import com.ibm.wala.j2ee.client.IClass; - -/** - * - * Object to track array contents in analysis results - * - * @author sfink - */ -public class ArrayContentsImpl implements IArrayContents { - - private final IClass klass; - - public ArrayContentsImpl(IClass klass) { - this.klass = klass; - } - - - public IClass getDeclaredClass() { - return klass; - } - - public String toString() { - return "ArrayContents:" + klass; - } - - public boolean equals(Object arg0) { - if (getClass().equals(arg0.getClass())) { - ArrayContentsImpl that = (ArrayContentsImpl)arg0; - return klass.equals(that.klass); - } else { - return false; - } - } - - public int hashCode() { - return 653 * klass.hashCode(); - } -} diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/CallGraphBuilderFactoryFactory.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/CallGraphBuilderFactoryFactory.java deleted file mode 100644 index 37c803490..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/CallGraphBuilderFactoryFactory.java +++ /dev/null @@ -1,46 +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.client.impl; - -import java.util.Properties; - -import com.ibm.wala.j2ee.client.J2EECallGraphBuilderFactory; -import com.ibm.wala.util.debug.Assertions; - -/** - * - * A factory for creating a call graph builder factory - * - * @author Stephen Fink - */ - -public class CallGraphBuilderFactoryFactory { - - /** - * Construct a CallGraphBuilderFactory - * - * @param props Optionally, influence the construction of the engine. - * @return A non-null AppAnalysisEngine instance. - */ - public static J2EECallGraphBuilderFactory getCallGraphBuilderFactory(Properties props) { - try { - String klass = "com.ibm.wala.j2ee.client.impl.RTABuilderFactory"; - if (props != null) { - klass = props.getProperty("analysis", "com.ibm.wala.j2ee.client.impl.RTABuilderFactory"); - } - return (J2EECallGraphBuilderFactory) Class.forName(klass).newInstance(); - } catch (Exception e) { - e.printStackTrace(); - Assertions.UNREACHABLE(); - return null; - } - } -} diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/ClassImpl.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/ClassImpl.java deleted file mode 100644 index 0141a4825..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/ClassImpl.java +++ /dev/null @@ -1,103 +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.client.impl; - -import com.ibm.wala.j2ee.client.IClass; -import com.ibm.wala.util.ImmutableByteArray; -import com.ibm.wala.util.StringStuff; - -/** - * - * A representation of a class used to communicate analysis results. - * - * @author sfink - */ -public class ClassImpl implements IClass { - - private final String classLoader; - private final String name; - private final String pack; - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - public String toString() { - return name; - } - - public ClassImpl(com.ibm.wala.classLoader.IClass klass) { - this(klass.getReference().getName().toString(),klass.getClassLoader().getName().toString()); - } - - public ClassImpl(String name, String classLoader) { - this.classLoader = classLoader; - this.name = name; - String canon = StringStuff.deployment2CanonicalTypeString(name); - ImmutableByteArray b = StringStuff.parseForPackage(new ImmutableByteArray(canon.getBytes())); - this.pack = (b == null) ? null : b.toString(); - } - - /* - * (non-Javadoc) - * - * @see com.ibm.wala.atk.Method#getClassLoaderName() - */ - - public String getClassLoaderName() { - return classLoader; - } - - /* - * (non-Javadoc) - * - * @see com.ibm.wala.atk.Method#getName() - */ - public String getName() { - return name; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getClassLoaderName().hashCode() * 4003 + getName().hashCode(); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object arg0) { - if (arg0 == null) { - return false; - } - if (getClass().equals(arg0.getClass())) { - ClassImpl other = (ClassImpl) arg0; - return getName().equals(other.getName()) && getClassLoaderName().equals(other.getClassLoaderName()); - } else { - return false; - } - } - - /* - * (non-Javadoc) - * - * @see com.ibm.wala.j2ee.client.IClass#getPackage() - */ - public String getPackage() { - return pack; - } -} \ No newline at end of file diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/FieldImpl.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/FieldImpl.java deleted file mode 100644 index 2f689aadf..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/FieldImpl.java +++ /dev/null @@ -1,50 +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.client.impl; - -import com.ibm.wala.j2ee.client.IField; -import com.ibm.wala.types.FieldReference; - -/** - * - * Object to track a field in analysis results - * - * @author sfink - */ -public class FieldImpl extends MemberImpl implements IField { - - /** - * @param f data structure representing a field - */ - public FieldImpl(FieldReference f) { - super(f); - } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - public String toString() { - return getDeclaringClass() + "." + getName(); - } - /* (non-Javadoc) - * @see com.ibm.wala.j2ee.client.impl.MemberImpl#equals(java.lang.Object) - */ - public boolean equals(Object arg0) { - if (arg0 == null) { - return false; - } - if (getClass().equals(arg0.getClass())) { - FieldImpl other = (FieldImpl)arg0; - return getName().equals(other.getName()) && getClassLoaderName().equals(other.getClassLoaderName()); - } else { - return false; - } - } -} diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/J2EEAbstractAnalysisEngine.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/J2EEAbstractAnalysisEngine.java deleted file mode 100644 index e99c1c8c5..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/J2EEAbstractAnalysisEngine.java +++ /dev/null @@ -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.client.impl; - -import java.io.IOException; -import java.util.Iterator; -import java.util.jar.JarFile; - -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; - -import com.ibm.wala.classLoader.JarFileModule; -import com.ibm.wala.classLoader.Module; -import com.ibm.wala.client.impl.AbstractAnalysisEngine; -import com.ibm.wala.ipa.callgraph.AnalysisOptions; -import com.ibm.wala.ipa.callgraph.CallGraphBuilder; -import com.ibm.wala.ipa.cha.ClassHierarchy; -import com.ibm.wala.j2ee.DeploymentMetaData; -import com.ibm.wala.j2ee.J2EEAnalysisScope; -import com.ibm.wala.j2ee.client.J2EECallGraphBuilderFactory; -import com.ibm.wala.j2ee.client.J2EEAnalysisEngine; -import com.ibm.wala.j2ee.util.TopLevelArchiveModule; -import com.ibm.wala.j2ee.util.TopLevelArchiveModule.BloatedArchiveModule; -import com.ibm.wala.types.ClassLoaderReference; -import com.ibm.wala.util.debug.Assertions; - -/** - * abstract base class for analysis engine implementations - * - * @author sfink - */ -public abstract class J2EEAbstractAnalysisEngine extends AbstractAnalysisEngine implements J2EEAnalysisEngine { - - /** - * A representation of the deployment descriptor - */ - private DeploymentMetaData dmd; - - /** - * The J2EE libraries to analyze - */ - private Module[] j2eeLibs; - - /** - * Should we analyze dependent jar files? - */ - private boolean dependentJars = true; - - protected J2EEAbstractAnalysisEngine() { - } - - protected CallGraphBuilder getCallGraphBuilder(ClassHierarchy cha, AnalysisOptions options) { - return ((J2EECallGraphBuilderFactory) getCallGraphBuilderFactory()).make(options, getCache(), cha, (J2EEAnalysisScope) getScope(), getDmd(), - false); - } - - /** - * Set up the AnalysisScope object - * @throws IOException - */ - protected void buildAnalysisScope() throws IOException { - buildAnalysisScope(null); - } - - /** - * Set up the AnalysisScope object - * @throws IOException - */ - protected void buildAnalysisScope(String exclusionsFile) throws IOException { - // set up the scope of the analysis - ClassLoader cl = J2EEAbstractAnalysisEngine.class.getClassLoader(); - if (j2seLibs == null) { - Assertions.UNREACHABLE("no j2selibs specificed. You probably did not call AppAnalysisEngine.setJ2SELibrary."); - } else if (j2eeLibs == null) { - Assertions.UNREACHABLE("j2ee.jar is null. You probably did not call AnalysisEngine.setJ2EELibrary."); - } else { - scope = J2EEAnalysisScope.make(j2seLibs, j2eeLibs, exclusionsFile, cl, true); - } - - addApplicationModulesToScope(); - } - - /** - * Add the application modules to the analysis scope. - */ - @SuppressWarnings( { "restriction", "unchecked" }) - protected void addApplicationModulesToScope() { - ClassLoaderReference app = scope.getApplicationLoader(); - for (Iterator it = moduleFiles.iterator(); it.hasNext();) { - Archive A = (Archive) it.next(); - // TODO: redesign to avoid holding onto BloatedArchives? - TopLevelArchiveModule M = new BloatedArchiveModule(A); - if (!dependentJars) { - M.setIgnoreDependentJars(true); - } - scope.addToScope(app, M); - } - } - - /* - * @see com.ibm.wala.atk.AppAnalysisEngine#setJ2EELibrary(java.util.jar.JarFile) - */ - public void setJ2EELibraries(JarFile[] libs) { - if (libs == null) { - Assertions.UNREACHABLE("Illegal to setJ2EELibrary(null)"); - } - this.j2eeLibs = new Module[libs.length]; - for (int i = 0; i < libs.length; i++) { - j2eeLibs[i] = new JarFileModule(libs[i]); - } - } - - public void setJ2EELibraries(Module[] libs) { - if (libs == null) { - Assertions.UNREACHABLE("Illegal to setJ2EELibrary(null)"); - } - this.j2eeLibs = new Module[libs.length]; - for (int i = 0; i < libs.length; i++) { - j2eeLibs[i] = libs[i]; - } - } - - - public DeploymentMetaData getDmd() { - return dmd; - } - - - protected void setDmd(DeploymentMetaData dmd) { - this.dmd = dmd; - } - - - public boolean isDependentJars() { - return dependentJars; - } - - - public void setDependentJars(boolean dependentJars) { - this.dependentJars = dependentJars; - } - -} diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/MemberImpl.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/MemberImpl.java deleted file mode 100644 index 4e3abbd55..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/MemberImpl.java +++ /dev/null @@ -1,53 +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.client.impl; - -import com.ibm.wala.j2ee.client.IClass; -import com.ibm.wala.types.MemberReference; - -/** - * - * A representation of a field used to communicate analysis results. - * - * @author sfink - */ -public abstract class MemberImpl { - - private final IClass declaringClass; - private final String name; - - public MemberImpl(MemberReference m) { - this.declaringClass = new ClassImpl(m.getDeclaringClass().getName().toString(),m.getDeclaringClass().getClassLoader().getName().toString()); - this.name = m.getName().toString(); - } - - - public IClass getDeclaringClass() { - return declaringClass; - } - - - public String getClassLoaderName() { - return declaringClass.getClassLoaderName(); - } - - - public String getName() { - return name; - } - - - public int hashCode() { - return getDeclaringClass().hashCode() * 4001 + getClassLoaderName().hashCode() * 4003 + getName().hashCode(); - } - - public abstract boolean equals(Object arg0); -} diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/MethodImpl.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/MethodImpl.java deleted file mode 100644 index cbe87a6d2..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/MethodImpl.java +++ /dev/null @@ -1,77 +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.client.impl; - -import com.ibm.wala.j2ee.client.IMethod; -import com.ibm.wala.types.MethodReference; - -/** - * - * A representation of a method used to communicate analysis results. - * - * @author sfink - */ -public class MethodImpl extends MemberImpl implements IMethod { - - private final String descriptor; - - public MethodImpl(MethodReference M) { - super(M); - descriptor = M.getDescriptor().toString(); - } - - - public String getDescriptor() { - return descriptor; - } - - /** - * A signature is a string like: - * com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer; - * - * @return String representation of the signature - */ - public String getSignature() { - String s = getDeclaringClass().toString().substring(1).replace('/', '.') + "." + getName() + getDescriptor(); - return s; - } - - - public String toString() { - return getSignature(); - } - - - public boolean equals(Object arg0) { - if (arg0 == null) { - return false; - } - if (getClass().equals(arg0.getClass())) { - MethodImpl other = (MethodImpl) arg0; - return getDeclaringClass().equals(other.getDeclaringClass()) && getClassLoaderName().equals(other.getClassLoaderName()) - && getName().equals(other.getName()) && descriptor.equals(other.descriptor); - } else { - return false; - } - } - - - public int hashCode() { - return getDeclaringClass().hashCode() * 4001 + getClassLoaderName().hashCode() * 4003 + getName().hashCode() - + descriptor.hashCode(); - } - - - public String getSelector() { - return getName() + descriptor; - } - -} diff --git a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/ProgramLocation.java b/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/ProgramLocation.java deleted file mode 100644 index 9c3b7a9e4..000000000 --- a/com.ibm.wala.j2ee/src/com/ibm/wala/j2ee/client/impl/ProgramLocation.java +++ /dev/null @@ -1,69 +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.client.impl; - -import com.ibm.wala.j2ee.client.IMethod; -import com.ibm.wala.j2ee.client.IProgramLocation; - -/** - * @author sfink - */ -public class ProgramLocation implements IProgramLocation { - - private final IMethod method; - - private final int bytecodeIndex; - - private final int lineNumber; - - public ProgramLocation(IMethod method, int bytecodeIndex, int lineNumber) { - this.method = method; - this.bytecodeIndex = bytecodeIndex; - this.lineNumber = lineNumber; - } - - /* - * (non-Javadoc) - * - * @see com.ibm.wala.j2ee.client.IProgramLocation#getMethod() - */ - public IMethod getMethod() { - return method; - } - - /* - * (non-Javadoc) - * - * @see com.ibm.wala.j2ee.client.IProgramLocation#getBytecodeIndex() - */ - public int getBytecodeIndex() { - return bytecodeIndex; - } - - /* - * (non-Javadoc) - * - * @see com.ibm.wala.j2ee.client.IProgramLocation#getLineNumber() - */ - public int getLineNumber() { - return lineNumber; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - public String toString() { - return method + "@" + bytecodeIndex + "(line " + lineNumber + ")"; - } - -} \ No newline at end of file