graphql-java icon indicating copy to clipboard operation
graphql-java copied to clipboard

MultiSourceLine.getSourceAndLineFromOverallLine() generates a lot of objects

Open andimarek opened this issue 4 years ago • 3 comments

andimarek avatar Feb 17 '21 07:02 andimarek

It has to track three things - a column, and line number and the source name that the text came from

It allocates a SourceAndLine sourceAndLine = new SourceAndLine(); and then a new SourceLocation(line, column, sourceAndLine.getSourceName()); for every AST node - so 2 per AST node

How would you do it otherwise? Move the source and col and int INTO the AST nodes themselves

bbakerman avatar Feb 26 '21 07:02 bbakerman

SourceAndLine should have a very short life span - SourceLocation lives as long as the AST node

bbakerman avatar Feb 26 '21 07:02 bbakerman

Hello, this issue has been inactive for 60 days, so we're marking it as stale. If you would like to continue this discussion, please comment within the next 30 days or we'll close the issue.

github-actions[bot] avatar Dec 27 '23 00:12 github-actions[bot]