Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/SourceSection.java @ 9775:5dc05fdcf3c2
Fix SourceSection.getCode.
author | Chris Seaton <chris.seaton@oracle.com> |
---|---|
date | Mon, 20 May 2013 23:22:36 -0700 |
parents | c485a44097b3 |
children | e210293dca77 |
comparison
equal
deleted
inserted
replaced
9774:20963f52fdd5 | 9775:5dc05fdcf3c2 |
---|---|
113 * Returns the code represented by this code section. | 113 * Returns the code represented by this code section. |
114 * | 114 * |
115 * @return the code as a String object | 115 * @return the code as a String object |
116 */ | 116 */ |
117 public final String getCode() { | 117 public final String getCode() { |
118 return getSource().getCode().substring(charIndex, charLength); | 118 return getSource().getCode().substring(charIndex, charIndex + charLength); |
119 } | 119 } |
120 | 120 |
121 @Override | 121 @Override |
122 public String toString() { | 122 public String toString() { |
123 return String.format("%s:%d", source.getName(), startLine); | 123 return String.format("%s:%d", source.getName(), startLine); |