Skip to main content
Jump to: navigation, search

Difference between revisions of "Handly/Migration05"

(Created page with "== Migration Guide for Handly 0.5 == Changes that need to be catered for by current adopters as part of migrating to Handly 0.5 from the previous major release (0.4). * '''I...")
 
 
Line 18: Line 18:
 
** Adopted the <tt>h</tt> prefix for the names of non-static API methods: <tt>getName</tt> &rarr; <tt>hName</tt>, <tt>exists</tt> &rarr; <tt>hExists</tt>, etc. ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=491564 bug 491564])
 
** Adopted the <tt>h</tt> prefix for the names of non-static API methods: <tt>getName</tt> &rarr; <tt>hName</tt>, <tt>exists</tt> &rarr; <tt>hExists</tt>, etc. ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=491564 bug 491564])
 
** <tt>getHandleManager</tt> &rarr; <tt>hElementManager</tt>
 
** <tt>getHandleManager</tt> &rarr; <tt>hElementManager</tt>
** Some of the API methods have changed type of parameters and/or return value (<tt>Body</tt> &rarr; <tt>Object</tt>, [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491570 bug 491570]):
+
** The type of a parameter and/or return value has changed in some of the API methods (<tt>Body</tt> &rarr; <tt>Object</tt>, [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491570 bug 491570]):
 
*** <tt>buildStructure('''Body''', Map<IHandle, '''Body'''>, ..)</tt> &rarr; <tt>hBuildStructure('''Object''', Map<IElement, '''Object'''>, ..)</tt>
 
*** <tt>buildStructure('''Body''', Map<IHandle, '''Body'''>, ..)</tt> &rarr; <tt>hBuildStructure('''Object''', Map<IElement, '''Object'''>, ..)</tt>
 
*** <tt>'''Body''' findBody()</tt> &rarr; <tt>'''Object''' hFindBody()</tt>
 
*** <tt>'''Body''' findBody()</tt> &rarr; <tt>'''Object''' hFindBody()</tt>
Line 35: Line 35:
 
** Field <tt>file</tt> is now private and must be accessed through the corresponding accessor method
 
** Field <tt>file</tt> is now private and must be accessed through the corresponding accessor method
 
** Adopted the <tt>h</tt> prefix for the names of non-static API methods: <tt>getFile</tt> &rarr; <tt>hFile</tt>, <tt>getBuffer</tt> &rarr; <tt>hBuffer</tt>, etc. ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=491564 bug 491564])
 
** Adopted the <tt>h</tt> prefix for the names of non-static API methods: <tt>getFile</tt> &rarr; <tt>hFile</tt>, <tt>getBuffer</tt> &rarr; <tt>hBuffer</tt>, etc. ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=491564 bug 491564])
** Some of the API methods have changed type of parameters:
+
** The type of a parameter has changed in some of the API methods:
 
*** <tt>buildStructure(SourceElementBody, Map<IHandle, '''Body'''>, ..)</tt> &rarr; <tt>hBuildStructure(SourceElementBody, Map<IElement, '''Object'''>, ..)</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=491570 bug 491570])
 
*** <tt>buildStructure(SourceElementBody, Map<IHandle, '''Body'''>, ..)</tt> &rarr; <tt>hBuildStructure(SourceElementBody, Map<IElement, '''Object'''>, ..)</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=491570 bug 491570])
 
*** <tt>becomeWorkingCopy('''IWorkingCopyBuffer''', ..)</tt> &rarr; <tt>hBecomeWorkingCopy('''IBuffer''', ..)</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=492179 bug 492179])
 
*** <tt>becomeWorkingCopy('''IWorkingCopyBuffer''', ..)</tt> &rarr; <tt>hBecomeWorkingCopy('''IBuffer''', ..)</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=492179 bug 492179])
Line 48: Line 48:
 
*** <tt>'''public''' toStringMinimal(StringBuilder)</tt> &rarr; <tt>'''protected''' hToStringMinimal(IndentationPolicy, int, StringBuilder)</tt>
 
*** <tt>'''public''' toStringMinimal(StringBuilder)</tt> &rarr; <tt>'''protected''' hToStringMinimal(IndentationPolicy, int, StringBuilder)</tt>
 
* '''HandleDeltaBuilder''' has been renamed to <tt>ElementDifferencer</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=491568 bug 491568], [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491575 bug 491575])
 
* '''HandleDeltaBuilder''' has been renamed to <tt>ElementDifferencer</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=491568 bug 491568], [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491575 bug 491575])
** Some of the API methods have changed type of parameters and/or return value:
+
** The type of a parameter and/or return value has changed in some of the API methods:
 
*** <tt>HandleDeltaBuilder('''IHandle''')</tt> &rarr; <tt>ElementDifferencer('''ElementDelta.Builder''')</tt>
 
*** <tt>HandleDeltaBuilder('''IHandle''')</tt> &rarr; <tt>ElementDifferencer('''ElementDelta.Builder''')</tt>
 
*** <tt>'''HandleDelta''' getDelta()</tt> &rarr; <tt>'''IElementDelta''' getDelta()</tt>
 
*** <tt>'''HandleDelta''' getDelta()</tt> &rarr; <tt>'''IElementDelta''' getDelta()</tt>
Line 57: Line 57:
 
** Methods <tt>internalClose(IHandle)</tt> and <tt>removing(IHandle, '''Body''')</tt> have been effectively replaced with <tt>closeChildren(IElement, Object)</tt> and <tt>removing(IElement, '''Object''')</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=491570 bug 491570])
 
** Methods <tt>internalClose(IHandle)</tt> and <tt>removing(IHandle, '''Body''')</tt> have been effectively replaced with <tt>closeChildren(IElement, Object)</tt> and <tt>removing(IElement, '''Object''')</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=491570 bug 491570])
 
* '''IBodyCache'''
 
* '''IBodyCache'''
** Some of the API methods have changed type of parameters and/or return value (<tt>Body</tt> &rarr; <tt>Object</tt>, [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491570 bug 491570]):
+
** The type of a parameter and/or return value has changed in some of the API methods (<tt>Body</tt> &rarr; <tt>Object</tt>, [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491570 bug 491570]):
 
*** <tt>'''Body''' get(IHandle)</tt> &rarr; <tt>'''Object''' get(IElement)</tt>
 
*** <tt>'''Body''' get(IHandle)</tt> &rarr; <tt>'''Object''' get(IElement)</tt>
 
*** <tt>'''Body''' peek(IHandle)</tt> &rarr; <tt>'''Object''' peek(IElement)</tt>
 
*** <tt>'''Body''' peek(IHandle)</tt> &rarr; <tt>'''Object''' peek(IElement)</tt>
Line 66: Line 66:
 
** New API method: <tt>getChildCount(IElement, Object)</tt>
 
** New API method: <tt>getChildCount(IElement, Object)</tt>
 
* '''WorkingCopyInfo''' has taken over the reconciling related responsibilities from <tt>IWorkingCopyBuffer</tt> and now works with any <tt>IBuffer</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=492179 bug 492179])
 
* '''WorkingCopyInfo''' has taken over the reconciling related responsibilities from <tt>IWorkingCopyBuffer</tt> and now works with any <tt>IBuffer</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=492179 bug 492179])
** Some of the API methods have changed type of parameters and/or return value:
+
** The type of a parameter and/or return value has changed in some of the API methods:
 
*** <tt>WorkingCopyInfo('''IWorkingCopyBuffer''')</tt> &rarr; <tt>WorkingCopyInfo('''IBuffer''')</tt>
 
*** <tt>WorkingCopyInfo('''IWorkingCopyBuffer''')</tt> &rarr; <tt>WorkingCopyInfo('''IBuffer''')</tt>
 
*** <tt>'''IWorkingCopyBuffer''' getBuffer()</tt> &rarr; <tt>'''IBuffer''' getBuffer()</tt>
 
*** <tt>'''IWorkingCopyBuffer''' getBuffer()</tt> &rarr; <tt>'''IBuffer''' getBuffer()</tt>

Latest revision as of 02:03, 19 June 2016

Migration Guide for Handly 0.5

Changes that need to be catered for by current adopters as part of migrating to Handly 0.5 from the previous major release (0.4).

  • IHandle has been replaced with a trio of IElement, IElementExtension, and Elements (bug 491568, bug 491564)
  • IHandle.ToStringStyle has become a top-level class (bug 491647)
  • ISourceElement has been effectively replaced with a trio of ISourceElement, ISourceElementExtension, and Elements (bug 491564)
    • getElementAtgetSourceElementAt
  • ISourceElement.Property has become a top-level class (bug 491649)
  • ISourceFile has been effectively replaced with a trio of ISourceFile, ISourceFileExtension, and Elements (bug 491564)
  • SourceElements has been replaced with Elements (bug 491564)
    • getElementAtgetSourceElementAt2
    • getSourceElementInfogetSourceElementInfo2
  • IHandleDelta has been replaced with a quartet of IElementDelta, IElementDeltaConstants, IElementDeltaExtension, and ElementDeltas (bug 491568, bug 491564)
    • getResourceDeltas and getMarkerDeltas may now return null (bug 488819)
  • Handle has been renamed to Element (bug 491568)
    • Fields parent and name are now private and must be accessed through corresponding accessor methods
    • Adopted the h prefix for the names of non-static API methods: getNamehName, existshExists, etc. (bug 491564)
    • getHandleManagerhElementManager
    • The type of a parameter and/or return value has changed in some of the API methods (BodyObject, bug 491570):
      • buildStructure(Body, Map<IHandle, Body>, ..)hBuildStructure(Object, Map<IElement, Object>, ..)
      • Body findBody()Object hFindBody()
      • Body peekAtBody()Object hPeekAtBody()
      • Body getBody()Object hBody()
      • Body newBody()Object hNewBody()
      • Body toStringBody(..)Object hToStringBody(..)
      • toStringChildren(.., Body)hToStringChildren(.., Object)
      • toStringBody(.., Body, ..)hToStringBody(.., Object, ..)
      • generateAncestorBodies(Map<IHandle, Body>, ..)hGenerateAncestorBodies(Map<IElement, Object>, ..)
      • generateBodies(Body, Map<IHandle, Body>, ..)hGenerateBodies(Object, Map<IElement, Object>, ..)
      • removing(Body)hRemoving(Object)
  • SourceElement
    • Adopted the h prefix for the names of non-static API methods: getElementAthSourceElementAt, etc. (bug 491564)
  • SourceFile
    • Field file is now private and must be accessed through the corresponding accessor method
    • Adopted the h prefix for the names of non-static API methods: getFilehFile, getBufferhBuffer, etc. (bug 491564)
    • The type of a parameter has changed in some of the API methods:
      • buildStructure(SourceElementBody, Map<IHandle, Body>, ..)hBuildStructure(SourceElementBody, Map<IElement, Object>, ..) (bug 491570)
      • becomeWorkingCopy(IWorkingCopyBuffer, ..)hBecomeWorkingCopy(IBuffer, ..) (bug 492179)
  • SourceConstruct
    • Adopted the h prefix for the names of non-static API methods: getOccurrenceCounthOccurrenceCount, etc. (bug 491564)
  • HandleDelta has been renamed to ElementDelta (bug 491568)
    • Adopted the h prefix for the names of non-static API methods: getElementhElement, getKindhKind, etc. (bug 491564)
    • insertXXX methods along with setMarkerDeltas and addResourceDelta have been replaced with a new API, ElementDelta.Builder (bug 491575)
    • New API method: hToString(ToStringStyle)
    • Some of the public toStringXXX methods have become protected:
      • public toStringFullprotected hToStringFull
      • public toStringMinimal(StringBuilder)protected hToStringMinimal(IndentationPolicy, int, StringBuilder)
  • HandleDeltaBuilder has been renamed to ElementDifferencer (bug 491568, bug 491575)
    • The type of a parameter and/or return value has changed in some of the API methods:
      • HandleDeltaBuilder(IHandle)ElementDifferencer(ElementDelta.Builder)
      • HandleDelta getDelta()IElementDelta getDelta()
      • findContentChange(Body, Body, IHandle)findContentChange(Object, Object, IElement) (bug 491570)
    • newDelta method is no longer needed and has been removed
    • New API methods: getElement() and isEmptyDelta()
  • HandleManager has been renamed to ElementManager (bug 491568)
    • Methods internalClose(IHandle) and removing(IHandle, Body) have been effectively replaced with closeChildren(IElement, Object) and removing(IElement, Object) (bug 491570)
  • IBodyCache
    • The type of a parameter and/or return value has changed in some of the API methods (BodyObject, bug 491570):
      • Body get(IHandle)Object get(IElement)
      • Body peek(IHandle)Object peek(IElement)
      • put(IHandle, Body)put(IElement, Object)
      • putAll(Map<IHandle, Body>)putAll(Map<IElement, Object>)
  • ElementCache now extends OverflowingLruCache<IElement, Object> instead of previously extending OverflowingLruChache<IHandle, Body> (bug 491570)
    • ensureSpaceLimit(Body, IHandle)ensureSpaceLimit(Object, IElement)
    • New API method: getChildCount(IElement, Object)
  • WorkingCopyInfo has taken over the reconciling related responsibilities from IWorkingCopyBuffer and now works with any IBuffer (bug 492179)
    • The type of a parameter and/or return value has changed in some of the API methods:
      • WorkingCopyInfo(IWorkingCopyBuffer)WorkingCopyInfo(IBuffer)
      • IWorkingCopyBuffer getBuffer()IBuffer getBuffer()
    • New API methods: onInit(), needsReconciling(), reconcile(..), getWorkingCopy()
    • New API classes: DefaultWorkingCopyInfo, XtextWorkingCopyInfo
  • IWorkingCopyInfoFactory
    • createWorkingCopyInfo(IWorkingCopyBuffer)createWorkingCopyInfo(IBuffer) (bug 429179)
  • IWorkingCopyBuffer and its implementations are no longer needed and have been removed (bug 429179)
  • IWorkingCopyReconciler and its implementations are no longer needed and have been removed (bug 429179)
  • Some of the API elements have been renamed (bug 491568)
    • IContentAdaper#getHandle#adapt
    • HandleLabelProviderElementLabelProvider
    • HandleTreeContentProviderElementTreeContentProvider
    • AbstractWorkingSetUpdater#processHandleDelta#processElementDelta
  • Previously deprecated API elements have been removed (bug 487183)
    • IBuffer#dispose - Replaced with #release
    • IDocumentBuffer - Effectively replaced with IBuffer#getDocument
    • IElementForEditorInputFactory - Replaced with IInputElementProvider
    • ISourceFile#openBuffer - Replaced with #getBuffer
    • TextFileSnapshot(IFile) - Replaced with TextFileSnapshot(IFile, boolean)

Back to the top