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 2007/08/02 23:27:58 UTC
svn commit: r562262 [5/6] - in /harmony/enhanced/classlib/branches/java6: ./
depends/build/platform/ modules/accessibility/ modules/annotation/
modules/applet/ modules/archive/ modules/auth/ modules/awt/
modules/awt/src/main/java/unix/org/apache/harmon...
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractList.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractList.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractList.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractList.java Thu Aug 2 14:27:53 2007
@@ -60,23 +60,25 @@
}
public void remove() {
- if (expectedModCount == modCount) {
- try {
- AbstractList.this.remove(lastPosition);
- } catch (IndexOutOfBoundsException e) {
- throw new IllegalStateException();
- } finally {
- if (modCount != expectedModCount) {
- expectedModCount++;
- }
- }
- if (pos == lastPosition) {
- pos--;
- }
- lastPosition = -1;
- } else {
+ if (this.lastPosition == -1) {
+ throw new IllegalStateException();
+ }
+
+ if (expectedModCount != modCount) {
+ throw new ConcurrentModificationException();
+ }
+
+ try {
+ AbstractList.this.remove(lastPosition);
+ } catch (IndexOutOfBoundsException e) {
throw new ConcurrentModificationException();
}
+
+ expectedModCount = modCount;
+ if (pos == lastPosition) {
+ pos--;
+ }
+ lastPosition = -1;
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/HashMap.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/HashMap.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/HashMap.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/HashMap.java Thu Aug 2 14:27:53 2007
@@ -535,7 +535,7 @@
if (++elementCount > threshold) {
rehash();
}
- entry = createHashedEntry(key, 0, 0);
+ entry = createHashedEntry(null, 0, 0);
}
} else {
int hash = key.hashCode();
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Stack.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Stack.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Stack.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Stack.java Thu Aug 2 14:27:53 2007
@@ -71,14 +71,14 @@
*/
@SuppressWarnings("unchecked")
public synchronized E pop() {
- try {
- int index = elementCount - 1;
- E obj = (E)elementData[index];
- removeElementAt(index);
- return obj;
- } catch (IndexOutOfBoundsException e) {
- throw new EmptyStackException();
- }
+ if(elementCount == 0){
+ throw new EmptyStackException();
+ }
+ final int index = --elementCount;
+ final E obj = (E)elementData[index];
+ elementData[index] = null;
+ modCount++;
+ return obj;
}
/**
@@ -92,7 +92,7 @@
* @see #peek
* @see #pop
*/
- public synchronized E push(E object) {
+ public E push(E object) {
addElement(object);
return object;
}
@@ -104,10 +104,22 @@
* @param o
* the object to be searched
*/
- public synchronized int search(Object o) {
- int index = lastIndexOf(o);
- if (index >= 0)
- return (elementCount - index);
- return -1;
+ public synchronized int search(Object object) {
+ final Object[] dumpArray = elementData;
+ final int size = elementCount;
+ if (object != null) {
+ for (int i = size - 1; i >= 0; i--) {
+ if (object.equals(dumpArray[i])) {
+ return size - i;
+ }
+ }
+ } else {
+ for (int i = size - 1; i >= 0; i--) {
+ if (dumpArray[i] == null) {
+ return size - i;
+ }
+ }
+ }
+ return -1;
}
}
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnectionManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/SecurityManager2Test.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/net/SecureCacheResponseTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/net/SecureCacheResponseTest.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/net/SecureCacheResponseTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/net/SecureCacheResponseTest.java Thu Aug 2 14:27:53 2007
@@ -1,85 +1,85 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.java.net;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.SecureCacheResponse;
-import java.security.Principal;
-import java.security.cert.Certificate;
-import java.util.List;
-import java.util.Map;
-
-import javax.net.ssl.SSLPeerUnverifiedException;
-
-import junit.framework.TestCase;
-
-public class SecureCacheResponseTest extends TestCase {
-
- public void testSecureCacheResponse() {
- // test constructor
- SecureCacheResponse sc = new MockCacheResponse();
- // nothing happened
- assertNull(sc.getCipherSuite());
- }
-
- class MockCacheResponse extends SecureCacheResponse{
-
- @Override
- public String getCipherSuite() {
- // do nothing
- return null;
- }
-
- @Override
- public List<Certificate> getLocalCertificateChain() {
- // do nothing
- return null;
- }
-
- @Override
- public Principal getLocalPrincipal() {
- // do nothing
- return null;
- }
-
- @Override
- public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
- // do nothing
- return null;
- }
-
- @Override
- public List<Certificate> getServerCertificateChain() throws SSLPeerUnverifiedException {
- // do nothing
- return null;
- }
-
- @Override
- public InputStream getBody() throws IOException {
- // do nothing
- return null;
- }
-
- @Override
- public Map<String, List<String>> getHeaders() throws IOException {
- // do nothing
- return null;
- }
-
- }
-}
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package tests.api.java.net;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.SecureCacheResponse;
+import java.security.Principal;
+import java.security.cert.Certificate;
+import java.util.List;
+import java.util.Map;
+
+import javax.net.ssl.SSLPeerUnverifiedException;
+
+import junit.framework.TestCase;
+
+public class SecureCacheResponseTest extends TestCase {
+
+ public void testSecureCacheResponse() {
+ // test constructor
+ SecureCacheResponse sc = new MockCacheResponse();
+ // nothing happened
+ assertNull(sc.getCipherSuite());
+ }
+
+ class MockCacheResponse extends SecureCacheResponse{
+
+ @Override
+ public String getCipherSuite() {
+ // do nothing
+ return null;
+ }
+
+ @Override
+ public List<Certificate> getLocalCertificateChain() {
+ // do nothing
+ return null;
+ }
+
+ @Override
+ public Principal getLocalPrincipal() {
+ // do nothing
+ return null;
+ }
+
+ @Override
+ public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
+ // do nothing
+ return null;
+ }
+
+ @Override
+ public List<Certificate> getServerCertificateChain() throws SSLPeerUnverifiedException {
+ // do nothing
+ return null;
+ }
+
+ @Override
+ public InputStream getBody() throws IOException {
+ // do nothing
+ return null;
+ }
+
+ @Override
+ public Map<String, List<String>> getHeaders() throws IOException {
+ // do nothing
+ return null;
+ }
+
+ }
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/net/SecureCacheResponseTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/AbstractListTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/AbstractListTest.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/AbstractListTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/AbstractListTest.java Thu Aug 2 14:27:53 2007
@@ -297,4 +297,45 @@
}
protected void doneSuite() {}
+
+ class MockRemoveFailureArrayList<E> extends AbstractList<E> {
+
+ @Override
+ public E get(int location) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int size() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public E remove(int idx) {
+ modCount+=2;
+ return null;
+ }
+
+ public int getModCount(){
+ return modCount;
+ }
+ }
+
+ //test remove for failure by inconsistency of modCount and expectedModCount
+ public void test_remove(){
+ MockRemoveFailureArrayList<String> mrfal = new MockRemoveFailureArrayList<String>();
+ Iterator<String> imrfal= mrfal.iterator();
+ imrfal.next();
+ imrfal.remove();
+ try{
+ imrfal.remove();
+ }
+ catch(ConcurrentModificationException e){
+ fail("Excepted to catch IllegalStateException not ConcurrentModificationException");
+ }
+ catch(IllegalStateException e){
+ //Excepted to catch IllegalStateException here
+ }
+ }
}
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/AbstractSequentialListTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/AbstractSequentialListTest.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/AbstractSequentialListTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/AbstractSequentialListTest.java Thu Aug 2 14:27:53 2007
@@ -1,95 +1,95 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package tests.api.java.util;
-
-import java.util.AbstractSequentialList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.ListIterator;
-
-import junit.framework.TestCase;
-
-public class AbstractSequentialListTest extends TestCase {
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- class ASLT<E> extends AbstractSequentialList<E> {
-
- LinkedList<E> l = new LinkedList<E>();
-
- @Override
- public ListIterator<E> listIterator(int index) {
- return l.listIterator(index);
- }
-
- @Override
- public int size() {
- return l.size();
- }
- }
-
- /**
- * @tests {@link java.util.AbstractSequentialList#addAll(int, java.util.Collection)}
- */
- public void test_addAll_ILCollection() {
- AbstractSequentialList<String> al = new ASLT<String>();
- String[] someList = { "Aardvark", //$NON-NLS-1$
- "Bear", //$NON-NLS-1$
- "Chimpanzee", //$NON-NLS-1$
- "Duck" }; //$NON-NLS-1$
- Collection<String> c = Arrays.asList(someList);
- al.addAll(c);
- assertTrue("Should return true", al.addAll(2, c)); //$NON-NLS-1$
- }
-
- public void test_set() throws Exception {
- MyAbstractSequentialList list = new MyAbstractSequentialList();
- try {
- list.set(0, new Object());
- fail("should throw IndexOutOfBoundsException");
- } catch (IndexOutOfBoundsException e) {
- // expected
- }
- }
-
- public static class MyAbstractSequentialList extends AbstractSequentialList {
-
- private LinkedList list = new LinkedList();
-
- public ListIterator listIterator(int index) {
- ListIterator iter = list.listIterator();
- for (int i = 0; i < index; i++) {
- iter.next();
- }
- return iter;
- }
-
- @Override
- public int size() {
- return list.size();
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package tests.api.java.util;
+
+import java.util.AbstractSequentialList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.ListIterator;
+
+import junit.framework.TestCase;
+
+public class AbstractSequentialListTest extends TestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ class ASLT<E> extends AbstractSequentialList<E> {
+
+ LinkedList<E> l = new LinkedList<E>();
+
+ @Override
+ public ListIterator<E> listIterator(int index) {
+ return l.listIterator(index);
+ }
+
+ @Override
+ public int size() {
+ return l.size();
+ }
+ }
+
+ /**
+ * @tests {@link java.util.AbstractSequentialList#addAll(int, java.util.Collection)}
+ */
+ public void test_addAll_ILCollection() {
+ AbstractSequentialList<String> al = new ASLT<String>();
+ String[] someList = { "Aardvark", //$NON-NLS-1$
+ "Bear", //$NON-NLS-1$
+ "Chimpanzee", //$NON-NLS-1$
+ "Duck" }; //$NON-NLS-1$
+ Collection<String> c = Arrays.asList(someList);
+ al.addAll(c);
+ assertTrue("Should return true", al.addAll(2, c)); //$NON-NLS-1$
+ }
+
+ public void test_set() throws Exception {
+ MyAbstractSequentialList list = new MyAbstractSequentialList();
+ try {
+ list.set(0, new Object());
+ fail("should throw IndexOutOfBoundsException");
+ } catch (IndexOutOfBoundsException e) {
+ // expected
+ }
+ }
+
+ public static class MyAbstractSequentialList extends AbstractSequentialList {
+
+ private LinkedList list = new LinkedList();
+
+ public ListIterator listIterator(int index) {
+ ListIterator iter = list.listIterator();
+ for (int i = 0; i < index; i++) {
+ iter.next();
+ }
+ return iter;
+ }
+
+ @Override
+ public int size() {
+ return list.size();
+ }
+ }
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/AbstractSequentialListTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/StackTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/StackTest.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/StackTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/StackTest.java Thu Aug 2 14:27:53 2007
@@ -155,6 +155,45 @@
assertEquals("Search returned incorrect value for search for null--wanted -1",
-1, s.search(null));
}
+
+ static class BugStack<E> extends Stack<E>{
+ /**
+ *
+ */
+ private static final long serialVersionUID = -9133762075342926141L;
+
+ /**
+ *
+ */
+ public void setLength(int elementCount)
+ {
+ this.elementCount = elementCount;
+ }
+
+ public int getLength()
+ {
+ return elementCount;
+ }
+ }
+
+ //test for wrong exception threw by pop method
+ public void test_pop_modify_elementCount(){
+ BugStack<String> testStack = new BugStack<String>();
+ testStack.push("A");
+ testStack.push("B");
+ testStack.setLength(20);
+ try{
+ testStack.pop();
+ }
+ catch(ArrayIndexOutOfBoundsException e)
+ {
+ //Expected to throw ArrayIndexOutOfBoundsException here
+ }
+ catch(EmptyStackException e)
+ {
+ fail("Should throw ArrayIndexOutOfBoundsException here");
+ }
+ }
/**
* Sets up the fixture, for example, open a network connection. This method
Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/impl/org/apache/harmony/tests/internal/net/www/protocol/http/PersistenceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/math/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/math/build.xml?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/math/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/math/build.xml Thu Aug 2 14:27:53 2007
@@ -60,8 +60,8 @@
<delete file="${hy.jdk}/jre/lib/boot/math-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.math.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="compile-java">
Modified: harmony/enhanced/classlib/branches/java6/modules/misc/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/misc/build.xml?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/misc/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/misc/build.xml Thu Aug 2 14:27:53 2007
@@ -62,8 +62,8 @@
<delete file="${hy.jdk}/jre/lib/boot/${hy.misc.packaging.jarname}-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.misc.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="compile-java">
Modified: harmony/enhanced/classlib/branches/java6/modules/nio/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/build.xml?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/build.xml Thu Aug 2 14:27:53 2007
@@ -83,8 +83,8 @@
<delete file="${hy.jdk}/jre/lib/boot/nio-src.jar" />
<delete includeemptydirs="true" failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.nio.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<!-- Clean natives. -->
Modified: harmony/enhanced/classlib/branches/java6/modules/nio_char/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio_char/META-INF/MANIFEST.MF?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio_char/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio_char/META-INF/MANIFEST.MF Thu Aug 2 14:27:53 2007
@@ -15,11 +15,13 @@
java.io,
java.lang,
java.lang.ref,
+ java.lang.reflect,
java.net,
java.nio,
java.security,
java.util,
org.apache.harmony.kernel.vm,
+ org.apache.harmony.nio,
org.apache.harmony.testframework.serialization;hy_usage=test;resolution:=optional,
tests.util;hy_usage=test;resolution:=optional
Export-Package: java.nio.charset,
Modified: harmony/enhanced/classlib/branches/java6/modules/nio_char/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio_char/build.xml?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio_char/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio_char/build.xml Thu Aug 2 14:27:53 2007
@@ -81,8 +81,8 @@
<delete file="${hy.jdk}/jre/lib/boot/${hy.nio_char.packaging.jarname}-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.nio_char.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="compile-java">
Modified: harmony/enhanced/classlib/branches/java6/modules/nio_char/src/main/java/java/nio/charset/Charset.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio_char/src/main/java/java/nio/charset/Charset.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio_char/src/main/java/java/nio/charset/Charset.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio_char/src/main/java/java/nio/charset/Charset.java Thu Aug 2 14:27:53 2007
@@ -73,52 +73,33 @@
* </p>
*
* @see java.nio.charset.spi.CharsetProvider
- *
*/
public abstract class Charset implements Comparable<Charset> {
/*
- * --------------------------------------------------------------------
- * Constants
- * --------------------------------------------------------------------
- */
-
- /*
- * the name of configuration files where charset provider class names can be
+ * The name of configuration files where charset provider class names can be
* specified.
*/
private static final String PROVIDER_CONFIGURATION_FILE_NAME = "META-INF/services/java.nio.charset.spi.CharsetProvider"; //$NON-NLS-1$
/*
- * the encoding of configuration files
+ * The encoding of configuration files
*/
private static final String PROVIDER_CONFIGURATION_FILE_ENCODING = "UTF-8"; //$NON-NLS-1$
/*
- * the comment string used in configuration files
+ * The comment string used in configuration files
*/
private static final String PROVIDER_CONFIGURATION_FILE_COMMENT = "#"; //$NON-NLS-1$
private static ClassLoader systemClassLoader;
- /*
- * --------------------------------------------------------------------
- * Class variables
- * --------------------------------------------------------------------
- */
-
// built in provider instance, assuming thread-safe
private static CharsetProviderImpl _builtInProvider = null;
// cached built in charsets
private static TreeMap<String, Charset> _builtInCharsets = null;
- /*
- * --------------------------------------------------------------------
- * Instance variables
- * --------------------------------------------------------------------
- */
-
private final String canonicalName;
// the aliases set
@@ -134,15 +115,12 @@
private static HashMap<String, CharsetEncoder> cachedCharsetEncoderTable = new HashMap<String, CharsetEncoder>();
private CharsetEncoder cachedEncoder = null;
- private CharsetDecoder cachedDecoder = null;
- /*
- * -------------------------------------------------------------------
- * Global initialization
- * -------------------------------------------------------------------
- */
+
+ private CharsetDecoder cachedDecoder = null;
+
static {
/*
- * create built-in charset provider even if no privilege to access
+ * Create built-in charset provider even if no privilege to access
* charset provider.
*/
_builtInProvider = AccessController
@@ -153,12 +131,6 @@
});
}
- /*
- * -------------------------------------------------------------------
- * Constructors
- * -------------------------------------------------------------------
- */
-
/**
* Constructs a <code>Charset</code> object. Duplicated aliases are
* ignored.
@@ -171,11 +143,8 @@
* on an illegal value being supplied for either
* <code>canonicalName</code> or for any element of
* <code>aliases</code>.
- *
*/
- protected Charset(String canonicalName, String[] aliases)
- throws IllegalCharsetNameException {
- // throw IllegalArgumentException if name is null
+ protected Charset(String canonicalName, String[] aliases) {
if (null == canonicalName) {
throw new NullPointerException();
}
@@ -193,12 +162,6 @@
}
/*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
-
- /*
* Checks whether a character is a special character that can be used in
* charset names, other than letters and digits.
*/
@@ -439,7 +402,7 @@
systemClassLoader);
cp = c.newInstance();
} catch (SecurityException e) {
- throw e;
+ throw e;
} catch (Exception e) {
throw new Error(e.getMessage(), e);
}
@@ -487,7 +450,7 @@
return cs;
}
// Try built-in charsets
- if(_builtInProvider == null) {
+ if (_builtInProvider == null) {
_builtInProvider = new CharsetProviderImpl();
}
cs = _builtInProvider.charsetForName(charsetName);
@@ -557,8 +520,7 @@
* @throws UnsupportedCharsetException
* If the desired charset is not supported by this runtime.
*/
- public static Charset forName(String charsetName)
- throws IllegalCharsetNameException, UnsupportedCharsetException {
+ public static Charset forName(String charsetName) {
Charset c = forNameInternal(charsetName);
if (null == c) {
throw new UnsupportedCharsetException(charsetName);
@@ -575,8 +537,7 @@
* @throws IllegalCharsetNameException
* If the specified charset name is illegal.
*/
- public static boolean isSupported(String charsetName)
- throws IllegalCharsetNameException {
+ public static boolean isSupported(String charsetName) {
Charset cs = forNameInternal(charsetName);
return (null != cs);
}
@@ -680,7 +641,7 @@
if (cachedEncoder == null) {
cachedEncoder = getCachedCharsetEncoder(canonicalName);
}
-
+
try {
synchronized (cachedEncoder) {
return cachedEncoder.encode(buffer);
@@ -695,8 +656,7 @@
*/
private CharsetEncoder getCachedCharsetEncoder(String name) {
synchronized (cachedCharsetEncoderTable) {
- CharsetEncoder e = cachedCharsetEncoderTable
- .get(name);
+ CharsetEncoder e = cachedCharsetEncoderTable.get(name);
if (null == e) {
e = this.newEncoder();
e.onMalformedInput(CodingErrorAction.REPLACE);
@@ -753,8 +713,7 @@
*/
private CharsetDecoder getCachedCharsetDecoder(String name) {
synchronized (cachedCharsetDecoderTable) {
- CharsetDecoder d = cachedCharsetDecoderTable
- .get(name);
+ CharsetDecoder d = cachedCharsetDecoderTable.get(name);
if (null == d) {
d = this.newDecoder();
d.onMalformedInput(CodingErrorAction.REPLACE);
Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/build.xml?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/build.xml Thu Aug 2 14:27:53 2007
@@ -68,8 +68,8 @@
<delete file="${hy.jdk}/jre/lib/boot/pack200-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.pack200.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="compile-java">
Propchange: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/freebsd.x86/hysignal_context.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/freebsd.x86/hysignal_context.h
------------------------------------------------------------------------------
svn:eol-style = native
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?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/prefs/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/prefs/build.xml Thu Aug 2 14:27:53 2007
@@ -77,8 +77,8 @@
<delete file="${hy.jdk}/jre/lib/boot/prefs-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.prefs.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<!-- Clean natives. Currently there are only windows natives for
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?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/print/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/print/build.xml Thu Aug 2 14:27:53 2007
@@ -69,8 +69,8 @@
<delete file="${hy.jdk}/jre/lib/boot/${hy.print.packaging.jarname}-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.print.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="clean-native" if="is.windows">
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?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/regex/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/regex/build.xml Thu Aug 2 14:27:53 2007
@@ -61,8 +61,8 @@
<delete file="${hy.jdk}/jre/lib/boot/regex-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.regex.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="compile-java">
Modified: harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/JointSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/JointSet.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/JointSet.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/regex/src/main/java/java/util/regex/JointSet.java Thu Aug 2 14:27:53 2007
@@ -22,14 +22,12 @@
package java.util.regex;
import java.util.ArrayList;
+import java.util.Iterator;
/**
* Represents group, which is alternation of other subexpression.
* One should think about "group" in this model as JointSet opening
* group and corresponding FSet closing group.
- *
- * @author Nikolay A. Kuznetsov
- * @version $Revision: 1.12.2.2 $
*/
class JointSet extends AbstractSet {
@@ -53,6 +51,9 @@
*/
public int matches(int stringIndex, CharSequence testString,
MatchResultImpl matchResult) {
+ if (children == null) {
+ return -1;
+ }
int start = matchResult.getStart(groupIndex);
matchResult.setStart(groupIndex, stringIndex);
int size = children.size();
@@ -84,9 +85,11 @@
}
public boolean first(AbstractSet set) {
- for (java.util.Iterator i = children.iterator(); i.hasNext();) {
- if (((AbstractSet) i.next()).first(set)) {
- return true;
+ if (children != null) {
+ for (Iterator i = children.iterator(); i.hasNext();) {
+ if (((AbstractSet) i.next()).first(set)) {
+ return true;
+ }
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/PatternTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/PatternTest.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/PatternTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/PatternTest.java Thu Aug 2 14:27:53 2007
@@ -511,13 +511,15 @@
assertTrue(mat.matches());
}
- public void testBug181() {
- Pattern.compile("[\\t-\\r]");
- }
+ public void testRegressions() {
+ // Bug 181
+ Pattern.compile("[\\t-\\r]");
- public void _testBug187() {
- Pattern
- .compile("|(?idmsux-idmsux)|(?idmsux-idmsux)|[^|\\[-\\0274|\\,-\\\\[^|W\\}\\nq\\x65\\002\\xFE\\05\\06\\00\\x66\\x47i\\,\\xF2\\=\\06\\u0EA4\\x9B\\x3C\\f\\|\\{\\xE5\\05\\r\\u944A\\xCA\\e|\\x19\\04\\x07\\04\\u607B\\023\\0073\\x91Tr\\0150\\x83]]?(?idmsux-idmsux:\\p{Alpha}{7}?)||(?<=[^\\uEC47\\01\\02\\u3421\\a\\f\\a\\013q\\035w\\e])(?<=\\p{Punct}{0,}?)(?=^\\p{Lower})(?!\\b{8,14})(?<![|\\00-\\0146[^|\\04\\01\\04\\060\\f\\u224DO\\x1A\\xC4\\00\\02\\0315\\0351\\u84A8\\xCBt\\xCC\\06|\\0141\\00\\=\\e\\f\\x6B\\0026Tb\\040\\x76xJ&&[\\\\-\\]\\05\\07\\02\\u2DAF\\t\\x9C\\e\\0023\\02\\,X\\e|\\u6058flY\\u954C]]]{5}?)(?<=\\p{Sc}{8}+)[^|\\026-\\u89BA|o\\u6277\\t\\07\\x50&&\\p{Punct}]{8,14}+((?<=^\\p{Punct})|(?idmsux-idmsux)||(?>[\\x3E-\\]])|(?idmsux-idmsux:\\p{Punct})|(?<![\\0111\\0371\\xDF\\u6A49\\07\\u2A4D\\00\\0212\\02Xd-\\xED[^\\a-\\0061|\\0257\\04\\f\\[\\0266\\043\\03\\x2D\\042&&[^\\f-\\]&&\\s]]])|(?>[|\\n\\042\\uB09F\\06\\u0F2B\\uC96D\\x89\\uC166\\xAA|\\04-\\][^|\\a\\|\\rx\\04\\uA770\
\n\\02\\t\\052\\056\\0274\\|\\=\\07\\e|\\00-\\x1D&&[^\\005\\uB15B\\uCDAC\\n\\x74\\0103\\0147\\uD91B\\n\\062G\\u9B4B\\077\\}\\0324&&[^\\0302\\,\\0221\\04\\u6D16\\04xy\\uD193\\[\\061\\06\\045\\x0F|\\e\\xBB\\f\\u1B52\\023\\u3AD2\\033\\007\\022\\}\\x66\\uA63FJ-\\0304]]]]{0,0})||(?<![^|\\0154U\\u0877\\03\\fy\\n\\|\\0147\\07-\\=[|q\\u69BE\\0243\\rp\\053\\02\\x33I\\u5E39\\u9C40\\052-\\xBC[|\\0064-\\?|\\uFC0C\\x30\\0060\\x45\\\\\\02\\?p\\xD8\\0155\\07\\0367\\04\\uF07B\\000J[^|\\0051-\\{|\\u9E4E\\u7328\\]\\u6AB8\\06\\x71\\a\\]\\e\\|KN\\u06AA\\0000\\063\\u2523&&[\\005\\0277\\x41U\\034\\}R\\u14C7\\u4767\\x09\\n\\054Ev\\0144\\<\\f\\,Q-\\xE4]]]]]{3}+)|(?>^+)|(?![^|\\|\\nJ\\t\\<\\04E\\\\\\t\\01\\\\\\02\\|\\=\\}\\xF3\\uBEC2\\032K\\014\\uCC5F\\072q\\|\\0153\\xD9\\0322\\uC6C8[^\\t\\0342\\x34\\x91\\06\\{\\xF1\\a\\u1710\\?\\xE7\\uC106\\02pF\\<&&[^|\\]\\064\\u381D\\u50CF\\eO&&[^|\\06\\x2F\\04\\045\\032\\u8536W\\0377\\0017|\\x06\\uE5FA\\05\\xD4\\020\\04c\\xFC\\02H\\x0A\\r]]]]+?)(?idmsux-idmsux)|
(?<![|\\r-\\,&&[I\\t\\r\\0201\\xDB\\e&&[^|\\02\\06\\00\\<\\a\\u7952\\064\\051\\073\\x41\\?n\\040\\0053\\031&&[\\x15-\\|]]]]{8,11}?)(?![^|\\<-\\uA74B\\xFA\\u7CD2\\024\\07n\\<\\x6A\\0042\\uE4FF\\r\\u896B\\[\\=\\042Y&&^\\p{ASCII}]++)|(?<![R-\\|&&[\\a\\0120A\\u6145\\<\\050-d[|\\e-\\uA07C|\\016-\\u80D9]]]{1,}+)|(?idmsux-idmsux)|(?idmsux-idmsux)|(?idmsux-idmsux:\\B{6,}?)|(?<=\\D{5,8}?)|(?>[\\{-\\0207|\\06-\\0276\\p{XDigit}])(?idmsux-idmsux:[^|\\x52\\0012\\]u\\xAD\\0051f\\0142\\\\l\\|\\050\\05\\f\\t\\u7B91\\r\\u7763\\{|h\\0104\\a\\f\\0234\\u2D4F&&^\\P{InGreek}]))");
+ // HARMONY-4472
+ Pattern.compile("a*.+");
+
+ // Bug187
+ Pattern.compile("|(?idmsux-idmsux)|(?idmsux-idmsux)|[^|\\[-\\0274|\\,-\\\\[^|W\\}\\nq\\x65\\002\\xFE\\05\\06\\00\\x66\\x47i\\,\\xF2\\=\\06\\u0EA4\\x9B\\x3C\\f\\|\\{\\xE5\\05\\r\\u944A\\xCA\\e|\\x19\\04\\x07\\04\\u607B\\023\\0073\\x91Tr\\0150\\x83]]?(?idmsux-idmsux:\\p{Alpha}{7}?)||(?<=[^\\uEC47\\01\\02\\u3421\\a\\f\\a\\013q\\035w\\e])(?<=\\p{Punct}{0,}?)(?=^\\p{Lower})(?!\\b{8,14})(?<![|\\00-\\0146[^|\\04\\01\\04\\060\\f\\u224DO\\x1A\\xC4\\00\\02\\0315\\0351\\u84A8\\xCBt\\xCC\\06|\\0141\\00\\=\\e\\f\\x6B\\0026Tb\\040\\x76xJ&&[\\\\-\\]\\05\\07\\02\\u2DAF\\t\\x9C\\e\\0023\\02\\,X\\e|\\u6058flY\\u954C]]]{5}?)(?<=\\p{Sc}{8}+)[^|\\026-\\u89BA|o\\u6277\\t\\07\\x50&&\\p{Punct}]{8,14}+((?<=^\\p{Punct})|(?idmsux-idmsux)||(?>[\\x3E-\\]])|(?idmsux-idmsux:\\p{Punct})|(?<![\\0111\\0371\\xDF\\u6A49\\07\\u2A4D\\00\\0212\\02Xd-\\xED[^\\a-\\0061|\\0257\\04\\f\\[\\0266\\043\\03\\x2D\\042&&[^\\f-\\]&&\\s]]])|(?>[|\\n\\042\\uB09F\\06\\u0F2B\\uC96D\\x89\\uC166\\xAA|\\04-\\][^|\\a\\|\\rx\
\04\\uA770\\n\\02\\t\\052\\056\\0274\\|\\=\\07\\e|\\00-\\x1D&&[^\\005\\uB15B\\uCDAC\\n\\x74\\0103\\0147\\uD91B\\n\\062G\\u9B4B\\077\\}\\0324&&[^\\0302\\,\\0221\\04\\u6D16\\04xy\\uD193\\[\\061\\06\\045\\x0F|\\e\\xBB\\f\\u1B52\\023\\u3AD2\\033\\007\\022\\}\\x66\\uA63FJ-\\0304]]]]{0,0})||(?<![^|\\0154U\\u0877\\03\\fy\\n\\|\\0147\\07-\\=[|q\\u69BE\\0243\\rp\\053\\02\\x33I\\u5E39\\u9C40\\052-\\xBC[|\\0064-\\?|\\uFC0C\\x30\\0060\\x45\\\\\\02\\?p\\xD8\\0155\\07\\0367\\04\\uF07B\\000J[^|\\0051-\\{|\\u9E4E\\u7328\\]\\u6AB8\\06\\x71\\a\\]\\e\\|KN\\u06AA\\0000\\063\\u2523&&[\\005\\0277\\x41U\\034\\}R\\u14C7\\u4767\\x09\\n\\054Ev\\0144\\<\\f\\,Q-\\xE4]]]]]{3}+)|(?>^+)|(?![^|\\|\\nJ\\t\\<\\04E\\\\\\t\\01\\\\\\02\\|\\=\\}\\xF3\\uBEC2\\032K\\014\\uCC5F\\072q\\|\\0153\\xD9\\0322\\uC6C8[^\\t\\0342\\x34\\x91\\06\\{\\xF1\\a\\u1710\\?\\xE7\\uC106\\02pF\\<&&[^|\\]\\064\\u381D\\u50CF\\eO&&[^|\\06\\x2F\\04\\045\\032\\u8536W\\0377\\0017|\\x06\\uE5FA\\05\\xD4\\020\\04c\\xFC\\02H\\x0A\\r]]]]+?)(?idms
ux-idmsux)|(?<![|\\r-\\,&&[I\\t\\r\\0201\\xDB\\e&&[^|\\02\\06\\00\\<\\a\\u7952\\064\\051\\073\\x41\\?n\\040\\0053\\031&&[\\x15-\\|]]]]{8,11}?)(?![^|\\<-\\uA74B\\xFA\\u7CD2\\024\\07n\\<\\x6A\\0042\\uE4FF\\r\\u896B\\[\\=\\042Y&&^\\p{ASCII}]++)|(?<![R-\\|&&[\\a\\0120A\\u6145\\<\\050-d[|\\e-\\uA07C|\\016-\\u80D9]]]{1,}+)|(?idmsux-idmsux)|(?idmsux-idmsux)|(?idmsux-idmsux:\\B{6,}?)|(?<=\\D{5,8}?)|(?>[\\{-\\0207|\\06-\\0276\\p{XDigit}])(?idmsux-idmsux:[^|\\x52\\0012\\]u\\xAD\\0051f\\0142\\\\l\\|\\050\\05\\f\\t\\u7B91\\r\\u7763\\{|h\\0104\\a\\f\\0234\\u2D4F&&^\\P{InGreek}]))");
}
public void testOrphanQuantifiers() {
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?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/rmi/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/rmi/build.xml Thu Aug 2 14:27:53 2007
@@ -62,8 +62,8 @@
<delete file="${hy.jdk}/jre/lib/boot/${hy.rmi.packaging.jarname}-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.rmi.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="compile-java">
Propchange: harmony/enhanced/classlib/branches/java6/modules/rmi/src/test/api/java/org/apache/harmony/rmi/tests/javax/rmi/ssl/SslRMIClientSocketFactoryTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/rmi/src/test/api/java/org/apache/harmony/rmi/tests/javax/rmi/ssl/SslRMIServerSocketFactoryTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/security/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/security/build.xml?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/security/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/security/build.xml Thu Aug 2 14:27:53 2007
@@ -112,8 +112,8 @@
<delete dir="${tests.resources.dir}" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.security.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="compile-java">
Modified: harmony/enhanced/classlib/branches/java6/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java Thu Aug 2 14:27:53 2007
@@ -1,243 +1,243 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.security.tests.java.security;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.security.Key;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.KeyStoreSpi;
-import java.security.NoSuchAlgorithmException;
-import java.security.Provider;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.util.Date;
-import java.util.Enumeration;
-
-import junit.framework.TestCase;
-
-public class KeyStore3Test extends TestCase {
-
- private KeyStore mockKeyStore;
-
- private KeyPair keyPair;
-
- private Certificate certificate;
-
- public KeyStore3Test() throws Exception {
- KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("DSA");
- keyPair = keyPairGenerator.generateKeyPair();
-
- String certificateData = "-----BEGIN CERTIFICATE-----\n"
- + "MIICZTCCAdICBQL3AAC2MA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw\n"
- + "HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl\n"
- + "IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NzAyMjAwMDAwMDBa\n"
- + "Fw05ODAyMjAyMzU5NTlaMIGWMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZv\n"
- + "cm5pYTESMBAGA1UEBxMJUGFsbyBBbHRvMR8wHQYDVQQKExZTdW4gTWljcm9zeXN0\n"
- + "ZW1zLCBJbmMuMSEwHwYDVQQLExhUZXN0IGFuZCBFdmFsdWF0aW9uIE9ubHkxGjAY\n"
- + "BgNVBAMTEWFyZ29uLmVuZy5zdW4uY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB\n"
- + "iQKBgQCofmdY+PiUWN01FOzEewf+GaG+lFf132UpzATmYJkA4AEA/juW7jSi+LJk\n"
- + "wJKi5GO4RyZoyimAL/5yIWDV6l1KlvxyKslr0REhMBaD/3Z3EsLTTEf5gVrQS6sT\n"
- + "WMoSZAyzB39kFfsB6oUXNtV8+UKKxSxKbxvhQn267PeCz5VX2QIDAQABMA0GCSqG\n"
- + "SIb3DQEBAgUAA34AXl3at6luiV/7I9MN5CXYoPJYI8Bcdc1hBagJvTMcmlqL2uOZ\n"
- + "H9T5hNMEL9Tk6aI7yZPXcw/xI2K6pOR/FrMp0UwJmdxX7ljV6ZtUZf7pY492UqwC\n"
- + "1777XQ9UEZyrKJvF5ntleeO0ayBqLGVKCWzWZX9YsXCpv47FNLZbupE=\n"
- + "-----END CERTIFICATE-----\n";
-
- ByteArrayInputStream certArray = new ByteArrayInputStream(
- certificateData.getBytes());
- CertificateFactory cf = CertificateFactory.getInstance("X.509");
- certificate = cf.generateCertificate(certArray);
- }
-
- public void test_load() throws Exception {
- // No exception should be thrown out.
- mockKeyStore.load(null);
- }
-
- public void test_store() throws Exception {
- try {
- mockKeyStore.store(null);
- fail("should throw KeyStoreException: not initialized");
- } catch (KeyStoreException e) {
- // expected
- }
-
- // No exception should be thrown out.
- mockKeyStore.load(null, null);
- mockKeyStore.store(null);
- }
-
- public void test_setKeyEntry_null() throws Exception {
- mockKeyStore.load(null, null);
- // No exception should be thrown out.
- mockKeyStore.setKeyEntry(null, null, null, null);
- }
-
- public void test_setKeyEntry_key_is_null() throws Exception {
- mockKeyStore.load(null, null);
- // No exception should be thrown out.
- mockKeyStore.setKeyEntry("Alias", null, null, new Certificate[]{certificate});
- }
-
- public void test_setKeyEntry_key_is_private() throws Exception {
- mockKeyStore.load(null, null);
- Key key = keyPair.getPrivate();
- try {
- mockKeyStore.setKeyEntry("Alias", key, null, null);
- fail("should throw IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- // expected
- }
-
- try {
- mockKeyStore.setKeyEntry("Alias", key, null,
- new Certificate[0]);
- fail("should throw IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- // expected
- }
-
- mockKeyStore.setKeyEntry("Alias", key, null, new Certificate[]{certificate});
- }
-
- public void test_setKeyEntry_key_is_public() throws Exception
- {
- mockKeyStore.load(null, null);
- Key key = keyPair.getPublic();
- mockKeyStore.setKeyEntry("Alias1", key, null, null);
- mockKeyStore.setKeyEntry("Alias2", key, null,
- new Certificate[0]);
- mockKeyStore.setKeyEntry("Alias3", key, null, new Certificate[]{certificate});
- }
-
- public void test_setCertificateEntry_null() throws Exception {
- mockKeyStore.load(null, null);
-
- mockKeyStore.setCertificateEntry(null, null);
-
- mockKeyStore.setCertificateEntry(null, certificate);
-
- mockKeyStore.setCertificateEntry("Alias", null);
- }
-
- public void test_store_null() throws Exception {
- mockKeyStore.load(null, null);
- mockKeyStore.store(null, null);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- mockKeyStore = new MyKeyStore(new MyKeyStoreSpi(), null, "MyKeyStore");
- }
-
- private static class MyKeyStore extends KeyStore {
-
- public MyKeyStore(KeyStoreSpi keyStoreSpi, Provider provider,
- String type) {
- super(keyStoreSpi, provider, type);
- }
- }
-
- private static class MyKeyStoreSpi extends KeyStoreSpi {
-
- public Enumeration<String> engineAliases() {
- return null;
- }
-
- public boolean engineContainsAlias(String arg0) {
- return false;
- }
-
- public void engineDeleteEntry(String arg0) throws KeyStoreException {
- }
-
- public Certificate engineGetCertificate(String arg0) {
- return null;
- }
-
- public String engineGetCertificateAlias(Certificate arg0) {
- return null;
- }
-
- public Certificate[] engineGetCertificateChain(String arg0) {
- return null;
- }
-
- public Date engineGetCreationDate(String arg0) {
- return null;
- }
-
- public Key engineGetKey(String arg0, char[] arg1)
- throws NoSuchAlgorithmException, UnrecoverableKeyException {
- return null;
- }
-
- public boolean engineIsCertificateEntry(String arg0) {
- return false;
- }
-
- public boolean engineIsKeyEntry(String arg0) {
- return false;
- }
-
- public void engineLoad(InputStream arg0, char[] arg1)
- throws IOException, NoSuchAlgorithmException,
- CertificateException {
- return;
- }
-
- public void engineSetCertificateEntry(String arg0, Certificate arg1)
- throws KeyStoreException {
- return;
- }
-
- public void engineSetKeyEntry(String arg0, byte[] arg1,
- Certificate[] arg2) throws KeyStoreException {
- return;
- }
-
- public void engineSetKeyEntry(String arg0, Key arg1, char[] arg2,
- Certificate[] arg3) throws KeyStoreException {
- return;
- }
-
- public int engineSize() {
- return 0;
- }
-
- public void engineStore(KeyStore.LoadStoreParameter param){
- return;
- }
-
- public void engineStore(OutputStream arg0, char[] arg1)
- throws IOException, NoSuchAlgorithmException,
- CertificateException {
- return;
- }
- }
-
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.security.tests.java.security;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.KeyStoreSpi;
+import java.security.NoSuchAlgorithmException;
+import java.security.Provider;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.util.Date;
+import java.util.Enumeration;
+
+import junit.framework.TestCase;
+
+public class KeyStore3Test extends TestCase {
+
+ private KeyStore mockKeyStore;
+
+ private KeyPair keyPair;
+
+ private Certificate certificate;
+
+ public KeyStore3Test() throws Exception {
+ KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("DSA");
+ keyPair = keyPairGenerator.generateKeyPair();
+
+ String certificateData = "-----BEGIN CERTIFICATE-----\n"
+ + "MIICZTCCAdICBQL3AAC2MA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw\n"
+ + "HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl\n"
+ + "IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NzAyMjAwMDAwMDBa\n"
+ + "Fw05ODAyMjAyMzU5NTlaMIGWMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZv\n"
+ + "cm5pYTESMBAGA1UEBxMJUGFsbyBBbHRvMR8wHQYDVQQKExZTdW4gTWljcm9zeXN0\n"
+ + "ZW1zLCBJbmMuMSEwHwYDVQQLExhUZXN0IGFuZCBFdmFsdWF0aW9uIE9ubHkxGjAY\n"
+ + "BgNVBAMTEWFyZ29uLmVuZy5zdW4uY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB\n"
+ + "iQKBgQCofmdY+PiUWN01FOzEewf+GaG+lFf132UpzATmYJkA4AEA/juW7jSi+LJk\n"
+ + "wJKi5GO4RyZoyimAL/5yIWDV6l1KlvxyKslr0REhMBaD/3Z3EsLTTEf5gVrQS6sT\n"
+ + "WMoSZAyzB39kFfsB6oUXNtV8+UKKxSxKbxvhQn267PeCz5VX2QIDAQABMA0GCSqG\n"
+ + "SIb3DQEBAgUAA34AXl3at6luiV/7I9MN5CXYoPJYI8Bcdc1hBagJvTMcmlqL2uOZ\n"
+ + "H9T5hNMEL9Tk6aI7yZPXcw/xI2K6pOR/FrMp0UwJmdxX7ljV6ZtUZf7pY492UqwC\n"
+ + "1777XQ9UEZyrKJvF5ntleeO0ayBqLGVKCWzWZX9YsXCpv47FNLZbupE=\n"
+ + "-----END CERTIFICATE-----\n";
+
+ ByteArrayInputStream certArray = new ByteArrayInputStream(
+ certificateData.getBytes());
+ CertificateFactory cf = CertificateFactory.getInstance("X.509");
+ certificate = cf.generateCertificate(certArray);
+ }
+
+ public void test_load() throws Exception {
+ // No exception should be thrown out.
+ mockKeyStore.load(null);
+ }
+
+ public void test_store() throws Exception {
+ try {
+ mockKeyStore.store(null);
+ fail("should throw KeyStoreException: not initialized");
+ } catch (KeyStoreException e) {
+ // expected
+ }
+
+ // No exception should be thrown out.
+ mockKeyStore.load(null, null);
+ mockKeyStore.store(null);
+ }
+
+ public void test_setKeyEntry_null() throws Exception {
+ mockKeyStore.load(null, null);
+ // No exception should be thrown out.
+ mockKeyStore.setKeyEntry(null, null, null, null);
+ }
+
+ public void test_setKeyEntry_key_is_null() throws Exception {
+ mockKeyStore.load(null, null);
+ // No exception should be thrown out.
+ mockKeyStore.setKeyEntry("Alias", null, null, new Certificate[]{certificate});
+ }
+
+ public void test_setKeyEntry_key_is_private() throws Exception {
+ mockKeyStore.load(null, null);
+ Key key = keyPair.getPrivate();
+ try {
+ mockKeyStore.setKeyEntry("Alias", key, null, null);
+ fail("should throw IllegalArgumentException");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+
+ try {
+ mockKeyStore.setKeyEntry("Alias", key, null,
+ new Certificate[0]);
+ fail("should throw IllegalArgumentException");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+
+ mockKeyStore.setKeyEntry("Alias", key, null, new Certificate[]{certificate});
+ }
+
+ public void test_setKeyEntry_key_is_public() throws Exception
+ {
+ mockKeyStore.load(null, null);
+ Key key = keyPair.getPublic();
+ mockKeyStore.setKeyEntry("Alias1", key, null, null);
+ mockKeyStore.setKeyEntry("Alias2", key, null,
+ new Certificate[0]);
+ mockKeyStore.setKeyEntry("Alias3", key, null, new Certificate[]{certificate});
+ }
+
+ public void test_setCertificateEntry_null() throws Exception {
+ mockKeyStore.load(null, null);
+
+ mockKeyStore.setCertificateEntry(null, null);
+
+ mockKeyStore.setCertificateEntry(null, certificate);
+
+ mockKeyStore.setCertificateEntry("Alias", null);
+ }
+
+ public void test_store_null() throws Exception {
+ mockKeyStore.load(null, null);
+ mockKeyStore.store(null, null);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ mockKeyStore = new MyKeyStore(new MyKeyStoreSpi(), null, "MyKeyStore");
+ }
+
+ private static class MyKeyStore extends KeyStore {
+
+ public MyKeyStore(KeyStoreSpi keyStoreSpi, Provider provider,
+ String type) {
+ super(keyStoreSpi, provider, type);
+ }
+ }
+
+ private static class MyKeyStoreSpi extends KeyStoreSpi {
+
+ public Enumeration<String> engineAliases() {
+ return null;
+ }
+
+ public boolean engineContainsAlias(String arg0) {
+ return false;
+ }
+
+ public void engineDeleteEntry(String arg0) throws KeyStoreException {
+ }
+
+ public Certificate engineGetCertificate(String arg0) {
+ return null;
+ }
+
+ public String engineGetCertificateAlias(Certificate arg0) {
+ return null;
+ }
+
+ public Certificate[] engineGetCertificateChain(String arg0) {
+ return null;
+ }
+
+ public Date engineGetCreationDate(String arg0) {
+ return null;
+ }
+
+ public Key engineGetKey(String arg0, char[] arg1)
+ throws NoSuchAlgorithmException, UnrecoverableKeyException {
+ return null;
+ }
+
+ public boolean engineIsCertificateEntry(String arg0) {
+ return false;
+ }
+
+ public boolean engineIsKeyEntry(String arg0) {
+ return false;
+ }
+
+ public void engineLoad(InputStream arg0, char[] arg1)
+ throws IOException, NoSuchAlgorithmException,
+ CertificateException {
+ return;
+ }
+
+ public void engineSetCertificateEntry(String arg0, Certificate arg1)
+ throws KeyStoreException {
+ return;
+ }
+
+ public void engineSetKeyEntry(String arg0, byte[] arg1,
+ Certificate[] arg2) throws KeyStoreException {
+ return;
+ }
+
+ public void engineSetKeyEntry(String arg0, Key arg1, char[] arg2,
+ Certificate[] arg3) throws KeyStoreException {
+ return;
+ }
+
+ public int engineSize() {
+ return 0;
+ }
+
+ public void engineStore(KeyStore.LoadStoreParameter param){
+ return;
+ }
+
+ public void engineStore(OutputStream arg0, char[] arg1)
+ throws IOException, NoSuchAlgorithmException,
+ CertificateException {
+ return;
+ }
+ }
+
+}
+
Propchange: harmony/enhanced/classlib/branches/java6/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/sound/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sound/build.xml?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sound/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/sound/build.xml Thu Aug 2 14:27:53 2007
@@ -65,8 +65,8 @@
<delete file="${hy.jdk}/jre/lib/boot/${hy.sound.packaging.jarname}-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.sound.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="compile-java">
Modified: harmony/enhanced/classlib/branches/java6/modules/sql/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/build.xml?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/build.xml Thu Aug 2 14:27:53 2007
@@ -60,8 +60,8 @@
<delete file="${hy.jdk}/jre/lib/boot/sql-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.sql.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="compile-java">