JDK-6183495 : Javac needs to use file offsets for positions
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 2.0
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2004-10-22
  • Updated: 2010-04-02
  • Resolved: 2005-02-18
Related Reports
Duplicate :  
Description
Javac currently uses packed integers to store source file positions, which hold the line and column position.  These packed integers suffer from two problems:

1.  very long source files, or files with very wide columns, can overrun the fields in the packed integer.

2.  tools that need to create source from the parse trees, such as when refactoring, cannot reliably recreate source offsets due to column tab-expansion problems.

The agreed upon solution is to use source file character offsets instead of packed integers.
###@###.### 10/22/04 23:48 GMT

Comments
EVALUATION Since a great deal of work has been put into this, we should get this into javac asap. ###@###.### 10/23/04 00:54 GMT
23-10-2004

SUGGESTED FIX Modify Scanner to use offsets instead of calculating packed integers. Update Log to rescan the source file to report errors. Update all references to Position.line and Position.column to use offsets. ###@###.### 10/22/04 23:48 GMT
22-10-2004