Merge branch 'wala' into master

This commit is contained in:
Juergen Graf 2014-04-09 16:59:51 +02:00
commit b82d5dba90
1440 changed files with 146264 additions and 177207 deletions

4
.gitignore vendored
View File

@ -13,9 +13,13 @@ com.ibm.wala.cast.js.rhino.test/*.html
com.ibm.wala.cast.js.test/examples-src/ajaxslt/
com.ibm.wala.cast.java.polyglot/lib/
.metadata/
*~
com.ibm.wala.cast.js.test/examples-src/ajaxslt/
com.ibm.wala.core.testdata/@dot/
com.ibm.wala.core.testdata/lib/
com.ibm.wala.cast.js.html.nu_validator/lib/
com.ibm.wala.cast.java.test/testdata/
edu.kit.wala.smali.test/out/
com.ibm.wala.core/@dot
com.ibm.wala.core/com.ibm.wala.core*.jar

View File

@ -3,5 +3,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="source"/>
<classpathentry kind="src" path="data"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.ibm.wala.cast.java.jdt.test</name>
<name>com.ibm.wala.ide.jdt.test</name>
<comment></comment>
<projects>
</projects>

View File

@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: WALA CAst Java JDT Test Plug-in
Bundle-SymbolicName: com.ibm.wala.cast.java.jdt.test
Bundle-SymbolicName: com.ibm.wala.ide.jdt.test
Bundle-Version: 1.0.0
Bundle-Activator: com.ibm.wala.cast.java.jdt.test.Activator
Bundle-Vendor: IBM
@ -9,14 +9,16 @@ Require-Bundle: com.ibm.wala.cast.java.test;bundle-version="1.0.0",
com.ibm.wala.cast.test;bundle-version="1.0.0",
com.ibm.wala.ide.tests;bundle-version="1.1.3",
com.ibm.wala.core.tests;bundle-version="1.1.3",
com.ibm.wala.cast.java.jdt;bundle-version="1.0.0",
com.ibm.wala.ide.jdt;bundle-version="1.0.0",
com.ibm.wala.cast.java;bundle-version="1.0.0",
com.ibm.wala.cast;bundle-version="1.0.0",
com.ibm.wala.ide;bundle-version="1.1.3",
com.ibm.wala.core;bundle-version="1.1.3",
com.ibm.wala.util;bundle-version="1.1.3",
org.eclipse.core.resources;bundle-version="3.4.1",
org.eclipse.jdt.core;bundle-version="3.4.2",
org.junit4;bundle-version="4.8.1",
org.eclipse.core.runtime
org.eclipse.core.runtime,
org.eclipse.pde.core;bundle-version="3.6.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5

View File

@ -0,0 +1,11 @@
java\/awt\/.*
javax\/swing\/.*
sun\/awt\/.*
sun\/swing\/.*
com\/sun\/.*
sun\/.*
org\/netbeans\/.*
org\/openide\/.*
com\/ibm\/crypto\/.*
com\/ibm\/security\/.*
org\/apache\/xerces\/.*

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.wala.cast.java.jdt.test/source/com/ibm/wala/cast/java/test/JDTJavaIRTests.java"/>
<listEntry value="/com.ibm.wala.ide.jdt.test/source/com/ibm/wala/cast/java/test/JDTJavaIRTests.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
@ -27,7 +27,7 @@
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.cast.java.test.JDTJavaIRTests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.cast.java.jdt.test"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.ide.jdt.test"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcom.ibm.wala.tracefile=/tmp/jdt15tests.txt -Xmx1024M -ea"/>
<stringAttribute key="pde.version" value="3.3"/>

File diff suppressed because one or more lines are too long

View File

@ -6,69 +6,12 @@
*****************************************************************************/
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.test.ide.IDEIRTestUtil;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.core.tests.plugin.CoreTestsPlugin;
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(TestPlugin.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(CoreTestsPlugin.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
} catch (IOException e) {
Assert.assertFalse("Cannot find exclusions file", true);
}
return engine;
super(JDTJavaIRTests.PROJECT);
}
@Test

View File

@ -37,28 +37,12 @@
*/
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.test.ide.IDEIRTestUtil;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.core.tests.plugin.CoreTestsPlugin;
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.cast.java.jdt.test.Activator;
import com.ibm.wala.client.AbstractAnalysisEngine;
import com.ibm.wala.ide.tests.util.EclipseTestUtil.ZippedProjectData;
public class JDTJavaIRTests extends JavaIRTests {
@ -66,42 +50,21 @@ public class JDTJavaIRTests extends JavaIRTests {
public static final String PROJECT_ZIP = "test_project.zip";
public static final ZippedProjectData PROJECT = new ZippedProjectData(Activator.getDefault(), PROJECT_NAME, PROJECT_ZIP);
private final ZippedProjectData project;
public JDTJavaIRTests() {
super(PROJECT_NAME);
this(PROJECT);
}
private JDTJavaIRTests(ZippedProjectData project) {
super(project.projectName);
this.project = project;
}
@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(TestPlugin.getDefault(), PROJECT_NAME, PROJECT_ZIP, new NullProgressMonitor());
System.err.println("finish importing project");
}
@AfterClass
public static void afterClass() {
EclipseTestUtil.destroyProject(PROJECT_NAME);
}
@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(CoreTestsPlugin.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, project);
}
}

View File

@ -0,0 +1,64 @@
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.CoreException;
import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
import com.ibm.wala.cast.java.jdt.test.Activator;
import com.ibm.wala.client.AbstractAnalysisEngine;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.ide.tests.util.EclipseTestUtil.ZippedProjectData;
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 abstract class JDTJavaTest extends IRTests {
private final ZippedProjectData project;
public JDTJavaTest(ZippedProjectData project) {
super(project.projectName);
this.project = project;
}
@Override
protected AbstractAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors, Collection<String> sources, List<String> libs) {
return makeAnalysisEngine(mainClassDescriptors, sources, libs, project);
}
static AbstractAnalysisEngine makeAnalysisEngine(final String[] mainClassDescriptors, Collection<String> sources, List<String> libs, ZippedProjectData project) {
AbstractAnalysisEngine engine;
try {
engine = new JDTJavaSourceAnalysisEngine(project.projectName) {
@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;
} catch (IOException e1) {
Assert.fail(e1.getMessage());
return null;
} catch (CoreException e1) {
Assert.fail(e1.getMessage());
return null;
}
}
}

View File

@ -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);
}
}
}

View File

@ -36,8 +36,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import org.eclipse.core.runtime.NullProgressMonitor;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.core.tests.util.TestConstants;
import com.ibm.wala.demandpa.alg.ContextSensitiveStateMachine;
@ -52,8 +50,6 @@ import com.ibm.wala.demandpa.alg.statemachine.StateMachineFactory;
import com.ibm.wala.demandpa.flowgraph.IFlowLabel;
import com.ibm.wala.demandpa.util.MemoryAccessMap;
import com.ibm.wala.demandpa.util.SimpleMemoryAccessMap;
import com.ibm.wala.ide.util.ProgressMaster;
import com.ibm.wala.ide.util.ProgressMonitorDelegate;
import com.ibm.wala.ipa.callgraph.AnalysisCache;
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
@ -78,7 +74,9 @@ import com.ibm.wala.ssa.SSAInstruction;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.CancelException;
import com.ibm.wala.util.NullProgressMonitor;
import com.ibm.wala.util.Predicate;
import com.ibm.wala.util.ProgressMaster;
import com.ibm.wala.util.WalaException;
import com.ibm.wala.util.collections.Pair;
import com.ibm.wala.util.debug.Assertions;
@ -189,7 +187,7 @@ public class DemandCastChecker {
master.setMillisPerWorkItem(360000);
master.beginTask("runSolver", 1);
try {
retCG = builder.makeCallGraph(options, ProgressMonitorDelegate.createProgressMonitorDelegate(master));
retCG = builder.makeCallGraph(options, master);
retPA = builder.getPointerAnalysis();
} catch (CallGraphBuilderCancelException e) {
System.err.println("TIMED OUT!!");

Binary file not shown.

View File

@ -1,278 +0,0 @@
#Thu Feb 03 10:12:26 EST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
org.eclipse.jdt.core.codeComplete.fieldPrefixes=
org.eclipse.jdt.core.codeComplete.fieldSuffixes=
org.eclipse.jdt.core.codeComplete.localPrefixes=
org.eclipse.jdt.core.codeComplete.localSuffixes=
org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
org.eclipse.jdt.core.formatter.comment.line_length=80
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_empty_lines=false
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=2
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=132
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=2
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true

File diff suppressed because one or more lines are too long

View File

@ -1,20 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Jdt Plug-in
Bundle-SymbolicName: com.ibm.wala.cast.java.jdt
Bundle-Version: 1.0.0
Bundle-Activator: com.ibm.wala.cast.java.jdt.Activator
Bundle-Vendor: IBM
Require-Bundle: com.ibm.wala.cast,
com.ibm.wala.cast.java,
com.ibm.wala.core,
org.eclipse.core.runtime,
org.eclipse.jdt.core,
org.eclipse.core.resources,
com.ibm.wala.shrike,
com.ibm.wala.ide
Bundle-ActivationPolicy: lazy
Export-Package: com.ibm.wala.cast.java.client,
com.ibm.wala.cast.java.jdt,
com.ibm.wala.cast.java.translator.jdt
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
@ -13,8 +16,8 @@ import com.ibm.wala.cast.java.translator.polyglot.IRTranslatorExtension;
import com.ibm.wala.cast.java.translator.polyglot.JavaIRTranslatorExtension;
import com.ibm.wala.cast.java.translator.polyglot.PolyglotJavaSourceAnalysisEngine;
import com.ibm.wala.cast.tree.CAst;
import com.ibm.wala.cast.tree.impl.CAstRewriter;
import com.ibm.wala.cast.tree.impl.CAstRewriterFactory;
import com.ibm.wala.cast.tree.rewrite.CAstRewriter;
import com.ibm.wala.cast.tree.rewrite.CAstRewriterFactory;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.callgraph.Entrypoint;
@ -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;
}

View File

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

View File

@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: WALA CAst Java Polyglot Plug-in
Bundle-SymbolicName: com.ibm.wala.cast.java.polyglot
Bundle-Version: 1.0.0
Bundle-Activator: com.ibm.wala.cast.java.polyglot.Activator
Bundle-Vendor: IBM
Require-Bundle: com.ibm.wala.cast.java,
com.ibm.wala.cast,
@ -11,13 +10,10 @@ Require-Bundle: com.ibm.wala.cast.java,
org.eclipse.core.runtime,
com.ibm.wala.shrike,
org.eclipse.jdt.core,
org.eclipse.core.resources,
com.ibm.wala.ide
org.eclipse.core.resources
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: com.ibm.wala.cast.java.client.polyglot,
com.ibm.wala.cast.java.polyglot;uses:="org.osgi.framework,org.eclipse.core.runtime",
com.ibm.wala.cast.java.translator.polyglot;
Export-Package: com.ibm.wala.cast.java.translator.polyglot;
uses:="com.ibm.wala.types,
polyglot.types,
polyglot.util,
@ -32,4 +28,21 @@ Export-Package: com.ibm.wala.cast.java.client.polyglot,
polyglot.frontend.goals,
com.ibm.wala.cast.tree.impl,
com.ibm.wala.cast.java.translator,
com.ibm.wala.cast.java.types"
com.ibm.wala.cast.java.types",
java_cup,
java_cup.runtime,
polyglot.ast,
polyglot.dispatch,
polyglot.frontend,
polyglot.lex,
polyglot.main,
polyglot.parse,
polyglot.qq,
polyglot.types,
polyglot.types.reflect,
polyglot.util,
polyglot.util.typedump,
polyglot.visit
Bundle-ClassPath: lib/java_cup.jar,
lib/polyglot.jar,
.

View File

@ -1,4 +1,6 @@
source.. = source/
output.. = bin/
bin.includes = META-INF/,\
.
.,\
lib/java_cup.jar,\
lib/polyglot.jar

View File

@ -1,162 +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.cast.java.client.polyglot;
import java.io.File;
import java.io.IOException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IJavaProject;
import com.ibm.wala.cast.ir.ssa.AstIRFactory;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
import com.ibm.wala.cast.java.translator.polyglot.IRTranslatorExtension;
import com.ibm.wala.cast.java.translator.polyglot.JavaIRTranslatorExtension;
import com.ibm.wala.cast.java.translator.polyglot.PolyglotClassLoaderFactory;
import com.ibm.wala.classLoader.BinaryDirectoryTreeModule;
import com.ibm.wala.classLoader.ClassLoaderFactory;
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.ipa.callgraph.impl.SetOfClasses;
import com.ibm.wala.ipa.callgraph.impl.Util;
import com.ibm.wala.ipa.cha.ClassHierarchy;
import com.ibm.wala.ipa.cha.ClassHierarchyException;
import com.ibm.wala.ipa.cha.IClassHierarchy;
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
*/
public class EclipseProjectSourceAnalysisEngine extends EclipseProjectAnalysisEngine {
public static final String defaultFileExt = "java";
/**
* file extension for source files in this Eclipse project
*/
final String fileExt;
public EclipseProjectSourceAnalysisEngine(IJavaProject project) throws IOException, CoreException {
this(project, defaultFileExt);
}
public EclipseProjectSourceAnalysisEngine(IJavaProject project, String fileExt) throws IOException, CoreException {
super(project);
this.fileExt = fileExt;
try {
setExclusionsFile((new EclipseFileProvider()).getFileFromPlugin(CorePlugin.getDefault(), "J2SEClassHierarchyExclusions.txt")
.getAbsolutePath());
} catch (IOException e) {
Assertions.UNREACHABLE("Cannot find exclusions file");
}
}
@Override
public AnalysisCache makeDefaultCache() {
return new AnalysisCache(AstIRFactory.makeDefaultFactory());
}
protected AnalysisScope makeSourceAnalysisScope() {
return new JavaSourceAnalysisScope();
}
@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 = ((JavaSourceAnalysisScope) scope).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());
}
}
public IRTranslatorExtension getTranslatorExtension() {
return new JavaIRTranslatorExtension();
}
protected ClassLoaderFactory getClassLoaderFactory(SetOfClasses exclusions, IRTranslatorExtension extInfo) {
return new PolyglotClassLoaderFactory(exclusions, extInfo);
}
@Override
public IClassHierarchy buildClassHierarchy() {
IClassHierarchy cha = null;
ClassLoaderFactory factory = getClassLoaderFactory(scope.getExclusions(), getTranslatorExtension());
try {
cha = ClassHierarchy.make(getScope(), factory);
} catch (ClassHierarchyException e) {
System.err.println("Class Hierarchy construction failed");
System.err.println(e.toString());
e.printStackTrace();
}
return cha;
}
@Override
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha);
}
@Override
public AnalysisOptions getDefaultOptions(Iterable<Entrypoint> entrypoints) {
AnalysisOptions options = new AnalysisOptions(getScope(), entrypoints);
SSAOptions ssaOptions = new SSAOptions();
ssaOptions.setDefaultValues(new SSAOptions.DefaultValues() {
public int getDefaultValue(SymbolTable symtab, int valueNumber) {
return symtab.getDefaultValue(valueNumber);
}
});
options.setSSAOptions(ssaOptions);
return options;
}
}

View File

@ -1,52 +0,0 @@
package com.ibm.wala.cast.java.polyglot;
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.polyglot";
// 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;
}
}

View File

@ -13,7 +13,7 @@
*/
package com.ibm.wala.cast.java.translator.polyglot;
import com.ibm.wala.cast.tree.impl.CAstRewriterFactory;
import com.ibm.wala.cast.tree.rewrite.CAstRewriterFactory;
public interface IRTranslatorExtension {
void setSourceLoader(PolyglotSourceLoaderImpl jsli);

View File

@ -21,7 +21,7 @@ import polyglot.frontend.JLScheduler;
import polyglot.frontend.Job;
import polyglot.frontend.Scheduler;
import com.ibm.wala.cast.tree.impl.CAstRewriterFactory;
import com.ibm.wala.cast.tree.rewrite.CAstRewriterFactory;
/**
* A Polyglot extension descriptor for a test harness extension that generates WALA IR for

View File

@ -17,11 +17,11 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import com.ibm.wala.classLoader.SourceModule;
import polyglot.frontend.FileSource;
import polyglot.frontend.Resource;
import com.ibm.wala.classLoader.SourceModule;
/**
* A Polyglot Source whose input comes from an InputStream.<br>
* Currently extends FileSource since that's all that the Polyglot Compiler class

View File

@ -120,7 +120,6 @@ import polyglot.util.Position;
import com.ibm.wala.cast.ir.translator.AstTranslator.InternalCAstSymbol;
import com.ibm.wala.cast.ir.translator.TranslatorToCAst;
import com.ibm.wala.cast.ir.translator.TranslatorToCAst.DoLoopTranslator;
import com.ibm.wala.cast.ir.translator.TranslatorToCAst.WalkContext;
import com.ibm.wala.cast.java.loader.Util;
import com.ibm.wala.cast.java.translator.JavaProcedureEntity;
import com.ibm.wala.cast.java.types.JavaType;

View File

@ -0,0 +1,25 @@
package com.ibm.wala.cast.java.translator.polyglot;
import com.ibm.wala.cast.tree.CAst;
import com.ibm.wala.cast.tree.rewrite.AstLoopUnwinder;
import com.ibm.wala.cast.tree.rewrite.CAstRewriter;
import com.ibm.wala.cast.tree.rewrite.CAstRewriterFactory;
public class PolyglotUnwoundIRTranslatorExtension
extends JavaIRTranslatorExtension
{
private final int unrollDepth;
public PolyglotUnwoundIRTranslatorExtension(int unrollDepth) {
this.unrollDepth = unrollDepth;
}
public CAstRewriterFactory<CAstRewriter.RewriteContext<AstLoopUnwinder.UnwindKey>,AstLoopUnwinder.UnwindKey> getCAstRewriterFactory() {
return new CAstRewriterFactory<CAstRewriter.RewriteContext<AstLoopUnwinder.UnwindKey>,AstLoopUnwinder.UnwindKey>() {
public AstLoopUnwinder createCAstRewriter(CAst ast) {
return new AstLoopUnwinder(ast, true, unrollDepth);
}
};
}
}

View File

@ -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>

View File

@ -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

View File

@ -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();

View File

@ -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();
}
}

View File

@ -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;
}
}

View File

@ -37,7 +37,7 @@
*/
package foo.bar.hello.world;
public class MiniaturList {
public class MiniaturList2 {
public static void main(String[] args) {
int a;

View File

@ -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, 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));
}
protected static void dumpIR(CallGraph cg, boolean assertReachable) throws IOException {
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;

View File

@ -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());

View File

@ -8,7 +8,7 @@ import com.ibm.wala.cast.tree.CAstEntity;
import com.ibm.wala.cast.tree.CAstNode;
import com.ibm.wala.cast.tree.CAstSourcePositionMap;
import com.ibm.wala.cast.tree.impl.CAstOperator;
import com.ibm.wala.cast.tree.impl.CAstRewriter;
import com.ibm.wala.cast.tree.rewrite.CAstRewriter;
import com.ibm.wala.classLoader.CallSiteReference;
import com.ibm.wala.util.collections.Pair;

View File

@ -16,7 +16,6 @@ import java.util.Iterator;
import java.util.Set;
import com.ibm.wala.cast.ipa.callgraph.ScopeMappingInstanceKeys;
import com.ibm.wala.cast.ipa.callgraph.ScopeMappingInstanceKeys.ScopeMappingInstanceKey;
import com.ibm.wala.cast.ir.translator.AstTranslator;
import com.ibm.wala.cast.java.loader.JavaSourceLoaderImpl.JavaClass;
import com.ibm.wala.cast.loader.AstMethod;

View File

@ -54,9 +54,9 @@ import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IClassLoader;
import com.ibm.wala.classLoader.IField;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.classLoader.Module;
import com.ibm.wala.classLoader.JavaLanguage.JavaInstructionFactory;
import com.ibm.wala.classLoader.Language;
import com.ibm.wala.classLoader.Module;
import com.ibm.wala.classLoader.ModuleEntry;
import com.ibm.wala.classLoader.NewSiteReference;
import com.ibm.wala.ipa.callgraph.impl.SetOfClasses;
@ -139,7 +139,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
result.add(domoType);
}
if (domoType == null && !getClassHierarchy().getScope().getExclusions().contains(name.toString().substring(1))){
assert false : "Failed to find all non-excluded interfaces.";
assert false : "Failed to find non-excluded interface: " + name;
}
}

View File

@ -15,13 +15,12 @@ package com.ibm.wala.cast.java.translator;
import java.io.PrintWriter;
import com.ibm.wala.cast.ir.translator.TranslatorToCAst;
import com.ibm.wala.cast.java.loader.JavaSourceLoaderImpl;
import com.ibm.wala.cast.tree.CAst;
import com.ibm.wala.cast.tree.CAstEntity;
import com.ibm.wala.cast.tree.impl.CAstImpl;
import com.ibm.wala.cast.tree.impl.CAstRewriter;
import com.ibm.wala.cast.tree.impl.CAstRewriterFactory;
import com.ibm.wala.cast.tree.rewrite.CAstRewriter;
import com.ibm.wala.cast.tree.rewrite.CAstRewriterFactory;
import com.ibm.wala.cast.util.CAstPrinter;
import com.ibm.wala.classLoader.ModuleEntry;

View File

@ -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>

View File

@ -3,18 +3,16 @@ Bundle-ManifestVersion: 2
Bundle-Name: Test Plug-in
Bundle-SymbolicName: com.ibm.wala.cast.js.rhino.test
Bundle-Version: 1.0.0
Bundle-Activator: com.ibm.wala.cast.js.rhino.test.Activator
Bundle-Vendor: IBM
Require-Bundle: org.eclipse.core.runtime,
com.ibm.wala.cast.js.rhino;bundle-version="1.0.0",
Require-Bundle: com.ibm.wala.cast.js.rhino;bundle-version="1.0.0",
com.ibm.wala.cast.js;bundle-version="1.0.0",
com.ibm.wala.cast;bundle-version="1.0.0",
com.ibm.wala.core;bundle-version="1.1.3",
com.ibm.wala.cast.js.test;bundle-version="1.0.0",
com.ibm.wala.cast.test;bundle-version="1.0.0",
com.ibm.wala.core.tests;bundle-version="1.1.3",
org.junit4;bundle-version="4.3.1",
com.ibm.wala.ide;bundle-version="1.1.3"
org.junit4;bundle-version="4.3.1"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: com.ibm.wala.cast.js.test
Export-Package: com.ibm.wala.cast.js.rhino.test,
com.ibm.wala.cast.js.test

View File

@ -19,8 +19,6 @@ import java.util.Properties;
import junit.framework.Assert;
import org.eclipse.core.runtime.NullProgressMonitor;
import com.ibm.wala.cast.ir.translator.AstTranslator;
import com.ibm.wala.cast.js.ipa.callgraph.ForInContextSelector;
import com.ibm.wala.cast.js.ipa.callgraph.JSCFABuilder;
@ -30,16 +28,16 @@ import com.ibm.wala.cast.js.ipa.callgraph.correlations.extraction.CorrelatedPair
import com.ibm.wala.cast.js.test.JSCallGraphBuilderUtil;
import com.ibm.wala.cast.js.test.JSCallGraphBuilderUtil.CGBuilderType;
import com.ibm.wala.cast.js.translator.CAstRhinoTranslatorFactory;
import com.ibm.wala.ide.util.ProgressMaster;
import com.ibm.wala.ide.util.ProgressMonitorDelegate;
import com.ibm.wala.ipa.callgraph.CGNode;
import com.ibm.wala.ipa.callgraph.CallGraph;
import com.ibm.wala.ipa.callgraph.CallGraphBuilderCancelException;
import com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis;
import com.ibm.wala.ipa.cha.ClassHierarchyException;
import com.ibm.wala.util.collections.Iterator2Iterable;
import com.ibm.wala.util.NullProgressMonitor;
import com.ibm.wala.util.ProgressMaster;
import com.ibm.wala.util.io.CommandLine;
import com.ibm.wala.util.io.FileProvider;
import com.ibm.wala.util.io.FileUtil;
/**
* Utility class for building call graphs of HTML pages.
@ -113,7 +111,7 @@ public class HTMLCGBuilder {
}
long start = System.currentTimeMillis();
CallGraph cg = timeout > 0 ? builder.makeCallGraph(builder.getOptions(),
ProgressMonitorDelegate.createProgressMonitorDelegate(master)) : builder.makeCallGraph(builder.getOptions());
master) : builder.makeCallGraph(builder.getOptions());
long end = System.currentTimeMillis();
master.done();
res.construction_time = (end - start);
@ -155,34 +153,51 @@ public class HTMLCGBuilder {
*/
public static void main(String[] args) throws ClassHierarchyException, IOException {
Properties parsedArgs = CommandLine.parse(args);
String src = parsedArgs.getProperty("src");
if (src == null) {
throw new IllegalArgumentException("-src argument is required");
}
// if src is a JS file, build trivial wrapper HTML file
if (src.endsWith(".js")) {
File tmpFile = File.createTempFile("HTMLCGBuilder", ".html");
tmpFile.deleteOnExit();
FileUtil.writeFile(tmpFile,
"<html>" +
" <head>" +
" <title></title>" +
" <script src=\"" + src + "\" type='text/javascript'></script>" +
" </head>" +
"<body>" +
"</body>" +
"</html>");
src = tmpFile.getAbsolutePath();
}
int timeout;
if (parsedArgs.containsKey("timeout")) {
timeout = Integer.parseInt(parsedArgs.getProperty("timeout"));
} else {
timeout = DEFAULT_TIMEOUT;
}
String reachableName = null;
if (parsedArgs.containsKey("reachable")) {
reachableName = parsedArgs.getProperty("reachable");
}
String srcNode = null, dstNode = null;
if (parsedArgs.containsKey("edgeExists")) {
String[] nodes = parsedArgs.getProperty("edgeExists").split(":");
srcNode = nodes[0];
dstNode = nodes[1];
}
// suppress debug output
JavaScriptFunctionDotCallTargetSelector.WARN_ABOUT_IMPRECISE_CALLGRAPH = false;
// build call graph
CGBuilderResult res = buildHTMLCG(src, timeout, true, AstTranslator.NEW_LEXICAL ? CGBuilderType.ONE_CFA_PRECISE_LEXICAL : CGBuilderType.ZERO_ONE_CFA);
if(res.construction_time == -1)
System.out.println("TIMED OUT");
else
System.out.println("Call graph construction took " + res.construction_time/1000.0 + " seconds");
if (reachableName != null) {
for (CGNode node : res.cg) {
if (node.getMethod().getDeclaringClass().getName().toString().contains(reachableName)) {
@ -191,16 +206,5 @@ public class HTMLCGBuilder {
}
}
}
if (srcNode != null) {
for (CGNode node : res.cg) {
if (node.getMethod().getDeclaringClass().getName().toString().endsWith(srcNode)) {
for (CGNode callee : Iterator2Iterable.make(res.cg.getSuccNodes(node))) {
if (callee.getMethod().getDeclaringClass().getName().toString().endsWith(dstNode)) {
System.out.println("EDGE EXISTS");
}
}
}
}
}
}
}

View File

@ -13,7 +13,6 @@ package com.ibm.wala.cast.js.test;
import java.io.IOException;
import com.ibm.wala.cast.js.translator.RhinoToAstTranslator;
import com.ibm.wala.cast.tree.CAstEntity;
import com.ibm.wala.cast.tree.impl.CAstImpl;

View File

@ -1,18 +0,0 @@
package com.ibm.wala.cast.js.test;
import org.junit.Before;
import com.ibm.wala.cast.js.translator.CAstRhinoTranslatorFactory;
public class TestMozillaBugPagesRhino extends TestMozillaBugPages {
public static void main(String[] args) {
justThisTest(TestMozillaBugPagesRhino.class);
}
@Before
public void setUp() {
com.ibm.wala.cast.js.ipa.callgraph.JSCallGraphUtil.setTranslatorFactory(new CAstRhinoTranslatorFactory());
}
}

View File

@ -65,4 +65,9 @@ public class TestSimpleCallGraphShapeRhino extends TestSimpleCallGraphShape {
public void testTranslateToCAstCrash3() throws IllegalArgumentException, IOException, CancelException {
JSCallGraphBuilderUtil.makeScriptCG("tests", "rhino_crash3.js");
}
@Test
public void testNonLoopBreakLabel() throws IllegalArgumentException, IOException, CancelException {
JSCallGraphBuilderUtil.makeScriptCG("tests", "non_loop_break.js");
}
}

View File

@ -18,6 +18,7 @@ import org.junit.Test;
import com.ibm.wala.cast.js.html.IHtmlParser;
import com.ibm.wala.cast.js.html.IHtmlParserFactory;
import com.ibm.wala.cast.js.html.JSSourceExtractor;
import com.ibm.wala.cast.js.html.WebUtil;
import com.ibm.wala.cast.js.translator.CAstRhinoTranslatorFactory;
import com.ibm.wala.ipa.callgraph.CallGraph;
@ -50,5 +51,7 @@ public abstract class TestSimplePageCallGraphShapeRhino extends TestSimplePageCa
return TestSimplePageCallGraphShapeRhino.this.getParser();
}
});
JSSourceExtractor.USE_TEMP_NAME = false;
JSSourceExtractor.DELETE_UPON_EXIT = false;
}
}

View File

@ -7,15 +7,18 @@
<listEntry value="4"/>
</listAttribute>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
<mapEntry key="[run]" value="org.eclipse.jdt.junit.launchconfig"/>
</mapAttribute>
<stringAttribute key="org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE" value="/tmp/console.txt"/>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.ibm.wala.cast.js.rhino.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5&quot; javaProject=&quot;com.ibm.wala.cast.js.rhino.test&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;com.ibm.wala.cast.js.rhino.test&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.ibm.wala.cast.js.test/examples-src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;com.ibm.wala.cast.js.rhino.test&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;com.ibm.wala.cast.js.rhino.test&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.ibm.wala.cast.js.test.data/examples-src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>

View File

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

View File

@ -12,4 +12,28 @@ Require-Bundle: org.eclipse.core.runtime,
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: com.ibm.wala.cast.js.translator,
org.mozilla.javascript
com.ibm.wala.js.rhino,
org.mozilla.classfile,
org.mozilla.javascript,
org.mozilla.javascript.annotations,
org.mozilla.javascript.ast,
org.mozilla.javascript.commonjs.module,
org.mozilla.javascript.commonjs.module.provider,
org.mozilla.javascript.debug,
org.mozilla.javascript.jdk13,
org.mozilla.javascript.jdk15,
org.mozilla.javascript.json,
org.mozilla.javascript.optimizer,
org.mozilla.javascript.regexp,
org.mozilla.javascript.serialize,
org.mozilla.javascript.tools,
org.mozilla.javascript.tools.debugger,
org.mozilla.javascript.tools.debugger.treetable,
org.mozilla.javascript.tools.idswitch,
org.mozilla.javascript.tools.jsc,
org.mozilla.javascript.tools.shell,
org.mozilla.javascript.xml,
org.mozilla.javascript.xml.impl.xmlbeans,
org.mozilla.javascript.xmlimpl
Bundle-ClassPath: lib/js.jar,
.

View File

@ -1,4 +1,5 @@
source.. = source/
output.. = bin/
bin.includes = META-INF/,\
.
.,\
lib/js.jar

View File

@ -0,0 +1,24 @@
package com.ibm.wala.cast.js.translator;
import com.ibm.wala.cast.ir.translator.TranslatorToCAst;
import com.ibm.wala.cast.js.translator.JavaScriptLoopUnwindingTranslatorFactory;
import com.ibm.wala.cast.tree.CAst;
import com.ibm.wala.classLoader.SourceModule;
public class CAstRhinoLoopUnwindingTranslatorFactory
extends JavaScriptLoopUnwindingTranslatorFactory
{
public CAstRhinoLoopUnwindingTranslatorFactory(int unwindFactor) {
super(unwindFactor);
}
public CAstRhinoLoopUnwindingTranslatorFactory() {
this(3);
}
@Override
protected TranslatorToCAst translateInternal(CAst Ast, SourceModule M, String N) {
return new CAstRhinoTranslator(M, true);
}
}

View File

@ -17,9 +17,9 @@ import java.util.List;
import com.ibm.wala.cast.ir.translator.TranslatorToCAst;
import com.ibm.wala.cast.tree.CAstEntity;
import com.ibm.wala.cast.tree.impl.CAstImpl;
import com.ibm.wala.cast.tree.impl.CAstRewriter.CopyKey;
import com.ibm.wala.cast.tree.impl.CAstRewriter.RewriteContext;
import com.ibm.wala.cast.tree.impl.CAstRewriterFactory;
import com.ibm.wala.cast.tree.rewrite.CAstRewriterFactory;
import com.ibm.wala.cast.tree.rewrite.CAstRewriter.CopyKey;
import com.ibm.wala.cast.tree.rewrite.CAstRewriter.RewriteContext;
import com.ibm.wala.classLoader.SourceFileModule;
import com.ibm.wala.classLoader.SourceModule;

View File

@ -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

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.ibm.wala.cast.js.test.data</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="examples-src"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.FireFoxBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>

View File

@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.JRE_CONTAINER

View File

@ -0,0 +1,10 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Eclipse-LazyStart: true
Bundle-Name: %pluginName
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/

View File

@ -0,0 +1,10 @@
var a = [];
a[0] = function reachable() { print("reachable"); };
a[1] = function also_reachable() { print("also reachable"); };
a[2] = function reachable_too() { print("reachable, too"); };
var o = { toString: function() { return 2; } };
a["0"]();
a[1.0]();
a[o]();

View File

@ -0,0 +1,16 @@
var a = [];
a[0] = function reachable() { print("reachable"); };
a[1] = function also_reachable() { print("also reachable"); };
a[2] = function reachable_too() { print("reachable, too"); };
var o = { toString: function() { return 2; } };
var pnames = [ "0", 1.0, o];
function invokeOnA(p) {
var f = a[p];
f();
}
for(var i=0;i<pnames.length;++i)
invokeOnA(pnames[i]);

Some files were not shown because too many files have changed in this diff Show More