harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Artem Aliev (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2471) [luni]java.net.URLConnection.setIfModifiedSince() throws unspecified IllegalAccessError
Date Tue, 05 Dec 2006 14:28:46 GMT
[luni]java.net.URLConnection.setIfModifiedSince() throws unspecified IllegalAccessError
---------------------------------------------------------------------------------------

                 Key: HARMONY-2471
                 URL: http://issues.apache.org/jira/browse/HARMONY-2471
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Artem Aliev
            Priority: Minor


According to the specification java.net.URLConnection.setIfModifiedSince(long
l) throws IllegalStateException, if already connected. Harmony throws
java.lang.IllegalAccessError instead that contradicts the specification.
The same issue is for 
  setDoOutput
  setDoInput
  setDefaultUseCaches 
methods.

Test for reproducing:
import junit.framework.TestCase;
import java.net.*;
import java.io.*;
public class test extends TestCase {

    public void test1 () {      
        HttpURLConnection u=null; 
        try { 
            u=(HttpURLConnection)(new
URL("http://intel.com").openConnection()); 
            u.connect(); 
        } catch (MalformedURLException e) { 
            fail("unexpected MalformedURLException"+e); 
        } catch (IOException f) { 
            fail("unexpected IOException"+f); 
        } 
        try { 
           u.setIfModifiedSince(1); 
        } catch (IllegalStateException e) { 
           //expected 
        };                     
   }  
   public void test2 () {      
        HttpURLConnection u=null; 
        try { 
            u=(HttpURLConnection)(new
URL("http://intel.com").openConnection()); 
            u.connect(); 
        } catch (MalformedURLException e) { 
            fail("unexpected MalformedURLException"+e); 
        } catch (IOException f) { 
            fail("unexpected IOException"+f); 
        } 
        try { 
           u.setDoOutput(true); 
        } catch (IllegalStateException e) { //expected 
        };                             
   } 
   public void test3 () {      
        HttpURLConnection u=null; 
        try { 
            u=(HttpURLConnection)(new
URL("http://intel.com").openConnection()); 
            u.connect(); 
        } catch (MalformedURLException e) { 
            fail("unexpected MalformedURLException"+e); 
        } catch (IOException f) { 
            fail("unexpected IOException"+f); 
        }        
        try { 
           u.setDoInput(true); 
        } catch (IllegalStateException e) { //expected 
        };                     
   }        
}
Output on Sun 1.5:
==================
...
Time: 0,953

OK (3 tests)

Output on Harmony:
==================
There were 3 errors:
1) test1(test)java.lang.IllegalAccessError: Connection already established
        at java.net.URLConnection.setIfModifiedSince(URLConnection.java:913)
        at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnect
ion.setIfModifiedSince(HttpURLConnection.java:1248)
        at test.test1(test.java:17)
        at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
2) test2(test)java.lang.IllegalAccessError: Connection already established
        at java.net.URLConnection.setDoOutput(URLConnection.java:885)
        at test.test2(test.java:33)
        at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
3) test3(test)java.lang.IllegalAccessError: Connection already established
        at java.net.URLConnection.setDoInput(URLConnection.java:862)
        at test.test3(test.java:48)
        at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)

FAILURES!!!
Tests run: 3,  Failures: 0,  Errors: 3


Affected tests: 
vts_api_java_net_URLConnection_setDefaultUseCaches_Z@test1_0    
vts_api_java_net_URLConnection_setDoInput_Z@test2_0    
vts_api_java_net_URLConnection_setDoOutput_Z@test2_0    
vts_api_java_net_URLConnection_setIfModifiedSince_J@test2_0 


-- 
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

        

Mime
View raw message