jtulach commented on a change in pull request #1991: [NETBEANS-3918] defer
creation of target folder until/if needed
URL: https://github.com/apache/netbeans/pull/1991#discussion_r386077499
##########
File path: platform/openide.loaders/src/org/openide/loaders/TemplateWizard.java
##########
@@ -244,7 +252,14 @@ public DataFolder getTemplatesFolder () {
public DataFolder getTargetFolder () throws IOException {
LOG.log(Level.FINE, "targetFolder={0} for {1}", new Object[]
{targetDataFolder, this});
if (targetDataFolder == null) {
- throw new IOException(NbBundle.getMessage(TemplateWizard.class,
"ERR_NoFilesystem"));
+ // Fix for [NETBEANS-3918] and [NETBEANS-3875]
+ File targetFolderFile = (File)
getProperty(PROP_TARGET_FOLDER_HINT);
Review comment:
The proposed property `PROP_TARGET_FOLDR_HINT` can hold any value, not just
`File`. To prevent `ClassCastException` change this and next line to `if (value
instanceof File) { ... }`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
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