release-request-762540b1-1728-41bc-a9ce-e977f3e2683f-for-git_nyc-mr2-pixel-monthly-release-3888830 snap-temp-L22300000056915770

Change-Id: I9adeccc0b2c6787e014be276623800a7718f5e6f
diff --git a/luni/src/test/java/libcore/java/net/FtpURLConnectionTest.java b/luni/src/test/java/libcore/java/net/FtpURLConnectionTest.java
deleted file mode 100644
index ff5d0b6..0000000
--- a/luni/src/test/java/libcore/java/net/FtpURLConnectionTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package libcore.java.net;
-
-import junit.framework.TestCase;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Locale;
-
-/**
- * Tests URLConnections for ftp:// URLs.
- */
-public class FtpURLConnectionTest extends TestCase {
-
-    private static final String FILE_PATH = "test/file/for/FtpURLConnectionTest.txt";
-    private static final String USER = "user";
-    private static final String PASSWORD = "password";
-    private static final String SERVER_HOSTNAME = "localhost";
-    private static final String USER_HOME_DIR = "/home/user";
-
-    // http://b/35784677
-    public void testCRLFInUserinfo() throws Exception {
-        int serverPort = 1234;
-        // '/r/n' in the username, no password
-        String url1String = String.format(Locale.US, "ftp://foo%%0D%%0Acommand@%s:%s/%s",
-            SERVER_HOSTNAME, serverPort, FILE_PATH);
-        // '/r/n' in the username with password
-        String url2String = String.format(Locale.US, "ftp://foo%%0D%%0Acommand:foo@%s:%s/%s",
-            SERVER_HOSTNAME, serverPort, FILE_PATH);
-        // '/r/n' in the password
-        String url3String = String.format(Locale.US, "ftp://foo:bar%%0D%%0Acommand@%s:%s/%s",
-            SERVER_HOSTNAME, serverPort, FILE_PATH);
-        // just '/r' in the password
-        String url4String = String.format(Locale.US, "ftp://foo:bar%%0Dcommand@%s:%s/%s",
-            SERVER_HOSTNAME, serverPort, FILE_PATH);
-        // just '/n' in the username
-        String url5String = String.format(Locale.US, "ftp://foo%%0Acommand:bar@%s:%s/%s",
-            SERVER_HOSTNAME, serverPort, FILE_PATH);
-
-        for (String urlString : new String[]{ url1String, url2String, url3String, url4String,
-                url5String }) {
-            try {
-                new URL(urlString).openConnection();
-                fail();
-            } catch(IOException expected) {}
-        }
-    }
-}
diff --git a/ojluni/src/main/java/sun/net/www/protocol/ftp/FtpURLConnection.java b/ojluni/src/main/java/sun/net/www/protocol/ftp/FtpURLConnection.java
index fd96343..e2b7fa1 100755
--- a/ojluni/src/main/java/sun/net/www/protocol/ftp/FtpURLConnection.java
+++ b/ojluni/src/main/java/sun/net/www/protocol/ftp/FtpURLConnection.java
@@ -184,12 +184,6 @@
         }
 
         if (userInfo != null) { // get the user and password
-            // Android-changed: Added a test for CR/LF presence in the userInfo
-            if (userInfo.indexOf("\r") != -1 || userInfo.indexOf("\n") != -1) {
-                throw new IOException("<CR> and/or <LF> characters in username and password are"
-                        + " not permitted");
-            }
-
             int delimiter = userInfo.indexOf(':');
             if (delimiter == -1) {
                 user = ParseUtil.decode(userInfo);