This is an automated email from the ASF dual-hosted git repository.

matthiasblaesing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 7172e2b  [NETBEANS-2446] Use *parent* of saved projectFolder as 
projectLocation
     new e803be8  Merge pull request #1980 from errael/WrongProjectParentFolder
7172e2b is described below

commit 7172e2b73cdb5bee33a1da0b6d714bc9c104e3d8
Author: Ernie Rael <[email protected]>
AuthorDate: Mon Feb 24 06:31:17 2020 +0000

    [NETBEANS-2446] Use *parent* of saved projectFolder as projectLocation
---
 .../modules/maven/newproject/BasicPanelVisual.java    | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git 
a/java/maven/src/org/netbeans/modules/maven/newproject/BasicPanelVisual.java 
b/java/maven/src/org/netbeans/modules/maven/newproject/BasicPanelVisual.java
index 16cfec2..01c02fb 100644
--- a/java/maven/src/org/netbeans/modules/maven/newproject/BasicPanelVisual.java
+++ b/java/maven/src/org/netbeans/modules/maven/newproject/BasicPanelVisual.java
@@ -509,13 +509,14 @@ public class BasicPanelVisual extends JPanel implements 
DocumentListener, Window
         }
         String name = projectNameTextField.getText().trim();
         String folder = createdFolderTextField.getText().trim();
-        final File parentFolder = new File(folder);
+        final File projectFolder = new File(folder);
         
-        d.putProperty(CommonProjectActions.PROJECT_PARENT_FOLDER, 
parentFolder);
+        // PROJECT_PARENT_FOLDER confusing, better name is PROJECT_BASE_FOLDER
+        d.putProperty(CommonProjectActions.PROJECT_PARENT_FOLDER, 
projectFolder);
         if (d instanceof TemplateWizard) {
             ((TemplateWizard) d).setTargetFolderLazy(() -> {
-                parentFolder.mkdirs();
-                return 
DataFolder.findFolder(FileUtil.toFileObject(parentFolder));
+                projectFolder.mkdirs();
+                return 
DataFolder.findFolder(FileUtil.toFileObject(projectFolder));
             });
         }
         d.putProperty("name", name); //NOI18N
@@ -561,10 +562,14 @@ public class BasicPanelVisual extends JPanel implements 
DocumentListener, Window
                 handle = null;
             }
         }        
-        File projectLocation = (File) 
settings.getProperty(CommonProjectActions.PROJECT_PARENT_FOLDER); //NOI18N
-        if (projectLocation == null || projectLocation.getParentFile() == null 
|| !projectLocation.getParentFile().isDirectory()) {
+        // PROJECT_PARENT_FOLDER confusing, better name is PROJECT_BASE_FOLDER
+        File projectFolder = (File) 
settings.getProperty(CommonProjectActions.PROJECT_PARENT_FOLDER); //NOI18N
+        File projectLocation;
+        if (projectFolder == null || projectFolder.getParentFile() == null || 
!projectFolder.getParentFile().isDirectory()) {
             projectLocation = ProjectChooser.getProjectsFolder();
-        } 
+        } else {
+            projectLocation = projectFolder.getParentFile();
+        }
         
this.projectLocationTextField.setText(projectLocation.getAbsolutePath());
         
         String projectName = (String) settings.getProperty("name"); //NOI18N


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to