Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321038 - NPE in Reindenter
Summary: NPE in Reindenter
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: Photran.Unknown (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 6.0.7   Edit
Assignee: Jeffrey Overbey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 284403
Blocks:
  Show dependency tree
 
Reported: 2010-07-27 11:33 EDT by Matthew Fotzler CLA
Modified: 2011-03-14 23:32 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Fotzler CLA 2010-07-27 11:33:28 EDT
When I use select all and then the Fortran Reindintation, I get a null pointer error.  The problem seems to be in TokenList.java on line 181.  There is a call getLine(array[index+1]), and array[index+1] seems to be getting the null in the array after the end of statement token that it should.
Comment 1 Matthew Fotzler CLA 2010-07-27 11:37:24 EDT
After looking at the line in question:

while (index+1 < array.length && getLine(array[index+1]) == line)

I think instead of checking index+1 < array.length, it should be checking index+1 < size, since array.length is larger than the actual number of tokens in the array.
Comment 2 Matthew Fotzler CLA 2010-08-11 16:48:59 EDT
There is also a bug when attempting to reindent with the Move Module Entities refactoring that causes the majority of the file to be indented when it should not be.
Comment 3 Jeffrey Overbey CLA 2011-03-14 14:18:56 EDT
This has been fixed in 7.0/HEAD for a while; I just committed the fix to 6_0 for the 6.0.7 release as well.