You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2009/10/06 16:57:51 UTC
svn commit: r822302 [2/5] - in /harmony/enhanced/classlib/branches/java6: ./
depends/build/ depends/build/platform/ depends/files/
depends/libs/windows.x86/ depends/oss/ make/ modules/accessibility/
modules/annotation/ modules/annotation/make/ modules/...
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/build.xml?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/build.xml Tue Oct 6 14:57:42 2009
@@ -81,6 +81,13 @@
</javac>
</target>
+ <target name="findbugs" depends="build-jar">
+ <run-findBugs
+ jarFile="${hy.jdk}/jre/lib/boot/beans.jar"
+ excludeFilter="make/findbugs-exclude-filter.xml"
+ outputFile="${findBugs.report}/beans.xml"/>
+ </target>
+
<target name="build-jar" depends="svn-info,class-patternset">
<jar destfile="${hy.jdk}/jre/lib/boot/beans.jar"
manifest="META-INF/MANIFEST.MF"
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/make/exclude.common
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/make/exclude.common?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/make/exclude.common (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/make/exclude.common Tue Oct 6 14:57:42 2009
@@ -1,3 +1,2 @@
org/apache/harmony/beans/tests/java/beans/VetoableChangeSupportTest.java
-org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ArrayPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ArrayPersistenceDelegate.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ArrayPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ArrayPersistenceDelegate.java Tue Oct 6 14:57:42 2009
@@ -56,16 +56,36 @@
Object oldValue = Array.get(oldInstance, i);
Object newValue = Array.get(newInstance, i);
+ if (!deepEquals(oldValue, newValue)) {
+ Statement s = new Statement(oldInstance, "set", //$NON-NLS-1$
+ new Object[] { new Integer(i), oldValue });
+ out.writeStatement(s);
+ }
+ }
+ }
- if (oldValue != null && !oldValue.equals(newValue)
- || oldValue == null && newValue != null) {
- if (nullValue == null || !nullValue.equals(oldValue)) {
- Statement s = new Statement(oldInstance, "set", //$NON-NLS-1$
- new Object[] { new Integer(i), oldValue });
-
- out.writeStatement(s);
+ private boolean deepEquals(Object oldInstance, Object newInstance) {
+ if (oldInstance == newInstance) {
+ return true;
+ }
+ if (null == oldInstance || null == newInstance) {
+ return false;
+ }
+ // oldInstnace != newInstance
+ if (oldInstance.equals(newInstance)) {
+ return true;
+ } else if (oldInstance.getClass().isArray() && newInstance.getClass().isArray()) {
+ int length = Array.getLength(oldInstance);
+ for (int i = 0; i < length; ++i) {
+ Object oldValue = Array.get(oldInstance, i);
+ Object newValue = Array.get(newInstance, i);
+ if (!deepEquals(oldValue, newValue)) {
+ return false;
}
}
+ return true;
+ } else {
+ return false;
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java Tue Oct 6 14:57:42 2009
@@ -269,11 +269,15 @@
assertCodedXML(b, "/xml/MockBean4Codec_BornFriendChange.xml");
}
+ /* RI fails on this. Because even though we have change the class
+ eception, it does not occurred on the output. */
public void testWriteObject_ManyChanges() throws Exception {
assertCodedXML(MockBean4Codec.getInstanceOfManyChanges(),
"/xml/MockBean4Codec_ManyChanges.xml");
}
+ /* RI fails on this. Because even though we have change the class
+ eception, it does not occurred on the output. */
public void testWriteObject_ManyChanges_2() throws Exception {
assertCodedXML(MockBean4Codec.getInstanceOfManyChanges2(),
"/xml/MockBean4Codec_ManyChanges_2.xml");
@@ -308,6 +312,7 @@
}
+ /* TODO HARMONY fails on this test case
public void testWriteObject_StaticField() throws Exception {
ByteArrayOutputStream temp = new ByteArrayOutputStream();
XMLEncoder enc = new XMLEncoder(temp);
@@ -319,6 +324,7 @@
"/xml/MockBean4StaticField.xml", temp, enc);
}
+ */
public void testWriteObject_MockTreeMap() throws Exception {
Map<String, TreeMap<String, String>> innerTreeMap = new MockTreeMapClass();
@@ -440,15 +446,17 @@
refString = refString.replace("${classname}", obj.getClass().getName());
}
if (saxParserClassName == null) {
- saxParserClassName = "org.apache.xerces.parsers.SAXParser";
+ xmlReader = XMLReaderFactory.createXMLReader();
+ refXmlReader = XMLReaderFactory.createXMLReader();
+ } else {
+ xmlReader = XMLReaderFactory.createXMLReader(saxParserClassName);
+ refXmlReader = XMLReaderFactory.createXMLReader(saxParserClassName);
}
- xmlReader = XMLReaderFactory.createXMLReader(saxParserClassName);
xmlReader.setContentHandler(handler);
xmlReader.setErrorHandler(handler);
xmlReader.parse(new InputSource(xml));
- refXmlReader = XMLReaderFactory.createXMLReader(saxParserClassName);
refXmlReader.setContentHandler(refHandler);
refXmlReader.setErrorHandler(refHandler);
refXmlReader.parse(new InputSource(new StringReader(refString)));
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/resources/xml/MockBean4Codec_ManyChanges.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/resources/xml/MockBean4Codec_ManyChanges.xml?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/resources/xml/MockBean4Codec_ManyChanges.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/resources/xml/MockBean4Codec_ManyChanges.xml Tue Oct 6 14:57:42 2009
@@ -48,7 +48,7 @@
<float>12.34</float>
</void>
<void property="friend">
- <object class="${classname}">
+ <object class="${classname}" id="MockBean4Codec1">
<void property="clazz">
<class>${classname}</class>
</void>
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/resources/xml/MockBean4Codec_ManyChanges_2.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/resources/xml/MockBean4Codec_ManyChanges_2.xml?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/resources/xml/MockBean4Codec_ManyChanges_2.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/resources/xml/MockBean4Codec_ManyChanges_2.xml Tue Oct 6 14:57:42 2009
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<java version="${version}" class="java.beans.XMLDecoder">
- <object class="org.apache.harmony.beans.tests.java.beans.mock.MockBean4Codec">
+ <object class="${classname}">
<void property="bornFriend">
<void property="clazz">
<class>java.lang.Exception</class>
Modified: harmony/enhanced/classlib/branches/java6/modules/concurrent/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/concurrent/build.xml?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/concurrent/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/concurrent/build.xml Tue Oct 6 14:57:42 2009
@@ -81,6 +81,13 @@
</javac>
</target>
+ <target name="findbugs" depends="build-jar">
+ <run-findBugs
+ jarFile="${hy.jdk}/jre/lib/boot/concurrent.jar"
+ excludeFilter="make/findbugs-exclude-filter.xml"
+ outputFile="${findBugs.report}/concurrent.xml"/>
+ </target>
+
<target name="build-jar" depends="svn-info,class-patternset">
<jar destfile="${hy.jdk}/jre/lib/boot/concurrent.jar"
manifest="META-INF/MANIFEST.MF"
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/atomic/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/atomic:765923-814402
+/harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/atomic:765923-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/locks/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks:765923-814402
+/harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks:765923-822279
Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/build.xml?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/build.xml Tue Oct 6 14:57:42 2009
@@ -81,6 +81,13 @@
</javac>
</target>
+ <target name="findbugs" depends="build-jar">
+ <run-findBugs
+ jarFile="${hy.jdk}/jre/lib/boot/crypto.jar"
+ excludeFilter="make/findbugs-exclude-filter.xml"
+ outputFile="${findBugs.report}/crypto.xml"/>
+ </target>
+
<target name="build-jar" depends="svn-info,class-patternset">
<jar destfile="${hy.jdk}/jre/lib/boot/crypto.jar"
manifest="META-INF/MANIFEST.MF"
Modified: harmony/enhanced/classlib/branches/java6/modules/imageio/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/imageio/build.xml?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/imageio/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/imageio/build.xml Tue Oct 6 14:57:42 2009
@@ -154,40 +154,19 @@
<env key="HY_JPEG_VER" value="${jpeg.ver}" />
</make-elements>
</make>
- <!-- Copy the built shared libs over to the jre/bin dir -->
- <copy todir="${hy.jdk}/jre/bin" preservelastmodified="true">
- <fileset dir="src/main/native/jpegencoder/">
- <include name="*${shlib.suffix}*"/>
- <include name="*${progdb.suffix}*" if="is.windows" />
- <exclude name="*${manifest.suffix}"/>
- </fileset>
- </copy>
- <!-- Copy link exports file on z/OS -->
- <copy todir="${hy.hdk}/lib" preservelastmodified="true">
- <fileset dir="src/main/native/jpegencoder/${hy.os.family}">
- <include name="*${linklib.suffix}" if="is.zos" />
- </fileset>
- </copy>
<make dir="src/main/native/pngencoder/${hy.os.family}">
<make-elements>
<env key="HY_PNG_VER" value="${png.ver}" />
</make-elements>
</make>
- <!-- Copy the built shared libs over to the jre/bin dir -->
- <copy todir="${hy.jdk}/jre/bin" preservelastmodified="true">
- <fileset dir="src/main/native/pngencoder/">
- <include name="*${shlib.suffix}*"/>
- <include name="*${progdb.suffix}*" if="is.windows" />
- <exclude name="*${manifest.suffix}"/>
- </fileset>
- </copy>
- <!-- Copy link exports file on z/OS -->
- <copy todir="${hy.hdk}/lib" preservelastmodified="true">
- <fileset dir="src/main/native/pngencoder/${hy.os.family}">
- <include name="*${linklib.suffix}" if="is.zos" />
- </fileset>
- </copy>
+ </target>
+
+ <target name="findbugs" depends="build-jar">
+ <run-findBugs
+ jarFile="${hy.jdk}/jre/lib/boot/imageio.jar"
+ excludeFilter="make/findbugs-exclude-filter.xml"
+ outputFile="${findBugs.report}/imageio.xml"/>
</target>
<target name="build-jar" depends="svn-info,class-patternset">
Propchange: harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/jpegencoder/
('svn:ignore' removed)
Modified: harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/jpegencoder/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/jpegencoder/unix/makefile?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/jpegencoder/unix/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/jpegencoder/unix/makefile Tue Oct 6 14:57:42 2009
@@ -32,7 +32,7 @@
MDLLIBFILES += $(LIBPATH)libhypool.a \
$(LIBPATH)libvmi$(HY_LINKLIB_SUFFIX)
-DLLNAME=../libjpegencoder$(HY_SHLIB_SUFFIX)
+DLLNAME=$(DLLPATH)libjpegencoder$(HY_SHLIB_SUFFIX)
EXPNAME=HYJPEGENCODER_0.1
include $(HY_HDK)/build/make/rules.mk
Modified: harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/jpegencoder/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/jpegencoder/windows/makefile?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/jpegencoder/windows/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/jpegencoder/windows/makefile Tue Oct 6 14:57:42 2009
@@ -18,7 +18,7 @@
JPEG_DIR=$(HY_HDK)\..\depends\libs\$(HY_PLATFORM)\jpeg-$(HY_JPEG_VER)\# avoid continuation
LIBBASE=jpegencoder
-DLLNAME=..\$(LIBBASE).dll
+DLLNAME=$(DLLPATH)$(LIBBASE).dll
LIBNAME=$(LIBPATH)$(LIBBASE).lib
HYLDFLAGS = $(HYLDFLAGS) -def:$(LIBBASE).def
Propchange: harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/pngencoder/
('svn:ignore' removed)
Modified: harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/pngencoder/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/pngencoder/unix/makefile?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/pngencoder/unix/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/pngencoder/unix/makefile Tue Oct 6 14:57:42 2009
@@ -39,7 +39,7 @@
MDLLIBFILES += $(MDLLIBZLIB)
endif
-DLLNAME=../libpngencoder$(HY_SHLIB_SUFFIX)
+DLLNAME=$(DLLPATH)libpngencoder$(HY_SHLIB_SUFFIX)
EXPNAME=HYPNGENCODER_0.1
include $(HY_HDK)/build/make/rules.mk
Modified: harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/pngencoder/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/pngencoder/windows/makefile?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/pngencoder/windows/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/native/pngencoder/windows/makefile Tue Oct 6 14:57:42 2009
@@ -18,7 +18,7 @@
PNG_DIR=$(HY_HDK)\..\depends\libs\$(HY_PLATFORM)\png-$(HY_PNG_VER)\# avoid continuation
LIBBASE=pngencoder
-DLLNAME=..\$(LIBBASE).dll
+DLLNAME=$(DLLPATH)$(LIBBASE).dll
LIBNAME=$(LIBPATH)$(LIBBASE).lib
HYLDFLAGS = $(HYLDFLAGS) -def:$(LIBBASE).def
Modified: harmony/enhanced/classlib/branches/java6/modules/instrument/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/instrument/build.xml?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/instrument/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/instrument/build.xml Tue Oct 6 14:57:42 2009
@@ -47,21 +47,6 @@
<target name="build-native" depends="build-native-all" />
<target name="build-native-all" >
<make dir="src/main/native/instrument/${hy.os.family}" />
-
- <!-- Copy the built shared libs over to the jre/bin dir -->
- <copy todir="${hy.jdk}/jre/bin" preservelastmodified="true">
- <fileset dir="src/main/native/instrument">
- <include name="*${shlib.suffix}*" />
- <include name="*${progdb.suffix}*" if="is.windows" />
- <exclude name="*${manifest.suffix}*" />
- </fileset>
- </copy>
- <!-- Copy link exports file on z/OS -->
- <copy todir="${hy.hdk}/lib" preservelastmodified="true">
- <fileset dir="src/main/native/instrument/${hy.os.family}">
- <include name="*${linklib.suffix}" if="is.zos" />
- </fileset>
- </copy>
</target>
<target name="clean-java" depends="class-patternset">
@@ -106,6 +91,13 @@
</javac>
</target>
+ <target name="findbugs" depends="build-jar">
+ <run-findBugs
+ jarFile="${hy.jdk}/jre/lib/boot/instrument.jar"
+ excludeFilter="make/findbugs-exclude-filter.xml"
+ outputFile="${findBugs.report}/instrument.xml"/>
+ </target>
+
<target name="build-jar" depends="svn-info,class-patternset">
<jar destfile="${hy.jdk}/jre/lib/boot/instrument.jar"
manifest="META-INF/MANIFEST.MF"
Propchange: harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/
('svn:ignore' removed)
Modified: harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/unix/makefile?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/unix/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/unix/makefile Tue Oct 6 14:57:42 2009
@@ -30,7 +30,7 @@
$(LIBPATH)libhypool.a \
$(LIBPATH)libvmi$(HY_LINKLIB_SUFFIX)
-DLLNAME = ../libhyinstrument$(HY_SHLIB_SUFFIX)
+DLLNAME = $(DLLPATH)libhyinstrument$(HY_SHLIB_SUFFIX)
EXPNAME = HYINSTRUMENT_0.1
include $(HY_HDK)/build/make/rules.mk
Modified: harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/windows/makefile?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/windows/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/windows/makefile Tue Oct 6 14:57:42 2009
@@ -20,7 +20,7 @@
!include <$(HY_HDK)\build\make\defines.mak>
LIBBASE=hyinstrument
-DLLNAME=..\$(LIBBASE).dll
+DLLNAME=$(DLLPATH)$(LIBBASE).dll
LIBNAME=$(LIBPATH)$(LIBBASE).lib
HYCFLAGS = $(HYCFLAGS) /I$(SHAREDSUB) /I$(SHARED)common /I$(SHARED)fdlibm
HYLDFLAGS = $(HYLDFLAGS) -def:$(LIBBASE).def
Propchange: harmony/enhanced/classlib/branches/java6/modules/jmx/META-INF/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/jmx/META-INF:768152-814402
+/harmony/enhanced/classlib/trunk/modules/jmx/META-INF:768152-822279
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/build.xml?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/build.xml Tue Oct 6 14:57:42 2009
@@ -81,6 +81,13 @@
</javac>
</target>
+ <target name="findbugs" depends="build-jar">
+ <run-findBugs
+ jarFile="${hy.jdk}/jre/lib/boot/jndi.jar"
+ excludeFilter="make/findbugs-exclude-filter.xml"
+ outputFile="${findBugs.report}/jndi.xml"/>
+ </target>
+
<target name="build-jar" depends="svn-info,class-patternset">
<jar destfile="${hy.jdk}/jre/lib/boot/jndi.jar"
manifest="META-INF/MANIFEST.MF"
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/InitialContext.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/InitialContext.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/InitialContext.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/InitialContext.java Tue Oct 6 14:57:42 2009
@@ -271,8 +271,9 @@
// 4.2 Read "java.home"/lib/jndi.properties
if (libProperties == null) {
- libProperties = new Hashtable<Object, Object>();
- EnvironmentReader.readLibraryResourceFile(libProperties);
+ Hashtable<Object, Object> props = new Hashtable<Object, Object>();
+ EnvironmentReader.readLibraryResourceFile(props);
+ libProperties = props;
}
EnvironmentReader.mergeEnvironment(libProperties, myProps, true);
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/GenericURLContext.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/GenericURLContext.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/GenericURLContext.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/GenericURLContext.java Tue Oct 6 14:57:42 2009
@@ -768,18 +768,17 @@
if (next > length) {
// jndi.2B=Invalid URL format: {0}
- new IllegalArgumentException(Messages.getString(
+ throw new IllegalArgumentException(Messages.getString(
"jndi.2B", str)); //$NON-NLS-1$
- }
+ }
try {
bytes[index++] = (byte) Integer.parseInt(str.substring(i,
next), 16);
} catch (NumberFormatException e) {
- throw (IllegalArgumentException)
// jndi.2B=Invalid URL format: {0}
- new IllegalArgumentException(Messages.getString(
- "jndi.2B", str)).initCause(e); //$NON-NLS-1$
+ throw (IllegalArgumentException) new IllegalArgumentException(
+ Messages.getString("jndi.2B", str)).initCause(e); //$NON-NLS-1$
}
i = next;
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSContext.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSContext.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSContext.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/org/apache/harmony/jndi/provider/dns/DNSContext.java Tue Oct 6 14:57:42 2009
@@ -2061,6 +2061,16 @@
}
/**
+ * Returns the hash of the context.
+ *
+ * @return the hash code.
+ */
+ @Override
+ public int hashCode() {
+ return contextName.hashCode();
+ }
+
+ /**
* @param name
* composite name to process
* @return root context of the namespace to that the target object belongs
Modified: harmony/enhanced/classlib/branches/java6/modules/lang-management/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/lang-management/build.xml?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/lang-management/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/lang-management/build.xml Tue Oct 6 14:57:42 2009
@@ -81,6 +81,13 @@
</javac>
</target>
+ <target name="findbugs" depends="build-jar">
+ <run-findBugs
+ jarFile="${hy.jdk}/jre/lib/boot/lang-management.jar"
+ excludeFilter="make/findbugs-exclude-filter.xml"
+ outputFile="${findBugs.report}/lang-management.xml"/>
+ </target>
+
<target name="build-jar" depends="svn-info,class-patternset">
<jar destfile="${hy.jdk}/jre/lib/boot/lang-management.jar"
manifest="META-INF/MANIFEST.MF"
Propchange: harmony/enhanced/classlib/branches/java6/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/util/logging/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/util/logging:768152-814402
+/harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/util/logging:768152-822279
Modified: harmony/enhanced/classlib/branches/java6/modules/logging/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/logging/build.xml?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/logging/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/logging/build.xml Tue Oct 6 14:57:42 2009
@@ -81,6 +81,13 @@
</javac>
</target>
+ <target name="findbugs" depends="build-jar">
+ <run-findBugs
+ jarFile="${hy.jdk}/jre/lib/boot/logging.jar"
+ excludeFilter="make/findbugs-exclude-filter.xml"
+ outputFile="${findBugs.report}/logging.xml"/>
+ </target>
+
<target name="build-jar" depends="svn-info,class-patternset">
<jar destfile="${hy.jdk}/jre/lib/boot/logging.jar"
manifest="META-INF/MANIFEST.MF"
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/build.xml?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/build.xml Tue Oct 6 14:57:42 2009
@@ -93,19 +93,6 @@
<!-- Build luni dll -->
<make dir="src/main/native/luni/${hy.os.family}" />
- <copy todir="${hy.jdk}/jre/bin" preservelastmodified="true">
- <fileset dir="src/main/native/luni">
- <include name="*${shlib.suffix}*" />
- <include name="*${progdb.suffix}*" if="is.windows" />
- <exclude name="*${manifest.suffix}"/>
- </fileset>
- </copy>
- <!-- Copy link exports file on z/OS -->
- <copy todir="${hy.hdk}/lib" preservelastmodified="true">
- <fileset dir="src/main/native/luni/${hy.os.family}">
- <include name="*${linklib.suffix}" if="is.zos" />
- </fileset>
- </copy>
<!-- Build vmls lib -->
<make dir="src/main/native/vmls/${hy.os.family}" />
@@ -117,21 +104,8 @@
</target>
<target name="-build-native-secondary2" >
-
<!-- Build launcher executables -->
<make dir="src/main/native/launcher/${hy.os.family}" />
-
- <!-- Copy across the built executables -->
- <copy todir="${hy.jdk}/jre/bin" preservelastmodified="true">
- <fileset dir="src/main/native/launcher">
- <patternset includes="java${exe.suffix}" />
- <patternset includes="javaw${exe.suffix}" />
- <include name="*${progdb.suffix}*" if="is.windows" />
- </fileset>
- </copy>
-
- <!-- Make sure the Linux launcher has execute permission -->
- <chmod file="${hy.jdk}/jre/bin/java${exe.suffix}" perm="ugo+x" />
</target>
<!-- Overlay OSS packages into their required locations -->
@@ -247,6 +221,13 @@
</javac>
</target>
+ <target name="findbugs" depends="build-jar">
+ <run-findBugs
+ jarFile="${hy.jdk}/jre/lib/boot/luni.jar"
+ excludeFilter="make/findbugs-exclude-filter.xml"
+ outputFile="${findBugs.report}/luni.xml"/>
+ </target>
+
<target name="build-jar" depends="svn-info,class-patternset">
<jar destfile="${hy.jdk}/jre/lib/boot/luni.jar"
manifest="META-INF/MANIFEST.MF"
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/EmulatedFieldsForDumping.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/EmulatedFieldsForDumping.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/EmulatedFieldsForDumping.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/EmulatedFieldsForDumping.java Tue Oct 6 14:57:42 2009
@@ -192,7 +192,6 @@
*/
@Override
@Deprecated
- @SuppressWarnings("deprecation")
public void write(ObjectOutput output) throws IOException {
EmulatedFields.ObjectSlot[] slots = emulatedFields.slots();
for (int i = 0; i < slots.length; i++) {
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=822302&r1=822301&r2=822302&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 Tue Oct 6 14:57:42 2009
@@ -808,18 +808,31 @@
* Indicates if this file's pathname is absolute. Whether a pathname is
* absolute is platform specific. On UNIX, absolute paths must start with
* the character '/'; on Windows it is absolute if either it starts with
- * '\', '/', '\\' (to represent a file server), or a letter followed by a
- * colon.
+ * '\\' (to represent a file server), or a letter followed by a colon.
*
* @return {@code true} if this file's pathname is absolute, {@code false}
* otherwise.
* @see #getPath
*/
public boolean isAbsolute() {
- return isAbsoluteImpl(Util.getUTF8Bytes(path));
- }
+ if (File.separatorChar == '\\') {
+ // for windows
+ if (path.length() > 1 && path.charAt(0) == File.separatorChar
+ && path.charAt(1) == File.separatorChar) {
+ return true;
+ }
+ if (path.length() > 2) {
+ if (Character.isLetter(path.charAt(0)) && path.charAt(1) == ':'
+ && (path.charAt(2) == '/' || path.charAt(2) == '\\')) {
+ return true;
+ }
+ }
+ return false;
+ }
- private native boolean isAbsoluteImpl(byte[] filePath);
+ // for Linux
+ return (path.length() > 0 && path.charAt(0) == File.separatorChar);
+ }
/**
* Indicates if this file represents a <em>directory</em> on the
@@ -1464,8 +1477,9 @@
if (properPath != null) {
return properPath;
}
- byte[] pathBytes = Util.getUTF8Bytes(path);
- if (isAbsoluteImpl(pathBytes)) {
+
+ if (isAbsolute()) {
+ byte[] pathBytes = Util.getUTF8Bytes(path);
return properPath = pathBytes;
}
// Check security by getting user.dir when the path is not absolute
@@ -1505,8 +1519,6 @@
return properPath = Util.getUTF8Bytes(result);
}
- private static native byte[] properPathImpl(byte[] path);
-
/**
* Renames this file to the name represented by the {@code dest} file. This
* works for both normal files and directories.
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/FileInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/FileInputStream.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/FileInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/FileInputStream.java Tue Oct 6 14:57:42 2009
@@ -69,9 +69,14 @@
super();
SecurityManager security = System.getSecurityManager();
if (security != null) {
+ // For compatibility, nulls are passed to the manager.
String filePath = (null == file ? null : file.getPath());
security.checkRead(filePath);
}
+ if (file == null) {
+ // KA001=Argument must not be null
+ throw new NullPointerException(Msg.getString("KA001")); //$NON-NLS-1$
+ }
fd = new FileDescriptor();
fd.readOnly = true;
fd.descriptor = fileSystem.open(file.properPath(true),
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java Tue Oct 6 14:57:42 2009
@@ -211,11 +211,16 @@
}
long skipped = 0;
int toRead = n < 4096 ? (int) n : 4096;
- if (skipBuf == null || skipBuf.length < toRead) {
- skipBuf = new byte[toRead];
+ // We are unsynchronized, so take a local copy of the skipBuf at some
+ // point in time.
+ byte[] localBuf = skipBuf;
+ if (localBuf == null || localBuf.length < toRead) {
+ // May be lazily written back to the static. No matter if it
+ // overwrites somebody else's store.
+ skipBuf = localBuf = new byte[toRead];
}
while (skipped < n) {
- int read = read(skipBuf, 0, toRead);
+ int read = read(localBuf, 0, toRead);
if (read == -1) {
return skipped;
}
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Enum.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Enum.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Enum.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Enum.java Tue Oct 6 14:57:42 2009
@@ -25,7 +25,7 @@
/**
* The superclass of all enumerated types. Actual enumeration types inherit from
- * this class, but extending this class does not make a class an enumration
+ * this class, but extending this class does not make a class an enumeration
* type, since the compiler needs to generate special information for it.
*/
public abstract class Enum<E extends Enum<E>> implements Serializable,
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Integer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Integer.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Integer.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Integer.java Tue Oct 6 14:57:42 2009
@@ -501,7 +501,7 @@
int quot = positive_value;
do {
int res = quot / 10;
- int digit_value = quot - (res * 10);
+ int digit_value = quot - ((res << 3) + (res << 1));
digit_value += '0';
buffer[last_digit++] = (char) digit_value;
quot = res;
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Math.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Math.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Math.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/Math.java Tue Oct 6 14:57:42 2009
@@ -270,9 +270,7 @@
* the value whose closest integer value has to be computed.
* @return the ceiling of the argument.
*/
- public static double ceil(double d) {
- return -floor(-d);
- }
+ public static native double ceil(double d);
/**
* Returns the closest double approximation of the cosine of the argument.
@@ -372,13 +370,7 @@
* the value whose closest integer value has to be computed.
* @return the floor of the argument.
*/
- public static double floor(double d) {
- if (Double.isNaN(d) || Double.isInfinite(d) || d == 0) {
- return d;
- }
- double res = (long) d;
- return d > 0 || res == d ? res : res - 1;
- }
+ public static native double floor(double d);
/**
* Returns {@code sqrt(}<i>{@code x}</i><sup>{@code 2}</sup>{@code +} <i>
@@ -759,13 +751,7 @@
* the value to be rounded.
* @return the closest integer to the argument (as a double).
*/
- public static double rint(double d) {
- if (d == +0.0d || d == -0.0d) {
- return d;
- }
- double res = floor(d + 0.5d);
- return res - d == 0.5d && res % 2 != 0 ? res - 1 : res;
- }
+ public static native double rint(double d);
/**
* Returns the result of rounding the argument to an integer. The result is
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/SecurityManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/SecurityManager.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/SecurityManager.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/lang/SecurityManager.java Tue Oct 6 14:57:42 2009
@@ -405,9 +405,8 @@
.getSecurityProperty(property));
if (list != null) {
int plen = pkg.length();
- StringTokenizer tokenizer = new StringTokenizer(list, ", "); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String token = tokenizer.nextToken();
+ String[] tokens = list.split(", *"); //$NON-NLS-1$
+ for (String token : tokens) {
int tlen = token.length();
if (plen > tlen
&& pkg.startsWith(token)
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/InetAddress.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/InetAddress.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/InetAddress.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/InetAddress.java Tue Oct 6 14:57:42 2009
@@ -1368,6 +1368,10 @@
family = fields.get("family", 2); //$NON-NLS-1$
}
+ /*
+ * The spec requires that if we encounter a generic InetAddress in
+ * serialized form then we should interpret it as an Inet4 address.
+ */
private Object readResolve() throws ObjectStreamException {
return new Inet4Address(ipaddress, hostName);
}
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/JarURLConnection.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/JarURLConnection.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/JarURLConnection.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/JarURLConnection.java Tue Oct 6 14:57:42 2009
@@ -69,7 +69,7 @@
if ((sepIdx = file.indexOf("!/")) < 0) { //$NON-NLS-1$
throw new MalformedURLException();
}
- fileURL = new URL(url.getFile().substring(0,sepIdx)); //$NON-NLS-1$
+ fileURL = new URL(url.getFile().substring(0,sepIdx));
sepIdx += 2;
if (file.length() == sepIdx) {
return;
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/NetworkInterface.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/NetworkInterface.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/NetworkInterface.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/NetworkInterface.java Tue Oct 6 14:57:42 2009
@@ -373,67 +373,66 @@
* the object to compare with this instance.
* @return {@code true} if the specified object is equal to this {@code
* NetworkInterface}, {@code false} otherwise.
- * @see #hashCode
+ * @see #hashCode()
*/
@Override
public boolean equals(Object obj) {
- // just return true if it is the exact same object
+ // Return true if it is the exact same object.
if (obj == this) {
return true;
}
- if (obj instanceof NetworkInterface) {
- /*
- * make sure that some simple checks pass. If the name is not the
- * same then we are sure it is not the same one. We don't check the
- * hashcode as it is generated from the name which we check
- */
- NetworkInterface netif = (NetworkInterface) obj;
+ // Ensure it is the right type.
+ if (!(obj instanceof NetworkInterface)) {
+ return false;
+ }
- if (netif.getIndex() != interfaceIndex) {
- return false;
- }
+ /*
+ * Make sure that some simple checks pass. If the name is not the same
+ * then we are sure it is not the same one. We don't check the hashcode
+ * as it is generated from the name which we check
+ */
+ NetworkInterface netif = (NetworkInterface) obj;
- if (!(name.equals("")) && (!netif.getName().equals(name))) { //$NON-NLS-1$
- return false;
- }
+ if (netif.getIndex() != interfaceIndex) {
+ return false;
+ }
- if ((name.equals("")) && (!netif.getName().equals(displayName))) { //$NON-NLS-1$
- return false;
- }
+ if (!(name.equals("")) && (!netif.getName().equals(name))) { //$NON-NLS-1$
+ return false;
+ }
- // now check that the internet addresses are the same
- Enumeration<InetAddress> netifAddresses = netif.getInetAddresses();
- Enumeration<InetAddress> localifAddresses = getInetAddresses();
- if ((netifAddresses == null) && (localifAddresses != null)) {
- return false;
- }
+ if ((name.equals("")) && (!netif.getName().equals(displayName))) { //$NON-NLS-1$
+ return false;
+ }
- if ((netifAddresses == null) && (localifAddresses == null)) {
- // neither have any addresses so they are the same
- return true;
- }
+ // Now check that the collection of internet addresses are equal.
+ Enumeration<InetAddress> netifAddresses = netif.getInetAddresses();
+ Enumeration<InetAddress> localifAddresses = getInetAddresses();
+
+ // Check for both null (same), or one null (not same).
+ if (netifAddresses == null) {
+ return localifAddresses == null;
+ }
+ if (localifAddresses == null) {
+ return false;
+ }
- if (netifAddresses != null) {
- while (netifAddresses.hasMoreElements()
- && localifAddresses.hasMoreElements()) {
- if (!(localifAddresses.nextElement()).equals(netifAddresses
- .nextElement())) {
- return false;
- }
- }
- /*
- * now make sure that they had the same number of internet
- * addresses, if not they are not the same interface
- */
- if (netifAddresses.hasMoreElements()
- || localifAddresses.hasMoreElements()) {
- return false;
- }
+ // Both are not null, check InetAddress elements.
+ while (netifAddresses.hasMoreElements()
+ && localifAddresses.hasMoreElements()) {
+ if (!(localifAddresses.nextElement()).equals(
+ netifAddresses.nextElement())) {
+ return false;
}
- return true;
}
- return false;
+
+ /*
+ * Now make sure that they had the same number of addresses, if not they
+ * are not the same interface.
+ */
+ return !netifAddresses.hasMoreElements()
+ && !localifAddresses.hasMoreElements();
}
/**
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/SocketAddress.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/SocketAddress.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/SocketAddress.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/SocketAddress.java Tue Oct 6 14:57:42 2009
@@ -26,6 +26,8 @@
*/
public abstract class SocketAddress implements Serializable {
+ private static final long serialVersionUID = 5215720748342549866L;
+
/**
* Creates a new {@code SocketAddress} instance.
*/
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/URL.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/URL.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/URL.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/URL.java Tue Oct 6 14:57:42 2009
@@ -889,15 +889,15 @@
protected void set(String protocol, String host, int port,
String authority, String userInfo, String path, String query,
String ref) {
- String file = path;
+ String filePart = path;
if (query != null && !query.equals("")) { //$NON-NLS-1$
- if (file != null) {
- file = file + "?" + query; //$NON-NLS-1$
+ if (filePart != null) {
+ filePart = filePart + "?" + query; //$NON-NLS-1$
} else {
- file = "?" + query; //$NON-NLS-1$
+ filePart = "?" + query; //$NON-NLS-1$
}
}
- set(protocol, host, port, file, ref);
+ set(protocol, host, port, filePart, ref);
this.authority = authority;
this.userInfo = userInfo;
this.path = path;
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/URLClassLoader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/URLClassLoader.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/URLClassLoader.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/URLClassLoader.java Tue Oct 6 14:57:42 2009
@@ -1167,7 +1167,7 @@
*/
private ArrayList<URL> getInternalURLs(URL root, String classpath) {
// Class-path attribute is composed of space-separated values.
- StringTokenizer tokenizer = new java.util.StringTokenizer(classpath);
+ StringTokenizer tokenizer = new StringTokenizer(classpath);
ArrayList<URL> addedURLs = new ArrayList<URL>();
String file = root.getFile();
int jarIndex = file.lastIndexOf("!/") - 1; //$NON-NLS-1$
@@ -1177,9 +1177,6 @@
System.getProperty("file.separator"), jarIndex) + 1; //$NON-NLS-1$
}
file = file.substring(0, index);
- String protocol = root.getProtocol();
- String host = root.getHost();
- int port = root.getPort();
while (tokenizer.hasMoreElements()) {
String element = tokenizer.nextToken();
if (!element.equals("")) { //$NON-NLS-1$
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/GregorianCalendar.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/GregorianCalendar.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/GregorianCalendar.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/GregorianCalendar.java Tue Oct 6 14:57:42 2009
@@ -533,7 +533,6 @@
fields[MINUTE] = (millis % 60);
millis /= 60;
fields[HOUR_OF_DAY] = (millis % 24);
- millis /= 24;
fields[AM_PM] = fields[HOUR_OF_DAY] > 11 ? 1 : 0;
fields[HOUR] = fields[HOUR_OF_DAY] % 12;
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/UnknownFormatFlagsException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/UnknownFormatFlagsException.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/UnknownFormatFlagsException.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/UnknownFormatFlagsException.java Tue Oct 6 14:57:42 2009
@@ -60,6 +60,7 @@
*/
@Override
public String getMessage() {
- return Msg.getString("K034a", flags);
+ // K034a=The flags are {0}
+ return Msg.getString("K034a", flags); //$NON-NLS-1$
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/Handler.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/Handler.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/Handler.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/Handler.java Tue Oct 6 14:57:42 2009
@@ -44,7 +44,7 @@
*/
@Override
protected URLConnection openConnection(URL u) throws IOException {
- return new HttpURLConnection(u, getDefaultPort());
+ return new HttpURLConnectionImpl(u, getDefaultPort());
}
/**
@@ -72,7 +72,7 @@
if (null == u || null == proxy) {
throw new IllegalArgumentException(Msg.getString("K034b")); //$NON-NLS-1$
}
- return new HttpURLConnection(u, getDefaultPort(), proxy);
+ return new HttpURLConnectionImpl(u, getDefaultPort(), proxy);
}
/**
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/Handler.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/Handler.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/Handler.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/Handler.java Tue Oct 6 14:57:42 2009
@@ -32,7 +32,7 @@
@Override
protected URLConnection openConnection(URL url) throws IOException {
- return new HttpsURLConnection(url, getDefaultPort());
+ return new HttpsURLConnectionImpl(url, getDefaultPort());
}
@Override
@@ -42,7 +42,7 @@
// K034b=url and proxy can not be null
throw new IllegalArgumentException(Msg.getString("K034b")); //$NON-NLS-1$
}
- return new HttpsURLConnection(url, getDefaultPort(), proxy);
+ return new HttpsURLConnectionImpl(url, getDefaultPort(), proxy);
}
@Override
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/Handler.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/Handler.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/Handler.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/Handler.java Tue Oct 6 14:57:42 2009
@@ -42,7 +42,7 @@
*/
@Override
protected URLConnection openConnection(URL u) throws IOException {
- return new JarURLConnection(u);
+ return new JarURLConnectionImpl(u);
}
/**
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/reflect/ProxyNameAndTypeCache.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/reflect/ProxyNameAndTypeCache.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/reflect/ProxyNameAndTypeCache.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/reflect/ProxyNameAndTypeCache.java Tue Oct 6 14:57:42 2009
@@ -17,6 +17,8 @@
package org.apache.harmony.luni.internal.reflect;
+import java.util.Arrays;
+
class ProxyNameAndTypeCache {
int[][] keyTable;
@@ -87,13 +89,15 @@
}
@Override
+ @SuppressWarnings("nls")
public String toString() {
int max = size();
StringBuilder buf = new StringBuilder();
buf.append("{");
for (int i = 0; i < max; ++i) {
if (keyTable[i] != null) {
- buf.append(keyTable[i]).append("->").append(valueTable[i]);
+ buf.append(Arrays.toString(keyTable[i]));
+ buf.append("->").append(valueTable[i]);
}
if (i < max) {
buf.append(", ");
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java Tue Oct 6 14:57:42 2009
@@ -62,6 +62,9 @@
public int writeDirect(FileDescriptor fd, long address, int count)
throws IOException;
+ public int writev(FileDescriptor fd, Object[] buffers, int[] offsets,
+ int[] counts, int length) throws IOException;
+
public void setNonBlocking(FileDescriptor aFD, boolean block)
throws IOException;
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=822302&r1=822301&r2=822302&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 Tue Oct 6 14:57:42 2009
@@ -129,12 +129,7 @@
* @throws OutOfMemoryError
* if the request cannot be satisfied.
*/
- public long malloc(long length) throws OutOfMemoryError
- {
- OSResourcesMonitor.ensurePhysicalMemoryCapacity();
- return mallocNative(length);
- }
- private native long mallocNative(long length) throws OutOfMemoryError;
+ public native long malloc(long length) throws OutOfMemoryError;
/**
* Deallocates space for a memory block that was previously allocated by a
@@ -551,10 +546,8 @@
public long mmap(long fileDescriptor, long alignment, long size,
int mapMode) throws IOException {
+ // No need to check mmapImpl return as it throws IOException in error cases
long address = mmapImpl(fileDescriptor, alignment, size, mapMode);
- if (address == -1) {
- throw new IOException();
- }
return address;
}
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java Tue Oct 6 14:57:42 2009
@@ -534,4 +534,26 @@
*/
public native int writeDirect(FileDescriptor fd, long address, int count)
throws IOException;
+
+ /**
+ * Write given buffers to a socket. The given buffers is a Object array, the
+ * element of array must be direct buffer or a byte array to be written.
+ *
+ * @param fd
+ * the socket on which to write the bytes
+ * @param buffers
+ * the element of array must be direct buffer or a byte array to
+ * be written
+ * @param offsets
+ * the index of the first byte to be write
+ * @param counts
+ * the maximum number of bytes to be written
+ * @param length
+ * the size of buffer array
+ * @return the actual number of bytes written
+ * @throws IOException
+ * if there is an underlying socket problem
+ */
+ public native int writev(FileDescriptor fd, Object[] buffers,
+ int[] offsets, int[] counts, int length) throws IOException;
}
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/PlatformAddressFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/PlatformAddressFactory.java?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/PlatformAddressFactory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/PlatformAddressFactory.java Tue Oct 6 14:57:42 2009
@@ -34,6 +34,11 @@
}
public static PlatformAddress allocMap(long fd, long start, long size, int mode) throws IOException{
+ if (size == 0) {
+ // if size is 0, call to mmap has incorrect behaviour on
+ // unix and windows, so return empty address
+ return mapOn(0, 0);
+ }
long osAddress = PlatformAddress.osMemory.mmap(fd, start, size, mode);
PlatformAddress newMemory = mapOn(osAddress, size);
PlatformAddress.memorySpy.alloc(newMemory);
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/fdlibm.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/fdlibm.h:803062-814402
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/fdlibm.h:803062-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/gp.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/gp.h:803062-814402
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/gp.h:803062-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/hymagic.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/hymagic.h:803062-814402
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/hymagic.h:803062-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/hysocket.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/hysocket.h:803062-814402
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/hysocket.h:803062-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/hyvmls.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/hyvmls.h:803062-814402
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/hyvmls.h:803062-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jni.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jni.h:803062-814402
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jni.h:803062-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jni_types.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jni_types.h:803062-814402
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jni_types.h:803062-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmpi.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmpi.h:803062-814402
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmpi.h:803062-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmri.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmri.h:803062-814402
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmri.h:803062-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmti.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmti.h:803062-814402
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmti.h:803062-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmti_types.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmti_types.h:803062-814402
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmti_types.h:803062-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/vmi.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/vmi.h:803062-814402
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/vmi.h:803062-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/vmizip.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 6 14:57:42 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/vmizip.h:803062-814402
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/vmizip.h:803062-822279
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/
('svn:ignore' removed)
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/shared/main.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/shared/main.c?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/shared/main.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/shared/main.c Tue Oct 6 14:57:42 2009
@@ -1037,17 +1037,28 @@
static BOOLEAN findDirInPath(char *path, char *dir, char *separator)
{
char *pos;
+ int pathlen;
int dirlen = strlen(dir);
+ while (dirlen > 1 && dir[dirlen-1] == DIR_SEPARATOR) {
+ dirlen--;
+ }
while ((pos = strchr(path, *separator)) != NULL) {
- int pathlen = pos - path;
+ int savedpathlen = pathlen = pos - path;
+ while (pathlen > 1 && path[pathlen-1] == DIR_SEPARATOR) {
+ pathlen--;
+ }
if (dirlen == pathlen && !strncmp(path, dir, dirlen)) {
return TRUE;
}
- path += pathlen + 1;
+ path += savedpathlen + 1;
}
- return !strcmp(dir, path);
+ pathlen = strlen(path);
+ while (pathlen > 1 && path[pathlen-1] == DIR_SEPARATOR) {
+ pathlen--;
+ }
+ return dirlen == pathlen && !strncmp(path, dir, dirlen);
}
/**
@@ -1073,8 +1084,8 @@
int rc = 0;
char *exeName;
int found = 0;
- int i=0;
- int strLen;
+ int i = 0;
+ int strLen = 0;
#ifndef HY_NO_THR
PORT_ACCESS_FROM_PORT (portLibrary);
@@ -1096,10 +1107,13 @@
* see if we can find all paths in the current path
*/
- for (i=0; i < count; i++) {
- if (newPathToAdd[i] != NULL
- && findDirInPath(oldPath, newPathToAdd[i], separator) != 0) {
+ for (i=0; i < count; i++) {
+ if (newPathToAdd[i] != NULL) {
+ if (findDirInPath(oldPath, newPathToAdd[i], separator) != 0) {
found++;
+ } else {
+ strLen += strlen(newPathToAdd[i]) + 1;
+ }
}
}
@@ -1116,15 +1130,7 @@
* short) and then add the old path on the end
*/
- strLen = strlen(variableName) + strlen("=") + strlen(oldPath);
-
- for (i=0; i < count; i++) {
- if (newPathToAdd[i] != NULL
- && findDirInPath(oldPath, newPathToAdd[i],separator) == 0) {
- strLen += strlen(newPathToAdd[i]);
- strLen++; // for each separator
- }
- }
+ strLen += strlen(variableName) + strlen("=") + strlen(oldPath);
#ifndef HY_NO_THR
newPath = hymem_allocate_memory(strLen + 1);
@@ -1138,14 +1144,11 @@
for (i=0; i < count; i++) {
if (newPathToAdd[i] != NULL
&& findDirInPath(oldPath, newPathToAdd[i], separator) == 0) {
- if (i != 0) {
- strcat(newPath, separator);
- }
- strcat(newPath, newPathToAdd[i]);
+ strcat(newPath, newPathToAdd[i]);
+ strcat(newPath, separator);
}
}
- strcat(newPath, separator);
strcat(newPath, oldPath);
/*
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/windows/makefile.javae
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/windows/makefile.javae?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/windows/makefile.javae (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/windows/makefile.javae Tue Oct 6 14:57:42 2009
@@ -19,7 +19,8 @@
!include <$(HY_HDK)\build\make\defines.mak>
-EXENAME=$(EXEPATH)java.exe
+EXEBASE=java
+EXENAME=$(EXEPATH)$(EXEBASE).exe
HYCFLAGS = $(HYCFLAGS) /I$(SHAREDSUB)
BUILDFILES = $(SHAREDSUB)launcher_copyright.obj $(SHAREDSUB)cmain.obj \
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/windows/makefile.javaw
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/windows/makefile.javaw?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/windows/makefile.javaw (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/launcher/windows/makefile.javaw Tue Oct 6 14:57:42 2009
@@ -19,7 +19,8 @@
!include <$(HY_HDK)\build\make\defines.mak>
-EXENAME=$(EXEPATH)javaw.exe
+EXEBASE=javaw
+EXENAME=$(EXEPATH)$(EXEBASE).exe
HYCFLAGS = $(HYCFLAGS) /I$(SHAREDSUB)
BUILDFILES = $(SHAREDSUB)launcher_copyright.obj $(SHAREDSUB)main.obj \
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/
('svn:ignore' removed)
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSMemory.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSMemory.c?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSMemory.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSMemory.c Tue Oct 6 14:57:42 2009
@@ -25,7 +25,7 @@
#include "IMemorySystem.h"
#include "exceptions.h"
-JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSMemory_mallocNative
+JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSMemory_malloc
(JNIEnv * env, jobject thiz, jlong size)
{
PORT_ACCESS_FROM_ENV (env);
@@ -66,10 +66,7 @@
(JNIEnv * env, jobject thiz, jlong address, jbyteArray byteArray,
jint offset, jint length)
{
- jboolean isCopy;
- jbyte *bytes = (*env)->GetByteArrayElements (env, byteArray, &isCopy);
- memcpy (bytes + offset, (const void *) ((IDATA) address), (size_t) length);
- (*env)->ReleaseByteArrayElements (env, byteArray, bytes, 0);
+ (*env)->SetByteArrayRegion(env, byteArray, offset, length, (jbyte *) ((IDATA) address));
}
JNIEXPORT void JNICALL Java_org_apache_harmony_luni_platform_OSMemory_setByteArray
@@ -77,10 +74,10 @@
jint offset, jint length)
{
jboolean isCopy;
- jbyte *bytes = (*env)->GetByteArrayElements (env, byteArray, &isCopy);
+ jbyte *bytes = (*env)->GetPrimitiveArrayCritical(env, byteArray, &isCopy);
memcpy ((void *) ((IDATA) address),
(const jbyte *) ((IDATA) bytes + offset), (size_t) length);
- (*env)->ReleaseByteArrayElements (env, byteArray, bytes, JNI_ABORT);
+ (*env)->ReleasePrimitiveArrayCritical(env, byteArray, bytes, JNI_ABORT);
}
JNIEXPORT jbyte JNICALL Java_org_apache_harmony_luni_platform_OSMemory_getByte
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSMemory.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSMemory.h?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSMemory.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSMemory.h Tue Oct 6 14:57:42 2009
@@ -43,10 +43,10 @@
(JNIEnv *, jclass);
/*
* Class: org_apache_harmony_luni_platform_OSMemory
- * Method: mallocNative
+ * Method: malloc
* Signature: (J)J
*/
- JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSMemory_mallocNative
+ JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSMemory_malloc
(JNIEnv *, jobject, jlong);
/*
* Class: org_apache_harmony_luni_platform_OSMemory
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h Tue Oct 6 14:57:42 2009
@@ -466,6 +466,14 @@
JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_writeDirect
(JNIEnv *, jobject, jobject, jlong, jint);
+/*
+ * Class: org_apache_harmony_luni_platform_OSNetworkSystem
+ * Method: writev
+ * Signature: (Ljava/io/FileDescriptor;[Ljava/lang/Object;[I[II)I
+ */
+JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_writev
+ (JNIEnv *, jobject, jobject, jobjectArray, jintArray, jintArray, jint);
+
#ifdef __cplusplus
}
#endif
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/file.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/file.c?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/file.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/file.c Tue Oct 6 14:57:42 2009
@@ -300,36 +300,6 @@
}
JNIEXPORT jboolean JNICALL
-Java_java_io_File_isAbsoluteImpl (JNIEnv * env, jobject recv, jbyteArray path)
-{
- I_32 result = 0;
- jsize length = (*env)->GetArrayLength (env, path);
- jbyte *lpath = (jbyte *) ((*env)->GetPrimitiveArrayCritical (env, path, 0));
-
- if (jclSeparator == '/' && length > 0)
- {
- result = (lpath[0] == jclSeparator);
- goto release;
- }
- if (length > 1 && lpath[0] == '\\' && lpath[1] == '\\')
- {
- result = 1;
- goto release;
- }
- if (length > 2)
- {
- if (isalpha (lpath[0]) && lpath[1] == ':'
- && (lpath[2] == '\\' || lpath[2] == '/'))
- result = 1;
- }
-
-release:
- /* Easier to release in one area than copy the code around */
- (*env)->ReleasePrimitiveArrayCritical (env, path, lpath, JNI_ABORT);
- return result;
-}
-
-JNIEXPORT jboolean JNICALL
Java_java_io_File_mkdirImpl (JNIEnv * env, jobject recv, jbyteArray path)
{
PORT_ACCESS_FROM_ENV (env);
@@ -565,12 +535,6 @@
return;
}
-JNIEXPORT jbyteArray JNICALL
-Java_java_io_File_properPathImpl (JNIEnv * env, jobject recv, jbyteArray path)
-{
- return getPlatformPath (env, path);
-}
-
JNIEXPORT jboolean JNICALL
Java_java_io_File_isReadOnlyImpl (JNIEnv * env, jobject recv, jbyteArray path)
{
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/harmonyglob.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/harmonyglob.h?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/harmonyglob.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/harmonyglob.h Tue Oct 6 14:57:42 2009
@@ -74,6 +74,7 @@
/* additional IDs for luni and nio */
jclass CLS_java_lang_Long;
jclass CLS_java_net_Inet6Address;
+ jclass CLS_java_nio_DirectByteBuffer;
jfieldID FID_java_lang_Long_value;
jmethodID MID_java_net_InetAddress_init;
} LUNIJniIDCache;
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.c?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.c Tue Oct 6 14:57:42 2009
@@ -208,7 +208,14 @@
if (!globalRef)
return;
HARMONY_CACHE_SET (env, CLS_java_net_Inet6Address, globalRef);
-
+ lookupClass = (*env)->FindClass (env, "java/nio/DirectByteBuffer");
+ if (!lookupClass)
+ return;
+ globalRef = (*env)->NewGlobalRef (env, lookupClass);
+ if (!globalRef)
+ return;
+ HARMONY_CACHE_SET (env, CLS_java_nio_DirectByteBuffer, globalRef);
+
}
/**
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/netif.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/netif.c?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/netif.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/netif.c Tue Oct 6 14:57:42 2009
@@ -1126,6 +1126,7 @@
{
return NULL;
}
+ (*env)->DeleteLocalRef(env, bytearray);
}
if (networkInterfaceArray.elements[j].displayName != NULL)
@@ -1147,6 +1148,7 @@
{
return NULL;
}
+ (*env)->DeleteLocalRef(env, bytearray);
}
/* generate the object with the inet addresses for the interface */
@@ -1188,6 +1190,9 @@
displayName, addresses,
networkInterfaceArray.elements[j].index);
+ (*env)->DeleteLocalRef(env, name);
+ (*env)->DeleteLocalRef(env, addresses);
+
if (j == 0)
{
networkInterfaces =
@@ -1199,6 +1204,9 @@
(*env)->SetObjectArrayElement (env, networkInterfaces, j,
currentInterface);
}
+
+ (*env)->DeleteLocalRef(env, currentInterface);
+
}
/* free the memory for the interfaces struct and return the new NetworkInterface List */
hysock_free_network_interface_struct (&networkInterfaceArray);
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c?rev=822302&r1=822301&r2=822302&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c Tue Oct 6 14:57:42 2009
@@ -26,9 +26,12 @@
#include <sys/mman.h>
#include <errno.h>
#include <unistd.h>
+#include <string.h>
#include "vmi.h"
#include "OSMemory.h"
#include "IMemorySystem.h"
+#include "exceptions.h"
+#include "hyport.h"
#ifdef ZOS
#define FD_BIAS 1000
@@ -154,7 +157,7 @@
JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSMemory_mmapImpl
(JNIEnv * env, jobject thiz, jlong fd, jlong alignment, jlong size, jint mmode)
{
- //PORT_ACCESS_FROM_ENV (env);
+ PORT_ACCESS_FROM_ENV (env);
void *mapAddress = NULL;
int prot, flags;
@@ -174,12 +177,15 @@
flags = MAP_PRIVATE;
break;
default:
+ throwJavaIoIOException(env, "Map mode not recognised");
return -1;
}
mapAddress = mmap(0, (size_t)(size&0x7fffffff), prot, flags, fd-FD_BIAS, (off_t)(alignment&0x7fffffff));
if (mapAddress == MAP_FAILED)
{
+ hyerror_set_last_error(errno, HYPORT_ERROR_OPFAILED);
+ throwJavaIoIOException(env, hyerror_last_error_message());
return -1;
}
return (jlong) ((IDATA)mapAddress);