Bug 181848

Summary: [misc] Fix indentation when displaying source code from java runtimes
Product: [Eclipse Project] JDT Reporter: Walter Harley <eclipse>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Walter Harley CLA 2007-04-10 17:08:07 EDT
Different teams treat tabs differently, and Eclipse has settings that meet the needs of virtually everyone.

However, regardless of individual team rules, we all have to look at the Java runtime source code from time to time.  And Sun is notorious for doing two things: using 8-space tab stops, and intermingling tabs and spaces.  The result is that unless one's own team rules involve 8-space tab stops (very unusual!), Java source becomes virtually unreadable, as a single space-indented line appears to be twice as deep as a single tab-indented line.

A specific fix would be to special-case the java runtime source code.  Since the Java runtime sources are in a well-defined location, and use well-known rules that do not correspond to most other teams' rules, it would be neat if the Java runtime source could be treated differently when displayed.  The code could either be displayed with 8-space tab stops, or dynamically reindented on the fly.

A more general alternative would be to always re-indent (pretty-print) the code when displaying source code for binary classes, regardless of what jar the class was found in (i.e., not just the java runtimes).  

Note that line breaks should never be changed, only indentation, in order to preserve stack traces.
Comment 1 Dani Megert CLA 2007-04-11 03:43:12 EDT
Would it be enough if you can set the Tab display with? Doing more would be too much as we would have to build a complete mapping layer in order make Debugging and other JDT tools work correctly.