Bug 15334 - ast: Message should have length
Summary: ast: Message should have length
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-06 12:40 EDT by Adam Kiezun CLA
Modified: 2002-05-07 10:38 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2002-05-06 12:40:29 EDT
CompilationUnit::getMessages() returns Messages, which is a useful feature
however, to properly display the problems in the ui i need not only source 
position but also the length. 

Messages are created from IProblems - so it should be not a big problem
alternatively, they could have pointers to IProblems they originated from 
(which would be more flexible - it'd give me error codes).
Comment 1 Adam Kiezun CLA 2002-05-06 12:41:04 EDT
forgot to point directly to Olivier
Comment 2 Jim des Rivieres CLA 2002-05-06 13:00:00 EDT
I recommend adding Messages.length, and not exposing the underlying IProblems.
Comment 3 Olivier Thomann CLA 2002-05-06 13:06:17 EDT
We don't want to expose the fact that a compiler is running underneath. So we will simply add a 
getLength() method on the Message class. We might want to rename the getSourcePosition() to 
getStartPosition() to be more consistent with the ASTNode APIs. getLength() will have a meaning 
only if getSourcePosition() is different from -1.
Is this fine for you?
Comment 4 Adam Kiezun CLA 2002-05-06 13:15:45 EDT
yes, although removing the method altogether and introducing 
IProblem[] CompilationUnit::getProblems() would be much better
(IProblems are light-weight, don't hold on to any internal stuff, 
have more useful info and you have them anyway - and create Messages from them)

(and then you could simply remove that Message class that is merely a subset of 
IProblem)


but, like i said, getLength() on Message will do fine
renaming is ok too - please deprecate first
Comment 5 Olivier Thomann CLA 2002-05-07 10:36:23 EDT
Fixed and released in HEAD.