You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Steven Swor (JIRA)" <ji...@apache.org> on 2012/11/09 00:24:11 UTC

[jira] [Created] (PIVOT-880) NPE when calling FileBrowser.setRootDirectory using a UNC path

Steven Swor created PIVOT-880:
---------------------------------

             Summary: NPE when calling FileBrowser.setRootDirectory using a UNC path
                 Key: PIVOT-880
                 URL: https://issues.apache.org/jira/browse/PIVOT-880
             Project: Pivot
          Issue Type: Bug
          Components: wtk-terra
    Affects Versions: 2.0.1
         Environment: Windows XP with network shares
            Reporter: Steven Swor
            Priority: Minor


I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").

In testing, I discovered a NPE was being logged when I ran the following code:
{code}
FileBrowser browser = ... //assume the browser is shown
String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
java.io.File directory = new java.io.File(path);
if (directory.exists()) {
    browser.setRootDirectory(directory);
}
{code}

The exception stack trace is:
{code}
java.lang.NullPointerException
	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
{code}

Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (PIVOT-880) NPE when calling FileBrowser.setRootDirectory using a UNC path

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Whitcomb resolved PIVOT-880.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.3

[trunk]
Sending        wtk-terra\src\org\apache\pivot\wtk\skin\terra\TerraFileBrowserSkin.java
Transmitting file data .
Committed revision 1407585.

[branches/2.0.x]
Sending        .
Sending        wtk-terra\src\org\apache\pivot\wtk\skin\terra\TerraFileBrowserSkin.java
Transmitting file data .
Committed revision 1407586.
                
> NPE when calling FileBrowser.setRootDirectory using a UNC path
> --------------------------------------------------------------
>
>                 Key: PIVOT-880
>                 URL: https://issues.apache.org/jira/browse/PIVOT-880
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk-terra
>    Affects Versions: 2.0.1
>         Environment: Windows XP with network shares
>            Reporter: Steven Swor
>            Assignee: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.1, 2.0.3
>
>
> I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").
> In testing, I discovered a NPE was being logged when I ran the following code:
> {code}
>   FileBrowser browser = ... //assume the browser is shown
>   String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
>   java.io.File directory = new java.io.File(path);
>   if (directory.exists()) {
>       browser.setRootDirectory(directory);
>   }
> {code}
> The exception stack trace is:
> {quote}
>   java.lang.NullPointerException
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
> 	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
> 	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
> 	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
> 	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
> 	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
> {quote}
> Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (PIVOT-880) NPE when calling FileBrowser.setRootDirectory using a UNC path

Posted by "Steven Swor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Swor updated PIVOT-880:
------------------------------

    Description: 
I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").

In testing, I discovered a NPE was being logged when I ran the following code:

{code}
FileBrowser browser = ... //assume the browser is shown
String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
java.io.File directory = new java.io.File(path);
if (directory.exists()) {
    browser.setRootDirectory(directory);
}
{code}

The exception stack trace is:

{code}
java.lang.NullPointerException
	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
{code}

Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

  was:
I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").

In testing, I discovered a NPE was being logged when I ran the following code:
{code}
FileBrowser browser = ... //assume the browser is shown
String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
java.io.File directory = new java.io.File(path);
if (directory.exists()) {
    browser.setRootDirectory(directory);
}
{code}

The exception stack trace is:
{code}
java.lang.NullPointerException
	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
{code}

Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

    
> NPE when calling FileBrowser.setRootDirectory using a UNC path
> --------------------------------------------------------------
>
>                 Key: PIVOT-880
>                 URL: https://issues.apache.org/jira/browse/PIVOT-880
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk-terra
>    Affects Versions: 2.0.1
>         Environment: Windows XP with network shares
>            Reporter: Steven Swor
>            Priority: Minor
>
> I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").
> In testing, I discovered a NPE was being logged when I ran the following code:
> {code}
> FileBrowser browser = ... //assume the browser is shown
> String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
> java.io.File directory = new java.io.File(path);
> if (directory.exists()) {
>     browser.setRootDirectory(directory);
> }
> {code}
> The exception stack trace is:
> {code}
> java.lang.NullPointerException
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
> 	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
> 	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
> 	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
> 	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
> 	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
> {code}
> Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (PIVOT-880) NPE when calling FileBrowser.setRootDirectory using a UNC path

Posted by "Steven Swor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Swor updated PIVOT-880:
------------------------------

    Description: 
I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").

In testing, I discovered a NPE was being logged when I ran the following code:
{code}
  FileBrowser browser = ... //assume the browser is shown
  String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
  java.io.File directory = new java.io.File(path);
  if (directory.exists()) {
      browser.setRootDirectory(directory);
  }
{code}

The exception stack trace is:
{quote}
  java.lang.NullPointerException
	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
{quote}

Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

  was:
I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").

In testing, I discovered a NPE was being logged when I ran the following code:

{code}
FileBrowser browser = ... //assume the browser is shown
String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
java.io.File directory = new java.io.File(path);
if (directory.exists()) {
    browser.setRootDirectory(directory);
}
{code}

The exception stack trace is:

{code}
java.lang.NullPointerException
	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
{code}

Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

    
> NPE when calling FileBrowser.setRootDirectory using a UNC path
> --------------------------------------------------------------
>
>                 Key: PIVOT-880
>                 URL: https://issues.apache.org/jira/browse/PIVOT-880
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk-terra
>    Affects Versions: 2.0.1
>         Environment: Windows XP with network shares
>            Reporter: Steven Swor
>            Priority: Minor
>
> I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").
> In testing, I discovered a NPE was being logged when I ran the following code:
> {code}
>   FileBrowser browser = ... //assume the browser is shown
>   String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
>   java.io.File directory = new java.io.File(path);
>   if (directory.exists()) {
>       browser.setRootDirectory(directory);
>   }
> {code}
> The exception stack trace is:
> {quote}
>   java.lang.NullPointerException
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
> 	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
> 	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
> 	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
> 	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
> 	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
> {quote}
> Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIVOT-880) NPE when calling FileBrowser.setRootDirectory using a UNC path

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494203#comment-13494203 ] 

Roger Whitcomb commented on PIVOT-880:
--------------------------------------

@Steven:  can you build the latest 2.0.x code and verify that this is fixed for you?  I was able to reproduce it and verified that this change fixed the problem for me.  Thanks.
                
> NPE when calling FileBrowser.setRootDirectory using a UNC path
> --------------------------------------------------------------
>
>                 Key: PIVOT-880
>                 URL: https://issues.apache.org/jira/browse/PIVOT-880
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk-terra
>    Affects Versions: 2.0.1
>         Environment: Windows XP with network shares
>            Reporter: Steven Swor
>            Assignee: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.1, 2.0.3
>
>
> I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").
> In testing, I discovered a NPE was being logged when I ran the following code:
> {code}
>   FileBrowser browser = ... //assume the browser is shown
>   String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
>   java.io.File directory = new java.io.File(path);
>   if (directory.exists()) {
>       browser.setRootDirectory(directory);
>   }
> {code}
> The exception stack trace is:
> {quote}
>   java.lang.NullPointerException
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
> 	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
> 	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
> 	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
> 	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
> 	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
> {quote}
> Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIVOT-880) NPE when calling FileBrowser.setRootDirectory using a UNC path

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493931#comment-13493931 ] 

Sandro Martini commented on PIVOT-880:
--------------------------------------

just committed a minimal test case (under tests/src/.../issues/ , as asual): pivot_880.bxml (but without Java code, only bxml), both in 2.0.x and trunk

                
> NPE when calling FileBrowser.setRootDirectory using a UNC path
> --------------------------------------------------------------
>
>                 Key: PIVOT-880
>                 URL: https://issues.apache.org/jira/browse/PIVOT-880
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk-terra
>    Affects Versions: 2.0.1
>         Environment: Windows XP with network shares
>            Reporter: Steven Swor
>            Assignee: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.1
>
>
> I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").
> In testing, I discovered a NPE was being logged when I ran the following code:
> {code}
>   FileBrowser browser = ... //assume the browser is shown
>   String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
>   java.io.File directory = new java.io.File(path);
>   if (directory.exists()) {
>       browser.setRootDirectory(directory);
>   }
> {code}
> The exception stack trace is:
> {quote}
>   java.lang.NullPointerException
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
> 	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
> 	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
> 	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
> 	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
> 	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
> {quote}
> Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIVOT-880) NPE when calling FileBrowser.setRootDirectory using a UNC path

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493825#comment-13493825 ] 

Sandro Martini commented on PIVOT-880:
--------------------------------------

Of course a workaround is to map the sahre to a drive letter, just to avoid the NPE ... in the meantime we look at it, if there is a simple solution (for 2.0.x, now I start to look), otherwise we have to fix in 2.1 .

Roger, you are currently working on FileBrowser ... what do you think ?

                
> NPE when calling FileBrowser.setRootDirectory using a UNC path
> --------------------------------------------------------------
>
>                 Key: PIVOT-880
>                 URL: https://issues.apache.org/jira/browse/PIVOT-880
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk-terra
>    Affects Versions: 2.0.1
>         Environment: Windows XP with network shares
>            Reporter: Steven Swor
>            Assignee: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.1
>
>
> I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").
> In testing, I discovered a NPE was being logged when I ran the following code:
> {code}
>   FileBrowser browser = ... //assume the browser is shown
>   String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
>   java.io.File directory = new java.io.File(path);
>   if (directory.exists()) {
>       browser.setRootDirectory(directory);
>   }
> {code}
> The exception stack trace is:
> {quote}
>   java.lang.NullPointerException
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
> 	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
> 	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
> 	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
> 	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
> 	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
> {quote}
> Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIVOT-880) NPE when calling FileBrowser.setRootDirectory using a UNC path

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495215#comment-13495215 ] 

Sandro Martini commented on PIVOT-880:
--------------------------------------

Hi all,
after some tests with the pivot_880,bxml test case (that's using the FileBrowserSheet instead, but it's the same), I had to do some small updates to the test case and to FileBrowserSheet : Committed revision 1408247 , noe I'll commit even in trunk.

@Roger, if you run this test case, you can see that now all works, but the drive letters lists local drives and not the network server (which is the first option in folders list) ... what do you think ?

                
> NPE when calling FileBrowser.setRootDirectory using a UNC path
> --------------------------------------------------------------
>
>                 Key: PIVOT-880
>                 URL: https://issues.apache.org/jira/browse/PIVOT-880
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk-terra
>    Affects Versions: 2.0.1
>         Environment: Windows XP with network shares
>            Reporter: Steven Swor
>            Assignee: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.1, 2.0.3
>
>
> I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").
> In testing, I discovered a NPE was being logged when I ran the following code:
> {code}
>   FileBrowser browser = ... //assume the browser is shown
>   String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
>   java.io.File directory = new java.io.File(path);
>   if (directory.exists()) {
>       browser.setRootDirectory(directory);
>   }
> {code}
> The exception stack trace is:
> {quote}
>   java.lang.NullPointerException
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
> 	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
> 	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
> 	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
> 	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
> 	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
> {quote}
> Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIVOT-880) NPE when calling FileBrowser.setRootDirectory using a UNC path

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494165#comment-13494165 ] 

Roger Whitcomb commented on PIVOT-880:
--------------------------------------

Probably is in code I modified lately -- I will fix it.
                
> NPE when calling FileBrowser.setRootDirectory using a UNC path
> --------------------------------------------------------------
>
>                 Key: PIVOT-880
>                 URL: https://issues.apache.org/jira/browse/PIVOT-880
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk-terra
>    Affects Versions: 2.0.1
>         Environment: Windows XP with network shares
>            Reporter: Steven Swor
>            Assignee: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.1
>
>
> I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").
> In testing, I discovered a NPE was being logged when I ran the following code:
> {code}
>   FileBrowser browser = ... //assume the browser is shown
>   String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
>   java.io.File directory = new java.io.File(path);
>   if (directory.exists()) {
>       browser.setRootDirectory(directory);
>   }
> {code}
> The exception stack trace is:
> {quote}
>   java.lang.NullPointerException
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
> 	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
> 	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
> 	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
> 	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
> 	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
> {quote}
> Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (PIVOT-880) NPE when calling FileBrowser.setRootDirectory using a UNC path

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495215#comment-13495215 ] 

Sandro Martini edited comment on PIVOT-880 at 11/12/12 11:33 AM:
-----------------------------------------------------------------

Hi all,
after some tests with the pivot_880,bxml test case (that's using the FileBrowserSheet instead, but it's the same), I had to do some small updates to the test case and to FileBrowserSheet : 
Committed revision 1408247 , now I'll commit even in trunk.

@Roger, if you run this test case, you can see that now all works, but the drive letters lists local drives and not the network server (which is the first option in folders list) ... what do you think ?

                
      was (Author: smartini):
    Hi all,
after some tests with the pivot_880,bxml test case (that's using the FileBrowserSheet instead, but it's the same), I had to do some small updates to the test case and to FileBrowserSheet : Committed revision 1408247 , noe I'll commit even in trunk.

@Roger, if you run this test case, you can see that now all works, but the drive letters lists local drives and not the network server (which is the first option in folders list) ... what do you think ?

                  
> NPE when calling FileBrowser.setRootDirectory using a UNC path
> --------------------------------------------------------------
>
>                 Key: PIVOT-880
>                 URL: https://issues.apache.org/jira/browse/PIVOT-880
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk-terra
>    Affects Versions: 2.0.1
>         Environment: Windows XP with network shares
>            Reporter: Steven Swor
>            Assignee: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.1, 2.0.3
>
>
> I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").
> In testing, I discovered a NPE was being logged when I ran the following code:
> {code}
>   FileBrowser browser = ... //assume the browser is shown
>   String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
>   java.io.File directory = new java.io.File(path);
>   if (directory.exists()) {
>       browser.setRootDirectory(directory);
>   }
> {code}
> The exception stack trace is:
> {quote}
>   java.lang.NullPointerException
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
> 	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
> 	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
> 	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
> 	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
> 	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
> {quote}
> Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (PIVOT-880) NPE when calling FileBrowser.setRootDirectory using a UNC path

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini updated PIVOT-880:
---------------------------------

    Fix Version/s: 2.1
         Assignee: Roger Whitcomb
    
> NPE when calling FileBrowser.setRootDirectory using a UNC path
> --------------------------------------------------------------
>
>                 Key: PIVOT-880
>                 URL: https://issues.apache.org/jira/browse/PIVOT-880
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk-terra
>    Affects Versions: 2.0.1
>         Environment: Windows XP with network shares
>            Reporter: Steven Swor
>            Assignee: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.1
>
>
> I'm using Pivot as the user interface to an enterprise application.  I want my users to be able to control applicaiton settings through the UI, such as where to save output files.  In this particular case, the users want to use a network share accessed via a UNC path ("\\server\share").
> In testing, I discovered a NPE was being logged when I ran the following code:
> {code}
>   FileBrowser browser = ... //assume the browser is shown
>   String path = ... //UNC path, such as "\\server\share" (escape slashes removed for legibility)
>   java.io.File directory = new java.io.File(path);
>   if (directory.exists()) {
>       browser.setRootDirectory(directory);
>   }
> {code}
> The exception stack trace is:
> {quote}
>   java.lang.NullPointerException
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin$2.selectedItemChanged(TerraFileBrowserSkin.java:610)
> 	at org.apache.pivot.wtk.ListButton$ListButtonSelectionListenerList.selectedItemChanged(ListButton.java:131)
> 	at org.apache.pivot.wtk.ListButton.setSelectedIndex(ListButton.java:514)
> 	at org.apache.pivot.wtk.ListButton.setSelectedItem(ListButton.java:532)
> 	at org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin.rootDirectoryChanged(TerraFileBrowserSkin.java:955)
> 	at org.apache.pivot.wtk.FileBrowser$FileBrowserListenerList.rootDirectoryChanged(FileBrowser.java:44)
> 	at org.apache.pivot.wtk.FileBrowser.setRootDirectory(FileBrowser.java:127)
> {quote}
> Stepping through the code, it appears as though TerraFileBrowserSkin tries to select the drive by looking for path separators (slash characters), but it gets thrown off by the leading slashes in the UNC path.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira