[ 
https://issues.apache.org/jira/browse/FTPSERVER-143?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Niklas Gustavsson closed FTPSERVER-143.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0-M2
         Assignee: Niklas Gustavsson

Fixed, thanks for reporting!

svn commit 
"/media/big/home/svn/apache/ftpserver-trunk/core/src/main/java/org/apache/ftpserver/usermanager/DbUserManager.java"
 -m "DBUserManager.getUserByName misses the lazyInit() function 
(FTPSERVER-143)" --username "ngn"
        M 
/media/big/home/svn/apache/ftpserver-trunk/core/src/main/java/org/apache/ftpserver/usermanager/DbUserManager.java
          Transmitting file data: 
/media/big/home/svn/apache/ftpserver-trunk/core/src/main/java/org/apache/ftpserver/usermanager/DbUserManager.java
Committed revision 681389

> DBUserManager.getUserByName misses the lazyInit() function
> ----------------------------------------------------------
>
>                 Key: FTPSERVER-143
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-143
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Core
>            Reporter: Peter van der Velde
>            Assignee: Niklas Gustavsson
>            Priority: Minor
>             Fix For: 1.0-M2
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> In the file DBUserManager.java all database acces functions call the lazyinit 
> function before continuing.
>     /**
>      * Get the user object. Fetch the row from the table.
>      */
>     public synchronized User getUserByName(String name) throws FtpException {
>         
>         Statement stmt = null;
>         ResultSet rs = null;
>         try {
>             
>             // create sql query
>             HashMap<String, Object> map = new HashMap<String, Object>();
>             map.put( ATTR_LOGIN, escapeString(name) );
>             String sql = StringUtils.replaceString(selectUserStmt, map);
>             LOG.info(sql);
>             
>             // execute query
>             stmt = createConnection().createStatement();
>             rs = stmt.executeQuery(sql);
> ...
> I think line 1 should be like for instance in the save function
>    /**
>      * Save user. If new insert a new row, else update the existing row.
>      */
>     public synchronized void save(User user) throws FtpException {
>         lazyInit();
>         
>         // null value check
>         if(user.getName() == null) {
>             throw new NullPointerException("User name is null.");
>         } 
> ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to