Skip to content

Commit b0f9fe1

Browse files
authored
Add @pure to Array.getLength()
1 parent e7c1d84 commit b0f9fe1

File tree

1 file changed

+2
-1
lines changed
  • src/java.base/share/classes/java/lang/reflect

1 file changed

+2
-1
lines changed

src/java.base/share/classes/java/lang/reflect/Array.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.checkerframework.checker.index.qual.LengthOf;
3030
import org.checkerframework.checker.index.qual.NonNegative;
3131
import org.checkerframework.checker.interning.qual.UsesObjectEquals;
32+
import org.checkerframework.dataflow.qual.Pure;
3233
import org.checkerframework.framework.qual.AnnotatedFor;
3334

3435
import jdk.internal.HotSpotIntrinsicCandidate;
@@ -130,7 +131,7 @@ public static Object newInstance(Class<?> componentType, @NonNegative int... dim
130131
* an array
131132
*/
132133
@HotSpotIntrinsicCandidate
133-
public static native @LengthOf({"#1"}) int getLength(Object array)
134+
public static native @Pure @LengthOf({"#1"}) int getLength(Object array)
134135
throws IllegalArgumentException;
135136

136137
/**

0 commit comments

Comments
 (0)