< prev index next >

test/jdk/java/io/NegativeInitSize.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1998, 2019 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) 1998, 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.
*** 47,60 **** System.out.println(e.getClass().getName()); throw new Exception ("PushbackReader failed to detect negative init size"); } - byte[] ba = { 123 }; - ByteArrayInputStream goodbis = new ByteArrayInputStream(ba); try { ! PushbackInputStream pbis = new PushbackInputStream(goodbis, -1); } catch (IllegalArgumentException e) { } catch (Exception e) { throw new Exception ("PushbackInputStream failed to detect negative init size"); } --- 47,58 ---- System.out.println(e.getClass().getName()); throw new Exception ("PushbackReader failed to detect negative init size"); } try { ! PushbackInputStream pbis = new PushbackInputStream(null, -1); } catch (IllegalArgumentException e) { } catch (Exception e) { throw new Exception ("PushbackInputStream failed to detect negative init size"); }
*** 66,75 **** --- 64,75 ---- } catch (Exception e) { throw new Exception ("BufferedOutputStream failed to detect negative init size"); } + byte[] ba = { 123 }; + ByteArrayInputStream goodbis = new ByteArrayInputStream(ba); try { BufferedInputStream bis = new BufferedInputStream(goodbis, -1); } catch (IllegalArgumentException e) { } catch (Exception e) { throw new Exception
< prev index next >