forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
When using an @OrderNonDet collection as a String in String concatenation, it should be treated as a @NonDet String because the order of the contents are not known. However, the checker tries to give the String type @OrderNonDet, which generates the warning that @OrderNonDet can't be written on such a type (String). This is shown in this class
import org.checkerframework.checker.determinism.qual.*;
import java.util.*;
public class C {
public void f(@OrderNonDet Set<@Det String> set) {
String s = "literal" + set;
}
}.java:6: error: [ordernondet.on.noncollection.and.nonarray] @OrderNonDet annotation is invalid for non-collections and non-arrays
String s = "literal" + set;
^
Either set's toString return type should be used instead of set's type here for the String, or primitive operations like addition should change @OrderNonDet to @NonDet automatically, instead of issuing an error.
Metadata
Metadata
Assignees
Labels
No labels