Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4010466

java.sql.Timestamp.setNanos() works wrong with negative values

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1
    • CPU:
      sparc
    • OS:
      solaris_2.5
    • Verification:
      Not verified

      Description

      This method should throw IllegalArgumentException but it doesn't

      === Here is the test demonstrating ther bug ===
      class java_sql_Timestamp3 {
        public static void main (String args[]) {
          java.sql.Timestamp t=new java.sql.Timestamp(96,11,13,14,15,25,745634000);
          t.setNanos(-10000);
          System.out.println(t.getNanos());
        }
      }

      === Here is the output of the test ===
      -10000

        Attachments

          Activity

            People

            Assignee:
            mhapnersunw Mark Hapner (Inactive)
            Reporter:
            mgorshen Mikhail Gorshenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: