You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mikhail Loenko (JIRA)" <ji...@apache.org> on 2006/04/20 14:50:05 UTC

[jira] Resolved: (HARMONY-374) java.io.RandomAccessFile.seek(int pos) does not throw IOException if pos < 0

     [ http://issues.apache.org/jira/browse/HARMONY-374?page=all ]
     
Mikhail Loenko resolved HARMONY-374:
------------------------------------

    Resolution: Fixed

fixed in revision 395577
Svetlana, please verify that it fully resolves the problem

> java.io.RandomAccessFile.seek(int pos) does not  throw IOException if pos < 0
> -----------------------------------------------------------------------------
>
>          Key: HARMONY-374
>          URL: http://issues.apache.org/jira/browse/HARMONY-374
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>     Assignee: Mikhail Loenko
>  Attachments: RandomAccessFile.diffs, RandomAccessFileTest.java
>
> Accodring to java 1.4.2 and 1.5 specifications for java java.io. RandomAccessFile.seek(int pos)
> IOException must be thrown if pos<0. Harmony does not throw exception while RI (BEA 1.5)  does.
> Code to reproduce:
> import java.io.File;
> import java.io.RandomAccessFile;
> import java.io.IOException;
> public class test {
>   public static void main(String[] args) {
>         try {            
>              File file=File.createTempFile("one",null);
>              RandomAccessFile rfl= new RandomAccessFile(file,"r");
>              rfl.seek(-1); 
>              System.out.println("FAIL: IOException must be thrown");           
>         } catch (IOException e) {
>              System.out.println("PASS");
>         }
>     }
> }
> Output on Harmony:
> FAIL: IOException must be thrown
> Output on BEA (1.5)
> PASS

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira