Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-798

Use generics in SerializationUtils

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.2
    • lang.*
    • None

    Description

      Use generics in SerializationUtils:

      I'd like to propose the change below. This lets you get rid of type casts in call sites. You'll still get a ClassCastException if you code it wrong of course.

      Old: public static Object deserialize(InputStream inputStream)
      New: public static <T> T deserialize(InputStream inputStream)

      Old: public static Object deserialize(byte[] objectData)
      New: public static <T> T deserialize(byte[] objectData)

      Attachments

        Activity

          People

            Unassigned Unassigned
            ggregory Gary D. Gregory
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: