/*
* 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 6322678
* @summary Test for making sure that FIS/FOS.finalize() will
* not disturb the FD that is still in use.
*/
public class Finalize {
throws Exception {
}
/* Create initial FIS for file */
/* Get the FileDescriptor from the fis */
/*
* Create a new FIS based on the existing FD
* (so the two FIS's share the same native fd)
*/
/* allow fis1 to be gc'ed */
int ret = 0;
/* encourage gc */
/*
* read from fis2 - when fis1 is gc'ed and finalizer is run,
* read should not fail
*/
}
}
}
private static void doFileOutputStream()
throws Exception {
/*Create initial FIS for file */
/* Get the FileDescriptor from the fos */
/* allow fos1 to be gc'ed */
/* encourage gc */
/*
* write to fos2 - when fos1 is gc'ed and finalizer is run,
* write to fos2 should not fail
*/
}
private static void doRandomAccessFile()
throws Exception {
// Create initial FIS for file
/* Get the FileDescriptor from the fis */
/* Create a new FIS based on the existing FD
* (so the two FIS's share the same native fd)
*/
/* allow fis to be gc'ed */
int ret = 0;
/* encourage gc */
/*
* read from raf - when fis is gc'ed and finalizer is run,
* read from raf should not fail
*/
}
/* allow fos to be gc'ed */
/* encourage gc */
/*
* write to raf - when fos is gc'ed and finalizer is run,
* write to raf should not fail
*/
}
/* Get the FileDescriptor from the fis */
/* Create a new FIS based on the existing FD
* (so the two FIS's share the same native fd)
*/
/**
* Encourage the GC
*/
int ret = 1;
/* Get the FileDescriptor from the fos */
/**
* Encourage the GC
*/
/*
* write to fc2 - when fos1 is gc'ed and finalizer is run,
* write to fc2 should not fail
*/
}
}