Modified: harmony/enhanced/classlib/branches/java6/modules/awt/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/build.xml?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/build.xml Thu Dec 18 01:46:12 2008
@@ -340,6 +340,7 @@
</fileset>
</bootclasspath>
<classpath location="${basedir}/../../${junit.jar}" />
+ <classpath location="${hy.hdk}/build/test/support.jar" />
</javac>
<mkdir dir="${hy.awt.bin.test.classes}" />
@@ -364,6 +365,7 @@
</fileset>
</bootclasspath>
<classpath location="${basedir}/../../${junit.jar}" />
+ <classpath location="${hy.hdk}/build/test/support.jar" />
</javac>
</target>
@@ -422,7 +424,12 @@
jvm="${test.jre.home}/bin/java">
<jvmarg line="${hy.test.vmargs}" />
- <classpath location="${hy.awt.bin.test.classes}" />
+ <classpath>
+ <pathelement path="${hy.awt.bin.test.classes}" />
+ <fileset dir="${hy.hdk}/build/test/">
+ <include name="*.jar" />
+ </fileset>
+ </classpath>
<formatter type="xml" />
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/Component.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/Component.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/Component.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/Component.java Thu Dec 18 01:46:12 2008
@@ -86,6 +86,7 @@
import org.apache.harmony.awt.text.TextFieldKit;
import org.apache.harmony.awt.text.TextKit;
import org.apache.harmony.awt.wtk.NativeWindow;
+import org.apache.harmony.luni.util.NotImplementedException;
public abstract class Component implements ImageObserver, MenuContainer, Serializable {
private static final long serialVersionUID = -7644114512714619750L;
@@ -568,32 +569,22 @@
protected boolean validatedContents;
- protected BltBufferStrategy(int numBuffers, BufferCapabilities caps) throws org.apache.harmony.luni.util.NotImplementedException {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
+ protected BltBufferStrategy(int numBuffers, BufferCapabilities caps) throws NotImplementedException {
+ throw new NotImplementedException();
}
@Override
- public boolean contentsLost() {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
- return false;
+ public boolean contentsLost() throws NotImplementedException {
+ throw new NotImplementedException();
}
@Override
- public boolean contentsRestored() {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
- return false;
+ public boolean contentsRestored() throws NotImplementedException {
+ throw new NotImplementedException();
}
- protected void createBackBuffers(int numBuffers) {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
+ protected void createBackBuffers(int numBuffers) throws NotImplementedException {
+ throw new NotImplementedException();
}
@Override
@@ -602,24 +593,17 @@
}
@Override
- public Graphics getDrawGraphics() {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
- return null;
+ public Graphics getDrawGraphics() throws NotImplementedException {
+ throw new NotImplementedException();
}
- protected void revalidate() {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
+ protected void revalidate() throws NotImplementedException {
+ throw new NotImplementedException();
}
@Override
- public void show() {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
+ public void show() throws NotImplementedException {
+ throw new NotImplementedException();
}
}
@@ -646,23 +630,17 @@
}
@Override
- public boolean contentsLost() {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
- return false;
+ public boolean contentsLost() throws NotImplementedException {
+ throw new NotImplementedException();
}
@Override
- public boolean contentsRestored() {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
- return false;
+ public boolean contentsRestored() throws NotImplementedException {
+ throw new NotImplementedException();
}
protected void createBuffers(int numBuffers, BufferCapabilities caps)
- throws AWTException {
+ throws AWTException,NotImplementedException {
if (numBuffers < 2) {
// awt.14C=Number of buffers must be greater than one
throw new IllegalArgumentException(Messages.getString("awt.14C")); //$NON-NLS-1$
@@ -676,28 +654,19 @@
throw new IllegalStateException(Messages.getString("awt.14E")); //$NON-NLS-1$
}
// TODO: throw new AWTException("Capabilities are not supported");
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
+ throw new NotImplementedException();
}
- protected void destroyBuffers() {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
+ protected void destroyBuffers() throws NotImplementedException {
+ throw new NotImplementedException();
}
- protected void flip(BufferCapabilities.FlipContents flipAction) {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
+ protected void flip(BufferCapabilities.FlipContents flipAction) throws NotImplementedException {
+ throw new NotImplementedException();
}
- protected Image getBackBuffer() {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
- return null;
+ protected Image getBackBuffer() throws NotImplementedException {
+ throw new NotImplementedException();
}
@Override
@@ -706,24 +675,17 @@
}
@Override
- public Graphics getDrawGraphics() {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
- return null;
+ public Graphics getDrawGraphics() throws NotImplementedException {
+ throw new NotImplementedException();
}
- protected void revalidate() {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
+ protected void revalidate() throws NotImplementedException {
+ throw new NotImplementedException();
}
@Override
- public void show() {
- if (true) {
- throw new RuntimeException("Method is not implemented"); //$NON-NLS-1$
- }
+ public void show() throws NotImplementedException {
+ throw new NotImplementedException();
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/Font.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/Font.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/Font.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/Font.java Thu Dec 18 01:46:12 2008
@@ -44,7 +44,6 @@
import org.apache.harmony.awt.gl.font.FontPeerImpl;
import org.apache.harmony.awt.gl.font.fontlib.FLFontManager;
import org.apache.harmony.awt.internal.nls.Messages;
-import org.apache.harmony.luni.util.NotImplementedException;
import org.apache.harmony.misc.HashCode;
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/GridBagLayout.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/GridBagLayout.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/GridBagLayout.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/GridBagLayout.java Thu Dec 18 01:46:12 2008
@@ -90,8 +90,6 @@
public void addLayoutComponent(Component comp, Object constraints) {
toolkit.lockAWT();
try {
- // awt.7F=AddLayoutComponent: attempt to add null component
- assert comp != null : Messages.getString("awt.7F"); //$NON-NLS-1$
GridBagConstraints cons;
if (constraints != null) {
if (!GridBagConstraints.class.isInstance(constraints)) {
@@ -125,8 +123,6 @@
public void removeLayoutComponent(Component comp) {
toolkit.lockAWT();
try {
- // awt.82=RemoveLayoutComponent: attempt to remove null component
- assert comp != null : Messages.getString("awt.82"); //$NON-NLS-1$
Container parent = comp.getParent();
if (parent != null) {
getParentInfo(parent).consTable.remove(comptable.get(comp));
@@ -154,10 +150,6 @@
public void setConstraints(Component comp, GridBagConstraints constraints) {
toolkit.lockAWT();
try {
- // awt.83=SetConstraints: attempt to get constraints of null component
- assert comp != null : Messages.getString("awt.83"); //$NON-NLS-1$
- // awt.84=SetConstraints: attempt to set null constraints
- assert constraints != null : Messages.getString("awt.84"); //$NON-NLS-1$
GridBagConstraints consClone = (GridBagConstraints) constraints.clone();
try {
// consClone.verify();
@@ -383,8 +375,6 @@
protected GridBagConstraints lookupConstraints(Component comp) {
toolkit.lockAWT();
try {
- // awt.89=LookupConstraints: attempt to get constraints of null component
- assert comp != null : Messages.getString("awt.89"); //$NON-NLS-1$
GridBagConstraints cons = comptable.get(comp);
if (cons == null) {
// if comp is not in the layout, return a copy of default constraints
@@ -435,10 +425,6 @@
protected void AdjustForGravity(GridBagConstraints constraints, Rectangle r) {
toolkit.lockAWT();
try {
- // awt.8A=AdjustForGravity: attempt to use null constraints
- assert constraints != null : Messages.getString("awt.8A"); //$NON-NLS-1$
- // awt.8B=AdjustForGravity: attempt to use null rectangle
- assert r != null : Messages.getString("awt.8B"); //$NON-NLS-1$
try {
// ((GridBagConstraints) constraints).verify();
} catch (IllegalArgumentException e) {
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/Toolkit.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/Toolkit.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/Toolkit.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/Toolkit.java Thu Dec 18 01:46:12 2008
@@ -832,10 +832,7 @@
} finally {
unlockAWT();
}
- if (true) {
- throw new RuntimeException("Method is not implemented"); //TODO: implement //$NON-NLS-1$
- }
- return null;
+ throw new org.apache.harmony.luni.util.NotImplementedException();
}
public Insets getScreenInsets(GraphicsConfiguration gc) throws HeadlessException {
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/fontlib/shared/Font.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/fontlib/shared/Font.cpp?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/fontlib/shared/Font.cpp (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/fontlib/shared/Font.cpp Thu Dec 18 01:46:12 2008
@@ -165,7 +165,7 @@
if (!isFound)
{
// printf("Font not found");
- return 0; // çäåñü ïîñòàâèòü çíà÷åíèÿ ïî óìîë÷àíèþ
+ return 0; //Font not found
}
return retFont;
}
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/StandardBeanInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/StandardBeanInfo.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/StandardBeanInfo.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/StandardBeanInfo.java Thu Dec 18 01:46:12 2008
@@ -87,7 +87,7 @@
private static PropertyComparator comparator = new PropertyComparator();
- private Image[] icon = new Image[4];
+ private Object[] icon = new Object[4];
private boolean canAddPropertyChangeListener;
@@ -196,7 +196,7 @@
@Override
public Image getIcon(int iconKind) {
- return icon[iconKind - 1];
+ return (Image)icon[iconKind - 1];
}
void mergeBeanInfo(BeanInfo beanInfo, boolean force)
@@ -291,8 +291,8 @@
// Sub is PropertyDescriptor
if (subIndexedType == null) {
// Same property type
- if (subType != null &&
- subType.getName().equals(superType.getName())) {
+ if (subType != null && superType != null
+ && subType.getName().equals(superType.getName())) {
if ((subGet == null) && (superGet != null)) {
subDesc.setReadMethod(superGet);
}
@@ -306,7 +306,8 @@
}
}
} else { // Sub is IndexedPropertyDescriptor
- if ((superType.isArray())
+ if (superType != null
+ && (superType.isArray())
&& (superType.getComponentType().getName()
.equals(subIndexedType.getName()))) {
// same type
@@ -321,7 +322,8 @@
subMap.put(propertyName, subDesc);
} else { // Super is IndexedPropertyDescriptor
if (subIndexedType == null) { // Sub is PropertyDescriptor
- if (subType.isArray()
+ if (subType != null
+ && subType.isArray()
&& (subType.getComponentType().getName()
.equals(superIndexedType.getName()))) {
// Same type
@@ -336,8 +338,9 @@
subMap.put(propertyName, (PropertyDescriptor) value);
}
- } else if (subIndexedType.getName().equals(
- superIndexedType.getName())) {
+ } else if (superIndexedType != null
+ && subIndexedType.getName().equals(
+ superIndexedType.getName())) {
// Sub is IndexedPropertyDescriptor and Same type
IndexedPropertyDescriptor subDesc = (IndexedPropertyDescriptor) value;
if ((subGet == null) && (superGet != null)) {
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java Thu Dec 18 01:46:12 2008
@@ -869,6 +869,39 @@
}
}
+ /*
+ * @test Introspector.getBeanInfo
+ * @test StandardBeanInfo.mergeProps
+ */
+ public void testGetBeanInfo_StandardBeanInfo_mergeProps() throws Exception {
+ class MockParent {
+ public void setValue(int v) {
+ // do nothing
+ }
+
+ public void setValue(int v, String s) {
+ // do nothing
+ }
+ }
+
+ class MockChild extends MockParent {
+ public void setValue(int v) {
+ // do nothing
+ }
+ }
+
+ BeanInfo beanInfo = Introspector.getBeanInfo(MockChild.class);
+ PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
+ PropertyDescriptor pd = null;
+ for(int i = 0; i < pds.length; i++){
+ if("value".equals(pds[i].getName())){
+ pd = pds[i];
+ }
+ }
+ assertNotNull(pd);
+ assertEquals(Integer.TYPE, pd.getPropertyType());
+ }
+
public void testSetBeanInfoSearchPath_null() throws IntrospectionException{
String[] oldPath = Introspector.getBeanInfoSearchPath();
try{
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java Thu Dec 18 01:46:12 2008
@@ -22,6 +22,7 @@
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeListenerProxy;
import java.beans.PropertyChangeSupport;
+import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -29,10 +30,7 @@
import java.io.ObjectOutputStream;
import java.io.Serializable;
-import junit.framework.Test;
import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
import org.apache.harmony.beans.tests.support.NonSerializablePropertyChangeListener;
import org.apache.harmony.beans.tests.support.SerializablePropertyChangeListener;
@@ -46,6 +44,18 @@
*/
public class PropertyChangeSupportTest extends TestCase {
+ private File tempFile;
+
+ @Override
+ protected void setUp() throws Exception {
+ tempFile = File.createTempFile("beans", ".ser");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ tempFile.delete();
+ tempFile = null;
+ }
/*
* Test the constructor with a normal parameter.
*/
@@ -1451,24 +1461,10 @@
readPropertyChangeListeners();
}
- /**
- *
- */
- public static Test suite() {
- return new TestSuite(PropertyChangeSupportTest.class);
- }
-
- /**
- *
- */
- public static void main(String[] args) {
- TestRunner.run(suite());
- }
-
private void writePropertyChangeListeners(PropertyChangeListener[] array) {
ObjectOutputStream oos = null;
try {
- oos = new ObjectOutputStream(new FileOutputStream("x.ser"));
+ oos = new ObjectOutputStream(new FileOutputStream(tempFile));
PropertyChangeSupport pcs = new PropertyChangeSupport("bean");
if (array != null && array.length > 0) {
for (PropertyChangeListener element : array) {
@@ -1496,7 +1492,7 @@
ObjectInputStream ois = null;
PropertyChangeSupport pcs = null;
try {
- ois = new ObjectInputStream(new FileInputStream("x.ser"));
+ ois = new ObjectInputStream(new FileInputStream(tempFile));
pcs = (PropertyChangeSupport) ois.readObject();
} finally {
if (ois != null) {
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/
('svn:externals' removed)
Modified: harmony/enhanced/classlib/branches/java6/modules/concurrent/.classpath
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/concurrent/.classpath?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/concurrent/.classpath (original)
+++ harmony/enhanced/classlib/branches/java6/modules/concurrent/.classpath Thu Dec 18 01:46:12 2008
@@ -1,13 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry output="bin/main" kind="src" path="standard/src/main/java"/>
- <classpathentry output="bin/main" kind="src" path="standard/src/main/resources"/>
- <classpathentry output="bin/test" kind="src" path="standard/src/test/java"/>
- <classpathentry output="bin/test" kind="src" path="standard/src/test/resources"/>
- <classpathentry output="bin/main" kind="src" path="src/main/java"/>
- <classpathentry output="bin/main" kind="src" path="src/main/resources"/>
- <classpathentry output="bin/test" kind="src" path="src/test/java"/>
- <classpathentry output="bin/test" kind="src" path="src/test/resources"/>
+ <classpathentry kind="src" output="bin/main" path="src/main/java"/>
+ <classpathentry kind="src" output="bin/main" path="src/main/resources"/>
+ <classpathentry kind="src" output="bin/test" path="src/test/java"/>
+ <classpathentry kind="src" output="bin/test" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="bin/main"/>
Modified: harmony/enhanced/classlib/branches/java6/modules/concurrent/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/concurrent/build.xml?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/concurrent/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/concurrent/build.xml Thu Dec 18 01:46:12 2008
@@ -28,14 +28,8 @@
<fileset id="classes" dir="${hy.build}">
<or>
- <present targetdir="src/main/java" />
- <present targetdir="src/main/java">
- <mapper type="regexp"
- from="^(.*?)(\$$[^/\\\.]*)?\.class$$"
- to="\1.java"/>
- </present>
- <present targetdir="standard/src/main/java" />
- <present targetdir="standard/src/main/java">
+ <present targetdir="${hy.concurrent.src.main.java}" />
+ <present targetdir="${hy.concurrent.src.main.java}">
<mapper type="regexp"
from="^(.*?)(\$$[^/\\\.]*)?\.class$$"
to="\1.java"/>
@@ -64,8 +58,8 @@
<target name="-test-module" depends="build, compile-tests, prepare-exclude, run-tests" />
<target name="clean">
- <delete file="${hy.jdk}/jre/lib/boot/${hy.concurrent.packaging.jarname}.jar" />
- <delete file="${hy.jdk}/jre/lib/boot/${hy.concurrent.packaging.jarname}-src.jar" />
+ <delete file="${hy.jdk}/jre/lib/boot/concurrent.jar" />
+ <delete file="${hy.jdk}/jre/lib/boot/concurrent-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
</delete>
@@ -77,8 +71,9 @@
<mkdir dir="${hy.build}" />
- <javac destdir="${hy.build}"
- sourcepath=""
+ <javac sourcepath=""
+ srcdir="${hy.concurrent.src.main.java}"
+ destdir="${hy.build}"
compiler="${hy.javac.compiler}"
memoryMaximumSize="${hy.javac.maxmem}"
source="${hy.javac.source}"
@@ -87,8 +82,6 @@
<compilerarg line="${build.compilerarg}" />
- <src path="src/main/java" />
- <src path="standard/src/main/java" />
<bootclasspath>
<fileset dir="${hy.jdk}/jre/lib/boot">
<include name="**/*.jar" />
@@ -98,7 +91,7 @@
</target>
<target name="build-jar" depends="svn-info">
- <jar destfile="${hy.jdk}/jre/lib/boot/${hy.concurrent.packaging.jarname}.jar"
+ <jar destfile="${hy.jdk}/jre/lib/boot/concurrent.jar"
manifest="${hy.concurrent}/META-INF/MANIFEST.MF"
compress="${hy.jar.compress}">
<fileset refid="classes" />
@@ -109,9 +102,8 @@
<metainf refid="hy.required.metainf-files"/>
</jar>
- <jar destfile="${hy.jdk}/jre/lib/boot/${hy.concurrent.packaging.jarname}-src.jar">
- <fileset dir="src/main/java" />
- <fileset dir="standard/src/main/java" />
+ <jar destfile="${hy.jdk}/jre/lib/boot/concurrent-src.jar">
+ <fileset dir="${hy.concurrent.src.main.java}" />
<manifest>
<attribute name="Implementation-Version" value="${svn.info}"/>
</manifest>
@@ -125,25 +117,21 @@
<mkdir dir="${hy.concurrent.bin.test}" />
- <javac destdir="${hy.concurrent.bin.test}"
- sourcepath=""
+ <javac sourcepath=""
+ srcdir="${hy.concurrent.src.test.java}"
+ destdir="${hy.concurrent.bin.test}"
compiler="${hy.javac.compiler}"
memoryMaximumSize="${hy.javac.maxmem}"
source="${hy.javac.source}"
target="${hy.javac.target}"
debug="${hy.javac.debug}">
-
<compilerarg line="${build.compilerarg}" />
-
- <src path="src/test/java" />
- <src path="standard/src/test/java" />
<bootclasspath>
<fileset dir="${hy.jdk}/jre/lib/boot">
<include name="**/*.jar" />
</fileset>
</bootclasspath>
<classpath location="../../build/tests" />
- <classpath location="${hy.hdk}/build/test/support.jar" />
</javac>
</target>
@@ -189,13 +177,6 @@
<include name="**/*Test.java" unless="test.case" />
<excludesfile name="${concurrent.exclude.file}" unless="test.case" />
</fileset>
- <fileset dir="${hy.concurrent.src.test.standard}">
- <!-- if ${test.case} -->
- <include name="${converted.tc}" if="test.case" />
- <!-- unless ${test.case} -->
- <include name="**/*Test.java" unless="test.case" />
- <excludesfile name="${concurrent.exclude.file}" unless="test.case" />
- </fileset>
</batchtest>
</junit>
<antcall target="touch-failures-file" />
Modified: harmony/enhanced/classlib/branches/java6/modules/concurrent/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/concurrent/make/hyproperties.xml?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/concurrent/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/concurrent/make/hyproperties.xml Thu Dec 18 01:46:12 2008
@@ -21,12 +21,10 @@
<src>
<main>
<java location="src/main/java" />
- <standard location="standard/src/main/java" />
<resources location="src/main/resources" />
</main>
<test>
<java location="src/test/java" />
- <standard location="standard/src/test/java" />
<resources location="src/test/resources" />
</test>
</src>
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/AbstractExecutorService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ArrayBlockingQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/BlockingQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/BrokenBarrierException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/Callable.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/CancellationException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/CompletionService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ConcurrentHashMap.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ConcurrentLinkedQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ConcurrentMap.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/CopyOnWriteArraySet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/CountDownLatch.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/CyclicBarrier.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/DelayQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/Delayed.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/Exchanger.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ExecutionException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/Executor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ExecutorCompletionService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ExecutorService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/Executors.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/Future.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/FutureTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/LinkedBlockingQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/PriorityBlockingQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/RejectedExecutionException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/RejectedExecutionHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ScheduledExecutorService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ScheduledFuture.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/Semaphore.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/SynchronousQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ThreadFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ThreadPoolExecutor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/TimeUnit.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/TimeoutException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/package.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AbstractExecutorServiceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AbstractQueueTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AbstractQueuedSynchronizerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/ArrayBlockingQueueTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AtomicBooleanTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AtomicIntegerArrayTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AtomicIntegerFieldUpdaterTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AtomicIntegerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AtomicLongArrayTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AtomicLongFieldUpdaterTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AtomicLongTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AtomicMarkableReferenceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AtomicReferenceArrayTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AtomicReferenceFieldUpdaterTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AtomicReferenceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/AtomicStampedReferenceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/ConcurrentHashMapTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/ConcurrentLinkedQueueTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/CopyOnWriteArrayListTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/CopyOnWriteArraySetTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/CountDownLatchTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/CyclicBarrierTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/DelayQueueTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/ExchangerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/ExecutorCompletionServiceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/ExecutorsTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/FutureTaskTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/JSR166TestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/LinkedBlockingQueueTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/LinkedListTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/LockSupportTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/PriorityBlockingQueueTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/PriorityQueueTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/ReentrantLockTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/ReentrantReadWriteLockTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/ScheduledExecutorTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/SemaphoreTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/SynchronousQueueTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/SystemTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/ThreadLocalTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/ThreadPoolExecutorTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/ThreadTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/test/java/TimeUnitTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/luni-kernel/src/main/java/java/lang/Class.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni-kernel/src/main/java/java/lang/Class.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni-kernel/src/main/java/java/lang/Class.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni-kernel/src/main/java/java/lang/Class.java Thu Dec 18 01:46:12 2008
@@ -169,6 +169,7 @@
* @throws SecurityException
* If member access is not allowed
*/
+ @SuppressWarnings("unchecked") // According to spec
public Class[] getClasses() {
return null;
}
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF Thu Dec 18 01:46:12 2008
@@ -13,7 +13,6 @@
Eclipse-JREBundle: true
Eclipse-ExtensibleAPI: true
Import-Package: com.ibm.icu.lang,
- java.awt,
java.lang.annotation,
java.math,
java.nio,
@@ -29,7 +28,7 @@
javax.net;resolution:=optional,
javax.net.ssl,
javax.xml.parsers,
- org.apache.harmony.awt.gl.image,
+ org.apache.harmony.awt.www.content.image;resolution:=optional,
org.apache.harmony.nio,
org.apache.harmony.testframework.serialization;hy_usage=test;resolution:=optional,
org.w3c.dom,
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/BufferedInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/BufferedInputStream.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/BufferedInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/BufferedInputStream.java Thu Dec 18 01:46:12 2008
@@ -21,8 +21,8 @@
/**
* <code>BufferedInputStream</code> is a class which takes an input stream and
- * <em>buffers</em> the input. In this way, costly interaction with the
- * original input stream can be minimized by reading buffered amounts of data
+ * <em>buffers</em> the input. In this way, costly interaction with the original
+ * input stream can be minimized by reading buffered amounts of data
* infrequently. The drawback is that extra space is required to hold the buffer
* and that copying takes place when reading that buffer.
*
@@ -32,7 +32,7 @@
/**
* The buffer containing the current bytes read from the target InputStream.
*/
- protected byte[] buf;
+ protected volatile byte[] buf;
/**
* The total number of bytes inside the byte array <code>buf</code>.
@@ -55,12 +55,10 @@
*/
protected int pos;
- private boolean closed = false;
-
/**
* Constructs a new <code>BufferedInputStream</code> on the InputStream
- * <code>in</code>. The default buffer size (8Kb) is allocated and all
- * reads can now be filtered through this stream.
+ * <code>in</code>. The default buffer size (8Kb) is allocated and all reads
+ * can now be filtered through this stream.
*
* @param in
* the InputStream to buffer reads on.
@@ -101,11 +99,12 @@
*/
@Override
public synchronized int available() throws IOException {
- if (buf == null) {
+ InputStream localIn = in; // 'in' could be invalidated by close()
+ if (buf == null || localIn == null) {
// K0059=Stream is closed
throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
}
- return count - pos + in.available();
+ return count - pos + localIn.available();
}
/**
@@ -116,19 +115,20 @@
* If an error occurs attempting to close this stream.
*/
@Override
- public synchronized void close() throws IOException {
- if (null != in) {
- super.close();
- in = null;
- }
+ public void close() throws IOException {
buf = null;
- closed = true;
+ InputStream localIn = in;
+ in = null;
+ if (localIn != null) {
+ localIn.close();
+ }
}
- private int fillbuf() throws IOException {
+ private int fillbuf(InputStream localIn, byte[] localBuf)
+ throws IOException {
if (markpos == -1 || (pos - markpos >= marklimit)) {
/* Mark position not set or exceeded readlimit */
- int result = in.read(buf);
+ int result = localIn.read(localBuf);
if (result > 0) {
markpos = -1;
pos = 0;
@@ -136,32 +136,35 @@
}
return result;
}
- if (markpos == 0 && marklimit > buf.length) {
- /* Increase buffer size to accomodate the readlimit */
- int newLength = buf.length * 2;
+ if (markpos == 0 && marklimit > localBuf.length) {
+ /* Increase buffer size to accommodate the readlimit */
+ int newLength = localBuf.length * 2;
if (newLength > marklimit) {
newLength = marklimit;
}
byte[] newbuf = new byte[newLength];
- System.arraycopy(buf, 0, newbuf, 0, buf.length);
- buf = newbuf;
+ System.arraycopy(localBuf, 0, newbuf, 0, localBuf.length);
+ // Reassign buf, which will invalidate any local references
+ // FIXME: what if buf was null?
+ localBuf = buf = newbuf;
} else if (markpos > 0) {
- System.arraycopy(buf, markpos, buf, 0, buf.length - markpos);
+ System.arraycopy(localBuf, markpos, localBuf, 0, localBuf.length
+ - markpos);
}
/* Set the new position and mark position */
pos -= markpos;
count = markpos = 0;
- int bytesread = in.read(buf, pos, buf.length - pos);
+ int bytesread = localIn.read(localBuf, pos, localBuf.length - pos);
count = bytesread <= 0 ? pos : pos + bytesread;
return bytesread;
}
/**
* Set a Mark position in this BufferedInputStream. The parameter
- * <code>readLimit</code> indicates how many bytes can be read before a
- * mark is invalidated. Sending reset() will reposition the Stream back to
- * the marked position provided <code>readLimit</code> has not been
- * surpassed. The underlying buffer may be increased in size to allow
+ * <code>readLimit</code> indicates how many bytes can be read before a mark
+ * is invalidated. Sending reset() will reposition the Stream back to the
+ * marked position provided <code>readLimit</code> has not been surpassed.
+ * The underlying buffer may be increased in size to allow
* <code>readlimit</code> number of bytes to be supported.
*
* @param readlimit
@@ -200,28 +203,40 @@
*/
@Override
public synchronized int read() throws IOException {
- if (in == null) {
+ // Use local refs since buf and in may be invalidated by an
+ // unsynchronized close()
+ byte[] localBuf = buf;
+ InputStream localIn = in;
+ if (localBuf == null || localIn == null) {
// K0059=Stream is closed
throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
}
/* Are there buffered bytes available? */
- if (pos >= count && fillbuf() == -1) {
+ if (pos >= count && fillbuf(localIn, localBuf) == -1) {
return -1; /* no, fill buffer */
}
+ // localBuf may have been invalidated by fillbuf
+ if (localBuf != buf) {
+ localBuf = buf;
+ if (localBuf == null) {
+ // K0059=Stream is closed
+ throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ }
+ }
/* Did filling the buffer fail with -1 (EOF)? */
if (count - pos > 0) {
- return buf[pos++] & 0xFF;
+ return localBuf[pos++] & 0xFF;
}
return -1;
}
/**
- * Reads at most <code>length</code> bytes from this BufferedInputStream
- * and stores them in byte array <code>buffer</code> starting at offset
- * <code>offset</code>. Answer the number of bytes actually read or -1 if
- * no bytes were read and end of stream was encountered. If all the buffered
+ * Reads at most <code>length</code> bytes from this BufferedInputStream and
+ * stores them in byte array <code>buffer</code> starting at offset
+ * <code>offset</code>. Answer the number of bytes actually read or -1 if no
+ * bytes were read and end of stream was encountered. If all the buffered
* bytes have been used, a mark has not been set, and the requested number
* of bytes is larger than the receiver's buffer size, this implementation
* bypasses the buffer and simply places the results directly into
@@ -242,7 +257,10 @@
@Override
public synchronized int read(byte[] buffer, int offset, int length)
throws IOException {
- if (closed) {
+ // Use local ref since buf may be invalidated by an unsynchronized
+ // close()
+ byte[] localBuf = buf;
+ if (localBuf == null) {
// K0059=Stream is closed
throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
}
@@ -253,7 +271,9 @@
if (length == 0) {
return 0;
}
- if (null == buf) {
+ InputStream localIn = in;
+ if (localIn == null) {
+ // K0059=Stream is closed
throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
}
@@ -261,9 +281,9 @@
if (pos < count) {
/* There are bytes available in the buffer. */
int copylength = count - pos >= length ? length : count - pos;
- System.arraycopy(buf, pos, buffer, offset, copylength);
+ System.arraycopy(localBuf, pos, buffer, offset, copylength);
pos += copylength;
- if (copylength == length || in.available() == 0) {
+ if (copylength == length || localIn.available() == 0) {
return copylength;
}
offset += copylength;
@@ -278,24 +298,33 @@
* If we're not marked and the required size is greater than the
* buffer, simply read the bytes directly bypassing the buffer.
*/
- if (markpos == -1 && required >= buf.length) {
- read = in.read(buffer, offset, required);
+ if (markpos == -1 && required >= localBuf.length) {
+ read = localIn.read(buffer, offset, required);
if (read == -1) {
return required == length ? -1 : length - required;
}
} else {
- if (fillbuf() == -1) {
+ if (fillbuf(localIn, localBuf) == -1) {
return required == length ? -1 : length - required;
}
+ // localBuf may have been invalidated by fillbuf
+ if (localBuf != buf) {
+ localBuf = buf;
+ if (localBuf == null) {
+ // K0059=Stream is closed
+ throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+ }
+ }
+
read = count - pos >= required ? required : count - pos;
- System.arraycopy(buf, pos, buffer, offset, read);
+ System.arraycopy(localBuf, pos, buffer, offset, read);
pos += read;
}
required -= read;
if (required == 0) {
return length;
}
- if (in.available() == 0) {
+ if (localIn.available() == 0) {
return length - required;
}
offset += read;
@@ -304,18 +333,16 @@
/**
* Reset this BufferedInputStream to the last marked location. If the
- * <code>readlimit</code> has been passed or no <code>mark</code> has
- * been set, throw IOException. This implementation resets the target
- * stream.
+ * <code>readlimit</code> has been passed or no <code>mark</code> has been
+ * set, throw IOException. This implementation resets the target stream.
*
* @throws IOException
* If the stream is already closed or another IOException
* occurs.
*/
-
@Override
public synchronized void reset() throws IOException {
- if (closed) {
+ if (buf == null) {
// K0059=Stream is closed
throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
}
@@ -341,7 +368,11 @@
*/
@Override
public synchronized long skip(long amount) throws IOException {
- if (null == in) {
+ // Use local refs since buf and in may be invalidated by an
+ // unsynchronized close()
+ byte[] localBuf = buf;
+ InputStream localIn = in;
+ if (localBuf == null || localIn == null) {
// K0059=Stream is closed
throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
}
@@ -358,7 +389,7 @@
if (markpos != -1) {
if (amount <= marklimit) {
- if (fillbuf() == -1) {
+ if (fillbuf(localIn, localBuf) == -1) {
return read;
}
if (count - pos >= amount - read) {
@@ -372,6 +403,6 @@
}
markpos = -1;
}
- return read + in.skip(amount - read);
+ return read + localIn.skip(amount - read);
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/File.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/File.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/File.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/File.java Thu Dec 18 01:46:12 2008
@@ -489,33 +489,12 @@
*/
public String getCanonicalPath() throws IOException {
byte[] result = properPath(false);
-
- boolean exists = false;
- byte[] pathBytes = result;
- do {
- byte[] linkBytes = getLinkImpl(pathBytes);
- if (linkBytes == pathBytes) {
- break;
- }
- if (linkBytes[0] == separatorChar) {
- pathBytes = linkBytes;
- } else {
- int index = pathBytes.length - 1;
- while (pathBytes[index] != separatorChar) {
- index--;
- }
- byte[] temp = new byte[index + 1 + linkBytes.length];
- System.arraycopy(pathBytes, 0, temp, 0, index + 1);
- System.arraycopy(linkBytes, 0, temp, index + 1,
- linkBytes.length);
- pathBytes = temp;
- }
- exists = existsImpl(pathBytes);
- } while (exists);
- if (exists) {
- result = pathBytes;
+ if(separatorChar == '/') {
+ // resolve the full path first
+ result = resolveLink(result, result.length, false);
+ // resolve the parent directories
+ result = resolve(result);
}
-
int numSeparators = 1;
for (int i = 0; i < result.length; i++) {
if (result[i] == separatorChar) {
@@ -583,6 +562,93 @@
newLength = newResult.length;
return Util.toUTF8String(newResult, 0, newLength);
}
+
+ /*
+ * Resolve symbolic links in the parent directories.
+ */
+ private byte[] resolve(byte[] newResult) throws IOException {
+ int last = 1, nextSize, linkSize;
+ byte[] linkPath = newResult, bytes;
+ boolean done, inPlace;
+ for (int i = 1; i <= newResult.length; i++) {
+ if (i == newResult.length || newResult[i] == separatorChar) {
+ done = i >= newResult.length - 1;
+ // if there is only one segment, do nothing
+ if (done && linkPath.length == 1) {
+ return newResult;
+ }
+ inPlace = false;
+ if (linkPath == newResult) {
+ bytes = newResult;
+ // if there are no symbolic links, terminate the C string
+ // instead of copying
+ if (!done) {
+ inPlace = true;
+ newResult[i] = '\0';
+ }
+ } else {
+ nextSize = i - last + 1;
+ linkSize = linkPath.length;
+ if (linkPath[linkSize - 1] == separatorChar) {
+ linkSize--;
+ }
+ bytes = new byte[linkSize + nextSize];
+ System.arraycopy(linkPath, 0, bytes, 0, linkSize);
+ System.arraycopy(newResult, last - 1, bytes, linkSize,
+ nextSize);
+ // the full path has already been resolved
+ }
+ if (done) {
+ return bytes;
+ }
+ linkPath = resolveLink(bytes, inPlace ? i : bytes.length, true);
+ if (inPlace) {
+ newResult[i] = '/';
+ }
+ last = i + 1;
+ }
+ }
+ throw new InternalError();
+ }
+
+ /*
+ * Resolve a symbolic link. While the path resolves to an existing path,
+ * keep resolving. If an absolute link is found, resolve the parent
+ * directories if resolveAbsolute is true.
+ */
+ private byte[] resolveLink(byte[] pathBytes, int length,
+ boolean resolveAbsolute) throws IOException {
+ boolean restart = false;
+ byte[] linkBytes, temp;
+ do {
+ linkBytes = getLinkImpl(pathBytes);
+ if (linkBytes == pathBytes) {
+ break;
+ }
+ if (linkBytes[0] == separatorChar) {
+ // link to an absolute path, if resolving absolute paths,
+ // resolve the parent dirs again
+ restart = resolveAbsolute;
+ pathBytes = linkBytes;
+ } else {
+ int last = length - 1;
+ while (pathBytes[last] != separatorChar) {
+ last--;
+ }
+ last++;
+ temp = new byte[last + linkBytes.length];
+ System.arraycopy(pathBytes, 0, temp, 0, last);
+ System.arraycopy(linkBytes, 0, temp, last, linkBytes.length);
+ pathBytes = temp;
+ }
+ length = pathBytes.length;
+ } while (existsImpl(pathBytes));
+ // resolve the parent directories
+ if (restart) {
+ return resolve(pathBytes);
+ }
+ return pathBytes;
+ }
/**
* Answers a new File created using the canonical file path of this File.
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/FilterInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/FilterInputStream.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/FilterInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/FilterInputStream.java Thu Dec 18 01:46:12 2008
@@ -30,7 +30,7 @@
/**
* The target InputStream which is being filtered.
*/
- protected InputStream in;
+ protected volatile InputStream in;
/**
* Constructs a new FilterInputStream on the InputStream <code>in</code>.
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStreamReader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStreamReader.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStreamReader.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStreamReader.java Thu Dec 18 01:46:12 2008
@@ -26,8 +26,8 @@
import java.nio.charset.MalformedInputException;
import java.nio.charset.UnmappableCharacterException;
import java.security.AccessController;
-import java.util.HashMap;
+import org.apache.harmony.luni.util.HistoricalNamesUtil;
import org.apache.harmony.luni.util.Msg;
import org.apache.harmony.luni.util.PriviAction;
@@ -177,160 +177,6 @@
return HistoricalNamesUtil.getHistoricalName(decoder.charset().name());
}
- /*
- * helper for getEncoding()
- */
- @SuppressWarnings("nls")
- static class HistoricalNamesUtil {
- private static HashMap<String, String> historicalNames = new HashMap<String, String>();
- static {
- historicalNames.put("Big5-HKSCS", "Big5_HKSCS");
- historicalNames.put("EUC-JP", "EUC_JP");
- historicalNames.put("EUC-KR", "EUC_KR");
- historicalNames.put("GB2312", "EUC_CN");
- historicalNames.put("IBM-Thai", "Cp838");
- historicalNames.put("IBM00858", "Cp858");
- historicalNames.put("IBM01140", "Cp1140");
- historicalNames.put("IBM01141", "Cp1141");
- historicalNames.put("IBM01142", "Cp1142");
- historicalNames.put("IBM01143", "Cp1143");
- historicalNames.put("IBM01144", "Cp1144");
- historicalNames.put("IBM01145", "Cp1145");
- historicalNames.put("IBM01146", "Cp1146");
- historicalNames.put("IBM01147", "Cp1147");
- historicalNames.put("IBM01148", "Cp1148");
- historicalNames.put("IBM01149", "Cp1149");
- historicalNames.put("IBM037", "Cp037");
- historicalNames.put("IBM1026", "Cp1026");
- historicalNames.put("IBM1047", "Cp1047");
- historicalNames.put("IBM273", "Cp273");
- historicalNames.put("IBM277", "Cp277");
- historicalNames.put("IBM278", "Cp278");
- historicalNames.put("IBM280", "Cp280");
- historicalNames.put("IBM284", "Cp284");
- historicalNames.put("IBM285", "Cp285");
- historicalNames.put("IBM297", "Cp297");
- historicalNames.put("IBM420", "Cp420");
- historicalNames.put("IBM424", "Cp424");
- historicalNames.put("IBM437", "Cp437");
- historicalNames.put("IBM500", "Cp500");
- historicalNames.put("IBM775", "Cp775");
- historicalNames.put("IBM850", "Cp850");
- historicalNames.put("IBM852", "Cp852");
- historicalNames.put("IBM855", "Cp855");
- historicalNames.put("IBM857", "Cp857");
- historicalNames.put("IBM860", "Cp860");
- historicalNames.put("IBM861", "Cp861");
- historicalNames.put("IBM862", "Cp862");
- historicalNames.put("IBM863", "Cp863");
- historicalNames.put("IBM864", "Cp864");
- historicalNames.put("IBM865", "Cp865");
- historicalNames.put("IBM866", "Cp866");
- historicalNames.put("IBM868", "Cp868");
- historicalNames.put("IBM869", "Cp869");
- historicalNames.put("IBM870", "Cp870");
- historicalNames.put("IBM871", "Cp871");
- historicalNames.put("IBM918", "Cp918");
- historicalNames.put("ISO-2022-CN", "ISO2022CN");
- historicalNames.put("ISO-2022-JP", "ISO2022JP");
- historicalNames.put("ISO-2022-KR", "ISO2022KR");
- historicalNames.put("ISO-8859-1", "ISO8859_1");
- historicalNames.put("ISO-8859-13", "ISO8859_13");
- historicalNames.put("ISO-8859-15", "ISO8859_15");
- historicalNames.put("ISO-8859-2", "ISO8859_2");
- historicalNames.put("ISO-8859-3", "ISO8859_3");
- historicalNames.put("ISO-8859-4", "ISO8859_4");
- historicalNames.put("ISO-8859-5", "ISO8859_5");
- historicalNames.put("ISO-8859-6", "ISO8859_6");
- historicalNames.put("ISO-8859-7", "ISO8859_7");
- historicalNames.put("ISO-8859-8", "ISO8859_8");
- historicalNames.put("ISO-8859-9", "ISO8859_9");
- historicalNames.put("KOI8-R", "KOI8_R");
- historicalNames.put("Shift_JIS", "SJIS");
- historicalNames.put("TIS-620", "TIS620");
- historicalNames.put("US-ASCII", "ASCII");
- historicalNames.put("UTF-16BE", "UnicodeBigUnmarked");
- historicalNames.put("UTF-16LE", "UnicodeLittleUnmarked");
- historicalNames.put("UTF-8", "UTF8");
- historicalNames.put("windows-1250", "Cp1250");
- historicalNames.put("windows-1251", "Cp1251");
- historicalNames.put("windows-1252", "Cp1252");
- historicalNames.put("windows-1253", "Cp1253");
- historicalNames.put("windows-1254", "Cp1254");
- historicalNames.put("windows-1255", "Cp1255");
- historicalNames.put("windows-1256", "Cp1256");
- historicalNames.put("windows-1257", "Cp1257");
- historicalNames.put("windows-1258", "Cp1258");
- historicalNames.put("windows-31j", "MS932");
- historicalNames.put("x-Big5-Solaris", "Big5_Solaris");
- historicalNames.put("x-euc-jp-linux", "EUC_JP_LINUX");
- historicalNames.put("x-EUC-TW", "EUC_TW");
- historicalNames.put("x-eucJP-Open", "EUC_JP_Solaris");
- historicalNames.put("x-IBM1006", "Cp1006");
- historicalNames.put("x-IBM1025", "Cp1025");
- historicalNames.put("x-IBM1046", "Cp1046");
- historicalNames.put("x-IBM1097", "Cp1097");
- historicalNames.put("x-IBM1098", "Cp1098");
- historicalNames.put("x-IBM1112", "Cp1112");
- historicalNames.put("x-IBM1122", "Cp1122");
- historicalNames.put("x-IBM1123", "Cp1123");
- historicalNames.put("x-IBM1124", "Cp1124");
- historicalNames.put("x-IBM1381", "Cp1381");
- historicalNames.put("x-IBM1383", "Cp1383");
- historicalNames.put("x-IBM33722", "Cp33722");
- historicalNames.put("x-IBM737", "Cp737");
- historicalNames.put("x-IBM856", "Cp856");
- historicalNames.put("x-IBM874", "Cp874");
- historicalNames.put("x-IBM875", "Cp875");
- historicalNames.put("x-IBM921", "Cp921");
- historicalNames.put("x-IBM922", "Cp922");
- historicalNames.put("x-IBM930", "Cp930");
- historicalNames.put("x-IBM933", "Cp933");
- historicalNames.put("x-IBM935", "Cp935");
- historicalNames.put("x-IBM937", "Cp937");
- historicalNames.put("x-IBM939", "Cp939");
- historicalNames.put("x-IBM942", "Cp942");
- historicalNames.put("x-IBM942C", "Cp942C");
- historicalNames.put("x-IBM943", "Cp943");
- historicalNames.put("x-IBM943C", "Cp943C");
- historicalNames.put("x-IBM948", "Cp948");
- historicalNames.put("x-IBM949", "Cp949");
- historicalNames.put("x-IBM949C", "Cp949C");
- historicalNames.put("x-IBM950", "Cp950");
- historicalNames.put("x-IBM964", "Cp964");
- historicalNames.put("x-IBM970", "Cp970");
- historicalNames.put("x-ISCII91", "ISCII91");
- historicalNames.put("x-ISO-2022-CN-CNS", "ISO2022CN");
- historicalNames.put("x-ISO-2022-CN-GB", "ISO2022CN");
- historicalNames.put("x-JISAutoDetect", "JISAutoDetect");
- historicalNames.put("x-MacArabic", "MacArabic");
- historicalNames.put("x-MacCentralEurope", "MacCentralEurope");
- historicalNames.put("x-MacCroatian", "MacCroatian");
- historicalNames.put("x-MacCyrillic", "MacCyrillic");
- historicalNames.put("x-MacDingbat", "MacDingbat");
- historicalNames.put("x-MacGreek", "MacGreek");
- historicalNames.put("x-MacHebrew", "MacHebrew");
- historicalNames.put("x-MacIceland", "MacIceland");
- historicalNames.put("x-MacRoman", "MacRoman");
- historicalNames.put("x-MacRomania", "MacRomania");
- historicalNames.put("x-MacSymbol", "MacSymbol");
- historicalNames.put("x-MacThai", "MacThai");
- historicalNames.put("x-MacTurkish", "MacTurkish");
- historicalNames.put("x-MacUkraine", "MacUkraine");
- historicalNames.put("x-MS950-HKSCS", "MS950_HKSCS");
- historicalNames.put("x-mswin-936", "MS936");
- historicalNames.put("x-PCK", "PCK");
- historicalNames.put("x-windows-874", "MS874");
- historicalNames.put("x-windows-949", "MS949");
- historicalNames.put("x-windows-950", "MS950");
- }
-
- public static String getHistoricalName(String name) {
- return (!historicalNames.containsKey(name) ? name : historicalNames
- .get(name));
- }
- }
-
/**
* Reads a single character from this InputStreamReader and returns the
* result as an int. The 2 higher-order characters are set to 0. If the end
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/OutputStreamWriter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/OutputStreamWriter.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/OutputStreamWriter.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/OutputStreamWriter.java Thu Dec 18 01:46:12 2008
@@ -25,6 +25,7 @@
import java.nio.charset.CodingErrorAction;
import java.security.AccessController;
+import org.apache.harmony.luni.util.HistoricalNamesUtil;
import org.apache.harmony.luni.util.Msg;
import org.apache.harmony.luni.util.PriviAction;
@@ -200,8 +201,7 @@
if (encoder == null) {
return null;
}
- return InputStreamReader.HistoricalNamesUtil.getHistoricalName(encoder
- .charset().name());
+ return HistoricalNamesUtil.getHistoricalName(encoder.charset().name());
}
/**
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/DatagramSocket.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/DatagramSocket.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/DatagramSocket.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/DatagramSocket.java Thu Dec 18 01:46:12 2008
@@ -20,9 +20,8 @@
import java.io.IOException;
import java.nio.channels.DatagramChannel;
-import org.apache.harmony.luni.net.SocketImplProvider;
+import org.apache.harmony.luni.net.PlainDatagramSocketImpl;
import org.apache.harmony.luni.platform.Platform;
-
import org.apache.harmony.luni.util.Msg;
/**
@@ -188,7 +187,7 @@
synchronized void createSocket(int aPort, InetAddress addr)
throws SocketException {
impl = factory != null ? factory.createDatagramSocketImpl()
- : SocketImplProvider.getDatagramSocketImpl();
+ : new PlainDatagramSocketImpl();
impl.create();
try {
impl.bind(aPort, addr);
@@ -561,7 +560,7 @@
checkListen(((InetSocketAddress) localAddr).getPort());
}
impl = factory != null ? factory.createDatagramSocketImpl()
- : SocketImplProvider.getDatagramSocketImpl();
+ : new PlainDatagramSocketImpl();
impl.create();
if (localAddr != null) {
try {
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/InetAddress.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/InetAddress.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/InetAddress.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/InetAddress.java Thu Dec 18 01:46:12 2008
@@ -913,10 +913,10 @@
// define traffic only for parameter
int traffic = 0;
boolean reached = false;
- NETIMPL.createSocket(fd, NetUtil.preferIPv4Stack());
+ NETIMPL.createStreamSocket(fd, NetUtil.preferIPv4Stack());
try {
if (null != source) {
- NETIMPL.bind(fd, 0, source);
+ NETIMPL.bind(fd, source, 0);
}
NETIMPL.connectStreamWithTimeoutSocket(fd, 7, timeout, traffic,
dest);
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/MulticastSocket.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/MulticastSocket.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/MulticastSocket.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/MulticastSocket.java Thu Dec 18 01:46:12 2008
@@ -20,7 +20,7 @@
import java.io.IOException;
import java.util.Enumeration;
-import org.apache.harmony.luni.net.SocketImplProvider;
+import org.apache.harmony.luni.net.PlainDatagramSocketImpl;
import org.apache.harmony.luni.util.Msg;
/**
@@ -551,11 +551,10 @@
synchronized void createSocket(int aPort, InetAddress addr)
throws SocketException {
impl = factory != null ? factory.createDatagramSocketImpl()
- : SocketImplProvider.getMulticastSocketImpl();
+ : new PlainDatagramSocketImpl();
impl.create();
try {
- // the required default options are now set in the VM where they
- // should be
+ impl.setOption(SocketOptions.SO_REUSEADDR, Boolean.TRUE);
impl.bind(aPort, addr);
isBound = true;
} catch (SocketException e) {
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/ServerSocket.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/ServerSocket.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/ServerSocket.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/ServerSocket.java Thu Dec 18 01:46:12 2008
@@ -20,9 +20,8 @@
import java.io.IOException;
import java.nio.channels.ServerSocketChannel;
-import org.apache.harmony.luni.net.SocketImplProvider;
+import org.apache.harmony.luni.net.PlainSocketImpl;
import org.apache.harmony.luni.platform.Platform;
-
import org.apache.harmony.luni.util.Msg;
/**
@@ -57,7 +56,7 @@
*/
public ServerSocket() throws IOException {
impl = factory != null ? factory.createSocketImpl()
- : SocketImplProvider.getServerSocketImpl();
+ : new PlainSocketImpl();
}
protected ServerSocket(SocketImpl impl) {
@@ -110,7 +109,7 @@
super();
checkListen(aport);
impl = factory != null ? factory.createSocketImpl()
- : SocketImplProvider.getServerSocketImpl();
+ : new PlainSocketImpl();
InetAddress addr = localAddr == null ? InetAddress.ANY : localAddr;
synchronized (this) {
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/Socket.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/Socket.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/Socket.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/Socket.java Thu Dec 18 01:46:12 2008
@@ -24,7 +24,7 @@
import java.security.AccessController;
import org.apache.harmony.luni.net.NetUtil;
-import org.apache.harmony.luni.net.SocketImplProvider;
+import org.apache.harmony.luni.net.PlainSocketImpl;
import org.apache.harmony.luni.platform.Platform;
import org.apache.harmony.luni.util.Msg;
import org.apache.harmony.luni.util.PriviAction;
@@ -78,7 +78,7 @@
*/
public Socket() {
impl = factory != null ? factory.createSocketImpl()
- : SocketImplProvider.getSocketImpl();
+ : new PlainSocketImpl();
}
/**
@@ -114,7 +114,7 @@
checkConnectPermission(host, port);
}
impl = factory != null ? factory.createSocketImpl()
- : SocketImplProvider.getSocketImpl(proxy);
+ : new PlainSocketImpl(proxy);
this.proxy = proxy;
}
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/SocketImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/SocketImpl.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/SocketImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/SocketImpl.java Thu Dec 18 01:46:12 2008
@@ -274,7 +274,7 @@
return this.netImpl.sendDatagram2(fd, buffer, offset, count, port,
address);
}
- return this.netImpl.sendStream(fd, buffer, offset, count);
+ return this.netImpl.write(fd, buffer, offset, count);
}
/**
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/URLConnection.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/URLConnection.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/URLConnection.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/net/URLConnection.java Thu Dec 18 01:46:12 2008
@@ -246,7 +246,8 @@
.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
try {
- String className = "org.apache.harmony.luni.internal.net.www.content." //$NON-NLS-1$
+ // Try looking up AWT image content handlers
+ String className = "org.apache.harmony.awt.www.content." //$NON-NLS-1$
+ typeString;
return Class.forName(className).newInstance();
} catch (ClassNotFoundException e) {
|