@@ -113,7 +113,7 @@ public Map<Comment, ErrorProneComment> comments() {
113113
114114 @ Override
115115 protected Comment processComment (int pos , int endPos , CommentStyle style ) {
116- char [] buf = getRawCharactersReflectively (pos , endPos );
116+ char [] buf = getRawCharacters (pos , endPos );
117117 Comment comment = super .processComment (pos , endPos , style );
118118 AccessibleReader reader = new AccessibleReader (fac , buf , buf .length );
119119 ErrorProneComment errorProneComment =
@@ -126,24 +126,6 @@ protected Comment processComment(int pos, int endPos, CommentStyle style) {
126126 comments .put (comment , errorProneComment );
127127 return comment ;
128128 }
129-
130- private char [] getRawCharactersReflectively (int beginIndex , int endIndex ) {
131- Object instance ;
132- try {
133- instance = JavaTokenizer .class .getDeclaredField ("reader" ).get (this );
134- } catch (ReflectiveOperationException e ) {
135- instance = this ;
136- }
137- try {
138- return (char [])
139- instance
140- .getClass ()
141- .getMethod ("getRawCharacters" , int .class , int .class )
142- .invoke (instance , beginIndex , endIndex );
143- } catch (ReflectiveOperationException e ) {
144- throw new LinkageError (e .getMessage (), e );
145- }
146- }
147129 }
148130
149131 // Scanner(ScannerFactory, JavaTokenizer) is package-private
0 commit comments