changeset 11177:80a5f6aa2033

8065420: Eliminate internal API dependency from java/net/ResponseCache/ResponseCacheTest.java Reviewed-by: chegar Contributed-by: Amanda Jiang <amanda.jiang@oracle.com>
author chegar
date Tue, 23 Dec 2014 15:10:15 +0000
parents 09bcd51adf34
children 46bd35a597eb
files test/java/net/ResponseCache/ResponseCacheTest.java
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/net/ResponseCache/ResponseCacheTest.java	Tue Dec 23 02:58:15 2014 +0000
+++ b/test/java/net/ResponseCache/ResponseCacheTest.java	Tue Dec 23 15:10:15 2014 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
 import java.net.*;
 import java.util.*;
 import java.io.*;
-import sun.net.www.ParseUtil;
 import javax.net.ssl.*;
 
 /**
@@ -178,11 +177,16 @@
     }
 
     static class MyResponseCache extends ResponseCache {
-        public CacheResponse
-        get(URI uri, String rqstMethod, Map<String,List<String>> rqstHeaders)
-            throws IOException {
-            if (uri.equals(ParseUtil.toURI(url1))) {
-                return new MyCacheResponse(FNPrefix+"file1.cache");
+        public CacheResponse get(URI uri, String rqstMethod,
+                                 Map<String,List<String>> rqstHeaders)
+            throws IOException
+        {
+            try {
+                if (uri.equals(url1.toURI())) {
+                    return new MyCacheResponse(FNPrefix+"file1.cache");
+                }
+            } catch (URISyntaxException ex) {
+                throw new RuntimeException (ex);
             }
             return null;
         }