Its in real not getting converted into int. Only thing happening is as JS Object its not showing .0
which is not relevant.
In your sample program, change some of the value from double[] d = new double[]{1.0,2.0,3.0}
to
double[] d = new double[]{1.0,2.1,3.1}
and run the program.
You will observer its in real not converting into int. The output you will get is {"doubles":[1,2.1,3.1]}