Nice/src/gnu/bytecode SourceMap.java,1.5,1.6

Daniel Bonniot <[email protected]>
Newsgroups gmane.comp.lang.nice.cvs
Message-ID <[email protected]>
Update of /cvsroot/nice/Nice/src/gnu/bytecode
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19546/src/gnu/bytecode

Modified Files:
	SourceMap.java 
Log Message:
Make sure to produce a valid source map while keeping its size below 65535.


Index: SourceMap.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/SourceMap.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SourceMap.java	12 Feb 2005 13:53:37 -0000	1.5
--- SourceMap.java	16 Feb 2005 23:31:39 -0000	1.6
***************
*** 40,45 ****
    public int getLength()
    {
!     // Truncate the content to keep it under 65535, because of a JVM bug.
!     return Math.min(65535, getBytes().length);
    }
  
--- 40,44 ----
    public int getLength()
    {
!     return getBytes().length;
    }
  
***************
*** 64,69 ****
    {
      byte[] bytes = getBytes();
!     // Truncate the content to keep it under 65535, because of a JVM bug.
!     out.write(bytes, 0, Math.min(65535, bytes.length));
   }
  
--- 63,67 ----
    {
      byte[] bytes = getBytes();
!     out.write(bytes, 0, bytes.length);
   }
  
***************
*** 93,96 ****
--- 91,98 ----
        return -1;
  
+     // Truncate the content to keep it under 65535, because of a JVM bug.
+     if (buffer.length() + lines.length() > 65000)
+       return -1;
+ 
      if (! file.equals(currentFile) || line < firstLine)
        {



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.