Harmony
  1. Harmony
  2. HARMONY-894

[classlib][net] java.net.DatagramSocket(null).getBroadcast() returns different values for harmony vs RI

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None

      Description

      The Harmony method DatagramSocket.getBroadcast() returns false while RI returns true.

      ================== test.java =====================
      import java.net.*;

      public class test {
      public static void main (String[] args) {
      try

      { System.out.println("getBroadcast()1 = " + new DatagramSocket().getBroadcast()); }

      catch (Exception e)

      { e.printStackTrace(); }
      try { System.out.println("getBroadcast()2 = " + new DatagramSocket((SocketAddress) null).getBroadcast()); } catch (Exception e) { e.printStackTrace(); }


      }
      }
      ==============================================

      Output:
      C:\tmp\tmp17>C:\jdk1.5.0_06\bin\java.exe -cp . -showversion test
      java version "1.5.0_06"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
      Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)

      getBroadcast()1 = true
      getBroadcast()2 = true

      C:\tmp\tmp17>C:\harmony\trunk_0427\deploy\jdk\jre\bin\java.exe -cp . -showversion test
      java version 1.5 (subset)

      (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
      getBroadcast()1 = true
      getBroadcast()2 = false

      1. DatagramSocket.patch
        1 kB
        Vladimir Ivanov
      2. 894.diff
        2 kB
        spark shen

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Paulex Yang
            Reporter:
            Vladimir Ivanov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development