< prev index next >
test/java/io/File/createTempFile/NameTooLong.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2016, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2016, 2017, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 41,51 ****
int failures = 0;
int index = 0;
for (String[] ps : prefixSuffix) {
File f;
try {
! f = File.createTempFile(ps[0], ps[1]);
String s = f.toPath().getFileName().toString();
if (!s.startsWith(ps[0].substring(0, 3))) {
System.err.printf("%s did not start with %s%n", s,
ps[0].substring(0, 3));
failures++;
--- 41,52 ----
int failures = 0;
int index = 0;
for (String[] ps : prefixSuffix) {
File f;
try {
! f = File.createTempFile(ps[0], ps[1],
! new File(System.getProperty("test.dir", ".")));
String s = f.toPath().getFileName().toString();
if (!s.startsWith(ps[0].substring(0, 3))) {
System.err.printf("%s did not start with %s%n", s,
ps[0].substring(0, 3));
failures++;
< prev index next >