Migrating to Architecture 8.6.0

This chapter describes the steps to migrate a VEE Port from Architecture 8.5.0 to Architecture 8.6.0.

As a reminder, refer to the Architecture 8.6.0 Changelog section for the complete list of changes and updates.

Migrate Kernel API Build

Architecture 8.6.0 introduces the final attribute for types declared in Kernel API definition files. The following rules are now enforced and may produce build errors on an existing Kernel API:

The following error may occur at Kernel build:

SOAR-S ERROR :
[M60] - Type 'com.mycompany.MyClass' is declared non-final in 'kernel.api', but its abstract method 'com.mycompany.MyClass.myMethod()void' is not exposed. Non-final types must expose all abstract methods in 'kernel.api'. Either expose 'com.mycompany.MyClass.myMethod()void' or mark 'com.mycompany.MyClass' as final.

A non-final type declared in the Kernel API has an abstract method that is not exposed. In previous Architecture versions, a Feature could extend the Kernel class and override only the exposed methods, leaving the unexposed abstract method unimplemented. If the Kernel then calls that method at runtime, it would result in an AbstractMethodError.

This error now catches the issue at build time.

Two options are available to fix this error:

  • Expose the abstract method: add the missing abstract method to the Kernel API definition file. This keeps the type open for extension by Features and ensures the full contract is visible.

    <method name="com.mycompany.MyClass.myMethod()void"/>
    
  • Mark the type as final: add the final=true attribute to the type declaration in the Kernel API definition file. This prevents Features from extending the type.

    <type name="com.mycompany.MyKernelClass" final="true"/>
    

    This is the preferred option when a type was implicitly exposed for API access only and not intended to be extended by Features. In this case, only a subset of its API can be exposed to reduce the footprint of the Kernel managed code.

    Note

    Make sure the type is not already explicitly exposed as a Kernel API elsewhere (either in the same kernel.api file or in another kernel.api file in the classpath). Otherwise, marking it final=true will have no effect. According to Kernel API definition, once a type is marked as non-final, it remains non-final, even if a subsequent rule (explicitly or implicitly) attempts to mark it as final.

The following error may occur at Feature build:

SOAR-S ERROR :
[M62] - Feature type 'com.mycompany.MyFeatureClass' cannot extend or implement 'com.mycompany.MyKernelClass' because it is declared final by the Kernel in a 'kernel.api' file.

A Feature type extends or implements a Kernel API type that is considered final. This occurs during migration when the type is implicitly exposed in the Kernel API (as a method parameter, return type, or supertype reference), which defaults to final=true as defined by the Kernel API Types specification.

To fix this error, explicitly declare the type in the Kernel API definition file. An explicit declaration without the final attribute defaults to final=false, allowing Features to extend or implement it:

<type name="com.mycompany.MyKernelClass"/>