You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mailet-api@james.apache.org by "Felix Knecht (JIRA)" <ma...@james.apache.org> on 2011/04/05 10:12:06 UTC

[jira] [Created] (MAILET-37) Java doesn't pass method arguments by reference; it passes them by value

Java doesn't pass method arguments by reference; it passes them by value
------------------------------------------------------------------------

                 Key: MAILET-37
                 URL: https://issues.apache.org/jira/browse/MAILET-37
             Project: Mailet
          Issue Type: Bug
          Components: Core API
    Affects Versions: 2.5
         Environment: all
            Reporter: Felix Knecht
            Priority: Critical


MailAddress [1] seems to defines "int pos = 0" in c'tor and never increments it. This will throw the Exception at line  132 in almost every case (throw new AddressException("Did not find @ between local-part and domain at position " + (pos + 1) + " in '" + address + "'",address,pos+1);), because 'pos' will be 0 in this place! Updates of pos seem to be done in various methods called within c'tor and it looks like 'pos' is overgiven to these methods as parameter by reference (e.g. localPartSB.append(parseUnquotedLocalPart(address, pos));). This will not work (see title)


[1] http://svn.apache.org/repos/asf/james/mailet/api/trunk/src/main/java/org/apache/mailet/MailAddress.java

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (MAILET-37) Java doesn't pass method arguments by reference; it passes them by value

Posted by "Felix Knecht (JIRA)" <ma...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MAILET-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Knecht reassigned MAILET-37:
----------------------------------

    Assignee: Felix Knecht

> Java doesn't pass method arguments by reference; it passes them by value
> ------------------------------------------------------------------------
>
>                 Key: MAILET-37
>                 URL: https://issues.apache.org/jira/browse/MAILET-37
>             Project: Mailet
>          Issue Type: Bug
>          Components: Core API
>    Affects Versions: 2.5
>         Environment: all
>            Reporter: Felix Knecht
>            Assignee: Felix Knecht
>            Priority: Critical
>
> MailAddress [1] seems to defines "int pos = 0" in c'tor and never increments it. This will throw the Exception at line  132 in almost every case (throw new AddressException("Did not find @ between local-part and domain at position " + (pos + 1) + " in '" + address + "'",address,pos+1);), because 'pos' will be 0 in this place! Updates of pos seem to be done in various methods called within c'tor and it looks like 'pos' is overgiven to these methods as parameter by reference (e.g. localPartSB.append(parseUnquotedLocalPart(address, pos));). This will not work (see title)
> [1] http://svn.apache.org/repos/asf/james/mailet/api/trunk/src/main/java/org/apache/mailet/MailAddress.java

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (MAILET-37) Java doesn't pass method arguments by reference; it passes them by value

Posted by "Felix Knecht (JIRA)" <ma...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MAILET-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Knecht closed MAILET-37.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.5

When enabled, test cases are passing again.

> Java doesn't pass method arguments by reference; it passes them by value
> ------------------------------------------------------------------------
>
>                 Key: MAILET-37
>                 URL: https://issues.apache.org/jira/browse/MAILET-37
>             Project: Mailet
>          Issue Type: Bug
>          Components: Core API
>    Affects Versions: 2.5
>         Environment: all
>            Reporter: Felix Knecht
>            Assignee: Felix Knecht
>            Priority: Critical
>             Fix For: 2.5
>
>
> MailAddress [1] seems to defines "int pos = 0" in c'tor and never increments it. This will throw the Exception at line  132 in almost every case (throw new AddressException("Did not find @ between local-part and domain at position " + (pos + 1) + " in '" + address + "'",address,pos+1);), because 'pos' will be 0 in this place! Updates of pos seem to be done in various methods called within c'tor and it looks like 'pos' is overgiven to these methods as parameter by reference (e.g. localPartSB.append(parseUnquotedLocalPart(address, pos));). This will not work (see title)
> [1] http://svn.apache.org/repos/asf/james/mailet/api/trunk/src/main/java/org/apache/mailet/MailAddress.java

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira