From 9b2724907d725e4890803a14a997f749b4d3f83e Mon Sep 17 00:00:00 2001 From: Fabio Zadrozny Date: Sat, 28 Sep 2024 08:34:13 -0300 Subject: [PATCH] Fix recursion error that could happen in race condition when restoring interpreter. --- .../AdditionalProjectInterpreterInfo.java | 2 +- .../pydev/analysis/mypy/MypyAnalysis.java | 3 +- .../tdd/TddQuickFixParticipant.java | 2 +- .../refactorer/ClassHierarchySearchTest.java | 2 +- .../python/pydev/ast/builder/VisitorMemo.java | 2 +- .../revisited/ProjectModulesManager.java | 4 +-- .../revisited/SyncSystemModulesManager.java | 2 +- .../DefaultPathsForInterpreterInfo.java | 12 +++++--- .../interpreter_managers/InterpreterInfo.java | 4 ++- .../pydev/ast/item_pointer/ItemPointer.java | 6 +++- .../pydev/ast/runners/SimpleRunner.java | 2 +- .../pydev/plugin/nature/PythonNature.java | 6 ++-- .../pydev/plugin/nature/PythonPathNature.java | 11 +++---- .../plugin/nature/SystemPythonNature.java | 3 +- .../python/pydev/core/IPythonPathNature.java | 3 +- .../core/docutils/StringSubstitution.java | 9 +++--- .../core/docutils/StringSubstitutionTest.java | 5 ++-- .../debug/ui/blocks/MainModuleBlock.java | 30 +++++++++---------- .../ui/launching/PythonRunnerConfig.java | 2 +- .../django/debug/ui/actions/DjangoWar.java | 2 +- .../pythonpathconf/PyListSelectionDialog.java | 8 ++--- .../pydev/navigator/PythonPathNatureStub.java | 3 +- 22 files changed, 70 insertions(+), 53 deletions(-) diff --git a/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/additionalinfo/AdditionalProjectInterpreterInfo.java b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/additionalinfo/AdditionalProjectInterpreterInfo.java index 5d0d0a8536..559f5a50c1 100644 --- a/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/additionalinfo/AdditionalProjectInterpreterInfo.java +++ b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/additionalinfo/AdditionalProjectInterpreterInfo.java @@ -125,7 +125,7 @@ protected Set getPythonPathFolders() { IPythonPathNature pythonPathNature = pythonNature.getPythonPathNature(); Set ret = new HashSet<>(); try { - ret.addAll(pythonPathNature.getOnlyProjectPythonPathStr(true)); + ret.addAll(pythonPathNature.getOnlyProjectPythonPathStr(true, true)); } catch (CoreException e) { Log.log(e); } diff --git a/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/mypy/MypyAnalysis.java b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/mypy/MypyAnalysis.java index c56a883b6b..2b2b0fad55 100644 --- a/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/mypy/MypyAnalysis.java +++ b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/mypy/MypyAnalysis.java @@ -196,7 +196,8 @@ void createMypyProcess(IExternalCodeAnalysisStream out) Collection addToMypyPath = new HashSet(); IModulesManager[] managersInvolved = nature.getAstManager().getModulesManager().getManagersInvolved(false); for (IModulesManager iModulesManager : managersInvolved) { - for (String s : iModulesManager.getNature().getPythonPathNature().getOnlyProjectPythonPathStr(true)) { + for (String s : iModulesManager.getNature().getPythonPathNature().getOnlyProjectPythonPathStr(true, + true)) { if (!s.isEmpty()) { addToMypyPath.add(s); } diff --git a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddQuickFixParticipant.java b/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddQuickFixParticipant.java index f734b882a0..6d19c1731c 100644 --- a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddQuickFixParticipant.java +++ b/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddQuickFixParticipant.java @@ -273,7 +273,7 @@ public void addProps(MarkerAnnotationAndPosition markerAnnotation, IAnalysisPref //Discover the source folder where we should create the structure. File editorFile = edit.getEditorFile(); - List split = nature.getPythonPathNature().getOnlyProjectPythonPathStr(false); + List split = nature.getPythonPathNature().getOnlyProjectPythonPathStr(false, true); for (int i = 0; i < split.size(); i++) { String fullPath = FileUtils.getFileAbsolutePath(split.get(i)); fullPath = PythonPathHelper.getDefaultPathStr(fullPath); diff --git a/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/refactorer/ClassHierarchySearchTest.java b/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/refactorer/ClassHierarchySearchTest.java index c49ebd67bb..99aadc9b5a 100644 --- a/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/refactorer/ClassHierarchySearchTest.java +++ b/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/refactorer/ClassHierarchySearchTest.java @@ -399,7 +399,7 @@ private HierarchyNodeModel assertIsIn(String name, String modName, List getOnlyProjectPythonPathStr(IPythonNature nature, boolean ad } if (lst == null) { HashSet projectSourcePath = new HashSet( - nature.getPythonPathNature().getOnlyProjectPythonPathStr(addExternal)); + nature.getPythonPathNature().getOnlyProjectPythonPathStr(addExternal, true)); lst = new ArrayList(projectSourcePath); if (addExternal) { onlyProjectPythonPathStrExternal = lst; diff --git a/plugins/org.python.pydev.ast/src/org/python/pydev/ast/codecompletion/revisited/ProjectModulesManager.java b/plugins/org.python.pydev.ast/src/org/python/pydev/ast/codecompletion/revisited/ProjectModulesManager.java index 913234ba9f..23c98ebf8b 100644 --- a/plugins/org.python.pydev.ast/src/org/python/pydev/ast/codecompletion/revisited/ProjectModulesManager.java +++ b/plugins/org.python.pydev.ast/src/org/python/pydev/ast/codecompletion/revisited/ProjectModulesManager.java @@ -253,7 +253,7 @@ protected String getResolveModuleErr(IResource member) { } public String resolveModuleOnlyInProjectSources(String fileAbsolutePath, boolean addExternal) throws CoreException { - List pathItems = this.nature.getPythonPathNature().getOnlyProjectPythonPathStr(addExternal); + List pathItems = this.nature.getPythonPathNature().getOnlyProjectPythonPathStr(addExternal, true); List filteredPathItems = filterDuplicatesPreservingOrder(pathItems); return this.pythonPathHelper.resolveModule(fileAbsolutePath, false, filteredPathItems, project); } @@ -540,7 +540,7 @@ public List getCompletePythonPath(IInterpreterInfo interpreter, IInterpr //Check if it's actually correct and auto-fix if it's not. List parsed; try { - parsed = pythonPathNature.getOnlyProjectPythonPathStr(true); + parsed = pythonPathNature.getOnlyProjectPythonPathStr(true, true); if (m2.nature != null && !new HashSet(parsed).equals(new HashSet(pythonpath))) { // Make it right at this moment (so any other place that calls it before the restore diff --git a/plugins/org.python.pydev.ast/src/org/python/pydev/ast/codecompletion/revisited/SyncSystemModulesManager.java b/plugins/org.python.pydev.ast/src/org/python/pydev/ast/codecompletion/revisited/SyncSystemModulesManager.java index 81be214318..6f2d1ed7bd 100644 --- a/plugins/org.python.pydev.ast/src/org/python/pydev/ast/codecompletion/revisited/SyncSystemModulesManager.java +++ b/plugins/org.python.pydev.ast/src/org/python/pydev/ast/codecompletion/revisited/SyncSystemModulesManager.java @@ -280,7 +280,7 @@ public IImageHandle get(String key) { if (newInterpreterInfo == null) { continue; } - DefaultPathsForInterpreterInfo defaultPaths = new DefaultPathsForInterpreterInfo(); + DefaultPathsForInterpreterInfo defaultPaths = new DefaultPathsForInterpreterInfo(false); OrderedSet newEntries = new OrderedSet(newInterpreterInfo.getPythonPath()); newEntries.removeAll(internalInfo.getPythonPath()); diff --git a/plugins/org.python.pydev.ast/src/org/python/pydev/ast/interpreter_managers/DefaultPathsForInterpreterInfo.java b/plugins/org.python.pydev.ast/src/org/python/pydev/ast/interpreter_managers/DefaultPathsForInterpreterInfo.java index 9ac88445b4..c47d6158e0 100644 --- a/plugins/org.python.pydev.ast/src/org/python/pydev/ast/interpreter_managers/DefaultPathsForInterpreterInfo.java +++ b/plugins/org.python.pydev.ast/src/org/python/pydev/ast/interpreter_managers/DefaultPathsForInterpreterInfo.java @@ -33,8 +33,11 @@ public class DefaultPathsForInterpreterInfo { private final Set rootPaths; - public DefaultPathsForInterpreterInfo() { - rootPaths = getRootPaths(); + public DefaultPathsForInterpreterInfo(boolean resolvingInterpreter) { + boolean addInterpreterInfoSubstitutions = !resolvingInterpreter; + // When resolving the interpreter, we can't try to resolve variables from the + // interpreter itself as we could get into a recursion error. + rootPaths = getRootPaths(addInterpreterInfoSubstitutions); } @@ -75,7 +78,7 @@ public static boolean isChildOfRootPath(String data, Set rootPaths) { * Creates a Set of the root paths of all projects (and the workspace root itself). * @return A HashSet of root paths. */ - public static HashSet getRootPaths() { + public static HashSet getRootPaths(boolean addInterpreterInfoSubstitutions) { HashSet rootPaths = new HashSet(); if (SharedCorePlugin.inTestMode()) { return rootPaths; @@ -96,7 +99,8 @@ public static HashSet getRootPaths() { PythonNature nature = PythonNature.getPythonNature(iProject); if (nature != null) { try { - List splitted = nature.getPythonPathNature().getOnlyProjectPythonPathStr(true); + List splitted = nature.getPythonPathNature().getOnlyProjectPythonPathStr(true, + addInterpreterInfoSubstitutions); for (String s : splitted) { try { rootPaths.add(Path.fromOSString(FileUtils.getFileAbsolutePath(s))); diff --git a/plugins/org.python.pydev.ast/src/org/python/pydev/ast/interpreter_managers/InterpreterInfo.java b/plugins/org.python.pydev.ast/src/org/python/pydev/ast/interpreter_managers/InterpreterInfo.java index 7a37bca7bd..44bf3e7996 100644 --- a/plugins/org.python.pydev.ast/src/org/python/pydev/ast/interpreter_managers/InterpreterInfo.java +++ b/plugins/org.python.pydev.ast/src/org/python/pydev/ast/interpreter_managers/InterpreterInfo.java @@ -371,7 +371,9 @@ public static InterpreterInfo fromString(String received, boolean askUserInOutPa List predefinedPaths = new ArrayList(); Properties stringSubstitutionVars = new Properties(); - DefaultPathsForInterpreterInfo defaultPaths = new DefaultPathsForInterpreterInfo(); + boolean resolvingInterpreter = true; + DefaultPathsForInterpreterInfo defaultPaths = new DefaultPathsForInterpreterInfo( + resolvingInterpreter); for (int j = 0; j < xmlNodes.getLength(); j++) { Node xmlChild = xmlNodes.item(j); diff --git a/plugins/org.python.pydev.ast/src/org/python/pydev/ast/item_pointer/ItemPointer.java b/plugins/org.python.pydev.ast/src/org/python/pydev/ast/item_pointer/ItemPointer.java index d401f22308..d1c1bd4de5 100644 --- a/plugins/org.python.pydev.ast/src/org/python/pydev/ast/item_pointer/ItemPointer.java +++ b/plugins/org.python.pydev.ast/src/org/python/pydev/ast/item_pointer/ItemPointer.java @@ -174,7 +174,11 @@ public URI getFileAsURI() { } else if (file instanceof IFile) { IFile f = (IFile) file; - return f.getRawLocationURI(); + URI rawLocationURI = f.getRawLocationURI(); + if (rawLocationURI != null) { + return rawLocationURI; + } + return f.getLocationURI(); } else if (file instanceof IPath) { IPath path = (IPath) file; diff --git a/plugins/org.python.pydev.ast/src/org/python/pydev/ast/runners/SimpleRunner.java b/plugins/org.python.pydev.ast/src/org/python/pydev/ast/runners/SimpleRunner.java index f40b01edf7..9402b50e4f 100644 --- a/plugins/org.python.pydev.ast/src/org/python/pydev/ast/runners/SimpleRunner.java +++ b/plugins/org.python.pydev.ast/src/org/python/pydev/ast/runners/SimpleRunner.java @@ -170,7 +170,7 @@ private static Map getDefaultSystemEnv(DebugPlugin defaultPlugin String translated = value; if (nature != null) { try { - StringSubstitution stringSubstitution = new StringSubstitution(nature); + StringSubstitution stringSubstitution = new StringSubstitution(nature, true); translated = stringSubstitution.performStringSubstitution(value, false); } catch (Exception e) { Log.log(e); diff --git a/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/PythonNature.java b/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/PythonNature.java index 5d43fed63f..f292d8e463 100644 --- a/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/PythonNature.java +++ b/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/PythonNature.java @@ -135,7 +135,9 @@ protected RebuildPythonNatureModules() { protected IStatus run(IProgressMonitor monitor) { String paths; try { - paths = StringUtils.join("|", pythonPathNature.getOnlyProjectPythonPathStr(true)); + boolean addInterpreterInfoSubstitutions = true; + paths = StringUtils.join("|", + pythonPathNature.getOnlyProjectPythonPathStr(true, addInterpreterInfoSubstitutions)); } catch (CoreException e1) { Log.log(e1); return Status.OK_STATUS; @@ -671,7 +673,7 @@ private void init(String version, String projectPythonpath, String externalProje protected IStatus run(IProgressMonitor monitor) { try { if (astManager != null) { - List pythonpath = pythonPathNature.getOnlyProjectPythonPathStr(true); + List pythonpath = pythonPathNature.getOnlyProjectPythonPathStr(true, true); PythonPathHelper pythonPathHelper = (PythonPathHelper) astManager.getModulesManager() .getPythonPathHelper(); //If it doesn't match, rebuid the pythonpath! diff --git a/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/PythonPathNature.java b/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/PythonPathNature.java index 75b4d380f7..c03a6f26b0 100644 --- a/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/PythonPathNature.java +++ b/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/PythonPathNature.java @@ -154,7 +154,8 @@ private IModulesManager getProjectModulesManager() { * @return the project pythonpath with complete paths in the filesystem. */ @Override - public List getOnlyProjectPythonPathStr(boolean addExternal) throws CoreException { + public List getOnlyProjectPythonPathStr(boolean addExternal, boolean addInterpreterInfoSubstitutions) + throws CoreException { String source = null; String external = null; String contributed = null; @@ -166,7 +167,7 @@ public List getOnlyProjectPythonPathStr(boolean addExternal) throws Core } //Substitute with variables! - StringSubstitution stringSubstitution = new StringSubstitution(nature); + StringSubstitution stringSubstitution = new StringSubstitution(nature, addInterpreterInfoSubstitutions); source = (String) getProjectSourcePath(true, stringSubstitution, RETURN_STRING_WITH_SEPARATOR); if (addExternal) { @@ -238,7 +239,7 @@ public Set getProjectSourcePathFolderSet() throws CoreException { } //Substitute with variables! - StringSubstitution stringSubstitution = new StringSubstitution(nature); + StringSubstitution stringSubstitution = new StringSubstitution(nature, true); source = (String) getProjectSourcePath(true, stringSubstitution, RETURN_STRING_WITH_SEPARATOR); @@ -386,7 +387,7 @@ private Object getProjectSourcePath(boolean replace, StringSubstitution substitu } if (replace && substitution == null) { - substitution = new StringSubstitution(fNature); + substitution = new StringSubstitution(fNature, true); } //we have to validate it, because as we store the values relative to the workspace, and not to the @@ -489,7 +490,7 @@ private String getProjectExternalSourcePath(boolean replace, StringSubstitution } if (replace && substitution == null) { - substitution = new StringSubstitution(fNature); + substitution = new StringSubstitution(fNature, true); } return trimAndReplaceVariablesIfNeeded(replace, extPath, nature, substitution); } diff --git a/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/SystemPythonNature.java b/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/SystemPythonNature.java index 6b662be03e..0c2502c392 100644 --- a/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/SystemPythonNature.java +++ b/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/SystemPythonNature.java @@ -107,7 +107,8 @@ public String getProjectExternalSourcePath(boolean replaceVariables) throws Core } @Override - public List getOnlyProjectPythonPathStr(boolean addExternal) throws CoreException { + public List getOnlyProjectPythonPathStr(boolean addExternal, boolean addInterpreterInfoSubstitutions) + throws CoreException { throw new RuntimeException("Not implemented"); } diff --git a/plugins/org.python.pydev.core/src/org/python/pydev/core/IPythonPathNature.java b/plugins/org.python.pydev.core/src/org/python/pydev/core/IPythonPathNature.java index 600e154662..cb899165a8 100644 --- a/plugins/org.python.pydev.core/src/org/python/pydev/core/IPythonPathNature.java +++ b/plugins/org.python.pydev.core/src/org/python/pydev/core/IPythonPathNature.java @@ -51,7 +51,8 @@ public interface IPythonPathNature { * complete paths in the filesystem. * @throws CoreException */ - public List getOnlyProjectPythonPathStr(boolean addExternal) throws CoreException; + public List getOnlyProjectPythonPathStr(boolean addExternal, boolean addInterpreterInfoSubstitutions) + throws CoreException; /** * Sets the project source path (paths are relative to the project location and are separated by | ) diff --git a/plugins/org.python.pydev.core/src/org/python/pydev/core/docutils/StringSubstitution.java b/plugins/org.python.pydev.core/src/org/python/pydev/core/docutils/StringSubstitution.java index 58e35f8234..2cc09827bd 100644 --- a/plugins/org.python.pydev.core/src/org/python/pydev/core/docutils/StringSubstitution.java +++ b/plugins/org.python.pydev.core/src/org/python/pydev/core/docutils/StringSubstitution.java @@ -53,22 +53,23 @@ public StringSubstitution(Map vars) { this.variableSubstitution = vars; } - public StringSubstitution(IPythonNature nature) { + public StringSubstitution(IPythonNature nature, boolean addInterpreterInfoSubstitutions) { if (nature != null) { try { IPythonPathNature pythonPathNature = nature.getPythonPathNature(); IProject project = nature.getProject(); //note: project can be null when creating a new project and receiving a system nature. - initialize(pythonPathNature, project); + initialize(pythonPathNature, project, addInterpreterInfoSubstitutions); } catch (Exception e) { Log.log(e); } } } - public void initialize(IPythonPathNature pythonPathNature, IProject project) { + public void initialize(IPythonPathNature pythonPathNature, IProject project, + boolean addInterpreterInfoSubstitutions) { try { try { - variableSubstitution = pythonPathNature.getVariableSubstitution(); + variableSubstitution = pythonPathNature.getVariableSubstitution(addInterpreterInfoSubstitutions); IPathVariableManager projectPathVarManager = null; try { if (project != null) { diff --git a/plugins/org.python.pydev.core/tests/org/python/pydev/core/docutils/StringSubstitutionTest.java b/plugins/org.python.pydev.core/tests/org/python/pydev/core/docutils/StringSubstitutionTest.java index 9b97415b1a..66aa560f68 100644 --- a/plugins/org.python.pydev.core/tests/org/python/pydev/core/docutils/StringSubstitutionTest.java +++ b/plugins/org.python.pydev.core/tests/org/python/pydev/core/docutils/StringSubstitutionTest.java @@ -194,7 +194,8 @@ public List getProjectExternalSourcePathAsList(boolean replaceVariables) } @Override - public List getOnlyProjectPythonPathStr(boolean b) throws CoreException { + public List getOnlyProjectPythonPathStr(boolean b, boolean addInterpreterInfoSubstitutions) + throws CoreException { throw new RuntimeException("Not implemented"); } @@ -1104,7 +1105,7 @@ public AdditionalGrammarVersionsToCheck getAdditionalGrammarVersions() throws Mi public Tuple getVersionAndError(boolean translateIfInterpreter) throws CoreException { throw new RuntimeException("Not implemented"); } - }); + }, false); return s; } } diff --git a/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/blocks/MainModuleBlock.java b/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/blocks/MainModuleBlock.java index 635730e250..3db54e1646 100644 --- a/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/blocks/MainModuleBlock.java +++ b/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/blocks/MainModuleBlock.java @@ -102,16 +102,14 @@ public void widgetSelected(SelectionEvent e) { if (!fUnitTesting) { title = "Main Module"; message = "Choose Python module which starts execution"; - } - else - { + } else { title = "Main Modules"; message = "Choose Python module(s) and/or package(s) to test"; } PythonModulePickerDialog dialog = new PythonModulePickerDialog(lParent.getShell(), title, message, project, fUnitTesting); - // Fixed request 1407469: main module browse button forgets path + // Fixed request 1407469: main module browse button forgets path if (currentResources != null) { dialog.setInitialSelections(currentResources); } @@ -127,8 +125,7 @@ public void widgetSelected(SelectionEvent e) { if (results[i] instanceof IResource) { if (results[i] instanceof IFile) { r_results.add((IFile) results[i]); - } - else { + } else { r_results.add((IResource) results[i]); } } @@ -142,7 +139,7 @@ public void widgetSelected(SelectionEvent e) { } }); - // Create a ModifyListener, used to listen for project modifications in the ProjectBlock. + // Create a ModifyListener, used to listen for project modifications in the ProjectBlock. // This assumes that the Project is in a Text control... fProjectModifyListener = new ModifyListener() { @Override @@ -169,7 +166,7 @@ public void modifyText(ModifyEvent e) { /* * (non-Javadoc) - * + * * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() */ @Override @@ -179,7 +176,7 @@ public String getName() { /* * (non-Javadoc) - * + * * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) */ @Override @@ -234,10 +231,10 @@ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { /** * Obtains an IFile that targets the current main module. - * + * * This is used for initializing the module selection dialog. - * - * @return The main module file. + * + * @return The main module file. */ private IResource[] getMainModuleResources() { String path = fMainModuleText.getText(); @@ -303,16 +300,17 @@ public StringSubstitution getStringSubstitution(IWorkspaceRoot root) { nature = PythonNature.getPythonNature(resource); } - StringSubstitution stringSubstitution = new StringSubstitution(nature); + boolean addInterpreterInfoSubstitutions = true; + StringSubstitution stringSubstitution = new StringSubstitution(nature, addInterpreterInfoSubstitutions); return stringSubstitution; } /** * Sets attributes in the working copy - * + * * @param configuration The configuration to set the attribute in * @param name Name of the attribute to set - * @param value Value to set + * @param value Value to set */ private void setAttribute(ILaunchConfigurationWorkingCopy configuration, String name, String value) { if (value == null || value.length() == 0) { @@ -397,7 +395,7 @@ public boolean isValid(ILaunchConfiguration launchConfig) { /** * Obtain a listener, used to detect changes of the currently selected project * This updates the browse button, and allos the appropriate selection of the main module. - * + * * @return a ModifyListener that updates the block controls. */ public ModifyListener getProjectModifyListener() { diff --git a/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunnerConfig.java b/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunnerConfig.java index a191cf5643..e78fe3b9a7 100644 --- a/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunnerConfig.java +++ b/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunnerConfig.java @@ -192,7 +192,7 @@ public static String getArguments(ILaunchConfiguration configuration, boolean ma } private static StringSubstitution getStringSubstitution(IPythonNature nature) { - return new StringSubstitution(nature); + return new StringSubstitution(nature, true); } /** diff --git a/plugins/org.python.pydev.django/src/org/python/pydev/django/debug/ui/actions/DjangoWar.java b/plugins/org.python.pydev.django/src/org/python/pydev/django/debug/ui/actions/DjangoWar.java index c75384d11c..70034f723f 100644 --- a/plugins/org.python.pydev.django/src/org/python/pydev/django/debug/ui/actions/DjangoWar.java +++ b/plugins/org.python.pydev.django/src/org/python/pydev/django/debug/ui/actions/DjangoWar.java @@ -24,7 +24,7 @@ public void run(IAction action) { return; } String javaLibs = null; - for (String path : nature.getPythonPathNature().getOnlyProjectPythonPathStr(true)) { + for (String path : nature.getPythonPathNature().getOnlyProjectPythonPathStr(true, true)) { if (path.endsWith(".jar")) { if (javaLibs == null) { javaLibs = path; diff --git a/plugins/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/PyListSelectionDialog.java b/plugins/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/PyListSelectionDialog.java index ec61d057bf..2c0a124cb4 100644 --- a/plugins/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/PyListSelectionDialog.java +++ b/plugins/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/PyListSelectionDialog.java @@ -95,7 +95,7 @@ private void addSelectionButtons(Composite composite) { SelectionListener listenerNotInWorkspace = new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - HashSet rootPaths = DefaultPathsForInterpreterInfo.getRootPaths(); + HashSet rootPaths = DefaultPathsForInterpreterInfo.getRootPaths(false); TableItem[] children = listViewer.getTable().getItems(); for (int i = 0; i < children.length; i++) { TableItem item = children[i]; @@ -129,7 +129,7 @@ public void widgetSelected(SelectionEvent e) { } /** - * Visually checks the previously-specified elements in this dialog's list + * Visually checks the previously-specified elements in this dialog's list * viewer. */ private void checkInitialSelections() { @@ -177,7 +177,7 @@ protected Control createDialogArea(Composite parent) { /** * Returns the viewer used to show the list. - * + * * @return the viewer, or null if not yet created */ protected CheckboxTableViewer getViewer() { @@ -192,7 +192,7 @@ private void initializeViewer() { } /** - * The ListSelectionDialog implementation of this + * The ListSelectionDialog implementation of this * Dialog method builds a list of the selected elements for later * retrieval by the client and closes this dialog. */ diff --git a/plugins/org.python.pydev/tests_navigator/org/python/pydev/navigator/PythonPathNatureStub.java b/plugins/org.python.pydev/tests_navigator/org/python/pydev/navigator/PythonPathNatureStub.java index 48d08e8f94..95cdf9c4a3 100644 --- a/plugins/org.python.pydev/tests_navigator/org/python/pydev/navigator/PythonPathNatureStub.java +++ b/plugins/org.python.pydev/tests_navigator/org/python/pydev/navigator/PythonPathNatureStub.java @@ -35,7 +35,8 @@ public List getCompleteProjectPythonPath(IInterpreterInfo interpreter, I } @Override - public List getOnlyProjectPythonPathStr(boolean b) throws CoreException { + public List getOnlyProjectPythonPathStr(boolean b, boolean addInterpreterInfoSubstitutions) + throws CoreException { throw new RuntimeException("Not impl"); }