Usage of constructors of primitive wrapper classes should be avoided in java.lang API docs

XMLWordPrintable

    • b05
    • generic
    • generic

        A DESCRIPTION OF THE PROBLEM :
        There are several code samples in the Java SE API documentation still using constructors of primitive wrapper classes, which are deprecated for removal. They should be replaced by valueOf factory methods or auto-boxing.

        Here's what I found:

        java.lang.ArrayStoreException
        java.lang.ClassCastException
        java.lang.Double.compare(double, double)
        java.lang.Float.compare(float, float)
        java.lang.Integer.getInteger(String, int)
        java.lang.Integer.valueOf(String)
        java.lang.Integer.valueOf(String, int)
        java.lang.Long.getLong(String, long)
        java.lang.Long.valueOf(String)
        java.lang.Long.valueOf(String, int)
        java.lang.Short.valueOf(String)
        java.lang.Short.valueOf(String, int)


              Assignee:
              Justin Lu
              Reporter:
              Andrew Wang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: