harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r944021 - in /harmony/enhanced/java/branches/java6: ./ classlib/ classlib/depends/libs/ classlib/modules/beans/src/main/java/java/beans/ classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/ classlib/modules/luni/s...
Date Thu, 13 May 2010 21:25:39 GMT
Author: hindessm
Date: Thu May 13 21:25:39 2010
New Revision: 944021

URL: http://svn.apache.org/viewvc?rev=944021&view=rev
Log:
Merging changes from trunk@943968

Modified:
    harmony/enhanced/java/branches/java6/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/build.xml
    harmony/enhanced/java/branches/java6/classlib/depends/libs/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/Introspector.java
    harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/InetAddress.java
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/Socket.java
    harmony/enhanced/java/branches/java6/common_resources/   (props changed)
    harmony/enhanced/java/branches/java6/drlvm/   (props changed)
    harmony/enhanced/java/branches/java6/jdktools/   (props changed)
    harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.cpp

Propchange: harmony/enhanced/java/branches/java6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 13 21:25:39 2010
@@ -1,3 +1,3 @@
 /harmony/enhanced/java/branches/mrh:935751-941490
-/harmony/enhanced/java/trunk:929253-942337
+/harmony/enhanced/java/trunk:929253-943968
 /harmony/enhanced/trunk:810871-929252

Propchange: harmony/enhanced/java/branches/java6/classlib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 13 21:25:39 2010
@@ -1,7 +1,7 @@
 /harmony/enhanced/classlib/trunk:713674-735919,765923-926091,926318-926838
 /harmony/enhanced/classlib/trunk/working_classlib:884014-884286
 /harmony/enhanced/java/branches/mrh/classlib:935751-941490
-/harmony/enhanced/java/trunk/classlib:929253-942337
+/harmony/enhanced/java/trunk/classlib:929253-943968
 /harmony/enhanced/trunk/classlib:810871-929252
 /harmony/enhanced/trunk/working_classlib:476396-920147
 /incubator/harmony/enhanced/trunk/working_classlib:423974-476394

Modified: harmony/enhanced/java/branches/java6/classlib/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/build.xml?rev=944021&r1=944020&r2=944021&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/build.xml (original)
+++ harmony/enhanced/java/branches/java6/classlib/build.xml Thu May 13 21:25:39 2010
@@ -385,7 +385,9 @@ ${built.files.list}
     <target name="test"
             depends="-test-init-hdk,clean-test-output"
             description="Runs all tests">
-        <ant dir="${hy.hdk}/build/test" inheritall="false" target="test">
+        <mkdir dir="${tests.output}" />
+        <ant antfile="${hy.hdk}/build/test/build.xml"
+             inheritall="false" target="test">
             <property name="tests.output" value="${tests.output}"/>
         </ant>
     </target>

Propchange: harmony/enhanced/java/branches/java6/classlib/depends/libs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 13 21:25:39 2010
@@ -1,3 +1,3 @@
 /harmony/enhanced/classlib/trunk/depends/libs:544451-926091
-/harmony/enhanced/java/trunk/classlib/depends/libs:929253-942337
+/harmony/enhanced/java/trunk/classlib/depends/libs:929253-943968
 /harmony/enhanced/trunk/classlib/depends/libs:810871-929252

Modified: harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/Introspector.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/Introspector.java?rev=944021&r1=944020&r2=944021&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/Introspector.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/Introspector.java
Thu May 13 21:25:39 2010
@@ -286,36 +286,42 @@ public class Introspector extends java.l
     }
 
     private static BeanInfo getExplicitBeanInfo(Class<?> beanClass) {
-        BeanInfo theBeanInfo = null;
         String beanInfoClassName = beanClass.getName() + "BeanInfo"; //$NON-NLS-1$
-        try{
-            theBeanInfo = loadBeanInfo(beanInfoClassName, beanClass);
-            return theBeanInfo;
-        }catch(Exception e){
-            //fall through
+        try {
+            return loadBeanInfo(beanInfoClassName, beanClass);
+        } catch (Exception e) {
+            // fall through
         }
+
         int index = beanInfoClassName.lastIndexOf('.');
-        String beanInfoName = index>=0? beanInfoClassName.substring(index+1):beanInfoClassName;
+        String beanInfoName = index >= 0 ? beanInfoClassName
+                .substring(index + 1) : beanInfoClassName;
+        BeanInfo theBeanInfo = null;
+        BeanDescriptor beanDescriptor = null;
         for (int i = 0; i < searchPath.length; i++) {
             beanInfoClassName = searchPath[i] + "." + beanInfoName; //$NON-NLS-1$
-            try{
+            try {
                 theBeanInfo = loadBeanInfo(beanInfoClassName, beanClass);
-                
-                // find the beanInfo of the given beanClass, check whether the
-                // beanInfo is consistent with the given beanClass
-                Class<?> beanClassOfBeanInfo = theBeanInfo.getBeanDescriptor()
-                        .getBeanClass();
-                if (beanClassOfBeanInfo.equals(beanClass)) {
-                    break;
-                } 
-            }catch(Exception e){
-                //ignore, try next one
+            } catch (Exception e) {
+                // ignore, try next one
+                continue;
+            }
+            beanDescriptor = theBeanInfo.getBeanDescriptor();
+            if (beanDescriptor != null
+                    && beanClass == beanDescriptor.getBeanClass()) {
+                return theBeanInfo;
             }
         }
-        return theBeanInfo;
+        if (BeanInfo.class.isAssignableFrom(beanClass)) {
+            try {
+                return loadBeanInfo(beanClass.getName(), beanClass);
+            } catch (Exception e) {
+                // fall through
+            }
+        }
+        return null;
     }
 
-
     /*
      * Method which attempts to instantiate a BeanInfo object of the supplied
      * classname

Modified: harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java?rev=944021&r1=944020&r2=944021&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
Thu May 13 21:25:39 2010
@@ -450,7 +450,60 @@ public class IntrospectorTest extends Te
         } catch (IntrospectionException e) {
         }
     }
-    
+
+    /*
+     * BeanClass provide bean info about itself
+     */
+    public static class MockBeanInfo4BeanClassSelf implements BeanInfo {
+
+        public void setValue(String v) throws Exception {
+        }
+
+        public int getValue() {
+            return 0;
+        }
+
+        public BeanDescriptor getBeanDescriptor() {
+            return null;
+        }
+
+        public EventSetDescriptor[] getEventSetDescriptors() {
+            return new EventSetDescriptor[0];
+        }
+
+        public int getDefaultEventIndex() {
+            return -1;
+        }
+
+        public int getDefaultPropertyIndex() {
+            return -1;
+        }
+
+        public PropertyDescriptor[] getPropertyDescriptors() {
+            return new PropertyDescriptor[0];
+        }
+
+        public MethodDescriptor[] getMethodDescriptors() {
+            return new MethodDescriptor[0];
+        }
+
+        public BeanInfo[] getAdditionalBeanInfo() {
+            return null;
+        }
+
+        public Image getIcon(int iconKind) {
+            return null;
+        }
+    }
+
+    public void test_BeanInfo_Self() throws Exception {
+        BeanInfo info = Introspector
+                .getBeanInfo(MockBeanInfo4BeanClassSelf.class);
+        assertEquals(0, info.getMethodDescriptors().length);
+        assertEquals(0, info.getPropertyDescriptors().length);
+        assertEquals(0, info.getEventSetDescriptors().length);
+    }
+
     /*
      * Introspect static methods
      */

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/InetAddress.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/InetAddress.java?rev=944021&r1=944020&r2=944021&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/InetAddress.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/InetAddress.java
Thu May 13 21:25:39 2010
@@ -1342,9 +1342,7 @@ public class InetAddress extends Object 
     }
 
     static boolean preferIPv6Addresses() {
-        String result = AccessController.doPrivileged(new PriviAction<String>(
-                "java.net.preferIPv6Addresses")); //$NON-NLS-1$
-        return "true".equals(result); //$NON-NLS-1$
+        return NetUtil.preferIPv6Addresses();
     }
 
     private static final ObjectStreamField[] serialPersistentFields = {

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/Socket.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/Socket.java?rev=944021&r1=944020&r2=944021&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/Socket.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/Socket.java
Thu May 13 21:25:39 2010
@@ -1112,9 +1112,7 @@ public class Socket {
     }
 
     static boolean preferIPv4Stack() {
-        String result = AccessController.doPrivileged(new PriviAction<String>(
-                "java.net.preferIPv4Stack")); //$NON-NLS-1$
-        return "true".equals(result); //$NON-NLS-1$
+        return NetUtil.preferIPv4Stack();
     }
 
     /**

Propchange: harmony/enhanced/java/branches/java6/common_resources/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 13 21:25:39 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/java/branches/mrh/common_resources:935751-941490
-/harmony/enhanced/java/trunk/common_resources:929253-942337
+/harmony/enhanced/java/trunk/common_resources:929253-943968
 /harmony/enhanced/trunk/common_resources:476396-929252
 /incubator/harmony/enhanced/trunk/common_resources:423974-476394

Propchange: harmony/enhanced/java/branches/java6/drlvm/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 13 21:25:39 2010
@@ -1,5 +1,5 @@
 /harmony/enhanced/java/branches/mrh/drlvm:935751-941490
-/harmony/enhanced/java/trunk/drlvm:929253-942337
+/harmony/enhanced/java/trunk/drlvm:929253-943968
 /harmony/enhanced/trunk/drlvm:810871-929252
 /harmony/enhanced/trunk/working_vm:476396-920147
 /incubator/harmony/enhanced/trunk/working_vm:423974-476394

Propchange: harmony/enhanced/java/branches/java6/jdktools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 13 21:25:39 2010
@@ -1,4 +1,4 @@
-/harmony/enhanced/java/trunk/jdktools:929253-942337
+/harmony/enhanced/java/trunk/jdktools:929253-943968
 /harmony/enhanced/jdktools/trunk:630107-925933
 /harmony/enhanced/trunk/jdktools:810871-929252
 /harmony/enhanced/trunk/working_jdktools:476396-920147

Modified: harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.cpp?rev=944021&r1=944020&r2=944021&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.cpp
(original)
+++ harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.cpp
Thu May 13 21:25:39 2010
@@ -388,12 +388,6 @@ CheckHandshaking(jdwpTransportEnv* env, 
     jlong timeout = handshakeTimeout == 0 ? 30000 : handshakeTimeout;
 
     jdwpTransportError err;
-    err = SendData(env, sckt, handshakeString, (int)strlen(handshakeString), handshakeTimeout);
-    if (err != JDWPTRANSPORT_ERROR_NONE) {
-        SetLastTranErrorMessagePrefix(env, "'JDWP-Handshake' sending error: ");
-        return err;
-    }
- 
     err = ReceiveData(env, sckt, receivedString, (int)strlen(handshakeString),
                       timeout);
  
@@ -405,6 +399,11 @@ CheckHandshaking(jdwpTransportEnv* env, 
         SetLastTranError(env, "handshake error, 'JDWP-Handshake' is not received", 0);
         return JDWPTRANSPORT_ERROR_IO_ERROR;
     }
+    err = SendData(env, sckt, handshakeString, (int)strlen(handshakeString), handshakeTimeout);
+    if (err != JDWPTRANSPORT_ERROR_NONE) {
+        SetLastTranErrorMessagePrefix(env, "'JDWP-Handshake' sending error: ");
+        return err;
+    }
     return JDWPTRANSPORT_ERROR_NONE;
 }// CheckHandshaking
 



Mime
View raw message