# Migration Guide for Sapphire 9

This documents covers changes that need to be made by Sapphire adopters as part of migrating to Sapphire 9 from a prior release. Only changes from the previous major release are covered.

Table of Contents

1. CountConstraint
2. PossibleTypesService
3. PossibleTypesServiceData
4. StringUtil
5. Type

## CountConstraint

Before | After
--- | ---
    org.eclipse.sapphire.modeling.annotations.CountConstraint
    org.eclipse.sapphire.Length
    @CountConstraint( ... )
    @Length( ... )

## PossibleTypesService

Before | After
--- | ---
    org.eclipse.sapphire.services.PossibleTypesService
    org.eclipse.sapphire.PossibleTypesService
    public class ExamplePossibleTypesService extends PossibleTypesService
    {
        @Override
        protected PossibleTypesServiceData compute()
        {
            return new PossibleTypesServiceData( ... );
        }
    }
    public class ExamplePossibleTypesService extends PossibleTypesService
    {
        @Override
        protected void compute( Set<ElementType> types )
        {
            ...
        }
    }
    SortedSet<ElementType> types = possibleTypesService.types();
    Set<ElementType> types = possibleTypesService.types();
    SortedSet<ElementType> types = possibleTypesService.data();
    Set<ElementType> types = possibleTypesService.data();

## PossibleTypesServiceData

This class has been removed. See PossibleTypesService migration.

## StringUtil

Before | After
--- | ---
    org.eclipse.sapphire.util.StringUtil.UTF8
    java.nio.charset.StandardCharsets.UTF_8

## Type

Before | After
--- | ---
    org.eclipse.sapphire.modeling.annotations.Type
    org.eclipse.sapphire.Type

Copyright (c) 2015 Oracle
Content made available under the terms of Eclipse Public License.