harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jimmy, Jing Lv" <firep...@gmail.com>
Subject Re: [classlib][net] The old fix is not complete (was Re: [jira] Updated: (HARMONY-1117) [classlib][net] Harmony implementation of SocketImpl.getFileDescriptor() return real object, but RI return null)
Date Thu, 14 Sep 2006 10:31:04 GMT
Andrew Zhang wrote:
> I don't think the fix is complete. The patch only fixed reported bug, but
> introduces new severe bugs.
> 
> Because fd would never be initialized after applying the patch. Running all
> tests would also fail with crash.
> 

Yes, fd without initialized may cause a tragedy, all network functions 
relay on this.

> After deleting initialization code in SocketImpl.java, we have to 
> initialize
> SocketImpl.fd elsewhere. I suggest add the code into
> PlainSocketImpl.createmethod.  Am I right?
> 

I believe this may be correct. Or we can add a constructor in 
PlainSocketImpl, initial fd there.

> If no one objects, I'll apply a patch to fix this jira. Thanks!
> 
> On 8/9/06, Igor V. Stolyarov (JIRA) <jira@apache.org> wrote:
>>
>>     [ http://issues.apache.org/jira/browse/HARMONY-1117?page=all ]
>>
>> Igor V. Stolyarov updated HARMONY-1117:
>> ---------------------------------------
>>
>>    Attachment: Harmony-1117.patch
>>
>> Fix attached
>>
>> > [classlib][net] Harmony implementation of 
>> SocketImpl.getFileDescriptor()
>> return real object, but RI return null
>> >
>> ---------------------------------------------------------------------------------------------------------------

>>
>> >
>> >                 Key: HARMONY-1117
>> >                 URL: http://issues.apache.org/jira/browse/HARMONY-1117
>> >             Project: Harmony
>> >          Issue Type: Bug
>> >            Reporter: Igor V. Stolyarov
>> >         Attachments: Harmony-1117.patch
>> >
>> >
>> >  Harmony implementation of SocketImpl.getFileDescriptor() return real
>> object, but RI return null
>> >
>> Test---------------------------------------------------------------------------------------------------

>>
>> > import java.io.*;
>> > import java.net.*;
>> > public class Test {
>> >     public static void main(String[] args) {
>> >        try {
>> >             TestSocketImpl testSocketImpl = new TestSocketImpl();
>> >             
>> System.out.println("res="+testSocketImpl.getFileDescriptor()
>> );
>> >        } catch (Exception e) {
>> >            e.printStackTrace();
>> >        }
>> >     }
>> > }
>> > class TestSocketImpl extends SocketImpl {
>> >     public FileDescriptor getFileDescriptor(){
>> >         return super.getFileDescriptor();
>> >     }
>> >     protected void create(boolean arg0) throws IOException {}
>> >     protected void connect(String arg0, int arg1) throws IOException {}
>> >     protected void connect(InetAddress arg0, int arg1) throws
>> IOException {}
>> >     protected void connect(SocketAddress arg0, int arg1) throws
>> IOException {}
>> >     protected void bind(InetAddress arg0, int arg1) throws 
>> IOException{}
>> >     protected void listen(int arg0) throws IOException {}
>> >     protected void accept(SocketImpl arg0) throws IOException {}
>> >     protected InputStream getInputStream() throws IOException {
>> >         return null;
>> >     }
>> >     protected OutputStream getOutputStream() throws IOException {
>> >         return null;
>> >     }
>> >     protected int available() throws IOException {
>> >         return 0;
>> >     }
>> >     protected void close() throws IOException {}
>> >     protected void sendUrgentData(int arg0) throws IOException {}
>> >     public void setOption(int arg0, Object arg1) throws
>> SocketException{}
>> >     public Object getOption(int arg0) throws SocketException {
>> >         return null;
>> >     }
>> > }
>> >
>> Output------------------------------------------------------------------------------------------------

>>
>> > Harmony:
>> > java version 1.5 (subset)
>> > (c) Copyright 1991, 2006 The Apache Software Foundation or its
>> licensors, as app
>> > licable.
>> > res=java.io.FileDescriptor@6460646
>> > JRockit:
>> > java version "1.5.0"
>> > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
>> > BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32,
>> R25.0.0-75, GC:
>> >  System optimized over throughput (initial strategy singleparpar))
>> > res=null
>>
>> -- 
>> This message is automatically generated by JIRA.
>> -
>> If you think it was sent incorrectly contact one of the administrators:
>> http://issues.apache.org/jira/secure/Administrators.jspa
>> -
>> For more information on JIRA, see: http://www.atlassian.com/software/jira
>>
>>
>>
> 
> 


-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message