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 2006/12/28 14:50:37 UTC
svn commit: r490724 - in /harmony/enhanced/classlib/trunk/modules/luni/src:
main/java/java/net/URLConnection.java
test/java/tests/api/java/net/URLConnectionTest.java
Author: tellison
Date: Thu Dec 28 05:50:36 2006
New Revision: 490724
URL: http://svn.apache.org/viewvc?view=rev&rev=490724
Log:
Apply patch HARMONY-2471 ([classlib][luni]java.net.URLConnection.setIfModifiedSince() throws unspecified IllegalAccessError)
Modified:
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java
harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URLConnectionTest.java
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java?view=diff&rev=490724&r1=490723&r2=490724
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java Thu Dec 28 05:50:36 2006
@@ -872,7 +872,7 @@
*/
public void setDoInput(boolean newValue) {
if (connected) {
- throw new IllegalAccessError(Msg.getString("K0037"));
+ throw new IllegalStateException(Msg.getString("K0037"));
}
this.doInput = newValue;
}
@@ -895,7 +895,7 @@
*/
public void setDoOutput(boolean newValue) {
if (connected) {
- throw new IllegalAccessError(Msg.getString("K0037"));
+ throw new IllegalStateException(Msg.getString("K0037"));
}
this.doOutput = newValue;
}
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URLConnectionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URLConnectionTest.java?view=diff&rev=490724&r1=490723&r2=490724
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URLConnectionTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URLConnectionTest.java Thu Dec 28 05:50:36 2006
@@ -940,17 +940,39 @@
}
/**
+ * @throws IOException
+ * @throws MalformedURLException
* @tests java.net.URLConnection#setDoInput(boolean)
*/
- public void test_setDoInputZ() {
+ public void test_setDoInputZ() throws MalformedURLException, IOException {
assertTrue("Used to test", true);
+ HttpURLConnection u = null;
+
+ u = (HttpURLConnection) (new URL("http://intel.com").openConnection());
+ u.connect();
+
+ try {
+ u.setDoInput(true);
+ } catch (IllegalStateException e) { // expected
+ }
}
/**
+ * @throws IOException
+ * @throws MalformedURLException
* @tests java.net.URLConnection#setDoOutput(boolean)
*/
- public void test_setDoOutputZ() {
+ public void test_setDoOutputZ() throws MalformedURLException, IOException {
assertTrue("Used to test", true);
+ HttpURLConnection u = null;
+
+ u = (HttpURLConnection) (new URL("http://intel.com").openConnection());
+ u.connect();
+
+ try {
+ u.setDoOutput(true);
+ } catch (IllegalStateException e) { // expected
+ }
}
/**