harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r953293 [2/2] - in /harmony/enhanced/java/branches/java6: ./ classlib/ classlib/depends/build/ classlib/depends/build/platform/ classlib/depends/libs/ classlib/modules/beans/src/main/java/java/beans/ classlib/modules/beans/src/main/java/org...
Date Thu, 10 Jun 2010 12:06:11 GMT
Modified: harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/IntEditor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/IntEditor.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/IntEditor.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/IntEditor.java Thu Jun 10 12:06:09 2010
@@ -52,12 +52,10 @@ public final class IntEditor extends Pro
     }
 
     private String getValueAsText() {
-        String result = null;
         Object value = getValue();
         if (value != null) {
-            Integer iValue = (Integer) value;
-            result = iValue.toString();
+            return ((Integer) value).toString();
         }
-        return result;
+        return null;
     }
 }

Modified: harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/LongEditor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/LongEditor.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/LongEditor.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/LongEditor.java Thu Jun 10 12:06:09 2010
@@ -36,7 +36,7 @@ public final class LongEditor extends Pr
 
     @Override
     public String getJavaInitializationString() {
-        return getValue()+"L";
+        return getValue() + "L"; //$NON-NLS-1$
     }
 
     @Override

Modified: harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/ShortEditor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/ShortEditor.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/ShortEditor.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/ShortEditor.java Thu Jun 10 12:06:09 2010
@@ -36,7 +36,8 @@ public final class ShortEditor extends P
 
     @Override
     public String getJavaInitializationString() {
-        return new StringBuilder().append("((short)").append(getValue()).append(")").toString();
+        return new StringBuilder()
+                .append("((short)").append(getValue()).append(")").toString(); //$NON-NLS-1$ //$NON-NLS-2$
     }
 
     @Override

Modified: harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/StringEditor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/StringEditor.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/StringEditor.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/org/apache/harmony/beans/editors/StringEditor.java Thu Jun 10 12:06:09 2010
@@ -37,7 +37,7 @@ public final class StringEditor extends 
 
     @Override
     public String getJavaInitializationString() {
-        Object value = getValue(); 
-        return value==null?"\"null\"":"\""+value+"\"";
+        Object value = getValue();
+        return value == null ? "\"null\"" : "\"" + value + "\"";
     }
 }

Modified: harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.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/EventHandlerTest.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java Thu Jun 10 12:06:09 2010
@@ -106,6 +106,13 @@ public class EventHandlerTest extends Te
 
         assertEquals(invocationObject, handler.getTarget());
         assertEquals(invocationObject.getSomeText(), getText());
+        try {
+            handler.invoke(proxy, null, new Object[] { new ActionEvent(this, 0,
+                    "") });
+            fail("should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
     /**

Modified: harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/FeatureDescriptorTest.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/FeatureDescriptorTest.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/FeatureDescriptorTest.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/FeatureDescriptorTest.java Thu Jun 10 12:06:09 2010
@@ -251,11 +251,25 @@ public class FeatureDescriptorTest exten
         fd.setValue(attributeName, value);
         assertSame(value, fd.getValue(attributeName));
 
-        Object newValue = null;
         try {
-            fd.setValue(attributeName, newValue);
-            fail("Should throw NullPointerException.");
+            fd.setValue(null, value);
+            fail("Should throw NullPointerException");
         } catch (NullPointerException e) {
+            // Expected
+        }
+
+        try {
+            fd.setValue(attributeName, null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+
+        try {
+            fd.setValue(null, null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
         }
     }
 

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=953293&r1=953292&r2=953293&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 Jun 10 12:06:09 2010
@@ -122,6 +122,11 @@ public class IntrospectorTest extends Te
         }
     }
 
+    public void testBeanDescriptor_Same() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MockJavaBean.class);
+        assertSame(beanInfo.getBeanDescriptor(), beanInfo.getBeanDescriptor());
+    }
+
     /**
      * The test checks the getMethodDescriptor method
      * 

Modified: harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerTest.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/PropertyEditorManagerTest.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerTest.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerTest.java Thu Jun 10 12:06:09 2010
@@ -102,15 +102,14 @@ public class PropertyEditorManagerTest e
     public void testFindEditor_TypeNull() {
         try {
             PropertyEditorManager.findEditor(null);
-            fail("Should throw NullPointerException.");
+            fail("Should throw NullPointerException");
         } catch (NullPointerException e) {
-            // expected
+            // Expected
         }
     }
 
     public void testFindEditor_TypeNoEditor() {
-        PropertyEditor editor = PropertyEditorManager.findEditor(MockFoo.class);
-        assertNull(editor);
+        assertNull(PropertyEditorManager.findEditor(MockFoo.class));
     }
 
     public void testGetEditorSearchPath_default() {
@@ -157,9 +156,9 @@ public class PropertyEditorManagerTest e
     public void testRegisterEditorType_Null() {
         try {
             PropertyEditorManager.registerEditor(null, ButtonEditor.class);
-            fail("Should throw NullPointerException.");
+            fail("Should throw NullPointerException");
         } catch (NullPointerException e) {
-            // expected
+            // Expected
         }
     }
 
@@ -171,6 +170,7 @@ public class PropertyEditorManagerTest e
         PropertyEditorManager.setEditorSearchPath(new String[] { null });
         assertEquals(1, PropertyEditorManager.getEditorSearchPath().length);
         assertNull(PropertyEditorManager.getEditorSearchPath()[0]);
+        assertNull(PropertyEditorManager.findEditor(PropertyEditorManagerTest.class));
         PropertyEditorManager.setEditorSearchPath(original);
     }
 
@@ -204,8 +204,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Boolean.TYPE);
         try {
             editor.setAsText(null);
-            fail("Should throw a NPException");
+            fail("Should throw NullPointerException");
         } catch (NullPointerException e) {
+            // Expected
         }
     }
 
@@ -213,13 +214,15 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Boolean.TYPE);
         try {
             editor.setAsText("yes");
-            fail("Should throw a IllegalArgumentException");
+            fail("Should throw IllegalArgumentException");
         } catch (IllegalArgumentException e) {
+            // Expected
         }
         try {
             editor.setAsText("***true***");
-            fail("Should throw a IllegalArgumentException");
+            fail("Should throw IllegalArgumentException");
         } catch (IllegalArgumentException e) {
+            // Expected
         }
     }
 
@@ -269,8 +272,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Byte.TYPE);
         try {
             editor.setAsText(null);
-            fail("Should throw a NumberFormatException");
+            fail("Should throw NumberFormatException");
         } catch (NumberFormatException e) {
+            // Expected
         }
     }
 
@@ -278,8 +282,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Byte.TYPE);
         try {
             editor.setAsText("invalid");
-            fail("Should throw a NumberFormatException");
+            fail("Should throw NumberFormatException");
         } catch (NumberFormatException e) {
+            // Expected
         }
     }
 
@@ -287,8 +292,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Byte.TYPE);
         try {
             editor.setAsText("128");
-            fail("Should throw a NumberFormatException");
+            fail("Should throw NumberFormatException");
         } catch (NumberFormatException e) {
+            // Expected
         }
     }
 
@@ -306,8 +312,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Double.TYPE);
         try {
             editor.setAsText(null);
-            fail("Should throw a NullPointerException");
+            fail("Should throw NullPointerException");
         } catch (NullPointerException e) {
+            // Expected
         }
     }
 
@@ -315,8 +322,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Double.TYPE);
         try {
             editor.setAsText("invalid");
-            fail("Should throw a NumberFormatException");
+            fail("Should throw NumberFormatException");
         } catch (NumberFormatException e) {
+            // Expected
         }
     }
 
@@ -335,8 +343,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Float.TYPE);
         try {
             editor.setAsText(null);
-            fail("Should throw a NullPointerException");
+            fail("Should throw NullPointerException");
         } catch (NullPointerException e) {
+            // Expected
         }
     }
 
@@ -344,8 +353,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Float.TYPE);
         try {
             editor.setAsText("invalid");
-            fail("Should throw a NumberFormatException");
+            fail("Should throw NumberFormatException");
         } catch (NumberFormatException e) {
+            // Expected
         }
     }
 
@@ -364,8 +374,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Long.TYPE);
         try {
             editor.setAsText(null);
-            fail("Should throw a NumberFormatException");
+            fail("Should throw NumberFormatException");
         } catch (NumberFormatException e) {
+            // Expected
         }
     }
 
@@ -373,8 +384,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Long.TYPE);
         try {
             editor.setAsText("invalid");
-            fail("Should throw a NumberFormatException");
+            fail("Should throw NumberFormatException");
         } catch (NumberFormatException e) {
+            // Expected
         }
     }
 
@@ -394,8 +406,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Short.TYPE);
         try {
             editor.setAsText(null);
-            fail("Should throw a NumberFormatException");
+            fail("Should throw NumberFormatException");
         } catch (NumberFormatException e) {
+            // Expected
         }
     }
 
@@ -403,8 +416,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Short.TYPE);
         try {
             editor.setAsText("invalid");
-            fail("Should throw a NumberFormatException");
+            fail("Should throw NumberFormatException");
         } catch (NumberFormatException e) {
+            // Expected
         }
     }
 
@@ -423,8 +437,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Integer.TYPE);
         try {
             editor.setAsText(null);
-            fail("Should throw a NumberFormatException");
+            fail("Should throw NumberFormatException");
         } catch (NumberFormatException e) {
+            // Expected
         }
     }
 
@@ -432,9 +447,9 @@ public class PropertyEditorManagerTest e
         PropertyEditor editor = PropertyEditorManager.findEditor(Integer.TYPE);
         try {
             editor.setAsText("invalid");
-            fail("Should throw a NumberFormatException");
+            fail("Should throw NumberFormatException");
         } catch (NumberFormatException e) {
-
+            // Expected
         }
     }
 
@@ -775,17 +790,17 @@ public class PropertyEditorManagerTest e
 
         try {
             e2.setValue(null);
-            fail("Should throw an error");
+            fail("Should throw MockError");
         } catch (MockError e) {
-            // expected
+            // Expected
             assertNull(e2.getValue());
         }
         
         try {
             e2.setValue(new Font("Arial", Font.BOLD, 10));
-            fail("Should throw an error");
+            fail("Should throw MockError");
         } catch (MockError e) {
-            // expected
+            // Expected
         }
     }
     
@@ -802,10 +817,11 @@ public class PropertyEditorManagerTest e
         }
 
     }
+
     public void testColorEditor() throws Exception{
         PropertyEditor e2 = PropertyEditorManager.findEditor(Color.class);
         assertNull(e2.getValue());
-        assertEquals("null", e2.getAsText());
+        assertEquals("", e2.getAsText());
         e2.setValue(Color.RED);
         e2.setAsText(e2.getAsText());
         assertNull(e2.getTags());
@@ -828,31 +844,36 @@ public class PropertyEditorManagerTest e
 
         try {
             e2.setValue(Color.yellow);
-            fail("Should throw an error");
+            fail("Should throw MockError");
         } catch (MockError e) {
-            // expected
+            // Expected
         }
 
         assertEquals("255,255,0", e2.getAsText());
 
         try {
             e2.setAsText(null);
-            fail("Should throw NPE");
+            fail("Should throw NullPointerException");
         } catch (NullPointerException e) {
-            // expected
+            // Expected
         }
 
         try {
             e2.setAsText("text");
             fail("Should throw IllegalArgumentException");
         } catch (IllegalArgumentException e) {
-            // expected
+            // Expected
         }
 
         e2.removePropertyChangeListener(listener);
         e2.setAsText("255,255,255");
         assertEquals("java.awt.Color[r=255,g=255,b=255]", ((Color) e2
                 .getValue()).toString());
+
+        Color value1 = (Color) e2.getValue();
+        e2.setAsText("255,255,255");
+        Color value2 = (Color) e2.getValue();
+        assertNotSame(value1, value2);
     }
     
     public void testGetSetEditorPath() throws Exception{

Modified: harmony/enhanced/java/branches/java6/classlib/modules/imageio/src/main/java/javax/imageio/spi/ServiceRegistry.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/imageio/src/main/java/javax/imageio/spi/ServiceRegistry.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/imageio/src/main/java/javax/imageio/spi/ServiceRegistry.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/imageio/src/main/java/javax/imageio/spi/ServiceRegistry.java Thu Jun 10 12:06:09 2010
@@ -209,7 +209,7 @@ public class ServiceRegistry {
         Map<Class<?>, Object> providers = new HashMap<Class<?>, Object>();
 
         boolean addProvider(Object provider) {
-            return providers.put(provider.getClass(), provider) != null;
+            return providers.put(provider.getClass(), provider) == null;
         }
 
         Iterator<Class<?>> getProviderClasses() {

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86.drl.interm
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86.drl.interm?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86.drl.interm (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86.drl.interm Thu Jun 10 12:06:09 2010
@@ -1,2 +1,2 @@
 #2315
-org/apache/harmony/luni/tests/java/net/InetAddressTest.java
+org/apache/harmony/luni/tests/java/net/InetAddressThreadTest.java

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86.ibm?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86.ibm (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86.ibm Thu Jun 10 12:06:09 2010
@@ -1,3 +1,2 @@
 org/apache/harmony/luni/tests/java/lang/SecurityManager2Test.java
-org/apache/harmony/luni/tests/java/lang/PackageTest.java
-org/apache/harmony/luni/tests/java/net/InetAddressTest.java
+org/apache/harmony/luni/tests/java/net/InetAddressThreadTest.java

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86_64.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86_64.drl?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86_64.drl (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86_64.drl Thu Jun 10 12:06:09 2010
@@ -1,2 +1,2 @@
-org/apache/harmony/luni/tests/java/net/InetAddressTest.java
+org/apache/harmony/luni/tests/java/net/InetAddressThreadTest.java
 org/apache/harmony/luni/tests/java/net/MulticastSocketTest.java

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86_64.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86_64.ibm?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86_64.ibm (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.linux.x86_64.ibm Thu Jun 10 12:06:09 2010
@@ -1,2 +1,2 @@
 org/apache/harmony/luni/tests/java/lang/SecurityManager2Test.java
-org/apache/harmony/luni/tests/java/net/InetAddressTest.java
+org/apache/harmony/luni/tests/java/net/InetAddressThreadTest.java

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.zos.s390.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.zos.s390.ibm?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.zos.s390.ibm (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.zos.s390.ibm Thu Jun 10 12:06:09 2010
@@ -1,4 +1,4 @@
 org/apache/harmony/luni/tests/java/util/PropertiesTest.java
 org/apache/harmony/luni/tests/java/lang/SecurityManager2Test.java
 org/apache/harmony/luni/tests/java/lang/PackageTest.java
-org/apache/harmony/luni/tests/java/net/InetAddressTest.java
+org/apache/harmony/luni/tests/java/net/InetAddressThreadTest.java

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.zos.s390x.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.zos.s390x.ibm?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.zos.s390x.ibm (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/make/exclude.zos.s390x.ibm Thu Jun 10 12:06:09 2010
@@ -1,4 +1,4 @@
 org/apache/harmony/luni/tests/java/util/PropertiesTest.java
 org/apache/harmony/luni/tests/java/lang/SecurityManager2Test.java
 org/apache/harmony/luni/tests/java/lang/PackageTest.java
-org/apache/harmony/luni/tests/java/net/InetAddressTest.java
+org/apache/harmony/luni/tests/java/net/InetAddressThreadTest.java

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/lang/String.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/lang/String.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/lang/String.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/lang/String.java Thu Jun 10 12:06:09 2010
@@ -1430,7 +1430,20 @@ public final class String implements Ser
             return this;
 
         String rs = replacement.toString();
-        StringBuilder buffer = new StringBuilder(count);
+
+        // special case if the string to match is empty then
+        // match at the start, inbetween each character and at the end
+        if ("".equals(ts)) {
+            StringBuilder buffer = new StringBuilder(count + (rs.length() * (count + 1)));
+            buffer.append(rs);
+            for(int i=0; i<count; i++) {
+                buffer.append(value[offset + i]);
+                buffer.append(rs);
+            }
+            return buffer.toString();
+        }
+
+        StringBuilder buffer = new StringBuilder(count + rs.length());
         int tl = target.length();
         int tail = 0;
         do {

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/NetworkInterface.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/NetworkInterface.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/NetworkInterface.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/NetworkInterface.java Thu Jun 10 12:06:09 2010
@@ -176,7 +176,11 @@ public final class NetworkInterface exte
                      * since we don't have a port in this case we pass in
                      * NO_PORT
                      */
-                    security.checkConnect(element.getHostName(),
+                    String hostName = element.getHostName();
+                    if(hostName.contains("::")){
+                        hostName = getFullFormOfCompressedIPV6Address(hostName);
+                    }
+                    security.checkConnect(hostName,
                             CHECK_CONNECT_NO_PORT);
                     accessibleAddresses.add(element);
                 } catch (SecurityException e) {
@@ -192,6 +196,62 @@ public final class NetworkInterface exte
 
         return new Vector<InetAddress>(0).elements();
     }
+    
+    private String getFullFormOfCompressedIPV6Address(String compressed) {
+        StringBuilder fullForm = new StringBuilder(39);
+        final int NUM_OF_IPV6_FIELDS = 8;
+
+        String[] fields = compressed.split(":");
+        // the number of compressed fields
+        int numOfCompressedFields;
+        
+        if (compressed.startsWith("::")) { // compressed head part
+            compressed = compressed.replace("::", "");
+            fields = compressed.split(":");
+            numOfCompressedFields = NUM_OF_IPV6_FIELDS - fields.length;
+            restoreCompressedFieldsWithZero(fullForm, numOfCompressedFields);
+            appendNonZeroFields(fullForm, fields);
+        } else if (compressed.endsWith("::")) { // compressed tail part
+            compressed = compressed.replace("::", "");
+            fields = compressed.split(":");
+            numOfCompressedFields = NUM_OF_IPV6_FIELDS - fields.length;
+            appendNonZeroFields(fullForm, fields);
+            restoreCompressedFieldsWithZero(fullForm, numOfCompressedFields);
+        } else { // compressed middle part
+            numOfCompressedFields = NUM_OF_IPV6_FIELDS - fields.length + 1;
+            for (String field : fields) {
+                if (field.equals("")) {
+                    // for compressed fields add 0
+                    restoreCompressedFieldsWithZero(fullForm, numOfCompressedFields);
+                } else {
+                    fullForm.append(field);
+                    // add colon
+                    fullForm.append(":");
+                }
+            }
+        }
+        // delete the excess colon
+        fullForm.deleteCharAt(fullForm.length() - 1);
+
+        return fullForm.toString();
+    }
+
+    private void appendNonZeroFields(StringBuilder fullForm,
+            String[] fields) {
+        for (int i = 0; i < fields.length; i++) {
+            fullForm.append(fields[i]);
+            fullForm.append(":");
+        }
+    }
+
+    private void restoreCompressedFieldsWithZero(StringBuilder fullForm,
+            int numOfCompressedFields) {
+        for (int i = 0; i < numOfCompressedFields; i++) {
+            fullForm.append("0");
+            // add colon
+            fullForm.append(":");
+        }
+    }
 
     /**
      * Gets the human-readable name associated with this network interface.

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/URI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/URI.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/URI.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/net/URI.java Thu Jun 10 12:06:09 2010
@@ -41,6 +41,8 @@ public final class URI implements Compar
 
     static final String someLegal = unreserved + punct;
 
+    static final String queryLegal =  unreserved + reserved + "\\";
+    
     static final String allLegal = unreserved + reserved;
 
     private String string;
@@ -453,7 +455,7 @@ public final class URI implements Compar
         private void validateQuery(String uri, String query, int index)
                 throws URISyntaxException {
             try {
-                URIEncoderDecoder.validate(query, allLegal);
+                URIEncoderDecoder.validate(query, queryLegal);
             } catch (URISyntaxException e) {
                 throw new URISyntaxException(uri, Messages.getString("luni.89", e //$NON-NLS-1$
                         .getReason()), index + e.getIndex());

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/OSFileSystem.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/OSFileSystem.c?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/OSFileSystem.c (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/OSFileSystem.c Thu Jun 10 12:06:09 2010
@@ -164,7 +164,7 @@ JNIEXPORT jlong JNICALL Java_org_apache_
       return -1;
     }
 
-  return (jlong) hyfile_seek ((IDATA) fd, (IDATA) offset, hywhence);
+  return (jlong) hyfile_seek ((IDATA) fd, (I_64) offset, hywhence);
 }
 
 /**

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/String2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/String2Test.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/String2Test.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/String2Test.java Thu Jun 10 12:06:09 2010
@@ -697,6 +697,12 @@ public class String2Test extends junit.f
                 "a", "ccc"));
         assertEquals("Failed replace by smaller seq", "$bba^", "$aaaaa^"
                 .replace(new StringBuilder("aa"), "b"));
+        assertEquals("Failed to replace empty string", "%%a%%b%%c%%",
+                "abc".replace("", "%%"));
+        assertEquals("Failed to replace with empty string", "aacc",
+                "aabbcc".replace("b", ""));
+        assertEquals("Failed to replace in empty string", "abc",
+                "".replace("", "abc"));
     }
 
     /**

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/InetAddressTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/InetAddressTest.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/InetAddressTest.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/InetAddressTest.java Thu Jun 10 12:06:09 2010
@@ -35,101 +35,6 @@ import tests.support.Support_Configurati
 
 public class InetAddressTest extends junit.framework.TestCase {
     
-    private static boolean someoneDone[] = new boolean[2];
-
-    protected static boolean threadedTestSucceeded;
-
-    protected static String threadedTestErrorString;
-
-    /**
-     * This class is used to test inet_ntoa, gethostbyaddr and gethostbyname
-     * functions in the VM to make sure they're threadsafe. getByName will cause
-     * the gethostbyname function to be called. getHostName will cause the
-     * gethostbyaddr to be called. getHostAddress will cause inet_ntoa to be
-     * called.
-     */
-    static class threadsafeTestThread extends Thread {
-        private String lookupName;
-
-        private InetAddress testAddress;
-
-        private int testType;
-
-        /*
-         * REP_NUM can be adjusted if desired. Since this error is
-         * non-deterministic it may not always occur. Setting REP_NUM higher,
-         * increases the chances of an error being detected, but causes the test
-         * to take longer. Because the Java threads spend a lot of time
-         * performing operations other than running the native code that may not
-         * be threadsafe, it is quite likely that several thousand iterations
-         * will elapse before the first error is detected.
-         */
-        private static final int REP_NUM = 20000;
-
-        public threadsafeTestThread(String name, String lookupName,
-                InetAddress testAddress, int type) {
-            super(name);
-            this.lookupName = lookupName;
-            this.testAddress = testAddress;
-            testType = type;
-        }
-
-        public void run() {
-            try {
-                String correctName = testAddress.getHostName();
-                String correctAddress = testAddress.getHostAddress();
-                long startTime = System.currentTimeMillis();
-
-                synchronized (someoneDone) {
-                }
-
-                for (int i = 0; i < REP_NUM; i++) {
-                    if (someoneDone[testType]) {
-                        break;
-                    } else if ((i % 25) == 0
-                            && System.currentTimeMillis() - startTime > 240000) {
-                        System.out
-                                .println("Exiting due to time limitation after "
-                                        + i + " iterations");
-                        break;
-                    }
-
-                    InetAddress ia = InetAddress.getByName(lookupName);
-                    String hostName = ia.getHostName();
-                    String hostAddress = ia.getHostAddress();
-
-                    // Intentionally not looking for exact name match so that 
-                    // the test works across different platforms that may or 
-                    // may not include a domain suffix on the hostname
-                    if (!hostName.startsWith(correctName)) {
-                        threadedTestSucceeded = false;
-                        threadedTestErrorString = (testType == 0 ? "gethostbyname"
-                                : "gethostbyaddr")
-                                + ": getHostName() returned "
-                                + hostName
-                                + " instead of " + correctName;
-                        break;
-                    }
-                    // IP addresses should match exactly
-                    if (!correctAddress.equals(hostAddress)) {
-                        threadedTestSucceeded = false;
-                        threadedTestErrorString = (testType == 0 ? "gethostbyname"
-                                : "gethostbyaddr")
-                                + ": getHostName() returned "
-                                + hostAddress
-                                + " instead of " + correctAddress;
-                        break;
-                    }
-
-                }
-                someoneDone[testType] = true;
-            } catch (Exception e) {
-                threadedTestSucceeded = false;
-                threadedTestErrorString = e.toString();
-            }
-        }
-    }
-    
     /**
      * @tests java.net.InetAddress#getByName(String)
      */
@@ -314,62 +219,6 @@ public class InetAddressTest extends jun
         } finally {
             System.setSecurityManager(oldman);
         }
-
-        // Make sure there is no caching
-        String originalPropertyValue = System
-                .getProperty("networkaddress.cache.ttl");
-        System.setProperty("networkaddress.cache.ttl", "0");
-
-        // Test for threadsafety
-        try {
-            InetAddress lookup1 = InetAddress
-                    .getByName(Support_Configuration.InetTestAddress);
-            assertTrue(lookup1 + " expected "
-                    + Support_Configuration.InetTestIP,
-                    Support_Configuration.InetTestIP.equals(lookup1
-                            .getHostAddress()));
-            InetAddress lookup2 = InetAddress
-                    .getByName(Support_Configuration.InetTestAddress2);
-            assertTrue(lookup2 + " expected "
-                    + Support_Configuration.InetTestIP2,
-                    Support_Configuration.InetTestIP2.equals(lookup2
-                            .getHostAddress()));
-            threadsafeTestThread thread1 = new threadsafeTestThread("1",
-                    lookup1.getHostName(), lookup1, 0);
-            threadsafeTestThread thread2 = new threadsafeTestThread("2",
-                    lookup2.getHostName(), lookup2, 0);
-            threadsafeTestThread thread3 = new threadsafeTestThread("3",
-                    lookup1.getHostAddress(), lookup1, 1);
-            threadsafeTestThread thread4 = new threadsafeTestThread("4",
-                    lookup2.getHostAddress(), lookup2, 1);
-
-            // initialize the flags
-            threadedTestSucceeded = true;
-            synchronized (someoneDone) {
-                thread1.start();
-                thread2.start();
-                thread3.start();
-                thread4.start();
-            }
-            thread1.join();
-            thread2.join();
-            thread3.join();
-            thread4.join();
-            /* FIXME: comment the assertion below because it is platform/configuration dependent
-             * Please refer to HARMONY-1664 (https://issues.apache.org/jira/browse/HARMONY-1664)
-             * for details
-             */
-//            assertTrue(threadedTestErrorString, threadedTestSucceeded);
-        } finally {
-            // restore the old value of the property
-            if (originalPropertyValue == null)
-                // setting the property to -1 has the same effect as having the
-                // property be null
-                System.setProperty("networkaddress.cache.ttl", "-1");
-            else
-                System.setProperty("networkaddress.cache.ttl",
-                        originalPropertyValue);
-        }
     }
 
     /**

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/NetworkInterfaceTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/NetworkInterfaceTest.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/NetworkInterfaceTest.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/NetworkInterfaceTest.java Thu Jun 10 12:06:09 2010
@@ -380,12 +380,22 @@ public class NetworkInterfaceTest extend
 					networkInterface1.toString());
 			assertFalse("validate that non-zero length string is generated",
 					networkInterface1.toString().equals(""));
+
+            SecurityManager backup = System.getSecurityManager();
+            System.setSecurityManager(new SecurityManager());
+            assertNotNull(networkInterface1.toString());
+            System.setSecurityManager(backup);
 		}
 		if (atLeastTwoInterfaces) {
 			assertFalse(
 					"Validate strings are different for different interfaces",
 					networkInterface1.toString().equals(
 							networkInterface2.toString()));
+            
+            SecurityManager backup = System.getSecurityManager();
+            System.setSecurityManager(new SecurityManager());
+            assertNotNull(networkInterface2.toString());
+            System.setSecurityManager(backup);
 		}
 	}
 

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java Thu Jun 10 12:06:09 2010
@@ -21,6 +21,7 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.HttpURLConnection;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.MalformedURLException;
@@ -68,6 +69,35 @@ public class URLTest extends TestCase {
     boolean caught = false;
 
     static boolean isSelectCalled;
+    
+    
+    /**
+     * Check when the argument in url consists of windows path character back-slach
+     * @tests java.net.URL#openConnection(Proxy)
+     * @throws Exception
+     */
+    public void test_openConnection_windows_path_character() throws Exception {
+        int port = 0;
+        HttpURLConnection con = null;
+        try {
+            port = Support_Jetty.startDefaultHttpServer();
+        } catch (Exception e) {
+            fail("Exception during setup jetty : " + e.getMessage());
+        }
+        try {
+            URL url = new URL("http://0.0.0.0:" + port + "/servlet?ResourceName=C:\\temp\\test.txt");
+            con = (HttpURLConnection)url.openConnection();
+            con.setDoInput(true);
+            con.setDoOutput(true);
+            con.setUseCaches(false);
+            con.setRequestMethod("GET");
+            InputStream is = con.getInputStream();
+         } catch (Exception e) {
+             fail("Unexpected exception : " + e.getMessage());
+         } finally {
+            con.disconnect();
+         }
+    }
 
     /**
      * @tests java.net.URL#URL(java.lang.String)

Modified: harmony/enhanced/java/branches/java6/classlib/modules/portlib/src/main/native/port/unix/hysock.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/portlib/src/main/native/port/unix/hysock.c?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/portlib/src/main/native/port/unix/hysock.c (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/portlib/src/main/native/port/unix/hysock.c Thu Jun 10 12:06:09 2010
@@ -131,6 +131,8 @@ I_32 map_sockettype_Hy_to_OS (I_32 socke
 
 static I_32 findHostError (int herr);
 
+static socklen_t getAddrLength(hysockaddr_t addr);
+
 #undef CDEV_CURRENT_FUNCTION
 
 #if NO_R
@@ -593,21 +595,10 @@ hysock_bind (struct HyPortLibrary * port
              hysockaddr_t addr)
 {
   I_32 rc = 0;
-  I_32 length = sizeof (addr->addr);
-
-#if defined(SIN6_LEN)
-  length = sizeof (struct sockaddr_storage);
-#if defined(IPv6_FUNCTION_SUPPORT)
-  if (((OSSOCKADDR *) & addr->addr)->sin_family == OS_AF_INET6)
-    {
-      length = ((OSSOCKADDR_IN6 *) & addr->addr)->sin6_len;
-    }
-#endif
-#endif
+  I_32 length = getAddrLength(addr);
 
   if (bind
-      (SOCKET_CAST (sock), (struct sockaddr *) &addr->addr,
-       sizeof (addr->addr)) < 0)
+      (SOCKET_CAST (sock), (struct sockaddr *) &addr->addr, length) < 0)
     {
       rc = errno;
       HYSOCKDEBUG ("<bind failed, err=%d>\n", rc);
@@ -678,10 +669,10 @@ hysock_connect (struct HyPortLibrary * p
                 hysockaddr_t addr)
 {
   I_32 rc = 0;
+  I_32 length = getAddrLength(addr);
 
   if (connect
-      (SOCKET_CAST (sock), (struct sockaddr *) &addr->addr,
-       sizeof (addr->addr)) < 0)
+      (SOCKET_CAST (sock), (struct sockaddr *) &addr->addr, length) < 0)
     {
       rc = errno;
       HYSOCKDEBUG ("<connect failed, err=%d>\n", rc);
@@ -2058,7 +2049,7 @@ I_32 VMCALL
 hysock_getpeername (struct HyPortLibrary * portLibrary, hysocket_t handle,
                     hysockaddr_t addrHandle)
 {
-  socklen_t addrlen = sizeof (addrHandle->addr);
+  socklen_t addrlen = getAddrLength(addrHandle);
 
   if (getpeername
       (SOCKET_CAST (handle), (struct sockaddr *) &addrHandle->addr,
@@ -2550,7 +2541,7 @@ hysock_readfrom (struct HyPortLibrary * 
 
   if (NULL == addrHandle)
     {
-      addrlen = sizeof (*addrHandle);
+      addrlen = sizeof (*addrHandle); /* TOFIX: This is not used? */
       bytesRec =
         recvfrom (SOCKET_CAST (sock), buf, nbyte, flags, NULL, &addrlen);
     }
@@ -2560,6 +2551,7 @@ hysock_readfrom (struct HyPortLibrary * 
       bytesRec =
         recvfrom (SOCKET_CAST (sock), buf, nbyte, flags,
                   (struct sockaddr *) &addrHandle->addr, &addrlen);
+      /* TOFIX: should check if addrlen > sizeof(addrlen) ? */
     }
   if (bytesRec == -1)
     {
@@ -3465,6 +3457,9 @@ hysock_sockaddr_init (struct HyPortLibra
   sockaddr->sin_family = family;
   sockaddr->sin_addr.s_addr = nipAddr;
   sockaddr->sin_port = nPort;
+#if defined(FREEBSD)
+  sockaddr->sin_len = sizeof(OSSOCKADDR);
+#endif
 
   return 0;
 }
@@ -3530,6 +3525,9 @@ hysock_sockaddr_init6 (struct HyPortLibr
           sockaddr_6->sin6_family = OS_AF_INET6;
           sockaddr_6->sin6_scope_id = scope_id;
           sockaddr_6->sin6_flowinfo = htonl (flowinfo);
+#if defined(FREEBSD)
+          sockaddr_6->sin6_len = sizeof(OSSOCKADDR_IN6);
+#endif
         }
       else
         {
@@ -3540,6 +3538,10 @@ hysock_sockaddr_init6 (struct HyPortLibr
           memcpy (&sockaddr->sin_addr.s_addr, addr, addrlength);
           sockaddr->sin_port = nPort;
           sockaddr->sin_family = OS_AF_INET4;
+#if defined(FREEBSD)
+          sockaddr->sin_len = sizeof(OSSOCKADDR);
+#endif
+
 #if defined(IPv6_FUNCTION_SUPPORT)
         }
 #endif
@@ -3555,12 +3557,7 @@ hysock_sockaddr_init6 (struct HyPortLibr
       sockaddr_6->sin6_scope_id = scope_id;
       sockaddr_6->sin6_flowinfo = htonl (flowinfo);
 #if defined(SIN6_LEN)
-      sockaddr_6->sin6_len = sizeof (struct sockaddr_in6);
-      if (((OSSOCKADDR_IN6 *) & handle->addr)->sin6_len != 0)
-        {
-          sockaddr_6->sin6_len =
-            ((OSSOCKADDR_IN6 *) & handle->addr)->sin6_len;
-        }
+      sockaddr_6->sin6_len = sizeof(OSSOCKADDR_IN6);
 #endif
     }
 #endif
@@ -3571,6 +3568,9 @@ hysock_sockaddr_init6 (struct HyPortLibr
       memcpy (&sockaddr->sin_addr.s_addr, addr, HYSOCK_INADDR_LEN);
       sockaddr->sin_port = nPort;
       sockaddr->sin_family = map_addr_family_Hy_to_OS (family);
+#if defined(FREEBSD)
+      sockaddr->sin_len = sizeof(OSSOCKADDR);
+#endif
     }
 
   return 0;
@@ -3845,7 +3845,7 @@ hysock_writeto (struct HyPortLibrary * p
   bytesSent =
     sendto (SOCKET_CAST (sock), buf, nbyte, flags,
             (struct sockaddr *) &(addrHandle->addr),
-            sizeof (addrHandle->addr));
+            getAddrLength(addrHandle));
 
   if (bytesSent == -1)
     {
@@ -5166,7 +5166,7 @@ hysock_connect_with_timeout (struct HyPo
 
       rc = connect
           (SOCKET_CAST (sock), (struct sockaddr *) &addr->addr,
-           sizeof (addr->addr));
+           getAddrLength(addr));
       if (rc < 0)
         {
           rc = errno;
@@ -5274,6 +5274,15 @@ hysock_connect_with_timeout (struct HyPo
 
 #undef CDEV_CURRENT_FUNCTION
 
-#define CDEV_CURRENT_FUNCTION
+#define CDEV_CURRENT_FUNCTION getAddrLength
 
+static socklen_t getAddrLength(hysockaddr_t addr)
+{
+  return
+#if defined(IPv6_FUNCTION_SUPPORT)
+    ((OSSOCKADDR *) & addr->addr)->sin_family == OS_AF_INET6 ?
+    sizeof(OSSOCKADDR_IN6) :
+#endif
+    sizeof(OSSOCKADDR);
+}
 #undef CDEV_CURRENT_FUNCTION

Modified: harmony/enhanced/java/branches/java6/classlib/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferencesTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferencesTest.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferencesTest.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferencesTest.java Thu Jun 10 12:06:09 2010
@@ -199,7 +199,7 @@ public class PreferencesTest extends Tes
             prefs = Preferences.userNodeForPackage(PreferencesTest.class);
         } finally {
             try {
-                prefs = Preferences.userRoot().node("tests");
+                prefs = Preferences.userNodeForPackage(PreferencesTest.class);
                 prefs.removeNode();
             } catch (Exception e) {
                 // Ignored

Modified: harmony/enhanced/java/branches/java6/classlib/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicArrowButton.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicArrowButton.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicArrowButton.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicArrowButton.java Thu Jun 10 12:06:09 2010
@@ -35,19 +35,23 @@ import org.apache.harmony.x.swing.Utilit
 public class BasicArrowButton extends JButton implements SwingConstants {
     protected int direction;
 
-    private static Color shadow = UIManager.getColor("ScrollBar.shadow");
-    private static Color darkShadow = UIManager.getColor("ScrollBar.darkShadow");
+    private Color shadow;
+    private Color darkShadow;
 
     public BasicArrowButton(final int direction) {
         this.direction = direction;
+        shadow = UIManager.getColor("ScrollBar.shadow");
+        darkShadow = UIManager.getColor("ScrollBar.darkShadow");
     }
 
-    public BasicArrowButton(final int direction, final Color background, final Color shadow,
-                            final Color darkShadow, final Color highlight) {
-        BasicArrowButton.shadow = shadow;
-        BasicArrowButton.darkShadow = darkShadow;
+    public BasicArrowButton(final int direction, final Color background,
+                            final Color shadow, final Color darkShadow,
+                            final Color highlight) {
+        this.shadow = shadow;
+        this.darkShadow = darkShadow;
         this.direction = direction;
         setBackground(background);
+        // TOFIX: highlight is ignored
     }
 
     public int getDirection() {
@@ -82,7 +86,10 @@ public class BasicArrowButton extends JB
         return false;
     }
 
-    public void paintTriangle(final Graphics g, final int x, final int y, final int size, final int direction, final boolean isEnabled) {
-        Utilities.fillArrow(g, x, y, direction, size, false, isEnabled ? darkShadow : shadow);
+    public void paintTriangle(final Graphics g, final int x, final int y,
+                              final int size, final int direction,
+                              final boolean isEnabled) {
+        Utilities.fillArrow(g, x, y, direction, size, false,
+                            isEnabled ? darkShadow : shadow);
     }
 }

Modified: harmony/enhanced/java/branches/java6/classlib/modules/swing/src/test/api/java.injected/javax/swing/plaf/basic/BasicArrowButtonTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/swing/src/test/api/java.injected/javax/swing/plaf/basic/BasicArrowButtonTest.java?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/swing/src/test/api/java.injected/javax/swing/plaf/basic/BasicArrowButtonTest.java (original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/swing/src/test/api/java.injected/javax/swing/plaf/basic/BasicArrowButtonTest.java Thu Jun 10 12:06:09 2010
@@ -75,9 +75,6 @@ public class BasicArrowButtonTest extend
     public void testGetBackground() {
         final Color c = Color.red;
         BasicArrowButton b = new BasicArrowButton(240, c, c, c, c);
-
-        System.out.println("parameter background == " + c);
-        System.out.println("getBackground()==" + b.getBackground());
         assertSame(c, b.getBackground());
     } 
 }

Propchange: harmony/enhanced/java/branches/java6/common_resources/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun 10 12:06:09 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/java/branches/mrh/common_resources:935751-941490
-/harmony/enhanced/java/trunk/common_resources:929253-951343
-/harmony/enhanced/trunk/common_resources:476396-929252
-/incubator/harmony/enhanced/trunk/common_resources:423974-476394
+/harmony/enhanced/java/trunk/common_resources:929253-953249
+/harmony/enhanced/trunk/common_resources:476395-929252
+/incubator/harmony/enhanced/trunk/common_resources:292550-476394

Modified: harmony/enhanced/java/branches/java6/debian/rules
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/debian/rules?rev=953293&r1=953292&r2=953293&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/debian/rules (original)
+++ harmony/enhanced/java/branches/java6/debian/rules Thu Jun 10 12:06:09 2010
@@ -10,10 +10,8 @@
 # Modified to make a template file for a multi-binary package with separated
 # build-arch and build-indep targets  by Bill Allombert 2001
 
-# -lib /usr/share/java ensures that ant finds ecj.jar, etc
-ANT_FLAGS = -lib /usr/share/java \
-            -Dhy.local.zlib=true -Dhy.zip.api=false   \
-            -Dhy.no.thr=false -Dauto.fetch=true -Djava6=true
+ANT_FLAGS = -Dhy.local.zlib=true -Dhy.zip.api=false   \
+            -Dhy.no.thr=false -Dauto.fetch=true
 VMDIR=$(CURDIR)/debian/harmony-6.0-drlvm
 CLDIR=$(CURDIR)/debian/harmony-6.0-classlib
 JREDIR=$(CURDIR)/debian/harmony-6.0-jre
@@ -28,7 +26,7 @@ export DH_OPTIONS
 
 
 
-CFLAGS = -Wall -g
+CFLAGS = -g
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 	CFLAGS += -O0
@@ -104,6 +102,13 @@ install-arch:
 	-rm -rf $(CLDIR)/usr/lib/harmony-6.0/jdk/jre
 	mv $(CURDIR)/target/hdk/jdk/jre $(CLDIR)/usr/lib/harmony-6.0/jdk
 
+	# move *-src.jar back out so they end up in the jdk
+	mkdir -p $(CURDIR)/target/hdk/jdk/jre/lib/boot
+	mv $(CLDIR)/usr/lib/harmony-6.0/jdk/jre/lib/boot/*-src.jar \
+	   $(CURDIR)/target/hdk/jdk/jre/lib/boot
+	mv $(CLDIR)/usr/lib/harmony-6.0/jdk/jre/lib/*-src.jar \
+	   $(CURDIR)/target/hdk/jdk/jre/lib
+
 	mkdir -p $(JREDIR)/usr/lib/harmony-6.0/jdk/jre/bin
 	mv $(CLDIR)/usr/lib/harmony-6.0/jdk/jre/bin/java \
 	   $(JREDIR)/usr/lib/harmony-6.0/jdk/jre/bin

Propchange: harmony/enhanced/java/branches/java6/drlvm/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun 10 12:06:09 2010
@@ -1,5 +1,5 @@
 /harmony/enhanced/java/branches/mrh/drlvm:935751-941490
-/harmony/enhanced/java/trunk/drlvm:929253-951343
-/harmony/enhanced/trunk/drlvm:810871-929252
+/harmony/enhanced/java/trunk/drlvm:929253-953249
+/harmony/enhanced/trunk/drlvm:476395-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 Jun 10 12:06:09 2010
@@ -1,5 +1,5 @@
-/harmony/enhanced/java/trunk/jdktools:929253-951343
+/harmony/enhanced/java/trunk/jdktools:929253-953249
 /harmony/enhanced/jdktools/trunk:630107-925933
-/harmony/enhanced/trunk/jdktools:810871-929252
+/harmony/enhanced/trunk/jdktools:476395-929252
 /harmony/enhanced/trunk/working_jdktools:476396-920147
 /incubator/harmony/enhanced/trunk/working_jdktools:423974-476394



Mime
View raw message