Skip to content

Commit

Permalink
fix for preference store
Browse files Browse the repository at this point in the history
  • Loading branch information
benjholla committed Oct 21, 2018
1 parent 9e325b3 commit 6c681eb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.ensoftcorp.open.commons.ui.components.LabelFieldEditor;
import com.ensoftcorp.open.commons.ui.components.SpacerFieldEditor;
import com.ensoftcorp.open.pointsto.preferences.PointsToPreferences;
import com.ensoftcorp.open.pointsto.ui.Activator;

/**
* UI for setting points-to analysis preferences
Expand Down Expand Up @@ -46,7 +45,7 @@ public PointsToPreferencesPage() {

@Override
public void init(IWorkbench workbench) {
IPreferenceStore preferences = Activator.getDefault().getPreferenceStore();
IPreferenceStore preferences = PointsToPreferences.getPreferenceStore();
setPreferenceStore(preferences);
setDescription("Configure preferences for the Points-to Analysis Toolbox plugin.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ public String[] getCodemapStageDependencies() {
}

@Override
public void performIndexing(IProgressMonitor monitor) {
public boolean performIndexing(IProgressMonitor monitor) {
boolean runIndexer = PointsToPreferences.isPointsToAnalysisEnabled();
try {
if(PointsToPreferences.isPointsToAnalysisEnabled()){
if(runIndexer){
PointsTo pointsToAnalysis = null;
if(PointsToPreferences.isJavaPointsToAnalysisModeEnabled()){
if(!CommonQueries.isEmpty(Query.universe().nodes(XCSG.Language.Java))) {
Expand Down Expand Up @@ -84,6 +85,7 @@ public void performIndexing(IProgressMonitor monitor) {
} catch (Exception e) {
Log.error("Error performing points-to analysis", e);
}
return runIndexer;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@

public class PointsToPreferences extends AbstractPreferenceInitializer {

/**
* Returns the preference store used for these preferences
* @return
*/
public static IPreferenceStore getPreferenceStore() {
return Activator.getDefault().getPreferenceStore();
}

private static boolean initialized = false;

/**
Expand Down

0 comments on commit 6c681eb

Please sign in to comment.