[ 
https://issues.apache.org/jira/browse/THRIFT-4476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16391014#comment-16391014
 ] 

ASF GitHub Bot commented on THRIFT-4476:
----------------------------------------

Github user ozymaxx commented on the issue:

    https://github.com/apache/thrift/pull/1496
  
    I finalized the changes, however there are a couple of errors in my builds 
which I think are irrelevant to my changes.
    
    Here are the links to my build results (please let me know if you cannot 
access them):
    Travis-CI: https://travis-ci.org/ozymaxx/thrift
    AppVeyor: https://ci.appveyor.com/project/ozymaxx/thrift/build/1.0.0-dev.42
    
    Here are the error descriptions:
    On Travis CI `#19.7`:
    ```
      +-- [email protected]
      +-- [email protected]
      | `-- [email protected]
      +-- [email protected]
      `-- [email protected]
        +-- [email protected]
        `-- [email protected]
          `-- [email protected]
            `-- [email protected] deduped
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by 
[email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by 
[email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by 
[email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    Makefile:811: recipe for target 'check-local' failed
    make[4]: *** [check-local] Error 1
    make[4]: Leaving directory '/thrift/src/lib/js'
    Makefile:686: recipe for target 'check-am' failed
    make[3]: *** [check-am] Error 2
    make[3]: Leaving directory '/thrift/src/lib/js'
    Makefile:536: recipe for target 'check-recursive' failed
    make[2]: *** [check-recursive] Error 1
    make[2]: Leaving directory '/thrift/src/lib/js'
    Makefile:580: recipe for target 'check-recursive' failed
    make[1]: *** [check-recursive] Error 1
    make[1]: Leaving directory '/thrift/src/lib'
    Makefile:662: recipe for target 'check-recursive' failed
    make: *** [check-recursive] Error 1
    ```
    
    On Travis CI `19.11`:
    ```
    
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by 
[email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by 
[email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by 
[email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    npm ERR! missing: [email protected], required by [email protected]
    Makefile:811: recipe for target 'check-local' failed
    make[4]: *** [check-local] Error 1
    make[4]: Leaving directory '/thrift/src/lib/js'
    Makefile:686: recipe for target 'check-am' failed
    make[3]: *** [check-am] Error 2
    make[3]: Leaving directory '/thrift/src/lib/js'
    Makefile:536: recipe for target 'check-recursive' failed
    make[2]: *** [check-recursive] Error 1
    make[2]: Leaving directory '/thrift/src/lib/js'
    Makefile:580: recipe for target 'check-recursive' failed
    make[1]: *** [check-recursive] Error 1
    make[1]: Leaving directory '/thrift/src/lib'
    Makefile:662: recipe for target 'check-recursive' failed
    make: *** [check-recursive] Error 1
    ```
    
    On AppVeyor `Environment: PROFILE=CYGWIN, PLATFORM=x64, 
CONFIGURATION=RelWithDebInfo, 
DISABLED_TESTS=(ZlibTest|OpenSSLManualInitTest|TNonblockingServerTest|StressTestNonBlocking)`:
    ```
    2314Scanning dependencies of target thrift_static
    2315      0 [main] make 3676 fork: child -1 - forked process 3656 died 
unexpectedly, retry 0, exit code 0xC0000005, errno 11
    2316make[2]: fork: Resource temporarily unavailable
    2317make[1]: *** [CMakeFiles/Makefile2:1171: 
lib/cpp/CMakeFiles/thrift_static.dir/all] Error 2
    2318make: *** [Makefile:161: all] Error 2
    2319
    2320C:\projects\thrift>set lastexitcode=2 
    2321
    2322C:\projects\thrift>set  
1>C:\Users\appveyor\AppData\Local\Temp\tmp86A3.tmp 
    2323
    2324C:\projects\thrift>echo C:\projects\thrift  
1>C:\Users\appveyor\AppData\Local\Temp\tmp86A4.tmp 
    2325
    2326C:\projects\thrift>exit /b 2 
    2327
    ```


> Typecasting problem on list items
> ---------------------------------
>
>                 Key: THRIFT-4476
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4476
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Compiler
>    Affects Versions: 0.11.0
>            Reporter: Ozan Can Altiok
>            Priority: Major
>
> I was trying to add the following into a thrift interface file.
> {{const list<double> timeCoefficients = [24, 60, 60, 1000, 1000, 1000]}}
> With the definition given above the {{.thrift}} file compiled properly. 
> However, I noticed that in Python, the items in {{timeCoefficients}} are 
> considered to be integer although the list has been defined to include items 
> of {{double}} type. Then I modified the definition as given below to make 
> sure all the items are of type {{double}}. 
> {{const list<double> timeCoefficients = [24.0, 60.0, 60.0, 1000.0, 1000.0, 
> 1000.0]}}
> After the change, I ran into the following error during compilation.
> {{[ERROR] .../TimeCoefficients.java:[402,48] error: no suitable method found 
> for add(int)}}
>  {{[ERROR] method Collection.add(Double) is not applicable}}
>  {{[ERROR] (argument mismatch; int cannot be converted to Double)}}
>  {{[ERROR] method List.add(Double) is not applicable}}
>  {{[ERROR] (argument mismatch; int cannot be converted to Double)}}
> Next, I changed the line as follows and the compilation became successful.
> {{const list<double> timeCoefficients = [24.1, 60.1, 60.1, 1000.1, 1000.1, 
> 1000.1]}}
> When I reviewed the generated Java source files, I discovered that
> {{const list<double> timeCoefficients = [24, 60, 60, 1000, 1000, 1000]}}
> compiles to
> {{public static final java.util.List<java.lang.Double> timeCoefficients = new 
> java.util.ArrayList<java.lang.Double>();}}
> {{static {}}
> {{  timeCoefficients.add((double)24);}}
>  {{  timeCoefficients.add((double)60);}}
>  {{  timeCoefficients.add((double)60);}}
>  {{  timeCoefficients.add((double)1000);}}
>  {{  timeCoefficients.add((double)1000);}}
>  {{  timeCoefficients.add((double)1000);}}
> {{}}}
> whilst
> {{const list<double> timeCoefficients = [24.0, 60.0, 60.0, 1000.0, 1000.0, 
> 1000.0]}}
> compiles to
> {{public static final java.util.List<java.lang.Double> timeCoefficients = new 
> java.util.ArrayList<java.lang.Double>();}}
> {{static {}}
> {{  timeCoefficients.add(24);}}
> {{  timeCoefficients.add(60);}}
> {{  timeCoefficients.add(60);}}
> {{  timeCoefficients.add(1000);}}
> {{  timeCoefficients.add(1000);}}
> {{  timeCoefficients.add(1000);}}
> {{}}}
> which leads to an error.
> When I modified this line as follows
> {{const list<double> timeCoefficients = [24.1, 60.1, 60.1, 1000.1, 1000.1, 
> 1000.1]}}
> this line compiled to
> {{public static final java.util.List<java.lang.Double> timeCoefficients = new 
> java.util.ArrayList<java.lang.Double>();}}
> {{static {}}
> {{  timeCoefficients.add(24.1);}}
> {{  timeCoefficients.add(60.1);}}
> {{  timeCoefficients.add(60.1);}}
> {{  timeCoefficients.add(1000.1);}}
> {{  timeCoefficients.add(1000.1);}}
> {{  timeCoefficients.add(1000.1);}}
> {{}}}
> My guess is that, even if I put {{.0}} at the end of each numeric constant, 
> on the Java side, Thrift compiler considers them to be {{double}} and does no 
> typecasts. However, the {{.0}} s are getting lost somewhere and the items 
> become integers in the generated Java code. Thus, when it comes to populating 
> the array, Java cannot succeed. {{Double}} s cannot be unboxed to integer and 
> Java thinks {{int}} and {{Double}} are not related.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to