Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 321038

Summary: NPE in Reindenter
Product: [Tools] PTP Reporter: Matthew Fotzler <incongruous>
Component: Photran.UnknownAssignee: Jeffrey Overbey <com-eclipse-dot-org>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: com-eclipse-dot-org
Version: unspecified   
Target Milestone: 6.0.7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 284403    
Bug Blocks:    

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.