merge changes and changes for atomic sets work
This commit is contained in:
parent
8f2ac704f4
commit
319eacc529
|
@ -6,71 +6,17 @@
|
|||
*****************************************************************************/
|
||||
package com.ibm.wala.cast.java.test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
|
||||
import com.ibm.wala.cast.java.jdt.test.Activator;
|
||||
import com.ibm.wala.cast.java.test.ide.IDEIRTestUtil;
|
||||
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
|
||||
import com.ibm.wala.ide.tests.util.EclipseTestUtil;
|
||||
import com.ibm.wala.ide.util.EclipseFileProvider;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.callgraph.Entrypoint;
|
||||
import com.ibm.wala.ipa.callgraph.impl.Util;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
|
||||
public class JDTJava15IRTests extends IRTests {
|
||||
public class JDTJava15IRTests extends JDTJavaTest {
|
||||
|
||||
public JDTJava15IRTests() {
|
||||
super(JDTJavaIRTests.PROJECT_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void populateScope(JavaSourceAnalysisEngine engine, Collection<String> sources, List<String> libs) throws IOException {
|
||||
IDEIRTestUtil.populateScope(projectName, (JDTJavaSourceAnalysisEngine)engine, sources, libs);
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClass() {
|
||||
EclipseTestUtil.importZippedProject(Activator.getDefault(), JDTJavaIRTests.PROJECT_NAME, JDTJavaIRTests.PROJECT_ZIP, new NullProgressMonitor());
|
||||
System.err.println("finish importing project");
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void afterClass() {
|
||||
EclipseTestUtil.destroyProject(JDTJavaIRTests.PROJECT_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors) {
|
||||
JavaSourceAnalysisEngine engine = new JDTJavaSourceAnalysisEngine(JDTJavaIRTests.PROJECT_NAME) {
|
||||
@Override
|
||||
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
|
||||
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, mainClassDescriptors);
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
engine.setExclusionsFile((new EclipseFileProvider())
|
||||
.getFileFromPlugin(Activator.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
|
||||
} catch (IOException e) {
|
||||
Assert.assertFalse("Cannot find exclusions file", true);
|
||||
}
|
||||
|
||||
return engine;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAnonGeneNullarySimple() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
|
|
|
@ -37,28 +37,13 @@
|
|||
*/
|
||||
package com.ibm.wala.cast.java.test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
|
||||
import com.ibm.wala.cast.java.jdt.test.Activator;
|
||||
import com.ibm.wala.cast.java.test.ide.IDEIRTestUtil;
|
||||
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
|
||||
import com.ibm.wala.ide.tests.util.EclipseTestUtil;
|
||||
import com.ibm.wala.ide.util.EclipseFileProvider;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.callgraph.Entrypoint;
|
||||
import com.ibm.wala.ipa.callgraph.impl.Util;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.client.AbstractAnalysisEngine;
|
||||
|
||||
public class JDTJavaIRTests extends JavaIRTests {
|
||||
|
||||
|
@ -70,38 +55,18 @@ public class JDTJavaIRTests extends JavaIRTests {
|
|||
super(PROJECT_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void populateScope(JavaSourceAnalysisEngine engine, Collection<String> sources, List<String> libs) throws IOException {
|
||||
IDEIRTestUtil.populateScope(projectName, (JDTJavaSourceAnalysisEngine)engine, sources, libs);
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClass() {
|
||||
EclipseTestUtil.importZippedProject(Activator.getDefault(), PROJECT_NAME, PROJECT_ZIP, new NullProgressMonitor());
|
||||
System.err.println("finish importing project");
|
||||
JDTJavaTest.beforeClass();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void afterClass() {
|
||||
EclipseTestUtil.destroyProject(PROJECT_NAME);
|
||||
JDTJavaTest.afterClass();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors) {
|
||||
JavaSourceAnalysisEngine engine = new JDTJavaSourceAnalysisEngine(PROJECT_NAME) {
|
||||
@Override
|
||||
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
|
||||
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, mainClassDescriptors);
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
engine.setExclusionsFile((new EclipseFileProvider())
|
||||
.getFileFromPlugin(Activator.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
|
||||
} catch (IOException e) {
|
||||
Assert.assertFalse("Cannot find exclusions file", true);
|
||||
}
|
||||
|
||||
return engine;
|
||||
protected AbstractAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors, Collection<String> sources, List<String> libs) {
|
||||
return JDTJavaTest.makeAnalysisEngine(mainClassDescriptors, sources, libs);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,43 +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
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* Created on Oct 3, 2005
|
||||
*/
|
||||
package com.ibm.wala.cast.java.test.ide;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.classLoader.JarFileModule;
|
||||
|
||||
public class IDEIRTestUtil {
|
||||
|
||||
public static void populateScope(String projectName, JDTJavaSourceAnalysisEngine engine, Collection<String> sources, List<String> libs) throws IOException {
|
||||
|
||||
boolean foundLib = false;
|
||||
for (String lib : libs) {
|
||||
File libFile = new File(lib);
|
||||
if (libFile.exists()) {
|
||||
foundLib = true;
|
||||
engine.addSystemModule(new JarFileModule(new JarFile(libFile)));
|
||||
}
|
||||
}
|
||||
assert foundLib : "couldn't find library file from " + libs;
|
||||
|
||||
for (String srcFilePath : sources) {
|
||||
engine.addSourceModule(srcFilePath);
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -6,6 +6,9 @@
|
|||
*******************************************************************************/
|
||||
package com.ibm.wala.cast.java.test;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
|
||||
import com.ibm.wala.cast.java.translator.polyglot.PolyglotJavaSourceAnalysisEngine;
|
||||
|
@ -18,13 +21,14 @@ import com.ibm.wala.ipa.cha.IClassHierarchy;
|
|||
public class PolyglotJLexTest extends JLexTest {
|
||||
|
||||
@Override
|
||||
protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors) {
|
||||
protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors, Collection<String> sources, List<String> libs) {
|
||||
JavaSourceAnalysisEngine engine = new PolyglotJavaSourceAnalysisEngine() {
|
||||
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
|
||||
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, new String[] { "LJLex/Main" });
|
||||
}
|
||||
};
|
||||
engine.setExclusionsFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS);
|
||||
populateScope(engine, sources, libs);
|
||||
return engine;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,9 +6,13 @@
|
|||
*******************************************************************************/
|
||||
package com.ibm.wala.cast.java.test;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
|
||||
import com.ibm.wala.cast.java.translator.polyglot.PolyglotJavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.client.AbstractAnalysisEngine;
|
||||
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.callgraph.Entrypoint;
|
||||
|
@ -22,13 +26,14 @@ public class PolyglotJavaIRTests extends JavaIRTests {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors) {
|
||||
protected AbstractAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors, Collection<String> sources, List<String> libs) {
|
||||
JavaSourceAnalysisEngine engine = new PolyglotJavaSourceAnalysisEngine() {
|
||||
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
|
||||
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, mainClassDescriptors);
|
||||
}
|
||||
};
|
||||
engine.setExclusionsFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS);
|
||||
populateScope(engine, sources, libs);
|
||||
return engine;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
*******************************************************************************/
|
||||
package com.ibm.wala.cast.java.test;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.examples.ast.SynchronizedBlockDuplicator;
|
||||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
|
||||
|
@ -23,7 +26,7 @@ import com.ibm.wala.ipa.cha.IClassHierarchy;
|
|||
|
||||
public class PolyglotSyncDuplicatorTest extends SyncDuplicatorTest {
|
||||
|
||||
protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors) {
|
||||
protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors, Collection<String> sources, List<String> libs) {
|
||||
JavaSourceAnalysisEngine engine = new PolyglotJavaSourceAnalysisEngine() {
|
||||
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
|
||||
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, mainClassDescriptors);
|
||||
|
@ -41,6 +44,7 @@ public class PolyglotSyncDuplicatorTest extends SyncDuplicatorTest {
|
|||
|
||||
};
|
||||
engine.setExclusionsFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS);
|
||||
populateScope(engine, sources, libs);
|
||||
return engine;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?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="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -3,8 +3,6 @@ Bundle-ManifestVersion: 2
|
|||
Bundle-Name: Data Plug-in
|
||||
Bundle-SymbolicName: com.ibm.wala.cast.java.test.data
|
||||
Bundle-Version: 1.0.0
|
||||
Bundle-Activator: com.ibm.wala.cast.java.test.data.Activator
|
||||
Bundle-Vendor: IBM
|
||||
Require-Bundle: org.eclipse.core.runtime
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Bundle-ActivationPolicy: lazy
|
||||
|
|
|
@ -47,17 +47,17 @@ package alreadywalaunittests;
|
|||
// invariants and non-invariants (immediate 'new' in that function)
|
||||
// subclasses
|
||||
|
||||
public class InnerClassA {
|
||||
public class InnerClassAA {
|
||||
int a_x;
|
||||
|
||||
public static void main(String args[]) {
|
||||
// prints out 5 5 9 7 5 5 7 5 7 5
|
||||
InnerClassA a = new InnerClassA();
|
||||
InnerClassAA a = new InnerClassAA();
|
||||
a.doAllThis();
|
||||
}
|
||||
|
||||
public void doAllThis() {
|
||||
InnerClassA a = this;
|
||||
InnerClassAA a = this;
|
||||
AA aa = new AA();
|
||||
aa = a.new AA();
|
||||
AB ab = aa.makeAB();
|
||||
|
@ -104,7 +104,7 @@ public class InnerClassA {
|
|||
doMoreWithABSubA(absuba);
|
||||
}
|
||||
|
||||
private void doMoreWithABSubA(InnerClassA.AB.ABSubA absuba) {
|
||||
private void doMoreWithABSubA(InnerClassAA.AB.ABSubA absuba) {
|
||||
System.out.println(absuba.getA_X()); // 5
|
||||
|
||||
AB.ABSubA.ABSubAA absubaa = absuba.new ABSubAA();
|
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
package alreadywalaunittests;
|
||||
|
||||
public class InnerClassSuper {
|
||||
public class InnerClassSuperA {
|
||||
int x = 5;
|
||||
class SuperOuter {
|
||||
public void test() {
|
||||
|
@ -48,10 +48,10 @@ public class InnerClassSuper {
|
|||
new Sub().new SubInner();
|
||||
}
|
||||
}
|
||||
class Sub extends InnerClassSuper {
|
||||
class Sub extends InnerClassSuperA {
|
||||
class SubInner {
|
||||
public SubInner() {
|
||||
InnerClassSuper.SuperOuter so = new InnerClassSuper.SuperOuter();
|
||||
InnerClassSuperA.SuperOuter so = new InnerClassSuperA.SuperOuter();
|
||||
so.test();
|
||||
}
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
* This file is a derivative of code released by the University of
|
||||
* California under the terms listed below.
|
||||
*
|
||||
* WALA JDT Frontend is Copyright (c) 2008 The Regents of the
|
||||
* University of California (Regents). Provided that this notice and
|
||||
* the following two paragraphs are included in any distribution of
|
||||
* Refinement Analysis Tools or its derivative work, Regents agrees
|
||||
* not to assert any of Regents' copyright rights in Refinement
|
||||
* Analysis Tools against recipient for recipient's reproduction,
|
||||
* preparation of derivative works, public display, public
|
||||
* performance, distribution or sublicensing of Refinement Analysis
|
||||
* Tools and derivative works, in source code and object code form.
|
||||
* This agreement not to assert does not confer, by implication,
|
||||
* estoppel, or otherwise any license or rights in any intellectual
|
||||
* property of Regents, including, but not limited to, any patents
|
||||
* of Regents or Regents' employees.
|
||||
*
|
||||
* IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT,
|
||||
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
||||
* INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE
|
||||
* AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY
|
||||
* WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING
|
||||
* DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS
|
||||
* IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
|
||||
* UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||
*/
|
||||
package com.ibm.wala.cast.java.test.data;
|
||||
|
||||
import org.eclipse.core.runtime.Plugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
/**
|
||||
* The activator class controls the plug-in life cycle
|
||||
*/
|
||||
public class Activator extends Plugin {
|
||||
|
||||
// The plug-in ID
|
||||
public static final String PLUGIN_ID = "com.ibm.wala.cast.java.test.data";
|
||||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
public Activator() {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
plugin = this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the shared instance
|
||||
*
|
||||
* @return the shared instance
|
||||
*/
|
||||
public static Activator getDefault() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
}
|
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
package foo.bar.hello.world;
|
||||
|
||||
public class MiniaturList {
|
||||
public class MiniaturList2 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
int a;
|
|
@ -29,6 +29,8 @@ import org.junit.Assert;
|
|||
|
||||
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
|
||||
import com.ibm.wala.cast.loader.AstClass;
|
||||
import com.ibm.wala.cast.loader.AstMethod;
|
||||
import com.ibm.wala.classLoader.IClass;
|
||||
import com.ibm.wala.classLoader.IClassLoader;
|
||||
import com.ibm.wala.classLoader.IMethod;
|
||||
|
@ -36,6 +38,7 @@ import com.ibm.wala.classLoader.JarFileModule;
|
|||
import com.ibm.wala.classLoader.Language;
|
||||
import com.ibm.wala.classLoader.SourceDirectoryTreeModule;
|
||||
import com.ibm.wala.classLoader.SourceFileModule;
|
||||
import com.ibm.wala.client.AbstractAnalysisEngine;
|
||||
import com.ibm.wala.ipa.callgraph.CGNode;
|
||||
import com.ibm.wala.ipa.callgraph.CallGraph;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
|
@ -46,6 +49,7 @@ import com.ibm.wala.types.ClassLoaderReference;
|
|||
import com.ibm.wala.types.MethodReference;
|
||||
import com.ibm.wala.types.TypeName;
|
||||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.CancelException;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.collections.Pair;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
|
@ -110,7 +114,7 @@ public abstract class IRTests {
|
|||
|
||||
public interface IRAssertion {
|
||||
|
||||
void check(CallGraph cg) throws Exception;
|
||||
void check(CallGraph cg);
|
||||
|
||||
}
|
||||
|
||||
|
@ -277,36 +281,46 @@ public abstract class IRTests {
|
|||
return new String[] { "L" + pkgName + "/" + getTestName().substring(4) };
|
||||
}
|
||||
|
||||
protected abstract JavaSourceAnalysisEngine getAnalysisEngine(String[] mainClassDescriptors);
|
||||
protected abstract AbstractAnalysisEngine getAnalysisEngine(String[] mainClassDescriptors, Collection<String> sources, List<String> libs);
|
||||
|
||||
public Pair runTest(Collection<String> sources, List<String> libs, String[] mainClassDescriptors, List<? extends IRAssertion> ca,
|
||||
boolean assertReachable) {
|
||||
try {
|
||||
JavaSourceAnalysisEngine engine = getAnalysisEngine(mainClassDescriptors);
|
||||
AbstractAnalysisEngine engine = getAnalysisEngine(mainClassDescriptors, sources, libs);
|
||||
|
||||
populateScope(engine, sources, libs);
|
||||
CallGraph callGraph;
|
||||
try {
|
||||
callGraph = engine.buildDefaultCallGraph();
|
||||
System.err.println(callGraph.toString());
|
||||
|
||||
CallGraph callGraph = engine.buildDefaultCallGraph();
|
||||
System.err.println(callGraph.toString());
|
||||
// If we've gotten this far, IR has been produced.
|
||||
dumpIR(callGraph, sources, assertReachable);
|
||||
|
||||
// If we've gotten this far, IR has been produced.
|
||||
dumpIR(callGraph, assertReachable);
|
||||
// Now check any assertions as to source mapping
|
||||
for (IRAssertion IRAssertion : ca) {
|
||||
IRAssertion.check(callGraph);
|
||||
}
|
||||
|
||||
// Now check any assertions as to source mapping
|
||||
for (IRAssertion IRAssertion : ca) {
|
||||
IRAssertion.check(callGraph);
|
||||
return Pair.make(callGraph, engine.getPointerAnalysis());
|
||||
} catch (IllegalArgumentException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (CancelException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return Pair.make(callGraph, engine.getPointerAnalysis());
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Assert.assertTrue(e.toString(), false);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected static void dumpIR(CallGraph cg, boolean assertReachable) throws IOException {
|
||||
protected static void dumpIR(CallGraph cg, Collection<String> sources, boolean assertReachable) throws IOException {
|
||||
Set<String> sourcePaths = HashSetFactory.make();
|
||||
for(String src : sources) {
|
||||
sourcePaths.add(src.substring(src.lastIndexOf(File.separator)+1));
|
||||
}
|
||||
|
||||
Set<IMethod> unreachable = HashSetFactory.make();
|
||||
IClassHierarchy cha = cg.getClassHierarchy();
|
||||
IClassLoader sourceLoader = cha.getLoader(JavaSourceAnalysisScope.SOURCE);
|
||||
|
@ -323,8 +337,13 @@ public abstract class IRTests {
|
|||
} else {
|
||||
Iterator nodeIter = cg.getNodes(m.getReference()).iterator();
|
||||
if (!nodeIter.hasNext()) {
|
||||
System.err.println(("Method " + m.getReference() + " not reachable?"));
|
||||
unreachable.add(m);
|
||||
if (m instanceof AstMethod) {
|
||||
String fn = ((AstClass)m.getDeclaringClass()).getSourcePosition().getURL().getFile();
|
||||
if (sourcePaths.contains(fn.substring(fn.lastIndexOf(File.separator)+1))) {
|
||||
System.err.println(("Method " + m.getReference() + " not reachable?"));
|
||||
unreachable.add(m);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
CGNode node = (CGNode) nodeIter.next();
|
||||
|
@ -378,13 +397,17 @@ public abstract class IRTests {
|
|||
return null;
|
||||
}
|
||||
|
||||
protected void populateScope(JavaSourceAnalysisEngine engine, Collection<String> sources, List<String> libs) throws IOException {
|
||||
protected void populateScope(JavaSourceAnalysisEngine engine, Collection<String> sources, List<String> libs) {
|
||||
boolean foundLib = false;
|
||||
for (String lib : libs) {
|
||||
File libFile = new File(lib);
|
||||
if (libFile.exists()) {
|
||||
foundLib = true;
|
||||
engine.addSystemModule(new JarFileModule(new JarFile(libFile)));
|
||||
try {
|
||||
engine.addSystemModule(new JarFileModule(new JarFile(libFile)));
|
||||
} catch (IOException e) {
|
||||
Assert.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
assert foundLib : "couldn't find library file from " + libs;
|
||||
|
|
|
@ -84,7 +84,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
|
||||
new IRAssertion() {
|
||||
|
||||
public void check(CallGraph cg) throws Exception {
|
||||
public void check(CallGraph cg) {
|
||||
final String typeStr = singleInputForTest();
|
||||
|
||||
final TypeReference type = findOrCreateTypeReference("Source", typeStr, cg.getClassHierarchy());
|
||||
|
@ -92,6 +92,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
final IClass iClass = cg.getClassHierarchy().lookupClass(type);
|
||||
Assert.assertNotNull("Could not find class " + typeStr, iClass);
|
||||
|
||||
/*
|
||||
Assert.assertEquals("Expected two classes.", iClass.getClassLoader().getNumberOfClasses(), 2);
|
||||
|
||||
for (Iterator<IClass> it = iClass.getClassLoader().iterateAllClasses(); it.hasNext();) {
|
||||
|
@ -101,6 +102,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
.equals(typeStr)
|
||||
|| cls.getName().getClassName().toString().equals("Bar"));
|
||||
}
|
||||
*/
|
||||
}
|
||||
}), true);
|
||||
}
|
||||
|
@ -113,7 +115,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
*/
|
||||
new IRAssertion() {
|
||||
|
||||
public void check(CallGraph cg) throws Exception {
|
||||
public void check(CallGraph cg) {
|
||||
final String typeStr = "IFoo";
|
||||
|
||||
final TypeReference type = findOrCreateTypeReference("Source", typeStr, cg.getClassHierarchy());
|
||||
|
@ -130,7 +132,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
*/
|
||||
new IRAssertion() {
|
||||
|
||||
public void check(CallGraph cg) throws Exception {
|
||||
public void check(CallGraph cg) {
|
||||
final String typeStr = "FooIT1";
|
||||
|
||||
final TypeReference type = findOrCreateTypeReference("Source", typeStr, cg.getClassHierarchy());
|
||||
|
@ -155,7 +157,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
*/
|
||||
new IRAssertion() {
|
||||
|
||||
public void check(CallGraph cg) throws Exception {
|
||||
public void check(CallGraph cg) {
|
||||
final String typeStr = "Derived";
|
||||
|
||||
final TypeReference type = findOrCreateTypeReference("Source", typeStr, cg.getClassHierarchy());
|
||||
|
@ -184,7 +186,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
*/
|
||||
new IRAssertion() {
|
||||
|
||||
public void check(CallGraph cg) throws Exception {
|
||||
public void check(CallGraph cg) {
|
||||
|
||||
MethodReference mref = descriptorToMethodRef("Source#Array1#foo#()V", cg.getClassHierarchy());
|
||||
|
||||
|
@ -213,7 +215,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
*/
|
||||
new IRAssertion() {
|
||||
|
||||
public void check(CallGraph cg) throws Exception {
|
||||
public void check(CallGraph cg) {
|
||||
|
||||
MethodReference mref = descriptorToMethodRef("Source#ArrayLiteral1#main#([Ljava/lang/String;)V", cg.getClassHierarchy());
|
||||
|
||||
|
@ -234,7 +236,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
*/
|
||||
new IRAssertion() {
|
||||
|
||||
public void check(CallGraph cg) throws Exception {
|
||||
public void check(CallGraph cg) {
|
||||
|
||||
MethodReference mref = descriptorToMethodRef("Source#ArrayLiteral2#main#([Ljava/lang/String;)V", cg.getClassHierarchy());
|
||||
|
||||
|
@ -295,7 +297,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
*/
|
||||
new IRAssertion() {
|
||||
|
||||
public void check(CallGraph cg) throws Exception {
|
||||
public void check(CallGraph cg) {
|
||||
|
||||
MethodReference mref = descriptorToMethodRef("Source#QualifiedStatic#main#([Ljava/lang/String;)V", cg.getClassHierarchy());
|
||||
|
||||
|
@ -317,7 +319,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
|
||||
new IRAssertion() {
|
||||
|
||||
public void check(CallGraph cg) throws Exception {
|
||||
public void check(CallGraph cg) {
|
||||
final String typeStr = singleInputForTest() + "$WhatsIt";
|
||||
|
||||
final TypeReference type = findOrCreateTypeReference("Source", typeStr, cg.getClassHierarchy());
|
||||
|
@ -347,7 +349,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
|
||||
new IRAssertion() {
|
||||
|
||||
public void check(CallGraph cg) throws Exception {
|
||||
public void check(CallGraph cg) {
|
||||
final String typeStr = singleInputForTest();
|
||||
|
||||
final TypeReference type = findOrCreateTypeReference("Source", typeStr + "$WhatsIt", cg.getClassHierarchy());
|
||||
|
@ -463,7 +465,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
* Classes local to method are enclosed in the class the methods belong
|
||||
* to.
|
||||
*/
|
||||
public void check(CallGraph cg) throws Exception {
|
||||
public void check(CallGraph cg) {
|
||||
final String typeStr = singleInputForTest();
|
||||
final String localClassStr = "Foo";
|
||||
|
||||
|
@ -499,7 +501,7 @@ public abstract class JavaIRTests extends IRTests {
|
|||
|
||||
new IRAssertion() {
|
||||
|
||||
public void check(CallGraph cg) throws Exception {
|
||||
public void check(CallGraph cg) {
|
||||
final String typeStr = singleInputForTest();
|
||||
|
||||
final TypeReference type = findOrCreateTypeReference("Source", typeStr, cg.getClassHierarchy());
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="harness-src"/>
|
||||
<classpathentry kind="lib" path="/com.ibm.wala.cast.js.test.data/examples-src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1046,7 +1046,14 @@ public class RhinoToAstTranslator {
|
|||
|
||||
@Override
|
||||
public CAstNode visitLabeledStatement(LabeledStatement node, WalkContext arg) {
|
||||
CAstNode result = visit(node.getStatement(), arg);
|
||||
ExpressionStatement ex = new ExpressionStatement();
|
||||
ex.setExpression(new EmptyExpression());
|
||||
CAstNode exNode = visit(ex, arg);
|
||||
arg.cfg().map(ex, exNode);
|
||||
|
||||
WalkContext labelBodyContext = makeBreakContext(node, arg, ex);
|
||||
|
||||
CAstNode result = visit(node.getStatement(), labelBodyContext);
|
||||
|
||||
AstNode prev = node;
|
||||
for(Label label : node.getLabels()) {
|
||||
|
@ -1055,7 +1062,7 @@ public class RhinoToAstTranslator {
|
|||
prev = label;
|
||||
}
|
||||
|
||||
return result;
|
||||
return Ast.makeNode(CAstNode.BLOCK_STMT, result, exNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,8 +2,9 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Eclipse-LazyStart: true
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: com.ibm.wala.cast.js.test.data
|
||||
Bundle-SymbolicName: com.ibm.wala.cast.js.test.data;singleton:=true
|
||||
Bundle-Version: 1.1.3.qualifier
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: examples-src/
|
||||
|
|
|
@ -27,6 +27,7 @@ import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
|||
import com.ibm.wala.ipa.callgraph.CallGraph;
|
||||
import com.ibm.wala.ipa.callgraph.CallGraphBuilder;
|
||||
import com.ibm.wala.ipa.callgraph.Entrypoint;
|
||||
import com.ibm.wala.ipa.callgraph.impl.SetOfClasses;
|
||||
import com.ibm.wala.ipa.callgraph.impl.Util;
|
||||
import com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis;
|
||||
import com.ibm.wala.ipa.cha.ClassHierarchy;
|
||||
|
@ -166,12 +167,13 @@ public abstract class AbstractAnalysisEngine implements AnalysisEngine {
|
|||
addApplicationModulesToScope();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return a IClassHierarchy object for this analysis scope
|
||||
*/
|
||||
public IClassHierarchy buildClassHierarchy() {
|
||||
IClassHierarchy cha = null;
|
||||
ClassLoaderFactory factory = new ClassLoaderFactoryImpl(getScope().getExclusions());
|
||||
ClassLoaderFactory factory = makeClassLoaderFactory(getScope().getExclusions());
|
||||
try {
|
||||
cha = ClassHierarchy.make(getScope(), factory);
|
||||
} catch (ClassHierarchyException e) {
|
||||
|
@ -182,6 +184,10 @@ public abstract class AbstractAnalysisEngine implements AnalysisEngine {
|
|||
return cha;
|
||||
}
|
||||
|
||||
protected ClassLoaderFactory makeClassLoaderFactory(SetOfClasses exclusions) {
|
||||
return new ClassLoaderFactoryImpl(exclusions);
|
||||
}
|
||||
|
||||
public IClassHierarchy getClassHierarchy() {
|
||||
return cha;
|
||||
}
|
||||
|
|
|
@ -38,8 +38,6 @@ public abstract class SSANewInstruction extends SSAInstruction {
|
|||
if (site == null) {
|
||||
throw new IllegalArgumentException("site cannot be null");
|
||||
}
|
||||
assert !site.getDeclaredType().isArrayType()
|
||||
|| site.getDeclaredType().getClassLoader().getLanguage() != ClassLoaderReference.Java;
|
||||
this.result = result;
|
||||
this.site = site;
|
||||
this.params = null;
|
||||
|
|
|
@ -433,6 +433,9 @@ public class StringStuff {
|
|||
default:
|
||||
throw new IllegalArgumentException("ill-formed array descriptor " + b);
|
||||
}
|
||||
} else {
|
||||
// type codes must be at the start of the descriptor; if we see something else, stop
|
||||
break;
|
||||
}
|
||||
}
|
||||
return code;
|
||||
|
|
|
@ -37,58 +37,63 @@
|
|||
*/
|
||||
package com.ibm.wala.cast.java.client;
|
||||
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.jdt.core.IJavaProject;
|
||||
|
||||
import com.ibm.wala.cast.java.client.impl.ZeroCFABuilderFactory;
|
||||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
|
||||
import com.ibm.wala.cast.java.translator.jdt.JDTClassLoaderFactory;
|
||||
import com.ibm.wala.classLoader.ClassLoaderFactory;
|
||||
import com.ibm.wala.ide.classloader.EclipseSourceFileModule;
|
||||
import com.ibm.wala.ide.client.EclipseProjectSourceAnalysisEngine;
|
||||
import com.ibm.wala.ide.util.EclipseProjectPath;
|
||||
import com.ibm.wala.ide.util.EclipseProjectPath.AnalysisScopeType;
|
||||
import com.ibm.wala.ide.util.JavaEclipseProjectPath;
|
||||
import com.ibm.wala.ide.util.JdtUtil;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisCache;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.callgraph.CallGraphBuilder;
|
||||
import com.ibm.wala.ipa.callgraph.impl.SetOfClasses;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.types.ClassLoaderReference;
|
||||
|
||||
public class JDTJavaSourceAnalysisEngine extends JavaSourceAnalysisEngine {
|
||||
protected final IJavaProject project;
|
||||
public class JDTJavaSourceAnalysisEngine extends EclipseProjectSourceAnalysisEngine<IJavaProject> {
|
||||
|
||||
public JDTJavaSourceAnalysisEngine(IJavaProject project) {
|
||||
super();
|
||||
this.project = project;
|
||||
public JDTJavaSourceAnalysisEngine(IJavaProject project) throws IOException, CoreException {
|
||||
super(project);
|
||||
}
|
||||
|
||||
public JDTJavaSourceAnalysisEngine(String projectName) {
|
||||
public JDTJavaSourceAnalysisEngine(String projectName) throws IOException, CoreException {
|
||||
this(JdtUtil.getNamedProject(projectName));
|
||||
}
|
||||
|
||||
protected ClassLoaderFactory getClassLoaderFactory(SetOfClasses exclusions) {
|
||||
return new JDTClassLoaderFactory(exclusions);
|
||||
@Override
|
||||
protected ClassLoaderFactory makeClassLoaderFactory(SetOfClasses exclusions) {
|
||||
return new JDTClassLoaderFactory(exclusions);
|
||||
}
|
||||
|
||||
public void addSourceModule(IResource file) {
|
||||
IProject proj = project.getProject();
|
||||
IPath path = file.getProjectRelativePath();
|
||||
if (file.getType() == IResource.FILE) {
|
||||
addSourceModule(EclipseSourceFileModule.createEclipseSourceFileModule(proj.getFile(path)));
|
||||
} else {
|
||||
assert file.getType() == IResource.FOLDER;
|
||||
IFolder dir = proj.getFolder(path);
|
||||
try {
|
||||
for(IResource x : dir.members()) {
|
||||
assert x.getType() == IResource.FILE || x.getType() == IResource.FOLDER;
|
||||
addSourceModule(x);
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
throw new RuntimeException("trouble with " + file, e);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected AnalysisScope makeAnalysisScope() {
|
||||
return new JavaSourceAnalysisScope();
|
||||
}
|
||||
|
||||
public void addSourceModule(String fileName) {
|
||||
IResource file = project.getProject().findMember(fileName);
|
||||
assert file != null;
|
||||
addSourceModule(file);
|
||||
@Override
|
||||
protected ClassLoaderReference getSourceLoader() {
|
||||
return JavaSourceAnalysisScope.SOURCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected EclipseProjectPath<?, IJavaProject> createProjectPath(
|
||||
IJavaProject project) throws IOException, CoreException {
|
||||
return JavaEclipseProjectPath.make(project, AnalysisScopeType.SOURCE_FOR_PROJ_AND_LINKED_PROJS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CallGraphBuilder getCallGraphBuilder(IClassHierarchy cha,
|
||||
AnalysisOptions options, AnalysisCache cache) {
|
||||
return new ZeroCFABuilderFactory().make(options, cache, cha, scope, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -37,10 +37,6 @@
|
|||
*/
|
||||
package com.ibm.wala.cast.java.translator.jdt;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
@ -52,6 +48,7 @@ import java.util.LinkedHashSet;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.jdt.core.dom.AST;
|
||||
import org.eclipse.jdt.core.dom.ASTNode;
|
||||
import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
|
||||
|
@ -140,7 +137,6 @@ import com.ibm.wala.cast.tree.CAstNode;
|
|||
import com.ibm.wala.cast.tree.CAstNodeTypeMap;
|
||||
import com.ibm.wala.cast.tree.CAstQualifier;
|
||||
import com.ibm.wala.cast.tree.CAstSourcePositionMap;
|
||||
import com.ibm.wala.cast.tree.CAstSourcePositionMap.Position;
|
||||
import com.ibm.wala.cast.tree.CAstType;
|
||||
import com.ibm.wala.cast.tree.impl.CAstControlFlowRecorder;
|
||||
import com.ibm.wala.cast.tree.impl.CAstImpl;
|
||||
|
@ -149,6 +145,7 @@ import com.ibm.wala.cast.tree.impl.CAstOperator;
|
|||
import com.ibm.wala.cast.tree.impl.CAstSourcePositionRecorder;
|
||||
import com.ibm.wala.cast.tree.impl.CAstSymbolImpl;
|
||||
import com.ibm.wala.classLoader.CallSiteReference;
|
||||
import com.ibm.wala.ide.util.JdtPosition;
|
||||
import com.ibm.wala.shrikeBT.IInvokeInstruction;
|
||||
import com.ibm.wala.types.FieldReference;
|
||||
import com.ibm.wala.types.MethodReference;
|
||||
|
@ -182,39 +179,41 @@ public class JDTJava2CAstTranslator {
|
|||
// ///////////////////////////////////////////
|
||||
// / HANDLINGS OF VARIOUS THINGS //
|
||||
// ///////////////////////////////////////////
|
||||
protected AST ast; // TAGALONG
|
||||
protected final AST ast; // TAGALONG
|
||||
|
||||
protected JDTIdentityMapper fIdentityMapper; // TAGALONG
|
||||
protected final JDTIdentityMapper fIdentityMapper; // TAGALONG
|
||||
|
||||
protected JDTTypeDictionary fTypeDict;
|
||||
protected final JDTTypeDictionary fTypeDict;
|
||||
|
||||
protected JavaSourceLoaderImpl fSourceLoader;
|
||||
protected final JavaSourceLoaderImpl fSourceLoader;
|
||||
|
||||
protected ITypeBinding fDivByZeroExcType;
|
||||
protected final ITypeBinding fDivByZeroExcType;
|
||||
|
||||
protected ITypeBinding fNullPointerExcType;
|
||||
protected final ITypeBinding fNullPointerExcType;
|
||||
|
||||
protected ITypeBinding fClassCastExcType;
|
||||
protected final ITypeBinding fClassCastExcType;
|
||||
|
||||
protected ITypeBinding fRuntimeExcType;
|
||||
protected final ITypeBinding fRuntimeExcType;
|
||||
|
||||
protected ITypeBinding NoClassDefFoundError;
|
||||
protected final ITypeBinding NoClassDefFoundError;
|
||||
|
||||
protected ITypeBinding ExceptionInInitializerError;
|
||||
protected final ITypeBinding ExceptionInInitializerError;
|
||||
|
||||
protected ITypeBinding OutOfMemoryError;
|
||||
protected final ITypeBinding OutOfMemoryError;
|
||||
|
||||
protected DoLoopTranslator doLoopTranslator;
|
||||
protected final DoLoopTranslator doLoopTranslator;
|
||||
|
||||
private String fullPath;
|
||||
private final String fullPath;
|
||||
|
||||
private final IFile sourceFile;
|
||||
|
||||
private CompilationUnit cu;
|
||||
private final CompilationUnit cu;
|
||||
|
||||
//
|
||||
// COMPILATION UNITS & TYPES
|
||||
//
|
||||
|
||||
public JDTJava2CAstTranslator(JavaSourceLoaderImpl sourceLoader, CompilationUnit astRoot, String fullPath, boolean replicateForDoLoops) {
|
||||
public JDTJava2CAstTranslator(JavaSourceLoaderImpl sourceLoader, CompilationUnit astRoot, IFile sourceFile, String fullPath, boolean replicateForDoLoops) {
|
||||
fDivByZeroExcType = FakeExceptionTypeBinding.arithmetic;
|
||||
fNullPointerExcType = FakeExceptionTypeBinding.nullPointer;
|
||||
fClassCastExcType = FakeExceptionTypeBinding.classCast;
|
||||
|
@ -222,6 +221,7 @@ public class JDTJava2CAstTranslator {
|
|||
ExceptionInInitializerError = FakeExceptionTypeBinding.initException;
|
||||
OutOfMemoryError = FakeExceptionTypeBinding.outOfMemory;
|
||||
|
||||
this.sourceFile = sourceFile;
|
||||
this.fSourceLoader = sourceLoader;
|
||||
this.cu = astRoot;
|
||||
|
||||
|
@ -646,6 +646,7 @@ public class JDTJava2CAstTranslator {
|
|||
// process Object in source...
|
||||
|
||||
ITypeBinding superType = classBinding.getSuperclass();
|
||||
|
||||
// find default constructor. IT is an error to have a constructor
|
||||
// without super() when the default constructor of the superclass does not exist.
|
||||
IMethodBinding defaultSuperCtor = findDefaultCtor(superType);
|
||||
|
@ -3145,71 +3146,10 @@ public class JDTJava2CAstTranslator {
|
|||
}
|
||||
|
||||
public JdtPosition makePosition(int start, int end) {
|
||||
return new JdtPosition(start, end, cu.getLineNumber(start), cu.getLineNumber(end), fullPath);
|
||||
return new JdtPosition(start, end, cu.getLineNumber(start), cu.getLineNumber(end), sourceFile, fullPath);
|
||||
}
|
||||
|
||||
public static class JdtPosition implements Position {
|
||||
private int firstOffset;
|
||||
|
||||
private int lastOffset;
|
||||
|
||||
private int firstLine, lastLine;
|
||||
|
||||
private String path;
|
||||
|
||||
public JdtPosition(int start, int end, int startLine, int endLine, String path) {
|
||||
firstOffset = start;
|
||||
lastOffset = end;
|
||||
firstLine = startLine;
|
||||
lastLine = endLine;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public int getFirstCol() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int getFirstLine() {
|
||||
return firstLine;
|
||||
}
|
||||
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getLastCol() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int getLastLine() {
|
||||
return lastLine;
|
||||
}
|
||||
|
||||
public URL getURL() {
|
||||
try {
|
||||
return new URL("file:" + path);
|
||||
} catch (MalformedURLException e) {
|
||||
Assertions.UNREACHABLE(e.toString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public int compareTo(Object arg0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getFirstOffset() {
|
||||
return firstOffset;
|
||||
}
|
||||
|
||||
public int getLastOffset() {
|
||||
return lastOffset;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "[offset " + firstOffset + ":" + lastOffset + "]";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
// // ENUM TRANSFORMATION //////////////////////////////////////////
|
||||
|
|
|
@ -44,6 +44,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.jdt.core.ICompilationUnit;
|
||||
import org.eclipse.jdt.core.JavaCore;
|
||||
|
@ -141,7 +142,7 @@ public class JDTSourceModuleTranslator implements SourceModuleTranslator {
|
|||
public void acceptAST(ICompilationUnit source, CompilationUnit ast) {
|
||||
|
||||
try {
|
||||
JDTJava2CAstTranslator jdt2cast = makeCAstTranslator(ast, source.getUnderlyingResource().getLocation().toOSString());
|
||||
JDTJava2CAstTranslator jdt2cast = makeCAstTranslator(ast, proj.getValue().get(source).getIFile(), source.getUnderlyingResource().getLocation().toOSString());
|
||||
final Java2IRTranslator java2ir = makeIRTranslator();
|
||||
java2ir.translate(proj.getValue().get(source), jdt2cast.translateToCAst());
|
||||
} catch (JavaModelException e) {
|
||||
|
@ -169,8 +170,8 @@ public class JDTSourceModuleTranslator implements SourceModuleTranslator {
|
|||
return new Java2IRTranslator(sourceLoader);
|
||||
}
|
||||
|
||||
protected JDTJava2CAstTranslator makeCAstTranslator(CompilationUnit cu, String fullPath) {
|
||||
return new JDTJava2CAstTranslator(sourceLoader, cu, fullPath, false);
|
||||
protected JDTJava2CAstTranslator makeCAstTranslator(CompilationUnit cu, IFile sourceFile, String fullPath) {
|
||||
return new JDTJava2CAstTranslator(sourceLoader, cu, sourceFile, fullPath, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,15 +1,42 @@
|
|||
package com.ibm.wala.ide.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.jdt.core.IClasspathContainer;
|
||||
import org.eclipse.jdt.core.IClasspathEntry;
|
||||
import org.eclipse.jdt.core.IJavaProject;
|
||||
import org.eclipse.jdt.core.JavaCore;
|
||||
import org.eclipse.jdt.core.JavaModelException;
|
||||
|
||||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
|
||||
import com.ibm.wala.classLoader.BinaryDirectoryTreeModule;
|
||||
import com.ibm.wala.classLoader.Module;
|
||||
import com.ibm.wala.types.ClassLoaderReference;
|
||||
import com.ibm.wala.util.collections.MapUtil;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
|
||||
public class JavaEclipseProjectPath extends EclipseProjectPath<IClasspathEntry, IJavaProject> {
|
||||
|
||||
public enum JavaSourceLoader implements ILoader {
|
||||
SOURCE(JavaSourceAnalysisScope.SOURCE);
|
||||
|
||||
private ClassLoaderReference ref;
|
||||
|
||||
JavaSourceLoader(ClassLoaderReference ref) {
|
||||
this.ref = ref;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassLoaderReference ref() {
|
||||
return ref;
|
||||
}
|
||||
}
|
||||
|
||||
protected JavaEclipseProjectPath(IProject project, com.ibm.wala.ide.util.EclipseProjectPath.AnalysisScopeType scopeType)
|
||||
throws IOException, CoreException {
|
||||
super(project, scopeType);
|
||||
|
@ -37,16 +64,50 @@ public class JavaEclipseProjectPath extends EclipseProjectPath<IClasspathEntry,
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void resolveClasspathEntry(IJavaProject project, IClasspathEntry entry,
|
||||
com.ibm.wala.ide.util.EclipseProjectPath.ILoader loader, boolean includeSource, boolean cpeFromMainProject) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
protected void resolveClasspathEntry(IJavaProject project, IClasspathEntry entry, ILoader loader, boolean includeSource, boolean cpeFromMainProject) {
|
||||
entry = JavaCore.getResolvedClasspathEntry(entry);
|
||||
switch (entry.getEntryKind()) {
|
||||
case IClasspathEntry.CPE_SOURCE: {
|
||||
resolveSourcePathEntry(includeSource? JavaSourceLoader.SOURCE: Loader.APPLICATION, includeSource, cpeFromMainProject, entry.getPath(), entry.getOutputLocation(), "java");
|
||||
break;
|
||||
}
|
||||
case IClasspathEntry.CPE_LIBRARY: {
|
||||
resolveLibraryPathEntry(loader, entry.getPath());
|
||||
break;
|
||||
}
|
||||
case IClasspathEntry.CPE_PROJECT: {
|
||||
resolveProjectPathEntry(loader, includeSource, entry.getPath());
|
||||
break;
|
||||
}
|
||||
case IClasspathEntry.CPE_CONTAINER: {
|
||||
try {
|
||||
IClasspathContainer cont = JavaCore.getClasspathContainer(entry.getPath(), project);
|
||||
IClasspathEntry[] entries = cont.getClasspathEntries();
|
||||
resolveClasspathEntries(project, Arrays.asList(entries), cont.getKind() == IClasspathContainer.K_APPLICATION ? loader : Loader.PRIMORDIAL,
|
||||
includeSource, false);
|
||||
} catch (CoreException e) {
|
||||
System.err.println(e);
|
||||
Assertions.UNREACHABLE();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void resolveProjectClasspathEntries(IJavaProject project, boolean includeSource) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
try {
|
||||
resolveClasspathEntries(project, Arrays.asList(project.getRawClasspath()), Loader.EXTENSION, includeSource, true);
|
||||
File output = makeAbsolute(project.getOutputLocation()).toFile();
|
||||
if (!includeSource) {
|
||||
if (output.exists()) {
|
||||
List<Module> s = MapUtil.findOrCreateList(modules, Loader.APPLICATION);
|
||||
s.add(new BinaryDirectoryTreeModule(output));
|
||||
}
|
||||
}
|
||||
} catch (JavaModelException e) {
|
||||
e.printStackTrace();
|
||||
Assertions.UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.eclipse.core.resources.IWorkspaceRoot;
|
|||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.jdt.core.ICompilationUnit;
|
||||
import org.eclipse.jdt.core.IJavaElement;
|
||||
import org.eclipse.jdt.core.IJavaModel;
|
||||
|
@ -33,6 +34,10 @@ import org.eclipse.jdt.core.ITypeParameter;
|
|||
import org.eclipse.jdt.core.JavaCore;
|
||||
import org.eclipse.jdt.core.JavaModelException;
|
||||
import org.eclipse.jdt.core.Signature;
|
||||
import org.eclipse.jdt.core.dom.AST;
|
||||
import org.eclipse.jdt.core.dom.ASTNode;
|
||||
import org.eclipse.jdt.core.dom.ASTParser;
|
||||
import org.eclipse.jdt.core.dom.NodeFinder;
|
||||
import org.eclipse.jdt.core.search.IJavaSearchConstants;
|
||||
import org.eclipse.jdt.core.search.IJavaSearchScope;
|
||||
import org.eclipse.jdt.core.search.SearchEngine;
|
||||
|
@ -572,4 +577,21 @@ public class JdtUtil {
|
|||
return helloWorldProject;
|
||||
}
|
||||
|
||||
public static ASTNode getAST(IFile javaSourceFile) {
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS3);
|
||||
parser.setSource(JavaCore.createCompilationUnitFrom(javaSourceFile));
|
||||
parser.setProject(JavaCore.create(javaSourceFile.getProject()));
|
||||
parser.setResolveBindings(true);
|
||||
return parser.createAST(new NullProgressMonitor());
|
||||
}
|
||||
|
||||
public static ASTNode getOriginalNode(JdtPosition pos) {
|
||||
ASTNode root = getAST(pos.getEclipseFile());
|
||||
return getOriginalNode(root, pos);
|
||||
}
|
||||
|
||||
public static ASTNode getOriginalNode(ASTNode root, JdtPosition pos) {
|
||||
return NodeFinder.perform(root, pos.getFirstOffset(), pos.getLastOffset()-pos.getFirstOffset());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public class EclipseJavaScriptAnalysisEngine extends EclipseProjectSourceAnalysi
|
|||
}
|
||||
|
||||
@Override
|
||||
protected AnalysisScope makeSourceAnalysisScope() {
|
||||
protected AnalysisScope makeAnalysisScope() {
|
||||
return new CAstAnalysisScope(new JavaScriptLoaderFactory(new CAstRhinoTranslatorFactory()), Collections.singleton(JavaScriptLoader.JS));
|
||||
}
|
||||
|
||||
|
|
|
@ -21,34 +21,43 @@ import com.ibm.wala.client.AbstractAnalysisEngine;
|
|||
import com.ibm.wala.ide.util.EclipseProjectPath;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisCache;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.callgraph.CallGraphBuilder;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.util.config.FileOfClasses;
|
||||
|
||||
abstract public class EclipseProjectAnalysisEngine<P> extends AbstractAnalysisEngine {
|
||||
|
||||
protected final P project;
|
||||
|
||||
protected final IPath workspaceRootPath;
|
||||
|
||||
protected final EclipseProjectPath ePath;
|
||||
protected final EclipseProjectPath<?,P> ePath;
|
||||
|
||||
public EclipseProjectAnalysisEngine(P project) throws IOException, CoreException {
|
||||
super();
|
||||
this.project = project;
|
||||
this.workspaceRootPath = ResourcesPlugin.getWorkspace().getRoot().getLocation();
|
||||
assert project != null;
|
||||
assert workspaceRootPath != null;
|
||||
this.ePath = createProjectPath(project);
|
||||
// setCallGraphBuilderFactory(new ZeroCFABuilderFactory());
|
||||
}
|
||||
|
||||
abstract protected EclipseProjectPath createProjectPath(P project) throws IOException, CoreException;
|
||||
abstract protected EclipseProjectPath<?,P> createProjectPath(P project) throws IOException, CoreException;
|
||||
|
||||
abstract protected CallGraphBuilder getCallGraphBuilder(IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache);
|
||||
|
||||
abstract protected AnalysisScope makeAnalysisScope();
|
||||
|
||||
@Override
|
||||
public void buildAnalysisScope() throws IOException {
|
||||
super.scope = ePath.toAnalysisScope(new File(getExclusionsFile()));
|
||||
super.scope = ePath.toAnalysisScope(makeAnalysisScope());
|
||||
if (getExclusionsFile() != null) {
|
||||
scope.setExclusions(FileOfClasses.createFileOfClasses(new File(getExclusionsFile())));
|
||||
}
|
||||
}
|
||||
|
||||
public EclipseProjectPath getEclipseProjectPath() {
|
||||
public EclipseProjectPath<?,P> getEclipseProjectPath() {
|
||||
return ePath;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,28 +10,21 @@
|
|||
*****************************************************************************/
|
||||
package com.ibm.wala.ide.client;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
||||
import com.ibm.wala.cast.ir.ssa.AstIRFactory;
|
||||
import com.ibm.wala.classLoader.BinaryDirectoryTreeModule;
|
||||
import com.ibm.wala.classLoader.Module;
|
||||
import com.ibm.wala.classLoader.SourceDirectoryTreeModule;
|
||||
import com.ibm.wala.ide.plugin.CorePlugin;
|
||||
import com.ibm.wala.ide.util.EclipseFileProvider;
|
||||
import com.ibm.wala.ide.util.EclipseProjectPath;
|
||||
import com.ibm.wala.ide.util.EclipseProjectPath.Loader;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisCache;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.callgraph.Entrypoint;
|
||||
import com.ibm.wala.ssa.SSAOptions;
|
||||
import com.ibm.wala.ssa.SymbolTable;
|
||||
import com.ibm.wala.types.ClassLoaderReference;
|
||||
import com.ibm.wala.util.config.FileOfClasses;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.io.FileProvider;
|
||||
|
||||
/**
|
||||
* An {@link EclipseProjectAnalysisEngine} specialized for source code analysis with CAst
|
||||
|
@ -56,7 +49,12 @@ abstract public class EclipseProjectSourceAnalysisEngine<P> extends EclipseProje
|
|||
setExclusionsFile((new EclipseFileProvider()).getFileFromPlugin(CorePlugin.getDefault(), "J2SEClassHierarchyExclusions.txt")
|
||||
.getAbsolutePath());
|
||||
} catch (IOException e) {
|
||||
Assertions.UNREACHABLE("Cannot find exclusions file");
|
||||
try {
|
||||
setExclusionsFile((new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt", getClass().getClassLoader())
|
||||
.getAbsolutePath());
|
||||
} catch (IOException f) {
|
||||
Assertions.UNREACHABLE("Cannot find exclusions file");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,43 +63,6 @@ abstract public class EclipseProjectSourceAnalysisEngine<P> extends EclipseProje
|
|||
return new AnalysisCache(AstIRFactory.makeDefaultFactory());
|
||||
}
|
||||
|
||||
protected abstract AnalysisScope makeSourceAnalysisScope();
|
||||
|
||||
@Override
|
||||
public void buildAnalysisScope() {
|
||||
try {
|
||||
scope = makeSourceAnalysisScope();
|
||||
if (getExclusionsFile() != null) {
|
||||
scope.setExclusions(FileOfClasses.createFileOfClasses(new File(getExclusionsFile())));
|
||||
}
|
||||
EclipseProjectPath<?,?> epath = getEclipseProjectPath();
|
||||
|
||||
for (Module m : epath.getModules(Loader.PRIMORDIAL, true)) {
|
||||
scope.addToScope(scope.getPrimordialLoader(), m);
|
||||
}
|
||||
ClassLoaderReference app = scope.getApplicationLoader();
|
||||
ClassLoaderReference src = getSourceLoader();
|
||||
for (Module m : epath.getModules(Loader.APPLICATION, true)) {
|
||||
if (m instanceof SourceDirectoryTreeModule) {
|
||||
scope.addToScope(src, m);
|
||||
} else {
|
||||
scope.addToScope(app, m);
|
||||
}
|
||||
}
|
||||
for (Module m : epath.getModules(Loader.EXTENSION, true)) {
|
||||
if (!(m instanceof BinaryDirectoryTreeModule))
|
||||
scope.addToScope(app, m);
|
||||
}
|
||||
/*
|
||||
* ClassLoaderReference src = ((JavaSourceAnalysisScope)scope).getSourceLoader(); for (Module m :
|
||||
* epath.getModules(Loader.APPLICATION, false)) { scope.addToScope(src, m); }
|
||||
*/
|
||||
|
||||
} catch (IOException e) {
|
||||
Assertions.UNREACHABLE(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract ClassLoaderReference getSourceLoader();
|
||||
|
||||
@Override
|
||||
|
|
|
@ -195,8 +195,15 @@ public class EclipseFileProvider extends FileProvider {
|
|||
@Override
|
||||
public File getFile(String fileName, ClassLoader loader) throws IOException {
|
||||
Plugin p = plugIn == null ? CorePlugin.getDefault() : plugIn;
|
||||
return (p == null) ? getFileFromClassLoader(fileName, loader) : getFileFromPlugin(
|
||||
p, fileName);
|
||||
if (p == null) {
|
||||
return getFileFromClassLoader(fileName, loader);
|
||||
} else {
|
||||
File f = getFileFromPlugin(p, fileName);
|
||||
if (f == null) {
|
||||
f = getFileFromClassLoader(fileName, loader);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -140,7 +140,7 @@ public abstract class EclipseProjectPath<E, P> {
|
|||
}
|
||||
|
||||
|
||||
protected void resolveLibraryPathEntry(ILoader loader, IPath p) throws IOException {
|
||||
protected void resolveLibraryPathEntry(ILoader loader, IPath p) {
|
||||
File file = makeAbsolute(p).toFile();
|
||||
JarFile j;
|
||||
try {
|
||||
|
@ -148,7 +148,7 @@ public abstract class EclipseProjectPath<E, P> {
|
|||
} catch (ZipException z) {
|
||||
// a corrupted file. ignore it.
|
||||
return;
|
||||
} catch (FileNotFoundException z) {
|
||||
} catch (IOException z) {
|
||||
// should ignore directories as well..
|
||||
return;
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ public abstract class EclipseProjectPath<E, P> {
|
|||
}
|
||||
}
|
||||
|
||||
protected void resolveProjectPathEntry(Loader loader, boolean includeSource, IPath p) throws IOException {
|
||||
protected void resolveProjectPathEntry(ILoader loader, boolean includeSource, IPath p) {
|
||||
IPath projectPath = makeAbsolute(p);
|
||||
IWorkspace ws = ResourcesPlugin.getWorkspace();
|
||||
IWorkspaceRoot root = ws.getRoot();
|
||||
|
@ -185,6 +185,9 @@ public abstract class EclipseProjectPath<E, P> {
|
|||
} catch (CoreException e1) {
|
||||
e1.printStackTrace();
|
||||
Assertions.UNREACHABLE();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Assertions.UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -280,7 +283,7 @@ public abstract class EclipseProjectPath<E, P> {
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void resolveClasspathEntries(P project, List l, Loader loader, boolean includeSource, boolean entriesFromTopLevelProject) {
|
||||
protected void resolveClasspathEntries(P project, List l, ILoader loader, boolean includeSource, boolean entriesFromTopLevelProject) {
|
||||
for (int i = 0; i < l.size(); i++) {
|
||||
resolveClasspathEntry(project, resolve((E)l.get(i)), loader, includeSource, entriesFromTopLevelProject);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue