You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Neil Fraser (JIRA)" <ji...@apache.org> on 2009/06/24 02:07:07 UTC

[jira] Created: (AXIS2-4405) (int)Math.random() always returns 0

(int)Math.random() always returns 0
-----------------------------------

                 Key: AXIS2-4405
                 URL: https://issues.apache.org/jira/browse/AXIS2-4405
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
            Reporter: Neil Fraser


This file:
modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl

Contains the following code:

private java.lang.String createPrefix() {
                return "ns" + (int)Math.random();
}

This code is clearly defective, since (int)Math.random() will always return 0.
It is unknown if this is causing errors or if the code is ever executed.  This bug was found through static analysis.
Note that bug AXIS2-2366 dealt with this two years ago, but the code remains.

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


[jira] Assigned: (AXIS2-4405) (int)Math.random() always returns 0

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

Andreas Veithen reassigned AXIS2-4405:
--------------------------------------

    Assignee: Andreas Veithen

> (int)Math.random() always returns 0
> -----------------------------------
>
>                 Key: AXIS2-4405
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4405
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>            Reporter: Neil Fraser
>            Assignee: Andreas Veithen
>
> This file:
> modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
> Contains the following code:
> private java.lang.String createPrefix() {
>                 return "ns" + (int)Math.random();
> }
> This code is clearly defective, since (int)Math.random() will always return 0.
> It is unknown if this is causing errors or if the code is ever executed.  This bug was found through static analysis.
> Note that bug AXIS2-2366 dealt with this two years ago, but the code remains.

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


[jira] Resolved: (AXIS2-4405) (int)Math.random() always returns 0

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

Andreas Veithen resolved AXIS2-4405.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.6

> (int)Math.random() always returns 0
> -----------------------------------
>
>                 Key: AXIS2-4405
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4405
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>            Reporter: Neil Fraser
>            Assignee: Andreas Veithen
>             Fix For: 1.6
>
>
> This file:
> modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
> Contains the following code:
> private java.lang.String createPrefix() {
>                 return "ns" + (int)Math.random();
> }
> This code is clearly defective, since (int)Math.random() will always return 0.
> It is unknown if this is causing errors or if the code is ever executed.  This bug was found through static analysis.
> Note that bug AXIS2-2366 dealt with this two years ago, but the code remains.

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


[jira] Commented: (AXIS2-4405) (int)Math.random() always returns 0

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12724676#action_12724676 ] 

Andreas Veithen commented on AXIS2-4405:
----------------------------------------

This part of the template is responsible for code generation in "helper mode" in which the schema compiler separates the parser/serializer code from the beans. Apparently this has not been updated for quite some time and there are not many people using this mode. Note that AXIS2-2366 fixed the issue, but only for normal mode.

> (int)Math.random() always returns 0
> -----------------------------------
>
>                 Key: AXIS2-4405
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4405
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>            Reporter: Neil Fraser
>
> This file:
> modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
> Contains the following code:
> private java.lang.String createPrefix() {
>                 return "ns" + (int)Math.random();
> }
> This code is clearly defective, since (int)Math.random() will always return 0.
> It is unknown if this is causing errors or if the code is ever executed.  This bug was found through static analysis.
> Note that bug AXIS2-2366 dealt with this two years ago, but the code remains.

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