Skip to content

Commit

Permalink
Added a preference option for Call Graph Analysis for future use.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Jun 9, 2016
1 parent 7c4c6e0 commit 9b741b8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public class PreferenceConstants {

public static final String P_MAXIMUM_CALL_GRAPH_ANALYSIS_DEPTH = "maximumCallGraphAnalysisDepthPreference";

public static final String P_ENABLE_CALL_GRAPH_ANALYSIS = "enableCallGraphAnalysisPreference";

public static final String P_ENABLE_ALIAS_ANALYSIS = "enableAliasAnalysisPreference";

public static final String P_PROJECT_COMPILATION_UNIT_CACHE_SIZE = "projectCompilationUnitCacheSize";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public void initializeDefaultPreferences() {
store.setDefault(PreferenceConstants.P_MAXIMUM_RATIO_OF_DUPLICATED_TO_EXTRACTED, 1.0);
store.setDefault(PreferenceConstants.P_MINIMUM_METHOD_SIZE, 0);
store.setDefault(PreferenceConstants.P_MAXIMUM_CALL_GRAPH_ANALYSIS_DEPTH, 3);
store.setDefault(PreferenceConstants.P_ENABLE_CALL_GRAPH_ANALYSIS, true);
store.setDefault(PreferenceConstants.P_ENABLE_ALIAS_ANALYSIS, true);
store.setDefault(PreferenceConstants.P_PROJECT_COMPILATION_UNIT_CACHE_SIZE, 20);
store.setDefault(PreferenceConstants.P_LIBRARY_COMPILATION_UNIT_CACHE_SIZE, 50);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class PropertyManagerPreferencePage
private StringFieldEditor maximumRatioOfDuplicatedToExtractedFieldEditor;
private IntegerFieldEditor minimumMethodSizeFieldEditor;
private IntegerFieldEditor maximumCallGraphAnalysisDepthFieldEditor;
private BooleanFieldEditor enableCallGraphAnalysisFieldEditor;
private BooleanFieldEditor enableAliasAnalysisFieldEditor;
private IntegerFieldEditor projectCompilationUnitCacheSizeFieldEditor;
private IntegerFieldEditor libraryCompilationUnitCacheSizeFieldEditor;
Expand Down Expand Up @@ -89,26 +90,39 @@ public void createFieldEditors() {
minimumMethodSizeFieldEditor.setEmptyStringAllowed(false);
addField(minimumMethodSizeFieldEditor);

Group callGraphAnalysisPreferenceGroup = new Group(composite, SWT.SHADOW_ETCHED_IN);
callGraphAnalysisPreferenceGroup.setLayout(new GridLayout(1, false));
callGraphAnalysisPreferenceGroup.setText("Call Graph Analysis Preferences");

enableCallGraphAnalysisFieldEditor = new BooleanFieldEditor(
PreferenceConstants.P_ENABLE_CALL_GRAPH_ANALYSIS,
"&Enable Call Graph Analysis", callGraphAnalysisPreferenceGroup);
addField(enableCallGraphAnalysisFieldEditor);

enableAliasAnalysisFieldEditor = new BooleanFieldEditor(
PreferenceConstants.P_ENABLE_ALIAS_ANALYSIS,
"&Enable Alias Analysis", callGraphAnalysisPreferenceGroup);
addField(enableAliasAnalysisFieldEditor);

maximumCallGraphAnalysisDepthFieldEditor = new IntegerFieldEditor(
PreferenceConstants.P_MAXIMUM_CALL_GRAPH_ANALYSIS_DEPTH,
"&Maximum depth of method call graph analysis:", sliceExtractionPreferenceGroup);
"&Maximum depth of method call graph analysis:", callGraphAnalysisPreferenceGroup);
maximumCallGraphAnalysisDepthFieldEditor.setEmptyStringAllowed(false);
addField(maximumCallGraphAnalysisDepthFieldEditor);

enableAliasAnalysisFieldEditor = new BooleanFieldEditor(
PreferenceConstants.P_ENABLE_ALIAS_ANALYSIS,
"&Enable Alias Analysis", sliceExtractionPreferenceGroup);
addField(enableAliasAnalysisFieldEditor);
Group compilationUnitCachePreferenceGroup = new Group(composite, SWT.SHADOW_ETCHED_IN);
compilationUnitCachePreferenceGroup.setLayout(new GridLayout(1, false));
compilationUnitCachePreferenceGroup.setText("CompilationUnit Cache Preferences");

projectCompilationUnitCacheSizeFieldEditor = new IntegerFieldEditor(
PreferenceConstants.P_PROJECT_COMPILATION_UNIT_CACHE_SIZE,
"&Project CompilationUnit cache size:", sliceExtractionPreferenceGroup);
"&Project CompilationUnit cache size:", compilationUnitCachePreferenceGroup);
projectCompilationUnitCacheSizeFieldEditor.setEmptyStringAllowed(false);
addField(projectCompilationUnitCacheSizeFieldEditor);

libraryCompilationUnitCacheSizeFieldEditor = new IntegerFieldEditor(
PreferenceConstants.P_LIBRARY_COMPILATION_UNIT_CACHE_SIZE,
"&Library CompilationUnit cache size:", sliceExtractionPreferenceGroup);
"&Library CompilationUnit cache size:", compilationUnitCachePreferenceGroup);
libraryCompilationUnitCacheSizeFieldEditor.setEmptyStringAllowed(false);
addField(libraryCompilationUnitCacheSizeFieldEditor);

Expand Down

0 comments on commit 9b741b8

Please sign in to comment.