Skip to content

Compilation error with Java 21 #86

@cushon

Description

@cushon

The definition of SIPHeaderList#removeLast causes a compilation error with Java 21:

public void removeLast() {

The change is due to the introduction of 'Sequenced Collections' in JDK 21 release notes, which added a removeLast method to the collections API that clashes with the definition in SIPHeaderList.

The error could be fixed by changing the definition of SIPHeaderList#removeLast to match the definition in the collections API, or by renaming the method.


Repro:

JAVA_HOME=<path to JDK 21> ant -Djavac.source=8 -Djavac.target=8 -Dsource.encoding=iso-8859-1 runtck
[jain-javac] /usr/local/google/home/cushon/src/jsip/src/gov/nist/javax/sip/header/ims/ServiceRouteList.java:37: error: removeLast() in SIPHeaderList cannot implement removeLast() in List
[jain-javac] public class ServiceRouteList extends SIPHeaderList<ServiceRoute> {
[jain-javac]        ^
[jain-javac]   return type void is not compatible with ServiceRoute
[jain-javac]   where E is a type-variable:
[jain-javac]     E extends Object declared in interface List

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions