harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r964007 - /harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/DatagramPacketTest.java
Date Wed, 14 Jul 2010 11:00:57 GMT
Author: hindessm
Date: Wed Jul 14 11:00:57 2010
New Revision: 964007

URL: http://svn.apache.org/viewvc?rev=964007&view=rev
Log:
Remove pointless code so we don't have to wait around for the second thread
to timeout.  See http://markmail.org/thread/4gymgnvu24hacldr

Modified:
    harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/DatagramPacketTest.java

Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/DatagramPacketTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/DatagramPacketTest.java?rev=964007&r1=964006&r2=964007&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/DatagramPacketTest.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/DatagramPacketTest.java
Wed Jul 14 11:00:57 2010
@@ -134,43 +134,9 @@ public class DatagramPacketTest extends 
         DatagramSocket socket = new DatagramSocket(0, localhost);
         final int port = socket.getLocalPort();
 
-        final Object lock = new Object();
-
-        Thread thread = new Thread(new Runnable() {
-            public void run() {
-                DatagramSocket socket = null;
-                try {
-                    socket = new DatagramSocket(0, localhost);
-                    synchronized (lock) {
-                        started = true;
-                        lock.notifyAll();
-                    }
-                    socket.setSoTimeout(3000);
-                    DatagramPacket packet = new DatagramPacket(new byte[256],
-                            256);
-                    socket.receive(packet);
-                    socket.send(packet);
-                    socket.close();
-                } catch (IOException e) {
-                    System.out.println("thread exception: " + e);
-                    if (socket != null)
-                        socket.close();
-                }
-            }
-        });
-        thread.start();
-
         socket.setSoTimeout(3000);
         DatagramPacket packet = new DatagramPacket(new byte[] { 1, 2, 3, 4, 5,
                 6 }, 6, localhost, port);
-        synchronized (lock) {
-            while (!started) {
-                try {
-                    lock.wait();
-                } catch (InterruptedException e) {
-                }
-            }
-        }
         socket.send(packet);
         socket.receive(packet);
         socket.close();



Mime
View raw message