var passwordField = pwFields[pwFields.length - 1].element; 
var passwordField = pwFields[0].element; 
    _fillPassword : function (usernameField) {        this.log("fillPassword autocomplete username: " + usernameField.value);        var form = usernameField.form;        var doc = form.ownerDocument;        var hostname = this._getPasswordOrigin(doc.documentURI);        var formSubmitURL = this._getActionOrigin(form)        // Find the password field. We should always have at least one,        // or else something has gone rather wrong.        var pwFields = this._getPasswordFields(form, false);        if (!pwFields) {            const err = "No password field for autocomplete password fill.";            // We want to know about this even if debugging is disabled.            if (!this._debug)                dump(err);            else                this.log(err);            return;        }        // XXX: we could do better on forms with 2 or 3 password fields.        var passwordField = pwFields[pwFields.length - 1].element;        // XXX this would really be cleaner if we could get at the        // AutoCompleteResult, which has the actual nsILoginInfo for the        // username selected.        // Temporary LoginInfo with the info we know.        var currentLogin = new this._nsLoginInfo();        currentLogin.init(hostname, formSubmitURL, null,                          usernameField.value, null,                          usernameField.name, passwordField.name);        // Look for a existing login and use its password.        var match = null;        var logins = this.findLogins({}, hostname, formSubmitURL, null);        if (!logins.some(function(l) {                                match = l;                                return currentLogin.equalsIgnorePassword(l);                        }))        {            this.log("Can't find a login for this autocomplete result.");            return;        }        this.log("Found a matching login, filling in password.");        passwordField.value = match.password;    }
5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5872/b684c2da5b304c09fa0da345cddfdcb142dee9f7/nsLoginManager.js/buggy/toolkit/components/passwordmgr/src/nsLoginManager.js