You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "D.R. (JIRA)" <ji...@codehaus.org> on 2008/09/24 18:55:45 UTC
[jira] Created: (WAGON-242) FtpWagon class needs to handle possible
null returned from ftpFiles[0].getTimestamp()
FtpWagon class needs to handle possible null returned from ftpFiles[0].getTimestamp()
-------------------------------------------------------------------------------------
Key: WAGON-242
URL: http://jira.codehaus.org/browse/WAGON-242
Project: Maven Wagon
Issue Type: Bug
Components: wagon-ftp
Affects Versions: 1.0-beta-4
Environment: IBM z/OS Unix System Services
Reporter: D.R.
Priority: Blocker
The following line can return a null value, causing a null pointer exception in the code.
FtpWagon.fillInputData()
...
//@todo check how it works! javadoc of common login says:
// Returns the file timestamp. This usually the last modification time.
//
long lastModified = ftpFiles[0].getTimestamp().getTimeInMillis();
...
org.apache.commons.net.ftp.parser.UnixFTPEntryParser.parseFTPEntry()
...
try
{
file.setTimestamp(super.parseTimestamp(datestr));
}
catch (ParseException e)
{
return null; // this is a parsing failure too.
}
...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (WAGON-242) FtpWagon class needs to handle
possible null returned from ftpFiles[0].getTimestamp()
Posted by "D.R. (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/WAGON-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148889#action_148889 ]
D.R. commented on WAGON-242:
----------------------------
This is no longer blocking and can be lowered to minor.
Adding Stacktrace:
java.lang.NullPointerException
at org.apache.maven.wagon.providers.ftp.FtpWagon.fillInputData(FtpWagon.java:354)
The work around is to revert to 1.0-alpha-5, this uses commons-net-1.1 instead of 1.4.1, in which it handles the 'getTimestamp' method differently for unix parsers.
> FtpWagon class needs to handle possible null returned from ftpFiles[0].getTimestamp()
> -------------------------------------------------------------------------------------
>
> Key: WAGON-242
> URL: http://jira.codehaus.org/browse/WAGON-242
> Project: Maven Wagon
> Issue Type: Bug
> Components: wagon-ftp
> Affects Versions: 1.0-beta-4
> Environment: IBM z/OS Unix System Services
> Reporter: D.R.
> Priority: Blocker
>
> The following line can return a null value, causing a null pointer exception in the code.
> FtpWagon.fillInputData()
> ...
> //@todo check how it works! javadoc of common login says:
> // Returns the file timestamp. This usually the last modification time.
> //
> long lastModified = ftpFiles[0].getTimestamp().getTimeInMillis();
> ...
> org.apache.commons.net.ftp.parser.UnixFTPEntryParser.parseFTPEntry()
> ...
> try
> {
> file.setTimestamp(super.parseTimestamp(datestr));
> }
> catch (ParseException e)
> {
> return null; // this is a parsing failure too.
> }
> ...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (WAGON-242) FtpWagon class needs to handle possible
null returned from ftpFiles[0].getTimestamp()
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/WAGON-242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brett Porter updated WAGON-242:
-------------------------------
Fix Version/s: 1.0-beta-5
> FtpWagon class needs to handle possible null returned from ftpFiles[0].getTimestamp()
> -------------------------------------------------------------------------------------
>
> Key: WAGON-242
> URL: http://jira.codehaus.org/browse/WAGON-242
> Project: Maven Wagon
> Issue Type: Bug
> Components: wagon-ftp
> Affects Versions: 1.0-beta-4
> Environment: IBM z/OS Unix System Services
> Reporter: D.R.
> Priority: Blocker
> Fix For: 1.0-beta-5
>
>
> The following line can return a null value, causing a null pointer exception in the code.
> FtpWagon.fillInputData()
> ...
> //@todo check how it works! javadoc of common login says:
> // Returns the file timestamp. This usually the last modification time.
> //
> long lastModified = ftpFiles[0].getTimestamp().getTimeInMillis();
> ...
> org.apache.commons.net.ftp.parser.UnixFTPEntryParser.parseFTPEntry()
> ...
> try
> {
> file.setTimestamp(super.parseTimestamp(datestr));
> }
> catch (ParseException e)
> {
> return null; // this is a parsing failure too.
> }
> ...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (WAGON-242) FtpWagon class needs to handle possible
null returned from ftpFiles[0].getTimestamp()
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/WAGON-242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brett Porter closed WAGON-242.
------------------------------
Assignee: Brett Porter
Resolution: Fixed
I think the upgrade to commons-net fixed this as the code in question is different in 2.0 (skips instead of returning null).
However I added a guard on the timestamp being null
> FtpWagon class needs to handle possible null returned from ftpFiles[0].getTimestamp()
> -------------------------------------------------------------------------------------
>
> Key: WAGON-242
> URL: http://jira.codehaus.org/browse/WAGON-242
> Project: Maven Wagon
> Issue Type: Bug
> Components: wagon-ftp
> Affects Versions: 1.0-beta-4
> Environment: IBM z/OS Unix System Services
> Reporter: D.R.
> Assignee: Brett Porter
> Priority: Blocker
> Fix For: 1.0-beta-5
>
>
> The following line can return a null value, causing a null pointer exception in the code.
> FtpWagon.fillInputData()
> ...
> //@todo check how it works! javadoc of common login says:
> // Returns the file timestamp. This usually the last modification time.
> //
> long lastModified = ftpFiles[0].getTimestamp().getTimeInMillis();
> ...
> org.apache.commons.net.ftp.parser.UnixFTPEntryParser.parseFTPEntry()
> ...
> try
> {
> file.setTimestamp(super.parseTimestamp(datestr));
> }
> catch (ParseException e)
> {
> return null; // this is a parsing failure too.
> }
> ...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira