harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r570061 [1/2] - in /harmony/enhanced/classlib/branches/java6: depends/build/ make/ modules/archive/src/main/java/java/util/zip/ modules/auth/src/test/java/common/org/ietf/jgss/ modules/awt/src/main/java/common/java/awt/geom/ modules/awt/src...
Date Mon, 27 Aug 2007 10:44:05 GMT
Author: pyang
Date: Mon Aug 27 03:43:59 2007
New Revision: 570061

URL: http://svn.apache.org/viewvc?rev=570061&view=rev
Log:
Merge updates from classlib trunk@570018 since r565677

Added:
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSResourcesMonitor.java
      - copied unchanged from r569416, harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSResourcesMonitor.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSResourcesMonitor.h
      - copied unchanged from r569416, harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSResourcesMonitor.h
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSResourcesMonitorLinux.c
      - copied unchanged from r569416, harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSResourcesMonitorLinux.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSResourcesMonitorWin32.c
      - copied unchanged from r569416, harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSResourcesMonitorWin32.c
    harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/
      - copied from r569416, harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/
    harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetImpl.java
      - copied, changed from r569416, harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetImpl.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/
      - copied from r569416, harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/
      - copied from r569416, harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/CachedRowSetImplTest.java
      - copied unchanged from r569416, harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/CachedRowSetImplTest.java
Removed:
    harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/BeanInfoData.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/BeanInfoImpl.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java
Modified:
    harmony/enhanced/classlib/branches/java6/depends/build/defines.mk
    harmony/enhanced/classlib/branches/java6/make/build-test.xml
    harmony/enhanced/classlib/branches/java6/make/depends.properties
    harmony/enhanced/classlib/branches/java6/make/depends.xml
    harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Deflater.java
    harmony/enhanced/classlib/branches/java6/modules/auth/src/test/java/common/org/ietf/jgss/OidTest.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/geom/Area.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/geom/FlatteningPathIterator.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/CrossingHelper.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/GeometryUtil.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/Crossing.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/render/JavaBlitter.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XBlitter.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XSurface.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/geom/AreaTest.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
    harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/Logger.java
    harmony/enhanced/classlib/branches/java6/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java
    harmony/enhanced/classlib/branches/java6/modules/logging/src/test/resources/config/java/util/logging/logging.config
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/File.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectInputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectStreamClass.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Character.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Arrays.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/LinkedHashMap.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Locale.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemory.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemory.h
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/exports.txt
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/makefile
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSMemory.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSMemory.h
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/makefile
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectInputStreamTest.java
    harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigDecimal.java
    harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigInteger.java
    harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/Logical.java
    harmony/enhanced/classlib/branches/java6/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java
    harmony/enhanced/classlib/branches/java6/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java
    harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/org/apache/harmony/nio/internal/SelectorImpl.java
    harmony/enhanced/classlib/branches/java6/modules/sql/build.xml
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/JOptionPane.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicOptionPaneUI.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSplitPaneUI.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/text/FlowView.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/text/html/HTMLDocument.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/text/html/ImageView.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/undo/UndoManager.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/plaf/basic/BasicSliderUITest.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/html/HTMLDocument_Reader_ActionsTest.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/html/HTMLTest.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/html/ImageViewTest.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/undo/CompoundEditTest.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/undo/UndoManagerTest.java
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/AttributedString.java
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormat.java

Modified: harmony/enhanced/classlib/branches/java6/depends/build/defines.mk
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/depends/build/defines.mk?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/depends/build/defines.mk (original)
+++ harmony/enhanced/classlib/branches/java6/depends/build/defines.mk Mon Aug 27 03:43:59 2007
@@ -54,7 +54,7 @@
 INCLUDES += -I$(HY_HDK)/include -I$(HY_HDK)/jdk/include -I. -I$(SHAREDSUB)
 
 ifndef HYDEBUGCFLAGS
-HYDEBUGCFLAGS = -g
+HYDEBUGCFLAGS = -ggdb -O0
 endif
 
 ifndef HYRELEASECFLAGS  
@@ -83,4 +83,4 @@
 
 ifeq ($(HY_ZIP_API),true)
 DEFINES += -DHY_ZIP_API
-endif
\ No newline at end of file
+endif

Modified: harmony/enhanced/classlib/branches/java6/make/build-test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/make/build-test.xml?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/make/build-test.xml (original)
+++ harmony/enhanced/classlib/branches/java6/make/build-test.xml Mon Aug 27 03:43:59 2007
@@ -99,6 +99,9 @@
         <fileset dir="${jetty.dir}">
             <include name="*.jar" />
         </fileset>
+        <fileset dir="${derby.dir}">
+            <include name="*.jar" />
+        </fileset>
         </copy>
     </target>
 

Modified: harmony/enhanced/classlib/branches/java6/make/depends.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/make/depends.properties?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/make/depends.properties (original)
+++ harmony/enhanced/classlib/branches/java6/make/depends.properties Mon Aug 27 03:43:59 2007
@@ -55,7 +55,8 @@
 msvcr.dir.x86_64=${depends.dir}/libs/windows.x86_64
 msvcr.dll.x86_64=${msvcr.dir.x86_64}/msvcr80.dll
 msvcr.dll.file.x86_64=msvcr80.dll
-msvcr.url.x86_64=file:///${hyenv.SystemRoot}/system32/msvcr80.dll
+#msvcr.url.x86_64=file:///${hyenv.SystemRoot}/system32/msvcr80.dll
+msvcr.url.x86_64=file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio%208/VC/redist/amd64/Microsoft.VC80.CRT/msvcr80.dll
 msvcr.md5.x86_64=465cebd7da2ceaba5e552fc9118a1415
 
 icu4j.dir=${depends.jars}/icu4j_3.4.4
@@ -130,4 +131,9 @@
 dejavu-fonts.zip=${dejavu-fonts.dir}/dejavu-ttf-2.18-1.zip
 dejavu-fonts.url=http://dfn.dl.sourceforge.net/sourceforge/dejavu/dejavu-ttf-2.18-1.zip
 dejavu-fonts.md5=72e0a87ec1f9c5c26c66eabcf1e2018e
+
+derby.dir=${depends.dir}/derby
+derby.jar=${derby.dir}/derby.jar
+derby.url=http://www.ibiblio.org/maven/org.apache.derby/jars/derby-10.3.1.4.jar
+derby.md5=f28d6047ab26445de53c4c96126494df
 

Modified: harmony/enhanced/classlib/branches/java6/make/depends.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/make/depends.xml?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/make/depends.xml (original)
+++ harmony/enhanced/classlib/branches/java6/make/depends.xml Mon Aug 27 03:43:59 2007
@@ -48,6 +48,7 @@
         <check-one-file src="${jetty-util.url}" dest="${jetty-util.jar}" />
         <check-one-file src="${servlet-api.url}" dest="${servlet-api.jar}" />
         <check-one-file src="${dejavu-fonts.url}" dest="${dejavu-fonts.zip}" />
+        <check-one-file src="${derby.url}" dest="${derby.jar}" />
     </target>
 
     <target name="-check-win" if="is.windows" depends="-really-check-win" />
@@ -348,6 +349,11 @@
     <download-one-file src="${dejavu-fonts.url}" dest="${dejavu-fonts.zip}"
                            md5="${dejavu-fonts.md5}" />
     <unzip src="${dejavu-fonts.zip}" dest="${dejavu-fonts.dir}" />
+
+    <mkdir dir="${derby.dir}" />
+    <download-one-file src="${derby.url}"
+                       dest="${derby.jar}"
+                       md5="${derby.md5}" />
     </target>
 
     <target name="-download-win" if="is.windows" depends="-select-win-deps-x86_64,-select-win-deps-x86">
@@ -364,7 +370,6 @@
     <download-one-file src="${awtdeps.url}"
                        dest="${awtdeps.tar}"
                        md5="${awtdeps.md5}" />
-
     </target>
 
     <macrodef name="download-one-file">

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Deflater.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Deflater.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Deflater.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/Deflater.java Mon Aug 27 03:43:59 2007
@@ -17,6 +17,8 @@
 
 package java.util.zip;
 
+import org.apache.harmony.luni.platform.OSResourcesMonitor;
+
 /**
  * The Deflater class is used to compress bytes using the DEFLATE compression
  * algorithm. Deflation is performed by the ZLIB compression library.
@@ -110,7 +112,7 @@
             throw new IllegalArgumentException();
         }
         compressLevel = level;
-        streamHandle = createStream(compressLevel, strategy, noHeader);
+        streamHandle = createStreamWithMemoryEnsurance(compressLevel, strategy, noHeader);
     }
 
     /**
@@ -431,5 +433,9 @@
         return getTotalOutImpl(streamHandle);
     }
 
+    private long createStreamWithMemoryEnsurance(int level, int strategy1, boolean noHeader1){
+        OSResourcesMonitor.ensurePhysicalMemoryCapacity();
+        return createStream(level, strategy1, noHeader1);
+    }
     private native long createStream(int level, int strategy1, boolean noHeader1);
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/auth/src/test/java/common/org/ietf/jgss/OidTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/auth/src/test/java/common/org/ietf/jgss/OidTest.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/auth/src/test/java/common/org/ietf/jgss/OidTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/auth/src/test/java/common/org/ietf/jgss/OidTest.java Mon Aug 27 03:43:59 2007
@@ -313,4 +313,11 @@
         } catch (GSSException e) {
         }
     }
+    
+    public void test_KerberosV5() throws Exception {
+        Oid oid = new Oid("1.2.840.113554.1.2.2");
+        byte[] expectedDer = new byte[] { 6, 9, 42, -122, 72, -122, -9, 18, 1,
+                2, 2 };
+        assertTrue(Arrays.equals(expectedDer, oid.getDER()));
+    }
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/geom/Area.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/geom/Area.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/geom/Area.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/geom/Area.java Mon Aug 27 03:43:59 2007
@@ -241,27 +241,57 @@
 	}
 
 	public void add(Area area) {
+    	if (area == null || area.isEmpty()) {
+    	    return;
+    	} else if (isEmpty()) {
+    	    copy(area, this);
+    		return;
+    	}
+
 		if (isPolygonal() && area.isPolygonal()) {
 			addPolygon(area);
 		} else {
 			addCurvePolygon(area);
 		}
+		
+		if (getAreaBoundsSquare() < GeometryUtil.EPSILON) {
+		    reset();
+		}
 	}
 	   
 	public void intersect(Area area) {
+		if (area == null) {
+		    return;
+		} else if (isEmpty() || area.isEmpty()) {
+		    reset();
+			return;		
+		}
+		
 		if (isPolygonal() && area.isPolygonal()) {
 			intersectPolygon(area);
 		} else {
 			intersectCurvePolygon(area);
 		}
+		
+		if (getAreaBoundsSquare() < GeometryUtil.EPSILON) {
+		    reset();
+		}
 	}
 	
 	public void subtract(Area area) {
+		if (area == null || isEmpty() || area.isEmpty()) {
+		    return;
+		}
+
 		if (isPolygonal() && area.isPolygonal()) {
 			subtractPolygon(area);
 		} else {
 			subtractCurvePolygon(area);
 		}
+		
+		if (getAreaBoundsSquare() < GeometryUtil.EPSILON) {
+		    reset();
+		}
 	}
 	
  	public void exclusiveOr(Area area) {
@@ -441,8 +471,9 @@
             double[] coords = (isCurrentArea) ? this.coords : area.coords;
             int offset = 2 * point.getEndIndex(isCurrentArea);
  
-            if (nextPoint.getBegIndex(isCurrentArea) < 
-            		point.getEndIndex(isCurrentArea)) {
+            if ((offset >= 0) && 
+            	    (nextPoint.getBegIndex(isCurrentArea) < 
+            		    point.getEndIndex(isCurrentArea))) {
                 int coordSize = (isCurrentArea) ? this.coordsSize : 
                 	                              area.coordsSize;
                 int length = coordSize - offset;
@@ -458,14 +489,16 @@
                 offset = 0;
             }
             
-            int length = 2 * nextPoint.getBegIndex(isCurrentArea) - offset + 2;
-            System.arraycopy(coords, offset, 
-            		         resultCoords, resultCoordPos, length);
-            
-            for (int i = 0; i < length / 2; i++) {
-            	resultRules[resultRulesPos] = PathIterator.SEG_LINETO;
-            	resultOffsets[resultRulesPos++] = resultCoordPos;
-            	resultCoordPos += 2;
+            if (offset >= 0) {
+                int length = 2 * nextPoint.getBegIndex(isCurrentArea) - offset + 2;
+                System.arraycopy(coords, offset, 
+            		             resultCoords, resultCoordPos, length);
+            
+                for (int i = 0; i < length / 2; i++) {
+            	    resultRules[resultRulesPos] = PathIterator.SEG_LINETO;
+            	    resultOffsets[resultRulesPos++] = resultCoordPos;
+            	    resultCoordPos += 2;
+                }
             }
 
             point = nextPoint;
@@ -814,21 +847,26 @@
 				                                        area.coordsSize });
 		IntersectPoint[] intersectPoints = crossHelper.findCrossing();
 
-		if ((intersectPoints.length == 0) && (contains(area.getBounds2D()))) {
-			copy(area, this);
-			return;
-		} 
+		if (intersectPoints.length == 0) {
+		    if (contains(area.getBounds2D())) {
+		        copy(area, this);
+		        return;
+			} 
+		    return;
+		}
 
-        double[] resultCoords = new double[coordsSize + area.coordsSize + 
-                                                       intersectPoints.length];
-        int[] resultRules = new int[rulesSize + area.rulesSize + 
-                                                       intersectPoints.length];
-        int[] resultOffsets = new int[rulesSize + area.rulesSize + 
-                                                       intersectPoints.length];
+        double[] resultCoords = new double[2 * (coordsSize + area.coordsSize + 
+                                                       intersectPoints.length)];
+        int[] resultRules = new int[2 * (rulesSize + area.rulesSize + 
+                                                       intersectPoints.length)];
+        int[] resultOffsets = new int[2 * (rulesSize + area.rulesSize + 
+                                                       intersectPoints.length)];
         int resultCoordPos = 0;
         int resultRulesPos = 0;
         boolean isCurrentArea = true;
-        int count = 0;
+        int countPoints = 0;
+        boolean curArea = false;
+        boolean addArea = false;
 
         IntersectPoint point = intersectPoints[0];
         resultRules[resultRulesPos] = PathIterator.SEG_MOVETO;
@@ -842,8 +880,11 @@
             int curIndex = point.getEndIndex(true);
             
             if ((curIndex < 0) || 
-            	(area.containsExact(coords[2 * curIndex], 
-            			            coords[2 * curIndex + 1]) > 0)) {
+            		(area.isVertex(coords[2 * curIndex], coords[2 * curIndex + 1]) && 
+            		     crossHelper.containsPoint(new double[] {coords[2 * curIndex], 
+            				                       coords[2 * curIndex + 1]}) && 
+            		(coords[2 * curIndex] != point.getX() || 
+            			 coords[2 * curIndex + 1] != point.getY()))) {
             	isCurrentArea = !isCurrentArea;
             } else if (area.containsExact(coords[2 * curIndex], 
             		                      coords[2 * curIndex + 1]) > 0) { 
@@ -851,6 +892,16 @@
             } else {
             	isCurrentArea = true;
             }
+            
+            if (countPoints >= intersectPoints.length) {
+                isCurrentArea = !isCurrentArea;
+            }
+            	 
+            if (isCurrentArea) {
+                curArea = true;
+            } else {
+                addArea = true;
+            }
 
             IntersectPoint nextPoint = (isCurrentArea) ? 
             		getNextIntersectPoint(intersectPoints, point, isCurrentArea):
@@ -916,27 +967,22 @@
             }
 
             point = nextPoint;
-            count++;
-        } while (point != intersectPoints[0] && count <= intersectPoints.length);
+            countPoints++;
+        } while (point != intersectPoints[0] || !(curArea && addArea));
         
-        if (count > intersectPoints.length) {
-        	reset();
-        } else {
-            resultRules[resultRulesPos - 1] = PathIterator.SEG_CLOSE;
-            resultOffsets[resultRulesPos - 1] = resultCoordPos;
-		    coords = resultCoords;
-		    rules = resultRules;
-		    offsets = resultOffsets;
-		    coordsSize = resultCoordPos;
-		    rulesSize = resultRulesPos;
-        }
+        resultRules[resultRulesPos - 1] = PathIterator.SEG_CLOSE;
+        resultOffsets[resultRulesPos - 1] = resultCoordPos;
+	    coords = resultCoords;
+	    rules = resultRules;
+	    offsets = resultOffsets;
+	    coordsSize = resultCoordPos;
+	    rulesSize = resultRulesPos;
 	}
 	
-	   private IntersectPoint getNextIntersectPoint(IntersectPoint[] iPoints,
+	private IntersectPoint getNextIntersectPoint(IntersectPoint[] iPoints,
 			                                        IntersectPoint isectPoint, 
 			                                        boolean isCurrentArea) {
-		   
-		int endIndex = isectPoint.getEndIndex(isCurrentArea);
+	    int endIndex = isectPoint.getEndIndex(isCurrentArea);
 		if (endIndex < 0) {
 			return iPoints[Math.abs(endIndex) - 1];
 		}
@@ -1227,6 +1273,20 @@
     	}
     }
     
+    private double getAreaBoundsSquare() {
+        Rectangle2D bounds = getBounds2D();
+        return bounds.getHeight() * bounds.getWidth();
+    }
+
+    private boolean isVertex(double x, double y) {
+        for (int i = 0; i < coordsSize;) {
+    	    if (x == coords[i++] && y == coords[i++]) {
+    		    return true;
+    		}
+    	}
+    	return false;
+    }
+
     // the internal class implements PathIterator
 	private class AreaPathIterator implements PathIterator {
 

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/geom/FlatteningPathIterator.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/geom/FlatteningPathIterator.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/geom/FlatteningPathIterator.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/geom/FlatteningPathIterator.java Mon Aug 27 03:43:59 2007
@@ -207,9 +207,7 @@
             if (bufEmpty) {
                 bufIndex = bufSize;
                 bufType = SEG_LINETO;
-            } else {
-                bufSubdiv--;
-            }
+            } 
             break;
         case SEG_CUBICTO:
             if (bufEmpty) {
@@ -251,9 +249,7 @@
             if (bufEmpty) {
                 bufIndex = bufSize;
                 bufType = SEG_LINETO;
-            } else {
-                bufSubdiv--;
-            }
+            } 
             break;
         }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/CrossingHelper.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/CrossingHelper.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/CrossingHelper.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/CrossingHelper.java Mon Aug 27 03:43:59 2007
@@ -284,7 +284,7 @@
         }
     }
     
-    private boolean containsPoint(double[] point) {
+    public boolean containsPoint(double[] point) {
     	IntersectPoint ipoint;
     	
     	for (Iterator i = isectPoints.iterator(); i.hasNext(); ) {

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/GeometryUtil.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/GeometryUtil.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/GeometryUtil.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/GeometryUtil.java Mon Aug 27 03:43:59 2007
@@ -19,7 +19,7 @@
 import org.apache.harmony.awt.gl.Crossing;
 
 public class GeometryUtil {
-    static final double EPSILON = Math.pow(10, -15);
+    public static final double EPSILON = Math.pow(10, -14);
 
     public static int intersectLinesWithParams(double x1, double y1, double x2, double y2,
                                                double x3, double y3, double x4, double y4,

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/Crossing.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/Crossing.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/Crossing.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/Crossing.java Mon Aug 27 03:43:59 2007
@@ -382,9 +382,14 @@
             }
         }
 
-        // START or END
-        if (x == x1 || x == x2) {
-            return 0;
+        // START
+        if (x == x1) {
+        	return x1 < x2 ? 0 : -1;        
+        }
+        
+        // END
+        if (x == x2) {
+        	return x1 < x2 ? 1 : 0;        
         }
 
         // INSIDE-DOWN
@@ -486,6 +491,13 @@
                     cross += crossLine(cx, cy, cx = mx, cy = my, x, y);
                 }
                 break;
+            }
+            
+            // checks if the point (x,y) is the vertex of shape with PathIterator p           
+            if (x == cx && y == cy) {
+            	cross = 0;
+            	cy = my;
+            	break;
             }
             p.next();
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/render/JavaBlitter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/render/JavaBlitter.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/render/JavaBlitter.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/render/JavaBlitter.java Mon Aug 27 03:43:59 2007
@@ -357,7 +357,7 @@
         Rectangle dstBlitBounds = new Rectangle(dstX, dstY, srcR.getWidth(), srcR.getHeight());
 
         Rectangle transSrcBounds = getBounds2D(at, srcBounds).getBounds();
-        Rectangle transDstBlitBounds = getBounds2D(at, dstBlitBounds).getBounds();
+        Rectangle transDstBlitBounds = new Rectangle(0, 0, dstR.getWidth(), dstR.getHeight());
 
         int translateX = transDstBlitBounds.x - transSrcBounds.x;
         int translateY = transDstBlitBounds.y - transSrcBounds.y;
@@ -474,7 +474,7 @@
 
     }
 
-    private Rectangle2D getBounds2D(AffineTransform at, Rectangle r) {
+    public static Rectangle2D getBounds2D(AffineTransform at, Rectangle r) {
         int x = r.x;
         int y = r.y;
         int width = r.width;

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XBlitter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XBlitter.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XBlitter.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XBlitter.java Mon Aug 27 03:43:59 2007
@@ -31,6 +31,7 @@
 
 import org.apache.harmony.awt.gl.*;
 import org.apache.harmony.awt.gl.render.Blitter;
+import org.apache.harmony.awt.gl.render.JavaBlitter;
 import org.apache.harmony.awt.gl.render.NativeImageBlitter;
 import org.apache.harmony.awt.nativebridge.linux.X11;
 import org.apache.harmony.awt.nativebridge.linux.X11Defs;
@@ -169,76 +170,49 @@
             default:
                 XSurface xDstSurf = (XSurface) dstSurf;
 
-                BufferedImage compIm;
-                int w = srcSurf.getWidth();
-                int h = srcSurf.getHeight();
-
-                if (!(srcSurf instanceof ImageSurface)) {
-                    compIm = xDstSurf.g2d.xConfig.createCompatibleImage(w, h);
-
-                    NativeImageBlitter.getInstance().blit(
-                            srcX, srcY, srcSurf,
-                            srcX, srcY,
-                            AwtImageBackdoorAccessor.getInstance().getImageSurface(compIm),
-                            w, h,
-                            AlphaComposite.Src, null, null
-                    );
-                } else {
-                    ColorModel cm = srcSurf.getColorModel();
-                    compIm = new BufferedImage(
-                            cm,
-                            srcSurf.getRaster(),
-                            cm.isAlphaPremultiplied(),
-                            null
-                    );
-                }
-
-                WritableRaster compRaster = compIm.getRaster();
-
                 AffineTransform at = (AffineTransform) sysxform.clone();
 
-                AffineTransformOp atop =
-                        new AffineTransformOp(at, xDstSurf.g2d.getRenderingHints());
-
-                Rectangle r = atop.getBounds2D(compRaster).getBounds();
-                int tWidth = r.width;
-                int tHeight = r.height;
+                Rectangle transDstBounds = JavaBlitter.getBounds2D(at, new Rectangle(dstX, dstY, width, height)).getBounds();
+                int tWidth = transDstBounds.width;
+                int tHeight = transDstBounds.height;
+                dstX = transDstBounds.x;
+                dstY = transDstBounds.y;
+
+                ColorModel cm = srcSurf.getColorModel();
+                WritableRaster compRaster = srcSurf.getRaster();
+                BufferedImage compIm = new BufferedImage(
+                        cm,
+                        compRaster,
+                        cm.isAlphaPremultiplied(),
+                        null
+                );
 
-                BufferedImage transformed;
-                if (compIm.getColorModel().getTransparency() == Transparency.OPAQUE) {
-                    transformed = xDstSurf.g2d.xConfig.createCompatibleImage(tWidth, tHeight);
-                } else {
-                    ColorModel cm = compIm.getColorModel();
-                    transformed =
-                            new BufferedImage(
-                                    cm,
-                                    compIm.getRaster().createCompatibleWritableRaster(
-                                            tWidth,
-                                            tHeight
-                                    ),
-                                    cm.isAlphaPremultiplied(),
-                                    null
-                            );
-                }
+                BufferedImage transformed = new BufferedImage(tWidth, tHeight, BufferedImage.TYPE_INT_ARGB);
 
-                atop.filter(compIm, transformed);
+                Surface transfSurf = Surface.getImageSurface(transformed);
+                JavaBlitter.getInstance().blit(srcX, srcY, Surface.getImageSurface(compIm), 
+                        0, 0, transfSurf, width, height, at, AlphaComposite.Src, null, null);
 
                 if (dstX < 0){
                     tWidth += dstX;
+                    srcX = -dstX;
                     dstX = 0;
                 }
 
                 if (dstY < 0){
                     tHeight += dstY;
+                    srcY = -dstY;
                     dstY = 0;
                 }
 
+                if(tWidth <= 0 || tHeight <= 0 || srcX >= tWidth || srcY >= tHeight) return;
                 blit(
-                        0, 0, AwtImageBackdoorAccessor.getInstance().getImageSurface(transformed),
+                        srcX, srcY, transfSurf,
                         dstX, dstY, dstSurf,
                         tWidth, tHeight,
                         comp, bgcolor, clip
                 );
+
         }
     }
 
@@ -248,6 +222,7 @@
             int width, int height,
             Composite comp, Color bgcolor, MultiRectArea clip
     ) {
+
         if (clip == null) {
             clip = new MultiRectArea(new Rectangle(dstX, dstY, width, height));
         } else {
@@ -298,7 +273,8 @@
                 makeClip(dstX, dstY, width, height, clip);
 
                 g2d.setXClip(clip, g2d.imageGC);
-                X11.getInstance().XCopyArea(
+                X11 x11 = X11.getInstance(); 
+                x11.XCopyArea(
                         g2d.display,
                         xSrcSurf.g2d.drawable, g2d.drawable,
                         g2d.imageGC,
@@ -306,6 +282,7 @@
                         width, height,
                         dstX, dstY
                 );
+                x11.XFlush(g2d.display);
                 g2d.resetXClip(g2d.imageGC);
 
                 g2d.setImageGCFunction(X11Defs.GXcopy);
@@ -384,8 +361,10 @@
             MultiRectArea clip
     ) {
         XSurface xDstSurf = ((XSurface) dstSurf);
+
         boolean srcNoAlpha =
                 srcSurf.getColorModel().getTransparency() == Transparency.OPAQUE;
+
         if (comp instanceof AlphaComposite) {
             AlphaComposite acomp = (AlphaComposite) comp;
             if (
@@ -400,28 +379,27 @@
             }
         }
 
-        AffineTransform t = xDstSurf.g2d.getTransform();
-        int tx = (int) t.getTranslateX();
-        int ty = (int) t.getTranslateY();
-
-        if (xDstSurf.needServerData) {
-            xDstSurf.setRoi(new Rectangle2D.Float(dstX - tx, dstY - ty, width, height));
-        }
-
-        clip.translate(-tx, -ty);
-
+        Rectangle2D roi = new Rectangle2D.Float(dstX, dstY, width, height); 
+        xDstSurf.setRoi(roi);
         NativeImageBlitter.getInstance().blit(
                 srcX, srcY, srcSurf,
-                dstX - tx, dstY - ty, xDstSurf.getImageSurface(),
+                0, 0, xDstSurf.getImageSurface(),
                 width, height,
-                comp, bgcolor, clip
+                comp, bgcolor, null
         );
 
-        clip.translate(tx, ty);
+        if (xDstSurf.needServerData) {
+            xDstSurf.putImage(clip,
+                    (int) (roi.getX()),
+                    (int) (roi.getY()),
+                    (int) roi.getWidth(), 
+                    (int) roi.getHeight()
+            );
+
+        } else {
+            xDstSurf.putImage(clip, dstX, dstY, width, height);
+        }
 
-        // Get translated clip
-        makeClip(dstX, dstY, width, height, clip);
-        xDstSurf.putImage(clip);
         xDstSurf.needServerData = true;
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XSurface.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XSurface.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XSurface.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XSurface.java Mon Aug 27 03:43:59 2007
@@ -100,8 +100,8 @@
                     g2d.drawable,
                     pixmap,
                     g2d.imageGC,
-                    (int) (g2d.getTransform().getTranslateX() + roi.getX()),
-                    (int) (g2d.getTransform().getTranslateY() + roi.getY()),
+                    (int) roi.getX(),
+                    (int) roi.getY(),
                     (int) roi.getWidth(), (int) roi.getHeight(),
                     0, 0
             );
@@ -155,11 +155,9 @@
                     (int) roi.getWidth(), (int) roi.getHeight(),
                     ~(0L), // All bits set to 1, should be same as XAllPlanes() result
                     X11Defs.ZPixmap,
-                    xImage,
-                    (int) (roi.getX()),
-                    (int) (roi.getY())
+                    xImage, 0, 0
             );
-
+            x11.XFreePixmap(g2d.display, pixmap);
             lastSnapshot = XVolatileImage.biFromXImage(xImage, g2d.xConfig);
 
             // Cleanup
@@ -167,16 +165,15 @@
         } else {
             lastSnapshot = g2d.xConfig.createCompatibleImage(width, height);
         }
+
         return lastSnapshot.getRaster();
     }
 
-    void putImage(MultiRectArea clip) {
+    void putImage(MultiRectArea clip, int x, int y, int width, int height) {
         putImage(
                 clip,
                 lastSnapshot.getRaster(),
-                (int) g2d.getTransform().getTranslateX(),
-                (int) g2d.getTransform().getTranslateY(),
-                width, height
+                x, y, width, height 
         );
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/geom/AreaTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/geom/AreaTest.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/geom/AreaTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/test/api/java/common/java/awt/geom/AreaTest.java Mon Aug 27 03:43:59 2007
@@ -174,6 +174,24 @@
          checkPathRule(path, PathIterator.WIND_EVEN_ODD);
          checkPathDone(path, true);
      }
+     
+     public void testSubtract() {
+         // Regression test HARMONY-4410
+ 		Rectangle2D rect1 = new Rectangle2D.Double(300, 300, 200, 150);
+		Rectangle2D rect2 = new Rectangle2D.Double(350, 200, 300, 150);
+
+		Area area1 = new Area(rect1);
+		Area area2 = new Area(rect2);
+
+		Area a = (Area) area1.clone();
+		a.intersect(area2);
+		area1.add(area2);
+		area1.subtract(a);
+		
+		assertFalse(area1.contains(375, 325));
+		assertTrue(area1.contains(600, 300));
+		assertTrue(area1.contains(325, 325));
+     }
 
     public static void main(String[] args) {
         junit.textui.TestRunner.run(AreaTest.class);

Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java Mon Aug 27 03:43:59 2007
@@ -218,7 +218,7 @@
         String eventTypeName = prepareEventTypeName(eventSetName);
 
         if (params.length > 0) {
-            firstParamTypeName = BeanInfoImpl.extractShortClassName(params[0]
+            firstParamTypeName = extractShortClassName(params[0]
                     .getName());
         }
 
@@ -227,6 +227,17 @@
             throw new IntrospectionException(Messages.getString("beans.51", //$NON-NLS-1$
                     listenerMethod.getName(), eventTypeName));
         }
+    }
+
+    /**
+     * @param fullClassName full name of the class
+     * @return name with package and encapsulating class info omitted 
+     */
+    static String extractShortClassName(String fullClassName) {
+        int k = fullClassName.lastIndexOf('$');
+        
+        k = (k == -1 ? fullClassName.lastIndexOf('.') : k);
+        return fullClassName.substring(k + 1);
     }
 
     private static String prepareEventTypeName(String eventSetName) {

Modified: harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/Logger.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/Logger.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/Logger.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/Logger.java Mon Aug 27 03:43:59 2007
@@ -446,9 +446,12 @@
                     if (null == handlerStr) {
                         return;
                     }
-                    StringTokenizer st = new StringTokenizer(handlerStr, " "); //$NON-NLS-1$
-                    while (st.hasMoreTokens()) {
-                        String handlerName = st.nextToken();
+                    String[] strs = handlerStr.split(",|\\s");
+                    for (int i = 0; i < strs.length; i++) {
+                        String handlerName = strs[i];
+                        if (handlerName.equals("")){
+                            continue;
+                        }
                         Handler handler = (Handler) LogManager
                                 .getInstanceByClass(handlerName);
                         handlers.add(handler);

Modified: harmony/enhanced/classlib/branches/java6/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java Mon Aug 27 03:43:59 2007
@@ -17,6 +17,8 @@
 
 package org.apache.harmony.logging.tests.java.util.logging;
 
+import java.io.File;
+import java.io.FileInputStream;
 import java.security.Permission;
 import java.util.Locale;
 import java.util.MissingResourceException;
@@ -50,6 +52,8 @@
 	private final static String VALID_RESOURCE_BUNDLE3 = "bundles/java/util/logging/res3";
 
 	private final static String INVALID_RESOURCE_BUNDLE = "impossible_not_existing";
+    
+    private final static String LOGGING_CONFIG_FILE= "src/test/resources/config/java/util/logging/logging.config";
 
 	private final static String VALID_KEY = "LOGGERTEST";
 
@@ -3451,6 +3455,20 @@
         } finally {
             System.setSecurityManager(originalSecurityManager);
         }
+    }
+    
+    /*
+     * test initHandler
+     */
+    public void test_initHandler() throws Exception {
+        File logProps = new File(LOGGING_CONFIG_FILE);
+        LogManager lm = LogManager.getLogManager();
+        lm.readConfiguration(new FileInputStream(logProps));
+
+        Logger log = Logger.getLogger("");
+        // can log properly
+        Handler[] handlers = log.getHandlers();
+        assertEquals(2, handlers.length);
     }
 
 	/*

Modified: harmony/enhanced/classlib/branches/java6/modules/logging/src/test/resources/config/java/util/logging/logging.config
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/logging/src/test/resources/config/java/util/logging/logging.config?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/logging/src/test/resources/config/java/util/logging/logging.config (original)
+++ harmony/enhanced/classlib/branches/java6/modules/logging/src/test/resources/config/java/util/logging/logging.config Mon Aug 27 03:43:59 2007
@@ -1,3 +1,3 @@
-handlers=org.apache.harmony.logging.tests.java.util.logging.LogManagerTest$MockHandler java.util.logging.ConsoleHandler
+handlers=org.apache.harmony.logging.tests.java.util.logging.LogManagerTest$MockHandler ,  java.util.logging.ConsoleHandler
 .level=ALL
 org.apache.harmony.logging.tests.java.util.logging.LogManagerTest$MockHandler.level=OFF

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/File.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/File.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/File.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/File.java Mon Aug 27 03:43:59 2007
@@ -21,6 +21,7 @@
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.security.AccessController;
+import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -1310,7 +1311,7 @@
 
     private static File genTempFile(String prefix, String suffix, File directory) {
         if (counter == 0) {
-            int newInt = new java.util.Random().nextInt();
+            int newInt = new SecureRandom().nextInt();
             counter = ((newInt / 65535) & 0xFFFF) + 0x2710;
         }
         StringBuilder newName = new StringBuilder();

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectInputStream.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectInputStream.java Mon Aug 27 03:43:59 2007
@@ -1618,9 +1618,7 @@
         Integer oldHandle = descriptorHandle;
         descriptorHandle = Integer.valueOf(nextHandle());
         classDesc = readClassDescriptor();
-        if (descriptorHandle != null) {
-            registerObjectRead(classDesc, descriptorHandle, false);
-        }
+        registerObjectRead(classDesc, descriptorHandle, false);
         descriptorHandle = oldHandle;
         primitiveData = emptyStream;
         classDesc.setClass(resolveClass(classDesc));
@@ -1700,9 +1698,7 @@
         Integer oldHandle = descriptorHandle;
         descriptorHandle = Integer.valueOf(nextHandle());
         ObjectStreamClass newClassDesc = readClassDescriptor();
-        if (descriptorHandle != null) {
-            registerObjectRead(newClassDesc, descriptorHandle, unshared);
-        }
+        registerObjectRead(newClassDesc, descriptorHandle, unshared);
         descriptorHandle = oldHandle;
         primitiveData = emptyStream;
 
@@ -1792,7 +1788,6 @@
         descriptorHandle = (null == descriptorHandle ? Integer
                 .valueOf(nextHandle()) : descriptorHandle);
         registerObjectRead(newClassDesc, descriptorHandle, false);
-        descriptorHandle = null;
 
         readFieldDescriptors(newClassDesc);
         return newClassDesc;

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectStreamClass.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectStreamClass.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectStreamClass.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/ObjectStreamClass.java Mon Aug 27 03:43:59 2007
@@ -232,6 +232,23 @@
             result.setFields(new ObjectStreamField[0]);
         }
 
+        // Copy all fields to loadFields - they should be read by default in
+        // ObjectInputStream.defaultReadObject() method
+        ObjectStreamField[] fields = result.getFields();
+    
+        if (fields != null) {
+            ObjectStreamField[] loadFields = new ObjectStreamField[fields.length];
+
+            for (int i = 0; i < fields.length; ++i) {
+                loadFields[i] = new ObjectStreamField(fields[i].getName(),
+                        fields[i].getType(), fields[i].isUnshared());
+
+                // resolve type string to init typeString field in ObjectStreamField
+                loadFields[i].getTypeString();
+            }
+            result.setLoadFields(loadFields);
+        }
+
         byte flags = 0;
         boolean externalizable = isExternalizable(cl);
         if (externalizable) {

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Character.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Character.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Character.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Character.java Mon Aug 27 03:43:59 2007
@@ -1815,7 +1815,7 @@
             int mid = -1;
             int high = BLOCKS.length - 1;
             while (low <= high) {
-                mid = (low + high) >> 1;
+                mid = (low + high) >>> 1;
                 UnicodeBlock block = BLOCKS[mid];
                 if (codePoint > block.end) {
                     low = mid + 1;

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Arrays.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Arrays.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Arrays.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Arrays.java Mon Aug 27 03:43:59 2007
@@ -341,7 +341,7 @@
         checkIndexForBinarySearch(array.length, startIndex, endIndex);
         int low = startIndex, mid = -1, high = endIndex - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (value > array[mid]) {
                 low = mid + 1;
             } else if (value == array[mid]) {
@@ -382,7 +382,7 @@
         checkIndexForBinarySearch(array.length, startIndex, endIndex);
         int low = startIndex, mid = -1, high = endIndex - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (value > array[mid]) {
                 low = mid + 1;
             } else if (value == array[mid]) {
@@ -424,7 +424,7 @@
         long longBits = Double.doubleToLongBits(value);
         int low = startIndex, mid = -1, high = endIndex - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (lessThan(array[mid], value)) {
                 low = mid + 1;
             } else if (longBits == Double.doubleToLongBits(array[mid])) {
@@ -466,7 +466,7 @@
         int intBits = Float.floatToIntBits(value);
         int low = startIndex, mid = -1, high = endIndex - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (lessThan(array[mid], value)) {
                 low = mid + 1;
             } else if (intBits == Float.floatToIntBits(array[mid])) {
@@ -507,7 +507,7 @@
         checkIndexForBinarySearch(array.length, startIndex, endIndex);
         int low = startIndex, mid = -1, high = endIndex - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (value > array[mid]) {
                 low = mid + 1;
             } else if (value == array[mid]) {
@@ -548,7 +548,7 @@
         checkIndexForBinarySearch(array.length, startIndex, endIndex);
         int low = startIndex, mid = -1, high = endIndex - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (value > array[mid]) {
                 low = mid + 1;
             } else if (value == array[mid]) {
@@ -597,7 +597,7 @@
         Comparable<Object> key = (Comparable<Object>) object;
         int low = startIndex, mid = 0, high = endIndex - 1, result = 0;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if ((result = key.compareTo(array[mid])) > 0) {
                 low = mid + 1;
             } else if (result == 0) {
@@ -646,7 +646,7 @@
 
         int low = startIndex, mid = 0, high = endIndex - 1, result = 0;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if ((result = comparator.compare(array[mid], object)) < 0) {
                 low = mid + 1;
             } else if (result == 0) {
@@ -684,7 +684,7 @@
         checkIndexForBinarySearch(array.length, startIndex, endIndex);
         int low = startIndex, mid = -1, high = endIndex - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (value > array[mid]) {
                 low = mid + 1;
             } else if (value == array[mid]) {
@@ -2695,7 +2695,7 @@
             }
             return;
         }
-        int med = (end + start) >> 1;
+        int med = (end + start) >>> 1;
         mergeSort(out, in, start, med);
         mergeSort(out, in, med, end);
 
@@ -2777,7 +2777,7 @@
             }
             return;
         }
-        int med = (end + start) >> 1;
+        int med = (end + start) >>> 1;
         mergeSort(out, in, start, med, c);
         mergeSort(out, in, med, end, c);
 
@@ -2859,7 +2859,7 @@
             d <<= 1;
         }
         while (l <= r) {
-            m = (l + r) >> 1;
+            m = (l + r) >>> 1;
             if (val.compareTo(arr[m]) > bnd) {
                 l = m + 1;
             } else {
@@ -2905,7 +2905,7 @@
             d <<= 1;
         }
         while (l <= r) {
-            m = (l + r) >> 1;
+            m = (l + r) >>> 1;
             if (c.compare(val, arr[m]) > bnd) {
                 l = m + 1;
             } else {

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/LinkedHashMap.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/LinkedHashMap.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/LinkedHashMap.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/LinkedHashMap.java Mon Aug 27 03:43:59 2007
@@ -17,17 +17,19 @@
 
 package java.util;
 
-
 /**
- * LinkedHashMap is a variant on HashMap. Its entries are kept in a doubly-linked list.
- * The iteration order is, by default, the order in which keys were inserted.
- * <p> 
- * If the three argument constructor is used, and <code>order</code> is specified as <code>true</code>, 
- * the iteration would be in the order that entries were accessed. The access order gets 
- * affected by put(), get(), putAll() operations, but not by operations on the collection views.
+ * LinkedHashMap is a variant on HashMap. Its entries are kept in a
+ * doubly-linked list. The iteration order is, by default, the order in which
+ * keys were inserted.
+ * <p>
+ * If the three argument constructor is used, and <code>order</code> is
+ * specified as <code>true</code>, the iteration would be in the order that
+ * entries were accessed. The access order gets affected by put(), get(),
+ * putAll() operations, but not by operations on the collection views.
  * <p>
  * Null elements are allowed, and all the optional Map operations are supported.
  * <p>
+ * 
  * @since 1.4
  */
 public class LinkedHashMap<K, V> extends HashMap<K, V> {
@@ -105,8 +107,10 @@
         putAll(m);
     }
 
-    static final class LinkedHashIterator<E, KT, VT> extends HashMapIterator<E, KT, VT> {
-        LinkedHashIterator(MapEntry.Type<E, KT, VT> value, LinkedHashMap<KT, VT> hm) {
+    static final class LinkedHashIterator<E, KT, VT> extends
+            HashMapIterator<E, KT, VT> {
+        LinkedHashIterator(MapEntry.Type<E, KT, VT> value,
+                LinkedHashMap<KT, VT> hm) {
             super(value, hm);
             entry = hm.head;
         }
@@ -124,7 +128,7 @@
             }
             E result = type.get(entry);
             lastEntry = entry;
-            entry = ((LinkedHashMapEntry<KT, VT>)entry).chainForward;
+            entry = ((LinkedHashMapEntry<KT, VT>) entry).chainForward;
             canRemove = true;
             return result;
         }
@@ -139,7 +143,9 @@
             canRemove = false;
             associatedMap.modCount++;
 
-            int index = (lastEntry.key == null)? 0 : (lastEntry.key.hashCode() & 0x7FFFFFFF) % associatedMap.elementData.length;
+            int index = (lastEntry.key == null) ? 0
+                    : (lastEntry.key.hashCode() & 0x7FFFFFFF)
+                            % associatedMap.elementData.length;
             LinkedHashMapEntry<KT, VT> m = (LinkedHashMapEntry<KT, VT>) associatedMap.elementData[index];
             if (m == lastEntry) {
                 associatedMap.elementData[index] = lastEntry.next;
@@ -177,18 +183,20 @@
         }
     }
 
-    static final class LinkedHashMapEntrySet<KT, VT> extends HashMapEntrySet<KT, VT> {
+    static final class LinkedHashMapEntrySet<KT, VT> extends
+            HashMapEntrySet<KT, VT> {
         public LinkedHashMapEntrySet(LinkedHashMap<KT, VT> lhm) {
             super(lhm);
         }
 
         @Override
-        public Iterator<Map.Entry<KT,VT>> iterator() {
-            return new LinkedHashIterator<Map.Entry<KT,VT>,KT,VT>(new MapEntry.Type<Map.Entry<KT,VT>, KT, VT>() {
-                public Map.Entry<KT,VT> get(MapEntry<KT,VT> entry) {
-                    return entry;
-                }
-            }, (LinkedHashMap<KT, VT>) hashMap());
+        public Iterator<Map.Entry<KT, VT>> iterator() {
+            return new LinkedHashIterator<Map.Entry<KT, VT>, KT, VT>(
+                    new MapEntry.Type<Map.Entry<KT, VT>, KT, VT>() {
+                        public Map.Entry<KT, VT> get(MapEntry<KT, VT> entry) {
+                            return entry;
+                        }
+                    }, (LinkedHashMap<KT, VT>) hashMap());
         }
     }
 
@@ -207,11 +215,11 @@
             chainBackward = null;
         }
 
-
         @Override
         @SuppressWarnings("unchecked")
         public Object clone() {
-            LinkedHashMapEntry<K, V> entry = (LinkedHashMapEntry<K, V>) super.clone();
+            LinkedHashMapEntry<K, V> entry = (LinkedHashMapEntry<K, V>) super
+                    .clone();
             entry.chainBackward = chainBackward;
             entry.chainForward = chainForward;
             LinkedHashMapEntry<K, V> lnext = (LinkedHashMapEntry<K, V>) entry.next;
@@ -221,7 +229,7 @@
             return entry;
         }
     }
-    
+
     /**
      * Searches this map for the specified value.
      * 
@@ -274,11 +282,11 @@
     public V get(Object key) {
         LinkedHashMapEntry<K, V> m;
         if (key == null) {
-            m = (LinkedHashMapEntry<K, V>)findNullKeyEntry();
+            m = (LinkedHashMapEntry<K, V>) findNullKeyEntry();
         } else {
             int hash = key.hashCode();
             int index = (hash & 0x7FFFFFFF) % elementData.length;
-            m = (LinkedHashMapEntry<K, V>)findNonNullKeyEntry(key, index, hash);
+            m = (LinkedHashMapEntry<K, V>) findNonNullKeyEntry(key, index, hash);
         }
         if (m == null) {
             return null;
@@ -312,7 +320,7 @@
         return m;
     }
 
-    Entry<K,V> createHashedEntry(K key, int index, int hash) {
+    Entry<K, V> createHashedEntry(K key, int index, int hash) {
         LinkedHashMapEntry<K, V> m = new LinkedHashMapEntry<K, V>(key, hash);
         m.next = elementData[index];
         elementData[index] = m;
@@ -332,7 +340,7 @@
      */
     @Override
     public V put(K key, V value) {
-        V result = putImpl(key,value);
+        V result = putImpl(key, value);
 
         if (removeEldestEntry(head)) {
             remove(head.key);
@@ -340,38 +348,38 @@
 
         return result;
     }
-    
-    V putImpl(K key, V value){
+
+    V putImpl(K key, V value) {
         LinkedHashMapEntry<K, V> m;
-        if (elementCount == 0){
+        if (elementCount == 0) {
             head = tail = null;
         }
         if (key == null) {
-            m = (LinkedHashMapEntry<K, V>)findNullKeyEntry();
+            m = (LinkedHashMapEntry<K, V>) findNullKeyEntry();
             if (m == null) {
                 modCount++;
-                // Check if we need to remove the oldest entry
-                // The check includes accessOrder since an accessOrder LinkedHashMap
-                // does not record
-                // the oldest member in 'head'.
+                // Check if we need to remove the oldest entry. The check
+                // includes accessOrder since an accessOrder LinkedHashMap does
+                // not record the oldest member in 'head'.
                 if (++elementCount > threshold) {
                     rehash();
                 }
-                    m = (LinkedHashMapEntry<K, V>) createHashedEntry(key, 0, 0);
+                m = (LinkedHashMapEntry<K, V>) createHashedEntry(null, 0, 0);
             } else {
                 linkEntry(m);
             }
         } else {
             int hash = key.hashCode();
             int index = (hash & 0x7FFFFFFF) % elementData.length;
-            m = (LinkedHashMapEntry<K, V>)findNonNullKeyEntry(key, index, hash);
-            if (m == null) {                
+            m = (LinkedHashMapEntry<K, V>) findNonNullKeyEntry(key, index, hash);
+            if (m == null) {
                 modCount++;
                 if (++elementCount > threshold) {
                     rehash();
                     index = (hash & 0x7FFFFFFF) % elementData.length;
                 }
-                m = (LinkedHashMapEntry<K, V>) createHashedEntry(key, index, hash);
+                m = (LinkedHashMapEntry<K, V>) createHashedEntry(key, index,
+                        hash);
             } else {
                 linkEntry(m);
             }
@@ -435,7 +443,6 @@
             tail.chainForward = m;
             tail = m;
         }
-
     }
 
     /**
@@ -487,11 +494,12 @@
 
                 @Override
                 public Iterator<K> iterator() {
-                    return new LinkedHashIterator<K,K,V>(new MapEntry.Type<K,K,V>() {
-                        public K get(MapEntry<K,V> entry) {
-                            return entry.key;
-                        }
-                    }, LinkedHashMap.this);
+                    return new LinkedHashIterator<K, K, V>(
+                            new MapEntry.Type<K, K, V>() {
+                                public K get(MapEntry<K, V> entry) {
+                                    return entry.key;
+                                }
+                            }, LinkedHashMap.this);
                 }
             };
         }
@@ -526,11 +534,12 @@
 
                 @Override
                 public Iterator<V> iterator() {
-                    return new LinkedHashIterator<V,K,V>(new MapEntry.Type<V,K,V>() {
-                        public V get(MapEntry<K,V> entry) {
-                            return entry.value;
-                        }
-                    }, LinkedHashMap.this);
+                    return new LinkedHashIterator<V, K, V>(
+                            new MapEntry.Type<V, K, V>() {
+                                public V get(MapEntry<K, V> entry) {
+                                    return entry.value;
+                                }
+                            }, LinkedHashMap.this);
                 }
             };
         }
@@ -575,7 +584,7 @@
      * @param eldest
      * @return true if the eldest member should be removed
      */
-    protected boolean removeEldestEntry(Map.Entry<K,V> eldest) {
+    protected boolean removeEldestEntry(Map.Entry<K, V> eldest) {
         return false;
     }
 
@@ -590,5 +599,4 @@
         super.clear();
         head = tail = null;
     }
-
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Locale.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Locale.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Locale.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Locale.java Mon Aug 27 03:43:59 2007
@@ -46,7 +46,7 @@
 	
 	private static final long serialVersionUID = 9149081749638150636L;
 
-	private static Locale[] availableLocales;
+	private static volatile Locale[] availableLocales;
 
 	// Initialize a default which is used during static
 	// initialization of the default for the platform.

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java Mon Aug 27 03:43:59 2007
@@ -122,7 +122,12 @@
 	 * @throws OutOfMemoryError
 	 *             if the request cannot be satisfied.
 	 */
-	public native long malloc(long length) throws OutOfMemoryError;
+	public long malloc(long length) throws OutOfMemoryError
+    {
+        OSResourcesMonitor.ensurePhysicalMemoryCapacity();
+        return mallocNative(length);  
+    }
+    private native long mallocNative(long length) throws OutOfMemoryError;
 
 	/**
 	 * Deallocates space for a memory block that was previously allocated by a

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemory.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemory.c?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemory.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemory.c Mon Aug 27 03:43:59 2007
@@ -29,7 +29,7 @@
 #include "IMemorySystem.h"
 #include "exceptions.h"
 
-JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSMemory_malloc
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSMemory_mallocNative
   (JNIEnv * env, jobject thiz, jlong size)
 {
   PORT_ACCESS_FROM_ENV (env);

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemory.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemory.h?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemory.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemory.h Mon Aug 27 03:43:59 2007
@@ -43,10 +43,10 @@
     (JNIEnv *, jclass);
 /*
  * Class:     org_apache_harmony_luni_platform_OSMemory
- * Method:    malloc
+ * Method:    mallocNative
  * Signature: (J)J
  */
-  JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSMemory_malloc
+  JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSMemory_mallocNative
     (JNIEnv *, jobject, jlong);
 /*
  * Class:     org_apache_harmony_luni_platform_OSMemory

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/exports.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/exports.txt?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/exports.txt (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/exports.txt Mon Aug 27 03:43:59 2007
@@ -190,7 +190,7 @@
 Java_org_apache_harmony_luni_platform_OSMemory_getPointerSizeImpl
 Java_org_apache_harmony_luni_platform_OSMemory_getAddress
 Java_org_apache_harmony_luni_platform_OSMemory_setAddress
-Java_org_apache_harmony_luni_platform_OSMemory_malloc
+Java_org_apache_harmony_luni_platform_OSMemory_mallocNative
 Java_org_apache_harmony_luni_platform_OSMemory_free
 Java_org_apache_harmony_luni_platform_OSMemory_memmove
 Java_org_apache_harmony_luni_platform_OSMemory_memset
@@ -258,6 +258,7 @@
 Java_org_apache_harmony_luni_platform_OSNetworkSystem_isReachableByICMPImpl
 Java_org_apache_harmony_luni_platform_OSNetworkSystem_inheritedChannelImpl
 Java_org_apache_harmony_luni_platform_OSNetworkSystem_oneTimeInitializationImpl
+Java_org_apache_harmony_luni_platform_OSResourcesMonitor_isSystemPhysicalMemoryLow
 Java_org_apache_harmony_luni_platform_Environment_getEnvBytes
 Java_org_apache_harmony_luni_platform_Environment_getEnvByName
 Java_java_io_File_setExecutableImpl

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/makefile?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/makefile Mon Aug 27 03:43:59 2007
@@ -34,7 +34,7 @@
 	$(SHAREDSUB)filedesc.o $(SHAREDSUB)timezone.o \
 	$(SHAREDSUB)OSFileSystem.o OSFileSystemLinux32.o \
 	OSMemory.o OSMemoryLinux32.o $(SHAREDSUB)OSNetworkSystem.o \
-	OSNetworkSystemLinux.o hyenv.o
+	OSNetworkSystemLinux.o OSResourcesMonitorLinux.o hyenv.o 
 
 ifneq ($(HY_ZIP_API),true)
 MDLLIBFILES += $(LIBPATH)libhyzip.a $(DLLPATH)libhyzlib$(HY_LINKLIB_SUFFIX)

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSMemory.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSMemory.c?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSMemory.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSMemory.c Mon Aug 27 03:43:59 2007
@@ -24,7 +24,7 @@
 #include "IMemorySystem.h"
 #include "exceptions.h"
 
-JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSMemory_malloc
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSMemory_mallocNative
   (JNIEnv * env, jobject thiz, jlong size)
 {
   PORT_ACCESS_FROM_ENV (env);

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSMemory.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSMemory.h?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSMemory.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSMemory.h Mon Aug 27 03:43:59 2007
@@ -41,10 +41,10 @@
     (JNIEnv *, jclass);
 /*
  * Class:     org_apache_harmony_luni_platform_OSMemory
- * Method:    malloc
+ * Method:    mallocNative
  * Signature: (J)J
  */
-  JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSMemory_malloc
+  JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSMemory_mallocNative
     (JNIEnv *, jobject, jlong);
 /*
  * Class:     org_apache_harmony_luni_platform_OSMemory

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/makefile?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/makefile Mon Aug 27 03:43:59 2007
@@ -37,7 +37,8 @@
   $(SHAREDSUB)filedesc.obj $(SHAREDSUB)timezone.obj \
   OSFileSystemWin32.obj hyenv.obj\
   $(SHAREDSUB)OSFileSystem.obj OSMemoryWin32.obj OSMemory.obj \
-  $(SHAREDSUB)OSNetworkSystem.obj OSNetworkSystemWin32.obj
+  $(SHAREDSUB)OSNetworkSystem.obj OSNetworkSystemWin32.obj \
+  OSResourcesMonitorWin32.obj
 
 VIRTFILES = hyluni.res
 

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectInputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectInputStreamTest.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectInputStreamTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectInputStreamTest.java Mon Aug 27 03:43:59 2007
@@ -32,12 +32,15 @@
 import java.io.ObjectOutputStream;
 import java.io.ObjectStreamClass;
 import java.io.OutputStream;
+import java.io.PipedInputStream;
+import java.io.PipedOutputStream;
 import java.io.Serializable;
 import java.io.SerializablePermission;
 import java.io.StreamCorruptedException;
 import java.security.Permission;
 import java.util.Arrays;
 import java.util.Hashtable;
+import java.util.HashMap;
 import java.util.Vector;
 
 import org.apache.harmony.testframework.serialization.SerializationTest;
@@ -711,8 +714,7 @@
 		Object obj = ois.readObject();
 		ois.close();
 		assertEquals(cls, obj);
-	}
-        
+	} 
 
 	// Regression Test for JIRA-2340
     public static class ObjectOutputStreamWithWriteDesc1 extends
@@ -921,6 +923,59 @@
         public void setCorrupt(boolean corrupt) {
             this.corrupt = corrupt;
         }
+    }
+
+    public static class ObjectIutputStreamWithReadDesc2 extends
+            ObjectInputStream {
+        private Class returnClass;
+
+        public ObjectIutputStreamWithReadDesc2(InputStream is, Class returnClass)
+                throws IOException {
+            super(is);
+            this.returnClass = returnClass;
+        }
+
+        public ObjectStreamClass readClassDescriptor() throws IOException,
+                ClassNotFoundException {
+            ObjectStreamClass osc = super.readClassDescriptor();
+
+            if (osc.getName().equals(returnClass.getName())) {
+                return ObjectStreamClass.lookup(returnClass);
+            }
+            return osc;
+        }
+    }
+
+    /*
+     * Testing classDescriptor replacement with the value generated by
+     * ObjectStreamClass.lookup() method.
+     * Regression test for HARMONY-4638
+     */
+    public void test_readClassDescriptor_1() throws IOException, ClassNotFoundException {
+        A a = new A();
+        a.name = "It's a test";
+        PipedOutputStream pout = new PipedOutputStream();
+        PipedInputStream pin = new PipedInputStream(pout);
+        ObjectOutputStream out = new ObjectOutputStream(pout);
+        ObjectInputStream in = new ObjectIutputStreamWithReadDesc2(pin, A.class);
+
+        // test single object
+        out.writeObject(a);
+        A a1 = (A) in.readObject();
+        assertEquals("Single case: incorrectly read the field of A", a.name, a1.name);
+
+        // test cyclic reference
+        HashMap m = new HashMap();
+        a = new A();
+        a.name = "It's a test 0";
+        a1 = new A();
+        a1.name = "It's a test 1";
+        m.put("0", a);
+        m.put("1", a1);
+        out.writeObject(m);
+        HashMap m1 = (HashMap) in.readObject();
+        assertEquals("Incorrectly read the field of A", a.name, ((A) m1.get("0")).name);
+        assertEquals("Incorrectly read the field of A1", a1.name, ((A) m1.get("1")).name);
     }
 
     public void test_registerValidation() throws Exception {

Modified: harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigDecimal.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigDecimal.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigDecimal.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigDecimal.java Mon Aug 27 03:43:59 2007
@@ -1314,7 +1314,7 @@
         long newScale = scale;
 
         if (isZero()) {
-            return this;
+            return new BigDecimal("0");
         }
         BigInteger strippedBI = getUnscaledValue();
         BigInteger[] quotAndRem;

Modified: harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigInteger.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigInteger.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigInteger.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigInteger.java Mon Aug 27 03:43:59 2007
@@ -247,7 +247,7 @@
         if (digits.length == 0) {
             sign = 0;
             numberLength = 1;
-            digits = new int[] { 0 };
+            this.digits = new int[] { 0 };
         } else {
             sign = signum;
             numberLength = digits.length;

Modified: harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/Logical.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/Logical.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/Logical.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/Logical.java Mon Aug 27 03:43:59 2007
@@ -224,12 +224,12 @@
     
     /** @see BigInteger#andNot(BigInteger) */
     static BigInteger andNot(BigInteger val, BigInteger that) {
-        if (val.sign == 0) {
-            return BigInteger.ZERO;
-        }
         if (that.sign == 0 ) {
             return val;
         }
+        if (val.sign == 0) {
+            return BigInteger.ZERO;
+        }
         if (val.equals(BigInteger.MINUS_ONE)) {
             return that.not();
         }
@@ -239,7 +239,7 @@
         
         //if val == that, return 0
         
-                    if (val.sign > 0) {
+       if (val.sign > 0) {
             if (that.sign > 0) {
                 return andNotPositive(val, that);
             } else {

Modified: harmony/enhanced/classlib/branches/java6/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/math/src/test/java/tests/api/java/math/BigDecimalTest.java Mon Aug 27 03:43:59 2007
@@ -894,4 +894,27 @@
         assertEquals(bd.doubleValue(), nbd.doubleValue(), 0.0);
         assertEquals(bd.toString(), nbd.toString());
     }
+	
+	/**
+	 * @tests java.math.BigDecimal#stripTrailingZero(long)
+	 */
+	public void test_stripTrailingZero() {
+		BigDecimal sixhundredtest = new BigDecimal("600.0");
+		assertTrue("stripTrailingZero failed for 600.0",
+				((sixhundredtest.stripTrailingZeros()).scale() == -2)
+				);
+		
+		/* Single digit, no trailing zero, odd number */
+		BigDecimal notrailingzerotest = new BigDecimal("1");
+		assertTrue("stripTrailingZero failed for 1",
+				((notrailingzerotest.stripTrailingZeros()).scale() == 0)
+				);
+		
+		/* Zero */
+        //regression for HARMONY-4623, NON-BUG DIFF with RI
+		BigDecimal zerotest = new BigDecimal("0.0000");
+		assertTrue("stripTrailingZero failed for 0.0000",
+				((zerotest.stripTrailingZeros()).scale() == 0)
+				);		
+	}	
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java?rev=570061&r1=570060&r2=570061&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/math/src/test/java/tests/api/java/math/BigIntegerTest.java Mon Aug 27 03:43:59 2007
@@ -857,6 +857,15 @@
 						(i1.testBit(i) && !i2.testBit(i)) == res.testBit(i));
             }
 		}
+        //regression for HARMONY-4653
+        try{
+            BigInteger.ZERO.andNot(null);
+            fail("should throw NPE");
+        }catch(Exception e){
+            //expected
+        }
+        BigInteger bi = new BigInteger(0, new byte[]{});
+        assertEquals(BigInteger.ZERO, bi.andNot(BigInteger.ZERO));
 	}
     
 



Mime
View raw message