Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » IMP » Proposed API change to IMessageHandler
Proposed API change to IMessageHandler [message #578057] Tue, 24 August 2010 14:46 Go to next message
Adam Taylor is currently offline Adam Taylor
Messages: 12
Registered: August 2010
Junior Member
*** Problem: ***

Quick Fix support:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=323532


*** Diagnosis: ***

For some quickfixes additional information is needed (an error code for example) when creating IMarkers and Annotations.


*** Proposed IMP API change: ***

Add the following method:

public interface IMessageHandler{
// ...

void handleSimpleMessage(String msg, int startOffset, int endOffset,
int startCol, int endCol,
int startLine, int endLine, Map<String, Object> attributeMap);

// ...
}

Also since this is a breaking change to this API, I suggest that IMessageHandlerExtension is thrown out and its method be added to IMessageHandler as well
Re: Proposed API change to IMessageHandler [message #578075 is a reply to message #578057] Tue, 24 August 2010 15:11 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4007
Registered: July 2009
Senior Member
Hi Adam

In my experience, functions with many arguments have many arguments
because there is a missing configuration/state object.

If you're breaking the API why not break it properly. Why are seven
attributes privileged while the rest are mapped? Surely severity,
source,... deserve to be privileged too? Why not allow derived
implementations to manage the representation to taste.

Generally at least one of startOffset or startLine/startCol is
redundant, ditto end... Putting them in the interface mandates that the
redundant one is calculated and that redundant state is propagated.

Regards

Ed Willink

On 24/08/2010 19:46, Adam Taylor wrote:
> *** Problem: ***
>
> Quick Fix support:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=323532
>
>
> *** Diagnosis: ***
>
> For some quickfixes additional information is needed (an error code for
> example) when creating IMarkers and Annotations.
>
> *** Proposed IMP API change: ***
>
> Add the following method:
>
> public interface IMessageHandler{
> // ...
>
> void handleSimpleMessage(String msg, int startOffset, int endOffset,
> int startCol, int endCol,
> int startLine, int endLine, Map<String, Object> attributeMap);
>
> // ...
> }
>
> Also since this is a breaking change to this API, I suggest that
> IMessageHandlerExtension is thrown out and its method be added to
> IMessageHandler as well
Previous Topic:Proposed API change to IEditorService
Next Topic:Proposed API change -- Make TextEditorActionContributor public
Goto Forum:
  


Current Time: Mon Jul 28 06:23:50 EDT 2014

Powered by FUDForum. Page generated in 0.01868 seconds