Suppress Warnings

Annotations can be used to suppress some of the warnings.

Annotation

The annotation starts with @SuppressWarnings followed by the warning type to be suppressed between quotes:

	@SuppressWarnings("unused")

In addition, a comma-separated list of warning types can be provided:

	@SuppressWarnings("unused", "unconnected")

This annotation can only be placed above the following elements:

Warning Types

The next paragraphs explain the warning types that can be suppressed and give an example. If you are not sure to which type the warning belongs (if one at all), you can use the quickfix (<CTRL> + <1>) on a warning to give you the correct suppress warnings annotation.

Unused

Any warnings about elements that are not used can be suppressed with the type "unused".

        process class TaskChild extends Task
        ports
            Out
        messages	
            Out!ReserveRoom(Integer)
        variables
            s : String
        init
            Initialise()()
        methods
            Initialise()()
                s := "Ready"

            @SuppressWarnings("unused")
            PerformWrites(Scenario : String)()
                Out!ReserveRoom(1)
		

Unconnected

Any warnings about connectivity issues (e.g., certain message types are not being send or received) can be suppressed with the type "unconnected".

        cluster class ClusterClass()
        ports

        instances
            instance: someClass()
            instance2: someClass()
        channels
            @SuppressWarnings("unconnected")
            { instance.s, instance2.s }
		

Typecheck

Any warnings about incorrect types of variables can be suppressed with the type "typecheck".

        data class Packet extends Object
        variables
        methods
            @SuppressWarnings("typecheck")
            getCounter() : Integer | s : String |
                s := new(Integer);
                return s
		

Return

Any warnings about the location of return in data methods can be suppressed with the type "return".

        data class SomeCounter extends Object
        variables

        methods
            @SuppressWarnings("return")
            getCounter() : Integer | i : Integer |
                i := 1;
                if true then
                    return i
                else
                    i := i + 1
                fi;
                return i