You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by qi...@apache.org on 2009/07/04 10:38:24 UTC
svn commit: r791082 [6/8] - in /harmony/enhanced/classlib/branches/java6: ./
depends/build/ depends/build/platform/ depends/manifests/asm-3.1/ make/
modules/accessibility/ modules/accessibility/make/
modules/accessibility/src/main/java/javax/accessibil...
Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java Sat Jul 4 08:38:13 2009
@@ -24,6 +24,7 @@
import java.util.List;
import org.apache.harmony.pack200.Archive.File;
+import org.apache.harmony.pack200.Archive.SegmentUnit;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.Attribute;
import org.objectweb.asm.ClassReader;
@@ -52,7 +53,7 @@
private PackingOptions options;
private boolean stripDebug;
private Attribute[] nonStandardAttributePrototypes;
-
+
/**
* The main method on Segment. Reads in all the class files, packs them and
* then writes the packed segment out to the given OutputStream.
@@ -69,23 +70,41 @@
* @throws IOException
* @throws Pack200Exception
*/
- public void pack(List classes, List files, OutputStream out, PackingOptions options)
+ public void pack(SegmentUnit segmentUnit, OutputStream out, PackingOptions options)
throws IOException, Pack200Exception {
this.options = options;
this.stripDebug = options.isStripDebug();
int effort = options.getEffort();
nonStandardAttributePrototypes = options.getUnknownAttributePrototypes();
+
+ PackingUtils.log("Start to pack a new segment with "
+ + segmentUnit.fileListSize() + " files including "
+ + segmentUnit.classListSize() + " classes");
+
+ PackingUtils.log("Initialize a header for the segment");
segmentHeader = new SegmentHeader();
- segmentHeader.setFile_count(files.size());
+ segmentHeader.setFile_count(segmentUnit.fileListSize());
segmentHeader.setHave_all_code_flags(!stripDebug);
+
+ PackingUtils.log("Setup constant pool bands for the segment");
cpBands = new CpBands(this, effort);
+
+ PackingUtils.log("Setup attribute definition bands for the segment");
attributeDefinitionBands = new AttributeDefinitionBands(this, effort, nonStandardAttributePrototypes);
+
+ PackingUtils.log("Setup internal class bands for the segment");
icBands = new IcBands(segmentHeader, cpBands, effort);
- classBands = new ClassBands(this, classes.size(), effort, stripDebug);
+
+ PackingUtils.log("Setup class bands for the segment");
+ classBands = new ClassBands(this, segmentUnit.classListSize(), effort, stripDebug);
+
+ PackingUtils.log("Setup byte code bands for the segment");
bcBands = new BcBands(cpBands, this, effort);
- fileBands = new FileBands(cpBands, segmentHeader, files, classes, effort);
+
+ PackingUtils.log("Setup file bands for the segment");
+ fileBands = new FileBands(cpBands, segmentHeader, options, segmentUnit, effort);
- processClasses(classes, files);
+ processClasses(segmentUnit);
cpBands.finaliseBands();
attributeDefinitionBands.finaliseBands();
@@ -98,22 +117,35 @@
// before segmentHeader because the band_headers band is only created
// when the other bands are packed, but comes before them in the packed
// file.
- ByteArrayOutputStream tempStream = new ByteArrayOutputStream();
+ ByteArrayOutputStream bandsOutputStream = new ByteArrayOutputStream();
- cpBands.pack(tempStream);
- attributeDefinitionBands.pack(tempStream);
- icBands.pack(tempStream);
- classBands.pack(tempStream);
- bcBands.pack(tempStream);
- fileBands.pack(tempStream);
-
- segmentHeader.pack(out);
- tempStream.writeTo(out);
- }
-
- private void processClasses(List classes, List files) throws Pack200Exception {
- segmentHeader.setClass_count(classes.size());
- for (Iterator iterator = classes.iterator(); iterator.hasNext();) {
+ PackingUtils.log("Packing...");
+ cpBands.pack(bandsOutputStream);
+ attributeDefinitionBands.pack(bandsOutputStream);
+ icBands.pack(bandsOutputStream);
+ classBands.pack(bandsOutputStream);
+ bcBands.pack(bandsOutputStream);
+ fileBands.pack(bandsOutputStream);
+
+ ByteArrayOutputStream headerOutputStream = new ByteArrayOutputStream();
+ segmentHeader.pack(headerOutputStream);
+
+ headerOutputStream.writeTo(out);
+ bandsOutputStream.writeTo(out);
+
+ segmentUnit.addPackedByteAmount(headerOutputStream.size());
+ segmentUnit.addPackedByteAmount(bandsOutputStream.size());
+
+ PackingUtils.log("Wrote total of " + segmentUnit.getPackedByteAmount()
+ + " bytes");
+ PackingUtils.log("Transmitted " + segmentUnit.fileListSize() + " files of "
+ + segmentUnit.getByteAmount() + " input bytes in a segment of "
+ + segmentUnit.getPackedByteAmount() + " bytes");
+ }
+
+ private void processClasses(SegmentUnit segmentUnit) throws Pack200Exception {
+ segmentHeader.setClass_count(segmentUnit.classListSize());
+ for (Iterator iterator = segmentUnit.getClassList().iterator(); iterator.hasNext();) {
Pack200ClassReader classReader = (Pack200ClassReader) iterator
.next();
currentClassReader = classReader;
@@ -129,7 +161,7 @@
classBands.removeCurrentClass();
String name = classReader.getFileName();
boolean found = false;
- for (Iterator iterator2 = files.iterator(); iterator2
+ for (Iterator iterator2 = segmentUnit.getFileList().iterator(); iterator2
.hasNext();) {
File file = (File) iterator2.next();
if(file.getName().equals(name)) {
Propchange: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jul 4 08:38:13 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java:782694-785553
+/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java:782694-790471
Propchange: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jul 4 08:38:13 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java:782694-785553
+/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java:782694-790471
Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ArchiveTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ArchiveTest.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ArchiveTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ArchiveTest.java Sat Jul 4 08:38:13 2009
@@ -245,6 +245,78 @@
compareFiles(jarFile, jarFile2);
}
+ public void testPassFiles() throws IOException, URISyntaxException, Pack200Exception {
+ // Don't pass any
+ in = new JarFile(new File(Archive.class
+ .getResource("/org/apache/harmony/pack200/tests/sqlUnpacked.jar").toURI()));
+ File file0 = File.createTempFile("sql", ".pack");
+ out = new FileOutputStream(file0);
+ PackingOptions options = new PackingOptions();
+ options.setGzip(false);
+ Archive archive = new Archive(in, out, options);
+ archive.pack();
+ in.close();
+ out.close();
+
+ // Pass one file
+ in = new JarFile(new File(Archive.class
+ .getResource("/org/apache/harmony/pack200/tests/sqlUnpacked.jar").toURI()));
+ file = File.createTempFile("sql", ".pack");
+ out = new FileOutputStream(file);
+ options = new PackingOptions();
+ options.setGzip(false);
+ options.addPassFile("bin/test/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.class");
+ assertTrue(options.isPassFile("bin/test/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.class"));
+ archive = new Archive(in, out, options);
+ archive.pack();
+ in.close();
+ out.close();
+
+ // Pass a whole directory
+ in = new JarFile(new File(Archive.class
+ .getResource("/org/apache/harmony/pack200/tests/sqlUnpacked.jar").toURI()));
+ File file2 = File.createTempFile("sql", ".pack");
+ out = new FileOutputStream(file2);
+ options = new PackingOptions();
+ options.setGzip(false);
+ options.addPassFile("bin/test/org/apache/harmony/sql/tests/java/sql");
+ assertTrue(options.isPassFile("bin/test/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.class"));
+ assertFalse(options.isPassFile("bin/test/org/apache/harmony/sql/tests/java/sqldata/SqlData.class"));
+ archive = new Archive(in, out, options);
+ archive.pack();
+ in.close();
+ out.close();
+
+ assertTrue("If files are passed then the pack file should be larger", file.length() > file0.length());
+ assertTrue("If more files are passed then the pack file should be larger", file2.length() > file.length());
+
+ // now unpack
+ InputStream in2 = new FileInputStream(file);
+ File file3 = File.createTempFile("sql", ".jar");
+ JarOutputStream out2 = new JarOutputStream(new FileOutputStream(file3));
+ org.apache.harmony.unpack200.Archive u2archive = new org.apache.harmony.unpack200.Archive(in2, out2);
+ u2archive.unpack();
+
+ File compareFile = new File(Archive.class.getResource(
+ "/org/apache/harmony/pack200/tests/sqlUnpacked.jar").toURI());
+ JarFile jarFile = new JarFile(file3);
+ file2.deleteOnExit();
+
+ JarFile jarFile2 = new JarFile(compareFile);
+ // Check that both jars have the same entries
+ compareJarEntries(jarFile, jarFile2);
+
+ // now unpack the file with lots of passed files
+ InputStream in3 = new FileInputStream(file2);
+ File file4 = File.createTempFile("sql", ".jar");
+ JarOutputStream out3 = new JarOutputStream(new FileOutputStream(file4));
+ u2archive = new org.apache.harmony.unpack200.Archive(in3, out3);
+ u2archive.unpack();
+ jarFile = new JarFile(file4);
+ jarFile2 = new JarFile(compareFile);
+ compareJarEntries(jarFile, jarFile2);
+ }
+
public void testAnnotations() throws IOException, Pack200Exception,
URISyntaxException {
in = new JarFile(new File(Archive.class.getResource(
@@ -325,6 +397,20 @@
}
}
+ private void compareJarEntries(JarFile jarFile, JarFile jarFile2)
+ throws IOException {
+ Enumeration entries = jarFile.entries();
+ while (entries.hasMoreElements()) {
+
+ JarEntry entry = (JarEntry) entries.nextElement();
+ assertNotNull(entry);
+
+ String name = entry.getName();
+ JarEntry entry2 = jarFile2.getJarEntry(name);
+ assertNotNull("Missing Entry: " + name, entry2);
+ }
+ }
+
private void compareFiles(JarFile jarFile, JarFile jarFile2)
throws IOException {
Enumeration entries = jarFile.entries();
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/build.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/build.xml Sat Jul 4 08:38:13 2009
@@ -23,6 +23,8 @@
<property name="hy.hdk" location="${basedir}/../../deploy" />
<import file="${hy.hdk}/build/ant/properties.xml" />
+ <property name="tests.output" location="../../build/test_report" />
+
<!-- set global properties for this build. -->
<xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
@@ -197,7 +199,7 @@
</target>
<target name="-make-report-dir">
- <mkdir dir="${hy.tests.reports}" />
+ <mkdir dir="${tests.output}" />
</target>
<target name="-compile-native-tests" if="test.portlib">
@@ -238,7 +240,7 @@
<exec-native test="hyipcmutex" />
<exec-native test="hymmap" />
- <move todir="${hy.tests.reports}">
+ <move todir="${tests.output}">
<fileset dir="${hy.portlib}">
<include name="TEST-*.xml"/>
</fileset>
@@ -279,7 +281,7 @@
</target>
<target name="touch-errors-file" if="test.errors">
- <echo file="${hy.tests.reports}/test.errors"
+ <echo file="${tests.output}/test.errors"
append="true">portlib${line.separator}</echo>
</target>
@@ -311,7 +313,7 @@
</not>
</condition>
<echo>@{test}: ${@{test}.result}${line.separator}</echo>
-<!-- <echo file="${hy.tests.reports}/TEST-${@{test}.name}.xml"
+<!-- <echo file="${tests.output}/TEST-${@{test}.name}.xml"
><?xml version='1.0' encoding='UTF-8' ?>
<testsuite tests="1" errors='${@{test}.errorcount}' failures='0'
name='${@{test}.name}' time='0'>
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/make/hyproperties.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/make/hyproperties.xml Sat Jul 4 08:38:13 2009
@@ -45,10 +45,4 @@
<jdk location="../../deploy/jdk" />
<build location="../../build/classes" />
- <tests>
- <reports location="../../build/test_report" />
- <support>
- <bin location="../../build/tests" />
- </support>
- </tests>
</hy>
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hyport.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hyport.h?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hyport.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hyport.h Sat Jul 4 08:38:13 2009
@@ -416,7 +416,7 @@
BOOLEAN decorate);
/** see @ref hysl.c::hysl_lookup_name "hysl_lookup_name"*/
UDATA (PVMCALL sl_lookup_name) (struct HyPortLibrary * portLibrary,
- UDATA descriptor, char *name,
+ UDATA descriptor, const char *name,
UDATA * func, const char *argSignature);
/** see @ref hytty.c::hytty_startup "hytty_startup"*/
I_32 (PVMCALL tty_startup) (struct HyPortLibrary * portLibrary);
@@ -450,7 +450,7 @@
/** see @ref hymem.c::hymem_allocate_memory_callSite "hymem_allocate_memory_callSite"*/
void *(PVMCALL mem_allocate_memory_callSite) (struct HyPortLibrary *
portLibrary, UDATA byteAmount,
- char *callSite);
+ const char *callSite);
/** see @ref hymem.c::hymem_free_memory "hymem_free_memory"*/
void (PVMCALL mem_free_memory) (struct HyPortLibrary * portLibrary,
void *memoryPointer);
@@ -505,7 +505,7 @@
I_32 flags);
/** see @ref hysock.c::hysock_sockaddr "hysock_sockaddr"*/
I_32 (PVMCALL sock_sockaddr) (struct HyPortLibrary * portLibrary,
- hysockaddr_t handle, char *addrStr,
+ hysockaddr_t handle, const char *addrStr,
U_16 port);
/** see @ref hysock.c::hysock_read "hysock_read"*/
I_32 (PVMCALL sock_read) (struct HyPortLibrary * portLibrary,
@@ -523,10 +523,10 @@
hysocket_t sock, hysockaddr_t addr);
/** see @ref hysock.c::hysock_inetaddr "hysock_inetaddr"*/
I_32 (PVMCALL sock_inetaddr) (struct HyPortLibrary * portLibrary,
- char *addrStr, U_32 * addr);
+ const char *addrStr, U_32 * addr);
/** see @ref hysock.c::hysock_gethostbyname "hysock_gethostbyname"*/
I_32 (PVMCALL sock_gethostbyname) (struct HyPortLibrary * portLibrary,
- char *name, hyhostent_t handle);
+ const char *name, hyhostent_t handle);
/** see @ref hysock.c::hysock_hostent_addrlist "hysock_hostent_addrlist"*/
I_32 (PVMCALL sock_hostent_addrlist) (struct HyPortLibrary * portLibrary,
hyhostent_t handle, U_32 index);
@@ -1004,6 +1004,8 @@
/** see @ref hyport.c::hyport_get_thread_library "hyport_get_thread_library" */
HyThreadLibrary * (PVMCALL port_get_thread_library) (struct HyPortLibrary * portLibrary);
#endif /* HY_NO_THR */
+ void (PVMCALL sock_fdset_zero)(struct HyPortLibrary *portLibrary, hyfdset_t fdset) ;
+ void (PVMCALL sock_fdset_set)(struct HyPortLibrary *portLibrary, hysocket_t aSocket, hyfdset_t fdset) ;
char _hypadding039C[4]; /* 4 bytes of automatic padding */
} HyPortLibrary;
#define HYPORT_SL_FOUND 0
@@ -1439,6 +1441,8 @@
#define hymem_allocate_memory(param1) privatePortLibrary->mem_allocate_memory_callSite(privatePortLibrary,param1, HY_GET_CALLSITE())
#undef hymem_allocate_code_memory
#define hymem_allocate_code_memory(param1) privatePortLibrary->mem_allocate_code_memory_callSite(privatePortLibrary,param1, HY_GET_CALLSITE())
+#define hysock_fdset_zero(param1) privatePortLibrary->sock_fdset_zero(privatePortLibrary,param1)
+#define hysock_fdset_set(param1,param2) privatePortLibrary->sock_fdset_set(privatePortLibrary,param1,param2)
#endif /* !HYPORT_LIBRARY_DEFINE */
/** @} */
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hyporterror.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hyporterror.h?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hyporterror.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hyporterror.h Sat Jul 4 08:38:13 2009
@@ -189,6 +189,9 @@
#define HYPORT_ERROR_SOCKET_CONNECTION_REFUSED HYPORT_ERROR_SOCKET_BASE-49 /* connection was refused */
#define HYPORT_ERROR_SOCKET_ENETUNREACH HYPORT_ERROR_SOCKET_BASE-50 /* network is not reachable */
#define HYPORT_ERROR_SOCKET_EACCES HYPORT_ERROR_SOCKET_BASE-51 /* permissions do not allow action on socket */
+#define HYPORT_ERROR_SOCKET_WAS_CLOSED (HYPORT_ERROR_SOCKET_BASE-52)
+#define HYPORT_ERROR_SOCKET_EINPROGRESS (HYPORT_ERROR_SOCKET_BASE-53)
+#define HYPORT_ERROR_SOCKET_ALREADYINPROGRESS (HYPORT_ERROR_SOCKET_BASE-54)
#define HYPORT_ERROR_SOCKET_FIRST_ERROR_NUMBER HYPORT_ERROR_SOCKET_BASE
#define HYPORT_ERROR_SOCKET_LAST_ERROR_NUMBER HYPORT_ERROR_SOCKET_VALUE_NULL /* Equals last used error code */
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hythread.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hythread.h?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hythread.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hythread.h Sat Jul 4 08:38:13 2009
@@ -136,7 +136,7 @@
extern HY_CFUNC IDATA VMCALL hythread_park
PROTOTYPE ((I_64 millis, IDATA nanos));
extern HY_CFUNC IDATA VMCALL hythread_monitor_init_with_name
- PROTOTYPE ((hythread_monitor_t * handle, UDATA flags, char *name));
+ PROTOTYPE ((hythread_monitor_t * handle, UDATA flags, const char *name));
extern HY_CFUNC IDATA VMCALL hythread_monitor_try_enter
PROTOTYPE ((hythread_monitor_t monitor));
extern HY_CFUNC void VMCALL hythread_jlm_thread_clear
@@ -239,7 +239,7 @@
PROTOTYPE ((hythread_t thread));
extern HY_CFUNC void *VMCALL hythread_tls_get
PROTOTYPE ((hythread_t thread, hythread_tls_key_t key));
- extern HY_CFUNC char *VMCALL hythread_monitor_get_name
+ extern HY_CFUNC const char *VMCALL hythread_monitor_get_name
PROTOTYPE ((hythread_monitor_t monitor));
extern HY_CFUNC hythread_monitor_t VMCALL hythread_monitor_walk
PROTOTYPE ((hythread_monitor_t monitor));
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/portpriv.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/portpriv.h?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/portpriv.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/portpriv.h Sat Jul 4 08:38:13 2009
@@ -318,7 +318,7 @@
extern HY_CFUNC void *VMCALL
hymem_allocate_memory_callSite
PROTOTYPE ((struct HyPortLibrary * portLibrary, UDATA byteAmount,
- char *callSite));
+ const char *callSite));
struct HyPortLibrary;
extern HY_CFUNC void VMCALL
hymem_shutdown PROTOTYPE ((struct HyPortLibrary * portLibrary));
@@ -587,7 +587,7 @@
struct HyPortLibrary;
extern HY_CFUNC UDATA VMCALL
hysl_lookup_name
-PROTOTYPE ((struct HyPortLibrary * portLibrary, UDATA descriptor, char *name,
+PROTOTYPE ((struct HyPortLibrary * portLibrary, UDATA descriptor, const char *name,
UDATA * func, const char *argSignature));
struct HyPortLibrary;
extern HY_CFUNC UDATA VMCALL
@@ -823,7 +823,7 @@
struct HyPortLibrary;
extern HY_CFUNC I_32 VMCALL
hysock_inetaddr
-PROTOTYPE ((struct HyPortLibrary * portLibrary, char *addrStr, U_32 * addr));
+PROTOTYPE ((struct HyPortLibrary * portLibrary, const char *addrStr, U_32 * addr));
struct HyPortLibrary;
extern HY_CFUNC I_32 VMCALL
hysock_bind
@@ -882,7 +882,7 @@
extern HY_CFUNC I_32 VMCALL
hysock_sockaddr
PROTOTYPE ((struct HyPortLibrary * portLibrary, hysockaddr_t handle,
- char *addrStr, U_16 port));
+ const char *addrStr, U_16 port));
struct HyPortLibrary;
extern HY_CFUNC I_32 VMCALL
hysock_gethostbyaddr
@@ -965,7 +965,7 @@
struct HyPortLibrary;
extern HY_CFUNC I_32 VMCALL
hysock_gethostbyname
-PROTOTYPE ((struct HyPortLibrary * portLibrary, char *name,
+PROTOTYPE ((struct HyPortLibrary * portLibrary, const char *name,
hyhostent_t handle));
struct HyPortLibrary;
struct hyNetworkInterfaceArray_struct;
@@ -1137,6 +1137,14 @@
hyport_get_thread_library
PROTOTYPE ((HyPortLibrary * portLib));
#endif /* HY_NO_THR */
+struct HyPortLibrary;
+extern HY_CFUNC void VMCALL
+ hysock_fdset_zero
+PROTOTYPE ((struct HyPortLibrary * portLibrary, hyfdset_t fdset));
+struct HyPortLibrary;
+extern HY_CFUNC void VMCALL
+ hysock_fdset_set
+PROTOTYPE ((struct HyPortLibrary * portLibrary, hysocket_t aSocket, hyfdset_t fdset));
static HyPortLibrary MasterPortLibraryTable = {
{HYPORT_MAJOR_VERSION_NUMBER, HYPORT_MINOR_VERSION_NUMBER, 0, HYPORT_CAPABILITY_MASK}, /* portVersion */
NULL, /* portGlobals */
@@ -1376,6 +1384,8 @@
#ifdef HY_NO_THR
hyport_get_thread_library, /* port_get_thread_library */
#endif /* HY_NO_THR */
+ hysock_fdset_zero,
+ hysock_fdset_set,
};
#endif
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hymem.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hymem.c?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hymem.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hymem.c Sat Jul 4 08:38:13 2009
@@ -230,7 +230,7 @@
*/
void *VMCALL
hymem_allocate_memory_callSite (struct HyPortLibrary *portLibrary,
- UDATA byteAmount, char *callSite)
+ UDATA byteAmount, const char *callSite)
{
void *ptr = NULL;
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysl.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysl.c?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysl.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysl.c Sat Jul 4 08:38:13 2009
@@ -192,7 +192,7 @@
*/
UDATA VMCALL
hysl_lookup_name (struct HyPortLibrary * portLibrary, UDATA descriptor,
- char *name, UDATA * func, const char *argSignature)
+ const char *name, UDATA * func, const char *argSignature)
{
void *address;
address = dlsym ((void *)descriptor, name);
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysock.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysock.c?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysock.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysock.c Sat Jul 4 08:38:13 2009
@@ -640,19 +640,22 @@
{
I_32 rc = 0;
- if ((*sock == INVALID_SOCKET) || (close (SOCKET_CAST (*sock)) < 0))
- {
- rc = errno;
- HYSOCKDEBUG ("<closesocket failed, err=%d>\n", rc);
- rc =
- portLibrary->error_set_last_error (portLibrary, rc,
- HYPORT_ERROR_SOCKET_BADSOCKET);
- }
+ if (*sock == INVALID_SOCKET) {
+ HYSOCKDEBUGPRINT ("<closesocket failed, invalid socket>\n");
+ return portLibrary->error_set_last_error (portLibrary,
+ HYPORT_ERROR_SOCKET_UNIX_EBADF,
+ HYPORT_ERROR_SOCKET_BADSOCKET);
+ }
- if (*sock != INVALID_SOCKET)
- {
- portLibrary->mem_free_memory (portLibrary, *sock);
- }
+ if (close (SOCKET_CAST (*sock)) < 0) {
+ rc = errno;
+ HYSOCKDEBUG ("<closesocket failed, err=%d>\n", rc);
+ rc =
+ portLibrary->error_set_last_error (portLibrary, rc,
+ HYPORT_ERROR_SOCKET_BADSOCKET);
+ }
+
+ portLibrary->mem_free_memory (portLibrary, *sock);
*sock = INVALID_SOCKET;
return rc;
}
@@ -784,6 +787,22 @@
#undef CDEV_CURRENT_FUNCTION
+#define CDEV_CURRENT_FUNCTION hysock_fdset_zero
+void VMCALL
+hysock_fdset_zero(struct HyPortLibrary *portLibrary, hyfdset_t fdset) {
+ FD_ZERO(&fdset->handle);
+ return;
+}
+#undef CDEV_CURRENT_FUNCTION
+
+#define CDEV_CURRENT_FUNCTION hysock_fdset_set
+void VMCALL
+hysock_fdset_set(struct HyPortLibrary *portLibrary, hysocket_t socket, hyfdset_t fdset) {
+ FD_SET(SOCKET_CAST(socket), &fdset->handle);
+ return;
+}
+#undef CDEV_CURRENT_FUNCTION
+
#define CDEV_CURRENT_FUNCTION hysock_freeaddrinfo
/**
@@ -1370,7 +1389,7 @@
* @return 0, if no errors occurred, otherwise the (negative) error code.
*/
I_32 VMCALL
-hysock_gethostbyname (struct HyPortLibrary * portLibrary, char *name,
+hysock_gethostbyname (struct HyPortLibrary * portLibrary, const char *name,
hyhostent_t handle)
{
#if !HOSTENT_DATA_R
@@ -2197,7 +2216,7 @@
* @return 0, if no errors occurred, otherwise the (negative) error code.
*/
I_32 VMCALL
-hysock_inetaddr (struct HyPortLibrary * portLibrary, char *addrStr,
+hysock_inetaddr (struct HyPortLibrary * portLibrary, const char *addrStr,
U_32 * addr)
{
I_32 rc = 0;
@@ -3290,7 +3309,7 @@
*/
I_32 VMCALL
hysock_sockaddr (struct HyPortLibrary * portLibrary, hysockaddr_t handle,
- char *addrStr, U_16 port)
+ const char *addrStr, U_16 port)
{
I_32 rc = 0;
U_32 addr = 0;
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/windows/hymem.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/windows/hymem.c?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/windows/hymem.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/windows/hymem.c Sat Jul 4 08:38:13 2009
@@ -191,7 +191,7 @@
*/
void *VMCALL
hymem_allocate_memory_callSite (struct HyPortLibrary *portLibrary,
- UDATA byteAmount, char *callSite)
+ UDATA byteAmount, const char *callSite)
{
void *ptr = NULL;
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/windows/hysl.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/windows/hysl.c?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/windows/hysl.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/windows/hysl.c Sat Jul 4 08:38:13 2009
@@ -35,13 +35,13 @@
#endif
#define CDEV_CURRENT_FUNCTION _prototypes_private
-UDATA VMCALL EsSharedLibraryLookupName (UDATA descriptor, char *name,
+UDATA VMCALL EsSharedLibraryLookupName (UDATA descriptor, const char *name,
UDATA * func);
#undef CDEV_CURRENT_FUNCTION
#define CDEV_CURRENT_FUNCTION EsSharedLibraryLookupName
UDATA VMCALL
-EsSharedLibraryLookupName (UDATA descriptor, char *name, UDATA * func)
+EsSharedLibraryLookupName (UDATA descriptor, const char *name, UDATA * func)
{
UDATA lpfnFunction;
@@ -259,7 +259,7 @@
*/
UDATA VMCALL
hysl_lookup_name (struct HyPortLibrary * portLibrary, UDATA descriptor,
- char *name, UDATA * func, const char *argSignature)
+ const char *name, UDATA * func, const char *argSignature)
{
char *mangledName;
UDATA result;
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/windows/hysock.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/windows/hysock.c?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/windows/hysock.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/windows/hysock.c Sat Jul 4 08:38:13 2009
@@ -987,6 +987,27 @@
#undef CDEV_CURRENT_FUNCTION
+#define CDEV_CURRENT_FUNCTION hysock_fdset_zero
+void VMCALL
+hysock_fdset_zero(struct HyPortLibrary *portLibrary, hyfdset_t fdset) {
+ FD_ZERO(&fdset->handle);
+ return;
+}
+#undef CDEV_CURRENT_FUNCTION
+
+#define CDEV_CURRENT_FUNCTION hysock_fdset_set
+void VMCALL
+hysock_fdset_set(struct HyPortLibrary *portLibrary, hysocket_t socket, hyfdset_t fdset) {
+ if (socket->flags & SOCKET_IPV4_OPEN_MASK) {
+ FD_SET(socket->ipv4, &fdset->handle);
+ }
+ if (socket->flags & SOCKET_IPV6_OPEN_MASK) {
+ FD_SET(socket->ipv6, &fdset->handle);
+ }
+ return;
+}
+#undef CDEV_CURRENT_FUNCTION
+
#define CDEV_CURRENT_FUNCTION hysock_freeaddrinfo
/**
* Frees the memory created by the call to @ref hysock_getaddrinfo().
@@ -1467,7 +1488,7 @@
* @return 0, if no errors occurred, otherwise the (negative) error code.
*/
I_32 VMCALL
-hysock_gethostbyname (struct HyPortLibrary * portLibrary, char *name,
+hysock_gethostbyname (struct HyPortLibrary * portLibrary, const char *name,
hyhostent_t handle)
{
OSHOSTENT *result;
@@ -2140,7 +2161,7 @@
* @return 0, if no errors occurred, otherwise the (negative) error code.
*/
I_32 VMCALL
-hysock_inetaddr (struct HyPortLibrary * portLibrary, char *addrStr,
+hysock_inetaddr (struct HyPortLibrary * portLibrary, const char *addrStr,
U_32 * addr)
{
I_32 rc = 0;
@@ -3423,7 +3444,7 @@
*/
I_32 VMCALL
hysock_sockaddr (struct HyPortLibrary * portLibrary, hysockaddr_t handle,
- char *addrStr, U_16 port)
+ const char *addrStr, U_16 port)
{
I_32 rc = 0;
U_32 addr = 0;
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/shared/hythread.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/shared/hythread.c?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/shared/hythread.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/shared/hythread.c Sat Jul 4 08:38:13 2009
@@ -3331,7 +3331,7 @@
*/
IDATA VMCALL
hythread_monitor_init_with_name (hythread_monitor_t * handle, UDATA flags,
- char *name)
+ const char *name)
{
ASSERT (handle);
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/shared/hythreadinspect.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/shared/hythreadinspect.c?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/shared/hythreadinspect.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/shared/hythreadinspect.c Sat Jul 4 08:38:13 2009
@@ -232,7 +232,7 @@
* @see hythread_monitor_init_with_name
*
*/
-char *VMCALL
+const char *VMCALL
hythread_monitor_get_name (hythread_monitor_t monitor)
{
ASSERT (monitor);
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/shared/hythreadinspect.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/shared/hythreadinspect.h?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/shared/hythreadinspect.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/shared/hythreadinspect.h Sat Jul 4 08:38:13 2009
@@ -41,7 +41,7 @@
UDATA VMCALL hythread_get_priority PROTOTYPE ((hythread_t thread));
void *VMCALL hythread_tls_get
PROTOTYPE ((hythread_t thread, hythread_tls_key_t key));
-char *VMCALL hythread_monitor_get_name
+const char *VMCALL hythread_monitor_get_name
PROTOTYPE ((hythread_monitor_t monitor));
hythread_monitor_t VMCALL hythread_monitor_walk
PROTOTYPE ((hythread_monitor_t monitor));
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/unix/thrtypes.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/unix/thrtypes.h?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/unix/thrtypes.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/unix/thrtypes.h Sat Jul 4 08:38:13 2009
@@ -50,7 +50,7 @@
UDATA flags;
UDATA userData;
struct HyThreadMonitorTracing *tracing;
- char *name;
+ const char *name;
UDATA pinCount;
UDATA antiDeflationCount;
UDATA proDeflationCount;
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/windows/thrtypes.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/windows/thrtypes.h?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/windows/thrtypes.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/windows/thrtypes.h Sat Jul 4 08:38:13 2009
@@ -53,7 +53,7 @@
UDATA flags;
UDATA userData;
struct HyThreadMonitorTracing *tracing;
- char *name;
+ const char *name;
UDATA pinCount;
UDATA antiDeflationCount;
UDATA proDeflationCount;
Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/test/native/hymmap/shared/hymmap.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/test/native/hymmap/shared/hymmap.c?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/test/native/hymmap/shared/hymmap.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/test/native/hymmap/shared/hymmap.c Sat Jul 4 08:38:13 2009
@@ -130,6 +130,7 @@
testFile = hyportLibrary->mem_allocate_memory(hyportLibrary, pathLen + strlen("shared") + 2 + strlen("testFile"));
strncpy(emptyFile, execPath, pathLen);
+ emptyFile[pathLen] = '\0';
strcat(emptyFile, "shared");
strcat(emptyFile, DIR_SEPARATOR_STR);
strcpy(testFile, emptyFile);
Modified: harmony/enhanced/classlib/branches/java6/modules/prefs/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/prefs/build.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/prefs/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/prefs/build.xml Sat Jul 4 08:38:13 2009
@@ -25,6 +25,8 @@
<property name="hy.hdk" location="${basedir}/../../deploy" />
<import file="${hy.hdk}/build/ant/properties.xml" />
+ <property name="tests.output" location="../../build/test_report" />
+
<!-- set global properties for this build. -->
<xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
@@ -181,12 +183,12 @@
<target name="run-tests">
- <mkdir dir="${hy.tests.reports}" />
+ <mkdir dir="${tests.output}" />
<property name="test.jre.home" value="${hy.jdk}/jre" />
<junit fork="yes"
- forkmode="${hy.test.forkmode}"
+ forkmode="perBatch"
timeout="${hy.test.timeout}"
printsummary="withOutAndErr"
errorproperty="test.errors"
@@ -209,7 +211,7 @@
<formatter type="xml" />
- <batchtest todir="${hy.tests.reports}" haltonfailure="no" >
+ <batchtest todir="${tests.output}" haltonfailure="no" >
<fileset dir="${hy.prefs.src.test.java}">
<!-- if ${test.case} -->
@@ -217,20 +219,30 @@
<!-- unless ${test.case} -->
<include name="**/*Test.java" unless="test.case" />
<excludesfile name="${prefs.exclude.file}" unless="test.case" />
+
+ <!-- These tests run in a separate jvm below -->
+ <exclude name="org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java" unless="test.case" />
</fileset>
</batchtest>
+
+ <batchtest todir="${tests.output}" haltonfailure="no" unless="test.case" >
+ <fileset dir="${hy.prefs.src.test.java}">
+ <include name="org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java" />
+ </fileset>
+ </batchtest>
+
</junit>
<antcall target="touch-failures-file" />
<antcall target="touch-errors-file" />
</target>
<target name="touch-failures-file" if="test.failures">
- <echo file="${hy.tests.reports}/test.failures"
+ <echo file="${tests.output}/test.failures"
append="true">prefs${line.separator}</echo>
</target>
<target name="touch-errors-file" if="test.errors">
- <echo file="${hy.tests.reports}/test.errors"
+ <echo file="${tests.output}/test.errors"
append="true">prefs${line.separator}</echo>
</target>
Modified: harmony/enhanced/classlib/branches/java6/modules/prefs/make/exclude.common
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/prefs/make/exclude.common?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/prefs/make/exclude.common (original)
+++ harmony/enhanced/classlib/branches/java6/modules/prefs/make/exclude.common Sat Jul 4 08:38:13 2009
@@ -1 +1 @@
-org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java
+
Modified: harmony/enhanced/classlib/branches/java6/modules/prefs/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/prefs/make/hyproperties.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/prefs/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/prefs/make/hyproperties.xml Sat Jul 4 08:38:13 2009
@@ -43,7 +43,4 @@
<jdk location="../../deploy/jdk" />
<build location="../../build/classes" />
- <tests>
- <reports location="../../build/test_report" />
- </tests>
</hy>
Modified: harmony/enhanced/classlib/branches/java6/modules/prefs/src/main/java/java/util/prefs/AbstractPreferences.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/prefs/src/main/java/java/util/prefs/AbstractPreferences.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/prefs/src/main/java/java/util/prefs/AbstractPreferences.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/prefs/src/main/java/java/util/prefs/AbstractPreferences.java Sat Jul 4 08:38:13 2009
@@ -819,7 +819,7 @@
@Override
public String toString() {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append(isUserNode() ? "User" : "System"); //$NON-NLS-1$ //$NON-NLS-2$
sb.append(" Preference Node: "); //$NON-NLS-1$
sb.append(absolutePath());
Modified: harmony/enhanced/classlib/branches/java6/modules/prefs/src/main/java/java/util/prefs/RegistryPreferencesImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/prefs/src/main/java/java/util/prefs/RegistryPreferencesImpl.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/prefs/src/main/java/java/util/prefs/RegistryPreferencesImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/prefs/src/main/java/java/util/prefs/RegistryPreferencesImpl.java Sat Jul 4 08:38:13 2009
@@ -169,7 +169,7 @@
// handle the lower/upper case pitfall
private static String encodeWindowsStr(String str) {
char[] chars = str.toCharArray();
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
for (int i = 0; i < chars.length; i++) {
char c = chars[i];
if (c == '/') {
@@ -186,7 +186,7 @@
}
private static String decodeWindowsStr(String str) {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
char[] chars = str.toCharArray();
for (int i = 0; i < chars.length; i++) {
char c = chars[i];
Modified: harmony/enhanced/classlib/branches/java6/modules/prefs/src/main/java/java/util/prefs/XMLParser.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/prefs/src/main/java/java/util/prefs/XMLParser.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/prefs/src/main/java/java/util/prefs/XMLParser.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/prefs/src/main/java/java/util/prefs/XMLParser.java Sat Jul 4 08:38:13 2009
@@ -318,7 +318,7 @@
}
private static String htmlEncode(String s) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
char c;
for (int i = 0; i < s.length(); i++) {
c = s.charAt(i);
Modified: harmony/enhanced/classlib/branches/java6/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java Sat Jul 4 08:38:13 2009
@@ -105,7 +105,9 @@
((MockAbstractPreferences) pref)
.setResult(MockAbstractPreferences.NORMAL);
}
- pref.removeNode();
+ // make sure remove it successfully
+ parent.node("mock").removeNode();
+
} catch (Exception e) {
}
super.tearDown();
Modified: harmony/enhanced/classlib/branches/java6/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java Sat Jul 4 08:38:13 2009
@@ -39,8 +39,8 @@
prevFactory = System.getProperty("java.util.prefs.PreferencesFactory");
System.setProperty("java.util.prefs.PreferencesFactory", "java.util.prefs.FilePreferencesFactoryImpl");
- uroot = Preferences.userRoot();
- sroot = Preferences.systemRoot();
+ uroot = Preferences.userRoot().node("harmony_test");
+ sroot = Preferences.systemRoot().node("harmony_test");
}
@Override
@@ -48,6 +48,8 @@
if (prevFactory != null)
System.setProperty("java.util.prefs.PreferencesFactory", prevFactory);
+ uroot.removeNode();
+ sroot.removeNode();
uroot = null;
sroot = null;
}
@@ -84,31 +86,20 @@
String[] childNames = uroot.childrenNames();
assertEquals(2, childNames.length);
- for (int i = 0; i < childNames.length; i++) {
- System.out.println(childNames[i]);
- }
childNames = child1.childrenNames();
assertEquals(1, childNames.length);
- for (int i = 0; i < childNames.length; i++) {
- System.out.println(childNames[i]);
- }
childNames = child2.childrenNames();
assertEquals(0, childNames.length);
- for (int i = 0; i < childNames.length; i++) {
- System.out.println(childNames[i]);
- }
child1.removeNode();
childNames = uroot.childrenNames();
assertEquals(1, childNames.length);
- for (int i = 0; i < childNames.length; i++) {
- System.out.println(childNames[i]);
- }
- // child2.removeNode();
- // childNames = uroot.childrenNames();
- // assertEquals(0, childNames.length);
+
+ child2.removeNode();
+ childNames = uroot.childrenNames();
+ assertEquals(0, childNames.length);
child1 = sroot.node("child1");
child2 = sroot.node("child2");
@@ -116,22 +107,13 @@
childNames = sroot.childrenNames();
- for (int i = 0; i < childNames.length; i++) {
- System.out.println(childNames[i]);
- }
assertEquals(2, childNames.length);
childNames = child1.childrenNames();
assertEquals(1, childNames.length);
- for (int i = 0; i < childNames.length; i++) {
- System.out.println(childNames[i]);
- }
childNames = child2.childrenNames();
assertEquals(0, childNames.length);
- for (int i = 0; i < childNames.length; i++) {
- System.out.println(childNames[i]);
- }
child1.removeNode();
assertNotSame(child1, sroot.node("child1"));
@@ -139,9 +121,6 @@
sroot.node("child1").removeNode();
childNames = sroot.childrenNames();
assertEquals(1, childNames.length);
- for (int i = 0; i < childNames.length; i++) {
- System.out.println(childNames[i]);
- }
child2.removeNode();
childNames = sroot.childrenNames();
assertEquals(0, childNames.length);
@@ -219,7 +198,6 @@
@Override
public void checkPermission(Permission perm, Object ctx) {
if (perm instanceof FilePermission) {
- System.out.println(perm.getActions());
throw new SecurityException();
} else if (dflt != null) {
dflt.checkPermission(perm, ctx);
Modified: harmony/enhanced/classlib/branches/java6/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockAbstractPreferences.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockAbstractPreferences.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockAbstractPreferences.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockAbstractPreferences.java Sat Jul 4 08:38:13 2009
@@ -22,6 +22,7 @@
import java.util.Set;
import java.util.prefs.AbstractPreferences;
import java.util.prefs.BackingStoreException;
+import java.util.prefs.Preferences;
public class MockAbstractPreferences extends AbstractPreferences {
static final int NORMAL = 0;
@@ -167,7 +168,15 @@
@Override
protected void removeNodeSpi() throws BackingStoreException {
checkException();
- ((MockAbstractPreferences) parent()).childs.remove(name());
+ Preferences p = parent();
+ if (p instanceof MockAbstractPreferences) {
+ ((MockAbstractPreferences) p).childs.remove(name());
+ } else {
+ String[] children = p.childrenNames();
+ for (String child : children) {
+ p.node(child).removeNode();
+ }
+ }
}
@Override
Modified: harmony/enhanced/classlib/branches/java6/modules/print/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/print/build.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/print/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/print/build.xml Sat Jul 4 08:38:13 2009
@@ -23,6 +23,8 @@
<property name="hy.hdk" location="${basedir}/../../deploy" />
<import file="${hy.hdk}/build/ant/properties.xml" />
+ <property name="tests.output" location="../../build/test_report" />
+
<!-- set global properties for this build. -->
<xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
@@ -199,7 +201,7 @@
<target name="run-tests">
- <mkdir dir="${hy.tests.reports}" />
+ <mkdir dir="${tests.output}" />
<property name="test.jre.home" value="${hy.jdk}/jre" />
@@ -227,7 +229,7 @@
<formatter type="xml" />
- <batchtest todir="${hy.tests.reports}" haltonfailure="no">
+ <batchtest todir="${tests.output}" haltonfailure="no">
<fileset dir="${hy.print.src.test.java}">
<!-- if ${test.case} -->
@@ -246,12 +248,12 @@
</target>
<target name="touch-failures-file" if="test.failures">
- <echo file="${hy.tests.reports}/test.failures"
+ <echo file="${tests.output}/test.failures"
append="true">print${line.separator}</echo>
</target>
<target name="touch-errors-file" if="test.errors">
- <echo file="${hy.tests.reports}/test.errors"
+ <echo file="${tests.output}/test.errors"
append="true">print${line.separator}</echo>
</target>
Modified: harmony/enhanced/classlib/branches/java6/modules/print/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/print/make/hyproperties.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/print/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/print/make/hyproperties.xml Sat Jul 4 08:38:13 2009
@@ -42,7 +42,4 @@
<jdk location="../../deploy/jdk" />
<build location="../../build/classes" />
- <tests>
- <reports location="../../build/test_report" />
- </tests>
</hy>
Modified: harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/javax/print/attribute/SetOfIntegerSyntax.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/javax/print/attribute/SetOfIntegerSyntax.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/javax/print/attribute/SetOfIntegerSyntax.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/javax/print/attribute/SetOfIntegerSyntax.java Sat Jul 4 08:38:13 2009
@@ -280,7 +280,7 @@
@Override
public String toString() {
- StringBuffer stringSet = new StringBuffer("");
+ StringBuilder stringSet = new StringBuilder("");
for (int i = 0; i < canonicalArray.length; i++) {
if (i > 0) {
stringSet.append(",");
Modified: harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/Graphics2D2PS.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/Graphics2D2PS.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/Graphics2D2PS.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/Graphics2D2PS.java Sat Jul 4 08:38:13 2009
@@ -237,7 +237,7 @@
return;
}
- StringBuffer sb = new StringBuffer(text.length());
+ StringBuilder sb = new StringBuilder(text.length());
int lastX = x;
for (int i = 0; i < text.length(); i++) {
@@ -246,7 +246,7 @@
} else {
if (sb.length() > 0) {
lastX += drawPSString(sb.toString(), lastX, y);
- sb = new StringBuffer(text.length() - i);
+ sb = new StringBuilder(text.length() - i);
}
lastX += drawStringShape(String.valueOf(text.charAt(i)), lastX,
Modified: harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/MimeType.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/MimeType.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/MimeType.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/MimeType.java Sat Jul 4 08:38:13 2009
@@ -82,7 +82,7 @@
* returns canonical for MimeType object.
*/
public String getCanonicalForm() {
- StringBuffer s = new StringBuffer();
+ StringBuilder s = new StringBuilder();
s.append(aType);
s.append("/");
s.append(aSubtype);
Modified: harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/attributes/MediaMargins.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/attributes/MediaMargins.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/attributes/MediaMargins.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/attributes/MediaMargins.java Sat Jul 4 08:38:13 2009
@@ -268,7 +268,7 @@
* Throws IllegalArgumentException if units < 1.
*/
public String toString(int myunits, String unitsName) {
- StringBuffer s = new StringBuffer();
+ StringBuilder s = new StringBuilder();
s.append("x1=");
s.append(getX1(myunits));
s.append(" y1=");
Modified: harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/ipp/util/IppMimeType.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/ipp/util/IppMimeType.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/ipp/util/IppMimeType.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/print/src/main/java/common/org/apache/harmony/x/print/ipp/util/IppMimeType.java Sat Jul 4 08:38:13 2009
@@ -33,7 +33,7 @@
* returns IPP/CUPS specific for MimeType object.
*/
public String getIppSpecificForm() {
- StringBuffer s = new StringBuffer();
+ StringBuilder s = new StringBuilder();
s.append(getType());
s.append("/");
s.append(getSubtype());
Modified: harmony/enhanced/classlib/branches/java6/modules/print/src/main/native/print/windows/print.def
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/print/src/main/native/print/windows/print.def?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/print/src/main/native/print/windows/print.def (original)
+++ harmony/enhanced/classlib/branches/java6/modules/print/src/main/native/print/windows/print.def Sat Jul 4 08:38:13 2009
@@ -1,4 +1,4 @@
-LIBRARY JPEGENCODER
+LIBRARY PRINT
SECTIONS
.data READ WRITE
Modified: harmony/enhanced/classlib/branches/java6/modules/print/src/main/native/print/windows/print.rc
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/print/src/main/native/print/windows/print.rc?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/print/src/main/native/print/windows/print.rc (original)
+++ harmony/enhanced/classlib/branches/java6/modules/print/src/main/native/print/windows/print.rc Sat Jul 4 08:38:13 2009
@@ -32,11 +32,11 @@
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "The Apache Software Foundation.\0"
- VALUE "FileDescription", "JPEG encoder native code\0"
+ VALUE "FileDescription", "Print native code\0"
VALUE "FileVersion", "0.1\0"
- VALUE "InternalName", "jpegencoder\0"
+ VALUE "InternalName", "print\0"
VALUE "LegalCopyright", "(c) Copyright 2006 The Apache Software Foundation or its licensors, as applicable.\0"
- VALUE "OriginalFilename", "jpegencoder.dll\0"
+ VALUE "OriginalFilename", "print.dll\0"
VALUE "ProductName", "Apache Harmony\0"
VALUE "ProductVersion", "0.1\0"
END
Modified: harmony/enhanced/classlib/branches/java6/modules/regex/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/regex/build.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/regex/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/regex/build.xml Sat Jul 4 08:38:13 2009
@@ -24,6 +24,8 @@
<property name="hy.hdk" location="${basedir}/../../deploy" />
<import file="${hy.hdk}/build/ant/properties.xml" />
+ <property name="tests.output" location="../../build/test_report" />
+
<!-- set global properties for this build. -->
<xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
@@ -153,7 +155,7 @@
<target name="run-tests">
- <mkdir dir="${hy.tests.reports}" />
+ <mkdir dir="${tests.output}" />
<property name="test.jre.home" value="${hy.jdk}/jre" />
@@ -182,7 +184,7 @@
<formatter type="xml" />
- <batchtest todir="${hy.tests.reports}" haltonfailure="no" >
+ <batchtest todir="${tests.output}" haltonfailure="no" >
<fileset dir="${hy.regex.src.test.java}">
<!-- if ${test.case} -->
@@ -198,12 +200,12 @@
</target>
<target name="touch-failures-file" if="test.failures">
- <echo file="${hy.tests.reports}/test.failures"
+ <echo file="${tests.output}/test.failures"
append="true">regex${line.separator}</echo>
</target>
<target name="touch-errors-file" if="test.errors">
- <echo file="${hy.tests.reports}/test.errors"
+ <echo file="${tests.output}/test.errors"
append="true">regex${line.separator}</echo>
</target>
Modified: harmony/enhanced/classlib/branches/java6/modules/regex/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/regex/make/hyproperties.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/regex/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/regex/make/hyproperties.xml Sat Jul 4 08:38:13 2009
@@ -43,7 +43,4 @@
<jdk location="../../deploy/jdk" />
<build location="../../build/classes" />
- <tests>
- <reports location="../../build/test_report" />
- </tests>
</hy>
Modified: harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/CharClass.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/CharClass.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/CharClass.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/CharClass.java Sat Jul 4 08:38:13 2009
@@ -534,7 +534,7 @@
}
public String toString() {
- StringBuffer temp = new StringBuffer();
+ StringBuilder temp = new StringBuilder();
for (int i = bs.nextSetBit(0); i >= 0; i = bs
.nextSetBit(i + 1)) {
temp.append(Character.toChars(i));
@@ -556,7 +556,7 @@
//for debugging purposes only
public String toString() {
- StringBuffer temp = new StringBuffer();
+ StringBuilder temp = new StringBuilder();
for (int i = bits.nextSetBit(0); i >= 0; i = bits.nextSetBit(i + 1)) {
temp.append(Character.toChars(i));
temp.append('|');
Modified: harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/DecomposedCharSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/DecomposedCharSet.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/DecomposedCharSet.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/DecomposedCharSet.java Sat Jul 4 08:38:13 2009
@@ -195,7 +195,7 @@
*/
private String getDecomposedChar() {
if (decomposedCharUTF16 == null) {
- StringBuffer strBuff = new StringBuffer();
+ StringBuilder strBuff = new StringBuilder();
for (int i = 0; i < decomposedCharLength; i++) {
strBuff.append(Character.toChars(decomposedChar[i]));
Modified: harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/Lexer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/Lexer.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/Lexer.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/Lexer.java Sat Jul 4 08:38:13 2009
@@ -353,7 +353,7 @@
int [] decompHangul;
//result of canonical decomposition of input in UTF-16 encoding
- StringBuffer result = new StringBuffer();
+ StringBuilder result = new StringBuilder();
decompTable = HashDecompositions.getHashDecompositions();
canonClassesTable = CanClasses.getHashCanClasses();
@@ -853,7 +853,7 @@
* Parse character classes names and verifies correction of the syntax;
*/
private String parseCharClassName() {
- StringBuffer sb = new StringBuffer(10);
+ StringBuilder sb = new StringBuilder(10);
if (index < pattern.length - 2) {
// one symbol family
if (pattern[index] != '{') {
@@ -888,7 +888,7 @@
* Process given character in assumption that it's quantifier.
*/
private Quantifier processQuantifier(int ch) {
- StringBuffer sb = new StringBuffer(4);
+ StringBuilder sb = new StringBuilder(4);
int min = -1;
int max = Integer.MAX_VALUE;
while (index < pattern.length && (ch = pattern[nextIndex()]) != '}') {
@@ -1007,7 +1007,7 @@
* Process hexadecimal integer.
*/
private int readHex(String radixName, int max) {
- StringBuffer st = new StringBuffer(max);
+ StringBuilder st = new StringBuilder(max);
int length = pattern.length - 2;
int i;
for (i = 0; i < max && index < length; i++) {
Modified: harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/Matcher.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/Matcher.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/Matcher.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/Matcher.java Sat Jul 4 08:38:13 2009
@@ -109,7 +109,7 @@
if (replacementParts == null) {
return processedRepl;
} else {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
for (int i = 0; i < replacementParts.size(); i++) {
sb.append(replacementParts.get(i));
}
@@ -119,7 +119,7 @@
} else {
this.replacement = replacement;
char[] repl = replacement.toCharArray();
- StringBuffer res = new StringBuffer();
+ StringBuilder res = new StringBuilder();
replacementParts = null;
int index = 0;
@@ -455,7 +455,7 @@
// first check whether we have smth to quote
if (s.indexOf('\\') < 0 && s.indexOf('$') < 0)
return s;
- StringBuffer res = new StringBuffer(s.length() * 2);
+ StringBuilder res = new StringBuilder(s.length() * 2);
char ch;
int len = s.length();
Modified: harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/Pattern.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/Pattern.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/Pattern.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/Pattern.java Sat Jul 4 08:38:13 2009
@@ -1378,7 +1378,7 @@
* @return the quoted string.
*/
public static String quote(String s) {
- StringBuffer sb = new StringBuffer().append("\\Q"); //$NON-NLS-1$
+ StringBuilder sb = new StringBuilder().append("\\Q"); //$NON-NLS-1$
int apos = 0;
int k;
while ((k = s.indexOf("\\E", apos)) >= 0) { //$NON-NLS-1$
Modified: harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/UCISequenceSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/UCISequenceSet.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/UCISequenceSet.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/UCISequenceSet.java Sat Jul 4 08:38:13 2009
@@ -32,7 +32,7 @@
private String string = null;
UCISequenceSet(StringBuffer substring) {
- StringBuffer res = new StringBuffer();
+ StringBuilder res = new StringBuilder();
for (int i = 0; i < substring.length(); i++) {
res.append(Character.toLowerCase(Character.toUpperCase(substring
.charAt(i))));
Modified: harmony/enhanced/classlib/branches/java6/modules/rmi/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/rmi/build.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/rmi/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/rmi/build.xml Sat Jul 4 08:38:13 2009
@@ -23,6 +23,8 @@
<property name="hy.hdk" location="${basedir}/../../deploy" />
<import file="${hy.hdk}/build/ant/properties.xml" />
+ <property name="tests.output" location="../../build/test_report" />
+
<!-- set global properties for this build. -->
<xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
@@ -152,7 +154,7 @@
<pathelement path="../../build/tests"/>
</classpath>
- <batchtest todir="${hy.tests.reports}" haltonfailure="no" >
+ <batchtest todir="${tests.output}" haltonfailure="no" >
<fileset dir="${hy.rmi.src.test}/api/java">
<!-- if ${test.case} -->
<include name="${converted.tc}" if="test.case" />
@@ -170,12 +172,12 @@
</target>
<target name="touch-failures-file" if="test.failures">
- <echo file="${hy.tests.reports}/test.failures"
+ <echo file="${tests.output}/test.failures"
append="true">rmi${line.separator}</echo>
</target>
<target name="touch-errors-file" if="test.errors">
- <echo file="${hy.tests.reports}/test.errors"
+ <echo file="${tests.output}/test.errors"
append="true">rmi${line.separator}</echo>
</target>
@@ -217,7 +219,7 @@
<sequential>
<echo message="Running RMI @{description}" />
- <mkdir dir="${hy.tests.reports}" />
+ <mkdir dir="${tests.output}" />
<property name="test.jre.home" value="${hy.jdk}/jre" />
Modified: harmony/enhanced/classlib/branches/java6/modules/rmi/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/rmi/make/hyproperties.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/rmi/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/rmi/make/hyproperties.xml Sat Jul 4 08:38:13 2009
@@ -41,7 +41,4 @@
<jdk location="../../deploy/jdk" />
<build location="../../build/classes" />
- <tests>
- <reports location="../../build/test_report" />
- </tests>
</hy>
Modified: harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/common/EclipseJavaCompiler.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/common/EclipseJavaCompiler.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/common/EclipseJavaCompiler.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/common/EclipseJavaCompiler.java Sat Jul 4 08:38:13 2009
@@ -140,7 +140,7 @@
* {@inheritDoc}
*/
protected int run(String[] args) throws JavaCompilerException {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
for (int i = 0; i < args.length; i++) {
if (i > 0) {
Modified: harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/common/RMIUtil.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/common/RMIUtil.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/common/RMIUtil.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/common/RMIUtil.java Sat Jul 4 08:38:13 2009
@@ -268,7 +268,7 @@
* @return Method descriptor.
*/
public static String getMethodDescriptor(Method method) {
- StringBuffer buffer = new StringBuffer().append('(');
+ StringBuilder buffer = new StringBuilder().append('(');
Class[] parameters = method.getParameterTypes();
for (int i = 0; i < parameters.length; i++) {
@@ -308,7 +308,7 @@
*/
public static String getBasicMethodSignature(Method method) {
// Start with method name.
- StringBuffer buffer = new StringBuffer()
+ StringBuilder buffer = new StringBuilder()
.append(method.getName()).append('(');
Class[] parameters = method.getParameterTypes();
@@ -336,7 +336,7 @@
* getLongMethodSignature(java.lang.reflect.Method)"</code>.
*/
public static String getLongMethodSignature(Method method) {
- StringBuffer suffix = new StringBuffer();
+ StringBuilder suffix = new StringBuilder();
Class cls = method.getReturnType();
// Create signature suffix for array types.
@@ -363,7 +363,7 @@
*/
public static String getShortMethodSignature(Method method) {
// Start with method name.
- StringBuffer buffer = new StringBuffer(method.getName() + '(');
+ StringBuilder buffer = new StringBuilder(method.getName() + '(');
Class[] parameters = method.getParameterTypes();
// Append short names of parameter types.
Modified: harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/ClassStub.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/ClassStub.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/ClassStub.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/ClassStub.java Sat Jul 4 08:38:13 2009
@@ -344,7 +344,7 @@
* @return Stub class declaration statement.
*/
private String getStubClassDeclaration() {
- StringBuffer buffer = new StringBuffer("public final class " //$NON-NLS-1$
+ StringBuilder buffer = new StringBuilder("public final class " //$NON-NLS-1$
+ stubName + " extends java.rmi.server.RemoteStub" + EOLN //$NON-NLS-1$
+ indenter.tIncrease(2) + "implements "); //$NON-NLS-1$
@@ -409,7 +409,7 @@
* @return <code>operations</code> array declaration statement.
*/
private String getOperationsArrayDeclaration() {
- StringBuffer buffer = new StringBuffer(indenter.indent()
+ StringBuilder buffer = new StringBuilder(indenter.indent()
+ "private static final java.rmi.server.Operation[]" //$NON-NLS-1$
+ " operations = {"); //$NON-NLS-1$
@@ -450,7 +450,7 @@
* @return <code>dispatch()</code> method declaration statement.
*/
private String getDispatchMethod() {
- StringBuffer buffer = new StringBuffer(indenter.indent()
+ StringBuilder buffer = new StringBuilder(indenter.indent()
+ "public void dispatch(java.rmi.Remote obj, " //$NON-NLS-1$
+ "java.rmi.server.RemoteCall call, int opnum, long hash) " //$NON-NLS-1$
+ "throws java.lang.Exception {" + EOLN + indenter.hIncrease()); //$NON-NLS-1$
@@ -512,7 +512,7 @@
* @return Variables declaration block.
*/
private String getMethodVariablesDeclaration() {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
for (Iterator i = methods.iterator(); i.hasNext(); ) {
buffer.append(((MethodStub) i.next()).getVariableDecl());
@@ -528,7 +528,7 @@
* @return Static initialization declaration block.
*/
private String getStaticInitializationBlock() {
- StringBuffer buffer = new StringBuffer(indenter.indent()
+ StringBuilder buffer = new StringBuilder(indenter.indent()
+ "static {" + EOLN + indenter.increase() + "try {" + EOLN //$NON-NLS-1$ //$NON-NLS-2$
+ indenter.hIncrease());
@@ -568,7 +568,7 @@
* @return Stub constructors code.
*/
private String getStubConstructors() {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
if (v11) {
buffer.append(indenter.indent() + "public " + stubName //$NON-NLS-1$
@@ -591,7 +591,7 @@
* @return Stub method implementations code.
*/
private String getMethodImplementations() {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
for (Iterator i = methods.iterator(); i.hasNext(); ) {
buffer.append(EOLN + ((MethodStub) i.next()).getStubImpl());
@@ -778,7 +778,7 @@
* @return <code>dispatch()</code> method case for this method.
*/
String getDispatchCase() {
- StringBuffer buffer = new StringBuffer(indenter.indent()
+ StringBuilder buffer = new StringBuilder(indenter.indent()
+ "case " + number + ": { // " + shortSign + EOLN + EOLN //$NON-NLS-1$ //$NON-NLS-2$
+ indenter.hIncrease());
@@ -873,7 +873,7 @@
* @return Method variable initialization.
*/
String getVariableInit() {
- StringBuffer buffer = new StringBuffer(indenter.indent()
+ StringBuilder buffer = new StringBuilder(indenter.indent()
+ varName + " = " + interfaceName + ".class.getMethod(\"" //$NON-NLS-1$ //$NON-NLS-2$
+ name + "\", new java.lang.Class[] {"); //$NON-NLS-1$
@@ -916,7 +916,7 @@
* @return Stub implementation header for this method.
*/
private String getStubImplHeader() {
- StringBuffer buffer = new StringBuffer(indenter.indent()
+ StringBuilder buffer = new StringBuilder(indenter.indent()
+ "// Implementation of " + shortSign + EOLN //$NON-NLS-1$
+ indenter.indent() + "public " + retTypeName //$NON-NLS-1$
+ ' ' + name + '(');
@@ -949,7 +949,7 @@
* @return Stub implementation code for this method.
*/
private String getStubImplCodeV11() {
- StringBuffer buffer = new StringBuffer(indenter.indent()
+ StringBuilder buffer = new StringBuilder(indenter.indent()
+ "java.rmi.server.RemoteCall call = " //$NON-NLS-1$
+ "ref.newCall((java.rmi.server.RemoteObject) this, " //$NON-NLS-1$
+ "operations, " + number + ", " + interfaceHashVarName //$NON-NLS-1$ //$NON-NLS-2$
@@ -1016,7 +1016,7 @@
* @return Stub implementation code for this method.
*/
private String getStubImplCodeV12() {
- StringBuffer buffer = new StringBuffer(indenter.indent());
+ StringBuilder buffer = new StringBuilder(indenter.indent());
if (retType != void.class) {
buffer.append("java.lang.Object " + retVarName + " = "); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1057,7 +1057,7 @@
* @return Stub implementation catch block for this method.
*/
private String getStubImplCatchBlock() {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
for (Iterator i = catches.iterator(); i.hasNext(); ) {
buffer.append(indenter.indent() + "} catch (" //$NON-NLS-1$
Modified: harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/Indenter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/Indenter.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/Indenter.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/Indenter.java Sat Jul 4 08:38:13 2009
@@ -203,7 +203,7 @@
* @return Increased indent string.
*/
String tIncrease(int steps) {
- StringBuffer buffer = new StringBuffer(currentIndent);
+ StringBuilder buffer = new StringBuilder(currentIndent);
for (int i = 0; i < steps; i++) {
buffer.append(stepString);
Modified: harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicUtil.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicUtil.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicUtil.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/compiler/RmicUtil.java Sat Jul 4 08:38:13 2009
@@ -55,7 +55,7 @@
* @return Suitable name for a parameter.
*/
static String getParameterName(Class cls, int number) {
- StringBuffer buffer = new StringBuffer(paramPrefix);
+ StringBuilder buffer = new StringBuilder(paramPrefix);
while (cls.isArray()) {
buffer.append(arrayPrefix);
@@ -209,7 +209,7 @@
}
// For all other types, create the respective cast statement.
- StringBuffer buffer = new StringBuffer("(("); //$NON-NLS-1$
+ StringBuilder buffer = new StringBuilder("(("); //$NON-NLS-1$
buffer.append(RMIUtil.getCanonicalName(RMIUtil.getWrappingClass(cls)));
buffer.append(") " + varName + ')'); //$NON-NLS-1$