/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 6840246
* @summary test String.split()
*/
public class Split {
for (int x=0; x<10; x++) {
// expected dropping of ""
throw new RuntimeException("String.split failure 1");
throw new RuntimeException("String.split failure 2");
}
} else {
throw new RuntimeException("String.split failure 3");
}
if (limit != 1) {
throw new RuntimeException(
"String.split failure 4");
} else {
throw new RuntimeException(
"String.split failure 10");
}
}
}
throw new RuntimeException("String.split failure 5");
}
}
}
}
// Check the case for no match found
throw new RuntimeException("String.split failure 6");
throw new RuntimeException("String.split failure 7");
}
// Check the case for limit == 0, source = "";
source = "";
throw new RuntimeException("String.split failure 8");
throw new RuntimeException("String.split failure 9");
// check fastpath of String.split()
source = "0123456789abcdefgABCDEFG";
for (boolean doEscape: new boolean[] {false, true}) {
if (doEscape)
try {
} catch (PatternSyntaxException pse) {
// illegal syntax
try {
} catch (PatternSyntaxException pse0) {
continue;
}
throw new RuntimeException("String.split failure 11");
}
"",
};
throw new RuntimeException("String.split failure 12");
}
}
}
}
}
}