Here you can find the source of toShort(String value)
public static Short toShort(String value)
//package com.java2s; //License from project: Open Source License public class Main { public static Short toShort(String value) { if (null == value) { return null; }/* w w w. j a v a 2s. co m*/ value = value.trim(); if ("null".equals(value)) { return null; } Double d = Double.parseDouble(value); return d.shortValue(); } public static Short toShort(Object value) { return toShort(String.valueOf(value)); } }