JDK-8139828 : JShell API: Consistent use of int vs long for positions
  • Type: Bug
  • Component: tools
  • Sub-Component: jshell
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Won't Fix
  • Submitted: 2015-10-19
  • Updated: 2016-11-18
  • Resolved: 2016-11-18
Related Reports
Relates :  
Description
Diag uses long

SourceCodeAnalysis uses int.

---

In SourceCodeAnalysis, the cursor and anchor parameters are int but the methods on Diag operate in terms of longs, shouldn't the cursor/anchor be a long as well?

Comments
Thinking of this: the API broadly uses String, and String's length is bound to int (and String methods take int) (at least currently). So, using long would be troublesome to use in combination with Strings and consistency with Diag does not seem to outweigh the trouble to me. So, I propose won't fix. Please feel free to reopen if you disagree.
18-11-2016

Assigning to Jan for analysis. This is from an old API review. Since this is API, it either needs to be fixed in 9, or left as-is. Diag derives from the corresponding compiler structure and thus should be long. The SourceCodeAnalysis methods are used for suggestions, which I don't see applying to source of more than 2,147,483,647 characters. It is possible that the two would be used together but... I'd be perfectly fine with "Will not fix"
21-08-2016

SourceCodeAnalysis.CompletionInfo was removed in another change, updating bug description accordingly
21-08-2016