Bug 480945 - HandleDelta overhaul
Summary: HandleDelta overhaul
Status: RESOLVED FIXED
Alias: None
Product: Handly
Classification: Technology
Component: Core (show other bugs)
Version: 0.4   Edit
Hardware: All All
: P3 enhancement
Target Milestone: 0.4   Edit
Assignee: Vladimir Piskarev CLA
QA Contact:
URL:
Whiteboard: breakingchange
Keywords: api
Depends on:
Blocks:
 
Reported: 2015-10-29 02:16 EDT by Vladimir Piskarev CLA
Modified: 2015-10-29 08:20 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Piskarev CLA 2015-10-29 02:16:09 EDT
Currently the HandleDelta class (largely adapted from JDT JavaElementDelta) is way too open. Each of its more than 50 members are either public or protected. The API surface area so large (and, to make matters worse, not very clean) may hinder future evolution of this class. It would be better to err on the 'too restricted' side initially and introduce additional API when/if it is requested by adopters. I suppose it's not too late to do it now.
Comment 1 Vladimir Piskarev CLA 2015-10-29 08:20:17 EDT
Pushed to master:
http://git.eclipse.org/c/handly/org.eclipse.handly.git/commit/?id=03900b83982ef56684b6b6c156fceb9dfedc93db

Breaking changes:
A number of 'toString' methods has changed signatures:
 - public String toDebugString(int)
   -> public void toStringFull(IndentationPolicy, int, StringBuilder)
 - protected void toDebugString(StringBuilder)
   -> public void toStringMinimal(StringBuilder builder)
 - protected boolean toDebugString(StringBuilder, int)
   -> protected boolean toStringFlags(StringBuilder builder)

The following previously public members has reduced visibility:
 - insert(HandleDelta) : private
 - createDeltaTree(HandleDelta) : private
 - addAffectedChild(HandleDelta) : private
 - removeAffectedChild(HandleDelta) : gone
 - clearAffectedChildren() : default
(But overall, the public API remained largely the same)

The following previously protected members remained protected:
 - newDelta(IHandle)
 - needsChildIndex()
Other previously protected members are private now.